if (m_star_params.starcolor.getAlpha() < 1)
return;
#if ENABLE_GLES
- u16 *indices = new u16[m_star_count * 3];
+ u16 *indices = new u16[m_star_params.count * 3];
video::S3DVertex *vertices =
- new video::S3DVertex[m_star_count * 3];
- for (u32 i = 0; i < m_star_count; i++) {
+ new video::S3DVertex[m_star_params.count * 3];
+ for (u32 i = 0; i < m_star_params.count; i++) {
indices[i * 3 + 0] = i * 3 + 0;
indices[i * 3 + 1] = i * 3 + 1;
indices[i * 3 + 2] = i * 3 + 2;
vertices[i * 3 + 2].Pos = p2;
vertices[i * 3 + 2].Color = starcolor;
}
- driver->drawIndexedTriangleList(vertices.data(), m_star_count * 3,
- indices.data(), m_star_count);
+ driver->drawIndexedTriangleList(vertices, m_star_params.count * 3,
+ indices, m_star_params.count);
delete[] indices;
delete[] vertices;
#else
}
}
-void Sky::setSunriseTexture(std::string sunglow_texture,
+void Sky::setSunriseTexture(std::string sunglow_texture,
ITextureSource* tsrc)
{
// Ignore matching textures (with modifiers) entirely.
);
}
-void Sky::setMoonTexture(std::string moon_texture,
+void Sky::setMoonTexture(std::string moon_texture,
std::string moon_tonemap, ITextureSource *tsrc)
{
// Ignore matching textures (with modifiers) entirely,
void Sky::setStarCount(u16 star_count, bool force_update)
{
- // Force updating star count at game init.
- if (force_update) {
- m_star_params.count = star_count;
- m_stars.clear();
- // Rebuild the stars surrounding the camera
- for (u16 i = 0; i < star_count; i++) {
- v3f star = v3f(
- myrand_range(-10000, 10000),
- myrand_range(-10000, 10000),
- myrand_range(-10000, 10000)
- );
-
- star.normalize();
- m_stars.emplace_back(star);
- }
- // Ignore changing star count if the new value is identical
- } else if (m_star_params.count == star_count)
- return;
- else {
+ // Allow force updating star count at game init.
+ if (m_star_params.count != star_count || force_update) {
m_star_params.count = star_count;
m_stars.clear();
// Rebuild the stars surrounding the camera
#pragma once
-struct skycolor
+struct SkyColor
{
video::SColor day_sky;
video::SColor day_horizon;
std::string type;
std::vector<std::string> textures;
bool clouds;
- skycolor sky_color;
+ SkyColor sky_color;
video::SColor sun_tint;
video::SColor moon_tint;
std::string tint_type;
class SkyboxDefaults
{
public:
- const skycolor getSkyColorDefaults()
+ const SkyColor getSkyColorDefaults()
{
- skycolor sky;
+ SkyColor sky;
// Horizon colors
sky.day_horizon = video::SColor(255, 155, 193, 240);
sky.indoors = video::SColor(255, 100, 100, 100);
const StarParams getStarDefaults()
{
StarParams stars;
+ stars.visible = true;
stars.count = 1000;
stars.starcolor = video::SColor(105, 235, 235, 255);
stars.scale = 1;