This is the mail archive of the xconq7@sources.redhat.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

display centering


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]