Author Topic: Gamma Controls went to false visibilty  (Read 675 times)

Slasher

  • slasher
    • I can help with AGS tutoring
    •  
    • Lifetime Achievement Award Winner
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Slasher worked on a game that was nominated for an AGS Award!
Gamma Controls went to false visibilty
« on: 14 Mar 2018, 14:37 »
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: Adventure Game Studio
  1. if (!System.SupportsGammaControl) {
  2.     // If we can't change the gamma settings, disable the relevant options.
  3.     sldGamma.Visible = false;
  4.     lblGamma.Visible = false;
  5.  

I had only positioned elements and did some cosmetics..

AGS 3,4,0,14




Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #1 on: 14 Mar 2018, 14:45 »
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

  • slasher
    • I can help with AGS tutoring
    •  
    • Lifetime Achievement Award Winner
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Slasher worked on a game that was nominated for an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #2 on: 14 Mar 2018, 15:15 »
Well, i set them to true and now show on control panel...

Thanks for the info Crimson.

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #3 on: 14 Mar 2018, 15:41 »
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

  • slasher
    • I can help with AGS tutoring
    •  
    • Lifetime Achievement Award Winner
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Slasher worked on a game that was nominated for an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #4 on: 14 Mar 2018, 16:03 »
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

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #5 on: 14 Mar 2018, 16:17 »
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: Adventure Game Studio
  1.   if (!System.SupportsGammaControl) {
  2.     // If we can't change the gamma settings, disable the relevant options.
  3.     sldGamma.Visible = false;
  4.     lblGamma.Visible = false;
  5.   }
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: Adventure Game Studio
  1. // If we can't change the gamma settings, disable the relevant options.
« Last Edit: 14 Mar 2018, 16:40 by Khris »

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #6 on: 14 Mar 2018, 16:23 »
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: Adventure Game Studio
  1.   if (!System.SupportsGammaControl) {
  2.     // If we can't change the gamma settings, disable the relevant options.
  3.     sldGamma.Visible = false;
  4.     lblGamma.Visible = false;
  5.   }
  6.  
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.
« Last Edit: 14 Mar 2018, 16:33 by Crimson Wizard »

Slasher

  • slasher
    • I can help with AGS tutoring
    •  
    • Lifetime Achievement Award Winner
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Slasher worked on a game that was nominated for an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #7 on: 14 Mar 2018, 18:27 »
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

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #8 on: 14 Mar 2018, 18:50 »
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

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #9 on: 14 Mar 2018, 20:20 »
Maybe you ran windowed and window covered all screen that looked like fullscreen?
That's my guess, too.

Slasher

  • slasher
    • I can help with AGS tutoring
    •  
    • Lifetime Achievement Award Winner
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Slasher worked on a game that was nominated for an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #10 on: 15 Mar 2018, 05:41 »
I'm 99% certain that it was not windowed mode :-\

Khris

    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
    • Khris worked on a game that was nominated for an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #11 on: 15 Mar 2018, 07:36 »
In that case it should be easy to replicate.

Slasher

  • slasher
    • I can help with AGS tutoring
    •  
    • Lifetime Achievement Award Winner
    •  
    • I can help with scripting
    •  
    • I can help with story design
    •  
    • Slasher worked on a game that was nominated for an AGS Award!
Re: Gamma Controls went to false visibilty
« Reply #12 on: 19 Mar 2018, 05:19 »
Seeing as it is all now working fine I will have to accept I must have made an error of judgement.

Cheers all....