CnC_Remastered_Collection

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

OVERLAY.H (4730B)


      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\overlay.h_v   2.16   16 Oct 1995 16:44:50   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 : OVERLAY.H                                                    *
     24  *                                                                                             *
     25  *                   Programmer : Joe L. Bostic                                                *
     26  *                                                                                             *
     27  *                   Start Date : May 17, 1994                                                 *
     28  *                                                                                             *
     29  *                  Last Update : May 17, 1994   [JLB]                                         *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Functions:                                                                                  *
     33  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     34 
     35 #ifndef OVERLAY_H
     36 #define OVERLAY_H
     37 
     38 #include	"object.h"
     39 #include	"type.h"
     40 
     41 /******************************************************************************
     42 **	This class controls the overlay object. Overlay objects function congruously
     43 **	to carpet on a floor. They have no depth, but merely control the icon to be rendered
     44 **	as the cell's bottom most layer.
     45 */
     46 class OverlayClass : public ObjectClass
     47 {
     48 	public:
     49 		/*-------------------------------------------------------------------
     50 		**	Constructors and destructors.
     51 		*/
     52 		static void * operator new(size_t size);
     53 		static void operator delete(void *ptr);
     54 		OverlayClass(void);
     55 		OverlayClass(OverlayType type, CELL pos=-1, HousesType = HOUSE_NONE);
     56 		virtual ~OverlayClass(void) {if (GameActive) OverlayClass::Limbo();};
     57 		operator OverlayType(void) const {return Class->Type;};
     58 		virtual RTTIType What_Am_I(void) const {return RTTI_OVERLAY;};
     59 
     60 		static void Init(void);
     61 
     62 		/*
     63 		**	File I/O.
     64 		*/
     65 		static void Read_INI(char *);
     66 		static void Write_INI(char *);
     67 		static char *INI_Name(void) {return "OVERLAY";};
     68 		bool Load(FileClass & file);
     69 		bool Save(FileClass & file);
     70 		virtual void Code_Pointers(void);
     71 		virtual void Decode_Pointers(void);
     72 
     73 		/*
     74 		**	Virtual support functionality.
     75 		*/
     76 		virtual bool Mark(MarkType);
     77 		virtual ObjectTypeClass const & Class_Of(void) const {return *Class;};
     78 		virtual void Draw_It(int , int , WindowNumberType ) {};
     79 
     80 		/*
     81 		**	Dee-buggin' support.
     82 		*/
     83 		int Validate(void) const;
     84 
     85 	private:
     86 		/*
     87 		**	This is used to control the marking process of the overlay. If this is
     88 		**	set to a valid house number, then the cell that the overlay is marked down
     89 		**	upon will be flagged as being owned by the specified house.
     90 		*/
     91 		static HousesType ToOwn;
     92 
     93 		/*
     94 		**	This is a pointer to the overlay object's class.
     95 		*/
     96 		OverlayTypeClass const * const Class;
     97 
     98 		/*
     99 		** Some additional padding in case we need to add data to the class and maintain backwards compatibility for save/load
    100 		*/
    101 		unsigned char SaveLoadPadding[8];
    102 
    103 		/*
    104 		** This contains the value of the Virtual Function Table Pointer
    105 		*/
    106 		static void * VTable;
    107 };
    108 
    109 #endif