BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
polylib.c File Reference
#include "blitzlib.h"
#include "blitzobj.h"

Data Structures

struct  point
struct  edge

Macros

#define CHUNKY(cl)
#define BLTCON0   0x40
#define BLTCON1   0x42
#define BLTAFWM   0x44
#define BLTALWM   0x46
#define BLTCPT   0x48
#define BLTBPT   0x4c
#define BLTDPT   0x54
#define BLTSIZE   0x58
#define BLTSIZV   0x5c
#define BLTSIZH   0x5e
#define BLTCMOD   0x60
#define BLTBMOD   0x62
#define BLTDMOD   0x66
#define BLTADAT   0x74
#define CHIPW(o)
#define CHIPL(o)
#define BLITWAIT()
#define BMI_W(a, b)
#define POINTMAX   16
#define EDGEMAX   (POINTMAX - 1)

Typedefs

typedef UBYTE *(* renderfn) (WORD n, const struct point *pts, UWORD colour, UBYTE *a3)

Functions

void _chunkycls (void)
void _chunkyplot (void)
void _chunkyplotclip (void)
void _chunkyvlin (void)
void _chunkyvlinclip (void)
void _chunkypoly (void)
void _chunkypoly2 (void)
void _bitmappoly (void)
void _bitmappoly2 (void)
void _rendertobitmap (void)
void _rendertobitmap2 (void)
void _rendertochunky (void)
void _rendertochunky2 (void)
void _renderpoly (void)
void _polychk (void)
void _chunkyvlinchk (void)
void _renderpolychk (void)
static UBYTE * render_none (WORD n, const struct point *pts, UWORD colour, UBYTE *a3)
static WORD muldiv (WORD a, WORD b, WORD c)
static ULONG edge_step (ULONG pos, ULONG step, UWORD unit)
static ULONG edge_start (WORD x, UWORD unit)
static int next_edge (const struct edge **list, UWORD *lines, ULONG *step)
static UWORD * side (UWORD *list, WORD x, WORD y, const struct point *p, int dir, int right)
static UWORD * outline (UWORD n)
static UWORD * polygon (WORD n, const struct point *pts, int swap)
static void _chunkycls_c (UWORD c)
 BLITZ_ALIAS (_chunkycls, _chunkycls_c)
static UWORD * chunkypixel (const struct bb_coplist *cl, UWORD x, UWORD y)
static void _chunkyplot_c (UWORD x, UWORD y, UWORD colour)
 BLITZ_ALIAS (_chunkyplot, _chunkyplot_c)
static void _chunkyplotclip_c (WORD x, WORD y, UWORD colour)
 BLITZ_ALIAS (_chunkyplotclip, _chunkyplotclip_c)
static void chunkyvlin (const struct bb_coplist *cl, UWORD x, UWORD y1, UWORD y2, UWORD colour)
static void _chunkyvlin_c (UWORD x, UWORD y1, UWORD y2, UWORD colour)
 BLITZ_ALIAS (_chunkyvlin, _chunkyvlin_c)
static void _chunkyvlinclip_c (WORD x, WORD y1, WORD y2, UWORD colour)
 BLITZ_ALIAS (_chunkyvlinclip, _chunkyvlinclip_c)
static UBYTE * chunkypoly (WORD n, const struct point *pts, UWORD colour, struct bb_coplist *cl, int cpu)
static void _chunkypoly_c (WORD n, ULONG pts, UWORD colour)
 BLITZ_ALIAS (_chunkypoly, _chunkypoly_c)
static void _chunkypoly2_c (WORD n, ULONG pts, UWORD colour)
 BLITZ_ALIAS (_chunkypoly2, _chunkypoly2_c)
static int span (ULONG left, ULONG right, UWORD rtclip, UWORD *first, UWORD *words)
static UBYTE * bitmappoly (WORD n, const struct point *pts, UWORD colour, struct bb_bitmap *bm)
static UBYTE * bitmappoly_dither (WORD n, const struct point *pts, UWORD colour, struct bb_bitmap *bm, struct bb_bitmap *dither)
static void _bitmappoly_c (WORD n, ULONG pts, UWORD colour)
 BLITZ_ALIAS (_bitmappoly, _bitmappoly_c)
static void _bitmappoly2_c (WORD n, ULONG pts, UWORD colour, struct bb_bitmap *dither)
 BLITZ_ALIAS (_bitmappoly2, _bitmappoly2_c)
