From 61180dab8f5c29f5a29b83fcb7d62942f7a741d1 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Sun, 16 Sep 2012 19:11:36 +0200 Subject: [PATCH] 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. --- player/callbacks.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; -- 2.30.2