Esempio n. 1
0
/**
 * load_game_graphics
 *
 * Description:
 * Loads all of the game graphics
 *
 * Returns:
 * TRUE on success FALSE otherwise
 **/
gboolean
load_game_graphics (void)
{
  gchar *filename;
  const char *pixmapdir;

  if (theme_preimage != NULL) {
    free_game_graphics ();
  }

  pixmapdir = games_runtime_get_directory (GAMES_RUNTIME_GAME_PIXMAP_DIRECTORY);
  filename = games_find_similar_file (properties_theme_name (), pixmapdir);

  theme_preimage = games_preimage_new_from_file (filename, NULL);
  g_free (filename);

  if (theme_preimage == NULL) {
    filename = games_find_similar_file ("robots", pixmapdir);
    theme_preimage = games_preimage_new_from_file (filename, NULL);
    g_free (filename);
  }

  if (!load_bubble_graphics ())
    return FALSE;

  rerender_needed = TRUE;

  return TRUE;
}
Esempio n. 2
0
/**
 * load_game_graphics
 *
 * Description:
 * Loads all of the game graphics
 *
 * Returns:
 * TRUE on success FALSE otherwise
 **/
gboolean
load_game_graphics (void)
{
  gchar *themedir, *filename;

  if (theme_preimage != NULL) {
    free_game_graphics ();
  }

  themedir = g_build_filename (DATA_DIRECTORY, "themes", NULL);
  filename = games_find_similar_file (properties_theme_name (), themedir);

  theme_preimage = games_preimage_new_from_file (filename, NULL);
  g_free (filename);

  if (theme_preimage == NULL) {
    filename = games_find_similar_file ("robots", themedir);
    theme_preimage = games_preimage_new_from_file (filename, NULL);
    g_free (filename);
  }
  g_free (themedir);

  if (!load_bubble_graphics ())
    return FALSE;

  rerender_needed = TRUE;

  return TRUE;
}
Esempio n. 3
0
void
bj_chip_set_size (gint width,
                  gint height)
{
        static const gchar *names[4] = { CHIP_FILENAME_100,
                                         CHIP_FILENAME_25,
                                         CHIP_FILENAME_5,
                                         CHIP_FILENAME_1 };
        const char *pixmapdir;

        pixmapdir = games_runtime_get_directory (GAMES_RUNTIME_GAME_PIXMAP_DIRECTORY);

        for (guint i = 0; i < G_N_ELEMENTS (names); i++) {
                gchar *fullname;

                fullname = g_build_filename (pixmapdir, names[i], NULL);

                if (!fullname)
                        continue;

		if (!chip_preimage[i])
			chip_preimage[i] = games_preimage_new_from_file (fullname,
									 NULL);

                if (chip_scaled_pixbuf[i])
                        g_object_unref (chip_scaled_pixbuf[i]);

                chip_scaled_pixbuf[i] = games_preimage_render (chip_preimage[i],
                                                               width,
                                                               height);
                g_free (fullname);
        }
}