Nothing really changed
This commit is contained in:
44
src/dusksdl2/display/scene/renderscene.c
Normal file
44
src/dusksdl2/display/scene/renderscene.c
Normal file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Copyright (c) 2025 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "renderscene.h"
|
||||
|
||||
renderscenecallback_t RENDER_SCENE_CALLBACKS[SCENE_COUNT] = {
|
||||
[SCENE_INITIAL] = {
|
||||
.init = NULL,
|
||||
.draw = NULL,
|
||||
.dispose = NULL
|
||||
},
|
||||
|
||||
[SCENE_OVERWORLD] = {
|
||||
.init = NULL,
|
||||
.draw = NULL,
|
||||
.dispose = NULL
|
||||
},
|
||||
};
|
||||
|
||||
void renderSceneInit(void) {
|
||||
for (int i = 0; i < SCENE_COUNT; i++) {
|
||||
if (RENDER_SCENE_CALLBACKS[i].init) {
|
||||
RENDER_SCENE_CALLBACKS[i].init();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void renderSceneDraw(void) {
|
||||
if(RENDER_SCENE_CALLBACKS[SCENE_CURRENT].draw) {
|
||||
RENDER_SCENE_CALLBACKS[SCENE_CURRENT].draw();
|
||||
}
|
||||
}
|
||||
|
||||
void renderSceneDispose(void) {
|
||||
for (int i = 0; i < SCENE_COUNT; i++) {
|
||||
if (RENDER_SCENE_CALLBACKS[i].dispose) {
|
||||
RENDER_SCENE_CALLBACKS[i].dispose();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user