maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
RetroFlat Soft Shapes API

Tools for drawing shape primatives. More...

Files

file  retrosft.h
 Tools for drawing shape primatives.
 

Macros

#define RETROFLAT_LINE_X   0
 
#define RETROFLAT_LINE_Y   1
 
#define RETROSOFT_TRACE_LVL   0
 

Functions

void retrosoft_line (retroflat_blit_t *target, RETROFLAT_COLOR color, int x1, int y1, int x2, int y2, uint8_t flags)
 Draw a line from x1, y1 to x2, y2.
 
void retrosoft_rect (retroflat_blit_t *target, const RETROFLAT_COLOR color_idx, int x, int y, int w, int h, uint8_t flags)
 Draw a rectangle at the given coordinates, with the given dimensions.
 
void retrosoft_ellipse (retroflat_blit_t *target, RETROFLAT_COLOR color, int x, int y, int w, int h, uint8_t flags)
 Draw an ellipsoid at the given coordinates, with the given dimensions.
 

Detailed Description

Tools for drawing shape primatives.

This library is also used in conjunction with retro3D, in order to manipulate texture bitmaps.

Function Documentation

◆ retrosoft_ellipse()

void retrosoft_ellipse ( retroflat_blit_t * target,
RETROFLAT_COLOR color,
int x,
int y,
int w,
int h,
uint8_t flags )

Draw an ellipsoid at the given coordinates, with the given dimensions.

Todo
Right now this uses integer polar coordinates; it needs to be redone to use the Midpoint circle algorithm or similar.
Warning
This function does not check if supplied bitmaps are read-only! Such checks should be performed by wrapper functions calling it!

◆ retrosoft_line()

void retrosoft_line ( retroflat_blit_t * target,
RETROFLAT_COLOR color,
int x1,
int y1,
int x2,
int y2,
uint8_t flags )

Draw a line from x1, y1 to x2, y2.

Warning
This function does not check if supplied bitmaps are read-only! Such checks should be performed by wrapper functions calling it!

◆ retrosoft_rect()

void retrosoft_rect ( retroflat_blit_t * target,
const RETROFLAT_COLOR color_idx,
int x,
int y,
int w,
int h,
uint8_t flags )

Draw a rectangle at the given coordinates, with the given dimensions.

Warning
This function does not check if supplied bitmaps are read-only! Such checks should be performed by wrapper functions calling it!