projects
/
super-star-trek.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e4a5aba
)
Move cursor restoration into io.c.
author
Eric S. Raymond
<esr@thyrsus.com>
Sat, 5 Feb 2005 18:41:54 +0000
(18:41 +0000)
committer
Eric S. Raymond
<esr@thyrsus.com>
Sat, 5 Feb 2005 18:41:54 +0000
(18:41 +0000)
battle.c
patch
|
blob
|
history
io.c
patch
|
blob
|
history
diff --git
a/battle.c
b/battle.c
index 5389821ab5d3dd048a2867eeaaa83b9a265b1fea..79043385397cd4cd284e7e6385a44a175f7d389c 100644
(file)
--- a/
battle.c
+++ b/
battle.c
@@
-175,7
+175,6
@@
void ram(int ibumpd, int ienm, int ix, int iy) {
void torpedo(double course, double r, int inx, int iny, double *hit, int wait, int i, int n) {
int l, iquad=0, ix=0, iy=0, jx=0, jy=0, shoved=0, ll;
void torpedo(double course, double r, int inx, int iny, double *hit, int wait, int i, int n) {
int l, iquad=0, ix=0, iy=0, jx=0, jy=0, shoved=0, ll;
- int crx,cry;
double ac=course + 0.25*r;
double angle = (15.0-ac)*0.5235988;
double ac=course + 0.25*r;
double angle = (15.0-ac)*0.5235988;
@@
-187,10
+186,10
@@
void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i
if (fabs(deltay) > bigger) bigger = fabs(deltay);
deltax /= bigger;
deltay /= bigger;
if (fabs(deltay) > bigger) bigger = fabs(deltay);
deltax /= bigger;
deltay /= bigger;
- crx=wherex();
-
cry=wherey(
);
- if (game.damage[DSRSENS]==0 || condit==IHDOCKED) setwnd(LEFTUPPER_WINDOW);
-
else
setwnd(LOWER_WINDOW);
+ if (game.damage[DSRSENS]==0 || condit==IHDOCKED)
+
setwnd(LEFTUPPER_WINDOW
);
+ else
+
setwnd(LOWER_WINDOW);
/* Loop to move a single torpedo */
for (l=1; l <= 15; l++) {
x += deltax;
/* Loop to move a single torpedo */
for (l=1; l <= 15; l++) {
x += deltax;
@@
-205,7
+204,6
@@
void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i
if (iquad==IHDOT) continue;
/* hit something */
setwnd(LOWER_WINDOW);
if (iquad==IHDOT) continue;
/* hit something */
setwnd(LOWER_WINDOW);
- gotoxy(crx,cry);
switch(iquad) {
case IHE: /* Hit our ship */
case IHF:
switch(iquad) {
case IHE: /* Hit our ship */
case IHF:
@@
-402,7
+400,6
@@
void torpedo(double course, double r, int inx, int iny, double *hit, int wait, i
}
if(curwnd!=LOWER_WINDOW) {
setwnd(LOWER_WINDOW);
}
if(curwnd!=LOWER_WINDOW) {
setwnd(LOWER_WINDOW);
- gotoxy(crx,cry);
}
if (shoved) {
game.quad[jx][jy]=iquad;
}
if (shoved) {
game.quad[jx][jy]=iquad;
diff --git
a/io.c
b/io.c
index 025aa162f00daa03cc6fc3eee2fda805180df7d6..d87d097990a70e5fc4b2cd2926d5c879977aa658 100644
(file)
--- a/
io.c
+++ b/
io.c
@@
-415,6
+415,9
@@
void tracktorpedo(int x, int y, int ix, int iy, int wait, int l, int i, int n, i
proutn("%d - %d ", (int)x, (int)y);
#else
if (game.damage[DSRSENS]==0 || condit==IHDOCKED) {
proutn("%d - %d ", (int)x, (int)y);
#else
if (game.damage[DSRSENS]==0 || condit==IHDOCKED) {
+ int crx, cry;
+ crx = wherex();
+ cry = wherey();
drawmaps(2);
delay((wait!=1)*400);
gotoxy(iy*2+3,ix+2);
drawmaps(2);
delay((wait!=1)*400);
gotoxy(iy*2+3,ix+2);
@@
-437,6
+440,7
@@
void tracktorpedo(int x, int y, int ix, int iy, int wait, int l, int i, int n, i
lowvideo();
_setcursortype(_NORMALCURSOR);
}
lowvideo();
_setcursortype(_NORMALCURSOR);
}
+ gotoxy(crx, cry);
} else {
proutn("%d - %d ", (int)x, (int)y);
}
} else {
proutn("%d - %d ", (int)x, (int)y);
}