mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-30 15:43:19 -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:
@@ -25,10 +25,10 @@ dFile_warning_c::dFile_warning_c(JKRArchive* i_archive, u8 param_1) {
|
||||
}
|
||||
|
||||
dFile_warning_c::~dFile_warning_c() {
|
||||
delete mFileWarn.mMsgString;
|
||||
delete mFileWarn.Scr;
|
||||
delete field_0x24;
|
||||
delete mpRootPane;
|
||||
JKR_DELETE(mFileWarn.mMsgString);
|
||||
JKR_DELETE(mFileWarn.Scr);
|
||||
JKR_DELETE(field_0x24);
|
||||
JKR_DELETE(mpRootPane);
|
||||
|
||||
mDoExt_removeMesgFont();
|
||||
}
|
||||
@@ -44,10 +44,10 @@ void dFile_warning_c::screenSet() {
|
||||
"zelda_option_set_up_window.bck",
|
||||
};
|
||||
|
||||
mFileWarn.Scr = new J2DScreen();
|
||||
mFileWarn.Scr = JKR_NEW J2DScreen();
|
||||
JUT_ASSERT(0, mFileWarn.Scr != NULL);
|
||||
|
||||
mFileWarn.mMsgString = new dMsgString_c();
|
||||
mFileWarn.mMsgString = JKR_NEW dMsgString_c();
|
||||
JUT_ASSERT(0, mFileWarn.mMsgString != NULL);
|
||||
|
||||
mFileWarn.Scr->setPriority(blo_name[field_0x3e], 0x100000, mpArchive);
|
||||
@@ -59,7 +59,7 @@ void dFile_warning_c::screenSet() {
|
||||
mFileWarn.Scr->animation();
|
||||
|
||||
mFileWarn.mFont = mDoExt_getMesgFont();
|
||||
mpRootPane = new CPaneMgr(mFileWarn.Scr, MULTI_CHAR('Nm_02'), 0, NULL);
|
||||
mpRootPane = JKR_NEW CPaneMgr(mFileWarn.Scr, MULTI_CHAR('Nm_02'), 0, NULL);
|
||||
JUT_ASSERT(0, mpRootPane != NULL);
|
||||
field_0x34 = mpRootPane->getTranslateY();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user