home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / RAYCAST.ZIP / MAXMINS.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1995-07-22  |  670 b   |  26 lines

  1. #include "ray.h"
  2. #include "globals.h"
  3. #include "maxmins.h"
  4.  
  5. void Get_Map_Max_Mins(long & min_x, long & min_y, long & max_x, long & max_y) {
  6.    pvector2 cur_vec;
  7.    short counter;
  8.  
  9.    // Get min and max points of world be looping through vectors
  10.  
  11.    min_x=max_x=Vector_List[0].x;
  12.    min_y=max_y=Vector_List[0].y;
  13.  
  14.    for (counter=1; counter < Number_Of_Vectors; counter++) {
  15.       cur_vec=Vector_List+counter;
  16.       if (cur_vec->x < min_x)
  17.          min_x=cur_vec->x;
  18.       if (cur_vec->y < min_y)
  19.          min_y=cur_vec->y;
  20.       if (cur_vec->x > max_x)
  21.          max_x=cur_vec->x;
  22.       if (cur_vec->y > max_y)
  23.          max_y=cur_vec->y;
  24.    }
  25. }
  26.