diff --git a/r_context.c b/r_context.c index 48e7b997..65821e7c 100644 --- a/r_context.c +++ b/r_context.c @@ -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; } diff --git a/r_image.c b/r_image.c index 07900cbf..95a5291d 100644 --- a/r_image.c +++ b/r_image.c @@ -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 ) diff --git a/r_light.c b/r_light.c index 7b3e00cf..08bd4fe3 100644 --- a/r_light.c +++ b/r_light.c @@ -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 ); diff --git a/r_local.h b/r_local.h index 53b1d5f2..5d3088fa 100644 --- a/r_local.h +++ b/r_local.h @@ -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; #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; 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); // diff --git a/r_main.c b/r_main.c index 57e69b61..f6c60140 100644 --- a/r_main.c +++ b/r_main.c @@ -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 ) 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 ) 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 )) { diff --git a/r_rast.c b/r_rast.c index d9212dcb..11ebef2d 100644 --- a/r_rast.c +++ b/r_rast.c @@ -562,7 +562,7 @@ void R_RenderFace (msurface_t *fa, int clipflags) // environment box surfaces to be emited /* if ( fa->texinfo->flags & SURF_SKY ) { - R_EmitSkyBox (); + R_EmitSkyBox (); return; }*/ diff --git a/wscript b/wscript index 8bed8fa4..a4e4b2c6 100644 --- a/wscript +++ b/wscript @@ -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' ]