Fixed some sm64 bugs

This commit is contained in:
KiritoDv
2024-10-03 16:02:22 -06:00
parent 298578677e
commit b2f3d9d1b5
3 changed files with 9 additions and 3 deletions
+4
View File
@@ -165,6 +165,7 @@ ExportResult SM64::PaintingBinaryExporter::Export(std::ostream &write, std::shar
writer.Write(hash);
} else {
SPDLOG_WARN("Could not find DisplayList at 0x{:X}", ptr);
writer.Write((uint64_t) 0);
}
}
@@ -177,6 +178,7 @@ ExportResult SM64::PaintingBinaryExporter::Export(std::ostream &write, std::shar
writer.Write(hash);
} else {
SPDLOG_WARN("Could not find Texture Maps at 0x{:X}", ptr);
writer.Write((uint64_t) 0);
}
}
@@ -189,6 +191,7 @@ ExportResult SM64::PaintingBinaryExporter::Export(std::ostream &write, std::shar
writer.Write(hash);
} else {
SPDLOG_WARN("Could not find Texture Arrays at 0x{:X}", ptr);
writer.Write((uint64_t) 0);
}
}
@@ -204,6 +207,7 @@ ExportResult SM64::PaintingBinaryExporter::Export(std::ostream &write, std::shar
writer.Write(hash);
} else {
SPDLOG_WARN("Could not find DisplayList at 0x{:X}", ptr);
writer.Write((uint64_t) 0);
}
}
+4 -2
View File
@@ -55,7 +55,9 @@ ExportResult SM64::PaintingMapBinaryExporter::Export(std::ostream &write, std::s
WriteHeader(writer, Torch::ResourceType::PaintingData, 0);
writer.Write((int16_t)paintingData->mPaintingMappings.size());
writer.Write((uint32_t) (paintingData->mPaintingMappings.size() + paintingData->mPaintingGroups.size()) + 2 );
writer.Write((int16_t) paintingData->mPaintingMappings.size());
for (auto &mapping : paintingData->mPaintingMappings) {
writer.Write(mapping.vtxId);
@@ -63,7 +65,7 @@ ExportResult SM64::PaintingMapBinaryExporter::Export(std::ostream &write, std::s
writer.Write(mapping.texY);
}
writer.Write((int16_t)paintingData->mPaintingGroups.size());
writer.Write((int16_t) paintingData->mPaintingGroups.size());
for (auto &group : paintingData->mPaintingGroups) {
writer.Write(group.x);
+1 -1
View File
@@ -1,6 +1,6 @@
#include "GeoUtils.h"
#define next_s16_in_geo_script(src) BSWAP16((*(*src)++))
#define next_s16_in_geo_script(src) (int16_t) BSWAP16((*(*src)++))
int16_t* read_vec3s_to_vec3f(Vec3f& dst, int16_t *src) {
dst.x = next_s16_in_geo_script(&src);