OVERLAY.H (4535B)
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/OVERLAY.H 1 3/03/97 10:25a 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 ** This is a pointer to the overlay object's class. 51 */ 52 CCPtr<OverlayTypeClass> Class; 53 54 /*------------------------------------------------------------------- 55 ** Constructors and destructors. 56 */ 57 static void * operator new(size_t size); 58 static void * operator new(size_t , void * ptr) {return(ptr);}; 59 static void operator delete(void *ptr); 60 OverlayClass(OverlayType type, CELL pos=-1, HousesType = HOUSE_NONE); 61 OverlayClass(NoInitClass const & x) : ObjectClass(x), Class(x) {}; 62 virtual ~OverlayClass(void) {if (GameActive) OverlayClass::Limbo();Class=0;}; 63 operator OverlayType(void) const {return Class->Type;}; 64 65 static void Init(void); 66 67 /* 68 ** File I/O. 69 */ 70 static void Read_INI(CCINIClass & ini); 71 static void Write_INI(CCINIClass & ini); 72 static char *INI_Name(void) {return "OVERLAY";}; 73 bool Load(Straw & file); 74 bool Save(Pipe & file) const; 75 76 /* 77 ** Virtual support functionality. 78 */ 79 virtual bool Mark(MarkType); 80 virtual ObjectTypeClass const & Class_Of(void) const {return *Class;}; 81 virtual void Draw_It(int , int , WindowNumberType ) const {}; 82 83 private: 84 /* 85 ** This is used to control the marking process of the overlay. If this is 86 ** set to a valid house number, then the cell that the overlay is marked down 87 ** upon will be flagged as being owned by the specified house. 88 */ 89 static HousesType ToOwn; 90 91 92 /* 93 ** Some additional padding in case we need to add data to the class and maintain backwards compatibility for save/load 94 */ 95 unsigned char SaveLoadPadding[8]; 96 }; 97 98 #endif