add heightmap:resize(int, int, str)

This commit is contained in:
MihailRis
2024-08-17 22:09:31 +03:00
parent e560236a8c
commit 8c0a3f4260
4 changed files with 114 additions and 1 deletions
+7
View File
@@ -306,6 +306,13 @@ namespace lua {
inline lua::Integer tointeger(lua::State* L, int idx) {
return lua_tointeger(L, idx);
}
inline uint64_t touinteger(lua::State* L, int idx) {
auto val = lua_tointeger(L, idx);
if (val < 0) {
throw std::runtime_error("negative value");
}
return static_cast<uint64_t>(val);
}
inline lua::Number tonumber(lua::State* L, int idx) {
return lua_tonumber(L, idx);
}