Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: Profile.
Home

[Freeciv-Dev] Re: Profile.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Profile.
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: Sat, 06 Oct 2001 00:09:50 +0100

>> > #define CHECK_MAP_POS(x,y) do{\
>> >     int dx = x, dy = y; \
>> >     assert(normalize_map_pos(&dx, &dy)); \
>> >     assert(x == dx && y == dy); \
>> >   } while(0)
>> 
>> Are you aware of check_coords() ?
> 
> No but this is another function call. And it doesn't assert or abort
> or exit. I don't want an error message I want a core dump. Such
> problems are errors.

Yes, but there still shouldn't be two ways to do (almost) exactly the
same thing.

>> > So map_get_tile would be like:
>> > 
>> > struct tile *map_get_tile(int x, int y)
>> > {
>> >   CHECK_MAP_POS(x,y);
>> > 
>> >   return map.tiles + map_inx(x, y);
>> > }
>> > 
>> > CHECK_MAP_POS can now check for 
>> >  - un-real map position or for
>> >  - non-normal(ized) map positions or
>> >  - can be a noop
>> 
>> This is very similar to what I've been thinking about.  However, I
>> think we should embedded this in map_inx() instead.  I think that
>> would be a lot less intrusive and probably more thorough.
> 
> Problem is: map_inx isn't used much.

That is a bug which can and should be fixed.  Viz. the recent
discussion about isometric view, and so on.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
It's NO USE..  I've gone to ``CLUB MED''!!


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