]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
host: Introduce host.h and use it, instead of quakedef.h
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 29 Sep 2020 00:33:14 +0000 (00:33 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 29 Sep 2020 00:33:14 +0000 (00:33 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12958 d7cf8633-e32d-0410-b094-e92efae38249

darkplaces-sdl2-vs2017.vcxproj
darkplaces-sdl2-vs2019.vcxproj
host.h [new file with mode: 0644]
quakedef.h

index 2b23d8e8b7786a31b18a44ab947617d6334460eb..1c3cc255ad1ae228673ef1e170fac49ea865d9ed 100644 (file)
     <ClInclude Include="gl_backend.h" />\r
     <ClInclude Include="glquake.h" />\r
     <ClInclude Include="hmac.h" />\r
+    <ClInclude Include="host.h" />\r
     <ClInclude Include="image.h" />\r
     <ClInclude Include="image_png.h" />\r
     <ClInclude Include="input.h" />\r
index 0eea6d48e85a127fecc1183d3f11f63a50dffd6f..2d5ff7a0eae408dc2abfe3c0af3188e5d5424319 100644 (file)
     <ClInclude Include="gl_backend.h" />\r
     <ClInclude Include="glquake.h" />\r
     <ClInclude Include="hmac.h" />\r
+    <ClInclude Include="host.h" />\r
     <ClInclude Include="image.h" />\r
     <ClInclude Include="image_png.h" />\r
     <ClInclude Include="input.h" />\r
diff --git a/host.h b/host.h
new file mode 100644 (file)
index 0000000..15b7ab9
--- /dev/null
+++ b/host.h
@@ -0,0 +1,38 @@
+typedef enum host_state_e
+{
+       host_shutdown,
+       host_init,
+       host_loading,
+       host_active
+} host_state_t;
+
+typedef struct host_s
+{
+       jmp_buf abortframe;
+       int state;
+       int framecount; // incremented every frame, never reset (checked by Host_Error and Host_SaveConfig_f)
+       double realtime; // the accumulated mainloop time since application started (with filtering), without any slowmo or clamping
+       double dirtytime; // the main loop wall time for this frame, equal to Sys_DirtyTime() at the start of this host frame
+       double sleeptime; // time spent sleeping overall
+       qbool restless; // don't sleep
+       qbool paused; // global paused state, pauses both client and server
+       cmd_buf_t *cbuf;
+
+       struct
+       {
+               void (*ConnectLocal)(void);
+       } hook;
+} host_t;
+
+extern host_t host;
+
+void Host_InitCommands(void);
+void Host_Main(void);
+double Host_Frame(double time);
+void Host_Shutdown(void);
+void Host_StartVideo(void);
+void Host_Error(const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN;
+void Host_NoOperation_f(cmd_state_t *cmd);
+void Host_LockSession(void);
+void Host_UnlockSession(void);
+void Host_AbortCurrentFrame(void);
index dfe40570aa736fe3c8c72ce5f11f56892b634ddd..be607c0d044ff4dfedef62090ccd59529e4314e7 100644 (file)
@@ -387,6 +387,7 @@ extern char engineversion[128];
 #include "netconn.h"
 #include "protocol.h"
 #include "cmd.h"
+#include "host.h"
 #include "sbar.h"
 #include "sound.h"
 #include "model_shared.h"
@@ -532,47 +533,8 @@ qbool Sys_HaveSSE2(void);
 #include "glquake.h"
 
 #include "palette.h"
-typedef enum host_state_e
-{
-       host_shutdown,
-       host_init,
-       host_loading,
-       host_active
-} host_state_t;
-
-typedef struct host_s
-{
-       jmp_buf abortframe;
-       int state;
-       int framecount; // incremented every frame, never reset (checked by Host_Error and Host_SaveConfig_f)
-       double realtime; // the accumulated mainloop time since application started (with filtering), without any slowmo or clamping
-       double dirtytime; // the main loop wall time for this frame, equal to Sys_DirtyTime() at the start of this host frame
-       double sleeptime; // time spent sleeping overall
-       qbool restless; // don't sleep
-       qbool paused; // global paused state, pauses both client and server
-       cmd_buf_t *cbuf;
-
-       struct
-       {
-               void (*ConnectLocal)(void);
-       } hook;
-} host_t;
-
-extern host_t host;
 extern cvar_t host_isclient;
 
-void Host_InitCommands(void);
-void Host_Main(void);
-double Host_Frame(double time);
-void Host_Shutdown(void);
-void Host_StartVideo(void);
-void Host_Error(const char *error, ...) DP_FUNC_PRINTF(1) DP_FUNC_NORETURN;
-void Host_NoOperation_f(cmd_state_t *cmd);
-void Host_LockSession(void);
-void Host_UnlockSession(void);
-
-void Host_AbortCurrentFrame(void);
-
 /// skill level for currently loaded level (in case the user changes the cvar while the level is running, this reflects the level actually in use)
 extern int current_skill;