From 11b673056b11c960dde32188c34729c7140fcce9 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Wed, 26 May 2021 07:57:11 -0400 Subject: [PATCH] Remove deprecated use of register keyword --- CHANGELOG.md | 5 +++++ GRRLIB/GRRLIB/GRRLIB_texEdit.c | 4 ++-- GRRLIB/GRRLIB/grrlib/GRRLIB_pixel.h | 12 ++++++------ examples/particle/source/main.cpp | 3 +-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcc9e31..768c637 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [Unreleased] + +- + ## [4.4.1] - 2021-03-05 - Patch widescreen on Wii U. @@ -107,6 +111,7 @@ All notable changes to this project will be documented in this file. - New Bitmap FX - Add `GRRLIB_Exit()` to free the memory allocated by GRRLIB +[unreleased]: https://github.com/GRRLIB/GRRLIB/compare/v4.4.1...HEAD [4.4.1]: https://github.com/GRRLIB/GRRLIB/compare/v4.4.0...v4.4.1 [4.4.0]: https://github.com/GRRLIB/GRRLIB/compare/4.3.2...v4.4.0 [4.3.2]: https://github.com/GRRLIB/GRRLIB/compare/4.3.1...4.3.2 diff --git a/GRRLIB/GRRLIB/GRRLIB_texEdit.c b/GRRLIB/GRRLIB/GRRLIB_texEdit.c index 6ae1dc2..adcfd43 100644 --- a/GRRLIB/GRRLIB/GRRLIB_texEdit.c +++ b/GRRLIB/GRRLIB/GRRLIB_texEdit.c @@ -185,9 +185,9 @@ GRRLIB_texImg* GRRLIB_LoadTexturePNG (const u8 *my_png) { * @return An array of palette. Memory must be deleted. */ static RGBQUAD* GRRLIB_CreatePalette (const u8 *my_bmp, u32 Size) { - u32 n, i = 0; + u32 i = 0; RGBQUAD *Palette = calloc(Size, sizeof(RGBQUAD)); - for(n=0; ndata; + u32 offs; + u32 ar; + u8* bp = (u8*)tex->data; offs = (((y&(~3))<<2)*tex->w) + ((x&(~3))<<4) + ((((y&3)<<2) + (x&3)) <<1); @@ -61,8 +61,8 @@ u32 GRRLIB_GetPixelFromtexImg (const int x, const int y, INLINE void GRRLIB_SetPixelTotexImg (const int x, const int y, GRRLIB_texImg *tex, const u32 color) { - register u32 offs; - register u8* bp = (u8*)tex->data; + u32 offs; + u8* bp = (u8*)tex->data; offs = (((y&(~3))<<2)*tex->w) + ((x&(~3))<<4) + ((((y&3)<<2) + (x&3)) <<1); diff --git a/examples/particle/source/main.cpp b/examples/particle/source/main.cpp index 3191953..a59db65 100644 --- a/examples/particle/source/main.cpp +++ b/examples/particle/source/main.cpp @@ -150,7 +150,6 @@ int main() { } static void createEffect( u8 id, int _x, int _y ) { - u8 _ColorAdd = 0; switch (id) { case EFFECT_SMOKEBOMB: for (u8 i = 0; i < 5; i++) { @@ -160,7 +159,7 @@ static void createEffect( u8 id, int _x, int _y ) { createParticle( 3, (_x + (RANDOM * 50)), (_y + (RANDOM * 50)), 1.25f, 1.5f, 92, 92, 92 ); } for (u8 i = 0; i < 5; i++) { - _ColorAdd = (RANDOM * 75); + u8 _ColorAdd = (RANDOM * 75); createParticle( 2, (_x + (RANDOM * 40)), (_y + (RANDOM * 40)), (1.0f+(RANDOM*0.20)), 1.0f, 128+_ColorAdd, 128+_ColorAdd, 128+_ColorAdd ); } break;