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
+2 -2
View File
@@ -603,7 +603,7 @@ static int daNpc_Du_Delete(npc_du_class* i_this) {
static int useHeapInit(fopAc_ac_c* actor) {
npc_du_class* i_this = (npc_du_class*)actor;
i_this->mpMorf = new mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("Npc_Du", 0xA), NULL, NULL,
i_this->mpMorf = JKR_NEW mDoExt_McaMorf((J3DModelData*)dComIfG_getObjectRes("Npc_Du", 0xA), NULL, NULL,
(J3DAnmTransform*)dComIfG_getObjectRes("Npc_Du", 6), 0, 1.0f, 0, -1, 1, NULL,
J3DMdlFlag_DifferedDLBuffer, 0x11020084);
if (i_this->mpMorf == NULL || i_this->mpMorf->getModel() == NULL) {
@@ -616,7 +616,7 @@ static int useHeapInit(fopAc_ac_c* actor) {
model->getModelData()->getJointNodePointer(i)->setCallBack(nodeCallBack);
}
i_this->mpBtpAnm = new mDoExt_btpAnm();
i_this->mpBtpAnm = JKR_NEW mDoExt_btpAnm();
if (i_this->mpBtpAnm == NULL) {
return 0;
}