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

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