mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-10 10:43:41 -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:
@@ -12,28 +12,28 @@ dKantera_icon_c::dKantera_icon_c() {
|
||||
}
|
||||
|
||||
dKantera_icon_c::~dKantera_icon_c() {
|
||||
delete mpKanteraIcon->getScreen();
|
||||
delete mpKanteraIcon;
|
||||
JKR_DELETE(mpKanteraIcon->getScreen());
|
||||
JKR_DELETE(mpKanteraIcon);
|
||||
mpKanteraIcon = NULL;
|
||||
|
||||
delete mpParent;
|
||||
JKR_DELETE(mpParent);
|
||||
mpParent = NULL;
|
||||
|
||||
delete mpGauge;
|
||||
JKR_DELETE(mpGauge);
|
||||
mpGauge = NULL;
|
||||
}
|
||||
|
||||
void dKantera_icon_c::initiate() {
|
||||
mpKanteraIcon = new dDlst_KanteraIcon_c();
|
||||
mpKanteraIcon = JKR_NEW dDlst_KanteraIcon_c();
|
||||
|
||||
J2DScreen* scrn = new J2DScreen();
|
||||
J2DScreen* scrn = JKR_NEW J2DScreen();
|
||||
scrn->setPriority("zelda_kantera_icon_mater.blo", 0x20000, dComIfGp_getMain2DArchive());
|
||||
dPaneClass_showNullPane(scrn);
|
||||
mpKanteraIcon->setScreen(scrn);
|
||||
|
||||
mpParent = new CPaneMgr(scrn, MULTI_CHAR('kan_m_n'), 2, NULL);
|
||||
mpParent = JKR_NEW CPaneMgr(scrn, MULTI_CHAR('kan_m_n'), 2, NULL);
|
||||
|
||||
mpGauge = new CPaneMgr(scrn, MULTI_CHAR('yellow_m'), 0, NULL);
|
||||
mpGauge = JKR_NEW CPaneMgr(scrn, MULTI_CHAR('yellow_m'), 0, NULL);
|
||||
}
|
||||
|
||||
void dKantera_icon_c::setAlphaRate(f32 alphaRate) {
|
||||
|
||||
Reference in New Issue
Block a user