diff options
author | Ludvig Strigeus | 2002-04-16 12:07:19 +0000 |
---|---|---|
committer | Ludvig Strigeus | 2002-04-16 12:07:19 +0000 |
commit | 71eac5acd30cb1fd48cbfbc464b4a37adee8a6b4 (patch) | |
tree | 8b6e4950c5dd6805344f8051cac517461691d76d /sdl.cpp | |
parent | d91b85049fc8d40cd9ac5ac42fef2d4f1008d63e (diff) | |
download | scummvm-rg350-71eac5acd30cb1fd48cbfbc464b4a37adee8a6b4.tar.gz scummvm-rg350-71eac5acd30cb1fd48cbfbc464b4a37adee8a6b4.tar.bz2 scummvm-rg350-71eac5acd30cb1fd48cbfbc464b4a37adee8a6b4.zip |
endian fixes,
don't use adlib driver if sound initialization fails,
simon1 savedialog works
svn-id: r3955
Diffstat (limited to 'sdl.cpp')
-rw-r--r-- | sdl.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -52,7 +52,7 @@ public: bool poll_event(Event *event); // Set function that generates samples - void set_sound_proc(void *param, SoundProc *proc, byte sound); + bool set_sound_proc(void *param, SoundProc *proc, byte sound); // Quit void quit(); @@ -458,6 +458,8 @@ void OSystem_SDL::mk_checksums(const byte *buf) { void OSystem_SDL::add_dirty_rgn_auto(const byte *buf) { + assert( ((uint32)buf & 3) == 0); + /* generate a table of the checksums */ mk_checksums(buf); @@ -713,7 +715,7 @@ bool OSystem_SDL::poll_event(Event *event) { } } -void OSystem_SDL::set_sound_proc(void *param, SoundProc *proc, byte format) { +bool OSystem_SDL::set_sound_proc(void *param, SoundProc *proc, byte format) { SDL_AudioSpec desired; /* only one format supported at the moment */ @@ -724,8 +726,11 @@ void OSystem_SDL::set_sound_proc(void *param, SoundProc *proc, byte format) { desired.samples = 2048; desired.callback = proc; desired.userdata = param; - SDL_OpenAudio(&desired, NULL); + if (SDL_OpenAudio(&desired, NULL) != 0) { + return false; + } SDL_PauseAudio(0); + return true; } @@ -1031,7 +1036,7 @@ public: void delay_msecs(uint msecs); void *create_thread(ThreadProc *proc, void *param) { return NULL; } bool poll_event(Event *event) { return false; } - void set_sound_proc(void *param, SoundProc *proc, byte sound) {} + bool set_sound_proc(void *param, SoundProc *proc, byte sound) {} void quit() { exit(1); } uint32 property(int param, uint32 value) { return 0; } static OSystem *create(int gfx_mode, bool full_screen); |