- Remove code that seemingly doesn't do anything and really shouldn't be needed

This commit is contained in:
Magnus Norddahl 2018-04-13 21:56:34 +02:00
parent 7e544c66fe
commit 915f8862a7
7 changed files with 4 additions and 38 deletions

View file

@ -58,6 +58,8 @@ void PolyRenderer::RenderView(player_t *player, DCanvas *target)
{ {
using namespace swrenderer; using namespace swrenderer;
R_ExecuteSetViewSize(Viewpoint, Viewwindow);
RenderTarget = target; RenderTarget = target;
RenderToCanvas = false; RenderToCanvas = false;
int width = SCREENWIDTH; int width = SCREENWIDTH;
@ -93,10 +95,6 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int
RenderTarget = nullptr; RenderTarget = nullptr;
RenderToCanvas = false; RenderToCanvas = false;
R_ExecuteSetViewSize(Viewpoint, Viewwindow);
float trueratio;
ActiveRatio(width, height, &trueratio);
//viewport->SetViewport(&Thread, width, height, viewport->viewwindow.WidescreenRatio);
viewactive = savedviewactive; viewactive = savedviewactive;
} }

View file

@ -37,8 +37,6 @@ struct FRenderer
// set up the colormap for a newly loaded level. // set up the colormap for a newly loaded level.
virtual void SetColormap() = 0; virtual void SetColormap() = 0;
virtual void OnModeSet() = 0;
virtual void SetClearColor(int color) = 0; virtual void SetClearColor(int color) = 0;
virtual void Init() = 0; virtual void Init() = 0;

View file

@ -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) void FSoftwareRenderer::SetClearColor(int color)
{ {
mScene.SetClearColor(color); mScene.SetClearColor(color);

View file

@ -20,7 +20,6 @@ struct FSoftwareRenderer : public FRenderer
// draws player sprites with hardware acceleration (only useful for software rendering) // draws player sprites with hardware acceleration (only useful for software rendering)
void DrawRemainingPlayerSprites() override; void DrawRemainingPlayerSprites() override;
void OnModeSet() override;
void SetClearColor(int color) override; void SetClearColor(int color) override;
void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, double fov) override; void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, double fov) override;

View file

@ -93,6 +93,8 @@ namespace swrenderer
viewport->RenderTarget = target; viewport->RenderTarget = target;
viewport->RenderingToCanvas = false; viewport->RenderingToCanvas = false;
R_ExecuteSetViewSize(MainThread()->Viewport->viewpoint, MainThread()->Viewport->viewwindow);
int width = SCREENWIDTH; int width = SCREENWIDTH;
int height = SCREENHEIGHT; int height = SCREENHEIGHT;
float trueratio; float trueratio;
@ -361,29 +363,9 @@ namespace swrenderer
viewport->RenderTarget = nullptr; viewport->RenderTarget = nullptr;
viewport->RenderingToCanvas = false; 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; 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() void RenderScene::Deinit()
{ {
MainThread()->TranslucentPass->Deinit(); MainThread()->TranslucentPass->Deinit();

View file

@ -44,7 +44,6 @@ namespace swrenderer
RenderScene(); RenderScene();
~RenderScene(); ~RenderScene();
void ScreenResized();
void Deinit(); void Deinit();
void SetClearColor(int color); void SetClearColor(int color);

View file

@ -1056,9 +1056,6 @@ void V_UpdateModeSize (int width, int height)
DisplayHeight = height; DisplayHeight = height;
R_OldBlend = ~0; R_OldBlend = ~0;
// the software renderer also needs to be notified
SWRenderer->OnModeSet();
} }
void V_OutputResized (int width, int height) void V_OutputResized (int width, int height)