Procházet zdrojové kódy

Review ExportImage() to use SaveFileData() #1779

pull/1780/head
Ray před 3 roky
rodič
revize
4a099c3658
1 změnil soubory, kde provedl 7 přidání a 1 odebrání
  1. +7
    -1
      src/textures.c

+ 7
- 1
src/textures.c Zobrazit soubor

@ -416,7 +416,13 @@ bool ExportImage(Image image, const char *fileName)
}
#if defined(SUPPORT_FILEFORMAT_PNG)
if (IsFileExtension(fileName, ".png")) success = stbi_write_png(fileName, image.width, image.height, channels, imgData, image.width*channels);
if (IsFileExtension(fileName, ".png"))
{
int dataSize = 0;
unsigned char *fileData = stbi_write_png_to_mem((const unsigned char *)imgData, image.width*channels, image.width, image.height, channels, &dataSize);
success = SaveFileData(fileName, fileData, dataSize);
RL_FREE(fileData);
}
#else
if (false) {}
#endif

Načítá se…
Zrušit
Uložit