Added AsloEngine 0.9.0 to Repository
This commit is contained in:
parent
d017dd84b3
commit
881e6c70f2
60 changed files with 2648 additions and 0 deletions
51
asloengine/scenemanager.cpp
Executable file
51
asloengine/scenemanager.cpp
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
#include "headers/scenemanager.hpp"
|
||||
|
||||
namespace asloengine
|
||||
{
|
||||
|
||||
Scene *SceneManager::scene;
|
||||
Scene *SceneManager::next_scene;
|
||||
|
||||
void SceneManager::load_scene(Scene *_scene)
|
||||
{
|
||||
|
||||
unload_scene();
|
||||
|
||||
scene = _scene;
|
||||
|
||||
scene->load();
|
||||
|
||||
}
|
||||
|
||||
void SceneManager::load_scene(Scene *_scene, sf::RenderWindow *window)
|
||||
{
|
||||
|
||||
unload_scene();
|
||||
|
||||
scene = _scene;
|
||||
|
||||
scene->load();
|
||||
scene->start(window);
|
||||
|
||||
}
|
||||
|
||||
void SceneManager::set_scene(Scene *_scene)
|
||||
{
|
||||
|
||||
next_scene = _scene;
|
||||
|
||||
}
|
||||
|
||||
void SceneManager::unload_scene()
|
||||
{
|
||||
LOG("UNLOAD");
|
||||
if (scene)
|
||||
{
|
||||
scene->destroy();
|
||||
delete scene;
|
||||
scene = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue