GSCREEN.H 5.4 KB

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