Fix a bug in palette that kept it from being idempotent.

This commit is contained in:
Zed A. Shaw 2025-12-12 11:41:57 -05:00
parent 986b2612d4
commit 37b007d79c
5 changed files with 21 additions and 10 deletions

View file

@ -11,6 +11,7 @@
#include "animation.hpp"
#include "components.hpp"
#include "ai.hpp"
#include "palette.hpp"
using namespace combat;
using namespace boss;
@ -100,6 +101,7 @@ TEST_CASE("boss/systems.cpp works", "[combat-battle]") {
components::init();
sfml::Backend backend;
guecs::init(&backend);
ai::reset();
ai::init("ai");
animation::init();

View file

@ -7,6 +7,10 @@ using namespace fmt;
TEST_CASE("color palette test", "[color-palette]") {
palette::init();
REQUIRE(palette::initialized() == true);
// confirm it's idempotent
palette::init();
sf::Color expect{10, 10, 10, 255};
auto gui_text = palette::get("gui/theme:dark_dark");