static UBYTE * render_bitmap (WORD n, const struct point *pts, UWORD colour, UBYTE *a3)
static UBYTE * render_dither (WORD n, const struct point *pts, UWORD colour, UBYTE *a3)
static UBYTE * render_chunky (WORD n, const struct point *pts, UWORD colour, UBYTE *a3)
static void _rendertobitmap_c (struct bb_bitmap *bm)
 BLITZ_ALIAS (_rendertobitmap, _rendertobitmap_c)
static void _rendertobitmap2_c (struct bb_bitmap *bm, struct bb_bitmap *dither)
 BLITZ_ALIAS (_rendertobitmap2, _rendertobitmap2_c)
static void _rendertochunky_c (struct bb_coplist *cl)
 BLITZ_ALIAS (_rendertochunky, _rendertochunky_c)
static void _rendertochunky2_c (UWORD split, UBYTE *cl)
 BLITZ_ALIAS (_rendertochunky2, _rendertochunky2_c)
static void _renderpoly_c (WORD n, ULONG pts, UWORD colour)
 BLITZ_ALIAS (_renderpoly, _renderpoly_c)
static void _polychk_c (WORD n)
static void _chunkyvlinchk_c (WORD y1, WORD y2)
static void _renderpolychk_c (WORD n, UWORD colour)

Variables

static const UWORD cols [15]
static renderfn polyvector = render_none
static struct bb_bitmap * bmap0
static struct bb_bitmap * bmap1
static struct bb_coplist * chunk0
static struct point polypts [2 *POINTMAX]
struct { 
   UWORD   width 
   UWORD   height 
   struct { 
      WORD   left 
      WORD   y 
      WORD   right 
   }   top
   UWORD   ledges [EDGEMAX *3+2] 
   UWORD   redges [EDGEMAX *3+2] 
} pv
static const UWORD lup1 [16]
static const UWORD lup2 [16]

Macro Definition Documentation

◆ BLITWAIT

#define BLITWAIT ( )
Value:
#define BL_BLITWAIT(cb)
Definition blitzhelp.h:172
#define BL_CUSTOM
Definition blitzhelp.h:165

◆ BLTADAT

#define BLTADAT   0x74

◆ BLTAFWM

#define BLTAFWM   0x44

◆ BLTALWM

#define BLTALWM   0x46

◆ BLTBMOD

#define BLTBMOD   0x62

◆ BLTBPT

#define BLTBPT   0x4c

◆ BLTCMOD

#define BLTCMOD   0x60

◆ BLTCON0

#define BLTCON0   0x40

◆ BLTCON1

#define BLTCON1   0x42

◆ BLTCPT

#define BLTCPT   0x48

◆ BLTDMOD

#define BLTDMOD   0x66

◆ BLTDPT

#define BLTDPT   0x54

◆ BLTSIZE

#define BLTSIZE   0x58

◆ BLTSIZH

#define BLTSIZH   0x5e

◆ BLTSIZV

#define BLTSIZV   0x5c

◆ BMI_W

#define BMI_W ( a,
b )
Value:
((WORD)((a) - (b)) < 0)

◆ CHIPL

#define CHIPL ( o)
Value:
#define BL_CUSTOML(cb, o)
Definition blitzhelp.h:167

◆ CHIPW

#define CHIPW ( o)
Value:
#define BL_CUSTOMW(cb, o)
Definition blitzhelp.h:166

◆ CHUNKY

#define CHUNKY ( cl)
Value:
(*(UBYTE *const *)&(cl)->cchunky)

◆ EDGEMAX

#define EDGEMAX   (POINTMAX - 1)

◆ POINTMAX

#define POINTMAX   16

Typedef Documentation

◆ renderfn

typedef UBYTE *(* renderfn) (WORD n, const struct point *pts, UWORD colour, UBYTE *a3)

Function Documentation

◆ _bitmappoly()

void _bitmappoly ( void )

◆ _bitmappoly2()

void _bitmappoly2 ( void )

◆ _bitmappoly2_c()

void _bitmappoly2_c ( WORD n,
ULONG pts,
UWORD colour,
struct bb_bitmap * dither )
static

◆ _bitmappoly_c()

void _bitmappoly_c ( WORD n,
ULONG pts,
UWORD colour )
static

◆ _chunkycls()

void _chunkycls ( void )

