]> icculus.org git repositories - btb/d2x.git/blob - main/editor/ksegmove.c
include conf.h in new editor files
[btb/d2x.git] / main / editor / ksegmove.c
1 /* $Id: ksegmove.c,v 1.3 2004-12-19 15:21:11 btb Exp $ */
2 /*
3 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
4 SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
5 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
6 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
7 IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
8 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
9 FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
10 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
11 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
12 COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
13 */
14
15 /*
16  *
17  * Functions for moving segments.
18  *
19  */
20
21 #ifdef RCS
22 static char rcsid[] = "$Id: ksegmove.c,v 1.3 2004-12-19 15:21:11 btb Exp $";
23 #endif
24
25 #ifdef HAVE_CONFIG_H
26 #include "conf.h"
27 #endif
28
29 //#include <stdio.h>
30 //#include <stdlib.h>
31 //#include <math.h>
32 //#include <string.h>
33
34 #include "inferno.h"
35 #include "editor.h"
36
37 // -- old -- int SegOrientCommon(fixang *ang, fix val)
38 // -- old -- {
39 // -- old --    *ang += val;
40 // -- old --    med_rotate_segment_ang(Cursegp,&Seg_orientation);
41 // -- old --    Update_flags |= UF_WORLD_CHANGED;
42 // -- old --    mine_changed = 1;
43 // -- old --    warn_if_concave_segment(Cursegp);
44 // -- old --    return 1;
45 // -- old -- }
46
47 int SegOrientCommon(fixang *ang, fix val)
48 {
49         Seg_orientation.p = 0;
50         Seg_orientation.b = 0;
51         Seg_orientation.h = 0;
52
53         *ang += val;
54         rotate_segment_new(&Seg_orientation);
55         Update_flags |= UF_WORLD_CHANGED;
56         mine_changed = 1;
57         warn_if_concave_segment(Cursegp);
58         return 1;
59 }
60
61 // ---------- segment orientation control ----------
62
63 int DecreaseHeading()
64 {
65         // decrease heading
66         return SegOrientCommon(&Seg_orientation.h,-512);
67 }
68
69 int IncreaseHeading()
70 {
71         return SegOrientCommon(&Seg_orientation.h,+512);
72 }
73
74 int DecreasePitch()
75 {
76         return SegOrientCommon(&Seg_orientation.p,-512);
77 }
78
79 int IncreasePitch()
80 {
81         return SegOrientCommon(&Seg_orientation.p,+512);
82 }
83
84 int DecreaseBank()
85 {
86         return SegOrientCommon(&Seg_orientation.b,-512);
87 }
88
89 int IncreaseBank()
90 {
91         return SegOrientCommon(&Seg_orientation.b,+512);
92 }