Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Generals/Code/GameEngine/Include/Common/ArchiveFileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,10 @@ class ArchiveFileSystem : public SubsystemInterface

// Unprotected this for copy-protection routines
AsciiString getArchiveFilenameForFile(const AsciiString& filename) const;

void loadMods( void );

protected:
virtual void loadIntoDirectoryTree(const ArchiveFile *archiveFile, const AsciiString& archiveFilename, Bool overwrite = FALSE); ///< load the archive file's header information and apply it to the global archive directory tree.
virtual void loadIntoDirectoryTree(const ArchiveFile *archiveFile, const AsciiString& archiveFilename, Bool overwrite = FALSE ); ///< load the archive file's header information and apply it to the global archive directory tree.

ArchiveFileMap m_archiveFileMap;
ArchivedDirectoryInfo m_rootDirectory;
Expand Down
12 changes: 12 additions & 0 deletions Generals/Code/GameEngine/Include/Common/BitFlagsIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,18 @@ template <size_t NUMBITS>
((BitFlags*)store)->parse(ini, NULL);
}

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
template <size_t NUMBITS>
/*static*/ void BitFlags<NUMBITS>::parseSingleBitFromINI(INI* ini, void* /*instance*/, void *store, const void* /*userData*/)
{
const char *token = ini->getNextToken();
Int bitIndex = INI::scanIndexList(token, s_bitNameList); // this throws if the token is not found

Int *storeAsInt = (Int*)store;
*storeAsInt = bitIndex;
}

//-------------------------------------------------------------------------------------------------
/** Xfer method
* Version Info:
Expand Down
3 changes: 3 additions & 0 deletions Generals/Code/GameEngine/Include/Common/DataChunk.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class DataChunkOutput
void writeUnicodeString(UnicodeString string);
void writeArrayOfBytes(char *ptr, Int len);
void writeDict(const Dict& d);
void writeNameKey(const NameKeyType key);
};

//----------------------------------------------------------------------
Expand Down Expand Up @@ -228,6 +229,8 @@ class DataChunkInput
UnicodeString readUnicodeString(void);
Dict readDict(void);
void readArrayOfBytes(char *ptr, Int len);

NameKeyType readNameKey(void);
};


Expand Down
3 changes: 3 additions & 0 deletions Generals/Code/GameEngine/Include/Common/DisabledTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
#include "Lib/BaseType.h"
#include "Common/BitFlags.h"
#include "Common/BitFlagsIO.h"

//-------------------------------------------------------------------------------------------------
/** Kind of flags for determining groups of things that belong together
Expand All @@ -56,6 +57,8 @@ enum DisabledType CPP_11(: Int)
DISABLED_SCRIPT_UNDERPOWERED,

DISABLED_COUNT,

DISABLED_ANY = 65535 ///< Do not use this value for setting disabled types (read-only)
};

typedef BitFlags<DISABLED_COUNT> DisabledMaskType;
Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/Include/Common/Energy.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Energy : public Snapshot

public:

inline Energy() : m_energyProduction(0), m_energyConsumption(0), m_owner(NULL) { }
Energy();

// reset energy information to base values.
void init( Player *owner)
Expand All @@ -77,7 +77,7 @@ class Energy : public Snapshot
}

/// return current energy production in kilowatts
Int getProduction() const { return m_energyProduction; }
Int getProduction() const;

/// return current energy consumption in kilowatts
Int getConsumption() const { return m_energyConsumption; }
Expand Down
7 changes: 5 additions & 2 deletions Generals/Code/GameEngine/Include/Common/FileSystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@ struct FileInfo {
* created when FileSystem::Open() gets called.
*/
//===============================
#include <map>

class FileSystem : public SubsystemInterface
{
FileSystem(const FileSystem&);
FileSystem& operator=(const FileSystem&);

public:
FileSystem();
virtual ~FileSystem();
Expand All @@ -138,8 +142,7 @@ class FileSystem : public SubsystemInterface
void loadMusicFilesFromCD();
void unloadMusicFilesFromCD();
protected:


mutable std::map<unsigned,bool> m_fileExist;
};

