[nostalgia/gfx/studio] Cleanup
All checks were successful
Build / build (push) Successful in 3m32s

This commit is contained in:
Gary Talent 2025-02-01 15:14:24 -06:00
parent 5351e9aa0a
commit 804d78e116

View File

@ -3,7 +3,6 @@
*/
#include <cmath>
#include <iostream>
#include "drawcommand.hpp"
@ -120,7 +119,8 @@ void DrawCommand::lineUpdate(ox::Point a, ox::Point b) noexcept {
if (a.x > b.x) { --b.x; }
iterateLine(a, b, [this, &ss](int32_t const x, int32_t const y, int32_t const h) {
int const mod = h < 0 ? -1 : 1;
for (int32_t i{}; i < abs(h); ++i) {
auto const range = h * mod;
for (int32_t i{}; i < range; ++i) {
auto const idx = ptToIdx(x, y + i * mod, ss.columns * TileWidth);
if (idx < ss.pixels.size()) {
m_changes.emplace_back(static_cast<uint32_t>(idx), getPixel(ss, idx));