STAGE.H 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /*
  2. ** Command & Conquer(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. /* $Header: F:\projects\c&c\vcs\code\stage.h_v 2.15 16 Oct 1995 16:45:16 JOE_BOSTIC $ */
  19. /***********************************************************************************************
  20. *** 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 ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : STAGE.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : June 17, 1994 *
  30. * *
  31. * Last Update : June 17, 1994 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef STAGE_H
  37. #define STAGE_H
  38. class StageClass {
  39. /*
  40. ** This handles the animation stage of the object. This includes smoke, walking,
  41. ** flapping, and rocket flames.
  42. */
  43. unsigned short Stage;
  44. /*
  45. ** This is the countdown timer for stage animation. When this counts down
  46. ** to zero, then the stage increments by one and the time cycle starts
  47. ** over again.
  48. */
  49. unsigned char StageTimer;
  50. /*
  51. ** This is the value to assign the StageTimer whenever it needs to be reset. Thus,
  52. ** this value is the control of how fast the stage value increments.
  53. */
  54. unsigned char Rate;
  55. public:
  56. StageClass(void) {
  57. StageTimer = 0;
  58. Stage = 0;
  59. Rate = 0;
  60. };
  61. int Fetch_Stage(void) const {return Stage;};
  62. int Fetch_Rate(void) const {return Rate;};
  63. void Set_Stage(int stage) {Stage = stage;};
  64. void Set_Rate(unsigned char rate) {Rate = StageTimer = rate;};
  65. void AI(void) {};
  66. bool Graphic_Logic(void) {
  67. if (Rate) {
  68. StageTimer--;
  69. if (!StageTimer) {
  70. Stage++;
  71. StageTimer = Rate;
  72. return true;
  73. }
  74. }
  75. return false;
  76. };
  77. #ifdef CHEAT_KEYS
  78. void Debug_Dump(MonoClass *mono) const {
  79. mono->Set_Cursor(56, 7);
  80. mono->Printf("%3d[%d]", Stage, Rate);
  81. };
  82. #endif
  83. /*
  84. ** File I/O.
  85. */
  86. void Code_Pointers(void) { return; }
  87. void Decode_Pointers(void) { return; }
  88. };
  89. #endif