Subversion Repositories Games.Descent

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Portions of this file are copyright Rebirth contributors and licensed as
  3.  * described in COPYING.txt.
  4.  * Portions of this file are copyright Parallax Software and licensed
  5.  * according to the Parallax license below.
  6.  * See COPYING.txt for license details.
  7.  
  8. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  9. SOFTWARE CORPORATION ("PARALLAX").  PARALLAX, IN DISTRIBUTING THE CODE TO
  10. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  11. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  12. IN USING, DISPLAYING,  AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  13. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  14. FREE PURPOSES.  IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  15. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES.  THE END-USER UNDERSTANDS
  16. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  17. COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION.  ALL RIGHTS RESERVED.
  18. */
  19.  
  20. /*
  21.  *
  22.  * Header for collide.c
  23.  *
  24.  */
  25.  
  26. #pragma once
  27.  
  28. #include "maths.h"
  29.  
  30. #ifdef __cplusplus
  31. #include <cstdint>
  32. #include "fwd-object.h"
  33. #include "fwd-segment.h"
  34. #include "fwd-vclip.h"
  35. #include "fwd-vecmat.h"
  36. #include "fwd-window.h"
  37.  
  38. #if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
  39. void collide_two_objects(vmobjptridx_t A, vmobjptridx_t B, vms_vector &collision_point);
  40. namespace dsx {
  41. window_event_result collide_object_with_wall(
  42. #if defined(DXX_BUILD_DESCENT_II)
  43.         const d_level_shared_destructible_light_state &LevelSharedDestructibleLightState,
  44. #endif
  45.         vmobjptridx_t A, fix hitspeed, vmsegptridx_t hitseg, short hitwall, const vms_vector &hitpt);
  46. void apply_damage_to_player(object &player, icobjptridx_t killer, fix damage, uint8_t possibly_friendly);
  47. }
  48.  
  49. // Returns 1 if robot died, else 0.
  50. #ifdef dsx
  51. namespace dsx {
  52. int apply_damage_to_robot(vmobjptridx_t robot, fix damage, objnum_t killer_objnum);
  53.  
  54. }
  55. #endif
  56. #define PERSISTENT_DEBRIS (PlayerCfg.PersistentDebris && !(Game_mode & GM_MULTI)) // no persistent debris in multi
  57.  
  58. #ifdef dsx
  59. namespace dsx {
  60. void collide_player_and_materialization_center(vmobjptridx_t objp);
  61. }
  62. #endif
  63. void collide_robot_and_materialization_center(vmobjptridx_t objp);
  64.  
  65. #ifdef dsx
  66. namespace dsx {
  67. bool scrape_player_on_wall(vmobjptridx_t obj, vmsegptridx_t hitseg, unsigned hitwall, const vms_vector &hitpt);
  68. int maybe_detonate_weapon(vmobjptridx_t obj0p, object &obj, const vms_vector &pos);
  69.  
  70. }
  71. #endif
  72. void collide_player_and_nasty_robot(vmobjptridx_t player, vmobjptridx_t robot, const vms_vector &collision_point);
  73.  
  74. void net_destroy_controlcen(imobjptridx_t controlcen);
  75. void collide_live_local_player_and_powerup(vmobjptridx_t powerup);
  76. #if defined(DXX_BUILD_DESCENT_I)
  77. #define check_effect_blowup(DestructibleLightsState,Vclip,seg,side,pnt,blower,force_blowup_flag,remote) check_effect_blowup(Vclip,seg,side,pnt)
  78. #endif
  79. #ifdef dsx
  80. namespace dsx {
  81. int check_effect_blowup(const d_level_shared_destructible_light_state &LevelSharedDestructibleLightState, const d_vclip_array &Vclip, vmsegptridx_t seg, unsigned side, const vms_vector &pnt, const laser_parent &blower, int force_blowup_flag, int remote);
  82. }
  83. #endif
  84. void apply_damage_to_controlcen(vmobjptridx_t controlcen, fix damage, const object &who);
  85. void bump_one_object(object_base &obj0, const vms_vector &hit_dir, fix damage);
  86. #ifdef dsx
  87. namespace dsx {
  88. void drop_player_eggs(vmobjptridx_t playerobj);
  89. enum class volatile_wall_result : int8_t
  90. {
  91.         none = -1,
  92.         lava,
  93. #if defined(DXX_BUILD_DESCENT_II)
  94.         water,
  95. #endif
  96. };
  97. #if defined(DXX_BUILD_DESCENT_II)
  98. window_event_result do_final_boss_frame(void);
  99. void do_final_boss_hacks(void);
  100. volatile_wall_result check_volatile_wall(vmobjptridx_t obj, const unique_side &seg);
  101. #endif
  102. }
  103. #endif
  104. #endif
  105.  
  106. #endif
  107.