30 #ifndef __STRATAGUS_H__
31 #define __STRATAGUS_H__
48 #define WIN32_LEAN_AND_MEAN
56 #pragma warning(disable:4244)
57 #pragma warning(disable:4761)
58 #pragma warning(disable:4786)
61 #define __func__ __FUNCTION__
64 #define snprintf _snprintf
65 #if !(_MSC_VER >= 1500 && _MSC_VER < 1600)
66 #define vsnprintf _vsnprintf
68 #define unlink _unlink
69 #define strdup _strdup
70 #define strcasecmp _stricmp
71 #define strncasecmp _strnicmp
82 #define UNUSED(var) do {__typeof__ (&var) __attribute__ ((unused)) __tmp = &var; } while(0)
84 #define UNUSED(var) (var)
88 #define PRINTF_VAARG_ATTRIBUTE(a, b) __attribute__((format (printf, a, b)))
90 #define PRINTF_VAARG_ATTRIBUTE(a, b)
104 extern void PrintLocation(
const char *file,
int line,
const char *funcName);
107 #define PrintFunction() PrintLocation(__FILE__, __LINE__, __func__);
113 extern void AbortAt(
const char *file,
int line,
const char *funcName,
const char *conditionStr);
119 #define Assert(cond) \
120 do { if (EnableAssert && !(cond)) { AbortAt(__FILE__, __LINE__, __func__, #cond); }} while (0)
125 #define DebugPrint(args) \
126 do { if (EnableDebugPrint) { PrintFunction(); PrintOnStdOut(args); } } while (0)
140 int len = strlen(str) + 1;
141 char *newstr =
new char[len];
158 #define UnitTypeMax 2048
159 #define UpgradeMax 2048
163 #define FRAMES_PER_SECOND 30 // 1/30s
164 #define CYCLES_PER_SECOND 30 // 1/30s 0.33ms
177 extern void Exit(
int err);
187 #endif // !__STRATAGUS_H__
void Exit(int err)
Game Replay Fast Forward Counter.
Definition: stratagus.cpp:396
void PrintLocation(const char *file, int line, const char *funcName)
if enabled, a unit info dump will be created
Definition: util.cpp:520
std::string StratagusLibPath
Definition: stratagus.cpp:236
errno_t strcpy_s(char *dst, size_t dstsize, const char *src)
Definition: util.cpp:185
void PrintOnStdOut(const char *format,...)
Definition: util.cpp:539
const char NameLine[]
Text string: Name, Version, Copyright.
Definition: stratagus.cpp:239
std::string MenuRace
Location of stratagus data.
Definition: stratagus.cpp:242
unsigned long FastForwardCycle
Game simulation cycle counter.
Definition: game.cpp:94
int stratagusMain(int argc, char **argv)
Game main loop.
Definition: stratagus.cpp:698
bool EnableAssert
if enabled, print the debug messages
Definition: stratagus.cpp:245
void GameMainLoop()
Draw the map area.
Definition: mainloop.cpp:400
void DrawMapArea()
Game display update.
Definition: mainloop.cpp:147
bool EnableDebugPrint
Definition: stratagus.cpp:244
bool EnableUnitDebug
if enabled, halt on assertion failures
Definition: stratagus.cpp:246
char * new_strdup(const char *str)
Definition: stratagus.h:138
void AbortAt(const char *file, int line, const char *funcName, const char *conditionStr)
Definition: util.cpp:525
void UpdateDisplay()
Exit with fatal error.
Definition: mainloop.cpp:169
unsigned long GameCycle
Definition: game.cpp:93
void ExitFatal(int err)
Exit.
Definition: stratagus.cpp:433