summaryrefslogtreecommitdiffhomepage
path: root/editor
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-18 23:42:07 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-18 23:42:07 +0100
commit4d9a82b720c8ce74b94f43f72ddd819ef21abbdf (patch)
treec0a5d21b8e19fbb60c286faec8e302e6f32b6679 /editor
parent32b8c22828315292857e2cd9909fba620f30ff70 (diff)
pre-declare integer types without cstddef/cstdint
Diffstat (limited to 'editor')
-rw-r--r--editor/app.cpp6
-rw-r--r--editor/app.hpp7
-rw-r--r--editor/draw.cpp14
-rw-r--r--editor/editor.cpp4
-rw-r--r--editor/events.cpp4
-rw-r--r--editor/imgui-inspect.cpp2
-rw-r--r--editor/imgui-raii.hpp2
-rw-r--r--editor/imgui-tiles.cpp2
-rw-r--r--editor/inspect-types.cpp28
-rw-r--r--editor/inspect.cpp44
-rw-r--r--editor/inspect.hpp5
-rw-r--r--editor/scenery-editor.cpp2
-rw-r--r--editor/tile-editor.cpp4
-rw-r--r--editor/tile-editor.hpp4
-rw-r--r--editor/update.cpp14
15 files changed, 71 insertions, 71 deletions
diff --git a/editor/app.cpp b/editor/app.cpp
index 63394ded..71b34cb8 100644
--- a/editor/app.cpp
+++ b/editor/app.cpp
@@ -50,7 +50,7 @@ void app::ensure_player_character(world& w)
return;
_character_id = 0;
- auto id = (std::uint64_t)-1;
+ auto id = (object_id)-1;
for (const auto& [coord, c] : w.chunks())
{
@@ -66,7 +66,7 @@ void app::ensure_player_character(world& w)
}
}
- if (id != (std::uint64_t)-1)
+ if (id != (object_id)-1)
_character_id = id;
else
{
@@ -135,7 +135,7 @@ fm_settings app::parse_cmdline(int argc, const char* const* const argv)
{
Vector2us size;
int n = 0, ret = std::sscanf(str.data(), "%hux%hu%n", &size.x(), &size.y(), &n);
- if (ret != 2 || (std::size_t)n != str.size() || Vector2ui(size).product() == 0)
+ if (ret != 2 || (size_t)n != str.size() || Vector2ui(size).product() == 0)
{
Error{} << "invalid --geometry argument '%s'" << str;
std::exit(EX_USAGE);
diff --git a/editor/app.hpp b/editor/app.hpp
index dc8fed2c..7f117f9c 100644
--- a/editor/app.hpp
+++ b/editor/app.hpp
@@ -10,6 +10,7 @@
#include "draw/box.hpp"
#include "floormat/app.hpp"
#include "keys.hpp"
+#include "object-id.hpp"
#include <memory>
#include <Corrade/Containers/Pointer.h>
#include <Corrade/Containers/Optional.h>
@@ -33,7 +34,7 @@ struct cursor_state final {
struct clickable;
-enum class Cursor: std::uint32_t {
+enum class Cursor: uint32_t {
Arrow, TextInput, Wait, Crosshair, WaitArrow,
ResizeNWSE, ResizeNESW, ResizeWE, ResizeNS, ResizeAll,
No, Hand, Hidden, HiddenLocked,
@@ -96,7 +97,7 @@ private:
void on_mouse_enter() noexcept override;
void do_mouse_move(int modifiers);
- void do_mouse_up_down(std::uint8_t button, bool is_down, int modifiers);
+ void do_mouse_up_down(uint8_t button, bool is_down, int modifiers);
void do_camera(float dt, const key_set& cmds, int mods);
void reset_camera_offset();
@@ -150,7 +151,7 @@ private:
key_set keys;
std::array<int, key_set::COUNT> key_modifiers = {};
std::vector<popup_target> inspectors;
- std::uint64_t _character_id = 0;
+ object_id _character_id = 0;
cursor_state cursor;
popup_target _popup_target;
diff --git a/editor/draw.cpp b/editor/draw.cpp
index 5cd6a124..611e77fc 100644
--- a/editor/draw.cpp
+++ b/editor/draw.cpp
@@ -74,8 +74,8 @@ void app::draw_collision_boxes()
using rtree_type = std::decay_t<decltype(*world[chunk_coords{}].rtree())>;
using rect_type = typename rtree_type::Rect;
- for (std::int16_t y = miny; y <= maxy; y++)
- for (std::int16_t x = minx; x <= maxx; x++)
+ for (int16_t y = miny; y <= maxy; y++)
+ for (int16_t x = minx; x <= maxx; x++)
{
const chunk_coords pos{x, y};
auto& c = world[pos];
@@ -87,7 +87,7 @@ void app::draw_collision_boxes()
{
constexpr float maxf = 1 << 24, max2f[] = { maxf, maxf }, min2f[] = { -maxf, -maxf };
const auto* rtree = c.rtree();
- rtree->Search(min2f, max2f, [&](std::uint64_t data, const rect_type& rect) {
+ rtree->Search(min2f, max2f, [&](object_id data, const rect_type& rect) {
[[maybe_unused]] auto x = std::bit_cast<collision_data>(data);
Vector2 start(rect.m_min[0], rect.m_min[1]), end(rect.m_max[0], rect.m_max[1]);
auto size = (end - start);
@@ -110,8 +110,8 @@ void app::draw_collision_boxes()
const auto subpixel_ = Vector2(std::fmod(tile_[0], 1.f), std::fmod(tile_[1], 1.f));
const auto subpixel = m * Vector2(curchunk[0] < 0 ? 1 + subpixel_[0] : subpixel_[0],
curchunk[1] < 0 ? 1 + subpixel_[1] : subpixel_[1]);
- for (std::int16_t y = miny; y <= maxy; y++)
- for (std::int16_t x = minx; x <= maxx; x++)
+ for (int16_t y = miny; y <= maxy; y++)
+ for (int16_t x = minx; x <= maxx; x++)
{
const chunk_coords c_pos{x, y};
auto& c = world[c_pos];
@@ -127,7 +127,7 @@ void app::draw_collision_boxes()
auto t0 = chunk_dist + curtile*TILE_SIZE2 + subpixel - half_tile;
auto t1 = t0+Vector2(1e-4f);
const auto* rtree = c.rtree();
- rtree->Search(t0.data(), t1.data(), [&](std::uint64_t data, const rect_type& rect) {
+ rtree->Search(t0.data(), t1.data(), [&](uint64_t data, const rect_type& rect) {
[[maybe_unused]] auto x = std::bit_cast<collision_data>(data);
Vector2 start(rect.m_min[0], rect.m_min[1]), end(rect.m_max[0], rect.m_max[1]);
auto size = end - start;
@@ -168,7 +168,7 @@ clickable* app::find_clickable_scenery(const Optional<Vector2i>& pixel)
{
const auto pos_ = *pixel - c.dest.min() + Vector2i(c.src.min());
const auto pos = !c.mirrored ? pos_ : Vector2i(int(c.src.sizeX()) - 1 - pos_[0], pos_[1]);
- std::size_t idx = unsigned(pos.y()) * c.stride + unsigned(pos.x());
+ size_t idx = unsigned(pos.y()) * c.stride + unsigned(pos.x());
fm_assert(idx < c.bitmask.size());
if (c.bitmask[idx])
{
diff --git a/editor/editor.cpp b/editor/editor.cpp
index cfb36480..f09030dc 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -69,10 +69,10 @@ void editor::on_mouse_move(world& world, global_coords& pos, int mods)
const auto [minx, maxx] = std::minmax(draw_coord.x, last.draw_coord.x);
const auto [miny, maxy] = std::minmax(draw_coord.y, last.draw_coord.y);
if (draw_offset[0])
- for (std::uint32_t i = minx; i <= maxx; i++)
+ for (uint32_t i = minx; i <= maxx; i++)
on_click_(world, { i, draw_coord.y }, last.btn);
else
- for (std::uint32_t j = miny; j <= maxy; j++)
+ for (uint32_t j = miny; j <= maxy; j++)
on_click_(world, { draw_coord.x, j }, last.btn);
}
else
diff --git a/editor/events.cpp b/editor/events.cpp
index 2fb8b567..4e0a2503 100644
--- a/editor/events.cpp
+++ b/editor/events.cpp
@@ -76,7 +76,7 @@ void app::on_mouse_up_down(const mouse_button_event& event, bool is_down) noexce
Middle = mouse_button_middle,
};
- const auto button = std::uint8_t(1 << (event.button-1));
+ const auto button = uint8_t(1 << (event.button-1));
struct ev {
using Button = Button_;
@@ -175,7 +175,7 @@ void app::on_key_up_down(const key_event& event, bool is_down) noexcept
else
{
keys[x] = is_down;
- key_modifiers[std::size_t(x)] = mods;
+ key_modifiers[size_t(x)] = mods;
}
}
diff --git a/editor/imgui-inspect.cpp b/editor/imgui-inspect.cpp
index 42e7bec5..45b42b7b 100644
--- a/editor/imgui-inspect.cpp
+++ b/editor/imgui-inspect.cpp
@@ -19,7 +19,7 @@ void app::draw_inspector()
constexpr auto max_inspectors = 4; // todo change later to 32
if (auto size = inspectors.size(); size > max_inspectors)
{
- auto end = inspectors.begin() + (std::ptrdiff_t)size - max_inspectors;
+ auto end = inspectors.begin() + (ptrdiff_t)size - max_inspectors;
inspectors.erase(inspectors.begin(), end);
}
diff --git a/editor/imgui-raii.hpp b/editor/imgui-raii.hpp
index 8df8de38..9888b70b 100644
--- a/editor/imgui-raii.hpp
+++ b/editor/imgui-raii.hpp
@@ -40,7 +40,7 @@ private:
void text(StringView str, ImGuiTextFlags flags = ImGuiTextFlags_NoWidthForLargeClippedText);
-template<std::size_t N>
+template<size_t N>
void text(const char (&buf)[N], ImGuiTextFlags_ flags = ImGuiTextFlags_NoWidthForLargeClippedText)
{
ImGui::TextEx(buf, buf + N - 1, flags);
diff --git a/editor/imgui-tiles.cpp b/editor/imgui-tiles.cpp
index 57cdecba..ead843a8 100644
--- a/editor/imgui-tiles.cpp
+++ b/editor/imgui-tiles.cpp
@@ -48,7 +48,7 @@ void app::draw_editor_tile_pane_atlas(tile_editor& ed, StringView name, const st
push_style_color(ImGuiCol_ButtonHovered, color_hover),
};
const bool perm_selected = ed.is_permutation_selected(atlas);
- constexpr std::size_t per_row = 8;
+ constexpr size_t per_row = 8;
for (auto i = 0_uz; i < N; i++)
{
const bool selected = ed.is_tile_selected(atlas, i);
diff --git a/editor/inspect-types.cpp b/editor/inspect-types.cpp
index 85b77e46..f43bdc7a 100644
--- a/editor/inspect-types.cpp
+++ b/editor/inspect-types.cpp
@@ -32,10 +32,10 @@ struct entity_accessors<scenery> {
[](const scenery& x) { return x.r; },
[](scenery& x, rotation r) { x.rotate(x.index(), r); },
},
- entity::type<std::uint16_t>::field{"frame"_s,
+ entity::type<uint16_t>::field{"frame"_s,
[](const scenery& x) { return x.frame; },
- [](scenery& x, std::uint16_t value) { x.frame = value; },
- [](const scenery& x) { return constraints::range<std::uint16_t>{0, !x.atlas ? std::uint16_t(0) : std::uint16_t(x.atlas->info().nframes-1)}; }
+ [](scenery& x, uint16_t value) { x.frame = value; },
+ [](const scenery& x) { return constraints::range<uint16_t>{0, !x.atlas ? uint16_t(0) : uint16_t(x.atlas->info().nframes-1)}; }
},
entity::type<Vector2b>::field{"offset"_s,
[](const scenery& x) { return x.offset; },
@@ -79,17 +79,17 @@ template<> struct has_anim_atlas<scenery> : std::true_type {
}
};
-using enum_pair = std::pair<StringView, std::size_t>;
+using enum_pair = std::pair<StringView, size_t>;
template<typename T, typename U> struct enum_values;
-template<std::size_t N>
+template<size_t N>
struct enum_pair_array {
std::array<enum_pair, N> array;
- std::size_t size;
+ size_t size;
operator ArrayView<const enum_pair>() const noexcept { return {array.data(), size}; }
};
-template<std::size_t N> enum_pair_array(std::array<enum_pair, N> array, std::size_t) -> enum_pair_array<N>;
+template<size_t N> enum_pair_array(std::array<enum_pair, N> array, size_t) -> enum_pair_array<N>;
template<typename T, typename U>
requires (!std::is_enum_v<T>)
@@ -99,10 +99,10 @@ struct enum_values<T, U> : std::true_type {
template<typename U> struct enum_values<pass_mode, U> : std::true_type {
static constexpr auto ret = std::to_array<enum_pair>({
- { "blocked"_s, (std::size_t)pass_mode::blocked, },
- { "see-through"_s, (std::size_t)pass_mode::see_through, },
- { "shoot-through"_s, (std::size_t)pass_mode::shoot_through, },
- { "pass"_s, (std::size_t)pass_mode::pass },
+ { "blocked"_s, (size_t)pass_mode::blocked, },
+ { "see-through"_s, (size_t)pass_mode::see_through, },
+ { "shoot-through"_s, (size_t)pass_mode::shoot_through, },
+ { "pass"_s, (size_t)pass_mode::pass },
});
static constexpr const auto& get() { return ret; }
};
@@ -112,7 +112,7 @@ requires has_anim_atlas<U>::value
struct enum_values<rotation, U> : std::false_type {
static auto get(const U& x) {
const anim_atlas& atlas = has_anim_atlas<U>::get_atlas(x);
- std::array<enum_pair, (std::size_t)rotation_COUNT> array;
+ std::array<enum_pair, (size_t)rotation_COUNT> array;
constexpr std::pair<StringView, rotation> values[] = {
{ "North"_s, rotation::N },
{ "Northeast"_s, rotation::NE },
@@ -123,10 +123,10 @@ struct enum_values<rotation, U> : std::false_type {
{ "West"_s, rotation::W },
{ "Northwest"_s, rotation::NW },
};
- std::size_t i = 0;
+ size_t i = 0;
for (auto [str, val] : values)
if (atlas.check_rotation(val))
- array[i++] = enum_pair{str, (std::size_t)val};
+ array[i++] = enum_pair{str, (size_t)val};
return enum_pair_array{array, i};
}
};
diff --git a/editor/inspect.cpp b/editor/inspect.cpp
index f68df7d1..0609c4be 100644
--- a/editor/inspect.cpp
+++ b/editor/inspect.cpp
@@ -16,7 +16,7 @@ namespace floormat::entities {
namespace {
-const char* label_left(StringView label, char* buf, std::size_t len)
+const char* label_left(StringView label, char* buf, size_t len)
{
std::snprintf(buf, len, "##%s", label.data());
float width = ImGui::CalcItemWidth(), x = ImGui::GetCursorPosX();
@@ -28,12 +28,12 @@ const char* label_left(StringView label, char* buf, std::size_t len)
}
template<typename T> struct IGDT_;
-template<> struct IGDT_<std::uint8_t> : std::integral_constant<int, ImGuiDataType_U8> {};
-template<> struct IGDT_<std::int8_t> : std::integral_constant<int, ImGuiDataType_S8> {};
-template<> struct IGDT_<std::uint16_t> : std::integral_constant<int, ImGuiDataType_U16> {};
-template<> struct IGDT_<std::int16_t> : std::integral_constant<int, ImGuiDataType_S16> {};
-template<> struct IGDT_<std::uint32_t> : std::integral_constant<int, ImGuiDataType_U32> {};
-template<> struct IGDT_<std::int32_t> : std::integral_constant<int, ImGuiDataType_S32> {};
+template<> struct IGDT_<uint8_t> : std::integral_constant<int, ImGuiDataType_U8> {};
+template<> struct IGDT_<int8_t> : std::integral_constant<int, ImGuiDataType_S8> {};
+template<> struct IGDT_<uint16_t> : std::integral_constant<int, ImGuiDataType_U16> {};
+template<> struct IGDT_<int16_t> : std::integral_constant<int, ImGuiDataType_S16> {};
+template<> struct IGDT_<uint32_t> : std::integral_constant<int, ImGuiDataType_U32> {};
+template<> struct IGDT_<int32_t> : std::integral_constant<int, ImGuiDataType_S32> {};
template<> struct IGDT_<float> : std::integral_constant<int, ImGuiDataType_Float> {};
template<typename T> constexpr auto IGDT = IGDT_<T>::value;
@@ -43,7 +43,7 @@ using namespace entities;
template<typename T> requires std::is_integral_v<T> constexpr bool eqv(T a, T b) { return a == b; }
inline bool eqv(float a, float b) { return std::fabs(a - b) < 1e-8f; }
inline bool eqv(const String& a, const String& b) { return a == b; }
-template<typename T, std::size_t N> constexpr bool eqv(const Math::Vector<N, T>& a, const Math::Vector<N, T>& b) { return a == b; }
+template<typename T, size_t N> constexpr bool eqv(const Math::Vector<N, T>& a, const Math::Vector<N, T>& b) { return a == b; }
int corrade_string_resize_callback(ImGuiInputTextCallbackData* data)
{
@@ -51,7 +51,7 @@ int corrade_string_resize_callback(ImGuiInputTextCallbackData* data)
{
auto* my_str = reinterpret_cast<String*>(data->UserData);
fm_assert(my_str->begin() == data->Buf);
- *my_str = String{ValueInit, (std::size_t)data->BufSize};
+ *my_str = String{ValueInit, (size_t)data->BufSize};
data->Buf = my_str->begin();
}
return 0;
@@ -59,7 +59,7 @@ int corrade_string_resize_callback(ImGuiInputTextCallbackData* data)
template<typename T>
bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr repr,
- const ArrayView<const std::pair<StringView, std::size_t>>& list)
+ const ArrayView<const std::pair<StringView, size_t>>& list)
{
if (list.isEmpty())
fm_assert(accessor.check_field_type<T>());
@@ -101,7 +101,7 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r
step2(!std::is_floating_point_v<T> ? T(10) : T(1e-3f));
switch (repr)
{
- default: fm_warn_once("invalid repr enum value '%zu'", (std::size_t)repr); break;
+ default: fm_warn_once("invalid repr enum value '%zu'", (size_t)repr); break;
case field_repr::input: ret = ImGui::InputScalar(label, igdt, &value, &step, &step2); break;
case field_repr::slider: ret = ImGui::SliderScalar(label, igdt, &value, &min, &max); break;
case field_repr::drag: ret = ImGui::DragScalar(label, igdt, &value, 1, &min, &max); break;
@@ -109,7 +109,7 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r
if constexpr(std::is_integral_v<T>)
{
const char* preview = "<invalid>";
- const auto old_value = (std::size_t)static_cast<std::make_unsigned_t<T>>(value);
+ const auto old_value = (size_t)static_cast<std::make_unsigned_t<T>>(value);
for (const auto& [str, x] : list)
if (x == old_value)
{
@@ -119,7 +119,7 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r
if (auto b = begin_combo(label, preview))
for (const auto& [str, x] : list)
{
- const bool is_selected = x == (std::size_t)old_value;
+ const bool is_selected = x == (size_t)old_value;
if (ImGui::Selectable(str.data(), is_selected))
value = T(x), ret = true;
if (is_selected)
@@ -141,7 +141,7 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r
switch (repr)
{
default:
- fm_warn_once("invalid repr enum value '%zu'", (std::size_t)repr);
+ fm_warn_once("invalid repr enum value '%zu'", (size_t)repr);
break;
case field_repr::input:
ret = ImGui::InputScalarN(label, igdt, &value, T::Size, &step, &step2);
@@ -171,7 +171,7 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r
#define MAKE_SPEC(type, repr) \
template<> \
bool inspect_field<type>(void* datum, const erased_accessor& accessor, \
- const ArrayView<const std::pair<StringView, std::size_t>>& list) \
+ const ArrayView<const std::pair<StringView, size_t>>& list) \
{ \
return do_inspect_field<type>(datum, accessor, (repr), list); \
}
@@ -179,7 +179,7 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r
#define MAKE_SPEC2(type, repr) \
template<> \
bool inspect_field<field_repr_<type, field_repr, repr>>(void* datum, const erased_accessor& accessor, \
- const ArrayView<const std::pair<StringView, std::size_t>>& list) \
+ const ArrayView<const std::pair<StringView, size_t>>& list) \
{ \
return do_inspect_field<type>(datum, accessor, (repr), list); \
}
@@ -197,12 +197,12 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r
MAKE_SPEC_REPRS(type) \
MAKE_SPEC2(type, field_repr::cbx)
-MAKE_SPEC_REPRS2(std::uint8_t)
-MAKE_SPEC_REPRS2(std::int8_t)
-MAKE_SPEC_REPRS2(std::uint16_t)
-MAKE_SPEC_REPRS2(std::int16_t)
-MAKE_SPEC_REPRS2(std::uint32_t)
-MAKE_SPEC_REPRS2(std::int32_t)
+MAKE_SPEC_REPRS2(uint8_t)
+MAKE_SPEC_REPRS2(int8_t)
+MAKE_SPEC_REPRS2(uint16_t)
+MAKE_SPEC_REPRS2(int16_t)
+MAKE_SPEC_REPRS2(uint32_t)
+MAKE_SPEC_REPRS2(int32_t)
MAKE_SPEC_REPRS2(float)
MAKE_SPEC(bool, field_repr::input)
MAKE_SPEC(String, field_repr::input)
diff --git a/editor/inspect.hpp b/editor/inspect.hpp
index 25ec8ec4..98649e13 100644
--- a/editor/inspect.hpp
+++ b/editor/inspect.hpp
@@ -1,5 +1,4 @@
#pragma once
-#include <cstddef>
#include <utility>
namespace floormat::entities {
@@ -28,11 +27,11 @@ template<typename T> using field_repr_drag = field_repr_<T, field_repr, field_re
template<typename T> using field_repr_cbx = field_repr_<T, field_repr, field_repr::cbx>;
template<typename T> bool inspect_field(void* datum, const entities::erased_accessor& accessor,
- const ArrayView<const std::pair<StringView, std::size_t>>& list);
+ const ArrayView<const std::pair<StringView, size_t>>& list);
template<typename T> bool inspect_type(T& x);
template<typename T> requires std::is_enum_v<T> bool inspect_field(void* datum, const entities::erased_accessor& accessor,
- const ArrayView<const std::pair<StringView, std::size_t>>& list)
+ const ArrayView<const std::pair<StringView, size_t>>& list)
{
return inspect_field<field_repr_cbx<std::underlying_type_t<T>>>(datum, accessor, list);
}
diff --git a/editor/scenery-editor.cpp b/editor/scenery-editor.cpp
index 45dd0288..562ca04f 100644
--- a/editor/scenery-editor.cpp
+++ b/editor/scenery-editor.cpp
@@ -84,7 +84,7 @@ void scenery_editor::place_tile(world& w, global_coords pos, const scenery_& s)
// don't regen colliders
const auto px = Vector2(pos.local()) * TILE_SIZE2;
const auto es = c.entities();
- for (auto i = es.size()-1; i != (std::size_t)-1; i--)
+ for (auto i = es.size()-1; i != (size_t)-1; i--)
{
const auto& e = *es[i];
if (e.type != entity_type::scenery)
diff --git a/editor/tile-editor.cpp b/editor/tile-editor.cpp
index ffee3b66..4de40ab6 100644
--- a/editor/tile-editor.cpp
+++ b/editor/tile-editor.cpp
@@ -59,7 +59,7 @@ void tile_editor::clear_selection()
_selection_mode = sel_none;
}
-void tile_editor::select_tile(const std::shared_ptr<tile_atlas>& atlas, std::size_t variant)
+void tile_editor::select_tile(const std::shared_ptr<tile_atlas>& atlas, size_t variant)
{
fm_assert(atlas);
clear_selection();
@@ -75,7 +75,7 @@ void tile_editor::select_tile_permutation(const std::shared_ptr<tile_atlas>& atl
_permutation = { atlas, {} };
}
-bool tile_editor::is_tile_selected(const std::shared_ptr<const tile_atlas>& atlas, std::size_t variant) const
+bool tile_editor::is_tile_selected(const std::shared_ptr<const tile_atlas>& atlas, size_t variant) const
{
return atlas && _selection_mode == sel_tile && _selected_tile &&
atlas == _selected_tile.atlas && variant == _selected_tile.variant;
diff --git a/editor/tile-editor.hpp b/editor/tile-editor.hpp
index 5f2b00d6..321b75c6 100644
--- a/editor/tile-editor.hpp
+++ b/editor/tile-editor.hpp
@@ -48,9 +48,9 @@ public:
editor_wall_rotation rotation() const noexcept { return _rotation; }
void clear_selection();
- void select_tile(const std::shared_ptr<tile_atlas>& atlas, std::size_t variant);
+ void select_tile(const std::shared_ptr<tile_atlas>& atlas, size_t variant);
void select_tile_permutation(const std::shared_ptr<tile_atlas>& atlas);
- bool is_tile_selected(const std::shared_ptr<const tile_atlas>& atlas, std::size_t variant) const;
+ bool is_tile_selected(const std::shared_ptr<const tile_atlas>& atlas, size_t variant) const;
bool is_permutation_selected(const std::shared_ptr<const tile_atlas>& atlas) const;
bool is_atlas_selected(const std::shared_ptr<const tile_atlas>& atlas) const;
bool is_anything_selected() const;
diff --git a/editor/update.cpp b/editor/update.cpp
index e9570208..0d8f692e 100644
--- a/editor/update.cpp
+++ b/editor/update.cpp
@@ -48,7 +48,7 @@ void app::do_mouse_move(int mods)
_editor.on_mouse_move(M->world(), *cursor.tile, mods);
}
-void app::do_mouse_up_down(std::uint8_t button, bool is_down, int mods)
+void app::do_mouse_up_down(uint8_t button, bool is_down, int mods)
{
auto& w = M->world();
update_cursor_tile(cursor.pixel);
@@ -136,7 +136,7 @@ void app::do_key(key k, int mods)
{
default:
if (k >= key_NO_REPEAT)
- fm_warn("unhandled key: '%zu'", std::size_t(k));
+ fm_warn("unhandled key: '%zu'", size_t(k));
return;
case key_rotate_tile:
return do_rotate(false);
@@ -178,13 +178,13 @@ void app::update_world(float dt)
auto& world = M->world();
auto [minx, maxx, miny, maxy] = M->get_draw_bounds();
minx--; miny--; maxx++; maxy++;
- for (std::int16_t y = miny; y <= maxy; y++)
- for (std::int16_t x = minx; x <= maxx; x++)
+ for (int16_t y = miny; y <= maxy; y++)
+ for (int16_t x = minx; x <= maxx; x++)
{
auto& c = world[chunk_coords{x, y}];
const auto& es = c.entities();
const auto size = es.size();
- for (auto i = size-1; i != (std::size_t)-1; i--)
+ for (auto i = size-1; i != (size_t)-1; i--)
{
auto& e = *es[i];
e.update(i, dt);
@@ -208,9 +208,9 @@ void app::set_cursor()
if (!cursor.in_imgui)
{
if ([[maybe_unused]] auto* cl = find_clickable_scenery(cursor.pixel))
- M->set_cursor(std::uint32_t(Cursor::Hand));
+ M->set_cursor(uint32_t(Cursor::Hand));
else
- M->set_cursor(std::uint32_t(Cursor::Arrow));
+ M->set_cursor(uint32_t(Cursor::Arrow));
}
else
set_cursor_from_imgui();