extern FileSystem* TheFileSystem;
Expand Down
5 changes: 1 addition & 4 deletions Generals/Code/GameEngine/Include/Common/GameMemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,6 @@ private: \
public: /* include this line at the end to reset visibility to 'public' */



// ----------------------------------------------------------------------------
/**
This class is provided as a simple and safe way to integrate C++ object allocation
Expand Down Expand Up @@ -768,7 +767,6 @@ class MemoryPoolObject
};



// INLINING ///////////////////////////////////////////////////////////////////

// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -893,7 +891,6 @@ class STLSpecialAlloc
#endif //DISABLE_GAMEMEMORY


// ----------------------------------------------------------------------------
/**
A simple utility class to ensure exception safety; this holds a MemoryPoolObject
and deletes it in its destructor. Especially useful for iterators!
Expand All @@ -910,7 +907,6 @@ class MemoryPoolObjectHolder
};


// ----------------------------------------------------------------------------
/**
Sometimes you want to make a class's destructor protected so that it can only
be destroyed under special circumstances. MemoryPoolObject short-circuits this
Expand All @@ -924,4 +920,5 @@ ARGVIS: void deleteInstance() { MemoryPoolObject::deleteInstance(); } public:

#define EMPTY_DTOR(CLASS) inline CLASS::~CLASS() { }


#endif // _GAME_MEMORY_H_
2 changes: 2 additions & 0 deletions Generals/Code/GameEngine/Include/Common/GameType.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ enum FormationID CPP_11(: Int)
FORCE_FORMATIONID_TO_LONG_SIZE = 0x7ffffff
};

#define INVALID_ANGLE -100.0f

class INI;

//-------------------------------------------------------------------------------------------------
Expand Down
8 changes: 7 additions & 1 deletion Generals/Code/GameEngine/Include/Common/GlobalData.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ class GlobalData : public SubsystemInterface

Color m_hotKeyTextColor; ///< standard color for all hotkeys.

//THis is put on ice until later - M Lorenzen
// Int m_cheaterHasBeenSpiedIfMyLowestBitIsTrue; ///< says it all.. this lives near other "colors" cause it is masquerading as one

AsciiString m_specialPowerViewObjectName; ///< Created when certain special powers are fired so players can watch.

std::vector<AsciiString> m_standardPublicBones;
Expand Down Expand Up @@ -492,10 +495,13 @@ class GlobalData : public SubsystemInterface

Bool m_isBreakableMovie; ///< if we enter a breakable movie, set this flag
Bool m_breakTheMovie; ///< The user has hit escape!

AsciiString m_modDir;
AsciiString m_modBIG;

//-allAdvice feature
//Bool m_allAdvice;


// the trailing '\' is included!
AsciiString getPath_UserData() const;

Expand Down
1 change: 1 addition & 0 deletions Generals/Code/GameEngine/Include/Common/KindOf.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
// INCLUDES ///////////////////////////////////////////////////////////////////////////////////////
#include "Lib/BaseType.h"
#include "Common/BitFlags.h"
#include "Common/BitFlagsIO.h"

//-------------------------------------------------------------------------------------------------
/** Kind of flags for determining groups of things that belong together
Expand Down
13 changes: 13 additions & 0 deletions Generals/Code/GameEngine/Include/Common/MapObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@
#include "Common/GameMemory.h"
#include "GameClient/TerrainRoads.h"



class WorldHeightMapInterfaceClass
{
public:

virtual Int getBorderSize() = 0;
virtual Real getSeismicZVelocity(Int xIndex, Int yIndex) const = 0;
virtual void setSeismicZVelocity(Int xIndex, Int yIndex, Real value) = 0;
virtual Real getBilinearSampleSeismicZVelocity( Int x, Int y) = 0;

};

/** MapObject class
Not ref counted. Do not store pointers to this class. */
class WorldHeightMap;
Expand Down
2 changes: 2 additions & 0 deletions Generals/Code/GameEngine/Include/Common/MessageStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ class GameMessage : public MemoryPoolObject
MSG_DEBUG_KILL_OBJECT,
#endif



