diff --git a/output.bin b/output.bin index e80ce2c..30e0b6b 100644 Binary files a/output.bin and b/output.bin differ diff --git a/src/gameobject.hh b/src/gameobject.hh index 12ad5a9..ae762a0 100644 --- a/src/gameobject.hh +++ b/src/gameobject.hh @@ -10,13 +10,14 @@ namespace psxsplash { class GameObject final { public: - psyqo::Vec3 position; - psyqo::Matrix33 rotation; union { Tri *polygons; uint32_t polygonsOffset; }; - int polyCount; + psyqo::Vec3 position; + psyqo::Matrix33 rotation; + uint16_t polyCount; + uint16_t reserved; }; static_assert(sizeof(GameObject) == 56, "GameObject is not 56 bytes"); } // namespace psxsplash \ No newline at end of file diff --git a/src/splashpack.cpp b/src/splashpack.cpp index 1c18532..a4922cd 100644 --- a/src/splashpack.cpp +++ b/src/splashpack.cpp @@ -38,7 +38,8 @@ eastl::vector LoadSplashpack(uint8_t *data) { for (uint16_t i = 0; i < header->clutCount; i++) { psxsplash::SPLASHPACKClut *clut = reinterpret_cast(curentPointer); - psxsplash::Renderer::getInstance().vramUpload(clut->clut, clut->clutPackingX * 16, clut->clutPackingY, clut->length, 1); + uint8_t* clutOffset = data + clut->clutOffset; + psxsplash::Renderer::getInstance().vramUpload((uint16_t*) clutOffset, clut->clutPackingX * 16, clut->clutPackingY, clut->length, 1); curentPointer += sizeof(psxsplash::SPLASHPACKClut); } diff --git a/src/splashpack.hh b/src/splashpack.hh index 2237e52..f2fa068 100644 --- a/src/splashpack.hh +++ b/src/splashpack.hh @@ -14,7 +14,7 @@ struct SPLASHPACKFileHeader { uint16_t gameObjectCount; uint16_t textureAtlasCount; uint16_t clutCount; - uint16_t pad; + uint16_t pad[3]; }; struct SPLASHPACKTextureAtlas { @@ -24,8 +24,7 @@ struct SPLASHPACKTextureAtlas { }; struct SPLASHPACKClut { - uint16_t clut[256]; - + uint32_t clutOffset; uint16_t clutPackingX; uint16_t clutPackingY; uint16_t length;