[nostalgia/core/studio] Start tile sheet editor

This commit is contained in:
2019-11-26 23:23:12 -06:00
parent 69666a0b31
commit 8f21670439
13 changed files with 334 additions and 19 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ namespace {
}
[[nodiscard]] int pointToIdx(int w, int x, int y) {
const auto colLength = 64;
constexpr auto colLength = 64;
const auto rowLength = (w / 8) * colLength;
const auto colStart = colLength * (x / 8);
const auto rowStart = rowLength * (y / 8);
@@ -87,7 +87,7 @@ namespace {
for (int x = 0; x < src.width(); x++) {
for (int y = 0; y < src.height(); y++) {
auto destI = pointToIdx(src.width(), x, y);
if (destI <= argTiles * 64) {
if (destI < argTiles * 64) {
const auto c = src.pixel(x, y);
// assign color a color id for the palette
if (!colors.contains(c)) {