46 |
|
#include "about_window.h" |
47 |
|
#include "video.h" |
48 |
|
#include "video_defs.h" |
49 |
+ |
#include "video_blit.h" |
50 |
|
|
51 |
|
#define DEBUG 0 |
52 |
|
#include "debug.h" |
102 |
|
static Window rootwin, the_win; // Root window and our window |
103 |
|
static int num_depths = 0; // Number of available X depths |
104 |
|
static int *avail_depths = NULL; // List of available X depths |
105 |
+ |
static VisualFormat visualFormat; |
106 |
|
static XVisualInfo visualInfo; |
107 |
|
static Visual *vis; |
108 |
|
static int color_class; |
542 |
|
native_byte_order = (XImageByteOrder(x_display) == LSBFirst); |
543 |
|
#endif |
544 |
|
#ifdef ENABLE_VOSF |
545 |
< |
Screen_blitter_init(&visualInfo, native_byte_order, depth); |
545 |
> |
Screen_blitter_init(visualFormat, native_byte_order, depth); |
546 |
|
#endif |
547 |
|
|
548 |
|
// Set bytes per row |
616 |
|
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
617 |
|
// Screen_blitter_init() returns TRUE if VOSF is mandatory |
618 |
|
// i.e. the framebuffer update function is not Blit_Copy_Raw |
619 |
< |
use_vosf = Screen_blitter_init(&visualInfo, native_byte_order, depth); |
619 |
> |
use_vosf = Screen_blitter_init(visualFormat, native_byte_order, depth); |
620 |
|
|
621 |
|
if (use_vosf) { |
622 |
|
// Allocate memory for frame buffer (SIZE is extended to page-boundary) |
653 |
|
return false; |
654 |
|
} |
655 |
|
|
656 |
+ |
// Build up visualFormat structure |
657 |
+ |
visualFormat.depth = visualInfo.depth; |
658 |
+ |
visualFormat.Rmask = visualInfo.red_mask; |
659 |
+ |
visualFormat.Gmask = visualInfo.green_mask; |
660 |
+ |
visualFormat.Bmask = visualInfo.blue_mask; |
661 |
+ |
|
662 |
|
// Create color maps |
663 |
|
if (color_class == PseudoColor || color_class == DirectColor) { |
664 |
|
cmap[0] = XCreateColormap(x_display, rootwin, vis, AllocAll); |
2379 |
|
// Set new cursor image if it was changed |
2380 |
|
if (hw_mac_cursor_accl && cursor_changed) { |
2381 |
|
cursor_changed = false; |
2382 |
< |
memcpy(cursor_image->data, MacCursor + 4, 32); |
2383 |
< |
memcpy(cursor_mask_image->data, MacCursor + 36, 32); |
2382 |
> |
uint8 *x_data = (uint8 *)cursor_image->data; |
2383 |
> |
uint8 *x_mask = (uint8 *)cursor_mask_image->data; |
2384 |
> |
for (int i = 0; i < 32; i++) { |
2385 |
> |
x_mask[i] = MacCursor[4 + i] | MacCursor[36 + i]; |
2386 |
> |
x_data[i] = MacCursor[4 + i]; |
2387 |
> |
} |
2388 |
|
XDisplayLock(); |
2389 |
|
XFreeCursor(x_display, mac_cursor); |
2390 |
|
XPutImage(x_display, cursor_map, cursor_gc, cursor_image, 0, 0, 0, 0, 16, 16); |