◆ _chunkycls_c()

void _chunkycls_c ( UWORD c)
static

◆ _chunkyplot()

void _chunkyplot ( void )

◆ _chunkyplot_c()

void _chunkyplot_c ( UWORD x,
UWORD y,
UWORD colour )
static

◆ _chunkyplotclip()

void _chunkyplotclip ( void )

◆ _chunkyplotclip_c()

void _chunkyplotclip_c ( WORD x,
WORD y,
UWORD colour )
static

◆ _chunkypoly()

void _chunkypoly ( void )

◆ _chunkypoly2()

void _chunkypoly2 ( void )

◆ _chunkypoly2_c()

void _chunkypoly2_c ( WORD n,
ULONG pts,
UWORD colour )
static

◆ _chunkypoly_c()

void _chunkypoly_c ( WORD n,
ULONG pts,
UWORD colour )
static

◆ _chunkyvlin()

void _chunkyvlin ( void )

◆ _chunkyvlin_c()

void _chunkyvlin_c ( UWORD x,
UWORD y1,
UWORD y2,
UWORD colour )
static

◆ _chunkyvlinchk()

void _chunkyvlinchk ( void )

◆ _chunkyvlinchk_c()

void _chunkyvlinchk_c ( WORD y1,
WORD y2 )
static

◆ _chunkyvlinclip()

void _chunkyvlinclip ( void )

◆ _chunkyvlinclip_c()

void _chunkyvlinclip_c ( WORD x,
WORD y1,
WORD y2,
UWORD colour )
static

◆ _polychk()

void _polychk ( void )

◆ _polychk_c()

void _polychk_c ( WORD n)
static

◆ _renderpoly()

void _renderpoly ( void )

◆ _renderpoly_c()

void _renderpoly_c ( WORD n,
ULONG pts,
UWORD colour )
static

◆ _renderpolychk()

void _renderpolychk ( void )

◆ _renderpolychk_c()

void _renderpolychk_c ( WORD n,
UWORD colour )
static

◆ _rendertobitmap()

void _rendertobitmap ( void )

◆ _rendertobitmap2()

void _rendertobitmap2 ( void )

◆ _rendertobitmap2_c()

void _rendertobitmap2_c ( struct bb_bitmap * bm,
struct bb_bitmap * dither )
static

◆ _rendertobitmap_c()

void _rendertobitmap_c ( struct bb_bitmap * bm)
static

◆ _rendertochunky()

void _rendertochunky ( void )

◆ _rendertochunky2()

void _rendertochunky2 ( void )

◆ _rendertochunky2_c()

void _rendertochunky2_c ( UWORD split,
UBYTE * cl )
static

◆ _rendertochunky_c()

void _rendertochunky_c ( struct bb_coplist * cl)
static

◆ bitmappoly()

UBYTE * bitmappoly ( WORD n,
const struct point * pts,
UWORD colour,
struct bb_bitmap * bm )
static

◆ bitmappoly_dither()

UBYTE * bitmappoly_dither ( WORD n,
const struct point * pts,
UWORD colour,
struct bb_bitmap * bm,
struct bb_bitmap * dither )
static

◆ BLITZ_ALIAS() [1/14]

BLITZ_ALIAS ( _bitmappoly ,
_bitmappoly_c  )

◆ BLITZ_ALIAS() [2/14]

BLITZ_ALIAS ( _bitmappoly2 ,
_bitmappoly2_c  )

◆ BLITZ_ALIAS() [3/14]

BLITZ_ALIAS ( _chunkycls ,
_chunkycls_c  )

◆ BLITZ_ALIAS() [4/14]

BLITZ_ALIAS ( _chunkyplot ,
_chunkyplot_c  )

◆ BLITZ_ALIAS() [5/14]

BLITZ_ALIAS ( _chunkyplotclip ,
_chunkyplotclip_c  )

◆ BLITZ_ALIAS() [6/14]

BLITZ_ALIAS ( _chunkypoly ,
_chunkypoly_c  )

◆ BLITZ_ALIAS() [7/14]

BLITZ_ALIAS ( _chunkypoly2 ,
_chunkypoly2_c  )

◆ BLITZ_ALIAS() [8/14]

BLITZ_ALIAS ( _chunkyvlin ,
_chunkyvlin_c  )

◆ BLITZ_ALIAS() [9/14]

