- took DCanvas and all its subtypes out of the DObject tree.

I have no idea why they were even in there, as they intentionally circumvented all GC related features - they declared themselves fixed if prone to getting collected, they all used OF_YesReallyDelete when destroying themselves and they never used any of the object creation or RTTI features, aside from a single assert in V_Init2.

Essentially they were a drag on the system and OF_YesReallyDelete was effectively added just to deal with the canvases which were DObjects but not supposed to behave like them in the first place.
This commit is contained in:
Christoph Oelckers 2017-04-14 10:48:18 +02:00
commit dc5a5419fc
21 changed files with 16 additions and 61 deletions

View file

@ -73,8 +73,6 @@ int active_con_scale();
FRenderer *Renderer;
IMPLEMENT_CLASS(DCanvas, true, false)
IMPLEMENT_CLASS(DFrameBuffer, true, false)
EXTERN_CVAR (Bool, swtruecolor)
EXTERN_CVAR (Bool, fullscreen)
@ -86,7 +84,7 @@ EXTERN_CVAR (Bool, fullscreen)
class DDummyFrameBuffer : public DFrameBuffer
{
DECLARE_CLASS (DDummyFrameBuffer, DFrameBuffer);
typedef DFrameBuffer Super;
public:
DDummyFrameBuffer (int width, int height)
: DFrameBuffer (0, 0, false)
@ -112,11 +110,6 @@ public:
float Gamma;
};
IMPLEMENT_CLASS(DDummyFrameBuffer, true, false)
// SimpleCanvas is not really abstract, but this macro does not
// try to generate a CreateNew() function.
IMPLEMENT_CLASS(DSimpleCanvas, true, false)
class FPaletteTester : public FTexture
{
@ -1272,7 +1265,6 @@ bool V_DoModeSetup (int width, int height, int bits)
}
screen = buff;
GC::WriteBarrier(screen);
screen->SetGamma (Gamma);
// Load fonts now so they can be packed into textures straight away,
@ -1544,7 +1536,6 @@ void V_Init (bool restart)
void V_Init2()
{
assert (screen->IsKindOf(RUNTIME_CLASS(DDummyFrameBuffer)));
int width = screen->GetWidth();
int height = screen->GetHeight();
float gamma = static_cast<DDummyFrameBuffer *>(screen)->Gamma;
@ -1552,7 +1543,6 @@ void V_Init2()
{
DFrameBuffer *s = screen;
screen = NULL;
s->ObjectFlags |= OF_YesReallyDelete;
delete s;
}
@ -1579,7 +1569,6 @@ void V_Shutdown()
{
DFrameBuffer *s = screen;
screen = NULL;
s->ObjectFlags |= OF_YesReallyDelete;
delete s;
}
V_ClearFonts();