home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
games
/
volume15
/
xminesweeper
/
patch1
/
patches01
Wrap
Text File
|
1993-01-27
|
12KB
|
434 lines
--------
*** /dev/null Mon Oct 12 08:12:48 1992
--- CHANGE.LOG Mon Oct 12 16:27:16 1992
***************
*** 0 ****
--- 1,24 ----
+ Ver. 1.1 (12 October 1992)
+ --------------------------------------------------
+
+ Larger font for the numbers displayed in the squares to improve readability.
+
+ Sweeper now accepts the standard Xview options on startup.
+
+ Function clock renamed to tick_clock. The name clock caused name clash
+ on some systems (f.ex HP-UX).
+
+ Corrected a problem with the clock starting to count directly when New Game button
+ was selected instead of when the first square was selected.
+
+ if you start the game from a pty, there isn't an entry in
+ /etc/utmp so getlogin() fails. I have added a check to use
+ getpwuid() if getlogin() fails.
+
+ The string used to display the clock was too short and causes a
+ memory overwrite.
+
+ Thanks to backbone!wayne@tssi.com and
+ Michael.Salmon@eos.ericsson.se
+ gerry@frc2.frc.ri.cmu.edu
+ for patches and suggestions.
*** released/window.c Mon Oct 12 15:10:06 1992
--- window.c Mon Oct 12 16:27:49 1992
***************
*** 1,4 ****
! static char sccsid[]="@(#)window.c 1.1 9/30/92";
#include "window.h"
--- 1,4 ----
! static char sccsid[]="@(#)window.c 1.5 10/12/92";
#include "window.h"
***************
*** 90,97 ****
NULL);
font=(Xv_Font)xv_find(NULL,FONT,
! FONT_FAMILY,FONT_FAMILY_DEFAULT_FIXEDWIDTH,
! FONT_SIZES_FOR_SCALE,6,12,24,36,
NULL);
largefont=(Xv_Font)xv_find(NULL,FONT,
--- 90,97 ----
NULL);
font=(Xv_Font)xv_find(NULL,FONT,
! FONT_FAMILY,FONT_FAMILY_DEFAULT,
! FONT_SIZES_FOR_SCALE,6,12,16,36,
NULL);
largefont=(Xv_Font)xv_find(NULL,FONT,
***************
*** 98,103 ****
--- 98,109 ----
FONT_RESCALE_OF, font, WIN_SCALE_EXTRALARGE,
NULL);
+ numberfont=(Xv_Font)xv_find(NULL,FONT,
+ FONT_FAMILY,FONT_FAMILY_DEFAULT,
+ FONT_STYLE,FONT_STYLE_BOLD,
+ FONT_SIZE,18,
+ NULL);
+
pw =xv_get(canvas,CANVAS_NTH_PAINT_WINDOW,0);
xid=(XID)xv_get(pw,XV_XID);
dpy=(Display *)xv_get(pw,XV_DISPLAY);
***************
*** 241,251 ****
--- 247,259 ----
char str[5];
gc=DefaultGC(dpy,DefaultScreen(dpy));
+ XSetFont(dpy,gc,(Font)xv_get(numberfont,XV_XID));
sprintf(str,"%d",number);
XDrawString(dpy,xwin,gc,
col*BOX_SIZE+BOX_SIZE/3,
(int)(row*BOX_SIZE+BOX_SIZE*0.66),
str,strlen(str));
+ XSetFont(dpy,gc,(Font)xv_get(font,XV_XID));
}
void bang(dpy,xwin)
***************
*** 273,279 ****
notify_set_itimer_func(frame,bang_timer,ITIMER_REAL,&timer,NULL);
}
! void bang_timer()
{
static counter=0;
--- 281,287 ----
notify_set_itimer_func(frame,bang_timer,ITIMER_REAL,&timer,NULL);
}
! Notify_value bang_timer()
{
static counter=0;
***************
*** 285,290 ****
--- 293,299 ----
xv_set(ngamebutt,PANEL_INACTIVE,FALSE,0);
bang_shown=0;
}
+ return 0;
}
void expose(x,y,pw,dpy,xwin)
***************
*** 477,483 ****
game_started=1;
timer.it_value.tv_usec=92767;
timer.it_interval.tv_usec=92767;
! notify_set_itimer_func(frame,clock,ITIMER_REAL,&timer,NULL);
sprintf(str,"No bombs left: %d",no_bombs);
xv_set(frame,FRAME_LEFT_FOOTER,str,0);
xv_set(time_msg,PANEL_LABEL_STRING,"Time: 0.00 ",0);
--- 486,492 ----
game_started=1;
timer.it_value.tv_usec=92767;
timer.it_interval.tv_usec=92767;
! notify_set_itimer_func(frame,tick_clock,ITIMER_REAL,&timer,NULL);
sprintf(str,"No bombs left: %d",no_bombs);
xv_set(frame,FRAME_LEFT_FOOTER,str,0);
xv_set(time_msg,PANEL_LABEL_STRING,"Time: 0.00 ",0);
***************
*** 493,498 ****
--- 502,508 ----
sec=0;
no_shown_squares=0;
init_board();
+ stop();
repaint_proc((Canvas)NULL,pw,
(Display *)xv_get(pw,XV_DISPLAY),
xv_get(pw,XV_XID),(Xv_xrectlist *)NULL);
***************
*** 508,517 ****
notify_set_itimer_func(frame,NOTIFY_FUNC_NULL,ITIMER_REAL,NULL,NULL);
}
! Notify_value clock()
{
static int cntr=0;
! char str[10];
if(cntr==0){
sec++;
--- 518,527 ----
notify_set_itimer_func(frame,NOTIFY_FUNC_NULL,ITIMER_REAL,NULL,NULL);
}
! Notify_value tick_clock()
{
static int cntr=0;
! char str[20];
if(cntr==0){
sec++;
***************
*** 601,610 ****
int update_highscore()
{
int i,j;
! char name[20];
stop();
! strcpy(name,getlogin());
read_highscore();
i=0;
while( highscore[level][size][i].score <= sec &&
--- 611,627 ----
int update_highscore()
{
int i,j;
! char name[30];
! struct passwd *passwd_entry;
stop();
!
! if( getlogin() )
! strcpy(name,getlogin());
! else{
! passwd_entry = getpwuid( geteuid() );
! strcpy( name, passwd_entry->pw_name );
! }
read_highscore();
i=0;
while( highscore[level][size][i].score <= sec &&
***************
*** 687,692 ****
--- 704,710 ----
{
int i,j,k;
+ xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
for(k=0;k<5;k++)
for(j=0;j<3;j++)
for(i=0;i<NOHIGHSCORES;i++)
*** released/window.h Mon Oct 12 15:10:06 1992
--- window.h Mon Oct 12 16:26:35 1992
***************
*** 1,4 ****
! /* static char sccsid[]="@(#)window.h 1.2 9/30/92";*/
#include "sweep.h"
#ifndef _WINDOWS_H_
#define _WINDOWS_H_
--- 1,4 ----
! /* static char sccsid[]="@(#)window.h 1.5 10/12/92";*/
#include "sweep.h"
#ifndef _WINDOWS_H_
#define _WINDOWS_H_
***************
*** 12,17 ****
--- 12,18 ----
#include <xview/svrimage.h>
#include <xview/icon.h>
#include <xview/notify.h>
+ #include <pwd.h>
short icon_bits[] = {
#include "sweeper.icon"
***************
*** 21,27 ****
#define HIGHSCOREFILE "sweeper.scores"
#endif
! #define VERSION "Sweeper V 1.0"
Frame frame;
Canvas canvas;
--- 22,28 ----
#define HIGHSCOREFILE "sweeper.scores"
#endif
! #define VERSION "Sweeper V 1.1"
Frame frame;
Canvas canvas;
***************
*** 29,35 ****
Panel_item time_msg,ngamebutt;
struct itimerval timer;
int sec,bang_shown,no_shown_squares;
! Xv_Font font,largefont;
void expose();
void repaint_proc();
--- 30,36 ----
Panel_item time_msg,ngamebutt;
struct itimerval timer;
int sec,bang_shown,no_shown_squares;
! Xv_Font font,numberfont,largefont;
void expose();
void repaint_proc();
***************
*** 43,51 ****
void set_diff();
void new_game();
void start();
! Notify_value clock();
void bang();
! void bang_timer();
void stop();
void highscore_butt();
void show_highscore();
--- 44,52 ----
void set_diff();
void new_game();
void start();
! Notify_value tick_clock();
void bang();
! Notify_value bang_timer();
void stop();
void highscore_butt();
void show_highscore();
*** released/MANIFEST Mon Oct 12 15:10:00 1992
--- MANIFEST Mon Oct 12 10:51:54 1992
***************
*** 1,12 ****
! File Name Archive # Description
! -----------------------------------------------------------
! MANIFEST 1 This shipping list
! Makefile 1
! README 1
! TODO 1
! sweep.c 1
! sweep.h 1
! sweeper.6 1
! sweeper.icon 1
! window.c 1
! window.h 1
--- 1,11 ----
! When you have unpacked the shar file you should have the
! following files:
!
! MANIFEST
! TODO
! sweep.c
! sweep.h
! sweeper.6
! sweeper.icon
! window.c
! window.h
*** released/TODO Mon Oct 12 15:10:02 1992
--- TODO Wed Sep 30 13:22:38 1992
***************
*** 1,5 ****
! o Better look for colour/grey scale
o Make the mines look more like mines...
--- 1,5 ----
! o Better loock for colour/grey scale
o Make the mines look more like mines...
*** released/sweeper.6 Mon Oct 12 15:10:03 1992
--- sweeper.6 Wed Sep 30 14:08:58 1992
***************
*** 7,24 ****
.SH DESCRIPTION
.LP
.B Sweeper
! is a game where your task is to find the hidden mines in a minefield.
.LP
To play the game move your mouse pointer to a square and press the left
mouse button to mark that you think this is safe square. If there is a
! mine on this square the game is over. If there is no mine on this square
a number will be shown that shows home many mines there are in the
! surronding squares. All surrounding squares, even those diagonally are
counted.
.LP
If you think there is a mine on a square you move the mousepointer to that
square and press the middle button. If you want to unmark a square that
! you thought that there is a mine on just press the middle button again.
.LP
If you click with the left button on a mine all squares will be revealed
to you. The squares that you have marked will be shaded, all other squares
--- 7,24 ----
.SH DESCRIPTION
.LP
.B Sweeper
! is a geme where your task is to find the hidden mines in a minefield.
.LP
To play the game move your mouse pointer to a square and press the left
mouse button to mark that you think this is safe square. If there is a
! mine on this square the game us oer. If there is no mine on this square
a number will be shown that shows home many mines there are in the
! surronding squares. All surrounding squares, even thos diagonally is
counted.
.LP
If you think there is a mine on a square you move the mousepointer to that
square and press the middle button. If you want to unmark a square that
! you thought that there is a mine on yust press the middle button again.
.LP
If you click with the left button on a mine all squares will be revealed
to you. The squares that you have marked will be shaded, all other squares
***************
*** 25,31 ****
will be white. A faulty marked bomb will be marked with a cross over it.
.SH BUGS
.LP
! The manual could be better.
.LP
The graphic interface could be better, and adapted for colour/gray scale.
.LP
--- 25,31 ----
will be white. A faulty marked bomb will be marked with a cross over it.
.SH BUGS
.LP
! The manual could be better
.LP
The graphic interface could be better, and adapted for colour/gray scale.
.LP
*** released/Makefile Mon Oct 12 15:10:01 1992
--- Makefile Mon Oct 12 11:00:13 1992
***************
*** 1,15 ****
PROGRAM= sweeper
SOURCES= sweep.c window.c
INCLUDES= sweep.h window.h
! OTHER= MANIFEST TODO sweeper.6 sweeper.icon Makefile
OBJECTS= sweep.o window.o
SCOREFILE= /home/solsta-b/pub/lib/games/sweeper.scores
- #SCOREFILE= sweeper.scores
SHARFILE= sweeper.shar
CFLAGS= -I/usr/openwin/include -O -DHIGHSCOREFILE=\"$(SCOREFILE)\"
- CCFLAGS=-I/usr/openwin/include -g
LDFLAGS= -L/usr/openwin/lib -lxview -lolgx -lX11
all: $(OBJECTS)
cc $(CFLAGS) -o $(PROGRAM) $(OBJECTS) $(LDFLAGS)
--- 1,20 ----
PROGRAM= sweeper
SOURCES= sweep.c window.c
INCLUDES= sweep.h window.h
! OTHER= MANIFEST TODO sweeper.6 sweeper.icon Makefile CHANGE.LOG
OBJECTS= sweep.o window.o
SCOREFILE= /home/solsta-b/pub/lib/games/sweeper.scores
SHARFILE= sweeper.shar
+ ## FLAGS FOR HP-UX
+ #CFLAGS = -D_BSD -I/usr/local/xview/usr/include -I/usr/include/X11R4 -DHIGHSCOREFILE=\"$(SCOREFILE)\"
+ #LDFLAGS= -L/usr/local/xview/usr/lib -L/usr/lib/X11R4 -lxview -lolgx -lX11
+
+ ## FLAGS for Sun 0S
CFLAGS= -I/usr/openwin/include -O -DHIGHSCOREFILE=\"$(SCOREFILE)\"
LDFLAGS= -L/usr/openwin/lib -lxview -lolgx -lX11
+
+ CCFLAGS=-I/usr/openwin/include -g
all: $(OBJECTS)
cc $(CFLAGS) -o $(PROGRAM) $(OBJECTS) $(LDFLAGS)