summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-11-12 09:45:20 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-11-12 09:57:37 +0100
commitc8f0c67d56716bde17b8699c300332eeac9fd0c4 (patch)
treefeb446095b33f3dad571ac9f4bf84b14cced3903
parent4c8457ab9d13ff9b5121f5a4761669a07b3f5343 (diff)
rename clashing type name {,Serialize::}anim_atlas
-rw-r--r--anim-crop-tool/atlas.cpp8
-rw-r--r--anim-crop-tool/atlas.hpp2
-rw-r--r--anim-crop-tool/main.cpp7
3 files changed, 9 insertions, 8 deletions
diff --git a/anim-crop-tool/atlas.cpp b/anim-crop-tool/atlas.cpp
index 392f90fc..1967032c 100644
--- a/anim-crop-tool/atlas.cpp
+++ b/anim-crop-tool/atlas.cpp
@@ -18,7 +18,7 @@ void anim_atlas_row::add_entry(const anim_atlas_entry& x)
max_height = std::max((unsigned)mat.rows, max_height);
}
-void anim_atlas::advance_row()
+void anim_atlas_::advance_row()
{
auto& row = rows.back();
if (row.data.empty())
@@ -30,13 +30,13 @@ void anim_atlas::advance_row()
rows.push_back({ {}, 0, 0, ypos });
}
-Magnum::Vector2ui anim_atlas::offset() const noexcept
+Magnum::Vector2ui anim_atlas_::offset() const noexcept
{
const auto& row = rows.back();
return { row.xpos, row.ypos };
}
-Magnum::Vector2ui anim_atlas::size() const noexcept
+Magnum::Vector2ui anim_atlas_::size() const noexcept
{
const anim_atlas_row& row = rows.back();
// prevent accidentally writing out of bounds by forgetting to call
@@ -44,7 +44,7 @@ Magnum::Vector2ui anim_atlas::size() const noexcept
return { std::max(maxx, row.xpos), ypos + row.max_height };
}
-bool anim_atlas::dump(StringView filename) const
+bool anim_atlas_::dump(StringView filename) const
{
auto sz = size();
cv::Mat4b mat((int)sz[1], (int)sz[0]);
diff --git a/anim-crop-tool/atlas.hpp b/anim-crop-tool/atlas.hpp
index 41e8ecca..05152a65 100644
--- a/anim-crop-tool/atlas.hpp
+++ b/anim-crop-tool/atlas.hpp
@@ -23,7 +23,7 @@ struct anim_atlas_row
void add_entry(const anim_atlas_entry& x);
};
-class anim_atlas
+class anim_atlas_
{
std::vector<anim_atlas_row> rows = {{}};
unsigned ypos = 0, maxx = 0;
diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp
index 0d20781c..9d45eac4 100644
--- a/anim-crop-tool/main.cpp
+++ b/anim-crop-tool/main.cpp
@@ -31,6 +31,7 @@ using namespace floormat;
using Corrade::Utility::Error;
using Corrade::Utility::Debug;
+using floormat::Serialize::anim_atlas_;
struct options
{
@@ -65,7 +66,7 @@ static std::tuple<cv::Vec2i, cv::Vec2i, bool> find_image_bounds(const cv::Mat4b&
}
[[nodiscard]]
-static bool load_file(anim_group& group, options& opts, Serialize::anim_atlas& atlas, StringView filename)
+static bool load_file(anim_group& group, options& opts, anim_atlas_& atlas, StringView filename)
{
auto mat = fm_begin(
cv::Mat mat = cv::imread(filename, cv::IMREAD_UNCHANGED);
@@ -127,7 +128,7 @@ static bool load_file(anim_group& group, options& opts, Serialize::anim_atlas& a
}
[[nodiscard]]
-static bool load_directory(anim_group& group, options& opts, Serialize::anim_atlas& atlas)
+static bool load_directory(anim_group& group, options& opts, anim_atlas_& atlas)
{
const auto input_dir = Path::join(opts.input_dir, group.name);
@@ -273,7 +274,7 @@ int main(int argc, char** argv)
return usage(args);
}
- Serialize::anim_atlas atlas;
+ anim_atlas_ atlas;
for (anim_group& group : anim_info.groups)
if (!load_directory(group, opts, atlas))