diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-05-16 18:46:18 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-05-16 18:46:18 -0300 |
| commit | 717f5cd9dacf30fe6bf1561db9297e75fd27fdef (patch) | |
| tree | 4785a3bf770da880d514fc232a9972bd8473a72e /src/main.cc | |
| download | game-717f5cd9dacf30fe6bf1561db9297e75fd27fdef.tar.gz game-717f5cd9dacf30fe6bf1561db9297e75fd27fdef.zip | |
initial commit - getting at TSkill structs
Diffstat (limited to 'src/main.cc')
| -rw-r--r-- | src/main.cc | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main.cc b/src/main.cc new file mode 100644 index 0000000..e616ce3 --- /dev/null +++ b/src/main.cc @@ -0,0 +1,38 @@ +#include "main.hh" + +#if 0 +// TODO(fusion): All globals should probably be packed into a `GlobalState` +// structure to minimize collisions and bugs. +struct GlobalState{ + // world state + // creatures + // items + // etc... +}; + +GlobalState G = {}; +#endif + +// TODO(fusion): Probably current server time. Used for delays, timers, etc. +int ServerMilliseconds = 0; + +void (*ErrorFunction)(const char*) = NULL; + +void error(char *Text, ...){ + char s[1024]; + + va_list ap; + va_start(ap, Text); + vsnprintf(s, sizeof(s) - 1, Text, ap); + va_end(ap); + + if(ErrorFunction){ + ErrorFunction(s); + }else{ + printf("%s", s); + } +} + +int main(int argc, char **argv){ + return 0; +} |
