static void impl_activate (PeasActivatable *plugin) { PlacemarksPluginPrivate *priv; GtkUIManager *manager; GtkListStore *store; priv = PLACEMARKS_PLUGIN (plugin)->priv; priv->window = EMERILLON_WINDOW (emerillon_window_dup_default ()); priv->map_view = emerillon_window_get_map_view (priv->window); priv->markers_layer = champlain_marker_layer_new_full (CHAMPLAIN_SELECTION_NONE); champlain_view_add_layer(priv->map_view, CHAMPLAIN_LAYER(priv->markers_layer)); manager = emerillon_window_get_ui_manager (priv->window); priv->action_group = gtk_action_group_new ("PlacemarksActions"); gtk_action_group_set_translation_domain (priv->action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions (priv->action_group, action_entries, G_N_ELEMENTS (action_entries), plugin); gtk_ui_manager_insert_action_group (manager, priv->action_group, -1); priv->ui_id = gtk_ui_manager_add_ui_from_string (manager, ui_definition, -1, NULL); g_warn_if_fail (priv->ui_id != 0); store = gtk_list_store_new (COL_COUNT, G_TYPE_STRING, /* ID */ G_TYPE_STRING, /* Name */ G_TYPE_FLOAT, /* Latitude */ G_TYPE_STRING, /* Latitude as a string */ G_TYPE_FLOAT, /* Longitude */ G_TYPE_STRING, /* Longitude as a string */ G_TYPE_INT, /* Zoom level */ G_TYPE_STRING, /* Zoom level as a string */ G_TYPE_UINT, /* UI ID */ G_TYPE_POINTER); /* Marker pointer */ priv->model = GTK_TREE_MODEL (store); priv->deleted_cb_id = g_signal_connect (priv->model, "row-deleted", G_CALLBACK (row_deleted_cb), plugin); load_placemarks (PLACEMARKS_PLUGIN (plugin)); load_menus (PLACEMARKS_PLUGIN (plugin)); }
// The good old main() int main(int argc, char *argv[]) { // Initialize SDL and OpenGL init_sdl_and_gl(); // Initialize FMOD init_mixer(); // Load fonts build_font_list(); font1 = load_png("fonts.png", true, false, true); // Show the loading screen loading_screen(); // Find the level files find_levels(); // Load textures font_num = load_png("fonts_num.png", true, false, true); load_bgrounds(); load_players(); load_enemies(); load_bonus(); load_maptex(); load_bombs(); load_particles(); load_teleports(); load_traps(); load_wisps(); load_potatoman(); load_icons(); load_menus(); // Add timer to run 60 fps start_timer(60); // Menu logic int ans = show_menu(MENU_ID_MAIN); while(ans != MENU_EXIT) { // Start the game? if(ans == MENU_SINGLEPLAY) // Single player start_game(); else if(ans == MENU_MULTIPLAY) // Two players start_game(true); // Show the menu again ans = show_menu(MENU_ID_MAIN); } // Destroy timer kill_timer(); // Free stuff delete_font_list(); kill_particles(); // Kill SDL SDL_Quit(); // Close the pakfile pakfile.close_mpk(); // Close the FMOD if(music_mod){ Mix_HaltMusic(); Mix_FreeMusic(music_mod); } Mix_CloseAudio(); // Save the config save_config(get_config_location(true), &config); return 0; }