X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=libchimara%2Fchimara-if.c;h=2048f95d8783ee7df28adf825ce05f72da824f18;hb=28c8862dc3d26a9a3735d0c2eb22ceb04be632c8;hp=4e8c1d9490b4fcbc38f0e471703a2fcc35fd5c29;hpb=89081782541e85e079f64839ffb26b4e74273eb7;p=projects%2Fchimara%2Fchimara.git diff --git a/libchimara/chimara-if.c b/libchimara/chimara-if.c index 4e8c1d9..2048f95 100644 --- a/libchimara/chimara-if.c +++ b/libchimara/chimara-if.c @@ -650,6 +650,24 @@ chimara_if_run_game(ChimaraIF *self, gchar *gamefile, GError **error) ; } + /* Check if an external blorb file is present */ + /* FIXME: hardcoded path */ + if(format == CHIMARA_IF_FORMAT_Z5 || format == CHIMARA_IF_FORMAT_Z6 || format == CHIMARA_IF_FORMAT_Z8) { + gchar *path = g_path_get_dirname(gamefile); + gchar *scratch = g_path_get_basename(gamefile); + *(strrchr(scratch, '.')) = '\0'; + gchar *blorbfile = g_strconcat(path, "/../Resources/", scratch, ".blb", NULL); + g_printerr("Looking for %s\n", blorbfile); + if(g_file_test(blorbfile, G_FILE_TEST_EXISTS)) { + args = g_slist_prepend(args, blorbfile); + g_printerr("Prepending graphics file to args\n"); + } else { + g_free(blorbfile); + } + g_free(path); + g_free(scratch); + } + /* Allocate argv to hold the arguments */ int argc = g_slist_length(args); args = g_slist_prepend(args, NULL);