mirror of https://github.com/bjornbytes/lovr.git
Fix gamma correction of multicolor text;
This commit is contained in:
parent
0191d29a45
commit
0da84894e8
|
@ -2472,9 +2472,9 @@ void lovrFontGetVertices(Font* font, ColoredString* strings, uint32_t count, flo
|
||||||
uint32_t previous = '\0';
|
uint32_t previous = '\0';
|
||||||
const char* str = strings[i].string;
|
const char* str = strings[i].string;
|
||||||
const char* end = strings[i].string + strings[i].length;
|
const char* end = strings[i].string + strings[i].length;
|
||||||
uint8_t r = (uint8_t) (CLAMP(strings[i].color[0], 0.f, 1.f) * 255.f);
|
uint8_t r = (uint8_t) (CLAMP(lovrMathGammaToLinear(strings[i].color[0]), 0.f, 1.f) * 255.f);
|
||||||
uint8_t g = (uint8_t) (CLAMP(strings[i].color[1], 0.f, 1.f) * 255.f);
|
uint8_t g = (uint8_t) (CLAMP(lovrMathGammaToLinear(strings[i].color[1]), 0.f, 1.f) * 255.f);
|
||||||
uint8_t b = (uint8_t) (CLAMP(strings[i].color[2], 0.f, 1.f) * 255.f);
|
uint8_t b = (uint8_t) (CLAMP(lovrMathGammaToLinear(strings[i].color[2]), 0.f, 1.f) * 255.f);
|
||||||
uint8_t a = (uint8_t) (CLAMP(strings[i].color[3], 0.f, 1.f) * 255.f);
|
uint8_t a = (uint8_t) (CLAMP(strings[i].color[3], 0.f, 1.f) * 255.f);
|
||||||
|
|
||||||
while ((bytes = utf8_decode(str, end, &codepoint)) > 0) {
|
while ((bytes = utf8_decode(str, end, &codepoint)) > 0) {
|
||||||
|
|
Loading…
Reference in New Issue