diff options
author | James Brown | 2002-04-27 04:31:25 +0000 |
---|---|---|
committer | James Brown | 2002-04-27 04:31:25 +0000 |
commit | d0b9677f5d29e5ec601c9831987a524c9a824503 (patch) | |
tree | 84490803eb452af9009eaaa209ccfd4bd89fe5a8 /sdl.cpp | |
parent | 1c108c0ed56faa146b8918c384450fff851f17b8 (diff) | |
download | scummvm-rg350-d0b9677f5d29e5ec601c9831987a524c9a824503.tar.gz scummvm-rg350-d0b9677f5d29e5ec601c9831987a524c9a824503.tar.bz2 scummvm-rg350-d0b9677f5d29e5ec601c9831987a524c9a824503.zip |
Add autosave support, fix sm and max midi.
svn-id: r4099
Diffstat (limited to 'sdl.cpp')
-rw-r--r-- | sdl.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -179,6 +179,7 @@ private: void hotswap_gfx_mode(); void get_320x200_image(byte *buf); + static uint32 autosave(uint32); }; int Init_2xSaI (uint32 BitFormat); @@ -191,23 +192,30 @@ void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, int width, int height); - - void atexit_proc() { SDL_ShowCursor(SDL_ENABLE); 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; syst->_full_screen = full_screen; - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) ==-1) { + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) ==-1) { error("Could not initialize SDL: %s.\n", SDL_GetError()); } SDL_ShowCursor(SDL_DISABLE); + SDL_SetTimer(5 * 60 * 1000, (SDL_TimerCallback) autosave); /* Clean up on exit */ atexit(atexit_proc); |