(18May99)
I assume that the graphic are handled by a graphic library
such as Allegro (or XwinAllegro).
Construction of player's grafic tile.
Every base tile (f.ex. for every race & sex combination)
is associated to 4 coordinates of where to put over the
graphics for headgear, left and right hands wielded items
and Footwear. (Armours and cloaks can be set too, but by now
i dont want too complex items, after finished this i will add
them)
The aditional tiles are stacked over (assuming the use
of masked bitmaps) the base tile (well, better use a larger
bitmap with that graphic centered) and the final union is
clipped to 32x32 pixels (or the size of your tiles) and
stored for later use.
(This is an ugly ASCII example, not well scaled)
(The graphic for the boots must be clipped)
+-------------------+ <- Base character graph. (Think
| | in a brave warrior or a
| 1 | mighty mage here)
| | 1 The coords for head (the graphic
| | for helm will be centered here.
| 2 |
| 3 | 2 Right hand (mostly weapon)
| |
| +---------+ | 3 Left hand
| | | |
| | | | 4 Boots
| | 4 | |
+----+---------+----+
| |
+---------+
The tile must be redrawn (recalculate?) in the memory buffer
every time the character change armor or wielded items or when is
wounded (blood stains can be added) or somehow change of status
(Polymorph anyone?), but the loos of speed is infimous, given
the times that you change the status of the player is only
every not soo few turns.
Also, weapon graphics can be added an aditional parameter
to handle the orientation of how the picture of the character
hold the weapon, and then rotate the weapon graphic before
make its merge (To advoid the feel that all characters are
in "vogue"(?) ) This will make some "graphical" damage to
our weapon tiles but ... (This idea is not tested yet by me)
NPC graphics can be handled using a similar method, but an
easier (and faster) one will be better. My dessing only uses weapons
graphs and only for humanoid NPC.
NEXT .... Palette and colour changes
               (
geocities.com/fmunoz_)