libtonc
tonc_sbmp8.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 u8 pixel_t
 

Functions

void sbmp8_floodfill_internal (const TSurface *dst, int x, int y, u8 clrNew, u8 clrOld)
 
u32 sbmp8_get_pixel (const TSurface *src, int x, int y)
 Get the pixel value of src at (x, y).
 
void sbmp8_plot (const TSurface *dst, int x, int y, u32 clr)
 Plot a single pixel on a 8-bit buffer.
 
void sbmp8_hline (const TSurface *dst, int x1, int y, int x2, u32 clr)
 Draw a horizontal line on an 8-bit buffer.
 
void sbmp8_vline (const TSurface *dst, int x, int y1, int y2, u32 clr)
 Draw a vertical line on an 8-bit buffer.
 
void sbmp8_line (const TSurface *dst, int x1, int y1, int x2, int y2, u32 clr)
 Draw a line on an 8-bit buffer.
 
void sbmp8_rect (const TSurface *dst, int left, int top, int right, int bottom, u32 clr)
 Draw a rectangle in 8-bit mode.
 
void sbmp8_frame (const TSurface *dst, int left, int top, int right, int bottom, u32 clr)
 Draw a rectangle in 8-bit mode.
 
void sbmp8_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 sbmp8_floodfill (const TSurface *dst, int x, int y, u32 clr)
 Floodfill an area of the same color with new color clr.
 
void sbmp8_floodfill_internal (const TSurface *dst, int x, int y, pixel_t clrNew, pixel_t clrOld)
 Internal routine for floodfill.
 

Variables

EWRAM_DATA TSurface m4_surface
 
const TSurfaceProcTab bmp8_tab
 

Detailed Description

Author
J Vijn
Date
20080127 - 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

◆ bmp8_tab

const TSurfaceProcTab bmp8_tab
Initial value:
=
{
"bmp8",
}
void sbmp8_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_sbmp8.c:314
void sbmp8_frame(const TSurface *dst, int left, int top, int right, int bottom, u32 clr)
Draw a rectangle in 8-bit mode.
Definition tonc_sbmp8.c:277
void sbmp8_rect(const TSurface *dst, int left, int top, int right, int bottom, u32 clr)
Draw a rectangle in 8-bit mode.
Definition tonc_sbmp8.c:248
void sbmp8_floodfill(const TSurface *dst, int x, int y, u32 clr)
Floodfill an area of the same color with new color clr.
Definition tonc_sbmp8.c:366
u32 sbmp8_get_pixel(const TSurface *src, int x, int y)
Get the pixel value of src at (x, y).
Definition tonc_sbmp8.c:53
void sbmp8_vline(const TSurface *dst, int x, int y1, int y2, u32 clr)
Draw a vertical line on an 8-bit buffer.
Definition tonc_sbmp8.c:105
void sbmp8_hline(const TSurface *dst, int x1, int y, int x2, u32 clr)
Draw a horizontal line on an 8-bit buffer.
Definition tonc_sbmp8.c:87
void sbmp8_line(const TSurface *dst, int x1, int y1, int x2, int y2, u32 clr)
Draw a line on an 8-bit buffer.
Definition tonc_sbmp8.c:140
void sbmp8_plot(const TSurface *dst, int x, int y, u32 clr)
Plot a single pixel on a 8-bit buffer.
Definition tonc_sbmp8.c:67

◆ m4_surface

EWRAM_DATA TSurface m4_surface
Initial value:
=
{
(u8*)m4_mem, M4_WIDTH, M4_WIDTH, M4_HEIGHT, SRF_BMP8, 8,
}
#define pal_bg_mem
Background palette.
Definition tonc_memmap.h:119
#define m4_mem
Mode 4 first page as a matrix.
Definition tonc_memmap.h:197
@ SRF_BMP8
8bpp linear (bitmap/tilemap).
Definition tonc_surface.h:121

Referenced by tte_init_bmp().