summaryrefslogtreecommitdiffhomepage
path: root/src/gameinfo.h
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2022-03-24 02:06:28 +0000
committerMichael Smith <mikesmiffy128@gmail.com>2022-03-24 04:38:25 +0000
commit00ad7cdd3d05d09a43bda972c823fdc440feabb9 (patch)
tree7f9725341e598f273fc1fb6ca0803c794bb67698 /src/gameinfo.h
parentb18326a75078530df7712667f41b4ea354e1da3e (diff)
Clean up gameinfo_init() and other random stuff
- Just ask the engine for the game directory instead of doing the stupid argv sniffing hacks from the early days of trying to get the damn thing working. - Also add some other path variables, functions and whatnot, and do some other minor tidying up. - Also also, another damn copyright year, somebody please help me. Unfortunate negative effect off this change: con_init() no longer reports the game name, because it has to happen before gameinfo_init(). I've decided I don't really care, though.
Diffstat (limited to 'src/gameinfo.h')
-rw-r--r--src/gameinfo.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gameinfo.h b/src/gameinfo.h
index d94b117..eac5009 100644
--- a/src/gameinfo.h
+++ b/src/gameinfo.h
@@ -1,5 +1,5 @@
/*
- * Copyright © 2021 Michael Smith <mikesmiffy128@gmail.com>
+ * Copyright © 2022 Michael Smith <mikesmiffy128@gmail.com>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -17,20 +17,24 @@
#ifndef INC_GAMEINFO_H
#define INC_GAMEINFO_H
+#include <stdio.h>
+
#include "intdefs.h"
#include "os.h"
/* These variables are only set after calling gameinfo_init(). */
-extern const char *gameinfo_title; /* Name of the game (window title) */
-extern const os_char *gameinfo_clientlib; /* Path to the client library */
-extern const os_char *gameinfo_serverlib; /* Path to the server library */
+extern const os_char *gameinfo_bindir; /* Absolute path to top-level bin/ */
+extern const os_char *gameinfo_gamedir; /* Absolute path to game directory */
+extern const char *gameinfo_title; /* Name of the game (window title) */
+extern const os_char *gameinfo_clientlib; /* Absolute path to the client lib */
+extern const os_char *gameinfo_serverlib; /* Absolute path to the server lib */
/*
* This function is called early in the plugin load and does a whole bunch of
* spaghetti magic to figure out which game/engine we're in and where its
* libraries (which we want to hook) are located.
*/
-bool gameinfo_init(void);
+bool gameinfo_init(void *(*ifacef)(const char *, int *));
#endif