engine: change RenderAPI's RenderGetParm return type to intptr_t to insure compatibility with 64-bit

This commit is contained in:
Alibek Omarov 2022-09-20 18:06:19 +03:00
parent 0645402946
commit 69b0954007
5 changed files with 8 additions and 8 deletions

View File

@ -161,7 +161,7 @@ struct ref_viewpass_s;
typedef struct render_api_s
{
// Get renderer info (doesn't changes engine state at all)
int (*RenderGetParm)( int parm, int arg ); // generic
intptr_t (*RenderGetParm)( int parm, int arg ); // generic
void (*GetDetailScaleForTexture)( int texture, float *xScale, float *yScale );
void (*GetExtraParmsForTexture)( int texture, byte *red, byte *green, byte *blue, byte *alpha );
lightstyle_t* (*GetLightStyle)( int number );

View File

@ -133,7 +133,7 @@ const char *CL_GenericHandle( int fileindex )
return cl.files_precache[fileindex];
}
int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef )
intptr_t CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef )
{
switch( parm )
{
@ -161,9 +161,9 @@ int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef )
case PARM_WATER_ALPHA:
return FBitSet( world.flags, FWORLD_WATERALPHA );
case PARM_DELUXEDATA:
return *(int *)&world.deluxedata;
return (intptr_t)world.deluxedata;
case PARM_SHADOWDATA:
return *(int *)&world.shadowdata;
return (intptr_t)world.shadowdata;
default:
// indicates call from client.dll
if( checkRef )
@ -204,7 +204,7 @@ int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef )
return 0;
}
static int pfnRenderGetParm( int parm, int arg )
static intptr_t pfnRenderGetParm( int parm, int arg )
{
return CL_RenderGetParm( parm, arg, true );
}

View File

@ -964,7 +964,7 @@ void CL_ClearAllRemaps( void );
// cl_render.c
//
qboolean R_InitRenderAPI( void );
int CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef );
intptr_t CL_RenderGetParm( const int parm, const int arg, const qboolean checkRef );
lightstyle_t *CL_GetLightStyle( int number );
int R_FatPVS( const vec3_t org, float radius, byte *visbuffer, qboolean merge, qboolean fullvis );
const ref_overview_t *GL_GetOverviewParms( void );

View File

@ -60,7 +60,7 @@ void GL_RenderFrame( const ref_viewpass_t *rvp )
ref.dllFuncs.GL_RenderFrame( rvp );
}
static int pfnEngineGetParm( int parm, int arg )
static intptr_t pfnEngineGetParm( int parm, int arg )
{
return CL_RenderGetParm( parm, arg, false ); // prevent recursion
}

View File

@ -256,7 +256,7 @@ typedef enum
typedef struct ref_api_s
{
int (*EngineGetParm)( int parm, int arg ); // generic
intptr_t (*EngineGetParm)( int parm, int arg ); // generic
// cvar handlers
cvar_t *(*Cvar_Get)( const char *szName, const char *szValue, int flags, const char *description );