aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api')
-rw-r--r--src/crepe/api/CMakeLists.txt6
-rw-r--r--src/crepe/api/Rigidbody.h2
-rw-r--r--src/crepe/api/Sprite.cpp6
-rw-r--r--src/crepe/api/Sprite.h2
-rw-r--r--src/crepe/api/Transform.cpp6
-rw-r--r--src/crepe/api/Transform.h3
6 files changed, 14 insertions, 11 deletions
diff --git a/src/crepe/api/CMakeLists.txt b/src/crepe/api/CMakeLists.txt
index f6de96e..f2d45eb 100644
--- a/src/crepe/api/CMakeLists.txt
+++ b/src/crepe/api/CMakeLists.txt
@@ -4,13 +4,14 @@ target_sources(crepe PUBLIC
Script.cpp
GameObject.cpp
Rigidbody.cpp
- Sprite.cpp
Force.cpp
ParticleEmitter.cpp
Transform.cpp
Color.cpp
Texture.cpp
AssetManager.cpp
+ Collider.cpp
+ Sprite.cpp
)
target_sources(crepe PUBLIC FILE_SET HEADERS FILES
@@ -21,9 +22,6 @@ target_sources(crepe PUBLIC FILE_SET HEADERS FILES
GameObject.hpp
Rigidbody.h
Sprite.h
- Force.h
- ParticleEmitter.h
- Transform.h
Point.h
Color.h
Texture.h
diff --git a/src/crepe/api/Rigidbody.h b/src/crepe/api/Rigidbody.h
index b7a0064..e59e217 100644
--- a/src/crepe/api/Rigidbody.h
+++ b/src/crepe/api/Rigidbody.h
@@ -3,7 +3,7 @@
#include "../Component.h"
#include <cstdint>
-namespace crepe::api {
+namespace crepe::api{
enum class BodyType {
Static, // Does not move (e.g. walls, ground ...)
diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp
index d9e26ab..3cc263e 100644
--- a/src/crepe/api/Sprite.cpp
+++ b/src/crepe/api/Sprite.cpp
@@ -1,8 +1,10 @@
#include "Sprite.h"
+#include "Component.h"
#include "api/Texture.h"
#include "util/log.h"
+#include <cstdint>
#include <memory>
#include <utility>
@@ -10,8 +12,8 @@ using namespace std;
using namespace crepe;
using namespace crepe::api;
-Sprite::Sprite(shared_ptr<Texture> image, const Color & color,
- const flip_settings & flip) : color(color), flip(flip), sprite_image(image) {
+Sprite::Sprite(uint32_t id, shared_ptr<Texture> image, const Color & color,
+ const flip_settings & 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 920f91e..3d9e911 100644
--- a/src/crepe/api/Sprite.h
+++ b/src/crepe/api/Sprite.h
@@ -17,7 +17,7 @@ struct flip_settings{
class Sprite : public Component {
public:
- Sprite(std::shared_ptr<Texture> image, const Color& color, const flip_settings& flip );
+ Sprite(uint32_t game_id, std::shared_ptr<Texture> image, const Color& color, const flip_settings& flip );
~Sprite();
std::shared_ptr<Texture> sprite_image;
Color color;
diff --git a/src/crepe/api/Transform.cpp b/src/crepe/api/Transform.cpp
index c83461f..4f22843 100644
--- a/src/crepe/api/Transform.cpp
+++ b/src/crepe/api/Transform.cpp
@@ -1,13 +1,15 @@
#include "Transform.h"
+#include "Component.h"
#include "api/Point.h"
#include "util/log.h"
+#include <cstdint>
using namespace crepe::api;
-Transform::Transform(Point & point, double rot, double scale)
- : position(point), rotation(rot), scale(scale) {
+Transform::Transform(uint32_t game_id, Point & point, double rot, double scale)
+ : Component(game_id), position(point), rotation(rot), scale(scale) {
dbg_trace();
}
Transform::~Transform() { dbg_trace(); }
diff --git a/src/crepe/api/Transform.h b/src/crepe/api/Transform.h
index a34ebb1..29e2a3d 100644
--- a/src/crepe/api/Transform.h
+++ b/src/crepe/api/Transform.h
@@ -2,11 +2,12 @@
#include "Component.h"
#include "api/Point.h"
+#include <cstdint>
namespace crepe::api {
class Transform : public Component {
public:
- Transform(Point&, double, double);
+ Transform(uint32_t id, Point&, double, double);
~Transform();
Point position; // Translation (shift)
double rotation; // Rotation, in radians