From: Philip Chimento Date: Sun, 16 Sep 2012 17:11:36 +0000 (+0200) Subject: Fix automatic resource file search X-Git-Tag: v0.9~3 X-Git-Url: https://git.stderr.nl/gitweb?p=projects%2Fchimara%2Fchimara.git;a=commitdiff_plain;h=61180dab8f5c29f5a29b83fcb7d62942f7a741d1 Fix automatic resource file search Fixes #21. Don't look for an extra resource file if the game to be loaded already has a blorb file extension. --- diff --git a/player/callbacks.c b/player/callbacks.c index a4cc173..94b9e5b 100644 --- a/player/callbacks.c +++ b/player/callbacks.c @@ -79,7 +79,18 @@ search_for_graphics_file(const char *filename, ChimaraIF *glk) /* First get the name of the story file */ char *scratch = g_path_get_basename(filename); - *(strrchr(scratch, '.')) = '\0'; + char *ext = strrchr(scratch, '.'); + if(strcmp(ext, ".zlb") == 0 || + strcmp(ext, ".zblorb") == 0 || + strcmp(ext, ".glb") == 0 || + strcmp(ext, ".gblorb") == 0 || + strcmp(ext, ".blorb") == 0 || + strcmp(ext, ".blb") == 0) + { + g_object_set(glk, "graphics-file", NULL, NULL); + return; + } + *ext = '\0'; /* Check in the stored resource path, if set */ char *resource_path;