Browse Source

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

pull/2/head
Alibek Omarov 2 years ago
parent
commit
69b0954007
  1. 2
      common/render_api.h
  2. 8
      engine/client/cl_render.c
  3. 2
      engine/client/client.h
  4. 2
      engine/client/ref_common.c
  5. 2
      engine/ref_api.h

2
common/render_api.h

@ -161,7 +161,7 @@ struct ref_viewpass_s; @@ -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 );

8
engine/client/cl_render.c

@ -133,7 +133,7 @@ const char *CL_GenericHandle( int fileindex ) @@ -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 ) @@ -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 ) @@ -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 );
}

2
engine/client/client.h

@ -964,7 +964,7 @@ void CL_ClearAllRemaps( void ); @@ -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 );

2
engine/client/ref_common.c

@ -60,7 +60,7 @@ void GL_RenderFrame( const ref_viewpass_t *rvp ) @@ -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
}

2
engine/ref_api.h

@ -256,7 +256,7 @@ typedef enum @@ -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 );

Loading…
Cancel
Save