mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-12-22 18:39:18 +00:00
Add GRRLIB_Ellipse
Thanks to HTV04 for the idea.
This commit is contained in:
parent
6c8f733566
commit
659ff0b86d
8 changed files with 131 additions and 75 deletions
2
.github/workflows/doc.yml
vendored
2
.github/workflows/doc.yml
vendored
|
@ -29,7 +29,7 @@ jobs:
|
|||
mv latex/refman.pdf html/PDF-documentation.pdf
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: JamesIves/github-pages-deploy-action@v4.3.3
|
||||
uses: JamesIves/github-pages-deploy-action@v4
|
||||
with:
|
||||
branch: gh-pages
|
||||
folder: html
|
||||
|
|
|
@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
- Fixed compatibility issues with devkitPPC release 39.
|
||||
- Added `GRRLIB_LoadTTFFromFile()` to load a TTF from a file.
|
||||
- Added `GRRLIB_Ellipse()` to draw an ellipse.
|
||||
- Fixed documentation for `GRRLIB_Camera3dSettings()`, `GRRLIB_Screen2Texture()` and `GRRLIB_CompoEnd()`.
|
||||
|
||||
## [4.4.1] - 2021-03-05
|
||||
|
|
|
@ -25,16 +25,17 @@ THE SOFTWARE.
|
|||
#include <grrlib.h>
|
||||
|
||||
/**
|
||||
* Draw a circle.
|
||||
* Draw an ellipse.
|
||||
* @author Dark_Link
|
||||
* @param x Specifies the x-coordinate of the circle.
|
||||
* @param y Specifies the y-coordinate of the circle.
|
||||
* @param radius The radius of the circle.
|
||||
* @param color The color of the circle in RGBA format.
|
||||
* @param filled Set to @c true to fill the circle.
|
||||
* @param x Specifies the x-coordinate of the ellipse.
|
||||
* @param y Specifies the y-coordinate of the ellipse.
|
||||
* @param radiusX The X radius of the ellipse.
|
||||
* @param radiusY The Y radius of the ellipse.
|
||||
* @param color The color of the ellipse in RGBA format.
|
||||
* @param filled Set to @c true to fill the ellipse.
|
||||
*/
|
||||
void GRRLIB_Circle (const f32 x, const f32 y, const f32 radius,
|
||||
const u32 color, const u8 filled) {
|
||||
void GRRLIB_Ellipse (const f32 x, const f32 y, const f32 radiusX,
|
||||
const f32 radiusY, const u32 color, const u8 filled) {
|
||||
guVector v[36];
|
||||
u32 ncolor[36];
|
||||
const f32 G_DTOR = M_DTOR * 10;
|
||||
|
@ -42,8 +43,8 @@ void GRRLIB_Circle (const f32 x, const f32 y, const f32 radius,
|
|||
for (u32 a = 0; a < 36; a++) {
|
||||
const f32 ra = a * G_DTOR;
|
||||
|
||||
v[a].x = cos(ra) * radius + x;
|
||||
v[a].y = sin(ra) * radius + y;
|
||||
v[a].x = cos(ra) * radiusX + x;
|
||||
v[a].y = sin(ra) * radiusY + y;
|
||||
v[a].z = 0.0f;
|
||||
ncolor[a] = color;
|
||||
}
|
||||
|
@ -55,3 +56,16 @@ void GRRLIB_Circle (const f32 x, const f32 y, const f32 radius,
|
|||
GRRLIB_GXEngine(v, ncolor, 36, GX_TRIANGLEFAN);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a circle.
|
||||
* @param x Specifies the x-coordinate of the circle.
|
||||
* @param y Specifies the y-coordinate of the circle.
|
||||
* @param radius The radius of the circle.
|
||||
* @param color The color of the circle in RGBA format.
|
||||
* @param filled Set to @c true to fill the circle.
|
||||
*/
|
||||
void GRRLIB_Circle (const f32 x, const f32 y, const f32 radius,
|
||||
const u32 color, const u8 filled) {
|
||||
GRRLIB_Ellipse(x, y, radius, radius, color, filled);
|
||||
}
|
||||
|
|
|
@ -83,6 +83,8 @@ void GRRLIB_Exit (void);
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// GRRLIB_fbAdvanced.c - Render to framebuffer: Advanced primitives
|
||||
void GRRLIB_Ellipse (const f32 x, const f32 y, const f32 radiusX,
|
||||
const f32 radiusY, const u32 color, const u8 filled);
|
||||
void GRRLIB_Circle (const f32 x, const f32 y, const f32 radius,
|
||||
const u32 color, const u8 filled);
|
||||
|
||||
|
|
|
@ -82,8 +82,8 @@ INLINE
|
|||
void GRRLIB_Rectangle (const f32 x, const f32 y,
|
||||
const f32 width, const f32 height,
|
||||
const u32 color, const bool filled) {
|
||||
f32 x2 = x + width;
|
||||
f32 y2 = y + height;
|
||||
const f32 x2 = x + width;
|
||||
const f32 y2 = y + height;
|
||||
|
||||
if (filled == true) {
|
||||
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
|
||||
// Tile stuff
|
||||
#define TILE_DELAY 10
|
||||
#define TILE_UP 12*0
|
||||
#define TILE_RIGHT 12*1
|
||||
#define TILE_DOWN 12*2
|
||||
#define TILE_LEFT 12*3
|
||||
#define TILE_UP2 12*4+9
|
||||
#define TILE_RIGHT2 12*5+9
|
||||
#define TILE_DOWN2 12*6+9
|
||||
#define TILE_LEFT2 12*7+9
|
||||
#define TILE_UP 12 * 0
|
||||
#define TILE_RIGHT 12 * 1
|
||||
#define TILE_DOWN 12 * 2
|
||||
#define TILE_LEFT 12 * 3
|
||||
#define TILE_UP2 12 * 4 + 9
|
||||
#define TILE_RIGHT2 12 * 5 + 9
|
||||
#define TILE_DOWN2 12 * 6 + 9
|
||||
#define TILE_LEFT2 12 * 7 + 9
|
||||
|
||||
// RGBA Colors
|
||||
#define GRRLIB_BLACK 0x000000FF
|
||||
|
@ -135,7 +135,8 @@ int main() {
|
|||
frame = direction + 1; // Not moving
|
||||
wait = TILE_DELAY; // Ready to move
|
||||
}
|
||||
if(frame > direction+2) frame = direction;
|
||||
if(frame > direction + 2)
|
||||
frame = direction;
|
||||
}
|
||||
break;
|
||||
case 2: // Draw shapes
|
||||
|
@ -202,13 +203,15 @@ int main() {
|
|||
page--;
|
||||
left = 0;
|
||||
top = 0;
|
||||
if(page < 0) page = 2;
|
||||
if(page < 0)
|
||||
page = 2;
|
||||
}
|
||||
if(wpaddown & WPAD_BUTTON_PLUS) {
|
||||
page++;
|
||||
left = 0;
|
||||
top = 0;
|
||||
if(page > 2) page = 0;
|
||||
if(page > 2)
|
||||
page = 0;
|
||||
}
|
||||
if(wpadheld & WPAD_BUTTON_1 && wpadheld & WPAD_BUTTON_2) {
|
||||
WPAD_Rumble(WPAD_CHAN_0, 1); // Rumble on
|
||||
|
|
|
@ -23,14 +23,14 @@
|
|||
|
||||
// Tile stuff
|
||||
#define TILE_DELAY 10
|
||||
#define TILE_UP 12*0
|
||||
#define TILE_RIGHT 12*1
|
||||
#define TILE_DOWN 12*2
|
||||
#define TILE_LEFT 12*3
|
||||
#define TILE_UP2 12*4+9
|
||||
#define TILE_RIGHT2 12*5+9
|
||||
#define TILE_DOWN2 12*6+9
|
||||
#define TILE_LEFT2 12*7+9
|
||||
#define TILE_UP 12 * 0
|
||||
#define TILE_RIGHT 12 * 1
|
||||
#define TILE_DOWN 12 * 2
|
||||
#define TILE_LEFT 12 * 3
|
||||
#define TILE_UP2 12 * 4 + 9
|
||||
#define TILE_RIGHT2 12 * 5 + 9
|
||||
#define TILE_DOWN2 12 * 6 + 9
|
||||
#define TILE_LEFT2 12 * 7 + 9
|
||||
|
||||
// RGBA Colors
|
||||
#define GRRLIB_BLACK 0x000000FF
|
||||
|
@ -124,7 +124,8 @@ int main() {
|
|||
frame = direction + 1; // Not moving
|
||||
wait = TILE_DELAY; // Ready to move
|
||||
}
|
||||
if(frame > direction+2) frame = direction;
|
||||
if(frame > direction + 2)
|
||||
frame = direction;
|
||||
}
|
||||
break;
|
||||
case 2: // Draw shapes
|
||||
|
@ -183,13 +184,15 @@ int main() {
|
|||
page--;
|
||||
left = 0;
|
||||
top = 0;
|
||||
if(page < 0) page = 2;
|
||||
if(page < 0)
|
||||
page = 2;
|
||||
}
|
||||
if(paddown & PAD_BUTTON_X) {
|
||||
page++;
|
||||
left = 0;
|
||||
top = 0;
|
||||
if(page > 2) page = 0;
|
||||
if(page > 2)
|
||||
page = 0;
|
||||
}
|
||||
|
||||
GRRLIB_Render();
|
||||
|
|
113
grrlib.doxygen
113
grrlib.doxygen
|
@ -1,4 +1,4 @@
|
|||
# Doxyfile 1.9.4
|
||||
# Doxyfile 1.9.5
|
||||
|
||||
# This file describes the settings to be used by the documentation system
|
||||
# doxygen (www.doxygen.org) for a project.
|
||||
|
@ -19,7 +19,8 @@
|
|||
# configuration file:
|
||||
# doxygen -x [configFile]
|
||||
# Use doxygen to compare the used configuration file with the template
|
||||
# configuration file without replacing the environment variables:
|
||||
# configuration file without replacing the environment variables or CMake type
|
||||
# replacement variables:
|
||||
# doxygen -x_noenv [configFile]
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -605,7 +606,8 @@ INTERNAL_DOCS = NO
|
|||
# Windows (including Cygwin) and MacOS, users should typically set this option
|
||||
# to NO, whereas on Linux or other Unix flavors it should typically be set to
|
||||
# YES.
|
||||
# The default value is: system dependent.
|
||||
# Possible values are: SYSTEM, NO and YES.
|
||||
# The default value is: SYSTEM.
|
||||
|
||||
CASE_SENSE_NAMES = NO
|
||||
|
||||
|
@ -917,10 +919,21 @@ INPUT = ./GRRLIB/GRRLIB \
|
|||
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
|
||||
# documentation (see:
|
||||
# https://www.gnu.org/software/libiconv/) for the list of possible encodings.
|
||||
# See also: INPUT_FILE_ENCODING
|
||||
# The default value is: UTF-8.
|
||||
|
||||
INPUT_ENCODING = UTF-8
|
||||
|
||||
# This tag can be used to specify the character encoding of the source files
|
||||
# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify
|
||||
# character encoding on a per file pattern basis. Doxygen will compare the file
|
||||
# name with each pattern and apply the encoding instead of the default
|
||||
# INPUT_ENCODING) if there is a match. The character encodings are a list of the
|
||||
# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding
|
||||
# "INPUT_ENCODING" for further information on supported encodings.
|
||||
|
||||
INPUT_FILE_ENCODING =
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
|
||||
# *.h) to filter out the source-files in the directories.
|
||||
|
@ -1028,6 +1041,11 @@ IMAGE_PATH = ./docs
|
|||
# code is scanned, but not when the output code is generated. If lines are added
|
||||
# or removed, the anchors will not be placed correctly.
|
||||
#
|
||||
# Note that doxygen will use the data processed and written to standard output
|
||||
# for further processing, therefore nothing else, like debug statements or used
|
||||
# commands (so in case of a Windows batch file always use @echo OFF), should be
|
||||
# written to standard output.
|
||||
#
|
||||
# Note that for custom extensions or not directly supported extensions you also
|
||||
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
|
||||
# properly processed by doxygen.
|
||||
|
@ -1069,6 +1087,15 @@ FILTER_SOURCE_PATTERNS =
|
|||
|
||||
USE_MDFILE_AS_MAINPAGE =
|
||||
|
||||
# The Fortran standard specifies that for fixed formatted Fortran code all
|
||||
# characters from position 72 are to be considered as comment. A common
|
||||
# extension is to allow longer lines before the automatic comment starts. The
|
||||
# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can
|
||||
# be processed before the automatic comment starts.
|
||||
# Minimum value: 7, maximum value: 10000, default value: 72.
|
||||
|
||||
FORTRAN_COMMENT_AFTER = 72
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
|
@ -1303,6 +1330,23 @@ HTML_EXTRA_STYLESHEET =
|
|||
|
||||
HTML_EXTRA_FILES =
|
||||
|
||||
# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output
|
||||
# should be rendered with a dark or light theme. Default setting AUTO_LIGHT
|
||||
# enables light output unless the user preference is dark output. Other options
|
||||
# are DARK to always use dark mode, LIGHT to always use light mode, AUTO_DARK to
|
||||
# default to dark mode unless the user prefers light mode, and TOGGLE to let the
|
||||
# user toggle between dark and light mode via a button.
|
||||
# Possible values are: LIGHT Always generate light output., DARK Always generate
|
||||
# dark output., AUTO_LIGHT Automatically set the mode according to the user
|
||||
# preference, use light mode if no preference is set (the default)., AUTO_DARK
|
||||
# Automatically set the mode according to the user preference, use dark mode if
|
||||
# no preference is set. and TOGGLE Allow to user to switch between light and
|
||||
# dark mode via a button..
|
||||
# The default value is: AUTO_LIGHT.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
HTML_COLORSTYLE = AUTO_LIGHT
|
||||
|
||||
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
|
||||
# will adjust the colors in the style sheet and background images according to
|
||||
# this color. Hue is specified as an angle on a color-wheel, see
|
||||
|
@ -1666,17 +1710,6 @@ HTML_FORMULA_FORMAT = png
|
|||
|
||||
FORMULA_FONTSIZE = 10
|
||||
|
||||
# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
|
||||
# generated for formulas are transparent PNGs. Transparent PNGs are not
|
||||
# supported properly for IE 6.0, but are supported on all modern browsers.
|
||||
#
|
||||
# Note that when changing this option you need to delete any form_*.png files in
|
||||
# the HTML output directory before the changes have effect.
|
||||
# The default value is: YES.
|
||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||
|
||||
FORMULA_TRANSPARENT = YES
|
||||
|
||||
# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
|
||||
# to create new LaTeX commands to be used in formulas as building blocks. See
|
||||
# the section "Including formulas" for details.
|
||||
|
@ -2396,26 +2429,38 @@ HAVE_DOT = YES
|
|||
|
||||
DOT_NUM_THREADS = 0
|
||||
|
||||
# When you want a differently looking font in the dot files that doxygen
|
||||
# generates you can specify the font name using DOT_FONTNAME. You need to make
|
||||
# sure dot is able to find the font, which can be done by putting it in a
|
||||
# standard location or by setting the DOTFONTPATH environment variable or by
|
||||
# setting DOT_FONTPATH to the directory containing the font.
|
||||
# The default value is: Helvetica.
|
||||
# DOT_COMMON_ATTR is common attributes for nodes, edges and labels of
|
||||
# subgraphs. When you want a differently looking font in the dot files that
|
||||
# doxygen generates you can specify fontname, fontcolor and fontsize attributes.
|
||||
# For details please see <a href=https://graphviz.org/doc/info/attrs.html>Node,
|
||||
# Edge and Graph Attributes specification</a> You need to make sure dot is able
|
||||
# to find the font, which can be done by putting it in a standard location or by
|
||||
# setting the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
|
||||
# directory containing the font. Default graphviz fontsize is 14.
|
||||
# The default value is: fontname=Helvetica,fontsize=10.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOT_FONTNAME = Helvetica
|
||||
DOT_COMMON_ATTR = "fontname=Helvetica,fontsize=10"
|
||||
|
||||
# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
|
||||
# dot graphs.
|
||||
# Minimum value: 4, maximum value: 24, default value: 10.
|
||||
# DOT_EDGE_ATTR is concatenated with DOT_COMMON_ATTR. For elegant style you can
|
||||
# add 'arrowhead=open, arrowtail=open, arrowsize=0.5'. <a
|
||||
# href=https://graphviz.org/doc/info/arrows.html>Complete documentation about
|
||||
# arrows shapes.</a>
|
||||
# The default value is: labelfontname=Helvetica,labelfontsize=10.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOT_FONTSIZE = 10
|
||||
DOT_EDGE_ATTR = "labelfontname=Helvetica,labelfontsize=10"
|
||||
|
||||
# By default doxygen will tell dot to use the default font as specified with
|
||||
# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
|
||||
# the path where dot can find it using this tag.
|
||||
# DOT_NODE_ATTR is concatenated with DOT_COMMON_ATTR. For view without boxes
|
||||
# around nodes set 'shape=plain' or 'shape=plaintext' <a
|
||||
# href=https://www.graphviz.org/doc/info/shapes.html>Shapes specification</a>
|
||||
# The default value is: shape=box,height=0.2,width=0.4.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOT_NODE_ATTR = "shape=box,height=0.2,width=0.4"
|
||||
|
||||
# You can set the path where dot can find font specified with fontname in
|
||||
# DOT_COMMON_ATTR and others dot attributes.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOT_FONTPATH =
|
||||
|
@ -2658,18 +2703,6 @@ DOT_GRAPH_MAX_NODES = 50
|
|||
|
||||
MAX_DOT_GRAPH_DEPTH = 0
|
||||
|
||||
# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
|
||||
# background. This is disabled by default, because dot on Windows does not seem
|
||||
# to support this out of the box.
|
||||
#
|
||||
# Warning: Depending on the platform used, enabling this option may lead to
|
||||
# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
|
||||
# read).
|
||||
# The default value is: NO.
|
||||
# This tag requires that the tag HAVE_DOT is set to YES.
|
||||
|
||||
DOT_TRANSPARENT = YES
|
||||
|
||||
# Set the DOT_MULTI_TARGETS tag to YES to allow dot to generate multiple output
|
||||
# files in one run (i.e. multiple -o and -T options on the command line). This
|
||||
# makes dot run faster, but since only newer versions of dot (>1.8.10) support
|
||||
|
|
Loading…
Reference in a new issue