GSCREEN.H 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /*
  2. ** Command & Conquer Red Alert(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: /CounterStrike/GSCREEN.H 1 3/03/97 10:24a 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 : GSCREEN.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : 12/15/94 *
  30. * *
  31. * Last Update : December 15, 1994 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef GSCREEN_H
  37. #define GSCREEN_H
  38. #include "function.h"
  39. #include "cell.h"
  40. class GScreenClass
  41. {
  42. public:
  43. GScreenClass(void);
  44. GScreenClass(NoInitClass const &) {};
  45. /*
  46. ** Initialization
  47. */
  48. virtual void One_Time(void); // One-time initializations
  49. virtual void Init(TheaterType = THEATER_NONE); // Inits everything
  50. virtual void Init_Clear(void); // Clears all to known state
  51. virtual void Init_IO(void); // Inits button list
  52. virtual void Init_Theater(TheaterType theater); // Theater-specific inits
  53. /*
  54. ** Player I/O is routed through here. It is called every game tick.
  55. */
  56. virtual void Input(KeyNumType & key, int & x, int & y);
  57. virtual void AI(KeyNumType &, int, int) {};
  58. virtual void Add_A_Button(GadgetClass & gadget);
  59. virtual void Remove_A_Button(GadgetClass & gadget);
  60. /*
  61. ** Called when map needs complete updating.
  62. */
  63. virtual void Flag_To_Redraw(bool complete=false);
  64. /*
  65. ** Render maintenance routine (call every game tick). Probably no need
  66. ** to override this in derived classes.
  67. */
  68. virtual void Render(void);
  69. /*
  70. ** Is called when actual drawing is required. This is the function to
  71. ** override in derived classes.
  72. */
  73. virtual void Draw_It(bool =false) {};
  74. /*
  75. ** This moves the hidpage up to the seenpage.
  76. */
  77. virtual void Blit_Display(void);
  78. /*
  79. ** Changes the mouse shape as indicated.
  80. */
  81. virtual void Set_Default_Mouse(MouseType mouse, bool wsmall) = 0;
  82. virtual bool Override_Mouse_Shape(MouseType mouse, bool wsmall) = 0;
  83. virtual void Revert_Mouse_Shape(void) = 0;
  84. virtual void Mouse_Small(bool wsmall) = 0;
  85. /*
  86. ** Misc routines.
  87. */
  88. virtual void * Shadow_Address(void) {return(ShadowPage);};
  89. /*
  90. ** This points to the buttons that are used for input. All of the derived classes will
  91. ** attached their specific buttons to this list.
  92. */
  93. static GadgetClass * Buttons;
  94. private:
  95. /*
  96. ** If the entire map is required to redraw, then this flag is true. This flag
  97. ** is set by the Flag_To_Redraw function. Typically, this occurs when the screen
  98. ** has been trashed or is first created.
  99. */
  100. unsigned IsToRedraw:1;
  101. /*
  102. ** If only a sub-system of the map must be redrawn, then this flag will be set.
  103. ** An example of something that would set this flag would be an animating icon
  104. ** in the sidebar. In such a case, complete redrawing of the entire display is not
  105. ** necessary, but the Draw_It function should still be called so that the appropriate
  106. ** class can perform it's rendering.
  107. */
  108. unsigned IsToUpdate:1;
  109. /*
  110. ** Pointer to an exact copy of the visible graphic page. This copy is used to speed
  111. ** display rendering by using an only-update-changed-pixels algorithm.
  112. */
  113. static GraphicBufferClass * ShadowPage;
  114. };
  115. #endif