aboutsummaryrefslogtreecommitdiff
path: root/sdl.cpp
diff options
context:
space:
mode:
authorJames Brown2002-05-14 18:14:16 +0000
committerJames Brown2002-05-14 18:14:16 +0000
commita592de43330c4ab1162b83599e12e70696cb661c (patch)
tree4d6d4b0296fdb2fa34ae89fec6925a766f29506c /sdl.cpp
parentb5a8bb6b2a3e8ae28ca4cee1464395cb6302acb7 (diff)
downloadscummvm-rg350-a592de43330c4ab1162b83599e12e70696cb661c.tar.gz
scummvm-rg350-a592de43330c4ab1162b83599e12e70696cb661c.tar.bz2
scummvm-rg350-a592de43330c4ab1162b83599e12e70696cb661c.zip
Remove SCUMM dependancies from SDL.C - This fixes a regular crash in Simon due to the autosaver.
This changes the OSystem interface. Porters beware. svn-id: r4318
Diffstat (limited to 'sdl.cpp')
-rw-r--r--sdl.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/sdl.cpp b/sdl.cpp
index def195189e..33fc6e6af5 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -96,6 +96,9 @@ public:
// Set a parameter
uint32 property(int param, Property *value);
+ // Add a callback timer
+ void set_timer(int timer, void* callback);
+
static OSystem *create(int gfx_mode, bool full_screen);
private:
@@ -176,8 +179,7 @@ private:
void hotswap_gfx_mode();
- void get_320x200_image(byte *buf);
- static uint32 autosave(uint32);
+ void get_320x200_image(byte *buf);
void setup_icon();
};
@@ -203,14 +205,6 @@ void atexit_proc() {
SDL_Quit();
}
-uint32 OSystem_SDL::autosave(uint32 interval)
-{
- g_scumm->_doAutosave = true;
-
- return interval;
-}
-
-
OSystem *OSystem_SDL::create(int gfx_mode, bool full_screen) {
OSystem_SDL *syst = new OSystem_SDL();
syst->_mode = gfx_mode;
@@ -225,7 +219,6 @@ OSystem *OSystem_SDL::create(int gfx_mode, bool full_screen) {
#endif /* doesn't do COOPERATIVE mode*/
SDL_ShowCursor(SDL_DISABLE);
- SDL_SetTimer(5 * 60 * 1000, (SDL_TimerCallback) autosave);
/* Setup the icon */
syst->setup_icon();
@@ -236,6 +229,9 @@ OSystem *OSystem_SDL::create(int gfx_mode, bool full_screen) {
return syst;
}
+void OSystem_SDL::set_timer(int timer, void* callback) {
+ SDL_SetTimer(timer, (SDL_TimerCallback) callback);
+}
OSystem *OSystem_SDL_create(int gfx_mode, bool full_screen) {
return OSystem_SDL::create(gfx_mode, full_screen);
}
@@ -891,7 +887,6 @@ uint32 OSystem_SDL::property(int param, Property *value) {
case PROP_TOGGLE_FULLSCREEN:
_full_screen ^= true;
- g_scumm->_fullScreen = _full_screen;
if (!SDL_WM_ToggleFullScreen(sdl_hwscreen)) {
/* if ToggleFullScreen fails, achieve the same effect with hotswap gfx mode */
@@ -899,6 +894,9 @@ uint32 OSystem_SDL::property(int param, Property *value) {
}
return 1;
+ case PROP_GET_FULLSCREEN:
+ return _full_screen;
+
case PROP_SET_WINDOW_CAPTION:
SDL_WM_SetCaption(value->caption, value->caption);
return 1;
@@ -1050,9 +1048,6 @@ void OSystem_SDL::stop_cdrom() { /* Stop CD Audio in 1/10th of a second */
}
void OSystem_SDL::play_cdrom(int track, int num_loops, int start_frame, int end_frame) {
- /* Reset sync count */
- g_scumm->_vars[g_scumm->VAR_MI1_TIMER] = 0;
-
if (!num_loops && !start_frame)
return;