engine: rename vguiapi_t to legacy_vguiapi_t as new VGUI support API is now being developed

This commit is contained in:
Alibek Omarov
2023-05-02 01:15:09 +03:00
parent 78e239d883
commit 3629448f0c
2 changed files with 12 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ static qboolean GAME_EXPORT VGUI_IsInGame( void );
static struct
{
qboolean initialized;
vguiapi_t dllFuncs;
legacy_vguiapi_t dllFuncs;
VGUI_DefaultCursor cursor;
HINSTANCE hInstance;
@@ -117,7 +117,7 @@ qboolean VGui_IsActive( void )
return vgui.initialized;
}
static void VGui_FillAPIFromRef( vguiapi_t *to, const ref_interface_t *from )
static void VGui_FillAPIFromRef( legacy_vguiapi_t *to, const ref_interface_t *from )
{
to->DrawInit = from->VGUI_DrawInit;
to->DrawShutdown = from->VGUI_DrawShutdown;
@@ -141,7 +141,7 @@ void VGui_RegisterCvars( void )
qboolean VGui_LoadProgs( HINSTANCE hInstance )
{
void (*F)( vguiapi_t* );
LEGACY_VGUISUPPORTAPI F;
qboolean client = hInstance != NULL;
// not loading interface from client.dll, load vgui_support.dll instead
@@ -174,7 +174,7 @@ qboolean VGui_LoadProgs( HINSTANCE hInstance )
}
// try legacy API first
F = COM_GetProcAddress( hInstance, client ? "InitVGUISupportAPI" : "InitAPI" );
F = COM_GetProcAddress( hInstance, client ? LEGACY_CLIENT_GET_VGUI_SUPPORT_API : LEGACY_GET_VGUI_SUPPORT_API );
if( F )
{

View File

@@ -151,6 +151,7 @@ enum VGUI_KeyAction
KA_PRESSED,
KA_RELEASED
};
enum VGUI_MouseAction
{
MA_PRESSED=0,
@@ -159,7 +160,7 @@ enum VGUI_MouseAction
MA_WHEEL
};
typedef struct vguiapi_s
typedef struct legacy_vguiapi_s
{
qboolean initialized;
// called from vgui_support
@@ -195,5 +196,10 @@ typedef struct vguiapi_s
void (*Key)( enum VGUI_KeyAction action, enum VGUI_KeyCode code );
void (*MouseMove)( int x, int y );
void (*TextInput)( const char *text );
} vguiapi_t;
} legacy_vguiapi_t;
typedef void (*LEGACY_VGUISUPPORTAPI)( legacy_vguiapi_t * );
#define LEGACY_GET_VGUI_SUPPORT_API "InitAPI"
#define LEGACY_CLIENT_GET_VGUI_SUPPORT_API "InitVGUISupportAPI"
#endif // VGUI_API_H