Upgrade to version 2.6, a lot of patches from FreeBSD ports.

This commit is contained in:
angelos 1999-01-14 03:29:52 +00:00
parent 6e5e31e698
commit fc83d70403
10 changed files with 631 additions and 298 deletions

View File

@ -1,17 +1,17 @@
# $OpenBSD: Makefile,v 1.3 1998/11/09 01:49:57 marc Exp $ # $OpenBSD: Makefile,v 1.4 1999/01/14 03:29:52 angelos Exp $
# #
DISTNAME= xboing2.3 DISTNAME= xboing2.4
PKGNAME= xboing-2.3 PKGNAME= xboing-2.4
CATEGORIES= games CATEGORIES= games
#BROKEN= "newer version available"
MAINTAINER= angelos@openbsd.org MAINTAINER= angelos@openbsd.org
MASTER_SITES= ${MASTER_SITE_XCONTRIB} MASTER_SITES= ${MASTER_SITE_XCONTRIB}
MASTER_SITE_SUBDIR= games MASTER_SITE_SUBDIR= games
LIB_DEPENDS= Xpm.4:${PORTSDIR}/graphics/xpm
USE_IMAKE= yes USE_IMAKE= yes
WRKSRC= ${WRKDIR}/xboing WRKSRC= ${WRKDIR}/xboing

View File

@ -1 +1 @@
MD5 (xboing2.3.tar.gz) = c73134a6121fdd7bc8e730114afc2ad8 MD5 (xboing2.4.tar.gz) = d596d29e53cf0deceb18f3b646787709

View File

