Use // line comments not /* block comments

This commit is contained in:
Rangi42
2025-01-27 18:11:50 -05:00
committed by Rangi
parent c5e59f40fd
commit b8b60207f5
81 changed files with 383 additions and 571 deletions

View File

@@ -1,4 +1,4 @@
/* SPDX-License-Identifier: MIT */
// SPDX-License-Identifier: MIT
#include "gfx/pal_packing.hpp"
@@ -27,15 +27,11 @@
// Tile | Proto-palette
// Page | Palette
/*
* A reference to a proto-palette, and attached attributes for sorting purposes
*/
// A reference to a proto-palette, and attached attributes for sorting purposes
struct ProtoPalAttrs {
size_t protoPalIndex;
/*
* Pages from which we are banned (to prevent infinite loops)
* This is dynamic because we wish not to hard-cap the amount of palettes
*/
// Pages from which we are banned (to prevent infinite loops)
// This is dynamic because we wish not to hard-cap the amount of palettes
std::vector<bool> bannedPages;
explicit ProtoPalAttrs(size_t index) : protoPalIndex(index) {}
@@ -50,10 +46,8 @@ struct ProtoPalAttrs {
}
};
/*
* A collection of proto-palettes assigned to a palette
* Does not contain the actual color indices because we need to be able to remove elements
*/
// A collection of proto-palettes assigned to a palette
// Does not contain the actual color indices because we need to be able to remove elements
class AssignedProtos {
// We leave room for emptied slots to avoid copying the structs around on removal
std::vector<std::optional<ProtoPalAttrs>> _assigned;
@@ -127,10 +121,8 @@ public:
}
const_iterator end() const { return const_iterator{&_assigned, _assigned.end()}; }
/*
* Assigns a new ProtoPalAttrs in a free slot, assuming there is one
* Args are passed to the `ProtoPalAttrs`'s constructor
*/
// Assigns a new ProtoPalAttrs in a free slot, assuming there is one
// Args are passed to the `ProtoPalAttrs`'s constructor
template<typename... Ts>
void assign(Ts &&...args) {
auto freeSlot =
@@ -192,9 +184,7 @@ private:
return colors;
}
public:
/*
* Returns the number of distinct colors
*/
// Returns the number of distinct colors
size_t volume() const { return uniqueColors().size(); }
bool canFit(ProtoPalette const &protoPal) const {
auto &colors = uniqueColors();
@@ -218,10 +208,8 @@ public:
return factor;
}();
/*
* Computes the "relative size" of a proto-palette on this palette;
* it's a measure of how much this proto-palette would "cost" to introduce.
*/
// Computes the "relative size" of a proto-palette on this palette;
// it's a measure of how much this proto-palette would "cost" to introduce.
uint32_t relSizeOf(ProtoPalette const &protoPal) const {
// NOTE: this function must not call `uniqueColors`, or one of its callers will break!
@@ -244,9 +232,7 @@ public:
return relSize;
}
/*
* Computes the "relative size" of a set of proto-palettes on this palette
*/
// Computes the "relative size" of a set of proto-palettes on this palette
template<typename Iter>
auto combinedVolume(Iter &&begin, Iter const &end, std::vector<ProtoPalette> const &protoPals)
const {
@@ -254,9 +240,7 @@ public:
addUniqueColors(colors, std::forward<Iter>(begin), end, protoPals);
return colors.size();
}
/*
* Computes the "relative size" of a set of colors on this palette
*/
// Computes the "relative size" of a set of colors on this palette
template<typename Iter>
auto combinedVolume(Iter &&begin, Iter &&end) const {
auto &colors = uniqueColors();