diff options
Diffstat (limited to 'src/engine/engine.cpp')
-rw-r--r-- | src/engine/engine.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index c988c33..a05fed9 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -9,8 +9,8 @@ CLIGameEngine::CLIGameEngine(IGameFactory game_factory, ISceneFactory scene_fact std::shared_ptr<IInputHandler> input_handler, std::shared_ptr<ICursorController> cursor_controller, std::shared_ptr<IWindow> window) noexcept - : _game_factory(game_factory), - _scene_factory(scene_factory), + : _game_factory(std::move(game_factory)), + _scene_factory(std::move(scene_factory)), _input_handler(std::move(input_handler)), _cursor_controller(std::move(cursor_controller)), _window(std::move(window)) @@ -19,7 +19,7 @@ CLIGameEngine::CLIGameEngine(IGameFactory game_factory, ISceneFactory scene_fact void CLIGameEngine::start() noexcept { - auto scene = _scene_factory(_cursor_controller, _window); + std::shared_ptr<IScene> scene = _scene_factory(_cursor_controller, _window); scene->enter(); _input_handler->enter_raw_mode(); @@ -29,7 +29,7 @@ void CLIGameEngine::start() noexcept game->on_start(); std::atexit(normalize_lambda( - [this, scene, game]() + [this, scene, &game]() { scene->leave(); _input_handler->leave_raw_mode(); |