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:
25
World.cpp
25
World.cpp
@@ -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() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user