Moved a few things around, definitely not clean but better.
Some checks failed
Build Dusk / run-tests (push) Failing after 2m3s
Build Dusk / build-linux (push) Successful in 2m13s
Build Dusk / build-psp (push) Successful in 1m56s

This commit is contained in:
2026-01-28 15:00:59 -06:00
parent c190271565
commit 794e0574ad
27 changed files with 558 additions and 66 deletions

View File

@@ -7,26 +7,20 @@
#include "assert/assert.h"
#include "util/memory.h"
#include "display/camera.h"
#include "display/camera/camera.h"
#include "display/screen.h"
scene_t SCENE;
camera_t cam;
errorret_t sceneInit(void) {
memoryZero(&SCENE, sizeof(scene_t));
cameraInitOrthographic(&cam);
errorChain(scriptContextInit(&SCENE.scriptContext));
errorOk();
}
void sceneUpdate(void) {
if(!scriptContextHasFunc(&SCENE.scriptContext, "sceneUpdate")) {
return;
}
if(!scriptContextHasFunc(&SCENE.scriptContext, "sceneUpdate")) return;
errorret_t err = scriptContextCallFunc(
&SCENE.scriptContext, "sceneUpdate", NULL, 0, NULL
@@ -35,20 +29,11 @@ void sceneUpdate(void) {
}
void sceneRender(void) {
if(!scriptContextHasFunc(&SCENE.scriptContext, "sceneRender")) {
return;
}
cam.orthographic.right = SCREEN.width;
cam.orthographic.bottom = SCREEN.height;
cam.orthographic.left = 0.0f;
cam.orthographic.top = 0.0f;
cameraPushMatrix(&cam);
if(!scriptContextHasFunc(&SCENE.scriptContext, "sceneRender")) return;
errorret_t err = scriptContextCallFunc(
&SCENE.scriptContext, "sceneRender", NULL, 0, NULL
);
cameraPopMatrix();
errorCatch(errorPrint(err));
}