diff options
Diffstat (limited to 'api.h')
-rw-r--r-- | api.h | 55 |
1 files changed, 55 insertions, 0 deletions
@@ -21,6 +21,7 @@ #define VENGINE_CLIENT_INTERFACE_VERSION "VEngineClient013" #define VENGINE_LAUNCHER_INTERFACE_VERSION "VENGINE_LAUNCHER_API_VERSION004" #define VENGINE_TOOL_INTERFACE_VERSION "VENGINETOOL003" +#define VENGINE_CVAR_INTERFACE_VERSION "VEngineCvar004" #include "intdef.h" #include "os.h" @@ -55,6 +56,34 @@ struct enginetools { } *vt; }; +struct cvar { + struct { + usize _pad[10]; + struct concommand * (*VIRTUAL find_command)(struct cvar *this, const char *name); + } *vt; +}; + +struct cmdbase { + void **vt; + struct cmdbase *next; + bool registered; + const char *name; + const char *helpstring; + int flags; +}; + +struct concommand { + struct cmdbase base; + void *callback; +}; + +struct audio_device { + struct { + usize _pad[22]; + void *transfer_samples; + } *vt; +}; + struct movieinfo { char name[256]; int curframe; @@ -132,6 +161,29 @@ struct demoplayer { } *vt; }; +/* EPIC HACK: + * Snd_WriteLinearBlastStereo16 is an inline asm function that starts with + * + * mov ebx,snd_p + * mov edi,snd_out + * mov ecx,snd_linear_count + * mov esi,snd_vol + * + * Luckily for us, these are all the things that we need!!!! + * So, we just use the instructions as a struct so we don't have to copy + * anything. It just works. + */ +struct soundstate { + u16 _mov_ebx; + int **snd_p; + u16 _mov_edi; + short **snd_out; + u16 _mov_ecx; + int *snd_linear_count; + u16 _mov_esi; + int *snd_vol; +} __attribute__((packed)); + #ifndef NO_EXTERNS extern struct engserver *engserver; extern struct engclient *engclient; @@ -141,10 +193,13 @@ extern struct demoplayer *demoplayer; extern struct videomode **videomode; extern struct movieinfo *movieinfo; extern void (*cbuf_addtext)(char *); +extern void (*snd_recordbuffer)(void); +extern struct soundstate *snd; #endif // initializes required engine apis. returns false on error. bool api_init(void); +bool api_find_snd_recordbuffer(void); #endif |