mirror of
https://github.com/DrBeef/Raze.git
synced 2025-02-20 18:52:43 +00:00
Fix mixing offscreenrendering (render targets) and mirrors. Don't allow recursing beyond 1 level of mirroring through multiple levels of render targets.
git-svn-id: https://svn.eduke32.com/eduke32@7853 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
5377b128a9
commit
83e863422a
2 changed files with 54 additions and 2 deletions
|
@ -1650,11 +1650,37 @@ void videoBeginDrawing(void)
|
|||
if (lockcount++ > 0)
|
||||
return;
|
||||
|
||||
if (offscreenrendering) return;
|
||||
static intptr_t backupFrameplace = 0;
|
||||
|
||||
if (inpreparemirror)
|
||||
{
|
||||
//POGO: if we are offscreenrendering and we need to render a mirror
|
||||
// or we are rendering a mirror and we start offscreenrendering,
|
||||
// backup our offscreen target so we can restore it later
|
||||
// (but only allow one level deep,
|
||||
// i.e. no viewscreen showing a camera showing a mirror that reflects the same viewscreen and recursing)
|
||||
if (offscreenrendering)
|
||||
{
|
||||
if (!backupFrameplace)
|
||||
backupFrameplace = frameplace;
|
||||
else if (frameplace != (intptr_t)mirrorBuffer &&
|
||||
frameplace != backupFrameplace)
|
||||
return;
|
||||
}
|
||||
|
||||
frameplace = (intptr_t)mirrorBuffer;
|
||||
|
||||
if (offscreenrendering)
|
||||
return;
|
||||
}
|
||||
else if (offscreenrendering)
|
||||
{
|
||||
if (backupFrameplace)
|
||||
{
|
||||
frameplace = backupFrameplace;
|
||||
backupFrameplace = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
#ifdef USE_OPENGL
|
||||
|
|
|
@ -1851,11 +1851,37 @@ void videoBeginDrawing(void)
|
|||
if (lockcount++ > 0)
|
||||
return; // already locked
|
||||
|
||||
if (offscreenrendering) return;
|
||||
static intptr_t backupFrameplace = 0;
|
||||
|
||||
if (inpreparemirror)
|
||||
{
|
||||
//POGO: if we are offscreenrendering and we need to render a mirror
|
||||
// or we are rendering a mirror and we start offscreenrendering,
|
||||
// backup our offscreen target so we can restore it later
|
||||
// (but only allow one level deep,
|
||||
// i.e. no viewscreen showing a camera showing a mirror that reflects the same viewscreen and recursing)
|
||||
if (offscreenrendering)
|
||||
{
|
||||
if (!backupFrameplace)
|
||||
backupFrameplace = frameplace;
|
||||
else if (frameplace != (intptr_t)mirrorBuffer &&
|
||||
frameplace != backupFrameplace)
|
||||
return;
|
||||
}
|
||||
|
||||
frameplace = (intptr_t)mirrorBuffer;
|
||||
|
||||
if (offscreenrendering)
|
||||
return;
|
||||
}
|
||||
else if (offscreenrendering)
|
||||
{
|
||||
if (backupFrameplace)
|
||||
{
|
||||
frameplace = backupFrameplace;
|
||||
backupFrameplace = 0;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue