From 4d9a82b720c8ce74b94f43f72ddd819ef21abbdf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 18 Mar 2023 23:42:07 +0100 Subject: pre-declare integer types without cstddef/cstdint --- loader/atlas.cpp | 2 +- loader/loader.hpp | 2 +- loader/texture.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'loader') diff --git a/loader/atlas.cpp b/loader/atlas.cpp index be8a2d23..a87d4ec1 100644 --- a/loader/atlas.cpp +++ b/loader/atlas.cpp @@ -84,7 +84,7 @@ std::shared_ptr loader_impl::anim_atlas(StringView name, StringView fm_soft_assert(anim_info.nframes == 1 || anim_info.fps > 0); const auto size = tex.pixels().size(); const auto width = size[1], height = size[0]; - fm_soft_assert(Vector2uz{anim_info.pixel_size} == Vector2uz{width, height}); + fm_soft_assert(anim_info.pixel_size[0] == width && anim_info.pixel_size[1] == height); auto atlas = std::make_shared(path, tex, std::move(anim_info)); return anim_atlas_map[atlas->name()] = atlas; diff --git a/loader/loader.hpp b/loader/loader.hpp index 577f45c5..e81abadf 100644 --- a/loader/loader.hpp +++ b/loader/loader.hpp @@ -7,7 +7,7 @@ namespace Magnum { using Vector2ub = Math::Vector2; } namespace floormat { struct serialized_scenery; } namespace Magnum::Trade { -template class ImageData; +template class ImageData; using ImageData2D = ImageData<2>; } // namespace Magnum::Trade diff --git a/loader/texture.cpp b/loader/texture.cpp index e14d0f34..5edef9ee 100644 --- a/loader/texture.cpp +++ b/loader/texture.cpp @@ -15,7 +15,7 @@ Trade::ImageData2D loader_impl::texture(StringView prefix, StringView filename_) { ensure_plugins(); - constexpr std::size_t max_extension_length = 16; + constexpr size_t max_extension_length = 16; const auto N = prefix.size(); if (N > 0) fm_assert(prefix[N-1] == '/'); @@ -27,7 +27,7 @@ Trade::ImageData2D loader_impl::texture(StringView prefix, StringView filename_) if (N > 0) std::memcpy(filename, prefix.data(), N); std::memcpy(filename + N, filename_.data(), filename_.size()); - std::size_t len = filename_.size() + N; + size_t len = filename_.size() + N; for (const auto& extension : std::initializer_list{ ".tga", ".png", ".webp", }) { -- cgit v1.2.3