diff --git a/src/dobjgc.cpp b/src/dobjgc.cpp index 5779b3903c..03a7153291 100644 --- a/src/dobjgc.cpp +++ b/src/dobjgc.cpp @@ -79,8 +79,6 @@ #include "g_levellocals.h" #include "events.h" -void MarkACSThinker(); - // MACROS ------------------------------------------------------------------ /* @@ -326,13 +324,11 @@ static void MarkRoot() Gray = NULL; Mark(Args); - Mark(screen); Mark(StatusBar); M_MarkMenus(); Mark(DIntermissionController::CurrentIntermission); DThinker::MarkRoots(); FCanvasTextureInfo::Mark(); - MarkACSThinker(); Mark(E_FirstEventHandler); Mark(E_LastEventHandler); for (auto &s : level.sectorPortals) diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 62a810969a..3d27b3a0dd 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -242,7 +242,6 @@ void PClass::StaticShutdown () { if (WP_NOCHANGE != nullptr) { - WP_NOCHANGE->ObjectFlags |= OF_YesReallyDelete; delete WP_NOCHANGE; } diff --git a/src/gl/system/gl_framebuffer.cpp b/src/gl/system/gl_framebuffer.cpp index cef60ed7ab..24e6ee6264 100644 --- a/src/gl/system/gl_framebuffer.cpp +++ b/src/gl/system/gl_framebuffer.cpp @@ -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) diff --git a/src/gl/system/gl_framebuffer.h b/src/gl/system/gl_framebuffer.h index 72bdb73158..0d88667ca9 100644 --- a/src/gl/system/gl_framebuffer.h +++ b/src/gl/system/gl_framebuffer.h @@ -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 diff --git a/src/gl/system/gl_swframebuffer.cpp b/src/gl/system/gl_swframebuffer.cpp index 4a97eb95be..7b9e54cfbd 100644 --- a/src/gl/system/gl_swframebuffer.cpp +++ b/src/gl/system/gl_swframebuffer.cpp @@ -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 diff --git a/src/gl/system/gl_swframebuffer.h b/src/gl/system/gl_swframebuffer.h index 0f9c0a0efb..dcb67e138d 100644 --- a/src/gl/system/gl_swframebuffer.h +++ b/src/gl/system/gl_swframebuffer.h @@ -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 diff --git a/src/p_acs.cpp b/src/p_acs.cpp index b510ee45fe..dd75f90697 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -11022,11 +11022,6 @@ CCMD(acsprofile) ShowProfileData(FuncProfiles, limit, sorter, true); } -void MarkACSThinker() -{ - GC::Mark(DACSThinker::ActiveThinker); -} - ADD_STAT(ACS) { return FStringf("ACS time: %f ms", ACSTime.TimeMS()); diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index fd09c88f82..298aee3a30 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -632,7 +632,6 @@ DFrameBuffer* CocoaVideo::CreateFrameBuffer(const int width, const int height, c } old->GetFlash(flashColor, flashAmount); - old->ObjectFlags |= OF_YesReallyDelete; if (old == screen) { @@ -1306,7 +1305,6 @@ void I_ShutdownGraphics() { if (NULL != screen) { - screen->ObjectFlags |= OF_YesReallyDelete; delete screen; screen = NULL; } diff --git a/src/posix/sdl/hardware.cpp b/src/posix/sdl/hardware.cpp index 88870cb52d..7c9f66d832 100644 --- a/src/posix/sdl/hardware.cpp +++ b/src/posix/sdl/hardware.cpp @@ -95,7 +95,6 @@ void I_ShutdownGraphics () { DFrameBuffer *s = screen; screen = NULL; - s->ObjectFlags |= OF_YesReallyDelete; delete s; } if (Video) diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp index 1e602f102e..196f2034b0 100644 --- a/src/posix/sdl/sdlglvideo.cpp +++ b/src/posix/sdl/sdlglvideo.cpp @@ -30,9 +30,6 @@ // TYPES ------------------------------------------------------------------- -IMPLEMENT_CLASS(SDLBaseFB, true, false) -IMPLEMENT_CLASS(SDLGLFB, true, false) - struct MiniModeInfo { uint16_t Width, Height; diff --git a/src/posix/sdl/sdlglvideo.h b/src/posix/sdl/sdlglvideo.h index de37abbf4b..69472c8484 100644 --- a/src/posix/sdl/sdlglvideo.h +++ b/src/posix/sdl/sdlglvideo.h @@ -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); diff --git a/src/posix/sdl/sdlvideo.cpp b/src/posix/sdl/sdlvideo.cpp index 030129fc00..4c830fe6cf 100644 --- a/src/posix/sdl/sdlvideo.cpp +++ b/src/posix/sdl/sdlvideo.cpp @@ -24,8 +24,6 @@ // TYPES ------------------------------------------------------------------- -IMPLEMENT_CLASS(SDLFB, false, false) - struct MiniModeInfo { uint16_t Width, Height; diff --git a/src/posix/sdl/sdlvideo.h b/src/posix/sdl/sdlvideo.h index 001d6c0880..31a168aa64 100644 --- a/src/posix/sdl/sdlvideo.h +++ b/src/posix/sdl/sdlvideo.h @@ -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(); diff --git a/src/swrenderer/r_swrenderer.cpp b/src/swrenderer/r_swrenderer.cpp index 9f6da2a149..de1172740d 100644 --- a/src/swrenderer/r_swrenderer.cpp +++ b/src/swrenderer/r_swrenderer.cpp @@ -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; } diff --git a/src/textures/canvastexture.cpp b/src/textures/canvastexture.cpp index ed72b0eee3..eba5d2feac 100644 --- a/src/textures/canvastexture.cpp +++ b/src/textures/canvastexture.cpp @@ -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(); diff --git a/src/v_video.cpp b/src/v_video.cpp index 96b45fad66..49cf088ea8 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -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(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(); diff --git a/src/v_video.h b/src/v_video.h index 56cb3ee0db..c4f9bdb954 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -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); diff --git a/src/win32/fb_d3d9.cpp b/src/win32/fb_d3d9.cpp index 85331a3473..188d2530e4 100644 --- a/src/win32/fb_d3d9.cpp +++ b/src/win32/fb_d3d9.cpp @@ -92,8 +92,6 @@ // TYPES ------------------------------------------------------------------- -IMPLEMENT_CLASS(D3DFB, false, false) - struct D3DFB::PackedTexture { D3DFB::Atlas *Owner; diff --git a/src/win32/fb_ddraw.cpp b/src/win32/fb_ddraw.cpp index b7f314608f..729bbaa916 100644 --- a/src/win32/fb_ddraw.cpp +++ b/src/win32/fb_ddraw.cpp @@ -60,8 +60,6 @@ // TYPES ------------------------------------------------------------------- -IMPLEMENT_CLASS(DDrawFB, false, false) - // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- // PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- diff --git a/src/win32/hardware.cpp b/src/win32/hardware.cpp index 70e622b391..fa5e82e528 100644 --- a/src/win32/hardware.cpp +++ b/src/win32/hardware.cpp @@ -142,7 +142,6 @@ void I_ShutdownGraphics () { DFrameBuffer *s = screen; screen = NULL; - s->ObjectFlags |= OF_YesReallyDelete; delete s; } if (Video) diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index 2074a17d8b..96c1510df4 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -945,8 +945,6 @@ bool Win32GLVideo::SetFullscreen(const char *devicename, int w, int h, int bits, // //========================================================================== -IMPLEMENT_CLASS(Win32GLFrameBuffer, true, false) - //========================================================================== // // diff --git a/src/win32/win32gliface.h b/src/win32/win32gliface.h index ca949c864f..09e9e56420 100644 --- a/src/win32/win32gliface.h +++ b/src/win32/win32gliface.h @@ -27,7 +27,7 @@ FRenderer *gl_CreateInterface(); class Win32GLFrameBuffer : public BaseWinFB { - DECLARE_CLASS(Win32GLFrameBuffer, BaseWinFB) + typedef BaseWinFB Super; public: Win32GLFrameBuffer() {} diff --git a/src/win32/win32iface.h b/src/win32/win32iface.h index 8e7768b64f..7ea1901352 100644 --- a/src/win32/win32iface.h +++ b/src/win32/win32iface.h @@ -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) {} diff --git a/src/win32/win32swiface.h b/src/win32/win32swiface.h index 5c0a456e46..59101c6023 100644 --- a/src/win32/win32swiface.h +++ b/src/win32/win32swiface.h @@ -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 (); diff --git a/src/win32/win32video.cpp b/src/win32/win32video.cpp index f734ac7891..0ef2781059 100644 --- a/src/win32/win32video.cpp +++ b/src/win32/win32video.cpp @@ -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);