aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/crepe/api/Animator.h4
-rw-r--r--src/crepe/api/Sprite.h4
-rw-r--r--src/crepe/facade/SDLContext.cpp6
-rw-r--r--src/crepe/manager/Mediator.h2
-rw-r--r--src/example/rendering_particle.cpp2
5 files changed, 10 insertions, 8 deletions
diff --git a/src/crepe/api/Animator.h b/src/crepe/api/Animator.h
index e0399a8..2a0a889 100644
--- a/src/crepe/api/Animator.h
+++ b/src/crepe/api/Animator.h
@@ -110,7 +110,8 @@ public:
* This constructor sets up the Animator with the given parameters, and initializes the
* animation system.
*/
- Animator(game_object_id_t id, Sprite & ss, unsigned int max_row, unsigned int max_col, const Animator::Data & ctx);
+ Animator(game_object_id_t id, Sprite & ss, unsigned int max_row, unsigned int max_col,
+ const Animator::Data & ctx);
~Animator(); // dbg_trace
public:
@@ -124,7 +125,6 @@ public:
const unsigned int row;
Animator::Data data;
-
};
} // namespace crepe
//
diff --git a/src/crepe/api/Sprite.h b/src/crepe/api/Sprite.h
index 0ccc296..78ed7ad 100644
--- a/src/crepe/api/Sprite.h
+++ b/src/crepe/api/Sprite.h
@@ -27,7 +27,7 @@ public:
//! vertical flip
bool flip_y = false;
};
-
+
struct Data {
//! Color tint of the sprite
Color color = Color::WHITE;
@@ -58,7 +58,7 @@ public:
//! independent sprite scale multiplier
float scale_offset = 1;
- //! independent sprite offset position
+ //! independent sprite offset position
vec2 position_offset;
};
diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp
index 9533b8a..cf9f7d5 100644
--- a/src/crepe/facade/SDLContext.cpp
+++ b/src/crepe/facade/SDLContext.cpp
@@ -243,8 +243,10 @@ SDL_FRect SDLContext::get_dst_rect(const DstRect & ctx) const {
size *= cam.render_scale * ctx.img_scale * data.scale_offset;
- vec2 screen_pos = (ctx.pos + data.position_offset - cam.cam_pos + (cam.zoomed_viewport) / 2) * cam.render_scale
- - size / 2 + cam.bar_size;
+ vec2 screen_pos
+ = (ctx.pos + data.position_offset - cam.cam_pos + (cam.zoomed_viewport) / 2)
+ * cam.render_scale
+ - size / 2 + cam.bar_size;
return SDL_FRect{
.x = screen_pos.x,
diff --git a/src/crepe/manager/Mediator.h b/src/crepe/manager/Mediator.h
index 5b53bcc..f8517a3 100644
--- a/src/crepe/manager/Mediator.h
+++ b/src/crepe/manager/Mediator.h
@@ -3,9 +3,9 @@
#include "../util/OptionalRef.h"
// TODO: remove these singletons:
+#include "../facade/SDLContext.h"
#include "EventManager.h"
#include "SaveManager.h"
-#include "../facade/SDLContext.h"
namespace crepe {
diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp
index 145bc5e..29d475d 100644
--- a/src/example/rendering_particle.cpp
+++ b/src/example/rendering_particle.cpp
@@ -57,7 +57,7 @@ public:
.order_in_layer = 2,
.size = {0, 100},
.angle_offset = 0,
- .position_offset = {100,0},
+ .position_offset = {100, 0},
});
auto & anim = game_object.add_component<Animator>(test_sprite, 4, 4,