libtonc
16bpp bitmap surfaces

Functions

u32 sbmp16_get_pixel (const TSurface *src, int x, int y)
 Get the pixel value of src at (x, y).
 
void sbmp16_plot (const TSurface *dst, int x, int y, u32 clr)
 Plot a single pixel on a 16-bit buffer.
 
void sbmp16_hline (const TSurface *dst, int x1, int y, int x2, u32 clr)
 Draw a horizontal line on an 16bit buffer.
 
void sbmp16_vline (const TSurface *dst, int x, int y1, int y2, u32 clr)
 Draw a vertical line on an 16bit buffer.
 
void sbmp16_line (const TSurface *dst, int x1, int y1, int x2, int y2, u32 clr)
 Draw a line on an 16bit buffer.
 
void sbmp16_rect (const TSurface *dst, int left, int top, int right, int bottom, u32 clr)
 Draw a rectangle in 16bit mode.
 
void sbmp16_frame (const TSurface *dst, int left, int top, int right, int bottom, u32 clr)
 Draw a rectangle in 16bit mode.
 
void sbmp16_blit (const TSurface *dst, int dstX, int dstY, uint width, uint height, const TSurface *src, int srcX, int srcY)
 16bpp blitter. Copies a rectangle from one surface to another.
 
void sbmp16_floodfill (const TSurface *dst, int x, int y, u32 clr)
 Floodfill an area of the same color with new color clr.
 
INLINE void _sbmp16_plot (const TSurface *dst, int x, int y, u32 clr)
 Plot a single pixel on a 16-bit buffer; inline version.
 
INLINE u32 _sbmp16_get_pixel (const TSurface *src, int x, int y)
 Get the pixel value of src at (x, y); inline version.
 

Detailed Description

Routines for 16bpp linear surfaces. For use in modes 3 and 5. Can also be used for regular tilemaps to a point.

Function Documentation

◆ sbmp16_blit()

void sbmp16_blit ( const TSurface *  dst,
int  dstX,
int  dstY,
uint  width,
uint  height,
const TSurface *  src,
int  srcX,
int  srcY 
)

16bpp blitter. Copies a rectangle from one surface to another.

Parameters
dstDestination surface.
dstXLeft coord of rectangle on dst.
dstYTop coord of rectangle on dst.
widthWidth of rectangle to blit.
heightHeight of rectangle to blit.
srcSource surface.
srcXLeft coord of rectangle on src.
srcYTop coord of rectangle on src.
Note
The rectangle will be clipped to both src and dst.

References memcpy16().

◆ sbmp16_floodfill()

void sbmp16_floodfill ( const TSurface *  dst,
int  x,
int  y,
u32  clr 
)

Floodfill an area of the same color with new color clr.

Parameters
dstDestination surface.
xX-coordinate.
yY-coordinate;
clrColor.

References sbmp16_floodfill_internal().

◆ sbmp16_frame()

void sbmp16_frame ( const TSurface *  dst,
int  left,
int  top,
int  right,
int  bottom,
u32  clr 
)

Draw a rectangle in 16bit mode.

Parameters
dstDestination surface.
leftLeft side of rectangle;
topTop side of rectangle.
rightRight side of rectangle.
bottomBottom side of rectangle.
clrColor.
Note
Does normalization, but not bounds checks.
PONDER: RB in- or exclusive?

References memset16().

◆ sbmp16_hline()

void sbmp16_hline ( const TSurface *  dst,
int  x1,
int  y,
int  x2,
u32  clr 
)

Draw a horizontal line on an 16bit buffer.

Parameters
dstDestination surface.
x1First X-coord.
yY-coord.
x2Second X-coord.
clrColor.
Note
Does normalization, but not bounds checks.

References memset16().

◆ sbmp16_line()

void sbmp16_line ( const TSurface *  dst,
int  x1,
int  y1,
int  x2,
int  y2,
u32  clr 
)

Draw a line on an 16bit buffer.

Parameters
dstDestination surface.
x1First X-coord.
y1First Y-coord.
x2Second X-coord.
y2Second Y-coord.
clrColor.
Note
Does normalization, but not bounds checks.

◆ sbmp16_plot()

void sbmp16_plot ( const TSurface *  dst,
int  x,
int  y,
u32  clr 
)

Plot a single pixel on a 16-bit buffer.

Parameters
dstDestination surface.
xX-coord.
yY-coord.
clrColor.
Note
Slow as fuck. Inline plotting functionality if possible.

◆ sbmp16_rect()

void sbmp16_rect ( const TSurface *  dst,
int  left,
int  top,
int  right,
int  bottom,
u32  clr 
)

Draw a rectangle in 16bit mode.

Parameters
dstDestination surface.
leftLeft side of rectangle;
topTop side of rectangle.
rightRight side of rectangle.
bottomBottom side of rectangle.
clrColor.
Note
Does normalization, but not bounds checks.

References memset16().

Referenced by bmp16_erase(), and se_erase().

◆ sbmp16_vline()

void sbmp16_vline ( const TSurface *  dst,
int  x,
int  y1,
int  y2,
u32  clr 
)

Draw a vertical line on an 16bit buffer.

Parameters
dstDestination surface.
xX-coord.
y1First Y-coord.
y2Second Y-coord.
clrColor.
Note
Does normalization, but not bounds checks.