Constructor. tX , tY : Set the size of the tiles on the layer.
Adds a tile to the tileSet. t : The tile. id : The ID in wchar to differentiate between different tiles.
Returns a tile from the displaylist
Returns the currently used warp mode.
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
Gets the the ID of the given element from the mapping. x , y : Position.
Removes the tile with the ID from the set.
Sets the warp mode. Returns the new warp mode that is being used.
Returns which tile is at the given pixel
Writes to the map. x , y : Position. w : ID of the tile.
Writes a text to the map. This function is a bit rudamentary, as it doesn't handle word breaks, and needs per-line writing. Requires the text to be in 16 bit format
Implements a single tile to be displayed. Is ordered in a BinarySearchTree for fast lookup.
displaylist using a BST to allow skipping elements
Emulates horizontal blanking interrupt effects, like per-line scrolling. line no -1 indicates that no lines have been drawn yet.
Map width
Map height
Contains the mapping data
Sets the master alpha value for the layer
Enables the TileLayer to access other parts of the palette if needed. Does not effect 16 bit bitmaps, but effects all 4 and 8 bit bitmap within the layer, so use with caution to avoid memory leakages.
Local buffer
Tile width
Tile height
Total width of the tilelayer in pixels
Total height of the tilelayer in pixels
Sets the warp mode of the layer. Can repeat the whole layer, a single tile, or be turned off completely.
Used to implement changeable renderers for each layers
Horizontal scroll position
Vertical scroll position
Raster width (visible)
Haster height
Sets up the layer for the current rasterizer.
Sets the global rendering mode for this layer.
Scrolls the layer to the given position.
Relatively scrolls the layer by the given amount. Formula is: [sX,sY] = [sX,sY] + [x,y]
Getter for the X scroll position.
Getter for the Y scroll position.
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.
Returns the type of the layer. Useful with certain scripting languages.
Standard algorithm for horizontal mirroring, used for tile mirroring