Browse Source

ref_soft: Update API

pull/2/head
mittorn 6 years ago
parent
commit
a00256a61c
  1. 4
      r_context.c
  2. 2
      r_image.c
  3. 2
      r_light.c
  4. 53
      r_local.h
  5. 8
      r_main.c
  6. 5
      wscript

4
r_context.c

@ -212,9 +212,9 @@ static int GL_RenderGetParm( int parm, int arg ) @@ -212,9 +212,9 @@ static int GL_RenderGetParm( int parm, int arg )
return gEngfuncs.Mod_SampleSizeForFace( &WORLDMODEL->surfaces[arg] );
return LM_SAMPLE_SIZE;
case PARM_SKY_SPHERE:
return gEngfuncs.CL_GetRenderParm( parm, arg ) && !tr.fCustomSkybox;
return ENGINE_GET_PARM_( parm, arg ) && !tr.fCustomSkybox;
default:
return gEngfuncs.CL_GetRenderParm( parm, arg );
return ENGINE_GET_PARM_( parm, arg );
}
return 0;
}

2
r_image.c

@ -374,7 +374,7 @@ byte *GL_ApplyFilter( const byte *source, int width, int height ) @@ -374,7 +374,7 @@ byte *GL_ApplyFilter( const byte *source, int width, int height )
byte *out = (byte *)source;
int i;
if( gEngfuncs.Host_IsQuakeCompatible() )
if( ENGINE_GET_PARM( PARM_QUAKE_COMPATIBLE ) )
return in;
for( i = 0; source && i < width * height; i++, in += 4 )

2
r_light.c

@ -58,7 +58,7 @@ void CL_RunLightStyles( void ) @@ -58,7 +58,7 @@ void CL_RunLightStyles( void )
continue;
}
if( !gEngfuncs.CL_GetRenderParm( PARAM_GAMEPAUSED, 0 ) && frametime <= 0.1f )
if( !ENGINE_GET_PARM( PARAM_GAMEPAUSED ) && frametime <= 0.1f )
ls->time += frametime; // evaluate local time
flight = (int)Q_floor( ls->time * 10 );

53
r_local.h

@ -658,12 +658,8 @@ void TriFogParams( float flDensity, int iFogSkybox ); @@ -658,12 +658,8 @@ void TriFogParams( float flDensity, int iFogSkybox );
void TriCullFace( TRICULLSTYLE mode );
//
// r_blitscreen.c
//
void R_BlitScreen();
void R_InitBlit();
#define ENGINE_GET_PARM_ (*gEngfuncs.EngineGetParm)
#define ENGINE_GET_PARM( parm ) ENGINE_GET_PARM_( (parm), 0 )
extern ref_api_t gEngfuncs;
extern ref_globals_t *gpGlobals;
@ -807,8 +803,6 @@ extern cvar_t *r_showhull; @@ -807,8 +803,6 @@ extern cvar_t *r_showhull;
#define CLIP_EPSILON 0.001
#define BACKFACE_EPSILON 0.01
// !!! if this is changed, it must be changed in asm_draw.h too !!!
#define NEAR_CLIP 0.01
@ -1218,6 +1212,49 @@ extern int r_maxvalidedgeoffset; @@ -1218,6 +1212,49 @@ extern int r_maxvalidedgeoffset;
extern int r_currentkey;
extern int r_currentbkey;
//
// r_blitscreen.c
//
void R_InitCaches (void);
void R_BlitScreen();
void R_InitBlit();
//
// r_edge.c
//
void R_SurfacePatch (void);
void R_BeginEdgeFrame (void);
void R_RenderWorld (void);
void R_ScanEdges (void);
//
// r_surf.c
//
void D_FlushCaches (void);
//
// r_draw.c
//
void Draw_Fill (int x, int y, int w, int h, int c);
//
// r_main.c
//
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]);
//
// r_misc.c
//
void R_SetupFrameQ (void);
void R_TransformFrustum (void);
void TransformVector (vec3_t in, vec3_t out);
//
// r_rast.c
//
void R_RenderBmodelFace (bedge_t *pedges, msurface_t *psurf);
void R_RenderFace (msurface_t *fa, int clipflags);
//

8
r_main.c

@ -827,7 +827,7 @@ static void R_CheckFog( void ) @@ -827,7 +827,7 @@ static void R_CheckFog( void )
int i, cnt, count;
// quake global fog
if( gEngfuncs.Host_IsQuakeCompatible( ))
if( ENGINE_GET_PARM( PARM_QUAKE_COMPATIBLE ))
{
if( !MOVEVARS->fog_settings )
{
@ -852,12 +852,12 @@ static void R_CheckFog( void ) @@ -852,12 +852,12 @@ static void R_CheckFog( void )
RI.fogEnabled = false;
if( RI.onlyClientDraw || gEngfuncs.GetWaterLevel() < 3 || !RI.drawWorld || !RI.viewleaf )
if( RI.onlyClientDraw || ENGINE_GET_PARM( PARM_WATER_LEVEL ) < 3 || !RI.drawWorld || !RI.viewleaf )
{
if( RI.cached_waterlevel == 3 )
{
// in some cases waterlevel jumps from 3 to 1. Catch it
RI.cached_waterlevel = gEngfuncs.GetWaterLevel();
RI.cached_waterlevel = ENGINE_GET_PARM( PARM_WATER_LEVEL );
RI.cached_contents = CONTENTS_EMPTY;
//if( !RI.fogCustom ) pglDisable( GL_FOG );
}
@ -869,7 +869,7 @@ static void R_CheckFog( void ) @@ -869,7 +869,7 @@ static void R_CheckFog( void )
cnt = ent->curstate.skin;
else cnt = RI.viewleaf->contents;
RI.cached_waterlevel = gEngfuncs.GetWaterLevel();
RI.cached_waterlevel = ENGINE_GET_PARM( PARM_WATER_LEVEL );
if( !IsLiquidContents( RI.cached_contents ) && IsLiquidContents( cnt ))
{

5
wscript

@ -30,17 +30,16 @@ def build(bld): @@ -30,17 +30,16 @@ def build(bld):
name = get_subproject_name(bld)
bld.env = bld.all_envs[name]
libs = [ 'M' ]
libs = [ 'public', 'M' ]
source = bld.path.ant_glob(['*.c'])
source += [ '../engine/common/mathlib.c', '../engine/common/crtlib.c', '../engine/common/matrixlib.c' ]
includes = ['.',
'../engine',
'../engine/common',
'../engine/server',
'../engine/client',
'../public',
'../common',
'../pm_shared' ]

Loading…
Cancel
Save