mirror of https://github.com/bjornbytes/lovr.git
Fix gamma correct issue with built-in Camera;
This commit is contained in:
parent
b27b9be7bd
commit
b9b719e862
|
@ -1502,7 +1502,6 @@ int luaopen_lovr_graphics(lua_State* L) {
|
||||||
|
|
||||||
luax_pushconf(L);
|
luax_pushconf(L);
|
||||||
|
|
||||||
// Gamma correct
|
|
||||||
lua_getfield(L, -1, "gammacorrect");
|
lua_getfield(L, -1, "gammacorrect");
|
||||||
bool gammaCorrect = lua_toboolean(L, -1);
|
bool gammaCorrect = lua_toboolean(L, -1);
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 1);
|
||||||
|
|
|
@ -242,7 +242,9 @@ void lovrGraphicsSetCamera(Camera* camera, bool clear) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (clear) {
|
if (clear) {
|
||||||
lovrGpuClear(state.camera.canvas, &state.backgroundColor, &(float) { 1. }, &(int) { 0 });
|
Color background = state.backgroundColor;
|
||||||
|
gammaCorrectColor(&background);
|
||||||
|
lovrGpuClear(state.camera.canvas, &background, &(float) { 1. }, &(int) { 0 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue