Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | pmbaty | 1 | /* |
| 2 | * Portions of this file are copyright Rebirth contributors and licensed as |
||
| 3 | * described in COPYING.txt. |
||
| 4 | * Portions of this file are copyright Parallax Software and licensed |
||
| 5 | * according to the Parallax license below. |
||
| 6 | * See COPYING.txt for license details. |
||
| 7 | |||
| 8 | THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX |
||
| 9 | SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO |
||
| 10 | END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A |
||
| 11 | ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS |
||
| 12 | IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS |
||
| 13 | SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE |
||
| 14 | FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE |
||
| 15 | CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS |
||
| 16 | AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. |
||
| 17 | COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. |
||
| 18 | */ |
||
| 19 | |||
| 20 | /* |
||
| 21 | * |
||
| 22 | * Functions for changing viewer's position |
||
| 23 | * |
||
| 24 | */ |
||
| 25 | |||
| 26 | |||
| 27 | #include "inferno.h" |
||
| 28 | #include "editor.h" |
||
| 29 | #include "editor/esegment.h" |
||
| 30 | #include "editor/medmisc.h" |
||
| 31 | #include "kdefs.h" |
||
| 32 | |||
| 33 | // ---------- zoom control on current window ---------- |
||
| 34 | int ZoomIn() |
||
| 35 | { |
||
| 36 | if (!current_view) return 0.0; |
||
| 37 | |||
| 38 | current_view->ev_zoom = fixmul(current_view->ev_zoom,62259); |
||
| 39 | current_view->ev_changed = 1; |
||
| 40 | return 1; |
||
| 41 | } |
||
| 42 | |||
| 43 | int ZoomOut() |
||
| 44 | { |
||
| 45 | if (!current_view) return 0.0; |
||
| 46 | |||
| 47 | current_view->ev_zoom = fixmul(current_view->ev_zoom,68985); |
||
| 48 | current_view->ev_changed = 1; |
||
| 49 | return 1; |
||
| 50 | } |
||
| 51 | |||
| 52 | // ---------- distance-of-viewer control on current window ---------- |
||
| 53 | int MoveCloser() |
||
| 54 | { |
||
| 55 | if (!current_view) return 0.0; |
||
| 56 | |||
| 57 | current_view->ev_dist = fixmul(current_view->ev_dist,62259); |
||
| 58 | current_view->ev_changed = 1; |
||
| 59 | return 1; |
||
| 60 | } |
||
| 61 | |||
| 62 | int MoveAway() |
||
| 63 | { |
||
| 64 | if (!current_view) return 0.0; |
||
| 65 | |||
| 66 | current_view->ev_dist = fixmul(current_view->ev_dist,68985); |
||
| 67 | current_view->ev_changed = 1; |
||
| 68 | return 1; |
||
| 69 | } |
||
| 70 | |||
| 71 | // ---------- Toggle chase mode. ---------- |
||
| 72 | |||
| 73 | int ToggleChaseMode() |
||
| 74 | { |
||
| 75 | Funky_chase_mode = !Funky_chase_mode; |
||
| 76 | auto &LevelSharedVertexState = LevelSharedSegmentState.get_vertex_state(); |
||
| 77 | auto &Vertices = LevelSharedVertexState.get_vertices(); |
||
| 78 | auto &vcvertptr = Vertices.vcptr; |
||
| 79 | set_view_target_from_segment(vcvertptr, Cursegp); |
||
| 80 | if (Funky_chase_mode == 1) { |
||
| 81 | diagnostic_message("Chase mode ON."); |
||
| 82 | } |
||
| 83 | if (Funky_chase_mode == 0) { |
||
| 84 | diagnostic_message("Chase mode OFF."); |
||
| 85 | } |
||
| 86 | return Funky_chase_mode; |
||
| 87 | } |
||
| 88 |