[nostalgia/core] Cleanup
This commit is contained in:
parent
bd665cfc35
commit
323d5d8d53
@ -2,12 +2,10 @@
|
||||
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||
*/
|
||||
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include <keel/keel.hpp>
|
||||
#include <nostalgia/core/gfx.hpp>
|
||||
#include <nostalgia/core/input.hpp>
|
||||
#include <nostalgia/core/opengl/gfx.hpp>
|
||||
|
||||
#include "core.hpp"
|
||||
|
@ -130,13 +130,13 @@ struct TileSheet {
|
||||
* Reads all pixels of this sheet or its children into the given pixel list
|
||||
* @param pixels
|
||||
*/
|
||||
constexpr void readPixelsTo(ox::Vector<uint8_t> *pPixels, int8_t bpp) const noexcept {
|
||||
if (subsheets.size()) {
|
||||
constexpr void readPixelsTo(ox::Vector<uint8_t> *pPixels, int8_t pBpp) const noexcept {
|
||||
if (!subsheets.empty()) {
|
||||
for (auto &s: subsheets) {
|
||||
s.readPixelsTo(pPixels);
|
||||
}
|
||||
} else {
|
||||
if (bpp == 4) {
|
||||
if (pBpp == 4) {
|
||||
for (auto p: this->pixels) {
|
||||
pPixels->emplace_back(p & 0b1111);
|
||||
pPixels->emplace_back(p >> 4);
|
||||
@ -154,7 +154,7 @@ struct TileSheet {
|
||||
* @param pixels
|
||||
*/
|
||||
constexpr void readPixelsTo(ox::Vector<uint8_t> *pPixels) const noexcept {
|
||||
if (subsheets.size()) {
|
||||
if (!subsheets.empty()) {
|
||||
for (auto &s: subsheets) {
|
||||
s.readPixelsTo(pPixels);
|
||||
}
|
||||
@ -384,7 +384,7 @@ struct TileSheet {
|
||||
const auto currentIdx = pIdx[pIdxIt];
|
||||
if (pSubsheet->subsheets.size() <= currentIdx) {
|
||||
auto out = pIdx;
|
||||
if (pSubsheet->subsheets.size()) {
|
||||
if (!pSubsheet->subsheets.empty()) {
|
||||
out.back().value = pSubsheet->subsheets.size() - 1;
|
||||
} else {
|
||||
out.pop_back();
|
||||
|
Loading…
x
Reference in New Issue
Block a user