This commit is contained in:
twinaphex 2018-01-09 23:47:13 +01:00
parent 2a42983b4f
commit 7e9945cde9

View File

@ -165,15 +165,17 @@ static bool switch_frame(void *data, const void *frame,
{ {
for(y = 0; y < height; y++) for(y = 0; y < height; y++)
{ {
unsigned subx, suby;
uint32_t pixel = 0; uint32_t pixel = 0;
if (sw->rgb32) if (sw->rgb32)
{ {
const uint32_t *frame_pixels = frame; const uint32_t *frame_pixels = frame;
pixel = frame_pixels[(y*pitch/sizeof(uint32_t)) + x]; pixel = frame_pixels[(y*pitch/sizeof(uint32_t)) + x];
} else { }
else
{
const uint16_t *frame_pixels = frame; const uint16_t *frame_pixels = frame;
unsigned subx, suby;
uint32_t spixel = frame_pixels[(y*pitch/sizeof(uint16_t)) + x]; uint32_t spixel = frame_pixels[(y*pitch/sizeof(uint16_t)) + x];
uint8_t r = (spixel >> 11) & 31; uint8_t r = (spixel >> 11) & 31;
uint8_t g = (spixel >> 5) & 63; uint8_t g = (spixel >> 5) & 63;
@ -434,4 +436,4 @@ video_driver_t video_switch = {
NULL, /* overlay_interface */ NULL, /* overlay_interface */
#endif #endif
switch_get_poke_interface, switch_get_poke_interface,
}; };