This commit is contained in:
Shinovon 2026-05-12 09:01:52 +05:00
parent dfdd037ed3
commit 6c644421fd
2 changed files with 6 additions and 6 deletions

View file

@ -630,7 +630,7 @@ rasterUnlock(Raster *raster, int32 level)
#endif
) {
// convert to 16-bit
uint16_t* pixels16 = (uint16_t*)rwMalloc(raster->width * raster->height * sizeof(uint16_t));
uint16_t* pixels16 = (uint16_t*)rwMalloc(raster->width * raster->height * sizeof(uint16_t), MEMDUR_FUNCTION | ID_DRIVER);
uint8_t* pixels8 = (uint8_t*)raster->pixels;
for (int i = 0; i < raster->width * raster->height; i++) {
@ -642,7 +642,7 @@ rasterUnlock(Raster *raster, int32 level)
pixels16[i] = ((r >> 4) << 12) | ((g >> 4) << 8) | ((b >> 4) << 4) | (a >> 4);
}
glTexImage2D(GL_TEXTURE_2D, level, GL_RGBA, raster->width, raster->height, 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, pixels16);
free(pixels16);
rwFree(pixels16);
CHECK_GL_ERROR("glTexImage2D 1");
} else
{