Move VideoMode wrappers to video_blit.h.

This commit is contained in:
gbeauche 2004-06-24 15:19:56 +00:00
parent 8948ce2a49
commit b76aab08e4
2 changed files with 38 additions and 36 deletions

View File

@ -30,10 +30,46 @@ struct VisualFormat {
uint32 Rshift, Gshift, Bshift; // RGB shift values
};
// Prototypes
extern void (*Screen_blit)(uint8 * dest, const uint8 * source, uint32 length);
extern bool Screen_blitter_init(VisualFormat const & visual_format, bool native_byte_order, int mac_depth);
extern uint32 ExpandMap[256];
// Glue for SheepShaver and BasiliskII
#ifdef SHEEPSHAVER
enum {
VIDEO_DEPTH_1BIT = APPLE_1_BIT,
VIDEO_DEPTH_2BIT = APPLE_2_BIT,
VIDEO_DEPTH_4BIT = APPLE_4_BIT,
VIDEO_DEPTH_8BIT = APPLE_8_BIT,
VIDEO_DEPTH_16BIT = APPLE_16_BIT,
VIDEO_DEPTH_32BIT = APPLE_32_BIT
};
#define VIDEO_MODE VideoInfo
#define VIDEO_MODE_INIT VideoInfo const & mode = VModes[cur_mode]
#define VIDEO_MODE_ROW_BYTES mode.viRowBytes
#define VIDEO_MODE_X mode.viXsize
#define VIDEO_MODE_Y mode.viYsize
#define VIDEO_MODE_RESOLUTION mode.viAppleID
#define VIDEO_MODE_DEPTH mode.viAppleMode
#else
enum {
VIDEO_DEPTH_1BIT = VDEPTH_1BIT,
VIDEO_DEPTH_2BIT = VDEPTH_2BIT,
VIDEO_DEPTH_4BIT = VDEPTH_4BIT,
VIDEO_DEPTH_8BIT = VDEPTH_8BIT,
VIDEO_DEPTH_16BIT = VDEPTH_16BIT,
VIDEO_DEPTH_32BIT = VDEPTH_32BIT
};
#define VIDEO_MODE video_mode
#define VIDEO_MODE_INIT video_mode const & mode = drv->mode
#define VIDEO_MODE_ROW_BYTES mode.bytes_per_row
#define VIDEO_MODE_X mode.x
#define VIDEO_MODE_Y mode.y
#define VIDEO_MODE_RESOLUTION mode.resolution_id
#define VIDEO_MODE_DEPTH (int)mode.depth
#endif
#endif /* VIDEO_BLIT_H */
#else

View File

@ -29,50 +29,21 @@
#include "sigsegv.h"
#include "vm_alloc.h"
// Glue for SheepShaver and BasiliskII
#if POWERPC_ROM
enum {
VIDEO_DEPTH_1BIT = APPLE_1_BIT,
VIDEO_DEPTH_2BIT = APPLE_2_BIT,
VIDEO_DEPTH_4BIT = APPLE_4_BIT,
VIDEO_DEPTH_8BIT = APPLE_8_BIT,
VIDEO_DEPTH_16BIT = APPLE_16_BIT,
VIDEO_DEPTH_32BIT = APPLE_32_BIT
};
#else
enum {
VIDEO_DEPTH_1BIT = VDEPTH_1BIT,
VIDEO_DEPTH_2BIT = VDEPTH_2BIT,
VIDEO_DEPTH_4BIT = VDEPTH_4BIT,
VIDEO_DEPTH_8BIT = VDEPTH_8BIT,
VIDEO_DEPTH_16BIT = VDEPTH_16BIT,
VIDEO_DEPTH_32BIT = VDEPTH_32BIT
};
#endif
// Glue for SDL and X11 support
#ifdef USE_SDL_VIDEO
#define MONITOR_INIT SDL_monitor_desc &monitor
#define VIDEO_DRV_INIT driver_window *drv
#define VIDEO_DRV_ROW_BYTES drv->s->pitch
#define VIDEO_DRV_LOCK_PIXELS if (SDL_MUSTLOCK(drv->s)) SDL_LockSurface(drv->s)
#define VIDEO_DRV_UNLOCK_PIXELS if (SDL_MUSTLOCK(drv->s)) SDL_UnlockSurface(drv->s)
#define VIDEO_MODE_INIT video_mode const & mode = drv->mode
#define VIDEO_MODE_ROW_BYTES mode.bytes_per_row
#define VIDEO_MODE_X mode.x
#define VIDEO_MODE_Y mode.y
#define VIDEO_MODE_DEPTH (int)mode.depth
#else
#if POWERPC_ROM
#ifdef SHEEPSHAVER
#define MONITOR_INIT /* nothing */
#define VIDEO_DRV_INIT /* nothing */
#define VIDEO_DRV_WINDOW the_win
#define VIDEO_DRV_GC the_gc
#define VIDEO_DRV_IMAGE img
#define VIDEO_DRV_HAVE_SHM have_shm
#define VIDEO_MODE_INIT VideoInfo const & mode = VModes[cur_mode]
#define VIDEO_MODE_ROW_BYTES mode.viRowBytes
#define VIDEO_MODE_X mode.viXsize
#define VIDEO_MODE_Y mode.viYsize
#define VIDEO_MODE_DEPTH mode.viAppleMode
#else
#define MONITOR_INIT X11_monitor_desc &monitor
#define VIDEO_DRV_INIT driver_window *drv
@ -80,11 +51,6 @@ enum {
#define VIDEO_DRV_GC drv->gc
#define VIDEO_DRV_IMAGE drv->img
#define VIDEO_DRV_HAVE_SHM drv->have_shm
#define VIDEO_MODE_INIT video_mode const & mode = drv->mode
#define VIDEO_MODE_ROW_BYTES mode.bytes_per_row
#define VIDEO_MODE_X mode.x
#define VIDEO_MODE_Y mode.y
#define VIDEO_MODE_DEPTH (int)mode.depth
#endif
#define VIDEO_DRV_LOCK_PIXELS /* nothing */
#define VIDEO_DRV_UNLOCK_PIXELS /* nothing */