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) { |
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 |
|
{ |
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 |
|
|
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)) |
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 |
|
} |