aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:50 -0500
committerJacek Antonelli2008-08-15 23:45:50 -0500
commit2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch)
tree95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/newview/llviewerwindow.cpp
parentSecond Life viewer sources 1.20.6 (diff)
downloadmeta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz
Second Life viewer sources 1.20.7
Diffstat (limited to 'linden/indra/newview/llviewerwindow.cpp')
-rw-r--r--linden/indra/newview/llviewerwindow.cpp68
1 files changed, 33 insertions, 35 deletions
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp
index 4c76b8b..9f091dc 100644
--- a/linden/indra/newview/llviewerwindow.cpp
+++ b/linden/indra/newview/llviewerwindow.cpp
@@ -43,7 +43,7 @@
43#include "llviewquery.h" 43#include "llviewquery.h"
44#include "llxmltree.h" 44#include "llxmltree.h"
45//#include "llviewercamera.h" 45//#include "llviewercamera.h"
46#include "llglimmediate.h" 46#include "llrender.h"
47 47
48#include "llvoiceclient.h" // for push-to-talk button handling 48#include "llvoiceclient.h" // for push-to-talk button handling
49 49
@@ -182,6 +182,7 @@
182#include "llviewerdisplay.h" 182#include "llviewerdisplay.h"
183#include "llspatialpartition.h" 183#include "llspatialpartition.h"
184#include "llviewerjoystick.h" 184#include "llviewerjoystick.h"
185#include "llviewernetwork.h"
185 186
186#if LL_WINDOWS 187#if LL_WINDOWS
187#include "llwindebug.h" 188#include "llwindebug.h"
@@ -1529,9 +1530,9 @@ LLViewerWindow::LLViewerWindow(
1529 ignore_pixel_depth, 1530 ignore_pixel_depth,
1530 gSavedSettings.getU32("RenderFSAASamples")); 1531 gSavedSettings.getU32("RenderFSAASamples"));
1531#if LL_WINDOWS 1532#if LL_WINDOWS
1532 if (!LLWinDebug::setupExceptionHandler()) 1533 if (!LLWinDebug::checkExceptionHandler())
1533 { 1534 {
1534 llwarns << " Someone took over my exception handler (post createWindow)!" << llendl; 1535 LL_WARNS("Window") << " Someone took over my exception handler (post createWindow)!" << LL_ENDL;
1535 } 1536 }
1536#endif 1537#endif
1537 1538
@@ -1542,8 +1543,8 @@ LLViewerWindow::LLViewerWindow(
1542 llwarns << "Unable to create window, be sure screen is set at 32-bit color and your graphics driver is configured correctly. See README-linux.txt or README-solaris.txt for further information." 1543 llwarns << "Unable to create window, be sure screen is set at 32-bit color and your graphics driver is configured correctly. See README-linux.txt or README-solaris.txt for further information."
1543 << llendl; 1544 << llendl;
1544#else 1545#else
1545 llwarns << "Unable to create window, be sure screen is set at 32-bit color in Control Panels->Display->Settings" 1546 LL_WARNS("Window") << "Unable to create window, be sure screen is set at 32-bit color in Control Panels->Display->Settings"
1546 << llendl; 1547 << LL_ENDL;
1547#endif 1548#endif
1548 LLAppViewer::instance()->forceExit(1); 1549 LLAppViewer::instance()->forceExit(1);
1549 } 1550 }
@@ -1569,7 +1570,7 @@ LLViewerWindow::LLViewerWindow(
1569 // We want to set this stuff up BEFORE we initialize the pipeline, so we can turn off 1570 // We want to set this stuff up BEFORE we initialize the pipeline, so we can turn off
1570 // stuff like AGP if we think that it'll crash the viewer. 1571 // stuff like AGP if we think that it'll crash the viewer.
1571 // 1572 //
1572 llinfos << "Loading feature tables." << llendl; 1573 LL_DEBUGS("Window") << "Loading feature tables." << LL_ENDL;
1573 1574
1574 LLFeatureManager::getInstance()->init(); 1575 LLFeatureManager::getInstance()->init();
1575 1576
@@ -1638,7 +1639,7 @@ LLViewerWindow::LLViewerWindow(
1638 1639
1639void LLViewerWindow::initGLDefaults() 1640void LLViewerWindow::initGLDefaults()
1640{ 1641{
1641 gGL.blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 1642 gGL.setSceneBlendType(LLRender::BT_ALPHA);
1642 glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE ); 1643 glColorMaterial( GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE );
1643 1644
1644 F32 ambient[4] = {0.f,0.f,0.f,0.f }; 1645 F32 ambient[4] = {0.f,0.f,0.f,0.f };
@@ -1656,7 +1657,7 @@ void LLViewerWindow::initGLDefaults()
1656 1657
1657 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient); 1658 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient);
1658 1659
1659 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 1660 gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
1660 1661
1661 glCullFace(GL_BACK); 1662 glCullFace(GL_BACK);
1662 1663
@@ -2198,7 +2199,7 @@ void LLViewerWindow::setNormalControlsVisible( BOOL visible )
2198 2199
2199 // ...and set the menu color appropriately. 2200 // ...and set the menu color appropriately.
2200 setMenuBackgroundColor(gAgent.getGodLevel() > GOD_NOT, 2201 setMenuBackgroundColor(gAgent.getGodLevel() > GOD_NOT,
2201 LLAppViewer::instance()->isInProductionGrid()); 2202 LLViewerLogin::getInstance()->isInProductionGrid());
2202 } 2203 }
2203 2204
2204 if ( gStatusBar ) 2205 if ( gStatusBar )
@@ -2213,15 +2214,15 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid)
2213 LLString::format_map_t args; 2214 LLString::format_map_t args;
2214 LLColor4 new_bg_color; 2215 LLColor4 new_bg_color;
2215 2216
2216 if(god_mode && LLAppViewer::instance()->isInProductionGrid()) 2217 if(god_mode && LLViewerLogin::getInstance()->isInProductionGrid())
2217 { 2218 {
2218 new_bg_color = gColors.getColor( "MenuBarGodBgColor" ); 2219 new_bg_color = gColors.getColor( "MenuBarGodBgColor" );
2219 } 2220 }
2220 else if(god_mode && !LLAppViewer::instance()->isInProductionGrid()) 2221 else if(god_mode && !LLViewerLogin::getInstance()->isInProductionGrid())
2221 { 2222 {
2222 new_bg_color = gColors.getColor( "MenuNonProductionGodBgColor" ); 2223 new_bg_color = gColors.getColor( "MenuNonProductionGodBgColor" );
2223 } 2224 }
2224 else if(!god_mode && !LLAppViewer::instance()->isInProductionGrid()) 2225 else if(!god_mode && !LLViewerLogin::getInstance()->isInProductionGrid())
2225 { 2226 {
2226 new_bg_color = gColors.getColor( "MenuNonProductionBgColor" ); 2227 new_bg_color = gColors.getColor( "MenuNonProductionBgColor" );
2227 } 2228 }
@@ -3538,7 +3539,7 @@ void LLViewerWindow::hitUIElementAsync(S32 x, S32 y_from_bot, MASK mask, void (*
3538 const LLVector2& display_scale = getDisplayScale(); 3539 const LLVector2& display_scale = getDisplayScale();
3539 glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); 3540 glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f);
3540 3541
3541 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 3542 gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
3542 3543
3543 // make viewport big enough to handle antialiased frame buffers 3544 // make viewport big enough to handle antialiased frame buffers
3544 glViewport(x - (PICK_HALF_WIDTH + 2), y_from_bot - (PICK_HALF_WIDTH + 2), PICK_DIAMETER + 4, PICK_DIAMETER + 4); 3545 glViewport(x - (PICK_HALF_WIDTH + 2), y_from_bot - (PICK_HALF_WIDTH + 2), PICK_DIAMETER + 4, PICK_DIAMETER + 4);
@@ -4185,8 +4186,9 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
4185 if ( (size.mX != new_width + BORDERWIDTH) 4186 if ( (size.mX != new_width + BORDERWIDTH)
4186 ||(size.mY != new_height + BORDERHEIGHT)) 4187 ||(size.mY != new_height + BORDERHEIGHT))
4187 { 4188 {
4188 S32 x = gViewerWindow->getWindowWidth(); 4189 // use actual display dimensions, not virtual UI dimensions
4189 S32 y = gViewerWindow->getWindowHeight(); 4190 S32 x = gViewerWindow->getWindowDisplayWidth();
4191 S32 y = gViewerWindow->getWindowDisplayHeight();
4190 BORDERWIDTH = size.mX - x; 4192 BORDERWIDTH = size.mX - x;
4191 BORDERHEIGHT = size.mY- y; 4193 BORDERHEIGHT = size.mY- y;
4192 LLCoordScreen new_size(new_width + BORDERWIDTH, 4194 LLCoordScreen new_size(new_width + BORDERWIDTH,
@@ -4938,7 +4940,7 @@ void LLViewerWindow::restoreGL(const LLString& progress_message)
4938 } 4940 }
4939 llinfos << "...Restoring GL done" << llendl; 4941 llinfos << "...Restoring GL done" << llendl;
4940#if LL_WINDOWS 4942#if LL_WINDOWS
4941 if (SetUnhandledExceptionFilter(LLWinDebug::handleException) != LLWinDebug::handleException) 4943 if(!LLWinDebug::checkExceptionHandler())
4942 { 4944 {
4943 llwarns << " Someone took over my exception handler (post restoreGL)!" << llendl; 4945 llwarns << " Someone took over my exception handler (post restoreGL)!" << llendl;
4944 } 4946 }
@@ -4951,21 +4953,21 @@ void LLViewerWindow::initFonts(F32 zoom_factor)
4951{ 4953{
4952 LLFontGL::destroyGL(); 4954 LLFontGL::destroyGL();
4953 LLFontGL::initDefaultFonts( gSavedSettings.getF32("FontScreenDPI"), 4955 LLFontGL::initDefaultFonts( gSavedSettings.getF32("FontScreenDPI"),
4954 mDisplayScale.mV[VX] * zoom_factor, 4956 mDisplayScale.mV[VX] * zoom_factor,
4955 mDisplayScale.mV[VY] * zoom_factor, 4957 mDisplayScale.mV[VY] * zoom_factor,
4956 gSavedSettings.getString("FontMonospace"), 4958 gSavedSettings.getString("FontMonospace"),
4957 gSavedSettings.getF32("FontSizeMonospace"), 4959 gSavedSettings.getF32("FontSizeMonospace"),
4958 gSavedSettings.getString("FontSansSerif"), 4960 gSavedSettings.getString("FontSansSerif"),
4959 gSavedSettings.getString("FontSansSerifFallback"), 4961 gSavedSettings.getString("FontSansSerifFallback"),
4960 gSavedSettings.getF32("FontSansSerifFallbackScale"), 4962 gSavedSettings.getF32("FontSansSerifFallbackScale"),
4961 gSavedSettings.getF32("FontSizeSmall"), 4963 gSavedSettings.getF32("FontSizeSmall"),
4962 gSavedSettings.getF32("FontSizeMedium"), 4964 gSavedSettings.getF32("FontSizeMedium"),
4963 gSavedSettings.getF32("FontSizeLarge"), 4965 gSavedSettings.getF32("FontSizeLarge"),
4964 gSavedSettings.getF32("FontSizeHuge"), 4966 gSavedSettings.getF32("FontSizeHuge"),
4965 gSavedSettings.getString("FontSansSerifBold"), 4967 gSavedSettings.getString("FontSansSerifBold"),
4966 gSavedSettings.getF32("FontSizeMedium"), 4968 gSavedSettings.getF32("FontSizeMedium"),
4967 gDirUtilp->getAppRODataDir() 4969 gDirUtilp->getAppRODataDir()
4968 ); 4970 );
4969} 4971}
4970void LLViewerWindow::toggleFullscreen(BOOL show_progress) 4972void LLViewerWindow::toggleFullscreen(BOOL show_progress)
4971{ 4973{
@@ -5018,20 +5020,16 @@ BOOL LLViewerWindow::checkSettings()
5018 return FALSE; 5020 return FALSE;
5019 } 5021 }
5020 5022
5021#ifndef LL_RELEASE_FOR_DOWNLOAD
5022 LLGLState::checkStates(); 5023 LLGLState::checkStates();
5023 LLGLState::checkTextureChannels(); 5024 LLGLState::checkTextureChannels();
5024#endif
5025 changeDisplaySettings(TRUE, 5025 changeDisplaySettings(TRUE,
5026 LLCoordScreen(gSavedSettings.getS32("FullScreenWidth"), 5026 LLCoordScreen(gSavedSettings.getS32("FullScreenWidth"),
5027 gSavedSettings.getS32("FullScreenHeight")), 5027 gSavedSettings.getS32("FullScreenHeight")),
5028 gSavedSettings.getBOOL("DisableVerticalSync"), 5028 gSavedSettings.getBOOL("DisableVerticalSync"),
5029 mShowFullscreenProgress); 5029 mShowFullscreenProgress);
5030 5030
5031#ifndef LL_RELEASE_FOR_DOWNLOAD
5032 LLGLState::checkStates(); 5031 LLGLState::checkStates();
5033 LLGLState::checkTextureChannels(); 5032 LLGLState::checkTextureChannels();
5034#endif
5035 return TRUE; 5033 return TRUE;
5036 } 5034 }
5037 return FALSE; 5035 return FALSE;