diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-13 18:46:06 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-13 18:46:06 +0100 |
commit | 0aa97807cb9b7f1d1850449dd5a5e45b961445ce (patch) | |
tree | 8f6a808669a39f5b8d91079ecb30c3d1f11e9e02 /src/crepe/ComponentManager.cpp | |
parent | bc2a31190b5afe7754b04e9c61fcda30e577d7d8 (diff) |
fix scene_manager example
Diffstat (limited to 'src/crepe/ComponentManager.cpp')
-rw-r--r-- | src/crepe/ComponentManager.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/crepe/ComponentManager.cpp b/src/crepe/ComponentManager.cpp index c6b658c..1e23609 100644 --- a/src/crepe/ComponentManager.cpp +++ b/src/crepe/ComponentManager.cpp @@ -25,13 +25,11 @@ void ComponentManager::delete_all_components() { ComponentManager::ComponentManager() { dbg_trace(); } ComponentManager::~ComponentManager() { dbg_trace(); } -GameObject & ComponentManager::new_object(const string & name, +GameObject ComponentManager::new_object(const string & name, const string & tag, const Vector2 & position, double rotation, double scale) { - GameObject * object = new GameObject(*this, this->next_id, name, tag, - position, rotation, scale); - this->objects.push_front(unique_ptr<GameObject>(object)); + GameObject object{*this, this->next_id, name, tag, position, rotation, scale}; this->next_id++; - return *object; + return object; } |