mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-02 02:30:22 -04:00
Isolate JKRHeap operator overloads
Fixes #25 This isolates the JKRHeap operator new/delete overloads. Every single new/delete site in the code has been replaced with a macro. Sadly for new[] and delete[] we have to keep global operators. The global new[] just allocates into malloc() however, and delete[] goes into free() if it's not in a JKRHeap. So that's fine.
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
#ifndef J2DANIMATION_H
|
||||
#define J2DANIMATION_H
|
||||
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "JSystem/JUtility/JUTPalette.h"
|
||||
|
||||
typedef struct _GXColor GXColor;
|
||||
typedef struct _GXColorS10 GXColorS10;
|
||||
class J2DScreen;
|
||||
class JUTPalette;
|
||||
struct ResTIMG;
|
||||
|
||||
enum J2DAnmKind {
|
||||
@@ -286,7 +287,7 @@ public:
|
||||
mPalette = NULL;
|
||||
}
|
||||
~J2DAnmTexPatternTIMGPointer() {
|
||||
delete mPalette;
|
||||
JKR_DELETE(mPalette);
|
||||
}
|
||||
|
||||
/* 0x0 */ ResTIMG* mRes;
|
||||
@@ -306,7 +307,7 @@ public:
|
||||
ResTIMG* getResTIMG(u16) const;
|
||||
JUTPalette* getPalette(u16) const;
|
||||
|
||||
virtual ~J2DAnmTexPattern() { delete[] mTIMGPtrArray; }
|
||||
virtual ~J2DAnmTexPattern() { JKR_DELETE_ARRAY(mTIMGPtrArray); }
|
||||
virtual void searchUpdateMaterialID(J2DScreen*);
|
||||
u16 getUpdateMaterialNum() const { return mUpdateMaterialNum; }
|
||||
u16 getUpdateMaterialID(u16 i) const {
|
||||
|
||||
Reference in New Issue
Block a user