mirror of
https://github.com/libretro/RetroArch
synced 2025-04-17 02:43:03 +00:00
Fixes issues with high-res games. :)
This commit is contained in:
parent
6a9798451a
commit
2d1dff83dc
2
config.h
2
config.h
@ -73,7 +73,7 @@ static const bool force_aspect = true;
|
||||
////////////////////////
|
||||
|
||||
// If you change this to something other than the HQ filters, make sure that you build the filter module in config.mk.
|
||||
#define VIDEO_FILTER FILTER_NONE
|
||||
#define VIDEO_FILTER FILTER_HQ2X
|
||||
|
||||
|
||||
////////////////
|
||||
|
13
gl.c
13
gl.c
@ -31,6 +31,8 @@ static GLuint tex_filter;
|
||||
typedef struct gl
|
||||
{
|
||||
bool vsync;
|
||||
unsigned real_x;
|
||||
unsigned real_y;
|
||||
} gl_t;
|
||||
|
||||
|
||||
@ -152,7 +154,7 @@ static float tv_to_fps(const struct timeval *tv, const struct timeval *new_tv, i
|
||||
|
||||
static bool gl_frame(void *data, const uint16_t* frame, int width, int height)
|
||||
{
|
||||
(void)data;
|
||||
gl_t *gl = data;
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
@ -175,10 +177,10 @@ static bool gl_frame(void *data, const uint16_t* frame, int width, int height)
|
||||
|
||||
float h = 224.0/256.0;
|
||||
|
||||
glTexCoord2f(0, h); glVertex3i(0, 0, 0);
|
||||
glTexCoord2f(0, h*height/gl->real_y); glVertex3i(0, 0, 0);
|
||||
glTexCoord2f(0, 0); glVertex3i(0, 1, 0);
|
||||
glTexCoord2f(1, 0); glVertex3i(1, 1, 0);
|
||||
glTexCoord2f(1, h); glVertex3i(1, 0, 0);
|
||||
glTexCoord2f((float)width/gl->real_x, 0); glVertex3i(1, 1, 0);
|
||||
glTexCoord2f((float)width/gl->real_x, h*height/gl->real_y); glVertex3i(1, 0, 0);
|
||||
|
||||
glEnd();
|
||||
|
||||
@ -268,6 +270,9 @@ static void* gl_init(video_info_t *video, const input_driver_t **input)
|
||||
exit(1);
|
||||
}
|
||||
|
||||
gl->real_x = video->input_scale * 256;
|
||||
gl->real_y = video->input_scale * 224;
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_DITHER);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
12
ssnes.c
12
ssnes.c
@ -150,16 +150,18 @@ static void uninit_audio(void)
|
||||
static void init_video_input(void)
|
||||
{
|
||||
int scale;
|
||||
|
||||
// We multiply scales with 2 to allow for hi-res games.
|
||||
#if VIDEO_FILTER == FILTER_NONE
|
||||
scale = 1;
|
||||
#elif VIDEO_FILTER == FILTER_HQ2X
|
||||
scale = 2;
|
||||
#elif VIDEO_FILTER == FILTER_HQ4X
|
||||
#elif VIDEO_FILTER == FILTER_HQ2X
|
||||
scale = 4;
|
||||
#elif VIDEO_FILTER == FILTER_HQ4X
|
||||
scale = 8;
|
||||
#elif VIDEO_FILTER == FILTER_GRAYSCALE
|
||||
scale = 1;
|
||||
scale = 2;
|
||||
#else
|
||||
scale = 1;
|
||||
scale = 2;
|
||||
#endif
|
||||
|
||||
video_info_t video = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user