home *** CD-ROM | disk | FTP | other *** search
/ Quake++ for Quake / Quake++.iso / quake / qube / tree.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-28  |  699 b   |  35 lines

  1. /***
  2. ****  QuBE --- BSP tree manipulation routine.
  3. ***/
  4.  
  5. #include "qube.h"
  6. #include "tree.h"
  7.  
  8. /*
  9. **  TreeList.  Not a lot, but it does the job.
  10. */
  11.  
  12. void TreeList(void)
  13. {
  14.     short int i, j, k;
  15.     unsigned long readcount;
  16.  
  17.     struct {
  18.         unsigned long int line;       /* What is this?    A VSD pointer? */
  19.         short int left;
  20.         short int right;
  21.     } tree;
  22.  
  23.     if (header.id != 0x17)
  24.         Error("Not a valid .BSP file");
  25.  
  26.         fseek(fi, header.tree, SEEK_SET);
  27.  
  28.     for (i = 0, readcount = 0L; readcount < header.treelen; readcount += 8, i++) {
  29.                 fread(&tree, 8, 1, fi);
  30.         printf("%4d:  %4d  %4d   (%ld)", i, tree.left, tree.right, tree.line);
  31.         printf("\n");
  32.         }
  33. }
  34.  
  35.