$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/game/game.cpp File Reference

#include "stratagus.h"
#include "map.h"
#include "tileset.h"
#include "minimap.h"
#include "player.h"
#include "unit.h"
#include "unittype.h"
#include "upgrade.h"
#include "pathfinder.h"
#include "ui.h"
#include "font.h"
#include "sound.h"
#include "sound_server.h"
#include "depend.h"
#include "interface.h"
#include "cursor.h"
#include "spells.h"
#include "construct.h"
#include "actions.h"
#include "network.h"
#include "netconnect.h"
#include "missile.h"
#include "settings.h"
#include "results.h"
#include "trigger.h"
#include "commands.h"
#include "iolib.h"
#include "iocompat.h"
#include "replay.h"
#include "script.h"

game.cpp - The game set-up and creation.

Settings GameSettings
static int LcmPreventRecurse
 Game Settings.
GameResults GameResult
 prevent recursion through LoadGameMap
static void LoadStratagusMap (const std::string &smpname, const std::string &mapname)
 Outcome of the game.
static int WriteMapPresentation (const std::string &mapname, CMap &map, char *)
int WriteMapSetup (const char *mapSetup, CMap &map, int writeTerrain)
int SaveStratagusMap (const std::string &mapName, CMap &map, int writeTerrain)
 Save a stratagus map (smp format).
static void LoadMap (const std::string &filename, CMap &map)
void SetGamePaused (bool paused)
 Set the game paused or unpaused.
bool GetGamePaused ()
 Get the game paused or unpaused.
void SetGameSpeed (int speed)
 Set the game speed.
int GetGameSpeed ()
 Get the game speed.
static void GameTypeFreeForAll ()
static void GameTypeTopVsBottom ()
static void GameTypeLeftVsRight ()
static void GameTypeManVsMachine ()
static void GameTypeManTeamVsMachine ()
void CreateGame (const std::string &filename, CMap *map)
 Create a game.
void InitSettings ()
 Init Setting to default values.

Function Documentation

void CreateGame ( const std::string &  filename,
CMap map 
)

Create a game.

CreateGame.

Load map, graphics, sounds, etc

Parameters:
filename map filename
map map loaded
Todo:
FIXME: use in this function InitModules / LoadModules!!!

static void GameTypeFreeForAll (  )  [static]

Free for all

static void GameTypeLeftVsRight (  )  [static]

Left vs Right

static void GameTypeManTeamVsMachine (  )  [static]

Man vs Machine whith Humans on a Team

static void GameTypeManVsMachine (  )  [static]

Man vs Machine

static void GameTypeTopVsBottom (  )  [static]

Top vs Bottom

bool GetGamePaused (  ) 

Get the game paused or unpaused.

Get the game paused or unpaused

Returns:
True if the game is paused, false otherwise

int GetGameSpeed (  ) 

Get the game speed.

Get the game speed

Returns:
Game speed

void InitSettings (  ) 

Init Setting to default values.

Init Game Setting to default values

Todo:
FIXME: this should not be executed for restart levels!

static void LoadMap ( const std::string &  filename,
CMap map 
) [static]

Load any map.

Parameters:
filename map filename
map map loaded

static void LoadStratagusMap ( const std::string &  smpname,
const std::string &  mapname 
) [static]

Outcome of the game.

Load a Stratagus map.

Parameters:
smpname smp filename
mapname map filename
map map loaded

int SaveStratagusMap ( const std::string &  mapName,
CMap map,
int  writeTerrain 
)

Save a stratagus map (smp format).

Save a Stratagus map.

Parameters:
mapName map filename
map map to save
writeTerrain write the tiles map in the .sms

void SetGamePaused ( bool  paused  ) 

Set the game paused or unpaused.

Set the game paused or unpaused

Parameters:
paused True to pause game, false to unpause.

void SetGameSpeed ( int  speed  ) 

Set the game speed.

Set the game speed

Parameters:
speed New game speed.

static int WriteMapPresentation ( const std::string &  mapname,
CMap map,
char *   
) [static]

int WriteMapSetup ( const char *  mapSetup,
CMap map,
int  writeTerrain 
)

Write the map setup file.

Parameters:
mapsetup map filename
map map to save
writeTerrain write the tiles map in the .sms


Variable Documentation

prevent recursion through LoadGameMap

Game results.

int LcmPreventRecurse [static]

Game Settings.

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.