MLR_I_C_DeT_PMesh.hpp 3.3 KB

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