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

Comparing BasiliskII/src/SDL/video_sdl.cpp (file contents):
Revision 1.11 by gbeauche, 2004-07-02T06:08:01Z vs.
Revision 1.12 by gbeauche, 2004-07-27T21:40:52Z

# Line 324 | Line 324 | static inline int bytes_per_pixel(int de
324   }
325  
326   // Map video_mode depth ID to numerical depth value
327 < static int sdl_depth_of_video_depth(int video_depth)
327 > static int mac_depth_of_video_depth(int video_depth)
328   {
329          int depth = -1;
330          switch (video_depth) {
# Line 352 | Line 352 | static int sdl_depth_of_video_depth(int
352          return depth;
353   }
354  
355 + // Map video_mode depth ID to SDL screen depth
356 + static int sdl_depth_of_video_depth(int video_depth)
357 + {
358 +        return (video_depth <= VIDEO_DEPTH_8BIT) ? 8 : mac_depth_of_video_depth(video_depth);
359 + }
360 +
361   // Check wether specified mode is available
362   static bool has_mode(int type, int width, int height)
363   {
# Line 617 | Line 623 | driver_window::driver_window(SDL_monitor
623          ADBSetRelMouseMode(mouse_grabbed);
624  
625          // Create surface
626 <        int depth = ((int)VIDEO_MODE_DEPTH <= VIDEO_DEPTH_8BIT ? 8 : screen_depth);
626 >        int depth = sdl_depth_of_video_depth(VIDEO_MODE_DEPTH);
627          if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE)) == NULL)
628                  return;
629  
# Line 675 | Line 681 | driver_window::driver_window(SDL_monitor
681          visualFormat.Rmask = f->Rmask;
682          visualFormat.Gmask = f->Gmask;
683          visualFormat.Bmask = f->Bmask;
684 <        Screen_blitter_init(visualFormat, true, sdl_depth_of_video_depth(VIDEO_MODE_DEPTH));
684 >        Screen_blitter_init(visualFormat, true, mac_depth_of_video_depth(VIDEO_MODE_DEPTH));
685  
686          // Load gray ramp to 8->16/32 expand map
687          if (!IsDirectMode(mode))
# Line 954 | Line 960 | bool VideoInit(bool classic)
960                          add_mode(display_type, 512, 342, 0x80, 64, VIDEO_DEPTH_1BIT);
961                  else {
962                          for (int d = VIDEO_DEPTH_1BIT; d <= default_depth; d++) {
963 <                                int bpp = (d <= VIDEO_DEPTH_8BIT ? 8 : sdl_depth_of_video_depth(d));
963 >                                int bpp = sdl_depth_of_video_depth(d);
964                                  if (SDL_VideoModeOK(max_width, max_height, bpp, SDL_HWSURFACE))
965                                          add_window_modes(video_depth(d));
966                          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines