| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051 |
- /*
- ** Command & Conquer(tm)
- ** Copyright 2025 Electronic Arts Inc.
- **
- ** This program is free software: you can redistribute it and/or modify
- ** it under the terms of the GNU General Public License as published by
- ** the Free Software Foundation, either version 3 of the License, or
- ** (at your option) any later version.
- **
- ** This program is distributed in the hope that it will be useful,
- ** but WITHOUT ANY WARRANTY; without even the implied warranty of
- ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- ** GNU General Public License for more details.
- **
- ** You should have received a copy of the GNU General Public License
- ** along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- /* $Header: F:\projects\c&c\vcs\code\iomap.cpv 2.18 16 Oct 1995 16:50:34 JOE_BOSTIC $ */
- /***********************************************************************************************
- *** 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 ***
- ***********************************************************************************************
- * *
- * Project Name : Command & Conquer *
- * *
- * File Name : IOMAP.CPP *
- * *
- * Programmer : Bill Randolph *
- * *
- * Start Date : January 16, 1995 *
- * *
- * Last Update : January 16, 1995 [BR] *
- * *
- *---------------------------------------------------------------------------------------------*
- * All map-related loading/saving routines should go in this module, so it can be overlayed. *
- *---------------------------------------------------------------------------------------------*
- * Functions: *
- * CellClass::Code_Pointers -- codes class's pointers for load/save *
- * CellClass::Decode_Pointers -- decodes pointers for load/save *
- * CellClass::Load -- Reads from a save game file. *
- * CellClass::Save -- Write to a save game file. *
- * CellClass::Should_Save -- Should the cell be written to disk? *
- * DisplayClass::Code_Pointers -- codes class's pointers for load/save *
- * DisplayClass::Decode_Pointers -- decodes pointers for load/save *
- * GScreenClass::Code_Pointers -- codes class's pointers for load/save *
- * GScreenClass::Decode_Pointers -- decodes pointers for load/save *
- * HelpClass::Code_Pointers -- codes class's pointers for load/save *
- * HelpClass::Decode_Pointers -- decodes pointers for load/save *
- * MapClass::Code_Pointers -- codes class's pointers for load/save *
- * MapClass::Decode_Pointers -- decodes pointers for load/save *
- * MouseClass::Code_Pointers -- codes class's pointers for load/save *
- * MouseClass::Decode_Pointers -- decodes pointers for load/save *
- * MouseClass::Load -- Loads from a save game file. *
- * MouseClass::Save -- Saves to a save game file. *
- * PowerClass::Code_Pointers -- codes class's pointers for load/save *
- * PowerClass::Decode_Pointers -- decodes pointers for load/save *
- * RadarClass::Code_Pointers -- codes class's pointers for load/save *
- * RadarClass::Decode_Pointers -- decodes pointers for load/save *
- * ScrollClass::Code_Pointers -- codes class's pointers for load/save *
- * ScrollClass::Decode_Pointers -- decodes pointers for load/save *
- * SidebarClass::Code_Pointers -- codes class's pointers for load/save *
- * SidebarClass::Decode_Pointers -- decodes pointers for load/save *
- * SidebarClass::StripClass::Code_Pointers -- codes class's pointers for load/save *
- * SidebarClass::StripClass::Decode_Pointers -- decodes pointers for load/save *
- * TabClass::Code_Pointers -- codes class's pointers for load/save *
- * TabClass::Decode_Pointers -- decodes pointers for load/save *
- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
- #include "function.h"
- /***********************************************************************************************
- * CellClass::Should_Save -- Should the cell be written to disk? *
- * *
- * This function will determine if the cell needs to be written to disk. Any cell that *
- * contains special data should be written to disk. *
- * *
- * INPUT: none *
- * *
- * OUTPUT: bool; Should this cell's data be written to disk? *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 09/19/1994 JLB : Created. *
- *=============================================================================================*/
- bool CellClass::Should_Save(void) const
- {
- return(
- (Smudge != SMUDGE_NONE) ||
- (TType != TEMPLATE_NONE) ||
- (Overlay != OVERLAY_NONE) ||
- IsMapped ||
- IsVisible ||
- IsTrigger ||
- Flag.Composite ||
- OccupierPtr ||
- Overlapper[0] || Overlapper[1] || Overlapper[2]
- );
- }
- /***********************************************************************************************
- * CellClass::Load -- Loads from a save game file. *
- * *
- * INPUT: file -- The file to read the cell's data from. *
- * *
- * OUTPUT: true = success, false = failure *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 09/19/1994 JLB : Created. *
- *=============================================================================================*/
- bool CellClass::Load(FileClass & file)
- {
- int rc;
- TriggerClass * trig;
- /*
- -------------------------- Load the object data --------------------------
- */
- rc = Read_Object(this, sizeof(CellClass), sizeof(CellClass), file, 0);
- /*
- ------------------------ Load the trigger pointer ------------------------
- */
- if (rc) {
- if (IsTrigger) {
- if (file.Read(&trig,sizeof(trig)) != sizeof(trig))
- return(false);
- CellTriggers[Cell_Number()] = trig;
- }
- }
- return(rc);
- }
- /***********************************************************************************************
- * CellClass::Save -- Write to a save game file. *
- * *
- * INPUT: file -- The file to write the cell's data to. *
- * *
- * OUTPUT: true = success, false = failure *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 09/19/1994 JLB : Created. *
- *=============================================================================================*/
- bool CellClass::Save(FileClass & file)
- {
- int rc;
- TriggerClass * trig;
- /*
- -------------------------- Save the object data --------------------------
- */
- rc = Write_Object(this, sizeof(CellClass), file);
- /*
- ------------------------ Save the trigger pointer ------------------------
- */
- if (rc) {
- if (IsTrigger) {
- trig = CellTriggers[Cell_Number()];
- if (file.Write(&trig,sizeof(trig)) != sizeof(trig))
- return(false);
- }
- }
- return(rc);
- }
- /***********************************************************************************************
- * CellClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void CellClass::Code_Pointers(void)
- {
- if (Cell_Occupier()) {
- OccupierPtr = (ObjectClass *)OccupierPtr->As_Target();
- }
- if (Overlapper[0]) {
- Overlapper[0] = (ObjectClass *)Overlapper[0]->As_Target();
- }
- if (Overlapper[1]) {
- Overlapper[1] = (ObjectClass *)Overlapper[1]->As_Target();
- }
- if (Overlapper[2]) {
- Overlapper[2] = (ObjectClass *)Overlapper[2]->As_Target();
- }
- /*
- ------------------------ Convert trigger pointer -------------------------
- */
- if (IsTrigger) {
- CellTriggers[Cell_Number()] = (TriggerClass *)CellTriggers[Cell_Number()]->As_Target();
- }
- }
- /***********************************************************************************************
- * CellClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void CellClass::Decode_Pointers(void)
- {
- if (OccupierPtr) {
- OccupierPtr = As_Object((TARGET)OccupierPtr);
- Check_Ptr((void *)OccupierPtr,__FILE__,__LINE__);
- }
- if (Overlapper[0]) {
- Overlapper[0] = As_Object((TARGET)Overlapper[0]);
- Check_Ptr((void *)Overlapper[0],__FILE__,__LINE__);
- }
- if (Overlapper[1]) {
- Overlapper[1] = As_Object((TARGET)Overlapper[1]);
- Check_Ptr((void *)Overlapper[1],__FILE__,__LINE__);
- }
- if (Overlapper[2]) {
- Overlapper[2] = As_Object((TARGET)Overlapper[2]);
- Check_Ptr((void *)Overlapper[2],__FILE__,__LINE__);
- }
- /*
- ** Convert trigger pointer.
- */
- if (IsTrigger) {
- CellTriggers[Cell_Number()] = As_Trigger( (TARGET)CellTriggers[Cell_Number()] );
- Check_Ptr((void *)CellTriggers[Cell_Number()],__FILE__,__LINE__);
- }
- }
- /***********************************************************************************************
- * MouseClass::Load -- Loads from a save game file. *
- * *
- * Loading the map is very complicated. Here are the steps: *
- * - Read the Theater for this save-game *
- * - call Init_Theater to perform theater-specific inits *
- * - call Free_Cells to free the cell array, because loading the map object will overwrite *
- * the pointer to the cell array *
- * - read the map object from disk *
- * - call Alloc_Cells to re-allocate the cell array *
- * - call Init_Cells to set the cells to a known state, because not every cell will be loaded *
- * - read the cell objects into the cell array *
- * - After the map & all objects have been loaded & the pointers decoded, Init_IO() >MUST< be *
- * called to restore the map's button list to the proper state. *
- * *
- * INPUT: file -- The file to read the cell's data from. *
- * *
- * OUTPUT: true = success, false = failure *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 09/19/1994 JLB : Created. *
- *=============================================================================================*/
- bool MouseClass::Load(FileClass & file)
- {
- unsigned count;
- CELL cell = 0;
- int index;
- // int rc;
- // int i;
- // int j;
- /*------------------------------------------------------------------------
- Load Theater: Even though this value is located in the DisplayClass,
- it must be loaded first so initialization can be done before any other
- map data is loaded. If initialization isn't done first, data read from
- disk will be over-written when initialization occurs. This code must
- go in the most-derived Map class.
- ------------------------------------------------------------------------*/
- if (file.Read (&Theater,sizeof(Theater)) != sizeof(Theater))
- return(false);
- /*
- ** Remove any old theater specific uncompressed shapes
- */
- if (Theater != LastTheater){
- Reset_Theater_Shapes();
- }
- /*
- ------------------------- Init display mixfiles --------------------------
- */
- Init_Theater(Theater);
- TerrainTypeClass::Init(Theater);
- TemplateTypeClass::Init(Theater);
- OverlayTypeClass::Init(Theater);
- UnitTypeClass::Init(Theater);
- InfantryTypeClass::Init(Theater);
- BuildingTypeClass::Init(Theater);
- BulletTypeClass::Init(Theater);
- AnimTypeClass::Init(Theater);
- AircraftTypeClass::Init(Theater);
- SmudgeTypeClass::Init(Theater);
- LastTheater = Theater;
- /*
- ** Free the cell array, because we're about to overwrite its pointers
- */
- Free_Cells();
- /*
- ** Read the entire map object in. Only read in sizeof(MouseClass), so if we're
- ** in editor mode, none of the map editor object is read in.
- */
- if (!Read_Object(this, sizeof(VectorClass<CellClass>), sizeof(MouseClass), file, VTable)) {
- return(false);
- }
- /*
- ** Reallocate the cell array
- */
- Alloc_Cells();
- /*
- ** Init all cells to empty
- */
- Init_Cells();
- /*
- --------------------------- Read # cells saved ---------------------------
- */
- if (file.Read(&count, sizeof(count)) != sizeof(count)) {
- return(false);
- }
- /*
- ------------------------------- Read cells -------------------------------
- */
- for (index = 0; index < count; index++) {
- if (file.Read(&cell, sizeof(cell)) != sizeof(cell))
- return(false);
- if (!(*this)[cell].Load(file))
- return(false);
- }
- return(true);
- }
- /***********************************************************************************************
- * MouseClass::Save -- Save to a save game file. *
- * *
- * INPUT: file -- The file to write the cell's data to. *
- * *
- * OUTPUT: true = success, false = failure *
- * *
- * WARNINGS: none *
- * *
- * HISTORY: *
- * 09/19/1994 JLB : Created. *
- *=============================================================================================*/
- bool MouseClass::Save(FileClass & file)
- {
- unsigned count;
- long pos;
- /*
- -------------------------- Save Theater >first< --------------------------
- */
- if (file.Write (&Theater,sizeof(Theater)) != sizeof(Theater))
- return(false);
- if (!Write_Object(this, sizeof(MouseClass), file))
- return(false);
- /*
- ---------------------- Record current file position ----------------------
- */
- pos = file.Seek(0, SEEK_CUR);
- /*
- ---------------------- write out placeholder bytes -----------------------
- */
- if (file.Write(&count, sizeof(count)) != sizeof(count))
- return(false);
- /*
- ------------------------ Save cells that need it -------------------------
- */
- count = 0;
- for (CELL cell = 0; cell < MAP_CELL_TOTAL; cell++) {
- if ((*this)[cell].Should_Save()) {
- if (file.Write(&cell, sizeof(cell)) != sizeof(cell))
- return(false);
- count++;
- if (!(*this)[cell].Save(file))
- return(false);
- }
- }
- /*
- -------------------------- Save # cells written --------------------------
- */
- file.Seek(pos, SEEK_SET);
- if (file.Write(&count, sizeof(count)) != sizeof(count))
- return(false);
- file.Seek(0, SEEK_END);
- return(true);
- }
- /***********************************************************************************************
- * MouseClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void MouseClass::Code_Pointers(void)
- {
- // Control.Code_Pointers();
- ScrollClass::Code_Pointers();
- }
- /***********************************************************************************************
- * MouseClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void MouseClass::Decode_Pointers(void)
- {
- // Control.Decode_Pointers();
- ScrollClass::Decode_Pointers();
- }
- /***********************************************************************************************
- * ScrollClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void ScrollClass::Code_Pointers(void)
- {
- HelpClass::Code_Pointers();
- }
- /***********************************************************************************************
- * ScrollClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void ScrollClass::Decode_Pointers(void)
- {
- HelpClass::Decode_Pointers();
- }
- /***********************************************************************************************
- * HelpClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void HelpClass::Code_Pointers(void)
- {
- TabClass::Code_Pointers();
- }
- /***********************************************************************************************
- * HelpClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void HelpClass::Decode_Pointers(void)
- {
- TabClass::Decode_Pointers();
- }
- /***********************************************************************************************
- * TabClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void TabClass::Code_Pointers(void)
- {
- SidebarClass::Code_Pointers();
- }
- /***********************************************************************************************
- * TabClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void TabClass::Decode_Pointers(void)
- {
- SidebarClass::Decode_Pointers();
- }
- /***********************************************************************************************
- * PowerClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void PowerClass::Code_Pointers(void)
- {
- RadarClass::Code_Pointers();
- }
- /***********************************************************************************************
- * PowerClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void PowerClass::Decode_Pointers(void)
- {
- RadarClass::Decode_Pointers();
- }
- /***********************************************************************************************
- * SidebarClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void SidebarClass::Code_Pointers(void)
- {
- for (int i = 0; i < COLUMNS; i++) {
- Column[i].Code_Pointers();
- }
- PowerClass::Code_Pointers();
- }
- /***********************************************************************************************
- * SidebarClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void SidebarClass::Decode_Pointers(void)
- {
- for (int i = 0; i < COLUMNS; i++) {
- Column[i].Decode_Pointers();
- }
- PowerClass::Decode_Pointers();
- }
- /***********************************************************************************************
- * SidebarClass::StripClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void SidebarClass::StripClass::Code_Pointers(void)
- {
- }
- /***********************************************************************************************
- * SidebarClass::StripClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void SidebarClass::StripClass::Decode_Pointers(void)
- {
- }
- /***********************************************************************************************
- * RadarClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void RadarClass::Code_Pointers(void)
- {
- DisplayClass::Code_Pointers();
- }
- /***********************************************************************************************
- * RadarClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void RadarClass::Decode_Pointers(void)
- {
- DisplayClass::Decode_Pointers();
- }
- /***********************************************************************************************
- * DisplayClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void DisplayClass::Code_Pointers(void)
- {
- /*
- ** Code PendingObjectPtr.
- */
- if (PendingObjectPtr) {
- PendingObjectPtr = (ObjectClass *)PendingObjectPtr->As_Target();
- }
- /*
- ** Chain to parent.
- */
- MapClass::Code_Pointers();
- }
- /***********************************************************************************************
- * DisplayClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void DisplayClass::Decode_Pointers(void)
- {
- /*
- ** Decode PendingObjectPtr. We can't decode PendingObject here, because we'd
- ** have to reference PendingObjectPtr->Class_Of(), and the object that
- ** PendingObjectPtr is pointing to hasn't been decoded yet. Since we can't
- ** decode PendingObjectPtr, we can't set the placement cursor shape here
- ** either. These have to be done as last-minute fixups.
- */
- if (PendingObjectPtr) {
- PendingObjectPtr = As_Object((TARGET)PendingObjectPtr);
- Check_Ptr((void *)PendingObjectPtr,__FILE__,__LINE__);
- }
- /*
- ** Chain to parent.
- */
- MapClass::Decode_Pointers();
- }
- /***********************************************************************************************
- * MapClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void MapClass::Code_Pointers(void)
- {
- CELL cell;
- /*
- ------------------------- Code the cell pointers -------------------------
- */
- for (cell = 0; cell < MAP_CELL_TOTAL; cell++) {
- (*this)[cell].Code_Pointers();
- }
- GScreenClass::Code_Pointers();
- }
- /***********************************************************************************************
- * MapClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void MapClass::Decode_Pointers(void)
- {
- CELL cell;
- /*
- ------------------------ Decode the cell pointers ------------------------
- */
- for (cell = 0; cell < MAP_CELL_TOTAL; cell++) {
- (*this)[cell].Decode_Pointers();
- }
- GScreenClass::Decode_Pointers();
- }
- /***********************************************************************************************
- * GScreenClass::Code_Pointers -- codes class's pointers for load/save *
- * *
- * This routine "codes" the pointers in the class by converting them to a number *
- * that still represents the object pointed to, but isn't actually a pointer. This *
- * allows a saved game to properly load without relying on the games data still *
- * being in the exact same location. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void GScreenClass::Code_Pointers(void)
- {
- }
- /***********************************************************************************************
- * GScreenClass::Decode_Pointers -- decodes pointers for load/save *
- * *
- * This routine "decodes" the pointers coded in Code_Pointers by converting the *
- * code values back into object pointers. *
- * *
- * INPUT: *
- * none. *
- * *
- * OUTPUT: *
- * none. *
- * *
- * WARNINGS: *
- * none. *
- * *
- * HISTORY: *
- * 01/02/1995 BR : Created. *
- *=============================================================================================*/
- void GScreenClass::Decode_Pointers(void)
- {
- }
|