Color Management: fix crash when displaying render preview if OCIO was disabled buildtime

This commit is contained in:
Sergey Sharybin 2012-09-16 15:17:22 +00:00
parent eacf3054aa
commit fc7de23537
4 changed files with 15 additions and 0 deletions

View File

@ -78,6 +78,11 @@ ConstConfigRcPtr *OCIO_getCurrentConfig(void)
return NULL;
}
ConstConfigRcPtr *OCIO_getDefaultConfig(void)
{
return NULL;
}
void OCIO_setCurrentConfig(const ConstConfigRcPtr *config)
{
try {

View File

@ -59,6 +59,7 @@ extern "C" {
ConstConfigRcPtr *OCIO_getCurrentConfig(void);
ConstConfigRcPtr *OCIO_getDefaultConfig(void);
void OCIO_setCurrentConfig(const ConstConfigRcPtr *config);
ConstConfigRcPtr *OCIO_configCreateFromEnv(void);

View File

@ -56,6 +56,11 @@ ConstConfigRcPtr *OCIO_getCurrentConfig(void)
return CONFIG_DEFAULT;
}
ConstConfigRcPtr *OCIO_getDefaultConfig(void)
{
return CONFIG_DEFAULT;
}
void OCIO_setCurrentConfig(const ConstConfigRcPtr *)
{
}

View File

@ -565,6 +565,10 @@ void IMB_colormanagement_init(void)
}
}
if (config == NULL) {
config = OCIO_getDefaultConfig();
}
if (config) {
OCIO_setCurrentConfig(config);