mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
DOS: scale menu frame to fit screen
This commit is contained in:
parent
83619b25e6
commit
0bdcdac2da
@ -368,7 +368,10 @@ static void vga_set_texture_frame(void *data,
|
|||||||
{
|
{
|
||||||
for(x = 0; x < VGA_WIDTH; x++)
|
for(x = 0; x < VGA_WIDTH; x++)
|
||||||
{
|
{
|
||||||
unsigned short pixel = video_frame[width * y + x];
|
/* scale incoming frame to fit the screen */
|
||||||
|
unsigned scaled_x = (width / (float)VGA_WIDTH) * x;
|
||||||
|
unsigned scaled_y = (height / (float)VGA_HEIGHT) * y;
|
||||||
|
unsigned short pixel = video_frame[width * scaled_y + scaled_x];
|
||||||
unsigned r = (7.0f / 15.0f) * ((pixel & 0xF000) >> 12);
|
unsigned r = (7.0f / 15.0f) * ((pixel & 0xF000) >> 12);
|
||||||
unsigned g = (7.0f / 15.0f) * ((pixel & 0xF00) >> 8);
|
unsigned g = (7.0f / 15.0f) * ((pixel & 0xF00) >> 8);
|
||||||
unsigned b = (3.0f / 15.0f) * ((pixel & 0xF0) >> 4);
|
unsigned b = (3.0f / 15.0f) * ((pixel & 0xF0) >> 4);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user