[CHG] Implemented JESPA's optimised plot and line algorithms

This commit is contained in:
csBlueChip 2009-08-19 21:40:13 +00:00
parent 515b4a994a
commit adb741ccf6
3 changed files with 14 additions and 12 deletions

View file

@ -275,7 +275,7 @@ Project Leader : NoNameNo
Documentation : Crayon, BlueChip Documentation : Crayon, BlueChip
Lead Coder : NoNameNo, Lead Coder : NoNameNo,
Support Coders : Xane, DragonMinded, BlueChip Support Coders : Xane, DragonMinded, BlueChip
Advisors : RedShade Advisors : RedShade, JESPA
Licence Licence

View file

@ -27,7 +27,7 @@ Project Leader : NoNameNo
Documentation : Crayon Documentation : Crayon
Lead Coder : NoNameNo, Lead Coder : NoNameNo,
Support Coders : BlueChip, DragonMinded, Xane Support Coders : BlueChip, DragonMinded, Xane
Advisors : RedShade Advisors : RedShade, JESPA
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/
/** /**

View file

@ -38,14 +38,14 @@ void GRRLIB_FillScreen (const u32 color) {
* @param x Specifies the x-coordinate of the dot. * @param x Specifies the x-coordinate of the dot.
* @param y Specifies the y-coordinate of the dot. * @param y Specifies the y-coordinate of the dot.
* @param color The color of the dot in RGBA format. * @param color The color of the dot in RGBA format.
* @author JESPA
*/ */
INLINE INLINE
void GRRLIB_Plot (const f32 x, const f32 y, const u32 color) { void GRRLIB_Plot (const f32 x, const f32 y, const u32 color) {
guVector v[] = {{x,y,0.0f}}; GX_Begin(GX_POINTS, GX_VTXFMT0, 1);
u32 ncolor[] = {color}; GX_Position3f32(x, y, 0);
GX_Color1u32(color);
GRRLIB_NPlot(v, ncolor, 1); GX_End();}
}
/** /**
* Draw a line. * Draw a line.
@ -54,15 +54,17 @@ void GRRLIB_Plot (const f32 x, const f32 y, const u32 color) {
* @param x2 Ending point for line for the x coordinate. * @param x2 Ending point for line for the x coordinate.
* @param y2 Ending point for line for the x coordinate. * @param y2 Ending point for line for the x coordinate.
* @param color Line color in RGBA format. * @param color Line color in RGBA format.
* @author JESPA
*/ */
INLINE INLINE
void GRRLIB_Line (const f32 x1, const f32 y1, void GRRLIB_Line (const f32 x1, const f32 y1,
const f32 x2, const f32 y2, const u32 color) { const f32 x2, const f32 y2, const u32 color) {
guVector v[] = {{x1,y1,0.0f}, {x2,y2,0.0f}}; GX_Begin(GX_LINES, GX_VTXFMT0, 2);
u32 ncolor[] = {color,color}; GX_Position3f32(x1, y1, 0);
GX_Color1u32(color);
GRRLIB_NGone(v, ncolor, 2); GX_Position3f32(x2, y2, 0);
} GX_Color1u32(color);
GX_End();}
/** /**
* Draw a rectangle. * Draw a rectangle.