diff options
author | Jacek Antonelli | 2008-08-15 23:45:48 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:48 -0500 |
commit | 32b59b5609706d574e2e3b9ff6162d35f6d7781c (patch) | |
tree | 340ae6f090700b109f2ced1c41b8fb274a215bd3 /linden/indra/newview/llviewerwindow.cpp | |
parent | Second Life viewer sources 1.20.4 (diff) | |
download | meta-impy-32b59b5609706d574e2e3b9ff6162d35f6d7781c.zip meta-impy-32b59b5609706d574e2e3b9ff6162d35f6d7781c.tar.gz meta-impy-32b59b5609706d574e2e3b9ff6162d35f6d7781c.tar.bz2 meta-impy-32b59b5609706d574e2e3b9ff6162d35f6d7781c.tar.xz |
Second Life viewer sources 1.20.5
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewerwindow.cpp | 67 |
1 files changed, 34 insertions, 33 deletions
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index a14a3b3..563c0e6 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp | |||
@@ -1259,8 +1259,8 @@ void LLViewerWindow::handleFocusLost(LLWindow *window) | |||
1259 | } | 1259 | } |
1260 | 1260 | ||
1261 | // restore mouse cursor | 1261 | // restore mouse cursor |
1262 | gViewerWindow->showCursor(); | 1262 | showCursor(); |
1263 | gViewerWindow->getWindow()->setMouseClipping(FALSE); | 1263 | getWindow()->setMouseClipping(FALSE); |
1264 | 1264 | ||
1265 | // JC - Leave keyboard focus, so if you're popping in and out editing | 1265 | // JC - Leave keyboard focus, so if you're popping in and out editing |
1266 | // a script, you don't have to click in the editor again and again. | 1266 | // a script, you don't have to click in the editor again and again. |
@@ -1435,7 +1435,7 @@ BOOL LLViewerWindow::handlePaint(LLWindow *window, S32 x, S32 y, S32 width, S | |||
1435 | 1435 | ||
1436 | void LLViewerWindow::handleScrollWheel(LLWindow *window, S32 clicks) | 1436 | void LLViewerWindow::handleScrollWheel(LLWindow *window, S32 clicks) |
1437 | { | 1437 | { |
1438 | gViewerWindow->handleScrollWheel( clicks ); | 1438 | handleScrollWheel( clicks ); |
1439 | } | 1439 | } |
1440 | 1440 | ||
1441 | void LLViewerWindow::handleWindowBlock(LLWindow *window) | 1441 | void LLViewerWindow::handleWindowBlock(LLWindow *window) |
@@ -1684,7 +1684,7 @@ void LLViewerWindow::initBase() | |||
1684 | F32 gamma = gSavedSettings.getF32("RenderGamma"); | 1684 | F32 gamma = gSavedSettings.getF32("RenderGamma"); |
1685 | if (gamma != 0.0f) | 1685 | if (gamma != 0.0f) |
1686 | { | 1686 | { |
1687 | gViewerWindow->getWindow()->setGamma(gamma); | 1687 | getWindow()->setGamma(gamma); |
1688 | } | 1688 | } |
1689 | 1689 | ||
1690 | // Create global views | 1690 | // Create global views |
@@ -1953,7 +1953,7 @@ void LLViewerWindow::initWorldUI() | |||
1953 | 1953 | ||
1954 | // Status bar | 1954 | // Status bar |
1955 | S32 menu_bar_height = gMenuBarView->getRect().getHeight(); | 1955 | S32 menu_bar_height = gMenuBarView->getRect().getHeight(); |
1956 | LLRect root_rect = gViewerWindow->getRootView()->getRect(); | 1956 | LLRect root_rect = getRootView()->getRect(); |
1957 | LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height); | 1957 | LLRect status_rect(0, root_rect.getHeight(), root_rect.getWidth(), root_rect.getHeight() - menu_bar_height); |
1958 | gStatusBar = new LLStatusBar("status", status_rect); | 1958 | gStatusBar = new LLStatusBar("status", status_rect); |
1959 | gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP); | 1959 | gStatusBar->setFollows(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_TOP); |
@@ -1965,10 +1965,10 @@ void LLViewerWindow::initWorldUI() | |||
1965 | 1965 | ||
1966 | LLFloaterChatterBox::createInstance(LLSD()); | 1966 | LLFloaterChatterBox::createInstance(LLSD()); |
1967 | 1967 | ||
1968 | gViewerWindow->getRootView()->addChild(gStatusBar); | 1968 | getRootView()->addChild(gStatusBar); |
1969 | 1969 | ||
1970 | // menu holder appears on top to get first pass at all mouse events | 1970 | // menu holder appears on top to get first pass at all mouse events |
1971 | gViewerWindow->getRootView()->sendChildToFront(gMenuHolder); | 1971 | getRootView()->sendChildToFront(gMenuHolder); |
1972 | } | 1972 | } |
1973 | } | 1973 | } |
1974 | 1974 | ||
@@ -2313,8 +2313,8 @@ void LLViewerWindow::draw() | |||
2313 | int pos_y = sub_region / llceil(zoom_factor); | 2313 | int pos_y = sub_region / llceil(zoom_factor); |
2314 | int pos_x = sub_region - (pos_y*llceil(zoom_factor)); | 2314 | int pos_x = sub_region - (pos_y*llceil(zoom_factor)); |
2315 | // offset for this tile | 2315 | // offset for this tile |
2316 | glTranslatef((F32)gViewerWindow->getWindowWidth() * -(F32)pos_x, | 2316 | glTranslatef((F32)getWindowWidth() * -(F32)pos_x, |
2317 | (F32)gViewerWindow->getWindowHeight() * -(F32)pos_y, | 2317 | (F32)getWindowHeight() * -(F32)pos_y, |
2318 | 0.f); | 2318 | 0.f); |
2319 | glScalef(zoom_factor, zoom_factor, 1.f); | 2319 | glScalef(zoom_factor, zoom_factor, 1.f); |
2320 | LLUI::sGLScaleFactor *= zoom_factor; | 2320 | LLUI::sGLScaleFactor *= zoom_factor; |
@@ -2379,8 +2379,8 @@ void LLViewerWindow::draw() | |||
2379 | const S32 DIST_FROM_TOP = 20; | 2379 | const S32 DIST_FROM_TOP = 20; |
2380 | LLFontGL::sSansSerifBig->renderUTF8( | 2380 | LLFontGL::sSansSerifBig->renderUTF8( |
2381 | mOverlayTitle, 0, | 2381 | mOverlayTitle, 0, |
2382 | llround( gViewerWindow->getWindowWidth() * 0.5f), | 2382 | llround( getWindowWidth() * 0.5f), |
2383 | gViewerWindow->getWindowHeight() - DIST_FROM_TOP, | 2383 | getWindowHeight() - DIST_FROM_TOP, |
2384 | LLColor4(1, 1, 1, 0.4f), | 2384 | LLColor4(1, 1, 1, 0.4f), |
2385 | LLFontGL::HCENTER, LLFontGL::TOP); | 2385 | LLFontGL::HCENTER, LLFontGL::TOP); |
2386 | } | 2386 | } |
@@ -3534,8 +3534,8 @@ void LLViewerWindow::hitUIElementAsync(S32 x, S32 y_from_bot, MASK mask, void (* | |||
3534 | // build orthogonal transform and picking viewport | 3534 | // build orthogonal transform and picking viewport |
3535 | // Perform pick on a PICK_DIAMETER x PICK_DIAMETER pixel region around cursor point. | 3535 | // Perform pick on a PICK_DIAMETER x PICK_DIAMETER pixel region around cursor point. |
3536 | // Don't limit the select distance for this pick. | 3536 | // Don't limit the select distance for this pick. |
3537 | gViewerWindow->setup2DRender(); | 3537 | setup2DRender(); |
3538 | const LLVector2& display_scale = gViewerWindow->getDisplayScale(); | 3538 | const LLVector2& display_scale = getDisplayScale(); |
3539 | glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); | 3539 | glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f); |
3540 | 3540 | ||
3541 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | 3541 | glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
@@ -3549,7 +3549,7 @@ void LLViewerWindow::hitUIElementAsync(S32 x, S32 y_from_bot, MASK mask, void (* | |||
3549 | 3549 | ||
3550 | // Draw the objects so the user can select them. | 3550 | // Draw the objects so the user can select them. |
3551 | // The starting ID is 1, since land is zero. | 3551 | // The starting ID is 1, since land is zero. |
3552 | //gViewerWindow->drawForSelect(); | 3552 | //drawForSelect(); |
3553 | 3553 | ||
3554 | stop_glerror(); | 3554 | stop_glerror(); |
3555 | 3555 | ||
@@ -3579,8 +3579,8 @@ void LLViewerWindow::performPick() | |||
3579 | 3579 | ||
3580 | // find pick region that is fully onscreen | 3580 | // find pick region that is fully onscreen |
3581 | LLCoordGL scaled_pick_point = mPickPoint; | 3581 | LLCoordGL scaled_pick_point = mPickPoint; |
3582 | scaled_pick_point.mX = llclamp(llround((F32)mPickPoint.mX * mDisplayScale.mV[VX]), PICK_HALF_WIDTH, gViewerWindow->getWindowDisplayWidth() - PICK_HALF_WIDTH); | 3582 | scaled_pick_point.mX = llclamp(llround((F32)mPickPoint.mX * mDisplayScale.mV[VX]), PICK_HALF_WIDTH, getWindowDisplayWidth() - PICK_HALF_WIDTH); |
3583 | scaled_pick_point.mY = llclamp(llround((F32)mPickPoint.mY * mDisplayScale.mV[VY]), PICK_HALF_WIDTH, gViewerWindow->getWindowDisplayHeight() - PICK_HALF_WIDTH); | 3583 | scaled_pick_point.mY = llclamp(llround((F32)mPickPoint.mY * mDisplayScale.mV[VY]), PICK_HALF_WIDTH, getWindowDisplayHeight() - PICK_HALF_WIDTH); |
3584 | 3584 | ||
3585 | glReadPixels(scaled_pick_point.mX - PICK_HALF_WIDTH, scaled_pick_point.mY - PICK_HALF_WIDTH, PICK_DIAMETER, PICK_DIAMETER, GL_RGBA, GL_UNSIGNED_BYTE, mPickBuffer); | 3585 | glReadPixels(scaled_pick_point.mX - PICK_HALF_WIDTH, scaled_pick_point.mY - PICK_HALF_WIDTH, PICK_DIAMETER, PICK_DIAMETER, GL_RGBA, GL_UNSIGNED_BYTE, mPickBuffer); |
3586 | 3586 | ||
@@ -4152,7 +4152,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageRaw *raw, const LLString& extensio | |||
4152 | filepath += extension; | 4152 | filepath += extension; |
4153 | 4153 | ||
4154 | struct stat stat_info; | 4154 | struct stat stat_info; |
4155 | err = gViewerWindow->mWindow->stat( filepath.c_str(), &stat_info ); | 4155 | err = mWindow->stat( filepath.c_str(), &stat_info ); |
4156 | i++; | 4156 | i++; |
4157 | } | 4157 | } |
4158 | while( -1 != err ); // search until the file is not found (i.e., stat() gives an error). | 4158 | while( -1 != err ); // search until the file is not found (i.e., stat() gives an error). |
@@ -4177,6 +4177,7 @@ BOOL LLViewerWindow::saveImageNumbered(LLImageRaw *raw, const LLString& extensio | |||
4177 | static S32 BORDERHEIGHT = 0; | 4177 | static S32 BORDERHEIGHT = 0; |
4178 | static S32 BORDERWIDTH = 0; | 4178 | static S32 BORDERWIDTH = 0; |
4179 | 4179 | ||
4180 | // static | ||
4180 | void LLViewerWindow::movieSize(S32 new_width, S32 new_height) | 4181 | void LLViewerWindow::movieSize(S32 new_width, S32 new_height) |
4181 | { | 4182 | { |
4182 | LLCoordScreen size; | 4183 | LLCoordScreen size; |
@@ -4656,7 +4657,7 @@ void LLViewerWindow::drawMouselookInstructions() | |||
4656 | LLRect instructions_rect; | 4657 | LLRect instructions_rect; |
4657 | instructions_rect.setLeftTopAndSize( | 4658 | instructions_rect.setLeftTopAndSize( |
4658 | INSTRUCTIONS_PAD, | 4659 | INSTRUCTIONS_PAD, |
4659 | gViewerWindow->getWindowHeight() - INSTRUCTIONS_PAD, | 4660 | getWindowHeight() - INSTRUCTIONS_PAD, |
4660 | font->getWidth( instructions ) + 2 * INSTRUCTIONS_PAD, | 4661 | font->getWidth( instructions ) + 2 * INSTRUCTIONS_PAD, |
4661 | llround(font->getLineHeight() + 2 * INSTRUCTIONS_PAD)); | 4662 | llround(font->getLineHeight() + 2 * INSTRUCTIONS_PAD)); |
4662 | 4663 | ||
@@ -4979,11 +4980,11 @@ void LLViewerWindow::getTargetWindow(BOOL& fullscreen, S32& width, S32& height) | |||
4979 | { | 4980 | { |
4980 | fullscreen = mWantFullscreen; | 4981 | fullscreen = mWantFullscreen; |
4981 | 4982 | ||
4982 | if (gViewerWindow->mWindow | 4983 | if (mWindow |
4983 | && gViewerWindow->mWindow->getFullscreen() == mWantFullscreen) | 4984 | && mWindow->getFullscreen() == mWantFullscreen) |
4984 | { | 4985 | { |
4985 | width = gViewerWindow->getWindowDisplayWidth(); | 4986 | width = getWindowDisplayWidth(); |
4986 | height = gViewerWindow->getWindowDisplayHeight(); | 4987 | height = getWindowDisplayHeight(); |
4987 | } | 4988 | } |
4988 | else if (mWantFullscreen) | 4989 | else if (mWantFullscreen) |
4989 | { | 4990 | { |
@@ -5000,14 +5001,14 @@ void LLViewerWindow::getTargetWindow(BOOL& fullscreen, S32& width, S32& height) | |||
5000 | 5001 | ||
5001 | BOOL LLViewerWindow::checkSettings() | 5002 | BOOL LLViewerWindow::checkSettings() |
5002 | { | 5003 | { |
5003 | BOOL is_fullscreen = gViewerWindow->mWindow->getFullscreen(); | 5004 | BOOL is_fullscreen = mWindow->getFullscreen(); |
5004 | if (is_fullscreen && !mWantFullscreen) | 5005 | if (is_fullscreen && !mWantFullscreen) |
5005 | { | 5006 | { |
5006 | gViewerWindow->changeDisplaySettings(FALSE, | 5007 | changeDisplaySettings(FALSE, |
5007 | LLCoordScreen(gSavedSettings.getS32("WindowWidth"), | 5008 | LLCoordScreen(gSavedSettings.getS32("WindowWidth"), |
5008 | gSavedSettings.getS32("WindowHeight")), | 5009 | gSavedSettings.getS32("WindowHeight")), |
5009 | TRUE, | 5010 | TRUE, |
5010 | mShowFullscreenProgress); | 5011 | mShowFullscreenProgress); |
5011 | return TRUE; | 5012 | return TRUE; |
5012 | } | 5013 | } |
5013 | else if (!is_fullscreen && mWantFullscreen) | 5014 | else if (!is_fullscreen && mWantFullscreen) |
@@ -5021,11 +5022,11 @@ BOOL LLViewerWindow::checkSettings() | |||
5021 | LLGLState::checkStates(); | 5022 | LLGLState::checkStates(); |
5022 | LLGLState::checkTextureChannels(); | 5023 | LLGLState::checkTextureChannels(); |
5023 | #endif | 5024 | #endif |
5024 | gViewerWindow->changeDisplaySettings(TRUE, | 5025 | changeDisplaySettings(TRUE, |
5025 | LLCoordScreen(gSavedSettings.getS32("FullScreenWidth"), | 5026 | LLCoordScreen(gSavedSettings.getS32("FullScreenWidth"), |
5026 | gSavedSettings.getS32("FullScreenHeight")), | 5027 | gSavedSettings.getS32("FullScreenHeight")), |
5027 | gSavedSettings.getBOOL("DisableVerticalSync"), | 5028 | gSavedSettings.getBOOL("DisableVerticalSync"), |
5028 | mShowFullscreenProgress); | 5029 | mShowFullscreenProgress); |
5029 | 5030 | ||
5030 | #ifndef LL_RELEASE_FOR_DOWNLOAD | 5031 | #ifndef LL_RELEASE_FOR_DOWNLOAD |
5031 | LLGLState::checkStates(); | 5032 | LLGLState::checkStates(); |