Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site mouton.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mouton!dje From: dje@mouton.UUCP Newsgroups: net.sources.bugs Subject: diff to add a "redraw screen" command to ogre Message-ID: <224@mouton.UUCP> Date: Mon, 12-Nov-84 22:09:55 EST Article-I.D.: mouton.224 Posted: Mon Nov 12 22:09:55 1984 Date-Received: Tue, 13-Nov-84 19:10:56 EST Distribution: net Organization: Bell Communications Research, Inc Lines: 155 It can be very frustrating when garbage characters show up on the screen and there is no "redraw screen" command. A diff follows to add such a "redraw screen" command (CONTROL L). Danny Espinoza {...!allegra!mouton!dje} ------------------------------------------------------------------------ *** OLDmap.c Sat Nov 10 12:42:25 1984 --- map.c Mon Nov 12 21:47:55 1984 *************** *** 11,16 #include "ext.h" #include /* Initialize the map display, at the beginning of the game. */ init_screen() { --- 11,17 ----- #include "ext.h" #include + int lastunit; /* Initialize the map display, at the beginning of the game. */ *************** *** 12,17 #include /* Initialize the map display, at the beginning of the game. */ init_screen() { --- 13,19 ----- int lastunit; + /* Initialize the map display, at the beginning of the game. */ init_screen() { *************** *** 31,36 disp_craters(); } /* Convert a left and right hex pair (eg, the hex 2015 has an l_hex of 20 and --- 33,39 ----- disp_craters(); } + redraw_screen() { int a, b; char row, col; *************** *** 32,37 } /* Convert a left and right hex pair (eg, the hex 2015 has an l_hex of 20 and an r_hex of 15) to x-y screen coordinates. --- 35,57 ----- redraw_screen() { + int a, b; + char row, col; + + clear_screen(); + + for(a = 1; a <= 28; a++) { + for(b = 1; b <= 28; b++) { + if(!off_map(a, b)) { + update_hex(a, b); + } + } + } + + describe_action("Move", lastunit); + disp_ogre_status(1); + } + /* Convert a left and right hex pair (eg, the hex 2015 has an l_hex of 20 and an r_hex of 15) to x-y screen coordinates. *************** *** 284,289 char *action; int i; { switch(unit[i].type) { --- 304,311 ----- char *action; int i; { + + lastunit = i; switch(unit[i].type) { *** OLDmove.c Sat Nov 10 12:42:25 1984 --- move.c Mon Nov 12 20:25:11 1984 *************** *** 73,78 unit[i].moves_left = 0; return; default: bad_char = TRUE; break; --- 73,83 ----- unit[i].moves_left = 0; return; + case REDRAW: + redraw_screen(); + bad_char = TRUE; + break; + default: bad_char = TRUE; break; *** OLDogre.h Sat Nov 10 12:42:25 1984 --- ogre.h Mon Nov 12 20:25:45 1984 *************** *** 52,57 #define UPLEFT 'w' #define DOWNLEFT 'z' #define SIT 's' #define TRUE 1 --- 52,58 ----- #define UPLEFT 'w' #define DOWNLEFT 'z' #define SIT 's' + #define REDRAW '\014' #define TRUE 1