]> icculus.org git repositories - btb/d2x.git/blob - main/editor/kview.c
more header cleanup
[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
28 // ---------- zoom control on current window ----------
29 int ZoomIn()
30 {
31         if (!current_view) return 0.0;
32
33         current_view->ev_zoom = fixmul(current_view->ev_zoom,62259);
34         current_view->ev_changed = 1;
35         return 1;
36 }
37
38 int ZoomOut()
39 {
40         if (!current_view) return 0.0;
41
42         current_view->ev_zoom = fixmul(current_view->ev_zoom,68985);
43         current_view->ev_changed = 1;
44         return 1;
45 }
46
47 // ---------- distance-of-viewer control on current window ----------
48 int MoveCloser()
49 {
50         if (!current_view) return 0.0;
51
52         current_view->ev_dist = fixmul(current_view->ev_dist,62259);
53         current_view->ev_changed = 1;
54         return 1;
55 }
56
57 int MoveAway()
58 {
59         if (!current_view) return 0.0;
60
61         current_view->ev_dist = fixmul(current_view->ev_dist,68985);
62         current_view->ev_changed = 1;
63         return 1;
64 }
65
66 // ---------- Toggle chase mode. ----------
67
68 int ToggleChaseMode()
69 {
70         Funky_chase_mode = !Funky_chase_mode;
71         set_view_target_from_segment(Cursegp);
72     if (Funky_chase_mode == 1) {
73         diagnostic_message("Chase mode ON.");
74     }
75     if (Funky_chase_mode == 0) {
76         diagnostic_message("Chase mode OFF.");
77     }
78     return Funky_chase_mode;
79 }
80