From d0648a7039059729035b1bbc2b819555667f61b5 Mon Sep 17 00:00:00 2001 From: Dave Vasilevsky Date: Mon, 22 Apr 2013 05:26:44 -0400 Subject: [PATCH] SDL: Make VOSF update functions apply to driver_base They don't use anything special from fullscreen/windowed derived classes. Also, get rid of unneeded friend declarations. --- BasiliskII/src/SDL/video_sdl.cpp | 14 ++++---------- BasiliskII/src/Unix/video_vosf.h | 4 ++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/BasiliskII/src/SDL/video_sdl.cpp b/BasiliskII/src/SDL/video_sdl.cpp index e17597e3..95623dcc 100644 --- a/BasiliskII/src/SDL/video_sdl.cpp +++ b/BasiliskII/src/SDL/video_sdl.cpp @@ -601,7 +601,7 @@ class driver_base { public: driver_base(SDL_monitor_desc &m); virtual void init(); - virtual ~driver_base(); + ~driver_base(); virtual void update_palette(void); virtual void suspend(void) {} @@ -623,18 +623,12 @@ public: SDL_Surface *s; // The surface we draw into }; -class driver_window; #ifdef ENABLE_VOSF -static void update_display_window_vosf(driver_window *drv); +static void update_display_window_vosf(driver_base *drv); #endif static void update_display_static(driver_base *drv); class driver_window : public driver_base { -#ifdef ENABLE_VOSF - friend void update_display_window_vosf(driver_window *drv); -#endif - friend void update_display_static(driver_base *drv); - public: driver_window(SDL_monitor_desc &monitor); virtual void init(); @@ -2104,7 +2098,7 @@ static void video_refresh_dga_vosf(void) tick_counter = 0; if (mainBuffer.dirty) { LOCK_VOSF; - update_display_dga_vosf(static_cast(drv)); + update_display_dga_vosf(drv); UNLOCK_VOSF; } } @@ -2122,7 +2116,7 @@ static void video_refresh_window_vosf(void) tick_counter = 0; if (mainBuffer.dirty) { LOCK_VOSF; - update_display_window_vosf(static_cast(drv)); + update_display_window_vosf(drv); UNLOCK_VOSF; } } diff --git a/BasiliskII/src/Unix/video_vosf.h b/BasiliskII/src/Unix/video_vosf.h index 6713d308..0fe0a172 100644 --- a/BasiliskII/src/Unix/video_vosf.h +++ b/BasiliskII/src/Unix/video_vosf.h @@ -36,8 +36,8 @@ #else #ifdef USE_SDL_VIDEO #define MONITOR_INIT SDL_monitor_desc &monitor -#define VIDEO_DRV_WIN_INIT driver_window *drv -#define VIDEO_DRV_DGA_INIT driver_fullscreen *drv +#define VIDEO_DRV_WIN_INIT driver_base *drv +#define VIDEO_DRV_DGA_INIT driver_base *drv #define VIDEO_DRV_LOCK_PIXELS SDL_VIDEO_LOCK_SURFACE(drv->s) #define VIDEO_DRV_UNLOCK_PIXELS SDL_VIDEO_UNLOCK_SURFACE(drv->s) #define VIDEO_DRV_DEPTH drv->s->format->BitsPerPixel