[client] all: move keybind implementation into app.c/h

This commit is contained in:
Geoffrey McRae
2021-01-26 02:33:28 +11:00
parent 9674421ce4
commit 3d03699cc8
6 changed files with 88 additions and 118 deletions

View File

@@ -22,6 +22,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include "common/option.h"
#include "common/locking.h"
#include "app.h"
#include "texture.h"
#include "shader.h"
#include "model.h"
@@ -29,8 +30,6 @@ Place, Suite 330, Boston, MA 02111-1307 USA
#include <stdlib.h>
#include <string.h>
#include "interface/app.h"
// these headers are auto generated by cmake
#include "desktop.vert.h"
#include "desktop_rgb.frag.h"
@@ -62,12 +61,11 @@ struct EGL_Desktop
struct DesktopShader shader_generic;
// night vision
KeybindHandle kbNV;
int nvMax;
int nvGain;
int nvMax;
int nvGain;
// colorblind mode
int cbMode;
int cbMode;
};
// forwards
@@ -136,7 +134,7 @@ bool egl_desktop_init(EGL_Desktop ** desktop, EGLDisplay * display)
egl_model_set_default((*desktop)->model);
egl_model_set_texture((*desktop)->model, (*desktop)->texture);
(*desktop)->kbNV = app_register_keybind(KEY_N, egl_desktop_toggle_nv, *desktop);
app_registerKeybind(KEY_N, egl_desktop_toggle_nv, *desktop);
(*desktop)->nvMax = option_get_int("egl", "nvGainMax");
(*desktop)->nvGain = option_get_int("egl", "nvGain" );
@@ -166,8 +164,6 @@ void egl_desktop_free(EGL_Desktop ** desktop)
egl_shader_free (&(*desktop)->shader_generic.shader);
egl_model_free (&(*desktop)->model );
app_release_keybind(&(*desktop)->kbNV);
free(*desktop);
*desktop = NULL;
}