libtonc
tonc_sbmp16.c File Reference
#include "tonc_surface.h"
#include "tonc_video.h"

Macros

#define PXSIZE   sizeof(pixel_t)
 
#define PXPTR(psrf, x, y)    (pixel_t*)(psrf->data + (y)*psrf->pitch + (x)*sizeof(pixel_t) )
 
#define BLIT_CLIP(_ax, _aw, _w, _bx)
 

Typedefs

typedef u16 pixel_t
 

Functions

void sbmp16_floodfill_internal (const TSurface *dst, int x, int y, pixel_t clrNew, pixel_t clrOld)
 Internal routine for floodfill.
 
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.
 

Variables

const TSurface m3_surface
 
EWRAM_DATA TSurface m5_surface
 
const TSurfaceProcTab bmp16_tab
 

Detailed Description

Author
J Vijn
Date
20080120 - 20080128
Todo:
Code consistency.

Macro Definition Documentation

◆ BLIT_CLIP

#define BLIT_CLIP (   _ax,
  _aw,
  _w,
  _bx 
)
Value:
do { \
if( (_ax) >= (_aw) || (_ax)+(_w) <= 0 ) \
return; \
if( (_ax)<0 ) \
{ _w += (_ax); _bx += (_ax); _ax= 0; } \
if( (_w) > (_aw)-(_ax) ) \
_w = (_aw)-(_ax); \
} while(0)

Variable Documentation

◆ bmp16_tab

const TSurfaceProcTab bmp16_tab
Initial value:
=
{
"bmp16",
}
void sbmp16_plot(const TSurface *dst, int x, int y, u32 clr)
Plot a single pixel on a 16-bit buffer.
Definition tonc_sbmp16.c:74
void sbmp16_rect(const TSurface *dst, int left, int top, int right, int bottom, u32 clr)
Draw a rectangle in 16bit mode.
Definition tonc_sbmp16.c:205
void sbmp16_frame(const TSurface *dst, int left, int top, int right, int bottom, u32 clr)
Draw a rectangle in 16bit mode.
Definition tonc_sbmp16.c:234
void sbmp16_hline(const TSurface *dst, int x1, int y, int x2, u32 clr)
Draw a horizontal line on an 16bit buffer.
Definition tonc_sbmp16.c:89
u32 sbmp16_get_pixel(const TSurface *src, int x, int y)
Get the pixel value of src at (x, y).
Definition tonc_sbmp16.c:61
void sbmp16_line(const TSurface *dst, int x1, int y1, int x2, int y2, u32 clr)
Draw a line on an 16bit buffer.
Definition tonc_sbmp16.c:135
void sbmp16_vline(const TSurface *dst, int x, int y1, int y2, u32 clr)
Draw a vertical line on an 16bit buffer.
Definition tonc_sbmp16.c:109
void sbmp16_floodfill(const TSurface *dst, int x, int y, u32 clr)
Floodfill an area of the same color with new color clr.
Definition tonc_sbmp16.c:330
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.
Definition tonc_sbmp16.c:278

◆ m3_surface

const TSurface m3_surface
Initial value:
=
{
(u8*)m3_mem , M3_WIDTH*2, M3_WIDTH, M3_HEIGHT, SRF_BMP16, 16,
0, NULL
}
#define m3_mem
Mode 3 frame as a matrix.
Definition tonc_memmap.h:190
@ SRF_BMP16
16bpp linear (bitmap/tilemap).
Definition tonc_surface.h:120

Referenced by tte_init_bmp().

◆ m5_surface

EWRAM_DATA TSurface m5_surface
Initial value:
=
{
(u8*)m5_mem , M5_WIDTH*2, M5_WIDTH, M5_HEIGHT, SRF_BMP16, 16,
0, NULL
}
#define m5_mem
Mode 5 first page as a matrix.
Definition tonc_memmap.h:202

Referenced by tte_init_bmp().