diff to add a "redraw screen" command to ogre
dje at mouton.UUCP
dje at mouton.UUCP
Tue Nov 13 13:09:55 AEST 1984
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 <ctype.h>
/* Initialize the map display, at the beginning of the game. */
init_screen() {
--- 11,17 -----
#include "ext.h"
#include <ctype.h>
+ int lastunit;
/* Initialize the map display, at the beginning of the game. */
***************
*** 12,17
#include <ctype.h>
/* 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
More information about the Comp.sources.bugs
mailing list