diff --git a/runtime/Sources/Core/SDLManager.cpp b/runtime/Sources/Core/SDLManager.cpp index 7aeef73..5f3aa50 100644 --- a/runtime/Sources/Core/SDLManager.cpp +++ b/runtime/Sources/Core/SDLManager.cpp @@ -275,7 +275,8 @@ namespace mlx default: break; } - m_binding_hook(&event); + if(m_binding_hook) + m_binding_hook(&event); } } diff --git a/runtime/Sources/Renderer/Image.cpp b/runtime/Sources/Renderer/Image.cpp index 6138f14..ee3ade6 100644 --- a/runtime/Sources/Renderer/Image.cpp +++ b/runtime/Sources/Renderer/Image.cpp @@ -243,9 +243,9 @@ namespace mlx if(moving_x >= static_cast(x + w) || moving_x >= m_width) { moving_x = x; + moving_y++; if(moving_y >= static_cast(y + h) || moving_y >= m_height) break; - moving_y++; } if constexpr(std::endian::native == std::endian::little) m_staging_buffer->GetMap()[(moving_y * m_width) + moving_x] = ReverseColor(pixels[i]); @@ -304,9 +304,9 @@ namespace mlx if(moving_x >= static_cast(x + w) || moving_x >= m_width) { moving_x = x; + moving_y++; if(moving_y >= static_cast(y + h) || moving_y >= m_height) break; - moving_y++; } if constexpr(std::endian::native == std::endian::little) dst[i] = ReverseColor(m_staging_buffer->GetMap()[(moving_y * m_width) + moving_x]);