aboutsummaryrefslogtreecommitdiff
path: root/old/ancient_main_comment.txt
diff options
context:
space:
mode:
authorKahrl <kahrl@gmx.net>2013-09-04 00:16:33 +0200
committerKahrl <kahrl@gmx.net>2013-09-04 00:16:33 +0200
commitaf490330e7f76ba1916c99d90c705a09f68ac00a (patch)
treea9858226e2180fef5c491af1d48ec2a27677b632 /old/ancient_main_comment.txt
parent1ad9365d34bbc4af1b712c77692fd027ebd4b586 (diff)
downloadminetest-af490330e7f76ba1916c99d90c705a09f68ac00a.tar.gz
minetest-af490330e7f76ba1916c99d90c705a09f68ac00a.tar.bz2
minetest-af490330e7f76ba1916c99d90c705a09f68ac00a.zip
Fix remnants of s32 enable_shaders
Diffstat (limited to 'old/ancient_main_comment.txt')
0 files changed, 0 insertions, 0 deletions
float t = time_of_day; if (t < 0.0f) t += ((int)(-t) / 24000) * 24000.0f; if (t >= 24000.0f) t -= ((int)(t) / 24000) * 24000.0f; if (t > 12000.0f) t = 24000.0f - t; const float values[9][2] = { {4250.0f + 125.0f, 175.0f}, {4500.0f + 125.0f, 175.0f}, {4750.0f + 125.0f, 250.0f}, {5000.0f + 125.0f, 350.0f}, {5250.0f + 125.0f, 500.0f}, {5500.0f + 125.0f, 675.0f}, {5750.0f + 125.0f, 875.0f}, {6000.0f + 125.0f, 1000.0f}, {6250.0f + 125.0f, 1000.0f}, }; if (!smooth) { float lastt = values[0][0]; for (u32 i = 1; i < 9; i++) { float t0 = values[i][0]; float switch_t = (t0 + lastt) / 2.0f; lastt = t0; if (switch_t <= t) continue; return values[i][1]; } return 1000; } if (t <= 4625.0f) // 4500 + 125 return values[0][1]; else if (t >= 6125.0f) // 6000 + 125 return 1000; for (u32 i = 0; i < 9; i++) { if (values[i][0] <= t) continue; float td0 = values[i][0] - values[i - 1][0]; float f = (t - values[i - 1][0]) / td0; return f * values[i][1] + (1.0f - f) * values[i - 1][1]; } return 1000; }