Skip to content

Commit 9742934

Browse files
committed
extra-animations: Fix blinds animation
1 parent eab8fa5 commit 9742934

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

src/extra-animations/blinds.hpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ class blinds_transformer : public wf::scene::view_2d_transformer_t
202202

203203
glm::mat4 p = glm::perspective(float(M_PI / 64.0), 1.0f, 0.1f, 100.0f);
204204
glm::mat4 l = glm::lookAt(
205-
glm::vec3(0., 0., 1.0 / std::tan(float(M_PI / 64.0) / 2)),
205+
glm::vec3(0., 0., -1.0 / std::tan(float(M_PI / 64.0) / 2)),
206206
glm::vec3(0., 0., 0.),
207-
glm::vec3(0., 1., 0.));
207+
glm::vec3(0., -1., 0.));
208208

209209
auto transform = p * l;
210210
wf::auxilliary_buffer_t slice_buffer;
@@ -222,16 +222,17 @@ class blinds_transformer : public wf::scene::view_2d_transformer_t
222222
wf::gles_texture_t slice_tex{slice_buffer.get_texture()};
223223

224224
wf::gles::bind_render_buffer(data.target);
225-
for (auto box : data.damage)
226-
{
227-
wf::gles::render_target_logic_scissor(data.target, box);
228-
OpenGL::render_transformed_texture(slice_tex,
229-
gl_geometry{float(src_box.x - line_height),
230-
float(src_box.y + i),
231-
float((src_box.x - line_height) + src_box.width + line_height * 2.0),
232-
float((src_box.y + i) + (y2 - y1))}, {},
233-
wf::gles::render_target_orthographic_projection(data.target), glm::vec4(1.0), 0);
234-
}
225+
/* XXX: Scissoring wrong boxes here makes only top part of effect work */
226+
// for (auto box : data.damage)
227+
// {
228+
// wf::gles::render_target_logic_scissor(data.target, box);
229+
OpenGL::render_transformed_texture(slice_tex,
230+
gl_geometry{float(src_box.x - line_height),
231+
float(src_box.y + i),
232+
float((src_box.x - line_height) + src_box.width + line_height * 2.0),
233+
float((src_box.y + i) + (y2 - y1))}, {},
234+
wf::gles::render_target_orthographic_projection(data.target), glm::vec4(1.0), 0);
235+
// }
235236

236237
slice_buffer.free();
237238
}

0 commit comments

Comments
 (0)