GSCREEN.H (5666B)
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 9 // TiberianDawn.DLL and RedAlert.dll and corresponding source code is distributed 10 // in the hope that it will be useful, but with permitted additional restrictions 11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 12 // distributed with this program. You should have received a copy of the 13 // GNU General Public License along with permitted additional restrictions 14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection 15 16 /* $Header: F:\projects\c&c\vcs\code\gscreen.h_v 2.17 16 Oct 1995 16:45:20 JOE_BOSTIC $ */ 17 /*********************************************************************************************** 18 *** 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 *** 19 *********************************************************************************************** 20 * * 21 * Project Name : Command & Conquer * 22 * * 23 * File Name : GSCREEN.H * 24 * * 25 * Programmer : Joe L. Bostic * 26 * * 27 * Start Date : 12/15/94 * 28 * * 29 * Last Update : December 15, 1994 [JLB] * 30 * * 31 *---------------------------------------------------------------------------------------------* 32 * Functions: * 33 * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 34 35 #ifndef GSCREEN_H 36 #define GSCREEN_H 37 38 #include "function.h" 39 #include "cell.h" 40 41 class GScreenClass : public VectorClass<CellClass> 42 { 43 public: 44 45 GScreenClass(void); 46 47 /* 48 ** Initialization 49 */ 50 virtual void One_Time(void); // One-time initializations 51 virtual void Init(TheaterType = THEATER_NONE); // Inits everything 52 virtual void Init_Clear(void); // Clears all to known state 53 virtual void Init_IO(void); // Inits button list 54 virtual void Init_Theater(TheaterType theater); // Theater-specific inits 55 56 /* 57 ** Player I/O is routed through here. It is called every game tick. 58 */ 59 virtual void Input(KeyNumType & key, int & x, int & y); 60 virtual void AI(KeyNumType &, int, int) {}; 61 virtual void Add_A_Button(GadgetClass & gadget); 62 virtual void Remove_A_Button(GadgetClass & gadget); 63 64 /* 65 ** Called when map needs complete updating. 66 */ 67 virtual void Flag_To_Redraw(bool complete=false); 68 69 /* 70 ** Render maintenance routine (call every game tick). Probably no need 71 ** to override this in derived classes. 72 */ 73 virtual void Render(void); 74 75 /* 76 ** Is called when actual drawing is required. This is the function to 77 ** override in derived classes. 78 */ 79 virtual void Draw_It(bool =false) {}; 80 81 /* 82 ** This moves the hidpage up to the seenpage. 83 */ 84 static void Blit_Display(void); 85 86 /* 87 ** Changes the mouse shape as indicated. 88 */ 89 virtual void Set_Default_Mouse(MouseType mouse, bool wwsmall) = 0; 90 virtual bool Override_Mouse_Shape(MouseType mouse, bool wwsmall) = 0; 91 virtual void Revert_Mouse_Shape(void) = 0; 92 virtual void Mouse_Small(bool wwsmall) = 0; 93 94 /* 95 ** File I/O. 96 */ 97 virtual void Code_Pointers(void); 98 virtual void Decode_Pointers(void); 99 100 /* 101 ** Misc routines. 102 */ 103 virtual void * Shadow_Address(void) {return(ShadowPage);}; 104 105 /* 106 ** This points to the buttons that are used for input. All of the derived classes will 107 ** attached their specific buttons to this list. 108 */ 109 static GadgetClass * Buttons; 110 111 private: 112 113 /* 114 ** If the entire map is required to redraw, then this flag is true. This flag 115 ** is set by the Flag_To_Redraw function. Typically, this occurs when the screen 116 ** has been trashed or is first created. 117 */ 118 unsigned IsToRedraw:1; 119 120 /* 121 ** If only a sub-system of the map must be redrawn, then this flag will be set. 122 ** An example of something that would set this flag would be an animating icon 123 ** in the sidebar. In such a case, complete redrawing of the entire display is not 124 ** necessary, but the Draw_It function should still be called so that the appropriate 125 ** class can perform it's rendering. 126 */ 127 unsigned IsToUpdate:1; 128 129 /* 130 ** Pointer to an exact copy of the visible graphic page. This copy is used to speed 131 ** display rendering by using an only-update-changed-pixels algorithm. 132 */ 133 public: 134 static GraphicBufferClass * ShadowPage; 135 private: 136 137 /* 138 ** Some additional padding in case we need to add data to the class and maintain backwards compatibility for save/load 139 */ 140 unsigned char SaveLoadPadding[1024]; 141 142 }; 143 144 #endif