afxStaticShape.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  2. // Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
  3. // Copyright (C) 2015 Faust Logic, Inc.
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to
  7. // deal in the Software without restriction, including without limitation the
  8. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9. // sell copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  21. // IN THE SOFTWARE.
  22. //
  23. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  24. #ifndef _AFX_STATIC_SHAPE_H_
  25. #define _AFX_STATIC_SHAPE_H_
  26. #include "T3D/staticShape.h"
  27. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  28. // afxStaticShapeData
  29. class afxStaticShapeData : public StaticShapeData
  30. {
  31. typedef StaticShapeData Parent;
  32. public:
  33. StringTableEntry sequence;
  34. bool ignore_scene_amb;
  35. bool use_custom_scene_amb;
  36. LinearColorF custom_scene_amb;
  37. bool do_spawn;
  38. public:
  39. /*C*/ afxStaticShapeData();
  40. /*C*/ afxStaticShapeData(const afxStaticShapeData&, bool = false);
  41. void packData(BitStream* stream) override;
  42. void unpackData(BitStream* stream) override;
  43. bool allowSubstitutions() const override { return true; }
  44. static void initPersistFields();
  45. DECLARE_CONOBJECT(afxStaticShapeData);
  46. };
  47. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  48. // afxStaticShape
  49. class afxStaticShape : public StaticShape
  50. {
  51. typedef StaticShape Parent;
  52. private:
  53. StaticShapeData* mDataBlock;
  54. afxStaticShapeData* mAFX_data;
  55. bool mIs_visible;
  56. U32 mChor_id;
  57. bool mHookup_with_chor;
  58. StringTableEntry mGhost_cons_name;
  59. protected:
  60. void prepRenderImage(SceneRenderState*) override;
  61. public:
  62. /*C*/ afxStaticShape();
  63. /*D*/ ~afxStaticShape();
  64. void init(U32 chor_id, StringTableEntry cons_name);
  65. bool onNewDataBlock(GameBaseData* dptr, bool reload) override;
  66. void advanceTime(F32 dt) override;
  67. U32 packUpdate(NetConnection*, U32, BitStream*) override;
  68. void unpackUpdate(NetConnection*, BitStream*) override;
  69. const char* getShapeFileName() const { return mDataBlock->getShapeFile(); }
  70. void setVisibility(bool flag) { mIs_visible = flag; }
  71. DECLARE_CONOBJECT(afxStaticShape);
  72. DECLARE_CATEGORY("UNLISTED");
  73. };
  74. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  75. #endif // _AFX_STATIC_SHAPE_H_