diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 16d4d2461..3ad2fceb7 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -12,30 +12,73 @@ if (STANDALONE) else (STANDALONE) use_prebuilt_binary(boost) set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) + set(Boost_VERSION "1.52") if (WINDOWS) - set(BOOST_VERSION 1_45) - set(BOOST_OPTIM_SUFFIX mt) - set(BOOST_DEBUG_SUFFIX mt-gd) - + set(Boost_CONTEXT_LIBRARY + optimized libboost_context-mt + debug libboost_context-mt-gd) + set(Boost_FILESYSTEM_LIBRARY + optimized libboost_filesystem-mt + debug libboost_filesystem-mt-gd) set(Boost_PROGRAM_OPTIONS_LIBRARY - optimized libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION} - debug libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION}) + optimized libboost_program_options-mt + debug libboost_program_options-mt-gd) set(Boost_REGEX_LIBRARY - optimized libboost_regex-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION} - debug libboost_regex-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION}) - - elseif (DARWIN) - set(Boost_FILESYSTEM_LIBRARY boost_filesystem) - set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options) - set(Boost_REGEX_LIBRARY boost_regex) - set(Boost_SYSTEM_LIBRARY boost_system) - set(Boost_DATE_TIME_LIBRARY boost_date_time) + optimized libboost_regex-mt + debug libboost_regex-mt-gd) + set(Boost_SIGNALS_LIBRARY + optimized libboost_signals-mt + debug libboost_signals-mt-gd) + set(Boost_SYSTEM_LIBRARY + optimized libboost_system-mt + debug libboost_system-mt-gd) + set(Boost_THREAD_LIBRARY + optimized libboost_thread-mt + debug libboost_thread-mt-gd) elseif (LINUX) - set(Boost_FILESYSTEM_LIBRARY boost_filesystem-mt) - set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) - set(Boost_REGEX_LIBRARY boost_regex-mt) - set(Boost_SYSTEM_LIBRARY boost_system-mt) - set(Boost_DATE_TIME_LIBRARY boost_date_time-mt) + set(Boost_CONTEXT_LIBRARY + optimized boost_context-mt.a + debug boost_context-mt-d.a) + set(Boost_FILESYSTEM_LIBRARY + optimized boost_filesystem-mt.a + debug boost_filesystem-mt-d.a) + set(Boost_PROGRAM_OPTIONS_LIBRARY + optimized boost_program_options-mt.a + debug boost_program_options-mt-d.a) + set(Boost_REGEX_LIBRARY + optimized boost_regex-mt.a + debug boost_regex-mt-d.a) + set(Boost_SIGNALS_LIBRARY + optimized boost_signals-mt.a + debug boost_signals-mt-d.a) + set(Boost_SYSTEM_LIBRARY + optimized boost_system-mt.a + debug boost_system-mt-d.a) + set(Boost_THREAD_LIBRARY + optimized boost_thread-mt.a + debug boost_thread-mt-d.a) + elseif (DARWIN) + set(Boost_CONTEXT_LIBRARY + optimized boost_context-mt + debug boost_context-mt-d) + set(Boost_FILESYSTEM_LIBRARY + optimized boost_filesystem-mt + debug boost_filesystem-mt-d) + set(Boost_PROGRAM_OPTIONS_LIBRARY + optimized boost_program_options-mt + debug boost_program_options-mt-d) + set(Boost_REGEX_LIBRARY + optimized boost_regex-mt + debug boost_regex-mt-d) + set(Boost_SIGNALS_LIBRARY + optimized boost_signals-mt + debug boost_signals-mt-d) + set(Boost_SYSTEM_LIBRARY + optimized boost_system-mt + debug boost_system-mt-d) + set(Boost_THREAD_LIBRARY + optimized boost_thread-mt + debug boost_thread-mt-d) endif (WINDOWS) endif (STANDALONE) diff --git a/indra/cmake/Colladadom.cmake b/indra/cmake/Colladadom.cmake index 1e4a9ed56..9041803d5 100644 --- a/indra/cmake/Colladadom.cmake +++ b/indra/cmake/Colladadom.cmake @@ -28,10 +28,6 @@ else (STANDALONE) set(COLLADADOM_LIBRARIES debug libcollada14dom22-d optimized libcollada14dom22 - debug libboost_filesystem-vc100-mt-gd-1_45.lib - optimized libboost_filesystem-vc100-mt-1_45.lib - debug libboost_system-vc100-mt-gd-1_45.lib - optimized libboost_system-vc100-mt-1_45.lib ) else (WINDOWS) set(COLLADADOM_LIBRARIES diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 3d71566c7..a5bcfafac 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -273,6 +273,7 @@ target_link_libraries( ${EXPAT_LIBRARIES} ${ZLIB_LIBRARIES} ${WINDOWS_LIBRARIES} + ${Boost_CONTEXT_LIBRARY} ${Boost_REGEX_LIBRARY} ${CORESERVICES_LIBRARY} ) diff --git a/indra/llcommon/llcoros.cpp b/indra/llcommon/llcoros.cpp index 0b5829eb7..baaddcaed 100644 --- a/indra/llcommon/llcoros.cpp +++ b/indra/llcommon/llcoros.cpp @@ -39,7 +39,12 @@ #include "llerror.h" #include "stringize.h" -LLCoros::LLCoros() +LLCoros::LLCoros(): + // MAINT-2724: default coroutine stack size too small on Windows. + // Previously we used + // boost::context::guarded_stack_allocator::default_stacksize(); + // empirically this is 64KB on Windows and Linux. Try quadrupling. + mStackSize(256*1024) { // Register our cleanup() method for "mainloop" ticks LLEventPumps::instance().obtain("mainloop").listen( @@ -55,7 +60,7 @@ bool LLCoros::cleanup(const LLSD&) // since last tick? if (mi->second->exited()) { - LL_INFOS("LLCoros") << "LLCoros: cleaning up coroutine " << mi->first << LL_ENDL; + LL_INFOS("LLCoros") << "LLCoros: cleaning up coroutine " << mi->first << LL_ENDL; // The erase() call will invalidate its passed iterator value -- // so increment mi FIRST -- but pass its original value to // erase(). This is what postincrement is all about. @@ -89,7 +94,7 @@ std::string LLCoros::generateDistinctName(const std::string& prefix) const { if (mCoros.find(name) == mCoros.end()) { - LL_INFOS("LLCoros") << "LLCoros: launching coroutine " << name << LL_ENDL; + LL_INFOS("LLCoros") << "LLCoros: launching coroutine " << name << LL_ENDL; return name; } } @@ -115,7 +120,7 @@ std::string LLCoros::getNameByID(const void* self_id) const // passed to us comes. for (CoroMap::const_iterator mi(mCoros.begin()), mend(mCoros.end()); mi != mend; ++mi) { - namespace coro_private = boost::coroutines::detail; + namespace coro_private = boost::dcoroutines::detail; if (static_cast(coro_private::coroutine_accessor::get_impl(const_cast(*mi->second)).get()) == self_id) { @@ -125,6 +130,12 @@ std::string LLCoros::getNameByID(const void* self_id) const return ""; } +void LLCoros::setStackSize(S32 stacksize) +{ + LL_INFOS("LLCoros") << "Setting coroutine stack size to " << stacksize << LL_ENDL; + mStackSize = stacksize; +} + /***************************************************************************** * MUST BE LAST *****************************************************************************/ diff --git a/indra/llcommon/llcoros.h b/indra/llcommon/llcoros.h index d75f28ec1..01ee11da1 100644 --- a/indra/llcommon/llcoros.h +++ b/indra/llcommon/llcoros.h @@ -29,7 +29,7 @@ #if ! defined(LL_LLCOROS_H) #define LL_LLCOROS_H -#include +#include #include "llsingleton.h" #include #include @@ -78,8 +78,8 @@ class LL_COMMON_API LLCoros: public LLSingleton { public: - /// Canonical boost::coroutines::coroutine signature we use - typedef boost::coroutines::coroutine coro; + /// Canonical boost::dcoroutines::coroutine signature we use + typedef boost::dcoroutines::coroutine coro; /// Canonical 'self' type typedef coro::self self; @@ -125,7 +125,7 @@ public: template std::string launch(const std::string& prefix, const CALLABLE& callable) { - return launchImpl(prefix, new coro(callable)); + return launchImpl(prefix, new coro(callable, mStackSize)); } /** @@ -152,6 +152,9 @@ public: /// getName() by self.get_id() std::string getNameByID(const void* self_id) const; + /// for delayed initialization + void setStackSize(S32 stacksize); + private: friend class LLSingleton; LLCoros(); @@ -159,6 +162,7 @@ private: std::string generateDistinctName(const std::string& prefix) const; bool cleanup(const LLSD&); + S32 mStackSize; typedef boost::ptr_map CoroMap; CoroMap mCoros; }; diff --git a/indra/llcommon/lleventcoro.h b/indra/llcommon/lleventcoro.h index 88a5e6ec7..a42af63b6 100644 --- a/indra/llcommon/lleventcoro.h +++ b/indra/llcommon/lleventcoro.h @@ -29,8 +29,8 @@ #if ! defined(LL_LLEVENTCORO_H) #define LL_LLEVENTCORO_H -#include -#include +#include +#include #include #include #include @@ -206,13 +206,13 @@ LLSD postAndWait(SELF& self, const LLSD& event, const LLEventPumpOrPumpName& req const LLEventPumpOrPumpName& replyPump, const LLSD& replyPumpNamePath=LLSD()) { // declare the future - boost::coroutines::future future(self); + boost::dcoroutines::future future(self); // make a callback that will assign a value to the future, and listen on // the specified LLEventPump with that callback std::string listenerName(LLEventDetail::listenerNameForCoro(self)); LLTempBoundListener connection( replyPump.getPump().listen(listenerName, - voidlistener(boost::coroutines::make_callback(future)))); + voidlistener(boost::dcoroutines::make_callback(future)))); // skip the "post" part if requestPump is default-constructed if (requestPump) { @@ -257,7 +257,7 @@ namespace LLEventDetail * This helper is specifically for the two-pump version of waitForEventOn(). * We use a single future object, but we want to listen on two pumps with it. * Since we must still adapt from (the callable constructed by) - * boost::coroutines::make_callback() (void return) to provide an event + * boost::dcoroutines::make_callback() (void return) to provide an event * listener (bool return), we've adapted LLVoidListener for the purpose. The * basic idea is that we construct a distinct instance of WaitForEventOnHelper * -- binding different instance data -- for each of the pumps. Then, when a @@ -331,16 +331,16 @@ LLEventWithID postAndWait2(SELF& self, const LLSD& event, const LLSD& replyPump1NamePath=LLSD()) { // declare the future - boost::coroutines::future future(self); + boost::dcoroutines::future future(self); // either callback will assign a value to this future; listen on // each specified LLEventPump with a callback std::string name(LLEventDetail::listenerNameForCoro(self)); LLTempBoundListener connection0( replyPump0.getPump().listen(name + "a", - LLEventDetail::wfeoh(boost::coroutines::make_callback(future), 0))); + LLEventDetail::wfeoh(boost::dcoroutines::make_callback(future), 0))); LLTempBoundListener connection1( replyPump1.getPump().listen(name + "b", - LLEventDetail::wfeoh(boost::coroutines::make_callback(future), 1))); + LLEventDetail::wfeoh(boost::dcoroutines::make_callback(future), 1))); // skip the "post" part if requestPump is default-constructed if (requestPump) { diff --git a/indra/llmessage/lldatapacker.h b/indra/llmessage/lldatapacker.h index 459d66e17..2b6e57484 100644 --- a/indra/llmessage/lldatapacker.h +++ b/indra/llmessage/lldatapacker.h @@ -201,17 +201,9 @@ inline BOOL LLDataPackerBinaryBuffer::verifyLength(const S32 data_size, const ch { if (mWriteEnabled && (mCurBufferp - mBufferp) > mBufferSize - data_size) { - // Handle invalid packets by throwing an exception and a graceful continue - // llwarns << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << llendl; - // llwarns << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << llendl; - // return FALSE; - - std::stringstream strm; - strm << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << std::endl; - strm << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << std::endl; - throw std::string( strm.str() ); - - // + llwarns << "Buffer overflow in BinaryBuffer length verify, field name " << name << "!" << llendl; + llwarns << "Current pos: " << (int)(mCurBufferp - mBufferp) << " Buffer size: " << mBufferSize << " Data size: " << data_size << llendl; + return FALSE; } return TRUE; diff --git a/indra/llmessage/llmessagetemplate.h b/indra/llmessage/llmessagetemplate.h index 84637885c..a91a8f775 100644 --- a/indra/llmessage/llmessagetemplate.h +++ b/indra/llmessage/llmessagetemplate.h @@ -364,22 +364,7 @@ public: { if (mHandlerFunc) { - - // Handle invalid packets by throwing an exception and a graceful continue - - // mHandlerFunc(msgsystem, mUserData); - - try - { mHandlerFunc(msgsystem, mUserData); - } - catch( std::string &why ) - { - llwarns << why << llendl; - } - - // - return TRUE; } return FALSE; diff --git a/indra/llmessage/lltemplatemessagereader.cpp b/indra/llmessage/lltemplatemessagereader.cpp index 2710d989e..bfce2ea29 100644 --- a/indra/llmessage/lltemplatemessagereader.cpp +++ b/indra/llmessage/lltemplatemessagereader.cpp @@ -511,29 +511,21 @@ BOOL LLTemplateMessageReader::decodeTemplate( void LLTemplateMessageReader::logRanOffEndOfPacket( const LLHost& host, const S32 where, const S32 wanted ) { - // Handle invalid packets by throwing an exception and a graceful continue - // we've run off the end of the packet! - std::stringstream strm; -// llwarns << "Ran off end of packet " << mCurrentRMessageTemplate->mName - strm << "Ran off end of packet " << mCurrentRMessageTemplate->mName + llwarns << "Ran off end of packet " << mCurrentRMessageTemplate->mName // << " with id " << mCurrentRecvPacketID << " from " << host << " trying to read " << wanted << " bytes at position " << where << " going past packet end at " << mReceiveSize -// << llendl; - << std::endl; + << llendl; if(gMessageSystem->mVerboseLog) { -// llinfos << "MSG: -> " << host << "\tREAD PAST END:\t" - strm << "MSG: -> " << host << "\tREAD PAST END:\t" + llinfos << "MSG: -> " << host << "\tREAD PAST END:\t" // << mCurrentRecvPacketID << " " -// << getMessageName() << llendl; - << getMessageName() << std::endl; + << getMessageName() << llendl; } gMessageSystem->callExceptionFunc(MX_RAN_OFF_END_OF_PACKET); - throw std::string( strm.str() ); } static LLFastTimer::DeclareTimer FTM_PROCESS_MESSAGES("Process Messages"); diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 7b890c57a..d8b179ed9 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -56,14 +56,7 @@ LLShaderMgr::LLShaderMgr() { { const std::string dumpdir = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,"shader_dump")+gDirUtilp->getDirDelimiter(); - try - { - boost::filesystem::remove_all(dumpdir); - } - catch(const boost::filesystem::filesystem_error& e) - { - llinfos << "boost::filesystem::remove_all(\""+dumpdir+"\") failed: '" + e.code().message() + "'" << llendl; - } + gDirUtilp->deleteDirAndContents(dumpdir); } } diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index df87d1d34..a93c833ba 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -111,7 +111,7 @@ std::vector LLDir::getFilesInDir(const std::string &dirname) { if (boost::filesystem::is_regular_file(dir_itr->status())) { - v.push_back(dir_itr->path().filename().c_str()); + v.push_back(dir_itr->path().filename().string()); } } } @@ -133,61 +133,74 @@ S32 LLDir::deleteFilesInDir(const std::string &dirname, const std::string &mask) llassert(!"Invalid file mask"); } - LLDirIterator iter(dirname, mask); - while (iter.next(filename)) + try { - fullpath = add(dirname, filename); - - if(LLFile::isdir(fullpath)) + LLDirIterator iter(dirname, mask); + while (iter.next(filename)) { - // skipping directory traversal filenames - count++; - continue; - } + fullpath = add(dirname, filename); - S32 retry_count = 0; - while (retry_count < 5) - { - if (0 != LLFile::remove(fullpath)) + if(LLFile::isdir(fullpath)) { - retry_count++; - result = errno; - llwarns << "Problem removing " << fullpath << " - errorcode: " + // skipping directory traversal filenames + count++; + continue; + } + + S32 retry_count = 0; + while (retry_count < 5) + { + if (0 != LLFile::remove(fullpath)) + { + retry_count++; + result = errno; + llwarns << "Problem removing " << fullpath << " - errorcode: " << result << " attempt " << retry_count << llendl; - if(retry_count >= 5) - { - llwarns << "Failed to remove " << fullpath << llendl ; - return count ; - } + if(retry_count >= 5) + { + llwarns << "Failed to remove " << fullpath << llendl ; + return count ; + } - ms_sleep(100); - } - else - { - if (retry_count) - { - llwarns << "Successfully removed " << fullpath << llendl; + ms_sleep(100); } - break; - } + else + { + if (retry_count) + { + llwarns << "Successfully removed " << fullpath << llendl; + } + break; + } + } + count++; } - count++; } + catch(...) + { + llwarns << "Unable to remove some files from " + dirname << llendl; + } + return count; } U32 LLDir::deleteDirAndContents(const std::string& dir_name) { //Removes the directory and its contents. Returns number of files removed. -#if defined(LL_LINUX) - // Singu TODO: Workaround for boost crashing on linux - deleteFilesInDir(dir_name, "*"); - boost::filesystem::remove(dir_name); - return 1; -#else - return boost::filesystem::remove_all(dir_name); -#endif + // Singu Note: boost::filesystem throws exceptions + S32 res = 0; + + try + { + res = boost::filesystem::remove_all(dir_name); + } + catch(const boost::filesystem::filesystem_error& e) + { + llwarns << "boost::filesystem::remove_all(\"" + dir_name + "\") failed: '" + e.code().message() + "'" << llendl; + } + + return res; } const std::string LLDir::findFile(const std::string &filename, diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 3a5451403..d7dbce179 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1589,6 +1589,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${LLCOMMON_LIBRARIES} ${NDOF_LIBRARY} ${viewer_LIBRARIES} + ${Boost_CONTEXT_LIBRARY} ${Boost_FILESYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_REGEX_LIBRARY} diff --git a/indra/newview/daeexport.cpp b/indra/newview/daeexport.cpp index 1e71bf61b..8c8aa3641 100644 --- a/indra/newview/daeexport.cpp +++ b/indra/newview/daeexport.cpp @@ -26,38 +26,9 @@ #include "daeexport.h" //colladadom includes -#if LL_MSVC -#pragma warning (disable : 4018) -#pragma warning (push) -#pragma warning (disable : 4068) -#pragma warning (disable : 4263) -#pragma warning (disable : 4264) -#endif -#pragma GCC diagnostic ignored "-Woverloaded-virtual" #include "dae.h" -//#include "dom.h" -#include "dom/domAsset.h" -#include "dom/domBind_material.h" #include "dom/domCOLLADA.h" -#include "dom/domConstants.h" -#include "dom/domController.h" -#include "dom/domEffect.h" -#include "dom/domGeometry.h" -#include "dom/domInstance_geometry.h" -#include "dom/domInstance_material.h" -#include "dom/domInstance_node.h" -#include "dom/domInstance_effect.h" -#include "dom/domMaterial.h" #include "dom/domMatrix.h" -#include "dom/domNode.h" -#include "dom/domProfile_COMMON.h" -#include "dom/domRotate.h" -#include "dom/domScale.h" -#include "dom/domTranslate.h" -#include "dom/domVisual_scene.h" -#if LL_MSVC -#pragma warning (pop) -#endif // library includes #include "aifilepicker.h" @@ -358,7 +329,7 @@ public: scroll_container->addChild(panel); panel->setEnabled(FALSE); S32 img_nr = 0; - for (S32 i=0; i < mSaver.mTextures.size(); i++) + for (U32 i=0; i < mSaver.mTextures.size(); i++) { if (mSaver.mTextureNames[i].empty()) continue; @@ -375,7 +346,7 @@ public: void saveTextures() { mTexturesToSave.clear(); - for (S32 i=0; i < mSaver.mTextures.size(); i++) + for (U32 i=0; i < mSaver.mTextures.size(); i++) { if (mSaver.mTextureNames[i].empty()) continue; mTexturesToSave[mSaver.mTextures[i]] = mSaver.mTextureNames[i]; @@ -613,7 +584,7 @@ void DAESaver::addSource(daeElement* mesh, const char* src_id, std::string param src_array->setAttribute("id", llformat("%s-%s", src_id, "array").c_str()); src_array->setAttribute("count", llformat("%d", vals.size()).c_str()); - for (S32 i = 0; i < vals.size(); i++) + for (U32 i = 0; i < vals.size(); i++) { ((domFloat_array*)src_array)->getValue().append(vals[i]); } @@ -870,7 +841,7 @@ bool DAESaver::saveDAE(std::string filename) // Add triangles if (gSavedSettings.getBOOL("DAEExportConsolidateMaterials")) { - for (S32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++) + for (U32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++) { int_list_t faces; getFacesWithMaterial(obj, objMaterials[objMaterial], &faces); @@ -913,7 +884,7 @@ bool DAESaver::saveDAE(std::string filename) // Bind materials daeElement* tq = nodeGeometry->add("bind_material technique_common"); - for (S32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++) + for (U32 objMaterial = 0; objMaterial < objMaterials.size(); objMaterial++) { std::string matName = objMaterials[objMaterial].name; daeElement* instanceMaterial = tq->add("instance_material"); @@ -929,7 +900,7 @@ bool DAESaver::saveDAE(std::string filename) generateEffects(effects); // Materials - for (S32 objMaterial = 0; objMaterial < mAllMaterials.size(); objMaterial++) + for (U32 objMaterial = 0; objMaterial < mAllMaterials.size(); objMaterial++) { daeElement* mat = materials->add("material"); mat->setAttribute("id", (mAllMaterials[objMaterial].name + "-material").c_str()); @@ -955,7 +926,7 @@ DAESaver::MaterialInfo DAESaver::getMaterial(LLTextureEntry* te) { if (gSavedSettings.getBOOL("DAEExportConsolidateMaterials")) { - for (S32 i=0; i < mAllMaterials.size(); i++) + for (U32 i=0; i < mAllMaterials.size(); i++) { if (mAllMaterials[i].matches(te)) { @@ -1010,7 +981,7 @@ void DAESaver::generateEffects(daeElement *effects) // Effects (face color, alpha) bool export_textures = gSavedSettings.getBOOL("DAEExportTextures"); - for (S32 mat = 0; mat < mAllMaterials.size(); mat++) + for (U32 mat = 0; mat < mAllMaterials.size(); mat++) { LLColor4 color = mAllMaterials[mat].color; domEffect* effect = (domEffect*)effects->add("effect"); @@ -1021,7 +992,7 @@ void DAESaver::generateEffects(daeElement *effects) if (export_textures) { LLUUID textID; - S32 i = 0; + U32 i = 0; for (; i < mTextures.size(); i++) { if (mAllMaterials[mat].textureID == mTextures[i]) @@ -1068,7 +1039,7 @@ void DAESaver::generateEffects(daeElement *effects) void DAESaver::generateImagesSection(daeElement* images) { - for (S32 i=0; i < mTextureNames.size(); i++) + for (U32 i=0; i < mTextureNames.size(); i++) { std::string name = mTextureNames[i]; if (name.empty()) continue; diff --git a/indra/newview/lfsimfeaturehandler.cpp b/indra/newview/lfsimfeaturehandler.cpp index 481856e95..e4b6408e2 100644 --- a/indra/newview/lfsimfeaturehandler.cpp +++ b/indra/newview/lfsimfeaturehandler.cpp @@ -26,6 +26,9 @@ LFSimFeatureHandler::LFSimFeatureHandler() : mSupportsExport(false) +, mSayRange(20) +, mShoutRange(100) +, mWhisperRange(10) { if (!gHippoGridManager->getCurrentGrid()->isSecondLife()) // Remove this line if we ever handle SecondLife sim features LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LFSimFeatureHandler::handleRegionChange, this)); @@ -61,15 +64,22 @@ void LFSimFeatureHandler::setSupportedFeatures() { // For definition of OpenSimExtras please see // http://opensimulator.org/wiki/SimulatorFeatures_Extras - mSupportsExport = info["OpenSimExtras"].has("ExportSupported") ? info["OpenSimExtras"]["ExportSupported"].asBoolean() : false; - mMapServerURL = info["OpenSimExtras"].has("map-server-url") ? info["OpenSimExtras"]["map-server-url"].asString() : ""; - mSearchURL = info["OpenSimExtras"].has("search-server-url") ? info["OpenSimExtras"]["search-server-url"].asString() : ""; + const LLSD& extras(info["OpenSimExtras"]); + mSupportsExport = extras.has("ExportSupported") ? extras["ExportSupported"].asBoolean() : false; + mMapServerURL = extras.has("map-server-url") ? extras["map-server-url"].asString() : ""; + mSearchURL = extras.has("search-server-url") ? extras["search-server-url"].asString() : ""; + mSayRange = extras.has("say-range") ? extras["say-range"].asInteger() : 20; + mShoutRange = extras.has("shout-range") ? extras["shout-range"].asInteger() : 100; + mWhisperRange = extras.has("whisper-range") ? extras["whisper-range"].asInteger() : 10; } else // OpenSim specifics are unsupported reset all to default { mSupportsExport = false; mMapServerURL = ""; mSearchURL = ""; + mSayRange = 20; + mShoutRange = 100; + mWhisperRange = 10; } } } @@ -84,3 +94,17 @@ boost::signals2::connection LFSimFeatureHandler::setSearchURLCallback(const boos return mSearchURL.connect(slot); } +boost::signals2::connection LFSimFeatureHandler::setSayRangeCallback(const boost::signals2::signal::slot_type& slot) +{ + return mSayRange.connect(slot); +} + +boost::signals2::connection LFSimFeatureHandler::setShoutRangeCallback(const boost::signals2::signal::slot_type& slot) +{ + return mShoutRange.connect(slot); +} + +boost::signals2::connection LFSimFeatureHandler::setWhisperRangeCallback(const boost::signals2::signal::slot_type& slot) +{ + return mWhisperRange.connect(slot); +} diff --git a/indra/newview/lfsimfeaturehandler.h b/indra/newview/lfsimfeaturehandler.h index 8a8c49640..d26983fcd 100644 --- a/indra/newview/lfsimfeaturehandler.h +++ b/indra/newview/lfsimfeaturehandler.h @@ -59,11 +59,17 @@ public: // Connection setters boost::signals2::connection setSupportsExportCallback(const boost::signals2::signal::slot_type& slot); boost::signals2::connection setSearchURLCallback(const boost::signals2::signal::slot_type& slot); + boost::signals2::connection setSayRangeCallback(const boost::signals2::signal::slot_type& slot); + boost::signals2::connection setShoutRangeCallback(const boost::signals2::signal::slot_type& slot); + boost::signals2::connection setWhisperRangeCallback(const boost::signals2::signal::slot_type& slot); // Accessors bool simSupportsExport() const { return mSupportsExport; } std::string mapServerURL() const { return mMapServerURL; } std::string searchURL() const { return mSearchURL; } + U32 sayRange() const { return mSayRange; } + U32 shoutRange() const { return mShoutRange; } + U32 whisperRange() const { return mWhisperRange; } ExportPolicy exportPolicy() const; private: @@ -71,6 +77,9 @@ private: SignaledType mSupportsExport; std::string mMapServerURL; SignaledType mSearchURL; + SignaledType mSayRange; + SignaledType mShoutRange; + SignaledType mWhisperRange; }; #endif //LFSIMFEATUREHANDLER_H diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp index 1c74ffbe1..af400e766 100644 --- a/indra/newview/llappviewermacosx.cpp +++ b/indra/newview/llappviewermacosx.cpp @@ -57,8 +57,6 @@ namespace int gArgC; char** gArgV; - bool sCrashReporterIsRunning = false; - OSErr AEQuitHandler(const AppleEvent *messagein, AppleEvent *reply, long refIn) { OSErr result = noErr; @@ -262,35 +260,6 @@ bool LLAppViewerMacOSX::restoreErrorTrap() return reset_count == 0; } -#if 0 // Singu Note: Defined but not used -static OSStatus CarbonEventHandler(EventHandlerCallRef inHandlerCallRef, - EventRef inEvent, - void* inUserData) -{ - ProcessSerialNumber psn; - - GetEventParameter(inEvent, - kEventParamProcessID, - typeProcessSerialNumber, - NULL, - sizeof(psn), - NULL, - &psn); - - if( GetEventKind(inEvent) == kEventAppTerminated ) - { - Boolean matching_psn = FALSE; - OSErr os_result = SameProcess(&psn, (ProcessSerialNumber*)inUserData, &matching_psn); - if(os_result >= 0 && matching_psn) - { - sCrashReporterIsRunning = false; - QuitApplicationEventLoop(); - } - } - return noErr; -} -#endif - void LLAppViewerMacOSX::initCrashReporting(bool reportFreeze) { // Singu Note: this is where original code forks crash logger process. diff --git a/indra/newview/llcrashlogger.cpp b/indra/newview/llcrashlogger.cpp index 96abf21a3..ad96ba19c 100644 --- a/indra/newview/llcrashlogger.cpp +++ b/indra/newview/llcrashlogger.cpp @@ -244,7 +244,9 @@ void LLCrashLogger::gatherFiles() mCrashInfo["DebugLog"] = mDebugLog; mFileMap["StatsLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"stats.log"); - + // Singu Note: we have just started again, log has been renamed + mFileMap["SecondLifeLog"] = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "Singularity.old"); + llinfos << "Encoding files..." << llendl; for(std::map::iterator itr = mFileMap.begin(); itr != mFileMap.end(); ++itr) diff --git a/indra/newview/llfloateravatarlist.cpp b/indra/newview/llfloateravatarlist.cpp index 14ef9b2b6..4ce5e7c18 100644 --- a/indra/newview/llfloateravatarlist.cpp +++ b/indra/newview/llfloateravatarlist.cpp @@ -61,6 +61,7 @@ #include "llviewermenu.h" #include "hippogridmanager.h" +#include "lfsimfeaturehandler.h" // [RLVa:KB] #include "rlvhandler.h" @@ -617,7 +618,7 @@ void LLFloaterAvatarList::updateAvatarList() // Announce position F32 dist = (F32)(position - mypos).magVec(); - entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < 20.0, dist < 96.0); + entry->setPosition(position, gAgent.getRegion()->pointInRegionGlobal(position), avatarp, dist < LFSimFeatureHandler::getInstance()->sayRange(), dist < LFSimFeatureHandler::getInstance()->shoutRange()); // Mark as typing if they are typing if (avatarp && avatarp->isTyping()) entry->setActivity(LLAvatarListEntry::ACTIVITY_TYPING); @@ -876,10 +877,10 @@ void LLFloaterAvatarList::refreshAvatarList() } else { - if (distance <= 96.0) + if (distance <= LFSimFeatureHandler::getInstance()->shoutRange()) { snprintf(temp, sizeof(temp), "%.1f", distance); - if (distance > 20.0f) + if (distance > LFSimFeatureHandler::getInstance()->sayRange()) { color = sRadarTextShoutRange; } diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 6c22653a3..50655e7b2 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -32,38 +32,10 @@ #include "llviewerprecompiledheaders.h" -#if LL_MSVC -#pragma warning (disable : 4018) -#pragma warning (push) -#pragma warning (disable : 4068) -#pragma warning (disable : 4263) -#pragma warning (disable : 4264) -#endif -#pragma GCC diagnostic ignored "-Woverloaded-virtual" #include "dae.h" -//#include "dom.h" -#include "dom/domAsset.h" -#include "dom/domBind_material.h" #include "dom/domCOLLADA.h" #include "dom/domConstants.h" -#include "dom/domController.h" -#include "dom/domEffect.h" -#include "dom/domGeometry.h" -#include "dom/domInstance_geometry.h" -#include "dom/domInstance_material.h" -#include "dom/domInstance_node.h" -#include "dom/domInstance_effect.h" -#include "dom/domMaterial.h" -#include "dom/domMatrix.h" -#include "dom/domNode.h" #include "dom/domProfile_COMMON.h" -#include "dom/domRotate.h" -#include "dom/domScale.h" -#include "dom/domTranslate.h" -#include "dom/domVisual_scene.h" -#if LL_MSVC -#pragma warning (pop) -#endif #include "llfloatermodelpreview.h" @@ -268,7 +240,7 @@ bool ll_is_degenerate(const LLVector4a& a, const LLVector4a& b, const LLVector4a bool validate_face(const LLVolumeFace& face) { - for (U32 i = 0; i < face.mNumIndices; ++i) + for (S32 i = 0; i < face.mNumIndices; ++i) { if (face.mIndices[i] >= face.mNumVertices) { @@ -951,7 +923,7 @@ void LLFloaterModelPreview::onPhysicsStageExecute(LLUICtrl* ctrl, void* data) if (sInstance->mModelPreview) { - for (S32 i = 0; i < sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS].size(); ++i) + for (U32 i = 0; i < sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS].size(); ++i) { LLModel* mdl = sInstance->mModelPreview->mModel[LLModel::LOD_PHYSICS][i]; DecompRequest* request = new DecompRequest(stage, mdl); @@ -1501,7 +1473,7 @@ bool LLModelLoader::doLoadModel() //1. Basic validity check on controller U32 controllerCount = (int) db->getElementCount(NULL, "controller"); bool result = false; - for (int i = 0; i < controllerCount; ++i) + for (U32 i = 0; i < controllerCount; ++i) { domController* pController = NULL; db->getElement((daeElement**) &pController, i , NULL, "controller"); @@ -2108,7 +2080,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename) for (S32 lod = 0; lod < LLModel::NUM_LODS; ++lod) { - for (U32 i = 0; i < mesh.size(); ++i) + for (int i = 0; i < mesh.size(); ++i) { std::stringstream str(mesh[i].asString()); LLPointer loaded_model = new LLModel(volume_params, (F32) lod); @@ -2143,7 +2115,7 @@ bool LLModelLoader::loadFromSLM(const std::string& filename) LLSD& instance = data["instance"]; - for (U32 i = 0; i < instance.size(); ++i) + for (int i = 0; i < instance.size(); ++i) { //deserialize instance list instance_list.push_back(LLModelInstance(instance[i])); @@ -2873,7 +2845,7 @@ void LLModelLoader::processElement(daeElement* element, bool& badElement) std::map LLModelLoader::getMaterials(LLModel* model, domInstance_geometry* instance_geo) { std::map materials; - for (int i = 0; i < model->mMaterialList.size(); i++) + for (U32 i = 0; i < model->mMaterialList.size(); i++) { LLImportMaterial import_material; @@ -2885,7 +2857,7 @@ std::map LLModelLoader::getMaterials(LLModel* mod if (technique) { daeTArray< daeSmartRef > inst_materials = technique->getChildrenByType(); - for (int j = 0; j < inst_materials.getCount(); j++) + for (U32 j = 0; j < inst_materials.getCount(); j++) { std::string symbol(inst_materials[j]->getSymbol()); @@ -2939,7 +2911,7 @@ LLImportMaterial LLModelLoader::profileToMaterial(domProfile_COMMON* material) if (texture) { domCommon_newparam_type_Array newparams = material->getNewparam_array(); - for (S32 i = 0; i < newparams.getCount(); i++) + for (U32 i = 0; i < newparams.getCount(); i++) { domFx_surface_common* surface = newparams[i]->getSurface(); if (surface) @@ -3331,7 +3303,7 @@ void LLModelPreview::rebuildUploadData() base_model->mMetric = metric; } - S32 idx = 0; + U32 idx = 0; for (idx = 0; idx < mBaseModel.size(); ++idx) { //find reference instance for this model if (mBaseModel[idx] == base_model) @@ -3651,7 +3623,7 @@ void LLModelPreview::loadModelCallback(S32 lod) list_iter->mModel = list_iter->mLOD[lod]; //add current model to current LoD's model list (LLModel::mLocalID makes a good vector index) - S32 idx = list_iter->mModel->mLocalID; + U32 idx = list_iter->mModel->mLocalID; if (mModel[lod].size() <= idx) { //stretch model list to fit model at given index @@ -5123,7 +5095,7 @@ BOOL LLModelPreview::render() if (textures) { - int materialCnt = instance.mModel->mMaterialList.size(); + U32 materialCnt = instance.mModel->mMaterialList.size(); if (i < materialCnt) { const std::string& binding = instance.mModel->mMaterialList[i]; @@ -5333,7 +5305,7 @@ BOOL LLModelPreview::render() LLStrider idx; buffer->getIndexStrider(idx, 0); - for (U32 i = 0; i < buffer->getNumIndices(); i += 3) + for (S32 i = 0; i < buffer->getNumIndices(); i += 3) { LLVector4a v1; v1.setMul(pos[*idx++], scale); LLVector4a v2; v2.setMul(pos[*idx++], scale); @@ -5417,7 +5389,7 @@ BOOL LLModelPreview::render() } } - for (U32 j = 0; j < buffer->getNumVerts(); ++j) + for (S32 j = 0; j < buffer->getNumVerts(); ++j) { LLMatrix4 final_mat; final_mat.mMatrix[0][0] = final_mat.mMatrix[1][1] = final_mat.mMatrix[2][2] = final_mat.mMatrix[3][3] = 0.f; diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index e77ca7a0b..162d036af 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -40,6 +40,7 @@ #include "lllocalcliprect.h" #include "llrender.h" +#include "lfsimfeaturehandler.h" #include "llfloateravatarlist.h" #include "llagent.h" @@ -503,11 +504,11 @@ void LLNetMap::draw() static LLUICachedControl chat_ring("MiniMapChatRing"); static LLUICachedControl shout_ring("MiniMapShoutRing"); if(whisper_ring) - drawRing(LLWorld::getInstance()->getWhisperDistance(), pos_map, map_whisper_ring_color); + drawRing(LFSimFeatureHandler::getInstance()->whisperRange(), pos_map, map_whisper_ring_color); if(chat_ring) - drawRing(LLWorld::getInstance()->getSayDistance(), pos_map, map_chat_ring_color); + drawRing(LFSimFeatureHandler::getInstance()->sayRange(), pos_map, map_chat_ring_color); if(shout_ring) - drawRing(LLWorld::getInstance()->getShoutDistance(), pos_map, map_shout_ring_color); + drawRing(LFSimFeatureHandler::getInstance()->shoutRange(), pos_map, map_shout_ring_color); // Draw frustum // Aurora Sim diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 4a1f578a1..84ac30bf8 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -94,12 +94,6 @@ const F32 LLWorld::mScale = 1.f; F32 LLWorld::mWidthInMeters = mWidth * mScale; // Aurora Sim -//TODO: This will use chat ranges -// according to opensim settings -const F32 LLWorld::mWhisperDistance = 10; -const F32 LLWorld::mSayDistance = 20; -const F32 LLWorld::mShoutDistance = 100; - // // Functions // diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h index 3545f0636..291159540 100644 --- a/indra/newview/llworld.h +++ b/indra/newview/llworld.h @@ -125,10 +125,6 @@ public: F32 getRegionMinHeight() const { return -mWidthInMeters; } F32 getRegionMaxHeight() const { return MAX_OBJECT_Z; } - F32 getWhisperDistance() const { return mWhisperDistance; } - F32 getSayDistance() const { return mSayDistance; } - F32 getShoutDistance() const { return mShoutDistance; } - void updateRegions(F32 max_update_time); void updateVisibilities(); void updateParticles(); @@ -202,10 +198,6 @@ private: static F32 mWidthInMeters; // Aurora Sim - static const F32 mWhisperDistance; - static const F32 mSayDistance; - static const F32 mShoutDistance; - F32 mLandFarClip; // Far clip distance for land. LLPatchVertexArray mLandPatch; S32 mLastPacketsIn; diff --git a/indra/newview/skins/default/xui/en-us/panel_login.xml b/indra/newview/skins/default/xui/en-us/panel_login.xml index ae63849a1..cc2257ab7 100644 --- a/indra/newview/skins/default/xui/en-us/panel_login.xml +++ b/indra/newview/skins/default/xui/en-us/panel_login.xml @@ -54,7 +54,7 @@ Grid: + left="0" mouse_opaque="true" width="120" name="grids_combo" tool_tip="Input the name/nick for a known grid or any login uri, or pick one from the list"/>