summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp54
1 files changed, 17 insertions, 37 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 9317f5fd4e..32ee632838 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -100,7 +100,6 @@
#include "llscenemonitor.h"
#include "llavatarrenderinfoaccountant.h"
#include "lllocalbitmaps.h"
-#include "llskinningutil.h"
// Linden library includes
#include "llavatarnamecache.h"
@@ -773,9 +772,7 @@ bool LLAppViewer::init()
// initialize LLWearableType translation bridge.
// Memory will be cleaned up in ::cleanupClass()
- LLTranslationBridge::ptr_t trans = std::make_shared<LLUITranslationBridge>();
- LLWearableType::initClass(trans);
- LLSettingsType::initClass(trans);
+ LLWearableType::initParamSingleton(new LLUITranslationBridge());
// initialize SSE options
LLVector4a::initClass();
@@ -799,9 +796,6 @@ bool LLAppViewer::init()
LL_INFOS("InitInfo") << "Configuration initialized." << LL_ENDL ;
- // initialize skinning util
- LLSkinningUtil::initClass();
-
//set the max heap size.
initMaxHeapSize() ;
LLCoros::instance().setStackSize(gSavedSettings.getS32("CoroutineStackSize"));
@@ -849,11 +843,10 @@ bool LLAppViewer::init()
settings_map["floater"] = &gSavedSettings; // *TODO: New settings file
settings_map["account"] = &gSavedPerAccountSettings;
- LLUI::initClass(settings_map,
+ LLUI::initParamSingleton(settings_map,
LLUIImageList::getInstance(),
ui_audio_callback,
- deferred_ui_audio_callback,
- &LLUI::getScaleFactor());
+ deferred_ui_audio_callback);
LL_INFOS("InitInfo") << "UI initialized." << LL_ENDL ;
// NOW LLUI::getLanguage() should work. gDirUtilp must know the language
@@ -897,8 +890,6 @@ bool LLAppViewer::init()
// LLKeyboard relies on LLUI to know what some accelerator keys are called.
LLKeyboard::setStringTranslatorFunc( LLTrans::getKeyboardString );
- LLWeb::initClass(); // do this after LLUI
-
// Provide the text fields with callbacks for opening Urls
LLUrlAction::setOpenURLCallback(boost::bind(&LLWeb::loadURL, _1, LLStringUtil::null, LLStringUtil::null));
LLUrlAction::setOpenURLInternalCallback(boost::bind(&LLWeb::loadURLInternal, _1, LLStringUtil::null, LLStringUtil::null, false));
@@ -906,7 +897,7 @@ bool LLAppViewer::init()
LLUrlAction::setExecuteSLURLCallback(&LLURLDispatcher::dispatchFromTextEditor);
// Let code in llui access the viewer help floater
- LLUI::sHelpImpl = LLViewerHelp::getInstance();
+ LLUI::getInstance()->mHelpImpl = LLViewerHelp::getInstance();
LL_INFOS("InitInfo") << "UI initialization is done." << LL_ENDL ;
@@ -1211,9 +1202,6 @@ bool LLAppViewer::init()
}
#endif
- LLViewerMedia::initClass();
- LL_INFOS("InitInfo") << "Viewer media initialized." << LL_ENDL ;
-
LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match;
//EXT-7013 - On windows for some locale (Japanese) standard
@@ -1253,7 +1241,7 @@ bool LLAppViewer::init()
// Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated.
LLVoiceChannel::initClass();
- LLVoiceClient::getInstance()->init(gServicePump);
+ LLVoiceClient::initParamSingleton(gServicePump);
LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLFloaterIMContainer::onCurrentChannelChanged, _1), true);
joystick = LLViewerJoystick::getInstance();
@@ -1754,8 +1742,6 @@ bool LLAppViewer::cleanup()
gTransferManager.cleanup();
#endif
- SUBSYSTEM_CLEANUP(LLLocalBitmapMgr);
-
// Note: this is where gWorldMap used to be deleted.
// Note: this is where gHUDManager used to be deleted.
@@ -1898,12 +1884,9 @@ bool LLAppViewer::cleanup()
//end_messaging_system();
- SUBSYSTEM_CLEANUP(LLFollowCamMgr);
- //SUBSYSTEM_CLEANUP(LLVolumeMgr);
LLPrimitive::cleanupVolumeManager();
SUBSYSTEM_CLEANUP(LLWorldMapView);
SUBSYSTEM_CLEANUP(LLFolderViewItem);
- SUBSYSTEM_CLEANUP(LLUI);
//
// Shut down the VFS's AFTER the decode manager cleans up (since it cleans up vfiles).
@@ -2053,13 +2036,10 @@ bool LLAppViewer::cleanup()
//Note:
//SUBSYSTEM_CLEANUP(LLViewerMedia) has to be put before gTextureList.shutdown()
//because some new image might be generated during cleaning up media. --bao
- SUBSYSTEM_CLEANUP(LLViewerMedia);
- SUBSYSTEM_CLEANUP(LLViewerParcelMedia);
gTextureList.shutdown(); // shutdown again in case a callback added something
LLUIImageList::getInstance()->cleanUp();
// This should eventually be done in LLAppViewer
- SUBSYSTEM_CLEANUP(LLImage);
SUBSYSTEM_CLEANUP(LLVFSThread);
SUBSYSTEM_CLEANUP(LLLFSThread);
@@ -2107,8 +2087,6 @@ bool LLAppViewer::cleanup()
SUBSYSTEM_CLEANUP(LLProxy);
LLCore::LLHttp::cleanup();
- SUBSYSTEM_CLEANUP(LLWearableType);
-
LLMainLoopRepeater::instance().stop();
ll_close_fail_log();
@@ -2167,7 +2145,7 @@ bool LLAppViewer::initThreads()
{
static const bool enable_threads = true;
- LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getS32("TextureReverseByteRange"));
+ LLImage::initParamSingleton(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getS32("TextureReverseByteRange"));
LLVFSThread::initClass(enable_threads && false);
LLLFSThread::initClass(enable_threads && false);
@@ -3051,7 +3029,7 @@ bool LLAppViewer::initWindow()
gViewerWindow->getWindow()->maximize();
}
- LLUI::sWindow = gViewerWindow->getWindow();
+ LLUI::getInstance()->mWindow = gViewerWindow->getWindow();
// Show watch cursor
gViewerWindow->setCursor(UI_CURSOR_WAIT);
@@ -4150,7 +4128,7 @@ bool LLAppViewer::initCache()
mPurgeCache = false;
BOOL read_only = mSecondInstance ? TRUE : FALSE;
LLAppViewer::getTextureCache()->setReadOnly(read_only) ;
- LLVOCache::getInstance()->setReadOnly(read_only);
+ LLVOCache::initParamSingleton(read_only);
bool texture_cache_mismatch = false;
if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion())
@@ -4222,7 +4200,8 @@ bool LLAppViewer::initCache()
S64 extra = LLAppViewer::getTextureCache()->initCache(LL_PATH_CACHE, texture_cache_size, texture_cache_mismatch);
texture_cache_size -= extra;
- LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion()) ;
+
+ LLVOCache::getInstance()->initCache(LL_PATH_CACHE, gSavedSettings.getU32("CacheNumberOfRegionsForObjects"), getObjectCacheVersion());
LLSplashScreen::update(LLTrans::getString("StartupInitializingVFS"));
@@ -4552,7 +4531,7 @@ void LLAppViewer::loadNameCache()
llifstream name_cache_stream(filename.c_str());
if(name_cache_stream.is_open())
{
- if ( ! LLAvatarNameCache::importFile(name_cache_stream))
+ if ( ! LLAvatarNameCache::getInstance()->importFile(name_cache_stream))
{
LL_WARNS("AppInit") << "removing invalid '" << filename << "'" << LL_ENDL;
name_cache_stream.close();
@@ -4579,7 +4558,7 @@ void LLAppViewer::saveNameCache()
llofstream name_cache_stream(filename.c_str());
if(name_cache_stream.is_open())
{
- LLAvatarNameCache::exportFile(name_cache_stream);
+ LLAvatarNameCache::getInstance()->exportFile(name_cache_stream);
}
// real names cache
@@ -5185,7 +5164,8 @@ void LLAppViewer::idleNameCache()
// granted to neighbor regions before the main agent gets there. Can't
// do it in the move-into-region code because cap not guaranteed to be
// granted yet, for example on teleport.
- bool had_capability = LLAvatarNameCache::hasNameLookupURL();
+ LLAvatarNameCache *name_cache = LLAvatarNameCache::getInstance();
+ bool had_capability = LLAvatarNameCache::getInstance()->hasNameLookupURL();
std::string name_lookup_url;
name_lookup_url.reserve(128); // avoid a memory allocation below
name_lookup_url = region->getCapability("GetDisplayNames");
@@ -5202,12 +5182,12 @@ void LLAppViewer::idleNameCache()
{
name_lookup_url += '/';
}
- LLAvatarNameCache::setNameLookupURL(name_lookup_url);
+ name_cache->setNameLookupURL(name_lookup_url);
}
else
{
// Display names not available on this region
- LLAvatarNameCache::setNameLookupURL( std::string() );
+ name_cache->setNameLookupURL( std::string() );
}
// Error recovery - did we change state?
@@ -5217,7 +5197,7 @@ void LLAppViewer::idleNameCache()
LLVOAvatar::invalidateNameTags();
}
- LLAvatarNameCache::idle();
+ name_cache->idle();
}
//