sf2dlib
sf2dlib copied to clipboard
Images 32x32 and under cause hang at creation/loading
Ever since sf2d_texture_tile32_hardware was added, any image I use that is 32x32 or under causes any program I use sf2d for to crash or hang. Changing TEX_MIN_SIZE to 64 seems to fix this, but I just want to be 100% sure that won't break any other programs that use sf2d first.
Do you create the textures and tile them manually or do you use https://github.com/xerpi/sfillib ?
I export them from gimp to c source files and load them like you do in your sample. I only use 3, so I never bothered with romfs and sfilib. After messing with the load order, I found that the two that are 16x16 and 2x16 would cause sf2d_create_texture_mem_RGBA8 to hang. My text box texture I use is 48x56 and it works fine.
The only reason it's an issue now is because of ctrulib dropping the depreciated GPU functions. Before, I'd just point users to the last version that worked. Unfortunately, that one doesn't build anymore.
I switched to sfillib, and it does work with smaller textures without any modifications to sf2d. It seems like it's only if you create them from memory and they're smaller than 32x32.
I had the same problem. I have fixed it locally by changing TEX_MIN_SIZE to 64. However, other people that have not patched TEX_MIN_SIZE manually won't be able to build my code. Is there any reason that TEX_MIN_SIZE has not been changed yet?