meshdam.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : WW3D *
  23. * *
  24. * $Archive:: /Commando/Code/ww3d2/meshdam.h $*
  25. * *
  26. * $Author:: Greg_h $*
  27. * *
  28. * $Modtime:: 1/08/01 10:04a $*
  29. * *
  30. * $Revision:: 1 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if 0
  36. #if defined(_MSC_VER)
  37. #pragma once
  38. #endif
  39. #ifndef MESHDAM_H
  40. #define MESHDAM_H
  41. #include "always.h"
  42. #include "vector3.h"
  43. #include "bittype.h"
  44. #include "w3derr.h"
  45. class MeshModelClass;
  46. class ChunkLoadClass;
  47. struct RGBStruct
  48. {
  49. uint8 R,G,B;
  50. };
  51. struct DamageVertexStruct
  52. {
  53. int VertexIdx; // index of the vertex to "damage"
  54. Vector3 Vertex0; // original vertex position
  55. Vector3 Vertex1; // damaged vertex position
  56. };
  57. struct DamageColorStruct
  58. {
  59. int VertexIdx; // index of the vertex to damage.
  60. RGBStruct Color0; // original color.
  61. RGBStruct Color1; // damaged color.
  62. };
  63. /*
  64. ** DamageClass - this class encapsulates the information needed
  65. ** to apply damage to meshes. It contains replacement vertices,
  66. ** vertex colors and materials
  67. */
  68. class DamageClass
  69. {
  70. public:
  71. DamageClass(void);
  72. ~DamageClass(void);
  73. WW3DErrorType Load_W3D(ChunkLoadClass & cload,MeshModelClass * basemesh);
  74. protected:
  75. WW3DErrorType read_vertices(ChunkLoadClass & cload,MeshModelClass * basemesh);
  76. WW3DErrorType read_colors(ChunkLoadClass & cload,MeshModelClass * basemesh);
  77. int DamageIndex;
  78. int NumMaterials;
  79. int NumVerts;
  80. int NumColors;
  81. DamageVertexStruct * Verts;
  82. DamageColorStruct * Colors;
  83. friend class MeshClass;
  84. };
  85. #endif
  86. #endif //0