sw scaler for gp2x
This commit is contained in:
parent
1d02ca7575
commit
4cadce9738
2
gui.c
2
gui.c
|
@ -756,7 +756,7 @@ u8 *scale_options[] =
|
||||||
"unscaled 3:2", "scaled 3:2 (slower)",
|
"unscaled 3:2", "scaled 3:2 (slower)",
|
||||||
"unscaled 3:2 (anti-tear)", "scaled 3:2 (anti-tear)"
|
"unscaled 3:2 (anti-tear)", "scaled 3:2 (anti-tear)"
|
||||||
#else
|
#else
|
||||||
"unscaled 3:2", "scaled 3:2", "fullscreen"
|
"unscaled 3:2", "scaled 3:2", "fullscreen", "scaled 3:2 (software)"
|
||||||
#ifdef PSP_BUILD
|
#ifdef PSP_BUILD
|
||||||
" 16:9"
|
" 16:9"
|
||||||
#endif
|
#endif
|
||||||
|
|
52
video.c
52
video.c
|
@ -3464,26 +3464,37 @@ void flip_screen()
|
||||||
}
|
}
|
||||||
#ifdef GP2X_BUILD
|
#ifdef GP2X_BUILD
|
||||||
{
|
{
|
||||||
if((screen_scale == unscaled) &&
|
if((resolution_width == small_resolution_width) &&
|
||||||
(resolution_width == small_resolution_width) &&
|
|
||||||
(resolution_height == small_resolution_height))
|
(resolution_height == small_resolution_height))
|
||||||
{
|
{
|
||||||
SDL_Rect srect = {0, 0, 240, 160};
|
switch (screen_scale)
|
||||||
SDL_Rect drect = {40, 40, 240, 160};
|
{
|
||||||
SDL_BlitSurface(screen, &srect, hw_screen, &drect);
|
case unscaled:
|
||||||
}
|
{
|
||||||
else if((screen_scale == scaled_aspect) &&
|
SDL_Rect srect = {0, 0, 240, 160};
|
||||||
(resolution_width == small_resolution_width) &&
|
SDL_Rect drect = {40, 40, 240, 160};
|
||||||
(resolution_height == small_resolution_height))
|
warm_cache_op_all(WOP_D_CLEAN);
|
||||||
{
|
SDL_BlitSurface(screen, &srect, hw_screen, &drect);
|
||||||
SDL_Rect drect = {0, 10, 0, 0};
|
return;
|
||||||
SDL_BlitSurface(screen, NULL, hw_screen, &drect);
|
}
|
||||||
}
|
case scaled_aspect:
|
||||||
else
|
{
|
||||||
{
|
SDL_Rect drect = {0, 10, 0, 0};
|
||||||
SDL_BlitSurface(screen, NULL, hw_screen, NULL);
|
warm_cache_op_all(WOP_D_CLEAN);
|
||||||
|
SDL_BlitSurface(screen, NULL, hw_screen, &drect);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case scaled_aspect_sw:
|
||||||
|
{
|
||||||
|
upscale_aspect(hw_screen->pixels, get_screen_pixels());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
case fullscreen:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
warm_cache_op_all(WOP_D_CLEAN);
|
warm_cache_op_all(WOP_D_CLEAN);
|
||||||
|
SDL_BlitSurface(screen, NULL, hw_screen, NULL);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
SDL_Flip(screen);
|
SDL_Flip(screen);
|
||||||
|
@ -3816,7 +3827,7 @@ void video_resolution_small()
|
||||||
SDL_GP2X_AllowGfxMemory(NULL, 0);
|
SDL_GP2X_AllowGfxMemory(NULL, 0);
|
||||||
|
|
||||||
w = 320; h = 240;
|
w = 320; h = 240;
|
||||||
if (screen_scale != unscaled)
|
if (screen_scale == scaled_aspect || screen_scale == fullscreen)
|
||||||
{
|
{
|
||||||
w = small_resolution_width * video_scale;
|
w = small_resolution_width * video_scale;
|
||||||
h = small_resolution_height * video_scale;
|
h = small_resolution_height * video_scale;
|
||||||
|
@ -3824,9 +3835,12 @@ void video_resolution_small()
|
||||||
if (screen_scale == scaled_aspect) h += 20;
|
if (screen_scale == scaled_aspect) h += 20;
|
||||||
hw_screen = SDL_SetVideoMode(w, h, 16, SDL_HWSURFACE);
|
hw_screen = SDL_SetVideoMode(w, h, 16, SDL_HWSURFACE);
|
||||||
|
|
||||||
|
w = small_resolution_width * video_scale;
|
||||||
|
if (screen_scale == scaled_aspect_sw)
|
||||||
|
w = 320;
|
||||||
screen = SDL_CreateRGBSurface(SDL_HWSURFACE,
|
screen = SDL_CreateRGBSurface(SDL_HWSURFACE,
|
||||||
small_resolution_width * video_scale, small_resolution_height *
|
w, small_resolution_height * video_scale,
|
||||||
video_scale, 16, 0xFFFF, 0xFFFF, 0xFFFF, 0);
|
16, 0xFFFF, 0xFFFF, 0xFFFF, 0);
|
||||||
|
|
||||||
SDL_ShowCursor(0);
|
SDL_ShowCursor(0);
|
||||||
|
|
||||||
|
|
10
video.h
10
video.h
|
@ -77,11 +77,15 @@ typedef enum
|
||||||
{
|
{
|
||||||
unscaled,
|
unscaled,
|
||||||
scaled_aspect,
|
scaled_aspect,
|
||||||
#ifndef WIZ_BUILD
|
#ifdef WIZ_BUILD
|
||||||
fullscreen,
|
|
||||||
#endif
|
|
||||||
unscaled_rot,
|
unscaled_rot,
|
||||||
scaled_aspect_rot,
|
scaled_aspect_rot,
|
||||||
|
#elif defined(GP2X_BUILD)
|
||||||
|
fullscreen,
|
||||||
|
scaled_aspect_sw,
|
||||||
|
#else
|
||||||
|
fullscreen,
|
||||||
|
#endif
|
||||||
} video_scale_type;
|
} video_scale_type;
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
Loading…
Reference in New Issue