MLR_I_L_DT_TMesh.hpp 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. //===========================================================================//
  2. // Copyright (C) Microsoft Corporation. All rights reserved. //
  3. //===========================================================================//
  4. #pragma once
  5. #define MLR_MLR_I_L_DT_TMESH_HPP
  6. #include <MLR\MLR.hpp>
  7. #include <MLR\MLR_I_C_TMesh.hpp>
  8. #include <MLR\MLR_I_L_PMesh.hpp>
  9. namespace MidLevelRenderer {
  10. //##########################################################################
  11. //#### MLRIndexedTriMesh with no color no lighting one texture layer #####
  12. //##########################################################################
  13. class MLR_I_L_DT_TMesh:
  14. public MLR_I_C_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_L_DT_TMesh(
  29. ClassData *class_data,
  30. Stuff::MemoryStream *stream,
  31. int version
  32. );
  33. ~MLR_I_L_DT_TMesh();
  34. public:
  35. MLR_I_L_DT_TMesh(ClassData *class_data=MLR_I_L_DT_TMesh::DefaultData);
  36. static MLR_I_L_DT_TMesh*
  37. Make(
  38. Stuff::MemoryStream *stream,
  39. int version
  40. );
  41. void
  42. Save(Stuff::MemoryStream *stream);
  43. public:
  44. virtual void
  45. SetNormalData(
  46. const Stuff::Vector3D *array,
  47. int point_count
  48. );
  49. virtual void
  50. GetNormalData(
  51. Stuff::Vector3D **array,
  52. int *point_count
  53. );
  54. #if COLOR_AS_DWORD
  55. virtual void
  56. SetColorData(
  57. const DWORD *array,
  58. int point_count
  59. );
  60. #else
  61. virtual void
  62. SetColorData(
  63. const Stuff::RGBAColor *array,
  64. int point_count
  65. );
  66. #endif
  67. virtual void Lighting(MLRLight* const*, int nrLights);
  68. virtual void
  69. #if COLOR_AS_DWORD
  70. PaintMe(const DWORD *paintMe);
  71. #else
  72. PaintMe(const Stuff::RGBAColor *paintMe);
  73. #endif
  74. virtual int
  75. TransformAndClip(Stuff::Matrix4D *, MLRClippingState, GOSVertexPool*,bool=false);
  76. virtual void
  77. TransformNoClip(Stuff::Matrix4D*, GOSVertexPool*,bool=false);
  78. bool
  79. Copy(MLR_I_L_DT_PMesh*);
  80. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  81. // Class Data Support
  82. //
  83. public:
  84. static ClassData
  85. *DefaultData;
  86. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  87. // Testing
  88. //
  89. public:
  90. void
  91. TestInstance() const;
  92. virtual int
  93. GetSize()
  94. {
  95. Check_Object(this);
  96. int ret = MLR_I_C_DT_TMesh::GetSize();
  97. ret += normals.GetSize();
  98. ret += litColors.GetSize();
  99. return ret;
  100. }
  101. protected:
  102. Stuff::DynamicArrayOf<Stuff::Vector3D> normals; // Base address of normal list
  103. #if COLOR_AS_DWORD
  104. Stuff::DynamicArrayOf<DWORD> litColors;
  105. #else
  106. Stuff::DynamicArrayOf<Stuff::RGBAColor> litColors;
  107. #endif
  108. };
  109. // MLR_I_L_DT_TMesh*
  110. // CreateIndexedTriCube_NoColor_NoLit(Stuff::Scalar, MLRState*);
  111. MLRShape*
  112. CreateIndexedTriIcosahedron_Color_Lit_2Tex(
  113. IcoInfo&,
  114. MLRState*,
  115. MLRState*
  116. );
  117. }