It is currently Thu, 20 Jan 2022 10:28:58 GMT



 
Author Message
 Patch for xboing-1.7
Hello Everybody,

Xboing a break-out like game with fancy graphics and sound effects
(sound blaster, /dev/audio, etc) for all sorts of UNIX X11 platforms,
eg. linux.

Recently I stumbled across xboing-1.7 but found out that the highscore
table isn't handled well. The bug actually is in highscore.c where the
internal data is stored and to be handled in ``network representation''.

Unfortunately, some uses of HighScoreEntry are not handled properly
resulting in a complete wrecked highscore table. The patch below fixes
the problem.

Have fun,

        Frank Hoffmeister
                                hoffmeis...@LS11.Informatik.Uni-Dortmund.DE
                                                Tel: +49-231-755-4678
        University of Dortmund                          Fax: +49-231-755-2450
                Department of Computer Science
                        Systems Analysis Research Group
                                D - 44221 Dortmund, Germany

PS:     I sent the patch also to j...@citri.edu.au

------------------------------------------------------------------------

*** highscore.c         Wed Sep  8 23:44:49 1993
--- highscore.c.fixed   Wed Sep  8 23:36:32 1993
***************
*** 253,259 ****

                        /* Draw the score */
                        sprintf(string, "%ld", ntohl(highScores[i].score));
!                       if (highScores[i].score != score)
                                DrawShadowText(display, window, textFont, string, xs, y, red);
                        else
                                DrawShadowText(display, window, textFont, string, xs, y, green);
--- 253,259 ----

                        /* Draw the score */
                        sprintf(string, "%ld", ntohl(highScores[i].score));
!                       if (ntohl(highScores[i].score) != score)
                                DrawShadowText(display, window, textFont, string, xs, y, red);
                        else
                                DrawShadowText(display, window, textFont, string, xs, y, green);
***************
*** 520,526 ****
                theTime = (time_t) ntohl(highScores[i].time);
                strftime(string, 10, "%d %b %y", localtime(&theTime));

!               if (ntohl(highScores[i].score) > 0)
                {
                        /* Print out the actual record */
                        fprintf(stdout, "%d\t%ld\t  %ld\t%d'%d\"\t%s  %s\n",
--- 520,526 ----
                theTime = (time_t) ntohl(highScores[i].time);
                strftime(string, 10, "%d %b %y", localtime(&theTime));

!               if (ntohl(highScores[i].score) > (u_long) 0)
                {
                        /* Print out the actual record */
                        fprintf(stdout, "%d\t%ld\t  %ld\t%d'%d\"\t%s  %s\n",
***************
*** 557,563 ****
                theTime = (time_t) ntohl(highScores[i].time);
                strftime(string, 10, "%d %b %y", localtime(&theTime));

!               if (ntohl(highScores[i].score) > 0)
                {
                        /* Print out the actual record */
                        fprintf(stdout, "%d\t%ld\t  %ld\t%d'%d\"\t%s  %s\n",
--- 557,563 ----
                theTime = (time_t) ntohl(highScores[i].time);
                strftime(string, 10, "%d %b %y", localtime(&theTime));

!               if (ntohl(highScores[i].score) > (u_long) 0)
                {
                        /* Print out the actual record */
                        fprintf(stdout, "%d\t%ld\t  %ld\t%d'%d\"\t%s  %s\n",
***************
*** 846,852 ****
                for (j = NUM_HIGHSCORES - 1; j > i; --j)
                {
                        /* Who has the higher score */
!                       if (highScores[j-1].score < highScores[j].score)
                        {
                                /* Swap the entries around - use memcpy in future */
                                tempHighScore.score             = highScores[j-1].score;
--- 846,852 ----
                for (j = NUM_HIGHSCORES - 1; j > i; --j)
                {
                        /* Who has the higher score */
!                       if (ntohl(highScores[j-1].score) < ntohl(highScores[j].score))
                        {
                                /* Swap the entries around - use memcpy in future */
                                tempHighScore.score             = highScores[j-1].score;
***************
*** 1101,1106 ****
--- 1101,1115 ----
                strcpy(filename, str);
        else
                strcpy(filename, HIGH_SCORE_FILE);
+
+ #ifndef       F_LOCK
+ #define       F_LOCK  LOCK_EX
+ #define       F_ULOCK LOCK_UN
+ #endif
+ #ifndef       LOCK_EX
+ #define       LOCK_EX F_LOCK
+ #define       LOCK_UN F_ULOCK
+ #endif

        /* Open the highscore file for both read & write */
        if (cmd == F_LOCK || cmd == LOCK_EX)

--
Send submissions for comp.os.linux.announce to: linux-annou...@tc.cornell.edu



 Tue, 27 Feb 1996 03:53:39 GMT   
 
   [ 1 post ] 

Similar Threads

1. Xboing with SB

2. Linux sound driver for xboing

3. Specialized XBoing sound driver for GUS/Linux?

4. Xboing binaries?

5. Xboing on Linux

6. xboing

7. XBOING WITH SOUNBLASTER SUPPORT: compiled??

8. Xboing is dog slow

9. Error when doing a make depend on Xboing and xpm

10. Xboing on a Cyrix P166+ (too fast)


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software