- separated DFrameBuffer from DCanvas.

This was a bad idea from the start and really only made sense with DirectDraw.
These days a FrameBuffer represents an abstract hardware canvas that shares nothing with a software canvas so having these classes linked together makes things needlessly complicated.
The software render buffer is now a canvas object owned by the FrameBuffer.

Note that this commit deactivates a few things in the software renderer, but from the looks of it none of those will be needed anymore if we set OpenGL 2 as minimum target.
This commit is contained in:
Christoph Oelckers 2018-03-27 14:14:46 +02:00
commit c06ad5c59c
14 changed files with 43 additions and 51 deletions

View file

@ -288,14 +288,16 @@ void RenderPolyPlayerSprites::RenderSprite(PolyRenderThread *thread, DPSprite *p
vis.texturemid = (BASEYCENTER - sy) * tex->Scale.Y + tex->TopOffset;
if (viewpoint.camera->player && (renderTarget != screen ||
auto screencanvas = screen->GetCanvas();
if (viewpoint.camera->player && (renderTarget != screencanvas ||
viewheight == renderTarget->GetHeight() ||
(renderTarget->GetWidth() > (BASEXCENTER * 2))))
{ // Adjust PSprite for fullscreen views
AWeapon *weapon = dyn_cast<AWeapon>(pspr->GetCaller());
if (weapon != nullptr && weapon->YAdjust != 0)
{
if (renderTarget != screen || viewheight == renderTarget->GetHeight())
if (renderTarget != screencanvas || viewheight == renderTarget->GetHeight())
{
vis.texturemid -= weapon->YAdjust;
}
@ -416,7 +418,7 @@ void RenderPolyPlayerSprites::RenderSprite(PolyRenderThread *thread, DPSprite *p
// Check for hardware-assisted 2D. If it's available, and this sprite is not
// fuzzy, don't draw it until after the switch to 2D mode.
if (!noaccel && renderTarget == screen && (DFrameBuffer *)screen->Accel2D)
if (!noaccel && renderTarget == screencanvas && (DFrameBuffer *)screen->Accel2D)
{
FRenderStyle style = vis.RenderStyle;
style.CheckFuzz();