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>In future versions, map sizes for this layer will be restricted to power of two sizes to make things faster</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, ITTL(
BMPType = Bitmap16Bit
int TileX = 8
int TileY = 8
) {}

Constructors

this
this(RenderingMode renderMode)
Undocumented in source.

Members

Aliases

DisplayList
alias DisplayList = TreeMap!(wchar, DisplayListItem, true)
Undocumented in source.
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, ubyte paletteSh)
Undocumented in source. Be warned that the author may not have intended to support it.
clearTilemap
void clearTilemap()
Undocumented in source. Be warned that the author may not have intended to support it.
getLayerType
LayerType getLayerType()
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
size_t getTX()
Undocumented in source. Be warned that the author may not have intended to support it.
getTY
size_t getTY()
Undocumented in source. Be warned that the author may not have intended to support it.
getTile
ABitmap getTile(wchar id)

Returns a tile from the displaylist

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.
getWarpMode
WarpMode getWarpMode()

Returns the currently used warp mode.

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
WarpMode setWarpMode(WarpMode mode)

Sets the warp mode. Returns the new warp mode that is being used.

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.

tileByPixelWithoutTransform
MappingElement[2] tileByPixelWithoutTransform(__m128i params)

Returns two tiles to speed up rendering.

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.

Structs

DisplayListItem
struct DisplayListItem
Undocumented in source.

Variables

_increment
short8 _increment;
Undocumented in source.
_mapAmpersand
__m128i _mapAmpersand;

Used for quick modulo by power of two to read maps

_tileAmpersand
int4 _tileAmpersand;

Used for quick modulo by power of two to calculate tile positions.

backbuffer
Bitmap32Bit backbuffer;

used to store current screen output

displayList
DisplayList 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.
masterVal
ubyte masterVal;

Sets the master alpha value for the layer

needsUpdate
bool needsUpdate;

Set to true if backbuffer needs an update (might be replaced with flags)

paletteOffset
ushort paletteOffset;

Offsets the palette by the given amount

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;

Transform point

transformPoints
short[4] transformPoints;

Defines how the layer is being transformed

warpMode
WarpMode warpMode;

Repeats the whole layer if set to true

Meta