home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!zephyr.ens.tek.com!master!saab!billr
- From: billr@saab.CNA.TEK.COM (Bill Randle)
- Newsgroups: comp.sources.games
- Subject: v13i102: thricken - a multiscreen collect-the-objects style game, Patch1
- Message-ID: <3078@master.CNA.TEK.COM>
- Date: 22 Jun 92 15:29:46 GMT
- Sender: news@master.CNA.TEK.COM
- Lines: 545
- Approved: billr@saab.CNA.TEK.COM
-
- Submitted-by: James Bonfield <rince@dcs.warwick.ac.uk>
- Posting-number: Volume 13, Issue 102
- Archive-name: thricken/Patch1
- Patch-To: thricken: Volume 13, Issue 101
- Environment: curses
-
- [The patch is mainly "cleanup" and minor fixes for compilation on
- more systems.]
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of shell archive."
- # Contents: patches01
- # Wrapped by billr@saab on Mon Jun 22 08:26:01 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'patches01' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patches01'\"
- else
- echo shar: Extracting \"'patches01'\" \(10762 characters\)
- sed "s/^X//" >'patches01' <<'END_OF_FILE'
- Xdiff -c ./Makefile ../thricken-1.1/Makefile
- X*** ./Makefile Mon Jun 22 02:05:54 1992
- X--- ../thricken-1.1/Makefile Mon Jun 22 01:45:26 1992
- X***************
- X*** 5,13 ****
- X LIBS = -lcurses -ltermcap
- X
- X # directories
- X! BINDIR = /dcs/89/rince/open/bin.$(ARCH)
- X! LIBDIR = /dcs/89/rince/open/lib/thricken
- X! MANDIR = /dcs/89/rince/open/man
- X
- X OBJ = files.o main.o scores.o screen.o
- X
- X--- 5,14 ----
- X LIBS = -lcurses -ltermcap
- X
- X # directories
- X! HOME = /dcs/89/rince/open
- X! BINDIR = $(HOME)/bin.$(ARCH)
- X! LIBDIR = $(HOME)/lib/thricken
- X! MANDIR = $(HOME)/man
- X
- X OBJ = files.o main.o scores.o screen.o
- X
- X***************
- X*** 22,40 ****
- X
- X install: thricken thricken.6
- X # the game
- X! -mkdir -p $(BINDIR)
- X chmod a+xr $(BINDIR)
- X -cp thricken $(BINDIR)
- X chmod a+x $(BINDIR)/thricken
- X
- X # the data files
- X! -mkdir -p $(LIBDIR)
- X chmod a+xr $(LIBDIR)
- X -cp data/* $(LIBDIR)
- X chmod a+r $(LIBDIR)/*
- X
- X # the man page
- X! -mkdir -p $(MANDIR)/man6
- X chmod a+xr $(MANDIR)/man6
- X -cp thricken.6 $(MANDIR)/man6
- X chmod a+r $(MANDIR)/man6/thricken.6
- X--- 23,42 ----
- X
- X install: thricken thricken.6
- X # the game
- X! -mkdir $(BINDIR)
- X chmod a+xr $(BINDIR)
- X -cp thricken $(BINDIR)
- X chmod a+x $(BINDIR)/thricken
- X
- X # the data files
- X! -mkdir $(LIBDIR)
- X chmod a+xr $(LIBDIR)
- X -cp data/* $(LIBDIR)
- X chmod a+r $(LIBDIR)/*
- X
- X # the man page
- X! -mkdir $(MANDIR)
- X! -mkdir $(MANDIR)/man6
- X chmod a+xr $(MANDIR)/man6
- X -cp thricken.6 $(MANDIR)/man6
- X chmod a+r $(MANDIR)/man6/thricken.6
- Xdiff -c ./README ../thricken-1.1/README
- X*** ./README Mon Jun 22 02:05:53 1992
- X--- ../thricken-1.1/README Mon Jun 22 01:21:59 1992
- X***************
- X*** 1,3 ****
- X--- 1,5 ----
- X+ Thricken Version 1.1
- X+
- X This is the game of thricken - written by James 'Rince' Bonfield.
- X You may redistribute and modify any of this source provided that my name is
- X still mentioned in connection with the pieces of code I have written.
- XCommon subdirectories: ./data and ../thricken-1.1/data
- Xdiff -c ./extern.h ../thricken-1.1/extern.h
- X*** ./extern.h Mon Jun 22 02:06:00 1992
- X--- ../thricken-1.1/extern.h Mon Jun 22 01:09:54 1992
- X***************
- X*** 1,6 ****
- X extern int load_level(int level);
- X extern void init_display();
- X! extern int draw_map(int y,int x);
- X extern void update_wins();
- X extern void draw_stats(char level);
- X extern void draw_you(char y, char x, char c);
- X--- 1,6 ----
- X extern int load_level(int level);
- X extern void init_display();
- X! extern void draw_map(int y,int x);
- X extern void update_wins();
- X extern void draw_stats(char level);
- X extern void draw_you(char y, char x, char c);
- Xdiff -c ./files.c ../thricken-1.1/files.c
- X*** ./files.c Mon Jun 22 02:06:00 1992
- X--- ../thricken-1.1/files.c Mon Jun 22 01:09:54 1992
- X***************
- X*** 1,3 ****
- X--- 1,4 ----
- X+ #include <stdlib.h>
- X #include <fcntl.h>
- X #include <string.h>
- X #include <stdio.h>
- X***************
- X*** 5,14 ****
- X
- X char *readline(FILE *fp);
- X int read_sprites();
- X char *spr_file, *data_file;
- X
- X int load_level(int level) {
- X! int i,j;
- X FILE *fp;
- X char *level_file = strdup("xxlevel");
- X
- X--- 6,16 ----
- X
- X char *readline(FILE *fp);
- X int read_sprites();
- X+ int read_sprdata();
- X char *spr_file, *data_file;
- X
- X int load_level(int level) {
- X! int i;
- X FILE *fp;
- X char *level_file = strdup("xxlevel");
- X
- X***************
- X*** 35,42 ****
- X free(author);
- X author = strdup(readline(fp));
- X fclose(fp);
- X! read_sprites();
- X! read_sprdata();
- X }
- X
- X char *readline(FILE *fp) {
- X--- 37,48 ----
- X free(author);
- X author = strdup(readline(fp));
- X fclose(fp);
- X! if (read_sprites() != 0)
- X! return -1;
- X! if (read_sprdata() != 0)
- X! return -1;
- X!
- X! return 0;
- X }
- X
- X char *readline(FILE *fp) {
- X***************
- X*** 45,52 ****
- X * a bit of a kludge.
- X */
- X static char buf[1024];
- X- int i=0;
- X- char c = '\0';
- X
- X if (fgets(buf,1000,fp) == (char *)0)
- X return (char *)-1;
- X--- 51,56 ----
- X***************
- X*** 54,61 ****
- X return buf;
- X }
- X
- X!
- X! read_sprites() {
- X FILE *fp;
- X char spr;
- X char *ptr;
- X--- 58,64 ----
- X return buf;
- X }
- X
- X! int read_sprites() {
- X FILE *fp;
- X char spr;
- X char *ptr;
- X***************
- X*** 71,79 ****
- X sprite[spr][j][i] = ptr[i];
- X }
- X }
- X }
- X
- X! read_sprdata() {
- X FILE *fp;
- X int i;
- X char *ptr;
- X--- 74,83 ----
- X sprite[spr][j][i] = ptr[i];
- X }
- X }
- X+ return 0;
- X }
- X
- X! int read_sprdata() {
- X FILE *fp;
- X int i;
- X char *ptr;
- X***************
- X*** 108,111 ****
- X--- 112,116 ----
- X *(ptr+8)=0;c->dirs = strdup(ptr+4);
- X *(ptr+4)=0;c->coll = strdup(ptr+1);
- X }
- X+ return 0;
- X }
- Xdiff -c ./main.c ../thricken-1.1/main.c
- X*** ./main.c Mon Jun 22 02:06:01 1992
- X--- ../thricken-1.1/main.c Mon Jun 22 01:44:35 1992
- X***************
- X*** 1,9 ****
- X--- 1,13 ----
- X+ #include <stdlib.h>
- X+ #include <stdio.h>
- X #include <signal.h>
- X #include <errno.h>
- X #include <curses.h>
- X #include <string.h>
- X+
- X #include "thricken.h"
- X #include "extern.h"
- X+ #include "patchlevel.h"
- X
- X extern int draw_sprite(WINDOW *w, int y,int x,char spr);
- X extern WINDOW *gw,*sw,*lw;
- X***************
- X*** 10,15 ****
- X--- 14,25 ----
- X
- X void init();
- X char query_map(char y, char x);
- X+ void play_game(unsigned char startl,int moves);
- X+ void move_dir(char dir,char key);
- X+ void set_map(char y, char x, char p);
- X+ void save_map();
- X+ void restore_map();
- X+
- X char face[] = "<v^>";
- X char keys[] = "hjkl";
- X /* short cut for setting up n1 & n2 */
- X***************
- X*** 17,24 ****
- X
- X char xs,ys;
- X
- X! main(int argc, char **argv) {
- X! char c,level=-1;
- X
- X extern char *optarg;
- X
- X--- 27,34 ----
- X
- X char xs,ys;
- X
- X! int main(int argc, char **argv) {
- X! int c,level=-1;
- X
- X extern char *optarg;
- X
- X***************
- X*** 60,68 ****
- X }
- X startlevel = level;
- X play_game(level,moves);
- X }
- X
- X! play_game(char startl,int moves) {
- X char c,t1,t2,t3,t4;
- X char dir;
- X
- X--- 70,80 ----
- X }
- X startlevel = level;
- X play_game(level,moves);
- X+
- X+ return 0;
- X }
- X
- X! void play_game(unsigned char startl,int smoves) {
- X char c,t1,t2,t3,t4;
- X char dir;
- X
- X***************
- X*** 71,77 ****
- X do {
- X llevel = level;
- X lscore = score;
- X! lmoves = moves;
- X if (load_level(level) == -1) {
- X nocbreak();
- X echo();
- X--- 83,89 ----
- X do {
- X llevel = level;
- X lscore = score;
- X! moves = lmoves = smoves;
- X if (load_level(level) == -1) {
- X nocbreak();
- X echo();
- X***************
- X*** 118,124 ****
- X } while (1);
- X }
- X
- X! move_dir(char dir,char key) {
- X char n1,n2,bang;
- X char nx,ny,mx,my;
- X struct coll *c;
- X--- 130,136 ----
- X } while (1);
- X }
- X
- X! void move_dir(char dir,char key) {
- X char n1,n2,bang;
- X char nx,ny,mx,my;
- X struct coll *c;
- X***************
- X*** 176,186 ****
- X return map[(y+rows+1)%rows][(x+cols+1)%cols];
- X }
- X
- X! set_map(char y, char x, char p) {
- X map[(y+rows+1)%rows][(x+cols+1)%cols]=p;
- X }
- X
- X! save_map() {
- X int i;
- X
- X for (i=0; i<100; i++) {
- X--- 188,198 ----
- X return map[(y+rows+1)%rows][(x+cols+1)%cols];
- X }
- X
- X! void set_map(char y, char x, char p) {
- X map[(y+rows+1)%rows][(x+cols+1)%cols]=p;
- X }
- X
- X! void save_map() {
- X int i;
- X
- X for (i=0; i<100; i++) {
- X***************
- X*** 199,205 ****
- X oldpos.y = y;
- X }
- X
- X! restore_map() {
- X int i;
- X
- X for (i=0; i<100; i++) {
- X--- 211,217 ----
- X oldpos.y = y;
- X }
- X
- X! void restore_map() {
- X int i;
- X
- X for (i=0; i<100; i++) {
- X***************
- X*** 216,220 ****
- X moves = oldpos.moves;
- X x = oldpos.x;
- X y = oldpos.y;
- X-
- X }
- X--- 228,231 ----
- XOnly in .: patch1
- Xdiff -c ./patchlevel.h ../thricken-1.1/patchlevel.h
- X*** ./patchlevel.h Mon Jun 22 02:06:16 1992
- X--- ../thricken-1.1/patchlevel.h Mon Jun 22 01:46:12 1992
- X***************
- X*** 0 ****
- X--- 1,10 ----
- X+ /* Patch 1:
- X+ * Fixed a few portability probs (such as use of signed vs unsigned)
- X+ * Updated manual page
- X+ * Fixed move counter
- X+ * Tidied up general coding - more checks for errors and better typed functions
- X+ * James Bonfield
- X+ */
- X+
- X+ char ident[] = "@(#)thricken: Version 1, patchlevel 1, May 22, 1992";
- X+ #define PATCHLEVEL 1
- Xdiff -c ./scores.c ../thricken-1.1/scores.c
- X*** ./scores.c Mon Jun 22 02:06:01 1992
- X--- ../thricken-1.1/scores.c Mon Jun 22 01:09:55 1992
- X***************
- X*** 35,40 ****
- X--- 35,41 ----
- X }
- X
- X p=getpwuid(getuid());
- X+ /* should check return of find_level here (-1 = failure) */
- X l = find_level(getuid())->level;
- X
- X /* if we cheated and started on a higher level then stop here */
- X***************
- X*** 112,118 ****
- X static struct scored ret;
- X
- X if ((fp = open_scores(fp,"r")) == NULL) {
- X! return;
- X }
- X p=getpwuid(uid);
- X do {
- X--- 113,119 ----
- X static struct scored ret;
- X
- X if ((fp = open_scores(fp,"r")) == NULL) {
- X! return (struct scored *)-1;
- X }
- X p=getpwuid(uid);
- X do {
- Xdiff -c ./screen.c ../thricken-1.1/screen.c
- X*** ./screen.c Mon Jun 22 02:06:01 1992
- X--- ../thricken-1.1/screen.c Mon Jun 22 01:09:55 1992
- X***************
- X*** 1,3 ****
- X--- 1,5 ----
- X+ #include <stdio.h>
- X+ #include <stdlib.h>
- X #include <signal.h>
- X #include <fcntl.h>
- X #include <curses.h>
- X***************
- X*** 20,27 ****
- X }
- X
- X void init_display() {
- X! int i,j;
- X! char *ptr,s;
- X FILE *fp;
- X initscr();
- X signal(SIGTSTP,stop);
- X--- 22,28 ----
- X }
- X
- X void init_display() {
- X! int i;
- X FILE *fp;
- X initscr();
- X signal(SIGTSTP,stop);
- X***************
- X*** 57,63 ****
- X exit(1);
- X }
- X
- X! draw_sprite(WINDOW *w, int y, int x, char spr) {
- X int i,j;
- X
- X for (j=0; j<SPRHEIGHT; j++)
- X--- 58,64 ----
- X exit(1);
- X }
- X
- X! void draw_sprite(WINDOW *w, int y, int x, char spr) {
- X int i,j;
- X
- X for (j=0; j<SPRHEIGHT; j++)
- X***************
- X*** 65,71 ****
- X mvwaddch(w,y+j,x+i,sprite[spr][j][i]);
- X }
- X
- X! draw_map(int y, int x) {
- X int i,j;
- X
- X for (i=0; i<SCRWIDTH; i++)
- X--- 66,72 ----
- X mvwaddch(w,y+j,x+i,sprite[spr][j][i]);
- X }
- X
- X! void draw_map(int y, int x) {
- X int i,j;
- X
- X for (i=0; i<SCRWIDTH; i++)
- Xdiff -c ./thricken.6 ../thricken-1.1/thricken.6
- X*** ./thricken.6 Mon Jun 22 02:06:02 1992
- X--- ../thricken-1.1/thricken.6 Mon Jun 22 01:09:55 1992
- X***************
- X*** 26,31 ****
- X--- 26,48 ----
- X the game into thinking you've completed the first 5 levels by starting on
- X level 5. Level 0 is the first level.
- X .sp
- X+ The keys are defined as follows :
- X+ .ta 1i 2i
- X+ .br
- X+ h left
- X+ .br
- X+ j down
- X+ .br
- X+ k up
- X+ .br
- X+ l right
- X+ .br
- X+ q quit
- X+ .br
- X+ s save (to memory)
- X+ .br
- X+ r restore (from memory)
- X+ .sp
- X Should you wish to give the game a different feel when using a different set
- X of sprites and rules you may specify a directory as an argument using the
- X .I -d directory
- X
- END_OF_FILE
- if test 10762 -ne `wc -c <'patches01'`; then
- echo shar: \"'patches01'\" unpacked with wrong size!
- fi
- # end of 'patches01'
- fi
- echo shar: End of shell archive.
- exit 0
-