diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-08-22 17:10:37 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-08-22 17:10:37 +0400 |
commit | 61dddcb800963390b348c977d307bec3620a443a (patch) | |
tree | 32f9451d7c56e637f94bcee014f8872ea91e6c40 /source/blender/imbuf/intern/dds/dds_api.cpp | |
parent | 10b983002f953f88ca84bc418d339a8096e3cef4 (diff) |
Fix part of #32377: TIFF not saving on windows to paths with special characters,
and DDS should not be in the list of file types because we can only load those
currently.
Diffstat (limited to 'source/blender/imbuf/intern/dds/dds_api.cpp')
-rw-r--r-- | source/blender/imbuf/intern/dds/dds_api.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/imbuf/intern/dds/dds_api.cpp b/source/blender/imbuf/intern/dds/dds_api.cpp index fba326f7865..1aaeb4766e1 100644 --- a/source/blender/imbuf/intern/dds/dds_api.cpp +++ b/source/blender/imbuf/intern/dds/dds_api.cpp @@ -32,6 +32,10 @@ #include <stdio.h> // printf #include <fstream> +#ifdef WIN32 +#include "utfconv.h" +#endif + extern "C" { #include "imbuf.h" @@ -39,7 +43,6 @@ extern "C" { #include "IMB_imbuf.h" #include "IMB_allocimbuf.h" - int imb_save_dds(struct ImBuf * ibuf, const char *name, int flags) { return(0); /* todo: finish this function */ @@ -49,7 +52,15 @@ int imb_save_dds(struct ImBuf * ibuf, const char *name, int flags) if (ibuf->rect == 0) return (0); /* open file for writing */ - std::ofstream fildes(name); + std::ofstream fildes; + +#ifdef WIN32 + wchar_t *wname = alloc_utf16_from_8(name, 0); + fildes.open(wname); + free(wname); +#else + fildes.open(name); +#endif /* write header */ fildes << "DDS "; |