21 |
#include <X11/Xlib.h> |
#include <X11/Xlib.h> |
22 |
#include <X11/Xutil.h> |
#include <X11/Xutil.h> |
23 |
#include <unistd.h> |
#include <unistd.h> |
24 |
|
#include <sys/time.h> |
25 |
#include <time.h> |
#include <time.h> |
26 |
#include <errno.h> |
#include <errno.h> |
27 |
#include <strings.h> |
#include <strings.h> |
64 |
static int g_red_shift_l, g_blue_shift_l, g_green_shift_l; |
static int g_red_shift_l, g_blue_shift_l, g_green_shift_l; |
65 |
|
|
66 |
/* software backing store */ |
/* software backing store */ |
67 |
static BOOL g_ownbackstore; |
BOOL g_ownbackstore = True; /* We can't rely on external BackingStore */ |
68 |
static Pixmap g_backstore = 0; |
static Pixmap g_backstore = 0; |
69 |
|
|
70 |
/* Moving in single app mode */ |
/* Moving in single app mode */ |
169 |
split_colour15(uint32 colour) |
split_colour15(uint32 colour) |
170 |
{ |
{ |
171 |
PixelColour rv; |
PixelColour rv; |
172 |
rv.red = (colour & 0x7c00) >> 10; |
rv.red = (colour & 0x7c00) >> 7; |
173 |
rv.red = (rv.red * 0xff) / 0x1f; |
rv.green = (colour & 0x03e0) >> 2; |
174 |
rv.green = (colour & 0x03e0) >> 5; |
rv.blue = (colour & 0x001f) << 3; |
|
rv.green = (rv.green * 0xff) / 0x1f; |
|
|
rv.blue = (colour & 0x1f); |
|
|
rv.blue = (rv.blue * 0xff) / 0x1f; |
|
175 |
return rv; |
return rv; |
176 |
} |
} |
177 |
|
|
179 |
split_colour16(uint32 colour) |
split_colour16(uint32 colour) |
180 |
{ |
{ |
181 |
PixelColour rv; |
PixelColour rv; |
182 |
rv.red = (colour & 0xf800) >> 11; |
rv.red = (colour & 0xf800) >> 8; |
183 |
rv.red = (rv.red * 0xff) / 0x1f; |
rv.green = (colour & 0x07e0) >> 3; |
184 |
rv.green = (colour & 0x07e0) >> 5; |
rv.blue = (colour & 0x001f) << 3; |
|
rv.green = (rv.green * 0xff) / 0x3f; |
|
|
rv.blue = (colour & 0x001f); |
|
|
rv.blue = (rv.blue * 0xff) / 0x1f; |
|
185 |
return rv; |
return rv; |
186 |
} |
} |
187 |
|
|
189 |
split_colour24(uint32 colour) |
split_colour24(uint32 colour) |
190 |
{ |
{ |
191 |
PixelColour rv; |
PixelColour rv; |
192 |
rv.blue = (colour & 0xff0000) >> 16; |
rv.blue = (colour & 0xff0000) >> 16; |
193 |
rv.green = (colour & 0xff00) >> 8; |
rv.green = (colour & 0x00ff00) >> 8; |
194 |
rv.red = (colour & 0xff); |
rv.red = (colour & 0x0000ff); |
195 |
return rv; |
return rv; |
196 |
} |
} |
197 |
|
|
786 |
warning("Screen depth is 8 bits or lower: you may want to use -C for a private colourmap\n"); |
warning("Screen depth is 8 bits or lower: you may want to use -C for a private colourmap\n"); |
787 |
} |
} |
788 |
|
|
789 |
if (DoesBackingStore(g_screen) != Always) |
if ((!g_ownbackstore) && (DoesBackingStore(g_screen) != Always)) |
790 |
|
{ |
791 |
|
warning("External BackingStore not available, using internal\n"); |
792 |
g_ownbackstore = True; |
g_ownbackstore = True; |
793 |
|
} |
794 |
|
|
795 |
test = 1; |
test = 1; |
796 |
g_host_be = !(BOOL) (*(uint8 *) (&test)); |
g_host_be = !(BOOL) (*(uint8 *) (&test)); |
1777 |
/* src */ int srcx, int srcy) |
/* src */ int srcx, int srcy) |
1778 |
{ |
{ |
1779 |
SET_FUNCTION(opcode); |
SET_FUNCTION(opcode); |
|
XCopyArea(g_display, g_wnd, g_wnd, g_gc, srcx, srcy, cx, cy, x, y); |
|
1780 |
if (g_ownbackstore) |
if (g_ownbackstore) |
1781 |
|
{ |
1782 |
|
XCopyArea(g_display, g_backstore, g_wnd, g_gc, srcx, srcy, cx, cy, x, y); |
1783 |
XCopyArea(g_display, g_backstore, g_backstore, g_gc, srcx, srcy, cx, cy, x, y); |
XCopyArea(g_display, g_backstore, g_backstore, g_gc, srcx, srcy, cx, cy, x, y); |
1784 |
|
} |
1785 |
|
else |
1786 |
|
{ |
1787 |
|
XCopyArea(g_display, g_wnd, g_wnd, g_gc, srcx, srcy, cx, cy, x, y); |
1788 |
|
} |
1789 |
RESET_FUNCTION(opcode); |
RESET_FUNCTION(opcode); |
1790 |
} |
} |
1791 |
|
|