Updated splashpack structure

This commit is contained in:
2025-04-03 17:51:36 +02:00
parent cc1b2c84ef
commit 651cbcdf55
4 changed files with 8 additions and 7 deletions

Binary file not shown.

View File

@@ -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

View File

@@ -38,7 +38,8 @@ eastl::vector<psxsplash::GameObject *> LoadSplashpack(uint8_t *data) {
for (uint16_t i = 0; i < header->clutCount; i++) {
psxsplash::SPLASHPACKClut *clut = reinterpret_cast<psxsplash::SPLASHPACKClut *>(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);
}

View File

@@ -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;