Skip to content

Commit

Permalink
SDL: Make VOSF update functions apply to driver_base
Browse files Browse the repository at this point in the history
They don't use anything special from fullscreen/windowed derived classes.
Also, get rid of unneeded friend declarations.
  • Loading branch information
vasi committed Apr 24, 2013
1 parent 2a5100e commit d0648a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
14 changes: 4 additions & 10 deletions BasiliskII/src/SDL/video_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand All @@ -623,18 +623,12 @@ class driver_base {
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();
Expand Down Expand Up @@ -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<driver_fullscreen *>(drv));
update_display_dga_vosf(drv);
UNLOCK_VOSF;
}
}
Expand All @@ -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<driver_window *>(drv));
update_display_window_vosf(drv);
UNLOCK_VOSF;
}
}
Expand Down
4 changes: 2 additions & 2 deletions BasiliskII/src/Unix/video_vosf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0648a7

Please sign in to comment.