[CHG] RollBack to version before latest Xanares change (global settings stuff) finally not added in this project. Sorry, Mass request ;)

This commit is contained in:
N0NameN0 2009-12-02 19:16:28 +00:00
parent 5da7abd4bc
commit 5761644fe8
17 changed files with 223 additions and 456 deletions

View file

@ -49,6 +49,9 @@ int GRRLIB_Init (void) {
Mtx44 perspective;
s8 error_code = 0;
//just to get the GRRLIB version in the dol ;)
if(1){ printf("GRRLIB 4.1.2"); }
// Ensure this function is only ever called once
if (is_setup) return 0 ;
@ -149,7 +152,6 @@ int GRRLIB_Init (void) {
GRRLIB_ClipReset();
// Default settings
GRRLIB_ResetSettings();
GRRLIB_Settings.antialias = true;
GRRLIB_Settings.blend = GRRLIB_BLEND_ALPHA;

View file

@ -31,12 +31,14 @@ THE SOFTWARE.
* @param xpos Specifies the x-coordinate of the upper-left corner of the text.
* @param ypos Specifies the y-coordinate of the upper-left corner of the text.
* @param tex The texture containing the character set.
* @param color Text color in RGBA format. The alpha channel is used to change the opacity of the text.
* @param zoom This is a factor by which the text size will be increase or decrease.
* @param text Text to draw.
* @param ... Optional arguments.
*/
void GRRLIB_Printf (const f32 xpos, const f32 ypos,
const GRRLIB_texImg *tex,
const char *text, ...) {
const GRRLIB_texImg *tex, const u32 color,
const f32 zoom, const char *text, ...) {
if (tex == NULL || tex->data == NULL) {
return;
}
@ -51,7 +53,7 @@ void GRRLIB_Printf (const f32 xpos, const f32 ypos,
for (i = 0; i < size; i++) {
u8 c = tmp[i]-tex->tilestart;
GRRLIB_DrawTile(xpos+i*tex->tilew*GRRLIB_GetScaleX(), ypos, tex, c);
GRRLIB_DrawTile(xpos+i*tex->tilew*zoom, ypos, tex, 0, zoom, zoom, color, c);
}
}
@ -98,6 +100,6 @@ void GRRLIB_PrintBMF (const f32 xpos, const f32 ypos,
}
GRRLIB_FlushTex( tex_BMfont );
GRRLIB_DrawImg(0, 0, tex_BMfont);
GRRLIB_DrawImg(0, 0, tex_BMfont, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_FreeTexture(tex_BMfont);
}

View file

@ -34,8 +34,12 @@ static guVector axis = (guVector){0, 0, 1};
* @param xpos Specifies the x-coordinate of the upper-left corner.
* @param ypos Specifies the y-coordinate of the upper-left corner.
* @param tex The texture to draw.
* @param degrees Angle of rotation.
* @param scaleX Specifies the x-coordinate scale. -1 could be used for flipping the texture horizontally.
* @param scaleY Specifies the y-coordinate scale. -1 could be used for flipping the texture vertically.
* @param color Color in RGBA format.
*/
void GRRLIB_DrawImg (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex) {
void GRRLIB_DrawImg (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex, const f32 degrees, const f32 scaleX, const f32 scaleY,const u32 color) {
GXTexObj texObj;
u16 width, height;
Mtx m, m1, m2, mv;
@ -53,12 +57,6 @@ void GRRLIB_DrawImg (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex)
GX_SetTevOp (GX_TEVSTAGE0, GX_MODULATE);
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
// Get current drawing settings.
u32 color = GRRLIB_Settings.colorRGBA;
f32 degrees = GRRLIB_Settings.rotation;
f32 scaleX = GRRLIB_Settings.scaleX;
f32 scaleY = GRRLIB_Settings.scaleY;
guMtxIdentity (m1);
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0);
guMtxRotAxisDeg(m2, &axis, degrees);
@ -105,8 +103,9 @@ void GRRLIB_DrawImg (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex)
* Draw a textured quad.
* @param pos Vector array of the 4 points.
* @param tex The texture to draw.
* @param color Color in RGBA format.
*/
void GRRLIB_DrawImgQuad (const guVector pos[4], GRRLIB_texImg *tex) {
void GRRLIB_DrawImgQuad (const guVector pos[4], GRRLIB_texImg *tex, const u32 color) {
GXTexObj texObj;
Mtx m, m1, m2, mv;
@ -123,9 +122,6 @@ void GRRLIB_DrawImgQuad (const guVector pos[4], GRRLIB_texImg *tex) {
GX_SetTevOp (GX_TEVSTAGE0, GX_MODULATE);
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
// Get current drawing settings.
u32 color = GRRLIB_Settings.colorRGBA;
guMtxIdentity (m1);
guMtxScaleApply(m1, m1, 1, 1, 1.0);
guMtxRotAxisDeg(m2, &axis, 0);
@ -162,8 +158,12 @@ void GRRLIB_DrawImgQuad (const guVector pos[4], GRRLIB_texImg *tex) {
* @param ypos Specifies the y-coordinate of the upper-left corner.
* @param tex The texture containing the tile to draw.
* @param frame Specifies the frame to draw.
* @param degrees Angle of rotation.
* @param scaleX Specifies the x-coordinate scale. -1 could be used for flipping the texture horizontally.
* @param scaleY Specifies the y-coordinate scale. -1 could be used for flipping the texture vertically.
* @param color Color in RGBA format.
*/
void GRRLIB_DrawTile (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex, const int frame) {
void GRRLIB_DrawTile (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex, const f32 degrees, const f32 scaleX, const f32 scaleY, const u32 color, const int frame) {
GXTexObj texObj;
f32 width, height;
Mtx m, m1, m2, mv;
@ -192,12 +192,6 @@ void GRRLIB_DrawTile (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex,
width = tex->tilew * 0.5f;
height = tex->tileh * 0.5f;
// Get current drawing settings.
u32 color = GRRLIB_Settings.colorRGBA;
f32 degrees = GRRLIB_Settings.rotation;
f32 scaleX = GRRLIB_Settings.scaleX;
f32 scaleY = GRRLIB_Settings.scaleY;
guMtxIdentity (m1);
guMtxScaleApply(m1, m1, scaleX, scaleY, 1.0f);
guMtxRotAxisDeg(m2, &axis, degrees);
@ -247,9 +241,12 @@ void GRRLIB_DrawTile (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex,
* @param partw Specifies the width in the texture.
* @param parth Specifies the height in the texture.
* @param tex The texture containing the tile to draw.
* @param degrees Angle of rotation.
* @param scaleX Specifies the x-coordinate scale. -1 could be used for flipping the texture horizontally.
* @param scaleY Specifies the y-coordinate scale. -1 could be used for flipping the texture vertically.
* @param color Color in RGBA format.
*/
void GRRLIB_DrawPart (const f32 xpos, const f32 ypos, const f32 partx, const f32 party,
const f32 partw, const f32 parth, const GRRLIB_texImg *tex) {
void GRRLIB_DrawPart (const f32 xpos, const f32 ypos, const f32 partx, const f32 party, const f32 partw, const f32 parth, const GRRLIB_texImg *tex, const f32 degrees, const f32 scaleX, const f32 scaleY, const u32 color) {
GXTexObj texObj;
f32 width, height;
Mtx m, m1, m2, mv;
@ -271,12 +268,6 @@ void GRRLIB_DrawPart (const f32 xpos, const f32 ypos, const f32 partx, const f3
GX_InitTexObjLOD(&texObj, GX_NEAR, GX_NEAR,
0.0f, 0.0f, 0.0f, 0, 0, GX_ANISO_1);
// Get current drawing settings.
u32 color = GRRLIB_Settings.colorRGBA;
f32 degrees = GRRLIB_Settings.rotation;
f32 scaleX = GRRLIB_Settings.scaleX;
f32 scaleY = GRRLIB_Settings.scaleY;
GX_LoadTexObj(&texObj, GX_TEXMAP0);
GX_SetTevOp (GX_TEVSTAGE0, GX_MODULATE);
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
@ -328,9 +319,10 @@ void GRRLIB_DrawPart (const f32 xpos, const f32 ypos, const f32 partx, const f3
* Draw a tile in a quad.
* @param pos Vector array of the 4 points.
* @param tex The texture to draw.
* @param color Color in RGBA format.
* @param frame Specifies the frame to draw.
*/
void GRRLIB_DrawTileQuad (const guVector pos[4], GRRLIB_texImg *tex, const int frame) {
void GRRLIB_DrawTileQuad (const guVector pos[4], GRRLIB_texImg *tex, const u32 color, const int frame) {
GXTexObj texObj;
Mtx m, m1, m2, mv;
f32 s1, s2, t1, t2;
@ -355,9 +347,6 @@ void GRRLIB_DrawTileQuad (const guVector pos[4], GRRLIB_texImg *tex, const int
GX_SetTevOp (GX_TEVSTAGE0, GX_MODULATE);
GX_SetVtxDesc(GX_VA_TEX0, GX_DIRECT);
// Get current drawing settings.
u32 color = GRRLIB_Settings.colorRGBA;
guMtxIdentity (m1);
guMtxScaleApply(m1, m1, 1, 1, 1.0f);
guMtxRotAxisDeg(m2, &axis, 0);

View file

@ -87,14 +87,6 @@ typedef enum GRRLIB_blendMode {
typedef struct GRRLIB_drawSettings {
bool antialias; /**< AntiAlias is enabled when set to true. */
GRRLIB_blendMode blend; /**< Blending Mode. */
u8 colorR; /**< Red component of color. */
u8 colorG; /**< Green component of color. */
u8 colorB; /**< Blue component of color. */
u8 colorA; /**< Alpha component of color. */
u32 colorRGBA; /**< Color in RGBA. */
f32 rotation; /**< Angle of rotation in degrees. */
f32 scaleX; /**< Horizontal scale. */
f32 scaleY; /**< Vertical scale. */
} GRRLIB_drawSettings;
//------------------------------------------------------------------------------

View file

@ -79,12 +79,12 @@ INLINE void GRRLIB_GXEngine (const guVector v[], const u32 color[],
//------------------------------------------------------------------------------
// GRRLIB_fbSimple.h -
INLINE void GRRLIB_FillScreen (const u32 color) ;
INLINE void GRRLIB_Plot (const f32 x, const f32 y) ;
INLINE void GRRLIB_Plot (const f32 x, const f32 y, const u32 color) ;
INLINE void GRRLIB_Line (const f32 x1, const f32 y1,
const f32 x2, const f32 y2) ;
const f32 x2, const f32 y2, const u32 color) ;
INLINE void GRRLIB_Rectangle (const f32 x, const f32 y,
const f32 width, const f32 height,
const u8 filled) ;
const u32 color, const u8 filled) ;
//------------------------------------------------------------------------------
// GRRLIB_handle.h - Texture handle manipulation
@ -109,21 +109,6 @@ INLINE void GRRLIB_SetBlend (const GRRLIB_blendMode blendmo
INLINE GRRLIB_blendMode GRRLIB_GetBlend (void) ;
INLINE void GRRLIB_SetAntiAliasing (const bool aa) ;
INLINE bool GRRLIB_GetAntiAliasing (void) ;
INLINE void GRRLIB_SetColor (const u8 r, const u8 g, const u8 b) ;
INLINE void GRRLIB_SetColorRGBA (const u32 color) ;
INLINE void GRRLIB_SetAlpha (const u32 alpha) ;
INLINE u8 GRRLIB_GetColorRed (void) ;
INLINE u8 GRRLIB_GetColorGreen (void) ;
INLINE u8 GRRLIB_GetColorBlue (void) ;
INLINE u8 GRRLIB_GetAlpha (void) ;
INLINE void GRRLIB_SetRotation (const f32 rot) ;
INLINE f32 GRRLIB_GetRotation (void) ;
INLINE void GRRLIB_SetScale (const f32 sx, const f32 sy) ;
INLINE void GRRLIB_SetScaleX (const f32 sx) ;
INLINE void GRRLIB_SetScaleY (const f32 sy) ;
INLINE f32 GRRLIB_GetScaleX (void) ;
INLINE f32 GRRLIB_GetScaleY (void) ;
INLINE void GRRLIB_ResetSettings (void) ;
//------------------------------------------------------------------------------
// GRRLIB_texSetup.h - Create and setup textures

View file

@ -91,8 +91,8 @@ bool GRRLIB_ScrShot (const char* filename) ;
//------------------------------------------------------------------------------
//! GRRLIB_print.c - Will someome please tell me what these are :)
void GRRLIB_Printf (const f32 xpos, const f32 ypos,
const GRRLIB_texImg *tex,
const char *text, ...) ;
const GRRLIB_texImg *tex, const u32 color,
const f32 zoom, const char *text, ...) ;
void GRRLIB_PrintBMF (const f32 xpos, const f32 ypos,
const GRRLIB_bytemapFont *bmf,
@ -100,17 +100,22 @@ void GRRLIB_PrintBMF (const f32 xpos, const f32 ypos,
//------------------------------------------------------------------------------
// GRRLIB_render.c - Rendering functions
void GRRLIB_DrawImg (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex) ;
void GRRLIB_DrawImg (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex,
const f32 degrees, const f32 scaleX, const f32 scaleY,
const u32 color) ;
void GRRLIB_DrawImgQuad (const guVector pos[4], GRRLIB_texImg *tex) ;
void GRRLIB_DrawImgQuad (const guVector pos[4], GRRLIB_texImg *tex,
const u32 color) ;
void GRRLIB_DrawTile (const f32 xpos, const f32 ypos, const GRRLIB_texImg *tex,
const int frame) ;
const f32 degrees, const f32 scaleX, const f32 scaleY,
const u32 color, const int frame) ;
void GRRLIB_DrawPart (const f32 xpos, const f32 ypos, const f32 partx, const f32 party,
const f32 partw, const f32 parth, const GRRLIB_texImg *tex);
const f32 partw, const f32 parth, const GRRLIB_texImg *tex,
const f32 degrees, const f32 scaleX, const f32 scaleY, const u32 color);
void GRRLIB_DrawTileQuad (const guVector pos[4], GRRLIB_texImg *tex, const int frame) ;
void GRRLIB_DrawTileQuad (const guVector pos[4], GRRLIB_texImg *tex, const u32 color, const int frame) ;
void GRRLIB_Render (void) ;

View file

@ -20,9 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
------------------------------------------------------------------------------*/
extern GRRLIB_drawSettings GRRLIB_Settings;
/**
* @file GRRLIB_fbSimple.h
* Inline functions for primitive point and line drawing.
@ -34,23 +31,21 @@ extern GRRLIB_drawSettings GRRLIB_Settings;
*/
INLINE
void GRRLIB_FillScreen (const u32 color) {
u32 tmpColor = GRRLIB_Settings.colorRGBA;
GRRLIB_SetColorRGBA(color);
GRRLIB_Rectangle(-40, -40, rmode->fbWidth +80, rmode->xfbHeight +80, 1);
GRRLIB_SetColorRGBA(tmpColor);
GRRLIB_Rectangle(-40, -40, rmode->fbWidth +80, rmode->xfbHeight +80, color, 1);
}
/**
* Draw a dot.
* @param x Specifies the x-coordinate of the dot.
* @param y Specifies the y-coordinate of the dot.
* @param color The color of the dot in RGBA format.
* @author Jespa
*/
INLINE
void GRRLIB_Plot (const f32 x, const f32 y) {
void GRRLIB_Plot (const f32 x, const f32 y, const u32 color) {
GX_Begin(GX_POINTS, GX_VTXFMT0, 1);
GX_Position3f32(x, y, 0);
GX_Color1u32(GRRLIB_Settings.colorRGBA);
GX_Color1u32(color);
GX_End();
}
@ -60,16 +55,17 @@ void GRRLIB_Plot (const f32 x, const f32 y) {
* @param y1 Starting point for line for the y coordinate.
* @param x2 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.
* @author JESPA
*/
INLINE
void GRRLIB_Line (const f32 x1, const f32 y1,
const f32 x2, const f32 y2) {
const f32 x2, const f32 y2, const u32 color) {
GX_Begin(GX_LINES, GX_VTXFMT0, 2);
GX_Position3f32(x1, y1, 0);
GX_Color1u32(GRRLIB_Settings.colorRGBA);
GX_Color1u32(color);
GX_Position3f32(x2, y2, 0);
GX_Color1u32(GRRLIB_Settings.colorRGBA);
GX_Color1u32(color);
GX_End();
}
@ -79,20 +75,16 @@ void GRRLIB_Line (const f32 x1, const f32 y1,
* @param y Specifies the y-coordinate of the upper-left corner of the rectangle.
* @param width The width of the rectangle.
* @param height The height of the rectangle.
* @param color The color of the rectangle in RGBA format.
* @param filled Set to true to fill the rectangle.
*/
INLINE
void GRRLIB_Rectangle (const f32 x, const f32 y,
const f32 width, const f32 height,
const u8 filled) {
const u32 color, const u8 filled) {
// Get current drawing settings.
u32 color = GRRLIB_Settings.colorRGBA;
f32 scaleX = GRRLIB_Settings.scaleX;
f32 scaleY = GRRLIB_Settings.scaleY;
f32 x2 = x + width * scaleX;
f32 y2 = y + height * scaleY;
f32 x2 = x + width;
f32 y2 = y + height;
if (filled) {
GX_Begin(GX_QUADS, GX_VTXFMT0, 4);

View file

@ -82,150 +82,3 @@ bool GRRLIB_GetAntiAliasing (void) {
return GRRLIB_Settings.antialias;
}
/**
* Set global rendering color.
* @param r Red component of color.
* @param g Green component of color.
* @param b Blue component of color.
*/
INLINE
void GRRLIB_SetColor (const u8 r, const u8 g, const u8 b) {
GRRLIB_Settings.colorR = r;
GRRLIB_Settings.colorG = g;
GRRLIB_Settings.colorB = b;
GRRLIB_Settings.colorRGBA = RGBA(r, g, b, GRRLIB_Settings.colorA);
}
/**
* Set global rendering color in RGBA-format.
* @param color Color in RGBA-format.
*/
INLINE
void GRRLIB_SetColorRGBA (const u32 color) {
GRRLIB_Settings.colorR = R(color);
GRRLIB_Settings.colorG = G(color);
GRRLIB_Settings.colorB = B(color);
GRRLIB_Settings.colorA = A(color);
GRRLIB_Settings.colorRGBA = color;
}
/**
* Set global rendering color in RGB-format.
* @param alpha Alpha component of color.
*/
INLINE
void GRRLIB_SetAlpha (const u32 alpha) {
GRRLIB_Settings.colorA = alpha;
GRRLIB_Settings.colorRGBA = RGBA(GRRLIB_Settings.colorR, GRRLIB_Settings.colorG, GRRLIB_Settings.colorB, alpha);
}
/**
* Get red component of current color.
* @return Red component of color.
*/
INLINE
u8 GRRLIB_GetColorRed (void) {
return GRRLIB_Settings.colorR;
}
/**
* Get green component of current color.
* @return Green component of color.
*/
INLINE
u8 GRRLIB_GetColorGreen (void) {
return GRRLIB_Settings.colorG;
}
/**
* Get blue component of current color.
* @return Blue component of color.
*/
INLINE
u8 GRRLIB_GetColorBlue (void) {
return GRRLIB_Settings.colorB;
}
/**
* Get current alpha.
* @return Alpha.
*/
INLINE
u8 GRRLIB_GetAlpha (void) {
return GRRLIB_Settings.colorA;
}
/**
* Set global rotation.
* @param rot Rotation in degrees.
*/
INLINE
void GRRLIB_SetRotation (const f32 rot) {
GRRLIB_Settings.rotation = rot;
}
/**
* Get current rotation.
* @return Rotation in degrees.
*/
INLINE
f32 GRRLIB_GetRotation (void) {
return GRRLIB_Settings.rotation;
}
/**
* Set global drawing scale.
* @param sx Horizontal scale.
* @param sy Vertical scale.
*/
INLINE
void GRRLIB_SetScale (const f32 sx, const f32 sy) {
GRRLIB_Settings.scaleX = sx;
GRRLIB_Settings.scaleY = sy;
}
/**
* Set global horizontal drawing scale.
* @param sx Horizontal scale.
*/
INLINE
void GRRLIB_SetScaleX (const f32 sx) {
GRRLIB_Settings.scaleX = sx;
}
/**
* Set global vertical drawing scale.
* @param sy Vertical scale.
*/
INLINE
void GRRLIB_SetScaleY (const f32 sy) {
GRRLIB_Settings.scaleY = sy;
}
/**
* Get current horizontal scale
* @return Horizontal scale.
*/
INLINE
f32 GRRLIB_GetScaleX (void) {
return GRRLIB_Settings.scaleX;
}
/**
* Get current vertical scale
* @return Vertical scale.
*/
INLINE
f32 GRRLIB_GetScaleY (void) {
return GRRLIB_Settings.scaleY;
}
/**
* Reset global drawing settings to default.
*/
INLINE
void GRRLIB_ResetSettings (void) {
GRRLIB_SetColorRGBA( 0xFFFFFFFF );
GRRLIB_SetScale( 1.0f, 1.0f );
GRRLIB_SetRotation( 0.0f );
}

View file

@ -38,19 +38,15 @@ int main() {
if(WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) exit(0);
GRRLIB_CompoStart();
GRRLIB_SetAlpha(0xff);
for(i=0;i<360;i+=30) {
GRRLIB_Settings.rotation= i+rot;
GRRLIB_DrawTile((rmode->fbWidth/2)-(tex_font->tilew/2), (rmode->efbHeight/2)-(tex_font->tileh+circsize), tex_font, 65-32+((int)i/45));
GRRLIB_DrawTile((rmode->fbWidth/2)-(tex_font->tilew/2), (rmode->efbHeight/2)-(tex_font->tileh+circsize), tex_font, rot+i, 1, 1, 0xFFFFFFFF, 65-32+((int)i/45));
}
GRRLIB_CompoEnd(0, 0, tex_screen);
GRRLIB_Settings.rotation=0;
rot-=0.6;
GRRLIB_SetAlpha(0xFF);
GRRLIB_DrawImg(50, 50, tex_screen);
GRRLIB_DrawImg(100, 100, tex_screen);
GRRLIB_DrawImg(50, 50, tex_screen, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(100, 100, tex_screen, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_Render();
}

View file

@ -106,17 +106,14 @@ int main() {
switch(page)
{
case 1: // Draw images
GRRLIB_ResetSettings();
GRRLIB_Printf(5, 25, tex_BMfont2, "IMAGES DEMO");
GRRLIB_Printf(5, 25, tex_BMfont2, GRRLIB_WHITE, 1, "IMAGES DEMO");
GRRLIB_DrawImg(10, 50, tex_test_jpg); // Draw a jpeg
GRRLIB_SetScale(4, 4);
GRRLIB_DrawImg(350, 50, tex_test_bmp); // Draw a bitmap
GRRLIB_DrawImg(10, 50, tex_test_jpg, 0, 1, 1, GRRLIB_WHITE); // Draw a jpeg
GRRLIB_DrawImg(350, 50, tex_test_bmp, 0, 4, 4, GRRLIB_WHITE); // Draw a bitmap
// Draw a sprite
GRRLIB_SetScale(2, 2);
GRRLIB_DrawTile(600, 400, tex_sprite_png, 12*4); // Rupee
GRRLIB_DrawTile(320+left, 240+top, tex_sprite_png, frame);
GRRLIB_DrawTile(600, 400, tex_sprite_png, 0, 2, 2, GRRLIB_WHITE, 12*4); // Rupee
GRRLIB_DrawTile(320+left, 240+top, tex_sprite_png, 0, 2, 2, GRRLIB_WHITE, frame);
if(GRRLIB_RectOnRect(320+left, 240+top, 48, 64, 618, 434, 12, 30))
{
WPAD_Rumble(WPAD_CHAN_0, 1);
@ -143,47 +140,33 @@ int main() {
}
break;
case 2: // Draw shapes
GRRLIB_ResetSettings();
GRRLIB_Printf(5, 25, tex_BMfont2, "SHAPES DEMO");
GRRLIB_Printf(5, 25, tex_BMfont2, GRRLIB_WHITE, 1, "SHAPES DEMO");
GRRLIB_SetColorRGBA(GRRLIB_RED);
GRRLIB_Rectangle(100, 100, 200, 100, 1);
GRRLIB_SetColorRGBA(GRRLIB_SILVER);
GRRLIB_Line(100, 100, 350, 200);
GRRLIB_Rectangle(100, 100, 200, 100, GRRLIB_RED, 1);
GRRLIB_Line(100, 100, 350, 200, GRRLIB_SILVER);
GRRLIB_NGoneFilled(triangle, trianglecolor, 3);
GRRLIB_SetColorRGBA(0x0000FFC8); // Blue with alpha
GRRLIB_Rectangle(left + 150, top + 150, 200, 200, 1);
GRRLIB_SetColorRGBA(GRRLIB_OLIVE);
GRRLIB_Rectangle(left + 150, top + 150, 200, 200, 0x0000FFC8, 1); // Blue with alpha
GRRLIB_Circle(left + 300, top + 300, 50, GRRLIB_OLIVE, 1);
// Draw a yellow four pixel dot where the wiimote is pointing
GRRLIB_SetColorRGBA(GRRLIB_YELLOW);
GRRLIB_Plot(ir1.sx, ir1.sy);
GRRLIB_Plot(ir1.sx + 1, ir1.sy);
GRRLIB_Plot(ir1.sx, ir1.sy + 1);
GRRLIB_Plot(ir1.sx + 1, ir1.sy + 1);
GRRLIB_Plot(ir1.sx, ir1.sy, GRRLIB_YELLOW);
GRRLIB_Plot(ir1.sx + 1, ir1.sy, GRRLIB_YELLOW);
GRRLIB_Plot(ir1.sx, ir1.sy + 1, GRRLIB_YELLOW);
GRRLIB_Plot(ir1.sx + 1, ir1.sy + 1, GRRLIB_YELLOW);
break;
default: // Print some text
GRRLIB_ResetSettings();
GRRLIB_Printf(5, 25, tex_BMfont2, "TEXT DEMO");
GRRLIB_Printf(5, 25, tex_BMfont2, GRRLIB_WHITE, 1, "TEXT DEMO");
GRRLIB_Printf(5, 100, tex_BMfont4, "TO QUIT PRESS THE HOME BUTTON.");
GRRLIB_SetColorRGBA(GRRLIB_YELLOW);
GRRLIB_Printf(5, 140, tex_BMfont4, "USE + OR - TO MOVE ACROSS PAGES.");
GRRLIB_SetColorRGBA(GRRLIB_GREEN);
GRRLIB_Printf(5, 180, tex_BMfont4, "USE THE D-PAD TO MOVE STUFF.");
GRRLIB_SetColorRGBA(GRRLIB_WHITE);
GRRLIB_Printf(left, top+250, tex_BMfont1, "IR X VALUE: %d", (int)ir1.x);
GRRLIB_Printf(left, top+300, tex_BMfont3, "IR Y VALUE: %d", (int)ir1.y);
GRRLIB_SetColorRGBA(0XFFFFFF50);
GRRLIB_Printf(left, top+350, tex_BMfont3, "TEXT WITH ALPHA");
GRRLIB_SetColorRGBA(GRRLIB_LIME);
GRRLIB_Printf(left, top+400, tex_BMfont5, "This font has the 128 ASCII characters");
GRRLIB_SetColorRGBA(GRRLIB_WHITE);
GRRLIB_Printf(5, 100, tex_BMfont4, GRRLIB_WHITE, 1, "TO QUIT PRESS THE HOME BUTTON.");
GRRLIB_Printf(5, 140, tex_BMfont4, GRRLIB_YELLOW, 1, "USE + OR - TO MOVE ACROSS PAGES.");
GRRLIB_Printf(5, 180, tex_BMfont4, GRRLIB_GREEN, 1, "USE THE D-PAD TO MOVE STUFF.");
GRRLIB_Printf(left, top+250, tex_BMfont1, GRRLIB_WHITE, 1, "IR X VALUE: %d", (int)ir1.x);
GRRLIB_Printf(left, top+300, tex_BMfont3, GRRLIB_WHITE, 1, "IR Y VALUE: %d", (int)ir1.y);
GRRLIB_Printf(left, top+350, tex_BMfont3, 0XFFFFFF50, 1, "TEXT WITH ALPHA");
GRRLIB_Printf(left, top+400, tex_BMfont5, GRRLIB_LIME, 1, "This font has the 128 ASCII characters");
GRRLIB_PrintBMF(left, top+420, bmf_Font2, 1, "%s", bmf_Font2->name);
}
GRRLIB_ResetSettings();
GRRLIB_Printf(500, 27, tex_BMfont5, "Current FPS: %d", FPS);
GRRLIB_Printf(500, 27, tex_BMfont5, GRRLIB_WHITE, 1, "Current FPS: %d", FPS);
GRRLIB_Render();
FPS = CalculateFrameRate();
@ -270,3 +253,4 @@ static u8 CalculateFrameRate() {
}
return FPS;
}

View file

@ -122,86 +122,71 @@ int main() {
switch(page)
{
case 1:
GRRLIB_SetColorRGBA(0X000000FF);
GRRLIB_Printf(10, 10, text_font1, "GRAYSCALE FX");
GRRLIB_Printf(10, 10, text_font1, 0X000000FF, 1, "GRAYSCALE FX");
GRRLIB_SetColorRGBA(0xFFFFFFFF);
GRRLIB_DrawImg(10, 60, tex_pirate);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_gray);
GRRLIB_DrawImg(10, 60, tex_pirate, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_gray, 0, 1, 1, 0xFFFFFFFF);
break;
case 2:
GRRLIB_SetColorRGBA(0X000000FF);
GRRLIB_Printf(10, 10, text_font1, "SEPIA FX");
GRRLIB_Printf(10, 10, text_font1, 0X000000FF, 1, "SEPIA FX");
GRRLIB_SetColorRGBA(0xFFFFFFFF);
GRRLIB_DrawImg(10, 60, tex_pirate);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_sepia);
GRRLIB_DrawImg(10, 60, tex_pirate, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_sepia, 0, 1, 1, 0xFFFFFFFF);
break;
case 3:
GRRLIB_SetColorRGBA(0X000000FF);
GRRLIB_Printf(10, 10, text_font1, "INVERT FX");
GRRLIB_Printf(10, 10, text_font1, 0X000000FF, 1, "INVERT FX");
GRRLIB_SetColorRGBA(0xFFFFFFFF);
GRRLIB_DrawImg(10, 60, tex_pirate);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_invert);
GRRLIB_DrawImg(10, 60, tex_pirate, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_invert, 0, 1, 1, 0xFFFFFFFF);
break;
case 4:
GRRLIB_SetColorRGBA(0X000000FF);
GRRLIB_Printf(10, 10, text_font1, "FLIPH AND FLIPV FX");
GRRLIB_Printf(10, 10, text_font1, 0X000000FF, 1, "FLIPH AND FLIPV FX");
GRRLIB_SetColorRGBA(0xFFFFFFFF);
GRRLIB_DrawImg(10, 60, tex_pirate);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_fliph);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60, tex_flipv);
GRRLIB_DrawImg(10+tex_pirate->w*3, 60, tex_fliphv);
GRRLIB_DrawImg(10, 60, tex_pirate, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_fliph, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60, tex_flipv, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*3, 60, tex_fliphv, 0, 1, 1, 0xFFFFFFFF);
break;
case 5:
GRRLIB_SetColorRGBA(0X000000FF);
GRRLIB_Printf(10, 10, text_font1, "BLUR FX");
GRRLIB_Printf(10, 10, text_font1, 0X000000FF, 1, "BLUR FX");
GRRLIB_SetColorRGBA(0xFFFFFFFF);
GRRLIB_DrawImg(10, 60, tex_pirate);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_blur1);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60, tex_blur2);
GRRLIB_DrawImg(10+tex_pirate->w*3, 60, tex_blur3);
GRRLIB_DrawImg(10, 60+tex_pirate->h*1, tex_blur4);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60+tex_pirate->h*1, tex_blur5);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60+tex_pirate->h*1, tex_blur6);
GRRLIB_DrawImg(10, 60, tex_pirate, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_blur1, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60, tex_blur2, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*3, 60, tex_blur3, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10, 60+tex_pirate->h*1, tex_blur4, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60+tex_pirate->h*1, tex_blur5, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60+tex_pirate->h*1, tex_blur6, 0, 1, 1, 0xFFFFFFFF);
break;
case 6:
GRRLIB_SetColorRGBA(0X000000FF);
GRRLIB_Printf(10, 10, text_font1, "PIXELATE FX");
GRRLIB_Printf(10, 10, text_font1, 0X000000FF, 1, "PIXELATE FX");
GRRLIB_SetColorRGBA(0xFFFFFFFF);
GRRLIB_DrawImg(10, 60, tex_pirate);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_pixel1);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60, tex_pixel2);
GRRLIB_DrawImg(10+tex_pirate->w*3, 60, tex_pixel3);
GRRLIB_DrawImg(10, 60+tex_pirate->h*1, tex_pixel4);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60+tex_pirate->h*1, tex_pixel5);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60+tex_pirate->h*1, tex_pixel6);
GRRLIB_DrawImg(10, 60, tex_pirate, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_pixel1, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60, tex_pixel2, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*3, 60, tex_pixel3, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10, 60+tex_pirate->h*1, tex_pixel4, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60+tex_pirate->h*1, tex_pixel5, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60+tex_pirate->h*1, tex_pixel6, 0, 1, 1, 0xFFFFFFFF);
break;
case 7:
GRRLIB_SetColorRGBA(0X000000FF);
GRRLIB_Printf(10, 10, text_font1, "SCATTER FX");
GRRLIB_Printf(10, 10, text_font1, 0X000000FF, 1, "SCATTER FX");
GRRLIB_SetColorRGBA(0xFFFFFFFF);
GRRLIB_DrawImg(10, 60, tex_pirate);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_scatter1);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60, tex_scatter2);
GRRLIB_DrawImg(10+tex_pirate->w*3, 60, tex_scatter3);
GRRLIB_DrawImg(10, 60+tex_pirate->h*1, tex_scatter4);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60+tex_pirate->h*1, tex_scatter5);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60+tex_pirate->h*1, tex_scatter6);
GRRLIB_DrawImg(10, 60, tex_pirate, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60, tex_scatter1, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60, tex_scatter2, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*3, 60, tex_scatter3, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10, 60+tex_pirate->h*1, tex_scatter4, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*1, 60+tex_pirate->h*1, tex_scatter5, 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(10+tex_pirate->w*2, 60+tex_pirate->h*1, tex_scatter6, 0, 1, 1, 0xFFFFFFFF);
break;
default:
GRRLIB_SetColorRGBA(0X000000FF);
GRRLIB_Printf(10, 10, text_font1, "WELCOME TO THE");
GRRLIB_Printf(10, 40, text_font1, "GRRLIB FX DEMO.");
GRRLIB_Printf(10, 80, text_font1, "TO QUIT PRESS THE");
GRRLIB_Printf(10, 120, text_font1, "HOME BUTTON.");
GRRLIB_Printf(10, 160, text_font1, "USE + OR - TO MOVE");
GRRLIB_Printf(10, 200, text_font1, "ACROSS PAGES.");
GRRLIB_Printf(10, 10, text_font1, 0X000000FF, 1, "WELCOME TO THE");
GRRLIB_Printf(10, 40, text_font1, 0X000000FF, 1, "GRRLIB FX DEMO.");
GRRLIB_Printf(10, 80, text_font1, 0X000000FF, 1, "TO QUIT PRESS THE");
GRRLIB_Printf(10, 120, text_font1, 0X000000FF, 1, "HOME BUTTON.");
GRRLIB_Printf(10, 160, text_font1, 0X000000FF, 1, "USE + OR - TO MOVE");
GRRLIB_Printf(10, 200, text_font1, 0X000000FF, 1, "ACROSS PAGES.");
}
GRRLIB_Render();

View file

@ -47,7 +47,7 @@ int main() {
}
GRRLIB_FillScreen(0xFFFFFFFF);
GRRLIB_DrawImgQuad(d, tex_pirate);
GRRLIB_DrawImgQuad(d, tex_pirate, 0xFFFFFFFF);
GRRLIB_Render();

View file

@ -36,8 +36,8 @@ int main() {
WPADDown = WPAD_ButtonsDown(0);
for(i=0; i<10; i++) {
GRRLIB_DrawImg(0, 0, tex_screen[i]);
GRRLIB_DrawImg(((640-64)/2)+sin(sinx[0])*160+sin(sinx[1])*sin(sinx[2])*50,((480-64)/2)+sin(siny[0])*120+sin(siny[1])*sin(siny[2])*50, tex_ball);
GRRLIB_DrawImg(0, 0, tex_screen[i], 0, 1, 1, 0xFFFFFFFF);
GRRLIB_DrawImg(((640-64)/2)+sin(sinx[0])*160+sin(sinx[1])*sin(sinx[2])*50,((480-64)/2)+sin(siny[0])*120+sin(siny[1])*sin(siny[2])*50, tex_ball, 0, 1, 1, 0xFFFFFFFF);
sinx[0]+=0.02;sinx[1]+=0.03;sinx[2]+=0.05;siny[0]+=0.03;siny[1]+=0.01;siny[2]+=0.06;
GRRLIB_Screen2Texture(0, 0, tex_screen[i], false);
GRRLIB_Render();

View file

@ -62,17 +62,16 @@ void GRRLIB_addon_Button(int indice, int x,int y,u32 col, int wpadx, int wpady,
bg[2].x = x+4+1*16;
}
GRRLIB_SetColorRGBA(col);
GRRLIB_DrawTile(x, y, tex_GRRLIBbutton, 0 );
GRRLIB_DrawTileQuad(bg, tex_GRRLIBbutton, 1 );
GRRLIB_DrawTile(bg[1].x, y, tex_GRRLIBbutton , 2);
GRRLIB_DrawTile(x, y, tex_GRRLIBbutton , 0, 1, 1, col,0 );
GRRLIB_DrawTileQuad(bg, tex_GRRLIBbutton, col,1 );
GRRLIB_DrawTile(bg[1].x, y, tex_GRRLIBbutton , 0, 1, 1, col,2);
if(GRRLIB_PtInRect(x, y, butwidth, 24, wpadx, wpady)) {
if((toto[0]=='^') && (toto[1]=='U')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, "%c", 0xa1);
else if((toto[0]=='^') && (toto[1]=='D')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, "%c", 0xa2);
else if((toto[0]=='^') && (toto[1]=='L')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, "%c", 0xa3);
else if((toto[0]=='^') && (toto[1]=='R')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, "%c", 0xa4);
else GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, toto);
if((toto[0]=='^') && (toto[1]=='U')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFFFF, 1, "%c", 0xa1);
else if((toto[0]=='^') && (toto[1]=='D')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFFFF, 1, "%c", 0xa2);
else if((toto[0]=='^') && (toto[1]=='L')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFFFF, 1, "%c", 0xa3);
else if((toto[0]=='^') && (toto[1]=='R')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFFFF, 1, "%c", 0xa4);
else GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFFFF, 1, toto);
if(WPADDown & but) {
*resdown=indice;
}
@ -81,12 +80,10 @@ void GRRLIB_addon_Button(int indice, int x,int y,u32 col, int wpadx, int wpady,
}
}
else {
GRRLIB_SetColorRGBA(0xFFFFFF77);
if((toto[0]=='^') && (toto[1]=='U')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, "%c", 0xa1);
else if((toto[0]=='^') && (toto[1]=='D')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, "%c", 0xa2);
else if((toto[0]=='^') && (toto[1]=='L')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, "%c", 0xa3);
else if((toto[0]=='^') && (toto[1]=='R')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, "%c", 0xa4);
else GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, toto);
GRRLIB_SetColorRGBA(0xFFFFFFFF);
if((toto[0]=='^') && (toto[1]=='U')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, "%c", 0xa1);
else if((toto[0]=='^') && (toto[1]=='D')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, "%c", 0xa2);
else if((toto[0]=='^') && (toto[1]=='L')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, "%c", 0xa3);
else if((toto[0]=='^') && (toto[1]=='R')) GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, "%c", 0xa4);
else GRRLIB_Printf(x+4, y+2, tex_GRRLIBfont, 0xFFFFFF77, 1, toto);
}
}

View file

@ -44,8 +44,8 @@ int main() {
GRRLIB_addon_Button(3, 100,180,0x00FFFFFF, wpadx, wpady, WPADDown, WPADHeld, WPAD_BUTTON_A, &resdown, &resheld, " My Third Button ");
GRRLIB_addon_Button(4, 100,260,0xCCCCCCFF, wpadx, wpady, WPADDown, WPADHeld, WPAD_BUTTON_A, &resdown, &resheld, " -- QuIt -- ");
GRRLIB_Printf(100, 310, tex_GRRLIBfont, "button down : %d",resdown);
GRRLIB_Printf(100, 330, tex_GRRLIBfont, "button held : %d",resheld);
GRRLIB_Printf(100, 310, tex_GRRLIBfont, 0xFFFFFFFF, 1, "button down : %d",resdown);
GRRLIB_Printf(100, 330, tex_GRRLIBfont, 0xFFFFFFFF, 1, "button held : %d",resheld);
if(resdown==4){
exit(0);
@ -53,7 +53,7 @@ int main() {
resdown=0,resheld=0;
GRRLIB_DrawImg(wpadx-32, wpady-32, tex_pointer);
GRRLIB_DrawImg(wpadx-32, wpady-32, tex_pointer , 0, 1, 1, 0xFFFFFFFF );
GRRLIB_Render();
}

View file

@ -85,37 +85,33 @@ int main() {
SY = 240 + (cos(DegToRad(Step*3)) * 100);
// Draw Stage
GRRLIB_SetColorRGBA(RGBA(255, 255, 255, 255));
GRRLIB_DrawImg( 0, 0, GFX_Background );
GRRLIB_DrawImg( 0, 0, GFX_Background, 0, 1, 1, RGBA(255, 255, 255, 255) );
GRRLIB_SetBlend( (Blending+1) ); Color = 255;
switch (Stage) {
case 2: Color = 160; break;
case 3: Color = 128; break;
case 4: Color = 64; break;
}
GRRLIB_SetColorRGBA(RGBA(Color, Color, Color, 255));
GRRLIB_DrawImg( SX, SY, GFX_Blob[BlobType] );
GRRLIB_DrawImg( SX, SY, GFX_Blob[BlobType], 0, 1, 1, RGBA(Color, Color, Color, 255) );
// IR Pointer
if (P1Mote.state == 1) {
GRRLIB_DrawImg( P1MX, P1MY, GFX_Blob[BlobType] );
GRRLIB_DrawImg( P1MX, P1MY, GFX_Blob[BlobType], 0, 1, 1, RGBA(Color, Color, Color, 255) );
}
// Draw Text
GRRLIB_SetBlend ( GRRLIB_BLEND_ALPHA );
GRRLIB_SetColorRGBA( RGBA(0, 0, 0, 160) );
GRRLIB_Rectangle( 28, 28, 480 + 16, 76, 1 );
GRRLIB_SetColorRGBA(0xFFFFFFFF);
GRRLIB_Printf ( 32, 32, GFX_Font, "Point your WiiMote on the screen." );
GRRLIB_Printf ( 32, 48, GFX_Font, "Press LEFT and RIGHT to switch through the different stages." );
GRRLIB_Printf ( 32, 64, GFX_Font, "Press A to change the blob sprite." );
GRRLIB_Rectangle( 28, 28, 480 + 16, 76, RGBA(0, 0, 0, 160), 1 );
GRRLIB_Printf ( 32, 32, GFX_Font, 0xFFFFFFFF, 1, "Point your WiiMote on the screen." );
GRRLIB_Printf ( 32, 48, GFX_Font, 0xFFFFFFFF, 1, "Press LEFT and RIGHT to switch through the different stages." );
GRRLIB_Printf ( 32, 64, GFX_Font, 0xFFFFFFFF, 1, "Press A to change the blob sprite." );
switch (Stage) {
case 0: GRRLIB_Printf( 32, 88, GFX_Font, "Stage 1: Additive Blending" ); Blending = 0; break;
case 1: GRRLIB_Printf( 32, 88, GFX_Font, "Stage 2: Alpha Light Blending" ); Blending = 1; break;
case 2: GRRLIB_Printf( 32, 88, GFX_Font, "Stage 3: Multiply Blending (75%)" ); Blending = 2; break;
case 3: GRRLIB_Printf( 32, 88, GFX_Font, "Stage 4: Multiply Blending (50%)" ); Blending = 2; break;
case 4: GRRLIB_Printf( 32, 88, GFX_Font, "Stage 5: Multiply Blending (25%)" ); Blending = 2; break;
case 5: GRRLIB_Printf( 32, 88, GFX_Font, "Stage 6: Invert Color Blending" ); Blending = 3; break;
case 0: GRRLIB_Printf( 32, 88, GFX_Font, 0xFFFFFFFF, 1, "Stage 1: Additive Blending" ); Blending = 0; break;
case 1: GRRLIB_Printf( 32, 88, GFX_Font, 0xFFFFFFFF, 1, "Stage 2: Alpha Light Blending" ); Blending = 1; break;
case 2: GRRLIB_Printf( 32, 88, GFX_Font, 0xFFFFFFFF, 1, "Stage 3: Multiply Blending (75%)" ); Blending = 2; break;
case 3: GRRLIB_Printf( 32, 88, GFX_Font, 0xFFFFFFFF, 1, "Stage 4: Multiply Blending (50%)" ); Blending = 2; break;
case 4: GRRLIB_Printf( 32, 88, GFX_Font, 0xFFFFFFFF, 1, "Stage 5: Multiply Blending (25%)" ); Blending = 2; break;
case 5: GRRLIB_Printf( 32, 88, GFX_Font, 0xFFFFFFFF, 1, "Stage 6: Invert Color Blending" ); Blending = 3; break;
}
GRRLIB_Render();

View file

@ -118,8 +118,7 @@ int main() {
P1MY = P1Mote.sy - 150;
// Drawing Background
GRRLIB_SetColorRGBA( RGBA(255, 255, 255, 255) );
GRRLIB_DrawImg( 0, 0, GFX_Background );
GRRLIB_DrawImg( 0, 0, GFX_Background, 0, 1, 1, RGBA(255, 255, 255, 255) );
// Add any pending objects into the main container
if (ParticleListTmp.size()) {
@ -132,10 +131,7 @@ int main() {
// Update and draw all particles
for (vector<Particle *>::iterator PartIter = ParticleList.begin(); PartIter != ParticleList.end();) {
if (updateParticle((*PartIter)) == true) {
GRRLIB_SetColorRGBA( RGBA( (*PartIter)->red, (*PartIter)->green, (*PartIter)->blue, GRRLIB_ClampVar8((*PartIter)->alpha*255) ) );
GRRLIB_SetScale ( (*PartIter)->scale, (*PartIter)->scale );
GRRLIB_SetRotation ( (*PartIter)->rot );
GRRLIB_DrawImg( (*PartIter)->x, (*PartIter)->y, (*PartIter)->tex );
GRRLIB_DrawImg( (*PartIter)->x, (*PartIter)->y, (*PartIter)->tex, (*PartIter)->rot, (*PartIter)->scale, (*PartIter)->scale, RGBA( (*PartIter)->red, (*PartIter)->green, (*PartIter)->blue, GRRLIB_ClampVar8((*PartIter)->alpha*255) ) );
} else {
free( (*PartIter) );
ParticleList.erase(PartIter);
@ -146,22 +142,15 @@ int main() {
}
// Draw Crosshair
GRRLIB_ResetSettings();
GRRLIB_DrawImg( P1MX, P1MY, GFX_Crosshair );
GRRLIB_DrawImg( P1MX, P1MY, GFX_Crosshair, 0, 1, 1, RGBA(255, 255, 255, 255) );
// Draw Text
GRRLIB_SetColorRGBA( RGBA(0, 0, 0, 160) );
GRRLIB_Rectangle( 28, 28, 280, 20, 1 );
GRRLIB_SetColorRGBA( 0xFFFFFFFF );
GRRLIB_Printf ( 32, 32, GFX_Font, "Point your WiiMote on the screen." );
GRRLIB_SetColorRGBA( RGBA(0, 0, 0, 160) );
GRRLIB_Rectangle( 28, 48, 200, 16, 1 );
GRRLIB_SetColorRGBA( 0xFFFFFFFF );
GRRLIB_Printf ( 32, 48, GFX_Font, "Number of Particle: %d", ParticleCnt );
GRRLIB_SetColorRGBA( RGBA(0, 0, 0, 160) );
GRRLIB_Rectangle( 28, 64, 64, 16, 1 );
GRRLIB_SetColorRGBA( 0xFFFFFFFF );
GRRLIB_Printf ( 32, 64, GFX_Font, "FPS: %d", FPS );
GRRLIB_Rectangle( 28, 28, 280, 20, RGBA(0, 0, 0, 160), 1 );
GRRLIB_Printf ( 32, 32, GFX_Font, 0xFFFFFFFF, 1, "Point your WiiMote on the screen." );
GRRLIB_Rectangle( 28, 48, 200, 16, RGBA(0, 0, 0, 160), 1 );
GRRLIB_Printf ( 32, 48, GFX_Font, 0xFFFFFFFF, 1, "Number of Particle: %d", ParticleCnt );
GRRLIB_Rectangle( 28, 64, 64, 16, RGBA(0, 0, 0, 160), 1 );
GRRLIB_Printf ( 32, 64, GFX_Font, 0xFFFFFFFF, 1, "FPS: %d", FPS );
// Renders the Scene
GRRLIB_Render();