OpenGL: Readable name fixes

This commit is contained in:
Jeffrey Pfau 2015-11-19 23:49:50 -08:00
parent 0de98898a3
commit ded463ea25
2 changed files with 4 additions and 1 deletions

View File

@ -19,14 +19,17 @@ height=640
type=float
default=1
pass[0]=false
readableName=Light brightness
[uniform.reflectionBrightness]
type=float
default=0.07
pass[0]=false
readableName=Reflection brightness
[uniform.reflectionDistance]
type=float2
default[0]=0
default[1]=0.025
pass[0]=false
readableName=Reflection distance

View File

@ -683,13 +683,13 @@ static bool _loadUniform(struct Configuration* description, size_t pass, struct
_loadValue(description, uniform->name, uniform->type, "default", &uniform->value);
_loadValue(description, uniform->name, uniform->type, "min", &uniform->min);
_loadValue(description, uniform->name, uniform->type, "max", &uniform->max);
uniform->name = strdup(uniform->name + strlen("uniform."));
const char* readable = ConfigurationGetValue(description, uniform->name, "readableName");
if (readable) {
uniform->readableName = strdup(readable);
} else {
uniform->readableName = 0;
}
uniform->name = strdup(uniform->name + strlen("uniform."));
return true;
}