#include <string.h>
#include "util.h"
Go to the source code of this file.
|
| #define | UNUSED(var) (var) |
| |
| #define | PRINTF_VAARG_ATTRIBUTE(a, b) |
| |
| #define | _C_ , |
| |
| #define | PrintFunction() PrintLocation(__FILE__, __LINE__, __func__); |
| | Print function in debug macros. More...
|
| |
| #define | Assert(cond) do { if (EnableAssert && !(cond)) { AbortAt(__FILE__, __LINE__, __func__, #cond); }} while (0) |
| |
| #define | DebugPrint(args) do { if (EnableDebugPrint) { PrintFunction(); PrintOnStdOut(args); } } while (0) |
| |
| #define | PlayerMax 16 |
| |
| #define | UnitTypeMax 2048 |
| |
| #define | UpgradeMax 2048 |
| |
| #define | MAX_RACES 8 |
| |
| #define | FRAMES_PER_SECOND 30 |
| | Frames per second to display (original 30-40) More...
|
| |
| #define | CYCLES_PER_SECOND 30 |
| | Game cycles per second to simulate (original 30-40) More...
|
| |
| bool | EnableDebugPrint |
| |
| bool | EnableAssert |
| | if enabled, print the debug messages More...
|
| |
| bool | EnableUnitDebug |
| | if enabled, halt on assertion failures More...
|
| |
| const char | NameLine [] |
| | Text string: Name, Version, Copyright. More...
|
| |
| std::string | StratagusLibPath |
| |
| std::string | MenuRace |
| | Location of stratagus data. More...
|
| |
| unsigned long | GameCycle |
| |
| unsigned long | FastForwardCycle |
| | Game simulation cycle counter. More...
|
| |
| void | PrintLocation (const char *file, int line, const char *funcName) |
| | if enabled, a unit info dump will be created More...
|
| |
| void | AbortAt (const char *file, int line, const char *funcName, const char *conditionStr) |
| |
| void | PrintOnStdOut (const char *format,...) |
| |
| char * | new_strdup (const char *str) |
| |
| void | Exit (int err) |
| | Game Replay Fast Forward Counter. More...
|
| |
| void | ExitFatal (int err) |
| | Exit. More...
|
| |
| void | UpdateDisplay () |
| | Exit with fatal error. More...
|
| |
| void | DrawMapArea () |
| | Game display update. More...
|
| |
| void | GameMainLoop () |
| | Draw the map area. More...
|
| |
| int | stratagusMain (int argc, char **argv) |
| | Game main loop. More...
|
| |
This simulates vararg macros. Example: DebugPrint("Test %d %d\n" C 1 C 2);
| #define Assert |
( |
|
cond | ) |
do { if (EnableAssert && !(cond)) { AbortAt(__FILE__, __LINE__, __func__, #cond); }} while (0) |
Assert a condition. If cond is not true abort with file,line.
| #define CYCLES_PER_SECOND 30 |
Game cycles per second to simulate (original 30-40)
Print debug information with function name.
| #define FRAMES_PER_SECOND 30 |
Frames per second to display (original 30-40)
| #define PRINTF_VAARG_ATTRIBUTE |
( |
|
a, |
|
|
|
b |
|
) |
| |
| #define PrintFunction |
( |
| ) |
PrintLocation(__FILE__, __LINE__, __func__); |
Print function in debug macros.
| #define UNUSED |
( |
|
var | ) |
(var) |
| void AbortAt |
( |
const char * |
file, |
|
|
int |
line, |
|
|
const char * |
funcName, |
|
|
const char * |
conditionStr |
|
) |
| |
Game display update.
Draw map area
Game Replay Fast Forward Counter.
Exit the game.
- Parameters
-
| err | Error code to pass to shell. |
| void ExitFatal |
( |
int |
err | ) |
|
Exit.
Do a fatal exit. Called on out of memory or crash.
- Parameters
-
| err | Error code to pass to shell. |
Draw the map area.
Game main loop.
Unit actions. Missile actions. Players (AI). Cyclic events (color cycle,...) Display update. Input/Network/Sound.
| char* new_strdup |
( |
const char * |
str | ) |
|
|
inline |
| void PrintLocation |
( |
const char * |
file, |
|
|
int |
line, |
|
|
const char * |
funcName |
|
) |
| |
if enabled, a unit info dump will be created
| void PrintOnStdOut |
( |
const char * |
format, |
|
|
|
... |
|
) |
| |
| int stratagusMain |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Game main loop.
The main program: initialise, parse options and arguments.
- Parameters
-
| argc | Number of arguments. |
| argv | Vector of arguments. |
Exit with fatal error.
Display update.
This functions updates everything on screen. The map, the gui, the cursors.
if enabled, print the debug messages
- Todo:
Needs code cleanup.
Needs compatibility checks.
Needs error message unification.
if enabled, halt on assertion failures
| unsigned long FastForwardCycle |
Game simulation cycle counter.
Location of stratagus data.
Location of stratagus data.
Text string: Name, Version, Copyright.
Text string: Name, Version, Copyright.
Name, Version, Copyright
| std::string StratagusLibPath |
(C) Copyright 1998-2012 by The