mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- fix missing psprite when camera textures are in view
This commit is contained in:
parent
d17216d7dd
commit
d10aa10889
1 changed files with 20 additions and 5 deletions
|
@ -343,13 +343,19 @@ namespace swrenderer
|
||||||
{
|
{
|
||||||
auto viewport = MainThread()->Viewport.get();
|
auto viewport = MainThread()->Viewport.get();
|
||||||
|
|
||||||
const bool savedviewactive = viewactive;
|
// Save a bunch of silly globals:
|
||||||
auto savedtarget = viewport->RenderTarget;
|
auto savedViewpoint = viewport->viewpoint;
|
||||||
|
auto savedViewwindow = viewport->viewwindow;
|
||||||
|
auto savedviewwindowx = viewwindowx;
|
||||||
|
auto savedviewwindowy = viewwindowy;
|
||||||
|
auto savedviewwidth = viewwidth;
|
||||||
|
auto savedviewheight = viewheight;
|
||||||
|
auto savedviewactive = viewactive;
|
||||||
|
auto savedRenderTarget = viewport->RenderTarget;
|
||||||
|
|
||||||
viewwidth = width;
|
// Setup the view:
|
||||||
viewport->RenderTarget = canvas;
|
viewport->RenderTarget = canvas;
|
||||||
viewport->RenderingToCanvas = true;
|
viewport->RenderingToCanvas = true;
|
||||||
|
|
||||||
R_SetWindow(MainThread()->Viewport->viewpoint, MainThread()->Viewport->viewwindow, 12, width, height, height, true);
|
R_SetWindow(MainThread()->Viewport->viewpoint, MainThread()->Viewport->viewwindow, 12, width, height, height, true);
|
||||||
viewwindowx = x;
|
viewwindowx = x;
|
||||||
viewwindowy = y;
|
viewwindowy = y;
|
||||||
|
@ -358,14 +364,23 @@ namespace swrenderer
|
||||||
if (r_models)
|
if (r_models)
|
||||||
PolyTriangleDrawer::ClearBuffers(viewport->RenderTarget);
|
PolyTriangleDrawer::ClearBuffers(viewport->RenderTarget);
|
||||||
|
|
||||||
|
// Render:
|
||||||
RenderActorView(actor, dontmaplines);
|
RenderActorView(actor, dontmaplines);
|
||||||
DrawerWaitCycles.Clock();
|
DrawerWaitCycles.Clock();
|
||||||
DrawerThreads::WaitForWorkers();
|
DrawerThreads::WaitForWorkers();
|
||||||
DrawerWaitCycles.Unclock();
|
DrawerWaitCycles.Unclock();
|
||||||
|
|
||||||
viewport->RenderTarget = savedtarget;
|
|
||||||
viewport->RenderingToCanvas = false;
|
viewport->RenderingToCanvas = false;
|
||||||
|
|
||||||
|
// Restore silly globals:
|
||||||
|
viewport->viewpoint = savedViewpoint;
|
||||||
|
viewport->viewwindow = savedViewwindow;
|
||||||
|
viewwindowx = savedviewwindowx;
|
||||||
|
viewwindowy = savedviewwindowy;
|
||||||
|
viewwidth = savedviewwidth;
|
||||||
|
viewheight = savedviewheight;
|
||||||
viewactive = savedviewactive;
|
viewactive = savedviewactive;
|
||||||
|
viewport->RenderTarget = savedRenderTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderScene::Deinit()
|
void RenderScene::Deinit()
|
||||||
|
|
Loading…
Reference in a new issue