aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api
diff options
context:
space:
mode:
authorheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-08 12:16:41 +0100
committerheavydemon21 <nielsstunnebrink1@gmail.com>2024-11-08 12:16:41 +0100
commit2e0b75fc51c4ef025f6b74f7f1648d04039bb955 (patch)
tree8f77d29c65b5b4e99b17accc5aea48c1115e10e4 /src/crepe/api
parent9f029bf458d43492093507f9b59a67f4f22c283c (diff)
fixed the includes and const settings
Diffstat (limited to 'src/crepe/api')
-rw-r--r--src/crepe/api/Animator.cpp6
-rw-r--r--src/crepe/api/Animator.h3
-rw-r--r--src/crepe/api/Camera.cpp9
-rw-r--r--src/crepe/api/Camera.h3
-rw-r--r--src/crepe/api/Sprite.cpp9
-rw-r--r--src/crepe/api/Sprite.h6
-rw-r--r--src/crepe/api/Texture.cpp2
7 files changed, 21 insertions, 17 deletions
diff --git a/src/crepe/api/Animator.cpp b/src/crepe/api/Animator.cpp
index 3834e0b..0896bb0 100644
--- a/src/crepe/api/Animator.cpp
+++ b/src/crepe/api/Animator.cpp
@@ -1,11 +1,11 @@
+#include <cstdint>
-#include "Animator.h"
#include "Component.h"
#include "api/Sprite.h"
-
#include "util/log.h"
-#include <cstdint>
+
+#include "Animator.h"
using namespace crepe;
diff --git a/src/crepe/api/Animator.h b/src/crepe/api/Animator.h
index 3493623..ec29a7f 100644
--- a/src/crepe/api/Animator.h
+++ b/src/crepe/api/Animator.h
@@ -1,8 +1,9 @@
#pragma once
+#include <cstdint>
+
#include "Component.h"
#include "api/Sprite.h"
-#include <cstdint>
namespace crepe {
class AnimatorSystem;
diff --git a/src/crepe/api/Camera.cpp b/src/crepe/api/Camera.cpp
index 46a56b2..d423131 100644
--- a/src/crepe/api/Camera.cpp
+++ b/src/crepe/api/Camera.cpp
@@ -1,14 +1,17 @@
+#include <cstdint>
-#include "Camera.h"
#include "Component.h"
#include "api/Color.h"
#include "util/log.h"
-#include <cstdint>
+
+#include "Camera.h"
using namespace crepe;
-Camera::Camera(uint32_t id, const Color& color) : Component(id), bg_color(color), aspect_width(640), aspect_height(480), zoom(1), x(0),y(0){
+Camera::Camera(uint32_t id, const Color & color)
+ : Component(id), bg_color(color), aspect_width(640), aspect_height(480),
+ zoom(1), x(0), y(0) {
dbg_trace();
}
diff --git a/src/crepe/api/Camera.h b/src/crepe/api/Camera.h
index 022496d..1ff9f37 100644
--- a/src/crepe/api/Camera.h
+++ b/src/crepe/api/Camera.h
@@ -1,8 +1,9 @@
#pragma once
+#include <cstdint>
+
#include "Component.h"
#include "api/Color.h"
-#include <cstdint>
namespace crepe {
diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp
index 3db8f2b..42e1177 100644
--- a/src/crepe/api/Sprite.cpp
+++ b/src/crepe/api/Sprite.cpp
@@ -1,17 +1,16 @@
-#include <cstdint>
#include <memory>
-#include "../util/log.h"
-
#include "Component.h"
-#include "Sprite.h"
#include "Texture.h"
#include "facade/SDLContext.h"
+#include "../util/log.h"
+
+#include "Sprite.h"
using namespace std;
using namespace crepe;
-Sprite::Sprite(game_object_id_t id, shared_ptr<Texture> image,
+Sprite::Sprite(game_object_id_t id, const shared_ptr<Texture> image,
const Color & color, const FlipSettings & flip)
: Component(id), color(color), flip(flip), sprite_image(image) {
dbg_trace();
diff --git a/src/crepe/api/Sprite.h b/src/crepe/api/Sprite.h
index 2e8b52a..6f83ac8 100644
--- a/src/crepe/api/Sprite.h
+++ b/src/crepe/api/Sprite.h
@@ -5,9 +5,9 @@
#include "api/Color.h"
#include "api/Texture.h"
-
#include "Component.h"
+
namespace crepe {
/**
@@ -62,7 +62,7 @@ public:
* \param color Color tint applied to the sprite.
* \param flip Flip settings for horizontal and vertical orientation.
*/
- Sprite(game_object_id_t id, std::shared_ptr<Texture> image,
+ Sprite(game_object_id_t id, const std::shared_ptr<Texture> image,
const Color & color, const FlipSettings & flip);
/**
@@ -72,7 +72,7 @@ public:
//! Texture used for the sprite
- std::shared_ptr<Texture> sprite_image;
+ const std::shared_ptr<Texture> sprite_image;
//! Color tint of the sprite
Color color;
//! Flip settings for the sprite
diff --git a/src/crepe/api/Texture.cpp b/src/crepe/api/Texture.cpp
index 5519e5e..f052e4d 100644
--- a/src/crepe/api/Texture.cpp
+++ b/src/crepe/api/Texture.cpp
@@ -2,8 +2,8 @@
#include "../facade/SDLContext.h"
#include "../util/log.h"
-
#include "Asset.h"
+
#include "Texture.h"
using namespace crepe;