X-Git-Url: https://git.bts.cx/benzene.git/blobdiff_plain/88fe7f92d3fd592960bc2534fcdc534021c870bc..a2fade1d5540d1017c26fd2d2f7733915088ff94:/src/bz/game/scene.c diff --git a/src/bz/game/scene.c b/src/bz/game/scene.c index 907fccb..f00ace6 100644 --- a/src/bz/game/scene.c +++ b/src/bz/game/scene.c @@ -180,15 +180,17 @@ BZSceneID bzGameSceneSwitch(BZMemoryArenaID arena, BZAudioPlaybackEngineID audio const char *spritesheetName = json_object_get_string(sceneJsonObject, "spritesheet"); if (spritesheetName != NULL) { - size_t imageWidth, imageHeight; - void *imageData = bzGfxLoadAsepriteImage(arena, &imageWidth, &imageHeight, spritesheetName); // FIXME, temp arena - bzGfxPrepareSpritesheet(arena, imageWidth, imageHeight, imageData); + size_t imageFrames, imageWidth, imageHeight; + void *imageData = bzGfxLoadAsepriteImage(arena, &imageFrames, &imageWidth, &imageHeight, spritesheetName); // FIXME, temp arena + bzGfxPrepareSpritesheet(arena, imageFrames, imageWidth, imageHeight, imageData); //free(imageData); } const char *fontName = json_object_get_string(sceneJsonObject, "font"); - BZFont *font = bzGfxLoadFont(arena, fontName); // FIXME, temp arena?? - bzGfxPrepareFont(arena, font); + if (fontName != NULL) { + BZFont *font = bzGfxLoadFont(arena, fontName); // FIXME, temp arena?? + bzGfxPrepareFont(arena, font); + } JSON_Array *actorDefinitionsArray = json_object_get_array(sceneJsonObject, "actors"); size_t actorDefinitionsArrayCount = json_array_get_count(actorDefinitionsArray);