mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-31 08:51:29 -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:
@@ -443,10 +443,10 @@ void dMeterMap_c::_create(J2DScreen* unused) {
|
||||
mSizeW = (s16)sizeX;
|
||||
mSizeH = (s16)sizeY;
|
||||
|
||||
mMap = new dMap_c(sizeX, sizeY, dispSizeW, dispSizeH);
|
||||
mMap = JKR_NEW dMap_c(sizeX, sizeY, dispSizeW, dispSizeH);
|
||||
JUT_ASSERT(999, mMap != NULL);
|
||||
|
||||
mMapJ2DPicture = new J2DPicture(mMap->getResTIMGPointer());
|
||||
mMapJ2DPicture = JKR_NEW J2DPicture(mMap->getResTIMGPointer());
|
||||
JUT_ASSERT(1002, mMapJ2DPicture != NULL);
|
||||
|
||||
mIsCompass = dComIfGs_isDungeonItemCompass();
|
||||
@@ -497,11 +497,11 @@ void dMeterMap_c::setDispPosInSide() {
|
||||
|
||||
void dMeterMap_c::_delete() {
|
||||
if (mMapJ2DPicture != NULL) {
|
||||
delete mMapJ2DPicture;
|
||||
JKR_DELETE(mMapJ2DPicture);
|
||||
}
|
||||
|
||||
if (mMap != NULL) {
|
||||
delete mMap;
|
||||
JKR_DELETE(mMap);
|
||||
}
|
||||
|
||||
if (isEnableDispMapAndMapDispSizeTypeNo()) {
|
||||
|
||||
Reference in New Issue
Block a user