engine: reject mbf21 and shit24 wads. there is no way to know if it is safe to ignore...
[k8vavoom.git] / source / host.h
blobc0ec9c270a5ef8a33607dcb47da69b8eb990d025
1 //**************************************************************************
2 //**
3 //** ## ## ## ## ## #### #### ### ###
4 //** ## ## ## ## ## ## ## ## ## ## #### ####
5 //** ## ## ## ## ## ## ## ## ## ## ## ## ## ##
6 //** ## ## ######## ## ## ## ## ## ## ## ### ##
7 //** ### ## ## ### ## ## ## ## ## ##
8 //** # ## ## # #### #### ## ##
9 //**
10 //** Copyright (C) 1999-2006 Jānis Legzdiņš
11 //** Copyright (C) 2018-2023 Ketmar Dark
12 //**
13 //** This program is free software: you can redistribute it and/or modify
14 //** it under the terms of the GNU General Public License as published by
15 //** the Free Software Foundation, version 3 of the License ONLY.
16 //**
17 //** This program is distributed in the hope that it will be useful,
18 //** but WITHOUT ANY WARRANTY; without even the implied warranty of
19 //** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 //** GNU General Public License for more details.
21 //**
22 //** You should have received a copy of the GNU General Public License
23 //** along with this program. If not, see <http://www.gnu.org/licenses/>.
24 //**
25 //**************************************************************************
26 #ifndef VAVOOM_HOST_HEADER
27 #define VAVOOM_HOST_HEADER
30 void Host_Init ();
31 void Host_Shutdown ();
32 void Host_Frame ();
33 const char *Host_GetCoreDump ();
34 bool Host_StartTitleMap ();
35 VStr Host_GetConfigDir ();
37 // called if CLI arguments contains some map selections command
38 void Host_CLIMapStartFound ();
39 bool Host_IsCLIMapStartFound ();
41 bool Host_IsDangerousTimeout ();
43 // call this after saving/loading/map loading, so we won't unnecessarily skip frames
44 void Host_ResetSkipFrames ();
46 // this does GC rougly twice per second (unless forced)
47 void Host_CollectGarbage (bool forced=false, bool resetUniqueId=false);
49 void Host_InitStreamCallbacks ();
51 extern bool host_initialised;
52 extern bool host_request_exit;
53 extern bool host_gdb_mode;
56 // no more than 250 FPS
57 /*#define max_fps_cap_double (1.0/250.0)*/
58 #define max_fps_cap_float ((float)(1.0f/250.0f))
60 extern float host_frametime; // time delta for the current frame
61 extern double host_systime; // current `Sys_Time()`; used for consistency, updated in `FilterTime()`
62 extern uint64_t host_systime64_usec; // monotonic time, in microseconds
63 extern int host_framecount; // used in demo playback
65 extern int cli_ShowEndText;
68 #if defined(__i386__) || defined(__x86_64__)
69 __inline__ __attribute__((unused,gnu_inline,always_inline)) static void host_debug_break_internal (void) {
70 __asm__ volatile("int $0x03");
72 __inline__ __attribute__((unused,gnu_inline,always_inline)) static void host_debug_break (void) { if (host_gdb_mode) host_debug_break_internal(); }
73 #else
74 __inline__ __attribute__((unused,gnu_inline,always_inline)) static void host_debug_break (void) {}
75 #endif
78 #endif