@ -1,78 +1,456 @@
diff -rc /usr/ports/games/xboing/xboing/include/misc.h ./include/misc.h --- bonus.c.orig Thu Nov 20 03:12:56 1997
*** /usr/ports/games/xboing/xboing/include/misc.h Wed Jan 4 17:14:48 1995 +++ bonus.c Thu Nov 20 03:15:32 1997
--- ./include/misc.h Mon Apr 3 22:26:22 1995 @@ -311,7 +311,7 @@
*************** XFlush(display);
*** 87,93 ****
int ObtainWindowWidthHeight(Display *display, Window window, SetBonusWait(BONUS_SCORE, frame + 5);
int *width, int *height); - SetGameSpeed(SLOW_SPEED);
void sleepSync(Display *display, unsigned long ms); + SetGameSpeed(MEDIUM_SPEED);
! int usleep(unsigned long usec);
int ObtainMousePosition(Display *display, Window window, int *x, int *y); DEBUG("set bonus mode to BONUS_SCORE.")
int YesNoDialogue(Display *display, char *message); }
Pixmap ScalePixmap(Display *display, Window window, Pixmap source, @@ -326,7 +326,7 @@
--- 87,93 ---- {
int ObtainWindowWidthHeight(Display *display, Window window, DEBUG("in function DoScore() in bonus.c")
int *width, int *height);
void sleepSync(Display *display, unsigned long ms); - SetGameSpeed(SLOW_SPEED);
! int Usleep(unsigned long usec); + SetGameSpeed(MEDIUM_SPEED);
int ObtainMousePosition(Display *display, Window window, int *x, int *y);
int YesNoDialogue(Display *display, char *message); /* Nice message rewarding you for your efforts */
Pixmap ScalePixmap(Display *display, Window window, Pixmap source, strcpy(string, "Congratulations on finishing this level.");
*************** @@ -336,7 +336,7 @@
*** 100,106 ****
int YesNoDialogue(); ypos += (35 + GAP);
int ObtainMousePosition(); SetBonusWait(BONUS_BONUS, frame + LINE_DELAY);
void sleepSync(); - SetGameSpeed(SLOW_SPEED);
! int usleep(); + SetGameSpeed(MEDIUM_SPEED);
int ObtainWindowWidthHeight(); DEBUG("set bonus mode to BONUS_BONUS.")
int ResizeMainWindow(); }
char *GetHomeDir();
--- 100,106 ---- @@ -387,7 +387,7 @@
int YesNoDialogue(); DrawShadowCentredText(display, window, textFont,
int ObtainMousePosition(); string, ypos, blue, TOTAL_WIDTH);
void sleepSync();
! int Usleep(); - SetGameSpeed(SLOW_SPEED);
int ObtainWindowWidthHeight(); + SetGameSpeed(MEDIUM_SPEED);
int ResizeMainWindow();
char *GetHomeDir(); /* Now skip to the next sequence */
diff -rc /usr/ports/games/xboing/xboing/misc.c ./misc.c SetBonusWait(BONUS_LEVEL, frame + LINE_DELAY);
*** /usr/ports/games/xboing/xboing/misc.c Wed Jan 4 17:13:33 1995 @@ -411,7 +411,7 @@
--- ./misc.c Mon Apr 3 22:13:07 1995 bonusScore += ComputeScore(SUPER_BONUS_SCORE);
*************** DisplayScore(display, scoreWindow, bonusScore);
*** 79,87 ****
*/ - SetGameSpeed(SLOW_SPEED);
+ SetGameSpeed(MEDIUM_SPEED);
#if NeedFunctionPrototypes
! int usleep(unsigned long usec) /* Now skip to the next sequence */
#else SetBonusWait(BONUS_LEVEL, frame + LINE_DELAY);
! int usleep(usec) @@ -454,7 +454,7 @@
unsigned long usec; ypos += (int) (textFont->ascent + GAP * 1.5);
#endif firstTime = True;
{
--- 79,87 ---- - SetGameSpeed(SLOW_SPEED);
*/ + SetGameSpeed(MEDIUM_SPEED);
}
#if NeedFunctionPrototypes }
! int Usleep(unsigned long usec)
#else @@ -468,7 +468,7 @@
! int Usleep(usec) {
unsigned long usec; int secs, theLevel;
#endif
{ - SetGameSpeed(SLOW_SPEED);
*************** + SetGameSpeed(MEDIUM_SPEED);
*** 122,128 ****
((et.tv_usec - st.tv_usec) / 1000) ); /* Get the number of seconds left on the clock */
secs = GetLevelTimeBonus();
if ((ms) > ((1000 / 60) + SyncTime)) @@ -533,7 +533,7 @@
! usleep(ms - SyncTime); /* Play the sound for the super bonus */
} if (noSound == False) playSoundFile("Doh3", 80);
#if NeedFunctionPrototypes - SetGameSpeed(SLOW_SPEED);
--- 122,128 ---- + SetGameSpeed(MEDIUM_SPEED);
((et.tv_usec - st.tv_usec) / 1000) );
/* Get ready for the next sequence */
if ((ms) > ((1000 / 60) + SyncTime)) SetBonusWait(BONUS_TIME, frame + LINE_DELAY);
! Usleep(ms - SyncTime); @@ -569,7 +569,7 @@
} SetBonusWait(BONUS_TIME, frame + LINE_DELAY);
ypos += (textFont->ascent + GAP/2);
#if NeedFunctionPrototypes firstTime = True;
- SetGameSpeed(SLOW_SPEED);
+ SetGameSpeed(MEDIUM_SPEED);
}
}
@@ -583,7 +583,7 @@
{
int secs = 0;
- SetGameSpeed(SLOW_SPEED);
+ SetGameSpeed(MEDIUM_SPEED);
/* Get the number of seconds left on the clock */
secs = GetLevelTimeBonus();
@@ -627,7 +627,7 @@
int myrank = 0;
char str[5];
- SetGameSpeed(SLOW_SPEED);
+ SetGameSpeed(MEDIUM_SPEED);
/* Obtain current ranking for this score */
myrank = GetHighScoreRanking(score);
@@ -680,7 +680,7 @@
{
DEBUG("DoEndText in bonus screen.")
- SetGameSpeed(SLOW_SPEED);
+ SetGameSpeed(MEDIUM_SPEED);
/* Finishing sentence - so you know what level to do */
sprintf(string, "Prepare for level %ld", level+1);
--- main.c.orig Thu Nov 20 03:15:34 1997
+++ main.c Thu Nov 20 03:15:54 1997
@@ -156,7 +156,7 @@
/* Set an entire game speedup or slowdown speed */
temp = (speed / (long) userDelay);
- userDelay = delay;
+ userDelay = delay/2 + 3;
speed = (long) (temp * userDelay);
speedLevel = 10 - delay;
}
--- misc.c.orig Fri Nov 22 09:28:46 1996
+++ misc.c Thu Nov 20 03:18:15 1997
@@ -89,8 +89,8 @@
#ifdef SYSV
#ifdef __clipper__
struct timeval tv;
- tv.tv_sec=((usec)/1000);
- tv.tv_usec=(((usec)%1000)*1000);
+ tv.tv_sec=((usec)/1000000);
+ tv.tv_usec=((usec)%1000000);
select(1,NULL,NULL,NULL,&tv);
#else
poll((struct poll *) 0, (size_t) 0, usec / 1000); /* ms resolution */
@@ -105,6 +105,68 @@
#endif
#if NeedFunctionPrototypes
+static int kudelay(unsigned long count)
+#else
+static int kudelay(count)
+unsigned long count;
+#endif
+{
+ unsigned int bluff = 1;
+
+ while( count-- != 0 ) /* this can hardly be "optimised out" */
+ bluff = (bluff ^ ((bluff & 1) * 0x6110)) >> 1;
+
+ return( bluff );
+}
+
+#if NeedFunctionPrototypes
+static void kusleep(unsigned long usec)
+#else
+static void kusleep(usec)
+ unsigned long usec;
+#endif
+{
+ static float kuliber_time = 0.0;
+ static float kuliber_count = 0.0;
+ static unsigned long kutimerswap = (1000000 / 15);
+ struct timeval st, et;
+ long gap;
+ unsigned long count;
+
+ if( kuliber_time == 0.0 )
+ {
+ count = 0x1000; /* calibrate delay loop */
+ gettimeofday(&st, NULL);
+
+ while( True )
+ {
+ kudelay( count );
+ count = (count << 1);
+ gettimeofday(&et, NULL);
+ gap = (((et.tv_sec - st.tv_sec) * 1000000) +
+ (et.tv_usec - st.tv_usec) );
+
+ if( gap > 400*1000 )
+ break;
+ }
+
+ kuliber_time = (float)(gap/4);
+ kuliber_count = (float)(((count-1)&~0xFFF)>>2);
+ }
+
+ if( usec > kutimerswap )
+ {
+ kutimerswap = (1000000 / 30);
+ usleep( usec ); /* using usleep() for low resolution only */
+ }
+ else
+ {
+ kutimerswap = (1000000 / 15);
+ kudelay( (unsigned long)(kuliber_count*((float)usec/kuliber_time)) );
+ }
+}
+
+#if NeedFunctionPrototypes
void sleepSync(Display *display, unsigned long ms)
#else
void sleepSync(display, ms)
@@ -112,27 +174,85 @@
unsigned long ms;
#endif
{
- struct timeval st, et;
- long SyncTime;
- static unsigned long accu;
+ static long Expected_time = 0;
+ static long Ref_sec = 0;
+ static long Ref_usec = 0;
+ static long Sleeping_time = 0;
+ static int PLL_filter = 0;
+ struct timeval st;
+ long elapsed;
+ long dodelay;
+ float x;
- gettimeofday(&st, NULL);
XSync(display, False);
- gettimeofday(&et, NULL);
- SyncTime = (((et.tv_sec - st.tv_sec) * 1000) +
- ((et.tv_usec - st.tv_usec) / 1000) );
+ gettimeofday(&st, NULL);
+
+ if( Ref_sec == 0 )
+ {
+ Ref_sec = st.tv_sec; /* take the initial reference point */
+ Ref_usec = st.tv_usec;
+ Sleeping_time = ms * 1000;
+ }
+
+ elapsed = (st.tv_sec - Ref_sec) * 1000000 + (st.tv_usec - Ref_usec);
+ dodelay = Sleeping_time;
+
+ if( PLL_filter > 0 && elapsed != 0 ) /* Phase lock loop */
+ {
+ dodelay = Expected_time + Sleeping_time - elapsed;
+
+ if( dodelay < 0 )
+ {
+ dodelay = 0; PLL_filter--;
+ }
+ else
+ if( dodelay > 2*Sleeping_time )
+ {
+ dodelay = 2*Sleeping_time; PLL_filter--;
+ }
+ else
+ PLL_filter = 3;
+
+ if( elapsed > 40*Sleeping_time && Expected_time > 40*Sleeping_time )
+ {
+ elapsed -= 20*Sleeping_time; /* Ref. point shouldn't be far away*/
+ Expected_time -= 20*Sleeping_time;
+ Ref_usec += 20*Sleeping_time;
+ Ref_sec += Ref_usec/1000000; Ref_usec %= 1000000;
+ }
+ }
-/* if ((ms) > ((1000 / 60) + SyncTime))
- usleep(ms - SyncTime);
-*/
- if ((ms + accu) > ((1000 / 30) + SyncTime))
+ if( PLL_filter <= 0 && elapsed > 40000 ) /* Frequency lock loop */
{
- usleep(ms +accu - SyncTime);
- accu = 0;
+ /* feedback filter */
+ x = 0.5 + 0.5 * (float)Expected_time / (float)elapsed;
+
+ if( x < 0.966 ) /* Acceleration must be strongly limited */
+ x = 0.966;
+
+ if( x > 2.0 )
+ x = 2.0;
+
+ Sleeping_time = (long)((float)Sleeping_time * x);
+
+ if( Sleeping_time < 500 )
+ Sleeping_time = 500;
+
+ if( x > 0.99 && x < 1.01 && Sleeping_time > ms*500 )
+ PLL_filter = -1 - 4*PLL_filter; /* locked - it's time to try PLL */
+ else
+ PLL_filter = 0;
+
+ Ref_sec = st.tv_sec;
+ Ref_usec = st.tv_usec;
+ Expected_time = 0;
+ dodelay = Sleeping_time;
}
- else if (ms > SyncTime)
- accu += (ms - SyncTime);
+
+ kusleep( dodelay );
+
+ Expected_time += ms * 1000;
}
#if NeedFunctionPrototypes
--- presents.c.orig Thu Nov 20 03:18:42 1997
+++ presents.c Thu Nov 20 03:21:38 1997
@@ -287,7 +287,7 @@
}
#endif
- SetPresentWait(PRESENT_TEXT1, frame + 800);
+ SetPresentWait(PRESENT_TEXT1, frame + 200);
}
#if NeedFunctionPrototypes
@@ -309,7 +309,7 @@
RenderShape(display, window, justin, justinM,
x, y, 285, 44, True);
- SetPresentWait(PRESENT_TEXT2, frame + 300);
+ SetPresentWait(PRESENT_TEXT2, frame + 100);
}
#if NeedFunctionPrototypes
@@ -331,7 +331,7 @@
RenderShape(display, window, kibell, kibellM,
x, y, 260, 40, True);
- SetPresentWait(PRESENT_TEXT3, frame + 500);
+ SetPresentWait(PRESENT_TEXT3, frame + 200);
}
#if NeedFunctionPrototypes
@@ -355,7 +355,7 @@
RenderShape(display, window, presents, presentsM,
x, y, 410, 44, True);
- SetPresentWait(PRESENT_TEXT_CLEAR, frame + 750);
+ SetPresentWait(PRESENT_TEXT_CLEAR, frame + 250);
}
#if NeedFunctionPrototypes
@@ -375,7 +375,7 @@
FadeAwayArea(display, window, x, y, 410, 44);
- SetPresentWait(PRESENT_LETTERS, frame + 10);
+ SetPresentWait(PRESENT_LETTERS, frame + 5);
}
/* The distances for the gap inbetwen blocks */
@@ -404,7 +404,7 @@
DrawLetter(display, window, i, x, y);
x += 10 + dists[i];
- SetPresentWait(PRESENT_LETTERS, frame + 300);
+ SetPresentWait(PRESENT_LETTERS, frame + 100);
}
else
{
@@ -416,7 +416,7 @@
x += dists[3];
DrawLetter(display, window, 3, x, y);
- SetPresentWait(PRESENT_SHINE, frame + 200);
+ SetPresentWait(PRESENT_SHINE, frame + 100);
}
i++;
@@ -463,7 +463,7 @@
if (in == 11)
{
XCopyArea(display, store, window, gc, 0, 0, 20, 20, x, y);
- SetPresentWait(PRESENT_SPECIAL_TEXT1, frame + 500);
+ SetPresentWait(PRESENT_SPECIAL_TEXT1, frame + 100);
}
}
}
@@ -499,7 +499,7 @@
len = strlen(wisdom);
x = ((PLAY_WIDTH + MAIN_WIDTH) / 2) -
(XTextWidth(dataFont, wisdom, len) / 2);
- nextFrame = frame + 10;
+ nextFrame = frame + 5;
first = False;
}
@@ -508,11 +508,11 @@
if (noSound == False) playSoundFile("key", 60);
DrawText(display, window, x, y, dataFont, red, wisdom, i);
- nextFrame = frame + 30;
+ nextFrame = frame + 15;
i++;
if (i > len)
- SetPresentWait(PRESENT_SPECIAL_TEXT2, frame + 700);
+ SetPresentWait(PRESENT_SPECIAL_TEXT2, frame + 150);
}
}
@@ -542,7 +542,7 @@
len = strlen(wisdom2);
x = ((PLAY_WIDTH + MAIN_WIDTH) / 2) -
(XTextWidth(dataFont, wisdom2, len) / 2);
- nextFrame = frame + 10;
+ nextFrame = frame + 5;
first = False;
}
@@ -551,11 +551,11 @@
if (noSound == False) playSoundFile("key", 60);
DrawText(display, window, x, y, dataFont, red, wisdom2, i);
- nextFrame = frame + 30;
+ nextFrame = frame + 15;
i++;
if (i > len)
- SetPresentWait(PRESENT_SPECIAL_TEXT3, frame + 700);
+ SetPresentWait(PRESENT_SPECIAL_TEXT3, frame + 150);
}
}
@@ -584,7 +584,7 @@
len = strlen(wisdom3);
x = ((PLAY_WIDTH + MAIN_WIDTH) / 2) -
(XTextWidth(dataFont, wisdom3, len) / 2);
- nextFrame = frame + 10;
+ nextFrame = frame + 5;
first = False;
}
@@ -593,11 +593,11 @@
if (noSound == False) playSoundFile("key", 60);
DrawText(display, window, x, y, dataFont, red, wisdom3, i);
- nextFrame = frame + 30;
+ nextFrame = frame + 15;
i++;
if (i > len)
- SetPresentWait(PRESENT_CLEAR, frame + 800);
+ SetPresentWait(PRESENT_CLEAR, frame + 200);
}
}
@@ -642,7 +642,7 @@
yb -= 10;
if (yt > ((PLAY_HEIGHT + MAIN_HEIGHT) / 2))
- SetPresentWait(PRESENT_FINISH, frame + 20);
+ SetPresentWait(PRESENT_FINISH, frame + 10);
nextFrame = frame + 20;
}

