home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / games / volume13 / thricken / patch1 / patches01
Text File  |  1992-08-03  |  11KB  |  514 lines

  1. diff -c ./Makefile ../thricken-1.1/Makefile
  2. *** ./Makefile    Mon Jun 22 02:05:54 1992
  3. --- ../thricken-1.1/Makefile    Mon Jun 22 01:45:26 1992
  4. ***************
  5. *** 5,13 ****
  6.   LIBS = -lcurses -ltermcap
  7.   
  8.   # directories
  9. ! BINDIR = /dcs/89/rince/open/bin.$(ARCH)
  10. ! LIBDIR = /dcs/89/rince/open/lib/thricken
  11. ! MANDIR = /dcs/89/rince/open/man
  12.   
  13.   OBJ = files.o main.o scores.o screen.o
  14.   
  15. --- 5,14 ----
  16.   LIBS = -lcurses -ltermcap
  17.   
  18.   # directories
  19. ! HOME = /dcs/89/rince/open
  20. ! BINDIR = $(HOME)/bin.$(ARCH)
  21. ! LIBDIR = $(HOME)/lib/thricken
  22. ! MANDIR = $(HOME)/man
  23.   
  24.   OBJ = files.o main.o scores.o screen.o
  25.   
  26. ***************
  27. *** 22,40 ****
  28.   
  29.   install:    thricken thricken.6
  30.       # the game
  31. !     -mkdir -p $(BINDIR)
  32.       chmod a+xr $(BINDIR)
  33.       -cp thricken $(BINDIR)
  34.       chmod a+x $(BINDIR)/thricken
  35.   
  36.       # the data files
  37. !     -mkdir -p $(LIBDIR)
  38.       chmod a+xr $(LIBDIR)
  39.       -cp data/* $(LIBDIR)
  40.       chmod a+r $(LIBDIR)/*
  41.   
  42.       # the man page
  43. !     -mkdir -p $(MANDIR)/man6
  44.       chmod a+xr $(MANDIR)/man6
  45.       -cp thricken.6 $(MANDIR)/man6
  46.       chmod a+r $(MANDIR)/man6/thricken.6
  47. --- 23,42 ----
  48.   
  49.   install:    thricken thricken.6
  50.       # the game
  51. !     -mkdir $(BINDIR)
  52.       chmod a+xr $(BINDIR)
  53.       -cp thricken $(BINDIR)
  54.       chmod a+x $(BINDIR)/thricken
  55.   
  56.       # the data files
  57. !     -mkdir $(LIBDIR)
  58.       chmod a+xr $(LIBDIR)
  59.       -cp data/* $(LIBDIR)
  60.       chmod a+r $(LIBDIR)/*
  61.   
  62.       # the man page
  63. !     -mkdir $(MANDIR)
  64. !     -mkdir $(MANDIR)/man6
  65.       chmod a+xr $(MANDIR)/man6
  66.       -cp thricken.6 $(MANDIR)/man6
  67.       chmod a+r $(MANDIR)/man6/thricken.6
  68. diff -c ./README ../thricken-1.1/README
  69. *** ./README    Mon Jun 22 02:05:53 1992
  70. --- ../thricken-1.1/README    Mon Jun 22 01:21:59 1992
  71. ***************
  72. *** 1,3 ****
  73. --- 1,5 ----
  74. + Thricken Version 1.1
  75.   This is the game of thricken - written by James 'Rince' Bonfield.
  76.   You may redistribute and modify any of this source provided that my name is
  77.   still mentioned in connection with the pieces of code I have written.
  78. Common subdirectories: ./data and ../thricken-1.1/data
  79. diff -c ./extern.h ../thricken-1.1/extern.h
  80. *** ./extern.h    Mon Jun 22 02:06:00 1992
  81. --- ../thricken-1.1/extern.h    Mon Jun 22 01:09:54 1992
  82. ***************
  83. *** 1,6 ****
  84.   extern int load_level(int level);
  85.   extern void init_display();
  86. ! extern int draw_map(int y,int x);
  87.   extern void update_wins();
  88.   extern void draw_stats(char level);
  89.   extern void draw_you(char y, char x, char c);
  90. --- 1,6 ----
  91.   extern int load_level(int level);
  92.   extern void init_display();
  93. ! extern void draw_map(int y,int x);
  94.   extern void update_wins();
  95.   extern void draw_stats(char level);
  96.   extern void draw_you(char y, char x, char c);
  97. diff -c ./files.c ../thricken-1.1/files.c
  98. *** ./files.c    Mon Jun 22 02:06:00 1992
  99. --- ../thricken-1.1/files.c    Mon Jun 22 01:09:54 1992
  100. ***************
  101. *** 1,3 ****
  102. --- 1,4 ----
  103. + #include <stdlib.h>
  104.   #include <fcntl.h>
  105.   #include <string.h>
  106.   #include <stdio.h>
  107. ***************
  108. *** 5,14 ****
  109.   
  110.   char *readline(FILE *fp);
  111.   int read_sprites();
  112.   char *spr_file, *data_file;
  113.   
  114.   int load_level(int level) {
  115. !     int i,j;
  116.       FILE *fp;
  117.       char *level_file = strdup("xxlevel");
  118.       
  119. --- 6,16 ----
  120.   
  121.   char *readline(FILE *fp);
  122.   int read_sprites();
  123. + int read_sprdata();
  124.   char *spr_file, *data_file;
  125.   
  126.   int load_level(int level) {
  127. !     int i;
  128.       FILE *fp;
  129.       char *level_file = strdup("xxlevel");
  130.       
  131. ***************
  132. *** 35,42 ****
  133.       free(author);
  134.       author = strdup(readline(fp));
  135.       fclose(fp);
  136. !     read_sprites();
  137. !     read_sprdata();
  138.   }
  139.   
  140.   char *readline(FILE *fp) {
  141. --- 37,48 ----
  142.       free(author);
  143.       author = strdup(readline(fp));
  144.       fclose(fp);
  145. !     if (read_sprites() != 0)
  146. !     return -1;
  147. !     if (read_sprdata() != 0)
  148. !     return -1;
  149. !     return 0;
  150.   }
  151.   
  152.   char *readline(FILE *fp) {
  153. ***************
  154. *** 45,52 ****
  155.        * a bit of a kludge.
  156.        */
  157.       static char buf[1024];
  158. -     int i=0;
  159. -     char c = '\0';
  160.       
  161.       if (fgets(buf,1000,fp) == (char *)0)
  162.       return (char *)-1;
  163. --- 51,56 ----
  164. ***************
  165. *** 54,61 ****
  166.       return buf;
  167.   }
  168.   
  169. ! read_sprites() {
  170.       FILE *fp;
  171.       char spr;
  172.       char *ptr;
  173. --- 58,64 ----
  174.       return buf;
  175.   }
  176.   
  177. ! int read_sprites() {
  178.       FILE *fp;
  179.       char spr;
  180.       char *ptr;
  181. ***************
  182. *** 71,79 ****
  183.           sprite[spr][j][i] = ptr[i];
  184.       }
  185.       }
  186.   }
  187.   
  188. ! read_sprdata() {
  189.       FILE *fp;
  190.       int i;
  191.       char *ptr;
  192. --- 74,83 ----
  193.           sprite[spr][j][i] = ptr[i];
  194.       }
  195.       }
  196. +     return 0;
  197.   }
  198.   
  199. ! int read_sprdata() {
  200.       FILE *fp;
  201.       int i;
  202.       char *ptr;
  203. ***************
  204. *** 108,111 ****
  205. --- 112,116 ----
  206.       *(ptr+8)=0;c->dirs = strdup(ptr+4);
  207.       *(ptr+4)=0;c->coll = strdup(ptr+1);
  208.       }
  209. +     return 0;
  210.   }
  211. diff -c ./main.c ../thricken-1.1/main.c
  212. *** ./main.c    Mon Jun 22 02:06:01 1992
  213. --- ../thricken-1.1/main.c    Mon Jun 22 01:44:35 1992
  214. ***************
  215. *** 1,9 ****
  216. --- 1,13 ----
  217. + #include <stdlib.h>
  218. + #include <stdio.h>
  219.   #include <signal.h>
  220.   #include <errno.h>
  221.   #include <curses.h>
  222.   #include <string.h>
  223.   #include "thricken.h"
  224.   #include "extern.h"
  225. + #include "patchlevel.h"
  226.   
  227.   extern int draw_sprite(WINDOW *w, int y,int x,char spr);
  228.   extern WINDOW *gw,*sw,*lw;
  229. ***************
  230. *** 10,15 ****
  231. --- 14,25 ----
  232.   
  233.   void init();
  234.   char query_map(char y, char x);
  235. + void play_game(unsigned char startl,int moves);
  236. + void move_dir(char dir,char key);
  237. + void set_map(char y, char x, char p);
  238. + void save_map();
  239. + void restore_map();
  240.   char face[] = "<v^>";
  241.   char keys[] = "hjkl";
  242.   /* short cut for setting up n1 & n2 */
  243. ***************
  244. *** 17,24 ****
  245.   
  246.   char xs,ys;
  247.   
  248. ! main(int argc, char **argv) {
  249. !     char c,level=-1;
  250.   
  251.       extern char *optarg;
  252.   
  253. --- 27,34 ----
  254.   
  255.   char xs,ys;
  256.   
  257. ! int main(int argc, char **argv) {
  258. !     int c,level=-1;
  259.   
  260.       extern char *optarg;
  261.   
  262. ***************
  263. *** 60,68 ****
  264.       }
  265.       startlevel = level;
  266.       play_game(level,moves);
  267.   }
  268.   
  269. ! play_game(char startl,int moves) {
  270.       char c,t1,t2,t3,t4;
  271.       char dir;
  272.   
  273. --- 70,80 ----
  274.       }
  275.       startlevel = level;
  276.       play_game(level,moves);
  277. +     return 0;
  278.   }
  279.   
  280. ! void play_game(unsigned char startl,int smoves) {
  281.       char c,t1,t2,t3,t4;
  282.       char dir;
  283.   
  284. ***************
  285. *** 71,77 ****
  286.       do {
  287.       llevel = level;
  288.       lscore = score;
  289. !     lmoves = moves;
  290.       if (load_level(level) == -1) {
  291.           nocbreak();
  292.           echo();
  293. --- 83,89 ----
  294.       do {
  295.       llevel = level;
  296.       lscore = score;
  297. !     moves = lmoves = smoves;
  298.       if (load_level(level) == -1) {
  299.           nocbreak();
  300.           echo();
  301. ***************
  302. *** 118,124 ****
  303.       } while (1);
  304.   }
  305.   
  306. ! move_dir(char dir,char key) {
  307.       char n1,n2,bang;
  308.       char nx,ny,mx,my;
  309.       struct coll *c;
  310. --- 130,136 ----
  311.       } while (1);
  312.   }
  313.   
  314. ! void move_dir(char dir,char key) {
  315.       char n1,n2,bang;
  316.       char nx,ny,mx,my;
  317.       struct coll *c;
  318. ***************
  319. *** 176,186 ****
  320.       return map[(y+rows+1)%rows][(x+cols+1)%cols];
  321.   }
  322.   
  323. ! set_map(char y, char x, char p) {
  324.       map[(y+rows+1)%rows][(x+cols+1)%cols]=p;
  325.   }
  326.   
  327. ! save_map() {
  328.       int i;
  329.   
  330.       for (i=0; i<100; i++) {
  331. --- 188,198 ----
  332.       return map[(y+rows+1)%rows][(x+cols+1)%cols];
  333.   }
  334.   
  335. ! void set_map(char y, char x, char p) {
  336.       map[(y+rows+1)%rows][(x+cols+1)%cols]=p;
  337.   }
  338.   
  339. ! void save_map() {
  340.       int i;
  341.   
  342.       for (i=0; i<100; i++) {
  343. ***************
  344. *** 199,205 ****
  345.       oldpos.y = y;
  346.   }
  347.   
  348. ! restore_map() {
  349.       int i;
  350.   
  351.       for (i=0; i<100; i++) {
  352. --- 211,217 ----
  353.       oldpos.y = y;
  354.   }
  355.   
  356. ! void restore_map() {
  357.       int i;
  358.   
  359.       for (i=0; i<100; i++) {
  360. ***************
  361. *** 216,220 ****
  362.       moves = oldpos.moves;
  363.       x = oldpos.x;
  364.       y = oldpos.y;
  365.   }
  366. --- 228,231 ----
  367. Only in .: patch1
  368. diff -c ./patchlevel.h ../thricken-1.1/patchlevel.h
  369. *** ./patchlevel.h    Mon Jun 22 02:06:16 1992
  370. --- ../thricken-1.1/patchlevel.h    Mon Jun 22 01:46:12 1992
  371. ***************
  372. *** 0 ****
  373. --- 1,10 ----
  374. + /* Patch 1:
  375. +  * Fixed a few portability probs (such as use of signed vs unsigned)
  376. +  * Updated manual page
  377. +  * Fixed move counter
  378. +  * Tidied up general coding - more checks for errors and better typed functions
  379. +  *       James Bonfield
  380. +  */
  381. + char ident[] = "@(#)thricken: Version 1, patchlevel 1, May 22, 1992";
  382. + #define PATCHLEVEL 1
  383. diff -c ./scores.c ../thricken-1.1/scores.c
  384. *** ./scores.c    Mon Jun 22 02:06:01 1992
  385. --- ../thricken-1.1/scores.c    Mon Jun 22 01:09:55 1992
  386. ***************
  387. *** 35,40 ****
  388. --- 35,41 ----
  389.       }
  390.   
  391.       p=getpwuid(getuid());
  392. +     /* should check return of find_level here (-1 = failure) */
  393.       l = find_level(getuid())->level;
  394.   
  395.       /* if we cheated and started on a higher level then stop here */
  396. ***************
  397. *** 112,118 ****
  398.       static struct scored ret;
  399.   
  400.       if ((fp = open_scores(fp,"r")) == NULL) {
  401. !     return;
  402.       }
  403.       p=getpwuid(uid);
  404.       do {
  405. --- 113,119 ----
  406.       static struct scored ret;
  407.   
  408.       if ((fp = open_scores(fp,"r")) == NULL) {
  409. !     return (struct scored *)-1;
  410.       }
  411.       p=getpwuid(uid);
  412.       do {
  413. diff -c ./screen.c ../thricken-1.1/screen.c
  414. *** ./screen.c    Mon Jun 22 02:06:01 1992
  415. --- ../thricken-1.1/screen.c    Mon Jun 22 01:09:55 1992
  416. ***************
  417. *** 1,3 ****
  418. --- 1,5 ----
  419. + #include <stdio.h>
  420. + #include <stdlib.h>
  421.   #include <signal.h>
  422.   #include <fcntl.h>
  423.   #include <curses.h>
  424. ***************
  425. *** 20,27 ****
  426.   }
  427.   
  428.   void init_display() {
  429. !     int i,j;
  430. !     char *ptr,s;
  431.       FILE *fp;
  432.       initscr();
  433.       signal(SIGTSTP,stop);
  434. --- 22,28 ----
  435.   }
  436.   
  437.   void init_display() {
  438. !     int i;
  439.       FILE *fp;
  440.       initscr();
  441.       signal(SIGTSTP,stop);
  442. ***************
  443. *** 57,63 ****
  444.       exit(1);
  445.   }
  446.   
  447. ! draw_sprite(WINDOW *w, int y, int x, char spr) {
  448.       int i,j;
  449.   
  450.       for (j=0; j<SPRHEIGHT; j++)
  451. --- 58,64 ----
  452.       exit(1);
  453.   }
  454.   
  455. ! void draw_sprite(WINDOW *w, int y, int x, char spr) {
  456.       int i,j;
  457.   
  458.       for (j=0; j<SPRHEIGHT; j++)
  459. ***************
  460. *** 65,71 ****
  461.           mvwaddch(w,y+j,x+i,sprite[spr][j][i]);
  462.   }
  463.   
  464. ! draw_map(int y, int x) {
  465.       int i,j;
  466.   
  467.       for (i=0; i<SCRWIDTH; i++)
  468. --- 66,72 ----
  469.           mvwaddch(w,y+j,x+i,sprite[spr][j][i]);
  470.   }
  471.   
  472. ! void draw_map(int y, int x) {
  473.       int i,j;
  474.   
  475.       for (i=0; i<SCRWIDTH; i++)
  476. diff -c ./thricken.6 ../thricken-1.1/thricken.6
  477. *** ./thricken.6    Mon Jun 22 02:06:02 1992
  478. --- ../thricken-1.1/thricken.6    Mon Jun 22 01:09:55 1992
  479. ***************
  480. *** 26,31 ****
  481. --- 26,48 ----
  482.   the game into thinking you've completed the first 5 levels by starting on
  483.   level 5. Level 0 is the first level.
  484.   .sp
  485. + The keys are defined as follows :
  486. + .ta 1i 2i
  487. + .br
  488. +     h    left
  489. + .br
  490. +     j    down
  491. + .br
  492. +     k    up
  493. + .br
  494. +     l    right
  495. + .br
  496. +     q    quit
  497. + .br
  498. +     s    save (to memory)
  499. + .br
  500. +     r     restore (from memory)
  501. + .sp
  502.   Should you wish to give the game a different feel when using a different set
  503.   of sprites and rules you may specify a directory as an argument using the
  504.   .I -d directory
  505.  
  506.