mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-26 06:16:24 -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:
+10
-10
@@ -5,13 +5,13 @@
|
||||
dJcame_c* dJcame_c::m_myObj;
|
||||
|
||||
dJcame_c::dJcame_c(const JStage::TSystem* i_system, f32 param_1, JUTGamePad& i_pad) {
|
||||
mOrthoGraph = new J2DOrthoGraph(0.0f, 0.0f, 608.0f, 448.0f, -1.0f, 1.0f);
|
||||
mFont = new JUTResFont((ResFONT*)JUTResFONT_Ascfont_fix12, NULL);
|
||||
mOrthoGraph = JKR_NEW J2DOrthoGraph(0.0f, 0.0f, 608.0f, 448.0f, -1.0f, 1.0f);
|
||||
mFont = JKR_NEW JUTResFont((ResFONT*)JUTResFONT_Ascfont_fix12, NULL);
|
||||
|
||||
mHeap = JKRExpHeap::create(0x100000, JKRHeap::getRootHeap2(), false);
|
||||
JUT_ASSERT(54, mHeap != NULL);
|
||||
|
||||
mControl = new JStudioCameraEditor::TControl();
|
||||
mControl = JKR_NEW JStudioCameraEditor::TControl();
|
||||
mHioId = mDoHIO_createChild("JStudioCameraEditor", mControl);
|
||||
JUT_ASSERT(57, mControl != NULL);
|
||||
|
||||
@@ -29,29 +29,29 @@ dJcame_c::dJcame_c(const JStage::TSystem* i_system, f32 param_1, JUTGamePad& i_p
|
||||
|
||||
dJcame_c::~dJcame_c() {
|
||||
if (mAdaptor != NULL) {
|
||||
delete mAdaptor;
|
||||
JKR_DELETE(mAdaptor);
|
||||
}
|
||||
|
||||
mControl->jstudio_setAdaptor(NULL);
|
||||
mDoHIO_deleteChild(mHioId);
|
||||
|
||||
delete mControl;
|
||||
JKR_DELETE(mControl);
|
||||
mHeap->destroy();
|
||||
delete mFont;
|
||||
delete mOrthoGraph;
|
||||
JKR_DELETE(mFont);
|
||||
JKR_DELETE(mOrthoGraph);
|
||||
|
||||
m_myObj = NULL;
|
||||
}
|
||||
|
||||
void dJcame_c::create(const JStage::TSystem* i_system, f32 param_1, JUTGamePad& i_pad) {
|
||||
JUT_ASSERT(109, m_myObj == NULL);
|
||||
new dJcame_c(i_system, param_1, i_pad);
|
||||
JKR_NEW dJcame_c(i_system, param_1, i_pad);
|
||||
JUT_ASSERT(111, m_myObj != NULL);
|
||||
}
|
||||
|
||||
void dJcame_c::remove() {
|
||||
JUT_ASSERT(126, m_myObj != NULL);
|
||||
delete m_myObj;
|
||||
JKR_DELETE(m_myObj);
|
||||
}
|
||||
|
||||
void dJcame_c::update() {
|
||||
@@ -63,7 +63,7 @@ void dJcame_c::update() {
|
||||
return;
|
||||
}
|
||||
|
||||
mAdaptor = new JStudio_JStage::TAdaptor_camera(mSystem, (JStage::TCamera*)object);
|
||||
mAdaptor = JKR_NEW JStudio_JStage::TAdaptor_camera(mSystem, (JStage::TCamera*)object);
|
||||
JUT_ASSERT(155, mAdaptor != NULL);
|
||||
|
||||
mControl->jstudio_setAdaptor(mAdaptor);
|
||||
|
||||
Reference in New Issue
Block a user