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

  1. /*
  2.  * $Source: f:/miner/source/main/editor/rcs/kview.c $
  3.  * $Revision: 2.0 $
  4.  * $Author: john $
  5.  * $Date: 1995/02/27 11:34:21 $
  6.  *
  7.  * Functions for changing viewer's position
  8.  *
  9.  * $Log: kview.c $
  10.  * Revision 2.0  1995/02/27  11:34:21  john
  11.  * Version 2.0! No anonymous unions, Watcom 10.0, with no need
  12.  * for bitmaps.tbl.
  13.  * 
  14.  * Revision 1.11  1993/12/02  12:39:41  matt
  15.  * Removed extra includes
  16.  * 
  17.  * Revision 1.10  1993/11/16  13:47:54  john
  18.  * Xchanged move away/closer
  19.  * 
  20.  * Revision 1.9  1993/11/16  13:45:32  john
  21.  * Exchanged zoom in/out.
  22.  * 
  23.  * Revision 1.8  1993/11/05  17:32:56  john
  24.  * added funcs
  25.  * .,
  26.  * 
  27.  * Revision 1.7  1993/11/03  12:10:21  yuan
  28.  * No keypress associated with chase mode
  29.  * 
  30.  * Revision 1.6  1993/11/02  17:06:55  yuan
  31.  * Icon stuff added.
  32.  * 
  33.  * Revision 1.5  1993/11/01  12:48:59  yuan
  34.  * Added Chase mode icon to status bar.
  35.  * 
  36.  * Revision 1.4  1993/10/29  19:12:55  yuan
  37.  * Added diagnostic messages
  38.  * 
  39.  * Revision 1.3  1993/10/27  18:26:16  matt
  40.  * Made zoom & related keys not do anything if no current view
  41.  * 
  42.  * Revision 1.2  1993/10/19  20:54:33  matt
  43.  * Changed/cleaned up window updates
  44.  * 
  45.  * Revision 1.1  1993/10/13  18:53:34  john
  46.  * Initial revision
  47.  * 
  48.  *
  49.  */
  50.  
  51. #pragma off (unreferenced)
  52. static char rcsid[] = "$Id: kview.c 2.0 1995/02/27 11:34:21 john Exp $";
  53. #pragma on (unreferenced)
  54.  
  55. #include "inferno.h"
  56. #include "editor.h"
  57.  
  58. // ---------- zoom control on current window ----------
  59. int ZoomIn()
  60. {
  61.     if (!current_view) return 0.0;
  62.  
  63.     current_view->ev_zoom = fixmul(current_view->ev_zoom,62259);
  64.     current_view->ev_changed = 1;
  65.     return 1;
  66. }
  67.  
  68. int ZoomOut()
  69. {
  70.     if (!current_view) return 0.0;
  71.  
  72.     current_view->ev_zoom = fixmul(current_view->ev_zoom,68985);
  73.     current_view->ev_changed = 1;
  74.     return 1;
  75. }
  76.  
  77. // ---------- distance-of-viewer control on current window ----------
  78. int MoveCloser()
  79. {
  80.     if (!current_view) return 0.0;
  81.  
  82.     current_view->ev_dist = fixmul(current_view->ev_dist,62259);
  83.     current_view->ev_changed = 1;
  84.     return 1;
  85. }
  86.  
  87. int MoveAway()
  88. {
  89.     if (!current_view) return 0.0;
  90.  
  91.     current_view->ev_dist = fixmul(current_view->ev_dist,68985);
  92.     current_view->ev_changed = 1;
  93.     return 1;
  94. }
  95.  
  96. // ---------- Toggle chase mode. ----------
  97.  
  98. int ToggleChaseMode()
  99. {
  100.     Funky_chase_mode = !Funky_chase_mode;
  101.     set_view_target_from_segment(Cursegp);
  102.     if (Funky_chase_mode == 1) {
  103.         diagnostic_message("Chase mode ON.");
  104.     }
  105.     if (Funky_chase_mode == 0) {
  106.         diagnostic_message("Chase mode OFF.");
  107.     }
  108.     return Funky_chase_mode;
  109. }
  110.  
  111.