Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/pointcache.c
| Context not available. | |||||
| #include <sys/stat.h> | #include <sys/stat.h> | ||||
| #include <sys/types.h> | #include <sys/types.h> | ||||
| #include "CLG_log.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_ID.h" | #include "DNA_ID.h" | ||||
| Context not available. | |||||
| /* could be made into a pointcache option */ | /* could be made into a pointcache option */ | ||||
| #define DURIAN_POINTCACHE_LIB_OK 1 | #define DURIAN_POINTCACHE_LIB_OK 1 | ||||
| static CLG_LogRef LOG = { "bke.pointcache" }; | |||||
| static int ptcache_data_size[] = { | static int ptcache_data_size[] = { | ||||
| sizeof(unsigned int), // BPHYS_DATA_INDEX | sizeof(unsigned int), // BPHYS_DATA_INDEX | ||||
| 3 * sizeof(float), // BPHYS_DATA_LOCATION | 3 * sizeof(float), // BPHYS_DATA_LOCATION | ||||
| Context not available. | |||||
| /* version header */ | /* version header */ | ||||
| ptcache_file_read(pf, version, 1, sizeof(char) * 4); | ptcache_file_read(pf, version, 1, sizeof(char) * 4); | ||||
| if (!STREQLEN(version, DPAINT_CACHE_VERSION, 4)) { | if (!STREQLEN(version, DPAINT_CACHE_VERSION, 4)) { | ||||
| printf("Dynamic Paint: Invalid cache version: '%c%c%c%c'!\n", UNPACK4(version)); | CLOG_ERROR(&LOG, "Dynamic Paint: Invalid cache version: '%c%c%c%c'!", UNPACK4(version)); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| Context not available. | |||||
| pf = ptcache_file_open(pid, PTCACHE_FILE_WRITE, pm->frame); | pf = ptcache_file_open(pid, PTCACHE_FILE_WRITE, pm->frame); | ||||
| if (pf==NULL) { | if (pf == NULL) { | ||||
| if (G.debug & G_DEBUG) | if (G.debug & G_DEBUG) | ||||
| printf("Error opening disk cache file for writing\n"); | printf("Error opening disk cache file for writing\n"); | ||||
| return 0; | return 0; | ||||
| Context not available. | |||||