mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
implement inter-chunk structure generation
This commit is contained in:
parent
03ba7c9539
commit
a413c5d09e
5 changed files with 67 additions and 9 deletions
|
|
@ -70,6 +70,15 @@ static int l_dump(lua::State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int l_at(lua::State* L) {
|
||||
if (auto heightmap = touserdata<LuaHeightmap>(L, 1)) {
|
||||
int x = lua::tointeger(L, 2);
|
||||
int y = lua::tointeger(L, 3);
|
||||
return lua::pushnumber(L, heightmap->getHeightmap()->get(x, y));
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
template<fnl_noise_type noise_type>
|
||||
static int l_noise(lua::State* L) {
|
||||
if (auto heightmap = touserdata<LuaHeightmap>(L, 1)) {
|
||||
|
|
@ -208,6 +217,7 @@ static std::unordered_map<std::string, lua_CFunction> methods {
|
|||
{"abs", lua::wrap<l_unaryop_func<util::abs>>},
|
||||
{"resize", lua::wrap<l_resize>},
|
||||
{"crop", lua::wrap<l_crop>},
|
||||
{"at", lua::wrap<l_at>},
|
||||
};
|
||||
|
||||
static int l_meta_meta_call(lua::State* L) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue