mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- 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:
parent
d407aa3157
commit
dc5a5419fc
21 changed files with 16 additions and 61 deletions
|
@ -326,7 +326,6 @@ static void MarkRoot()
|
|||
|
||||
Gray = NULL;
|
||||
Mark(Args);
|
||||
Mark(screen);
|
||||
Mark(StatusBar);
|
||||
M_MarkMenus();
|
||||
Mark(DIntermissionController::CurrentIntermission);
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include "gl/renderer/gl_2ddrawer.h"
|
||||
#include "gl_debug.h"
|
||||
|
||||
IMPLEMENT_CLASS(OpenGLFrameBuffer, false, false)
|
||||
EXTERN_CVAR (Float, vid_brightness)
|
||||
EXTERN_CVAR (Float, vid_contrast)
|
||||
EXTERN_CVAR (Bool, vid_vsync)
|
||||
|
|
|
@ -17,13 +17,11 @@ extern long gl_frameMS;
|
|||
class OpenGLFrameBuffer : public Win32GLFrameBuffer
|
||||
{
|
||||
typedef Win32GLFrameBuffer Super;
|
||||
DECLARE_CLASS(OpenGLFrameBuffer, Win32GLFrameBuffer)
|
||||
#else
|
||||
#include "sdlglvideo.h"
|
||||
class OpenGLFrameBuffer : public SDLGLFB
|
||||
{
|
||||
// typedef SDLGLFB Super; //[C]commented, DECLARE_CLASS defines this in linux
|
||||
DECLARE_CLASS(OpenGLFrameBuffer, SDLGLFB)
|
||||
typedef SDLGLFB Super; //[C]commented, DECLARE_CLASS defines this in linux
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -113,8 +113,6 @@ DFrameBuffer *CreateGLSWFrameBuffer(int width, int height, bool bgra, bool fulls
|
|||
}
|
||||
#endif
|
||||
|
||||
IMPLEMENT_CLASS(OpenGLSWFrameBuffer, false, false)
|
||||
|
||||
const char *const OpenGLSWFrameBuffer::ShaderDefines[OpenGLSWFrameBuffer::NUM_SHADERS] =
|
||||
{
|
||||
"#define ENORMALCOLOR", // NormalColor
|
||||
|
|
|
@ -17,13 +17,11 @@ class FGLDebug;
|
|||
class OpenGLSWFrameBuffer : public Win32GLFrameBuffer
|
||||
{
|
||||
typedef Win32GLFrameBuffer Super;
|
||||
DECLARE_CLASS(OpenGLSWFrameBuffer, Win32GLFrameBuffer)
|
||||
#else
|
||||
#include "sdlglvideo.h"
|
||||
class OpenGLSWFrameBuffer : public SDLGLFB
|
||||
{
|
||||
// typedef SDLGLFB Super; //[C]commented, DECLARE_CLASS defines this in linux
|
||||
DECLARE_CLASS(OpenGLSWFrameBuffer, SDLGLFB)
|
||||
typedef SDLGLFB Super; //[C]commented, DECLARE_CLASS defines this in linux
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -30,9 +30,6 @@
|
|||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(SDLBaseFB, true, false)
|
||||
IMPLEMENT_CLASS(SDLGLFB, true, false)
|
||||
|
||||
struct MiniModeInfo
|
||||
{
|
||||
uint16_t Width, Height;
|
||||
|
|
|
@ -37,7 +37,7 @@ private:
|
|||
|
||||
class SDLBaseFB : public DFrameBuffer
|
||||
{
|
||||
DECLARE_CLASS(SDLBaseFB, DFrameBuffer)
|
||||
typedef DFrameBuffer Super;
|
||||
public:
|
||||
using DFrameBuffer::DFrameBuffer;
|
||||
virtual SDL_Window *GetSDLWindow() = 0;
|
||||
|
@ -47,7 +47,7 @@ public:
|
|||
|
||||
class SDLGLFB : public SDLBaseFB
|
||||
{
|
||||
DECLARE_CLASS(SDLGLFB, SDLBaseFB)
|
||||
typedef SDLBaseFB Super;
|
||||
public:
|
||||
// this must have the same parameters as the Windows version, even if they are not used!
|
||||
SDLGLFB (void *hMonitor, int width, int height, int, int, bool fullscreen, bool bgra);
|
||||
|
|
|
@ -24,8 +24,6 @@
|
|||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(SDLFB, false, false)
|
||||
|
||||
struct MiniModeInfo
|
||||
{
|
||||
uint16_t Width, Height;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
class SDLFB : public SDLBaseFB
|
||||
{
|
||||
DECLARE_CLASS(SDLFB, SDLBaseFB)
|
||||
typedef SDLBaseFB Super;
|
||||
public:
|
||||
SDLFB(int width, int height, bool bgra, bool fullscreen, SDL_Window *oldwin);
|
||||
~SDLFB();
|
||||
|
|
|
@ -206,7 +206,6 @@ void FSoftwareRenderer::WriteSavePic (player_t *player, FileWriter *file, int wi
|
|||
PalEntry palette[256];
|
||||
|
||||
// Take a snapshot of the player's view
|
||||
pic->ObjectFlags |= OF_Fixed;
|
||||
pic->Lock ();
|
||||
if (r_polyrenderer)
|
||||
{
|
||||
|
@ -227,8 +226,6 @@ void FSoftwareRenderer::WriteSavePic (player_t *player, FileWriter *file, int wi
|
|||
screen->GetFlashedPalette (palette);
|
||||
M_CreatePNG (file, pic->GetBuffer(), palette, SS_PAL, width, height, pic->GetPitch());
|
||||
pic->Unlock ();
|
||||
pic->Destroy();
|
||||
pic->ObjectFlags |= OF_YesReallyDelete;
|
||||
delete pic;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,7 +114,6 @@ void FCanvasTexture::MakeTexture ()
|
|||
{
|
||||
Canvas = new DSimpleCanvas (Width, Height, false);
|
||||
Canvas->Lock ();
|
||||
GC::AddSoftRoot(Canvas);
|
||||
|
||||
if (Width != Height || Width != Canvas->GetPitch())
|
||||
{
|
||||
|
@ -136,7 +135,6 @@ void FCanvasTexture::MakeTextureBgra()
|
|||
{
|
||||
CanvasBgra = new DSimpleCanvas(Width, Height, true);
|
||||
CanvasBgra->Lock();
|
||||
GC::AddSoftRoot(CanvasBgra);
|
||||
|
||||
if (Width != Height || Width != CanvasBgra->GetPitch())
|
||||
{
|
||||
|
@ -172,16 +170,12 @@ void FCanvasTexture::Unload ()
|
|||
|
||||
if (Canvas != NULL)
|
||||
{
|
||||
GC::DelSoftRoot(Canvas);
|
||||
Canvas->Destroy();
|
||||
Canvas = NULL;
|
||||
delete Canvas;
|
||||
}
|
||||
|
||||
if (CanvasBgra != NULL)
|
||||
{
|
||||
GC::DelSoftRoot(CanvasBgra);
|
||||
CanvasBgra->Destroy();
|
||||
CanvasBgra = NULL;
|
||||
delete CanvasBgra;
|
||||
}
|
||||
|
||||
FTexture::Unload();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -198,9 +198,8 @@ struct VMVa_List
|
|||
//
|
||||
// [RH] Made screens more implementation-independant:
|
||||
//
|
||||
class DCanvas : public DObject
|
||||
class DCanvas
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS (DCanvas, DObject)
|
||||
public:
|
||||
DCanvas (int width, int height, bool bgra);
|
||||
virtual ~DCanvas ();
|
||||
|
@ -317,7 +316,7 @@ private:
|
|||
|
||||
class DSimpleCanvas : public DCanvas
|
||||
{
|
||||
DECLARE_CLASS (DSimpleCanvas, DCanvas)
|
||||
typedef DCanvas Super;
|
||||
public:
|
||||
DSimpleCanvas (int width, int height, bool bgra);
|
||||
~DSimpleCanvas ();
|
||||
|
@ -357,7 +356,7 @@ public:
|
|||
|
||||
class DFrameBuffer : public DSimpleCanvas
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS (DFrameBuffer, DSimpleCanvas)
|
||||
typedef DSimpleCanvas Super;
|
||||
public:
|
||||
DFrameBuffer (int width, int height, bool bgra);
|
||||
|
||||
|
|
|
@ -92,8 +92,6 @@
|
|||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(D3DFB, false, false)
|
||||
|
||||
struct D3DFB::PackedTexture
|
||||
{
|
||||
D3DFB::Atlas *Owner;
|
||||
|
|
|
@ -60,8 +60,6 @@
|
|||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(DDrawFB, false, false)
|
||||
|
||||
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
|
||||
|
||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||
|
|
|
@ -142,7 +142,6 @@ void I_ShutdownGraphics ()
|
|||
{
|
||||
DFrameBuffer *s = screen;
|
||||
screen = NULL;
|
||||
s->ObjectFlags |= OF_YesReallyDelete;
|
||||
delete s;
|
||||
}
|
||||
if (Video)
|
||||
|
|
|
@ -945,8 +945,6 @@ bool Win32GLVideo::SetFullscreen(const char *devicename, int w, int h, int bits,
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
IMPLEMENT_CLASS(Win32GLFrameBuffer, true, false)
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
|
@ -27,7 +27,7 @@ FRenderer *gl_CreateInterface();
|
|||
|
||||
class Win32GLFrameBuffer : public BaseWinFB
|
||||
{
|
||||
DECLARE_CLASS(Win32GLFrameBuffer, BaseWinFB)
|
||||
typedef BaseWinFB Super;
|
||||
|
||||
public:
|
||||
Win32GLFrameBuffer() {}
|
||||
|
|
|
@ -103,7 +103,7 @@ class Win32Video : public IVideo
|
|||
|
||||
class BaseWinFB : public DFrameBuffer
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(BaseWinFB, DFrameBuffer)
|
||||
typedef DFrameBuffer Super;
|
||||
public:
|
||||
BaseWinFB(int width, int height, bool bgra) : DFrameBuffer(width, height, bgra), Windowed(true) {}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ extern HANDLE FPSLimitEvent;
|
|||
|
||||
class DDrawFB : public BaseWinFB
|
||||
{
|
||||
DECLARE_CLASS(DDrawFB, BaseWinFB)
|
||||
typedef BaseWinFB Super;
|
||||
public:
|
||||
DDrawFB (int width, int height, bool fullscreen);
|
||||
~DDrawFB ();
|
||||
|
@ -100,7 +100,7 @@ private:
|
|||
|
||||
class D3DFB : public BaseWinFB
|
||||
{
|
||||
DECLARE_CLASS(D3DFB, BaseWinFB)
|
||||
typedef BaseWinFB Super;
|
||||
public:
|
||||
D3DFB (UINT adapter, int width, int height, bool bgra, bool fullscreen);
|
||||
~D3DFB ();
|
||||
|
|
|
@ -80,8 +80,6 @@
|
|||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_CLASS(BaseWinFB, true, false)
|
||||
|
||||
typedef IDirect3D9 *(WINAPI *DIRECT3DCREATE9FUNC)(UINT SDKVersion);
|
||||
typedef HRESULT (WINAPI *DIRECTDRAWCREATEFUNC)(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter);
|
||||
|
||||
|
@ -662,8 +660,7 @@ DFrameBuffer *Win32Video::CreateFrameBuffer (int width, int height, bool bgra, b
|
|||
return old;
|
||||
}
|
||||
old->GetFlash (flashColor, flashAmount);
|
||||
old->ObjectFlags |= OF_YesReallyDelete;
|
||||
if (old == screen) screen = NULL;
|
||||
if (old == screen) screen = nullptr;
|
||||
delete old;
|
||||
}
|
||||
else
|
||||
|
@ -700,7 +697,6 @@ DFrameBuffer *Win32Video::CreateFrameBuffer (int width, int height, bool bgra, b
|
|||
{
|
||||
hr = fb->GetHR ();
|
||||
}
|
||||
fb->ObjectFlags |= OF_YesReallyDelete;
|
||||
delete fb;
|
||||
|
||||
LOG1 ("fb is bad: %08lx\n", hr);
|
||||
|
|
Loading…
Reference in a new issue