[nostalgia/core] Cleanup

This commit is contained in:
Gary Talent 2023-05-24 20:43:00 -05:00
parent bd665cfc35
commit 323d5d8d53
2 changed files with 5 additions and 7 deletions

View File

@ -2,12 +2,10 @@
* Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved. * Copyright 2016 - 2023 Gary Talent (gary@drinkingtea.net). All rights reserved.
*/ */
#include <glad/glad.h>
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#include <keel/keel.hpp> #include <keel/keel.hpp>
#include <nostalgia/core/gfx.hpp> #include <nostalgia/core/gfx.hpp>
#include <nostalgia/core/input.hpp>
#include <nostalgia/core/opengl/gfx.hpp> #include <nostalgia/core/opengl/gfx.hpp>
#include "core.hpp" #include "core.hpp"

View File

@ -130,13 +130,13 @@ struct TileSheet {
* Reads all pixels of this sheet or its children into the given pixel list * Reads all pixels of this sheet or its children into the given pixel list
* @param pixels * @param pixels
*/ */
constexpr void readPixelsTo(ox::Vector<uint8_t> *pPixels, int8_t bpp) const noexcept { constexpr void readPixelsTo(ox::Vector<uint8_t> *pPixels, int8_t pBpp) const noexcept {
if (subsheets.size()) { if (!subsheets.empty()) {
for (auto &s: subsheets) { for (auto &s: subsheets) {
s.readPixelsTo(pPixels); s.readPixelsTo(pPixels);
} }
} else { } else {
if (bpp == 4) { if (pBpp == 4) {
for (auto p: this->pixels) { for (auto p: this->pixels) {
pPixels->emplace_back(p & 0b1111); pPixels->emplace_back(p & 0b1111);
pPixels->emplace_back(p >> 4); pPixels->emplace_back(p >> 4);
@ -154,7 +154,7 @@ struct TileSheet {
* @param pixels * @param pixels
*/ */
constexpr void readPixelsTo(ox::Vector<uint8_t> *pPixels) const noexcept { constexpr void readPixelsTo(ox::Vector<uint8_t> *pPixels) const noexcept {
if (subsheets.size()) { if (!subsheets.empty()) {
for (auto &s: subsheets) { for (auto &s: subsheets) {
s.readPixelsTo(pPixels); s.readPixelsTo(pPixels);
} }
@ -384,7 +384,7 @@ struct TileSheet {
const auto currentIdx = pIdx[pIdxIt]; const auto currentIdx = pIdx[pIdxIt];
if (pSubsheet->subsheets.size() <= currentIdx) { if (pSubsheet->subsheets.size() <= currentIdx) {
auto out = pIdx; auto out = pIdx;
if (pSubsheet->subsheets.size()) { if (!pSubsheet->subsheets.empty()) {
out.back().value = pSubsheet->subsheets.size() - 1; out.back().value = pSubsheet->subsheets.size() - 1;
} else { } else {
out.pop_back(); out.pop_back();