Convert stb_image_write.h to Q_fopen() to be able to create screenshots.

This commit is contained in:
Yamagi Burmeister 2018-02-05 18:10:22 +01:00
parent 6b13d77c36
commit 3b810ba51e

View file

@ -276,7 +276,7 @@ static int stbi__start_write_file(stbi__write_context *s, const char *filename)
if (fopen_s(&f, filename, "wb"))
f = NULL;
#else
f = fopen(filename, "wb");
f = Q_fopen(filename, "wb");
#endif
stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f);
return f != NULL;
@ -1108,7 +1108,7 @@ STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const
if (fopen_s(&f, filename, "wb"))
f = NULL;
#else
f = fopen(filename, "wb");
f = Q_fopen(filename, "wb");
#endif
if (!f) { STBIW_FREE(png); return 0; }
fwrite(png, 1, len, f);