SCORE.H 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. //
  2. // Copyright 2020 Electronic Arts Inc.
  3. //
  4. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is free
  5. // software: you can redistribute it and/or modify it under the terms of
  6. // the GNU General Public License as published by the Free Software Foundation,
  7. // either version 3 of the License, or (at your option) any later version.
  8. // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed
  9. // in the hope that it will be useful, but with permitted additional restrictions
  10. // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT
  11. // distributed with this program. You should have received a copy of the
  12. // GNU General Public License along with permitted additional restrictions
  13. // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
  14. /* $Header: F:\projects\c&c\vcs\code\score.h_v 2.18 16 Oct 1995 16:46:18 JOE_BOSTIC $ */
  15. /***********************************************************************************************
  16. *** 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 ***
  17. ***********************************************************************************************
  18. * *
  19. * Project Name : Command & Conquer *
  20. * *
  21. * File Name : SCORE.H *
  22. * *
  23. * Programmer : Joe L. Bostic *
  24. * *
  25. * Start Date : April 19, 1994 *
  26. * *
  27. * Last Update : April 19, 1994 [JLB] *
  28. * *
  29. *---------------------------------------------------------------------------------------------*
  30. * Functions: *
  31. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  32. #ifndef SCORE_H
  33. #define SCORE_H
  34. #include "unit.h"
  35. #include "building.h"
  36. class ScoreClass {
  37. public:
  38. int Score;
  39. int NKilled;
  40. int GKilled;
  41. int CKilled;
  42. int NBKilled;
  43. int GBKilled;
  44. int CBKilled;
  45. int NHarvested;
  46. int GHarvested;
  47. int CHarvested;
  48. unsigned long ElapsedTime;
  49. void Init(void) {memset(this, 0, sizeof(ScoreClass));};
  50. void Presentation(void);
  51. /*
  52. ** File I/O.
  53. */
  54. bool Load(FileClass & file);
  55. bool Save(FileClass & file);
  56. void Code_Pointers(void);
  57. void Decode_Pointers(void);
  58. protected:
  59. private:
  60. unsigned char *ChangingGun;
  61. void ScoreDelay(int ticks);
  62. void Pulse_Bar_Graph(void);
  63. void Print_Graph_Title(int,int);
  64. void Print_Minutes(int minutes);
  65. void Count_Up_Print(char *str, int percent, int max, int xpos, int ypos);
  66. void Show_Credits(int house, char const pal[]);
  67. void Do_GDI_Graph(void const * yellowptr, void const * redptr, int gdikilled, int nodkilled, int ypos);
  68. void Do_Nod_Casualties_Graph(void);
  69. void Do_Nod_Buildings_Graph(void);
  70. void Input_Name(char str[], int xpos, int ypos, char const pal[]);
  71. };
  72. class ScoreAnimClass {
  73. public:
  74. ScoreAnimClass(int x, int y, void const * data);
  75. int XPos;
  76. int YPos;
  77. CountDownTimerClass Timer;
  78. void const * DataPtr;
  79. virtual void Update(void) {} ;
  80. virtual ~ScoreAnimClass(void) {} ;
  81. };
  82. class ScoreCredsClass : public ScoreAnimClass {
  83. public:
  84. int Stage;
  85. int MaxStage;
  86. int TimerReset;
  87. void const * CashTurn;
  88. void const * Clock1;
  89. virtual void Update(void);
  90. ScoreCredsClass(int xpos, int ypos, void const * data, int max, int timer);
  91. virtual ~ScoreCredsClass(void) {};
  92. };
  93. class ScoreTimeClass : public ScoreAnimClass {
  94. public:
  95. int Stage;
  96. int MaxStage;
  97. int TimerReset;
  98. virtual void Update(void);
  99. ScoreTimeClass(int xpos, int ypos, void const * data, int max, int timer);
  100. virtual ~ScoreTimeClass(void) {};
  101. };
  102. class ScorePrintClass : public ScoreAnimClass {
  103. public:
  104. int Background;
  105. int Stage;
  106. void const * PrimaryPalette;
  107. virtual void Update(void);
  108. ScorePrintClass(void const * string, int xpos, int ypos, void const * palette, int background=TBLACK);
  109. ScorePrintClass( int string, int xpos, int ypos, void const * palette, int background=TBLACK);
  110. virtual ~ScorePrintClass(void) {};
  111. };
  112. class MultiStagePrintClass : public ScoreAnimClass {
  113. public:
  114. int Background;
  115. int Stage;
  116. void const * PrimaryPalette;
  117. virtual void Update(void);
  118. MultiStagePrintClass(void const * string, int xpos, int ypos, void const * palette, int background=TBLACK);
  119. MultiStagePrintClass( int string, int xpos, int ypos, void const * palette, int background=TBLACK);
  120. virtual ~MultiStagePrintClass(void) {};
  121. };
  122. class ScoreScaleClass : public ScoreAnimClass {
  123. public:
  124. int Stage;
  125. char const * Palette;
  126. virtual void Update(void);
  127. ScoreScaleClass(void const * data, int xpos, int ypos, char const pal[]);
  128. virtual ~ScoreScaleClass(void) {};
  129. };
  130. #define MAXSCOREOBJS 8
  131. extern ScoreAnimClass *ScoreObjs[MAXSCOREOBJS];
  132. void Multi_Score_Presentation(void);
  133. #endif