]> icculus.org git repositories - btb/d2x.git/blob - main/editor/ksegmove.c
Move old logs to ChangeLog-old
[btb/d2x.git] / main / editor / ksegmove.c
1 /* $Id: ksegmove.c,v 1.2 2004-12-19 14:52:48 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.2 2004-12-19 14:52:48 btb Exp $";
23 #endif
24
25 //#include <stdio.h>
26 //#include <stdlib.h>
27 //#include <math.h>
28 //#include <string.h>
29
30 #include "inferno.h"
31 #include "editor.h"
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 }