Subversion Repositories Games.Descent

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
/*
2
 * Portions of this file are copyright Rebirth contributors and licensed as
3
 * described in COPYING.txt.
4
 * Portions of this file are copyright Parallax Software and licensed
5
 * according to the Parallax license below.
6
 * See COPYING.txt for license details.
7
 
8
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
9
SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
10
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
11
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
12
IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
13
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
14
FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
15
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
16
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
17
COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
18
*/
19
 
20
/*
21
 *
22
 * Functions for moving segments.
23
 *
24
 */
25
 
26
#include "inferno.h"
27
#include "editor.h"
28
#include "editor/esegment.h"
29
#include "kdefs.h"
30
 
31
static int SegOrientCommon(fixang *ang, fix val)
32
{
33
        Seg_orientation.p = 0;
34
        Seg_orientation.b = 0;
35
        Seg_orientation.h = 0;
36
 
37
        *ang += val;
38
        rotate_segment_new(Seg_orientation);
39
        Update_flags |= UF_WORLD_CHANGED;
40
        mine_changed = 1;
41
        warn_if_concave_segment(Cursegp);
42
        return 1;
43
}
44
 
45
// ---------- segment orientation control ----------
46
 
47
int DecreaseHeading()
48
{
49
        // decrease heading
50
        return SegOrientCommon(&Seg_orientation.h,-512);
51
}
52
 
53
int IncreaseHeading()
54
{
55
        return SegOrientCommon(&Seg_orientation.h,+512);
56
}
57
 
58
int DecreasePitch()
59
{
60
        return SegOrientCommon(&Seg_orientation.p,-512);
61
}
62
 
63
int IncreasePitch()
64
{
65
        return SegOrientCommon(&Seg_orientation.p,+512);
66
}
67
 
68
int DecreaseBank()
69
{
70
        return SegOrientCommon(&Seg_orientation.b,-512);
71
}
72
 
73
int IncreaseBank()
74
{
75
        return SegOrientCommon(&Seg_orientation.b,+512);
76
}