On 2015-08-26, Joerg Jung <m...@umaxx.net> wrote: >> This moves games/xinvaders to a slightly newer release (1993 -> 2000) >> and fixes the LP64 issue in the application resource handling. The >> fix is, uh, inspired by xcdplayer but uses a #define hack to keep >> the patching down. >> >> I've dropped pjanzen@ as maintainer since his e-mail address is gone. >> >> We could enable scorefile support (say, /var/games/xinvaders.score) >> and install xinvaders as setgid games. Do we want that? > > Yes, please.
Now with scorefile. Index: Makefile =================================================================== RCS file: /cvs/ports/games/xinvaders/Makefile,v retrieving revision 1.30 diff -u -p -r1.30 Makefile --- Makefile 8 Dec 2014 21:35:32 -0000 1.30 +++ Makefile 26 Aug 2015 18:11:15 -0000 @@ -1,35 +1,24 @@ # $OpenBSD: Makefile,v 1.30 2014/12/08 21:35:32 naddy Exp $ -NOT_FOR_ARCHS= ${LP64_ARCHS} - COMMENT= shoot them nasty little bugs -DISTNAME= xinvaders -DIST_SUBDIR= xinvaders -PKGNAME= xinvaders-2.0 -REVISION = 2 +DISTNAME= xinvaders-2.1.1 CATEGORIES= games -MAINTAINER= Paul Janzen <pjan...@openbsd.org> - PERMIT_PACKAGE_CDROM= no fee PERMIT_PACKAGE_FTP= Yes -WANTLIB= ICE SM X11 Xau Xdmcp Xaw Xext Xmu Xt c pthread-stubs xcb - -MASTER_SITES= ftp://ftp.uu.net/usenet/comp.sources.x/volume19/xinvaders/ \ - ftp://unix.hensa.ac.uk/archive/usenet/comp.sources.x/volume19/xinvaders/ -DISTFILES= part01.Z part02.Z part03.Z - -EXTRACT_CASES= *.Z) ${GZIP_CMD} -dc ${FULLDISTDIR}/$$archive | ${_PERL_FIX_SHAR} | /bin/sh;; +WANTLIB= X11 Xaw Xmu Xt c -CONFIGURE_STYLE= imake +MASTER_SITES= ${MASTER_SITE_SUNSITE:=games/arcade/invaders/} -WRKDIST= ${WRKDIR} +MODULES= devel/gettext -pre-patch: - @cd $(WRKSRC) ; mv xinvaders.ma xinvaders.man +CONFIGURE_STYLE=gnu +CONFIGURE_ARGS= --enable-scorefile=/var/games/xinvaders.scores +CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \ + LDFLAGS="-L${LOCALBASE}/lib -lintl -liconv" -NO_TEST= Yes +FAKE_FLAGS= SCOREFILE=${PREFIX}/share/examples/xinvaders/xinvaders.scores .include <bsd.port.mk> Index: distinfo =================================================================== RCS file: /cvs/ports/games/xinvaders/distinfo,v retrieving revision 1.4 diff -u -p -r1.4 distinfo --- distinfo 18 Jan 2015 03:14:04 -0000 1.4 +++ distinfo 26 Aug 2015 18:11:15 -0000 @@ -1,6 +1,2 @@ -SHA256 (xinvaders/part01.Z) = wtlmG+Dk3nMGLOITk0t/96J2YVVbN4yNyRvyAKiK2do= -SHA256 (xinvaders/part02.Z) = QeTLQNorOQyz7ekvAkJBgvnaRXjMpAMJdQCEgfxQIIo= -SHA256 (xinvaders/part03.Z) = jt+pRAwpo67H29Glk4oo3SEo8SLT1AOELHPXEp4jnro= -SIZE (xinvaders/part01.Z) = 15161 -SIZE (xinvaders/part02.Z) = 24538 -SIZE (xinvaders/part03.Z) = 17263 +SHA256 (xinvaders-2.1.1.tar.gz) = 2yCBidZmgFjwTF25tJ/no0J4J7xQUQzAm1PmxF7EFI0= +SIZE (xinvaders-2.1.1.tar.gz) = 120631 Index: patches/patch-Imakefile =================================================================== RCS file: patches/patch-Imakefile diff -N patches/patch-Imakefile --- patches/patch-Imakefile 26 Oct 2007 21:19:16 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-Imakefile,v 1.1 2007/10/26 21:19:16 ajacoutot Exp $ ---- Imakefile.orig Fri Oct 26 23:05:34 2007 -+++ Imakefile Fri Oct 26 23:05:39 2007 -@@ -4,6 +4,7 @@ OBJS = spacers.o base.o widget.o main.o vaders.o shot. - - SRCS = spacers.c base.c widget.c main.c vaders.c shot.c score.c - --INCLUDES = -I$(TOP) -I$(TOP)/X11 -+INCLUDES = -I$(TOP) - - ComplexProgramTarget(xinvaders) -+MANSUFFIX=6 Index: patches/patch-Makefile_in =================================================================== RCS file: patches/patch-Makefile_in diff -N patches/patch-Makefile_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-Makefile_in 26 Aug 2015 18:11:15 -0000 @@ -0,0 +1,21 @@ +$OpenBSD$ +--- Makefile.in.orig Mon Sep 18 07:53:30 2000 ++++ Makefile.in Wed Aug 26 17:23:14 2015 +@@ -91,7 +91,7 @@ AUTOMAKE_OPTIONS = foreign + SUBDIRS = intl po + EXTRA_DIST = debian Vaders xinvaders.6 icon.xpm xinvaders.lsm + +-execgamesdir = $(prefix)/games ++execgamesdir = $(bindir) + execgames_PROGRAMS = xinvaders + + xinvaders_SOURCES = base.c main.c score.c shot.c spacers.c vaders.c widget.c me.h patchlevel.h vaders.h base1.bit base2.bit explode1.bit explode2.bit spacer1.bit spacer2.bit sperma1.bit sperma2.bit spermb1.bit spermb2.bit vader1a1.bit vader1a2.bit vader1b1.bit vader1b2.bit vader2a1.bit vader2a2.bit vader2b1.bit vader2b2.bit vader3a1.bit vader3a2.bit vader3b1.bit vader3b2.bit vexplod1.bit vexplod2.bit +@@ -521,7 +521,7 @@ mostlyclean distclean maintainer-clean + + + install-data-local: +- mkdir -p $(shell dirname $(DESTDIR)$(SCOREFILE) ) ++ mkdir -p `dirname $(DESTDIR)$(SCOREFILE)` + echo 0 > $(DESTDIR)$(SCOREFILE) + chgrp games $(DESTDIR)$(SCOREFILE) + chmod 0660 $(DESTDIR)$(SCOREFILE) Index: patches/patch-base_c =================================================================== RCS file: patches/patch-base_c diff -N patches/patch-base_c --- patches/patch-base_c 26 Oct 2007 21:19:16 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,51 +0,0 @@ -$OpenBSD: patch-base_c,v 1.1 2007/10/26 21:19:16 ajacoutot Exp $ ---- base.c.orig Fri Oct 26 23:05:33 2007 -+++ base.c Fri Oct 26 23:05:40 2007 -@@ -48,11 +48,6 @@ XImage *explosion; - - int ReadBaseImage() - { -- unsigned int width, height; -- int x_hot, y_hot; -- char *data, filename[255]; -- int status; -- - base->width = (scale == 1) ? base1_width : base2_width; - base->height = (scale == 1) ? base1_height : base2_height; - -@@ -105,7 +100,7 @@ GC gc; - } - - --ShowBase(i, gc) -+void ShowBase(i, gc) - int i; - GC gc; - { -@@ -114,7 +109,7 @@ GC gc; - base->width, base->height); - } - --PaintBasesLeft() -+void PaintBasesLeft() - { - int i; - XDrawString(dpy, labelwindow, scoregc, -@@ -156,7 +151,7 @@ int x,y; - return FALSE; - } - --ResetGame() -+void ResetGame() - { - static Arg args[1]; - -@@ -314,7 +309,7 @@ int x,y; - return FALSE; - } - --InitBuildings() -+void InitBuildings() - { - int i, j, k; - Index: patches/patch-main_c =================================================================== RCS file: /cvs/ports/games/xinvaders/patches/patch-main_c,v retrieving revision 1.1 diff -u -p -r1.1 patch-main_c --- patches/patch-main_c 26 Oct 2007 21:19:16 -0000 1.1 +++ patches/patch-main_c 26 Aug 2015 18:11:15 -0000 @@ -1,32 +1,196 @@ $OpenBSD: patch-main_c,v 1.1 2007/10/26 21:19:16 ajacoutot Exp $ ---- main.c.orig Fri Oct 26 23:05:33 2007 -+++ main.c Fri Oct 26 23:05:40 2007 -@@ -135,14 +135,13 @@ caddr_t data; +--- main.c.orig Mon Sep 11 00:32:16 2000 ++++ main.c Tue Aug 25 21:10:26 2015 +@@ -26,7 +26,6 @@ Wed May 8 1991 + #include <X11/IntrinsicP.h> + #include <X11/Label.h> + #endif +-static int width, height; /* Size of window. */ + + #ifdef XFILESEARCHPATH + static void AddPathToSearchPath(); +@@ -40,51 +39,51 @@ static XrmOptionDescRec table[] = { + + static XtResource resources[] = { + {XtNwidth, XtCWidth, XtRInt, sizeof(int), +- (Cardinal)&width, XtRImmediate, (caddr_t) VWIDTH}, ++ XtOffsetOf(AppData, width), XtRImmediate, (caddr_t) VWIDTH}, + {XtNheight, XtCHeight, XtRInt, sizeof(int), +- (Cardinal)&height, XtRImmediate, (caddr_t) VHEIGHT}, ++ XtOffsetOf(AppData, height), XtRImmediate, (caddr_t) VHEIGHT}, + {"debug", "Debug", XtRBoolean, sizeof(Boolean), +- (Cardinal)&debug, XtRString, "off"}, ++ XtOffsetOf(AppData, debug), XtRString, "off"}, + {"font", "Font", XtRString, sizeof(String), +- (Cardinal)&vaderfont, XtRString, (String)"9x15"}, ++ XtOffsetOf(AppData, vaderfont), XtRString, (String)"9x15"}, + {"scale", "Scale", XtRInt, sizeof(int), +- (Cardinal)&scale, XtRImmediate, (caddr_t) 2}, ++ XtOffsetOf(AppData, scale), XtRImmediate, (caddr_t) 2}, + {"basewait", "BaseWait", XtRInt, sizeof(int), +- (Cardinal)&basewait, XtRImmediate, (caddr_t) 10}, ++ XtOffsetOf(AppData, basewait), XtRImmediate, (caddr_t) 10}, + {"vaderwait", "VaderWait", XtRInt, sizeof(int), +- (Cardinal)&vaderwait, XtRImmediate, (caddr_t) 300}, ++ XtOffsetOf(AppData, vaderwait), XtRImmediate, (caddr_t) 300}, + {"spacerwait", "SpacerWait", XtRInt, sizeof(int), +- (Cardinal)&spacerwait, XtRImmediate, (caddr_t) 50}, ++ XtOffsetOf(AppData, spacerwait), XtRImmediate, (caddr_t) 50}, + {"shotwait", "ShotWait", XtRInt, sizeof(int), +- (Cardinal)&shotwait, XtRImmediate, (caddr_t) 10}, ++ XtOffsetOf(AppData, shotwait), XtRImmediate, (caddr_t) 10}, + {"vshotwait", "VshotWait", XtRInt, sizeof(int), +- (Cardinal)&vshotwait, XtRImmediate, (caddr_t) 30}, ++ XtOffsetOf(AppData, vshotwait), XtRImmediate, (caddr_t) 30}, + {"basecolor", "BaseColor", XtRPixel, sizeof(Pixel), +- (Cardinal)&basepixel, XtRString, "cyan"}, ++ XtOffsetOf(AppData, basepixel), XtRString, "cyan"}, + {"spacercolor", "SpacerColor", XtRPixel, sizeof(Pixel), +- (Cardinal)&spacerpixel, XtRString, "gray"}, ++ XtOffsetOf(AppData, spacerpixel), XtRString, "gray"}, + {"buildingcolor", "BuildingColor", XtRPixel, sizeof(Pixel), +- (Cardinal)&buildingpixel, XtRString, "yellow"}, ++ XtOffsetOf(AppData, buildingpixel), XtRString, "yellow"}, + {"vader1color", "Vader1Color", XtRPixel, sizeof(Pixel), +- (Cardinal)&vader1pixel, XtRString, "blue"}, ++ XtOffsetOf(AppData, vader1pixel), XtRString, "blue"}, + {"vader2color", "Vader2Color", XtRPixel, sizeof(Pixel), +- (Cardinal)&vader2pixel, XtRString, "green"}, ++ XtOffsetOf(AppData, vader2pixel), XtRString, "green"}, + {"vader3color", "Vader3Color", XtRPixel, sizeof(Pixel), +- (Cardinal)&vader3pixel, XtRString, "red"}, ++ XtOffsetOf(AppData, vader3pixel), XtRString, "red"}, + {"shotcolor", "ShotColor", XtRPixel, sizeof(Pixel), +- (Cardinal)&shotpixel, XtRString, "lavender"}, ++ XtOffsetOf(AppData, shotpixel), XtRString, "lavender"}, + {"vshotcolor", "VshotColor", XtRPixel, sizeof(Pixel), +- (Cardinal)&vshotpixel, XtRString, "orange"}, ++ XtOffsetOf(AppData, vshotpixel), XtRString, "orange"}, + {"scorecolor", "ScoreColor", XtRPixel, sizeof(Pixel), +- (Cardinal)&scorepixel, XtRString, "white"}, ++ XtOffsetOf(AppData, scorepixel), XtRString, "white"}, + {"maxshots", "MaxShots", XtRInt, sizeof(int), +- (Cardinal) &maxshots, XtRImmediate, (caddr_t) 1}, ++ XtOffsetOf(AppData, maxshots), XtRImmediate, (caddr_t) 1}, + {"maxvshots", "MaxVshots", XtRInt, sizeof(int), +- (Cardinal) &maxvshots, XtRImmediate, (caddr_t) 6}, ++ XtOffsetOf(AppData, maxvshots), XtRImmediate, (caddr_t) 6}, + {"defaultfore", "DefaultFore", XtRPixel, sizeof(Pixel), +- (Cardinal) &defaultfore, XtRString, "white"}, ++ XtOffsetOf(AppData, defaultfore), XtRString, "white"}, + {"defaultback", "DefaultBack", XtRPixel, sizeof(Pixel), +- (Cardinal) &defaultback, XtRString, "black"}, ++ XtOffsetOf(AppData, defaultback), XtRString, "black"}, + }; + + +@@ -141,7 +140,7 @@ caddr_t data; return w; } --main(argc, argv) -+int main(argc, argv) - Cardinal argc; - char **argv; +-int main(Cardinal argc, char **argv) ++int main(int argc, char **argv) { static Arg args[10]; int n; - Widget form, button; -- extern WidgetClass labelwidgetclass; +@@ -161,25 +160,25 @@ int main(Cardinal argc, char **argv) + &argc, argv); + dpy = XtDisplay(toplevel); + XtAddConverter(XtRString, XtRFloat, CvtStringToFloat, NULL, 0); +- XtGetApplicationResources(toplevel, (caddr_t) NULL, ++ XtGetApplicationResources(toplevel, (caddr_t) &app_data, + resources, XtNumber(resources), + NULL, (Cardinal) 0); +- AddResource("*background", &defaultback); ++ AddResource("*background", &app_data.defaultback); + if (DisplayCells(dpy, DefaultScreen(dpy)) <= 2) + { +- basepixel = defaultfore; +- buildingpixel = defaultfore; +- vader1pixel = defaultfore; +- vader2pixel = defaultfore; +- vader3pixel = defaultfore; +- shotpixel = defaultfore; +- vshotpixel = defaultfore; +- scorepixel = defaultfore; ++ app_data.basepixel = app_data.defaultfore; ++ app_data.buildingpixel = app_data.defaultfore; ++ app_data.vader1pixel = app_data.defaultfore; ++ app_data.vader2pixel = app_data.defaultfore; ++ app_data.vader3pixel = app_data.defaultfore; ++ app_data.shotpixel = app_data.defaultfore; ++ app_data.vshotpixel = app_data.defaultfore; ++ app_data.scorepixel = app_data.defaultfore; + } +- if (scale<1) scale = 1; +- if (scale>2) scale = 2; +- width = scale*VWIDTH; +- height = scale*VHEIGHT; ++ if (app_data.scale<1) app_data.scale = 1; ++ if (app_data.scale>2) app_data.scale = 2; ++ app_data.width = app_data.scale*VWIDTH; ++ app_data.height = app_data.scale*VHEIGHT; - me_image = NULL; + form = XtCreateManagedWidget ("form", formWidgetClass, + toplevel, NULL, 0); +@@ -189,8 +188,8 @@ int main(Cardinal argc, char **argv) + XtSetArg (args[n], XtNright, XtChainLeft); n++; + XtSetArg (args[n], XtNtop, XtChainTop); n++; + XtSetArg (args[n], XtNbottom, XtChainTop); n++; +- XtSetArg (args[n], XtNwidth, width); n++; +- XtSetArg (args[n], XtNheight, height); n++; ++ XtSetArg (args[n], XtNwidth, app_data.width); n++; ++ XtSetArg (args[n], XtNheight, app_data.height); n++; + + gamewidget = (VadersWidget) + XtCreateManagedWidget("field", vadersWidgetClass, form, args, n); +@@ -204,29 +203,29 @@ int main(Cardinal argc, char **argv) + XtSetArg (args[n], XtNbottom, XtChainTop); n++; + XtSetArg (args[n], XtNfromHoriz, gamewidget); n++; + XtSetArg (args[n], XtNhorizDistance, 5); n++; +- XtSetArg (args[n], XtNwidth, scale*IWIDTH); n++; +- XtSetArg (args[n], XtNheight, height/2); n++; ++ XtSetArg (args[n], XtNwidth, app_data.scale*IWIDTH); n++; ++ XtSetArg (args[n], XtNheight, app_data.height/2); n++; + + labelwidget = (VadersWidget) + XtCreateManagedWidget("label", vadersWidgetClass, form, args, n); -@@ -268,12 +267,4 @@ char *path; - #endif - } + pausebutton = MakeCommandButton(form, "pause", Pause, labelwidget, gamewidget, NULL); + XtSetArg(args[0], XtNlabel,_(" Start")); +- XtSetArg(args[1], XtNforeground, defaultfore); +- XtSetArg(args[2], XtNbackground, defaultback); +- XtSetArg(args[3], XtNborderColor, defaultfore); ++ XtSetArg(args[1], XtNforeground, app_data.defaultfore); ++ XtSetArg(args[2], XtNbackground, app_data.defaultback); ++ XtSetArg(args[3], XtNborderColor, app_data.defaultfore); + XtSetValues(pausebutton, args, 4); + button = MakeCommandButton(form, "quit", Quit, pausebutton, gamewidget, NULL); + XtSetArg(args[0], XtNlabel,_(" Quit ")); +- XtSetArg(args[1], XtNforeground, defaultfore); +- XtSetArg(args[2], XtNbackground, defaultback); +- XtSetArg(args[3], XtNborderColor, defaultfore); ++ XtSetArg(args[1], XtNforeground, app_data.defaultfore); ++ XtSetArg(args[2], XtNbackground, app_data.defaultback); ++ XtSetArg(args[3], XtNborderColor, app_data.defaultfore); + XtSetValues(button, args, 4); + infobutton = MakeCommandButton(form, "info", ShowInfo, button, gamewidget, NULL); + XtSetArg(args[0], XtNlabel,_(" Info ")); +- XtSetArg(args[1], XtNforeground, defaultfore); +- XtSetArg(args[2], XtNbackground, defaultback); +- XtSetArg(args[3], XtNborderColor, defaultfore); ++ XtSetArg(args[1], XtNforeground, app_data.defaultfore); ++ XtSetArg(args[2], XtNbackground, app_data.defaultback); ++ XtSetArg(args[3], XtNborderColor, app_data.defaultfore); + XtSetValues(infobutton, args, 4); + + XtRealizeWidget(toplevel); +@@ -280,7 +279,7 @@ char *path; } --#endif -- --#ifdef sparc --XShapeCombineMask() --{} -- --XShapeQueryExtension() --{} #endif + +-#ifdef sparc ++#ifdef sun + XShapeCombineMask() + {} + Index: patches/patch-score_c =================================================================== RCS file: patches/patch-score_c diff -N patches/patch-score_c --- patches/patch-score_c 26 Oct 2007 21:19:16 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: patch-score_c,v 1.1 2007/10/26 21:19:16 ajacoutot Exp $ ---- score.c.orig Fri Oct 26 23:05:34 2007 -+++ score.c Fri Oct 26 23:05:40 2007 -@@ -20,7 +20,7 @@ Wed May 8 1991 - #define HILABEL (SCOREPOS+20) - #define HIPOS (HILABEL+15) - --PaintScore() -+void PaintScore() - { - char scorestring[8]; - XDrawImageString(dpy, labelwindow, scoregc, 0, SCORELABEL, "Score", 5); -@@ -39,7 +39,7 @@ PaintScore() - XDrawImageString(dpy, labelwindow, scoregc, 0, HIPOS, scorestring, 7); - } - --InitScore() -+void InitScore() - { - score = 0; - if (hiscore == 0) hiscore = -1; Index: patches/patch-shot_c =================================================================== RCS file: patches/patch-shot_c diff -N patches/patch-shot_c --- patches/patch-shot_c 26 Oct 2007 21:19:16 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-shot_c,v 1.1 2007/10/26 21:19:16 ajacoutot Exp $ ---- shot.c.orig Fri Oct 26 23:05:34 2007 -+++ shot.c Fri Oct 26 23:05:41 2007 -@@ -230,7 +230,7 @@ int ReadVshotImages() - return BitmapSuccess; - } - --InitShot() -+void InitShot() - { - shottimerid = NULL; - numshots = 0; Index: patches/patch-vaders_h =================================================================== RCS file: /cvs/ports/games/xinvaders/patches/patch-vaders_h,v retrieving revision 1.1 diff -u -p -r1.1 patch-vaders_h --- patches/patch-vaders_h 26 Oct 2007 21:19:16 -0000 1.1 +++ patches/patch-vaders_h 26 Aug 2015 18:11:15 -0000 @@ -1,56 +1,150 @@ -$OpenBSD: patch-vaders_h,v 1.1 2007/10/26 21:19:16 ajacoutot Exp $ ---- vaders.h.orig Fri Oct 26 23:05:36 2007 -+++ vaders.h Fri Oct 26 23:05:41 2007 -@@ -130,11 +130,11 @@ ext int vaderwait; /* Number of milleseconds to wait +$OpenBSD$ +--- vaders.h.orig Mon Sep 11 00:32:40 2000 ++++ vaders.h Tue Aug 25 21:28:01 2015 +@@ -90,15 +90,82 @@ typedef struct _VadersRec { - ext Pixel spacerpixel; - ext XtIntervalId spacertimerid; --ext int spacerwait; /* Number of milliseconds to wait between -- /* moving spacers. /* -+ext int spacerwait; /* Number of milliseconds to wait between */ + + ++/* ++ * Application resources ++ */ ++typedef struct { ++ int width, height; /* Size of window. */ ++ int scale; ++ Boolean debug; + ++ /* Base info: */ ++ int basewait; /* Number of milliseconds to wait between */ ++ /* moving base. */ ++ Pixel basepixel; ++ Pixel buildingpixel; ++ ++ /* Vader info */ ++ Pixel vader1pixel; ++ Pixel vader2pixel; ++ Pixel vader3pixel; ++ int vaderwait; /* Number of milliseconds to wait between */ ++ /* moving vaders. */ ++ ++ /* Spacer info */ ++ Pixel spacerpixel; ++ int spacerwait; /* Number of milliseconds to wait between */ + /* moving spacers. */ ++ ++ /* Shot info */ ++ Pixel shotpixel; ++ Pixel vshotpixel; ++ int shotwait; ++ int vshotwait; ++ int maxshots; /* How many shots are allowed to exist at */ ++ /* once. */ ++ int maxvshots; /* How many shots are allowed to exist at */ ++ /* once. */ ++ ++ /* Score info */ ++ Pixel scorepixel; ++ ++ Pixel defaultfore, defaultback; ++ ++ char *vaderfont; ++} AppData; ++ ++ext AppData app_data; ++ ++#ifndef MAIN ++#define scale app_data.scale ++#define debug app_data.debug ++#define basewait app_data.basewait ++#define basepixel app_data.basepixel ++#define buildingpixel app_data.buildingpixel ++#define vader1pixel app_data.vader1pixel ++#define vader2pixel app_data.vader2pixel ++#define vader3pixel app_data.vader3pixel ++#define vaderwait app_data.vaderwait ++#define spacerpixel app_data.spacerpixel ++#define spacerwait app_data.spacerwait ++#define shotpixel app_data.shotpixel ++#define vshotpixel app_data.vshotpixel ++#define shotwait app_data.shotwait ++#define vshotwait app_data.vshotwait ++#define maxshots app_data.maxshots ++#define maxvshots app_data.maxvshots ++#define scorepixel app_data.scorepixel ++#define defaultfore app_data.defaultfore ++#define defaultback app_data.defaultback ++#define vaderfont app_data.vaderfont ++#endif ++ + /* + * Actual vaders definitions. + */ + + ext Widget pausebutton, infobutton; +-ext int scale; + +-ext Boolean debug; + ext int level; + + ext Display *dpy; +@@ -111,30 +178,17 @@ ext int basesleft; + + /* Base info: */ + +-ext int basewait; /* Number of milleseconds to wait between */ +- /* moving base. */ +- + ext XtIntervalId basetimerid; + +-ext Pixel basepixel; +-ext Pixel buildingpixel; + ext Boolean basedestroyed; /* TRUE if the base is non-existant */ + + /* Vader info: */ + + ext XtIntervalId vadertimerid; +-ext Pixel vader1pixel; +-ext Pixel vader2pixel; +-ext Pixel vader3pixel; +-ext int vaderwait; /* Number of milleseconds to wait between */ +- /* moving vaders. */ + + /* Spacer info */ + +-ext Pixel spacerpixel; + ext XtIntervalId spacertimerid; +-ext int spacerwait; /* Number of milliseconds to wait between */ +- /* moving spacers. */ ext int spacerappear; /* same, but for the interval between appearances */ --ext Boolean spacer_shown; /* Currnet_Spacer is something */ -+ext Boolean spacer_shown; /* Current_Spacer is something */ - ext int spacer_counter; /* number of cycles to create a spacer */ - - /* Shot info. */ -@@ -168,7 +168,6 @@ ext XImage *me_image; - - /* From widget.c */ - --extern Boolean TakeFocus(); - extern void Quit(); - extern void Pause(); - extern int paused; -@@ -188,6 +187,10 @@ extern Boolean ShotHitsBuilding(); - extern void InitBase(); - extern void PaintBase(); - extern void DrawBuildings(); -+extern void InitBuildings(); -+extern void PaintBasesLeft(); -+extern void ShowBase(); -+extern void ResetGame(); - - /* From vaders.c */ - -@@ -207,6 +210,10 @@ extern void MakeSpacer(); - extern void InitSpacers(); - extern void PaintSpacer(); - -+/* from score.c */ -+extern void PaintScore(); -+extern void InitScore(); -+ - /* From shot.c */ - - extern void AddLine(); -@@ -216,6 +223,7 @@ extern void MoveShots(); - extern void MoveVshots(); - extern void PaintAllShots(); - ext Pixel defaultfore, defaultback; -+extern void InitShot(); + ext Boolean spacer_shown; /* Currnet_Spacer is something */ +@@ -144,21 +198,11 @@ ext int spacer_counter; /* number of cycles to create - ext char *vaderfont; + ext XtIntervalId shottimerid; + ext XtIntervalId vshottimerid; +-ext Pixel shotpixel; +-ext Pixel vshotpixel; +-ext int shotwait; +-ext int vshotwait; +-ext int maxshots; /* How many shots are allowed to exist at */ +- /* once. */ +-ext int maxvshots; /* How many shots are allowed to exist at */ +- /* once. */ + ext int numshots; /* how many shots (from the base) there are right now. */ + ext int numvshots; /* how many shots (from vaders) there are right now. */ + + /* Score info */ + +-ext Pixel scorepixel; +- + ext int bases, nextbonus, lastscore; + extern int hiscore; + +@@ -227,8 +271,5 @@ void InitShot(); + void MoveShots(); + void MoveVshots(); + void PaintAllShots(); +-ext Pixel defaultfore, defaultback; +- +-ext char *vaderfont; + #endif _vaders_h Index: patches/patch-widget_c =================================================================== RCS file: patches/patch-widget_c diff -N patches/patch-widget_c --- patches/patch-widget_c 26 Oct 2007 21:19:16 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -$OpenBSD: patch-widget_c,v 1.1 2007/10/26 21:19:16 ajacoutot Exp $ ---- widget.c.orig Fri Oct 26 23:05:34 2007 -+++ widget.c Fri Oct 26 23:05:41 2007 -@@ -25,8 +25,9 @@ typedef struct _BaseRec { - - extern Base base; - --void HandleFocus(); --void HandleStruct(); -+static void HandleFocus(); -+static void HandleStruct(); -+static Boolean TakeFocus(); - void Pause(); - - static XtActionsRec actions[] = { Index: pkg/DESCR =================================================================== RCS file: /cvs/ports/games/xinvaders/pkg/DESCR,v retrieving revision 1.2 diff -u -p -r1.2 DESCR --- pkg/DESCR 25 Sep 1998 22:49:21 -0000 1.2 +++ pkg/DESCR 26 Aug 2015 18:11:15 -0000 @@ -1,2 +1,2 @@ -Xinvaders is an implementation of the old Atari Space Invaders game +Xinvaders is an implementation of the classic Space Invaders game on top of the X11 window system. Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/games/xinvaders/pkg/PLIST,v retrieving revision 1.6 diff -u -p -r1.6 PLIST --- pkg/PLIST 11 Oct 2013 20:39:25 -0000 1.6 +++ pkg/PLIST 26 Aug 2015 18:11:15 -0000 @@ -1,3 +1,14 @@ @comment $OpenBSD: PLIST,v 1.6 2013/10/11 20:39:25 naddy Exp $ +@mode g+s +@group games @bin bin/xinvaders +@mode +@group @man man/man6/xinvaders.6 +share/examples/xinvaders/ +@mode 660 +@group games +share/examples/xinvaders/xinvaders.scores +@sample /var/games/xinvaders.scores +@mode +@group -- Christian "naddy" Weisgerber na...@mips.inka.de