|
resonance 1.0.1
|
Convex polygon for the ACanvas polygon fills, as vertex indices into a shared point array. More...
#include <apolygon.h>

Public Member Functions | |
| void | SetupEdge (APolygonEdge *pEdge, short nFrom, int nDirection) const |
| Start an edge at one vertex and aim it at a neighbour. | |
| void | SetupTexturedEdge (APolygonEdge *pEdge, short nFrom, int nDirection, const ABitmap *pTexture) const |
| Start an edge as SetupEdge() does and add its texture walk. | |
Public Attributes | |
| union { | |
| unsigned int mColor | |
| const ABitmap * mTexture | |
| }; | |
| short | mReserved04 |
| short | mVertexCount |
| const APoint * | mPoints |
| unsigned char | mIndices [kAPolygonMaxVertexCount] |
| const APoint * | mTexCoords |
Convex polygon for the ACanvas polygon fills, as vertex indices into a shared point array.
The record is not polymorphic and has no RTTI. Its two routines sit inside the ACanvas translation unit, between the ACanvas members that call them.
The record is at least 0x18 bytes. The index array runs from 0x0c to the texture coordinate pointer at 0x14, which bounds it at eight vertices. No reader of the halfword at 0x04 was located.
The first word has two readings. ACanvas::DrawFlatConvexPolygon() passes it to ACanvas::SetColorNative(), and ACanvas::DrawTmappedConvexPolygon() passes it as the source bitmap of ACanvas::DrawTmapRow8U(). It is modelled as a union of the two.
Every position is 24.8 fixed point. A vertex position is mPoints[mIndices[i]], while a texture coordinate is mTexCoords[i] with no indirection. Each texture coordinate is a fraction of the texture extent, because APolygon::SetupTexturedEdge() multiplies it by the texture width or height.
| void APolygon::SetupEdge | ( | APolygonEdge * | pEdge, |
| short | nFrom, | ||
| int | nDirection ) const |
Start an edge at one vertex and aim it at a neighbour.
The neighbour is nFrom plus nDirection, wrapped to the vertex count at either end. The previous mBottom of the edge becomes its mTop, and the new mBottom is the neighbour's row rounded to the nearest whole row with AFix::onehalf. The column step is the column difference divided by the row count, or zero for an edge of no rows.
| pEdge | The edge to fill. |
| nFrom | The vertex position in mIndices the edge starts at. |
| nDirection | 1 to walk forward through mIndices, -1 to walk backward. |
| void APolygon::SetupTexturedEdge | ( | APolygonEdge * | pEdge, |
| short | nFrom, | ||
| int | nDirection, | ||
| const ABitmap * | pTexture ) const |
Start an edge as SetupEdge() does and add its texture walk.
Scales both texture coordinates of the edge by the texture extent. The texture step is written only for an edge of one row or more, so an empty edge retains the previous step.
| pEdge | The edge to fill. |
| nFrom | The vertex position in mIndices the edge starts at. |
| nDirection | 1 to walk forward through mIndices, -1 to walk backward. |
| pTexture | The texture whose extent scales the coordinates. |
| unsigned int APolygon::mColor |
The fill colour in the canvas pixel format. +0x00
| const ABitmap* APolygon::mTexture |
The texture of a textured fill. +0x00
| union { ... } APolygon |
| short APolygon::mReserved04 |
No reader was located. +0x04
| short APolygon::mVertexCount |
Vertices in mIndices. +0x06
| const APoint* APolygon::mPoints |
The shared vertex positions. +0x08
| unsigned char APolygon::mIndices[kAPolygonMaxVertexCount] |
Positions into mPoints. +0x0c
| const APoint* APolygon::mTexCoords |
Texture coordinates, one per vertex. +0x14