[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50115] trunk/blender/source/blender: Fix part of #32377: TIFF not saving on windows to paths with special characters,
Brecht Van Lommel
brechtvanlommel at pandora.be
Wed Aug 22 15:10:37 CEST 2012
Revision: 50115
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50115
Author: blendix
Date: 2012-08-22 13:10:37 +0000 (Wed, 22 Aug 2012)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/blender/source/blender/imbuf/intern/dds/dds_api.cpp
trunk/blender/source/blender/imbuf/intern/tiff.c
trunk/blender/source/blender/makesrna/intern/rna_scene.c
Modified: trunk/blender/source/blender/imbuf/intern/dds/dds_api.cpp
===================================================================
--- trunk/blender/source/blender/imbuf/intern/dds/dds_api.cpp 2012-08-22 13:03:54 UTC (rev 50114)
+++ trunk/blender/source/blender/imbuf/intern/dds/dds_api.cpp 2012-08-22 13:10:37 UTC (rev 50115)
@@ -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 @@
#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,8 +52,16 @@
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 ";
fildes.close();
Modified: trunk/blender/source/blender/imbuf/intern/tiff.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/tiff.c 2012-08-22 13:03:54 UTC (rev 50114)
+++ trunk/blender/source/blender/imbuf/intern/tiff.c 2012-08-22 13:10:37 UTC (rev 50115)
@@ -59,8 +59,10 @@
#include "tiffio.h"
+#ifdef WIN32
+#include "utfconv.h"
+#endif
-
/***********************
* Local declarations. *
***********************/
@@ -712,7 +714,13 @@
}
else {
/* create image as a file */
+#ifdef WIN32
+ wchar_t *wname = alloc_utf16_from_8(name, 0);
+ image = TIFFOpenW(wname, "w");
+ free(wname);
+#else
image = TIFFOpen(name, "w");
+#endif
}
if (image == NULL) {
fprintf(stderr,
Modified: trunk/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_scene.c 2012-08-22 13:03:54 UTC (rev 50114)
+++ trunk/blender/source/blender/makesrna/intern/rna_scene.c 2012-08-22 13:10:37 UTC (rev 50115)
@@ -209,7 +209,7 @@
#define IMAGE_TYPE_ITEMS_IMAGE_ONLY \
R_IMF_ENUM_BMP \
- R_IMF_ENUM_DDS \
+ /* DDS save not supported yet R_IMF_ENUM_DDS */ \
R_IMF_ENUM_IRIS \
R_IMF_ENUM_PNG \
R_IMF_ENUM_JPEG \
More information about the Bf-blender-cvs
mailing list