ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/video_x.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/video_x.cpp (file contents):
Revision 1.57 by cebix, 2001-07-09T11:22:00Z vs.
Revision 1.59 by cebix, 2001-07-11T17:04:41Z

# Line 213 | Line 213 | static bool find_visual_for_depth(video_
213          // Calculate minimum and maximum supported X depth
214          int min_depth = 1, max_depth = 32;
215          switch (depth) {
216 <                case VDEPTH_1BIT:       // 1-bit works always
217 <                        min_depth = 1;
218 <                        max_depth = 32;
216 >                case VDEPTH_1BIT:       // 1-bit works always and uses default visual
217 >                        min_depth = max_depth = DefaultDepth(x_display, screen);
218                          break;
219   #ifdef ENABLE_VOSF
220                  case VDEPTH_2BIT:
# Line 294 | Line 293 | static bool find_visual_for_depth(video_
293                  case DirectColor: D(bug("DirectColor\n")); break;
294          }
295   #endif
296 +        return true;
297   }
298  
299   // Add mode to list of supported modes
# Line 532 | Line 532 | driver_base::~driver_base()
532   // Palette has changed
533   void driver_base::update_palette(void)
534   {
535 <        if (cmap[0] && cmap[1]) {
535 >        if (color_class == PseudoColor || color_class == DirectColor) {
536                  int num = vis->map_entries;
537                  if (!IsDirectMode(VideoMonitor.mode) && color_class == DirectColor)
538                          return; // Indexed mode on true color screen, don't set CLUT
# Line 570 | Line 570 | driver_window::driver_window(const video
570          // Set absolute mouse mode
571          ADBSetRelMouseMode(mouse_grabbed);
572  
573 <        // Create window
573 >        // Create window (setting backround_pixel, border_pixel and colormap is
574 >        // mandatory when using a non-default visual; in 1-bit mode we use the
575 >        // default visual, so we can also use the default colormap)
576          XSetWindowAttributes wattr;
577          wattr.event_mask = eventmask = win_eventmask;
578 <        wattr.background_pixel = black_pixel;
579 <        wattr.colormap = (mode.depth == VDEPTH_1BIT && color_class == PseudoColor ? DefaultColormap(x_display, screen) : cmap[0]);
578 >        wattr.background_pixel = (vis == DefaultVisual(x_display, screen) ? black_pixel : 0);
579 >        wattr.border_pixel = 0;
580 >        wattr.colormap = (mode.depth == VDEPTH_1BIT ? DefaultColormap(x_display, screen) : cmap[0]);
581          w = XCreateWindow(x_display, rootwin, 0, 0, width, height, 0, xdepth,
582 <                InputOutput, vis, CWEventMask | CWBackPixel | (color_class == PseudoColor || color_class == DirectColor ? CWColormap : 0), &wattr);
582 >                InputOutput, vis, CWEventMask | CWBackPixel | CWBorderPixel | CWColormap, &wattr);
583  
584          // Set window name/class
585          set_window_name(w, STR_WINDOW_TITLE);
# Line 1347 | Line 1350 | static bool video_open(const video_mode
1350          if (color_class == PseudoColor || color_class == DirectColor) {
1351                  cmap[0] = XCreateColormap(x_display, rootwin, vis, AllocAll);
1352                  cmap[1] = XCreateColormap(x_display, rootwin, vis, AllocAll);
1353 +        } else {
1354 +                cmap[0] = XCreateColormap(x_display, rootwin, vis, AllocNone);
1355 +                cmap[1] = XCreateColormap(x_display, rootwin, vis, AllocNone);
1356          }
1357  
1358          // Find pixel format of direct modes
# Line 1391 | Line 1397 | static bool video_open(const video_mode
1397                  palette[i].green = c * 0x0101;
1398                  palette[i].blue = c * 0x0101;
1399          }
1400 <        if (cmap[0] && cmap[1]) {
1400 >        if (color_class == PseudoColor || color_class == DirectColor) {
1401                  XStoreColors(x_display, cmap[0], palette, num);
1402                  XStoreColors(x_display, cmap[1], palette, num);
1403          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines