summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/factories/DisplayListFactory.cpp38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/factories/DisplayListFactory.cpp b/src/factories/DisplayListFactory.cpp
index aa004ca..17f5f13 100644
--- a/src/factories/DisplayListFactory.cpp
+++ b/src/factories/DisplayListFactory.cpp
@@ -283,7 +283,8 @@ ExportResult DListBinaryExporter::Export(std::ostream &write, std::shared_ptr<IP
auto ptr = w1;
- if(auto overlap = GFXDOverride::GetVtxOverlap(ptr); overlap.has_value()){
+ auto overlap = GFXDOverride::GetVtxOverlap(ptr);
+ if(overlap.has_value()){
auto ovnode = std::get<1>(overlap.value());
auto path = Companion::Instance->RelativePath(std::get<0>(overlap.value()));
uint64_t hash = CRC64(path.c_str());
@@ -310,28 +311,31 @@ ExportResult DListBinaryExporter::Export(std::ostream &write, std::shared_ptr<IP
w0 = hash >> 32;
w1 = hash & 0xFFFFFFFF;
- } else if(auto dec = Companion::Instance->GetSafeStringByAddr(ptr, "VTX"); dec.has_value()){
- uint64_t hash = CRC64(dec.value().c_str());
- if(hash == 0) {
- throw std::runtime_error("Vtx hash is 0 for " + dec.value());
- }
+ } else {
+ auto dec = Companion::Instance->GetSafeStringByAddr(ptr, "VTX");
+ if(dec.has_value()){
+ uint64_t hash = CRC64(dec.value().c_str());
+ if(hash == 0) {
+ throw std::runtime_error("Vtx hash is 0 for " + dec.value());
+ }
- SPDLOG_INFO("Found vtx: 0x{:X} Hash: 0x{:X} Path: {}", ptr, hash, dec.value());
+ SPDLOG_INFO("Found vtx: 0x{:X} Hash: 0x{:X} Path: {}", ptr, hash, dec.value());
- N64Gfx value = gsSPVertexOTR(0, nvtx, didx);
+ N64Gfx value = gsSPVertexOTR(0, nvtx, didx);
- SPDLOG_INFO("gsSPVertex({}, {}, 0x{:X})", nvtx, didx, ptr);
+ SPDLOG_INFO("gsSPVertex({}, {}, 0x{:X})", nvtx, didx, ptr);
- w0 = value.words.w0;
- w1 = value.words.w1;
+ w0 = value.words.w0;
+ w1 = value.words.w1;
- writer.Write(w0);
- writer.Write(w1);
+ writer.Write(w0);
+ writer.Write(w1);
- w0 = hash >> 32;
- w1 = hash & 0xFFFFFFFF;
- } else {
- SPDLOG_WARN("Could not find vtx at 0x{:X}", ptr);
+ w0 = hash >> 32;
+ w1 = hash & 0xFFFFFFFF;
+ } else {
+ SPDLOG_WARN("Could not find vtx at 0x{:X}", ptr);
+ }
}
}