//*********************************************************************************************************
MSG_END_NETWORK_MESSAGES = 1999, ///< MARKER TO DELINEATE MESSAGES THAT GO OVER THE NETWORK
//*********************************************************************************************************
Expand Down
3 changes: 2 additions & 1 deletion Generals/Code/GameEngine/Include/Common/MiscAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,5 @@ struct MiscAudio
};


#endif /* _MISCAUDIO_H_ */
#endif /* _MISCAUDIO_H_ */

3 changes: 3 additions & 0 deletions Generals/Code/GameEngine/Include/Common/ModelState.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "Lib/BaseType.h"
#include "Common/INI.h"
#include "Common/BitFlags.h"
#include "Common/BitFlagsIO.h"

//-------------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -83,6 +84,8 @@

*/

#define NUM_MODELCONDITION_DOOR_STATES 4

//-------------------------------------------------------------------------------------------------
// IMPORTANT NOTE: you should endeavor to set up states such that the most "normal"
// state is defined by the bit being off. That is, the typical "normal" condition
Expand Down
3 changes: 3 additions & 0 deletions Generals/Code/GameEngine/Include/Common/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Object;
class Player;
class Thing;
class W3DModelDrawModuleData; // ugh, hack (srj)
class W3DTreeDrawModuleData; // ugh, hack (srj)
struct FieldParse;

// TYPES //////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -112,6 +113,8 @@ class ModuleData : public Snapshot

// ugh, hack
virtual const W3DModelDrawModuleData* getAsW3DModelDrawModuleData() const { return NULL; }
// ugh, hack
virtual const W3DTreeDrawModuleData* getAsW3DTreeDrawModuleData() const { return NULL; }
virtual StaticGameLODLevel getMinimumRequiredGameLOD() const { return (StaticGameLODLevel)0;}

static void buildFieldParse(MultiIniFieldParse& p)
Expand Down
6 changes: 3 additions & 3 deletions Generals/Code/GameEngine/Include/Common/MultiplayerSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class MultiplayerSettings : public SubsystemInterface

MultiplayerSettings( void );

void init() { }
void update() { }
void reset() { }
virtual void init() { }
virtual void update() { }
virtual void reset() { }

//-----------------------------------------------------------------------------------------------
static const FieldParse m_multiplayerSettingsFieldParseTable[]; ///< the parse table for INI definition
Expand Down
5 changes: 5 additions & 0 deletions Generals/Code/GameEngine/Include/Common/NameKeyGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ class NameKeyGenerator : public SubsystemInterface

/// Given a string, convert into a unique integer key.
NameKeyType nameToKey(const AsciiString& name) { return nameToKey(name.str()); }
NameKeyType nameToLowercaseKey(const AsciiString& name) { return nameToLowercaseKey(name.str()); }

/// Given a string, convert into a unique integer key.
NameKeyType nameToKey(const char* name);
NameKeyType nameToLowercaseKey(const char *name);

/**
given a key, return the name. this is almost never needed,
Expand All @@ -108,6 +110,9 @@ class NameKeyGenerator : public SubsystemInterface
*/
AsciiString keyToName(NameKeyType key);

// Get a string out of the INI. Store it into a NameKeyType
static void parseStringAsNameKeyType( INI *ini, void *instance, void *store, const void* userData );

private:

enum
Expand Down
6 changes: 6 additions & 0 deletions Generals/Code/GameEngine/Include/Common/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,9 @@ class Player : public Snapshot
void toggleFreeBuild(){ m_DEMO_freeBuild = !m_DEMO_freeBuild; }
Bool buildsForFree() const { return m_DEMO_freeBuild; }

#endif

