lltexglobalcolor.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /**
  2. * @file lltexglobalcolor.h
  3. * @brief This is global texture color info used by llavatarappearance.
  4. *
  5. * $LicenseInfo:firstyear=2008&license=viewergpl$
  6. *
  7. * Copyright (c) 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_LLTEXGLOBALCOLOR_H
  33. #define LL_LLTEXGLOBALCOLOR_H
  34. #include "llpreprocessor.h"
  35. #include "lltexlayer.h"
  36. #include "lltexlayerparams.h"
  37. class LLAvatarAppearance;
  38. class LLTexGlobalColorInfo;
  39. class LLWearable;
  40. class LLTexGlobalColor
  41. {
  42. public:
  43. LLTexGlobalColor(LLAvatarAppearance* appearance);
  44. #if 0
  45. ~LLTexGlobalColor();
  46. #endif
  47. LL_INLINE LLTexGlobalColorInfo* getInfo() const { return mInfo; }
  48. // This sets mInfo and calls initialization functions
  49. bool setInfo(LLTexGlobalColorInfo* info);
  50. LL_INLINE LLAvatarAppearance* getAvatarAppearance() const { return mAvatarAppearance; }
  51. LLColor4 getColor() const;
  52. const std::string& getName() const;
  53. private:
  54. param_color_list_t mParamGlobalColorList;
  55. LLAvatarAppearance* mAvatarAppearance; // just backlink, don't LLPointer
  56. LLTexGlobalColorInfo* mInfo;
  57. };
  58. // Used by llavatarappearance to determine skin/eye/hair color.
  59. class LLTexGlobalColorInfo
  60. {
  61. friend class LLTexGlobalColor;
  62. protected:
  63. LOG_CLASS(LLTexGlobalColorInfo);
  64. public:
  65. LLTexGlobalColorInfo() = default;
  66. ~LLTexGlobalColorInfo();
  67. bool parseXml(LLXmlTreeNode* node);
  68. private:
  69. param_color_info_list_t mParamColorInfoList;
  70. std::string mName;
  71. };
  72. class alignas(16) LLTexParamGlobalColor : public LLTexLayerParamColor
  73. {
  74. public:
  75. LLTexParamGlobalColor(LLTexGlobalColor* tex_color);
  76. LLViewerVisualParam* cloneParam(LLWearable* wearable) const override;
  77. protected:
  78. LLTexParamGlobalColor(const LLTexParamGlobalColor& other);
  79. void onGlobalColorChanged(bool upload_bake) override;
  80. private:
  81. LLTexGlobalColor* mTexGlobalColor;
  82. };
  83. #endif