]> icculus.org git repositories - btb/d2x.git/blob - main/editor/ksegmove.c
remove rcs tags
[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 // -- old -- int SegOrientCommon(fixang *ang, fix val)
33 // -- old -- {
34 // -- old --    *ang += val;
35 // -- old --    med_rotate_segment_ang(Cursegp,&Seg_orientation);
36 // -- old --    Update_flags |= UF_WORLD_CHANGED;
37 // -- old --    mine_changed = 1;
38 // -- old --    warn_if_concave_segment(Cursegp);
39 // -- old --    return 1;
40 // -- old -- }
41
42 int SegOrientCommon(fixang *ang, fix val)
43 {
44         Seg_orientation.p = 0;
45         Seg_orientation.b = 0;
46         Seg_orientation.h = 0;
47
48         *ang += val;
49         rotate_segment_new(&Seg_orientation);
50         Update_flags |= UF_WORLD_CHANGED;
51         mine_changed = 1;
52         warn_if_concave_segment(Cursegp);
53         return 1;
54 }
55
56 // ---------- segment orientation control ----------
57
58 int DecreaseHeading()
59 {
60         // decrease heading
61         return SegOrientCommon(&Seg_orientation.h,-512);
62 }
63
64 int IncreaseHeading()
65 {
66         return SegOrientCommon(&Seg_orientation.h,+512);
67 }
68
69 int DecreasePitch()
70 {
71         return SegOrientCommon(&Seg_orientation.p,-512);
72 }
73
74 int IncreasePitch()
75 {
76         return SegOrientCommon(&Seg_orientation.p,+512);
77 }
78
79 int DecreaseBank()
80 {
81         return SegOrientCommon(&Seg_orientation.b,-512);
82 }
83
84 int IncreaseBank()
85 {
86         return SegOrientCommon(&Seg_orientation.b,+512);
87 }