From: Perttu Ahola Date: Sun, 25 Mar 2012 12:52:43 +0000 (+0300) Subject: Sound loading from memory (by using a quick hack) X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=db0928add3af6da67b1717933e92338f1030d5fb;p=zefram%2Fminetest%2Fminetest_engine.git Sound loading from memory (by using a quick hack) --- diff --git a/src/game.cpp b/src/game.cpp index aff1f198..d6c9910b 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -972,31 +972,6 @@ void the_game( SoundMaker soundmaker(sound, nodedef); soundmaker.registerReceiver(&eventmgr); - // Preload sounds -#if 0 - sound->loadSound("default_grass_footstep", porting::path_share + DIR_DELIM - + "sounds" + DIR_DELIM + "default_grass_walk1.ogg"); - sound->loadSound("default_grass_footstep", porting::path_share + DIR_DELIM - + "sounds" + DIR_DELIM + "default_grass_walk2.ogg"); - sound->loadSound("default_grass_footstep", porting::path_share + DIR_DELIM - + "sounds" + DIR_DELIM + "default_grass_walk3.ogg"); - - sound->loadSound("default_dig_crumbly", porting::path_share + DIR_DELIM - + "sounds" + DIR_DELIM + "default_dig_crumbly1.ogg"); - sound->loadSound("default_dig_crumbly", porting::path_share + DIR_DELIM - + "sounds" + DIR_DELIM + "default_dig_crumbly2.ogg"); - - sound->loadSound("default_dig_cracky", porting::path_share + DIR_DELIM - + "sounds" + DIR_DELIM + "default_dig_cracky1.ogg"); - - sound->loadSound("default_place_node", porting::path_share + DIR_DELIM - + "sounds" + DIR_DELIM + "default_place_node1.ogg"); - sound->loadSound("default_place_node", porting::path_share + DIR_DELIM - + "sounds" + DIR_DELIM + "default_place_node2.ogg"); - sound->loadSound("default_place_node", porting::path_share + DIR_DELIM - + "sounds" + DIR_DELIM + "default_place_node3.ogg"); -#endif - // Add chat log output for errors to be shown in chat LogOutputBuffer chat_log_error_buf(LMT_ERROR); diff --git a/src/sound_openal.cpp b/src/sound_openal.cpp index f7bce654..e635e0fa 100644 --- a/src/sound_openal.cpp +++ b/src/sound_openal.cpp @@ -41,6 +41,7 @@ with this program; ifnot, write to the Free Software Foundation, Inc., #include #include #include "utility.h" // myrand() +#include "filesys.h" #define BUFFER_SIZE 30000 @@ -434,9 +435,18 @@ public: bool loadSoundData(const std::string &name, const std::string &filedata) { - errorstream<<"OpenALSoundManager: Loading from filedata not" - " implemented"<