Modules
This commit is contained in:
@@ -47,14 +47,11 @@ void sceneManagerRegisterScene(scene_t *scene) {
|
||||
SCENE_MANAGER.scenes[SCENE_MANAGER.sceneCount++] = scene;
|
||||
}
|
||||
|
||||
void sceneManagerSetScene(scene_t *scene) {
|
||||
if(SCENE_MANAGER.current) {
|
||||
// TODO: Should dispose?
|
||||
assertTrue(
|
||||
SCENE_MANAGER.current->flags & SCENE_FLAG_INITIALIZED,
|
||||
"Current scene not initialized"
|
||||
);
|
||||
|
||||
errorret_t sceneManagerSetScene(scene_t *scene) {
|
||||
if(
|
||||
SCENE_MANAGER.current &&
|
||||
(SCENE_MANAGER.current->flags & SCENE_FLAG_INITIALIZED) != 0
|
||||
) {
|
||||
SCENE_MANAGER.current->flags &= ~SCENE_FLAG_INITIALIZED;
|
||||
if(SCENE_MANAGER.current->dispose) {
|
||||
SCENE_MANAGER.current->dispose(&SCENE_MANAGER.sceneData);
|
||||
@@ -63,12 +60,12 @@ void sceneManagerSetScene(scene_t *scene) {
|
||||
|
||||
SCENE_MANAGER.current = scene;
|
||||
|
||||
if(scene) {
|
||||
assertTrue(
|
||||
(scene->flags & SCENE_FLAG_INITIALIZED) == 0,
|
||||
"Scene should not yet be initialized"
|
||||
);
|
||||
if(scene && scene->init) {
|
||||
scene->flags |= SCENE_FLAG_INITIALIZED;
|
||||
errorChain(scene->init(&SCENE_MANAGER.sceneData));
|
||||
}
|
||||
|
||||
errorOk();
|
||||
}
|
||||
|
||||
void sceneManagerUpdate(void) {
|
||||
|
||||
Reference in New Issue
Block a user