mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2025-02-17 09:22:51 +00:00
added the R_SetPVSCulling extension
This commit is contained in:
parent
ec95faad1b
commit
7e0de354c2
6 changed files with 27 additions and 2 deletions
|
@ -356,6 +356,7 @@ static qbool CL_CG_GetValue( char* value, int valueSize, const char* key )
|
||||||
{ "trap_CNQ3_NDP_StartVideo", CG_EXT_NDP_STARTVIDEO },
|
{ "trap_CNQ3_NDP_StartVideo", CG_EXT_NDP_STARTVIDEO },
|
||||||
{ "trap_CNQ3_NDP_StopVideo", CG_EXT_NDP_STOPVIDEO },
|
{ "trap_CNQ3_NDP_StopVideo", CG_EXT_NDP_STOPVIDEO },
|
||||||
{ "trap_CNQ3_R_RenderScene", CG_EXT_R_RENDERSCENE },
|
{ "trap_CNQ3_R_RenderScene", CG_EXT_R_RENDERSCENE },
|
||||||
|
{ "trap_CNQ3_R_SetPVSCulling", CG_EXT_R_SETPVSCULLING },
|
||||||
// commands
|
// commands
|
||||||
{ "screenshotnc", 1 },
|
{ "screenshotnc", 1 },
|
||||||
{ "screenshotncJPEG", 1 },
|
{ "screenshotncJPEG", 1 },
|
||||||
|
@ -708,6 +709,10 @@ static intptr_t CL_CgameSystemCalls( intptr_t *args )
|
||||||
re.RenderScene( VMA(1), args[2] );
|
re.RenderScene( VMA(1), args[2] );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
case CG_EXT_R_SETPVSCULLING:
|
||||||
|
re.SetPVSCulling( (qbool)args[1] );
|
||||||
|
return 0;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Com_Error( ERR_DROP, "Bad cgame system trap: %i", args[0] );
|
Com_Error( ERR_DROP, "Bad cgame system trap: %i", args[0] );
|
||||||
}
|
}
|
||||||
|
|
|
@ -202,7 +202,8 @@ typedef enum {
|
||||||
CG_EXT_NDP_READUNTIL,
|
CG_EXT_NDP_READUNTIL,
|
||||||
CG_EXT_NDP_STARTVIDEO,
|
CG_EXT_NDP_STARTVIDEO,
|
||||||
CG_EXT_NDP_STOPVIDEO,
|
CG_EXT_NDP_STOPVIDEO,
|
||||||
CG_EXT_R_RENDERSCENE
|
CG_EXT_R_RENDERSCENE,
|
||||||
|
CG_EXT_R_SETPVSCULLING
|
||||||
} cgameImport_t;
|
} cgameImport_t;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -683,6 +683,12 @@ static qbool RE_IsDepthClampEnabled()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void RE_SetPVSCulling( qbool enable )
|
||||||
|
{
|
||||||
|
tr.drawEntireMap = !enable;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const refexport_t* GetRefAPI( const refimport_t* rimp )
|
const refexport_t* GetRefAPI( const refimport_t* rimp )
|
||||||
{
|
{
|
||||||
static refexport_t re;
|
static refexport_t re;
|
||||||
|
@ -736,5 +742,7 @@ const refexport_t* GetRefAPI( const refimport_t* rimp )
|
||||||
|
|
||||||
re.DepthClamp = RE_IsDepthClampEnabled;
|
re.DepthClamp = RE_IsDepthClampEnabled;
|
||||||
|
|
||||||
|
re.SetPVSCulling = RE_SetPVSCulling;
|
||||||
|
|
||||||
return &re;
|
return &re;
|
||||||
}
|
}
|
||||||
|
|
|
@ -936,6 +936,8 @@ typedef struct {
|
||||||
float mipFilter[4]; // only used by the GPU generators
|
float mipFilter[4]; // only used by the GPU generators
|
||||||
|
|
||||||
qbool worldSurface; // is the currently added draw surface a world surface?
|
qbool worldSurface; // is the currently added draw surface a world surface?
|
||||||
|
|
||||||
|
qbool drawEntireMap;
|
||||||
} trGlobals_t;
|
} trGlobals_t;
|
||||||
|
|
||||||
extern backEndState_t backEnd;
|
extern backEndState_t backEnd;
|
||||||
|
|
|
@ -170,6 +170,9 @@ typedef struct {
|
||||||
|
|
||||||
// is depth clamping enabled?
|
// is depth clamping enabled?
|
||||||
qbool (*DepthClamp)();
|
qbool (*DepthClamp)();
|
||||||
|
|
||||||
|
// qfalse will force drawing the entire map
|
||||||
|
void (*SetPVSCulling)( qbool enable );
|
||||||
} refexport_t;
|
} refexport_t;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -512,6 +512,12 @@ static void R_MarkLeaves()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when playing a demo on a different map, the area masks might not match
|
||||||
|
// it's safest to ignore the demo's area mask and mark all nodes as visible
|
||||||
|
if ( tr.drawEntireMap ) {
|
||||||
|
tr.refdef.areamaskModified = qtrue;
|
||||||
|
}
|
||||||
|
|
||||||
// current viewcluster
|
// current viewcluster
|
||||||
leaf = R_PointInLeaf( tr.viewParms.pvsOrigin );
|
leaf = R_PointInLeaf( tr.viewParms.pvsOrigin );
|
||||||
cluster = leaf->cluster;
|
cluster = leaf->cluster;
|
||||||
|
@ -528,7 +534,7 @@ static void R_MarkLeaves()
|
||||||
tr.visCount++;
|
tr.visCount++;
|
||||||
tr.viewCluster = cluster;
|
tr.viewCluster = cluster;
|
||||||
|
|
||||||
if ( r_novis->integer || tr.viewCluster == -1 ) {
|
if ( r_novis->integer || tr.viewCluster == -1 || tr.drawEntireMap ) {
|
||||||
for ( i = 0; i < tr.world->numnodes; ++i ) {
|
for ( i = 0; i < tr.world->numnodes; ++i ) {
|
||||||
if (tr.world->nodes[i].contents != CONTENTS_SOLID) {
|
if (tr.world->nodes[i].contents != CONTENTS_SOLID) {
|
||||||
tr.world->nodes[i].visframe = tr.visCount;
|
tr.world->nodes[i].visframe = tr.visCount;
|
||||||
|
|
Loading…
Reference in a new issue