summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorBrad Kittenbrink <brad@lindenlab.com>2008-02-27 18:58:14 +0000
committerBrad Kittenbrink <brad@lindenlab.com>2008-02-27 18:58:14 +0000
commit6d52efe452aa8469e0343da1c7d108f3f52ab651 (patch)
treea87be48e9840d7fc1f7ee514d7c7f994e71fdb3c /indra/newview/llappviewer.cpp
parent6027ad2630b8650cabcf00628ee9b0d25bedd67f (diff)
Merge of windlight into release (QAR-286). This includes all changes in
windlight14 which have passed QA (up through r79932). svn merge -r 80831:80833 svn+ssh://svn.lindenlab.com/svn/linden/branches/merge_windlight14_r80620
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp170
1 files changed, 104 insertions, 66 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index fe1d93c7bc..106b2b1517 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -100,6 +100,9 @@
#include "lltracker.h"
#include "llviewerparcelmgr.h"
#include "llworldmapview.h"
+#include "llpostprocess.h"
+#include "llwlparammanager.h"
+#include "llwaterparammanager.h"
#include "lldebugview.h"
#include "llconsole.h"
@@ -127,6 +130,9 @@
#include "llframestats.h"
#include "llagentpilot.h"
#include "llsrv.h"
+#include "llvovolume.h"
+#include "llflexibleobject.h"
+#include "llvosurfacepatch.h"
// includes for idle() idleShutdown()
#include "llviewercontrol.h"
@@ -458,8 +464,6 @@ static void saved_settings_to_globals()
LLCOMBOBOX_WIDTH = 128;
LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize"));
-
- LLVOSky::sNighttimeBrightness = gSavedSettings.getF32("RenderNightBrightness");
LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic");
LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor");
@@ -492,6 +496,11 @@ static void saved_settings_to_globals()
gHandleKeysAsync = gSavedSettings.getBOOL("AsyncKeyboard");
LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips");
+ LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO");
+ LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors");
+ LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor");
+ LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //sqaure lod factor to get exponential range of [1,4]
+
#if LL_VECTORIZE
if (gSysCPU.hasAltivec())
{
@@ -1009,13 +1018,6 @@ bool LLAppViewer::init()
gCurrentVersion = llformat("%s %d.%d.%d.%d", gChannelName.c_str(), LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VERSION_BUILD );
//
- // Load the feature tables
- //
- llinfos << "Loading feature tables." << llendl;
-
- gFeatureManagerp->loadFeatureTables();
- gFeatureManagerp->initCPUFeatureMasks();
-
// Merge with the command line overrides
gSavedSettings.applyOverrides(gCommandLineSettings);
@@ -1260,26 +1262,64 @@ bool LLAppViewer::init()
llinfos << "Viewer Digest: " << gViewerDigest << llendl;
// If we don't have the right GL requirements, exit.
- // BUG: This should just be changed to a generic GL "Not good enough" flag
- if (!gGLManager.mHasMultitexture && !gNoRender)
- {
- std::ostringstream msg;
- msg <<
- "You do not appear to have the proper hardware requirements "
- "for " << gSecondLife << ". " << gSecondLife << " requires an OpenGL graphics "
- "card that has multitexture support. If this is the case, "
- "you may want to make sure that you have the latest drivers for "
- "your graphics card, and service packs and patches for your "
- "operating system.\n"
- "If you continue to have problems, please go to: "
- "www.secondlife.com/support ";
+ if (!gGLManager.mHasRequirements && !gNoRender)
+ {
+ // can't use an alert here since we're existing and
+ // all hell breaks lose.
OSMessageBox(
- msg.str().c_str(),
+ LLAlertDialog::getTemplateMessage("UnsupportedGLRequirements").c_str(),
NULL,
OSMB_OK);
return 0;
}
+ // alert the user if they are using unsupported hardware
+ if(!gSavedSettings.getBOOL("AlertedUnsupportedHardware"))
+ {
+ bool unsupported = false;
+ LLString::format_map_t args;
+ LLString minSpecs;
+
+ // get cpu data from xml
+ std::stringstream minCPUString(LLAlertDialog::getTemplateMessage("UnsupportedCPUAmount"));
+ S32 minCPU = 0;
+ minCPUString >> minCPU;
+
+ // get RAM data from XML
+ std::stringstream minRAMString(LLAlertDialog::getTemplateMessage("UnsupportedRAMAmount"));
+ U64 minRAM = 0;
+ minRAMString >> minRAM;
+ minRAM = minRAM * 1024 * 1024;
+
+ if(!gFeatureManagerp->isGPUSupported())
+ {
+ minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedGPU");
+ minSpecs += "\n";
+ unsupported = true;
+ }
+ if(gSysCPU.getMhz() < minCPU)
+ {
+ minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedCPU");
+ minSpecs += "\n";
+ unsupported = true;
+ }
+ if(gSysMemory.getPhysicalMemoryClamped() < minRAM)
+ {
+ minSpecs += LLAlertDialog::getTemplateMessage("UnsupportedRAM");
+ minSpecs += "\n";
+ unsupported = true;
+ }
+
+ if(unsupported)
+ {
+ args["MINSPECS"] = minSpecs;
+ gViewerWindow->alertXml("UnsupportedHardware", args );
+
+ // turn off flag
+ gSavedSettings.setBOOL("AlertedUnsupportedHardware", TRUE);
+ }
+ }
+
// Save the current version to the prefs file
gSavedSettings.setString("LastRunVersion", gCurrentVersion);
@@ -1337,6 +1377,7 @@ bool LLAppViewer::mainLoop()
debugTime.reset();
}
#endif
+
if (!LLApp::isExiting())
{
// Scan keyboard for movement keys. Command keys and typing
@@ -1434,7 +1475,7 @@ bool LLAppViewer::mainLoop()
const F64 min_frame_time = 0.0; //(.0333 - .0010); // max video frame rate = 30 fps
const F64 min_idle_time = 0.0; //(.0010); // min idle time = 1 ms
- const F64 max_idle_time = run_multiple_threads ? min_idle_time : .005; // 5 ms
+ const F64 max_idle_time = run_multiple_threads ? min_idle_time : llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second
idleTimer.reset();
while(1)
{
@@ -1620,7 +1661,11 @@ bool LLAppViewer::cleanup()
LLSelectMgr::cleanupGlobals();
LLViewerObject::cleanupVOClasses();
-
+
+ LLWaterParamManager::cleanupClass();
+ LLWLParamManager::cleanupClass();
+ LLPostProcess::cleanupClass();
+
LLTracker::cleanupInstance();
// *FIX: This is handled in LLAppViewerWin32::cleanup().
@@ -2316,16 +2361,33 @@ bool LLAppViewer::initWindow()
gViewerWindow->getWindow()->setNativeAspectRatio(gSavedSettings.getF32("FullScreenAspectRatio"));
}
+ if (!gNoRender)
+ {
+ //
+ // Initialize GL stuff
+ //
+
+ // Set this flag in case we crash while initializing GL
+ gSavedSettings.setBOOL("RenderInitError", TRUE);
+ gSavedSettings.saveToFile( gSettingsFileName, TRUE );
+
+ gPipeline.init();
+ stop_glerror();
+ gViewerWindow->initGLDefaults();
+
+ gSavedSettings.setBOOL("RenderInitError", FALSE);
+ gSavedSettings.saveToFile( gSettingsFileName, TRUE );
+ }
+
LLUI::sWindow = gViewerWindow->getWindow();
LLAlertDialog::parseAlerts("alerts.xml");
LLNotifyBox::parseNotify("notify.xml");
- //
- // Clean up the feature manager lookup table - settings were updated
- // in the LLViewerWindow constructor
- //
- gFeatureManagerp->cleanupFeatureTables();
+ // *TODO - remove this when merging into release
+ // DON'T Clean up the feature manager lookup table - settings are needed
+ // for setting the graphics level.
+ //gFeatureManagerp->cleanupFeatureTables();
// Show watch cursor
gViewerWindow->setCursor(UI_CURSOR_WAIT);
@@ -3268,8 +3330,7 @@ void LLAppViewer::idle()
if (!gDisconnected)
{
LLFastTimer t(LLFastTimer::FTM_NETWORK);
-
- // Update spaceserver timeinfo
+ // Update spaceserver timeinfo
gWorldp->setSpaceTimeUSec(gWorldp->getSpaceTimeUSec() + (U32)(dt_raw * SEC_TO_MICROSEC));
@@ -3372,8 +3433,6 @@ void LLAppViewer::idle()
// Update statistics for this frame
update_statistics(gFrameCount);
-
- gViewerWindow->updateDebugText();
}
////////////////////////////////////////
@@ -3403,11 +3462,7 @@ void LLAppViewer::idle()
//
LLCoordGL current_mouse = gViewerWindow->getCurrentMouse();
-// BOOL was_in_prelude = gAgent.inPrelude();
-
{
- //LLFastTimer t(LLFastTimer::FTM_TEMP1);
-
// After agent and camera moved, figure out if we need to
// deselect objects.
gSelectMgr->deselectAllIfTooFar();
@@ -3415,19 +3470,6 @@ void LLAppViewer::idle()
}
{
- LLFastTimer t(LLFastTimer::FTM_RESET_DRAWORDER);
-
- //////////////////////////////////////////////
- //
- // Clear draw orders
- //
- // Should actually be done after render, but handlePerFrameHover actually does a "render"
- // to do its selection.
- //
-
- gPipeline.resetDrawOrders();
- }
- {
// Handle pending gesture processing
gGestureManager.update();
@@ -3444,11 +3486,6 @@ void LLAppViewer::idle()
}
}
- {
- LLFastTimer t(LLFastTimer::FTM_UPDATE_SKY);
- gSky.updateSky();
- }
-
//////////////////////////////////////
//
// Deletes objects...
@@ -3476,8 +3513,6 @@ void LLAppViewer::idle()
//
{
- //LLFastTimer t(LLFastTimer::FTM_TEMP3);
-
gFrameStats.start(LLFrameStats::UPDATE_EFFECTS);
gSelectMgr->updateEffects();
gHUDManager->cleanupEffects();
@@ -3552,16 +3587,18 @@ void LLAppViewer::idle()
//
gFrameStats.start(LLFrameStats::IMAGE_UPDATE);
- LLFastTimer t(LLFastTimer::FTM_IMAGE_UPDATE);
-
- LLViewerImage::updateClass(gCamera->getVelocityStat()->getMean(),
- gCamera->getAngularVelocityStat()->getMean());
+ {
+ LLFastTimer t(LLFastTimer::FTM_IMAGE_UPDATE);
+
+ LLViewerImage::updateClass(gCamera->getVelocityStat()->getMean(),
+ gCamera->getAngularVelocityStat()->getMean());
- gBumpImageList.updateImages(); // must be called before gImageList version so that it's textures are thrown out first.
+ gBumpImageList.updateImages(); // must be called before gImageList version so that it's textures are thrown out first.
- const F32 max_image_decode_time = 0.005f; // 5 ms decode time
- gImageList.updateImages(max_image_decode_time);
- stop_glerror();
+ const F32 max_image_decode_time = llmin(0.005f, 0.005f*10.f*gFrameIntervalSeconds); // 50 ms/second decode time (no more than 5ms/frame)
+ gImageList.updateImages(max_image_decode_time);
+ stop_glerror();
+ }
//////////////////////////////////////
//
@@ -3571,6 +3608,7 @@ void LLAppViewer::idle()
if (!gNoRender)
{
+ LLFastTimer t(LLFastTimer::FTM_WORLD_UPDATE);
gFrameStats.start(LLFrameStats::UPDATE_MOVE);
gPipeline.updateMove();