Layer

The basis of all layer classes, containing function pointers for rendering. Can be overloaded for user defined layers.

Members

Aliases

main4BitColorLookupFunction
alias main4BitColorLookupFunction = colorLookup4Bit!uint
Undocumented in source.
main8BitColorLookupFunction
alias main8BitColorLookupFunction = colorLookup!(ubyte, uint)
Undocumented in source.
mainColorLookupFunction
alias mainColorLookupFunction = colorLookup!(ushort, uint)
Undocumented in source.

Functions

flipHorizontal
void flipHorizontal(T[] target)

Standard algorithm for horizontal mirroring, used for tile mirroring

getLayerType
LayerType getLayerType()

Returns the type of the layer. Useful with certain scripting languages.

getSX
int getSX()

Getter for the X scroll position.

getSY
int getSY()

Getter for the Y scroll position.

relScroll
void relScroll(int x, int y)

Relatively scrolls the layer by the given amount. Formula is: [sX,sY] = [sX,sY] + [x,y]

scroll
void scroll(int x, int y)

Scrolls the layer to the given position.

setRasterizer
void setRasterizer(int rX, int rY)

Sets up the layer for the current rasterizer.

setRenderingMode
void setRenderingMode(RenderingMode mode)

Sets the global rendering mode for this layer.

updateRaster
void updateRaster(void* workpad, int pitch, Color* palette)

Renders the layer's output to the raster. Function is called sequentially for all layers. Layers with higher priority number will render to the raster in a later time. Function is marked as @nogc, as render-time allocation has negative impact on performance. For errors, either use asserts for unrecoverable errors, or errorcodes for less severe cases.

Variables

mainRenderingFunction
RenderFunc mainRenderingFunction;

Used to implement changeable renderers for each layers

rasterX
int rasterX;

Raster width (visible)

rasterY
int rasterY;

Haster height

renderMode
RenderingMode renderMode;
Undocumented in source.
sX
int sX;

Horizontal scroll position

sY
int sY;

Vertical scroll position

Meta