CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

GSCREEN.H (5526B)


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