BLITZ_ALIAS ( _chunkyvlinclip ,
_chunkyvlinclip_c  )

◆ BLITZ_ALIAS() [10/14]

BLITZ_ALIAS ( _renderpoly ,
_renderpoly_c  )

◆ BLITZ_ALIAS() [11/14]

BLITZ_ALIAS ( _rendertobitmap ,
_rendertobitmap_c  )

◆ BLITZ_ALIAS() [12/14]

BLITZ_ALIAS ( _rendertobitmap2 ,
_rendertobitmap2_c  )

◆ BLITZ_ALIAS() [13/14]

BLITZ_ALIAS ( _rendertochunky ,
_rendertochunky_c  )

◆ BLITZ_ALIAS() [14/14]

BLITZ_ALIAS ( _rendertochunky2 ,
_rendertochunky2_c  )

◆ chunkypixel()

UWORD * chunkypixel ( const struct bb_coplist * cl,
UWORD x,
UWORD y )
static

◆ chunkypoly()

UBYTE * chunkypoly ( WORD n,
const struct point * pts,
UWORD colour,
struct bb_coplist * cl,
int cpu )
static

◆ chunkyvlin()

void chunkyvlin ( const struct bb_coplist * cl,
UWORD x,
UWORD y1,
UWORD y2,
UWORD colour )
static

◆ edge_start()

ULONG edge_start ( WORD x,
UWORD unit )
static

◆ edge_step()

ULONG edge_step ( ULONG pos,
ULONG step,
UWORD unit )
static

◆ muldiv()

WORD muldiv ( WORD a,
WORD b,
WORD c )
static

◆ next_edge()

int next_edge ( const struct edge ** list,
UWORD * lines,
ULONG * step )
static

◆ outline()

UWORD * outline ( UWORD n)
static

◆ polygon()

UWORD * polygon ( WORD n,
const struct point * pts,
int swap )
static

◆ render_bitmap()

UBYTE * render_bitmap ( WORD n,
const struct point * pts,
UWORD colour,
UBYTE * a3 )
static

◆ render_chunky()

UBYTE * render_chunky ( WORD n,
const struct point * pts,
UWORD colour,
UBYTE * a3 )
static

◆ render_dither()

UBYTE * render_dither ( WORD n,
const struct point * pts,
UWORD colour,
UBYTE * a3 )
static

◆ render_none()

UBYTE * render_none ( WORD n,
const struct point * pts,
UWORD colour,
UBYTE * a3 )
static

◆ side()

UWORD * side ( UWORD * list,
WORD x,
WORD y,
const struct point * p,
int dir,
int right )
static

◆ span()

int span ( ULONG left,
ULONG right,
UWORD rtclip,
UWORD * first,
UWORD * words )
static

Variable Documentation

◆ bmap0

struct bb_bitmap* bmap0
static

◆ bmap1

struct bb_bitmap * bmap1
static

◆ chunk0

struct bb_coplist* chunk0
static

◆ cols

const UWORD cols[15]
static
Initial value:
= {
0, 0xf00, 0x0f0, 0x00f, 0xa40, 0x028, 0xfff, 0xf80,
0x840, 0x8f4, 0x84f, 0x248, 0x488, 0x888, 0xf88,
}

◆ height

UWORD height

◆ ledges

UWORD ledges[EDGEMAX *3+2]

◆ left

WORD left

◆ lup1

const UWORD lup1[16]
static
Initial value:
= {
0xffff, 0x7fff, 0x3fff, 0x1fff, 0x0fff, 0x07ff, 0x03ff, 0x01ff,
0x00ff, 0x007f, 0x003f, 0x001f, 0x000f, 0x0007, 0x0003, 0x0001,
}

◆ lup2

const UWORD lup2[16]
static
Initial value:
= {
0x8000, 0xc000, 0xe000, 0xf000, 0xf800, 0xfc00, 0xfe00, 0xff00,
0xff80, 0xffc0, 0xffe0, 0xfff0, 0xfff8, 0xfffc, 0xfffe, 0xffff,
}

◆ polypts

struct point polypts[2 *POINTMAX]
static

◆ polyvector

renderfn polyvector = render_none
static

◆ [struct]

struct { ... } pv

◆ redges

UWORD redges[EDGEMAX *3+2]

◆ right

WORD right

◆ [struct]

struct { ... } top

◆ width

UWORD width

◆ y

WORD y