diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-03-16 00:18:26 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-03-16 00:18:26 +0000 |
commit | f8e5e4afaa9e4299ade0a3892fa213a8ed29cb6c (patch) | |
tree | 5e0efba496efa0474bc2de9fc96baea7a63bc992 | |
parent | 020ae4ba6537fdce87209f07ea21cc002aaa52ba (diff) | |
download | mana-f8e5e4afaa9e4299ade0a3892fa213a8ed29cb6c.tar.gz mana-f8e5e4afaa9e4299ade0a3892fa213a8ed29cb6c.tar.bz2 mana-f8e5e4afaa9e4299ade0a3892fa213a8ed29cb6c.tar.xz mana-f8e5e4afaa9e4299ade0a3892fa213a8ed29cb6c.zip |
Advanced version to 0.0.11, updated desert tilesets and made sound code log a
bit more.
-rw-r--r-- | The Mana World.dev | 6 | ||||
-rwxr-xr-x | configure.ac | 2 | ||||
-rw-r--r-- | src/game.cpp | 2 | ||||
-rw-r--r-- | src/gui/chat.cpp | 1 | ||||
-rw-r--r-- | src/sound.cpp | 54 |
5 files changed, 23 insertions, 42 deletions
diff --git a/The Mana World.dev b/The Mana World.dev index 0c3c666c..5039443b 100644 --- a/The Mana World.dev +++ b/The Mana World.dev @@ -32,19 +32,19 @@ CompilerSettings=0010001001001000001101 [VersionInfo] Major=0 Minor=0 -Release=10 +Release=11 Build=0 LanguageID=1033 CharsetID=1252 CompanyName=The Mana World Development Team -FileVersion=0.0.10 +FileVersion=0.0.11 FileDescription=The Mana World InternalName=tmw.exe LegalCopyright=2004 (C) LegalTrademarks= OriginalFilename=tmw.exe ProductName=The Mana World MMORPG -ProductVersion=0.0.10 +ProductVersion=0.0.11 AutoIncBuildNr=0 [Unit8] diff --git a/configure.ac b/configure.ac index 54d4ab61..2fd683ff 100755 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([The Mana World], [0.0.10], [umperio@users.sourceforge.net]) +AC_INIT([The Mana World], [0.0.11], [umperio@users.sourceforge.net]) AC_CONFIG_HEADERS([config.h:config.h.in]) AC_LANG_CPLUSPLUS diff --git a/src/game.cpp b/src/game.cpp index 77bb83c3..276131d9 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -127,7 +127,7 @@ void game() { void do_init() { tiledMap = Map::load(map_path); - //tiledMap = MapReader::readMap("core/maps/desert.tmx"); + //tiledMap = MapReader::readMap("core/maps/tempdesert.tmx.gz"); if (!tiledMap) { error("Could not find map file"); } diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 45c87ee8..d642459c 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -347,4 +347,3 @@ std::string ChatWindow::cut_string(std::string& value, unsigned int maximumLengt return std::string(""); } - diff --git a/src/sound.cpp b/src/sound.cpp index 6e2c19fe..74222c8c 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -24,10 +24,6 @@ #include "sound.h" #include "log.h" -#ifdef __DEBUG -#include <iostream> -#endif - void Sound::init(int voices, int mod_voices) { // Don't initialize sound engine twice @@ -39,9 +35,10 @@ void Sound::init(int voices, int mod_voices) int audio_channels = 2; int audio_buffers = 4096; - if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) { + if (Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) + { #ifndef __DEBUG - throw("Unable to open audio device!\n"); + throw("Unable to open audio device!"); #else throw(Mix_GetError()); #endif @@ -58,10 +55,9 @@ void Sound::init(int voices, int mod_voices) void Sound::setVolume(int music) { - if (isOk == -1) - return; + if (isOk == -1) return; - if (isMaxVol(music) == false) { + if (!isMaxVol(music)) { vol_music = music; Mix_VolumeMusic(vol_music); } @@ -69,8 +65,7 @@ void Sound::setVolume(int music) void Sound::adjustVolume(int amusic) { - if (isOk == -1) - return; + if (isOk == -1) return; if (!isMaxVol(vol_music + amusic)) { vol_music += amusic; @@ -78,31 +73,25 @@ void Sound::adjustVolume(int amusic) } } -void Sound::startBgm(char * in, int loop) +void Sound::startBgm(char *in, int loop) { - if (isOk == -1) - return; + if (isOk == -1) return; if (bgm != NULL) { stopBgm(); } + log("Sound::startBgm() playing \"%s\" %d times", in, loop); + bgm = Mix_LoadMUS(in); Mix_PlayMusic(bgm, loop); -#ifdef __DEBUG - std::cout << "Sound::startBgm() Playing \"" << in << "\" " << loop << " times\n"; -#endif } void Sound::stopBgm() { - if (isOk == -1) { - return; - } + if (isOk == -1) return; -#ifdef __DEBUG - std::cout << "Sound::stopBgm()\n"; -#endif + log("Sound::stopBgm()"); if (bgm != NULL) { Mix_HaltMusic(); @@ -113,15 +102,12 @@ void Sound::stopBgm() SOUND_SID Sound::loadItem(char *fpath) { -#ifdef __DEBUG - std::cout << "Sound::loadItem() precaching \"" << fpath << "\"\n"; -#endif + log("Sound::loadItem() precaching \"%s\"", fpath); + Mix_Chunk *newItem; if ((newItem = Mix_LoadWAV(fpath))) { soundpool[++items] = newItem; -#ifdef __DEBUG - std::cout << "Sound::loadItem() success SOUND_SID = " << items << std::endl; -#endif + log("Sound::loadItem() success SOUND_SID = %d", items); return items; } @@ -131,9 +117,7 @@ SOUND_SID Sound::loadItem(char *fpath) void Sound::startItem(SOUND_SID id, int volume) { if (soundpool[id]) { -#ifdef __DEBUG - std::cout << "Sound::startItem() playing SOUND_SID = " << id << std::endl; -#endif + log("Sound::startItem() playing SOUND_SID = %d", id); Mix_VolumeChunk(soundpool[id], volume); Mix_PlayChannel(-1, soundpool[id], 0); } @@ -141,15 +125,13 @@ void Sound::startItem(SOUND_SID id, int volume) void Sound::clearCache() { - for(SOUND_SID i = 0; i == items; i++) { + for (SOUND_SID i = 0; i == items; i++) { Mix_FreeChunk(soundpool[i]); soundpool[i] = NULL; } soundpool.clear(); -#ifdef __DEBUG - std::cout << "Sound::clearCache() wiped all items off the cache\n"; -#endif + log("Sound::clearCache() wiped all items off the cache"); } void Sound::close() |