GameMtlForm.cpp 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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 : Max2W3d *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/max2w3d/GameMtlForm.cpp $*
  25. * *
  26. * Author:: Greg Hjelstrom *
  27. * *
  28. * $Modtime:: 11/23/98 6:21p $*
  29. * *
  30. * $Revision:: 3 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * GameMtlFormClass::GameMtlFormClass -- constructor *
  35. * GameMtlFormClass::SetThing -- Set the material being edited by this form *
  36. * GameMtlFormClass::GetThing -- get the material being edited by this form *
  37. * GameMtlFormClass::DeleteThis -- delete myself *
  38. * GameMtlFormClass::ClassID -- returns the classID of the object being edited *
  39. * GameMtlFormClass::SetTime -- set the current time *
  40. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  41. #include "GameMtlForm.h"
  42. #include "GameMtl.h"
  43. /***********************************************************************************************
  44. * GameMtlFormClass::GameMtlFormClass -- constructor *
  45. * *
  46. * INPUT: *
  47. * *
  48. * OUTPUT: *
  49. * *
  50. * WARNINGS: *
  51. * *
  52. * HISTORY: *
  53. * 11/23/98 GTH : Created. *
  54. *=============================================================================================*/
  55. GameMtlFormClass::GameMtlFormClass
  56. (
  57. IMtlParams * imtl_params,
  58. GameMtl * mtl,
  59. int pass
  60. )
  61. {
  62. IParams = imtl_params;
  63. TheMtl = mtl;
  64. PassIndex = pass;
  65. }
  66. /***********************************************************************************************
  67. * GameMtlFormClass::SetThing -- Set the material being edited by this form *
  68. * *
  69. * INPUT: *
  70. * *
  71. * OUTPUT: *
  72. * *
  73. * WARNINGS: *
  74. * *
  75. * HISTORY: *
  76. * 11/23/98 GTH : Created. *
  77. *=============================================================================================*/
  78. void GameMtlFormClass::SetThing(ReferenceTarget * target)
  79. {
  80. assert (target->SuperClassID()==MATERIAL_CLASS_ID);
  81. assert (target->ClassID()==GameMaterialClassID);
  82. TheMtl = (GameMtl *)target;
  83. }
  84. /***********************************************************************************************
  85. * GameMtlFormClass::GetThing -- get the material being edited by this form *
  86. * *
  87. * INPUT: *
  88. * *
  89. * OUTPUT: *
  90. * *
  91. * WARNINGS: *
  92. * *
  93. * HISTORY: *
  94. * 11/23/98 GTH : Created. *
  95. *=============================================================================================*/
  96. ReferenceTarget * GameMtlFormClass::GetThing(void)
  97. {
  98. return (ReferenceTarget*)TheMtl;
  99. }
  100. /***********************************************************************************************
  101. * GameMtlFormClass::DeleteThis -- delete myself *
  102. * *
  103. * INPUT: *
  104. * *
  105. * OUTPUT: *
  106. * *
  107. * WARNINGS: *
  108. * *
  109. * HISTORY: *
  110. * 11/23/98 GTH : Created. *
  111. *=============================================================================================*/
  112. void GameMtlFormClass::DeleteThis(void)
  113. {
  114. delete this;
  115. }
  116. /***********************************************************************************************
  117. * GameMtlFormClass::ClassID -- returns the classID of the object being edited *
  118. * *
  119. * INPUT: *
  120. * *
  121. * OUTPUT: *
  122. * *
  123. * WARNINGS: *
  124. * *
  125. * HISTORY: *
  126. * 11/23/98 GTH : Created. *
  127. *=============================================================================================*/
  128. Class_ID GameMtlFormClass::ClassID()
  129. {
  130. return GameMaterialClassID;
  131. }
  132. /***********************************************************************************************
  133. * GameMtlFormClass::SetTime -- set the current time *
  134. * *
  135. * INPUT: *
  136. * *
  137. * OUTPUT: *
  138. * *
  139. * WARNINGS: *
  140. * *
  141. * HISTORY: *
  142. * 11/23/98 GTH : Created. *
  143. *=============================================================================================*/
  144. void GameMtlFormClass::SetTime(TimeValue t)
  145. {
  146. // child dialog classes don't have to support
  147. // the SetTime function.
  148. }