]> git.bts.cx Git - benzene.git/blobdiff - src/bz/game/scene.c
Sprites
[benzene.git] / src / bz / game / scene.c
index 907fccb03e72b55a1c54bc051ba8ff59524895f9..f00ace6252ae1ab63c4c869d8d2a532d669d7d67 100644 (file)
@@ -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);