This commit is contained in:
2026-07-19 22:12:53 -05:00
parent e80d693d85
commit 373f1c1010
24 changed files with 1646 additions and 16 deletions
+25 -1
View File
@@ -8,9 +8,33 @@
#include "game/game.h"
#include "scene/scene.h"
#include "scene/overworldscene.h"
#include "assert/assert.h"
#include "asset/asset.h"
#include "yyjson.h"
#define GAME_TEST_SCENE_ASSET "scenes/test.json"
errorret_t gameInit(void) {
sceneSetActive(overworldSceneCreate());
// overworldSceneCreate();
sceneid_t testSceneId = sceneCreate();
// Exercises sceneDeserialize() end-to-end: a camera looking at a
// colored cube that falls under gravity onto a static ground plane,
// described entirely as JSON rather than built with the entity API.
assetentry_t *sceneEntry = assetLock(
GAME_TEST_SCENE_ASSET, ASSET_LOADER_TYPE_JSON, NULL
);
errorret_t ret = assetRequireLoaded(sceneEntry);
if(errorIsOk(ret)) {
ret = sceneDeserialize(
testSceneId, yyjson_doc_get_root(sceneEntry->data.json)
);
}
assetUnlockEntry(sceneEntry);
errorChain(ret);
sceneSetActive(testSceneId);
errorOk();
}