@@ -77,12 +77,7 @@ public SceneryDrawer(Viewer viewer)
7777 public void Load ( )
7878 {
7979 var cancellation = Viewer . LoaderProcess . CancellationToken ;
80- Viewer . DontLoadNightTextures = ( Program . Simulator . Settings . ConditionalLoadOfDayOrNightTextures &&
81- ( ( Viewer . MaterialManager . sunDirection . Y > 0.05f && Program . Simulator . ClockTime % 86400 < 43200 ) ||
82- ( Viewer . MaterialManager . sunDirection . Y > 0.15f && Program . Simulator . ClockTime % 86400 >= 43200 ) ) ) ? true : false ;
83- Viewer . DontLoadDayTextures = ( Program . Simulator . Settings . ConditionalLoadOfDayOrNightTextures &&
84- ( ( Viewer . MaterialManager . sunDirection . Y < - 0.05f && Program . Simulator . ClockTime % 86400 >= 43200 ) ||
85- ( Viewer . MaterialManager . sunDirection . Y < - 0.15f && Program . Simulator . ClockTime % 86400 < 43200 ) ) ) ? true : false ;
80+
8681 if ( TileX != VisibleTileX || TileZ != VisibleTileZ )
8782 {
8883 TileX = VisibleTileX ;
@@ -113,7 +108,7 @@ public void Load()
113108 Viewer . tryLoadingNightTextures = true ; // when Tiles loaded change you can try
114109 Viewer . tryLoadingDayTextures = true ; // when Tiles loaded change you can try
115110 }
116- else if ( Viewer . NightTexturesNotLoaded && Program . Simulator . ClockTime % 86400 >= 43200 && Viewer . tryLoadingNightTextures )
111+ else if ( Viewer . NightTexturesNotLoaded && ! Viewer . IsBeforeNoon && Viewer . tryLoadingNightTextures )
117112 {
118113 var sunHeight = Viewer . MaterialManager . sunDirection . Y ;
119114 if ( sunHeight < 0.10f && sunHeight > 0.01 )
@@ -133,7 +128,7 @@ public void Load()
133128 else if ( sunHeight <= 0.01 )
134129 Viewer . NightTexturesNotLoaded = false ; // too late to try, we must give up and we don't load the night textures
135130 }
136- else if ( Viewer . DayTexturesNotLoaded && Program . Simulator . ClockTime % 86400 < 43200 && Viewer . tryLoadingDayTextures )
131+ else if ( Viewer . DayTexturesNotLoaded && Viewer . IsBeforeNoon && Viewer . tryLoadingDayTextures )
137132 {
138133 var sunHeight = Viewer . MaterialManager . sunDirection . Y ;
139134 if ( sunHeight > - 0.10f && sunHeight < - 0.01 )
0 commit comments