Texturing Notes - 04/06/07
Each level texture object is associated with a texture either contained within a Lemmings Texture Archive (.LTA), or packed within the level data.
Level texture objects are rendered pixel by pixel by starting at the top left of the texture object using texture coordinates TOX, TOY (Texture origin x, y), and advancing across the texture object in units of TSX, TSY (Texture scale x, y) per pixel.
Texture space is measured in 24.8 signed fixed point: each pixel of a texture at normal scaling will advance 1 << 8 through texture space per pixel. It is possible for a level texture object to have a negative TSX or TSY. In this case, the texture will appear mirrored when rendered. Texture space loops infinitely in all directions.
The sole image in the top right shows the brick texture source image.
The image in the top left of the square shows the texture looped four times in each direction using 1 << 8 for both TSX and TSY.
The image in the top right shows the texture looped twice in the x direction, and four times in the y direction using 1 << 7 for TSX and 1 << 8 for TSY.
The image in the top right shows the texture looped four times in the x direction, and twice in the y direction using 1 << 8 for TSX and 1 << 7 for TSY.
The image in the top right shows the texture looped twice in each direction using 1 << 7 for TSX and 1 << 7 for TSY.
Textures are series of raw values from 0x0 to 0xF for 16 colour textures, and 0x00 to 0xFF for 256 colour textures. For 16 colour textures, the first pixel is stored in the low byte.
Colour zero is defined as transparent. However, this can be overridden as any texture colours can be have colour zero mapped to them in Lemmings DS Builder.