[Freeciv-Dev] Re: TODO
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Thue wrote:
>
> On Wed, 20 Sep 2000 14:13:06 Erik Sigra wrote:
> > Thue wrote:
> > > I have added a lot of points to the TODO file. Some are obvious, but a few
> > > like splitting the server to allow a graphical frontend can be
> > > controversial. People should comment/object now before I apply the patch
> and
> > > thereby make my modifications the public freeciv opinion. :)
> > > Note that some of the points are very concrete and even contains some
> > > implementation hints. (did that sound like a school assignment or what?
> :))
> >
> > I have started to implement this now. It is of course far from
> > complete (because you didn't want any mega patches, this is just 6.4k).
> >
> > The most important thing is that it abstracts away the
> > coordinates by replacing pairs of local variables called "x, y" with
> > an abstract variable called "position". This is important because normal
> > functions shoudn't care about how the coordinates work. It replaces
> > occurences of "x, y - 1" with "north(position)" and so on. When
> > changing coordinate system, only such functions as north() must be
> > changed. Not every function that uses them. All functions that are
> > aware of the lowlevel coordinates could eventually be moved to a
> > separate packet if you want.
> >
> > This patch also starts to implement optional wrapping in both
> > directions. It assumes that when a direction is not wrapped, a
> > dummy row/column of tiles at both ends exists. The dummy column can
> > not be entered nor uncovered. It is neccessary for correct rendering
> > of the terrain in the rows/columns next to the dummy columns (most
> > notably rivers). This is similar to the case where tiles next to know
> > tiles are used to render terrain in known tiles but are not
> > shown. Also, poles can be showed as only tiny ice borders.
> >
> > I don't know if I have explained clearly enough so please ask.
> >
> > I will continue if I get approval.
>
> Your implementation seems nicer than having seperate x and y coordinates,
> but it would require a lot of recoding. What I had in mind was just a small
> change in the bounds check of x and y at select places, requireing small
> changes, not a recode. Though it would be nice, I don't really want to
> commit to a rewamping of all of freeciv.
Yes, my implementation requires a lot of recoding (I'm doing it right
now). But it can be done in steps. It just takes some typecasting
klugdes ("(struct locus({x, y}") in some places during the transition. I
will soon release coordinates-3 (don't report bugs in coordinates-2
because I might already have fixed them).
Now I am:
* Abstracting away all direct use of coordinates from the river
generator.
* Abstracting away the use of "x=myrand(map.xsize);y=myrand(map.ysize);"
to
get a random position on the map. I'm replacing it with
"position = random_locus_anywhere();", which I think is more elegant.
* More similar stuff...
> -Thue
-Erik
[Freeciv-Dev] Re: TODO, Erik Sigra, 2000/09/20
- [Freeciv-Dev] Re: TODO, Erik Sigra, 2000/09/20
- [Freeciv-Dev] Re: TODO, Thue, 2000/09/21
- [Freeciv-Dev] Re: TODO,
Erik Sigra <=
- [Freeciv-Dev] Re: TODO, Thue, 2000/09/21
- [Freeciv-Dev] Re: TODO, Gerhard Killesreiter, 2000/09/21
- [Freeciv-Dev] Re: TODO, Erik Sigra, 2000/09/21
- [Freeciv-Dev] Re: TODO, Gerhard Killesreiter, 2000/09/21
- [Freeciv-Dev] Re: TODO, Gaute B Strokkenes, 2000/09/21
- [Freeciv-Dev] Re: TODO, Gerhard Killesreiter, 2000/09/21
- [Freeciv-Dev] Re: TODO, Daniel Sjölie, 2000/09/21
- [Freeciv-Dev] Re: TODO, Christian Knoke, 2000/09/21
- [Freeciv-Dev] Re: TODO, Tuomas Airaksinen, 2000/09/23
- [Freeciv-Dev] Re: TODO, Gerhard Killesreiter, 2000/09/21
|
|