2023-07-22 10:27:40 -04:00
|
|
|
|
|
|
|
#ifndef GLOBALS_H_
|
|
|
|
#define GLOBALS_H_
|
2023-07-19 19:37:28 -04:00
|
|
|
|
|
|
|
#include "sdk.h"
|
|
|
|
|
2023-07-28 09:43:35 -04:00
|
|
|
enum game_id {
|
|
|
|
HL = 0, /* Half-Life 1 */
|
|
|
|
CS = 1, /* Counter-Strike 1.6 */
|
|
|
|
TF = 2, /* Team Fortress Classic */
|
|
|
|
DOD = 3, /* Day of Defeat */
|
|
|
|
};
|
|
|
|
|
2023-07-19 19:37:28 -04:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*
|
2023-07-20 11:26:30 -04:00
|
|
|
* DECL_INTF: Macro for declaring interfaces and it's originals.
|
|
|
|
* DECL_INTF_EXTERN: Extern version for the header.
|
2023-07-20 10:38:02 -04:00
|
|
|
*
|
2023-07-19 19:37:28 -04:00
|
|
|
* prefix | meaning
|
2023-07-20 14:25:49 -04:00
|
|
|
* -------+-------------------------------
|
2023-07-27 09:42:14 -04:00
|
|
|
* h_* | handler ptr (global scope)
|
2023-07-20 14:25:49 -04:00
|
|
|
* i_* | interface ptr (global scope)
|
|
|
|
* o_* | original interface (not a ptr)
|
2023-07-19 19:37:28 -04:00
|
|
|
*/
|
2023-07-20 10:38:02 -04:00
|
|
|
#define DECL_INTF(type, name) \
|
2023-07-20 14:25:49 -04:00
|
|
|
type* i_##name = NULL; \
|
|
|
|
type o_##name;
|
2023-07-19 19:37:28 -04:00
|
|
|
|
2023-07-20 10:38:02 -04:00
|
|
|
#define DECL_INTF_EXTERN(type, name) \
|
2023-07-20 14:25:49 -04:00
|
|
|
extern type* i_##name; \
|
|
|
|
extern type o_##name;
|
2023-07-19 19:37:28 -04:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2023-07-28 09:43:35 -04:00
|
|
|
extern game_id this_game_id;
|
2023-07-30 14:05:12 -04:00
|
|
|
extern vec3_t g_punchAngles;
|
2023-07-28 09:43:35 -04:00
|
|
|
|
2023-07-19 19:37:28 -04:00
|
|
|
extern void* hw;
|
2023-07-24 09:57:48 -04:00
|
|
|
extern void** h_client; /* hClientDLL hander */
|
2023-07-20 10:38:02 -04:00
|
|
|
DECL_INTF_EXTERN(cl_enginefunc_t, engine);
|
|
|
|
DECL_INTF_EXTERN(cl_clientfunc_t, client);
|
2023-07-20 14:40:34 -04:00
|
|
|
DECL_INTF_EXTERN(playermove_t, pmove);
|
2023-07-24 10:29:19 -04:00
|
|
|
DECL_INTF_EXTERN(engine_studio_api_t, enginestudio);
|
2023-07-24 09:57:48 -04:00
|
|
|
DECL_INTF_EXTERN(StudioModelRenderer_t, studiomodelrenderer);
|
2023-07-19 19:37:28 -04:00
|
|
|
|
2023-07-27 08:18:47 -04:00
|
|
|
extern game_t* game_info;
|
2023-07-28 10:31:21 -04:00
|
|
|
extern void* player_extra_info;
|
2023-07-20 17:30:44 -04:00
|
|
|
extern cl_entity_t* localplayer;
|
|
|
|
|
2023-07-19 19:37:28 -04:00
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
bool globals_init(void);
|
2023-07-21 01:02:26 -04:00
|
|
|
void globals_store(void);
|
|
|
|
void globals_restore(void);
|
2023-07-19 19:37:28 -04:00
|
|
|
|
2023-07-22 10:27:40 -04:00
|
|
|
#endif /* GLOBALS_H_ */
|