Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: (PR#8632) Easy way to set map size with auto ratios (s
Home

[Freeciv-Dev] Re: (PR#8632) Easy way to set map size with auto ratios (s

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mburda@xxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#8632) Easy way to set map size with auto ratios (seteables if desired)
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 May 2004 14:24:40 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8632 >

Marcelo Burda wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=8632 >
> 
> Le mer 05/05/2004 à 22:34, Jason Short a écrit :
> 
>><URL: http://rt.freeciv.org/Ticket/Display.html?id=8632 >
>>
>>Marcelo Burda wrote:
>>
>>
>>>there are 2 restrictions map.xsize and map.ysize are < MAX_LINEAR_SIZE
>>>in native coordiantes.
>>
>>AFAIK there is no need for this restriction.
> 
> NO in no iso-map map.xsize  and map.ysize are <= MAX_LINEAR_SIZE .
> in no iso map that is ok to restrict maximal map coordinates to be less
> than 255
> but for the iso map i need add a more hard one to make the some think
> that is
> MAX(map.xsize + map.ysize / 2, map.xsize / 2 + map.ysize) + 1 <=
> MAP_MAX_LINEAR_SIZE
> 
> where MAX_LINEAR_SIZE=254 ( <255)
> 
> i can use only the last one but i no need to be so restric for no iso
> maps.
> 
> we can search for all usage on the code of#define
> MAP_MIN_HEIGHT           ( MAP_MIN_LINEAR_SIZE )
> MAP_MAX_HEIGHT           ( MAP_MAX_LINEAR_SIZE )
> MAP_MIN_WIDTH            ( MAP_MIN_LINEAR_SIZE )
> MAP_MAX_WIDTH            ( MAP_MAX_LINEAR_SIZE )
> and make some clean ups too.

#define NAT_WIDTH map.xsize
#define NAT_HEIGHT map.ysize

#define MAP_WIDTH \
   (topo_has_flag(TF_ISO) \
    ? (map.xsize + map.ysize / 2) \
    : map.xsize)
#define MAP_HEIGHT \
   (topo_has_flag(TF_ISO) \
    ? (map.xsize + map.ysize / 2) \
    : map.ysize)

There is no restriction on NAT_WIDTH and NAT_HEIGHT.  The restriction is 
only on MAP_WIDTH and MAP_HEIGHT.  So a single check on 
MAP_WIDTH/MAP_HEIGHT should suffice for both.

That said, I'm in favor of removing the ratio server variable and always 
having the optimal ratio - in which case we shouldn't have a problem.

jason




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