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 demo playback system
  23.  *
  24.  */
  25.  
  26. #pragma once
  27.  
  28. #ifdef __cplusplus
  29. #include "physfsx.h"
  30. #include "fwd-object.h"
  31. #include "fwd-segment.h"
  32. #include "fwd-window.h"
  33.  
  34. class object_signature_t;
  35.  
  36. #define ND_STATE_NORMAL                 0
  37. #define ND_STATE_RECORDING              1
  38. #define ND_STATE_PLAYBACK               2
  39. #define ND_STATE_PAUSED                 3
  40. #define ND_STATE_REWINDING              4
  41. #define ND_STATE_FASTFORWARD            5
  42. #define ND_STATE_ONEFRAMEFORWARD        6
  43. #define ND_STATE_ONEFRAMEBACKWARD       7
  44.  
  45. #define DEMO_DIR                "demos/"
  46. #define DEMO_EXT                "dem"
  47. extern const std::array<file_extension_t, 1> demo_file_extensions;
  48.  
  49. #if DXX_WORDS_BIGENDIAN
  50. #define DEMO_BACKUP_EXT                 "386"
  51. #else
  52. #define DEMO_BACKUP_EXT                 "ppc"
  53. #endif
  54.  
  55. // Gives state of recorder
  56. extern int Newdemo_state;
  57. extern int NewdemoFrameCount;
  58.  
  59. extern int Newdemo_vcr_state;
  60. extern int Newdemo_game_mode;
  61. extern sbyte Newdemo_do_interpolate;
  62. extern int Newdemo_show_percentage;
  63.  
  64. //Does demo start automatically?
  65. extern int Auto_demo;
  66. extern int Newdemo_num_written;
  67.  
  68. #if defined(DXX_BUILD_DESCENT_II)
  69. extern ubyte DemoDoRight,DemoDoLeft;
  70. extern struct object DemoRightExtra,DemoLeftExtra;
  71. #endif
  72.  
  73. // Functions called during recording process...
  74. #ifdef dsx
  75. namespace dsx {
  76. extern void newdemo_record_start_demo();
  77. extern void newdemo_record_start_frame(fix frame_time );
  78. }
  79. #endif
  80. #ifdef dsx
  81. #ifdef dsx
  82. namespace dsx {
  83. void newdemo_record_render_object(vmobjptridx_t  obj);
  84. void newdemo_record_viewer_object(vcobjptridx_t obj);
  85. }
  86. #endif
  87. icobjptridx_t newdemo_find_object(object_signature_t signature);
  88. void newdemo_record_kill_sound_linked_to_object(vcobjptridx_t);
  89. namespace dsx {
  90. void newdemo_start_playback(const char *filename);
  91. void newdemo_record_morph_frame(vcobjptridx_t);
  92. }
  93. #endif
  94. extern void newdemo_record_sound_3d_once( int soundno, int angle, int volume );
  95. extern void newdemo_record_sound_once( int soundno );
  96. extern void newdemo_record_sound( int soundno );
  97. void newdemo_record_wall_hit_process( segnum_t segnum, int side, int damage, int playernum );
  98. extern void newdemo_record_player_stats(int shields, int energy, int score );
  99. void newdemo_record_wall_toggle(segnum_t segnum, int side );
  100. extern void newdemo_record_control_center_destroyed();
  101. extern void newdemo_record_hud_message(const char *s);
  102. extern void newdemo_record_palette_effect(short r, short g, short b);
  103. extern void newdemo_record_player_energy(int);
  104. extern void newdemo_record_player_shields(int);
  105. extern void newdemo_record_player_flags(unsigned);
  106. extern void newdemo_record_player_weapon(int, int);
  107. void newdemo_record_effect_blowup(segnum_t, int, const vms_vector &);
  108. extern void newdemo_record_homing_distance(fix);
  109. extern void newdemo_record_letterbox(void);
  110. extern void newdemo_record_rearview(void);
  111. extern void newdemo_record_restore_cockpit(void);
  112. #ifdef dsx
  113. void newdemo_record_wall_set_tmap_num1(vcsegidx_t seg, unsigned side, vcsegidx_t cseg, unsigned cside, int16_t tmap);
  114. void newdemo_record_wall_set_tmap_num2(vcsegidx_t seg, unsigned side, vcsegidx_t cseg, unsigned cside, int16_t tmap);
  115. #endif
  116. extern void newdemo_record_multi_cloak(int pnum);
  117. extern void newdemo_record_multi_decloak(int pnum);
  118. #ifdef dsx
  119. namespace dsx {
  120. extern void newdemo_set_new_level(int level_num);
  121. }
  122. #endif
  123. extern void newdemo_record_restore_rearview(void);
  124.  
  125. extern void newdemo_record_multi_death(int pnum);
  126. extern void newdemo_record_multi_kill(int pnum, sbyte kill);
  127. void newdemo_record_multi_connect(unsigned pnum, unsigned new_player, const char *new_callsign);
  128. extern void newdemo_record_multi_reconnect(int pnum);
  129. extern void newdemo_record_multi_disconnect(int pnum);
  130. extern void newdemo_record_player_score(int score);
  131. void newdemo_record_multi_score(unsigned pnum, int score);
  132. extern void newdemo_record_primary_ammo(int new_ammo);
  133. extern void newdemo_record_secondary_ammo(int new_ammo);
  134. void newdemo_record_door_opening(segnum_t segnum, int side);
  135. extern void newdemo_record_laser_level(sbyte old_level, sbyte new_level);
  136.  
  137. #ifdef dsx
  138. namespace dsx {
  139. #if defined(DXX_BUILD_DESCENT_II)
  140. void newdemo_record_player_afterburner(fix afterburner);
  141. void newdemo_record_cloaking_wall(int front_wall_num, int back_wall_num, ubyte type, ubyte state, fix cloak_value, fix l0, fix l1, fix l2, fix l3);
  142. void newdemo_record_guided_start();
  143. void newdemo_record_guided_end();
  144. void newdemo_record_secret_exit_blown(int truth);
  145. void newdemo_record_trigger(vcsegidx_t segnum, unsigned side, objnum_t objnum, unsigned shot);
  146. #endif
  147. }
  148. #endif
  149.  
  150. // Functions called during playback process...
  151. extern void newdemo_object_move_all();
  152. extern window_event_result newdemo_playback_one_frame();
  153. #ifdef dsx
  154. namespace dsx {
  155. extern window_event_result newdemo_goto_end(int to_rewrite);
  156. }
  157. #endif
  158. extern window_event_result newdemo_goto_beginning();
  159.  
  160. // Interactive functions to control playback/record;
  161. #ifdef dsx
  162. namespace dsx {
  163. extern void newdemo_stop_playback();
  164. }
  165. #endif
  166. extern void newdemo_start_recording();
  167. extern void newdemo_stop_recording();
  168.  
  169. extern int newdemo_swap_endian(const char *filename);
  170.  
  171. extern int newdemo_get_percent_done();
  172.  
  173. extern void newdemo_record_link_sound_to_object3( int soundno, objnum_t objnum, fix max_volume, fix  max_distance, int loop_start, int loop_end );
  174. int newdemo_count_demos();
  175. void newdemo_strip_frames(char *, int);
  176.  
  177. #endif
  178.