Skip to content

Commit

Permalink
Convert some more errors
Browse files Browse the repository at this point in the history
  • Loading branch information
grunt-lucas committed Sep 21, 2023
1 parent d05356d commit 74801d6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,15 +829,18 @@ importCompiledAnimations(PtContext &ctx, const std::vector<std::vector<Animation
CompiledAnimFrame animFrame{animPng.frameName};

if (animPng.png.get_height() % TILE_SIDE_LENGTH != 0) {
// TODO : fill in real error
throw std::runtime_error{"TODO : frame.png.get_height() % TILE_SIDE_LENGTH != 0"};
// error_animDimensionNotDivisibleBy8(ctx.err, frame.animName, frame.frameName, "height",
// frame.png.get_height());
fatalerror(ctx.err, ctx.decompilerSrcPaths, ctx.decompilerConfig.mode,
fmt::format("anim '{}' frame '{}' height '{}' was not divisible by 8",
fmt::styled(compiledAnim.animName, fmt::emphasis::bold),
fmt::styled(animFrame.frameName, fmt::emphasis::bold),
fmt::styled(animPng.png.get_height(), fmt::emphasis::bold)));
}
if (animPng.png.get_width() % TILE_SIDE_LENGTH != 0) {
// TODO : fill in real error
throw std::runtime_error{"TODO : frame.png.get_width() % TILE_SIDE_LENGTH != 0"};
// error_animDimensionNotDivisibleBy8(ctx.err, frame.animName, frame.frameName, "width", frame.png.get_width());
fatalerror(ctx.err, ctx.decompilerSrcPaths, ctx.decompilerConfig.mode,
fmt::format("anim '{}' frame '{}' width '{}' was not divisible by 8",
fmt::styled(compiledAnim.animName, fmt::emphasis::bold),
fmt::styled(animFrame.frameName, fmt::emphasis::bold),
fmt::styled(animPng.png.get_width(), fmt::emphasis::bold)));
}

frameWidths.insert(animPng.png.get_width());
Expand Down

0 comments on commit 74801d6

Please sign in to comment.