This repository has been archived on 2022-06-27. You can view files and clone it, but cannot push or open issues or pull requests.
Xash3DArchive/mainui/enginecallback.h

154 lines
5.6 KiB
C
Raw Normal View History

2010-07-17 22:00:00 +02:00
//=======================================================================
// Copyright XashXT Group 2010 <20>
// enginecallback.h - actual engine callbacks
//=======================================================================
#ifndef ENGINECALLBACKS_H
#define ENGINECALLBACKS_H
// built-in memory manager
#define MALLOC( x ) (*g_engfuncs.pfnMemAlloc)( x, __FILE__, __LINE__ )
#define CALLOC( x, y ) (*g_engfuncs.pfnMemAlloc)((x) * (y), __FILE__, __LINE__ )
#define FREE( x ) (*g_engfuncs.pfnMemFree)( x, __FILE__, __LINE__ )
// screen handlers
#define PIC_Width (*g_engfuncs.pfnPIC_Width)
#define PIC_Height (*g_engfuncs.pfnPIC_Height)
#define PIC_EnableScissor (*g_engfuncs.pfnPIC_EnableScissor)
#define PIC_DisableScissor (*g_engfuncs.pfnPIC_DisableScissor)
#define FillRGBA (*g_engfuncs.pfnFillRGBA)
#define GetScreenInfo (*g_engfuncs.pfnGetScreenInfo)
2010-07-18 22:00:00 +02:00
#define GetGameInfo (*g_engfuncs.pfnGetGameInfo)
2010-10-22 22:00:00 +02:00
#define CheckGameDll (*g_engfuncs.pfnCheckGameDll)
2010-07-17 22:00:00 +02:00
2010-09-30 22:00:00 +02:00
#define DRAW_LOGO (*g_engfuncs.pfnDrawLogo)
2010-10-01 22:00:00 +02:00
#define PRECACHE_LOGO( x ) (*g_engfuncs.pfnDrawLogo)( x, 0, 0, 0, 0 )
2010-09-30 22:00:00 +02:00
#define GetLogoWidth (*g_engfuncs.pfnGetLogoWidth)
#define GetLogoHeight (*g_engfuncs.pfnGetLogoHeight)
2010-10-06 22:00:00 +02:00
inline HIMAGE PIC_Load( const char *szPicName )
{
return g_engfuncs.pfnPIC_Load( szPicName, NULL, 0 );
}
inline HIMAGE PIC_Load( const char *szPicName, const byte *ucRawImage, long ulRawImageSize )
{
return g_engfuncs.pfnPIC_Load( szPicName, ucRawImage, ulRawImageSize );
}
2010-07-17 22:00:00 +02:00
#define PIC_Free (*g_engfuncs.pfnPIC_Free)
#define PLAY_SOUND (*g_engfuncs.pfnPlayLocalSound)
#define CVAR_REGISTER (*g_engfuncs.pfnRegisterVariable)
#define CVAR_SET_FLOAT (*g_engfuncs.pfnCvarSetValue)
#define CVAR_GET_FLOAT (*g_engfuncs.pfnGetCvarFloat)
#define CVAR_GET_STRING (*g_engfuncs.pfnGetCvarString)
#define CVAR_SET_STRING (*g_engfuncs.pfnCvarSetString)
#define CLIENT_COMMAND (*g_engfuncs.pfnClientCmd)
#define CLIENT_JOIN (*g_engfuncs.pfnClientJoin)
#define GET_MENU_EDICT (*g_engfuncs.pfnGetPlayerModel)
#define ENGINE_SET_MODEL (*g_engfuncs.pfnSetModel)
#define R_ClearScene (*g_engfuncs.pfnClearScene)
2010-08-20 22:00:00 +02:00
#define R_AddEntity (*g_engfuncs.CL_CreateVisibleEntity)
2010-07-17 22:00:00 +02:00
#define R_RenderFrame (*g_engfuncs.pfnRenderScene)
2010-08-20 22:00:00 +02:00
#define LOAD_FILE (*g_engfuncs.COM_LoadFile)
2010-07-17 22:00:00 +02:00
#define FILE_EXISTS (*g_engfuncs.pfnFileExists)
2010-08-20 22:00:00 +02:00
#define FREE_FILE (*g_engfuncs.COM_FreeFile)
2010-07-17 22:00:00 +02:00
#define GET_GAME_DIR (*g_engfuncs.pfnGetGameDir)
#define LOAD_LIBRARY (*g_engfuncs.pfnLoadLibrary)
#define GET_PROC_ADDRESS (*g_engfuncs.pfnGetProcAddress)
#define FREE_LIBRARY (*g_engfuncs.pfnFreeLibrary)
#define HOST_ERROR (*g_engfuncs.pfnHostError)
2010-08-20 22:00:00 +02:00
#define COM_ParseFile (*g_engfuncs.COM_ParseFile)
2010-07-17 22:00:00 +02:00
#define KEY_SetDest (*g_engfuncs.pfnSetKeyDest)
#define KEY_ClearStates (*g_engfuncs.pfnKeyClearStates)
#define KEY_KeynumToString (*g_engfuncs.pfnKeynumToString)
#define KEY_GetBinding (*g_engfuncs.pfnKeyGetBinding)
#define KEY_SetBinding (*g_engfuncs.pfnKeySetBinding)
#define KEY_IsDown (*g_engfuncs.pfnKeyIsDown)
#define KEY_GetOverstrike (*g_engfuncs.pfnKeyGetOverstrikeMode)
#define KEY_SetOverstrike (*g_engfuncs.pfnKeySetOverstrikeMode)
#define Cmd_AddCommand (*g_engfuncs.pfnAddCommand)
#define Cmd_RemoveCommand (*g_engfuncs.pfnDelCommand)
#define CMD_ARGC (*g_engfuncs.pfnCmdArgc)
#define CMD_ARGV (*g_engfuncs.pfnCmdArgv)
2010-08-15 22:00:00 +02:00
#define Con_Printf (*g_engfuncs.Con_Printf)
2010-07-17 22:00:00 +02:00
#define GET_GAMES_LIST (*g_engfuncs.pfnGetGamesList)
2010-11-22 22:00:00 +01:00
#define BACKGROUND_TRACK (*g_engfuncs.pfnPlayBackgroundTrack)
2010-07-17 22:00:00 +02:00
#define SHELL_EXECUTE (*g_engfuncs.pfnShellExecute)
#define HOST_WRITECONFIG (*g_engfuncs.pfnWriteServerConfig)
#define HOST_CHANGEGAME (*g_engfuncs.pfnChangeInstance)
#define CHECK_MAP_LIST (*g_engfuncs.pfnCreateMapsList)
#define HOST_ENDGAME (*g_engfuncs.pfnHostEndGame)
#define GET_CLIPBOARD (*g_engfuncs.pfnGetClipboardData)
#define FS_SEARCH (*g_engfuncs.pfnGetFilesList)
#define GET_SAVE_COMMENT (*g_engfuncs.pfnGetSaveComment)
#define GET_DEMO_COMMENT (*g_engfuncs.pfnGetDemoComment)
#define CL_IsActive (*g_engfuncs.pfnClientInGame)
inline void PIC_Set( HIMAGE hPic, int r, int g, int b )
{
g_engfuncs.pfnPIC_Set( hPic, r, g, b, 255 );
}
inline void PIC_Set( HIMAGE hPic, int r, int g, int b, int a )
{
g_engfuncs.pfnPIC_Set( hPic, r, g, b, a );
}
2010-12-02 22:00:00 +01:00
inline void PIC_Draw( int x, int y, const wrect_t *prc )
2010-07-17 22:00:00 +02:00
{
2010-12-02 22:00:00 +01:00
g_engfuncs.pfnPIC_Draw( x, y, -1, -1, prc );
2010-07-17 22:00:00 +02:00
}
2010-12-02 22:00:00 +01:00
inline void PIC_Draw( int x, int y, int width, int height )
2010-07-17 22:00:00 +02:00
{
2010-12-02 22:00:00 +01:00
g_engfuncs.pfnPIC_Draw( x, y, width, height, NULL );
2010-07-17 22:00:00 +02:00
}
2010-12-02 22:00:00 +01:00
inline void PIC_DrawTrans( int x, int y, const wrect_t *prc )
2010-07-17 22:00:00 +02:00
{
2010-12-02 22:00:00 +01:00
g_engfuncs.pfnPIC_DrawTrans( x, y, -1, -1, prc );
2010-07-17 22:00:00 +02:00
}
2010-12-02 22:00:00 +01:00
inline void PIC_DrawTrans( int x, int y, int width, int height )
2010-07-17 22:00:00 +02:00
{
2010-12-02 22:00:00 +01:00
g_engfuncs.pfnPIC_DrawTrans( x, y, width, height, NULL );
2010-07-17 22:00:00 +02:00
}
2010-12-02 22:00:00 +01:00
inline void PIC_DrawHoles( int x, int y, const wrect_t *prc )
2010-07-17 22:00:00 +02:00
{
2010-12-02 22:00:00 +01:00
g_engfuncs.pfnPIC_DrawHoles( x, y, -1, -1, prc );
2010-07-17 22:00:00 +02:00
}
2010-12-02 22:00:00 +01:00
inline void SPR_DrawHoles( int x, int y, int width, int height )
2010-07-17 22:00:00 +02:00
{
2010-12-02 22:00:00 +01:00
g_engfuncs.pfnPIC_DrawHoles( x, y, width, height, NULL );
2010-07-17 22:00:00 +02:00
}
2010-12-02 22:00:00 +01:00
inline void PIC_DrawAdditive( int x, int y, int width, int height )
2010-07-17 22:00:00 +02:00
{
2010-12-02 22:00:00 +01:00
g_engfuncs.pfnPIC_DrawAdditive( x, y, width, height, NULL );
2010-07-17 22:00:00 +02:00
}
2010-12-02 22:00:00 +01:00
inline void PIC_DrawAdditive( int x, int y, const wrect_t *prc )
2010-07-17 22:00:00 +02:00
{
2010-12-02 22:00:00 +01:00
g_engfuncs.pfnPIC_DrawAdditive( x, y, -1, -1, prc );
2010-07-17 22:00:00 +02:00
}
2010-07-20 22:00:00 +02:00
inline void TextMessageSetColor( int r, int g, int b, int alpha = 255 )
{
g_engfuncs.pfnDrawSetTextColor( r, g, b, alpha );
}
#define TextMessageDrawChar (*g_engfuncs.pfnDrawCharacter)
#define DrawConsoleString (*g_engfuncs.pfnDrawConsoleString)
#define GetConsoleStringSize (*g_engfuncs.pfnDrawConsoleStringLen)
#define ConsoleSetColor (*g_engfuncs.pfnSetConsoleDefaultColor)
2010-07-17 22:00:00 +02:00
#endif//ENGINECALLBACKS_H