| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- /*
- ** Command & Conquer Generals(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/>.
- */
- ////////////////////////////////////////////////////////////////////////////////
- // //
- // (c) 2001-2003 Electronic Arts Inc. //
- // //
- ////////////////////////////////////////////////////////////////////////////////
- // FILE GhostObject.cpp ///////////////////////////////////////////////////////////////////////////
- // Simple base object
- // Author: Michael S. Booth, October 2000
- ///////////////////////////////////////////////////////////////////////////////////////////////////
-
- #include "PreRTS.h" // This must go first in EVERY cpp file int the GameEngine
- #include "Common/Xfer.h"
- #include "GameLogic/GameLogic.h"
- #include "GameLogic/GhostObject.h"
- #include "GameLogic/Object.h"
- GhostObjectManager *TheGhostObjectManager=NULL;
- //-------------------------------------------------------------------------------------------------
- //-------------------------------------------------------------------------------------------------
- GhostObject::GhostObject(void):
- //Added By Sadullah Nader
- //Initializations missing and needed
- m_parentAngle(0.0f),
- m_parentGeometryIsSmall(0.0f),
- m_parentGeometryMajorRadius(0.0f),
- m_parentGeometryminorRadius(0.0f),
- m_parentObject(NULL),
- m_partitionData(NULL)
- {
- m_parentPosition.zero();
- // End Initializations
- } // end Object
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- GhostObject::~GhostObject()
- {
- }
- // ------------------------------------------------------------------------------------------------
- /** CRC */
- // ------------------------------------------------------------------------------------------------
- void GhostObject::crc( Xfer *xfer )
- {
- } // end crc
- // ------------------------------------------------------------------------------------------------
- /** Xfer Method
- * Version Info:
- * 1: Initial version */
- // ------------------------------------------------------------------------------------------------
- void GhostObject::xfer( Xfer *xfer )
- {
- // version
- XferVersion currentVersion = 1;
- XferVersion version = currentVersion;
- xfer->xferVersion( &version, currentVersion );
- // parent object
- ObjectID parentObjectID = INVALID_ID;
- if( m_parentObject )
- parentObjectID = m_parentObject->getID();
- xfer->xferObjectID( &parentObjectID );
- if( xfer->getXferMode() == XFER_LOAD )
- {
- // tie up parent object pointer
- m_parentObject = TheGameLogic->findObjectByID( parentObjectID );
- // sanity
- if( parentObjectID != INVALID_ID && m_parentObject == NULL )
- {
- DEBUG_CRASH(( "GhostObject::xfer - Unable to connect m_parentObject\n" ));
- throw INI_INVALID_DATA;
- } // end if
- } // end if
- // parent geometry type
- xfer->xferUser( &m_parentGeometryType, sizeof( GeometryType ) );
- // parent geometry is small
- xfer->xferBool( &m_parentGeometryIsSmall );
- // parent geometry major radius
- xfer->xferReal( &m_parentGeometryMajorRadius );
- // parent geometry minor radius
- xfer->xferReal( &m_parentGeometryminorRadius );
- // parent angle
- xfer->xferReal( &m_parentAngle );
- // parent position
- xfer->xferCoord3D( &m_parentPosition );
- // partition data
- ///@todo write me ---> !!!!!
- // PartitionData *m_partitionData; ///< our PartitionData
- } // end xfer
- // ------------------------------------------------------------------------------------------------
- /** Load post process */
- // ------------------------------------------------------------------------------------------------
- void GhostObject::loadPostProcess( void )
- {
- } // end loadPostProcess
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- GhostObjectManager::GhostObjectManager(void)
- {
- m_lockGhostObjects = FALSE;
- m_saveLockGhostObjects = FALSE;
- m_localPlayer = 0;
- }
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- GhostObjectManager::~GhostObjectManager()
- {
- }
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- void GhostObjectManager::reset(void)
- {
- }
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- GhostObject *GhostObjectManager::addGhostObject(Object *object, PartitionData *pd)
- {
- return 0;
- }
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- void GhostObjectManager::removeGhostObject(GhostObject *mod)
- {
- }
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- void GhostObjectManager::updateOrphanedObjects(int *playerIndexList, int numNonLocalPlayers)
- {
- }
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- void GhostObjectManager::releasePartitionData(void)
- {
- }
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- void GhostObjectManager::restorePartitionData(void)
- {
- }
- // ------------------------------------------------------------------------------------------------
- // ------------------------------------------------------------------------------------------------
- void GhostObjectManager::crc( Xfer *xfer )
- {
- } // end crc
- // ------------------------------------------------------------------------------------------------
- /** Xfer Method:
- * Version Info:
- * 1: Initial version */
- // ------------------------------------------------------------------------------------------------
- void GhostObjectManager::xfer( Xfer *xfer )
- {
- // version
- XferVersion currentVersion = 1;
- XferVersion version = currentVersion;
- xfer->xferVersion( &version, currentVersion );
- // local player
- xfer->xferInt( &m_localPlayer );
- } // end xfer
- // ------------------------------------------------------------------------------------------------
- /** Load post process */
- // ------------------------------------------------------------------------------------------------
- void GhostObjectManager::loadPostProcess( void )
- {
- } // end loadPostProcess
|