Debian Codegraph @

similar/editor/kview.cpp

raw
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 "editor.h"
28 #include "editor/esegment.h"
29 #include "editor/medmisc.h"
30 #include "kdefs.h"
31
32 // ---------- zoom control on current window ----------
33 int ZoomIn()
34 {
35 if (!current_view) return 0.0;
36
37 current_view->ev_zoom = fixmul(current_view->ev_zoom,62259);
38 current_view->ev_changed = 1;
39 return 1;
40 }
41
42 int ZoomOut()
43 {
44 if (!current_view) return 0.0;
45
46 current_view->ev_zoom = fixmul(current_view->ev_zoom,68985);
47 current_view->ev_changed = 1;
48 return 1;
49 }
50
51 // ---------- distance-of-viewer control on current window ----------
52 int MoveCloser()
53 {
54 if (!current_view) return 0.0;
55
56 current_view->ev_dist = fixmul(current_view->ev_dist,62259);
57 current_view->ev_changed = 1;
58 return 1;
59 }
60
61 int MoveAway()
62 {
63 if (!current_view) return 0.0;
64
65 current_view->ev_dist = fixmul(current_view->ev_dist,68985);
66 current_view->ev_changed = 1;
67 return 1;
68 }
69
70 // ---------- Toggle chase mode. ----------
71
72 int ToggleChaseMode()
73 {
74 Funky_chase_mode = !Funky_chase_mode;
75 auto &LevelSharedVertexState = LevelSharedSegmentState.get_vertex_state();
76 auto &Vertices = LevelSharedVertexState.get_vertices();
77 auto &vcvertptr = Vertices.vcptr;
78 set_view_target_from_segment(vcvertptr, Cursegp);
79 if (Funky_chase_mode == 1) {
80 diagnostic_message("Chase mode ON.");
81 }
82 if (Funky_chase_mode == 0) {
83 diagnostic_message("Chase mode OFF.");
84 }
85 return Funky_chase_mode;
86 }
87