Commit 6e622e7bc8cba78bbd199c28ad255a8660744e31
1 parent
401d10ba
Try to fix the gamma issue on some computers
Showing
2 changed files
with
11 additions
and
7 deletions
... | ... | @@ -593,12 +593,16 @@ end |
593 | 593 | --- Sets the gamma of the window |
594 | 594 | -- By default it uses SDL gamma settings, but it can also use a fullscreen shader if available |
595 | 595 | function _M:setGamma(gamma) |
596 | - if self.support_shader_gamma and self.full_fbo_shader then | |
597 | - -- Tell the shader which gamma to use | |
598 | - self.full_fbo_shader:setUniform("gamma", gamma) | |
599 | - -- Remove SDL gamma correction | |
600 | - core.display.setGamma(1) | |
601 | - print("[GAMMA] Setting gamma correction using fullscreen shader", gamma) | |
596 | + if self.support_shader_gamma and core.shader.active() then | |
597 | + if self.full_fbo_shader then | |
598 | + -- Tell the shader which gamma to use | |
599 | + self.full_fbo_shader:setUniform("gamma", gamma) | |
600 | + -- Remove SDL gamma correction | |
601 | + core.display.setGamma(1) | |
602 | + print("[GAMMA] Setting gamma correction using fullscreen shader", gamma) | |
603 | + else | |
604 | + print("[GAMMA] Not setting gamma correction yet, no fullscreen shader found", gamma) | |
605 | + end | |
602 | 606 | else |
603 | 607 | core.display.setGamma(gamma) |
604 | 608 | print("[GAMMA] Setting gamma correction using SDL", gamma) | ... | ... |
... | ... | @@ -141,7 +141,7 @@ game = false |
141 | 141 | -- Setup resolution |
142 | 142 | engine.Game:setResolution(config.settings.window.size, true) |
143 | 143 | core.display.setTextBlended(config.settings.aa_text) |
144 | -core.display.setGamma(config.settings.gamma_correction / 100) | |
144 | +-- core.display.setGamma(config.settings.gamma_correction / 100) | |
145 | 145 | if not config.settings.fbo_active then core.display.disableFBO() print("Disabling FBO") end |
146 | 146 | if not config.settings.shaders_active then core.shader.disable() print("Disabling Shaders") end |
147 | 147 | ... | ... |
-
Please register or login to post a comment