levelInfo.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. #ifndef _LEVELINFO_H_
  23. #define _LEVELINFO_H_
  24. #ifndef _NETOBJECT_H_
  25. #include "sim/netObject.h"
  26. #endif
  27. #ifndef _COLOR_H_
  28. #include "core/color.h"
  29. #endif
  30. #ifndef _FOGSTRUCTS_H_
  31. #include "scene/fogStructs.h"
  32. #endif
  33. #ifndef _SFXCOMMON_H_
  34. #include "sfx/sfxCommon.h"
  35. #endif
  36. #ifndef _GFXTEXTUREHANDLE_H_
  37. #include "gfx/gfxTextureHandle.h"
  38. #endif
  39. #include "T3D/assets/ImageAsset.h"
  40. class SFXAmbience;
  41. class SFXSoundscape;
  42. class LevelInfo : public NetObject
  43. {
  44. typedef NetObject Parent;
  45. private:
  46. F32 mWorldSize;
  47. FogData mFogData;
  48. F32 mNearClip;
  49. F32 mVisibleDistance;
  50. F32 mVisibleGhostDistance;
  51. F32 mDecalBias;
  52. ColorI mCanvasClearColor;
  53. /// @name Lighting Properties
  54. /// @{
  55. bool mAdvancedLightmapSupport;
  56. /// Seconds it takes to go from one global ambient color
  57. /// to a different one.
  58. F32 mAmbientLightBlendPhase;
  59. /// Interpolation for going from one global ambient color
  60. /// to a different one.
  61. EaseF mAmbientLightBlendCurve;
  62. /// @}
  63. /// @name Sound Properties
  64. /// @{
  65. /// Global ambient sound space properties.
  66. SFXAmbience* mSoundAmbience;
  67. /// Distance attenuation model to use.
  68. SFXDistanceModel mSoundDistanceModel;
  69. ///
  70. SFXSoundscape* mSoundscape;
  71. /// @}
  72. /// Responsible for passing on
  73. /// the LevelInfo settings to the
  74. /// client SceneGraph, from which
  75. /// other systems can get at them.
  76. void _updateSceneGraph();
  77. void _onLMActivate(const char *lm, bool enable);
  78. protected:
  79. DECLARE_IMAGEASSET(LevelInfo, AccuTexture, onAccuTextureChanged, GFXStaticTextureSRGBProfile);
  80. DECLARE_ASSET_SETGET(LevelInfo, AccuTexture);
  81. void onAccuTextureChanged() {}
  82. public:
  83. LevelInfo();
  84. virtual ~LevelInfo();
  85. DECLARE_CONOBJECT(LevelInfo);
  86. /// @name SceneObject Inheritance
  87. /// @{
  88. virtual SFXAmbience* getSoundAmbience() const { return mSoundAmbience; }
  89. /// @}
  90. /// @name SimObject Inheritance
  91. /// @{
  92. virtual bool onAdd();
  93. virtual void onRemove();
  94. virtual void inspectPostApply();
  95. static void initPersistFields();
  96. /// @}
  97. /// @name NetObject Inheritance
  98. /// @{
  99. enum NetMaskBits
  100. {
  101. UpdateMask = BIT(0)
  102. };
  103. virtual U32 packUpdate( NetConnection *conn, U32 mask, BitStream *stream );
  104. virtual void unpackUpdate( NetConnection *conn, BitStream *stream );
  105. static bool _setLevelAccuTexture(void *object, const char *index, const char *data);
  106. void setLevelAccuTexture(StringTableEntry name);
  107. /// @}
  108. };
  109. #endif // _LEVELINFO_H_