From 1b68f71348ecf3983b76b40d7940da8377f049b7 Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 29 Apr 2024 07:43:28 +0300 Subject: #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed --- indra/newview/llfloatermap.cpp | 182 ++++++++++++++++++++--------------------- 1 file changed, 91 insertions(+), 91 deletions(-) (limited to 'indra/newview/llfloatermap.cpp') diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index fd1af7ccc0..6b7f52b0d0 100755 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -1,25 +1,25 @@ -/** +/** * @file llfloatermap.cpp * @brief The "mini-map" or radar in the upper right part of the screen. * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -57,17 +57,17 @@ const F32 MAP_MINOR_DIR_THRESHOLD = 0.035f; // Member functions // -LLFloaterMap::LLFloaterMap(const LLSD& key) - : LLFloater(key), - mTextBoxEast(NULL), - mTextBoxNorth(NULL), - mTextBoxWest(NULL), - mTextBoxSouth(NULL), - mTextBoxSouthEast(NULL), - mTextBoxNorthEast(NULL), - mTextBoxNorthWest(NULL), - mTextBoxSouthWest(NULL), - mMap(NULL) +LLFloaterMap::LLFloaterMap(const LLSD& key) + : LLFloater(key), + mTextBoxEast(NULL), + mTextBoxNorth(NULL), + mTextBoxWest(NULL), + mTextBoxSouth(NULL), + mTextBoxSouthEast(NULL), + mTextBoxNorthEast(NULL), + mTextBoxNorthWest(NULL), + mTextBoxSouthWest(NULL), + mMap(NULL) { } @@ -119,32 +119,32 @@ BOOL LLFloaterMap::postBuild() BOOL LLFloaterMap::handleDoubleClick(S32 x, S32 y, MASK mask) { - // If floater is minimized, minimap should be shown on doubleclick (STORM-299) - if (isMinimized()) - { - setMinimized(FALSE); - return TRUE; - } - - LLVector3d pos_global = mMap->viewPosToGlobal(x, y); - - LLTracker::stopTracking(false); - LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance(); - if (world_map) - { - world_map->trackLocation(pos_global); - } - - if (gSavedSettings.getBOOL("DoubleClickTeleport")) - { - // If DoubleClickTeleport is on, double clicking the minimap will teleport there - gAgent.teleportViaLocationLookAt(pos_global); - } - else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap")) - { - LLFloaterReg::showInstance("world_map"); - } - return TRUE; + // If floater is minimized, minimap should be shown on doubleclick (STORM-299) + if (isMinimized()) + { + setMinimized(FALSE); + return TRUE; + } + + LLVector3d pos_global = mMap->viewPosToGlobal(x, y); + + LLTracker::stopTracking(false); + LLFloaterWorldMap* world_map = LLFloaterWorldMap::getInstance(); + if (world_map) + { + world_map->trackLocation(pos_global); + } + + if (gSavedSettings.getBOOL("DoubleClickTeleport")) + { + // If DoubleClickTeleport is on, double clicking the minimap will teleport there + gAgent.teleportViaLocationLookAt(pos_global); + } + else if (gSavedSettings.getBOOL("DoubleClickShowWorldMap")) + { + LLFloaterReg::showInstance("world_map"); + } + return TRUE; } void LLFloaterMap::setDirectionPos(LLTextBox *text_box, F32 rotation) @@ -189,66 +189,66 @@ void LLFloaterMap::setDirectionPos(LLTextBox *text_box, F32 rotation) void LLFloaterMap::updateMinorDirections() { - if (mTextBoxNorthEast == NULL) - { - return; - } - - // Hide minor directions if they cover too much of the map - bool show_minors = mTextBoxNorthEast->getRect().getHeight() < MAP_MINOR_DIR_THRESHOLD * - llmin(getRect().getWidth(), getRect().getHeight()); - - mTextBoxNorthEast->setVisible(show_minors); - mTextBoxNorthWest->setVisible(show_minors); - mTextBoxSouthWest->setVisible(show_minors); - mTextBoxSouthEast->setVisible(show_minors); + if (mTextBoxNorthEast == NULL) + { + return; + } + + // Hide minor directions if they cover too much of the map + bool show_minors = mTextBoxNorthEast->getRect().getHeight() < MAP_MINOR_DIR_THRESHOLD * + llmin(getRect().getWidth(), getRect().getHeight()); + + mTextBoxNorthEast->setVisible(show_minors); + mTextBoxNorthWest->setVisible(show_minors); + mTextBoxSouthWest->setVisible(show_minors); + mTextBoxSouthEast->setVisible(show_minors); } // virtual void LLFloaterMap::draw() { - F32 rotation = 0; - - static LLUICachedControl rotate_map("MiniMapRotate", true); - if( rotate_map ) - { - // rotate subsequent draws to agent rotation - rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); - } - - setDirectionPos( mTextBoxEast, rotation ); - setDirectionPos( mTextBoxNorth, rotation + F_PI_BY_TWO ); - setDirectionPos( mTextBoxWest, rotation + F_PI ); - setDirectionPos( mTextBoxSouth, rotation + F_PI + F_PI_BY_TWO ); - - setDirectionPos( mTextBoxNorthEast, rotation + F_PI_BY_TWO / 2); - setDirectionPos( mTextBoxNorthWest, rotation + F_PI_BY_TWO + F_PI_BY_TWO / 2); - setDirectionPos( mTextBoxSouthWest, rotation + F_PI + F_PI_BY_TWO / 2); - setDirectionPos( mTextBoxSouthEast, rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); - - // Note: we can't just gAgent.check cameraMouselook() because the transition states are wrong. - if(gAgentCamera.cameraMouselook()) - { - setMouseOpaque(FALSE); - getDragHandle()->setMouseOpaque(FALSE); - } - else - { - setMouseOpaque(TRUE); - getDragHandle()->setMouseOpaque(TRUE); - } - - LLFloater::draw(); + F32 rotation = 0; + + static LLUICachedControl rotate_map("MiniMapRotate", true); + if( rotate_map ) + { + // rotate subsequent draws to agent rotation + rotation = atan2( LLViewerCamera::getInstance()->getAtAxis().mV[VX], LLViewerCamera::getInstance()->getAtAxis().mV[VY] ); + } + + setDirectionPos( mTextBoxEast, rotation ); + setDirectionPos( mTextBoxNorth, rotation + F_PI_BY_TWO ); + setDirectionPos( mTextBoxWest, rotation + F_PI ); + setDirectionPos( mTextBoxSouth, rotation + F_PI + F_PI_BY_TWO ); + + setDirectionPos( mTextBoxNorthEast, rotation + F_PI_BY_TWO / 2); + setDirectionPos( mTextBoxNorthWest, rotation + F_PI_BY_TWO + F_PI_BY_TWO / 2); + setDirectionPos( mTextBoxSouthWest, rotation + F_PI + F_PI_BY_TWO / 2); + setDirectionPos( mTextBoxSouthEast, rotation + F_PI + F_PI_BY_TWO + F_PI_BY_TWO / 2); + + // Note: we can't just gAgent.check cameraMouselook() because the transition states are wrong. + if(gAgentCamera.cameraMouselook()) + { + setMouseOpaque(FALSE); + getDragHandle()->setMouseOpaque(FALSE); + } + else + { + setMouseOpaque(TRUE); + getDragHandle()->setMouseOpaque(TRUE); + } + + LLFloater::draw(); } void LLFloaterMap::reshape(S32 width, S32 height, BOOL called_from_parent) { - LLFloater::reshape(width, height, called_from_parent); - - updateMinorDirections(); + LLFloater::reshape(width, height, called_from_parent); + + updateMinorDirections(); } LLFloaterMap* LLFloaterMap::getInstance() { - return LLFloaterReg::getTypedInstance("mini_map"); + return LLFloaterReg::getTypedInstance("mini_map"); } -- cgit v1.2.3