This commit is contained in:
Rachael Alexanderson 2017-04-14 05:51:36 -04:00
commit 4b2b2af63e
25 changed files with 16 additions and 73 deletions

View File

@ -79,8 +79,6 @@
#include "g_levellocals.h" #include "g_levellocals.h"
#include "events.h" #include "events.h"
void MarkACSThinker();
// MACROS ------------------------------------------------------------------ // MACROS ------------------------------------------------------------------
/* /*
@ -326,13 +324,11 @@ static void MarkRoot()
Gray = NULL; Gray = NULL;
Mark(Args); Mark(Args);
Mark(screen);
Mark(StatusBar); Mark(StatusBar);
M_MarkMenus(); M_MarkMenus();
Mark(DIntermissionController::CurrentIntermission); Mark(DIntermissionController::CurrentIntermission);
DThinker::MarkRoots(); DThinker::MarkRoots();
FCanvasTextureInfo::Mark(); FCanvasTextureInfo::Mark();
MarkACSThinker();
Mark(E_FirstEventHandler); Mark(E_FirstEventHandler);
Mark(E_LastEventHandler); Mark(E_LastEventHandler);
for (auto &s : level.sectorPortals) for (auto &s : level.sectorPortals)

View File

@ -242,7 +242,6 @@ void PClass::StaticShutdown ()
{ {
if (WP_NOCHANGE != nullptr) if (WP_NOCHANGE != nullptr)
{ {
WP_NOCHANGE->ObjectFlags |= OF_YesReallyDelete;
delete WP_NOCHANGE; delete WP_NOCHANGE;
} }

View File

@ -52,7 +52,6 @@
#include "gl/renderer/gl_2ddrawer.h" #include "gl/renderer/gl_2ddrawer.h"
#include "gl_debug.h" #include "gl_debug.h"
IMPLEMENT_CLASS(OpenGLFrameBuffer, false, false)
EXTERN_CVAR (Float, vid_brightness) EXTERN_CVAR (Float, vid_brightness)
EXTERN_CVAR (Float, vid_contrast) EXTERN_CVAR (Float, vid_contrast)
EXTERN_CVAR (Bool, vid_vsync) EXTERN_CVAR (Bool, vid_vsync)

View File

@ -17,13 +17,11 @@ extern long gl_frameMS;
class OpenGLFrameBuffer : public Win32GLFrameBuffer class OpenGLFrameBuffer : public Win32GLFrameBuffer
{ {
typedef Win32GLFrameBuffer Super; typedef Win32GLFrameBuffer Super;
DECLARE_CLASS(OpenGLFrameBuffer, Win32GLFrameBuffer)
#else #else
#include "sdlglvideo.h" #include "sdlglvideo.h"
class OpenGLFrameBuffer : public SDLGLFB class OpenGLFrameBuffer : public SDLGLFB
{ {
// typedef SDLGLFB Super; //[C]commented, DECLARE_CLASS defines this in linux typedef SDLGLFB Super; //[C]commented, DECLARE_CLASS defines this in linux
DECLARE_CLASS(OpenGLFrameBuffer, SDLGLFB)
#endif #endif

View File

@ -113,8 +113,6 @@ DFrameBuffer *CreateGLSWFrameBuffer(int width, int height, bool bgra, bool fulls
} }
#endif #endif
IMPLEMENT_CLASS(OpenGLSWFrameBuffer, false, false)
const char *const OpenGLSWFrameBuffer::ShaderDefines[OpenGLSWFrameBuffer::NUM_SHADERS] = const char *const OpenGLSWFrameBuffer::ShaderDefines[OpenGLSWFrameBuffer::NUM_SHADERS] =
{ {
"#define ENORMALCOLOR", // NormalColor "#define ENORMALCOLOR", // NormalColor

View File

@ -17,13 +17,11 @@ class FGLDebug;
class OpenGLSWFrameBuffer : public Win32GLFrameBuffer class OpenGLSWFrameBuffer : public Win32GLFrameBuffer
{ {
typedef Win32GLFrameBuffer Super; typedef Win32GLFrameBuffer Super;
DECLARE_CLASS(OpenGLSWFrameBuffer, Win32GLFrameBuffer)
#else #else
#include "sdlglvideo.h" #include "sdlglvideo.h"
class OpenGLSWFrameBuffer : public SDLGLFB class OpenGLSWFrameBuffer : public SDLGLFB
{ {
// typedef SDLGLFB Super; //[C]commented, DECLARE_CLASS defines this in linux typedef SDLGLFB Super; //[C]commented, DECLARE_CLASS defines this in linux
DECLARE_CLASS(OpenGLSWFrameBuffer, SDLGLFB)
#endif #endif

View File

@ -11022,11 +11022,6 @@ CCMD(acsprofile)
ShowProfileData(FuncProfiles, limit, sorter, true); ShowProfileData(FuncProfiles, limit, sorter, true);
} }
void MarkACSThinker()
{
GC::Mark(DACSThinker::ActiveThinker);
}
ADD_STAT(ACS) ADD_STAT(ACS)
{ {
return FStringf("ACS time: %f ms", ACSTime.TimeMS()); return FStringf("ACS time: %f ms", ACSTime.TimeMS());

View File

@ -632,7 +632,6 @@ DFrameBuffer* CocoaVideo::CreateFrameBuffer(const int width, const int height, c
} }
old->GetFlash(flashColor, flashAmount); old->GetFlash(flashColor, flashAmount);
old->ObjectFlags |= OF_YesReallyDelete;
if (old == screen) if (old == screen)
{ {
@ -1306,7 +1305,6 @@ void I_ShutdownGraphics()
{ {
if (NULL != screen) if (NULL != screen)
{ {
screen->ObjectFlags |= OF_YesReallyDelete;
delete screen; delete screen;
screen = NULL; screen = NULL;
} }

View File

@ -95,7 +95,6 @@ void I_ShutdownGraphics ()
{ {
DFrameBuffer *s = screen; DFrameBuffer *s = screen;
screen = NULL; screen = NULL;
s->ObjectFlags |= OF_YesReallyDelete;
delete s; delete s;
} }
if (Video) if (Video)

View File

@ -30,9 +30,6 @@
// TYPES ------------------------------------------------------------------- // TYPES -------------------------------------------------------------------
IMPLEMENT_CLASS(SDLBaseFB, true, false)
IMPLEMENT_CLASS(SDLGLFB, true, false)
struct MiniModeInfo struct MiniModeInfo
{ {
uint16_t Width, Height; uint16_t Width, Height;

View File

@ -37,7 +37,7 @@ private:
class SDLBaseFB : public DFrameBuffer class SDLBaseFB : public DFrameBuffer
{ {
DECLARE_CLASS(SDLBaseFB, DFrameBuffer) typedef DFrameBuffer Super;
public: public:
using DFrameBuffer::DFrameBuffer; using DFrameBuffer::DFrameBuffer;
virtual SDL_Window *GetSDLWindow() = 0; virtual SDL_Window *GetSDLWindow() = 0;
@ -47,7 +47,7 @@ public:
class SDLGLFB : public SDLBaseFB class SDLGLFB : public SDLBaseFB
{ {
DECLARE_CLASS(SDLGLFB, SDLBaseFB) typedef SDLBaseFB Super;
public: public:
// this must have the same parameters as the Windows version, even if they are not used! // 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); SDLGLFB (void *hMonitor, int width, int height, int, int, bool fullscreen, bool bgra);

View File

@ -24,8 +24,6 @@
// TYPES ------------------------------------------------------------------- // TYPES -------------------------------------------------------------------
IMPLEMENT_CLASS(SDLFB, false, false)
struct MiniModeInfo struct MiniModeInfo
{ {
uint16_t Width, Height; uint16_t Width, Height;

View File

@ -4,7 +4,7 @@
class SDLFB : public SDLBaseFB class SDLFB : public SDLBaseFB
{ {
DECLARE_CLASS(SDLFB, SDLBaseFB) typedef SDLBaseFB Super;
public: public:
SDLFB(int width, int height, bool bgra, bool fullscreen, SDL_Window *oldwin); SDLFB(int width, int height, bool bgra, bool fullscreen, SDL_Window *oldwin);
~SDLFB(); ~SDLFB();

View File

@ -206,7 +206,6 @@ void FSoftwareRenderer::WriteSavePic (player_t *player, FileWriter *file, int wi
PalEntry palette[256]; PalEntry palette[256];
// Take a snapshot of the player's view // Take a snapshot of the player's view
pic->ObjectFlags |= OF_Fixed;
pic->Lock (); pic->Lock ();
if (r_polyrenderer) if (r_polyrenderer)
{ {
@ -227,8 +226,6 @@ void FSoftwareRenderer::WriteSavePic (player_t *player, FileWriter *file, int wi
screen->GetFlashedPalette (palette); screen->GetFlashedPalette (palette);
M_CreatePNG (file, pic->GetBuffer(), palette, SS_PAL, width, height, pic->GetPitch()); M_CreatePNG (file, pic->GetBuffer(), palette, SS_PAL, width, height, pic->GetPitch());
pic->Unlock (); pic->Unlock ();
pic->Destroy();
pic->ObjectFlags |= OF_YesReallyDelete;
delete pic; delete pic;
} }

View File

@ -114,7 +114,6 @@ void FCanvasTexture::MakeTexture ()
{ {
Canvas = new DSimpleCanvas (Width, Height, false); Canvas = new DSimpleCanvas (Width, Height, false);
Canvas->Lock (); Canvas->Lock ();
GC::AddSoftRoot(Canvas);
if (Width != Height || Width != Canvas->GetPitch()) if (Width != Height || Width != Canvas->GetPitch())
{ {
@ -136,7 +135,6 @@ void FCanvasTexture::MakeTextureBgra()
{ {
CanvasBgra = new DSimpleCanvas(Width, Height, true); CanvasBgra = new DSimpleCanvas(Width, Height, true);
CanvasBgra->Lock(); CanvasBgra->Lock();
GC::AddSoftRoot(CanvasBgra);
if (Width != Height || Width != CanvasBgra->GetPitch()) if (Width != Height || Width != CanvasBgra->GetPitch())
{ {
@ -172,16 +170,12 @@ void FCanvasTexture::Unload ()
if (Canvas != NULL) if (Canvas != NULL)
{ {
GC::DelSoftRoot(Canvas); delete Canvas;
Canvas->Destroy();
Canvas = NULL;
} }
if (CanvasBgra != NULL) if (CanvasBgra != NULL)
{ {
GC::DelSoftRoot(CanvasBgra); delete CanvasBgra;
CanvasBgra->Destroy();
CanvasBgra = NULL;
} }
FTexture::Unload(); FTexture::Unload();

View File

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

View File

@ -198,9 +198,8 @@ struct VMVa_List
// //
// [RH] Made screens more implementation-independant: // [RH] Made screens more implementation-independant:
// //
class DCanvas : public DObject class DCanvas
{ {
DECLARE_ABSTRACT_CLASS (DCanvas, DObject)
public: public:
DCanvas (int width, int height, bool bgra); DCanvas (int width, int height, bool bgra);
virtual ~DCanvas (); virtual ~DCanvas ();
@ -317,7 +316,7 @@ private:
class DSimpleCanvas : public DCanvas class DSimpleCanvas : public DCanvas
{ {
DECLARE_CLASS (DSimpleCanvas, DCanvas) typedef DCanvas Super;
public: public:
DSimpleCanvas (int width, int height, bool bgra); DSimpleCanvas (int width, int height, bool bgra);
~DSimpleCanvas (); ~DSimpleCanvas ();
@ -357,7 +356,7 @@ public:
class DFrameBuffer : public DSimpleCanvas class DFrameBuffer : public DSimpleCanvas
{ {
DECLARE_ABSTRACT_CLASS (DFrameBuffer, DSimpleCanvas) typedef DSimpleCanvas Super;
public: public:
DFrameBuffer (int width, int height, bool bgra); DFrameBuffer (int width, int height, bool bgra);

View File

@ -92,8 +92,6 @@
// TYPES ------------------------------------------------------------------- // TYPES -------------------------------------------------------------------
IMPLEMENT_CLASS(D3DFB, false, false)
struct D3DFB::PackedTexture struct D3DFB::PackedTexture
{ {
D3DFB::Atlas *Owner; D3DFB::Atlas *Owner;

View File

@ -60,8 +60,6 @@
// TYPES ------------------------------------------------------------------- // TYPES -------------------------------------------------------------------
IMPLEMENT_CLASS(DDrawFB, false, false)
// EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- // EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
// PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- // PUBLIC FUNCTION PROTOTYPES ----------------------------------------------

View File

@ -142,7 +142,6 @@ void I_ShutdownGraphics ()
{ {
DFrameBuffer *s = screen; DFrameBuffer *s = screen;
screen = NULL; screen = NULL;
s->ObjectFlags |= OF_YesReallyDelete;
delete s; delete s;
} }
if (Video) if (Video)

View File

@ -945,8 +945,6 @@ bool Win32GLVideo::SetFullscreen(const char *devicename, int w, int h, int bits,
// //
//========================================================================== //==========================================================================
IMPLEMENT_CLASS(Win32GLFrameBuffer, true, false)
//========================================================================== //==========================================================================
// //
// //

View File

@ -27,7 +27,7 @@ FRenderer *gl_CreateInterface();
class Win32GLFrameBuffer : public BaseWinFB class Win32GLFrameBuffer : public BaseWinFB
{ {
DECLARE_CLASS(Win32GLFrameBuffer, BaseWinFB) typedef BaseWinFB Super;
public: public:
Win32GLFrameBuffer() {} Win32GLFrameBuffer() {}

View File

@ -103,7 +103,7 @@ class Win32Video : public IVideo
class BaseWinFB : public DFrameBuffer class BaseWinFB : public DFrameBuffer
{ {
DECLARE_ABSTRACT_CLASS(BaseWinFB, DFrameBuffer) typedef DFrameBuffer Super;
public: public:
BaseWinFB(int width, int height, bool bgra) : DFrameBuffer(width, height, bgra), Windowed(true) {} BaseWinFB(int width, int height, bool bgra) : DFrameBuffer(width, height, bgra), Windowed(true) {}

View File

@ -18,7 +18,7 @@ extern HANDLE FPSLimitEvent;
class DDrawFB : public BaseWinFB class DDrawFB : public BaseWinFB
{ {
DECLARE_CLASS(DDrawFB, BaseWinFB) typedef BaseWinFB Super;
public: public:
DDrawFB (int width, int height, bool fullscreen); DDrawFB (int width, int height, bool fullscreen);
~DDrawFB (); ~DDrawFB ();
@ -100,7 +100,7 @@ private:
class D3DFB : public BaseWinFB class D3DFB : public BaseWinFB
{ {
DECLARE_CLASS(D3DFB, BaseWinFB) typedef BaseWinFB Super;
public: public:
D3DFB (UINT adapter, int width, int height, bool bgra, bool fullscreen); D3DFB (UINT adapter, int width, int height, bool bgra, bool fullscreen);
~D3DFB (); ~D3DFB ();

View File

@ -80,8 +80,6 @@
// TYPES ------------------------------------------------------------------- // TYPES -------------------------------------------------------------------
IMPLEMENT_CLASS(BaseWinFB, true, false)
typedef IDirect3D9 *(WINAPI *DIRECT3DCREATE9FUNC)(UINT SDKVersion); typedef IDirect3D9 *(WINAPI *DIRECT3DCREATE9FUNC)(UINT SDKVersion);
typedef HRESULT (WINAPI *DIRECTDRAWCREATEFUNC)(GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter); 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; return old;
} }
old->GetFlash (flashColor, flashAmount); old->GetFlash (flashColor, flashAmount);
old->ObjectFlags |= OF_YesReallyDelete; if (old == screen) screen = nullptr;
if (old == screen) screen = NULL;
delete old; delete old;
} }
else else
@ -700,7 +697,6 @@ DFrameBuffer *Win32Video::CreateFrameBuffer (int width, int height, bool bgra, b
{ {
hr = fb->GetHR (); hr = fb->GetHR ();
} }
fb->ObjectFlags |= OF_YesReallyDelete;
delete fb; delete fb;
LOG1 ("fb is bad: %08lx\n", hr); LOG1 ("fb is bad: %08lx\n", hr);