|
|
@ -327,7 +327,7 @@ R_SetupFrustum |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void R_SetupFrustum( void ) |
|
|
|
void R_SetupFrustum( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ref_overview_t *ov = &clgame.overView; |
|
|
|
ref_overview_t *ov = gEngfuncs.GetOverviewParms(); |
|
|
|
|
|
|
|
|
|
|
|
if( RP_NORMALPASS() && ( cl.local.waterlevel >= 3 )) |
|
|
|
if( RP_NORMALPASS() && ( cl.local.waterlevel >= 3 )) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -362,7 +362,7 @@ static void R_SetupProjectionMatrix( matrix4x4 m ) |
|
|
|
|
|
|
|
|
|
|
|
if( RI.drawOrtho ) |
|
|
|
if( RI.drawOrtho ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ref_overview_t *ov = &clgame.overView; |
|
|
|
ref_overview_t *ov = gEngfuncs.GetOverviewParms(); |
|
|
|
Matrix4x4_CreateOrtho( m, ov->xLeft, ov->xRight, ov->yTop, ov->yBottom, ov->zNear, ov->zFar ); |
|
|
|
Matrix4x4_CreateOrtho( m, ov->xLeft, ov->xRight, ov->yTop, ov->yBottom, ov->zNear, ov->zFar ); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -518,10 +518,10 @@ void R_SetupGL( qboolean set_gl_state ) |
|
|
|
int x, x2, y, y2; |
|
|
|
int x, x2, y, y2; |
|
|
|
|
|
|
|
|
|
|
|
// set up viewport (main, playersetup)
|
|
|
|
// set up viewport (main, playersetup)
|
|
|
|
x = floor( RI.viewport[0] * glState.width / glState.width ); |
|
|
|
x = floor( RI.viewport[0] * gpGlobals->width / gpGlobals->width ); |
|
|
|
x2 = ceil(( RI.viewport[0] + RI.viewport[2] ) * glState.width / glState.width ); |
|
|
|
x2 = ceil(( RI.viewport[0] + RI.viewport[2] ) * gpGlobals->width / gpGlobals->width ); |
|
|
|
y = floor( glState.height - RI.viewport[1] * glState.height / glState.height ); |
|
|
|
y = floor( gpGlobals->height - RI.viewport[1] * gpGlobals->height / gpGlobals->height ); |
|
|
|
y2 = ceil( glState.height - ( RI.viewport[1] + RI.viewport[3] ) * glState.height / glState.height ); |
|
|
|
y2 = ceil( gpGlobals->height - ( RI.viewport[1] + RI.viewport[3] ) * gpGlobals->height / gpGlobals->height ); |
|
|
|
|
|
|
|
|
|
|
|
pglViewport( x, y2, x2 - x, y - y2 ); |
|
|
|
pglViewport( x, y2, x2 - x, y - y2 ); |
|
|
|
} |
|
|
|
} |
|
|
@ -858,7 +858,7 @@ void R_DrawEntitiesOnList( void ) |
|
|
|
GL_CheckForErrors(); |
|
|
|
GL_CheckForErrors(); |
|
|
|
|
|
|
|
|
|
|
|
if( RI.drawWorld ) |
|
|
|
if( RI.drawWorld ) |
|
|
|
clgame.dllFuncs.pfnDrawNormalTriangles(); |
|
|
|
gEngfuncs.pfnDrawNormalTriangles(); |
|
|
|
|
|
|
|
|
|
|
|
GL_CheckForErrors(); |
|
|
|
GL_CheckForErrors(); |
|
|
|
|
|
|
|
|
|
|
@ -902,7 +902,7 @@ void R_DrawEntitiesOnList( void ) |
|
|
|
if( RI.drawWorld ) |
|
|
|
if( RI.drawWorld ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); |
|
|
|
pglTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); |
|
|
|
clgame.dllFuncs.pfnDrawTransparentTriangles (); |
|
|
|
gEngfuncs.pfnDrawTransparentTriangles (); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GL_CheckForErrors(); |
|
|
|
GL_CheckForErrors(); |
|
|
@ -1109,11 +1109,11 @@ void R_RenderFrame( const ref_viewpass_t *rvp ) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// completely override rendering
|
|
|
|
// completely override rendering
|
|
|
|
if( clgame.drawFuncs.GL_RenderFrame != NULL ) |
|
|
|
if( gRenderIface.GL_RenderFrame != NULL ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
tr.fCustomRendering = true; |
|
|
|
tr.fCustomRendering = true; |
|
|
|
|
|
|
|
|
|
|
|
if( clgame.drawFuncs.GL_RenderFrame( rvp )) |
|
|
|
if( gRenderIface.GL_RenderFrame( rvp )) |
|
|
|
{ |
|
|
|
{ |
|
|
|
R_GatherPlayerLight(); |
|
|
|
R_GatherPlayerLight(); |
|
|
|
tr.realframecount++; |
|
|
|
tr.realframecount++; |
|
|
@ -1204,11 +1204,6 @@ static int GL_RenderGetParm( int parm, int arg ) |
|
|
|
case PARM_TEX_DEPTH: |
|
|
|
case PARM_TEX_DEPTH: |
|
|
|
glt = R_GetTexture( arg ); |
|
|
|
glt = R_GetTexture( arg ); |
|
|
|
return glt->depth; |
|
|
|
return glt->depth; |
|
|
|
case PARM_BSP2_SUPPORTED: |
|
|
|
|
|
|
|
#ifdef SUPPORT_BSP2_FORMAT |
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
case PARM_TEX_SKYBOX: |
|
|
|
case PARM_TEX_SKYBOX: |
|
|
|
Assert( arg >= 0 && arg < 6 ); |
|
|
|
Assert( arg >= 0 && arg < 6 ); |
|
|
|
return tr.skyboxTextures[arg]; |
|
|
|
return tr.skyboxTextures[arg]; |
|
|
@ -1217,22 +1212,14 @@ static int GL_RenderGetParm( int parm, int arg ) |
|
|
|
case PARM_TEX_LIGHTMAP: |
|
|
|
case PARM_TEX_LIGHTMAP: |
|
|
|
arg = bound( 0, arg, MAX_LIGHTMAPS - 1 ); |
|
|
|
arg = bound( 0, arg, MAX_LIGHTMAPS - 1 ); |
|
|
|
return tr.lightmapTextures[arg]; |
|
|
|
return tr.lightmapTextures[arg]; |
|
|
|
case PARM_SKY_SPHERE: |
|
|
|
|
|
|
|
return FBitSet( WORLDMODEL->flags, FWORLD_SKYSPHERE ) && !FBitSet( WORLDMODEL->flags, FWORLD_CUSTOM_SKYBOX ); |
|
|
|
|
|
|
|
case PARAM_GAMEPAUSED: |
|
|
|
|
|
|
|
return cl.paused; |
|
|
|
|
|
|
|
case PARM_WIDESCREEN: |
|
|
|
case PARM_WIDESCREEN: |
|
|
|
return glState.wideScreen; |
|
|
|
return gpGlobals->wideScreen; |
|
|
|
case PARM_FULLSCREEN: |
|
|
|
case PARM_FULLSCREEN: |
|
|
|
return glState.fullScreen; |
|
|
|
return gpGlobals->fullScreen; |
|
|
|
case PARM_SCREEN_WIDTH: |
|
|
|
case PARM_SCREEN_WIDTH: |
|
|
|
return glState.width; |
|
|
|
return gpGlobals->width; |
|
|
|
case PARM_SCREEN_HEIGHT: |
|
|
|
case PARM_SCREEN_HEIGHT: |
|
|
|
return glState.height; |
|
|
|
return gpGlobals->height; |
|
|
|
case PARM_CLIENT_INGAME: |
|
|
|
|
|
|
|
return CL_IsInGame(); |
|
|
|
|
|
|
|
case PARM_MAX_ENTITIES: |
|
|
|
|
|
|
|
return clgame.maxEntities; |
|
|
|
|
|
|
|
case PARM_TEX_TARGET: |
|
|
|
case PARM_TEX_TARGET: |
|
|
|
glt = R_GetTexture( arg ); |
|
|
|
glt = R_GetTexture( arg ); |
|
|
|
return glt->target; |
|
|
|
return glt->target; |
|
|
@ -1249,16 +1236,10 @@ static int GL_RenderGetParm( int parm, int arg ) |
|
|
|
case PARM_LIGHTSTYLEVALUE: |
|
|
|
case PARM_LIGHTSTYLEVALUE: |
|
|
|
arg = bound( 0, arg, MAX_LIGHTSTYLES - 1 ); |
|
|
|
arg = bound( 0, arg, MAX_LIGHTSTYLES - 1 ); |
|
|
|
return tr.lightstylevalue[arg]; |
|
|
|
return tr.lightstylevalue[arg]; |
|
|
|
case PARM_MAP_HAS_DELUXE: |
|
|
|
|
|
|
|
return FBitSet( WORLDMODEL->flags, FWORLD_HAS_DELUXEMAP ); |
|
|
|
|
|
|
|
case PARM_MAX_IMAGE_UNITS: |
|
|
|
case PARM_MAX_IMAGE_UNITS: |
|
|
|
return GL_MaxTextureUnits(); |
|
|
|
return GL_MaxTextureUnits(); |
|
|
|
case PARM_CLIENT_ACTIVE: |
|
|
|
|
|
|
|
return (cls.state == ca_active); |
|
|
|
|
|
|
|
case PARM_REBUILD_GAMMA: |
|
|
|
case PARM_REBUILD_GAMMA: |
|
|
|
return glConfig.softwareGammaUpdate; |
|
|
|
return glConfig.softwareGammaUpdate; |
|
|
|
case PARM_DEDICATED_SERVER: |
|
|
|
|
|
|
|
return (host.type == HOST_DEDICATED); |
|
|
|
|
|
|
|
case PARM_SURF_SAMPLESIZE: |
|
|
|
case PARM_SURF_SAMPLESIZE: |
|
|
|
if( arg >= 0 && arg < WORLDMODEL->numsurfaces ) |
|
|
|
if( arg >= 0 && arg < WORLDMODEL->numsurfaces ) |
|
|
|
return gEngfuncs.Mod_SampleSizeForFace( &WORLDMODEL->surfaces[arg] ); |
|
|
|
return gEngfuncs.Mod_SampleSizeForFace( &WORLDMODEL->surfaces[arg] ); |
|
|
@ -1269,8 +1250,10 @@ static int GL_RenderGetParm( int parm, int arg ) |
|
|
|
return glConfig.wrapper; |
|
|
|
return glConfig.wrapper; |
|
|
|
case PARM_STENCIL_ACTIVE: |
|
|
|
case PARM_STENCIL_ACTIVE: |
|
|
|
return glState.stencilEnabled; |
|
|
|
return glState.stencilEnabled; |
|
|
|
case PARM_WATER_ALPHA: |
|
|
|
case PARM_SKY_SPHERE: |
|
|
|
return FBitSet( WORLDMODEL->flags, FWORLD_WATERALPHA ); |
|
|
|
return gEngfuncs.CL_GetRenderParm( parm, arg ) && !tr.fCustomSkybox; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return gEngfuncs.CL_GetRenderParm( parm, arg ); |
|
|
|
} |
|
|
|
} |
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
@ -1358,22 +1341,16 @@ Initialize client external rendering |
|
|
|
qboolean R_InitRenderAPI( void ) |
|
|
|
qboolean R_InitRenderAPI( void ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// make sure what render functions is cleared
|
|
|
|
// make sure what render functions is cleared
|
|
|
|
memset( &clgame.drawFuncs, 0, sizeof( clgame.drawFuncs )); |
|
|
|
memset( &gRenderIface, 0, sizeof( gRenderIface )); |
|
|
|
|
|
|
|
|
|
|
|
if( clgame.dllFuncs.pfnGetRenderInterface ) |
|
|
|
if( gEngfuncs.pfnGetRenderInterface( CL_RENDER_INTERFACE_VERSION, &gRenderAPI, &gRenderIface )) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( clgame.dllFuncs.pfnGetRenderInterface( CL_RENDER_INTERFACE_VERSION, &gRenderAPI, &clgame.drawFuncs )) |
|
|
|
Con_Reportf( "CL_LoadProgs: ^2initailized extended RenderAPI ^7ver. %i\n", CL_RENDER_INTERFACE_VERSION ); |
|
|
|
{ |
|
|
|
return true; |
|
|
|
Con_Reportf( "CL_LoadProgs: ^2initailized extended RenderAPI ^7ver. %i\n", CL_RENDER_INTERFACE_VERSION ); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// make sure what render functions is cleared
|
|
|
|
|
|
|
|
memset( &clgame.drawFuncs, 0, sizeof( clgame.drawFuncs )); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false; // just tell user about problems
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// render interface is missed
|
|
|
|
// make sure what render functions is cleared
|
|
|
|
return true; |
|
|
|
memset( &gRenderIface, 0, sizeof( gRenderIface )); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false; // just tell user about problems
|
|
|
|
} |
|
|
|
} |
|
|
|