diff options
author | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:42 -0500 |
commit | ce28e056c20bf2723f565bbf464b87781ec248a2 (patch) | |
tree | ef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/lltoolgun.cpp | |
parent | Second Life viewer sources 1.19.1.4b (diff) | |
download | meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2 meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz |
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/lltoolgun.cpp')
-rw-r--r-- | linden/indra/newview/lltoolgun.cpp | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/linden/indra/newview/lltoolgun.cpp b/linden/indra/newview/lltoolgun.cpp index 3385064..e4a7f6c 100644 --- a/linden/indra/newview/lltoolgun.cpp +++ b/linden/indra/newview/lltoolgun.cpp | |||
@@ -51,7 +51,6 @@ LLToolGun::LLToolGun( LLToolComposite* composite ) | |||
51 | : | 51 | : |
52 | LLTool( "gun", composite ) | 52 | LLTool( "gun", composite ) |
53 | { | 53 | { |
54 | mCrosshairImg = gImageList.getImage( LLUUID( gSavedSettings.getString("UIImgCrosshairsUUID") ), MIPMAP_FALSE, TRUE ); | ||
55 | } | 54 | } |
56 | 55 | ||
57 | void LLToolGun::handleSelect() | 56 | void LLToolGun::handleSelect() |
@@ -71,23 +70,19 @@ void LLToolGun::handleDeselect() | |||
71 | BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask) | 70 | BOOL LLToolGun::handleMouseDown(S32 x, S32 y, MASK mask) |
72 | { | 71 | { |
73 | gGrabTransientTool = this; | 72 | gGrabTransientTool = this; |
74 | gToolMgr->getCurrentToolset()->selectTool( gToolGrab ); | 73 | LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() ); |
75 | 74 | ||
76 | return gToolGrab->handleMouseDown(x, y, mask); | 75 | return LLToolGrab::getInstance()->handleMouseDown(x, y, mask); |
77 | } | 76 | } |
78 | 77 | ||
79 | BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask) | 78 | BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask) |
80 | { | 79 | { |
81 | if( gAgent.cameraMouselook() ) | 80 | if( gAgent.cameraMouselook() ) |
82 | { | 81 | { |
83 | #if 1 //LL_WINDOWS || LL_DARWIN | 82 | const F32 NOMINAL_MOUSE_SENSITIVITY = 0.0025f; |
84 | const F32 NOMINAL_MOUSE_SENSITIVITY = 0.0025f; | ||
85 | #else | ||
86 | const F32 NOMINAL_MOUSE_SENSITIVITY = 0.025f; | ||
87 | #endif | ||
88 | 83 | ||
89 | 84 | F32 mouse_sensitivity = gSavedSettings.getF32("MouseSensitivity"); | |
90 | F32 mouse_sensitivity = clamp_rescale(gMouseSensitivity, 0.f, 15.f, 0.5f, 2.75f) * NOMINAL_MOUSE_SENSITIVITY; | 85 | mouse_sensitivity = clamp_rescale(mouse_sensitivity, 0.f, 15.f, 0.5f, 2.75f) * NOMINAL_MOUSE_SENSITIVITY; |
91 | 86 | ||
92 | // ...move the view with the mouse | 87 | // ...move the view with the mouse |
93 | 88 | ||
@@ -98,7 +93,7 @@ BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask) | |||
98 | if (dx != 0 || dy != 0) | 93 | if (dx != 0 || dy != 0) |
99 | { | 94 | { |
100 | // ...actually moved off center | 95 | // ...actually moved off center |
101 | if (gInvertMouse) | 96 | if (gSavedSettings.getBOOL("InvertMouse")) |
102 | { | 97 | { |
103 | gAgent.pitch(mouse_sensitivity * -dy); | 98 | gAgent.pitch(mouse_sensitivity * -dy); |
104 | } | 99 | } |
@@ -111,9 +106,9 @@ BOOL LLToolGun::handleHover(S32 x, S32 y, MASK mask) | |||
111 | 106 | ||
112 | if (gSavedSettings.getBOOL("MouseSun")) | 107 | if (gSavedSettings.getBOOL("MouseSun")) |
113 | { | 108 | { |
114 | gSky.setSunDirection(gCamera->getAtAxis(), LLVector3(0.f, 0.f, 0.f)); | 109 | gSky.setSunDirection(LLViewerCamera::getInstance()->getAtAxis(), LLVector3(0.f, 0.f, 0.f)); |
115 | gSky.setOverrideSun(TRUE); | 110 | gSky.setOverrideSun(TRUE); |
116 | gSavedSettings.setVector3("SkySunDefaultPosition", gCamera->getAtAxis()); | 111 | gSavedSettings.setVector3("SkySunDefaultPosition", LLViewerCamera::getInstance()->getAtAxis()); |
117 | } | 112 | } |
118 | 113 | ||
119 | gViewerWindow->moveCursorToCenter(); | 114 | gViewerWindow->moveCursorToCenter(); |
@@ -137,9 +132,9 @@ void LLToolGun::draw() | |||
137 | { | 132 | { |
138 | if( gSavedSettings.getBOOL("ShowCrosshairs") ) | 133 | if( gSavedSettings.getBOOL("ShowCrosshairs") ) |
139 | { | 134 | { |
140 | gl_draw_image( | 135 | LLUIImagePtr crosshair = LLUI::getUIImage("UIImgCrosshairsUUID"); |
141 | ( gViewerWindow->getWindowWidth() - mCrosshairImg->getWidth() ) / 2, | 136 | crosshair->draw( |
142 | ( gViewerWindow->getWindowHeight() - mCrosshairImg->getHeight() ) / 2, | 137 | ( gViewerWindow->getWindowWidth() - crosshair->getWidth() ) / 2, |
143 | mCrosshairImg ); | 138 | ( gViewerWindow->getWindowHeight() - crosshair->getHeight() ) / 2); |
144 | } | 139 | } |
145 | } | 140 | } |