llvlcomposition.h
上传用户:king477883
上传日期:2021-03-01
资源大小:9553k
文件大小:3k
源码类别:

游戏引擎

开发平台:

C++ Builder

  1. /** 
  2.  * @file llvlcomposition.h
  3.  * @brief Viewer-side representation of a composition layer...
  4.  *
  5.  * $LicenseInfo:firstyear=2001&license=viewergpl$
  6.  * 
  7.  * Copyright (c) 2001-2010, 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. #ifndef LL_LLVLCOMPOSITION_H
  33. #define LL_LLVLCOMPOSITION_H
  34. #include "llviewerlayer.h"
  35. #include "llviewertexture.h"
  36. class LLSurface;
  37. class LLVLComposition : public LLViewerLayer
  38. {
  39. public:
  40. LLVLComposition(LLSurface *surfacep, const U32 width, const F32 scale);
  41. /*virtual*/ ~LLVLComposition();
  42. void setSurface(LLSurface *surfacep);
  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. // Use these as indeces ito the get/setters below that use 'corner'
  49. enum ECorner
  50. {
  51. SOUTHWEST = 0,
  52. SOUTHEAST = 1,
  53. NORTHWEST = 2,
  54. NORTHEAST = 3,
  55. CORNER_COUNT = 4
  56. };
  57. LLUUID getDetailTextureID(S32 corner);
  58. LLViewerFetchedTexture* getDetailTexture(S32 corner);
  59. F32 getStartHeight(S32 corner);
  60. F32 getHeightRange(S32 corner);
  61. void setDetailTextureID(S32 corner, const LLUUID& id);
  62. void setStartHeight(S32 corner, F32 start_height);
  63. void setHeightRange(S32 corner, F32 range);
  64. friend class LLVOSurfacePatch;
  65. friend class LLDrawPoolTerrain;
  66. void setParamsReady() { mParamsReady = TRUE; }
  67. BOOL getParamsReady() const { return mParamsReady; }
  68. protected:
  69. BOOL mParamsReady;
  70. LLSurface *mSurfacep;
  71. BOOL mTexturesLoaded;
  72. LLPointer<LLViewerFetchedTexture> mDetailTextures[CORNER_COUNT];
  73. LLPointer<LLImageRaw> mRawImages[CORNER_COUNT];
  74. F32 mStartHeight[CORNER_COUNT];
  75. F32 mHeightRange[CORNER_COUNT];
  76. F32 mTexScaleX;
  77. F32 mTexScaleY;
  78. };
  79. #endif //LL_LLVLCOMPOSITION_H