Merge commit '8a74e044dc5fa44ba10dbbf7d2812c7070ff4f7c'
All checks were successful
Build / build (push) Successful in 1m30s
All checks were successful
Build / build (push) Successful in 1m30s
This commit is contained in:
@ -11,7 +11,7 @@
|
|||||||
namespace nostalgia::gfx {
|
namespace nostalgia::gfx {
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr std::size_t ptToIdx(int x, int y, int c, int scale = 1) noexcept {
|
constexpr std::size_t ptToIdx(int const x, int const y, int const c, int const scale = 1) noexcept {
|
||||||
auto const tileWidth = TileWidth * scale;
|
auto const tileWidth = TileWidth * scale;
|
||||||
auto const tileHeight = TileHeight * scale;
|
auto const tileHeight = TileHeight * scale;
|
||||||
auto const pixelsPerTile = tileWidth * tileHeight;
|
auto const pixelsPerTile = tileWidth * tileHeight;
|
||||||
@ -25,12 +25,12 @@ constexpr std::size_t ptToIdx(int x, int y, int c, int scale = 1) noexcept {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr std::size_t ptToIdx(const ox::Point &pt, int c, int scale = 1) noexcept {
|
constexpr std::size_t ptToIdx(ox::Point const &pt, int const c, int const scale = 1) noexcept {
|
||||||
return ptToIdx(pt.x, pt.y, c * TileWidth, scale);
|
return ptToIdx(pt.x, pt.y, c * TileWidth, scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr ox::Point idxToPt(int i, int c, int scale = 1) noexcept {
|
constexpr ox::Point idxToPt(int const i, int c, int const scale = 1) noexcept {
|
||||||
auto const tileWidth = TileWidth * scale;
|
auto const tileWidth = TileWidth * scale;
|
||||||
auto const tileHeight = TileHeight * scale;
|
auto const tileHeight = TileHeight * scale;
|
||||||
auto const pixelsPerTile = tileWidth * tileHeight;
|
auto const pixelsPerTile = tileWidth * tileHeight;
|
||||||
|
@ -481,6 +481,8 @@ ox::Result<uint32_t> getTileOffset(TileSheet const&ts, SubSheetId pId) noexcept;
|
|||||||
|
|
||||||
ox::Result<ox::StringView> getNameFor(TileSheet::SubSheet const &ss, SubSheetId pId) noexcept;
|
ox::Result<ox::StringView> getNameFor(TileSheet::SubSheet const &ss, SubSheetId pId) noexcept;
|
||||||
|
|
||||||
|
ox::Result<ox::StringView> getNameFor(TileSheet &ts, SubSheetId pId) noexcept;
|
||||||
|
|
||||||
ox::Result<ox::StringView> getNameFor(TileSheet const &ts, SubSheetId pId) noexcept;
|
ox::Result<ox::StringView> getNameFor(TileSheet const &ts, SubSheetId pId) noexcept;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
|
@ -133,6 +133,9 @@ ox::Error cmdExportTilesheet(studio::Project &project, ox::SpanView<ox::CString>
|
|||||||
"[-scale <int>]\n");
|
"[-scale <int>]\n");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if (args.empty()) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
OX_REQUIRE(srcPath, clargs.getString("src-path").transformError(1, "no src path specified"));
|
OX_REQUIRE(srcPath, clargs.getString("src-path").transformError(1, "no src path specified"));
|
||||||
OX_REQUIRE(dstPath, clargs.getString("dst-path").transformError(2, "no dst path specified"));
|
OX_REQUIRE(dstPath, clargs.getString("dst-path").transformError(2, "no dst path specified"));
|
||||||
auto const palPath = clargs.getString("pal-path", "");
|
auto const palPath = clargs.getString("pal-path", "");
|
||||||
|
@ -90,7 +90,10 @@ static ox::Error run(
|
|||||||
return ox::Error{2, "failed to load project directory"};
|
return ox::Error{2, "failed to load project directory"};
|
||||||
}
|
}
|
||||||
Project project{*kctx.value, projectDir, projectDataDir};
|
Project project{*kctx.value, projectDir, projectDataDir};
|
||||||
return c.func(project, args + numCmdArgs);
|
return c.func(
|
||||||
|
project,
|
||||||
|
args.size() > numCmdArgs ?
|
||||||
|
args + numCmdArgs : ox::SpanView<ox::CString>{});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ox::Error{1, "command not found"};
|
return ox::Error{1, "command not found"};
|
||||||
|
Reference in New Issue
Block a user