dx8polygonrenderer.cpp 4.2 KB

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