Initial commit of Command & Conquer Generals and Command & Conquer Generals Zero Hour source code.
This commit is contained in:
parent
2e338c00cb
commit
3d0ee53a05
6072 changed files with 2283311 additions and 0 deletions
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
** 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: W3DGameLogic.h ///////////////////////////////////////////////////////
|
||||
//
|
||||
// W3D game logic class, there shouldn't be a lot of new functionality
|
||||
// in this class, but there are certain things that need to have close
|
||||
// knowledge of each other like ther logical and visual terrain
|
||||
//
|
||||
// Author: Colin Day, April 2001
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __W3DGAMELOGIC_H_
|
||||
#define __W3DGAMELOGIC_H_
|
||||
|
||||
// SYSTEM INCLUDES ////////////////////////////////////////////////////////////
|
||||
|
||||
// USER INCLUDES //////////////////////////////////////////////////////////////
|
||||
#include "GameLogic/GameLogic.h"
|
||||
#include "W3DDevice/GameLogic/W3DTerrainLogic.h"
|
||||
#include "W3DDevice/GameLogic/W3DGhostObject.h"
|
||||
|
||||
class W3DGhostObjectManager;
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// PROTOTYPES /////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// W3DGameLogic
|
||||
//-----------------------------------------------------------------------------
|
||||
/** W3D specific functionality for game logic */
|
||||
//-----------------------------------------------------------------------------
|
||||
class W3DGameLogic : public GameLogic
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
protected:
|
||||
|
||||
/// factory for TheTerrainLogic, called from init()
|
||||
virtual TerrainLogic *createTerrainLogic( void ) { return NEW W3DTerrainLogic; };
|
||||
virtual GhostObjectManager *createGhostObjectManager(void) { return NEW W3DGhostObjectManager; }
|
||||
|
||||
}; // end class W3DGameLogic
|
||||
|
||||
#endif // end __W3DGAMELOGIC_H_
|
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
** 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: W3DGhostObject.h ////////////////////////////////////////////////////////////
|
||||
// Placeholder for objects that have been deleted but need to be maintained because
|
||||
// a player can see them fogged.
|
||||
// Author: Mark Wilczynski, August 2002
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef _W3DGHOSTOBJECT_H_
|
||||
#define _W3DGHOSTOBJECT_H_
|
||||
|
||||
#include "GameLogic/GhostObject.h"
|
||||
#include "Lib/BaseType.h"
|
||||
#include "Common/GameCommon.h"
|
||||
#include "GameClient/DrawableInfo.h"
|
||||
|
||||
class Object;
|
||||
class W3DGhostObjectManager;
|
||||
class W3DRenderObjectSnapshot;
|
||||
class PartitionData;
|
||||
|
||||
class W3DGhostObject: public GhostObject
|
||||
{
|
||||
friend W3DGhostObjectManager;
|
||||
public:
|
||||
W3DGhostObject();
|
||||
virtual ~W3DGhostObject();
|
||||
virtual void snapShot(int playerIndex);
|
||||
virtual void updateParentObject(Object *object, PartitionData *mod);
|
||||
virtual void freeSnapShot(int playerIndex);
|
||||
protected:
|
||||
virtual void crc( Xfer *xfer);
|
||||
virtual void xfer( Xfer *xfer );
|
||||
virtual void loadPostProcess( void );
|
||||
void removeParentObject(void);
|
||||
void restoreParentObject(void); ///< restore the original non-ghosted object to scene.
|
||||
void addToScene(int playerIndex);
|
||||
void removeFromScene(int playerIndex);
|
||||
void release(void); ///< used by manager to return object to free store.
|
||||
void getShroudStatus(int playerIndex); ///< used to get the partition manager to update ghost objects without parent objects.
|
||||
void freeAllSnapShots(void); ///< used to free all snapshots from all players.
|
||||
W3DRenderObjectSnapshot *m_parentSnapshots[MAX_PLAYER_COUNT];
|
||||
DrawableInfo m_drawableInfo;
|
||||
|
||||
///@todo this list should really be part of the device independent base class (CBD 12-3-2002)
|
||||
W3DGhostObject *m_nextSystem;
|
||||
W3DGhostObject *m_prevSystem;
|
||||
};
|
||||
|
||||
class W3DGhostObjectManager : public GhostObjectManager
|
||||
{
|
||||
public:
|
||||
W3DGhostObjectManager();
|
||||
virtual ~W3DGhostObjectManager();
|
||||
virtual void reset(void);
|
||||
virtual GhostObject *addGhostObject(Object *object, PartitionData *pd);
|
||||
virtual void removeGhostObject(GhostObject *mod);
|
||||
virtual void setLocalPlayerIndex(int index);
|
||||
virtual void updateOrphanedObjects(int *playerIndexList, int numNonLocalPlayers);
|
||||
virtual void W3DGhostObjectManager::releasePartitionData(void);
|
||||
virtual void W3DGhostObjectManager::restorePartitionData(void);
|
||||
|
||||
protected:
|
||||
virtual void crc( Xfer *xfer );
|
||||
virtual void xfer( Xfer *xfer );
|
||||
virtual void loadPostProcess( void );
|
||||
|
||||
///@todo this list should really be part of the device independent base class (CBD 12-3-2002)
|
||||
W3DGhostObject *m_freeModules;
|
||||
W3DGhostObject *m_usedModules;
|
||||
};
|
||||
|
||||
#endif // _W3DGHOSTOBJECT_H_
|
|
@ -0,0 +1,85 @@
|
|||
/*
|
||||
** 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: W3DTerrainLogic.h ////////////////////////////////////////////////////////////////////////
|
||||
// W3D implementation details for logical terrain
|
||||
// Author: Colin Day, April 2001
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __W3DTERRAINLOGIC_H_
|
||||
#define __W3DTERRAINLOGIC_H_
|
||||
|
||||
#include "GameLogic/TerrainLogic.h"
|
||||
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
/** W3D specific implementation details for logical terrain ... we have this
|
||||
* because the logic and visual terrain are closely tied together in that
|
||||
* they represent the same thing, but need to be broken up into logical
|
||||
* and graphical representations */
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
class W3DTerrainLogic : public TerrainLogic
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
W3DTerrainLogic();
|
||||
virtual ~W3DTerrainLogic();
|
||||
|
||||
virtual void init( void ); ///< Init
|
||||
virtual void reset( void ); ///< Reset
|
||||
virtual void update( void ); ///< Update
|
||||
|
||||
/// @todo The loading of the raw height data should be device independent
|
||||
virtual Bool loadMap( AsciiString filename , Bool query );
|
||||
virtual void newMap( Bool saveGame ); ///< Initialize the logic for new map.
|
||||
|
||||
virtual Real getGroundHeight( Real x, Real y, Coord3D* normal = NULL ) const;
|
||||
|
||||
virtual Bool isCliffCell( Real x, Real y) const; ///< is point cliff cell.
|
||||
|
||||
virtual Real getLayerHeight(Real x, Real y, PathfindLayerEnum layer, Coord3D* normal = NULL, Bool clip = true) const;
|
||||
|
||||
virtual void getExtent( Region3D *extent ) const ; ///< Get the 3D extent of the terrain in world coordinates
|
||||
|
||||
virtual void getMaximumPathfindExtent( Region3D *extent ) const;
|
||||
|
||||
virtual void getExtentIncludingBorder( Region3D *extent ) const;
|
||||
|
||||
virtual Bool isClearLineOfSight(const Coord3D& pos, const Coord3D& posOther) const;
|
||||
|
||||
protected:
|
||||
|
||||
// snapshot methods
|
||||
virtual void crc( Xfer *xfer );
|
||||
virtual void xfer( Xfer *xfer );
|
||||
virtual void loadPostProcess( void );
|
||||
|
||||
Real m_mapMinZ; ///< Minimum terrain z value.
|
||||
Real m_mapMaxZ; ///< Maximum terrain z value.
|
||||
|
||||
}; // end W3DTerrainLogic
|
||||
|
||||
#endif // end __W3DTERRAINLOGIC_H_
|
Reference in a new issue