View File

@ -1,7 +1,7 @@
*** audio/LINUXaudio.c.orig Tue May 24 16:34:59 1994 *** audio/LINUXaudio.c.orig Thu Nov 20 03:04:17 1997
--- audio/LINUXaudio.c Sun Mar 5 23:43:14 1995 --- audio/LINUXaudio.c Thu Nov 20 03:04:31 1997
*************** ***************
*** 38,44 **** *** 55,61 ****
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
@ -9,12 +9,12 @@
#include "include/error.h" #include "include/error.h"
#include "include/audio.h" #include "include/audio.h"
--- 38,45 ---- --- 55,61 ----
#include <unistd.h> #include <unistd.h>
#include <stdio.h> #include <stdio.h>
#include <fcntl.h> #include <fcntl.h>
+ #include <sys/ioctl.h> + #include <sys/ioctl.h>
! #include <machine/soundcard.h> ! #include <soundcard.h>
#include "include/error.h" #include "include/error.h"
#include "include/audio.h" #include "include/audio.h"

View File

@ -1,64 +1,44 @@
*** Imakefile.orig Wed Jun 1 17:11:10 1994 --- Imakefile.orig Fri Nov 22 09:28:46 1996
--- Imakefile Sun Mar 5 23:43:55 1995 +++ Imakefile Thu Jul 16 11:08:58 1998
*************** @@ -24,23 +24,23 @@
*** 5,24 **** XCOMM This is the directory where the highscore, level & sound data will be
XCOMM This is the directory where the highscore, level & sound data will be XCOMM placed. Default will be the current directory.
XCOMM placed. Default will be the current directory.
- XBOING_DIR = .
! XBOING_DIR = . + XBOING_DIR = ${X11BASE}/lib/X11/xboing
XCOMM These are some defines that must be set. Some may be overwritten in the XCOMM These are some defines that must be set. Some may be overwritten in the
XCOMM machine arch section. XCOMM machine arch section.
! XPMLIB = -L../xpm-3.4c/lib -lXpm - XPMLIB = -L/usr/X11/lib -lXpm
! XPMINCLUDE = -I../xpm-3.4c/lib - XPMINCLUDE = -I/usr/X11/include/X11
XBOINGINCLUDE = -I./include + XPMLIB = -lXpm
LEVEL_INSTALL_DIR = $(XBOING_DIR)/levels + XPMINCLUDE = -I${X11BASE}/include/X11
SOUNDS_DIR = $(XBOING_DIR)/sounds XBOINGINCLUDE = -I./include
BACKUP_DIR = $(XBOING_DIR)/../backups LEVEL_INSTALL_DIR = $(XBOING_DIR)/levels
HIGH_SCORE_FILE = $(XBOING_DIR)/.xboing.scr SOUNDS_DIR = $(XBOING_DIR)/sounds
! AUDIO_AVAILABLE = False BACKUP_DIR = $(XBOING_DIR)/../backups
! AUDIO_SRC = audio/NOaudio.c HIGH_SCORE_FILE = $(XBOING_DIR)/.xboing.scr
AUDIO_INCLUDE = - AUDIO_AVAILABLE = False
! AUDIO_LIB = - AUDIO_SRC = audio/NOaudio.c
+ AUDIO_AVAILABLE = True
--- 5,24 ---- + AUDIO_SRC = audio/LINUXaudio.c
XCOMM This is the directory where the highscore, level & sound data will be AUDIO_INCLUDE =
XCOMM placed. Default will be the current directory. - AUDIO_LIB =
+ AUDIO_LIB = -lossaudio
! XBOING_DIR = /usr/X11R6/lib/X11/xboing - CDEBUGFLAGS = -g
+ CDEBUGFLAGS = -O2 -pipe
XCOMM These are some defines that must be set. Some may be overwritten in the
XCOMM machine arch section. XCOMM Uncomment this if you want to use ANY of the AUDIO sound systems
#define COMPILE_IN_AUDIO
! XPMLIB = -lXpm @@ -132,8 +132,8 @@
! XPMINCLUDE = -I/usr/X11R6/include/X11 -DLEVEL_INSTALL_DIR=\"$(LEVEL_INSTALL_DIR)\" \
XBOINGINCLUDE = -I./include -DAUDIO_AVAILABLE=\"$(AUDIO_AVAILABLE)\" \
LEVEL_INSTALL_DIR = $(XBOING_DIR)/levels -DSOUNDS_DIR=\"$(SOUNDS_DIR)\" \
SOUNDS_DIR = $(XBOING_DIR)/sounds - -DREADMEP_FILE=\"$(XBOING_DIR)/docs/problems.doc\"
BACKUP_DIR = $(XBOING_DIR)/../backups -XCOMM -DUSE_FLOCK=\"True\" \
HIGH_SCORE_FILE = $(XBOING_DIR)/.xboing.scr + -DREADMEP_FILE=\"$(XBOING_DIR)/problems.doc\" \
! AUDIO_AVAILABLE = True + -DUSE_FLOCK=\"True\"
! AUDIO_SRC = audio/LINUXaudio.c XCOMM -DNEED_USLEEP=\"True\" \
AUDIO_INCLUDE = XCOMM -DNO_LOCKING=\"True\"
! AUDIO_LIB = -lossaudio
***************
*** 98,105 ****
-DLEVEL_INSTALL_DIR=\"$(LEVEL_INSTALL_DIR)\" \
-DAUDIO_AVAILABLE=\"$(AUDIO_AVAILABLE)\" \
-DSOUNDS_DIR=\"$(SOUNDS_DIR)\" \
! -DREADMEP_FILE=\"$(XBOING_DIR)/docs/problems.doc\"
! XCOMM -DUSE_FLOCK=\"True\" \
XCOMM -DNO_LOCKING=\"True\"
LOCAL_LIBRARIES = $(AUDIO_LIB) $(XPMLIB) $(XLIB) -lm
--- 98,105 ----
-DLEVEL_INSTALL_DIR=\"$(LEVEL_INSTALL_DIR)\" \
-DAUDIO_AVAILABLE=\"$(AUDIO_AVAILABLE)\" \
-DSOUNDS_DIR=\"$(SOUNDS_DIR)\" \
! -DREADMEP_FILE=\"$(XBOING_DIR)/docs/problems.doc\" \
! -DUSE_FLOCK=\"True\"
XCOMM -DNO_LOCKING=\"True\"
LOCAL_LIBRARIES = $(AUDIO_LIB) $(XPMLIB) $(XLIB) -lm

