From 0c4cad40ffa86c1e517db3fa0a0bef960cb4f51b Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Fri, 9 Apr 2010 13:16:44 +0000 Subject: [PATCH] no sound means no sound git-svn-id: http://svn.net-core.org/repos/t-engine4@528 51575b47-30f0-44d4-a5cc-537603b46e54 --- src/music.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/music.c b/src/music.c index d6c4aeb3f6..854cb8c182 100644 --- a/src/music.c +++ b/src/music.c @@ -30,6 +30,7 @@ static int music_new(lua_State *L) { + if (no_sound) return 0; const char *name = luaL_checkstring(L, 1); Mix_Music **m = (Mix_Music**)lua_newuserdata(L, sizeof(Mix_Music*)); @@ -67,6 +68,7 @@ static int music_play(lua_State *L) static int music_stop(lua_State *L) { + if (no_sound) return 0; int fadeout = lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 0; Mix_FadeOutMusic(fadeout); return 0; @@ -74,6 +76,7 @@ static int music_stop(lua_State *L) static int music_volume(lua_State *L) { + if (no_sound) return 0; int vol = lua_isnumber(L, 1) ? lua_tonumber(L, 1) : 100; Mix_VolumeMusic(SDL_MIX_MAXVOLUME * vol / 100); @@ -82,6 +85,7 @@ static int music_volume(lua_State *L) static int sound_new(lua_State *L) { + if (no_sound) return 0; const char *name = luaL_checkstring(L, 1); Mix_Chunk **m = (Mix_Chunk**)lua_newuserdata(L, sizeof(Mix_Chunk*)); @@ -132,6 +136,7 @@ static int sound_volume(lua_State *L) static int channel_fadeout(lua_State *L) { + if (no_sound) return 0; int chan = luaL_checknumber(L, 1); int ms = luaL_checknumber(L, 2); -- GitLab