MLR_I_C_DT_PMesh.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #pragma once
  5. #define MLR_MLR_I_C_DT_PMESH_HPP
  6. #if !defined(MLR_MLR_HPP)
  7. #include <MLR\MLR.hpp>
  8. #endif
  9. #if !defined(MLR_MLR_I_DT_PMESH_HPP)
  10. #include <MLR\MLR_I_DT_PMesh.hpp>
  11. #endif
  12. namespace MidLevelRenderer {
  13. //##########################################################################
  14. //#### MLRIndexedPolyMesh with color but no lighting two texture layers ####
  15. //##########################################################################
  16. class MLR_I_C_DT_PMesh:
  17. public MLR_I_DT_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_DT_PMesh(
  32. ClassData *class_data,
  33. Stuff::MemoryStream *stream,
  34. int version
  35. );
  36. ~MLR_I_C_DT_PMesh();
  37. public:
  38. MLR_I_C_DT_PMesh(ClassData *class_data=MLR_I_C_DT_PMesh::DefaultData);
  39. static MLR_I_C_DT_PMesh*
  40. Make(
  41. Stuff::MemoryStream *stream,
  42. int version
  43. );
  44. void
  45. Save(Stuff::MemoryStream *stream);
  46. public:
  47. #if COLOR_AS_DWORD
  48. virtual void
  49. SetColorData(
  50. const DWORD *array,
  51. int point_count
  52. );
  53. virtual void
  54. GetColorData(
  55. DWORD **array,
  56. int *point_count
  57. );
  58. #else
  59. virtual void
  60. SetColorData(
  61. const Stuff::RGBAColor *array,
  62. int point_count
  63. );
  64. virtual void
  65. GetColorData(
  66. Stuff::RGBAColor **array,
  67. int *point_count
  68. );
  69. #endif
  70. virtual void
  71. #if COLOR_AS_DWORD
  72. PaintMe(const DWORD *paintMe);
  73. #else
  74. PaintMe(const Stuff::RGBAColor *paintMe);
  75. #endif
  76. virtual int TransformAndClip(Stuff::Matrix4D *, MLRClippingState, GOSVertexPool*,bool=false);
  77. virtual void
  78. TransformNoClip(Stuff::Matrix4D*, GOSVertexPool*,bool=false);
  79. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  80. // Class Data Support
  81. //
  82. public:
  83. static ClassData
  84. *DefaultData;
  85. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. // Testing
  87. //
  88. public:
  89. void
  90. TestInstance() const;
  91. virtual int
  92. GetSize()
  93. {
  94. Check_Object(this);
  95. int ret = MLR_I_DT_PMesh::GetSize();
  96. ret += colors.GetSize();
  97. return ret;
  98. }
  99. protected:
  100. #if COLOR_AS_DWORD
  101. Stuff::DynamicArrayOf<DWORD> colors; // Base address of color list
  102. #else
  103. Stuff::DynamicArrayOf<Stuff::RGBAColor> colors; // Base address of color list
  104. #endif
  105. };
  106. MLR_I_C_DT_PMesh*
  107. CreateIndexedCube_Color_NoLit_2Tex(Stuff::Scalar, Stuff::RGBAColor*, MLRState*, MLRState*);
  108. MLRShape*
  109. CreateIndexedIcosahedron_Color_NoLit_2Tex(
  110. IcoInfo&,
  111. MLRState*,
  112. MLRState*
  113. );
  114. }