声音控制函数
| 1519 | |
| 1520 | // 声音控制函数 |
| 1521 | static int PlaySound(lua_State* L)LNOEXCEPT |
| 1522 | { |
| 1523 | const char* s = luaL_checkstring(L, 1); |
| 1524 | ResSound* p = LRES.FindSound(s); |
| 1525 | if (!p) |
| 1526 | return luaL_error(L, "sound '%s' not found.", s); |
| 1527 | p->Play((float)luaL_checknumber(L, 2) * LRES.GetGlobalSoundEffectVolume(), (float)luaL_optnumber(L, 3, 0.)); |
| 1528 | return 0; |
| 1529 | } |
| 1530 | static int StopSound(lua_State* L)LNOEXCEPT |
| 1531 | { |
| 1532 | const char* s = luaL_checkstring(L, 1); |
nothing calls this directly
no test coverage detected