TransformableTileLayer

Implements a modified TileLayer with transformability with capabilities similar to MODE7. <br/> Transform function: [x',y'] = ([A,B,C,D] * ([x,y] + [sX,sY] - [x_0,y_0])>>>8 + [x_0,y_0] <br/> All basic transform values are integer based, 256 equals with 1.0 <br/> Restrictions compared to standard TileLayer: <ul> <li>Tiles must have any of the following sizes: 8, 16, 32, 64; since this layer needs to do modulo computations for each pixel.</li> <li>Maximum layer size in pixels are restricted to 65536*65536 due to architectural limitations. Accelerated versions might raise this limitation.</li> </ul> HDMA emulation supported through delegate hBlankInterrupt.

class TransformableTileLayer : Layer , ITileLayer (
BMPType = Bitmap16Bit
int TileX = 8
int TileY = 8
) {}

Constructors

this
this(LayerRenderingMode renderMode)
Undocumented in source.

Members

Aliases

HBIDelegate
alias HBIDelegate = void delegate(ref short[4] localABCD, ref short[2] localsXsY, ref short[2] localx0y0, short y)
Undocumented in source.

Functions

addTile
void addTile(ABitmap tile, wchar id)
Undocumented in source. Be warned that the author may not have intended to support it.
getMX
int getMX()
Undocumented in source. Be warned that the author may not have intended to support it.
getMY
int getMY()
Undocumented in source. Be warned that the author may not have intended to support it.
getMapping
MappingElement[] getMapping()
Undocumented in source. Be warned that the author may not have intended to support it.
getTX
int getTX()
Undocumented in source. Be warned that the author may not have intended to support it.
getTY
int getTY()
Undocumented in source. Be warned that the author may not have intended to support it.
getTileHeight
int getTileHeight()
Undocumented in source. Be warned that the author may not have intended to support it.
getTileWidth
int getTileWidth()
Undocumented in source. Be warned that the author may not have intended to support it.
loadMapping
void loadMapping(int x, int y, MappingElement[] mapping)

Loads a mapping from an array. x , y : Sizes of the mapping. map : an array representing the elements of the map. x*y=map.length

readMapping
MappingElement readMapping(int x, int y)

Gets the the ID of the given element from the mapping. x , y : Position.

relScroll
void relScroll(int x, int y)
Undocumented in source. Be warned that the author may not have intended to support it.
removeTile
void removeTile(wchar id)

Removes the tile with the ID from the set.

scroll
void scroll(int x, int y)
Undocumented in source. Be warned that the author may not have intended to support it.
setRasterizer
void setRasterizer(int rX, int rY)
Undocumented in source. Be warned that the author may not have intended to support it.
setWarpMode
void setWarpMode(bool w)

Warpmode: if enabled, the layer will be turned into an "infinite" mode.

tileByPixel
MappingElement tileByPixel(int x, int y)

Returns which tile is at the given pixel

tileByPixelWithoutTransform
MappingElement tileByPixelWithoutTransform(int x, int y)

Returns which tile is at the given pixel

updateRaster
void updateRaster(void* workpad, int pitch, Color* palette)
Undocumented in source. Be warned that the author may not have intended to support it.
writeMapping
void writeMapping(int x, int y, MappingElement w)

Writes to the map. x , y : Position. w : ID of the tile.

Properties

A
short A [@property getter]

Horizontal scaling. Greater than 256 means zooming in, less than 256 means zooming out.

A
short A [@property setter]

Horizontal scaling. Greater than 256 means zooming in, less than 256 means zooming out.

B
short B [@property getter]

Horizontal shearing.

B
short B [@property setter]

Horizontal shearing.

C
short C [@property getter]

Vertical shearing.

C
short C [@property setter]

Vertical shearing.

D
short D [@property getter]

Vertical scaling. Greater than 256 means zooming in, less than 256 means zooming out.

D
short D [@property setter]

Vertical scaling. Greater than 256 means zooming in, less than 256 means zooming out.

x_0
short x_0 [@property getter]

Horizontal transformation offset.

x_0
short x_0 [@property setter]

Horizontal transformation offset.

y_0
short y_0 [@property getter]

Vertical transformation offset.

y_0
short y_0 [@property setter]

Vertical transformation offset.

Static variables

_increment
short8 _increment;
Undocumented in source.

Structs

DisplayListItem
struct DisplayListItem
Undocumented in source.

Variables

_tileAmpersand
int4 _tileAmpersand;
Undocumented in source.
backbuffer
Bitmap32Bit backbuffer;

used to store current screen output

displayList
BinarySearchTree!(wchar, DisplayListItem) displayList;
Undocumented in source.
hBlankInterrupt
HBIDelegate hBlankInterrupt;

Called before each line being redrawn. Can modify global values for each lines.

mX
int mX;
Undocumented in source.
mY
int mY;

"Inherited" from TileLayer

mapping
MappingElement[] mapping;
Undocumented in source.
needsUpdate
bool needsUpdate;

Set to true if backbuffer needs an update

shiftX
int shiftX;
Undocumented in source.
shiftX
int shiftX;
Undocumented in source.
shiftX
int shiftX;
Undocumented in source.
shiftX
int shiftX;
Undocumented in source.
shiftY
int shiftY;
Undocumented in source.
shiftY
int shiftY;
Undocumented in source.
shiftY
int shiftY;
Undocumented in source.
shiftY
int shiftY;
Undocumented in source.
src
ushort[] src;
Undocumented in source.
totalX
int totalX;
totalY
int totalY;
Undocumented in source.
tpOrigin
short[2] tpOrigin;
Undocumented in source.
transformPoints
short[4] transformPoints;

Defines how the layer is being transformed

warpMode
bool warpMode;

Repeats the whole layer if set to true

Inherited Members

From Layer

mainRenderingFunction
void function(uint* src, uint* dest, size_t length) mainRenderingFunction;

Used to get around some readability issues. (void* src, void* dest, int length)

mainColorLookupFunction
void function(ushort* src, uint* dest, uint* palette, size_t length) mainColorLookupFunction;
Undocumented in source.
main8BitColorLookupFunction
void function(ubyte* src, uint* dest, uint* palette, size_t length) main8BitColorLookupFunction;
Undocumented in source.
main4BitColorLookupFunction
void function(ubyte* src, uint* dest, uint* palette, size_t length, int offset) main4BitColorLookupFunction;
Undocumented in source.
renderMode
LayerRenderingMode renderMode;
Undocumented in source.
sX
int sX;
sY
int sY;
rasterX
int rasterX;
rasterY
int rasterY;
Undocumented in source.
setRasterizer
void setRasterizer(int rX, int rY)

Sets the main rasterizer

setRenderingMode
void setRenderingMode(LayerRenderingMode mode)

Sets the rendering mode

scroll
void scroll(int x, int y)

Absolute scrolling.

relScroll
void relScroll(int x, int y)

Relative scrolling. Positive values scrolls the layer left and up, negative values scrolls the layer down and right.

getSX
int getSX()

Getter for the X scroll position.

getSY
int getSY()

Getter for the Y scroll position.

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

Override this to enable output to the raster

flipHorizontal
void flipHorizontal(uint* src, int length)

Standard algorithm for horizontal mirroring Will be deprecated in later versions and instead external functions will be used.

From ITileLayer

getMapping
MappingElement[] getMapping()
Undocumented in source.
readMapping
MappingElement readMapping(int x, int y)

Reads the mapping element from the given area.

writeMapping
void writeMapping(int x, int y, MappingElement w)

Writes the given element into the mapping at the given location.

loadMapping
void loadMapping(int x, int y, MappingElement[] mapping)

Loads the mapping, primarily used for deserialization.

removeTile
void removeTile(wchar id)

Removes the tile from the display list with the given ID.

tileByPixel
MappingElement tileByPixel(int x, int y)

Returns the tile ID from the location by pixel.

getTileWidth
int getTileWidth()

Returns the width of the tiles.

getTileHeight
int getTileHeight()

Returns the height of the tiles.

getMX
int getMX()

Returns the width of the mapping.

getMY
int getMY()

Returns the height of the mapping.

getTX
int getTX()

Returns the total width of the tile layer.

getTY
int getTY()

Returns the total height of the tile layer.

addTile
void addTile(ABitmap tile, wchar id)

Adds a tile.

Meta