Gamma Controls went to false visibilty

Started by Slasher, Wed 14/03/2018 14:37:24

Previous topic - Next topic

Slasher

I could not see slider to adjust Gamma settings on the control panel in-game full screen.

Upon looking at the function I noticed they had mysteriously turned to false:

Code: ags

if (!System.SupportsGammaControl) {
    // If we can't change the gamma settings, disable the relevant options.
    sldGamma.Visible = false; 
    lblGamma.Visible = false;


I had only positioned elements and did some cosmetics..

AGS 3,4,0,14




Crimson Wizard

Not every graphics driver supports gamma control.
Software driver - supports;
Direct3D9 - depends on system and gfx card;
OpenGL - does not support (not sure why, maybe not implemented).

Slasher

Well, i set them to true and now show on control panel...

Thanks for the info Crimson.

Khris

Slasher, the point of the code you quoted is to hide the slider if and only if it's useless anyway.
That code does not remove the slider regardless.

Are you saying that you can use the slider to change the screen's gamma now? Because that means there's a bug in the engine that sets System.SupportsGammaControl to a wrong value.

Slasher

Hi Khris,

The point is is that the Editor in it's wisdom set these to false...and I had to change to true which should never happen unless you set to false yourself...

And yes, now the slider is seen and is usable...

Khris

#5
No, you don't understand. The editor doesn't change random bools in the GlobalScript.

AGAIN:
The slider (and label) are visible perfectly fine when the game is started. What the function you changed is supposed to do is to hide the slider, IF it is useless anyway.
And running a 3.4.0.16 Default Game, this works perfectly fine for me: in windowed mode, the function hides the slider when the game is started. If I run the game fullscreen, System.SupportsGammaControl is true, and therefore the visibility of the slider and label is *not* set to false. The slider is visible, and using it changes the gamma value.

By changing the two false to true, you're short-circuiting the logic, causing the slider to *always* appear, even if it's useless.

AGAIN:
If you change those back to false, as it's supposed to be and always has been, then run the game fullscreen and *do not* see the slider, you have found a bug. In that case, the engine has set System.SupportsGammaControl to false although it should actually be true.

So please do the following:

1. change the code back to
Code: ags
  if (!System.SupportsGammaControl) {
    // If we can't change the gamma settings, disable the relevant options.
    sldGamma.Visible = false; 
    lblGamma.Visible = false;
  }

2. run the game fullscreen

Does the slider appear? If not, you have found a bug.


Edit:
I also have to add that this is explained perfectly in the COMMENT RIGHT THERE IN THE CODE:
Code: ags
// If we can't change the gamma settings, disable the relevant options.

Crimson Wizard

#6
Quote from: Slasher on Wed 14/03/2018 16:03:43
The point is is that the Editor in it's wisdom set these to false...and I had to change to true which should never happen unless you set to false yourself...

Wait... this is what you meant by "mysteriously turned to false"? That you had "trues" there before and then suddenly they become "false"?

Editor does not change anything in the script on its own. It simply does not have such ability coded into it to change trues to false in script texts.

This initial code is present in Default template:
Code: ags

  if (!System.SupportsGammaControl) {
    // If we can't change the gamma settings, disable the relevant options.
    sldGamma.Visible = false; 
    lblGamma.Visible = false;
  } 

It is not there because of the Editor, but because of the human who created this template, and this is how it is supposed to be, at least in its author's vision.


EDIT: Also, yes, what Khris said above. If System.SupportsGammaControl returns negative, but at the same time you can actually change gamma by moving these sliders, then it's a bug in the engine.

Slasher

i just didn't understand why when running full screen that the Gamma slider and lbl was not there...

Anyhow... returned back to false and they both showed up... Not quite sure what happened..

I understand now that their default is false..

Just another wtf case...



Crimson Wizard

Quote from: Slasher on Wed 14/03/2018 18:27:43
i just didn't understand why when running full screen that the Gamma slider and lbl was not there...

Anyhow... returned back to false and they both showed up... Not quite sure what happened..

Yes, for Direct3D9 it should be enabled in fullscreen and disabled in windowed.
Maybe you ran windowed and window covered all screen that looked like fullscreen?

OpenGL is only added in 3.4.1 for Windows, and should not be present in 3,4,0,14, so don't know either.

Khris

Quote from: Crimson Wizard on Wed 14/03/2018 18:50:09Maybe you ran windowed and window covered all screen that looked like fullscreen?
That's my guess, too.

Slasher

I'm 99% certain that it was not windowed mode :-\

Khris

In that case it should be easy to replicate.

Slasher

Seeing as it is all now working fine I will have to accept I must have made an error of judgement.

Cheers all....

SMF spam blocked by CleanTalk