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 "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)

View File

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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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());

View File

@ -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;
}

View File

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

View File

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

View File

@ -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);

View File

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

View File

@ -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();

View File

@ -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;
}

View File

@ -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();

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();

View File

@ -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);

View File

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

View File

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

View File

@ -142,7 +142,6 @@ void I_ShutdownGraphics ()
{
DFrameBuffer *s = screen;
screen = NULL;
s->ObjectFlags |= OF_YesReallyDelete;
delete s;
}
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
{
DECLARE_CLASS(Win32GLFrameBuffer, BaseWinFB)
typedef BaseWinFB Super;
public:
Win32GLFrameBuffer() {}

View File

@ -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) {}

View File

@ -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 ();

View File

@ -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);