aboutsummaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc38
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;
+}