diff --git a/driver.h b/driver.h index 3939df02a3..1bb4d880b1 100644 --- a/driver.h +++ b/driver.h @@ -61,7 +61,7 @@ typedef struct input_driver typedef struct video_driver { - void* (*init)(video_info_t *video, input_driver_t **input); + void* (*init)(video_info_t *video, const input_driver_t **input); // Should the video driver act as an input driver as well? :) bool (*frame)(void* data, const uint16_t* frame, int width, int height); void (*free)(void* data); diff --git a/gl.c b/gl.c index 2976c04b3d..ac9fe6d676 100644 --- a/gl.c +++ b/gl.c @@ -88,7 +88,7 @@ static void glfw_free_input(void *data) free(data); } -static input_driver_t input_glfw = { +static const input_driver_t input_glfw = { .poll = glfw_input_poll, .input_state = glfw_input_state, .free = glfw_free_input @@ -171,7 +171,7 @@ static void gl_free(void *data) free(gl_buffer); } -static void* gl_init(video_info_t *video, input_driver_t **input) +static void* gl_init(video_info_t *video, const input_driver_t **input) { gl_t *foo = malloc(sizeof(gl_t)); if ( foo == NULL ) diff --git a/ssnes.c b/ssnes.c index 8b1fbc196a..3e52513fb0 100644 --- a/ssnes.c +++ b/ssnes.c @@ -122,7 +122,7 @@ static void init_video_input(void) .input_scale = scale, }; - driver.video_data = driver.video->init(&video, (input_driver_t**)&(driver.input)); + driver.video_data = driver.video->init(&video, &(driver.input)); if ( driver.video_data == NULL ) { @@ -155,16 +155,15 @@ static void video_frame(const uint16_t *data, unsigned width, unsigned height) if ( !video_active ) return; - uint16_t output[width * height]; #if VIDEO_FILTER == FILTER_HQ2X uint16_t outputHQ2x[width * height * 2 * 2]; -#endif -#if VIDEO_FILTER == FILTER_HQ4X +#elif VIDEO_FILTER == FILTER_HQ4X uint16_t outputHQ4x[width * height * 4 * 4]; +#else + uint16_t output[width * height]; #endif - int y; - for ( y = 0; y < height; y++ ) + for ( int y = 0; y < height; y++ ) { const uint16_t *src = data + y * 1024; uint16_t *dst = output + y * width;