diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/clickable.hpp | 2 | ||||
-rw-r--r-- | main/draw.cpp | 20 | ||||
-rw-r--r-- | main/events.cpp | 26 | ||||
-rw-r--r-- | main/main-impl.cpp | 6 | ||||
-rw-r--r-- | main/main-impl.hpp | 4 |
5 files changed, 29 insertions, 29 deletions
diff --git a/main/clickable.hpp b/main/clickable.hpp index 7311b451..38968d87 100644 --- a/main/clickable.hpp +++ b/main/clickable.hpp @@ -14,7 +14,7 @@ struct clickable final { BitArrayView bitmask; std::shared_ptr<entity> e; float depth; - std::uint32_t stride; + uint32_t stride; bool mirrored; }; diff --git a/main/draw.cpp b/main/draw.cpp index 84d90f65..5c36e8d1 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -43,7 +43,7 @@ void main_impl::recalc_viewport(Vector2i fb_size, Vector2i win_size) noexcept global_coords main_impl::pixel_to_tile(Vector2d position) const noexcept { auto vec = pixel_to_tile_(position); - const auto x = (std::int32_t)std::floor(vec[0]), y = (std::int32_t)std::floor(vec[1]); + const auto x = (int32_t)std::floor(vec[0]), y = (int32_t)std::floor(vec[1]); return { x, y }; } @@ -57,7 +57,7 @@ Vector2d main_impl::pixel_to_tile_(Vector2d position) const noexcept auto main_impl::get_draw_bounds() const noexcept -> draw_bounds { - using limits = std::numeric_limits<std::int16_t>; + using limits = std::numeric_limits<int16_t>; auto x0 = limits::max(), x1 = limits::min(), y0 = limits::max(), y1 = limits::min(); const auto win = Vector2d(window_size()); @@ -82,7 +82,7 @@ auto main_impl::get_draw_bounds() const noexcept -> draw_bounds void main_impl::update_collect_threshold() { const auto [minx, maxx, miny, maxy] = get_draw_bounds(); - const auto value = std::max(64_uz, (std::size_t)(maxx-minx+4)*(std::size_t)(maxy-minx+4)); + const auto value = std::max(64_uz, (size_t)(maxx-minx+4)*(size_t)(maxy-minx+4)); if (!(GL::Context::current().configurationFlags() & GL::Implementation::ContextConfigurationFlag::QuietLog)) fm_debug("collect threshold is now %zu", value); _world.set_collect_threshold(value); @@ -93,8 +93,8 @@ void main_impl::draw_world() noexcept const auto [minx, maxx, miny, maxy] = get_draw_bounds(); const auto sz = window_size(); - 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}; if (!_world.contains(pos)) @@ -109,8 +109,8 @@ void main_impl::draw_world() noexcept GL::Renderer::enable(GL::Renderer::Feature::DepthTest); GL::defaultFramebuffer.clearDepthStencil(0, 0); - 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]; @@ -125,8 +125,8 @@ void main_impl::draw_world() noexcept GL::Renderer::setDepthMask(false); - 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]; @@ -149,7 +149,7 @@ void main_impl::draw_world() noexcept bool floormat_main::check_chunk_visible(const Vector2d& offset, const Vector2i& size) noexcept { constexpr Vector3d len = dTILE_SIZE * TILE_MAX_DIM20d; - enum : std::size_t { x, y, }; + enum : size_t { x, y, }; constexpr Vector2d p00 = tile_shader::project(Vector3d(0, 0, 0)), p10 = tile_shader::project(Vector3d(len[x], 0, 0)), p01 = tile_shader::project(Vector3d(0, len[y], 0)), diff --git a/main/events.cpp b/main/events.cpp index 6222f964..6888132a 100644 --- a/main/events.cpp +++ b/main/events.cpp @@ -17,32 +17,32 @@ void main_impl::viewportEvent(Platform::Sdl2Application::ViewportEvent& event) void main_impl::mousePressEvent(Platform::Sdl2Application::MouseEvent& event) { app.on_mouse_up_down({event.position() * _virtual_scale, - (SDL_Keymod)(std::uint16_t)event.modifiers(), - mouse_button(SDL_BUTTON((std::uint8_t)event.button())), - std::uint8_t(std::min(255, event.clickCount()))}, + (SDL_Keymod)(uint16_t)event.modifiers(), + mouse_button(SDL_BUTTON((uint8_t)event.button())), + uint8_t(std::min(255, event.clickCount()))}, true); } void main_impl::mouseReleaseEvent(Platform::Sdl2Application::MouseEvent& event) { app.on_mouse_up_down({event.position() * _virtual_scale, - (SDL_Keymod)(std::uint16_t)event.modifiers(), - mouse_button(SDL_BUTTON((std::uint8_t)event.button())), - std::uint8_t(std::min(255, event.clickCount()))}, + (SDL_Keymod)(uint16_t)event.modifiers(), + mouse_button(SDL_BUTTON((uint8_t)event.button())), + uint8_t(std::min(255, event.clickCount()))}, false); } void main_impl::mouseMoveEvent(Platform::Sdl2Application::MouseMoveEvent& event) { app.on_mouse_move({event.position() * _virtual_scale, - (mouse_button)(std::uint8_t)std::uint32_t{event.buttons()}, - (SDL_Keymod)(std::uint16_t)event.modifiers()}); + (mouse_button)(uint8_t)uint32_t{event.buttons()}, + (SDL_Keymod)(uint16_t)event.modifiers()}); } void main_impl::mouseScrollEvent(Platform::Sdl2Application::MouseScrollEvent& event) { app.on_mouse_scroll({event.offset(), event.position() * _virtual_scale, - (SDL_Keymod)(std::uint16_t)event.modifiers()}); + (SDL_Keymod)(uint16_t)event.modifiers()}); } void main_impl::textInputEvent(Platform::Sdl2Application::TextInputEvent& event) @@ -59,16 +59,16 @@ void main_impl::textEditingEvent(Platform::Sdl2Application::TextEditingEvent& ev void main_impl::keyPressEvent(Platform::Sdl2Application::KeyEvent& event) { - app.on_key_up_down({(SDL_Keycode)(std::uint32_t)event.key(), - (SDL_Keymod)(std::uint16_t)event.modifiers(), + app.on_key_up_down({(SDL_Keycode)(uint32_t)event.key(), + (SDL_Keymod)(uint16_t)event.modifiers(), event.isRepeated()}, true); } void main_impl::keyReleaseEvent(Platform::Sdl2Application::KeyEvent& event) { - app.on_key_up_down({(SDL_Keycode)(std::uint32_t)event.key(), - (SDL_Keymod)(std::uint16_t)event.modifiers(), + app.on_key_up_down({(SDL_Keycode)(uint32_t)event.key(), + (SDL_Keymod)(uint16_t)event.modifiers(), event.isRepeated()}, false); } diff --git a/main/main-impl.cpp b/main/main-impl.cpp index a971edcf..8cde3e2f 100644 --- a/main/main-impl.cpp +++ b/main/main-impl.cpp @@ -46,15 +46,15 @@ Vector2i floormat_main::window_size() const noexcept return _framebuffer_size; } -void main_impl::set_cursor(std::uint32_t cursor) noexcept +void main_impl::set_cursor(uint32_t cursor) noexcept { setCursor(Cursor(cursor)); } -std::uint32_t main_impl::cursor() const noexcept +uint32_t main_impl::cursor() const noexcept { using App = Platform::Sdl2Application; - return (std::uint32_t)static_cast<App*>(const_cast<main_impl*>(this))->cursor(); + return (uint32_t)static_cast<App*>(const_cast<main_impl*>(this))->cursor(); } } // namespace floormat diff --git a/main/main-impl.hpp b/main/main-impl.hpp index 9e8527ad..e968951e 100644 --- a/main/main-impl.hpp +++ b/main/main-impl.hpp @@ -71,8 +71,8 @@ struct main_impl final : Platform::Sdl2Application, floormat_main void debug_callback(unsigned src, unsigned type, unsigned id, unsigned severity, StringView str) const; - void set_cursor(std::uint32_t cursor) noexcept override; - std::uint32_t cursor() const noexcept override; + void set_cursor(uint32_t cursor) noexcept override; + uint32_t cursor() const noexcept override; private: fm_settings s; |