mirror of
https://github.com/PrimeDecomp/PrimeRemasterStructs.git
synced 2026-07-12 18:18:58 -07:00
Fix WiiU GFXLibrary, messagetable and DKCTF texture read
Actual commit this time
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
#define _CSCALEFORMFLASHLIBRARY
|
||||
|
||||
typedef struct
|
||||
{ ChunkDescriptor chunk;
|
||||
{
|
||||
ChunkDescriptor chunk;
|
||||
struct CScaleformFlashLibraryChunk
|
||||
{
|
||||
uint32 referencedTextures;
|
||||
@@ -24,10 +25,24 @@ typedef struct
|
||||
struct ReferencedTxtr
|
||||
{
|
||||
GUID texRef;
|
||||
CStringFixed texName;
|
||||
if (ReadByte() == 0)
|
||||
{
|
||||
CStringFixed texName;
|
||||
}
|
||||
else
|
||||
{
|
||||
CString texName;
|
||||
}
|
||||
} rtxtr[referencedTextures] <optimize = false>;
|
||||
} rtxrs;
|
||||
CStringFixed theSWFName;
|
||||
if (ReadByte() == 0)
|
||||
{
|
||||
CStringFixed theSWFName;
|
||||
}
|
||||
else
|
||||
{
|
||||
CString theSWFName;
|
||||
}
|
||||
FSkip(4); //Skip ahead to see the SWF size
|
||||
LittleEndian(); //temp swap endian
|
||||
uint32 swfSize<hidden=true>; //Pull SWF size
|
||||
|
||||
+307
-274
File diff suppressed because it is too large
Load Diff
@@ -1,18 +1,16 @@
|
||||
#ifndef _MESSAGESTUDIOBINARYTEXT
|
||||
#define _MESSAGESTUDIOBINARYTEXT
|
||||
struct LanguageHeader(string expectedLanguage) {
|
||||
char magic[4];
|
||||
Assert(magic == expectedLanguage);
|
||||
uint fileSize;
|
||||
uint unk[4];
|
||||
};
|
||||
|
||||
struct MSBTHeader {
|
||||
char magic[8];
|
||||
Assert(magic == "MsgStdBn");
|
||||
ushort bom <format=hex>;
|
||||
//Todo add a meaningful check for endian, this works for LE/DKCTF NS/MP1R for now
|
||||
Assert(bom == 0xFEFF); // Big-Endian byte order
|
||||
//Assert(bom == 0xFEFF); // Big-Endian byte order
|
||||
//Let's check
|
||||
if (bom == 0xFFFE && isDKCTF)
|
||||
{
|
||||
LittleEndian();
|
||||
}
|
||||
ushort unk1;
|
||||
ubyte maybeMajorVersion;
|
||||
ubyte maybeMinorVersion;
|
||||
@@ -20,6 +18,10 @@ struct MSBTHeader {
|
||||
ushort unk3;
|
||||
uint fileSize;
|
||||
byte padding[10]<hidden=true>;
|
||||
if (isDKCTF) //Swap back
|
||||
{
|
||||
BigEndian();
|
||||
}
|
||||
};
|
||||
|
||||
struct TableHeader(string expectedMagic) {
|
||||
@@ -126,7 +128,7 @@ struct TextsSection {
|
||||
};
|
||||
|
||||
struct Language (string expectedLanguage) {
|
||||
LanguageHeader languageHeader(expectedLanguage);
|
||||
ChunkDescriptor languageChunkHeader;
|
||||
// Each section here is heavily referenced from https://zeldamods.org/wiki/Msbt
|
||||
struct MSBTContents {
|
||||
MSBTHeader header;
|
||||
+5
-2
@@ -2,7 +2,10 @@
|
||||
#define _NTEXTUREFORMAT
|
||||
struct STextureReadInfo
|
||||
{
|
||||
byte index;
|
||||
if (!isDKCTF)
|
||||
{
|
||||
byte index; //MP1R has this byte
|
||||
}
|
||||
uint32 offset <format=hex>;
|
||||
uint32 size <format=hex>;
|
||||
};
|
||||
@@ -34,7 +37,7 @@ struct STextureMetaData(uint64 fileStart)
|
||||
uint32 decompressedSize <format=hex>; // Total size decompressed
|
||||
uint32 infoCount;
|
||||
if (infoCount != 0) {
|
||||
STextureReadInfo info[infoCount];
|
||||
STextureReadInfo info[infoCount]<optimize=false>; //Do this so isDKCTF doesn't kill 010
|
||||
}
|
||||
uint32 bufferCount;
|
||||
if (bufferCount != 0) {
|
||||
|
||||
@@ -42,9 +42,9 @@ typedef struct {
|
||||
local uint64 start<format = hex, hidden = true> = FTell();
|
||||
switch (form.id) {
|
||||
case "MTRL":
|
||||
if (form.readerVersion == 168) {
|
||||
if (form.readerVersion == 168 || form.readerVersion == 12) {
|
||||
byte MTRLRaw[form.size]; // For now
|
||||
} else if (form.readerVersion == 22) {
|
||||
} else if (form.readerVersion == 22 || form.readerVersion == 10) {
|
||||
MaterialArchive materialArchive(form.size);
|
||||
} else {
|
||||
Assert(false, "Invalid version!");
|
||||
|
||||
Reference in New Issue
Block a user