gnome-games r8239 - trunk/gnobots2



Author: chpe
Date: Tue Nov  4 14:25:22 2008
New Revision: 8239
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8239&view=rev

Log:
Remove directory defines from CPPFLAGS to ensure they're not used, and replace remaining uses of the directory defines, if any, with games-runtime lookups. Prettify the Makefile.am in the process, and make libgames-support includes consistent.

Modified:
   trunk/gnobots2/Makefile.am
   trunk/gnobots2/graphics.c
   trunk/gnobots2/properties.c

Modified: trunk/gnobots2/Makefile.am
==============================================================================
--- trunk/gnobots2/Makefile.am	(original)
+++ trunk/gnobots2/Makefile.am	Tue Nov  4 14:25:22 2008
@@ -3,19 +3,8 @@
 schema_DATA = $(schema_in_files:.schemas.in=.schemas)
 @INTLTOOL_SCHEMAS_RULE@
 
-pixmapdir=$(datadir)/gnome-games/gnobots2/pixmaps
-configdir=$(datadir)/gnome-games/gnobots2/games
-Gamesdir=$(datadir)/applications
-
 SUBDIRS = help
 
-INCLUDES = 			\
-	-DGNOMELOCALEDIR=\""$(datadir)/locale"\" \
-	-DDATADIR=\""$(datadir)"\"		   \
-	-DPIXMAPDIR=\""$(pixmapdir)"\"		\
-	-I$(top_srcdir)   	        \
-	$(GNOME_GAMES_CFLAGS)
-
 bin_PROGRAMS = gnobots2
 
 gnobots2_SOURCES = \
@@ -42,11 +31,20 @@
 	cursors.h \
 	gbdefs.h
 
+gnobots2_CPPFLAGS = \
+	-I$(top_srcdir) \
+	$(AM_CPPFLAGS)
+
+gnobots2_CFLAGS = \
+	$(GNOME_GAMES_CFLAGS) \
+	$(AM_CFLAGS)
+
 gnobots2_LDADD = \
-	../libgames-support/libgames-support.la \
+	$(top_builddir)/libgames-support/libgames-support.la \
 	$(GNOME_GAMES_LIBS) \
 	$(INTLLIBS)
 
+pixmapdir = $(pkgdatadir)/gnobots2/pixmaps
 pixmap_DATA = gnomes.png \
               yahoo.png \
               aieee.png \
@@ -55,12 +53,14 @@
               boo.svg \
               ufo.svg
 
+configdir = $(pkgdatadir)/gnobots2/games
 config_DATA = robots2.cfg \
               robots2_easy.cfg \
               classic_robots.cfg \
               robots_with_safe_teleport.cfg \
               nightmare.cfg
 
+Gamesdir = $(datadir)/applications
 Games_in_files = gnobots2.desktop.in.in
 Games_DATA = $(Games_in_files:.desktop.in.in=.desktop)
 @INTLTOOL_DESKTOP_RULE@

Modified: trunk/gnobots2/graphics.c
==============================================================================
--- trunk/gnobots2/graphics.c	(original)
+++ trunk/gnobots2/graphics.c	Tue Nov  4 14:25:22 2008
@@ -209,18 +209,20 @@
 load_game_graphics (void)
 {
   gchar *filename;
+  const char *pixmapdir;
 
   if (theme_preimage != NULL) {
     free_game_graphics ();
   }
 
-  filename = games_find_similar_file (properties_theme_name (), PIXMAPDIR);
+  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);
+    filename = games_find_similar_file ("robots", pixmapdir);
     theme_preimage = games_preimage_new_from_file (filename, NULL);
     g_free (filename);
   }

Modified: trunk/gnobots2/properties.c
==============================================================================
--- trunk/gnobots2/properties.c	(original)
+++ trunk/gnobots2/properties.c	Tue Nov  4 14:25:22 2008
@@ -34,6 +34,7 @@
 #include <libgames-support/games-scores-dialog.h>
 #include <libgames-support/games-conf.h>
 #include <libgames-support/games-sound.h>
+#include <libgames-support/games-runtime.h>
 
 #include "properties.h"
 #include "gameconfig.h"
@@ -358,10 +359,13 @@
 static GtkWidget *
 make_theme_menu (void)
 {
+  const char *pixmapdir;
+
   if (theme_list)
     g_object_unref (theme_list);
 
-  theme_list = games_file_list_new_images (PIXMAPDIR, NULL);
+  pixmapdir = games_runtime_get_directory (GAMES_RUNTIME_GAME_PIXMAP_DIRECTORY);
+  theme_list = games_file_list_new_images (pixmapdir, NULL);
   games_file_list_transform_basename (theme_list);
 
   /* FIXME: Get rid of the bubbles images from the list (preferably by



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