#if defined(_DEBUG) || defined(_INTERNAL) || defined(_ALLOW_DEBUG_CHEATS_IN_RELEASE)
/// No time building cheat key
void toggleInstantBuild(){ m_DEMO_instantBuild = !m_DEMO_instantBuild; }
Bool buildsInstantly() const { return m_DEMO_instantBuild; }
Expand Down Expand Up @@ -770,6 +773,9 @@ class Player : public Snapshot
#if defined(_DEBUG) || defined(_INTERNAL)
Bool m_DEMO_ignorePrereqs; ///< Can I ignore prereq checks?
Bool m_DEMO_freeBuild; ///< Can I build everything for no money?
#endif

#if defined(_DEBUG) || defined(_INTERNAL) || defined(_ALLOW_DEBUG_CHEATS_IN_RELEASE)
Bool m_DEMO_instantBuild; ///< Can I build anything in one frame?
#endif

Expand Down
1 change: 1 addition & 0 deletions Generals/Code/GameEngine/Include/Common/Radar.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ class Radar : public Snapshot,
Bool isRadarWindow( GameWindow *window ) { return (m_radarWindow == window) && (m_radarWindow != NULL); }

Bool radarToWorld( const ICoord2D *radar, Coord3D *world ); ///< radar point to world point on terrain
Bool radarToWorld2D( const ICoord2D *radar, Coord3D *world ); ///< radar point to world point (x,y only!)
Bool worldToRadar( const Coord3D *world, ICoord2D *radar ); ///< translate world point to radar (x,y)
Bool localPixelToRadar( const ICoord2D *pixel, ICoord2D *radar ); ///< translate pixel (with UL of radar being (0,0)) to logical radar coords
Bool screenPixelToWorld( const ICoord2D *pixel, Coord3D *world ); ///< translate pixel (with UL of the screen being (0,0)) to world position in the world
Expand Down
21 changes: 21 additions & 0 deletions Generals/Code/GameEngine/Include/Common/SparseMatchFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,26 @@ class SparseMatchFinder
}
};

struct MapHelper
{
bool operator()(const BITSET& a, const BITSET& b) const
{
int i;
if (a.size() < b.size()) {
return true;
}
for (i = 0; i < a.size(); ++i) {
bool aVal = a.test(i);
bool bVal = b.test(i);
if (aVal && bVal) continue;
if (!aVal && !bVal) continue;
if (!aVal) return true;
return false;
}
return false; // all bits match.
}
};

//-------------------------------------------------------------------------------------------------
typedef std::hash_map< BITSET, const MATCHABLE*, HashMapHelper, HashMapHelper > MatchMap;

Expand All @@ -80,6 +100,7 @@ class SparseMatchFinder
//-------------------------------------------------------------------------------------------------

mutable MatchMap m_bestMatches;
//mutable HashMatchMap m_bestHashMatches;

//-------------------------------------------------------------------------------------------------
// METHODS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define __SPECIALPOWERMASKTYPE_H__

#include "Common/BitFlags.h"
#include "Common/BitFlagsIO.h"
#include "Common/SpecialPowerType.h"

typedef BitFlags<SPECIALPOWER_COUNT> SpecialPowerMaskType;
Expand Down
5 changes: 1 addition & 4 deletions Generals/Code/GameEngine/Include/Common/StackDump.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@

#ifndef IG_DEGBUG_STACKTRACE
#define IG_DEBUG_STACKTRACE 1
#endif

#endif // Unsure about this one -ML 3/25/03
#if defined(_DEBUG) || defined(_INTERNAL) || defined(IG_DEBUG_STACKTRACE)

// Writes a stackdump (provide a callback : gets called per line)
Expand Down Expand Up @@ -70,6 +69,4 @@ __inline void DumpExceptionInfo( unsigned int u, EXCEPTION_POINTERS* e_info ) {}
#endif

extern AsciiString g_LastErrorDump;


#endif // __STACKDUMP_H_
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/Common/Team.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class Team : public MemoryPoolObject,
a convenience routine used to estimate the team's position by just returning the position
of the first member of the team
*/
const Coord3D* getEstimateTeamPosition(void);
const Coord3D* getEstimateTeamPosition(void) const;

/**
a convenience routine to move a team's units to another team.
Expand Down
Loading
Loading