diff options
author | Alexander Baldeck <alexander@archlinux.org> | 2004-12-29 12:29:58 +0000 |
---|---|---|
committer | Alexander Baldeck <alexander@archlinux.org> | 2004-12-29 12:29:58 +0000 |
commit | 8fe800f7afa25e052c387b8a1a7ad6d46f38d916 (patch) | |
tree | ca0f0bf3ef5f556caa3b82f77b9691680182c799 /src/main.cpp | |
parent | ff208227c9dcda7a8279acc8ee43fa28ea284478 (diff) | |
download | mana-8fe800f7afa25e052c387b8a1a7ad6d46f38d916.tar.gz mana-8fe800f7afa25e052c387b8a1a7ad6d46f38d916.tar.bz2 mana-8fe800f7afa25e052c387b8a1a7ad6d46f38d916.tar.xz mana-8fe800f7afa25e052c387b8a1a7ad6d46f38d916.zip |
- 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
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
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 ) |