MLR_I_C_DeT_TMesh.hpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #pragma once
  5. #define MLR_MLR_I_C_DET_TMESH_HPP
  6. #include <MLR\MLR.hpp>
  7. #include <MLR\MLR_I_DeT_TMesh.hpp>
  8. #include <MLR\MLR_I_C_DeT_PMesh.hpp>
  9. namespace MidLevelRenderer {
  10. //##########################################################################
  11. //###### MLRIndexedTriMesh with color no lighting and detail texture #######
  12. //##########################################################################
  13. class MLR_I_C_DeT_TMesh:
  14. public MLR_I_DeT_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_DeT_TMesh(
  29. ClassData *class_data,
  30. Stuff::MemoryStream *stream,
  31. int version
  32. );
  33. ~MLR_I_C_DeT_TMesh();
  34. public:
  35. MLR_I_C_DeT_TMesh(ClassData *class_data=MLR_I_C_DeT_TMesh::DefaultData);
  36. static MLR_I_C_DeT_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. void
  77. Copy(
  78. MLR_I_C_TMesh*,
  79. MLRState detailState,
  80. Stuff::Scalar xOff,
  81. Stuff::Scalar yOff,
  82. Stuff::Scalar xFac,
  83. Stuff::Scalar yFac
  84. );
  85. bool
  86. Copy(MLR_I_C_DeT_PMesh*);
  87. virtual void
  88. HurtMe(const Stuff::LinearMatrix4D&, Stuff::Scalar radius);
  89. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  90. // Class Data Support
  91. //
  92. public:
  93. static ClassData
  94. *DefaultData;
  95. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  96. // Testing
  97. //
  98. public:
  99. void
  100. TestInstance() const;
  101. virtual int
  102. GetSize()
  103. {
  104. Check_Object(this);
  105. int ret = MLR_I_DeT_TMesh::GetSize();
  106. ret += colors.GetSize();
  107. return ret;
  108. }
  109. protected:
  110. #if COLOR_AS_DWORD
  111. Stuff::DynamicArrayOf<DWORD> colors; // Base address of color list
  112. Stuff::DynamicArrayOf<DWORD> *actualColors;
  113. #else
  114. Stuff::DynamicArrayOf<Stuff::RGBAColor> colors; // Base address of color list
  115. Stuff::DynamicArrayOf<Stuff::RGBAColor> *actualColors;
  116. #endif
  117. };
  118. MLR_I_C_DeT_TMesh*
  119. CreateIndexedTriCube_Color_NoLit_DetTex(Stuff::Scalar, MLRState*);
  120. MLRShape*
  121. CreateIndexedTriIcosahedron_Color_NoLit_DetTex (
  122. IcoInfo&,
  123. MLRState*,
  124. MLRState*
  125. );
  126. }