add cubic interpolation type

This commit is contained in:
ChancellorIkseew
2024-10-28 04:47:40 +10:00
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);
}