mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 03:24:56 +08:00
engine: rename vguiapi_t to legacy_vguiapi_t as new VGUI support API is now being developed
This commit is contained in:
@@ -35,7 +35,7 @@ static qboolean GAME_EXPORT VGUI_IsInGame( void );
|
|||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
qboolean initialized;
|
qboolean initialized;
|
||||||
vguiapi_t dllFuncs;
|
legacy_vguiapi_t dllFuncs;
|
||||||
VGUI_DefaultCursor cursor;
|
VGUI_DefaultCursor cursor;
|
||||||
|
|
||||||
HINSTANCE hInstance;
|
HINSTANCE hInstance;
|
||||||
@@ -117,7 +117,7 @@ qboolean VGui_IsActive( void )
|
|||||||
return vgui.initialized;
|
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->DrawInit = from->VGUI_DrawInit;
|
||||||
to->DrawShutdown = from->VGUI_DrawShutdown;
|
to->DrawShutdown = from->VGUI_DrawShutdown;
|
||||||
@@ -141,7 +141,7 @@ void VGui_RegisterCvars( void )
|
|||||||
|
|
||||||
qboolean VGui_LoadProgs( HINSTANCE hInstance )
|
qboolean VGui_LoadProgs( HINSTANCE hInstance )
|
||||||
{
|
{
|
||||||
void (*F)( vguiapi_t* );
|
LEGACY_VGUISUPPORTAPI F;
|
||||||
qboolean client = hInstance != NULL;
|
qboolean client = hInstance != NULL;
|
||||||
|
|
||||||
// not loading interface from client.dll, load vgui_support.dll instead
|
// not loading interface from client.dll, load vgui_support.dll instead
|
||||||
@@ -174,7 +174,7 @@ qboolean VGui_LoadProgs( HINSTANCE hInstance )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// try legacy API first
|
// 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 )
|
if( F )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ enum VGUI_KeyAction
|
|||||||
KA_PRESSED,
|
KA_PRESSED,
|
||||||
KA_RELEASED
|
KA_RELEASED
|
||||||
};
|
};
|
||||||
|
|
||||||
enum VGUI_MouseAction
|
enum VGUI_MouseAction
|
||||||
{
|
{
|
||||||
MA_PRESSED=0,
|
MA_PRESSED=0,
|
||||||
@@ -159,7 +160,7 @@ enum VGUI_MouseAction
|
|||||||
MA_WHEEL
|
MA_WHEEL
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct vguiapi_s
|
typedef struct legacy_vguiapi_s
|
||||||
{
|
{
|
||||||
qboolean initialized;
|
qboolean initialized;
|
||||||
// called from vgui_support
|
// called from vgui_support
|
||||||
@@ -195,5 +196,10 @@ typedef struct vguiapi_s
|
|||||||
void (*Key)( enum VGUI_KeyAction action, enum VGUI_KeyCode code );
|
void (*Key)( enum VGUI_KeyAction action, enum VGUI_KeyCode code );
|
||||||
void (*MouseMove)( int x, int y );
|
void (*MouseMove)( int x, int y );
|
||||||
void (*TextInput)( const char *text );
|
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
|
#endif // VGUI_API_H
|
||||||
|
|||||||
Reference in New Issue
Block a user