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

  1. #include "ray.h"
  2. #include "asm.h"
  3. #include "globals.h"
  4. #include "voxinter.h"
  5. #include "scrconf.h"
  6. #include <stddef.h>
  7.  
  8. void setWindowDimensions(short height)
  9. {
  10. // Routine to set the height of the window
  11.  
  12.    // check our height bounds to make sure they are legal
  13.    if ((height > Get_Phys_Screen_Height())|| (height <=MIN_WINDOW_HEIGHT))
  14.       return;
  15.  
  16.    WINDOW_HEIGHT=height;
  17.    WINDOW_MIDDLE=height >> 1; // half the height
  18.  
  19.    // setup the new window
  20.    setupNewScreen();
  21. }
  22.  
  23. void setupNewScreen() // do all calulations having to do with a change in the view window
  24. {
  25.    clearBuff();
  26.    VERTICAL_SCALE=(64*(WINDOW_HEIGHT>>1)<<SHIFT)
  27.                 /tan_table[VERTICAL_VIEW_RANGE>>1]; // Set the right scale factor
  28.  
  29.    if (tex_mark_table!=NULL)
  30.       DelPtr(tex_mark_table);
  31.    tex_mark_table=(tex_mark * )NewPtr((WINDOW_HEIGHT)*sizeof(tex_mark));
  32.  
  33.    Build_Vertical_Distance_Table();
  34.    Build_Height_Table();
  35.    V_Recalc_Alts();
  36. }
  37.  
  38. void setWindowFOV(short vertangle)
  39. {
  40. //Routine to set the vertical FOV
  41.  
  42. // check our angle bounds to make sure they are legal
  43. if ((vertangle>MAX_VERT_FOV) || (vertangle<=MIN_VERT_FOV))
  44.    return;
  45. VERTICAL_VIEW_RANGE=vertangle;
  46.  
  47. // setup the new window
  48. setupNewScreen();
  49. }
  50.  
  51.