diff options
-rw-r--r-- | games/Makefile | 1 | ||||
-rw-r--r-- | games/moonlander/Makefile | 48 | ||||
-rw-r--r-- | games/moonlander/distinfo | 3 | ||||
-rw-r--r-- | games/moonlander/files/patch-Makefile | 36 | ||||
-rw-r--r-- | games/moonlander/files/patch-moon_lander_c | 95 | ||||
-rw-r--r-- | games/moonlander/pkg-descr | 4 | ||||
-rw-r--r-- | games/moonlander/pkg-plist | 61 |
7 files changed, 248 insertions, 0 deletions
diff --git a/games/Makefile b/games/Makefile index 49b8c5d28ae5..e05f973b1436 100644 --- a/games/Makefile +++ b/games/Makefile @@ -229,6 +229,7 @@ SUBDIR += mirrormagic SUBDIR += miscom SUBDIR += moon-buggy + SUBDIR += moonlander SUBDIR += mvdsv SUBDIR += myth2_demo SUBDIR += mythserver diff --git a/games/moonlander/Makefile b/games/moonlander/Makefile new file mode 100644 index 000000000000..d6510a80208e --- /dev/null +++ b/games/moonlander/Makefile @@ -0,0 +1,48 @@ +# New ports collection makefile for: moonlander +# Date created: 27 Jun 2003 +# Whom: Kris Kennaway <kris@FreeBSD.org> +# +# $FreeBSD$ +# + +PORTNAME= moonlander +PORTVERSION= 1.0 +CATEGORIES= games +MASTER_SITES= http://downloads.daveblood.com/lunar_lander/ +DISTNAME= moon-lander-1.0 + +MAINTAINER= ports@FreeBSD.org +COMMENT= "land a spacecraft on the moon" + +LIB_DEPENDS= SDL_image.10:${PORTSDIR}/graphics/sdl_image \ + SDL_mixer.2:${PORTSDIR}/audio/sdl_mixer + +USE_X_PREFIX= YES +USE_REINPLACE= YES + +WRKSRC= ${WRKDIR}/moon-lander + +install_dirs= fonts images +.if defined(WITHOUT_SOUND) +CFLAGS+= -DNOSOUND +PLIST_SUB+= SOUND="@comment " +.else +PLIST_SUB+= SOUND= +install_dirs+= sounds +.endif + +do-configure: + ${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/moon_lander.c + +do-install: + @${MKDIR} ${PREFIX}/bin; \ + ${INSTALL_PROGRAM} ${WRKSRC}/moonlander ${PREFIX}/bin; \ + ${MKDIR} ${PREFIX}/share/moonlander +.for i in ${install_dirs} + @cp -R ${WRKSRC}/${i} ${PREFIX}/share/moonlander +.endfor + +post-install: + @find ${PREFIX}/share/moonlander -type f -print0 |xargs -0 ${CHMOD} 444 + +.include <bsd.port.mk> diff --git a/games/moonlander/distinfo b/games/moonlander/distinfo new file mode 100644 index 000000000000..b9eb835fdbc3 --- /dev/null +++ b/games/moonlander/distinfo @@ -0,0 +1,3 @@ +MD5 (moon-lander-1.0.tar.gz) = 5726de9d85b9e8b60c27f2ea6428bc96 +RMD160 (moon-lander-1.0.tar.gz) = a87d858f456a46100934937196efa401b4ec9c20 +SHA1 (moon-lander-1.0.tar.gz) = 87a5d85fc841d7b13a0b65c7a858907b9d676843 diff --git a/games/moonlander/files/patch-Makefile b/games/moonlander/files/patch-Makefile new file mode 100644 index 000000000000..be81ec3162e7 --- /dev/null +++ b/games/moonlander/files/patch-Makefile @@ -0,0 +1,36 @@ +--- Makefile.orig Tue Aug 14 16:28:49 2001 ++++ Makefile Thu Jun 26 22:07:33 2003 +@@ -1,26 +1,20 @@ + # Makefile for test program for game_libs - lunar lander +-CFLAGS=-Wall `sdl-config --libs --cflags` +-CC=gcc ++CFLAGS+=`sdl11-config --cflags` ++#CC=gcc + +-LIBS=SDL_image ++LIBS=`sdl11-config --libs` -lSDL_image -lSDL_mixer + + C_FILES=moon_lander.c game_lib.c DT_drawtext.c + OBJ_FILES=moon_lander.o game_lib.o DT_drawtext.o +-OUT_FILE=moon-lander.bin ++OUT_FILE=moonlander + + all: game_lib + + game_lib: $(OBJ_FILES) +- $(CC) $(CFLAGS) -o $(OUT_FILE) $(OBJ_FILES) -l$(LIBS) -lSDL_mixer ++ $(CC) $(CFLAGS) -o $(OUT_FILE) $(OBJ_FILES) $(LIBS) + +-moon_lander.o: moon_lander.c +- $(CC) $(CFLAGS) -c -o $@ $^ +- +-game_lib.o: game_lib.c +- $(CC) $(CFLAGS) -c -o $@ $^ +- +-DT_drawtext.o: DT_drawtext.c +- $(CC) $(CFLAGS) -c -o $@ $^ ++.c.o: ++ $(CC) $(CFLAGS) -c $< -o $@ + + clean: + rm -f *.o core diff --git a/games/moonlander/files/patch-moon_lander_c b/games/moonlander/files/patch-moon_lander_c new file mode 100644 index 000000000000..af69159ce31f --- /dev/null +++ b/games/moonlander/files/patch-moon_lander_c @@ -0,0 +1,95 @@ +--- moon_lander.c.orig Wed Aug 22 13:52:28 2001 ++++ moon_lander.c Thu Jun 26 22:23:46 2003 +@@ -20,6 +20,7 @@ + + #include <stdio.h> + #include <stdlib.h> ++#include <string.h> + #include <math.h> + #include <sys/types.h> + #include <unistd.h> +@@ -37,7 +38,7 @@ + #define YSIZE 480 + #define TERRAIN_YSIZE (YSIZE / 2) + #define FPS (1000 / 35) +-#define DATAPATH "" ++#define DATAPATH "%%PREFIX%%/share/moonlander/" + + #define FRESHRUN 0 + #define GAMEOVER 1 +@@ -175,9 +176,10 @@ + + char filename[1024]; + DIR *dir; +- struct dirent *files[100]; +- int done = 0; ++ char *bg[100]; ++ struct dirent *d; + int count = 0; ++ int i; + + /* read images/backgrounds dir and choose a random image from there. + * put it's filename in image_file +@@ -185,27 +187,20 @@ + + + +- sprintf(filename, "%simages/backgrounds", DATAPATH); ++ snprintf(filename, sizeof filename, "%simages/backgrounds", DATAPATH); + + if ( !(dir = opendir(filename)) ){ + /* error */ + printf("cannot open dir %s\n", filename); + exit(0); + } +- +- while (!done){ +- if ( files[count] = readdir(dir) ){ +- +- //printf("I see - %d %s\n", count, files[count]->d_name); +- count++; +- } +- else{ +- done = 1; +- } +- +- if (count > 99) { +- done = 1; +- } ++ ++ while ( (d = readdir(dir)) != NULL){ ++ if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, "..")) ++ continue; ++ bg[count++] = strdup(d->d_name); ++ if (count >= 100) ++ break; + } + + closedir(dir); +@@ -221,12 +216,12 @@ + + game->back_no++; + +- if (game->back_no < 2){ +- game->back_no = 2; ++ if (game->back_no < 0){ ++ game->back_no = 0; + } + + if (game->back_no >= count){ +- game->back_no = 2; ++ game->back_no = 0; + } + + +@@ -240,7 +235,9 @@ + + //printf("about to get new background: %d\n", game->back_no ); + +- sprintf(filename, "%simages/backgrounds/%s", DATAPATH, files[game->back_no]->d_name); ++ snprintf(filename, sizeof(filename), "%simages/backgrounds/%s", DATAPATH, bg[game->back_no]); ++ for (i = 0; i < count; i++) ++ free(bg[i]); + + // printf("got %s\n", filename); + diff --git a/games/moonlander/pkg-descr b/games/moonlander/pkg-descr new file mode 100644 index 000000000000..9f20c216a3c0 --- /dev/null +++ b/games/moonlander/pkg-descr @@ -0,0 +1,4 @@ +Moon Lander is a 2D game of gravity. Land your ship on the landing pad. +Don't go too fast, or you will crash. + +WWW: http://magigames.org/moonlander.htm diff --git a/games/moonlander/pkg-plist b/games/moonlander/pkg-plist new file mode 100644 index 000000000000..ade96e5c072f --- /dev/null +++ b/games/moonlander/pkg-plist @@ -0,0 +1,61 @@ +bin/moonlander +share/moonlander/fonts/ConsoleFont.bmp +share/moonlander/fonts/LargeFont.bmp +share/moonlander/images/backgrounds/blue_nebula.jpg +share/moonlander/images/backgrounds/earth_moon.jpg +share/moonlander/images/backgrounds/fingers.jpg +share/moonlander/images/backgrounds/fire_and_planet.jpg +share/moonlander/images/backgrounds/glowing_nebula.jpg +share/moonlander/images/backgrounds/orange_gas.jpg +share/moonlander/images/backgrounds/red_plain.jpg +share/moonlander/images/backgrounds/saturn.jpg +share/moonlander/images/blank_terrain.gif +share/moonlander/images/kablam/exp01.png +share/moonlander/images/kablam/exp02.png +share/moonlander/images/kablam/exp03.png +share/moonlander/images/kablam/exp04.png +share/moonlander/images/kablam/exp05.png +share/moonlander/images/kablam/exp06.png +share/moonlander/images/kablam/exp07.png +share/moonlander/images/kablam/exp08.png +share/moonlander/images/kablam/exp09.png +share/moonlander/images/kablam/exp10.png +share/moonlander/images/kablam/exp11.png +share/moonlander/images/kablam/exp12.png +share/moonlander/images/kablam/exp13.png +share/moonlander/images/kablam/exp14.png +share/moonlander/images/kablam/exp15.png +share/moonlander/images/kablam/exp16.png +share/moonlander/images/kablam/exp17.png +share/moonlander/images/kablam/exp18.png +share/moonlander/images/kablam/exp19.png +share/moonlander/images/kablam/exp20.png +share/moonlander/images/kablam/exp21.png +share/moonlander/images/kablam/exp22.png +share/moonlander/images/kablam/exp23.png +share/moonlander/images/kablam/exp24.png +share/moonlander/images/kablam/exp25.png +share/moonlander/images/logo.png +share/moonlander/images/magigames_steel.gif +share/moonlander/images/miniship2.bmp +share/moonlander/images/moon-lander.ico +share/moonlander/images/newship.png +share/moonlander/images/thrust1.png +share/moonlander/images/thrust2.png +share/moonlander/images/thrust_left.bmp +share/moonlander/images/thrust_right.bmp +share/moonlander/images/win_icon.bmp +%%SOUND%%share/moonlander/sounds/Blaster_1.wav +%%SOUND%%share/moonlander/sounds/Retro_3.wav +%%SOUND%%share/moonlander/sounds/Space_Bubbles_2.wav +%%SOUND%%share/moonlander/sounds/beep1b.wav +%%SOUND%%share/moonlander/sounds/eagle_has_landed.wav +%%SOUND%%share/moonlander/sounds/explosion2.wav +%%SOUND%%share/moonlander/sounds/honk.wav +%%SOUND%%share/moonlander/sounds/jet_lp.wav +%%SOUND%%@dirrm share/moonlander/sounds +@dirrm share/moonlander/images/kablam +@dirrm share/moonlander/images/backgrounds +@dirrm share/moonlander/images +@dirrm share/moonlander/fonts +@dirrm share/moonlander |