home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #6 / amigaacscoverdisc1998-061998.iso / games / descent / source / main / editor / ksegmove.c < prev    next >
C/C++ Source or Header  |  1998-06-08  |  3KB  |  114 lines

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