- [FIX] Ajustada la càrrega de textures, per a que quan tenen tamanys raros i s'està usant acceleració hardware

This commit is contained in:
2025-11-18 09:47:35 +01:00
parent 9eae2aa785
commit 618e032284

View File

@@ -58,7 +58,14 @@ namespace draw
int sdl_pitch; int sdl_pitch;
SDL_LockTexture(surf, NULL, (void **)&sdl_pixels, &sdl_pitch); SDL_LockTexture(surf, NULL, (void **)&sdl_pixels, &sdl_pitch);
for (uint32_t i = 0; i < w*h; ++i) sdl_pixels[i] = transparent==pixels[i] ? 0x00000000 : pal[pixels[i]] | 0xff000000; int i=0;
for (int y=0; y<h; ++y) {
for (int x=0; x<w; ++x) {
sdl_pixels[x+y*(sdl_pitch/4)] = transparent==pixels[i] ? 0x00000000 : pal[pixels[i]] | 0xff000000;
i++;
}
}
//for (uint32_t i = 0; i < w*h; ++i) sdl_pixels[i] = transparent==pixels[i] ? 0x00000000 : pal[pixels[i]] | 0xff000000;
SDL_UnlockTexture(surf); SDL_UnlockTexture(surf);
free(pal); free(pal);