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
@@ -148,21 +148,21 @@ int daObjVolcBom_c::CreateHeap() {
J3DAnmTevRegKey* pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 16);
JUT_ASSERT(403, pbrk != NULL);
mBrk1 = new mDoExt_brkAnm();
mBrk1 = JKR_NEW mDoExt_brkAnm();
if (mBrk1 == NULL || !mBrk1->init(modelData, pbrk, 1, 2, 1.0f, 0, -1)) {
return 0;
}
J3DAnmTextureSRTKey* pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 21);
JUT_ASSERT(416, pbtk != NULL);
mBtk1 = new mDoExt_btkAnm();
mBtk1 = JKR_NEW mDoExt_btkAnm();
if (mBtk1 == NULL || !mBtk1->init(modelData, pbtk, 1, 2, 1.0f, 0, -1)) {
return 0;
}
J3DAnmTransform* pbck = (J3DAnmTransform*)dComIfG_getObjectRes(l_arcName, 8);
JUT_ASSERT(428, pbck != NULL);
mBck1 = new mDoExt_bckAnm();
mBck1 = JKR_NEW mDoExt_bckAnm();
if (mBck1 == NULL || !mBck1->init(pbck, 1, 0, 1.0f, 0, -1, false)) {
return 0;
}
@@ -177,7 +177,7 @@ int daObjVolcBom_c::CreateHeap() {
pbrk = (J3DAnmTevRegKey*)dComIfG_getObjectRes(l_arcName, 15);
JUT_ASSERT(457, pbrk != NULL);
mBrk2 = new mDoExt_brkAnm();
mBrk2 = JKR_NEW mDoExt_brkAnm();
if (mBrk2 == NULL || !mBrk2->init(modelData, pbrk, 1, 0, 1.0f, 0, -1)) {
return 0;
}
@@ -185,7 +185,7 @@ int daObjVolcBom_c::CreateHeap() {
mBrk2->setPlaySpeed(0.0f);
pbtk = (J3DAnmTextureSRTKey*)dComIfG_getObjectRes(l_arcName, 19);
JUT_ASSERT(471, pbtk != NULL);
mBtk2 = new mDoExt_btkAnm();
mBtk2 = JKR_NEW mDoExt_btkAnm();
if (mBtk2 == NULL || !mBtk2->init(modelData, pbtk, 1, 2, 1.0f, 0, -1)) {
return 0;
}