mirror of
https://github.com/DrBeef/Doom3Quest.git
synced 2024-11-27 14:22:18 +00:00
Fixed remote security camera rendering causing a crash
This commit is contained in:
parent
7fead4caeb
commit
01dfd9d6dc
3 changed files with 30 additions and 12 deletions
|
@ -1190,15 +1190,11 @@ bool idRenderSystemLocal::UploadImage( const char *imageName, const byte *data,
|
||||||
|
|
||||||
void idRenderSystemLocal::DirectFrameBufferStart()
|
void idRenderSystemLocal::DirectFrameBufferStart()
|
||||||
{
|
{
|
||||||
emptyCommand_t *cmd;
|
R_DirectFrameBufferStart();
|
||||||
cmd = (emptyCommand_t *)R_GetCommandBuffer( sizeof( *cmd ) );
|
|
||||||
cmd->commandId = RC_DIRECT_BUFFER_START;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void idRenderSystemLocal::DirectFrameBufferEnd()
|
void idRenderSystemLocal::DirectFrameBufferEnd()
|
||||||
{
|
{
|
||||||
emptyCommand_t *cmd;
|
R_DirectFrameBufferEnd();
|
||||||
cmd = (emptyCommand_t *)R_GetCommandBuffer( sizeof( *cmd ) );
|
|
||||||
cmd->commandId = RC_DIRECT_BUFFER_END;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1478,6 +1478,9 @@ void *R_FrameAlloc( int bytes );
|
||||||
void *R_ClearedFrameAlloc( int bytes );
|
void *R_ClearedFrameAlloc( int bytes );
|
||||||
void R_FrameFree( void *data );
|
void R_FrameFree( void *data );
|
||||||
|
|
||||||
|
void R_DirectFrameBufferStart();
|
||||||
|
void R_DirectFrameBufferEnd();
|
||||||
|
|
||||||
void *R_StaticAlloc( int bytes ); // just malloc with error checking
|
void *R_StaticAlloc( int bytes ); // just malloc with error checking
|
||||||
void *R_ClearedStaticAlloc( int bytes ); // with memset
|
void *R_ClearedStaticAlloc( int bytes ); // with memset
|
||||||
void R_StaticFree( void *data );
|
void R_StaticFree( void *data );
|
||||||
|
|
|
@ -278,6 +278,21 @@ static viewDef_t *R_XrayViewBySurface( drawSurf_t *drawSurf ) {
|
||||||
return parms;
|
return parms;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void R_DirectFrameBufferStart()
|
||||||
|
{
|
||||||
|
emptyCommand_t *cmd;
|
||||||
|
cmd = (emptyCommand_t *)R_GetCommandBuffer( sizeof( *cmd ) );
|
||||||
|
cmd->commandId = RC_DIRECT_BUFFER_START;
|
||||||
|
}
|
||||||
|
|
||||||
|
void R_DirectFrameBufferEnd()
|
||||||
|
{
|
||||||
|
emptyCommand_t *cmd;
|
||||||
|
cmd = (emptyCommand_t *)R_GetCommandBuffer( sizeof( *cmd ) );
|
||||||
|
cmd->commandId = RC_DIRECT_BUFFER_END;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
===============
|
===============
|
||||||
R_RemoteRender
|
R_RemoteRender
|
||||||
|
@ -324,7 +339,9 @@ static void R_RemoteRender( drawSurf_t *surf, textureStage_t *stage ) {
|
||||||
parms->superView = tr.viewDef;
|
parms->superView = tr.viewDef;
|
||||||
parms->subviewSurface = surf;
|
parms->subviewSurface = surf;
|
||||||
|
|
||||||
R_FrameBufferStart();
|
parms->renderView.forceMono = true;
|
||||||
|
|
||||||
|
R_DirectFrameBufferStart();
|
||||||
|
|
||||||
// generate render commands for it
|
// generate render commands for it
|
||||||
R_RenderView(parms);
|
R_RenderView(parms);
|
||||||
|
@ -338,7 +355,7 @@ static void R_RemoteRender( drawSurf_t *surf, textureStage_t *stage ) {
|
||||||
tr.CaptureRenderToImage( stage->image->imgName );
|
tr.CaptureRenderToImage( stage->image->imgName );
|
||||||
tr.UnCrop();
|
tr.UnCrop();
|
||||||
|
|
||||||
R_FrameBufferEnd();
|
R_DirectFrameBufferEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -380,7 +397,7 @@ void R_MirrorRender( drawSurf_t *surf, textureStage_t *stage, idScreenRect sciss
|
||||||
// triangle culling order changes with mirroring
|
// triangle culling order changes with mirroring
|
||||||
parms->isMirror = ( ( (int)parms->isMirror ^ (int)tr.viewDef->isMirror ) != 0 );
|
parms->isMirror = ( ( (int)parms->isMirror ^ (int)tr.viewDef->isMirror ) != 0 );
|
||||||
|
|
||||||
R_FrameBufferStart();
|
R_DirectFrameBufferStart();
|
||||||
|
|
||||||
// generate render commands for it
|
// generate render commands for it
|
||||||
R_RenderView( parms );
|
R_RenderView( parms );
|
||||||
|
@ -392,7 +409,7 @@ void R_MirrorRender( drawSurf_t *surf, textureStage_t *stage, idScreenRect sciss
|
||||||
tr.CaptureRenderToImage( stage->image->imgName );
|
tr.CaptureRenderToImage( stage->image->imgName );
|
||||||
tr.UnCrop();
|
tr.UnCrop();
|
||||||
|
|
||||||
R_FrameBufferEnd();
|
R_DirectFrameBufferEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -434,7 +451,9 @@ void R_XrayRender( drawSurf_t *surf, textureStage_t *stage, idScreenRect scissor
|
||||||
// triangle culling order changes with mirroring
|
// triangle culling order changes with mirroring
|
||||||
parms->isMirror = ( ( (int)parms->isMirror ^ (int)tr.viewDef->isMirror ) != 0 );
|
parms->isMirror = ( ( (int)parms->isMirror ^ (int)tr.viewDef->isMirror ) != 0 );
|
||||||
|
|
||||||
R_FrameBufferStart();
|
parms->renderView.forceMono = true;
|
||||||
|
|
||||||
|
R_DirectFrameBufferStart();
|
||||||
|
|
||||||
// generate render commands for it
|
// generate render commands for it
|
||||||
R_RenderView( parms );
|
R_RenderView( parms );
|
||||||
|
@ -446,7 +465,7 @@ void R_XrayRender( drawSurf_t *surf, textureStage_t *stage, idScreenRect scissor
|
||||||
tr.CaptureRenderToImage( stage->image->imgName );
|
tr.CaptureRenderToImage( stage->image->imgName );
|
||||||
tr.UnCrop();
|
tr.UnCrop();
|
||||||
|
|
||||||
R_FrameBufferEnd();
|
R_DirectFrameBufferEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue