wolf_raycast.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. Copyright (C) 2004 Michael Liebscher
  3. Copyright (C) 2000-2002 by DarkOne the Hacker
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. /*
  17. * wolf_raycast.h: Wolfenstein3-D ray-casting.
  18. *
  19. * Author: Michael Liebscher <johnnycanuck@users.sourceforge.net>
  20. * Date: 2004
  21. *
  22. * Acknowledgement:
  23. * Portion of this code was derived from NewWolf, and was originally
  24. * written by DarkOne the Hacker.
  25. *
  26. */
  27. /*
  28. Notes:
  29. This module is implemented by wolf_raycast.c
  30. */
  31. #ifndef __WOLF_RAYCAST_H__
  32. #define __WOLF_RAYCAST_H__
  33. // marks
  34. #define TRACE_MARK_MAP 1 // marks traced area in 'AM_AutoMap.vis' array
  35. // obstacle levels
  36. #define TRACE_SIGHT 2 // player sight
  37. #define TRACE_SIGHT_AI 4 // enemy sight
  38. #define TRACE_BULLET 8 // bullet
  39. #define TRACE_OBJECT 16 // object
  40. #define TRACE_HIT_VERT 32 // vertical wall was hit
  41. #define TRACE_HIT_DOOR 64 // door was hit
  42. #define TRACE_HIT_PWALL 128 // pushwall was hit
  43. typedef struct r_trace_s
  44. {
  45. int x, y; // origin
  46. int a; // trace angle
  47. int flags;
  48. W8 (*tile_vis)[ 64 ]; // should point to [ 64 ][ 64 ] array
  49. } r_trace_t;
  50. #define UPPERZCOORD 0.6f
  51. #define LOWERZCOORD -0.6f
  52. extern W8 tile_visible[ 64 ][ 64 ]; // can player see this tile?
  53. extern void R_RayCast( placeonplane_t viewport, LevelData_t *lvl );
  54. extern void R_Trace( r_trace_t *trace, LevelData_t *lvl );
  55. #endif /* __WOLF_RAYCAST_H__ */