Fixed oversights in collision code. More sound control.
[luagame.git] / funcs_sound.cpp
blobbf11d15eaf027e2ee22bb2cd336b7848c5ccbb71
1 /*
2 Copyright (c)2006-2007 - Brett Lajzer
4 See LICENSE for license information.
5 */
7 #include "SoundEngine.h"
8 #include "lua.hpp"
9 #include "globals.h"
10 #include "funcs_sound.h"
12 //play a sample
13 int l_playsample(lua_State *L){
14 SoundEngine::play_sample(luaL_checkstring(L,1));
15 return 0;
18 //preload a sample
19 int l_loadsample(lua_State *L){
20 SoundEngine::load_sample(luaL_checkstring(L,1));
21 return 0;
24 //unload a sample
25 int l_unloadsample(lua_State *L){
26 SoundEngine::unload_sample(luaL_checkstring(L,1));
27 return 0;
30 //clear the sample cache
31 int l_clearsamples(lua_State *L){
32 SoundEngine::clear_samples();
33 return 0;
37 //play music
38 int l_playmusic(lua_State *L){
39 SoundEngine::play_music(luaL_checkstring(L,1),lua_tointeger(L,2));
40 return 0;
43 //stop music
44 int l_stopmusic(lua_State *L){
45 SoundEngine::stop_music();
46 return 0;