X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=player%2Fcallbacks.c;h=3013800baafaca0471649e3efb8c065a0bda678b;hb=f5ef90183114ba9429109038b0a9be7f3f90b900;hp=86e85b62a9e14c384134bee146c81f280d818276;hpb=f95649aae72dacb4b65d5a987ce0a41b467a3909;p=projects%2Fchimara%2Fchimara.git diff --git a/player/callbacks.c b/player/callbacks.c index 86e85b6..3013800 100644 --- a/player/callbacks.c +++ b/player/callbacks.c @@ -87,6 +87,21 @@ on_open_activate(GtkAction *action, ChimaraGlk *glk) if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { GError *error = NULL; gchar *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + + /* See if there is a corresponding graphics file */ + /* FIXME: hardcoded path */ + gchar *path = g_path_get_dirname(filename); + gchar *scratch = g_path_get_basename(filename); + *(strrchr(scratch, '.')) = '\0'; + gchar *blorbfile = g_strconcat(path, "/../Resources/", scratch, ".blb", NULL); + if(g_file_test(blorbfile, G_FILE_TEST_EXISTS)) { + g_object_set(glk, "graphics-file", blorbfile, NULL); + g_printerr("Setting graphics file to %s\n", blorbfile); + } + g_free(blorbfile); + g_free(path); + g_free(scratch); + if(!chimara_if_run_game(CHIMARA_IF(glk), filename, &error)) { error_dialog(window, error, _("Could not open game file '%s': "), filename); g_free(filename);