Skip to content

Commit eef4885

Browse files
author
Hugo
committed
Stop embedding the default theme in the executable
Now the theme is always dynamically loaded as if we used the -graphic option
1 parent d64e316 commit eef4885

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ([2.69])
5-
#AC_INIT([xjump], [2.8], []) #email
65
AC_INIT([xjump], [2.8], []) #email
6+
77
AC_CONFIG_SRCDIR([src/game.c])
88
AC_CONFIG_HEADERS([config.h])
9+
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile themes/Makefile])
910

1011
AM_INIT_AUTOMAKE
11-
1212

1313
# Checks for programs.
1414
AC_PROG_CC
@@ -27,4 +27,4 @@ AC_TYPE_UID_T
2727
AC_FUNC_ERROR_AT_LINE
2828
AC_CHECK_FUNCS([ftruncate])
2929

30-
AC_OUTPUT(Makefile src/Makefile man/Makefile themes/Makefile)
30+
AC_OUTPUT

src/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
AM_CFLAGS = --std=c99 --pedantic -Wall -O2
2-
AM_CPPFLAGS = -DRECORD_ENTRY=20 -DRECORD_FILE=\"@localstatedir@/xjump/highscores\"
2+
AM_CPPFLAGS = -DRECORD_ENTRY=20 \
3+
-DRECORD_FILE=\"@localstatedir@/xjump/highscores\" \
4+
-DGRAPH_FILE=\"$(pkgdatadir)/themes/default.xpm\"
35
AM_LDFLAGS = -lXaw -lXt -lXpm -lX11
46

57
bin_PROGRAMS = xjump

src/main.c

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include"record.h"
2727
#include"config.h"
2828

29-
#include"themes/default.xpm"
3029
#include"icon.xbm"
3130
#include"icon_msk.xbm"
3231

@@ -58,7 +57,7 @@ static Colormap Cmap;
5857
static int IntervalState;
5958
static XtIntervalId IntervalId;
6059

61-
static char *GraphFile = NULL; /* For custom graphics */
60+
static char *GraphFile = GRAPH_FILE; /* For custom graphics */
6261

6362
static GameState GameMode; /* 0=Title; 1=Game; 2=GameOver; 3=Pause */
6463

@@ -417,20 +416,14 @@ static void option( int argc, char **argv )
417416

418417
static void make_graphic( void )
419418
{
420-
int i;
421419
XpmAttributes attr;
422-
423420
attr.valuemask = XpmColormap;
424421
attr.colormap = Cmap;
425422

426-
if( GraphFile != NULL )
427-
i = XpmReadFileToPixmap( Disp,DefaultRootWindow(Disp),GraphFile,
428-
&Char_p,&Char_m,&attr );
429-
else
430-
i = XpmCreatePixmapFromData( Disp,DefaultRootWindow(Disp),
431-
picture_xpm,&Char_p,&Char_m,&attr );
432-
if( i ){
433-
fprintf( stderr,"%s: %s\n",Myname,XpmGetErrorString(i) );
423+
int err = XpmReadFileToPixmap( Disp, DefaultRootWindow(Disp), GraphFile,
424+
&Char_p,&Char_m,&attr );
425+
if( err ){
426+
fprintf( stderr,"%s: %s\n",Myname,XpmGetErrorString(err) );
434427
exit(1);
435428
}
436429

0 commit comments

Comments
 (0)