Update JoeyLib Drawing Functions

Scott Duensing 2019-10-17 18:49:12 -05:00
parent d98e659546
commit 1095f5b77c

@ -18,19 +18,19 @@ Allows rapid blitting of a pre-defined arrangement of tiles to the current drawi
#### jlDrawBox #### jlDrawBox
```c ```c
void jlDrawBox(int x1, int y1, int x2, int y2); void jlDrawBox(jint16 x1, jint16 y1, jint16 x2, jint16 y2);
``` ```
Draws a hollow rectangle from (x1, y1) to (x2, y2). Draws a hollow rectangle from (`x1`, `y1`) to (`x2`, `y2`).
#### jlDrawBoxFilled #### jlDrawBoxFilled
```c ```c
void jlDrawBoxFilled(int x1, int y1, int x2, int y2); void jlDrawBoxFilled(jint16 x1, jint16 y1, jint16 x2, jint16 y2);
``` ```
Draws a hollow rectangle from (x1, y1) to (x2, y2). Draws a hollow rectangle from (`x1`, `y1`) to (`x2`, `y2`).
#### jlDrawCircle #### jlDrawCircle
```c ```c
void jlDrawCircle(int x, int y, int radius); void jlDrawCircle(jint16 x, jint16 y, jint16 radius);
``` ```
Draws a circle of the given size at the given coordinates. Unlike the majority of drawing routines, a portion of the circle may extend off the screen and will be clipped. Clipped circles are much slower to draw. Draws a circle of the given size at the given coordinates. Unlike the majority of drawing routines, a portion of the circle may extend off the screen and will be clipped. Clipped circles are much slower to draw.
@ -40,44 +40,62 @@ void jlDrawClear(void);
``` ```
Clears the back buffer to the current draw color. Clears the back buffer to the current draw color.
#### jlDrawColor #### jlDrawColorGet
```c ```c
void jlDrawColor(byte index); byte jlDrawColorGet(void);
```
Returns the index of the currently specified drawing color.
#### jlDrawColorSet
```c
void jlDrawColorSet(byte index);
``` ```
Specifies the color to use for the following draw functions. Colors are specified by their index position in the current palette. Specifies the color to use for the following draw functions. Colors are specified by their index position in the current palette.
#### jlDrawEllipse #### jlDrawEllipse
```c ```c
void jlDrawEllipse(int x1, int y1, int x2, int y2); void jlDrawEllipse(jint16 x1, jint16 y1, jint16 x2, jint16 y2);
``` ```
Draws an ellipse that fills the box represented by (x1, y1) to (x2, y2). Draws an ellipse that fills the box represented by (`x1`, `y1`) to (`x2`, `y2`).
#### jlDrawFill #### jlDrawFill
```c ```c
void jlDrawFill(int x, int y); void jlDrawFill(jint16 x, jint16 y);
``` ```
Performs a flood fill from the given coordinates. The fill will continue as long as it occupies the same color as the starting point. Performs a flood fill from the given coordinates. The fill will continue as long as it occupies the same color as the starting point.
#### jlDrawFillTo #### jlDrawFillTo
```c ```c
void jlDrawFillTo(int x, int y, byte color); void jlDrawFillTo(jint16 x, jint16 y, byte color);
``` ```
Performs a flood fill from the given coordinates. The fill will continue until it encounters pixels of `color`. Performs a flood fill from the given coordinates. The fill will continue until it encounters pixels of `color`.
#### jlDrawGetPixel #### jlDrawLine
```c ```c
byte jlDrawGetPixel(int x, int y); void jlDrawLine(jint16 x1, jint16 y1, jint16 x2, jint16 y2);
```
Draws a line from (`x1`, `y1`) to (`x2`, `y2`).
#### jlDrawPixelGet
```c
byte jlDrawPixelGet(jint16 x, jint16 y);
``` ```
Returns the color index of the specified pixel. Returns the color index of the specified pixel.
#### jlDrawLine #### jlDrawPixelSet
```c ```c
void jlDrawLine(int x1, int y1, int x2, int y2); void jlDrawPixelSet(jint16 x, jint16 y);
``` ```
Draws a line from (x1, y1) to (x2, y2). Draws a single point at location (`x`, `y`).
#### jlDrawPoint #### jlDrawSurfaceGet
```c ```c
void jlDrawPoint(int x, int y); jlSurfaceT jlDrawSurfaceGet(void);
``` ```
Draws a single point at location (x, y). Returns a pointer to the current drawing surface.
#### jlDrawSurfaceSet
```c
void jlDrawSurfaceSet(jlSurfaceT target);
```
Specifies the drawing surface for all drawing functions to use as a target. To draw to the display back buffer itself, use `JOEY_DISPLAY` as the `target`.