summaryrefslogtreecommitdiff
path: root/games/xroads
diff options
context:
space:
mode:
authorKirill Ponomarev <krion@FreeBSD.org>2004-11-20 16:18:17 +0000
committerKirill Ponomarev <krion@FreeBSD.org>2004-11-20 16:18:17 +0000
commitc8380252536019afb7eea4285cf5ec18fb93f357 (patch)
tree7212ac8e25fa7047d4088937743a7622cb7bc130 /games/xroads
parent- Reset longterm inactive maintainer (diff)
Fix build on 5/6.x
Assign maintainership to submitter. PR: ports/74162 Submitted by: Erik Greenwald <erik@smluc.org>
Notes
Notes: svn path=/head/; revision=122009
Diffstat (limited to 'games/xroads')
-rw-r--r--games/xroads/Makefile2
-rw-r--r--games/xroads/files/patch-ai.c116
-rw-r--r--games/xroads/files/patch-xroads.c134
-rw-r--r--games/xroads/files/patch-xroads.h11
4 files changed, 262 insertions, 1 deletions
diff --git a/games/xroads/Makefile b/games/xroads/Makefile
index 2f5b3482a7d5..1af9a39a2e88 100644
--- a/games/xroads/Makefile
+++ b/games/xroads/Makefile
@@ -12,7 +12,7 @@ CATEGORIES= games
MASTER_SITES= http://linux.tucows.com/files/x11/entertain/
DISTNAME= ${PORTNAME}-v${PORTVERSION}
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= erik@smluc.org
COMMENT= Commodore 64 "Crossroads"-like video game for X Window System
USE_X_PREFIX= yes
diff --git a/games/xroads/files/patch-ai.c b/games/xroads/files/patch-ai.c
new file mode 100644
index 000000000000..b644d1082761
--- /dev/null
+++ b/games/xroads/files/patch-ai.c
@@ -0,0 +1,116 @@
+--- ai.c.orig Sat Nov 20 09:50:36 2004
++++ ai.c Sat Nov 20 09:50:56 2004
+@@ -59,12 +59,12 @@
+ int tries=0;
+
+ /* If in a halfstep, finish it */
+- if(ntrunc(amonst->x)!=round(amonst->x)) switch(amonst->dir) {
++ if(ntrunc(amonst->x)!=xrround(amonst->x)) switch(amonst->dir) {
+ case LEFT: amonst->x-=0.5; return;
+ case RIGHT: amonst->x+=0.5; return;
+ default: amonst->dir = directions[(int)rnd(2) + 2]; break;
+ }
+- if(ntrunc(amonst->y)!=round(amonst->y)) switch(amonst->dir) {
++ if(ntrunc(amonst->y)!=xrround(amonst->y)) switch(amonst->dir) {
+ case UP: amonst->y-=0.5; return;
+ case DOWN: amonst->y+=0.5; return;
+ default: amonst->dir = directions[(int)rnd(2)]; break;
+@@ -84,9 +84,9 @@
+ /* Find coordinates for new position */
+ switch(dir) {
+ case UP: y-=0.5; eqy=ntrunc(y); eqx=ntrunc(x); break;
+- case DOWN: y+=0.5; eqy=round(y); eqx=ntrunc(x); break;
++ case DOWN: y+=0.5; eqy=xrround(y); eqx=ntrunc(x); break;
+ case LEFT: x-=0.5; eqy=ntrunc(y); eqx=ntrunc(x); break;
+- case RIGHT: x+=0.5; eqy=ntrunc(y); eqx=round(x); break;
++ case RIGHT: x+=0.5; eqy=ntrunc(y); eqx=xrround(x); break;
+ default: printf("Error: Not a direction\n"); return;
+ }
+
+@@ -95,7 +95,7 @@
+ goto tryagain;
+
+ /* Check for double half-step */
+- if(ntrunc(x)!=round(x) && ntrunc(y)!=round(y)) goto tryagain;
++ if(ntrunc(x)!=xrround(x) && ntrunc(y)!=xrround(y)) goto tryagain;
+
+ /* Did we hit a powerup? */
+ if(data[xytotype(eqx, eqy)].etype == POWERUP) {
+@@ -121,12 +121,12 @@
+ float dx, dy, dz;
+
+ /* If in a halfstep, finish it */
+- if(ntrunc(amonst->x)!=round(amonst->x)) switch(amonst->dir) {
++ if(ntrunc(amonst->x)!=xrround(amonst->x)) switch(amonst->dir) {
+ case LEFT: amonst->x-=0.5; return;
+ case RIGHT: amonst->x+=0.5; return;
+ default: amonst->dir = directions[(int)rnd(2) + 2]; break;
+ }
+- if(ntrunc(amonst->y)!=round(amonst->y)) switch(amonst->dir) {
++ if(ntrunc(amonst->y)!=xrround(amonst->y)) switch(amonst->dir) {
+ case UP: amonst->y-=0.5; return;
+ case DOWN: amonst->y+=0.5; return;
+ default: amonst->dir = directions[(int)rnd(2)]; break;
+@@ -146,8 +146,8 @@
+ tryagain: /* Come back here to try again */
+ tries++;
+ if(tries>100) {
+- if(ntrunc(amonst->x)==round(amonst->x) &&
+- ntrunc(amonst->y)==round(amonst->y))
++ if(ntrunc(amonst->x)==xrround(amonst->x) &&
++ ntrunc(amonst->y)==xrround(amonst->y))
+ watchentity(amonst, target);
+ return;
+ }
+@@ -186,7 +186,7 @@
+ goto tryagain;
+
+ /* Be careful of half-steps */
+- if(ntrunc(x)!=round(x) && ntrunc(y)!=round(y)) goto tryagain;
++ if(ntrunc(x)!=xrround(x) && ntrunc(y)!=xrround(y)) goto tryagain;
+
+ /* Did we hit a powerup? */
+ if(data[xytotype(eqx, eqy)].etype == POWERUP) {
+@@ -318,7 +318,7 @@
+ printf("I was asked to kill a monster that shouldn't be killed!\n");
+ if(amonst->health <= 0) {
+ if(data[amonst->type].etype != EFFECT) {
+- maze[round(amonst->y)][round(amonst->x)] = -2; /* Blank */
++ maze[xrround(amonst->y)][xrround(amonst->x)] = -2; /* Blank */
+ maze[ntrunc(amonst->y)][ntrunc(amonst->x)] = -2; /* Blank */
+ }
+ draw_tilex2(mainwindow, data[amonst->type].tile[amonst->frame],
+@@ -332,8 +332,8 @@
+ bmonst->x*GRIDSIZE, bmonst->y*GRIDSIZE,
+ bmonst->color, bmonst->dir);
+ }
+- if(maze[round(amonst->y)][round(amonst->x)]!=-2) {
+- bmonst=&monst[maze[round(amonst->y)][round(amonst->x)]];
++ if(maze[xrround(amonst->y)][xrround(amonst->x)]!=-2) {
++ bmonst=&monst[maze[xrround(amonst->y)][xrround(amonst->x)]];
+ draw_tilex2(mainwindow, data[bmonst->type].tile[bmonst->frame],
+ bmonst->x*GRIDSIZE, bmonst->y*GRIDSIZE,
+ bmonst->color, bmonst->dir);
+@@ -392,9 +392,9 @@
+ amonst->atspeed = data[amonst->type].atspeed;
+ switch(amonst->dir) {
+ case LEFT: fx-=1; x=ntrunc(fx); y=ntrunc(fy); break;
+- case RIGHT: fx+=1; x=round(fx); y=ntrunc(fy); break;
++ case RIGHT: fx+=1; x=xrround(fx); y=ntrunc(fy); break;
+ case UP: fy-=1; y=ntrunc(fy); x=ntrunc(fx); break;
+- case DOWN: fy+=1; y=round(fy); x=ntrunc(fx); break;
++ case DOWN: fy+=1; y=xrround(fy); x=ntrunc(fx); break;
+ }
+ icorrectpos(&x, &y);
+ if(!checkdest(x, y)) {
+@@ -460,8 +460,8 @@
+ if(!(amonst->x == target->x || amonst->y == target->y)) return 0;
+
+ /* Halfsteps are banned */
+- if(round(amonst->x) != ntrunc(amonst->x)) return 0;
+- if(round(amonst->y) != ntrunc(amonst->y)) return 0;
++ if(xrround(amonst->x) != ntrunc(amonst->x)) return 0;
++ if(xrround(amonst->y) != ntrunc(amonst->y)) return 0;
+
+ /* Force x1, y1 to be smaller pair */
+ if(x1 > x2) {
diff --git a/games/xroads/files/patch-xroads.c b/games/xroads/files/patch-xroads.c
new file mode 100644
index 000000000000..9516ba106f63
--- /dev/null
+++ b/games/xroads/files/patch-xroads.c
@@ -0,0 +1,134 @@
+--- xroads.c.orig Fri Jul 16 21:37:03 1999
++++ xroads.c Sat Nov 20 10:01:35 2004
+@@ -318,7 +318,7 @@
+ }
+
+ /*************************************************************************************************/
+-int round( float num ) { /* Round a float to an int */
++int xrround( float num ) { /* Round a float to an int */
+ return (int)(num+0.5);
+ }
+
+@@ -452,8 +452,8 @@
+ }
+
+ /* VacAttack */
+- if(data[amonst->type].attack1==VACCUUM && (round(amonst->x) ==
+- ntrunc(amonst->x) && round(amonst->y) == ntrunc(amonst->y)) &&
++ if(data[amonst->type].attack1==VACCUUM && (xrround(amonst->x) ==
++ ntrunc(amonst->x) && xrround(amonst->y) == ntrunc(amonst->y)) &&
+ clearshot(amonst, &monst[targ]) && amonst->team!=monst[targ].team
+ && data[monst[targ].type].etype != POWERUP) {
+ watchentity(amonst, &monst[targ]);
+@@ -479,9 +479,9 @@
+ else amonst->frame++;
+
+ if(data[amonst->type].etype!=EFFECT) {
+- maze[round(oldy)][round(oldx)]=-2; /* Blank out old space */
++ maze[xrround(oldy)][xrround(oldx)]=-2; /* Blank out old space */
+ maze[ntrunc(oldy)][ntrunc(oldx)]=-2;
+- maze[round(amonst->y)][round(amonst->x)]=number;
++ maze[xrround(amonst->y)][xrround(amonst->x)]=number;
+ maze[ntrunc(amonst->y)][ntrunc(amonst->x)]=number;
+ }
+
+@@ -491,8 +491,8 @@
+ draw_tilex2(mainwindow, data[bmonst->type].tile[bmonst->frame], (bmonst->x)*GRIDSIZE,
+ (bmonst->y)*GRIDSIZE, bmonst->color, bmonst->dir);
+ }
+- if(maze[round(amonst->y)][round(amonst->x)]!=-2) {
+- bmonst=&monst[maze[round(amonst->y)][round(amonst->x)]];
++ if(maze[xrround(amonst->y)][xrround(amonst->x)]!=-2) {
++ bmonst=&monst[maze[xrround(amonst->y)][xrround(amonst->x)]];
+ draw_tilex2(mainwindow, data[bmonst->type].tile[bmonst->frame], (bmonst->x)*GRIDSIZE,
+ (bmonst->y)*GRIDSIZE, bmonst->color, bmonst->dir);
+ }
+@@ -615,7 +615,7 @@
+ else if(player->attr & PULL_R) { newx+=1; player->attr &= ~PULL_R; }
+
+ /* Only one half-step at a time */
+- if(round(newx)!=ntrunc(newx) && round(newy)!=ntrunc(newy)) {
++ if(xrround(newx)!=ntrunc(newx) && xrround(newy)!=ntrunc(newy)) {
+ #ifdef DEBUG
+ printf("Damn, in two half-steps at a time...\n");
+ #endif
+@@ -631,17 +631,17 @@
+
+ /* If we're in a half-step, eqx and eqy are the space we're moving
+ into */
+- if(round(newx)!=ntrunc(newx)) {
++ if(xrround(newx)!=ntrunc(newx)) {
+ eqy = ntrunc(newy);
+ if(newx > player->x)
+- eqx = round(newx);
++ eqx = xrround(newx);
+ else if(newx < player->x)
+ eqx = ntrunc(newx);
+ }
+- else if(round(newy)!=ntrunc(newy)) {
++ else if(xrround(newy)!=ntrunc(newy)) {
+ eqx = ntrunc(newx);
+ if(newy > player->y)
+- eqy = round(newy);
++ eqy = xrround(newy);
+ else if(newy < player->y)
+ eqy = ntrunc(newy);
+ }
+@@ -652,9 +652,9 @@
+ /*
+ switch(player->dir) {
+ case LEFT: eqx = ntrunc(newx); break;
+- case RIGHT: eqx = round(newx); break;
++ case RIGHT: eqx = xrround(newx); break;
+ case UP: eqy = ntrunc(newy); break;
+- case DOWN: eqy = round(newy); break;
++ case DOWN: eqy = xrround(newy); break;
+ default: break;
+ }
+ */
+@@ -667,8 +667,8 @@
+ printf("Destination (%0.2f, %0.2f)...\n", newx, newy);
+ printf("Equiv (%d, %d)\n", eqx, eqy);
+ printf("@ %d, %d : %d\n", eqx, eqy, maze[eqy][eqx]);
+- printf("newx: %0.2f: round %d, ntrunc %d\n", newx, round(newx), ntrunc(newx));
+- printf("newy: %0.2f: round %d, ntrunc %d\n", newy, round(newy), ntrunc(newy));
++ printf("newx: %0.2f: round %d, ntrunc %d\n", newx, xrround(newx), ntrunc(newx));
++ printf("newy: %0.2f: round %d, ntrunc %d\n", newy, xrround(newy), ntrunc(newy));
+ printf("Checkdest: %d\n", checkdest(eqx, eqy));
+ printf("-----\n");
+ }
+@@ -704,7 +704,7 @@
+ #ifdef DEBUG
+ printf("something in the way. (%d or %d)\n",
+ maze[ntrunc(newy)][ntrunc(newx)],
+- maze[round(newy)][round(newy)]);
++ maze[xrround(newy)][xrround(newy)]);
+ #endif
+ newx=player->x;
+ newy=player->y;
+@@ -715,14 +715,14 @@
+ #endif
+
+ /* Destination has been set, now all we have to do is move there */
+- maze[round(player->y)][round(player->x)]=-2;
++ maze[xrround(player->y)][xrround(player->x)]=-2;
+ maze[ntrunc(player->y)][ntrunc(player->x)]=-2;
+ draw_tilex2(mainwindow, blank, player->x*GRIDSIZE, player->y*GRIDSIZE,
+ BLACK, RIGHT);
+
+ /* Draw player */
+ player->x=newx; player->y=newy;
+- maze[round(player->y)][round(player->x)]=player->ind;
++ maze[xrround(player->y)][xrround(player->x)]=player->ind;
+ maze[ntrunc(player->y)][ntrunc(player->x)]=player->ind;
+ draw_tilex2(mainwindow, data[datapos].tile[player->frame],
+ player->x*GRIDSIZE, player->y*GRIDSIZE,
+@@ -1340,7 +1340,7 @@
+ player[i]->health = 0;
+ if(player[i]->attr & ACTIVE) {
+ player[i]->attr ^= ACTIVE;
+- maze[round(player[i]->y)][round(player[i]->x)] = -2;
++ maze[xrround(player[i]->y)][xrround(player[i]->x)] = -2;
+ maze[ntrunc(player[i]->y)][ntrunc(player[i]->x)] = -2;
+ draw_tilex2(mainwindow, blank, player[i]->x*GRIDSIZE,
+ player[i]->y*GRIDSIZE, BLACK, RIGHT);
diff --git a/games/xroads/files/patch-xroads.h b/games/xroads/files/patch-xroads.h
new file mode 100644
index 000000000000..0c82d490f7d7
--- /dev/null
+++ b/games/xroads/files/patch-xroads.h
@@ -0,0 +1,11 @@
+--- xroads.h.orig Sat Nov 20 09:50:11 2004
++++ xroads.h Sat Nov 20 09:49:42 2004
+@@ -33,7 +33,7 @@
+ void killme( char * );
+ void xconnect( int, char *[] );
+ int ntrunc( float );
+-int round( float );
++int xrround( float );
+ #ifdef SIGHANDLE
+ void sigcatch( int );
+ #endif