Fix virtual keyboard so that it can get allocated as a 4bpp texture

This commit is contained in:
UnknownShadow200 2025-07-14 22:49:47 +10:00
parent 027c6a8fb7
commit 157c538a08
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;