aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender/lltextureatlas.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/llrender/lltextureatlas.h92
1 files changed, 0 insertions, 92 deletions
diff --git a/linden/indra/llrender/lltextureatlas.h b/linden/indra/llrender/lltextureatlas.h
deleted file mode 100644
index 4922175..0000000
--- a/linden/indra/llrender/lltextureatlas.h
+++ /dev/null
@@ -1,92 +0,0 @@
1/**
2 * @file lltextureatlas.h
3 * @brief LLTextureAtlas base class.
4 *
5 * $LicenseInfo:firstyear=2002&license=viewergpl$
6 *
7 * Copyright (c) 2002-2009, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at
21 * http://secondlifegrid.net/programs/open_source/licensing/flossexception
22 *
23 * By copying, modifying or distributing this software, you acknowledge
24 * that you have read and understood your obligations described above,
25 * and agree to abide by those obligations.
26 *
27 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
28 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
29 * COMPLETENESS OR PERFORMANCE.
30 * $/LicenseInfo$
31 */
32
33
34#ifndef LL_TEXTUREATLAS_H
35#define LL_TEXTUREATLAS_H
36
37#include "llimagegl.h"
38class LLSpatialGroup ;
39
40class LLTextureAtlas : public LLImageGL
41{
42public:
43 LLTextureAtlas(U8 ncomponents, S16 atlas_dim = 16) ;
44 ~LLTextureAtlas() ;
45
46 LLGLuint insertSubTexture(const LLImageRaw* raw_image, S16 slot_col, S16 slot_row) ;
47 void releaseSlot(S16 slot_col, S16 slot_row, S8 slot_width);
48
49 BOOL getNextAvailableSlot(S8 bits_len, S16& col, S16& row) ;
50 void getTexCoordOffset(S16 col, S16 row, F32& xoffset, F32& yOffset) ;
51 void getTexCoordScale(S32 w, S32 h, F32& xscale, F32& yscale) ;
52
53 BOOL isEmpty() const ;
54 BOOL isFull(S8 to_be_reserved = 1) const ;
55 F32 getFullness() const ;
56
57 void addSpatialGroup(LLSpatialGroup* groupp) ;
58 void removeSpatialGroup(LLSpatialGroup* groupp) ;
59 LLSpatialGroup* getLastSpatialGroup() ;
60 void removeLastSpatialGroup() ;
61 BOOL hasSpatialGroup(LLSpatialGroup* groupp) ;
62 void clearSpatialGroup() ;
63 std::list<LLSpatialGroup*>* getSpatialGroupList() {return &mSpatialGroupList;}
64private:
65 void generateEmptyUsageBits() ;
66 void releaseUsageBits() ;
67
68 void markUsageBits(S8 bits_len, U8 mask, S16 col, S16 row) ;
69 void unmarkUsageBits(S8 bits_len, S16 col, S16 row) ;
70
71 void getPositionFromIndex(S16 index, S16& col, S16& row) ;
72 void getIndexFromPosition(S16 col, S16 row, S16& index) ;
73 BOOL areUsageBitsMarked(S8 bits_len, U8 mask, S16 col, S16 row) ;
74
75private:
76 S16 mAtlasDim ; //number of slots per edge, i.e, there are "mAtlasDim * mAtlasDim" total slots in the atlas.
77 S16 mNumSlotsReserved ;
78 S16 mMaxSlotsInAtlas ;
79 U8 **mUsageBits ;
80 std::list<LLSpatialGroup*> mSpatialGroupList ;
81
82public:
83 //debug use only
84 U8 **mTestBits ;
85
86public:
87 static S16 sMaxSubTextureSize ;
88 static S16 sSlotSize ;
89};
90
91#endif
92