2
0

vissectorstats.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 : WWPhys *
  23. * *
  24. * $Archive:: /Commando/Code/wwphys/vissectorstats.h $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Patrick $*
  29. * *
  30. * $Modtime:: 6/07/00 11:33a $*
  31. * *
  32. * $Revision:: 2 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #if defined(_MSC_VER)
  38. #pragma once
  39. #endif
  40. #ifndef VISSECTORSTATS_H
  41. #define VISSECTORSTATS_H
  42. #include "always.h"
  43. #include "vector3.h"
  44. class StaticPhysClass;
  45. class VisTableClass;
  46. /**
  47. ** VisSectorStatsClass
  48. ** This object is used to compute some statistics about the given vis sector. For example,
  49. ** it stores how many polygons are in the vis-set from anywhere in the given sector.
  50. */
  51. class VisSectorStatsClass
  52. {
  53. public:
  54. VisSectorStatsClass(void);
  55. VisSectorStatsClass(const VisSectorStatsClass &src);
  56. ~VisSectorStatsClass(void);
  57. const VisSectorStatsClass & operator= (const VisSectorStatsClass &src);
  58. void Compute_Stats(StaticPhysClass * obj,VisTableClass * vistbl);
  59. int Get_Vis_Id(void);
  60. int Get_Polygon_Count(void);
  61. int Get_Texture_Count(void);
  62. int Get_Texture_Bytes(void);
  63. Vector3 Get_Position(void);
  64. StaticPhysClass * Peek_Phys_Obj(void);
  65. const char * Get_Name(void);
  66. //
  67. // For use with DynamicVectorClass
  68. //
  69. bool operator== (const VisSectorStatsClass &src) { return false; }
  70. bool operator!= (const VisSectorStatsClass &src) { return true; }
  71. protected:
  72. int VisId;
  73. int PolygonCount;
  74. int TextureCount;
  75. int TextureBytes;
  76. Vector3 CenterPoint;
  77. StaticPhysClass * PhysObj;
  78. };
  79. /*
  80. ** inlines
  81. */
  82. inline int VisSectorStatsClass::Get_Vis_Id(void)
  83. {
  84. return VisId;
  85. }
  86. inline int VisSectorStatsClass::Get_Polygon_Count(void)
  87. {
  88. return PolygonCount;
  89. }
  90. inline int VisSectorStatsClass::Get_Texture_Count(void)
  91. {
  92. return TextureCount;
  93. }
  94. inline int VisSectorStatsClass::Get_Texture_Bytes(void)
  95. {
  96. return TextureBytes;
  97. }
  98. inline Vector3 VisSectorStatsClass::Get_Position(void)
  99. {
  100. return CenterPoint;
  101. }
  102. inline StaticPhysClass *VisSectorStatsClass::Peek_Phys_Obj(void)
  103. {
  104. return PhysObj;
  105. }
  106. #endif // VISSECTORSTATS_H