Skip to content

Commit

Permalink
Fixed wrong calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed Mar 29, 2024
1 parent f450638 commit 8786ab5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/factories/BaseFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions src/utils/Decompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8786ab5

Please sign in to comment.