store each logo scale with 1.0 as max
This commit is contained in:
parent
8bf3b595c3
commit
37ecb3a30b
@ -49,7 +49,7 @@ class FadingLogos : Mode
|
|||||||
mat4 view_matrix;
|
mat4 view_matrix;
|
||||||
view_matrix.make_identity();
|
view_matrix.make_identity();
|
||||||
view_matrix.scale(ss.get_height() / cast(float)ss.get_width(), 1.0, 1.0);
|
view_matrix.scale(ss.get_height() / cast(float)ss.get_width(), 1.0, 1.0);
|
||||||
double scale = 0.35 * ss.get_width() * 1080.0 / (ss.get_height() * 1920.0);
|
const double scale = 0.35 * ss.get_aspect() * (1080.0 / 1920.0);
|
||||||
view_matrix.scale(scale, scale, scale);
|
view_matrix.scale(scale, scale, scale);
|
||||||
|
|
||||||
glUniformMatrix4fv(m_shader.view_idx, 1, GL_TRUE, view_matrix.value_ptr);
|
glUniformMatrix4fv(m_shader.view_idx, 1, GL_TRUE, view_matrix.value_ptr);
|
||||||
@ -81,7 +81,6 @@ class FadingLogos : Mode
|
|||||||
|
|
||||||
protected void update_logos(ScreenSaver ss, uint ms)
|
protected void update_logos(ScreenSaver ss, uint ms)
|
||||||
{
|
{
|
||||||
const double max_scale = 0.35 * ss.get_aspect() * (1080.0 / 1920.0);
|
|
||||||
if (m_last_create_time == 0 || (ms - m_last_create_time) >= CREATE_DELAY)
|
if (m_last_create_time == 0 || (ms - m_last_create_time) >= CREATE_DELAY)
|
||||||
{
|
{
|
||||||
/* time to create a new logo */
|
/* time to create a new logo */
|
||||||
@ -90,7 +89,7 @@ class FadingLogos : Mode
|
|||||||
lp.c_x = uniform(-0.8 * ss.get_aspect(), 0.8 * ss.get_aspect());
|
lp.c_x = uniform(-0.8 * ss.get_aspect(), 0.8 * ss.get_aspect());
|
||||||
lp.c_y = uniform(-0.8, 0.8);
|
lp.c_y = uniform(-0.8, 0.8);
|
||||||
lp.rotation = uniform(0.0, math.PI * 2.0);
|
lp.rotation = uniform(0.0, math.PI * 2.0);
|
||||||
lp.scale = uniform(0.2 * max_scale, max_scale);
|
lp.scale = uniform(0.2, 1.0);
|
||||||
m_logos ~= lp;
|
m_logos ~= lp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user