Advanced Strategic Command
Classes | Macros | Enumerations | Functions
sg.cpp File Reference

THE main program: ASC. More...

#include "global.h"
#include <stdio.h>
#include <stdlib.h>
#include <new>
#include <cstdlib>
#include <ctype.h>
#include <algorithm>
#include <memory>
#include <fstream>
#include <boost/regex.hpp>
#include <boost/algorithm/string/split.hpp>
#include <boost/algorithm/string/classification.hpp>
#include "paradialog.h"
#include "vehicletype.h"
#include "buildingtype.h"
#include "ai/ai.h"
#include "misc.h"
#include "events.h"
#include "typen.h"
#include "spfst.h"
#include "loaders.h"
#include "dlg_box.h"
#include "controls.h"
#include "dialog.h"
#include "strtmesg.h"
#include "gamedlg.h"
#include "sg.h"
#include "gameoptions.h"
#include "loadimage.h"
#include "astar2.h"
#include "errors.h"
#include "dialogs/pwd_dlg.h"
#include "viewcalculation.h"
#include "replay.h"
#include "graphicset.h"
#include "loadbi3.h"
#include "itemrepository.h"
#include "music.h"
#include "messagedlg.h"
#include "statisticdialog.h"
#include "clipboard.h"
#include "guifunctions.h"
#include "iconrepository.h"
#include "dashboard.h"
#include "gamedialog.h"
#include "unitset.h"
#include "applicationstarter.h"
#include "replaymapdisplay.h"
#include "asc-mainscreen.h"
#include "dialogs/unitinfodialog.h"
#include "util/messaginghub.h"
#include "cannedmessages.h"
#include "memorycheck.cpp"
#include "networkinterface.h"
#include "resourcenet.h"
#include "mapimageexport.h"
#include "loadpcx.h"
#include "gameeventsystem.h"
#include "sdl/sound.h"
#include "soundList.h"
#include "turncontrol.h"
#include "networksupervisor.h"
#include "dialogs/newgame.h"
#include "dialogs/soundsettings.h"
#include "dialogs/alliancesetup.h"
#include "dialogs/unitcounting.h"
#include "dialogs/editgameoptions.h"
#include "dialogs/nextcampaignmap.h"
#include "dialogs/terraininfo.h"
#include "dialogs/editplayerdata.h"
#include "dialogs/locatefile.h"
#include "dialogs/infodialogs.h"
#include "stdio-errorhandler.h"
#include "widgets/textrenderer.h"
#include "dialogs/productionanalysis.h"
#include "dialogs/fileselector.h"
#include "containerbase-functions.h"
#include "memory-measurement.h"
#include "dialogs/mailoptionseditor.h"
#include "dialogs/unitguidedialog.h"
#include "actions/cancelresearchcommand.h"
#include "actions/diplomacycommand.h"
#include "gameevent_dialogs.h"
#include "actions/commandwriter.h"
#include "dialogs/actionmanager.h"
#include "dialogs/gotoposition.h"
#include "loggingoutput.h"
#include "contextutils.h"
#include "actions/taskinterface.h"
#include "tasks/taskcontainer.h"
#include "dialogs/taskmanager.h"
#include "autotraining.h"
#include "spfst-legacy.h"
#include "dialogs/eventinfo.h"
#include "lua/luarunner.h"
#include "lua/luastate.h"
#include "luacommandwriter.h"
#include "campaignactionrecorder.h"
#include "textfiletags.h"
#include "dataversioncheck.h"
#include "packagemanager.h"
#include "i18n.h"
#include "clparser/asc.cpp"

Go to the source code of this file.

Classes

class  CommandAllianceSetupStrategy
 
class  GameThreadParams
 
class  ResourceLogger
 
class  ScreenResolutionSetup
 

Macros

#define mmaintainence
 

Enumerations

enum  MapTypeLoaded { None, Map, Savegame, Mailfile }
 

Functions

MapFieldgetSelectedField (void)
 
bool maintainencecheck (void)
 
void positionCursor (Player &player)
 
void viewcomp (Player &player)
 
void runOpenTasks ()
 
void runPendingTasks (Player &player)
 
void hookGuiToMap (GameMap *map)
 
bool loadGameFromFile (const ASCString &filename)
 
bool loadGame (bool mostRecent)
 
void saveGame (bool as)
 
void loadmap (const ASCString &name, bool campaign)
 
MapTypeLoaded loadStartupMap (const char *gameToLoad=NULL)
 
void startnextcampaignmap (int id)
 
void benchgame (bool withViewCalc)
 
void changePassword (GameMap *gamemap)
 
