- 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

@ -605,8 +605,12 @@ DSimpleCanvas::~DSimpleCanvas ()
//==========================================================================
DFrameBuffer::DFrameBuffer (int width, int height, bool bgra)
: DCanvas (ViewportScaledWidth(width, height), ViewportScaledHeight(width, height), bgra)
//: DCanvas
{
Width = ViewportScaledWidth(width, height);
Height = ViewportScaledHeight(width, height);
Bgra = bgra;
LastMS = LastSec = FrameCount = LastCount = LastTic = 0;
Accel2D = false;
@ -796,32 +800,6 @@ void FPaletteTester::MakeTexture()
CurTranslation = t;
}
//==========================================================================
//
// DFrameBuffer :: CopyFromBuff
//
// Copies pixels from main memory to video memory. This is only used by
// DDrawFB.
//
//==========================================================================
void DFrameBuffer::CopyFromBuff (uint8_t *src, int srcPitch, int width, int height, uint8_t *dest)
{
if (Pitch == width && Pitch == Width && srcPitch == width)
{
memcpy (dest, src, Width * Height);
}
else
{
for (int y = 0; y < height; y++)
{
memcpy (dest, src, width);
dest += Pitch;
src += srcPitch;
}
}
}
//==========================================================================
//
// DFrameBuffer :: SetVSync