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.  * Prototypes for functions for game sequencing.
  23.  *
  24.  */
  25.  
  26. #pragma once
  27.  
  28. #include <cstddef>
  29. #include "fwd-player.h"
  30. #include "fwd-object.h"
  31. #include "fwd-vclip.h"
  32. #include "fwd-window.h"
  33. #include "powerup.h"
  34.  
  35. #if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
  36.  
  37. namespace dcx {
  38. template <std::size_t>
  39. struct PHYSFSX_gets_line_t;
  40.  
  41. constexpr std::integral_constant<unsigned, 36> LEVEL_NAME_LEN{};       //make sure this is multiple of 4!
  42.  
  43. // Current_level_num starts at 1 for the first level
  44. // -1,-2,-3 are secret levels
  45. // 0 used to mean not a real level loaded (i.e. editor generated level), but this hack has been removed
  46. extern int Current_level_num, Next_level_num;
  47. extern PHYSFSX_gets_line_t<LEVEL_NAME_LEN> Current_level_name;
  48. extern std::array<obj_position, MAX_PLAYERS> Player_init;
  49.  
  50. // This is the highest level the player has ever reached
  51. extern int Player_highest_level;
  52. }
  53.  
  54. //
  55. // New game sequencing functions
  56. //
  57.  
  58. // starts a new game on the given level
  59. #ifdef dsx
  60. namespace dsx {
  61. void StartNewGame(int start_level);
  62.  
  63. // starts the next level
  64. window_event_result StartNewLevel(int level_num);
  65.  
  66. }
  67. #endif
  68. void InitPlayerObject();            //make sure player's object set up
  69. namespace dsx {
  70. void init_player_stats_game(playernum_t pnum);      //clear all stats
  71. }
  72.  
  73. // called when the player has finished a level
  74. // if secret flag is true, advance to secret level, else next normal level
  75. #ifdef dsx
  76. namespace dsx {
  77. window_event_result PlayerFinishedLevel(int secret_flag);
  78.  
  79. }
  80. #endif
  81. namespace dsx {
  82. // called when the player has died
  83. window_event_result DoPlayerDead(void);
  84. }
  85.  
  86. #if defined(DXX_BUILD_DESCENT_I)
  87. static inline void load_level_robots(int level_num)
  88. {
  89.         (void)level_num;
  90. }
  91. #elif defined(DXX_BUILD_DESCENT_II)
  92. namespace dsx {
  93. // load just the hxm file
  94. void load_level_robots(int level_num);
  95. extern int      First_secret_visit;
  96. window_event_result ExitSecretLevel();
  97. }
  98. #endif
  99.  
  100. // load a level off disk. level numbers start at 1.
  101. // Secret levels are -1,-2,-3
  102. #ifdef dsx
  103. namespace dsx {
  104. void LoadLevel(int level_num, int page_in_textures);
  105.  
  106. }
  107. #endif
  108. extern void update_player_stats();
  109.  
  110. // from scores.c
  111.  
  112. extern void show_high_scores(int place);
  113. extern void draw_high_scores(int place);
  114. extern int add_player_to_high_scores(player *pp);
  115. extern void input_name (int place);
  116. extern int reset_high_scores();
  117.  
  118. void open_message_window(void);
  119. void close_message_window(void);
  120.  
  121. // create flash for player appearance
  122. #ifdef dsx
  123. namespace dsx {
  124. void create_player_appearance_effect(const d_vclip_array &Vclip, const object_base &player_obj);
  125. void bash_to_shield(const d_powerup_info_array &Powerup_info, const d_vclip_array &Vclip, object_base &i);
  126. void copy_defaults_to_robot(object_base &objp);
  127. void gameseq_remove_unused_players();
  128. }
  129. #endif
  130.  
  131. // Show endlevel bonus scores
  132. namespace dcx {
  133. // stuff for multiplayer
  134. extern unsigned NumNetPlayerPositions;
  135. extern fix StartingShields;
  136. extern int      Do_appearance_effect;
  137. }
  138.  
  139.  
  140. int p_secret_level_destroyed(void);
  141. namespace dsx {
  142. #if defined(DXX_BUILD_DESCENT_II)
  143. void do_cloak_invul_secret_stuff(fix64 old_gametime, player_info &player_info);
  144. #endif
  145. void EnterSecretLevel(void);
  146. void init_player_stats_new_ship(playernum_t pnum);
  147. }
  148. #endif
  149.