From ef107d1a4d75ffc5645505867efec6b39b114d50 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 4 Oct 2012 13:39:08 +0000 Subject: Color Management: fallback to stub ocio implementation in cases when ocio configuration file failed to load This solves issues with infinite NULL-checks to prevent crashes in such situations. Currently only happens if there's no configuration file at all, but could be tweaked further to fallback if this file isn't usable by blender. --- intern/opencolorio/ocio_capi.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'intern/opencolorio/ocio_capi.h') diff --git a/intern/opencolorio/ocio_capi.h b/intern/opencolorio/ocio_capi.h index 0218ccfafcd..f924bffb8e0 100644 --- a/intern/opencolorio/ocio_capi.h +++ b/intern/opencolorio/ocio_capi.h @@ -28,8 +28,6 @@ #ifndef __OCIO_CAPI_H__ #define __OCIO_CAPI_H__ - - #ifdef __cplusplus using namespace OCIO_NAMESPACE; extern "C" { @@ -37,7 +35,6 @@ extern "C" { #define OCIO_DECLARE_HANDLE(name) typedef struct name##__ { int unused; } *name - #ifndef OCIO_CAPI_IMPLEMENTATION #define OCIO_ROLE_SCENE_LINEAR "scene_linear" #define OCIO_ROLE_COLOR_PICKING "color_picking" @@ -57,13 +54,15 @@ extern "C" { OCIO_DECLARE_HANDLE(MatrixTransformRcPtr); #endif +void OCIO_init(void); +void OCIO_exit(void); ConstConfigRcPtr *OCIO_getCurrentConfig(void); -ConstConfigRcPtr *OCIO_getDefaultConfig(void); void OCIO_setCurrentConfig(const ConstConfigRcPtr *config); ConstConfigRcPtr *OCIO_configCreateFromEnv(void); ConstConfigRcPtr *OCIO_configCreateFromFile(const char* filename); +ConstConfigRcPtr *OCIO_configCreateFallback(void); void OCIO_configRelease(ConstConfigRcPtr *config); @@ -127,4 +126,4 @@ void OCIO_matrixTransformScale(float * m44, float * offset4, const float * scale } #endif -#endif //OCIO_CAPI_H +#endif /* OCIO_CAPI_H */ -- cgit v1.2.3