From 29555f8af209e54ad25831e34ba6b38d6750d231 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Wed, 10 Apr 2019 22:38:11 -0400 Subject: [PATCH] Use u32 instead uint --- CHANGELOG.md | 4 +++- GRRLIB/GRRLIB/GRRLIB_bmf.c | 6 +++--- GRRLIB/GRRLIB/GRRLIB_print.c | 4 ++-- GRRLIB/GRRLIB/GRRLIB_texEdit.c | 10 +++++----- GRRLIB/GRRLIB/grrlib.h | 21 ++++++++------------- GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h | 8 ++++---- examples/particle/source/main.cpp | 6 ++++-- 7 files changed, 29 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2bbc6a..b1261f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ All notable changes to this project will be documented in this file. ## [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 - libpng was updated to version 1.5.12 diff --git a/GRRLIB/GRRLIB/GRRLIB_bmf.c b/GRRLIB/GRRLIB/GRRLIB_bmf.c index 6a96a0e..9129d0e 100644 --- a/GRRLIB/GRRLIB/GRRLIB_bmf.c +++ b/GRRLIB/GRRLIB/GRRLIB_bmf.c @@ -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 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). */ void GRRLIB_InitTileSet (GRRLIB_texImg *tex, - const uint tilew, const uint tileh, - const uint tilestart) { + const u32 tilew, const u32 tileh, + const u32 tilestart) { tex->tilew = tilew; tex->tileh = tileh; if (tilew != 0) { // Avoid division by zero diff --git a/GRRLIB/GRRLIB/GRRLIB_print.c b/GRRLIB/GRRLIB/GRRLIB_print.c index 54d8ef4..1a98558 100644 --- a/GRRLIB/GRRLIB/GRRLIB_print.c +++ b/GRRLIB/GRRLIB/GRRLIB_print.c @@ -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 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, const GRRLIB_bytemapFont *bmf, const char *text, ...) { - uint i, size; + u32 i, size; u8 x, y; char tmp[1024]; f32 xoff = xpos; diff --git a/GRRLIB/GRRLIB/GRRLIB_texEdit.c b/GRRLIB/GRRLIB/GRRLIB_texEdit.c index d855165..c80b251 100644 --- a/GRRLIB/GRRLIB/GRRLIB_texEdit.c +++ b/GRRLIB/GRRLIB/GRRLIB_texEdit.c @@ -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 of this software and associated documentation files (the "Software"), to deal @@ -76,9 +76,9 @@ typedef struct tagRGBQUAD { */ static void RawTo4x4RGBA (const u8 *src, void *dst, - const uint width, const uint height) { - uint block; - uint i; + const u32 width, const u32 height) { + u32 block; + u32 i; u8 c; u8 argb; @@ -115,7 +115,7 @@ void RawTo4x4RGBA (const u8 *src, void *dst, * @param h Height of the new texture to create. * @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)); diff --git a/GRRLIB/GRRLIB/grrlib.h b/GRRLIB/GRRLIB/grrlib.h index ac1aea8..0ebef43 100644 --- a/GRRLIB/GRRLIB/grrlib.h +++ b/GRRLIB/GRRLIB/grrlib.h @@ -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 of this software and associated documentation files (the "Software"), to deal @@ -52,11 +52,6 @@ THE SOFTWARE. extern "C" { #endif /* __cplusplus */ -//============================================================================== -// Extra standard declarations -//============================================================================== -typedef unsigned int uint;/**< The uint keyword signifies an integral type. */ - //============================================================================== // Primitive colour macros //============================================================================== @@ -110,19 +105,19 @@ typedef struct GRRLIB_drawSettings { * Structure to hold the texture information. */ typedef struct GRRLIB_texImg { - uint w; /**< The width of the texture in pixels. */ - uint h; /**< The height of the texture in pixels. */ + u32 w; /**< The width of the texture in pixels. */ + u32 h; /**< The height of the texture in pixels. */ int handlex; /**< Texture handle x. */ int handley; /**< Texture handle y. */ int offsetx; /**< Texture offset x. */ int offsety; /**< Texture offset y. */ bool tiledtex; /**< Texture is tiled if set to true. */ - uint tilew; /**< The width of one tile in pixels. */ - uint tileh; /**< The height of one tile in pixels. */ - uint nbtilew; /**< Number of tiles for the x axis. */ - uint nbtileh; /**< Number of tiles for the y axis. */ - uint tilestart; /**< Offset to tile starting position. */ + u32 tilew; /**< The width of one tile in pixels. */ + u32 tileh; /**< The height of one tile in pixels. */ + u32 nbtilew; /**< Number of tiles for the x axis. */ + u32 nbtileh; /**< Number of tiles for the y axis. */ + u32 tilestart; /**< Offset to tile starting position. */ f32 ofnormaltexx;/**< Offset of normalized texture on x. */ f32 ofnormaltexy;/**< Offset of normalized texture on y. */ diff --git a/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h b/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h index 6a429c5..27a9e71 100644 --- a/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h +++ b/GRRLIB/GRRLIB/grrlib/GRRLIB__lib.h @@ -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 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_InitTileSet (GRRLIB_texImg *tex, - const uint tilew, const uint tileh, - const uint tilestart); + const u32 tilew, const u32 tileh, + const u32 tilestart); //------------------------------------------------------------------------------ // 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_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_LoadTexturePNG (const u8 *my_png); GRRLIB_texImg* GRRLIB_LoadTextureJPG (const u8 *my_jpg); diff --git a/examples/particle/source/main.cpp b/examples/particle/source/main.cpp index e04dee0..4ea6c03 100644 --- a/examples/particle/source/main.cpp +++ b/examples/particle/source/main.cpp @@ -142,7 +142,7 @@ int main() { createEffect( EFFECT_SMOKEBOMB, P1MX, P1MY ); } if (WPADKeyDown & WPAD_BUTTON_HOME) { - ExitGame(); + break; } } ExitGame(); @@ -233,7 +233,9 @@ static bool updateParticle( Particle *part ) { part->blue *= part->scolor; break; } - if ((part->scale < 0) || (part->alpha < 0)) { return false; } + if ((part->scale < 0) || (part->alpha < 0)) { + return false; + } return true; }