[nostalgia] Start on new TileSheetEditor
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user