diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-04 08:31:05 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-04 08:31:05 +0100 |
commit | 63d50eea4e389e73e26f41452829dd48e6190c70 (patch) | |
tree | 82a8ef7a28fe7e069dbe9830adc28fd49dd85846 /src | |
parent | 06f65659fc6ffde7cabd2135040cbfbf089e5a24 (diff) | |
parent | 2585dc3cab48ccad0cfa0c63354662d656c86c46 (diff) |
Merge branch 'master' of github.com:lonkaars/crepe
Diffstat (limited to 'src')
-rw-r--r-- | src/crepe/api/Transform.cpp | 3 | ||||
-rw-r--r-- | src/example/audio_internal.cpp | 6 | ||||
-rw-r--r-- | src/example/log.cpp | 4 | ||||
-rw-r--r-- | src/example/script.cpp | 12 |
4 files changed, 13 insertions, 12 deletions
diff --git a/src/crepe/api/Transform.cpp b/src/crepe/api/Transform.cpp index 3b218bc..c76bc72 100644 --- a/src/crepe/api/Transform.cpp +++ b/src/crepe/api/Transform.cpp @@ -8,7 +8,8 @@ using namespace crepe::api; -Transform::Transform(uint32_t game_id, const Point & point, double rot, double scale) +Transform::Transform(uint32_t game_id, const Point & point, double rot, + double scale) : Component(game_id), position(point), rotation(rot), scale(scale) { dbg_trace(); } diff --git a/src/example/audio_internal.cpp b/src/example/audio_internal.cpp index f35ad9d..c7dd163 100644 --- a/src/example/audio_internal.cpp +++ b/src/example/audio_internal.cpp @@ -4,8 +4,8 @@ */ #include <crepe/Sound.h> -#include <crepe/util/log.h> #include <crepe/api/Config.h> +#include <crepe/util/log.h> #include <thread> @@ -16,7 +16,7 @@ using namespace std::chrono_literals; using std::make_unique; // Unrelated stuff that is not part of this POC -int _ = [] () { +int _ = []() { // Show dbg_trace() output auto & cfg = api::Config::get_instance(); cfg.log.level = util::LogLevel::TRACE; @@ -24,8 +24,6 @@ int _ = [] () { return 0; // satisfy compiler }(); - - int main() { // Load a background track (Ogg Vorbis) auto bgm = Sound("../mwe/audio/bgm.ogg"); diff --git a/src/example/log.cpp b/src/example/log.cpp index 04ab9cd..75f133c 100644 --- a/src/example/log.cpp +++ b/src/example/log.cpp @@ -10,13 +10,13 @@ using namespace crepe; using namespace crepe::util; // unrelated setup code -int _ = [] () { +int _ = []() { // make sure all log messages get printed auto & cfg = api::Config::get_instance(); cfg.log.level = util::LogLevel::TRACE; return 0; // satisfy compiler -} (); +}(); int main() { dbg_trace(); diff --git a/src/example/script.cpp b/src/example/script.cpp index cda9591..5df26e8 100644 --- a/src/example/script.cpp +++ b/src/example/script.cpp @@ -18,7 +18,7 @@ using namespace crepe::api; using namespace std; // Unrelated stuff that is not part of this POC -int _ = [] () { +int _ = []() { // Show dbg_trace() output auto & cfg = api::Config::get_instance(); cfg.log.level = util::LogLevel::TRACE; @@ -26,8 +26,6 @@ int _ = [] () { return 0; // satisfy compiler }(); - - // User-defined script: class MyScript : public Script { void update() { @@ -40,7 +38,12 @@ class MyScript : public Script { int main() { // Create game object with Transform and BehaviorScript components auto obj = GameObject(0, "name", "tag", 0); - obj.add_component<Transform>(Point { .x = 1.2, .y = 3.4, }, 0, 0); + obj.add_component<Transform>( + Point{ + .x = 1.2, + .y = 3.4, + }, + 0, 0); obj.add_component<BehaviorScript>().set_script<MyScript>(); // Get ScriptSystem singleton instance (this would normally be done from the @@ -51,4 +54,3 @@ int main() { return EXIT_SUCCESS; } - |