mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-09-02 08:43:42 -04:00
Pjb dev 3 (#48)
* Undo array allocation changes from #43 Doesn't work * Expand dmeter heap sizes, give names * Fix manual operator delete call in resource.cpp * Disable map rendering for now Aurora can't handle lines * Re-enable assert heap on DVD thread Should be fine? * Some basic debug groups with the new Aurora API * Allow Aurora backend to be set via CLI * Give materials debug groups * More debug groups * JKRHeap separation: array edition Pain
This commit is contained in:
committed by
GitHub
parent
9e303b063f
commit
15732e241c
@@ -586,7 +586,7 @@ void J2DAnmTexPattern::searchUpdateMaterialID(J2DScreen* pScreen) {
|
||||
}
|
||||
}
|
||||
JKR_DELETE_ARRAY(mTIMGPtrArray);
|
||||
mTIMGPtrArray = JKR_NEW J2DAnmTexPatternTIMGPointer[pScreen->mTexRes->mCount];
|
||||
mTIMGPtrArray = JKR_NEW_ARRAY(J2DAnmTexPatternTIMGPointer, pScreen->mTexRes->mCount);
|
||||
if (mTIMGPtrArray != NULL) {
|
||||
JUTResReference resRef;
|
||||
for (u16 i = 0; i < pScreen->mTexRes->mCount; i++) {
|
||||
|
||||
@@ -93,7 +93,7 @@ u8* J2DPrint::setBuffer(size_t size) {
|
||||
JKR_DELETE(mStrBuff);
|
||||
}
|
||||
|
||||
mStrBuff = JKR_NEW_ARGS (JKRGetSystemHeap(), 0) char[size];
|
||||
mStrBuff = JKR_NEW_ARRAY_ARGS(char, size, JKRGetSystemHeap(), 0);
|
||||
mStrBuffSize = size;
|
||||
sStrBufInitialized = true;
|
||||
return u8Buff;
|
||||
|
||||
@@ -321,9 +321,9 @@ J2DResReference* J2DScreen::getResReference(JSURandomInputStream* p_stream, u32
|
||||
|
||||
char* buffer;
|
||||
if (param_1 & 0x1F0000) {
|
||||
buffer = JKR_NEW char[size1];
|
||||
buffer = JKR_NEW_ARRAY(char, size1);
|
||||
} else {
|
||||
buffer = JKR_NEW_ARGS (-4) char[size1];
|
||||
buffer = JKR_NEW_ARRAY_ARGS(char, size1, -4);
|
||||
}
|
||||
|
||||
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 = JKR_NEW_ARRAY(J2DMaterial, mMaterialNum);
|
||||
} else {
|
||||
mMaterials = JKR_NEW_ARGS (-4) J2DMaterial[mMaterialNum];
|
||||
mMaterials = JKR_NEW_ARRAY_ARGS(J2DMaterial, mMaterialNum, -4);
|
||||
}
|
||||
|
||||
u8* buffer = JKR_NEW_ARGS (-4) u8[header.mSize];
|
||||
u8* buffer = JKR_NEW_ARRAY_ARGS(u8, header.mSize, -4);
|
||||
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 = JKR_NEW_ARRAY(u8, size);
|
||||
if (nametab == NULL) {
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@@ -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 = JKR_NEW_ARRAY(char, strLength);
|
||||
}
|
||||
|
||||
if (mStringPtr != NULL) {
|
||||
@@ -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 = JKR_NEW_ARRAY(char, stringLen);
|
||||
|
||||
if (stringLen != 0 && mStringPtr != NULL) {
|
||||
strncpy(mStringPtr, string, stringLen - 1);
|
||||
@@ -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 = JKR_NEW_ARRAY(char, stringLen + 1);
|
||||
|
||||
if (mStringPtr != NULL) {
|
||||
p_stream->read(mStringPtr, stringLen);
|
||||
@@ -326,7 +326,7 @@ s32 J2DTextBox::setString(char const* string, ...) {
|
||||
}
|
||||
|
||||
mStringLength = 0;
|
||||
mStringPtr = JKR_NEW char[len + 1];
|
||||
mStringPtr = JKR_NEW_ARRAY(char, len + 1);
|
||||
|
||||
if (mStringPtr) {
|
||||
mStringLength = len + 1;
|
||||
@@ -357,7 +357,7 @@ s32 J2DTextBox::setString(s16 length, char const* string, ...) {
|
||||
mStringLength = 0;
|
||||
|
||||
if (stringLen != 0) {
|
||||
mStringPtr = JKR_NEW char[stringLen];
|
||||
mStringPtr = JKR_NEW_ARRAY(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 = JKR_NEW_ARRAY(char, strLength);
|
||||
}
|
||||
|
||||
if (mStringPtr != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user