diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d34b2e2..fca87ab 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,5 +1,11 @@ { "name": "devkitPPC", "image": "devkitpro/devkitppc:latest", - "extensions": ["ms-vscode.cpptools"] + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools" + ] + } + } } diff --git a/GRRLIB/GRRLIB/GRRLIB_print.c b/GRRLIB/GRRLIB/GRRLIB_print.c index 73b8bff..fb7f86c 100644 --- a/GRRLIB/GRRLIB/GRRLIB_print.c +++ b/GRRLIB/GRRLIB/GRRLIB_print.c @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------------ -Copyright (c) 2009-2019 The GRRLIB Team +Copyright (c) 2009-2023 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 @@ -43,16 +43,15 @@ void GRRLIB_Printf (const f32 xpos, const f32 ypos, return; } - int i, size; char tmp[1024]; f32 offset = tex->tilew * zoom; va_list argp; va_start(argp, text); - size = vsnprintf(tmp, sizeof(tmp), text, argp); + const int size = vsnprintf(tmp, sizeof(tmp), text, argp); va_end(argp); - for (i = 0; i < size; i++) { + for (int i = 0; i < size; i++) { GRRLIB_DrawTile(xpos+i*offset, ypos, tex, 0, zoom, zoom, color, tmp[i] - tex->tilestart); } @@ -70,22 +69,20 @@ 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, ...) { - u32 i, size; - u8 x, y; char tmp[1024]; f32 xoff = xpos; const GRRLIB_bytemapChar *pchar; va_list argp; va_start(argp, text); - size = vsnprintf(tmp, sizeof(tmp), text, argp); + const u32 size = vsnprintf(tmp, sizeof(tmp), text, argp); va_end(argp); - for (i=0; icharDef[(u8)tmp[i]]; u8 *pdata = pchar->data; - for (y=0; yheight; y++) { - for (x=0; xwidth; x++) { + for (u8 y = 0; yheight; y++) { + for (u8 x = 0; xwidth; x++) { if (*pdata) { GRRLIB_Plot(xoff + x + pchar->relx, ypos + y + pchar->rely, diff --git a/GRRLIB/GRRLIB/GRRLIB_ttf.c b/GRRLIB/GRRLIB/GRRLIB_ttf.c index 06b71f7..78747ce 100644 --- a/GRRLIB/GRRLIB/GRRLIB_ttf.c +++ b/GRRLIB/GRRLIB/GRRLIB_ttf.c @@ -1,5 +1,5 @@ /*------------------------------------------------------------------------------ -Copyright (c) 2009-2020 The GRRLIB Team +Copyright (c) 2009-2023 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 @@ -133,7 +133,9 @@ void GRRLIB_PrintfTTFW(int x, int y, GRRLIB_ttfFont *myFont, const wchar_t *utf3 FT_GlyphSlot slot = Face->glyph; FT_UInt glyphIndex; FT_UInt previousGlyph = 0; - u8 cR = R(color), cG = G(color), cB = B(color); + const u8 cR = R(color); + const u8 cG = G(color); + const u8 cB = B(color); if (FT_Set_Pixel_Sizes(Face, 0, fontSize) != 0) { FT_Set_Pixel_Sizes(Face, 0, 12);