Fix gamma correct issue with built-in Camera;

This commit is contained in:
bjorn 2019-02-13 21:14:45 -08:00
parent b27b9be7bd
commit b9b719e862
2 changed files with 3 additions and 2 deletions

View File

@ -1502,7 +1502,6 @@ int luaopen_lovr_graphics(lua_State* L) {
luax_pushconf(L);
// Gamma correct
lua_getfield(L, -1, "gammacorrect");
bool gammaCorrect = lua_toboolean(L, -1);
lua_pop(L, 1);

View File

@ -242,7 +242,9 @@ void lovrGraphicsSetCamera(Camera* camera, bool 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 });
}
}