@@ -839,7 +839,7 @@ class Game {
839
839
MapDrawControl *draw_control = nullptr ;
840
840
Camera *camera = nullptr ;
841
841
Clouds *clouds = nullptr ; // Free using ->Drop()
842
- Sky *m_sky = nullptr ; // Free using ->Drop()
842
+ Sky *sky = nullptr ; // Free using ->Drop()
843
843
Hud *hud = nullptr ;
844
844
Minimap *mapper = nullptr ;
845
845
@@ -1159,8 +1159,8 @@ void Game::shutdown()
1159
1159
if (gui_chat_console)
1160
1160
gui_chat_console->drop ();
1161
1161
1162
- if (m_sky )
1163
- m_sky ->drop ();
1162
+ if (sky )
1163
+ sky ->drop ();
1164
1164
1165
1165
/* cleanup menus */
1166
1166
while (g_menumgr.menuCount () > 0 ) {
@@ -1346,8 +1346,8 @@ bool Game::createClient(const GameStartData &start_data)
1346
1346
1347
1347
/* Skybox
1348
1348
*/
1349
- m_sky = new Sky (-1 , m_rendering_engine, texture_src, shader_src);
1350
- scsf->setSky (m_sky );
1349
+ sky = new Sky (-1 , m_rendering_engine, texture_src, shader_src);
1350
+ scsf->setSky (sky );
1351
1351
skybox = NULL ; // This is used/set later on in the main run loop
1352
1352
1353
1353
/* Pre-calculated values
@@ -2754,51 +2754,51 @@ void Game::handleClientEvent_HudChange(ClientEvent *event, CameraOrientation *ca
2754
2754
2755
2755
void Game::handleClientEvent_SetSky (ClientEvent *event, CameraOrientation *cam)
2756
2756
{
2757
- m_sky ->setVisible (false );
2757
+ sky ->setVisible (false );
2758
2758
// Whether clouds are visible in front of a custom skybox.
2759
- m_sky ->setCloudsEnabled (event->set_sky ->clouds );
2759
+ sky ->setCloudsEnabled (event->set_sky ->clouds );
2760
2760
2761
2761
if (skybox) {
2762
2762
skybox->remove ();
2763
2763
skybox = NULL ;
2764
2764
}
2765
2765
// Clear the old textures out in case we switch rendering type.
2766
- m_sky ->clearSkyboxTextures ();
2766
+ sky ->clearSkyboxTextures ();
2767
2767
// Handle according to type
2768
2768
if (event->set_sky ->type == " regular" ) {
2769
2769
// Shows the mesh skybox
2770
- m_sky ->setVisible (true );
2770
+ sky ->setVisible (true );
2771
2771
// Update mesh based skybox colours if applicable.
2772
- m_sky ->setSkyColors (event->set_sky ->sky_color );
2773
- m_sky ->setHorizonTint (
2772
+ sky ->setSkyColors (event->set_sky ->sky_color );
2773
+ sky ->setHorizonTint (
2774
2774
event->set_sky ->fog_sun_tint ,
2775
2775
event->set_sky ->fog_moon_tint ,
2776
2776
event->set_sky ->fog_tint_type
2777
2777
);
2778
2778
} else if (event->set_sky ->type == " skybox" &&
2779
2779
event->set_sky ->textures .size () == 6 ) {
2780
2780
// Disable the dyanmic mesh skybox:
2781
- m_sky ->setVisible (false );
2781
+ sky ->setVisible (false );
2782
2782
// Set fog colors:
2783
- m_sky ->setFallbackBgColor (event->set_sky ->bgcolor );
2783
+ sky ->setFallbackBgColor (event->set_sky ->bgcolor );
2784
2784
// Set sunrise and sunset fog tinting:
2785
- m_sky ->setHorizonTint (
2785
+ sky ->setHorizonTint (
2786
2786
event->set_sky ->fog_sun_tint ,
2787
2787
event->set_sky ->fog_moon_tint ,
2788
2788
event->set_sky ->fog_tint_type
2789
2789
);
2790
2790
// Add textures to skybox.
2791
2791
for (int i = 0 ; i < 6 ; i++)
2792
- m_sky ->addTextureToSkybox (event->set_sky ->textures [i], i, texture_src);
2792
+ sky ->addTextureToSkybox (event->set_sky ->textures [i], i, texture_src);
2793
2793
} else {
2794
2794
// Handle everything else as plain color.
2795
2795
if (event->set_sky ->type != " plain" )
2796
2796
infostream << " Unknown sky type: "
2797
2797
<< (event->set_sky ->type ) << std::endl;
2798
- m_sky ->setVisible (false );
2799
- m_sky ->setFallbackBgColor (event->set_sky ->bgcolor );
2798
+ sky ->setVisible (false );
2799
+ sky ->setFallbackBgColor (event->set_sky ->bgcolor );
2800
2800
// Disable directional sun/moon tinting on plain or invalid skyboxes.
2801
- m_sky ->setHorizonTint (
2801
+ sky ->setHorizonTint (
2802
2802
event->set_sky ->bgcolor ,
2803
2803
event->set_sky ->bgcolor ,
2804
2804
" custom"
@@ -2810,30 +2810,30 @@ void Game::handleClientEvent_SetSky(ClientEvent *event, CameraOrientation *cam)
2810
2810
2811
2811
void Game::handleClientEvent_SetSun (ClientEvent *event, CameraOrientation *cam)
2812
2812
{
2813
- m_sky ->setSunVisible (event->sun_params ->visible );
2814
- m_sky ->setSunTexture (event->sun_params ->texture ,
2813
+ sky ->setSunVisible (event->sun_params ->visible );
2814
+ sky ->setSunTexture (event->sun_params ->texture ,
2815
2815
event->sun_params ->tonemap , texture_src);
2816
- m_sky ->setSunScale (event->sun_params ->scale );
2817
- m_sky ->setSunriseVisible (event->sun_params ->sunrise_visible );
2818
- m_sky ->setSunriseTexture (event->sun_params ->sunrise , texture_src);
2816
+ sky ->setSunScale (event->sun_params ->scale );
2817
+ sky ->setSunriseVisible (event->sun_params ->sunrise_visible );
2818
+ sky ->setSunriseTexture (event->sun_params ->sunrise , texture_src);
2819
2819
delete event->sun_params ;
2820
2820
}
2821
2821
2822
2822
void Game::handleClientEvent_SetMoon (ClientEvent *event, CameraOrientation *cam)
2823
2823
{
2824
- m_sky ->setMoonVisible (event->moon_params ->visible );
2825
- m_sky ->setMoonTexture (event->moon_params ->texture ,
2824
+ sky ->setMoonVisible (event->moon_params ->visible );
2825
+ sky ->setMoonTexture (event->moon_params ->texture ,
2826
2826
event->moon_params ->tonemap , texture_src);
2827
- m_sky ->setMoonScale (event->moon_params ->scale );
2827
+ sky ->setMoonScale (event->moon_params ->scale );
2828
2828
delete event->moon_params ;
2829
2829
}
2830
2830
2831
2831
void Game::handleClientEvent_SetStars (ClientEvent *event, CameraOrientation *cam)
2832
2832
{
2833
- m_sky ->setStarsVisible (event->star_params ->visible );
2834
- m_sky ->setStarCount (event->star_params ->count , false );
2835
- m_sky ->setStarColor (event->star_params ->starcolor );
2836
- m_sky ->setStarScale (event->star_params ->scale );
2833
+ sky ->setStarsVisible (event->star_params ->visible );
2834
+ sky ->setStarCount (event->star_params ->count , false );
2835
+ sky ->setStarColor (event->star_params ->starcolor );
2836
+ sky ->setStarScale (event->star_params ->scale );
2837
2837
delete event->star_params ;
2838
2838
}
2839
2839
@@ -3710,7 +3710,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
3710
3710
direct_brightness = time_brightness;
3711
3711
sunlight_seen = true ;
3712
3712
} else {
3713
- float old_brightness = m_sky ->getBrightness ();
3713
+ float old_brightness = sky ->getBrightness ();
3714
3714
direct_brightness = client->getEnv ().getClientMap ()
3715
3715
.getBackgroundBrightness (MYMIN (runData.fog_range * 1.2 , 60 * BS),
3716
3716
daynight_ratio, (int )(old_brightness * 255.5 ), &sunlight_seen)
@@ -3737,15 +3737,15 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
3737
3737
3738
3738
runData.time_of_day_smooth = time_of_day_smooth;
3739
3739
3740
- m_sky ->update (time_of_day_smooth, time_brightness, direct_brightness,
3740
+ sky ->update (time_of_day_smooth, time_brightness, direct_brightness,
3741
3741
sunlight_seen, camera->getCameraMode (), player->getYaw (),
3742
3742
player->getPitch ());
3743
3743
3744
3744
/*
3745
3745
Update clouds
3746
3746
*/
3747
3747
if (clouds) {
3748
- if (m_sky ->getCloudsVisible ()) {
3748
+ if (sky ->getCloudsVisible ()) {
3749
3749
clouds->setVisible (true );
3750
3750
clouds->step (dtime);
3751
3751
// camera->getPosition is not enough for 3rd person views
@@ -3755,14 +3755,14 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
3755
3755
camera_node_position.Y = camera_node_position.Y + camera_offset.Y * BS;
3756
3756
camera_node_position.Z = camera_node_position.Z + camera_offset.Z * BS;
3757
3757
clouds->update (camera_node_position,
3758
- m_sky ->getCloudColor ());
3758
+ sky ->getCloudColor ());
3759
3759
if (clouds->isCameraInsideCloud () && m_cache_enable_fog) {
3760
3760
// if inside clouds, and fog enabled, use that as sky
3761
3761
// color(s)
3762
3762
video::SColor clouds_dark = clouds->getColor ()
3763
3763
.getInterpolated (video::SColor (255 , 0 , 0 , 0 ), 0.9 );
3764
- m_sky ->overrideColors (clouds_dark, clouds->getColor ());
3765
- m_sky ->setInClouds (true );
3764
+ sky ->overrideColors (clouds_dark, clouds->getColor ());
3765
+ sky ->setInClouds (true );
3766
3766
runData.fog_range = std::fmin (runData.fog_range * 0 .5f , 32 .0f * BS);
3767
3767
// do not draw clouds after all
3768
3768
clouds->setVisible (false );
@@ -3783,7 +3783,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
3783
3783
3784
3784
if (m_cache_enable_fog) {
3785
3785
driver->setFog (
3786
- m_sky ->getBgColor (),
3786
+ sky ->getBgColor (),
3787
3787
video::EFT_FOG_LINEAR,
3788
3788
runData.fog_range * m_cache_fog_start,
3789
3789
runData.fog_range * 1.0 ,
@@ -3793,7 +3793,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
3793
3793
);
3794
3794
} else {
3795
3795
driver->setFog (
3796
- m_sky ->getBgColor (),
3796
+ sky ->getBgColor (),
3797
3797
video::EFT_FOG_LINEAR,
3798
3798
100000 * BS,
3799
3799
110000 * BS,
@@ -3873,7 +3873,7 @@ void Game::updateFrame(ProfilerGraph *graph, RunStats *stats, f32 dtime,
3873
3873
/*
3874
3874
Drawing begins
3875
3875
*/
3876
- const video::SColor &skycolor = m_sky ->getSkyColor ();
3876
+ const video::SColor &skycolor = sky ->getSkyColor ();
3877
3877
3878
3878
TimeTaker tt_draw (" Draw scene" );
3879
3879
driver->beginScene (true , true , skycolor);
0 commit comments