]> icculus.org git repositories - btb/d2x.git/blob - main/editor/kview.c
remove rcs tags
[btb/d2x.git] / main / editor / kview.c
1 /*
2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
12 */
13
14 /*
15  *
16  * Functions for changing viewer's position
17  *
18  */
19
20 #ifdef HAVE_CONFIG_H
21 #include "conf.h"
22 #endif
23
24 #include "inferno.h"
25 #include "editor.h"
26
27 // ---------- zoom control on current window ----------
28 int ZoomIn()
29 {
30         if (!current_view) return 0.0;
31
32         current_view->ev_zoom = fixmul(current_view->ev_zoom,62259);
33         current_view->ev_changed = 1;
34         return 1;
35 }
36
37 int ZoomOut()
38 {
39         if (!current_view) return 0.0;
40
41         current_view->ev_zoom = fixmul(current_view->ev_zoom,68985);
42         current_view->ev_changed = 1;
43         return 1;
44 }
45
46 // ---------- distance-of-viewer control on current window ----------
47 int MoveCloser()
48 {
49         if (!current_view) return 0.0;
50
51         current_view->ev_dist = fixmul(current_view->ev_dist,62259);
52         current_view->ev_changed = 1;
53         return 1;
54 }
55
56 int MoveAway()
57 {
58         if (!current_view) return 0.0;
59
60         current_view->ev_dist = fixmul(current_view->ev_dist,68985);
61         current_view->ev_changed = 1;
62         return 1;
63 }
64
65 // ---------- Toggle chase mode. ----------
66
67 int ToggleChaseMode()
68 {
69         Funky_chase_mode = !Funky_chase_mode;
70         set_view_target_from_segment(Cursegp);
71     if (Funky_chase_mode == 1) {
72         diagnostic_message("Chase mode ON.");
73     }
74     if (Funky_chase_mode == 0) {
75         diagnostic_message("Chase mode OFF.");
76     }
77     return Funky_chase_mode;
78 }
79