[CF-Devel] Re: Patch: client display issues

crossfire-devel-admin at archives.real-time.com crossfire-devel-admin at archives.real-time.com
Sat Oct 11 17:46:51 CDT 2003


Sorry, forgot to attach the diffs...
-------------- next part --------------
Index: socket/request.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/socket/request.c,v
retrieving revision 1.52
diff -w -c -5 -r1.52 request.c
*** socket/request.c	13 Sep 2003 05:02:14 -0000	1.52
--- socket/request.c	11 Oct 2003 19:55:23 -0000
***************
*** 1728,1738 ****
       * area, we clear the values - otherwise, the old values
       * are preserved, and the check_head thinks it needs to clear them.
       */
      for(x=0; x<mx; x++) {
  	for(y=0; y<my; y++) {
! 	    if ((x+dx) < 0 || x >= ns->mapx || (y+dy) < 0 || y >= ns->mapy) {
  		memset(&(newmap.cells[x][y]), 0, sizeof(struct MapCell));
  	    }
  	    else {
  		memcpy(&(newmap.cells[x][y]),
  		   &(ns->lastmap.cells[x+dx][y+dy]),sizeof(struct MapCell));
--- 1728,1739 ----
       * area, we clear the values - otherwise, the old values
       * are preserved, and the check_head thinks it needs to clear them.
       */
      for(x=0; x<mx; x++) {
  	for(y=0; y<my; y++) {
! 	    if (x < 0 || x+dx < 0 || x >= ns->mapx || x+dx >= ns->mapx
! 	    ||  y < 0 || y+dy < 0 || y >= ns->mapy || y+dy >= ns->mapy) {
  		memset(&(newmap.cells[x][y]), 0, sizeof(struct MapCell));
  	    }
  	    else {
  		memcpy(&(newmap.cells[x][y]),
  		   &(ns->lastmap.cells[x+dx][y+dy]),sizeof(struct MapCell));
-------------- next part --------------
Index: gtk/map.c
===================================================================
RCS file: /cvsroot/crossfire/client/gtk/map.c,v
retrieving revision 1.16
diff -w -c -5 -r1.16 map.c
*** gtk/map.c	8 Aug 2003 17:06:40 -0000	1.16
--- gtk/map.c	11 Oct 2003 19:39:39 -0000
***************
*** 355,372 ****
  		if( x < 0 || y < 0 || x >= the_map.x ||	y >= the_map.y)
  		    continue;
  
  
  		the_map.cells[x][y].need_update= 1;
!         /*After long long long investigations on why the multipart objects did
!           disappear when entering map view from right or bottom, scrolling
!           through whole server code, i concluded the following line should be
!           commented. If a multipart object was on a square outside of map,
!           containing the tail, tail may be cleared by following process and
!           so we end up with things like tower disappearance.
!                     
     
     tchize at myrealbox.com
     
     */
! 		/*the_map.cells[x][y].cleared= 1;*/
  	    }
  	} /* for y */
      } /* for x */
  
  #ifdef HAVE_SDL
--- 355,365 ----
  		if( x < 0 || y < 0 || x >= the_map.x ||	y >= the_map.y)
  		    continue;
  
  
  		the_map.cells[x][y].need_update= 1;
! 		the_map.cells[x][y].cleared= 1;
  	    }
  	} /* for y */
      } /* for x */
  
  #ifdef HAVE_SDL
-------------- next part --------------
Index: x11/x11.c
===================================================================
RCS file: /cvsroot/crossfire/client/x11/x11.c,v
retrieving revision 1.19
diff -w -c -5 -r1.19 x11.c
*** x11/x11.c	6 Oct 2003 07:04:01 -0000	1.19
--- x11/x11.c	11 Oct 2003 19:39:40 -0000
***************
*** 2985,3009 ****
  	return;
      }
  
      XFillRectangle(display,xpm_pixmap,gc_clear_xpm,0,0,image_size,image_size);
      for (k=0; k<MAXLAYERS; k++) {
  	    if (the_map.cells[mx][my].heads[k].face >0 ) {
  		/* Always draw the lower right corner of the heads. */
  		gen_draw_face(xpm_pixmap, the_map.cells[mx][my].heads[k].face, 0, 0,
  		   (pixmaps[the_map.cells[mx][my].heads[k].face]->width - 1) * image_size,
  		   (pixmaps[the_map.cells[mx][my].heads[k].face]->height - 1) * image_size
  			      );
  		got_one = 1;
  	    }
- 	    if (the_map.cells[mx][my].tails[k].face >0 ) {
- 		gen_draw_face(xpm_pixmap, the_map.cells[mx][my].tails[k].face, 0, 0,
- 		   (pixmaps[the_map.cells[mx][my].tails[k].face]->width - the_map.cells[mx][my].tails[k].size_x - 1) * image_size,
- 		   (pixmaps[the_map.cells[mx][my].tails[k].face]->height - the_map.cells[mx][my].tails[k].size_y - 1) * image_size
- 			      );
- 		got_one = 1;
- 	    }
      }
      if (got_one) {
  	if (the_map.cells[mx][my].cleared) {
  	    XSetClipOrigin(display, gc_xpm[XPMGCS-1], 0, 0);
  	    XSetForeground(display, gc_xpm[XPMGCS-1], discolor[0].pixel);
--- 2985,3009 ----
  	return;
      }
  
      XFillRectangle(display,xpm_pixmap,gc_clear_xpm,0,0,image_size,image_size);
      for (k=0; k<MAXLAYERS; k++) {
+ 	    if (the_map.cells[mx][my].tails[k].face >0 ) {
+ 		gen_draw_face(xpm_pixmap, the_map.cells[mx][my].tails[k].face, 0, 0,
+ 		   (pixmaps[the_map.cells[mx][my].tails[k].face]->width - the_map.cells[mx][my].tails[k].size_x - 1) * image_size,
+ 		   (pixmaps[the_map.cells[mx][my].tails[k].face]->height - the_map.cells[mx][my].tails[k].size_y - 1) * image_size
+ 			      );
+ 		got_one = 1;
+ 	    }
  	    if (the_map.cells[mx][my].heads[k].face >0 ) {
  		/* Always draw the lower right corner of the heads. */
  		gen_draw_face(xpm_pixmap, the_map.cells[mx][my].heads[k].face, 0, 0,
  		   (pixmaps[the_map.cells[mx][my].heads[k].face]->width - 1) * image_size,
  		   (pixmaps[the_map.cells[mx][my].heads[k].face]->height - 1) * image_size
  			      );
  		got_one = 1;
  	    }
      }
      if (got_one) {
  	if (the_map.cells[mx][my].cleared) {
  	    XSetClipOrigin(display, gc_xpm[XPMGCS-1], 0, 0);
  	    XSetForeground(display, gc_xpm[XPMGCS-1], discolor[0].pixel);
    
    


More information about the crossfire mailing list