]> icculus.org git repositories - btb/d2x.git/blob - main/editor/ksegmove.c
imported missing editor files from d1x
[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  * $Source: /cvs/cvsroot/d2x/main/editor/ksegmove.c,v $
15  * $Revision: 1.1 $
16  * $Author: btb $
17  * $Date: 2004-12-19 13:54:27 $
18  *
19  * Functions for moving segments.
20  *
21  * $Log: not supported by cvs2svn $
22  * Revision 1.1.1.1  1999/06/14 22:03:29  donut
23  * Import of d1x 1.37 source.
24  *
25  * Revision 2.0  1995/02/27  11:33:37  john
26  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
27  * for bitmaps.tbl.
28  * 
29  * Revision 1.5  1993/12/02  12:39:36  matt
30  * Removed extra includes
31  * 
32  * Revision 1.4  1993/11/12  16:40:23  mike
33  * Use rotate_segment_new in place of med_rotate_segment_ang.
34  * 
35  * Revision 1.3  1993/11/05  17:32:54  john
36  * added funcs
37  * .,
38  * 
39  * Revision 1.2  1993/10/26  11:28:41  mike
40  * Write common routine SegOrientCommon so all movement can pass
41  * through the same routine to check for concavity, among other things.
42  * 
43  * Revision 1.1  1993/10/13  18:53:21  john
44  * Initial revision
45  * 
46  *
47  */
48
49 #ifdef RCS
50 static char rcsid[] = "$Id: ksegmove.c,v 1.1 2004-12-19 13:54:27 btb Exp $";
51 #endif
52
53 //#include <stdio.h>
54 //#include <stdlib.h>
55 //#include <math.h>
56 //#include <string.h>
57
58 #include "inferno.h"
59 #include "editor.h"
60
61 // -- old -- int SegOrientCommon(fixang *ang, fix val)
62 // -- old -- {
63 // -- old --    *ang += val;
64 // -- old --    med_rotate_segment_ang(Cursegp,&Seg_orientation);
65 // -- old --    Update_flags |= UF_WORLD_CHANGED;
66 // -- old --    mine_changed = 1;
67 // -- old --    warn_if_concave_segment(Cursegp);
68 // -- old --    return 1;
69 // -- old -- }
70
71 int SegOrientCommon(fixang *ang, fix val)
72 {
73         Seg_orientation.p = 0;
74         Seg_orientation.b = 0;
75         Seg_orientation.h = 0;
76
77         *ang += val;
78         rotate_segment_new(&Seg_orientation);
79         Update_flags |= UF_WORLD_CHANGED;
80         mine_changed = 1;
81         warn_if_concave_segment(Cursegp);
82         return 1;
83 }
84
85 // ---------- segment orientation control ----------
86
87 int DecreaseHeading()
88 {
89         // decrease heading
90         return SegOrientCommon(&Seg_orientation.h,-512);
91 }
92
93 int IncreaseHeading()
94 {
95         return SegOrientCommon(&Seg_orientation.h,+512);
96 }
97
98 int DecreasePitch()
99 {
100         return SegOrientCommon(&Seg_orientation.p,-512);
101 }
102
103 int IncreasePitch()
104 {
105         return SegOrientCommon(&Seg_orientation.p,+512);
106 }
107
108 int DecreaseBank()
109 {
110         return SegOrientCommon(&Seg_orientation.b,-512);
111 }
112
113 int IncreaseBank()
114 {
115         return SegOrientCommon(&Seg_orientation.b,+512);
116 }