Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-11-13 19:17:24 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-13 19:17:24 +0400
commit8b323417751ecc051e445a8e69188cf00afa3c4e (patch)
tree6e0d2af2f49f648d821da828fc08bd3943ce1cf2 /source
parentea38cb2e5eb84fbc6e15e64c69589c691a5d240a (diff)
ensure that the path and directory are joined correctly for ocean cache (assumed path ended with a '/')
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/CMakeLists.txt4
-rw-r--r--source/blender/blenkernel/intern/ocean.c18
-rw-r--r--source/blender/modifiers/intern/MOD_ocean.c6
3 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index fd98da949ca..b4745669ff0 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -385,7 +385,9 @@ if(WITH_LIBMV)
endif()
if(WITH_FFTW3)
- list(APPEND INC_SYS ${FFTW3_INCLUDE_DIRS})
+ list(APPEND INC_SYS
+ ${FFTW3_INCLUDE_DIRS}
+ )
add_definitions(-DFFTW3=1)
endif()
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
index 24d7701dcfc..e050ff89f86 100644
--- a/source/blender/blenkernel/intern/ocean.c
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -46,6 +46,7 @@
#include "BLI_rand.h"
#include "BLI_string.h"
#include "BLI_threads.h"
+#include "BLI_path_util.h"
#include "BLI_utildefines.h"
#include "IMB_imbuf.h"
@@ -994,26 +995,27 @@ void BKE_free_ocean(struct Ocean *oc)
#define CACHE_TYPE_FOAM 2
#define CACHE_TYPE_NORMAL 3
-static void cache_filename(char *string, char *path, int frame, int type)
+static void cache_filename(char *string, const char *path, int frame, int type)
{
- char *cachepath=NULL;
+ char cachepath[FILE_MAX];
+ const char *fname;
switch(type) {
case CACHE_TYPE_FOAM:
- cachepath = BLI_strdupcat(path, "foam_");
+ fname= "foam_";
break;
case CACHE_TYPE_NORMAL:
- cachepath = BLI_strdupcat(path, "normal_");
+ fname= "normal_";
break;
case CACHE_TYPE_DISPLACE:
default:
- cachepath = BLI_strdupcat(path, "disp_");
+ fname= "disp_";
break;
}
-
+
+ BLI_join_dirfile(cachepath, sizeof(cachepath), path, fname);
+
BKE_makepicstring(string, cachepath, frame, R_OPENEXR, 1, TRUE);
-
- MEM_freeN(cachepath);
}
void BKE_free_ocean_cache(struct OceanCache *och)
diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c
index f36d3674913..2613cf2b944 100644
--- a/source/blender/modifiers/intern/MOD_ocean.c
+++ b/source/blender/modifiers/intern/MOD_ocean.c
@@ -122,9 +122,9 @@ static void initData(ModifierData *md)
omd->size = 1.0;
omd->repeat_x = 1;
omd->repeat_y = 1;
-
- strcpy(omd->cachepath, "//ocean_cache/");
-
+
+ BLI_strncpy(omd->cachepath, "//ocean_cache", sizeof(omd->cachepath));
+
omd->cached = 0;
omd->bakestart = 1;
omd->bakeend = 250;