#help_index "Sprites/Binary"

class CMeshTri
{
    I32 color;      //Give one of 0-7 colors.
                        //Colors 8-15 are 0-7 with intensity bit set.
    I32 nums[3];    //Vertex number
};

class CQueueMeshTri
{
    CQueueMeshTri   *next,*last;
    U0               start;
    I32              color;
    I32              nums[3];
};

public class CSpriteBase
{
    U8 type;
};

public class CSpriteColor : CSpriteBase
{
    U8 color;
};

public class CSpriteDitherColor : CSpriteBase
{
    U16 dither_color;
};

public class CSpriteT : CSpriteBase
{
    I32 thick;
};

public class CSpritePt : CSpriteBase
{
    I32 x1;
    I32 y1;
};

public class CSpritePtRad : CSpritePt
{
    I32 radius;
};

public class CSpritePtPt : CSpritePt
{
    I32 x2;
    I32 y2;
};

public class CSpritePtPtAng : CSpritePtPt
{
    F64 angle;
};

public class CSpritePtWH : CSpritePt
{
    I32 width;
    I32 height;
};

public class CSpritePtWHU8s : CSpritePtWH
{
    U8 u[0];
};

public class CSpritePtWHAng : CSpritePtWH
{
    F64 angle;
};

public class CSpritePtWHAngSides : CSpritePtWHAng
{
    I32 sides;
};

public class CSpriteNumU8s : CSpriteBase
{
    I32 num;
    U8  u[0];
};

public class CSpriteNumPtU8s : CSpriteBase
{
    I32 num;
    I32 x;
    I32 y;
    U8  u[0];
};

public class CSpritePtStr : CSpritePt
{
    U8  st[0];
};

public class CSpriteMeshU8s : CSpriteBase
{
    I32 vertex_count;
    I32 tri_count;
    U8  u[0];
};

public class CSpritePtMeshU8s : CSpriteBase
{
    I32 x;
    I32 y;
    I32 z;
    I32 vertex_count;
    I32 tri_count;
    U8  u[0];
};

#define SPF_SEL     128
#define SPf_SEL     7

#define SPT_END             0           // CSpriteBase
#define SPT_COLOR           1           // CSpriteColor
#define SPT_DITHER_COLOR    2           // CSpriteDitherColor
#define SPT_THICK           3           // CSpriteT
#define SPT_PLANAR_SYMMETRY 4           // CSpritePtPt
#define SPT_TRANSFORM_ON    5           // CSpriteBase
#define SPT_TRANSFORM_OFF   6           // CSpriteBase
#define SPT_SHIFT           7           // CSpritePt
#define SPT_PT              8           // CSpritePt
#define SPT_POLYPT          9           // CSpriteNumPtU8s
#define SPT_LINE            10          // CSpritePtPt
#define SPT_POLYLINE        11          // CSpriteNumU8s
#define SPT_RECT            12          // CSpritePtPt
#define SPT_ROTATED_RECT    13          // CSpritePtPtAng
#define SPT_CIRCLE          14          // CSpritePtRad
#define SPT_ELLIPSE         15          // CSpritePtWHAng
#define SPT_POLYGON         16          // CSpritePtWHAngSides
#define SPT_BSPLINE2        17          // CSpriteNumU8s
#define SPT_BSPLINE2_CLOSED 18          // CSpriteNumU8s
#define SPT_BSPLINE3        19          // CSpriteNumU8s
#define SPT_BSPLINE3_CLOSED 20          // CSpriteNumU8s
#define SPT_FLOOD_FILL      21          // CSpritePt
#define SPT_FLOOD_FILL_NOT  22          // CSpritePt
#define SPT_BITMAP          23          // CSpritePtWHU8s
#define SPT_MESH            24          // CSpriteMeshU8s   See ::/Apps/GrModels.
#define SPT_SHIFTABLE_MESH  25          // CSpritePtMeshU8s See ::/Apps/GrModels.
#define SPT_ARROW           26          // CSpritePtPt
#define SPT_TEXT            27          // CSpritePtStr
#define SPT_TEXT_BOX        28          // CSpritePtStr
#define SPT_TEXT_DIAMOND    29          // CSpritePtStr
#define SPT_TYPES_NUM       30
#define SPG_TYPE_MASK       0x7F

#help_index "Graphics/Sprite;Sprites;Sprites/Binary"

// See Sprites. See ::/System/Gr/GrSpritePlot.ZC and
// ::/Demo/Graphics/SpriteRaw.ZC for how CSprite are stored.
public class CSprite
{
    CSprite *next,*last;
    U0       start;
    union
    {
        U8 type;
        CSpriteBase         b;
        CSpriteColor        c;
        CSpriteDitherColor  d;
        CSpriteT            t;
        CSpritePt           p;
        CSpritePtPt         pp;
        CSpritePtPtAng      ppa;
        CSpritePtRad        pr;
        CSpritePtWHU8s      pwhu;
        CSpritePtWHAng      pwha;
        CSpritePtWHAngSides pwhas;
        CSpriteNumU8s       nu;
        CSpriteNumPtU8s     npu;
        CSpriteMeshU8s      mu;
        CSpritePtMeshU8s    pmu;
        CSpritePtStr        ps;
    }
};