Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2003:
[Freeciv-Dev] (PR#4691) replace regular_map_pos_is_normal users with nat
Home

[Freeciv-Dev] (PR#4691) replace regular_map_pos_is_normal users with nat

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#4691) replace regular_map_pos_is_normal users with native coordinates
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Sep 2003 13:06:54 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[jdorje - Mon Sep 15 19:50:26 2003]:

> [glip - Thu Sep 11 11:47:37 2003]:
> 
> > [jdorje - Fri Jul 25 20:13:08 2003]:
> > 
> > > This patch removes the regular_map_pos_is_normal macro, and replaces
> its 
> > > users (in savegame.c) with native coordinates instead.
> > > 
> > > This means the savegames will be stored in native coordinates. 
For an 
> > > iso-map this is a big savings versus using map coordinates since the 
> > > native coordinates are rectangular.
> > 
> > In SAVE_NORMAL_MAP_DATA, where does y (or nat_y) come from?  Where are
> > they defined?
> 
> These exist (and must match) both inside and outside the macro.  This is
> a significant hack; on the other hand, that's how it's already been done.
> 
> In the current code y is used at all three levels (caller,
> SAVE_NORMAL_MAP_DATA definition, SAVE_MAP_DATA definition):
> 
>   SAVE_NORMAL_MAP_DATA(file, terrain_chars[map_get_tile(x, y)->terrain],
>                      "map.t%03d");
> 
> 
> #define SAVE_NORMAL_MAP_DATA(secfile, get_xy_char, secfile_name)     
    \
>       SAVE_MAP_DATA(get_xy_char,                                        \
>                     secfile_insert_str(secfile, line, secfile_name, y))
> 
> #define SAVE_MAP_DATA(get_xy_char, secfile_insert_line) \
> {                                                       \
>   char *line = fc_malloc(map.xsize + 1);                \
>   int x, y;                                             \
> 
> It may be possible to decrease this hack by adding it as a parameter. 
> Hmm...

Here's a patch for the current code to fix this.  Of course, it
conflicts with the original 4691 patch.  And the parameter order may be
inferior?

jason



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