CnC_Remastered_Collection

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

STAGE.H (3938B)


      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\stage.h_v   2.15   16 Oct 1995 16:45:16   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 : STAGE.H                                                      *
     24  *                                                                                             *
     25  *                   Programmer : Joe L. Bostic                                                *
     26  *                                                                                             *
     27  *                   Start Date : June 17, 1994                                                *
     28  *                                                                                             *
     29  *                  Last Update : June 17, 1994   [JLB]                                        *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Functions:                                                                                  *
     33  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     34 
     35 #ifndef STAGE_H
     36 #define STAGE_H
     37 
     38 class StageClass {
     39 
     40 		/*
     41 		**	This handles the animation stage of the object. This includes smoke, walking,
     42 		**	flapping, and rocket flames.
     43 		*/
     44 		unsigned short Stage;
     45 
     46 		/*
     47 		**	This is the countdown timer for stage animation. When this counts down
     48 		**	to zero, then the stage increments by one and the time cycle starts 
     49 		**	over again.
     50 		*/
     51 		unsigned char StageTimer;
     52 
     53 		/*
     54 		**	This is the value to assign the StageTimer whenever it needs to be reset. Thus,
     55 		**	this value is the control of how fast the stage value increments.
     56 		*/
     57 		unsigned char Rate;
     58 
     59 	public:
     60 		StageClass(void) {
     61 			StageTimer = 0;
     62 			Stage = 0;
     63 			Rate = 0;
     64 		};
     65 
     66 		int Fetch_Stage(void) const {return Stage;};
     67 		int Fetch_Rate(void) const {return Rate;};
     68 		void Set_Stage(int stage) {Stage = stage;};
     69 		void Set_Rate(unsigned char rate) {Rate = StageTimer = rate;};
     70 		void AI(void) {};
     71 		bool Graphic_Logic(void) {
     72 			if (Rate) {
     73 				StageTimer--;
     74 				if (!StageTimer) {
     75 					Stage++;
     76 					StageTimer = Rate;
     77 					return true;
     78 				}
     79 			}
     80 			return false;
     81 		};
     82 		#ifdef CHEAT_KEYS
     83 		void Debug_Dump(MonoClass *mono) const {
     84 			mono->Set_Cursor(56, 7);
     85 			mono->Printf("%3d[%d]", Stage, Rate);
     86 		};
     87 		#endif
     88 
     89 		/*
     90 		**	File I/O.
     91 		*/
     92 		void Code_Pointers(void) { return; }
     93 		void Decode_Pointers(void) { return; }
     94 };
     95 
     96 
     97 #endif