lightsolveprogress.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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/lightsolveprogress.h $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 3/01/02 10:20a $*
  31. * *
  32. * $Revision:: 2 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #ifndef LIGHTSOLVEPROGRESS_H
  38. #define LIGHTSOLVEPROGRESS_H
  39. /**
  40. ** LightSolveProgressClass
  41. ** This class is used to communicate the current status of the light solve
  42. */
  43. class LightSolveProgressClass
  44. {
  45. public:
  46. LightSolveProgressClass(void);
  47. /*
  48. ** Read status (UI uses this to provide progress display)
  49. */
  50. int Get_Object_Count(void) { return ObjectCount; }
  51. int Get_Processed_Object_Count(void) { return ProcessedObjectCount; }
  52. const char * Get_Current_Mesh_Name(void) { return CurrentMeshName; }
  53. int Get_Current_Mesh_Vertex_Count(void) { return CurrentVertexCount; }
  54. int Get_Current_Vertex(void) { return CurrentVertex; }
  55. /*
  56. ** Set status (vertex solver does this)
  57. */
  58. void Set_Object_Count(int count) { ObjectCount = count; }
  59. void Increment_Processed_Object_Count(void) { ProcessedObjectCount++; }
  60. void Set_Current_Mesh_Name(const char * name) { CurrentMeshName = name; }
  61. void Set_Current_Mesh_Vertex_Count(int vcount) { CurrentVertexCount = vcount; }
  62. void Set_Current_Vertex(int index) { CurrentVertex = index; }
  63. /*
  64. ** Cancellation request
  65. */
  66. void Request_Cancel(void) { CancelRequested = true; }
  67. bool Is_Cancel_Requested(void) { return CancelRequested; }
  68. protected:
  69. int ObjectCount;
  70. int ProcessedObjectCount;
  71. const char * CurrentMeshName;
  72. int CurrentVertexCount;
  73. int CurrentVertex;
  74. bool CancelRequested;
  75. };
  76. inline LightSolveProgressClass::LightSolveProgressClass(void) :
  77. ObjectCount(0),
  78. ProcessedObjectCount(0),
  79. CurrentMeshName(NULL),
  80. CurrentVertexCount(0),
  81. CurrentVertex(0),
  82. CancelRequested(false)
  83. {
  84. }
  85. #endif