indexing description: "[ Transition effect. Dissolves smoothly from source to destination scene. This class is part of the XAE Extended Adventure Engine Project. ]" author: "Ralph Wiedemeier, ralphw@student.ethz.ch" date: "$Date$" revision: "$Revision$" class GUI_TRANSITION_DISSOLVE inherit GUI_TRANSITION feature -- Operation do_transition (source: GUI_SCENE; destination: GUI_SCENE; surface: EM_VIDEO_SURFACE) is -- Scene transition: The source scene smoothly dissolves to the destination scene local rel_time: INTEGER start_time: INTEGER blend: DOUBLE texture: EM3D_TEXTURE_2D[EMGL_FORMAT_RGBA] do initialization make_snapshots (source, destination) macro_set_projection_perspective macro_enable_alpha_blending macro_disable_depth_test emgl_load_identity emgl_translatef (0, 52, -700) from start_time := gui_constants.ticks rel_time := 0 until rel_time > duration loop blend := gui_timing.smooth (rel_time / duration) emgl_clear (EM_gl_color_buffer_bit | EM_gl_depth_buffer_bit) texture := fx_texture_1 macro_bind_texture_antialiased_replace (texture) emgl_begin (EM_gl_quads) emgl_color4d (1, 1, 1, 1) emgl_tex_coord2d (0.0, 0.0) emgl_vertex3d (-512, -256, 0) emgl_tex_coord2d (1.0, 0.0) emgl_vertex3d ( 512, -256, 0) emgl_tex_coord2d (1.0, 1.0) emgl_vertex3d ( 512, 256, 0) emgl_tex_coord2d (0.0, 1.0) emgl_vertex3d (-512, 256, 0) emgl_end texture.unbind texture := fx_texture_2 macro_bind_texture_antialiased_modulate (texture) emgl_begin (EM_gl_quads) emgl_color4d (1, 1, 1, blend) emgl_tex_coord2d (0.0, 0.0) emgl_vertex3d (-512, -256, 0) emgl_tex_coord2d (1.0, 0.0) emgl_vertex3d ( 512, -256, 0) emgl_tex_coord2d (1.0, 1.0) emgl_vertex3d ( 512, 256, 0) emgl_tex_coord2d (0.0, 1.0) emgl_vertex3d (-512, 256, 0) emgl_end texture.unbind -- CHANGES -> comment surface.enable_opengl_blitting game_skin.draw (surface) surface.disable_opengl_blitting surface.redraw rel_time := gui_constants.ticks - start_time end destination.reset_scene_time end feature {NONE} -- Implementation default_duration: INTEGER is 800 end -- class GUI_TRANSITION_DISSOLVE