CnC_Remastered_Collection

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

SMUDGE.H (4559B)


      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\smudge.h_v   2.16   16 Oct 1995 16:47:32   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 : SMUDGE.H                                                     *
     24  *                                                                                             *
     25  *                   Programmer : Joe L. Bostic                                                *
     26  *                                                                                             *
     27  *                   Start Date : August 9, 1994                                               *
     28  *                                                                                             *
     29  *                  Last Update : August 9, 1994   [JLB]                                       *
     30  *                                                                                             *
     31  *---------------------------------------------------------------------------------------------*
     32  * Functions:                                                                                  *
     33  * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
     34 
     35 #ifndef SMUDGE_H
     36 #define SMUDGE_H
     37 
     38 #include	"object.h"
     39 #include	"type.h"
     40 
     41 /******************************************************************************
     42 **	This is the transitory form for smudges. They exist as independent objects
     43 **	only in the transition stage from creation to placement upon the map. Once
     44 **	they are placed on the map, they merely become 'smudges' in the cell data. This
     45 **	object is then destroyed.
     46 */
     47 class SmudgeClass : public ObjectClass
     48 {
     49 	public:
     50 		/*-------------------------------------------------------------------
     51 		**	Constructors and destructors.
     52 		*/
     53 		static void * operator new(size_t size);
     54 		static void operator delete(void *ptr);
     55 		SmudgeClass(SmudgeType type, COORDINATE pos=-1, HousesType house = HOUSE_NONE);
     56 		SmudgeClass(void) : Class(0) {};
     57 		operator SmudgeType(void) const {return Class->Type;};
     58 		virtual ~SmudgeClass(void) {if (GameActive) SmudgeClass::Limbo();};
     59 		virtual RTTIType What_Am_I(void) const {return RTTI_SMUDGE;};
     60 
     61 		static void Init(void);
     62 
     63 		/*
     64 		**	File I/O.
     65 		*/
     66 		static void Read_INI(char *);
     67 		static void Write_INI(char *);
     68 		static char *INI_Name(void) {return "SMUDGE";};
     69 		bool Load(FileClass & file);
     70 		bool Save(FileClass & file);
     71 		virtual void Code_Pointers(void);
     72 		virtual void Decode_Pointers(void);
     73 
     74 		virtual ObjectTypeClass const & Class_Of(void) const {return *Class;};
     75 		virtual bool Mark(MarkType);
     76 		virtual void Draw_It(int , int , WindowNumberType ) {};
     77 
     78 		void Disown(CELL cell);
     79 
     80 		/*
     81 		**	Dee-buggin' support.
     82 		*/
     83 		int Validate(void) const;
     84 
     85 	private:
     86 
     87 		static HousesType ToOwn;
     88 
     89 		/*
     90 		**	This is a pointer to the template object's class.
     91 		*/
     92 		SmudgeTypeClass const * const Class;
     93 
     94 		/*
     95 		** Some additional padding in case we need to add data to the class and maintain backwards compatibility for save/load
     96 		*/
     97 		unsigned char SaveLoadPadding[8];
     98 
     99 		/*
    100 		** This contains the value of the Virtual Function Table Pointer
    101 		*/
    102 		static void * VTable;
    103 };
    104 
    105 #endif