From 8fe800f7afa25e052c387b8a1a7ad6d46f38d916 Mon Sep 17 00:00:00 2001 From: Alexander Baldeck Date: Wed, 29 Dec 2004 12:29:58 +0000 Subject: - ported sound engine to SDL_Mixer - name change from TmwSound to Sound as required by HACKING.txt - slight modification of other files using it due to interface changes - minor speedups in Configuration - makefile.static modfified to link against SDL --- src/main.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 07eafbf0..eb830773 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -91,7 +91,7 @@ unsigned char stretch_mode, screen_mode; char *dir; // new sound-engine /- kth5 -TmwSound sound; +Sound sound; // ini file configuration reader Configuration config; @@ -267,6 +267,7 @@ void exit_engine() { config.write(dir); delete dir; gui_exit(); + SDL_Quit(); destroy_bitmap(buffer); allegro_exit(); } @@ -276,9 +277,15 @@ int main() { init_engine(); // initialize sound-engine and start playing intro-theme /-kth5 try { - if (config.getValue("sound", 0) == 1) - sound.Init(32, 20); - sound.SetVol(128, 128, 128); + if (config.getValue("sound", 0) == 1) { + SDL_Init(SDL_INIT_AUDIO); + sound.init(32, 20); + } + sound.setVolume(64); + + /* left here to serve as an example ;) + SOUND_SID id = sound.loadItem("./data/sound/wavs/level.wav"); + sound.startItem(id, 70);*/ } catch (const char *err) { ok("Sound Engine", err); warning(err); @@ -299,7 +306,7 @@ int main() { charSelect(); break; case GAME: - sound.StopBGM(); + sound.stopBgm(); status("GAME"); map_start(); if( state==GAME ) -- cgit v1.2.3-70-g09d2