From 7dabb7260b8f45062470e1f5d2b51e9fc37348b5 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Sat, 8 Sep 2012 15:23:02 +0100 Subject: [PATCH] Delete dead code --- src/Editor.cpp | 94 -------------------------------------------------- 1 file changed, 94 deletions(-) diff --git a/src/Editor.cpp b/src/Editor.cpp index 50d2149..ecfe4a9 100644 --- a/src/Editor.cpp +++ b/src/Editor.cpp @@ -619,100 +619,6 @@ void Editor::draw_dragged_track() else draw_constrained_track(start_dir, end_dir); } - - -#if 0 - end_dir = -end_dir; - - // If we have to guess both orientations use a heuristic to decide - // between S-bends and curves - if (end_was_guess && start_was_guess) { - if (min(xlen, ylen) <= 2) { - if (xlen > ylen) - start_dir = end_dir = axis::X; - else - start_dir = end_dir = axis::Y; - } - else { - start_dir = axis::X; - end_dir = axis::Y; - } - } - // Otherwise always prefer curves to S-bends - else if (start_was_guess) { - if (end_dir == axis::X || end_dir == -axis::X) { - if (is_shift_down) - start_dir = drag_begin.y > drag_end.y - ? make_vector(end_dir.x, 0, -1) - : make_vector(end_dir.x, 0, 1); - else - start_dir = drag_begin.y > drag_end.y ? -axis::Y : axis::Y; - } - else { - if (is_shift_down) - start_dir = drag_begin.x > drag_end.x - ? make_vector(-1, 0, end_dir.z) - : make_vector(1, 0, end_dir.z); - else - start_dir = drag_begin.x > drag_end.x ? -axis::X : axis::X; - } - } - else if (end_was_guess) { - if (start_dir == axis::X || start_dir == -axis::X) { - if (is_shift_down) - end_dir = drag_begin.y > drag_end.y - ? make_vector(start_dir.x, 0, -1) - : make_vector(start_dir.x, 0, 1); - else - end_dir = drag_begin.y > drag_end.y ? -axis::Y : axis::Y; - } - else { - if (is_shift_down) - end_dir = drag_begin.x > drag_end.x - ? make_vector(-1, 0, start_dir.z) - : make_vector(1, 0, start_dir.z); - else - end_dir = drag_begin.x > drag_end.x ? -axis::X : axis::X; - } - } - -#if 1 - debug(); - debug() << "start_was_guess=" << start_was_guess - << " end_was_guess=" << end_was_guess; - debug() << "drag_begin=" << drag_begin - << " drag_end=" << drag_end; - debug() << "start_dir=" << start_dir << " end_dir=" << end_dir; -#endif - - if (xlen == 1 && ylen == 1) { - // A single tile - draw_track_tile(drag_begin, start_dir); - } - else if (xlen == 1) { - draw_dragged_straight(drag_begin.y < drag_end.y ? axis::Y : -axis::Y, - ylen); - } - else if (ylen == 1) { - draw_dragged_straight(drag_begin.x < drag_end.x ? axis::X : -axis::X, - xlen); - } - else { - PointI delta = drag_end - drag_begin; - - VectorI off = make_vector(delta.x, delta.y, 0); - - ITrackSegmentPtr track = make_spline_track(off, - start_dir, - end_dir); - - PointI where = drag_begin; - track->set_origin(where.x, where.y, map->height_at(where)); - - if (can_place_track(track)) - map->set_track_at(where, track); - } -#endif } // Delete all objects in the area selected by the user -- 2.39.2