mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-28 15:07:04 -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:
@@ -13,7 +13,7 @@
|
||||
|
||||
dBrightCheck_c::dBrightCheck_c(JKRArchive* i_archive) {
|
||||
mArchive = i_archive;
|
||||
mBrightCheck.mMsgString = new dMsgString_c();
|
||||
mBrightCheck.mMsgString = JKR_NEW dMsgString_c();
|
||||
JUT_ASSERT(0, mBrightCheck.mMsgString != NULL);
|
||||
|
||||
screenSet();
|
||||
@@ -22,8 +22,8 @@ dBrightCheck_c::dBrightCheck_c(JKRArchive* i_archive) {
|
||||
}
|
||||
|
||||
dBrightCheck_c::~dBrightCheck_c() {
|
||||
delete mBrightCheck.Scr;
|
||||
delete mBrightCheck.mMsgString;
|
||||
JKR_DELETE(mBrightCheck.Scr);
|
||||
JKR_DELETE(mBrightCheck.mMsgString);
|
||||
}
|
||||
|
||||
void dBrightCheck_c::screenSet() {
|
||||
@@ -57,7 +57,7 @@ void dBrightCheck_c::screenSet() {
|
||||
};
|
||||
#endif
|
||||
|
||||
mBrightCheck.Scr = new J2DScreen();
|
||||
mBrightCheck.Scr = JKR_NEW J2DScreen();
|
||||
JUT_ASSERT(0, mBrightCheck.Scr != NULL);
|
||||
mBrightCheck.Scr->setPriority("zelda_option_check.blo", 0x1100000, mArchive);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user