public inbox for xconq7@sourceware.org
 help / color / mirror / Atom feed
* display centering
@ 2003-10-10 14:46 Peter Garrone
  2003-10-10 16:14 ` Eric McDonald
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Garrone @ 2003-10-10 14:46 UTC (permalink / raw)
  To: xconq7

Hi,
 When the turn is finished, the AI player does its thing off-screen so
 to speak, which is all a bit boring. I have tried the following simple
 patch a bit which re-centers the screen whenever the ai player does
 any combat. It may not be the best fix to the problem, as sometimes
 the display is disconcertingly re-centered when doing combat with
 your own units. Anyway, i thought i would post it to stimulate
 anyone interested.

diff -r -U 5 -p tcltk_old/tkmap.c tcltk/tkmap.c
--- tcltk_old/tkmap.c	Sun Oct  5 16:40:33 2003
+++ tcltk/tkmap.c	Mon Oct  6 00:47:15 2003
@@ -3531,10 +3531,11 @@ void
 draw_unit_blast(Map *map, Unit *unit, int blasttype, int duration)
 {
     int sx, sy, sw, sh;
     MapW *mapw = (MapW *) map->widget;
     VP *vp = mapw->vp;
+    put_on_screen(map,unit->x,unit->y);
 
     if (between(0, blasttype, 2)) {
 	if (vp->hw > 10 && !vp->isometric) {
 	    x_xform_unit(mapw, unit, &sx, &sy, &sw, &sh);
 	} else {
@@ -3557,10 +3558,11 @@ draw_unit_blast(Map *map, Unit *unit, in
 void
 draw_cell_blast(Map *map, int x, int y, int blasttype, int duration)
 {
     int sx, sy, sw, sh;
     MapW *mapw = (MapW *) map->widget;
+    put_on_screen(map,x,y);
 
     if (blasttype == 3) {
 	xform(mapw, x, y, &sx, &sy);
 	sw = mapw->vp->hw;  sh = mapw->vp->hh;
 	mapw->blastsx = sx;  mapw->blastsy = sy;

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-10-13 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-10 14:46 display centering Peter Garrone
2003-10-10 16:14 ` Eric McDonald
2003-10-10 21:22   ` Hans Ronne
2003-10-13 11:39   ` Peter Garrone
2003-10-13 15:02     ` Eric McDonald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).