From 2153593f3a684a6b771c98a8e0c385b50a1e8886 Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Wed, 11 Dec 2024 16:09:21 +0100 Subject: implemented feedback --- src/crepe/api/Animator.cpp | 6 +++--- src/crepe/api/Animator.h | 8 ++++---- src/crepe/api/Config.h | 2 +- src/crepe/api/LoopManager.h | 7 ++----- src/crepe/api/LoopTimer.h | 2 -- 5 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src/crepe/api') diff --git a/src/crepe/api/Animator.cpp b/src/crepe/api/Animator.cpp index 644363e..4ce4bf0 100644 --- a/src/crepe/api/Animator.cpp +++ b/src/crepe/api/Animator.cpp @@ -8,10 +8,10 @@ using namespace crepe; Animator::Animator(game_object_id_t id, Sprite & spritesheet, const ivec2 & single_frame_size, - const uvec2 & max_cell_size, const Animator::Data & data) + const uvec2 & grid_size, const Animator::Data & data) : Component(id), spritesheet(spritesheet), - max_cell_size(max_cell_size), + grid_size(grid_size), data(data) { dbg_trace(); @@ -52,6 +52,6 @@ void Animator::set_anim(int col) { void Animator::next_anim() { Animator::Data & ctx = this->data; - ctx.row = ctx.row++ % this->max_cell_size.x; + ctx.row = ctx.row++ % this->grid_size.x; this->spritesheet.mask.x = ctx.row * this->spritesheet.mask.w; } diff --git a/src/crepe/api/Animator.h b/src/crepe/api/Animator.h index 09f0134..5918800 100644 --- a/src/crepe/api/Animator.h +++ b/src/crepe/api/Animator.h @@ -77,14 +77,14 @@ public: * \param spritesheet the reference to the spritesheet * \param single_frame_size the width and height in pixels of a single frame inside the * spritesheet - * \param max_cell_size the max rows and columns inside the given spritesheet + * \param grid_size the max rows and columns inside the given spritesheet * \param data extra animation data for more control * * This constructor sets up the Animator with the given parameters, and initializes the * animation system. */ Animator(game_object_id_t id, Sprite & spritesheet, const ivec2 & single_frame_size, - const uvec2 & max_cell_size, const Animator::Data & data); + const uvec2 & grid_size, const Animator::Data & data); ~Animator(); // dbg_trace public: @@ -94,8 +94,8 @@ private: //! A reference to the Sprite sheet containing. Sprite & spritesheet; - //! The maximum number of rows and columns size - const uvec2 max_cell_size; + //! The maximum number of rows and columns inside the spritesheet + const uvec2 grid_size; //! Uses the spritesheet friend AnimatorSystem; diff --git a/src/crepe/api/Config.h b/src/crepe/api/Config.h index 73c9a4e..6472270 100644 --- a/src/crepe/api/Config.h +++ b/src/crepe/api/Config.h @@ -26,7 +26,7 @@ struct Config final { * * Only messages with equal or higher priority than this value will be logged. */ - Log::Level level = Log::Level::TRACE; + Log::Level level = Log::Level::INFO; /** * \brief Colored log output * diff --git a/src/crepe/api/LoopManager.h b/src/crepe/api/LoopManager.h index bf1a9f9..1bafa56 100644 --- a/src/crepe/api/LoopManager.h +++ b/src/crepe/api/LoopManager.h @@ -102,12 +102,9 @@ private: ResourceManager resource_manager{mediator}; //! Save manager instance SaveManager save_manager{mediator}; - + //! SDLContext instance SDLContext sdl_context{mediator}; - - ResourceManager res_man{mediator}; - - //! Loop timer \todo no more singletons! + //! LoopTimer instance LoopTimer loop_timer{mediator}; private: diff --git a/src/crepe/api/LoopTimer.h b/src/crepe/api/LoopTimer.h index 2a0b2a5..0a73a4c 100644 --- a/src/crepe/api/LoopTimer.h +++ b/src/crepe/api/LoopTimer.h @@ -5,8 +5,6 @@ namespace crepe { -class Mediator; - class LoopTimer : public Manager { public: /** -- cgit v1.2.3