Download SMDH files for badges

Thanks to ThemePlaza for providing these to make browser icons work
Also fixed badge previews by increasing tex size if the preview
image is larger than 512 pixel high
This commit is contained in:
2024-06-02 20:51:39 -04:00
parent 30833995d1
commit df4c81c96d
3 changed files with 13 additions and 11 deletions

View File

@@ -310,6 +310,7 @@ void load_icons_thread(void * void_arg)
bool load_preview_from_buffer(char * row_pointers, u32 size, C2D_Image * preview_image, int * preview_offset, int height)
{
int width = (uint32_t)((size / 4) / height);
u32 tex_height = height > 512 ? 1024 : 512;
free_preview(*preview_image);
@@ -322,10 +323,10 @@ bool load_preview_from_buffer(char * row_pointers, u32 size, C2D_Image * preview
subt3x->left = 0.0f;
subt3x->top = 1.0f;
subt3x->right = width/512.0f;
subt3x->bottom = 1.0-(height/512.0f);
subt3x->bottom = 1.0-(height/tex_height);
preview_image->subtex = subt3x;
C3D_TexInit(preview_image->tex, 512, 512, GPU_RGBA8);
C3D_TexInit(preview_image->tex, 512, tex_height, GPU_RGBA8);
memset(preview_image->tex->data, 0, preview_image->tex->size);