summaryrefslogtreecommitdiff
path: root/src/JSystem/JParticle/JPAResourceLoader.cpp
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-04-27 09:57:42 +0200
committerrobojumper <robojumper@gmail.com>2025-04-27 09:57:42 +0200
commitf83815457f6323b3ef009fb59a47949d203832bb (patch)
tree346cdde6cd211c2ab2650c6a840a6586067f68af /src/JSystem/JParticle/JPAResourceLoader.cpp
parent73ebfb9faec8572df4ab9bdd2d7053211c367d24 (diff)
Get the thing building again after Eggification
Diffstat (limited to 'src/JSystem/JParticle/JPAResourceLoader.cpp')
-rw-r--r--src/JSystem/JParticle/JPAResourceLoader.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/JSystem/JParticle/JPAResourceLoader.cpp b/src/JSystem/JParticle/JPAResourceLoader.cpp
index 84a30f12..c43c70ab 100644
--- a/src/JSystem/JParticle/JPAResourceLoader.cpp
+++ b/src/JSystem/JParticle/JPAResourceLoader.cpp
@@ -18,7 +18,7 @@
/* 8027D8A0-8027D8E0 2781E0 0040+00 0/0 1/1 0/0 .text
* __ct__17JPAResourceLoaderFPCUcP18JPAResourceManager */
JPAResourceLoader::JPAResourceLoader(u8 const* data, JPAResourceManager* mgr) {
- if (*(u32*)(data + 4) == '2-10') {
+ if (*(u32*)(data + 4) == '2-11') {
load_jpc(data, mgr);
}
}
@@ -37,19 +37,19 @@ void JPAResourceLoader::load_jpc(u8 const* data, JPAResourceManager* mgr) {
EGG::Heap* heap = mgr->mpHeap;
mgr->mResMax = *(u16*)(data + 8);
mgr->mTexMax = *(u16*)(data + 0xA);
- mgr->mpResArr = new (heap, 0) JPAResource*[mgr->mResMax];
- mgr->mpTexArr = new (heap, 0) JPATexture*[mgr->mTexMax];
+ mgr->mpResArr = new (heap, 4) JPAResource*[mgr->mResMax];
+ mgr->mpTexArr = new (heap, 4) JPATexture*[mgr->mTexMax];
u32 offset = 0x10;
for (int i = 0; i < *(u16*)(data + 8); i++) {
JPAResourceHeader* header = (JPAResourceHeader*)(data + offset);
- JPAResource* res = new (heap, 0) JPAResource();
+ JPAResource* res = new (heap, 4) JPAResource();
res->mFieldBlockNum = header->mFieldBlockNum;
res->mpFieldBlocks = res->mFieldBlockNum != 0 ?
- new (heap, 0) JPAFieldBlock*[res->mFieldBlockNum] : NULL;
+ new (heap, 4) JPAFieldBlock*[res->mFieldBlockNum] : NULL;
res->mKeyBlockNum = header->mKeyBlockNum;
res->mpKeyBlocks = res->mKeyBlockNum != 0 ?
- new (heap, 0) JPAKeyBlock*[res->mKeyBlockNum] : NULL;
+ new (heap, 4) JPAKeyBlock*[res->mKeyBlockNum] : NULL;
res->mTDB1Num = header->mTDB1Num;
res->mpTDB1 = NULL;
res->mUsrIdx = header->mUsrIdx;
@@ -63,27 +63,27 @@ void JPAResourceLoader::load_jpc(u8 const* data, JPAResourceManager* mgr) {
u32 size = *(u32*)(data + offset + 4);
switch (magic) {
case 'FLD1':
- res->mpFieldBlocks[field_idx] = new (heap, 0) JPAFieldBlock(data + offset, heap);
+ res->mpFieldBlocks[field_idx] = new (heap, 4) JPAFieldBlock(data + offset, heap);
field_idx++;
break;
case 'KFA1':
- res->mpKeyBlocks[key_idx] = new (heap, 0) JPAKeyBlock(data + offset);
+ res->mpKeyBlocks[key_idx] = new (heap, 4) JPAKeyBlock(data + offset);
key_idx++;
break;
case 'BEM1':
- res->mpDynamicsBlock = new (heap, 0) JPADynamicsBlock(data + offset);
+ res->mpDynamicsBlock = new (heap, 4) JPADynamicsBlock(data + offset);
break;
case 'BSP1':
- res->mpBaseShape = new (heap, 0) JPABaseShape(data + offset, heap);
+ res->mpBaseShape = new (heap, 4) JPABaseShape(data + offset, heap);
break;
case 'ESP1':
- res->mpExtraShape = new (heap, 0) JPAExtraShape(data + offset);
+ res->mpExtraShape = new (heap, 4) JPAExtraShape(data + offset);
break;
case 'SSP1':
- res->mpChildShape = new (heap, 0) JPAChildShape(data + offset);
+ res->mpChildShape = new (heap, 4) JPAChildShape(data + offset);
break;
case 'ETX1':
- res->mpExTexShape = new (heap, 0) JPAExTexShape(data + offset);
+ res->mpExTexShape = new (heap, 4) JPAExTexShape(data + offset);
break;
case 'TDB1':
res->mpTDB1 = (const u16*)(data + offset + 8);
@@ -99,7 +99,7 @@ void JPAResourceLoader::load_jpc(u8 const* data, JPAResourceManager* mgr) {
offset = *(u32*)(data + 0xC);
for (int i = 0; i < *(u16*)(data + 0xA); i++) {
u32 size = *(u32*)(data + offset + 4);
- JPATexture* tex = new (heap, 0) JPATexture(data + offset);
+ JPATexture* tex = new (heap, 4) JPATexture(data + offset);
mgr->registTex(tex);
offset += size;
}