MLR_I_L_DeT_PMesh.hpp 3.2 KB

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