From 717f5cd9dacf30fe6bf1561db9297e75fd27fdef Mon Sep 17 00:00:00 2001 From: fusion32 Date: Fri, 16 May 2025 18:46:18 -0300 Subject: initial commit - getting at TSkill structs --- src/main.cc | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/main.cc (limited to 'src/main.cc') 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; +} -- cgit v1.2.3