Imports the current Win32 source for the pod-racing game 'Red Planet', built on the MUNGA engine and its L4 (Win32/DirectX) platform layer: - MUNGA / MUNGA_L4: cross-platform engine core and Win32 backend - RP / RP_L4: Red Planet game logic and Win32 application - DivLoader, Setup1: asset loader and installer project - lib, MUNGA_L4/openal, MUNGA_L4/sos: third-party audio dependencies Removed stale Subversion metadata and added .gitignore/.gitattributes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
275 lines
5.5 KiB
C++
275 lines
5.5 KiB
C++
#pragma once
|
|
|
|
#include "cstr.h"
|
|
#include "schain.h"
|
|
#include "vchain.h"
|
|
#include "resource.h"
|
|
#include "host.h"
|
|
#include "scnrole.h"
|
|
|
|
class BitMap;
|
|
|
|
//##########################################################################
|
|
//####################### MissionHostData ############################
|
|
//##########################################################################
|
|
|
|
class MissionHostData : public Plug
|
|
{
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Construction, Destruction
|
|
//
|
|
public:
|
|
MissionHostData(const CString &address_string, HostType host_type);
|
|
virtual ~MissionHostData();
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Accessors
|
|
//
|
|
public:
|
|
CString GetAddressString() { return addressString; }
|
|
HostType GetHostType() { return hostType; }
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Private data
|
|
//
|
|
private:
|
|
CString addressString;
|
|
HostType hostType;
|
|
};
|
|
|
|
//##########################################################################
|
|
//########################### Mission ################################
|
|
//##########################################################################
|
|
|
|
class Mission SIGNATURED
|
|
{
|
|
friend class Mission_HostIterator;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Public types
|
|
//
|
|
public:
|
|
typedef Mission_HostIterator HostIterator;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Construction, Destruction, and Testing
|
|
//
|
|
public:
|
|
Mission(
|
|
NotationFile *notation_file,
|
|
ResourceFile *resources
|
|
);
|
|
virtual ~Mission();
|
|
|
|
Logical
|
|
TestInstance() const;
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Set the player data
|
|
//
|
|
public:
|
|
virtual void
|
|
SetPlayerData(NotationFile *notation_file);
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Accessors
|
|
//
|
|
public:
|
|
ResourceDescription::ResourceID
|
|
GetMapID();
|
|
ResourceDescription::ResourceID
|
|
GetExistanceMapID();
|
|
const char*
|
|
GetDropZoneName()
|
|
{Check(this); return dropZoneName;}
|
|
const char*
|
|
GetGameModel()
|
|
{Check(this); return gameModel;}
|
|
Logical
|
|
IsDropZoneHost()
|
|
{Check(this); return dropZoneHost;}
|
|
const char*
|
|
GetColorName()
|
|
{Check(this); return colorName;}
|
|
const char*
|
|
GetBadgeName()
|
|
{Check(this); return badgeName;}
|
|
const char*
|
|
GetMissionTime()
|
|
{Check(this); return missionTime;}
|
|
const char*
|
|
GetMissionWeather()
|
|
{Check(this); return missionWeather;}
|
|
const char*
|
|
GetScenarioName()
|
|
{Check(this); return scenarioName;}
|
|
|
|
int
|
|
GetTeamID()
|
|
{ Check(this); return teamID; }
|
|
int
|
|
GetPlayerCount()
|
|
{Check(this); return playerCount;}
|
|
|
|
const char*
|
|
GetPositionName()
|
|
{ Check(this); return positionName; }
|
|
|
|
Scalar
|
|
GetGameLength()
|
|
{ Check(this); return gameLength; }
|
|
|
|
BitMap*
|
|
GetLargeNameBitmap(int index)
|
|
{
|
|
Check(this);
|
|
return largeNameBitmapChain.Find(index);
|
|
}
|
|
|
|
BitMap*
|
|
GetSmallNameBitmap(int index)
|
|
{
|
|
Check(this);
|
|
return smallNameBitmapChain.Find(index);
|
|
}
|
|
|
|
BitMap*
|
|
GetOrdinalBitmap(int index)
|
|
{
|
|
Check(this);
|
|
return ordinalBitmapChain.Find(index);
|
|
}
|
|
|
|
BitMap*
|
|
GetTeamBitmap(int team_index)
|
|
{
|
|
Check(this);
|
|
return teamBitmapChain.Find(team_index);
|
|
}
|
|
|
|
BitMap*
|
|
GetLandmarkBitmap(int landmark_index)
|
|
{
|
|
Check(this);
|
|
return landmarkBitmapChain.Find(landmark_index);
|
|
}
|
|
|
|
int
|
|
GetPlayerBitmapIndex() const
|
|
{Check(this); return playerBitmapIndex;}
|
|
|
|
ScenarioRole*
|
|
GetScenarioRole(const CString &role_name)
|
|
{
|
|
Check(this);
|
|
VChainIteratorOf<ScenarioRole*, CString> iterator(scenarioRoleChain);
|
|
return iterator.Find(role_name);
|
|
}
|
|
|
|
void
|
|
AddScenarioRole(ScenarioRole *scenario_role)
|
|
{
|
|
Check(this);
|
|
Check(scenario_role);
|
|
if (!GetScenarioRole(scenario_role->GetRoleName()))
|
|
{
|
|
scenarioRoleChain.AddValue(scenario_role, scenario_role->GetRoleName());
|
|
}
|
|
#if DEBUG_LEVEL > 0
|
|
else
|
|
{
|
|
Tell(scenario_role->GetRoleName());
|
|
Warn(" already exists not adding to Mission \n");
|
|
}
|
|
#endif
|
|
}
|
|
|
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// Protected data
|
|
//
|
|
protected:
|
|
|
|
ResourceDescription::ResourceID
|
|
mapID,
|
|
existanceMapID;
|
|
SChainOf<MissionHostData*>
|
|
missionHostSocket;
|
|
char
|
|
*colorName,
|
|
*badgeName,
|
|
*dropZoneName,
|
|
*gameModel,
|
|
*missionTime,
|
|
*missionWeather,
|
|
*scenarioName;
|
|
|
|
Logical
|
|
dropZoneHost;
|
|
char
|
|
*positionName;
|
|
|
|
int
|
|
teamID,
|
|
playerCount;
|
|
|
|
int
|
|
playerBitmapIndex;
|
|
|
|
VChainOf<ScenarioRole*, CString>
|
|
scenarioRoleChain;
|
|
|
|
VChainOf<BitMap*, int>
|
|
largeNameBitmapChain,
|
|
smallNameBitmapChain;
|
|
|
|
VChainOf<BitMap*, int>
|
|
ordinalBitmapChain;
|
|
|
|
VChainOf<BitMap*, int>
|
|
teamBitmapChain;
|
|
|
|
VChainOf<BitMap*, int>
|
|
landmarkBitmapChain;
|
|
|
|
void
|
|
LoadOrdinalBitmaps(NotationFile *notation_file);
|
|
|
|
void
|
|
LoadNameBitmaps(NotationFile *notation_file);
|
|
|
|
void
|
|
LoadTeamBitmaps(NotationFile *notation_file);
|
|
|
|
void
|
|
LoadLandmarkBitmaps(NotationFile *notation_file);
|
|
|
|
Scalar
|
|
gameLength;
|
|
};
|
|
|
|
inline ResourceDescription::ResourceID
|
|
Mission::GetMapID()
|
|
{
|
|
Check(this);
|
|
return mapID;
|
|
}
|
|
|
|
inline ResourceDescription::ResourceID
|
|
Mission::GetExistanceMapID()
|
|
{
|
|
Check(this);
|
|
return existanceMapID;
|
|
}
|
|
|
|
//##########################################################################
|
|
//##################### Mission_HostIterator #########################
|
|
//##########################################################################
|
|
|
|
class Mission_HostIterator:
|
|
public SChainIteratorOf<MissionHostData*>
|
|
{
|
|
public:
|
|
Mission_HostIterator(Mission *mission);
|
|
~Mission_HostIterator();
|
|
};
|