16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 15:49:18 +02:00

support for seasonal texture sets, wireframe mode render speed fix

This commit is contained in:
tmj-fstate
2017-10-23 15:57:37 +02:00
parent 35e526a454
commit d92004a818
9 changed files with 108 additions and 60 deletions

View File

@@ -2322,7 +2322,6 @@ void TWorld::ChangeDynamic() {
}
Global::changeDynObj = NULL;
}
//---------------------------------------------------------------------------
void
TWorld::ToggleDaylight() {
@@ -2339,6 +2338,30 @@ TWorld::ToggleDaylight() {
}
}
// calculates current season of the year based on set simulation date
void
TWorld::compute_season( int const Yearday ) const {
using dayseasonpair = std::pair<int, std::string>;
std::vector<dayseasonpair> seasonsequence {
{ 65, "winter" },
{ 158, "spring" },
{ 252, "summer" },
{ 341, "autumn" },
{ 366, "winter" } };
auto const lookup =
std::lower_bound(
std::begin( seasonsequence ), std::end( seasonsequence ),
clamp( Yearday, 1, seasonsequence.back().first ),
[]( dayseasonpair const &Left, const int Right ) {
return Left.first < Right; } );
Global::Season = lookup->second + ":";
}
void
world_environment::init() {