diff --git a/vendor/librw/src/gl/gl3raster.cpp b/vendor/librw/src/gl/gl3raster.cpp index 71545b1..d3bbc48 100644 --- a/vendor/librw/src/gl/gl3raster.cpp +++ b/vendor/librw/src/gl/gl3raster.cpp @@ -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 { diff --git a/vendor/librw/src/gles1/gl1raster.cpp b/vendor/librw/src/gles1/gl1raster.cpp index 8e7a0fd..571efe3 100644 --- a/vendor/librw/src/gles1/gl1raster.cpp +++ b/vendor/librw/src/gles1/gl1raster.cpp @@ -453,7 +453,7 @@ void rasterUnlock(Raster *raster, int32 level){ // flip vertical (igual que antes) { int stride = raster->width * natras->bpp; - uint8_t *tmp = (uint8_t*)rwMalloc(stride); + uint8_t *tmp = (uint8_t*)rwMalloc(stride, MEMDUR_FUNCTION | ID_DRIVER); for(int y = 0; y < raster->height / 2; y++){ uint8_t *a = (uint8_t*)raster->pixels + y * stride; uint8_t *b = (uint8_t*)raster->pixels + (raster->height - 1 - y) * stride; @@ -461,13 +461,13 @@ void rasterUnlock(Raster *raster, int32 level){ memcpy(a, b, stride); memcpy(b, tmp, stride); } - free(tmp); + rwFree(tmp); } if(!natras->isCompressed){ if(natras->format == GL_RGBA && natras->type == GL_UNSIGNED_BYTE){ // convertir RGBA8888 → RGBA4444 - uint16_t *pixels16 = (uint16_t*)rwMalloc(raster->width * raster->height * 2); + uint16_t *pixels16 = (uint16_t*)rwMalloc(raster->width * raster->height * 2, MEMDUR_FUNCTION | ID_DRIVER); uint8_t *pixels8 = (uint8_t*)raster->pixels; for(int i = 0; i < raster->width * raster->height; i++){ uint8_t r = pixels8[i*4+0]; @@ -479,7 +479,7 @@ void rasterUnlock(Raster *raster, int32 level){ 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); } else { glTexImage2D(GL_TEXTURE_2D, level, natras->internalFormat, raster->width, raster->height, 0,