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:
PJB3005
2026-02-27 23:11:59 +01:00
parent 2204ad0813
commit 038ef4216f
634 changed files with 3451 additions and 3350 deletions
+5 -5
View File
@@ -174,7 +174,7 @@ int daE_PM_c::DemoSkipCallBack(void* i_this, int param_1) {
int daE_PM_c::CreateHeap() {
J3DModelData* model_data = (J3DModelData*)dComIfG_getObjectRes("E_PM", 0x1d);
mpMorf = new mDoExt_McaMorfSO(model_data, NULL, NULL,
mpMorf = JKR_NEW mDoExt_McaMorfSO(model_data, NULL, NULL,
(J3DAnmTransform*)dComIfG_getObjectRes("E_PM", 0x10),
J3DFrameCtrl::EMode_NONE, 1.0f, 0, -1,
&mCreatureSound, 0x80000, 0x11020084);
@@ -182,7 +182,7 @@ int daE_PM_c::CreateHeap() {
return 0;
}
mpEyeAnm = new mDoExt_btpAnm();
mpEyeAnm = JKR_NEW mDoExt_btpAnm();
if (mpEyeAnm == NULL) {
return 5;
}
@@ -198,7 +198,7 @@ int daE_PM_c::CreateHeap() {
return 0;
}
mpTrumpetMorf = new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("E_PM", 0x1f), NULL,
mpTrumpetMorf = JKR_NEW mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("E_PM", 0x1f), NULL,
NULL, (J3DAnmTransform*)dComIfG_getObjectRes("E_PM", 0x19),
J3DFrameCtrl::EMode_NONE, 0.0f, 0, -1, 1, NULL,
0x80000, 0x11000084);
@@ -206,7 +206,7 @@ int daE_PM_c::CreateHeap() {
return 0;
}
mpGlowEffectMorf = new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("E_PM", 0x1c), NULL,
mpGlowEffectMorf = JKR_NEW mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("E_PM", 0x1c), NULL,
NULL, (J3DAnmTransform*)dComIfG_getObjectRes("E_PM", 5),
J3DFrameCtrl::EMode_LOOP, 1.0f, 0, -1, 1, NULL,
0x80000, 0x11000084);
@@ -293,7 +293,7 @@ void daE_PM_c::SetAnm(int i_anm, int i_attr, f32 i_morf, f32 i_rate) {
}
static void dummy() {
delete (cM3dGPla*)NULL;
JKR_DELETE((cM3dGPla*)NULL);
}
static BOOL way_bg_check2(daE_PM_c* i_this, cXyz i_start, cXyz i_end) {