mirror of
https://github.com/zeldaret/ss
synced 2026-07-13 07:06:44 -04:00
Get the thing building again after Eggification
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user