mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-05 10:47:27 -04:00
26 02 27 pjb dev 2 (#41)
* fix kankyo UB
* Fix TEV Stage DL writing
BE issue
* BE Fixes in materials/shapes
* Move to Aurora GD impl
* JUTDataFileHeader
* j3d: load vertex and texture not through GD
* Endian swap vertex data (mostly)
* Just exit(0) when closing the game
Fix crashes :godo:
* fix fopAcM_ct_placement and remove memcpy
* J3D: track vertex arrays correctly, swap work
* fix visibility, turn off overridden new/delete when we call into aurora
* event: cut name be
* Default window improvements
Double size, allow OS to decide position
* survive TParse::parseHeader_next
* color swap fix
* swap endian/fixes oob function pointer
* Remove GXGetViewportv stub
Aurora has it now
* Set array pointers via GD again
Relies on https://github.com/encounter/aurora/pull/35
* Let Aurora decide graphics backend
* disable procbar drawing
* Fix TColor endianness conversion issues
Fixes the wrong color for the flashing logo
* cam param swap
* simplify vtx loading, mat/amb color fix
* endian swap stb/fvb data
* aurora stat changes
* fix storage buffer crash
dont unnecessarily reassign vertex buffers in a way that forces aurora to recache things
* set bgobj spec fix
* add camera debug, endian swap more stb data, d_a_bg_obj::spec_data_c swapped
* JKRExpHeap: fix bad allocator slowdown
* solid tex
* texture caching
* log level
* fix window aspect ratio, disable bloom, endian swap camera type data
camera is now actually playing opening cutscene!!!!
* add GXDestroyTexObj to a couple stack init'd GXTexObjs, remove some diag printfs
* endian swap joint weight envelope data
* move to dusk config
* verbose arg errors
* better stub logging (for now)
* less logging, more BE
* more stubbing, move logging stuff around
* move all logging to aurora logging
* fix STUB_LOG, __FUNCTION__ isn't a string literal, wasn't building as it
was.
* update aurora
* fix heap alignment mismatch and always head align for now
* prevent them from fucking up my shit
* forward jut warning to DuskLog
* remove report logging
* maybe and i must emphasize maybe fix JMessage parsing
* this was a dumb idea
* preserve negative alignment for JKRHeap
* use normal free on macos and linux
* ^
* fix JMAHermiteInterpolation c impl
* endian swap J2DScreen mColor (oops)
* swap more J3D anim data, remove weird pointer addr check in J3DMaterial getMaterialAnm
* typo fix
* Fix aligned_alloc() size issues on POSIX
aligned_alloc() requires its input size to be a multiple of alignment. This wasn't being upheld so there were allocation failures in init code that made the game fail to start outside Windows.
Also just cleaned up some of this code a bit and removed fallback cases that *shouldn't* get hit.
* _Exit instead of exit()
Seriously I don't want destructors to run. Let the OS reclaim that shit.
* Reapply "Isolate JKRHeap operator overloads" (#39)
This reverts commit 3623b27f37.
* Fix some oopsies
* Fix hardcoded pointer size in JUTCacheFont::allocArray
* More operator overload fixes
Add void template specialization for jkrDelete
Add new[] placement overload. Apparently.
* Fix delete macros on nullptr
TIL C++ allows that.
* fix delete[]
* fix new(std::nothrow) overload
* fix avoid ub
* swap remaining anim data needed for title logo
* get rid of op 7
* move aurora_end_frame to correct spot
* juttexture destroy tex
* j2d animation be
* shutdown crash
* link warp material fix
* mDoExt_3DlineMat1_c fix
* hacky keyboard controls
* endian swap J2DResReference, add kb_pad to files.cmake
* fix some missing endian swaps in J2D, remove addr alignment check
* Remove heap unsetting in aurora calls
Never worked properly and not the right solution even if it did
* Don't print in DC stubs
They're fine to never implement
* Fix alignment stuff again
* Compile GF from dolphin lib
Doesn't seem to break anything and shuts up some stub warnings
* j3dtexture tlut obj fix
* addTexMtxIndexInDL fix
* don't recreate null tex data every frame
* the actual fix i wanted to push
* its kinda fakematch city over here
* insert hte efb copy
* limited window size / viewport support
* IsDelete FIX
---------
Co-authored-by: madeline <qwertytrogi@gmail.com>
Co-authored-by: Jasper St. Pierre <jstpierre@mecheye.net>
Co-authored-by: Jeffrey Crowell <jeff@crowell.biz>
Co-authored-by: TakaRikka <takarikka@outlook.com>
Co-authored-by: CraftyBoss <talibabdulmaalik@gmail.com>
Co-authored-by: Lurs <2795933+Lurs@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
820e2e3df6
commit
b289dece80
@@ -7,6 +7,8 @@
|
||||
#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);
|
||||
@@ -56,7 +58,7 @@ void J2DTexGenBlock::setGX() {
|
||||
|
||||
J2DTexGenBlock::~J2DTexGenBlock() {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
delete mTexMtx[i];
|
||||
JKR_DELETE(mTexMtx[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +66,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] = new J2DTexMtx(param_1.getTexMtxInfo());
|
||||
mTexMtx[param_0] = JKR_NEW J2DTexMtx(param_1.getTexMtxInfo());
|
||||
if (!mTexMtx[param_0]) {
|
||||
return;
|
||||
}
|
||||
@@ -101,13 +103,13 @@ J2DTevBlock1::J2DTevBlock1() {
|
||||
|
||||
J2DTevBlock1::~J2DTevBlock1() {
|
||||
if (mUndeleteFlag & 1) {
|
||||
delete mTexture[0];
|
||||
JKR_DELETE(mTexture[0]);
|
||||
}
|
||||
|
||||
delete mPalette[0];
|
||||
JKR_DELETE(mPalette[0]);
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +141,7 @@ bool J2DTevBlock1::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
mTexture[0] = new JUTTexture();
|
||||
mTexture[0] = JKR_NEW JUTTexture();
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
return false;
|
||||
@@ -166,7 +168,7 @@ bool J2DTevBlock1::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
}
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
mTexture[0] = new JUTTexture(p_timg, 0);
|
||||
mTexture[0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
return false;
|
||||
@@ -197,7 +199,7 @@ bool J2DTevBlock1::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 1) {
|
||||
delete mTexture[0];
|
||||
JKR_DELETE(mTexture[0]);
|
||||
}
|
||||
|
||||
mTexture[0] = p_tex;
|
||||
@@ -214,7 +216,7 @@ bool J2DTevBlock1::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[0] = new JUTTexture(p_timg, 0);
|
||||
mTexture[0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
return false;
|
||||
@@ -228,7 +230,7 @@ bool J2DTevBlock1::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[0]->storeTIMG(p_timg, (u8)0);
|
||||
} else {
|
||||
delete mTexture[0];
|
||||
JKR_DELETE(mTexture[0]);
|
||||
mTexture[0] = NULL;
|
||||
mUndeleteFlag &= 0x80;
|
||||
}
|
||||
@@ -236,7 +238,7 @@ bool J2DTevBlock1::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[0] = new JUTTexture(p_timg, 0);
|
||||
mTexture[0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[0] == NULL) {
|
||||
return false;
|
||||
@@ -246,7 +248,7 @@ bool J2DTevBlock1::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
delete mPalette[0];
|
||||
JKR_DELETE(mPalette[0]);
|
||||
mPalette[0] = NULL;
|
||||
mTexNo[0] = -1;
|
||||
return true;
|
||||
@@ -258,12 +260,12 @@ bool J2DTevBlock1::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 1) {
|
||||
delete mTexture[0];
|
||||
JKR_DELETE(mTexture[0]);
|
||||
}
|
||||
|
||||
mTexture[0] = p_tex;
|
||||
mUndeleteFlag &= 0x80;
|
||||
delete mPalette[0];
|
||||
JKR_DELETE(mPalette[0]);
|
||||
mPalette[0] = NULL;
|
||||
mTexNo[0] = -1;
|
||||
return true;
|
||||
@@ -275,12 +277,12 @@ bool J2DTevBlock1::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 1) {
|
||||
delete mTexture[0];
|
||||
JKR_DELETE(mTexture[0]);
|
||||
}
|
||||
|
||||
mTexture[0] = NULL;
|
||||
mUndeleteFlag &= 0x80;
|
||||
delete mPalette[0];
|
||||
JKR_DELETE(mPalette[0]);
|
||||
mTexNo[0] = -1;
|
||||
return true;
|
||||
}
|
||||
@@ -290,13 +292,13 @@ bool J2DTevBlock1::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -310,7 +312,7 @@ bool J2DTevBlock1::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -325,7 +327,7 @@ bool J2DTevBlock1::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[0] == NULL) {
|
||||
mPalette[0] = new JUTPalette(GX_TLUT0, (ResTLUT*)p_tlut);
|
||||
mPalette[0] = JKR_NEW JUTPalette(GX_TLUT0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[0] == NULL) {
|
||||
return false;
|
||||
@@ -338,7 +340,7 @@ bool J2DTevBlock1::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[0]->attachPalette(mPalette[0]);
|
||||
}
|
||||
} else {
|
||||
delete mPalette[0];
|
||||
JKR_DELETE(mPalette[0]);
|
||||
mPalette[0] = NULL;
|
||||
}
|
||||
|
||||
@@ -403,18 +405,18 @@ J2DTevBlock2::J2DTevBlock2() {
|
||||
|
||||
J2DTevBlock2::~J2DTevBlock2() {
|
||||
if (mUndeleteFlag & 1) {
|
||||
delete mTexture[0];
|
||||
JKR_DELETE(mTexture[0]);
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 2) {
|
||||
delete mTexture[1];
|
||||
JKR_DELETE(mTexture[1]);
|
||||
}
|
||||
|
||||
delete mPalette[0];
|
||||
delete mPalette[1];
|
||||
JKR_DELETE(mPalette[0]);
|
||||
JKR_DELETE(mPalette[1]);
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,7 +456,7 @@ bool J2DTevBlock2::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
mTexture[i] = new JUTTexture();
|
||||
mTexture[i] = JKR_NEW JUTTexture();
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
return false;
|
||||
@@ -499,7 +501,7 @@ bool J2DTevBlock2::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
|
||||
JUTTexture* tex;
|
||||
if (mTexture[texNo] == NULL) {
|
||||
tex = new JUTTexture(p_timg, tlutid);
|
||||
tex = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (tex == NULL) {
|
||||
return false;
|
||||
@@ -575,7 +577,7 @@ bool J2DTevBlock2::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
|
||||
if (mTexture[1] != NULL && mTexture[1]->getTexInfo() == NULL) {
|
||||
if (mUndeleteFlag & 2) {
|
||||
delete mTexture[1];
|
||||
JKR_DELETE(mTexture[1]);
|
||||
}
|
||||
|
||||
mUndeleteFlag &= ~2;
|
||||
@@ -617,7 +619,7 @@ bool J2DTevBlock2::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = new JUTTexture(p_timg, tlutid);
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -631,7 +633,7 @@ bool J2DTevBlock2::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0]->storeTIMG(p_timg, tlutid);
|
||||
} else {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
mTexture[param_0] = NULL;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
}
|
||||
@@ -639,7 +641,7 @@ bool J2DTevBlock2::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[param_0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = new JUTTexture(p_timg, 0);
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -649,7 +651,7 @@ bool J2DTevBlock2::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -661,12 +663,12 @@ bool J2DTevBlock2::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
}
|
||||
|
||||
mTexture[param_0] = p_tex;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -678,9 +680,9 @@ bool J2DTevBlock2::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
}
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
|
||||
if (param_0 == 0) {
|
||||
mTexture[0] = mTexture[1];
|
||||
@@ -700,13 +702,13 @@ bool J2DTevBlock2::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -720,7 +722,7 @@ bool J2DTevBlock2::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -735,7 +737,7 @@ bool J2DTevBlock2::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[param_0] == NULL) {
|
||||
mPalette[param_0] = new JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
mPalette[param_0] = JKR_NEW JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -748,7 +750,7 @@ bool J2DTevBlock2::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[param_0]->attachPalette(mPalette[param_0]);
|
||||
}
|
||||
} else {
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
}
|
||||
|
||||
@@ -841,13 +843,13 @@ J2DTevBlock4::J2DTevBlock4() {
|
||||
J2DTevBlock4::~J2DTevBlock4() {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (mUndeleteFlag & (1 << i)) {
|
||||
delete mTexture[i];
|
||||
JKR_DELETE(mTexture[i]);
|
||||
}
|
||||
delete mPalette[i];
|
||||
JKR_DELETE(mPalette[i]);
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -892,7 +894,7 @@ bool J2DTevBlock4::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
mTexture[i] = new JUTTexture();
|
||||
mTexture[i] = JKR_NEW JUTTexture();
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
return false;
|
||||
@@ -949,7 +951,7 @@ bool J2DTevBlock4::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
}
|
||||
JUTTexture* texture;
|
||||
if (!mTexture[idx]) {
|
||||
texture = new JUTTexture(p_timg, local_43);
|
||||
texture = JKR_NEW JUTTexture(p_timg, local_43);
|
||||
if (!texture) {
|
||||
return false;
|
||||
}
|
||||
@@ -1017,7 +1019,7 @@ bool J2DTevBlock4::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
|
||||
if (mTexture[3] != NULL && mTexture[3]->getTexInfo() == NULL) {
|
||||
if (mUndeleteFlag & 8) {
|
||||
delete mTexture[3];
|
||||
JKR_DELETE(mTexture[3]);
|
||||
}
|
||||
|
||||
mUndeleteFlag &= ~8;
|
||||
@@ -1069,7 +1071,7 @@ bool J2DTevBlock4::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = new JUTTexture(p_timg, tlutid);
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1083,7 +1085,7 @@ bool J2DTevBlock4::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0]->storeTIMG(p_timg, tlutid);
|
||||
} else {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
mTexture[param_0] = NULL;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
}
|
||||
@@ -1091,7 +1093,7 @@ bool J2DTevBlock4::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[param_0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = new JUTTexture(p_timg, 0);
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1101,7 +1103,7 @@ bool J2DTevBlock4::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -1113,12 +1115,12 @@ bool J2DTevBlock4::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
}
|
||||
|
||||
mTexture[param_0] = p_tex;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -1130,9 +1132,9 @@ bool J2DTevBlock4::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
}
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
|
||||
for (u32 i = param_0; i < 3; i++) {
|
||||
mTexture[i] = mTexture[i + 1];
|
||||
@@ -1152,13 +1154,13 @@ bool J2DTevBlock4::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -1172,7 +1174,7 @@ bool J2DTevBlock4::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -1187,7 +1189,7 @@ bool J2DTevBlock4::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[param_0] == NULL) {
|
||||
mPalette[param_0] = new JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
mPalette[param_0] = JKR_NEW JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1200,7 +1202,7 @@ bool J2DTevBlock4::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[param_0]->attachPalette(mPalette[param_0]);
|
||||
}
|
||||
} else {
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
}
|
||||
|
||||
@@ -1285,13 +1287,13 @@ J2DTevBlock8::J2DTevBlock8() {
|
||||
J2DTevBlock8::~J2DTevBlock8() {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (mUndeleteFlag & (1 << i)) {
|
||||
delete mTexture[i];
|
||||
JKR_DELETE(mTexture[i]);
|
||||
}
|
||||
delete mPalette[i];
|
||||
JKR_DELETE(mPalette[i]);
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1337,7 +1339,7 @@ bool J2DTevBlock8::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
mTexture[i] = new JUTTexture();
|
||||
mTexture[i] = JKR_NEW JUTTexture();
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
return false;
|
||||
@@ -1394,7 +1396,7 @@ bool J2DTevBlock8::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette*
|
||||
}
|
||||
JUTTexture* texture;
|
||||
if (!mTexture[idx]) {
|
||||
texture = new JUTTexture(p_timg, local_43);
|
||||
texture = JKR_NEW JUTTexture(p_timg, local_43);
|
||||
if (!texture) {
|
||||
return false;
|
||||
}
|
||||
@@ -1462,7 +1464,7 @@ bool J2DTevBlock8::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
|
||||
if (mTexture[7] != NULL && mTexture[7]->getTexInfo() == NULL) {
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mTexture[7];
|
||||
JKR_DELETE(mTexture[7]);
|
||||
}
|
||||
|
||||
mUndeleteFlag &= ~0x80;
|
||||
@@ -1514,7 +1516,7 @@ bool J2DTevBlock8::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = new JUTTexture(p_timg, tlutid);
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1528,7 +1530,7 @@ bool J2DTevBlock8::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0]->storeTIMG(p_timg, tlutid);
|
||||
} else {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
mTexture[param_0] = NULL;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
}
|
||||
@@ -1536,7 +1538,7 @@ bool J2DTevBlock8::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[param_0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = new JUTTexture(p_timg, 0);
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1546,7 +1548,7 @@ bool J2DTevBlock8::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -1558,12 +1560,12 @@ bool J2DTevBlock8::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
}
|
||||
|
||||
mTexture[param_0] = p_tex;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -1575,9 +1577,9 @@ bool J2DTevBlock8::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
}
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
|
||||
for (u32 i = param_0; i < 7; i++) {
|
||||
mTexture[i] = mTexture[i + 1];
|
||||
@@ -1597,13 +1599,13 @@ bool J2DTevBlock8::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -1617,7 +1619,7 @@ bool J2DTevBlock8::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -1632,7 +1634,7 @@ bool J2DTevBlock8::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[param_0] == NULL) {
|
||||
mPalette[param_0] = new JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
mPalette[param_0] = JKR_NEW JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1645,7 +1647,7 @@ bool J2DTevBlock8::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[param_0]->attachPalette(mPalette[param_0]);
|
||||
}
|
||||
} else {
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
}
|
||||
|
||||
@@ -1725,13 +1727,13 @@ J2DTevBlock16::J2DTevBlock16() {
|
||||
J2DTevBlock16::~J2DTevBlock16() {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (mUndeleteFlag & (1 << i)) {
|
||||
delete mTexture[i];
|
||||
JKR_DELETE(mTexture[i]);
|
||||
}
|
||||
delete mPalette[i];
|
||||
JKR_DELETE(mPalette[i]);
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1777,7 +1779,7 @@ bool J2DTevBlock16::prepareTexture(u8 param_0) {
|
||||
}
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
mTexture[i] = new JUTTexture();
|
||||
mTexture[i] = JKR_NEW JUTTexture();
|
||||
|
||||
if (mTexture[i] == NULL) {
|
||||
return false;
|
||||
@@ -1834,7 +1836,7 @@ bool J2DTevBlock16::insertTexture(u32 param_0, ResTIMG const* p_timg, JUTPalette
|
||||
}
|
||||
JUTTexture* texture;
|
||||
if (!mTexture[idx]) {
|
||||
texture = new JUTTexture(p_timg, local_43);
|
||||
texture = JKR_NEW JUTTexture(p_timg, local_43);
|
||||
if (!texture) {
|
||||
return false;
|
||||
}
|
||||
@@ -1902,7 +1904,7 @@ bool J2DTevBlock16::insertTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
|
||||
if (mTexture[7] != NULL && mTexture[7]->getTexInfo() == NULL) {
|
||||
if (mUndeleteFlag & 0x80) {
|
||||
delete mTexture[7];
|
||||
JKR_DELETE(mTexture[7]);
|
||||
}
|
||||
|
||||
mUndeleteFlag &= ~0x80;
|
||||
@@ -1954,7 +1956,7 @@ bool J2DTevBlock16::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = new JUTTexture(p_timg, tlutid);
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, tlutid);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1968,7 +1970,7 @@ bool J2DTevBlock16::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0]->storeTIMG(p_timg, tlutid);
|
||||
} else {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
mTexture[param_0] = NULL;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
}
|
||||
@@ -1976,7 +1978,7 @@ bool J2DTevBlock16::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
mTexture[param_0] = NULL;
|
||||
|
||||
if (p_timg != NULL) {
|
||||
mTexture[param_0] = new JUTTexture(p_timg, 0);
|
||||
mTexture[param_0] = JKR_NEW JUTTexture(p_timg, 0);
|
||||
|
||||
if (mTexture[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -1986,7 +1988,7 @@ bool J2DTevBlock16::setTexture(u32 param_0, ResTIMG const* p_timg) {
|
||||
}
|
||||
}
|
||||
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -1998,12 +2000,12 @@ bool J2DTevBlock16::setTexture(u32 param_0, JUTTexture* p_tex) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
}
|
||||
|
||||
mTexture[param_0] = p_tex;
|
||||
mUndeleteFlag &= ~(1 << param_0);
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
mTexNo[param_0] = -1;
|
||||
return true;
|
||||
@@ -2015,9 +2017,9 @@ bool J2DTevBlock16::removeTexture(u32 param_0) {
|
||||
}
|
||||
|
||||
if (mUndeleteFlag & (1 << param_0)) {
|
||||
delete mTexture[param_0];
|
||||
JKR_DELETE(mTexture[param_0]);
|
||||
}
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
|
||||
for (u32 i = param_0; i < 7; i++) {
|
||||
mTexture[i] = mTexture[i + 1];
|
||||
@@ -2037,13 +2039,13 @@ bool J2DTevBlock16::setFont(ResFONT* p_font) {
|
||||
return false;
|
||||
}
|
||||
|
||||
JUTResFont* resFont = new JUTResFont(p_font, NULL);
|
||||
JUTResFont* resFont = JKR_NEW JUTResFont(p_font, NULL);
|
||||
if (resFont == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = resFont;
|
||||
@@ -2057,7 +2059,7 @@ bool J2DTevBlock16::setFont(JUTFont* p_font) {
|
||||
}
|
||||
|
||||
if (mFontUndeleteFlag) {
|
||||
delete mFont;
|
||||
JKR_DELETE(mFont);
|
||||
}
|
||||
|
||||
mFont = (JUTResFont*)p_font;
|
||||
@@ -2072,7 +2074,7 @@ bool J2DTevBlock16::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
|
||||
if (p_tlut != NULL) {
|
||||
if (mPalette[param_0] == NULL) {
|
||||
mPalette[param_0] = new JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
mPalette[param_0] = JKR_NEW JUTPalette((GXTlut)param_0, (ResTLUT*)p_tlut);
|
||||
|
||||
if (mPalette[param_0] == NULL) {
|
||||
return false;
|
||||
@@ -2085,7 +2087,7 @@ bool J2DTevBlock16::setPalette(u32 param_0, ResTLUT const* p_tlut) {
|
||||
mTexture[param_0]->attachPalette(mPalette[param_0]);
|
||||
}
|
||||
} else {
|
||||
delete mPalette[param_0];
|
||||
JKR_DELETE(mPalette[param_0]);
|
||||
mPalette[param_0] = NULL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user