
 Sector-like clipping for sprites
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sprite picnums can be assigned to a bunch of connected sectors so that
clipping against these sprites will work as if it is carried out on the
associated sectors. For this, files named _clipshapeX.map (where X is
in 0..9) should be present at program start time. Every such map must be
built to certain rules, and loading many of them has the same effect as
loading a single map with all sectors/walls/sprites thrown together.

* Every sector that contains at least one white wall is considered an "outer" sector.
  Conversely, sectors with only red walls are "inner" (clipping) sectors.

* Sprites in outer sectors are ignored.

* To associate a picnum with a bunch of sectors, place a sprite with that picnum in
  some inner sector of the lot. At the end stage of editing, align the sprite so that
  the model matches the sectors well. See samples/_clipshape_.map for examples.

* A picnum may be associated with many "layers" (called "indices" in the code) of
  sectorwork. This serves two purposes: one is to enable more complex shapes than
  would be possible using only one sector. The other reason is that a sprite may differ
  in orientation in such a way that it is not possible to calculate one from another.
  In particular, floor-aligned sprites and face/wall sprites should have their own
  sector versions (of course only if they are intended to be used in a particular
  orientation).

* The sprites in inner sectors should point northward and should not have any orientation-
  changing bits like x-flip or y-flip set. Setting centering and a custom size is permitted,
  though.

* A set of picnums can be aliased to a layer. This is useful if "secondary" picnums
  are going to be used as decoration, for example. For this, set lotags and/or hitags
  of any wall of an inner sector to the picnums to be aliased to layer containing the wall.
  If only one of them is set, it is taken as a picnum, otherwise as a both-sided inclusive
  range, the order doesn't matter. The pigcop tank is present as an example in
  samples/_clipshape_.map. If a picnum has multiple layers, it is advisable to set the same
  lotags/hitags for each layer. Note that you do not need to set tags unless you intend to
  have more than one picnum to share a clipping shape.

* The inner sectors of a given layer must be all interconnected (not necessarily directly)
  and for a layer there must be a unique outer sector.

* Making the floor or ceiling of a sector parallaxed will disable clipping on it in certain
  ways. Normally, there are four horizontal clipping planes per inner sector (see the round
  table for an example). Making the ceiling parallaxed disables the upper two, and analogously
  for the floor.

* Making a sprite transparent will disable rotation around its origin to match a given sprite's
  angle. Use it on models with rotational symmetry.


Notes:
------

* The clipping will not change with rendering modes or options.


Known bugs:
-----------

* Flipping doesn't work correctly


Predicted bugs:
---------------

* Clipping may not work across playing map sector boundaries, especially with large sprites.


 --Helixhorned
