diff --git a/src/engine.cpp b/src/engine.cpp index 1f3dfa8..6e36827 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -1,7 +1,6 @@ #include "engine.hpp" #include "audiodevice.hpp" -#include "entity.hpp" #include "entitymanager.hpp" #include "eventmanager.hpp" #include "framerate.hpp" @@ -170,7 +169,7 @@ void engine::_loop() noexcept { _overlay->update(delta); _entitymanager->update(delta); - for (auto &loopable : _loopables) { + for (const auto &loopable : _loopables) { loopable->loop(delta); } diff --git a/src/entity.hpp b/src/entity.hpp index f42a173..4e677fa 100644 --- a/src/entity.hpp +++ b/src/entity.hpp @@ -1,11 +1,9 @@ #pragma once -#include "anchor.hpp" #include "common.hpp" #include "entitymanager.hpp" #include "entityprops.hpp" #include "flip.hpp" -#include "resourcemanager.hpp" #include "vector2d.hpp" namespace framework { diff --git a/src/fontfactory.cpp b/src/fontfactory.cpp index c4ea528..5ce65b0 100644 --- a/src/fontfactory.cpp +++ b/src/fontfactory.cpp @@ -17,7 +17,7 @@ std::shared_ptr fontfactory::get(const std::string &name) { if (added) { std::cout << "[fontfactory] cache miss: " << name << std::endl; - const auto buffer = storage::io::read(name); + const auto buffer = storage::io::read(fmt::format("fonts/{}.json", name)); const auto j = json::parse(buffer); const auto alphabet = j["alphabet"].get(); diff --git a/src/label.cpp b/src/label.cpp index 48ee2b9..77f498d 100644 --- a/src/label.cpp +++ b/src/label.cpp @@ -24,7 +24,7 @@ void label::update(float_t delta) noexcept { } void label::draw() const noexcept { - if (!_font || _text.empty()) { + if (!_font || _text.empty()) [[unlikely]] { return; } diff --git a/src/overlay.hpp b/src/overlay.hpp index 4f7d850..8997522 100644 --- a/src/overlay.hpp +++ b/src/overlay.hpp @@ -1,7 +1,6 @@ #pragma once #include "common.hpp" -#include "fontfactory.hpp" #include "widget.hpp" namespace graphics {