Scene methods
This commit is contained in:
@@ -6,18 +6,13 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "error/error.h"
|
||||
#include "script/scriptcontext.h"
|
||||
|
||||
typedef struct {
|
||||
const char_t *name;
|
||||
errorret_t (*init)(void);
|
||||
void (*update)(void);
|
||||
void (*render)(void);
|
||||
void (*dispose)(void);
|
||||
scriptcontext_t scriptContext;
|
||||
} scene_t;
|
||||
|
||||
extern const scene_t SCENES[];
|
||||
extern uint_fast8_t SCENE_CURRENT;
|
||||
extern scene_t SCENE;
|
||||
|
||||
/**
|
||||
* Initialize the scene subsystem.
|
||||
@@ -34,30 +29,14 @@ void sceneUpdate(void);
|
||||
*/
|
||||
void sceneRender(void);
|
||||
|
||||
/**
|
||||
* Set the current scene by script name.
|
||||
*
|
||||
* @param script The script name of the scene to set.
|
||||
*/
|
||||
errorret_t sceneSet(const char_t *script);
|
||||
|
||||
/**
|
||||
* Dispose of the scene subsystem.
|
||||
*/
|
||||
void sceneDispose(void);
|
||||
|
||||
/**
|
||||
* Set the current scene.
|
||||
*
|
||||
* @param sceneIndex The index of the scene to set.
|
||||
* @return An error code indicating success or failure.
|
||||
*/
|
||||
errorret_t sceneSet(const scene_t *scene);
|
||||
|
||||
/**
|
||||
* Get the current scene.
|
||||
*
|
||||
* @return The current scene.
|
||||
*/
|
||||
const scene_t* sceneGetCurrent(void);
|
||||
|
||||
/**
|
||||
* Get a scene by its name.
|
||||
*
|
||||
* @param name The name of the scene.
|
||||
* @return The scene with the given name, or NULL if not found.
|
||||
*/
|
||||
const scene_t* sceneGetByName(const char_t *name);
|
||||
void sceneDispose(void);
|
||||
Reference in New Issue
Block a user