home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / RAYCAST.ZIP / RAYWIDTH.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1995-10-23  |  1.1 KB  |  51 lines

  1. #include "ray.h"
  2. #include "globals.h"
  3. #include "raywidth.h"
  4. #include "fixed.h"
  5. #include "scrconf.h"
  6. #include "asm.h"
  7. #include "voxinter.h"
  8. #include "slopes.h"
  9.  
  10. #define MIN_WINDOW_WIDTH 20
  11. #define MAX_HORIZ_FOV ANGLE_90
  12. #define MIN_HORIZ_FOV ANGLE_15
  13.  
  14. extern void Build_Movement_Table();
  15.  
  16. void Setup_Horiz_Window_Change();
  17.  
  18. void Set_Window_Width(short width) {
  19. // Sets width of window
  20.  
  21.    // is it legal?
  22.    if ((width > Get_Phys_Screen_Width())||(width <= MIN_WINDOW_WIDTH))
  23.       return;
  24.  
  25.    WINDOW_WIDTH=width;
  26.    WINDOW_MIDDLEW=width/2;
  27.    
  28.    //setup the new window
  29.    Setup_Horiz_Window_Change();
  30. }
  31.  
  32. void Set_Horiz_FOV(angle_type horiz_angle) {
  33. // routine to set horiz FOV
  34.  
  35.    // is it legal?
  36.    if ((horiz_angle>MAX_HORIZ_FOV) || (horiz_angle<=MIN_HORIZ_FOV))
  37.       return;
  38.    HORIZ_VIEW_RANGE=horiz_angle;
  39.  
  40.    // setup the new window
  41.    Setup_Horiz_Window_Change();
  42. }
  43.  
  44. void Setup_Horiz_Window_Change() {
  45.    clearBuff();
  46.    SCALE_FACTOR=fixeddiv(WINDOW_MIDDLEW, tan_table[HORIZ_VIEW_RANGE>>1]);
  47.    Build_Movement_Table();
  48.    Recalc_Slope_Table();
  49.    V_Recalc_Length();
  50. }
  51.