PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llvlcomposition.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 86 lines | 45 code | 13 blank | 28 comment | 0 complexity | dcfe93014daf5777de27f2aa8c4549f3 MD5 | raw file
 1/** 
 2 * @file llvlcomposition.h
 3 * @brief Viewer-side representation of a composition layer...
 4 *
 5 * $LicenseInfo:firstyear=2001&license=viewerlgpl$
 6 * Second Life Viewer Source Code
 7 * Copyright (C) 2010, Linden Research, Inc.
 8 * 
 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License only.
13 * 
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * Lesser General Public License for more details.
18 * 
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
22 * 
23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
24 * $/LicenseInfo$
25 */
26
27#ifndef LL_LLVLCOMPOSITION_H
28#define LL_LLVLCOMPOSITION_H
29
30#include "llviewerlayer.h"
31#include "llviewertexture.h"
32
33class LLSurface;
34
35class LLVLComposition : public LLViewerLayer
36{
37public:
38	LLVLComposition(LLSurface *surfacep, const U32 width, const F32 scale);
39	/*virtual*/ ~LLVLComposition();
40
41	void setSurface(LLSurface *surfacep);
42
43	// Viewer side hack to generate composition values
44	BOOL generateHeights(const F32 x, const F32 y, const F32 width, const F32 height);
45	BOOL generateComposition();
46	// Generate texture from composition values.
47	BOOL generateTexture(const F32 x, const F32 y, const F32 width, const F32 height);		
48
49	// Use these as indeces ito the get/setters below that use 'corner'
50	enum ECorner
51	{
52		SOUTHWEST = 0,
53		SOUTHEAST = 1,
54		NORTHWEST = 2,
55		NORTHEAST = 3,
56		CORNER_COUNT = 4
57	};
58	LLUUID getDetailTextureID(S32 corner);
59	LLViewerFetchedTexture* getDetailTexture(S32 corner);
60	F32 getStartHeight(S32 corner);
61	F32 getHeightRange(S32 corner);
62
63	void setDetailTextureID(S32 corner, const LLUUID& id);
64	void setStartHeight(S32 corner, F32 start_height);
65	void setHeightRange(S32 corner, F32 range);
66
67	friend class LLVOSurfacePatch;
68	friend class LLDrawPoolTerrain;
69	void setParamsReady()		{ mParamsReady = TRUE; }
70	BOOL getParamsReady() const	{ return mParamsReady; }
71protected:
72	BOOL mParamsReady;
73	LLSurface *mSurfacep;
74	BOOL mTexturesLoaded;
75
76	LLPointer<LLViewerFetchedTexture> mDetailTextures[CORNER_COUNT];
77	LLPointer<LLImageRaw> mRawImages[CORNER_COUNT];
78
79	F32 mStartHeight[CORNER_COUNT];
80	F32 mHeightRange[CORNER_COUNT];
81
82	F32 mTexScaleX;
83	F32 mTexScaleY;
84};
85
86#endif //LL_LLVLCOMPOSITION_H