From d78e22887482056e9e29cccf2b7a8a675035d040 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Sat, 6 Sep 2008 18:27:37 -0500 Subject: Second Life viewer sources 1.21.1-RC --- linden/indra/llcommon/llapr.cpp | 22 ++++++++++++++++++++++ linden/indra/llcommon/llapr.h | 14 ++++++++++++++ linden/indra/llcommon/llthread.cpp | 12 ++++++------ linden/indra/llcommon/llversionviewer.h | 2 +- linden/indra/llvfs/lldir_win32.cpp | 10 ++++------ linden/indra/llwindow/llwindow.cpp | 5 +++++ linden/indra/llwindow/llwindow.h | 1 + linden/indra/llwindow/llwindowwin32.cpp | 4 +++- linden/indra/lscript/lscript_compile/indra.l | 2 +- linden/indra/newview/app_settings/settings.xml | 2 +- linden/indra/newview/lltexturecache.cpp | 12 ++++++++++++ linden/indra/newview/lltexturecache.h | 3 +++ linden/indra/newview/llviewerstats.cpp | 1 - linden/indra/newview/llviewerwindow.cpp | 5 +++++ linden/indra/newview/llviewerwindow.h | 2 +- linden/indra/newview/llvoavatar.cpp | 8 -------- .../newview/skins/default/xui/en-us/alerts.xml | 4 ++-- .../newview/skins/default/xui/en-us/floater_im.xml | 2 +- .../xui/en-us/floater_instant_message_group.xml | 2 +- .../default/xui/en-us/panel_preferences_im.xml | 12 ++++++------ .../default/xui/en-us/panel_speaker_controls.xml | 4 ++-- .../skins/default/xui/en-us/role_actions.xml | 8 ++++---- 22 files changed, 95 insertions(+), 42 deletions(-) (limited to 'linden') diff --git a/linden/indra/llcommon/llapr.cpp b/linden/indra/llcommon/llapr.cpp index 73e715a..17c753d 100644 --- a/linden/indra/llcommon/llapr.cpp +++ b/linden/indra/llcommon/llapr.cpp @@ -73,6 +73,28 @@ void ll_cleanup_apr() } // +//LLAPRPool +// +LLAPRPool::LLAPRPool(apr_pool_t *parent, apr_size_t size) +{ + mStatus = apr_pool_create(&mPool, parent); + + if(size > 0) //size is the number of blocks (which is usually 4K), NOT bytes. + { + apr_allocator_t *allocator = apr_pool_allocator_get(mPool); + if (allocator) + { + apr_allocator_max_free_set(allocator, size) ; + } + } +} + +LLAPRPool::~LLAPRPool() +{ + apr_pool_destroy(mPool) ; +} + +// // LLScopedLock // LLScopedLock::LLScopedLock(apr_thread_mutex_t* mutex) : mMutex(mutex) diff --git a/linden/indra/llcommon/llapr.h b/linden/indra/llcommon/llapr.h index 323dcb2..1b91d37 100644 --- a/linden/indra/llcommon/llapr.h +++ b/linden/indra/llcommon/llapr.h @@ -60,6 +60,20 @@ void ll_init_apr(); */ void ll_cleanup_apr(); +class LLAPRPool +{ +public: + LLAPRPool(apr_pool_t *parent = NULL, apr_size_t size = 0) ; + ~LLAPRPool() ; + + apr_pool_t* getAPRPool() {return mPool ; } + apr_status_t getStatus() {return mStatus ; } + +private: + apr_pool_t* mPool ; + apr_status_t mStatus ; +} ; + /** * @class LLScopedLock * @brief Small class to help lock and unlock mutexes. diff --git a/linden/indra/llcommon/llthread.cpp b/linden/indra/llcommon/llthread.cpp index e07170b..822adc2 100644 --- a/linden/indra/llcommon/llthread.cpp +++ b/linden/indra/llcommon/llthread.cpp @@ -266,12 +266,12 @@ void LLThread::wakeLocked() LLMutex::LLMutex(apr_pool_t *poolp) : mAPRMutexp(NULL) { - if (poolp) - { - mIsLocalPool = FALSE; - mAPRPoolp = poolp; - } - else + //if (poolp) + //{ + // mIsLocalPool = FALSE; + // mAPRPoolp = poolp; + //} + //else { mIsLocalPool = TRUE; apr_pool_create(&mAPRPoolp, NULL); // Create a subpool for this thread diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h index 4820f68..cd7b304 100644 --- a/linden/indra/llcommon/llversionviewer.h +++ b/linden/indra/llcommon/llversionviewer.h @@ -34,7 +34,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 21; -const S32 LL_VERSION_PATCH = 0; +const S32 LL_VERSION_PATCH = 1; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Release"; diff --git a/linden/indra/llvfs/lldir_win32.cpp b/linden/indra/llvfs/lldir_win32.cpp index 99d5e18..9cb9721 100644 --- a/linden/indra/llvfs/lldir_win32.cpp +++ b/linden/indra/llvfs/lldir_win32.cpp @@ -117,15 +117,13 @@ LLDir_Win32::LLDir_Win32() mExecutableDir = utf16str_to_utf8str(llutf16string(w_str)); #endif - mAppRODataDir = getCurPath(); - // *FIX:Mani - The following is the old way we did things. I'm keeping this around - // in case there is some really good reason to make mAppRODataDir == mExecutableDir - /* - if (strstr(mExecutableDir.c_str(), "indra\\newview")) + // When running in a dev tree, app_settings is under indra/newview/ + // but in production it is under Program Files/SecondLife/ + // Attempt to detect which one we're using. JC + if (mExecutableDir.find("indra") != std::string::npos) mAppRODataDir = getCurPath(); else mAppRODataDir = mExecutableDir; - */ } LLDir_Win32::~LLDir_Win32() diff --git a/linden/indra/llwindow/llwindow.cpp b/linden/indra/llwindow/llwindow.cpp index 890143d..f4ee8cc 100644 --- a/linden/indra/llwindow/llwindow.cpp +++ b/linden/indra/llwindow/llwindow.cpp @@ -203,6 +203,11 @@ BOOL LLWindowCallbacks::handleDeviceChange(LLWindow *window) return FALSE; } +void LLWindowCallbacks::handlePingWatchdog(LLWindow *window, const char * msg) +{ + +} + S32 OSMessageBox(const std::string& text, const std::string& caption, U32 type) { // Properly hide the splash screen when displaying the message box diff --git a/linden/indra/llwindow/llwindow.h b/linden/indra/llwindow/llwindow.h index 82e95a8..cee83b9 100644 --- a/linden/indra/llwindow/llwindow.h +++ b/linden/indra/llwindow/llwindow.h @@ -119,6 +119,7 @@ public: virtual void handleDataCopy(LLWindow *window, S32 data_type, void *data); virtual BOOL handleTimerEvent(LLWindow *window); virtual BOOL handleDeviceChange(LLWindow *window); + virtual void handlePingWatchdog(LLWindow *window, const char * msg); }; // Refer to llwindow_test in test/common/llwindow for usage example diff --git a/linden/indra/llwindow/llwindowwin32.cpp b/linden/indra/llwindow/llwindowwin32.cpp index 047fa31..3729a71 100644 --- a/linden/indra/llwindow/llwindowwin32.cpp +++ b/linden/indra/llwindow/llwindowwin32.cpp @@ -1575,7 +1575,9 @@ void LLWindowWin32::gatherInput() while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) && msg_count < MAX_MESSAGE_PER_UPDATE) { + mCallbacks->handlePingWatchdog(this, "Main:TranslateGatherInput"); TranslateMessage(&msg); + mCallbacks->handlePingWatchdog(this, "Main:DispatchGatherInput"); DispatchMessage(&msg); msg_count++; @@ -1602,7 +1604,7 @@ void LLWindowWin32::gatherInput() } } */ - + mCallbacks->handlePingWatchdog(this, "Main:AsyncCallbackGatherInput"); // For async host by name support. Really hacky. if (gAsyncMsgCallback && (LL_WM_HOST_RESOLVED == msg.message)) { diff --git a/linden/indra/lscript/lscript_compile/indra.l b/linden/indra/lscript/lscript_compile/indra.l index 49ed6fc..4cfe199 100644 --- a/linden/indra/lscript/lscript_compile/indra.l +++ b/linden/indra/lscript/lscript_compile/indra.l @@ -752,8 +752,8 @@ BOOL lscript_compile(const char* src_filename, const char* dst_filename, #ifdef EMERGENCY_DEBUG_PRINTOUTS fclose(compfile); #endif - fclose(yyout); } + fclose(yyout); fclose(yyin); } diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index c181ce8..f2653cd 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -5814,7 +5814,7 @@ Type Boolean Value - 1 + 0 RenderDebugPipeline diff --git a/linden/indra/newview/lltexturecache.cpp b/linden/indra/newview/lltexturecache.cpp index da23710..c9ad5a3 100644 --- a/linden/indra/newview/lltexturecache.cpp +++ b/linden/indra/newview/lltexturecache.cpp @@ -792,6 +792,14 @@ bool LLTextureCacheRemoteWorker::doWrite() //virtual bool LLTextureCacheWorker::doWork(S32 param) { + //allocate a new local apr_pool + LLAPRPool pool ; + + //save the current mFileAPRPool to avoid breaking anything. + apr_pool_t* old_pool = mCache->getFileAPRPool() ; + //make mFileAPRPool to point to the local one + mCache->setFileAPRPool(pool.getAPRPool()) ; + bool res = false; if (param == 0) // read { @@ -805,6 +813,10 @@ bool LLTextureCacheWorker::doWork(S32 param) { llassert_always(0); } + + //set mFileAPRPool back, the local one will be released automatically. + mCache->setFileAPRPool(old_pool) ; + return res; } diff --git a/linden/indra/newview/lltexturecache.h b/linden/indra/newview/lltexturecache.h index 14f44ba..4bac15c 100644 --- a/linden/indra/newview/lltexturecache.h +++ b/linden/indra/newview/lltexturecache.h @@ -114,6 +114,9 @@ protected: std::string getTextureFileName(const LLUUID& id); void addCompleted(Responder* responder, bool success); +protected: + void setFileAPRPool(apr_pool_t* pool) { mFileAPRPool = pool ; } + private: void setDirNames(ELLPath location); void readHeaderCache(apr_pool_t* poolp = NULL); diff --git a/linden/indra/newview/llviewerstats.cpp b/linden/indra/newview/llviewerstats.cpp index 32d7f63..9034634 100644 --- a/linden/indra/newview/llviewerstats.cpp +++ b/linden/indra/newview/llviewerstats.cpp @@ -757,7 +757,6 @@ void send_stats() S32 window_height = gViewerWindow->getWindowDisplayHeight(); S32 window_size = (window_width * window_height) / 1024; misc["string_1"] = llformat("%d", window_size); - misc["string_1"] = llformat("%.dx%d", window_width, window_height); // misc["string_2"] = // misc["int_1"] = LLFloaterDirectory::sOldSearchCount; // Steve: 1.18.6 // misc["int_2"] = LLFloaterDirectory::sNewSearchCount; // Steve: 1.18.6 diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 1f5dd44..bd40796 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp @@ -1370,6 +1370,11 @@ BOOL LLViewerWindow::handleDeviceChange(LLWindow *window) return FALSE; } +void LLViewerWindow::handlePingWatchdog(LLWindow *window, const char * msg) +{ + LLAppViewer::instance()->pingMainloopTimeout(msg); +} + // // Classes // diff --git a/linden/indra/newview/llviewerwindow.h b/linden/indra/newview/llviewerwindow.h index 683d331..9262e61 100644 --- a/linden/indra/newview/llviewerwindow.h +++ b/linden/indra/newview/llviewerwindow.h @@ -174,7 +174,7 @@ public: /*virtual*/ void handleDataCopy(LLWindow *window, S32 data_type, void *data); /*virtual*/ BOOL handleTimerEvent(LLWindow *window); /*virtual*/ BOOL handleDeviceChange(LLWindow *window); - + /*virtual*/ void handlePingWatchdog(LLWindow *window, const char * msg); // diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index d6c9e2f..a9ecf9d 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -6269,10 +6269,6 @@ void LLVOAvatar::sitOnObject(LLViewerObject *sit_object) mDrawable->mXform.setPosition(rel_pos); mDrawable->mXform.setRotation(mDrawable->getWorldRotation() * inv_obj_rot); - //in case the viewerobject is not updated in time - mDrawable->getVObj()->setPosition(sit_object->getWorldPosition()) ; - mDrawable->getVObj()->setRotation(sit_object->getWorldRotation()) ; - gPipeline.markMoved(mDrawable, TRUE); mIsSitting = TRUE; mRoot.getXform()->setParent(&sit_object->mDrawable->mXform); // LLVOAvatar::sitOnObject @@ -6333,10 +6329,6 @@ void LLVOAvatar::getOffObject() mDrawable->mXform.setPosition(cur_position_world); mDrawable->mXform.setRotation(cur_rotation_world); - //in case the viewerobject is not updated from sim in time - mDrawable->getVObj()->setPosition(cur_position_world); - mDrawable->getVObj()->setRotation(cur_rotation_world); - gPipeline.markMoved(mDrawable, TRUE); mIsSitting = FALSE; diff --git a/linden/indra/newview/skins/default/xui/en-us/alerts.xml b/linden/indra/newview/skins/default/xui/en-us/alerts.xml index 8b17754..57736b4 100644 --- a/linden/indra/newview/skins/default/xui/en-us/alerts.xml +++ b/linden/indra/newview/skins/default/xui/en-us/alerts.xml @@ -1041,7 +1041,7 @@ MINSPECS Do you wish to visit [_URL] for more information? - Ignore unsupported hardware + When detecting unsupported hardware