This is the mail archive of the xconq7@sourceware.cygnus.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Xconq view objects


Now that 7.3 is out there, it's possible to go back and address
some longstanding issues.  At the moment I'm overhauling the view
(fog-of-war) machinery.  The basic view management code hasn't
changed in some years, although it has serious limitations.

In particular, it doesn't play nice with stacking, because it
can only store type and side for one unit in each cell.  So for
instance if you're looking at a stack of enemies, then move away
so you're no longer directly viewing the cell, the stack gets
replaced by a single image, more-or-less randomly chosen.

Bad things also happen when invisible units maneuver around
stacks of other units, and there is generally quite a bit of
kludgery that has accumulated around viewing code.

So I'm addressing this with a new type of object, a "unit view".
This object is similar to a unit object, but it includes only
properties that are visible to other sides.  It also includes a
pointer to the real unit if the side has full access to the
real unit's data.

Code using views now needs to account for the stack possibility,
and there is a macro for_all_view_stack that iterates through
all unit views at a location.

Implementation details are still being worked out.  Originally
I was concerned about having lots of objects chewing up lots of
space, but that may not be much of an issue as I thought.  The
current prototype attempts to generate view objects from real
units (if visible) or the old unitview layer, and it seems unduly
complicated...

Stan

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]