OldSchool Library
Advanced

Topics

 Images
 
 Low level drawing
 

Functions

void oslSwizzleTexture (u8 *out, const u8 *in, unsigned int width, unsigned int height)
 Swizzles texture data.
 
void oslUnswizzleTexture (u8 *out, const u8 *in, unsigned int width, unsigned int height)
 Unswizzles texture data.
 
void oslDrawTile (int u, int v, int x, int y, int tX, int tY)
 Draws a tile from the currently selected texture at the specified position.
 

Detailed Description

Advanced drawing tasks.

Function Documentation

◆ oslSwizzleTexture()

void oslSwizzleTexture ( u8 * out,
const u8 * in,
unsigned int width,
unsigned int height )
extern

Swizzles texture data.

This function performs a swizzling operation on texture data. Swizzling is a process that reorders texture data to improve memory access patterns, often used for better performance on specific hardware. The function takes an input texture and writes the swizzled output to the provided buffer.

@param out Pointer to the buffer where the swizzled texture data will be stored.
@param in Pointer to the input texture data.
@param width The width of the texture in pixels.
@param height The height of the texture in pixels.

◆ oslUnswizzleTexture()

void oslUnswizzleTexture ( u8 * out,
const u8 * in,
unsigned int width,
unsigned int height )
extern

Unswizzles texture data.

This function performs the inverse of the swizzling operation. It converts texture data that has been swizzled back into its original order. The function takes a swizzled texture and writes the unswizzled output to the provided buffer.

@param out Pointer to the buffer where the unswizzled texture data will be stored.
@param in Pointer to the swizzled texture data.
@param width The width of the texture in pixels.
@param height The height of the texture in pixels.

◆ oslDrawTile()

void oslDrawTile ( int u,
int v,
int x,
int y,
int tX,
int tY )
extern

Draws a tile from the currently selected texture at the specified position.

This function draws a rectangular section (tile) from the currently bound texture to a specified position on the screen. The tile is defined by its top-left corner (u, v) and its size (tX, tY). The destination position on the screen is specified by (x, y).

Note
This function is deprecated and should not be used in new code. It may be removed in future versions.
Parameters
uThe x-coordinate of the top-left corner of the tile in the texture.
vThe y-coordinate of the top-left corner of the tile in the texture.
xThe x-coordinate of the position on the screen where the tile will be drawn.
yThe y-coordinate of the position on the screen where the tile will be drawn.
tXThe width of the tile.
tYThe height of the tile.