mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-16 18:01:40 +00:00
Fix consistency of sky sun/moon texture behaviour
Also cleans up related code somewhat.
This commit is contained in:
parent
37d80784dd
commit
f8cef52ea0
7 changed files with 79 additions and 139 deletions
|
@ -17,6 +17,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "irrlichttypes_extrabloated.h"
|
||||
#include <ISceneNode.h>
|
||||
#include <array>
|
||||
|
@ -25,8 +27,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "shader.h"
|
||||
#include "skyparams.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
#define SKY_MATERIAL_COUNT 12
|
||||
|
||||
class ITextureSource;
|
||||
|
@ -77,7 +77,7 @@ public:
|
|||
void setMoonScale(f32 moon_scale) { m_moon_params.scale = moon_scale; }
|
||||
|
||||
void setStarsVisible(bool stars_visible) { m_star_params.visible = stars_visible; }
|
||||
void setStarCount(u16 star_count, bool force_update);
|
||||
void setStarCount(u16 star_count);
|
||||
void setStarColor(video::SColor star_color) { m_star_params.starcolor = star_color; }
|
||||
void setStarScale(f32 star_scale) { m_star_params.scale = star_scale; updateStars(); }
|
||||
|
||||
|
@ -150,7 +150,7 @@ private:
|
|||
bool m_visible = true;
|
||||
// Used when m_visible=false
|
||||
video::SColor m_fallback_bg_color = video::SColor(255, 255, 255, 255);
|
||||
bool m_first_update = true;
|
||||
bool m_first_update = true; // Set before the sky is updated for the first time
|
||||
float m_time_of_day;
|
||||
float m_time_brightness;
|
||||
bool m_sunlight_seen;
|
||||
|
@ -206,7 +206,6 @@ private:
|
|||
void draw_stars(video::IVideoDriver *driver, float wicked_time_of_day);
|
||||
void place_sky_body(std::array<video::S3DVertex, 4> &vertices,
|
||||
float horizon_position, float day_position);
|
||||
void setSkyDefaults();
|
||||
};
|
||||
|
||||
// calculates value for sky body positions for the given observed time of day
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue