mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 03:21:49 +00:00
add cubic interpolation type
This commit is contained in:
parent
868b69db90
commit
2bf6ca9b7a
2 changed files with 70 additions and 2 deletions
|
|
@ -229,8 +229,10 @@ static int l_resize(lua::State* L) {
|
|||
uint height = touinteger(L, 3);
|
||||
auto interpName = tostring(L, 4);
|
||||
auto interpolation = InterpolationType::NEAREST;
|
||||
if (!std::strcmp(interpName, "linear")) {
|
||||
if (std::strcmp(interpName, "linear") == 0) {
|
||||
interpolation = InterpolationType::LINEAR;
|
||||
} else if (std::strcmp(interpName, "cubic") == 0) {
|
||||
interpolation = InterpolationType::CUBIC;
|
||||
}
|
||||
heightmap->getHeightmap()->resize(width, height, interpolation);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue