Merge branch 'main' into animation

This commit is contained in:
MihailRis 2026-08-30 20:13:38 +03:00
commit 8c1d8bd794
24 changed files with 56 additions and 50 deletions

View file

@ -51,7 +51,7 @@ static std::unique_ptr<xml::xmlelement> toxml(lua::State* L) {
break;
}
auto key = lua::require_lstring(L, -1);
if (key == "@") {
if (key == TAG_ATTR) {
break;
}
auto value = lua::require_lstring(L, -2);

View file

@ -323,7 +323,7 @@ namespace lua {
if (found == usertypeNames.end()) {
log_error(
"usertype is not registred: " + std::string(typeid(T).name())
"usertype is not registered: " + std::string(typeid(T).name())
);
} else if (getglobal(L, found->second)) {
setmetatable(L);

View file

@ -128,11 +128,10 @@ static int l_noise(lua::State* L) {
}
float noiseValue = fnlGetNoise2D(noise, u, v);
float t = 1.0f / static_cast<float>(1 << c) * multiplier;
if (normalizedNoise) {
float t = 1.0f / (static_cast<float>(1 << c) * multiplier);
value = value * (1.0f - t) + noiseValue * t;
} else {
float t = 1.0f / static_cast<float>(1 << c) * multiplier;
value += noiseValue * t;
}
heights[i] = value;