#include <src/Ares.h>
List of all members.
Member Function Documentation
void Ares::CloseConfig |
( |
CCINIClass ** |
ppINI | ) |
[static] |
{
if(ppINI && *ppINI) {
GAME_DEALLOC(*ppINI);
*ppINI = NULL;
}
}
void __stdcall Ares::CmdLineParse |
( |
char ** |
ppArgs, |
|
|
int |
nNumArgs |
|
) |
| [static] |
void __stdcall Ares::ExeRun |
( |
| ) |
[static] |
void __stdcall Ares::ExeTerminate |
( |
| ) |
[static] |
void Ares::InitNoCDMode |
( |
| ) |
[static] |
{
if(!GetCDClass::Instance->Count) {
Debug::Log("No CD drives detected. Switching to NoCD mode.\n");
bNoCD = true;
}
if(bNoCD) {
Debug::Log("Optimizing list of CD drives for NoCD mode.\n");
memset(GetCDClass::Instance->Drives, -1, 26);
char drv[] = "a:\\";
for(int i=0; i<26; ++i) {
drv[0] = 'a' + (i + 2) % 26;
if(GetDriveTypeA(drv) == DRIVE_FIXED) {
GetCDClass::Instance->Drives[0] = (i + 2) % 26;
GetCDClass::Instance->Count = 1;
break;
}
}
}
}
void Ares::InitOwnResources |
( |
| ) |
[static] |
CCINIClass * Ares::OpenConfig |
( |
const char * |
file | ) |
[static] |
{
CCINIClass* pINI;
GAME_ALLOC(CCINIClass, pINI);
CCFileClass *cfg;
GAME_ALLOC(CCFileClass, cfg, file);
if(cfg->Exists(NULL)) {
pINI->ReadCCFile(cfg);
}
GAME_DEALLOC(cfg);
return pINI;
}
void __stdcall Ares::PostGameInit |
( |
| ) |
[static] |
void __stdcall Ares::RegisterCommands |
( |
| ) |
[static] |
{
if(bAllowAIControl) {
MakeCommand<AIControlCommandClass>();
}
MakeCommand<MapSnapshotCommandClass>();
MakeCommand<TestSomethingCommandClass>();
MakeCommand<DumperTypesCommandClass>();
MakeCommand<MemoryDumperCommandClass>();
MakeCommand<DebuggingCommandClass>();
MakeCommand<AIBasePlanCommandClass>();
}
bool Ares::RunningOnWindows7OrVista |
( |
| ) |
[static] |
{
static bool W7 = false;
static bool Checked = false;
if(!Checked) {
Checked = true;
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
W7 = (osvi.dwMajorVersion == 6);
}
return W7;
}
void Ares::SendPDPlane |
( |
HouseClass * |
pOwner, |
|
|
CellClass * |
pDestination, |
|
|
AircraftTypeClass * |
pPlaneType, |
|
|
TypeList< TechnoTypeClass * > * |
pTypes, |
|
|
TypeList< int > * |
pNums |
|
) |
| [static] |
{
if(pNums && pTypes &&
pNums->Count == pTypes->Count &&
pNums->Count > 0 &&
pOwner && pPlaneType && pTarget)
{
++Unsorted::IKnowWhatImDoing;
AircraftClass* pPlane = reinterpret_cast<AircraftClass*>(pPlaneType->CreateObject(pOwner));
--Unsorted::IKnowWhatImDoing;
pPlane->Spawned = true;
int edge = pOwner->StartingEdge;
if(edge < edge_NORTH || edge > edge_WEST) {
edge = pOwner->Edge;
if(edge < edge_NORTH || edge > edge_WEST) {
edge = edge_NORTH;
}
}
CellStruct spawn_cell;
MapClass::Instance->PickCellOnEdge(&spawn_cell, edge, (CellStruct *)0xB04C38, (CellStruct *)0xB04C38, 4, 1, 0);
pPlane->QueueMission(mission_ParadropApproach, false);
if(pTarget) {
pPlane->SetTarget(pTarget);
}
CoordStruct spawn_crd = {(spawn_cell.X << 8) + 128, (spawn_cell.Y << 8) + 128, 0};
++Unsorted::IKnowWhatImDoing;
bool bSpawned = pPlane->Put(&spawn_crd, Direction::North);
--Unsorted::IKnowWhatImDoing;
if(bSpawned) {
pPlane->HasPassengers = true;
for(int i = 0; i < pTypes->Count; i++) {
TechnoTypeClass* pTechnoType = pTypes->GetItem(i);
eAbstractType WhatAmI = pTechnoType->WhatAmI();
if(WhatAmI == abs_UnitType || WhatAmI == abs_InfantryType) {
for(int k = 0; k < pNums->Items[i]; k++) {
FootClass* pNew = reinterpret_cast<FootClass*>(pTechnoType->CreateObject(pOwner));
pNew->Remove();
pPlane->Passengers.AddPassenger(pNew);
}
}
}
pPlane->NextMission();
} else {
if(pPlane) {
GAME_DEALLOC(pPlane);
}
}
}
}
void Ares::UninitOwnResources |
( |
| ) |
[static] |
void Ares::UpdateStability |
( |
| ) |
[static] |
{
if(Ares::bStable) {
return;
}
if(Unsorted::CurrentFrame < 900) {
return;
}
if(!Ares::bStableNotification) {
Debug::FatalErrorAndExit("This version of Ares is not considered stable, but for some reason the warning text isn't showing.\n"
"This suggests that your version of Ares has been tampered with "
"and the original developers cannot be held responsible for any problems you might experience.");
}
}
Member Data Documentation
The documentation for this class was generated from the following files: