[gnome-games] gnibbles: Load images from standard data directory



commit e782d65a99d6e20d20fc5930fcfacc7834a91974
Author: Robert Ancell <robert ancell canonical com>
Date:   Sun Jan 1 13:38:36 2012 +1100

    gnibbles: Load images from standard data directory

 gnibbles/data/Makefile.am        |    2 +-
 gnibbles/data/levels/Makefile.am |    2 +-
 gnibbles/data/pix/Makefile.am    |    2 +-
 gnibbles/src/Makefile.am         |    1 +
 gnibbles/src/board.c             |    9 ++-------
 gnibbles/src/gnibbles.c          |    4 +---
 6 files changed, 7 insertions(+), 13 deletions(-)
---
diff --git a/gnibbles/data/Makefile.am b/gnibbles/data/Makefile.am
index f97c373..528a974 100644
--- a/gnibbles/data/Makefile.am
+++ b/gnibbles/data/Makefile.am
@@ -1,6 +1,6 @@
 SUBDIRS = icons levels pix
 
-pixmapdir = $(datadir)/gnome-games/gnibbles/pixmaps
+pixmapdir = $(datadir)/gnibbles/pixmaps
 pixmap_DATA = gnibbles-logo.svg
 
 desktopdir=$(datadir)/applications
diff --git a/gnibbles/data/levels/Makefile.am b/gnibbles/data/levels/Makefile.am
index 917f24c..401f28a 100644
--- a/gnibbles/data/levels/Makefile.am
+++ b/gnibbles/data/levels/Makefile.am
@@ -1,4 +1,4 @@
-configdir = $(datadir)/gnome-games/gnibbles/games
+configdir = $(datadir)/gnibbles/games
 config_DATA = \
 	level001.gnl \
 	level002.gnl \
diff --git a/gnibbles/data/pix/Makefile.am b/gnibbles/data/pix/Makefile.am
index cedd748..e97f305 100644
--- a/gnibbles/data/pix/Makefile.am
+++ b/gnibbles/data/pix/Makefile.am
@@ -1,4 +1,4 @@
-pixmapdir = $(pkgdatadir)/gnibbles/pixmaps
+pixmapdir = $(datadir)/gnibbles/pixmaps
 
 BONUS_PIX = \
 	blank.svg \
diff --git a/gnibbles/src/Makefile.am b/gnibbles/src/Makefile.am
index fc8c58a..36e04fb 100644
--- a/gnibbles/src/Makefile.am
+++ b/gnibbles/src/Makefile.am
@@ -31,6 +31,7 @@ gnibbles_CPPFLAGS = \
 	$(AM_CPPFLAGS)
 
 gnibbles_CFLAGS = \
+	-DDATA_DIRECTORY=\"$(datadir)/gnibbles\" \
 	-DSOUND_DIRECTORY=\"$(pkgdatadir)/sounds\" \
 	$(GTK_CFLAGS) \
 	$(CANBERRA_GTK_CFLAGS) \
diff --git a/gnibbles/src/board.c b/gnibbles/src/board.c
index 7e08601..d41e77b 100644
--- a/gnibbles/src/board.c
+++ b/gnibbles/src/board.c
@@ -27,7 +27,6 @@
 #include <glib/gi18n.h>
 #include <gdk/gdk.h>
 
-#include <libgames-support/games-runtime.h>
 #include <clutter-gtk/clutter-gtk.h>
 
 #include "main.h"
@@ -48,7 +47,6 @@ GnibblesBoard *
 gnibbles_board_new (void)
 {
   gchar *filename;
-  const char *dirname;
   GValue val = {0,};
 
   GnibblesBoard *board = g_new (GnibblesBoard, 1);
@@ -57,8 +55,7 @@ gnibbles_board_new (void)
   board->level = NULL;
   board->surface = NULL;
 
-  dirname = games_runtime_get_directory (GAMES_RUNTIME_GAME_PIXMAP_DIRECTORY);
-  filename = g_build_filename (dirname, "wall-small-empty.svg", NULL);
+  filename = g_build_filename (DATA_DIRECTORY, "pixmaps", "wall-small-empty.svg", NULL);
 
   board->surface = clutter_texture_new_from_file (filename, NULL);
 
@@ -229,7 +226,6 @@ gnibbles_board_level_new (GnibblesBoard *board, gint level)
 {
 
   gchar *tmp = NULL;
-  const char *dirname;
   gchar *filename;
   FILE *in;
   gchar tmpboard [BOARDWIDTH +2];
@@ -240,8 +236,7 @@ gnibbles_board_level_new (GnibblesBoard *board, gint level)
 
   tmp = g_strdup_printf("level%03d.gnl", level);
 
-  dirname = games_runtime_get_directory (GAMES_RUNTIME_GAME_GAMES_DIRECTORY);
-  filename = g_build_filename (dirname, tmp, NULL);
+  filename = g_build_filename (DATA_DIRECTORY, "games", tmp, NULL);
 
   g_free (tmp);
 
diff --git a/gnibbles/src/gnibbles.c b/gnibbles/src/gnibbles.c
index 06fbf7c..b49d55f 100644
--- a/gnibbles/src/gnibbles.c
+++ b/gnibbles/src/gnibbles.c
@@ -78,10 +78,8 @@ gnibbles_load_pixmap_file (const gchar * pixmap, gint xsize, gint ysize)
 {
   GdkPixbuf *image;
   gchar *filename;
-  const char *dirname;
 
-  dirname = games_runtime_get_directory (GAMES_RUNTIME_GAME_PIXMAP_DIRECTORY);
-  filename = g_build_filename (dirname, pixmap, NULL);
+  filename = g_build_filename (DATA_DIRECTORY, "pixmaps", pixmap, NULL);
 
   if (!filename) {
     char *message =



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]