From 157c538a083b88d9932790fb220ad4c07e5846f5 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 14 Jul 2025 22:49:47 +1000 Subject: [PATCH] Fix virtual keyboard so that it can get allocated as a 4bpp texture --- src/VirtualKeyboard.h | 2 +- src/ps2/Graphics_PS2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VirtualKeyboard.h b/src/VirtualKeyboard.h index e342d78ea..95512a35f 100644 --- a/src/VirtualKeyboard.h +++ b/src/VirtualKeyboard.h @@ -157,7 +157,7 @@ static void VirtualKeyboard_Draw(struct Context2D* ctx) { w = kb_tileWidth * KB_GetCellWidth(i); h = kb_tileHeight; - Gradient_Noise(ctx, i == selected ? KB_SELECTED_COLOR : KB_NORMAL_COLOR, 4, x, y, w, h); + Gradient_Noise(ctx, i == selected ? KB_SELECTED_COLOR : KB_NORMAL_COLOR, 2, x, y, w, h); LWidget_DrawBorder(ctx, KB_BACKGROUND_COLOR, 1, 1, x, y, w, h); dx = (w - Drawer2D_TextWidth (&args)) / 2; diff --git a/src/ps2/Graphics_PS2.c b/src/ps2/Graphics_PS2.c index 4b403a231..aeb5ef898 100644 --- a/src/ps2/Graphics_PS2.c +++ b/src/ps2/Graphics_PS2.c @@ -464,7 +464,7 @@ GfxResourceID Gfx_AllocTexture(struct Bitmap* bmp, int rowWidth, cc_uint8 flags, tex->pal_index = pal_index; ConvertTexture_Palette((cc_uint8*)tex->pixels, bmp, rowWidth, palette, pal_count); - int size = VRAM_Size(tex->width, max(32, 1 << tex->log2_h), GS_PSM_4HH); + int size = VRAM_Size(tex->width, ALIGNUP(tex->height, 32), GS_PSM_4HH); // TODO fix properly. alignup instead int blocks = SIZE_TO_BLOCKS(size, TEXMEM_BLOCK_SIZE); tex->blocks = blocks;