mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-21 21:17:19 +00:00
[client] egl: add options for maximum NV level and initial level
Adds options: * egl:nvGain * egl:nvGainMax Fixes #153
This commit is contained in:
parent
5af88ae61e
commit
3585e02993
@ -19,6 +19,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
#include "desktop.h"
|
||||
#include "common/debug.h"
|
||||
#include "common/option.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "texture.h"
|
||||
@ -63,7 +64,7 @@ struct EGL_Desktop
|
||||
|
||||
// night vision
|
||||
KeybindHandle kbNV;
|
||||
bool nv;
|
||||
int nvMax;
|
||||
int nvGain;
|
||||
};
|
||||
|
||||
@ -141,6 +142,9 @@ bool egl_desktop_init(EGL_Desktop ** desktop)
|
||||
|
||||
(*desktop)->kbNV = app_register_keybind(SDL_SCANCODE_N, egl_desktop_toggle_nv, *desktop);
|
||||
|
||||
(*desktop)->nvMax = option_get_int("egl", "nvGainMax");
|
||||
(*desktop)->nvGain = option_get_int("egl", "nvGain" );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -148,7 +152,7 @@ bool egl_desktop_init(EGL_Desktop ** desktop)
|
||||
void egl_desktop_toggle_nv(SDL_Scancode key, void * opaque)
|
||||
{
|
||||
EGL_Desktop * desktop = (EGL_Desktop *)opaque;
|
||||
if (++desktop->nvGain == 4)
|
||||
if (desktop->nvGain++ == desktop->nvMax)
|
||||
desktop->nvGain = 0;
|
||||
|
||||
if (desktop->nvGain == 0) app_alert(LG_ALERT_INFO, "NV Disabled");
|
||||
|
@ -101,6 +101,20 @@ static struct Option egl_options[] =
|
||||
.type = OPTION_TYPE_BOOL,
|
||||
.value.x_bool = false
|
||||
},
|
||||
{
|
||||
.module = "egl",
|
||||
.name = "nvGainMax",
|
||||
.description = "The maximum night vision gain",
|
||||
.type = OPTION_TYPE_INT,
|
||||
.value.x_int = 1
|
||||
},
|
||||
{
|
||||
.module = "egl",
|
||||
.name = "nvGain",
|
||||
.description = "The initial night vision gain at startup",
|
||||
.type = OPTION_TYPE_INT,
|
||||
.value.x_int = 0
|
||||
},
|
||||
{0}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user