aboutsummaryrefslogtreecommitdiff
path: root/sdl.cpp
diff options
context:
space:
mode:
authorLudvig Strigeus2002-04-16 12:07:19 +0000
committerLudvig Strigeus2002-04-16 12:07:19 +0000
commit71eac5acd30cb1fd48cbfbc464b4a37adee8a6b4 (patch)
tree8b6e4950c5dd6805344f8051cac517461691d76d /sdl.cpp
parentd91b85049fc8d40cd9ac5ac42fef2d4f1008d63e (diff)
downloadscummvm-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.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/sdl.cpp b/sdl.cpp
index 6d4ec0cd37..00b4ed8b96 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -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);