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
+4 -4
View File
@@ -3651,7 +3651,7 @@ int daE_VA_c::CreateHeap() {
J3DModelData* modelData = (J3DModelData*)dComIfG_getObjectRes("E_VA", 0x33);
JUT_ASSERT(0, modelData != NULL);
mpMorf = new mDoExt_McaMorfSO(modelData, NULL, NULL,
mpMorf = JKR_NEW mDoExt_McaMorfSO(modelData, NULL, NULL,
(J3DAnmTransform*)dComIfG_getObjectRes("E_VA", 15), 0, 1.0f, 0,
-1, &mSound, 0x80000, 0x31000084);
if (mpMorf == NULL || mpMorf->getModel() == NULL) {
@@ -3679,7 +3679,7 @@ int daE_VA_c::CreateHeap() {
return 0;
}
mpWeaponBrk = new mDoExt_brkAnm();
mpWeaponBrk = JKR_NEW mDoExt_brkAnm();
if (mpWeaponBrk == NULL) {
return 0;
}
@@ -3694,7 +3694,7 @@ int daE_VA_c::CreateHeap() {
modelData = (J3DModelData*)dComIfG_getObjectRes("E_VA", 0x37);
JUT_ASSERT(0, modelData != NULL);
mpEndEfMorf = new mDoExt_McaMorfSO(modelData, NULL, NULL,
mpEndEfMorf = JKR_NEW mDoExt_McaMorfSO(modelData, NULL, NULL,
(J3DAnmTransform*)dComIfG_getObjectRes("E_VA", 7), 0, 1.0f,
0, -1, &mSound, 0x80000, 0x31000084);
if (mpEndEfMorf == NULL || mpEndEfMorf->getModel() == NULL) {
@@ -3710,7 +3710,7 @@ int daE_VA_c::CreateHeap() {
}
}
mpEndEfBrk = new mDoExt_brkAnm();
mpEndEfBrk = JKR_NEW mDoExt_brkAnm();
if (mpEndEfBrk == NULL) {
return 0;
}