<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40184 >

2008/6/12 Madeline Book:
> PR#37356, which you can feel free
> to ignore if you've heard before or just have not had time to
> address the issues raised there).

 That's temporary halfway solution. Old codebase had just specials
AIRBASE and FORTRESS. In the future (most likely not yet in 2.2)
number of military bases should be configurable, and bases cannot be
part of specials array. They are still part of specials array since I
have had no time (or acceptable means) to convert all users to access
them properly. New users should not rely on them being in specials
array, but to use accessor functions.
 Instead of S_FORTRESS and S_AIRBASE you should be using at least base
id. Tilespec already has base tiles in an array where index is base

> Please correct me if I am wrong but the references to
> S_FORTRESS and S_AIRBASE that are being objected to are in
> the function get_basic_special_sprite in client/tilespec.c.

 Actually, I just saw S_FORTRESS and S_AIRBASE in new code and reacted
to that :-)
 There should be no new references to those, unless it's about 'moving
boundary' of the old/new model to correct direction.

> My argument is that as long as S_FORTRESS and S_AIRBASE are
> a part of enum tile_special_type this reference is simply
> unavoidable. Furthermore if I were to say add some manner
> of conversion function (e.g. base_by_special, special_is_base)

 Please don't assume that bases are stored as specials. Iterating
specials should already skip S_FORTRESS and S_AIRBASE (at least it did
when I last worked on this)
 I realize that editor code may require some new accessor functions. I
can write those in a proper manner, if you tell me what you need. Note
that tile.c has functions for checking, adding and removing bases from

> I would have to check for this and add annoying special-case
> code every time I iterate over the special types (which is
> very common considering the requirements of the editor).

 Isn't common iterator macro no longer doing this?

> I will however look into using the {fore,middle,back}ground
> sprites more intelligently (I suppose they should be combined
> into one sprite to actually make the full representative
> sprite of an airbase or fortress).

 No, those separate parts are for a reason. Depending on tileset,
units in fortress may appear in front of fortress background, but
behind foreground. There certainly is a reason for middleground too,
even though I cannot remember it now.

 - ML

Freeciv-dev mailing list

Reply via email to