dx8polygonrenderer.cpp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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/dx8polygonrenderer.cpp $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 2/12/02 2:34p $*
  31. * *
  32. * $Revision:: 12 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #include "dx8polygonrenderer.h"
  38. #include "dx8renderer.h"
  39. // ----------------------------------------------------------------------------
  40. DX8PolygonRendererClass::DX8PolygonRendererClass(
  41. unsigned index_count_,
  42. MeshClass* mesh_,
  43. DX8TextureCategoryClass* tex_cat,
  44. unsigned vertex_offset_,
  45. unsigned index_offset_,
  46. bool strip_)
  47. :
  48. mesh(mesh_),
  49. texture_category(tex_cat),
  50. index_offset(index_offset_),
  51. vertex_offset(vertex_offset_),
  52. min_vertex_index(0),
  53. vertex_index_range(0),
  54. index_count(index_count_),
  55. strip(strip_)
  56. {
  57. WWASSERT(index_count);
  58. mesh->PolygonRendererList.Add_Tail(this);
  59. }
  60. DX8PolygonRendererClass::DX8PolygonRendererClass(const DX8PolygonRendererClass& src,MeshClass* mesh_)
  61. :
  62. mesh(mesh_),
  63. texture_category(src.texture_category),
  64. index_offset(src.index_offset),
  65. vertex_offset(src.vertex_offset),
  66. min_vertex_index(src.min_vertex_index),
  67. vertex_index_range(src.vertex_index_range),
  68. index_count(src.index_count),
  69. strip(src.strip)
  70. {
  71. mesh->PolygonRendererList.Add_Tail(this);
  72. }
  73. DX8PolygonRendererClass::~DX8PolygonRendererClass()
  74. {
  75. if (texture_category) texture_category->Remove_Polygon_Renderer(this);
  76. }
  77. // ----------------------------------------------------------------------------
  78. void DX8PolygonRendererClass::Log()
  79. {
  80. StringClass work(true);
  81. work.Format(" %8d %8d %6d %6d %6d %s\n",
  82. index_count,
  83. index_count/3,
  84. index_offset,
  85. min_vertex_index,
  86. vertex_index_range,
  87. mesh->Get_Name());
  88. /* work.Format(
  89. " Index count: %d (%d polys) i_offset: %d min_vi: %d vi_range: %d ident: %d (%s)\n",
  90. index_count,
  91. index_count/3,
  92. index_offset,
  93. min_vertex_index,
  94. vertex_index_range,
  95. mmc->ident,
  96. mmc->Get_Name());
  97. */ WWDEBUG_SAY((work));
  98. }