MLR_I_C_DT_TMesh.hpp 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #pragma once
  5. #define MLR_MLR_I_C_DT_TMESH_HPP
  6. #include <MLR\MLR.hpp>
  7. #include <MLR\MLR_I_TMesh.hpp>
  8. #include <MLR\MLR_I_C_PMesh.hpp>
  9. namespace MidLevelRenderer {
  10. //##########################################################################
  11. //###### MLRIndexedTriMesh with color no lighting two texture layer #######
  12. //##########################################################################
  13. class MLR_I_C_DT_TMesh:
  14. public MLR_I_DT_TMesh
  15. {
  16. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  17. // Initialization
  18. //
  19. public:
  20. static void
  21. InitializeClass();
  22. static void
  23. TerminateClass();
  24. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. // Constructors/Destructors
  26. //
  27. protected:
  28. MLR_I_C_DT_TMesh(
  29. ClassData *class_data,
  30. Stuff::MemoryStream *stream,
  31. int version
  32. );
  33. ~MLR_I_C_DT_TMesh();
  34. public:
  35. MLR_I_C_DT_TMesh(ClassData *class_data=MLR_I_C_DT_TMesh::DefaultData);
  36. static MLR_I_C_DT_TMesh*
  37. Make(
  38. Stuff::MemoryStream *stream,
  39. int version
  40. );
  41. void
  42. Save(Stuff::MemoryStream *stream);
  43. public:
  44. #if COLOR_AS_DWORD
  45. virtual void
  46. SetColorData(
  47. const DWORD *array,
  48. int point_count
  49. );
  50. virtual void
  51. GetColorData(
  52. DWORD **array,
  53. int *point_count
  54. );
  55. #else
  56. virtual void
  57. SetColorData(
  58. const Stuff::RGBAColor *array,
  59. int point_count
  60. );
  61. virtual void
  62. GetColorData(
  63. Stuff::RGBAColor **array,
  64. int *point_count
  65. );
  66. #endif
  67. virtual void
  68. #if COLOR_AS_DWORD
  69. PaintMe(const DWORD *paintMe);
  70. #else
  71. PaintMe(const Stuff::RGBAColor *paintMe);
  72. #endif
  73. virtual int TransformAndClip(Stuff::Matrix4D *, MLRClippingState, GOSVertexPool*,bool=false);
  74. virtual void
  75. TransformNoClip(Stuff::Matrix4D*, GOSVertexPool*,bool=false);
  76. bool
  77. Copy(MLR_I_C_DT_PMesh*);
  78. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  79. // Class Data Support
  80. //
  81. public:
  82. static ClassData
  83. *DefaultData;
  84. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  85. // Testing
  86. //
  87. public:
  88. void
  89. TestInstance() const;
  90. virtual int
  91. GetSize()
  92. {
  93. Check_Object(this);
  94. int ret = MLR_I_DT_TMesh::GetSize();
  95. ret += colors.GetSize();
  96. return ret;
  97. }
  98. protected:
  99. #if COLOR_AS_DWORD
  100. Stuff::DynamicArrayOf<DWORD> colors; // Base address of color list
  101. Stuff::DynamicArrayOf<DWORD> *actualColors;
  102. #else
  103. Stuff::DynamicArrayOf<Stuff::RGBAColor> colors; // Base address of color list
  104. Stuff::DynamicArrayOf<Stuff::RGBAColor> *actualColors;
  105. #endif
  106. };
  107. MLR_I_C_DT_TMesh*
  108. CreateIndexedTriCube_Color_NoLit_2Tex(Stuff::Scalar, MLRState*);
  109. MLRShape*
  110. CreateIndexedTriIcosahedron_Color_NoLit_2Tex(
  111. IcoInfo&,
  112. MLRState*,
  113. MLRState*
  114. );
  115. }