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

  1. #include "ray.h"
  2. #include "globals.h"
  3. #include "voxinter.h"
  4. #include "prevarr.h"
  5. #include "sprinter.h"
  6. #include <stdio.h>
  7. #include <mem.h>
  8. #include <stdlib.h>
  9. #include <string.h>
  10. #include "sprinter.h"
  11. #include "scrconf.h"
  12. #include "fixed.h"
  13. #include "raybuff.h"
  14. #include "getangle.h"
  15.  
  16. void    initRay()
  17.         {
  18.         F_Init();
  19.         Init_Objects();
  20.         WINDOW_HEIGHT=Get_Phys_Screen_Height();
  21.         WINDOW_MIDDLE=WINDOW_HEIGHT/2;
  22.         WINDOW_WIDTH=Get_Phys_Screen_Width();
  23.         WINDOW_MIDDLEW=WINDOW_WIDTH/2;
  24.         HORIZ_VIEW_RANGE=ANGLE_60;
  25.         VERTICAL_VIEW_RANGE=ANGLE_60;
  26.         VERTICAL_SCALE=13312;
  27.         Build_Tables();
  28.         Init_Get_Angle();
  29.         SCALE_FACTOR=fixeddiv(WINDOW_MIDDLEW, tan_table[HORIZ_VIEW_RANGE>>1]);
  30.         Init_Buffer();
  31.         Setup_Prev_Arrays();
  32.         Set_View_Angle(ANGLE_0);
  33.         Render_Init();
  34.         SetRenderMode(MODE_3D);
  35.         Init_Voxel();
  36.         }
  37.  
  38. void closeRay()
  39. {
  40. Clear_Prev_Arrays();
  41. Close_Objects();
  42. Render_Close();
  43. Close_Voxel();
  44. F_Shutdown();
  45. DelPtr(tan_table);
  46. DelPtr(inv_tan_table);
  47. DelPtr(rcos_table);
  48. DelPtr(rsin_table);
  49. DelPtr(inv_cos_table);
  50. DelPtr(distance_table);
  51. //DelPtr(movement_table;
  52. DelPtr(height_table);
  53. }
  54.  
  55.