Small updates.

This commit is contained in:
Themaister 2010-06-27 14:57:37 +02:00
parent 10d9a1c6ba
commit 13c503160f
3 changed files with 8 additions and 9 deletions

View File

@ -61,7 +61,7 @@ typedef struct input_driver
typedef struct video_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? :) // Should the video driver act as an input driver as well? :)
bool (*frame)(void* data, const uint16_t* frame, int width, int height); bool (*frame)(void* data, const uint16_t* frame, int width, int height);
void (*free)(void* data); void (*free)(void* data);

4
gl.c
View File

@ -88,7 +88,7 @@ static void glfw_free_input(void *data)
free(data); free(data);
} }
static input_driver_t input_glfw = { static const input_driver_t input_glfw = {
.poll = glfw_input_poll, .poll = glfw_input_poll,
.input_state = glfw_input_state, .input_state = glfw_input_state,
.free = glfw_free_input .free = glfw_free_input
@ -171,7 +171,7 @@ static void gl_free(void *data)
free(gl_buffer); 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)); gl_t *foo = malloc(sizeof(gl_t));
if ( foo == NULL ) if ( foo == NULL )

11
ssnes.c
View File

@ -122,7 +122,7 @@ static void init_video_input(void)
.input_scale = scale, .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 ) if ( driver.video_data == NULL )
{ {
@ -155,16 +155,15 @@ static void video_frame(const uint16_t *data, unsigned width, unsigned height)
if ( !video_active ) if ( !video_active )
return; return;
uint16_t output[width * height];
#if VIDEO_FILTER == FILTER_HQ2X #if VIDEO_FILTER == FILTER_HQ2X
uint16_t outputHQ2x[width * height * 2 * 2]; uint16_t outputHQ2x[width * height * 2 * 2];
#endif #elif VIDEO_FILTER == FILTER_HQ4X
#if VIDEO_FILTER == FILTER_HQ4X
uint16_t outputHQ4x[width * height * 4 * 4]; uint16_t outputHQ4x[width * height * 4 * 4];
#else
uint16_t output[width * height];
#endif #endif
int y; for ( int y = 0; y < height; y++ )
for ( y = 0; y < height; y++ )
{ {
const uint16_t *src = data + y * 1024; const uint16_t *src = data + y * 1024;
uint16_t *dst = output + y * width; uint16_t *dst = output + y * width;