diff options
| author | coco875 <pereira.jannin@gmail.com> | 2025-11-30 22:42:54 +0100 |
|---|---|---|
| committer | Lywx <kiritodev01@gmail.com> | 2025-12-01 12:39:42 -0600 |
| commit | 9591fca05134a7276fe1834f73c23f5a87134ea6 (patch) | |
| tree | b7aba0ca13b59d3a37d1033193991049a278ebe0 /src/factories | |
| parent | c7189642c36152cc312c4d32f944473dc2946db9 (diff) | |
remove assigment in if
Diffstat (limited to 'src/factories')
| -rw-r--r-- | src/factories/DisplayListFactory.cpp | 38 |
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); + } } } |
