home *** CD-ROM | disk | FTP | other *** search
/ Virtual Reality Homebrewer's Handbook / vr.iso / vr386 / splits.h < prev    next >
C/C++ Source or Header  |  1996-03-19  |  3KB  |  87 lines

  1. /* Functions related to splits and areas */
  2. /* Splitting-tree structures: theory by Dave Stampe, initial
  3.    implementation by Bernie Roehl */
  4.  
  5. /* Original written by Bernie Roehl, June 1992 */
  6. /* Substantially upgraded by Dave Stampe, August '92 */
  7.  
  8. // THE AREAS, SPLITS ETC WILL BE SUBSTANTIALLY MODIFIED
  9. // AS THE API EVOLVES
  10.  
  11.  
  12. /*
  13.  This code is part of the VR-386 project, created by Dave Stampe.
  14.  VR-386 is a desendent of REND386, created by Dave Stampe and
  15.  Bernie Roehl.  Almost all the code has been rewritten by Dave
  16.  Stampre for VR-386.
  17.  
  18.  Copyright (c) 1994 by Dave Stampe:
  19.  May be freely used to write software for release into the public domain
  20.  or for educational use; all commercial endeavours MUST contact Dave Stampe
  21.  (dstampe@psych.toronto.edu) for permission to incorporate any part of
  22.  this software or source code into their products!  Usually there is no
  23.  charge for under 50-100 items for low-cost or shareware products, and terms
  24.  are reasonable.  Any royalties are used for development, so equipment is
  25.  often acceptable payment.
  26.  
  27.  ATTRIBUTION:  If you use any part of this source code or the libraries
  28.  in your projects, you must give attribution to VR-386 and Dave Stampe,
  29.  and any other authors in your documentation, source code, and at startup
  30.  of your program.  Let's keep the freeware ball rolling!
  31.  
  32.  DEVELOPMENT: VR-386 is a effort to develop the process started by
  33.  REND386, improving programmer access by rewriting the code and supplying
  34.  a standard API.  If you write improvements, add new functions rather
  35.  than rewriting current functions.  This will make it possible to
  36.  include you improved code in the next API release.  YOU can help advance
  37.  VR-386.  Comments on the API are welcome.
  38.  
  39.  CONTACT: dstampe@psych.toronto.edu
  40. */
  41.  
  42.  
  43. #ifndef SPLITDEF
  44. #define SPLITDEF 1
  45. typedef void SPLIT;
  46. #endif
  47.  
  48. #ifndef AREADEF
  49. #define AREADEF 1
  50. typedef void AREA;
  51. #endif
  52.  
  53. extern SPLIT *add_split(SPLIT **tree, long x, long y, long z,
  54.             long nx, long ny, long nz, unsigned flags);
  55. extern AREA *what_area(SPLIT *tree, long x, long y, long z);
  56. extern char *area_name(AREA *a);
  57. extern char *set_area_name(AREA *a, char *name);
  58.  
  59. extern void add_obj_to_area(AREA *a, OBJECT *obj);
  60. extern void add_obj_to_split(SPLIT *tree, OBJECT *obj);
  61.  
  62. extern void split_move_handler(OBJECT *obj);
  63. extern SPLIT *create_initial_world_split();
  64.  
  65. extern OBJLIST *which_area_objlist(SPLIT *tree, long x, long y, long z);
  66. extern void add_obj_to_split_area(SPLIT *tree, OBJECT *obj);
  67. extern void add_obj_to_split_center(SPLIT *tree, OBJECT *obj);
  68.  
  69. extern void render_monitor_point(int x, int y);
  70. extern OBJECT *render_check_monitor(int *poly, int *vert);
  71. extern void render_objlist(OBJLIST *objlist);
  72. extern void render_area(AREA *a);
  73. extern void render_subtree(int type, SPLIT *ptr, VIEW *view);
  74. extern void render_split(SPLIT *tree, VIEW *view);
  75. extern void render_visareas(AREA *area);
  76. extern void walk_area(AREA *a, void (*fn)());
  77. extern void walk_split_tree(SPLIT *tree, void (*fn)());
  78. extern void set_area_function(AREA *a, void (*fn)());
  79. extern void call_area_fn(AREA *a);
  80. extern void add_floor(AREA *area, long a, long b, long c, long d);
  81. extern void add_ceiling(AREA *area, long a, long b, long c, long d);
  82. extern long floor_at(AREA *a, long x, long z);
  83. extern long ceiling_at(AREA *a, long x, long z);
  84. extern int add_visfrom(AREA *from, AREA *to);
  85.  
  86. /* End of splits.h */
  87.