Fix translate16to16 along the lines of all the other translate functions.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@527 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
5934915c9f
commit
ff230a1672
36
xwin.c
36
xwin.c
@ -408,34 +408,35 @@ translate15to32(uint16 * data, uint8 * out, uint8 * end)
|
||||
}
|
||||
|
||||
static void
|
||||
translate16to16(uint16 * data, uint16 * out, uint16 * end)
|
||||
translate16to16(uint16 * data, uint8 * out, uint8 * end)
|
||||
{
|
||||
uint16 pixel;
|
||||
uint16 value;
|
||||
|
||||
while (out < end)
|
||||
{
|
||||
pixel = *(data++);
|
||||
|
||||
if (g_host_be)
|
||||
{
|
||||
BSWAP16(pixel);
|
||||
}
|
||||
|
||||
value = make_colour(split_colour16(pixel));
|
||||
|
||||
if (g_xserver_be)
|
||||
{
|
||||
while (out < end)
|
||||
{
|
||||
value = *data;
|
||||
BSWAP16(value);
|
||||
*out = value;
|
||||
data++;
|
||||
out++;
|
||||
}
|
||||
|
||||
*(out++) = value >> 8;
|
||||
*(out++) = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (out < end)
|
||||
{
|
||||
*out = *data;
|
||||
out++;
|
||||
data++;
|
||||
*(out++) = value;
|
||||
*(out++) = value >> 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
translate16to24(uint16 * data, uint8 * out, uint8 * end)
|
||||
{
|
||||
@ -591,8 +592,7 @@ translate_image(int width, int height, uint8 * data)
|
||||
translate16to24((uint16 *) data, out, end);
|
||||
break;
|
||||
case 16:
|
||||
translate16to16((uint16 *) data, (uint16 *) out,
|
||||
(uint16 *) end);
|
||||
translate16to16((uint16 *) data, out, end);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user