Esempio n. 1
0
/* Start the compiling process. Called from the main thread. */
void
i7_story_compile(I7Story *story, gboolean release, gboolean refresh)
{
    I7_STORY_USE_PRIVATE(story, priv);

    i7_document_save(I7_DOCUMENT(story));
    i7_story_stop_running_game(story);
    if(priv->copy_blorb_dest_file) {
        g_object_unref(priv->copy_blorb_dest_file);
        priv->copy_blorb_dest_file = NULL;
    }
    if(priv->compiler_output_file) {
        g_object_unref(priv->compiler_output_file);
        priv->compiler_output_file = NULL;
    }
    gtk_action_group_set_sensitive(priv->compile_action_group, FALSE);

    /* Set up the compiler */
    CompilerData *data = g_slice_new0(CompilerData);
    data->story = story;
    data->create_blorb = release && i7_story_get_create_blorb(story);
    data->use_debug_flags = !release;
    data->refresh_only = refresh;

    gchar *filename;
    if(data->create_blorb) {
        if(i7_story_get_story_format(story) == I7_STORY_FORMAT_GLULX)
            filename = g_strdup("output.gblorb");
        else
            filename = g_strdup("output.zblorb");
    } else {
        filename = g_strconcat("output.", i7_story_get_extension(story), NULL);
    }
    data->input_file = i7_document_get_file(I7_DOCUMENT(story));
    data->builddir_file = g_file_get_child(data->input_file, "Build");
    data->output_file = g_file_get_child(data->builddir_file, filename);
    g_free(filename);

    prepare_ni_compiler(data);
    start_ni_compiler(data);
}
Esempio n. 2
0
/* File->Save */
void
action_save(GtkAction *action, I7Document *document)
{
	i7_document_save(document);
}