| 1630 | return 0; |
| 1631 | } |
| 1632 | static int SetBGMVolume(lua_State* L)LNOEXCEPT |
| 1633 | { |
| 1634 | if (lua_gettop(L) == 1) |
| 1635 | { |
| 1636 | float x = static_cast<float>(luaL_checknumber(L, 1)); |
| 1637 | LRES.SetGlobalMusicVolume(max(min(x, 1.f), 0.f)); |
| 1638 | } |
| 1639 | else |
| 1640 | { |
| 1641 | const char* s = luaL_checkstring(L, 1); |
| 1642 | float x = static_cast<float>(luaL_checknumber(L, 2)); |
| 1643 | ResMusic* p = LRES.FindMusic(s); |
| 1644 | if (!p) |
| 1645 | return luaL_error(L, "music '%s' not found.", s); |
| 1646 | p->SetVolume(x * LRES.GetGlobalMusicVolume()); |
| 1647 | } |
| 1648 | return 0; |
| 1649 | } |
| 1650 | |
| 1651 | // 输入控制函数 |
| 1652 | static int GetKeyState(lua_State* L)LNOEXCEPT |
nothing calls this directly
no test coverage detected