View File

@ -1,134 +1,82 @@
*** highscore.c.orig Wed Jan 4 17:13:31 1995 --- highscore.c.orig Thu Nov 20 03:07:35 1997
--- highscore.c Fri Apr 7 00:13:54 1995 +++ highscore.c Thu Nov 20 03:12:23 1997
*************** @@ -55,6 +55,7 @@
*** 54,59 **** #include <time.h>
--- 54,60 ---- #include <file.h>
#include <unistd.h> #include <sys/param.h>
#include <time.h> +#include <sys/stat.h>
#include <sys/param.h> #include <X11/Xlib.h>
+ #include <sys/stat.h> #include <X11/Xutil.h>
#include <netinet/in.h> #include <X11/Xos.h>
#include <X11/Xlib.h> @@ -119,7 +120,7 @@
#include <X11/Xutil.h> static void InitialiseHighScores(void);
*************** static void SortHighScores(void);
*** 118,124 **** static void DeleteScore(int i);
static void InitialiseHighScores(void); -static int LockUnlock(int cmd);
static void SortHighScores(void); +static int LockUnlock(int cmd, int fd);
static void DeleteScore(int i); #else
! static int LockUnlock(int cmd); static int LockUnlock();
#else static void DeleteScore();
static int LockUnlock(); @@ -844,7 +845,7 @@
static void DeleteScore();
--- 119,125 ---- /* Lock the file for me only */
static void InitialiseHighScores(void); if (type == GLOBAL)
static void SortHighScores(void); - id = LockUnlock(LOCK_FILE);
static void DeleteScore(int i); + id = LockUnlock(LOCK_FILE, -1);
! static int LockUnlock(int cmd, int fd);
#else /* Read in the lastest scores */
static int LockUnlock(); if (ReadHighScoreTable(type) == False)
static void DeleteScore(); @@ -875,8 +876,8 @@
*************** {
*** 839,845 **** /* Don't add as score is smaller */
if (id != -1)
/* Lock the file for me only */ - id = LockUnlock(UNLOCK_FILE);
if (type == GLOBAL) - return False;
! id = LockUnlock(LOCK_FILE); + id = LockUnlock(UNLOCK_FILE, id);
+ goto doUnlock;
/* Read in the lastest scores */ }
if (ReadHighScoreTable(type) == False) }
--- 840,846 ---- } /* for */
@@ -898,16 +899,17 @@
/* Lock the file for me only */
if (type == GLOBAL) /* Unlock the file now thanks */
! id = LockUnlock(LOCK_FILE, -1); if (id != -1)
- id = LockUnlock(UNLOCK_FILE);
/* Read in the lastest scores */ + id = LockUnlock(UNLOCK_FILE, id);
if (ReadHighScoreTable(type) == False)
*************** /* Yes - it was placed in the highscore */
*** 869,875 **** return True;
else }
{ }
/* Don't add as score is smaller */
! return False; +doUnlock:
} /* Unlock the file now thanks */
} if (id != -1)
} /* for */ - id = LockUnlock(UNLOCK_FILE);
--- 870,876 ---- + id = LockUnlock(UNLOCK_FILE, id);
else
{ /* Not even a highscore - loser! */
/* Don't add as score is smaller */ return False;
! goto doUnlock; @@ -1185,10 +1187,10 @@
} }
}
} /* for */ #if NeedFunctionPrototypes
*************** -static int LockUnlock(int cmd)
*** 891,906 **** +static int LockUnlock(int cmd, int fd)
#else
/* Unlock the file now thanks */ static int LockUnlock(cmd)
if (id != -1) - int cmd;
! id = LockUnlock(UNLOCK_FILE); + int cmd, fd;
#endif
/* Yes - it was placed in the highscore */ {
return True; static int inter = -1;
} @@ -1225,6 +1227,9 @@
} /* Open the highscore file for both read & write */
if (cmd == LOCK_FILE)
/* Unlock the file now thanks */ inter = open(filename, O_CREAT | O_RDWR, 0666);
if (id != -1) + else
! id = LockUnlock(UNLOCK_FILE); + /* use old fd to unlock */
+ inter = fd;
/* Not even a highscore - loser! */
return False; #ifndef NO_LOCKING
--- 892,908 ----
/* Unlock the file now thanks */
if (id != -1)
! id = LockUnlock(UNLOCK_FILE, id);
/* Yes - it was placed in the highscore */
return True;
}
}
+ doUnlock:
/* Unlock the file now thanks */
if (id != -1)
! id = LockUnlock(UNLOCK_FILE, id);
/* Not even a highscore - loser! */
return False;
***************
*** 1178,1187 ****
}
#if NeedFunctionPrototypes
! static int LockUnlock(int cmd)
#else
! static int LockUnlock(cmd)
! int cmd;
#endif
{
static int inter = -1;
--- 1180,1189 ----
}
#if NeedFunctionPrototypes
! static int LockUnlock(int cmd, int fd)
#else
! static int LockUnlock(cmd, fd)
! int cmd, fd;
#endif
{
static int inter = -1;
***************
*** 1218,1223 ****
--- 1220,1228 ----
/* Open the highscore file for both read & write */
if (cmd == LOCK_FILE)
inter = open(filename, O_CREAT | O_RDWR, 0666);
+ else
+ /* use old fd to unlock */
+ inter = fd;
#ifndef NO_LOCKING

View File

@ -1,5 +1,5 @@
*** ball.c.orig Tue May 19 22:49:22 1998 *** ball.c.orig Wed Jan 13 22:16:23 1999
--- ball.c Tue May 19 22:49:27 1998 --- ball.c Wed Jan 13 22:16:29 1999
*************** ***************
*** 50,56 **** *** 50,56 ****
#include <stdio.h> #include <stdio.h>
@ -7,6 +7,6 @@
#include <math.h> #include <math.h>
- #include <values.h> - #include <values.h>
#include <xpm.h> #include <xpm.h>
#include <X11/Xos.h>
#include "bitmaps/balls/ball1.xpm"
--- 50,55 ---- --- 50,55 ----

View File

@ -1,7 +1,9 @@
*** editor.c.orig Tue May 19 22:49:40 1998 *** editor.c.orig Wed Jan 13 22:23:04 1999
--- editor.c Tue May 19 22:51:44 1998 --- editor.c Wed Jan 13 22:27:18 1999
*************** ***************
*** 654,660 **** *** 652,660 ****
Display *display;
#endif
{ {
EditState = EDIT_TEST; EditState = EDIT_TEST;
@ -9,12 +11,19 @@
if (SaveLevelDataFile(display, tempName) == False) if (SaveLevelDataFile(display, tempName) == False)
ShutDown(display, 1, "Sorry, cannot save test play level."); ShutDown(display, 1, "Sorry, cannot save test play level.");
--- 654,661 ---- --- 652,666 ----
Display *display;
#endif
{ {
+ int fd;
+
EditState = EDIT_TEST; EditState = EDIT_TEST;
! sprintf(tempName, "/tmp/xboing-XXXXXXXX"); ! sprintf(tempName, "/tmp/xboing-XXXXXXXXXX");
! close(mkstemp(tempName)); ! if ((fd = mkstemp(tempName)) < 0)
! ShutDown(display, 1, "Sorry, cannot save test play level.");
!
! close(fd);
if (SaveLevelDataFile(display, tempName) == False) if (SaveLevelDataFile(display, tempName) == False)
ShutDown(display, 1, "Sorry, cannot save test play level."); ShutDown(display, 1, "Sorry, cannot save test play level.");

View File

@ -3,4 +3,4 @@ to bounce a ball around the game area blowing up blocks with the ball.
You win by obtaining points for each block destroyed and each level You win by obtaining points for each block destroyed and each level
completed. The person with the highest score wins. completed. The person with the highest score wins.
This is version 2.3. This is version 2.4.

View File

@ -67,6 +67,21 @@ lib/X11/xboing/levels/level62.data
lib/X11/xboing/levels/level63.data lib/X11/xboing/levels/level63.data
lib/X11/xboing/levels/level64.data lib/X11/xboing/levels/level64.data
lib/X11/xboing/levels/level65.data lib/X11/xboing/levels/level65.data
lib/X11/xboing/levels/level66.data
lib/X11/xboing/levels/level67.data
lib/X11/xboing/levels/level68.data
lib/X11/xboing/levels/level69.data
lib/X11/xboing/levels/level70.data
lib/X11/xboing/levels/level71.data
lib/X11/xboing/levels/level72.data
lib/X11/xboing/levels/level73.data
lib/X11/xboing/levels/level74.data
lib/X11/xboing/levels/level75.data
lib/X11/xboing/levels/level76.data
lib/X11/xboing/levels/level77.data
lib/X11/xboing/levels/level78.data
lib/X11/xboing/levels/level79.data
lib/X11/xboing/levels/level80.data
lib/X11/xboing/levels/new.data lib/X11/xboing/levels/new.data
lib/X11/xboing/sounds/Doh1.au lib/X11/xboing/sounds/Doh1.au
lib/X11/xboing/sounds/Doh2.au lib/X11/xboing/sounds/Doh2.au
@ -115,8 +130,11 @@ lib/X11/xboing/sounds/wzzz.au
lib/X11/xboing/sounds/wzzz2.au lib/X11/xboing/sounds/wzzz2.au
lib/X11/xboing/sounds/youagod.au lib/X11/xboing/sounds/youagod.au
lib/X11/xboing/problems.doc lib/X11/xboing/problems.doc
man/man1/xboing.1 man/cat1/xboing.0
@comment otherwise the new directories will have mode 777...duh @comment otherwise the new directories will have mode 777...duh
@exec chmod 755 %D/lib/X11/xboing @exec chmod 755 %D/lib/X11/xboing
@exec chmod 755 %D/lib/X11/xboing/sounds @exec chmod 755 %D/lib/X11/xboing/sounds
@exec chmod 755 %D/lib/X11/xboing/levels @exec chmod 755 %D/lib/X11/xboing/levels
@dirrm lib/X11/xboing/sounds
@dirrm lib/X11/xboing/levels
@dirrm lib/X11/xboing