Scene methods
Some checks failed
Build Dusk / run-tests (push) Failing after 2m14s
Build Dusk / build-linux (push) Successful in 2m12s
Build Dusk / build-psp (push) Failing after 1m30s

This commit is contained in:
2026-01-28 10:31:31 -06:00
parent 25dc97e3cc
commit 6bdb4ae30d
20 changed files with 215 additions and 151 deletions

View File

@@ -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);