Use u32 instead uint

This commit is contained in:
Crayon2000 2019-04-10 22:38:11 -04:00
parent 2e2df56a61
commit 29555f8af2
7 changed files with 29 additions and 30 deletions

View file

@ -2,7 +2,9 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
## [Unreleased] ## [Unreleased]
- Fully compatible with devkitPPC release 35 - Removed libpng, zlib, libfreetype and libjpeg from project. These libraries should now be installed with pacman.
- GRRLIB and pngu are now installed into the porlibs folder.
- Removed uint declaration. u32 should be used instead.
## [4.3.2] - 2012-08-12 ## [4.3.2] - 2012-08-12
- libpng was updated to version 1.5.12 - libpng was updated to version 1.5.12

View file

@ -1,5 +1,5 @@
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
Copyright (c) 2009-2017 The GRRLIB Team Copyright (c) 2009-2019 The GRRLIB Team
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -105,8 +105,8 @@ void GRRLIB_FreeBMF (GRRLIB_bytemapFont *bmf) {
* @param tilestart Offset for starting position (Used in fonts). * @param tilestart Offset for starting position (Used in fonts).
*/ */
void GRRLIB_InitTileSet (GRRLIB_texImg *tex, void GRRLIB_InitTileSet (GRRLIB_texImg *tex,
const uint tilew, const uint tileh, const u32 tilew, const u32 tileh,
const uint tilestart) { const u32 tilestart) {
tex->tilew = tilew; tex->tilew = tilew;
tex->tileh = tileh; tex->tileh = tileh;
if (tilew != 0) { // Avoid division by zero if (tilew != 0) { // Avoid division by zero

View file

@ -1,5 +1,5 @@
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
Copyright (c) 2009-2017 The GRRLIB Team Copyright (c) 2009-2019 The GRRLIB Team
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -70,7 +70,7 @@ void GRRLIB_Printf (const f32 xpos, const f32 ypos,
void GRRLIB_PrintBMF (const f32 xpos, const f32 ypos, void GRRLIB_PrintBMF (const f32 xpos, const f32 ypos,
const GRRLIB_bytemapFont *bmf, const GRRLIB_bytemapFont *bmf,
const char *text, ...) { const char *text, ...) {
uint i, size; u32 i, size;
u8 x, y; u8 x, y;
char tmp[1024]; char tmp[1024];
f32 xoff = xpos; f32 xoff = xpos;

View file

@ -1,5 +1,5 @@
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
Copyright (c) 2009-2017 The GRRLIB Team Copyright (c) 2009-2019 The GRRLIB Team
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -76,9 +76,9 @@ typedef struct tagRGBQUAD {
*/ */
static static
void RawTo4x4RGBA (const u8 *src, void *dst, void RawTo4x4RGBA (const u8 *src, void *dst,
const uint width, const uint height) { const u32 width, const u32 height) {
uint block; u32 block;
uint i; u32 i;
u8 c; u8 c;
u8 argb; u8 argb;
@ -115,7 +115,7 @@ void RawTo4x4RGBA (const u8 *src, void *dst,
* @param h Height of the new texture to create. * @param h Height of the new texture to create.
* @return A GRRLIB_texImg structure newly created. * @return A GRRLIB_texImg structure newly created.
*/ */
GRRLIB_texImg* GRRLIB_CreateEmptyTexture (const uint w, const uint h) GRRLIB_texImg* GRRLIB_CreateEmptyTexture (const u32 w, const u32 h)
{ {
GRRLIB_texImg *my_texture = (struct GRRLIB_texImg *)calloc(1, sizeof(GRRLIB_texImg)); GRRLIB_texImg *my_texture = (struct GRRLIB_texImg *)calloc(1, sizeof(GRRLIB_texImg));

View file

@ -1,5 +1,5 @@
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
Copyright (c) 2009-2017 The GRRLIB Team Copyright (c) 2009-2019 The GRRLIB Team
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -52,11 +52,6 @@ THE SOFTWARE.
extern "C" { extern "C" {
#endif /* __cplusplus */ #endif /* __cplusplus */
//==============================================================================
// Extra standard declarations
//==============================================================================
typedef unsigned int uint;/**< The uint keyword signifies an integral type. */
//============================================================================== //==============================================================================
// Primitive colour macros // Primitive colour macros
//============================================================================== //==============================================================================
@ -110,19 +105,19 @@ typedef struct GRRLIB_drawSettings {
* Structure to hold the texture information. * Structure to hold the texture information.
*/ */
typedef struct GRRLIB_texImg { typedef struct GRRLIB_texImg {
uint w; /**< The width of the texture in pixels. */ u32 w; /**< The width of the texture in pixels. */
uint h; /**< The height of the texture in pixels. */ u32 h; /**< The height of the texture in pixels. */
int handlex; /**< Texture handle x. */ int handlex; /**< Texture handle x. */
int handley; /**< Texture handle y. */ int handley; /**< Texture handle y. */
int offsetx; /**< Texture offset x. */ int offsetx; /**< Texture offset x. */
int offsety; /**< Texture offset y. */ int offsety; /**< Texture offset y. */
bool tiledtex; /**< Texture is tiled if set to true. */ bool tiledtex; /**< Texture is tiled if set to true. */
uint tilew; /**< The width of one tile in pixels. */ u32 tilew; /**< The width of one tile in pixels. */
uint tileh; /**< The height of one tile in pixels. */ u32 tileh; /**< The height of one tile in pixels. */
uint nbtilew; /**< Number of tiles for the x axis. */ u32 nbtilew; /**< Number of tiles for the x axis. */
uint nbtileh; /**< Number of tiles for the y axis. */ u32 nbtileh; /**< Number of tiles for the y axis. */
uint tilestart; /**< Offset to tile starting position. */ u32 tilestart; /**< Offset to tile starting position. */
f32 ofnormaltexx;/**< Offset of normalized texture on x. */ f32 ofnormaltexx;/**< Offset of normalized texture on x. */
f32 ofnormaltexy;/**< Offset of normalized texture on y. */ f32 ofnormaltexy;/**< Offset of normalized texture on y. */

View file

@ -1,5 +1,5 @@
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
Copyright (c) 2009-2017 The GRRLIB Team Copyright (c) 2009-2019 The GRRLIB Team
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@ -47,8 +47,8 @@ GRRLIB_bytemapFont* GRRLIB_LoadBMF (const u8 my_bmf[] );
void GRRLIB_FreeBMF (GRRLIB_bytemapFont *bmf); void GRRLIB_FreeBMF (GRRLIB_bytemapFont *bmf);
void GRRLIB_InitTileSet (GRRLIB_texImg *tex, void GRRLIB_InitTileSet (GRRLIB_texImg *tex,
const uint tilew, const uint tileh, const u32 tilew, const u32 tileh,
const uint tilestart); const u32 tilestart);
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// GRRLIB_bmfx.c - Bitmap f/x // GRRLIB_bmfx.c - Bitmap f/x
@ -133,7 +133,7 @@ void GRRLIB_CompoEnd(int posx, int posy, GRRLIB_texImg *tex);
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// GRRLIB_texEdit.c - Modifying the content of a texture // GRRLIB_texEdit.c - Modifying the content of a texture
GRRLIB_texImg* GRRLIB_CreateEmptyTexture (const uint w, const uint h); GRRLIB_texImg* GRRLIB_CreateEmptyTexture (const u32 w, const u32 h);
GRRLIB_texImg* GRRLIB_LoadTexture (const u8 *my_img); GRRLIB_texImg* GRRLIB_LoadTexture (const u8 *my_img);
GRRLIB_texImg* GRRLIB_LoadTexturePNG (const u8 *my_png); GRRLIB_texImg* GRRLIB_LoadTexturePNG (const u8 *my_png);
GRRLIB_texImg* GRRLIB_LoadTextureJPG (const u8 *my_jpg); GRRLIB_texImg* GRRLIB_LoadTextureJPG (const u8 *my_jpg);

View file

@ -142,7 +142,7 @@ int main() {
createEffect( EFFECT_SMOKEBOMB, P1MX, P1MY ); createEffect( EFFECT_SMOKEBOMB, P1MX, P1MY );
} }
if (WPADKeyDown & WPAD_BUTTON_HOME) { if (WPADKeyDown & WPAD_BUTTON_HOME) {
ExitGame(); break;
} }
} }
ExitGame(); ExitGame();
@ -233,7 +233,9 @@ static bool updateParticle( Particle *part ) {
part->blue *= part->scolor; part->blue *= part->scolor;
break; break;
} }
if ((part->scale < 0) || (part->alpha < 0)) { return false; } if ((part->scale < 0) || (part->alpha < 0)) {
return false;
}
return true; return true;
} }