void helpAbout ()
 
void undo ()
 
void redo ()
 
bool continueAndStartMultiplayerGame (bool mostRecent=false)
 
void writeLuaCommands ()
 
void selectAndRunLuaScript ()
 
void showUnitAiProperties ()
 
void showUsedPackages ()
 
void editAlliances ()
 
void chooseTechnologyIfAvail (Player &player)
 this performs some check if a technology may be choosen right now and than either calls chooseTechnology or displays some informational messages More...
 
void executeUserAction (tuseractions action)
 
bool mainloopidle (PG_MessageObject *msgObj)
 
void resetActions (GameMap &map)
 
void resetActmap (GameMap &map)
 
pfont load_font (const char *name)
 
void loadLegacyFonts ()
 
void checkGameEvents (GameMap *map, const Command &command)
 
int gamethread (void *data)
 
static void __runResearch (Player &player)
 
void deployMapPlayingHooks (GameMap *map)
 
int main (int argc, char *argv[])
 

Detailed Description

THE main program: ASC.

Definition in file sg.cpp.

Macro Definition Documentation

#define mmaintainence

Definition at line 205 of file sg.cpp.

Enumeration Type Documentation

Enumerator
None 
Map 
Savegame 
Mailfile 

Definition at line 412 of file sg.cpp.

Function Documentation

static void __runResearch ( Player player)
static

Definition at line 1526 of file sg.cpp.

References runResearch().

Referenced by deployMapPlayingHooks().

void benchgame ( bool  withViewCalc)

Definition at line 528 of file sg.cpp.

References actmap, computeview(), infoMessage(), repaintMap, and ticker.

Referenced by executeUserAction().

void changePassword ( GameMap gamemap)
void checkGameEvents ( GameMap map,
const Command command 
)

Definition at line 1367 of file sg.cpp.

References checkevents(), checktimedevents(), and getDefaultMapDisplay().

void chooseTechnologyIfAvail ( Player player)

this performs some check if a technology may be choosen right now and than either calls chooseTechnology or displays some informational messages

Definition at line 741 of file sg.cpp.

References Research::activetechnology, checkForNewResearch(), infoMessage(), Technology::name, Research::progress, and Player::research.

Referenced by executeUserAction().

bool continueAndStartMultiplayerGame ( bool  mostRecent = false)
void deployMapPlayingHooks ( GameMap map)
void editAlliances ( )
void executeUserAction ( tuseractions  action)
int gamethread ( void *  data)
MapField* getSelectedField ( void  )

Definition at line 199 of file sg.cpp.

References actmap, GameMap::getCursor(), and GameMap::getField().

Referenced by executeUserAction(), and showUnitAiProperties().

void helpAbout ( )

Definition at line 571 of file sg.cpp.

References getVersionAndCompilation(), readtextmessage(), and ASC_PG_Dialog::RunModal().

Referenced by executeUserAction().

void hookGuiToMap ( GameMap map)
pfont load_font ( const char *  name)

Definition at line 1325 of file sg.cpp.

References loadfont(), and tnstream::reading.

Referenced by loadLegacyFonts().

bool loadGame ( bool  mostRecent)
bool loadGameFromFile ( const ASCString filename)

Definition at line 309 of file sg.cpp.

Referenced by loadGame(), loadGameLua(), and loadStartupMap().

void loadLegacyFonts ( )
void loadmap ( const ASCString name,
bool  campaign 
)
MapTypeLoaded loadStartupMap ( const char *  gameToLoad = NULL)
int main ( int  argc,
char *  argv[] 
)
bool mainloopidle ( PG_MessageObject *  msgObj)
bool maintainencecheck ( void  )
void positionCursor ( Player player)
void redo ( )
void resetActions ( GameMap map)

Definition at line 1310 of file sg.cpp.

References NewGuiHost::pendingCommand.

Referenced by gamethread().

void resetActmap ( GameMap map)

Definition at line 1318 of file sg.cpp.

References actmap.

Referenced by gamethread().

void runOpenTasks ( )
void runPendingTasks ( Player player)
void saveGame ( bool  as)
void selectAndRunLuaScript ( )
void showUnitAiProperties ( )
void showUsedPackages ( )
void startnextcampaignmap ( int  id)
void undo ( )
void viewcomp ( Player player)

Definition at line 242 of file sg.cpp.

References computeview(), and Player::getParentMap().

Referenced by hookGuiToMap().

void writeLuaCommands ( )

Definition at line 627 of file sg.cpp.

References GameMap::actions, actmap, ActionContainer::getCommands(), and selectFile().

Referenced by executeUserAction().