]> icculus.org git repositories - btb/d2x.git/blob - main/editor/ksegmove.c
more header cleanup
[btb/d2x.git] / main / editor / ksegmove.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 moving segments.
17  *
18  */
19
20 #ifdef HAVE_CONFIG_H
21 #include "conf.h"
22 #endif
23
24 //#include <stdio.h>
25 //#include <stdlib.h>
26 //#include <math.h>
27 //#include <string.h>
28
29 #include "inferno.h"
30 #include "editor.h"
31
32
33 // -- old -- int SegOrientCommon(fixang *ang, fix val)
34 // -- old -- {
35 // -- old --    *ang += val;
36 // -- old --    med_rotate_segment_ang(Cursegp,&Seg_orientation);
37 // -- old --    Update_flags |= UF_WORLD_CHANGED;
38 // -- old --    mine_changed = 1;
39 // -- old --    warn_if_concave_segment(Cursegp);
40 // -- old --    return 1;
41 // -- old -- }
42
43 int SegOrientCommon(fixang *ang, fix val)
44 {
45         Seg_orientation.p = 0;
46         Seg_orientation.b = 0;
47         Seg_orientation.h = 0;
48
49         *ang += val;
50         rotate_segment_new(&Seg_orientation);
51         Update_flags |= UF_WORLD_CHANGED;
52         mine_changed = 1;
53         warn_if_concave_segment(Cursegp);
54         return 1;
55 }
56
57 // ---------- segment orientation control ----------
58
59 int DecreaseHeading()
60 {
61         // decrease heading
62         return SegOrientCommon(&Seg_orientation.h,-512);
63 }
64
65 int IncreaseHeading()
66 {
67         return SegOrientCommon(&Seg_orientation.h,+512);
68 }
69
70 int DecreasePitch()
71 {
72         return SegOrientCommon(&Seg_orientation.p,-512);
73 }
74
75 int IncreasePitch()
76 {
77         return SegOrientCommon(&Seg_orientation.p,+512);
78 }
79
80 int DecreaseBank()
81 {
82         return SegOrientCommon(&Seg_orientation.b,-512);
83 }
84
85 int IncreaseBank()
86 {
87         return SegOrientCommon(&Seg_orientation.b,+512);
88 }