  private:
    GLPainter(const GLPainter&) = delete;
 diff --git a/src/video/gl/gl_renderer.cpp b/src/video/gl/gl_renderer.cpp
-index 8f4a18ee..470bdd4 100644
+index 8f4a18ee..072e99e 100644
 --- a/src/video/gl/gl_renderer.cpp
 +++ b/src/video/gl/gl_renderer.cpp
 @@ -43,35 +43,13 @@

-  }
+  //SCREEN_WIDTH = SDL_GetVideoInfo()->current_w;
+  //SCREEN_HEIGHT = SDL_GetVideoInfo()->current_h;
+  SDL_SetVideoMode(m_desktop_size.width, m_desktop_size.height, 24, SDL_OPENGL | SDL_DOUBLEBUF | SDL_FULLSCREEN);
 }
 
 void
@@ -433,9 +324,9 @@ GLRenderer::to_logical(int physical_x, int physical_y)
 void
 GLRenderer::set_gamma(float gamma)
 {

+      jump_helper_move_right = true;
+    else
+      jump_helper_move_left = true;
+  }
+
+  if (jump_helper)
+  {
+    float friction = WALK_ACCELERATION_X * (on_ice ? ICE_FRICTION_MULTIPLIER : NORMAL_FRICTION_MULTIPLIER);
+    float frictionDistance = physic.get_velocity_x() * physic.get_velocity_x() / friction / 2.0f;
+    if (!jump_helper_jump)
+    { // Start running before jump for long jumps
+      float gravity = Sector::current()->get_gravity();
+      float jumpSpeed = fabs(physic.get_velocity_x()) > MAX_WALK_XM ? 580 : 520;
+      float jumpTime = jumpSpeed / gravity * 2.0f;
+      float maxRunSpeed = speedlimit > 0 ? speedlimit : MAX_RUN_XM;
+      float actualJumpDistance = fabs(physic.get_velocity_x()) * jumpTime / 100.0f;
+      float maxJumpDistance = maxRunSpeed * jumpTime / 100.0f;
+      // Check if we can jump that far at current speed, compensate a bit for velocity we'll gain in the air
+      // Empirical coefficients, we should use WALK_ACCELERATION_X / RUN_ACCELERATION_X here
+      if (fabs(jump_helper_x - get_pos().x) <= actualJumpDistance * 0.4f + maxJumpDistance * 0.6f)
+        jump_helper_jump = true;
+      // Check if we can jump that far without running first
+      if (fabs(jump_helper_x - get_pos().x) <= maxJumpDistance * 0.75f)
+        jump_helper_jump = true;
+    }
+    if (controller->mouse_pressed() // Cancel a jump if user presses any button
+        || controller->pressed(Controller::JUMP) || controller->pressed(Controller::ACTION)
+        || controller->pressed(Controller::DOWN) || controller->pressed(Controller::UP)
+        || controller->pressed(Controller::LEFT) || controller->pressed(Controller::RIGHT)
+        || (jump_helper_x >= get_pos().x - frictionDistance && jump_helper_move_left) // Reached destination - finish the jump
+        || (jump_helper_x <= get_pos().x + frictionDistance && jump_helper_move_right))
+    {
