mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-17 20:43:07 -04:00
Revert "Isolate JKRHeap operator overloads" (#39)
This commit is contained in:
@@ -585,8 +585,8 @@ void J2DAnmTexPattern::searchUpdateMaterialID(J2DScreen* pScreen) {
|
||||
mUpdateMaterialID[entry] = 0xFFFF;
|
||||
}
|
||||
}
|
||||
JKR_DELETE_ARRAY(mTIMGPtrArray);
|
||||
mTIMGPtrArray = JKR_NEW J2DAnmTexPatternTIMGPointer[pScreen->mTexRes->mCount];
|
||||
delete[] mTIMGPtrArray;
|
||||
mTIMGPtrArray = new J2DAnmTexPatternTIMGPointer[pScreen->mTexRes->mCount];
|
||||
if (mTIMGPtrArray != NULL) {
|
||||
JUTResReference resRef;
|
||||
for (u16 i = 0; i < pScreen->mTexRes->mCount; i++) {
|
||||
@@ -601,7 +601,7 @@ void J2DAnmTexPattern::searchUpdateMaterialID(J2DScreen* pScreen) {
|
||||
}
|
||||
mTIMGPtrArray[i].mRes = var2;
|
||||
if (var2 != NULL && var2->indexTexture) {
|
||||
mTIMGPtrArray[i].mPalette = JKR_NEW JUTPalette(
|
||||
mTIMGPtrArray[i].mPalette = new JUTPalette(
|
||||
GX_TLUT0,
|
||||
GXTlutFmt(var2->colorFormat),
|
||||
JUTTransparency(var2->alphaEnabled),
|
||||
|
||||
@@ -18,13 +18,13 @@ J2DAnmBase* J2DAnmLoaderDataBase::load(void const* p_data) {
|
||||
switch (hdr->mType) {
|
||||
case 'bck1': {
|
||||
J2DAnmKeyLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmTransformKey();
|
||||
loader.mpResource = new J2DAnmTransformKey();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
break;
|
||||
}
|
||||
case 'bpk1': {
|
||||
J2DAnmKeyLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmColorKey();
|
||||
loader.mpResource = new J2DAnmColorKey();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
break;
|
||||
}
|
||||
@@ -33,42 +33,42 @@ J2DAnmBase* J2DAnmLoaderDataBase::load(void const* p_data) {
|
||||
return NULL;
|
||||
case 'btk1': {
|
||||
J2DAnmKeyLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmTextureSRTKey();
|
||||
loader.mpResource = new J2DAnmTextureSRTKey();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
break;
|
||||
}
|
||||
case 'brk1': {
|
||||
J2DAnmKeyLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmTevRegKey();
|
||||
loader.mpResource = new J2DAnmTevRegKey();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
break;
|
||||
}
|
||||
case 'bxk1': {
|
||||
J2DAnmKeyLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmVtxColorKey();
|
||||
loader.mpResource = new J2DAnmVtxColorKey();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
break;
|
||||
}
|
||||
case 'bca1': {
|
||||
J2DAnmFullLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmTransformFull();
|
||||
loader.mpResource = new J2DAnmTransformFull();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
break;
|
||||
}
|
||||
case 'bpa1': {
|
||||
J2DAnmFullLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmColorFull();
|
||||
loader.mpResource = new J2DAnmColorFull();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
break;
|
||||
}
|
||||
case 'btp1': {
|
||||
J2DAnmFullLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmTexPattern();
|
||||
loader.mpResource = new J2DAnmTexPattern();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
}
|
||||
case 'bva1': {
|
||||
J2DAnmFullLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmVisibilityFull();
|
||||
loader.mpResource = new J2DAnmVisibilityFull();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
break;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ J2DAnmBase* J2DAnmLoaderDataBase::load(void const* p_data) {
|
||||
return NULL;
|
||||
case 'bxa1': {
|
||||
J2DAnmFullLoader_v15 loader;
|
||||
loader.mpResource = JKR_NEW J2DAnmVtxColorFull();
|
||||
loader.mpResource = new J2DAnmVtxColorFull();
|
||||
return (J2DAnmBase*)loader.load(p_data);
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#include "JSystem/JUtility/JUTTexture.h"
|
||||
#include <gx.h>
|
||||
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
void J2DColorBlock::initialize() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
mMatColor[i] = JUtility::TColor(j2dDefaultColInfo);
|
||||
@@ -58,7 +56,7 @@ void J2DTexGenBlock::setGX() {
|
||||
|
||||
J2DTexGenBlock::~J2DTexGenBlock() {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
JKR_DELETE(mTexMtx[i]);
|
||||
delete mTexMtx[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +64,7 @@ void J2DTexGenBlock::setTexMtx(u32 param_0, J2DTexMtx& param_1) {
|
||||
J3D_PANIC(103, param_0 < 8, "Error : range over.");
|
||||
|
||||
if (!mTexMtx[param_0]) {
|
||||
mTexMtx[param_0] = JKR_NEW J2DTexMtx(param_1.getTexMtxInfo());
|
||||
mTexMtx[param_0] = new J2DTexMtx(param_1.getTexMtxInfo());
|
||||
if (!mTexMtx[param_0]) {
|
||||
return;
|
||||
}
|
||||
@@ -103,13 +101,13 @@ J2DTevBlock1::J2DTevBlock1() {
|
||||
|
||||
J2DTevBlock1::~J2DTevBlock1() {
|
||||
if (mUndeleteFlag & 1) {
|
||||
JKR_DELETE(mTexture[0]);
|
||||
delete mTexture[0];
|
||||
}
|
||||
|
||||
JKR_DELETE(mPalette[0]);
|
||||
delete mPalette[0];
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +139,7 @@ bool J2DTevBlock1::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
mTexture[0] = JKR_NEW JUTTexture();
|
||||
mTexture[0] = new JUTTexture();
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
return false;
|
||||
@@ -168,7 +166,7 @@ bool J2DTevBlock1::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
}
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
mTexture[0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
mTexture[0] = new JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
return false;
|
||||
@@ -199,7 +197,7 @@ bool J2DTevBlock1::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 1) {
|
||||
JKR_DELETE(mTexture[0]);
|
||||
delete mTexture[0];
|
||||
}
|
||||
|
||||
mTexture[0] = p_tex;
|
||||
@@ -216,7 +214,7 @@ bool J2DTevBlock1::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
mTexture[0] = new JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
return false;
|
||||
@@ -230,7 +228,7 @@ bool J2DTevBlock1::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[0]->storeTIMG(p_timg, (u8)0);
|
||||
} else {
|
||||
JKR_DELETE(mTexture[0]);
|
||||
delete mTexture[0];
|
||||
mTexture[0] = NULL;
|
||||
mUndeleteFlag &= 0x80;
|
||||
}
|
||||
@@ -238,7 +236,7 @@ bool J2DTevBlock1::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
mTexture[0] = new JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
return false;
|
||||
@@ -248,7 +246,7 @@ bool J2DTevBlock1::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
JKR_DELETE(mPalette[0]);
|
||||
delete mPalette[0];
|
||||
mPalette[0] = NULL;
|
||||
mTexNo[0] = -1;
|
||||
return true;
|
||||
@@ -260,12 +258,12 @@ bool J2DTevBlock1::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 1) {
|
||||
JKR_DELETE(mTexture[0]);
|
||||
delete mTexture[0];
|
||||
}
|
||||
|
||||
mTexture[0] = p_tex;
|
||||
mUndeleteFlag &= 0x80;
|
||||
JKR_DELETE(mPalette[0]);
|
||||
delete mPalette[0];
|
||||
mPalette[0] = NULL;
|
||||
mTexNo[0] = -1;
|
||||
return true;
|
||||
@@ -277,12 +275,12 @@ bool J2DTevBlock1::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 1) {
|
||||
JKR_DELETE(mTexture[0]);
|
||||
delete mTexture[0];
|
||||
}
|
||||
|
||||
mTexture[0] = NULL;
|
||||
mUndeleteFlag &= 0x80;
|
||||
JKR_DELETE(mPalette[0]);
|
||||
delete mPalette[0];
|
||||
mTexNo[0] = -1;
|
||||
return true;
|
||||
}
|
||||
@@ -292,13 +290,13 @@ bool J2DTevBlock1::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -312,7 +310,7 @@ bool J2DTevBlock1::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -327,7 +325,7 @@ bool J2DTevBlock1::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[0] == NULL) {
|
||||
mPalette[0] = JKR_NEW JUTPalette(GX_TLUT0, (ResTLUT*)p_tlut);
|
||||
mPalette[0] = new JUTPalette(GX_TLUT0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[0] == NULL) {
|
||||
return false;
|
||||
@@ -340,7 +338,7 @@ bool J2DTevBlock1::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[0]->attachPalette(mPalette[0]);
|
||||
}
|
||||
} else {
|
||||
JKR_DELETE(mPalette[0]);
|
||||
delete mPalette[0];
|
||||
mPalette[0] = NULL;
|
||||
}
|
||||
|
||||
@@ -405,18 +403,18 @@ J2DTevBlock2::J2DTevBlock2() {
|
||||
|
||||
J2DTevBlock2::~J2DTevBlock2() {
|
||||
if (mUndeleteFlag & 1) {
|
||||
JKR_DELETE(mTexture[0]);
|
||||
delete mTexture[0];
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 2) {
|
||||
JKR_DELETE(mTexture[1]);
|
||||
delete mTexture[1];
|
||||
}
|
||||
|
||||
JKR_DELETE(mPalette[0]);
|
||||
JKR_DELETE(mPalette[1]);
|
||||
delete mPalette[0];
|
||||
delete mPalette[1];
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,7 +454,7 @@ bool J2DTevBlock2::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
mTexture[i] = JKR_NEW JUTTexture();
|
||||
mTexture[i] = new JUTTexture();
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
return false;
|
||||
@@ -501,7 +499,7 @@ bool J2DTevBlock2::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
|
||||
JUTTexture* tex;
|
||||
if (mTexture[texNo] == NULL) {
|
||||
tex = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
tex = new JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (tex == NULL) {
|
||||
return false;
|
||||
@@ -577,7 +575,7 @@ bool J2DTevBlock2::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
|
||||
if (mTexture[1] != NULL && mTexture[1]->getTexInfo() == NULL) {
|
||||
if (mUndeleteFlag & 2) {
|
||||
JKR_DELETE(mTexture[1]);
|
||||
delete mTexture[1];
|
||||
}
|
||||
|
||||
mUndeleteFlag &= ~2;
|
||||
@@ -619,7 +617,7 @@ bool J2DTevBlock2::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
mTexture[param_0] = new JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -633,7 +631,7 @@ bool J2DTevBlock2::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0]->storeTIMG(p_timg, tlutid);
|
||||
} else {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
mTexture[param_0] = NULL;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
}
|
||||
@@ -641,7 +639,7 @@ bool J2DTevBlock2::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[param_0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
mTexture[param_0] = new JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -651,7 +649,7 @@ bool J2DTevBlock2::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -663,12 +661,12 @@ bool J2DTevBlock2::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
}
|
||||
|
||||
mTexture[param_0] = p_tex;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -680,9 +678,9 @@ bool J2DTevBlock2::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
}
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
|
||||
if (param_0 == 0) {
|
||||
mTexture[0] = mTexture[1];
|
||||
@@ -702,13 +700,13 @@ bool J2DTevBlock2::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -722,7 +720,7 @@ bool J2DTevBlock2::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -737,7 +735,7 @@ bool J2DTevBlock2::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[param_0] == NULL) {
|
||||
mPalette[param_0] = JKR_NEW JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
mPalette[param_0] = new JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -750,7 +748,7 @@ bool J2DTevBlock2::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[param_0]->attachPalette(mPalette[param_0]);
|
||||
}
|
||||
} else {
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
}
|
||||
|
||||
@@ -843,13 +841,13 @@ J2DTevBlock4::J2DTevBlock4() {
|
||||
J2DTevBlock4::~J2DTevBlock4() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (mUndeleteFlag & (1 << i)) {
|
||||
JKR_DELETE(mTexture[i]);
|
||||
delete mTexture[i];
|
||||
}
|
||||
JKR_DELETE(mPalette[i]);
|
||||
delete mPalette[i];
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -894,7 +892,7 @@ bool J2DTevBlock4::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
mTexture[i] = JKR_NEW JUTTexture();
|
||||
mTexture[i] = new JUTTexture();
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
return false;
|
||||
@@ -951,7 +949,7 @@ bool J2DTevBlock4::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
}
|
||||
JUTTexture* texture;
|
||||
if (!mTexture[idx]) {
|
||||
texture = JKR_NEW JUTTexture(p_timg, local_43);
|
||||
texture = new JUTTexture(p_timg, local_43);
|
||||
if (!texture) {
|
||||
return false;
|
||||
}
|
||||
@@ -1019,7 +1017,7 @@ bool J2DTevBlock4::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
|
||||
if (mTexture[3] != NULL && mTexture[3]->getTexInfo() == NULL) {
|
||||
if (mUndeleteFlag & 8) {
|
||||
JKR_DELETE(mTexture[3]);
|
||||
delete mTexture[3];
|
||||
}
|
||||
|
||||
mUndeleteFlag &= ~8;
|
||||
@@ -1071,7 +1069,7 @@ bool J2DTevBlock4::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
mTexture[param_0] = new JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1085,7 +1083,7 @@ bool J2DTevBlock4::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0]->storeTIMG(p_timg, tlutid);
|
||||
} else {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
mTexture[param_0] = NULL;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
}
|
||||
@@ -1093,7 +1091,7 @@ bool J2DTevBlock4::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[param_0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
mTexture[param_0] = new JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1103,7 +1101,7 @@ bool J2DTevBlock4::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -1115,12 +1113,12 @@ bool J2DTevBlock4::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
}
|
||||
|
||||
mTexture[param_0] = p_tex;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -1132,9 +1130,9 @@ bool J2DTevBlock4::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
}
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
|
||||
for (u32 i = param_0; i < 3; i++) {
|
||||
mTexture[i] = mTexture[i + 1];
|
||||
@@ -1154,13 +1152,13 @@ bool J2DTevBlock4::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -1174,7 +1172,7 @@ bool J2DTevBlock4::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -1189,7 +1187,7 @@ bool J2DTevBlock4::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[param_0] == NULL) {
|
||||
mPalette[param_0] = JKR_NEW JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
mPalette[param_0] = new JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1202,7 +1200,7 @@ bool J2DTevBlock4::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[param_0]->attachPalette(mPalette[param_0]);
|
||||
}
|
||||
} else {
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
}
|
||||
|
||||
@@ -1287,13 +1285,13 @@ J2DTevBlock8::J2DTevBlock8() {
|
||||
J2DTevBlock8::~J2DTevBlock8() {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (mUndeleteFlag & (1 << i)) {
|
||||
JKR_DELETE(mTexture[i]);
|
||||
delete mTexture[i];
|
||||
}
|
||||
JKR_DELETE(mPalette[i]);
|
||||
delete mPalette[i];
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1339,7 +1337,7 @@ bool J2DTevBlock8::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
mTexture[i] = JKR_NEW JUTTexture();
|
||||
mTexture[i] = new JUTTexture();
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
return false;
|
||||
@@ -1396,7 +1394,7 @@ bool J2DTevBlock8::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
}
|
||||
JUTTexture* texture;
|
||||
if (!mTexture[idx]) {
|
||||
texture = JKR_NEW JUTTexture(p_timg, local_43);
|
||||
texture = new JUTTexture(p_timg, local_43);
|
||||
if (!texture) {
|
||||
return false;
|
||||
}
|
||||
@@ -1464,7 +1462,7 @@ bool J2DTevBlock8::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
|
||||
if (mTexture[7] != NULL && mTexture[7]->getTexInfo() == NULL) {
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mTexture[7]);
|
||||
delete mTexture[7];
|
||||
}
|
||||
|
||||
mUndeleteFlag &= ~0x80;
|
||||
@@ -1516,7 +1514,7 @@ bool J2DTevBlock8::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
mTexture[param_0] = new JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1530,7 +1528,7 @@ bool J2DTevBlock8::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0]->storeTIMG(p_timg, tlutid);
|
||||
} else {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
mTexture[param_0] = NULL;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
}
|
||||
@@ -1538,7 +1536,7 @@ bool J2DTevBlock8::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[param_0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
mTexture[param_0] = new JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1548,7 +1546,7 @@ bool J2DTevBlock8::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -1560,12 +1558,12 @@ bool J2DTevBlock8::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
}
|
||||
|
||||
mTexture[param_0] = p_tex;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -1577,9 +1575,9 @@ bool J2DTevBlock8::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
}
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
|
||||
for (u32 i = param_0; i < 7; i++) {
|
||||
mTexture[i] = mTexture[i + 1];
|
||||
@@ -1599,13 +1597,13 @@ bool J2DTevBlock8::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -1619,7 +1617,7 @@ bool J2DTevBlock8::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -1634,7 +1632,7 @@ bool J2DTevBlock8::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[param_0] == NULL) {
|
||||
mPalette[param_0] = JKR_NEW JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
mPalette[param_0] = new JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1647,7 +1645,7 @@ bool J2DTevBlock8::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[param_0]->attachPalette(mPalette[param_0]);
|
||||
}
|
||||
} else {
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
}
|
||||
|
||||
@@ -1727,13 +1725,13 @@ J2DTevBlock16::J2DTevBlock16() {
|
||||
J2DTevBlock16::~J2DTevBlock16() {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (mUndeleteFlag & (1 << i)) {
|
||||
JKR_DELETE(mTexture[i]);
|
||||
delete mTexture[i];
|
||||
}
|
||||
JKR_DELETE(mPalette[i]);
|
||||
delete mPalette[i];
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1779,7 +1777,7 @@ bool J2DTevBlock16::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
mTexture[i] = JKR_NEW JUTTexture();
|
||||
mTexture[i] = new JUTTexture();
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
return false;
|
||||
@@ -1836,7 +1834,7 @@ bool J2DTevBlock16::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette
|
||||
}
|
||||
JUTTexture* texture;
|
||||
if (!mTexture[idx]) {
|
||||
texture = JKR_NEW JUTTexture(p_timg, local_43);
|
||||
texture = new JUTTexture(p_timg, local_43);
|
||||
if (!texture) {
|
||||
return false;
|
||||
}
|
||||
@@ -1904,7 +1902,7 @@ bool J2DTevBlock16::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
|
||||
if (mTexture[7] != NULL && mTexture[7]->getTexInfo() == NULL) {
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
JKR_DELETE(mTexture[7]);
|
||||
delete mTexture[7];
|
||||
}
|
||||
|
||||
mUndeleteFlag &= ~0x80;
|
||||
@@ -1956,7 +1954,7 @@ bool J2DTevBlock16::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
mTexture[param_0] = new JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1970,7 +1968,7 @@ bool J2DTevBlock16::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0]->storeTIMG(p_timg, tlutid);
|
||||
} else {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
mTexture[param_0] = NULL;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
}
|
||||
@@ -1978,7 +1976,7 @@ bool J2DTevBlock16::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[param_0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
mTexture[param_0] = new JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1988,7 +1986,7 @@ bool J2DTevBlock16::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -2000,12 +1998,12 @@ bool J2DTevBlock16::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
}
|
||||
|
||||
mTexture[param_0] = p_tex;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -2017,9 +2015,9 @@ bool J2DTevBlock16::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
}
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
|
||||
for (u32 i = param_0; i < 7; i++) {
|
||||
mTexture[i] = mTexture[i + 1];
|
||||
@@ -2039,13 +2037,13 @@ bool J2DTevBlock16::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -2059,7 +2057,7 @@ bool J2DTevBlock16::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -2074,7 +2072,7 @@ bool J2DTevBlock16::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[param_0] == NULL) {
|
||||
mPalette[param_0] = JKR_NEW JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
mPalette[param_0] = new JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -2087,7 +2085,7 @@ bool J2DTevBlock16::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[param_0]->attachPalette(mPalette[param_0]);
|
||||
}
|
||||
} else {
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
delete mPalette[param_0];
|
||||
mPalette[param_0] = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@ J2DMaterial::J2DMaterial() {
|
||||
}
|
||||
|
||||
J2DMaterial::~J2DMaterial() {
|
||||
JKR_DELETE(mTevBlock);
|
||||
JKR_DELETE(mIndBlock);
|
||||
JKR_DELETE(mAnmPointer);
|
||||
delete mTevBlock;
|
||||
delete mIndBlock;
|
||||
delete mAnmPointer;
|
||||
}
|
||||
|
||||
void J2DMaterial::setGX() {
|
||||
@@ -45,27 +45,27 @@ J2DTevBlock* J2DMaterial::createTevBlock(int block_type, bool noAlign) {
|
||||
|
||||
if (noAlign) {
|
||||
if (block_type <= 1) {
|
||||
block = JKR_NEW J2DTevBlock1();
|
||||
block = new J2DTevBlock1();
|
||||
} else if (block_type == 2) {
|
||||
block = JKR_NEW J2DTevBlock2();
|
||||
block = new J2DTevBlock2();
|
||||
} else if (block_type <= 4) {
|
||||
block = JKR_NEW J2DTevBlock4();
|
||||
block = new J2DTevBlock4();
|
||||
} else if (block_type <= 8) {
|
||||
block = JKR_NEW J2DTevBlock8();
|
||||
block = new J2DTevBlock8();
|
||||
} else {
|
||||
block = JKR_NEW J2DTevBlock16();
|
||||
block = new J2DTevBlock16();
|
||||
}
|
||||
} else {
|
||||
if (block_type <= 1) {
|
||||
block = JKR_NEW_ARGS (-4) J2DTevBlock1();
|
||||
block = new (-4) J2DTevBlock1();
|
||||
} else if (block_type == 2) {
|
||||
block = JKR_NEW_ARGS (-4) J2DTevBlock2();
|
||||
block = new (-4) J2DTevBlock2();
|
||||
} else if (block_type <= 4) {
|
||||
block = JKR_NEW_ARGS (-4) J2DTevBlock4();
|
||||
block = new (-4) J2DTevBlock4();
|
||||
} else if (block_type <= 8) {
|
||||
block = JKR_NEW_ARGS (-4) J2DTevBlock8();
|
||||
block = new (-4) J2DTevBlock8();
|
||||
} else {
|
||||
block = JKR_NEW_ARGS (-4) J2DTevBlock16();
|
||||
block = new (-4) J2DTevBlock16();
|
||||
}
|
||||
}
|
||||
ASSERTMSGLINE(101, block, "Error : allocate memory.");
|
||||
@@ -78,15 +78,15 @@ J2DIndBlock* J2DMaterial::createIndBlock(int block_type, bool noAlign) {
|
||||
|
||||
if (noAlign) {
|
||||
if (block_type != 0) {
|
||||
block = JKR_NEW J2DIndBlockFull();
|
||||
block = new J2DIndBlockFull();
|
||||
} else {
|
||||
block = JKR_NEW J2DIndBlockNull();
|
||||
block = new J2DIndBlockNull();
|
||||
}
|
||||
} else {
|
||||
if (block_type != 0) {
|
||||
block = JKR_NEW_ARGS (-4) J2DIndBlockFull();
|
||||
block = new (-4) J2DIndBlockFull();
|
||||
} else {
|
||||
block = JKR_NEW_ARGS (-4) J2DIndBlockNull();
|
||||
block = new (-4) J2DIndBlockNull();
|
||||
}
|
||||
}
|
||||
ASSERTMSGLINE(133, block, "Error : allocate memory.");
|
||||
@@ -122,7 +122,7 @@ void J2DMaterial::makeAnmPointer() {
|
||||
int r29;
|
||||
int r28;
|
||||
if (mAnmPointer == NULL) {
|
||||
mAnmPointer = JKR_NEW J2DMaterialAnmPointer();
|
||||
mAnmPointer = new J2DMaterialAnmPointer();
|
||||
r29 = 1;
|
||||
if (mAnmPointer == NULL) {
|
||||
OS_PANIC(171, "Error : allocate memory.");
|
||||
|
||||
@@ -228,7 +228,7 @@ J2DTexMtx* J2DMaterialFactory::newTexMtx(int param_0, int param_1) const {
|
||||
J2DTexMtx* rv = NULL;
|
||||
J2DMaterialInitData* iVar2 = &mpMaterialInitData[mpMaterialID[param_0]];
|
||||
if (iVar2->field_0x24[param_1] != 0xffff) {
|
||||
rv = JKR_NEW J2DTexMtx(mpTexMtxInfo[iVar2->field_0x24[param_1]]);
|
||||
rv = new J2DTexMtx(mpTexMtxInfo[iVar2->field_0x24[param_1]]);
|
||||
rv->calc();
|
||||
}
|
||||
return rv;
|
||||
|
||||
@@ -210,7 +210,7 @@ void J2DPane::changeUseTrans(J2DPane* p_pane) {
|
||||
J2DPane::~J2DPane() {
|
||||
JSUTreeIterator<J2DPane> iterator = mPaneTree.getFirstChild();
|
||||
for (; iterator != mPaneTree.getEndChild();) {
|
||||
JKR_DELETE((iterator++).getObject());
|
||||
delete (iterator++).getObject();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -208,12 +208,12 @@ void J2DPicture::private_readStream(J2DPane* parent, JSURandomInputStream* strea
|
||||
field_0x109 = 1;
|
||||
|
||||
if (img != NULL) {
|
||||
mTexture[0] = JKR_NEW JUTTexture(img, 0);
|
||||
mTexture[0] = new JUTTexture(img, 0);
|
||||
mTextureNum++;
|
||||
}
|
||||
|
||||
if (lut != NULL) {
|
||||
mPalette = JKR_NEW JUTPalette(GX_TLUT0, lut);
|
||||
mPalette = new JUTPalette(GX_TLUT0, lut);
|
||||
mTexture[0]->attachPalette(mPalette);
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ void J2DPicture::private_initiate(const ResTIMG* timg, const ResTLUT* tlut) {
|
||||
|
||||
if (timg != NULL) {
|
||||
if (mTexture[0] == NULL) {
|
||||
mTexture[0] = JKR_NEW JUTTexture(timg, 0);
|
||||
mTexture[0] = new JUTTexture(timg, 0);
|
||||
if (mTexture[0] != NULL) {
|
||||
mTextureNum++;
|
||||
field_0x109 = (field_0x109 & 2) | 1;
|
||||
@@ -251,7 +251,7 @@ void J2DPicture::private_initiate(const ResTIMG* timg, const ResTLUT* tlut) {
|
||||
|
||||
mPalette = NULL;
|
||||
if (tlut && mPalette == NULL) {
|
||||
mPalette = JKR_NEW JUTPalette(GX_TLUT0, const_cast<ResTLUT*>(tlut));
|
||||
mPalette = new JUTPalette(GX_TLUT0, const_cast<ResTLUT*>(tlut));
|
||||
if (mTexture[0] != NULL) {
|
||||
mTexture[0]->attachPalette(mPalette);
|
||||
}
|
||||
@@ -272,11 +272,11 @@ void J2DPicture::initinfo() {
|
||||
J2DPicture::~J2DPicture() {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if ((int)(field_0x109 & 1 << i) != 0) {
|
||||
JKR_DELETE(mTexture[i]);
|
||||
delete mTexture[i];
|
||||
}
|
||||
}
|
||||
|
||||
JKR_DELETE(mPalette);
|
||||
delete mPalette;
|
||||
}
|
||||
|
||||
bool J2DPicture::prepareTexture(u8 param_0) {
|
||||
@@ -286,7 +286,7 @@ bool J2DPicture::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
mTexture[i] = JKR_NEW JUTTexture();
|
||||
mTexture[i] = new JUTTexture();
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
return 0;
|
||||
@@ -309,7 +309,7 @@ bool J2DPicture::insert(ResTIMG const* img, JUTPalette* palette, u8 param_2, f32
|
||||
|
||||
JUTTexture* var_r31;
|
||||
if (mTexture[mTextureNum] == NULL) {
|
||||
var_r31 = JKR_NEW JUTTexture(img, var_r26);
|
||||
var_r31 = new JUTTexture(img, var_r26);
|
||||
|
||||
if (palette != NULL) {
|
||||
var_r31->storeTIMG(img, palette);
|
||||
@@ -381,7 +381,7 @@ bool J2DPicture::insert(JUTTexture* texture, u8 param_1, f32 param_2) {
|
||||
}
|
||||
|
||||
if (mTexture[1] != NULL && field_0x109 & 2) {
|
||||
JKR_DELETE(mTexture[1]);
|
||||
delete mTexture[1];
|
||||
field_0x109 &= 1;
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ bool J2DPicture::remove(u8 param_0) {
|
||||
}
|
||||
|
||||
if (field_0x109 & (1 << param_0)) {
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
delete mTexture[param_0];
|
||||
}
|
||||
|
||||
for (u8 i = param_0; i < mTextureNum - 1; i++) {
|
||||
|
||||
@@ -62,7 +62,7 @@ J2DPictureEx::J2DPictureEx(J2DPane* param_0, JSURandomInputStream* param_1, u32
|
||||
|
||||
J2DPictureEx::~J2DPictureEx() {
|
||||
if (field_0x190) {
|
||||
JKR_DELETE(mMaterial);
|
||||
delete mMaterial;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,10 +90,10 @@ u8* J2DPrint::setBuffer(size_t size) {
|
||||
|
||||
u8* u8Buff = (u8*)mStrBuff;
|
||||
if (sStrBufInitialized) {
|
||||
JKR_DELETE(mStrBuff);
|
||||
delete mStrBuff;
|
||||
}
|
||||
|
||||
mStrBuff = JKR_NEW_ARGS (JKRGetSystemHeap(), 0) char[size];
|
||||
mStrBuff = new (JKRGetSystemHeap(), 0) char[size];
|
||||
mStrBuffSize = size;
|
||||
sStrBufInitialized = true;
|
||||
return u8Buff;
|
||||
|
||||
@@ -27,19 +27,19 @@ J2DScreen::~J2DScreen() {
|
||||
}
|
||||
|
||||
void J2DScreen::clean() {
|
||||
JKR_DELETE_ARRAY(mMaterials);
|
||||
delete[] mMaterials;
|
||||
mMaterialNum = 0;
|
||||
mMaterials = NULL;
|
||||
|
||||
JKR_DELETE_ARRAY(mTexRes);
|
||||
delete[] mTexRes;
|
||||
mTexRes = NULL;
|
||||
|
||||
JKR_DELETE_ARRAY(mFontRes);
|
||||
delete[] mFontRes;
|
||||
mFontRes = NULL;
|
||||
|
||||
if (mNameTable != NULL) {
|
||||
JKR_DELETE_ARRAY(mNameTable->getResNameTable());
|
||||
JKR_DELETE(mNameTable);
|
||||
delete[] mNameTable->getResNameTable();
|
||||
delete mNameTable;
|
||||
mNameTable = NULL;
|
||||
}
|
||||
}
|
||||
@@ -176,40 +176,40 @@ J2DPane* J2DScreen::createPane(J2DScrnBlockHeader const& header, JSURandomInputS
|
||||
|
||||
switch (header.mTag) {
|
||||
case 'PAN1':
|
||||
newPane = JKR_NEW J2DPane(p_basePane, p_stream, 0);
|
||||
newPane = new J2DPane(p_basePane, p_stream, 0);
|
||||
break;
|
||||
case 'WIN1':
|
||||
newPane = JKR_NEW J2DWindow(p_basePane, p_stream, p_archive);
|
||||
newPane = new J2DWindow(p_basePane, p_stream, p_archive);
|
||||
break;
|
||||
case 'PIC1':
|
||||
newPane = JKR_NEW J2DPicture(p_basePane, p_stream, p_archive);
|
||||
newPane = new J2DPicture(p_basePane, p_stream, p_archive);
|
||||
break;
|
||||
case 'TBX1':
|
||||
newPane = JKR_NEW J2DTextBox(p_basePane, p_stream, p_archive);
|
||||
newPane = new J2DTextBox(p_basePane, p_stream, p_archive);
|
||||
break;
|
||||
case 'PAN2':
|
||||
newPane = JKR_NEW J2DPane(p_basePane, p_stream, 1);
|
||||
newPane = new J2DPane(p_basePane, p_stream, 1);
|
||||
break;
|
||||
case 'WIN2':
|
||||
if (param_3 & 0x1F0000) {
|
||||
newPane = JKR_NEW J2DWindowEx(p_basePane, p_stream, param_3, mMaterials);
|
||||
newPane = new J2DWindowEx(p_basePane, p_stream, param_3, mMaterials);
|
||||
break;
|
||||
}
|
||||
newPane = JKR_NEW J2DWindow(p_basePane, p_stream, mMaterials);
|
||||
newPane = new J2DWindow(p_basePane, p_stream, mMaterials);
|
||||
break;
|
||||
case 'PIC2':
|
||||
if (param_3 & 0x1F0000) {
|
||||
newPane = JKR_NEW J2DPictureEx(p_basePane, p_stream, param_3, mMaterials);
|
||||
newPane = new J2DPictureEx(p_basePane, p_stream, param_3, mMaterials);
|
||||
break;
|
||||
}
|
||||
newPane = JKR_NEW J2DPicture(p_basePane, p_stream, mMaterials);
|
||||
newPane = new J2DPicture(p_basePane, p_stream, mMaterials);
|
||||
break;
|
||||
case 'TBX2':
|
||||
if (param_3 & 0x1F0000) {
|
||||
newPane = JKR_NEW J2DTextBoxEx(p_basePane, p_stream, param_3, mMaterials);
|
||||
newPane = new J2DTextBoxEx(p_basePane, p_stream, param_3, mMaterials);
|
||||
break;
|
||||
}
|
||||
newPane = JKR_NEW J2DTextBox(p_basePane, p_stream, param_3, mMaterials);
|
||||
newPane = new J2DTextBox(p_basePane, p_stream, param_3, mMaterials);
|
||||
break;
|
||||
default:
|
||||
JUT_WARN(446, "%s", "unknown pane");
|
||||
@@ -217,7 +217,7 @@ J2DPane* J2DScreen::createPane(J2DScrnBlockHeader const& header, JSURandomInputS
|
||||
s32 size = header.mSize;
|
||||
s32 start = size + position;
|
||||
|
||||
newPane = JKR_NEW J2DPane(p_basePane, p_stream, 0);
|
||||
newPane = new J2DPane(p_basePane, p_stream, 0);
|
||||
p_stream->seek(start, JSUStreamSeekFrom_SET);
|
||||
break;
|
||||
}
|
||||
@@ -321,9 +321,9 @@ J2DResReference* J2DScreen::getResReference(JSURandomInputStream* p_stream, u32
|
||||
|
||||
char* buffer;
|
||||
if (param_1 & 0x1F0000) {
|
||||
buffer = JKR_NEW char[size1];
|
||||
buffer = new char[size1];
|
||||
} else {
|
||||
buffer = JKR_NEW_ARGS (-4) char[size1];
|
||||
buffer = new (-4) char[size1];
|
||||
}
|
||||
|
||||
if (buffer != NULL) {
|
||||
@@ -343,12 +343,12 @@ bool J2DScreen::createMaterial(JSURandomInputStream* p_stream, u32 param_1, JKRA
|
||||
p_stream->skip(2);
|
||||
|
||||
if (param_1 & 0x1F0000) {
|
||||
mMaterials = JKR_NEW J2DMaterial[mMaterialNum];
|
||||
mMaterials = new J2DMaterial[mMaterialNum];
|
||||
} else {
|
||||
mMaterials = JKR_NEW_ARGS (-4) J2DMaterial[mMaterialNum];
|
||||
mMaterials = new (-4) J2DMaterial[mMaterialNum];
|
||||
}
|
||||
|
||||
u8* buffer = JKR_NEW_ARGS (-4) u8[header.mSize];
|
||||
u8* buffer = new (-4) u8[header.mSize];
|
||||
if (mMaterials != NULL && buffer != NULL) {
|
||||
J2DMaterialBlock* pBlock = (J2DMaterialBlock*)buffer;
|
||||
p_stream->seek(position, JSUStreamSeekFrom_SET);
|
||||
@@ -372,7 +372,7 @@ bool J2DScreen::createMaterial(JSURandomInputStream* p_stream, u32 param_1, JKRA
|
||||
}
|
||||
size++;
|
||||
|
||||
u8* nametab = JKR_NEW u8[size];
|
||||
u8* nametab = new u8[size];
|
||||
if (nametab == NULL) {
|
||||
goto failure;
|
||||
}
|
||||
@@ -380,20 +380,20 @@ bool J2DScreen::createMaterial(JSURandomInputStream* p_stream, u32 param_1, JKRA
|
||||
nametab[i] = (buffer + offset)[i];
|
||||
}
|
||||
|
||||
mNameTable = JKR_NEW JUTNameTab((ResNTAB*)nametab);
|
||||
mNameTable = new JUTNameTab((ResNTAB*)nametab);
|
||||
if (mNameTable == NULL) {
|
||||
JKR_DELETE_ARRAY(nametab);
|
||||
delete[] nametab;
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
|
||||
success:
|
||||
JKR_DELETE_ARRAY(buffer);
|
||||
delete[] buffer;
|
||||
return true;
|
||||
}
|
||||
|
||||
failure:
|
||||
JKR_DELETE_ARRAY(buffer);
|
||||
delete[] buffer;
|
||||
clean();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ J2DTextBox::J2DTextBox(J2DPane* p_pane, JSURandomInputStream* p_stream, u32 para
|
||||
mStringPtr = NULL;
|
||||
|
||||
if (strLength != 0) {
|
||||
mStringPtr = JKR_NEW char[strLength];
|
||||
mStringPtr = new char[strLength];
|
||||
}
|
||||
|
||||
if (mStringPtr != NULL) {
|
||||
@@ -121,7 +121,7 @@ J2DTextBox::J2DTextBox(u64 tag, JGeometry::TBox2<f32> const& bounds, ResFONT con
|
||||
void J2DTextBox::initiate(ResFONT const* p_font, char const* string, s16 length,
|
||||
J2DTextBoxHBinding hBind, J2DTextBoxVBinding vBind) {
|
||||
if (p_font != NULL) {
|
||||
mFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
mFont = new JUTResFont(p_font, NULL);
|
||||
}
|
||||
|
||||
mCharColor.set(0xFFFFFFFF);
|
||||
@@ -144,7 +144,7 @@ void J2DTextBox::initiate(ResFONT const* p_font, char const* string, s16 length,
|
||||
stringLen = len + 1;
|
||||
}
|
||||
|
||||
mStringPtr = JKR_NEW char[stringLen];
|
||||
mStringPtr = new char[stringLen];
|
||||
|
||||
if (stringLen != 0 && mStringPtr != NULL) {
|
||||
strncpy(mStringPtr, string, stringLen - 1);
|
||||
@@ -185,7 +185,7 @@ void J2DTextBox::private_readStream(J2DPane* p_pane, JSURandomInputStream* p_str
|
||||
|
||||
ResFONT* fontPtr = (ResFONT*)getPointer(p_stream, 'FONT', p_archive);
|
||||
if (fontPtr != NULL) {
|
||||
mFont = JKR_NEW JUTResFont(fontPtr, NULL);
|
||||
mFont = new JUTResFont(fontPtr, NULL);
|
||||
}
|
||||
|
||||
mCharColor.set(p_stream->read32b());
|
||||
@@ -198,7 +198,7 @@ void J2DTextBox::private_readStream(J2DPane* p_pane, JSURandomInputStream* p_str
|
||||
mFontSizeY = p_stream->read16b();
|
||||
|
||||
s16 stringLen = p_stream->read16b();
|
||||
mStringPtr = JKR_NEW char[stringLen + 1];
|
||||
mStringPtr = new char[stringLen + 1];
|
||||
|
||||
if (mStringPtr != NULL) {
|
||||
p_stream->read(mStringPtr, stringLen);
|
||||
@@ -240,16 +240,16 @@ void J2DTextBox::private_readStream(J2DPane* p_pane, JSURandomInputStream* p_str
|
||||
|
||||
J2DTextBox::~J2DTextBox() {
|
||||
if (mTextFontOwned) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
|
||||
JKR_DELETE_ARRAY(mStringPtr);
|
||||
delete[] mStringPtr;
|
||||
}
|
||||
|
||||
void J2DTextBox::setFont(JUTFont* p_font) {
|
||||
if (p_font) {
|
||||
if (mTextFontOwned) {
|
||||
JKR_DELETE(mFont);
|
||||
delete mFont;
|
||||
}
|
||||
mFont = p_font;
|
||||
mTextFontOwned = false;
|
||||
@@ -317,7 +317,7 @@ s32 J2DTextBox::setString(char const* string, ...) {
|
||||
va_list args;
|
||||
va_start(args, string);
|
||||
|
||||
JKR_DELETE_ARRAY(mStringPtr);
|
||||
delete[] mStringPtr;
|
||||
|
||||
u32 len = strlen(string);
|
||||
|
||||
@@ -326,7 +326,7 @@ s32 J2DTextBox::setString(char const* string, ...) {
|
||||
}
|
||||
|
||||
mStringLength = 0;
|
||||
mStringPtr = JKR_NEW char[len + 1];
|
||||
mStringPtr = new char[len + 1];
|
||||
|
||||
if (mStringPtr) {
|
||||
mStringLength = len + 1;
|
||||
@@ -341,7 +341,7 @@ s32 J2DTextBox::setString(s16 length, char const* string, ...) {
|
||||
va_list args;
|
||||
va_start(args, string);
|
||||
|
||||
JKR_DELETE_ARRAY(mStringPtr);
|
||||
delete[] mStringPtr;
|
||||
mStringPtr = NULL;
|
||||
|
||||
u32 len = strlen(string);
|
||||
@@ -357,7 +357,7 @@ s32 J2DTextBox::setString(s16 length, char const* string, ...) {
|
||||
mStringLength = 0;
|
||||
|
||||
if (stringLen != 0) {
|
||||
mStringPtr = JKR_NEW char[stringLen];
|
||||
mStringPtr = new char[stringLen];
|
||||
}
|
||||
|
||||
if (mStringPtr != NULL) {
|
||||
|
||||
@@ -65,7 +65,7 @@ J2DTextBoxEx::J2DTextBoxEx(J2DPane* p_pane, JSURandomInputStream* p_stream, u32
|
||||
mStringPtr = NULL;
|
||||
|
||||
if (strLength != 0) {
|
||||
mStringPtr = JKR_NEW char[strLength];
|
||||
mStringPtr = new char[strLength];
|
||||
}
|
||||
|
||||
if (mStringPtr != NULL) {
|
||||
@@ -88,7 +88,7 @@ J2DTextBoxEx::J2DTextBoxEx(J2DPane* p_pane, JSURandomInputStream* p_stream, u32
|
||||
|
||||
J2DTextBoxEx::~J2DTextBoxEx() {
|
||||
if (field_0x140 != 0) {
|
||||
JKR_DELETE(mMaterial);
|
||||
delete mMaterial;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,19 +150,19 @@ J2DWindow::J2DWindow(u64 param_0, const JGeometry::TBox2<f32>& param_1, const ch
|
||||
|
||||
void J2DWindow::initiate(const ResTIMG* param_0, const ResTIMG* param_1, const ResTIMG* param_2, const ResTIMG* param_3, const ResTLUT* param_4, J2DWindowMirror param_5, const JGeometry::TBox2<f32>& param_6) {
|
||||
if (param_0) {
|
||||
field_0x100 = JKR_NEW JUTTexture(param_0, 0);
|
||||
field_0x100 = new JUTTexture(param_0, 0);
|
||||
}
|
||||
if (param_1) {
|
||||
field_0x104 = JKR_NEW JUTTexture(param_1, 0);
|
||||
field_0x104 = new JUTTexture(param_1, 0);
|
||||
}
|
||||
if (param_2) {
|
||||
field_0x108 = JKR_NEW JUTTexture(param_2, 0);
|
||||
field_0x108 = new JUTTexture(param_2, 0);
|
||||
}
|
||||
if (param_3) {
|
||||
field_0x10c = JKR_NEW JUTTexture(param_3, 0);
|
||||
field_0x10c = new JUTTexture(param_3, 0);
|
||||
}
|
||||
if (param_4) {
|
||||
mPalette = JKR_NEW JUTPalette(GX_TLUT0, const_cast<ResTLUT*>(param_4));
|
||||
mPalette = new JUTPalette(GX_TLUT0, const_cast<ResTLUT*>(param_4));
|
||||
}
|
||||
field_0x144 = param_5;
|
||||
if (field_0x100 && field_0x104 && field_0x108 && field_0x10c) {
|
||||
@@ -189,23 +189,23 @@ void J2DWindow::private_readStream(J2DPane* param_0, JSURandomInputStream* param
|
||||
field_0x114.set(f31, f30, f29, f28);
|
||||
ResTIMG* timg = (ResTIMG*)getPointer(param_1, 'TIMG', param_2);
|
||||
if (timg) {
|
||||
field_0x100 = JKR_NEW JUTTexture(timg, 0);
|
||||
field_0x100 = new JUTTexture(timg, 0);
|
||||
}
|
||||
timg = (ResTIMG*)getPointer(param_1, 'TIMG', param_2);
|
||||
if (timg) {
|
||||
field_0x104 = JKR_NEW JUTTexture(timg, 0);
|
||||
field_0x104 = new JUTTexture(timg, 0);
|
||||
}
|
||||
timg = (ResTIMG*)getPointer(param_1, 'TIMG', param_2);
|
||||
if (timg) {
|
||||
field_0x108 = JKR_NEW JUTTexture(timg, 0);
|
||||
field_0x108 = new JUTTexture(timg, 0);
|
||||
}
|
||||
timg = (ResTIMG*)getPointer(param_1, 'TIMG', param_2);
|
||||
if (timg) {
|
||||
field_0x10c = JKR_NEW JUTTexture(timg, 0);
|
||||
field_0x10c = new JUTTexture(timg, 0);
|
||||
}
|
||||
ResTLUT* tlut = (ResTLUT*)getPointer(param_1, 'TLUT', param_2);
|
||||
if (tlut) {
|
||||
mPalette = JKR_NEW JUTPalette(GX_TLUT0, tlut);
|
||||
mPalette = new JUTPalette(GX_TLUT0, tlut);
|
||||
}
|
||||
field_0x144 = param_1->read8b();
|
||||
field_0x128.set(param_1->read32b());
|
||||
@@ -218,7 +218,7 @@ void J2DWindow::private_readStream(J2DPane* param_0, JSURandomInputStream* param
|
||||
int unused;
|
||||
timg = (ResTIMG*)getPointer(param_1, 'TIMG', param_2);
|
||||
if (timg) {
|
||||
field_0x110 = JKR_NEW JUTTexture(timg, 0);
|
||||
field_0x110 = new JUTTexture(timg, 0);
|
||||
}
|
||||
r27--;
|
||||
}
|
||||
@@ -288,12 +288,12 @@ J2DWindowMirror J2DWindow::convertMirror(J2DTextureBase texBase) {
|
||||
}
|
||||
|
||||
J2DWindow::~J2DWindow() {
|
||||
JKR_DELETE(field_0x100);
|
||||
JKR_DELETE(field_0x104);
|
||||
JKR_DELETE(field_0x108);
|
||||
JKR_DELETE(field_0x10c);
|
||||
JKR_DELETE(mPalette);
|
||||
JKR_DELETE(field_0x110);
|
||||
delete field_0x100;
|
||||
delete field_0x104;
|
||||
delete field_0x108;
|
||||
delete field_0x10c;
|
||||
delete mPalette;
|
||||
delete field_0x110;
|
||||
}
|
||||
|
||||
void J2DWindow::draw(JGeometry::TBox2<f32> const& param_0) {
|
||||
|
||||
@@ -112,12 +112,12 @@ void J2DWindowEx::setMinSize() {
|
||||
J2DWindowEx::~J2DWindowEx() {
|
||||
for (u8 i = 0; i < 4; i++) {
|
||||
if (field_0x170 & (1 << i)) {
|
||||
JKR_DELETE(mFrameMaterial[i]);
|
||||
delete mFrameMaterial[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (field_0x170 & 0x10) {
|
||||
JKR_DELETE(mContentsMaterial);
|
||||
delete mContentsMaterial;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user