diff --git a/src/polyrenderer/poly_renderer.cpp b/src/polyrenderer/poly_renderer.cpp index f23b264eda..d5e525bb09 100644 --- a/src/polyrenderer/poly_renderer.cpp +++ b/src/polyrenderer/poly_renderer.cpp @@ -58,6 +58,8 @@ void PolyRenderer::RenderView(player_t *player, DCanvas *target) { using namespace swrenderer; + R_ExecuteSetViewSize(Viewpoint, Viewwindow); + RenderTarget = target; RenderToCanvas = false; int width = SCREENWIDTH; @@ -93,10 +95,6 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int RenderTarget = nullptr; RenderToCanvas = false; - R_ExecuteSetViewSize(Viewpoint, Viewwindow); - float trueratio; - ActiveRatio(width, height, &trueratio); - //viewport->SetViewport(&Thread, width, height, viewport->viewwindow.WidescreenRatio); viewactive = savedviewactive; } diff --git a/src/r_renderer.h b/src/r_renderer.h index 975fe76bfb..db8968ba05 100644 --- a/src/r_renderer.h +++ b/src/r_renderer.h @@ -37,8 +37,6 @@ struct FRenderer // set up the colormap for a newly loaded level. virtual void SetColormap() = 0; - virtual void OnModeSet() = 0; - virtual void SetClearColor(int color) = 0; virtual void Init() = 0; diff --git a/src/swrenderer/r_swrenderer.cpp b/src/swrenderer/r_swrenderer.cpp index b64fd5399e..6490702c4c 100644 --- a/src/swrenderer/r_swrenderer.cpp +++ b/src/swrenderer/r_swrenderer.cpp @@ -225,13 +225,6 @@ void FSoftwareRenderer::DrawRemainingPlayerSprites() } } -void FSoftwareRenderer::OnModeSet () -{ - // This does not work if the SW renderer is not in use. - if (!V_IsHardwareRenderer()) - mScene.ScreenResized(); -} - void FSoftwareRenderer::SetClearColor(int color) { mScene.SetClearColor(color); diff --git a/src/swrenderer/r_swrenderer.h b/src/swrenderer/r_swrenderer.h index 3843d58169..6c14012461 100644 --- a/src/swrenderer/r_swrenderer.h +++ b/src/swrenderer/r_swrenderer.h @@ -20,7 +20,6 @@ struct FSoftwareRenderer : public FRenderer // draws player sprites with hardware acceleration (only useful for software rendering) void DrawRemainingPlayerSprites() override; - void OnModeSet() override; void SetClearColor(int color) override; void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, double fov) override; diff --git a/src/swrenderer/scene/r_scene.cpp b/src/swrenderer/scene/r_scene.cpp index 8fffe32af3..5392984d88 100644 --- a/src/swrenderer/scene/r_scene.cpp +++ b/src/swrenderer/scene/r_scene.cpp @@ -93,6 +93,8 @@ namespace swrenderer viewport->RenderTarget = target; viewport->RenderingToCanvas = false; + R_ExecuteSetViewSize(MainThread()->Viewport->viewpoint, MainThread()->Viewport->viewwindow); + int width = SCREENWIDTH; int height = SCREENHEIGHT; float trueratio; @@ -361,29 +363,9 @@ namespace swrenderer viewport->RenderTarget = nullptr; viewport->RenderingToCanvas = false; - - R_ExecuteSetViewSize(MainThread()->Viewport->viewpoint, MainThread()->Viewport->viewwindow); - float trueratio; - ActiveRatio(width, height, &trueratio); - viewport->SetViewport(MainThread(), width, height, trueratio); - viewactive = savedviewactive; } - - void RenderScene::ScreenResized() - { - auto viewport = MainThread()->Viewport.get(); - int width = SCREENWIDTH; - int height = SCREENHEIGHT; - viewport->RenderTarget = new DCanvas(width, height, V_IsTrueColor()); // Some code deeper down needs something valid here, so give it a dummy canvas. - float trueratio; - ActiveRatio(width, height, &trueratio); - viewport->SetViewport(MainThread(), SCREENWIDTH, SCREENHEIGHT, trueratio); - delete viewport->RenderTarget; - viewport->RenderTarget = nullptr; - } - void RenderScene::Deinit() { MainThread()->TranslucentPass->Deinit(); diff --git a/src/swrenderer/scene/r_scene.h b/src/swrenderer/scene/r_scene.h index d3b8613c09..a935d1cda2 100644 --- a/src/swrenderer/scene/r_scene.h +++ b/src/swrenderer/scene/r_scene.h @@ -44,7 +44,6 @@ namespace swrenderer RenderScene(); ~RenderScene(); - void ScreenResized(); void Deinit(); void SetClearColor(int color); diff --git a/src/v_video.cpp b/src/v_video.cpp index 51ef13e0a6..49862625f6 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -1056,9 +1056,6 @@ void V_UpdateModeSize (int width, int height) DisplayHeight = height; R_OldBlend = ~0; - - // the software renderer also needs to be notified - SWRenderer->OnModeSet(); } void V_OutputResized (int width, int height)