Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] client and gui
Home

[Freeciv-Dev] client and gui

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] client and gui
From: Jason Dorje Short <vze2zq63@xxxxxxxxxxx>
Date: Tue, 30 Oct 2001 17:01:14 -0500
Reply-to: jdorje@xxxxxxxxxxxx

The best candidates for being moved from gui-***/mapview.c to
mapview_common.c are, IMO, get_canvas_xy and get_map_xy [1].  But, this
will only be possible if the window's origin/dimensions (map_view_[xy]0,
map_canvas_store_t[width|height]) are also moved to mapview_common (the
other option is to have these be passed in as parameters to these
functions).  Although these variables exist in every GUI, there are two
problems:

1.  They have different names in some of the GUIs.  I prefer the
gtk/xaw/mui naming of map_view_[xy]0, and the win32 naming of
map_view_[width|height].  Renaming them will be a big cosmetic change,
but nothing really special (I hope).

2.  In gui-mui, these values (well, tha map_canvas_store,t* ones) are
calculated on demand rather than being stored permanently and changed
appropriately.  Can this be changed?  Is it a surmountable problem at
all?  Are there guis where it might be impossible to track changes to
these values?  If so, the parameter-passing method would have to be used
instead.

There are several reasons why it would be nice for these functions to be
common.  (1) They contain entirely mathematical calculations to handle
isometric and overhead view tile positioning.  Since other tile stuff is
generally common, there's no reason these shouldn't be as well.  (2)
They will change significantly in the move to general topologies.  It'd
be easiest to make this change just once.  (3) In the future they may be
changed to allow the map origin to be any pixel, not aligned by a tile. 
It would be easiest to make this change just once.  (4) They implement
both overhead and isometric view, making an isometric-view
implementation for xaw or any other gui that much closer.

Although I'm quite familiar with the calculations these functions will
do, and confident that they will be the same between different guis, I'm
not sure about the above technical problems.  Would it be better to pass
in parameters to the functions?

[1] Well, there may be other code that is easier to move.  But this
would give the most benefits, I think.

jason


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