____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"
#include <stdlib.h>
#include <string>
#include "util.h"
#include "translate.h"
Go to the source code of this file.
Defines | |
| #define | _C_ , |
| Debug , to simulate vararg macros. | |
| #define | PrintFunction() do { fprintf(stdout, "%s:%d: ", __FILE__, __LINE__); } while (0) |
| #define | Assert(cond) |
| #define | DebugPrint(args) |
| #define | _(str) Translate(str) |
| #define | N_(str) str |
| #define | STRATAGUS_LIB_PATH "." |
| Where to find the data files. | |
| #define | STRATAGUS_HOME_PATH ".boswars/" |
| #define | PlayerMax 9 |
| How many players are supported. | |
| #define | UnitTypeMax 257 |
| How many unit types supported. | |
| #define | UnitMax 2048 |
| How many units supported. | |
| #define | FRAMES_PER_SECOND 30 |
| < Frames per second to display | |
| #define | CYCLES_PER_SECOND 30 |
Functions | |
| void | LoadGame (const std::string &filename) |
| Load saved game. | |
| void | SaveGame (const std::string &filename) |
| Save game. | |
| void | Exit (int err) |
| Exit. | |
| void | ExitFatal (int err) |
| Exit with fatal error. | |
| void | UpdateDisplay (void) |
| Game display update. | |
| void | InitModules (void) |
| Initialize all modules. | |
| void | LoadModules (void) |
| Load all modules. | |
| void | CleanModules (void) |
| Cleanup all modules. | |
| void | DrawMapArea (void) |
| Draw the map area. | |
| void | GameMainLoop (void) |
| Game main loop. | |
| void | ShowLoadProgress (const char *fmt,...) |
Variables | |
| std::string | UserDirectory |
| Directory containing user settings and data. | |
| std::string | StratagusLibPath |
| Location of stratagus data. | |
| std::string | ClickMissile |
| Missile to show when you click. | |
| std::string | DamageMissile |
| Missile to show damage caused. | |
| int | SpeedBuild |
| Speed factor for building. | |
| int | SpeedTrain |
| Speed factor for training. | |
| unsigned long | GameCycle |
| Game simulation cycle counter. | |
| unsigned long | FastForwardCycle |
| Game Replay Fast Forward Counter. | |
| std::string | CompileOptions |
| Compile options. | |
| bool | SaveGameLoading |
| Save game is in progress of loading. | |
Definition in file stratagus.h.
| #define _ | ( | str | ) | Translate(str) |
Definition at line 129 of file stratagus.h.
Referenced by CenterOnMessage(), CheckCanBuild(), CPlayer::CheckLimits(), MessagesDisplay::CheckRepeatMessage(), CommandQuit(), CButtonPanel::DoClicked(), DoNextReplay(), DrawPlayers(), DrawResources(), DrawUnitStats(), EditorActionRemoveUnit(), EditorCallbackButtonDown(), EditorCallbackKeyDown(), EditorCallbackMouse(), Exit(), HandleActionBuilt(), HandleActionSpellCast(), HandleActionTrain(), HandleKeyModifiersDown(), HitUnit(), InitKey2Str(), MoveToLocation(), NetworkEvent(), NetworkRecover(), ParseNetworkCommand(), PatchEditorMainLoop(), ReplayEachCycle(), ShowInput(), ShowPatchInfo(), ShowUnitInfo(), StartBuilding(), UiDecreaseGameSpeed(), UIHandleButtonUp(), UiIncreaseGameSpeed(), UiToggleBigMap(), UiToggleGrabMouse(), UiToggleMusic(), UiTogglePause(), UiToggleSound(), and UiToggleTerrain().
| #define _C_ , |
Debug , to simulate vararg macros.
This simulates vararg macros. Example: DebugPrint("Test %d %d\n" _C_ 1 _C_ 2); Print function in debug macros
Definition at line 88 of file stratagus.h.
Referenced by AddButton(), AiCanNotBuild(), AiCountUnitBuilders(), AiFindBuildingPlace(), AiFindTarget(), AiHelpMe(), AiInit(), AiMakeUnit(), AiPlanAttack(), AiRepairUnit(), AiTrainingComplete(), AiUnitKilled(), AiWorkComplete(), AttackTarget(), Summon::Cast(), Ccl2Condition(), CclAiAttackWithForce(), CclAiForce(), CclAiForceRole(), CclAiWait(), CclAiWaitForce(), CclDefineAi(), CclDefineAiHelper(), CclDefineAiPlayer(), CclDefineAllow(), CclDefineAnimations(), CclDefineButton(), CclDefineButtonStyle(), CclDefineConstruction(), CclDefineCursor(), CclDefineDecorations(), CclDefineGameSounds(), CclDefineMissileType(), CclDefinePlayerColors(), CclDefinePlayerTypes(), CclDefineSpell(), CclDefineSprites(), CclDefineUnitAllow(), CclDefineUnitType(), CclDefineVariables(), CclDefineViewports(), CclGarbageCollect(), CclGetResourceByName(), CclGetUnitVariable(), CclIfNearUnit(), CclIfRescuedNearUnit(), CclLoad(), CclLog(), CclMissile(), CclOrderUnit(), CclParseBuilt(), CclParseHarvest(), CclParseMove(), CclParseOrder(), CclParseTrain(), CclPlayer(), CclReplayLog(), CclSavedGameInfo(), CclSetTitleScreens(), CclSetUnitVariable(), CclSlotUsage(), CclSpellAction(), CclSpellAutocast(), CclSpellCondition(), CclSpellMissileLocation(), CclStratagusMap(), CclUnit(), CheckVersions(), ClientParseAsync(), ClientParseConnected(), ClientParseConnecting(), ClientParseDetaching(), ClientParseGoAhead(), ClientParseMapInfo(), ClientParseStarted(), ClientParseSynced(), CommandCancelTraining(), CommandSpellCast(), ConstructionByIdent(), CreatePlayer(), CursorByIdent(), DebugPlayers(), DefineVariableField(), DoNextReplay(), CUnit::Draw(), Exit(), ExitNetwork1(), FindLabel(), FindNewResource(), FireMissile(), GatherResource(), CIcon::Get(), CFontColor::Get(), CFont::Get(), HandleActionBuilt(), HandleActionNone(), HandleActionPatrol(), HandleBuffs(), HandleMouseOn(), InitNetwork1(), InitNetwork2(), InitSdlSound(), KickDeadClient(), LibraryFileName(), LoadIcons(), MakeSound(), MakeSoundGroup(), MakeTextures2(), MakeUnit(), NetworkEvent(), NetworkExecCommands(), NetworkExitServerConnect(), NetworkGamePrepareGameSettings(), NetworkParseMenuPacket(), NetworkProcessClientRequest(), NetworkProcessServerRequest(), NetworkSendCommands(), NetworkSendRateLimitedClientMessage(), NetworkServerStartGame(), NetworkSetupServerAddress(), NextPathElement(), ParseAnimationFrame(), ParseBuildingRules(), ParseButtonStyleProperties(), ParseCommand(), ParseExtendedCommand(), ParseNetworkCommand(), PlayMusic(), CUnit::Release(), CUnit::Remove(), ResourceGiveUp(), SendCommand(), SendSpellCast(), ServerParseGoodBye(), ServerParseHello(), ServerParseMap(), ServerParseResync(), ServerParseSeeYou(), ServerParseState(), ServerParseWaiting(), SetVideoSync(), ShowLoadProgress(), ShowSingleOrder(), SoundForName(), SpellCast(), StartEditor(), StartMap(), TriggerGetPlayer(), UIHandleButtonDown(), UiToggleGrabMouse(), UnitLost(), UnitTypeIdByIdent(), and UpdateUnitVariables().
| #define Assert | ( | cond | ) |
Definition at line 112 of file stratagus.h.
Referenced by CPatchManager::add(), AddAnimationToArray(), AddButton(), CUnit::AddInContainer(), AddToGroup(), CPlayer::AddToUnitsConsumingResources(), AiAssignHarvester(), AiCanNotBuild(), AiCanNotReach(), AiHelperInsert(), AiNeedMoreSupply(), AiReduceMadeInBuilt(), AiRemoveFromBuilt(), AiRemoveFromBuilt2(), AiTrainingComplete(), AiUnitKilled(), AiWorkComplete(), AllocNCQ(), AnimateActionHarvest(), AStarRemoveMinimum(), AttackTarget(), AttackUnitsInRange(), AttackUnitsInReactRange(), AutoAttack(), CalculateCosts(), CalculateDamage(), CalculateMaxIconSize(), CanMove(), AdjustVitals::Cast(), CclAiWaitForce(), CclDefineAiPlayer(), CclDefineCursor(), CclDefineDecorations(), CclLog(), CclMissile(), CclParseBuilt(), CclReplayLog(), CclSlotUsage(), CclSpellMissileLocation(), CclUnit(), ChangeSelectedUnits(), ChangeTeamSelectedUnits(), CheckForTargetInRange(), CleanButtons(), ClearGroup(), ClipViewport(), CMap::CoastOnMap(), CommandAttack(), CommandAttackGround(), CommandMove(), CommandMoveOrder(), CommandPatrolUnit(), CommandSpellCast(), CommandStopUnit(), CostMoveTo(), CMap::Create(), CSmokeParticle::CSmokeParticle(), DefaultResourceNumber(), DoActionMove(), CButtonPanel::DoClicked(), DoDrawText(), DoNextReplay(), DoRepair(), DoRightButton(), CUnit::Draw(), CDecoVarSpriteBar::Draw(), CButtonPanel::Draw(), linedraw_gl::DrawCircle(), linedraw_gl::DrawCircleClip(), DrawDecoration(), linedraw_gl::DrawLineClip(), Missile::DrawMissile(), DrawShadow(), DropOutAll(), DropOutNearest(), FillChannel(), FindRangeAttack(), FireMissile(), CGraphic::Free(), GameMainLoop(), GetButtonStatus(), CPatchType::getFlag(), getUnitTypeFromString(), GraphicAnimation::GraphicAnimation(), GraphicPlayerPixels(), HandleActionAttack(), HandleActionDie(), HandleActionFollow(), HandleActionMove(), HandleMouseOn(), HandleUnitAction(), HitUnit(), COrder::Init(), CUnit::Init(), InitAStar(), InitUnitTypes(), CUnitCache::Insert(), InvalidateArea(), IsButtonAllowed(), CUnit::IsVisibleInViewport(), CursorConfig::Load(), IconConfig::Load(), CGraphic::Load(), LoadMap(), MissileType::LoadMissileSprite(), LoadWav(), LuaCallback::LuaCallback(), main(), MakeSound(), MapMarkTileRadar(), MapMarkTileRadarJammer(), MapMarkTileSight(), MapUnmarkTileRadar(), MapUnmarkTileRadarJammer(), MapUnmarkTileSight(), MissileHit(), MissileHitsGoal(), MissileInitMove(), MissileNewHeadingFromXY(), MissilesActionLoop(), MixChannelsToStereo32(), MixMusicToStereo32(), MixSampleToStereo32(), MoveToDropZone(), MoveToLocation(), MoveToTarget(), MoveToTransporter(), CUnit::MoveToXY(), NetResolveHost(), NetworkExecCommands(), NetworkGamePrepareGameSettings(), NetworkProcessSelection(), NetworkSendCommand(), NetworkServerStartGame(), CPlayerColorGraphic::New(), CGraphic::New(), CFile::open(), ParabolicMissile(), ParseBuildingRules(), ParseCommand(), ParseNetworkCommand(), CUnit::Place(), PlaceReachable(), PointToPointMissile(), CUnit::RefsDecrease(), CUnit::RefsIncrease(), CUnit::Release(), CUnitCache::Remove(), RemoveOrder(), RemoveUnitFromContainer(), RemoveUnitFromGroups(), CGraphic::Resize(), RestoreSavedOrder(), SaveGlobal(), SaveUnit(), CUnitCache::Select(), SelectGroup(), SelectTargetUnitsOfAutoCast(), SelectUnitsByType(), SetClipping(), CPatchType::setFlag(), SetGroup(), SoundForName(), SpellMoveToTarget(), StartBuilding(), StartGathering(), StaticParticle::StaticParticle(), MenuScreen::stop(), UIHandleButtonDown(), UnitCanBeAt(), UnitIdAllowed(), UnitLost(), UnitShowAnimationScaled(), UnitsOnTileUnmarkSeen(), UnitTypeCanBeAt(), UnitTypeIdByIdent(), UnloadUnit(), UnSelectUnit(), UpdateButtonPanelMultipleUnits(), UpdateButtonPanelSingleUnit(), UpdateStatusLineForButton(), UpdateUnitSightRange(), UpdateUnitVariables(), and CMap::WaterOnMap().
| #define CYCLES_PER_SECOND 30 |
Definition at line 164 of file stratagus.h.
Referenced by AiCheckRepair(), AiEachSecond(), AiResourceManager(), CclSetResourcesHeld(), DoRightButton(), DrawCosts(), DrawInfoPanelNoneSelected(), DrawPopup(), DrawResources(), DrawTimer(), DrawUnitInfo(), GameMainLoop(), CUnitType::GetEnergyStorageCapacity(), CPlayer::GetEnergyStorageCapacity(), CPlayer::GetEnergyStored(), CUnitType::GetEnergyValue(), GetGameSpeed(), CUnitType::GetMagmaStorageCapacity(), CPlayer::GetMagmaStorageCapacity(), CPlayer::GetMagmaStored(), CUnitType::GetMagmaValue(), CPlayer::GetTotalEnergy(), CPlayer::GetTotalMagma(), HandleActionTrain(), HitUnit(), SendCommand(), CUnitType::SetEnergyStorageCapacity(), CPlayer::SetEnergyStorageCapacity(), CPlayer::SetEnergyStored(), CUnitType::SetEnergyValue(), SetGameSpeed(), CUnitType::SetMagmaStorageCapacity(), CPlayer::SetMagmaStorageCapacity(), CPlayer::SetMagmaStored(), CUnitType::SetMagmaValue(), CPlayer::SetTotalEnergy(), CPlayer::SetTotalMagma(), SetVideoSync(), ShowTitleImage(), ShowUnitInfo(), UnitActions(), and UpdateUnitVariables().
| #define DebugPrint | ( | args | ) |
Definition at line 113 of file stratagus.h.
Referenced by AddButton(), AiAttackWithForce(), AiCanNotBuild(), AiCountUnitBuilders(), AiFindBuildingPlace(), AiFindTarget(), AiForceAttacks(), AiForceManager(), AiHelpMe(), AiInit(), AiMakeUnit(), AiMarkWaterTransporter(), AiPlanAttack(), AiRemoveFromBuilt(), AiRepairUnit(), AiTrainingComplete(), AiUnitKilled(), AiWorkComplete(), AttackTarget(), Summon::Cast(), SpawnPortal::Cast(), CclAiWait(), CclCreateUnit(), CclDefineAi(), CclDefineAiPlayer(), CclDefineAllow(), CclDefineMissileType(), CclDefineSpell(), CclDefineUnitAllow(), CclDefineUnitType(), CclDefineVariables(), CclGarbageCollect(), CclLoad(), CclParseOrder(), CclSavedGameInfo(), CclSpellAction(), CclUnit(), CUnit::ChangeOwner(), CheckVersions(), CleanSpells(), ClientParseAsync(), ClientParseConnected(), ClientParseConnecting(), ClientParseDetaching(), ClientParseGoAhead(), ClientParseMapInfo(), ClientParseStarted(), ClientParseSynced(), ClosestFreeCoast(), CommandAttackGround(), CommandCancelTraining(), CommandDismiss(), CommandSpellCast(), ConstructionByIdent(), CreateGame(), CreatePlayer(), CursorByIdent(), DebugPlayers(), DoDrawText(), DoNextReplay(), DoRightButton(), CUnit::Draw(), EditorActionPlaceUnit(), EnterTransporter(), Exit(), ExitNetwork1(), FindNewResource(), FireMissile(), GatherResource(), CIcon::Get(), CFontColor::Get(), CFont::Get(), GetUTF8(), HandleActionAttack(), HandleActionBuilt(), HandleActionFollow(), HandleActionMove(), HandleActionNone(), HandleActionPatrol(), HandleActionSpellCast(), HandleActionTrain(), HandleBuffs(), HandleCheats(), HandleCommandKey(), HandleMouseOn(), HandleUnitAction(), HitUnit(), InitNetwork1(), InitNetwork2(), InitSdlSound(), KickDeadClient(), LeaveTransporter(), LetUnitDie(), LibraryFileName(), LoadIcons(), MakeSound(), MakeSoundGroup(), MakeTextures2(), MakeUnit(), MissileHit(), MoveToLocation(), NetSocketSetSocketReady(), NetworkEvent(), NetworkExecCommands(), NetworkExitServerConnect(), NetworkGamePrepareGameSettings(), NetworkParseMenuPacket(), NetworkProcessClientRequest(), NetworkProcessServerRequest(), NetworkSendCommands(), NetworkSendRateLimitedClientMessage(), NetworkServerStartGame(), NetworkSetupServerAddress(), CFile::open(), ParseCommand(), ParseExtendedCommand(), ParseNetworkCommand(), PlayMusic(), CUnit::Release(), CUnit::Remove(), RepairUnit(), ResourceGiveUp(), SaveAi(), SaveOrder(), SavePlayers(), SelectTargetUnitsOfAutoCast(), SelectUnit(), SendCommand(), SendRepair(), SendSpellCast(), ServerParseGoodBye(), ServerParseHello(), ServerParseMap(), ServerParseResync(), ServerParseSeeYou(), ServerParseState(), ServerParseWaiting(), SetVideoSync(), SetViewportMode(), SetViewportModeQuad(), SetViewportModeSingle(), SetViewportModeSplitHoriz(), SetViewportModeSplitHoriz3(), SetViewportModeSplitVert(), ShowLoadProgress(), ShowSingleOrder(), SoundForName(), SpellCast(), StartEditor(), StartMap(), UIHandleButtonDown(), UiToggleGrabMouse(), UnitLost(), UnitTypeIdByIdent(), UpdateStats(), UpdateUnitVariables(), WaitForTransporter(), and CFile::~CFile().
| #define FRAMES_PER_SECOND 30 |
< Frames per second to display
Game cycles per second to simulate
Definition at line 162 of file stratagus.h.
Referenced by DoScrollArea(), EditorMainLoop(), NetworkRecover(), and CMinimap::Update().
| #define N_ | ( | str | ) | str |
Definition at line 130 of file stratagus.h.
| #define PlayerMax 9 |
How many players are supported.
Definition at line 153 of file stratagus.h.
Referenced by ApplyReplaySettings(), CclDefineAiPlayer(), CclDefineAllow(), CclDefinePlayerColorIndex(), CclDefinePlayerTypes(), CclDefineUnitAllow(), CclPlayer(), CclReplayLog(), CclSetAllPlayersBuildingLimit(), CclSetAllPlayersTotalUnitLimit(), CclSetAllPlayersUnitLimit(), CclUnit(), CleanAi(), CleanPlayers(), CleanSelections(), ClientParseAsync(), ClientParseConnecting(), CreateGame(), CreatePlayer(), DebugPlayers(), CInitMessage::Deserialize(), CServerSetup::Deserialize(), DrawInfoPanelNoneSelected(), DrawPlayers(), DrawStartLocations(), DrawUnitSelection(), EditorCallbackMouse(), CGraphic::Free(), FreeOpenGLGraphics(), GameTypeFreeForAll(), GameTypeLeftVsRight(), GameTypeManTeamVsMachine(), GameTypeManVsMachine(), GameTypeTopVsBottom(), GetNumOpponents(), CEditor::Init(), InitNetwork1(), InitPlayers(), InitSelections(), InitSettings(), InputKey(), IsTileRadarVisible(), CMap::IsTileVisible(), CUnit::IsVisible(), KickDeadClient(), NetListenTCP(), NetworkExitServerConnect(), NetworkGamePrepareGameSettings(), NetworkInitClientConnect(), NetworkInitServerConnect(), NetworkParseMenuPacket(), NetworkProcessServerRequest(), NetworkSendSelection(), NetworkServerResyncClients(), NetworkServerStartGame(), ReloadGraphics(), ReplayEachCycle(), RestoreSelection(), CMap::Reveal(), CMap::Save(), SaveAiPlayers(), SaveFullLog(), SavePlayers(), SaveSelection(), SaveUnit(), SaveUpgrades(), CInitMessage::Serialize(), CServerSetup::Serialize(), ServerParseHello(), ServerParseResync(), ServerParseState(), ServerParseWaiting(), SetPlayersPalette(), CServerSetup::Size(), StartReplay(), tolua_get_stratagus_CMapInfo_PlayerType(), tolua_get_stratagus_CServerSetup_CompOpt(), tolua_get_stratagus_CServerSetup_LastFrame(), tolua_get_stratagus_CServerSetup_Ready(), tolua_get_stratagus_Hosts(), tolua_get_stratagus_Players(), tolua_get_stratagus_Settings_Presets(), tolua_set_stratagus_CMapInfo_PlayerType(), tolua_set_stratagus_CServerSetup_CompOpt(), tolua_set_stratagus_CServerSetup_LastFrame(), tolua_set_stratagus_CServerSetup_Ready(), tolua_set_stratagus_Hosts(), tolua_set_stratagus_Players(), tolua_set_stratagus_Settings_Presets(), tolua_stratagus_open(), TriggerGetPlayer(), UnitCountSeen(), UnitsOnTileMarkSeen(), UnitsOnTileUnmarkSeen(), UnSelectUnit(), UpdateStats(), WriteMapPresentation(), WriteMapSetup(), and CUnitType::~CUnitType().
| #define PrintFunction | ( | ) | do { fprintf(stdout, "%s:%d: ", __FILE__, __LINE__); } while (0) |
| #define STRATAGUS_HOME_PATH ".boswars/" |
| #define STRATAGUS_LIB_PATH "." |
| #define UnitMax 2048 |
How many units supported.
Definition at line 155 of file stratagus.h.
Referenced by AddSelectedAirUnitsInRectangle(), AddSelectedGroundUnitsInRectangle(), AddSelectedUnitsInRectangle(), AiAssignFreeUnitsToForce(), AiBuildBuilding(), AiEnemyUnitsInDistance(), AiRepairBuilding(), AiTrainUnit(), AttackUnitsInDistance(), Summon::Cast(), AreaAdjustVitals::Cast(), Demolish::Cast(), CclChangeUnitsOwner(), CclDefineAllow(), CclGetNumUnitsAt(), CclIfNearUnit(), CclIfRescuedNearUnit(), CclKillUnitAt(), CclOrderUnit(), CBuildRestrictionOnTop::Check(), CBuildRestrictionAddOn::Check(), CBuildRestrictionDistance::Check(), CheckAlreadyBuilding(), CPlayer::CheckLimits(), CViewport::Draw(), EditorActionPlaceUnit(), EnemyOnMapTile(), FindRangeAttack(), HandleActionTrain(), MakeUnit(), MapFogFilterFlags(), MissileHit(), NetworkProcessSelection(), RescueUnits(), ResourceOnMap(), SaveAiPlayer(), CUnitCache::Select(), SelectAirUnitsInRectangle(), SelectGroundUnitsInRectangle(), SelectTargetUnitsOfAutoCast(), SelectUnitsByType(), SelectUnitsInRectangle(), TargetOnMap(), ToggleUnitsByType(), tolua_get_stratagus_CPlayer_Units(), tolua_set_stratagus_CPlayer_Units(), tolua_stratagus_open(), UnitActions(), UnitLost(), UnitOnMapTile(), UnitsOnTileMarkSeen(), UnitsOnTileUnmarkSeen(), UnitToRepairInRange(), and UnmarkUnitFieldFlags().
| #define UnitTypeMax 257 |
How many unit types supported.
Definition at line 154 of file stratagus.h.
Referenced by AiCheckBelongsToForce(), AiCheckUnits(), AiCleanForce(), AiFindUnitTypeEquiv(), AiMakeUnit(), AiNewUnitTypeEquiv(), AiReduceMadeInBuilt(), AiRemoveFromBuilt(), AiResetUnitTypeEquiv(), tolua_get_stratagus_CPlayer_UnitTypesCount(), and UnitIdAllowed().
| void CleanModules | ( | void | ) |
Cleanup all modules.
Cleanup modules.
Call each module to clean up.
Definition at line 77 of file loadgame.cpp.
References CMap::Clean(), CleanButtons(), CleanConstructions(), CleanCursors(), CleanDecorations(), CMap::CleanFogOfWar(), CleanFonts(), CleanGroups(), CleanIcons(), CleanMessages(), CleanMissiles(), CleanMissileTypes(), CleanPlayers(), CleanReplayLog(), CleanSelections(), CleanSpells(), CleanTriggers(), CleanUnits(), CleanUnitTypes(), CleanUserInterface(), EndReplayLog(), CParticleManager::exit(), FreeAi(), FreePathfinder(), FreeVisionTable(), and Map.
Referenced by EditorMainLoop(), and Exit().
| void DrawMapArea | ( | void | ) |
Draw the map area.
Draw map area
Definition at line 162 of file mainloop.cpp.
References NoUnitP, CUserInterface::NumViewports, TileSizeX, TileSizeY, UI, UnitActionDie, and CUserInterface::Viewports.
Referenced by EditorUpdateDisplay(), and UpdateDisplay().
| void Exit | ( | int | err | ) |
Exit.
Exit the game.
| err | Error code to pass to shell. |
Definition at line 566 of file stratagus.cpp.
References _, _C_, CleanModules(), Containers, DebugPrint, ExitNetwork1(), FrameCounter, freeGuichan(), Lua, NetworkQuit(), QuitSound(), SlowFrameCounter, and StopMusic().
Referenced by AiInit(), ApplyReplaySettings(), EditorCallbackKeyDown(), main(), PatchEditorCallbackKeyDown(), SdlDoEvent(), ToggleFullScreen(), and tolua_stratagus_Exit00().
| void ExitFatal | ( | int | err | ) |
Exit with fatal error.
Do a fatal exit. Called on out of memory or crash.
| err | Error code to pass to shell. |
Definition at line 601 of file stratagus.cpp.
Referenced by CPlayerColorGraphic::ForceNew(), CGraphic::ForceNew(), IconConfig::Load(), CGraphic::Load(), LoadCcl(), LoadMap(), LoadStratagusMap(), LuaLoadBuffer(), main(), CPlayerColorGraphic::New(), CGraphic::New(), NewUnitTypeSlot(), FileWriter::printf(), and SaveStratagusMap().
| void GameMainLoop | ( | void | ) |
Game main loop.
Show load progress
Game main loop.
Unit actions. Missile actions. Players (AI). Cyclic events (color cycle,...) Display update. Input/Network/Sound.
Definition at line 253 of file mainloop.cpp.
References Assert, CclCommand(), CheckMusicFinished(), CursorConfig::Cursor, CYCLES_PER_SECOND, DoScrollArea(), EndReplayLog(), CParticleManager::exit(), FastForwardCycle, FlagRevealMap, GameCursor, GameCycle, GamePaused, GameRunning, GetCallbacks(), GodMode, CParticleManager::init(), InitGameCallbacks(), KeyModifiers, KeyScrollState, CUserInterface::Minimap, MissileActions(), ModifierControl, MouseScrollState, MultiPlayerReplayEachCycle(), NetworkCommands(), NetworkInSync, NetworkQuit(), NetworkRecover(), NumPlayers, ParticleManager, PlayersEachCycle(), PlayersEachSecond(), CUserInterface::Point, RealizeVideoMemory(), ReplayRevealMap, RescueUnits(), SaveGameLoading, SetCallbacks(), SetVideoSync(), SinglePlayerReplayEachCycle(), SkipGameCycle, TriggersEachCycle(), UI, UnitActions(), CParticleManager::update(), CMinimap::Update(), UpdateDisplay(), UpdateMessages(), UpdateTimer(), and WaitEventsOneFrame().
Referenced by StartMap().
| void InitModules | ( | void | ) |
Initialize all modules.
Initialize all modules.
Call each module to initialize.
Definition at line 112 of file loadgame.cpp.
References CallbackMusicOn, FastForwardCycle, GameCycle, CMap::Init(), InitAiModule(), InitButtons(), InitConstructions(), InitGroups(), InitIcons(), InitMissiles(), InitMissileTypes(), InitPlayers(), InitSelections(), InitSpells(), InitSyncRand(), InitTriggers(), InitUnits(), InitUnitTypes(), InitUserInterface(), InitVideoCursors(), Map, and SyncHash.
Referenced by LoadGame().
| void LoadGame | ( | const std::string & | filename | ) |
Load saved game.
Load a game to file.
| filename | File name to be loaded. |
Definition at line 179 of file loadgame.cpp.
References CclGarbageCollect(), CommandLogDisabled, FontWhite, FontYellow, GameCycle, InitModules(), InitUnitTypes(), InitVisionTable(), LoadFonts(), LoadModules(), LuaLoadFile(), NumPlayers, NumUnits, CUnit::Place(), Players, CPlayer::RebuildUnitsConsumingResourcesList(), CUnit::Removed, SaveGameLoading, SelectionChanged(), SetDefaultTextColors(), SyncHash, SyncRandSeed, Units, CUnit::X, and CUnit::Y.
Referenced by StartSavedGame().
| void LoadModules | ( | void | ) |
Load all modules.
Load all.
Call each module to load additional files (graphics,sounds).
Definition at line 149 of file loadgame.cpp.
References CMinimap::Create(), InitPathfinder(), InitSoundClient(), CUserInterface::Load(), LoadConstructions(), LoadCursors(), LoadDecorations(), LoadFonts(), LoadIcons(), LoadMissileSprites(), LoadUnitSounds(), LoadUnitTypes(), MapUnitSounds(), CUserInterface::Minimap, CUserInterface::NormalFontColor, CUserInterface::ReverseFontColor, SetDefaultTextColors(), SetPlayersPalette(), SoundEnabled(), and UI.
Referenced by LoadGame().
| void SaveGame | ( | const std::string & | filename | ) |
Save game.
Save a game to file.
| filename | File name to be stored. |
Definition at line 84 of file savegame.cpp.
References CL_OPEN_WRITE, CL_WRITE_GZ, CFile::close(), CurrentMapPath, CMapInfo::Description, GameCycle, GetSaveDir(), CMap::Info, Lua, Map, CFile::open(), CFile::printf(), CMap::Save(), SaveAi(), SaveCcl(), SaveGlobal(), SaveGroups(), SaveMissiles(), SavePlayers(), SaveReplayList(), SaveSelections(), SaveTriggers(), SaveUnits(), SaveUpgrades(), SaveUserInterface(), StratagusMajorVersion, StratagusMinorVersion, StratagusPatchLevel, SyncHash, SyncRandSeed, and VERSION.
Referenced by tolua_stratagus_SaveGame00().
| void ShowLoadProgress | ( | const char * | fmt, | |
| ... | ||||
| ) |
Show load progress.
| fmt | printf format string. |
Definition at line 258 of file stratagus.cpp.
References _C_, ColorBlack, DebugPrint, CVideo::Depth, CVideo::FillRectangle(), GameFont, CVideo::Height, InvalidateArea(), CFont::IsLoaded(), RealizeVideoMemory(), Video, VideoDrawTextCentered(), and CVideo::Width.
Referenced by CEditor::Init(), LoadCcl(), LoadConstructions(), LoadCursors(), LoadDecorations(), LoadFonts(), LoadIcons(), and LoadUnitTypes().
| void UpdateDisplay | ( | void | ) |
Game display update.
Display update.
This functions updates everything on screen. The map, the gui, the cursors.
Definition at line 187 of file mainloop.cpp.
References BigMapMode, CUserInterface::ButtonPanel, CursorState, CursorStateRectangle, CStatusLine::Draw(), CButtonPanel::Draw(), CInfoPanel::Draw(), CMinimap::Draw(), DrawCosts(), CMinimap::DrawCursor(), DrawCursor(), DrawGuichanWidgets(), DrawMapArea(), DrawMenuButtonArea(), DrawMessages(), DrawPieMenu(), DrawResources(), DrawTimer(), Editor, EditorEditing, CUserInterface::Fillers, GameRunning, CUserInterface::InfoPanel, int(), Invalidate(), CViewport::MapX, CViewport::MapY, CUserInterface::Minimap, CEditor::Running, CUserInterface::SelectedViewport, CUserInterface::StatusLine, and UI.
Referenced by GameMainLoop(), and MenuScreen::run().
| std::string ClickMissile |
Missile to show when you click.
Definition at line 56 of file script_ui.cpp.
Referenced by CclSetClickMissile(), UIHandleButtonDown(), and UISelectStateButtonDown().
| std::string CompileOptions |
Compile options.
Definition at line 231 of file stratagus.cpp.
Referenced by CclGetCompileFeature(), main(), and PrintHeader().
| std::string DamageMissile |
Missile to show damage caused.
Definition at line 57 of file script_ui.cpp.
Referenced by CclSetDamageMissile(), and HitUnit().
| unsigned long FastForwardCycle |
Game Replay Fast Forward Counter.
Definition at line 247 of file stratagus.cpp.
Referenced by CreateGame(), GameMainLoop(), InitModules(), InputKey(), SetGameSpeed(), UiDecreaseGameSpeed(), and UiIncreaseGameSpeed().
| unsigned long GameCycle |
Game simulation cycle counter.
Definition at line 246 of file stratagus.cpp.
Referenced by ActionSetTimer(), AiCheckingWork(), AiCheckRepair(), AiEachSecond(), AiMoveUnitInTheWay(), AiResourceManager(), AiSendExplorers(), CUnitManager::AllocUnit(), Summon::Cast(), CclAiSleep(), CommandLog(), CreateGame(), DoNextReplay(), DoRightButton(), CUnit::Draw(), CViewport::Draw(), DrawInfoPanelNoneSelected(), DrawUnitOn(), GameMainLoop(), HandleActionTrain(), HandleBuffs(), HitUnit(), InitModules(), LoadGame(), NetworkCommands(), NetworkEvent(), NetworkExecCommands(), NetworkQuit(), NetworkRecover(), NetworkResendCommands(), NetworkSendCommand(), NetworkSendCommands(), NetworkSendExtendedCommand(), NetworkSyncCommands(), ParseNetworkCommand(), CUnitManager::ReleaseUnit(), ReplayEachCycle(), SaveGame(), SendCommand(), SetGameSpeed(), tolua_get_unsigned_GameCycle(), tolua_set_unsigned_GameCycle(), UiDecreaseGameSpeed(), UiIncreaseGameSpeed(), UnitActions(), and UpdateTimer().
| bool SaveGameLoading |
Save game is in progress of loading.
Definition at line 73 of file script.cpp.
Referenced by CUnit::AssignToPlayer(), CclReplayLog(), CreateGame(), GameMainLoop(), InitUnits(), LoadGame(), CUnit::Place(), CUnit::RefsDecrease(), CUnit::RefsIncrease(), StartSavedGame(), and UpdateUnitSightRange().
| int SpeedBuild |
Speed factor for building.
Definition at line 239 of file stratagus.cpp.
Referenced by CclGetSpeedBuild(), CclSetSpeedBuild(), CclSetSpeeds(), DoRepair(), HandleActionBuilt(), and SaveCcl().
| int SpeedTrain |
Speed factor for training.
Definition at line 240 of file stratagus.cpp.
Referenced by CclGetSpeedTrain(), CclSetSpeeds(), CclSetSpeedTrain(), HandleActionTrain(), and SaveCcl().
| std::string StratagusLibPath |
Location of stratagus data.
Definition at line 223 of file stratagus.cpp.
Referenced by CclFilteredListDirectory(), CclSavedGameInfo(), CclStratagusLibraryPath(), ClientParseConnected(), EditorSaveMap(), ExpandPath(), LibraryFileName(), LoadStratagusMap(), and main().
| std::string UserDirectory |
Directory containing user settings and data.
Definition at line 71 of file script.cpp.
Referenced by PatchSaveButtonListener::action(), CclFilteredListDirectory(), CommandLog(), CreateUserDirectories(), ExpandPath(), GetSaveDir(), LibraryFileName(), SavePreferences(), and SaveReplay().
1.5.6