mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-19 07:30:59 +00:00
Change redundant bRenderingToCanvas into a helper function
This commit is contained in:
parent
bb0a223b80
commit
ca93d7456a
5 changed files with 4 additions and 7 deletions
|
@ -85,7 +85,6 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int
|
||||||
|
|
||||||
viewwidth = width;
|
viewwidth = width;
|
||||||
viewport->RenderTarget = canvas;
|
viewport->RenderTarget = canvas;
|
||||||
viewport->bRenderingToCanvas = true;
|
|
||||||
R_SetWindow(12, width, height, height, true);
|
R_SetWindow(12, width, height, height, true);
|
||||||
viewport->SetViewport(width, height, WidescreenRatio);
|
viewport->SetViewport(width, height, WidescreenRatio);
|
||||||
viewwindowx = x;
|
viewwindowx = x;
|
||||||
|
@ -99,7 +98,6 @@ void PolyRenderer::RenderViewToCanvas(AActor *actor, DCanvas *canvas, int x, int
|
||||||
canvas->Unlock();
|
canvas->Unlock();
|
||||||
|
|
||||||
viewport->RenderTarget = screen;
|
viewport->RenderTarget = screen;
|
||||||
viewport->bRenderingToCanvas = false;
|
|
||||||
R_ExecuteSetViewSize();
|
R_ExecuteSetViewSize();
|
||||||
float trueratio;
|
float trueratio;
|
||||||
ActiveRatio(width, height, &trueratio);
|
ActiveRatio(width, height, &trueratio);
|
||||||
|
|
|
@ -815,7 +815,7 @@ namespace swrenderer
|
||||||
auto viewport = RenderViewport::Instance();
|
auto viewport = RenderViewport::Instance();
|
||||||
// clip ceiling to console bottom
|
// clip ceiling to console bottom
|
||||||
fillshort(floorclip, viewwidth, viewheight);
|
fillshort(floorclip, viewwidth, viewheight);
|
||||||
fillshort(ceilingclip, viewwidth, !screen->Accel2D && ConBottom > viewwindowy && !viewport->bRenderingToCanvas ? (ConBottom - viewwindowy) : 0);
|
fillshort(ceilingclip, viewwidth, !screen->Accel2D && ConBottom > viewwindowy && !viewport->RenderingToCanvas() ? (ConBottom - viewwindowy) : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RenderOpaquePass::AddSprites(sector_t *sec, int lightlevel, WaterFakeSide fakeside, bool foggy, FDynamicColormap *basecolormap)
|
void RenderOpaquePass::AddSprites(sector_t *sec, int lightlevel, WaterFakeSide fakeside, bool foggy, FDynamicColormap *basecolormap)
|
||||||
|
|
|
@ -199,7 +199,6 @@ namespace swrenderer
|
||||||
|
|
||||||
viewwidth = width;
|
viewwidth = width;
|
||||||
viewport->RenderTarget = canvas;
|
viewport->RenderTarget = canvas;
|
||||||
viewport->bRenderingToCanvas = true;
|
|
||||||
|
|
||||||
R_SetWindow(12, width, height, height, true);
|
R_SetWindow(12, width, height, height, true);
|
||||||
viewwindowx = x;
|
viewwindowx = x;
|
||||||
|
@ -212,7 +211,6 @@ namespace swrenderer
|
||||||
R_EndDrawerCommands();
|
R_EndDrawerCommands();
|
||||||
|
|
||||||
viewport->RenderTarget = screen;
|
viewport->RenderTarget = screen;
|
||||||
viewport->bRenderingToCanvas = false;
|
|
||||||
|
|
||||||
R_ExecuteSetViewSize();
|
R_ExecuteSetViewSize();
|
||||||
float trueratio;
|
float trueratio;
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace swrenderer
|
||||||
{
|
{
|
||||||
int virtheight, virtwidth, virtwidth2, virtheight2;
|
int virtheight, virtwidth, virtwidth2, virtheight2;
|
||||||
|
|
||||||
if (!bRenderingToCanvas)
|
if (!RenderingToCanvas())
|
||||||
{ // Set r_viewsize cvar to reflect the current view size
|
{ // Set r_viewsize cvar to reflect the current view size
|
||||||
UCVarValue value;
|
UCVarValue value;
|
||||||
char temp[16];
|
char temp[16];
|
||||||
|
|
|
@ -27,7 +27,6 @@ namespace swrenderer
|
||||||
void SetupFreelook();
|
void SetupFreelook();
|
||||||
|
|
||||||
DCanvas *RenderTarget = nullptr;
|
DCanvas *RenderTarget = nullptr;
|
||||||
bool bRenderingToCanvas = false;
|
|
||||||
fixed_t viewingrangerecip = 0;
|
fixed_t viewingrangerecip = 0;
|
||||||
double FocalLengthX = 0.0;
|
double FocalLengthX = 0.0;
|
||||||
double FocalLengthY = 0.0;
|
double FocalLengthY = 0.0;
|
||||||
|
@ -47,6 +46,8 @@ namespace swrenderer
|
||||||
|
|
||||||
uint8_t *dc_destorg = nullptr;
|
uint8_t *dc_destorg = nullptr;
|
||||||
|
|
||||||
|
bool RenderingToCanvas() const { return RenderTarget != screen; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void InitTextureMapping();
|
void InitTextureMapping();
|
||||||
void SetupBuffer();
|
void SetupBuffer();
|
||||||
|
|
Loading…
Reference in a new issue