diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 09:07:21 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-05-15 09:07:21 -0400 |
commit | 5d43bc166d011e911e0492579b2f4f8bf015b48f (patch) | |
tree | ccc4cda5c2c2c3a5689f4a33dcfda2a896f21b8c /indra/newview/llworldmipmap.h | |
parent | a3f2cacf542e1d770698ef6c7e6ea1c0a5cd3368 (diff) | |
parent | e7eced3c87310b15ac20cc3cd470d67686104a14 (diff) |
Merge commit 'e7eced3' into release/luau-scripting: whitespace fix.
Diffstat (limited to 'indra/newview/llworldmipmap.h')
-rw-r--r-- | indra/newview/llworldmipmap.h | 80 |
1 files changed, 40 insertions, 40 deletions
diff --git a/indra/newview/llworldmipmap.h b/indra/newview/llworldmipmap.h index 963aac1403..ab98b55b72 100644 --- a/indra/newview/llworldmipmap.h +++ b/indra/newview/llworldmipmap.h @@ -1,25 +1,25 @@ -/** +/** * @file llworldmipmap.h * @brief Data storage for the S3 mipmap of the entire world. * * $LicenseInfo:firstyear=2003&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$ */ @@ -29,18 +29,18 @@ #include <map> -#include "llmemory.h" // LLPointer -#include "indra_constants.h" // REGION_WIDTH_UNITS -#include "llregionhandle.h" // to_region_handle() +#include "llmemory.h" // LLPointer +#include "indra_constants.h" // REGION_WIDTH_UNITS +#include "llregionhandle.h" // to_region_handle() class LLViewerFetchedTexture; // LLWorldMipmap : Mipmap handling of all the tiles used to render the world at any resolution. -// This class provides a clean structured access to the hierarchy of tiles stored in the +// This class provides a clean structured access to the hierarchy of tiles stored in the // Amazon S3 repository and abstracts its directory/file structure. // The interface of this class though still assumes that the caller knows the general level/tiles // structure (at least, that it exists...) but doesn't requite the caller to know the details of it. -// IOW, you need to know that rendering levels exists as well as grid coordinates for regions, +// IOW, you need to know that rendering levels exists as well as grid coordinates for regions, // but you can ignore where those tiles are located, how to get them, etc... // The class API gives you back LLPointer<LLViewerFetchedTexture> per tile. @@ -52,43 +52,43 @@ class LLViewerFetchedTexture; class LLWorldMipmap { public: - // Parameters of the mipmap - static const S32 MAP_LEVELS = 8; // Number of subresolution levels computed by the mapserver - static const S32 MAP_TILE_SIZE = 256; // Width in pixels of the tiles computed by the mapserver + // Parameters of the mipmap + static const S32 MAP_LEVELS = 8; // Number of subresolution levels computed by the mapserver + static const S32 MAP_TILE_SIZE = 256; // Width in pixels of the tiles computed by the mapserver - LLWorldMipmap(); - ~LLWorldMipmap(); + LLWorldMipmap(); + ~LLWorldMipmap(); - // Clear up the maps and release all image handles - void reset(); - // Manage the boost levels between loops (typically draw() loops) - void equalizeBoostLevels(); - // Drop the boost levels to none (used when hiding the map) - void dropBoostLevels(); - // Get the tile smart pointer, does the loading if necessary - LLPointer<LLViewerFetchedTexture> getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load = true); + // Clear up the maps and release all image handles + void reset(); + // Manage the boost levels between loops (typically draw() loops) + void equalizeBoostLevels(); + // Drop the boost levels to none (used when hiding the map) + void dropBoostLevels(); + // Get the tile smart pointer, does the loading if necessary + LLPointer<LLViewerFetchedTexture> getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load = true); - // Helper functions: those are here as they depend solely on the topology of the mipmap though they don't access it - // Convert sim scale (given in sim width in display pixels) into a mipmap level - static S32 scaleToLevel(F32 scale); - // Convert world coordinates to mipmap grid coordinates at a given level - static void globalToMipmap(F64 global_x, F64 global_y, S32 level, U32* grid_x, U32* grid_y); + // Helper functions: those are here as they depend solely on the topology of the mipmap though they don't access it + // Convert sim scale (given in sim width in display pixels) into a mipmap level + static S32 scaleToLevel(F32 scale); + // Convert world coordinates to mipmap grid coordinates at a given level + static void globalToMipmap(F64 global_x, F64 global_y, S32 level, U32* grid_x, U32* grid_y); private: - // Get a handle (key) from grid coordinates - U64 convertGridToHandle(U32 grid_x, U32 grid_y) { return to_region_handle(grid_x * REGION_WIDTH_UNITS, grid_y * REGION_WIDTH_UNITS); } - // Load the relevant tile from S3 - LLPointer<LLViewerFetchedTexture> loadObjectsTile(U32 grid_x, U32 grid_y, S32 level); - // Clear a level from its "missing" tiles - void cleanMissedTilesFromLevel(S32 level); + // Get a handle (key) from grid coordinates + U64 convertGridToHandle(U32 grid_x, U32 grid_y) { return to_region_handle(grid_x * REGION_WIDTH_UNITS, grid_y * REGION_WIDTH_UNITS); } + // Load the relevant tile from S3 + LLPointer<LLViewerFetchedTexture> loadObjectsTile(U32 grid_x, U32 grid_y, S32 level); + // Clear a level from its "missing" tiles + void cleanMissedTilesFromLevel(S32 level); - // The mipmap is organized by resolution level (MAP_LEVELS of them). Each resolution level is an std::map - // using a region_handle as a key and storing a smart pointer to the image as a value. - typedef std::map<U64, LLPointer<LLViewerFetchedTexture> > sublevel_tiles_t; - sublevel_tiles_t mWorldObjectsMipMap[MAP_LEVELS]; -// sublevel_tiles_t mWorldTerrainMipMap[MAP_LEVELS]; + // The mipmap is organized by resolution level (MAP_LEVELS of them). Each resolution level is an std::map + // using a region_handle as a key and storing a smart pointer to the image as a value. + typedef std::map<U64, LLPointer<LLViewerFetchedTexture> > sublevel_tiles_t; + sublevel_tiles_t mWorldObjectsMipMap[MAP_LEVELS]; +// sublevel_tiles_t mWorldTerrainMipMap[MAP_LEVELS]; - S32 mCurrentLevel; // The level last accessed by a getObjectsTile() + S32 mCurrentLevel; // The level last accessed by a getObjectsTile() }; #endif // LL_LLWORLDMIPMAP_H |