Remove deprecated use of register keyword

This commit is contained in:
Crayon2000 2021-05-26 07:57:11 -04:00
parent 7db60f3fd5
commit 11b673056b
4 changed files with 14 additions and 10 deletions

View file

@ -2,6 +2,10 @@
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]
-
## [4.4.1] - 2021-03-05 ## [4.4.1] - 2021-03-05
- Patch widescreen on Wii U. - Patch widescreen on Wii U.
@ -107,6 +111,7 @@ All notable changes to this project will be documented in this file.
- New Bitmap FX - New Bitmap FX
- Add `GRRLIB_Exit()` to free the memory allocated by GRRLIB - 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.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.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 [4.3.2]: https://github.com/GRRLIB/GRRLIB/compare/4.3.1...4.3.2

View file

@ -185,9 +185,9 @@ GRRLIB_texImg* GRRLIB_LoadTexturePNG (const u8 *my_png) {
* @return An array of palette. Memory must be deleted. * @return An array of palette. Memory must be deleted.
*/ */
static RGBQUAD* GRRLIB_CreatePalette (const u8 *my_bmp, u32 Size) { static RGBQUAD* GRRLIB_CreatePalette (const u8 *my_bmp, u32 Size) {
u32 n, i = 0; u32 i = 0;
RGBQUAD *Palette = calloc(Size, sizeof(RGBQUAD)); RGBQUAD *Palette = calloc(Size, sizeof(RGBQUAD));
for(n=0; n<Size; n++) { for(u32 n=0; n<Size; n++) {
Palette[n].rgbBlue = my_bmp[i]; Palette[n].rgbBlue = my_bmp[i];
Palette[n].rgbGreen = my_bmp[i+1]; Palette[n].rgbGreen = my_bmp[i+1];
Palette[n].rgbRed = my_bmp[i+2]; Palette[n].rgbRed = my_bmp[i+2];

View file

@ -1,5 +1,5 @@
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
Copyright (c) 2009-2017 The GRRLIB Team Copyright (c) 2009-2021 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
@ -40,9 +40,9 @@ THE SOFTWARE.
INLINE INLINE
u32 GRRLIB_GetPixelFromtexImg (const int x, const int y, u32 GRRLIB_GetPixelFromtexImg (const int x, const int y,
const GRRLIB_texImg *tex) { const GRRLIB_texImg *tex) {
register u32 offs; u32 offs;
register u32 ar; u32 ar;
register u8* bp = (u8*)tex->data; u8* bp = (u8*)tex->data;
offs = (((y&(~3))<<2)*tex->w) + ((x&(~3))<<4) + ((((y&3)<<2) + (x&3)) <<1); 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 INLINE
void GRRLIB_SetPixelTotexImg (const int x, const int y, void GRRLIB_SetPixelTotexImg (const int x, const int y,
GRRLIB_texImg *tex, const u32 color) { GRRLIB_texImg *tex, const u32 color) {
register u32 offs; u32 offs;
register u8* bp = (u8*)tex->data; u8* bp = (u8*)tex->data;
offs = (((y&(~3))<<2)*tex->w) + ((x&(~3))<<4) + ((((y&3)<<2) + (x&3)) <<1); offs = (((y&(~3))<<2)*tex->w) + ((x&(~3))<<4) + ((((y&3)<<2) + (x&3)) <<1);

View file

@ -150,7 +150,6 @@ int main() {
} }
static void createEffect( u8 id, int _x, int _y ) { static void createEffect( u8 id, int _x, int _y ) {
u8 _ColorAdd = 0;
switch (id) { switch (id) {
case EFFECT_SMOKEBOMB: case EFFECT_SMOKEBOMB:
for (u8 i = 0; i < 5; i++) { 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 ); createParticle( 3, (_x + (RANDOM * 50)), (_y + (RANDOM * 50)), 1.25f, 1.5f, 92, 92, 92 );
} }
for (u8 i = 0; i < 5; i++) { 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 ); createParticle( 2, (_x + (RANDOM * 40)), (_y + (RANDOM * 40)), (1.0f+(RANDOM*0.20)), 1.0f, 128+_ColorAdd, 128+_ColorAdd, 128+_ColorAdd );
} }
break; break;