[nostalgia] Start on new TileSheetEditor

This commit is contained in:
2021-12-17 20:57:56 -06:00
parent ed074d07be
commit 775008a513
122 changed files with 651 additions and 2592 deletions
+3 -18
View File
@@ -1,15 +1,9 @@
/*
* Copyright 2016 - 2021 gary@drinkingtea.net
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* Copyright 2016 - 2021 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/
#pragma once
#include <QString>
#include <ox/std/error.hpp>
#include <ox/std/types.hpp>
@@ -19,16 +13,7 @@
namespace nostalgia::core {
[[nodiscard]] constexpr int pointToIdx(int w, int x, int y) noexcept {
constexpr auto colLength = PixelsPerTile;
const auto rowLength = (w / TileWidth) * colLength;
const auto colStart = colLength * (x / TileWidth);
const auto rowStart = rowLength * (y / TileHeight);
const auto colOffset = x % TileWidth;
const auto rowOffset = (y % TileHeight) * TileHeight;
return colStart + colOffset + rowStart + rowOffset;
}
[[nodiscard]] std::unique_ptr<core::NostalgiaGraphic> imgToNg(QString argInPath, int argBpp = -1);
[[nodiscard]]
ox::UniquePtr<core::NostalgiaGraphic> imgToNg(ox::String argInPath, int argBpp = -1);
}