diff -r 622887f7e954 -r 9e25f080a33e src/scene.c --- a/src/scene.c Thu Apr 24 19:53:40 2025 +0200 +++ b/src/scene.c Fri Apr 25 18:38:08 2025 +0200 @@ -41,17 +41,25 @@ #include void asc_scene_init(AscScene *scene) { + if (scene->root != NULL) { + asc_wprintf("Scene %"PRIxPTR" is already initialized - initialization skipped.", (uintptr_t) scene); + return; + } asc_dprintf("Initialized scene %"PRIxPTR, (uintptr_t) scene); // TODO: how should we initialize the camera? scene->root = asc_scene_node_empty(); } void asc_scene_destroy(AscScene *scene) { + if (scene->root == NULL) return; + asc_dprintf("Destroyed scene %"PRIxPTR, (uintptr_t) scene); asc_scene_node_free(scene->root); } void asc_scene_draw(AscScene *scene, asc_recti viewport) { + if (scene->root == NULL) return; + // create render groups CxList *render_group[ASC_RENDER_GROUP_COUNT]; cx_for_n(i, ASC_RENDER_GROUP_COUNT) {