diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-28 07:53:24 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-28 07:53:24 +0100 |
commit | 14cbc9061ecd7ab1c9e58e5f9ba75a5216e1de2b (patch) | |
tree | cd395d82abf24ef2dca4376b5063ea39676177e3 | |
parent | ddb5bde6e5dd4d89faf419630086ece66690d6b5 (diff) |
feedback implemented
-rw-r--r-- | src/crepe/api/Camera.cpp | 4 | ||||
-rw-r--r-- | src/crepe/api/Camera.h | 4 | ||||
-rw-r--r-- | src/crepe/api/Sprite.h | 10 |
3 files changed, 5 insertions, 13 deletions
diff --git a/src/crepe/api/Camera.cpp b/src/crepe/api/Camera.cpp index 4397ac7..99a0831 100644 --- a/src/crepe/api/Camera.cpp +++ b/src/crepe/api/Camera.cpp @@ -1,3 +1,4 @@ +#include "types.h" #include "util/Log.h" #include "Camera.h" @@ -7,9 +8,10 @@ using namespace crepe; Camera::Camera(game_object_id_t id, const Color & bg_color, const ivec2 & screen, - const ivec2 & viewport, const double & zoom) + const ivec2 & viewport, const double & zoom, const vec2& offset) : Component(id), bg_color(bg_color), + offset(offset), screen(screen), viewport(viewport), zoom(zoom) { diff --git a/src/crepe/api/Camera.h b/src/crepe/api/Camera.h index 2ba37fc..8908caa 100644 --- a/src/crepe/api/Camera.h +++ b/src/crepe/api/Camera.h @@ -21,7 +21,7 @@ public: * \param id Unique identifier for the camera component. * \param bg_color Background color for the camera view. */ - Camera(game_object_id_t id, const Color & bg_color, const ivec2 & screen, const ivec2 & viewport, const double & zoom); + Camera(game_object_id_t id, const Color & bg_color, const ivec2 & screen, const ivec2 & viewport, const double & zoom, const vec2 & offset = {0,0}); ~Camera(); // dbg_trace only public: @@ -29,7 +29,7 @@ public: const Color bg_color; //! offset postion from the game object transform component - vec2 offset = {0, 0}; + vec2 offset; //! pos the postion of the camera in world space this will be filled with //pos = transform + offset diff --git a/src/crepe/api/Sprite.h b/src/crepe/api/Sprite.h index 1c40501..9644e72 100644 --- a/src/crepe/api/Sprite.h +++ b/src/crepe/api/Sprite.h @@ -77,16 +77,6 @@ public: * does it need to be calculated again in the Animator */ double aspect_ratio; - -public: - /** - * \brief Gets the maximum number of instances allowed for this sprite. - * \return Maximum instance count as an integer. - * - * For now is this number randomly picked. I think it will eventually be 1. - */ - virtual int get_instances_max() const { return 10; } - private: //! Reads the sprite_rect of sprite friend class SDLContext; |