Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2001:
[Freeciv-Dev] win32 native + non-iso tileset
Home

[Freeciv-Dev] win32 native + non-iso tileset

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Andreas Kemnade <akemnade@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] win32 native + non-iso tileset
From: James Wilson <fat_hot@xxxxxxxxx>
Date: Thu, 15 Nov 2001 01:40:32 -0500

I've been trying the (cvs head) win32 native client, which is nice and snappy, and found that it blows up when I try to use -tiles trident. the problem is apparently in graphics.c, init_fog_bmp (); it uses sprites.black_tile->mask, but black_tile is NULL when is_isometric is not set, so boom. frankly I don't know what "fog of war" is, so don't know if the below tweak is correct, but it let me get up and running with trident.

also, since civclient is built as a win32 non-console app, it apparently doesn't have a real stderr and so freelog messages just disappear unless you run with --log. even saying 'civclient --help' produces no output. I looked at log_info and it seems like a callback function could be set up to pop up a dialog box or something, maybe #ifdef WIN32_NATIVE or something like that. I see that, once ui_main is called, a logoutput_win is set up, but it doesn't appear that freelog messages go to it even then.

James

Index: graphics.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-win32/graphics.c,v
retrieving revision 1.2
diff -c -r1.2 graphics.c
*** graphics.c  2001/10/13 17:38:57     1.2
--- graphics.c  2001/11/15 06:19:25
***************
*** 375,395 ****
    fog_sprite.height=NORMAL_TILE_HEIGHT;
    HBITMAP2BITMAP(fog,&fog_sprite.bmp);
    DeleteObject(fog);
!   fog_sprite.has_mask=1;
!   fog=BITMAP2HBITMAP(&sprites.black_tile->mask);
!   old=SelectObject(hdc,fog);
!   for(x=0;x<NORMAL_TILE_WIDTH;x++)
!     for(y=0;y<NORMAL_TILE_HEIGHT;y++)
!       {
!       if (!GetPixel(hdc,x,y))
!         {
!           if ((x+y)&1)
!             SetPixel(hdc,x,y,RGB(255,255,255));
!         }
!       }
!   SelectObject(hdc,old);
!   HBITMAP2BITMAP(fog,&fog_sprite.mask);
!   DeleteObject(fog);
    DeleteObject(hdc);

  }
--- 375,399 ----
    fog_sprite.height=NORMAL_TILE_HEIGHT;
    HBITMAP2BITMAP(fog,&fog_sprite.bmp);
    DeleteObject(fog);
!
!   if (is_isometric) {
!     fog_sprite.has_mask=1;
!     fog=BITMAP2HBITMAP(&sprites.black_tile->mask);
!     old=SelectObject(hdc,fog);
!     for(x=0;x<NORMAL_TILE_WIDTH;x++)
!       for(y=0;y<NORMAL_TILE_HEIGHT;y++)
!       {
!         if (!GetPixel(hdc,x,y))
!           {
!             if ((x+y)&1)
!               SetPixel(hdc,x,y,RGB(255,255,255));
!           }
!       }
!     SelectObject(hdc,old);
!     HBITMAP2BITMAP(fog,&fog_sprite.mask);
!     DeleteObject(fog);
!   }
!
    DeleteObject(hdc);

  }


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com



[Prev in Thread] Current Thread [Next in Thread]