diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2024-03-29 15:00:59 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2024-03-29 15:00:59 -0600 |
| commit | 8786ab57b938617257bfbeb9a426267fe7499b8c (patch) | |
| tree | b584d15830f736ff18bb0dcb4692be8c12c70052 | |
| parent | f4506380ee8b4436a903b47c76793fbcf2e20e0f (diff) | |
Fixed wrong calculation
| -rw-r--r-- | src/factories/BaseFactory.h | 2 | ||||
| -rw-r--r-- | src/utils/Decompressor.cpp | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/src/factories/BaseFactory.h b/src/factories/BaseFactory.h index 048c91e..bc1fb8c 100644 --- a/src/factories/BaseFactory.h +++ b/src/factories/BaseFactory.h @@ -20,7 +20,7 @@ #define SEGMENT_OFFSET(a) ((uint32_t)(a) & 0x00FFFFFF) #define SEGMENT_NUMBER(x) (((uint32_t)(x) >> 24) & 0xFF) // I would love to use 0x01000000, but the stupid compiler takes it as 0x01 -#define IS_SEGMENTED(x) (((uint32_t)(x) > 16777216) && (SEGMENT_NUMBER(x) < 0x20)) +#define IS_SEGMENTED(x) ((SEGMENT_NUMBER(x) > 0) && (SEGMENT_NUMBER(x) < 0x20)) #define ASSET_PTR(x) (IS_SEGMENTED(x) ? SEGMENT_OFFSET(x) : (x)) #define tab "\t" diff --git a/src/utils/Decompressor.cpp b/src/utils/Decompressor.cpp index c59d867..0fc806e 100644 --- a/src/utils/Decompressor.cpp +++ b/src/utils/Decompressor.cpp @@ -60,10 +60,8 @@ DecompressedData Decompressor::AutoDecode(YAML::Node& node, std::vector<uint8_t> } case CompressionType::YAY0: throw std::runtime_error("Found compressed yay0 segment.\nDecompression of yay0 has not been implemented yet."); - break; case CompressionType::YAZ0: throw std::runtime_error("Found compressed yaz0 segment.\nDecompression of yaz0 has not been implemented yet."); - break; case CompressionType::None: { auto fileOffset = TranslateAddr(offset); |
