Fix T50630: Fluid fails on win32 w/ unicode paths
Allow overriding gzip open w/ elbeem.
This commit is contained in:
@@ -107,6 +107,14 @@ add_definitions(
|
|||||||
-DNEWDIRVELMOTEST=0
|
-DNEWDIRVELMOTEST=0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
# We need BLI_gzopen on win32 for unicode paths
|
||||||
|
add_definitions(
|
||||||
|
-DLBM_GZIP_OVERRIDE_H="${CMAKE_SOURCE_DIR}/source/blender/blenlib/BLI_fileops.h"
|
||||||
|
-D LBM_GZIP_OPEN_FN="\(gzFile\)BLI_gzopen"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_OPENMP)
|
if(WITH_OPENMP)
|
||||||
add_definitions(-DPARALLEL=1)
|
add_definitions(-DPARALLEL=1)
|
||||||
else()
|
else()
|
||||||
|
@@ -22,7 +22,11 @@
|
|||||||
|
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
|
||||||
|
#ifdef LBM_GZIP_OVERRIDE_H
|
||||||
|
# include LBM_GZIP_OVERRIDE_H
|
||||||
|
#else
|
||||||
|
# define LBM_GZIP_OPEN_FN(a, b) gzopen(a, b)
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Constructor
|
* Constructor
|
||||||
@@ -141,7 +145,8 @@ int ntlBlenderDumper::renderScene( void )
|
|||||||
std::ostringstream bvelfilename;
|
std::ostringstream bvelfilename;
|
||||||
bvelfilename << boutfilename.str();
|
bvelfilename << boutfilename.str();
|
||||||
bvelfilename << ".bvel.gz";
|
bvelfilename << ".bvel.gz";
|
||||||
gzf = gzopen(bvelfilename.str().c_str(), "wb9");
|
/* wraps gzopen */
|
||||||
|
gzf = LBM_GZIP_OPEN_FN(bvelfilename.str().c_str(), "wb9");
|
||||||
if(gzf) {
|
if(gzf) {
|
||||||
int numVerts;
|
int numVerts;
|
||||||
if(sizeof(numVerts)!=4) { errMsg("ntlBlenderDumper::renderScene","Invalid int size"); return 1; }
|
if(sizeof(numVerts)!=4) { errMsg("ntlBlenderDumper::renderScene","Invalid int size"); return 1; }
|
||||||
@@ -162,7 +167,8 @@ int ntlBlenderDumper::renderScene( void )
|
|||||||
|
|
||||||
// compress all bobj's
|
// compress all bobj's
|
||||||
boutfilename << ".bobj.gz";
|
boutfilename << ".bobj.gz";
|
||||||
gzf = gzopen(boutfilename.str().c_str(), "wb1"); // wb9 is slow for large meshes!
|
/* wraps gzopen */
|
||||||
|
gzf = LBM_GZIP_OPEN_FN(boutfilename.str().c_str(), "wb1"); // wb9 is slow for large meshes!
|
||||||
if (!gzf) {
|
if (!gzf) {
|
||||||
errMsg("ntlBlenderDumper::renderScene","Unable to open output '" + boutfilename.str() + "' ");
|
errMsg("ntlBlenderDumper::renderScene","Unable to open output '" + boutfilename.str() + "' ");
|
||||||
return 1; }
|
return 1; }
|
||||||
|
Reference in New Issue
Block a user