From 1095f5b77cb24c13266768b6224107da0d3ed141 Mon Sep 17 00:00:00 2001 From: Scott Duensing Date: Thu, 17 Oct 2019 18:49:12 -0500 Subject: [PATCH] Update JoeyLib Drawing Functions --- JoeyLib-Drawing-Functions.md | 56 ++++++++++++++++++++++++------------ 1 file changed, 37 insertions(+), 19 deletions(-) diff --git a/JoeyLib-Drawing-Functions.md b/JoeyLib-Drawing-Functions.md index 6d41541..db8aa85 100644 --- a/JoeyLib-Drawing-Functions.md +++ b/JoeyLib-Drawing-Functions.md @@ -18,19 +18,19 @@ Allows rapid blitting of a pre-defined arrangement of tiles to the current drawi #### jlDrawBox ```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 ```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 ```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. @@ -40,44 +40,62 @@ void jlDrawClear(void); ``` Clears the back buffer to the current draw color. -#### jlDrawColor +#### jlDrawColorGet ```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. #### jlDrawEllipse ```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 ```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. #### jlDrawFillTo ```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`. -#### jlDrawGetPixel +#### jlDrawLine ```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. -#### jlDrawLine +#### jlDrawPixelSet ```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 -void jlDrawPoint(int x, int y); +jlSurfaceT jlDrawSurfaceGet(void); ``` -Draws a single point at location (x, y). \ No newline at end of file +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`.