2006-03-20 17:12:09 +00:00
|
|
|
/*
|
2014-06-01 17:55:23 +00:00
|
|
|
* Portions of this file are copyright Rebirth contributors and licensed as
|
|
|
|
* described in COPYING.txt.
|
|
|
|
* Portions of this file are copyright Parallax Software and licensed
|
|
|
|
* according to the Parallax license below.
|
|
|
|
* See COPYING.txt for license details.
|
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
|
|
|
|
SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
|
|
|
|
END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
|
|
|
|
ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
|
|
|
|
IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
|
|
|
|
SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
|
|
|
|
FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
|
|
|
|
CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
|
|
|
|
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
|
|
|
|
COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
*
|
|
|
|
* header for demo playback system
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-08-22 20:43:04 +00:00
|
|
|
#pragma once
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#ifdef __cplusplus
|
2014-07-20 01:09:55 +00:00
|
|
|
#include "physfsx.h"
|
2015-10-10 03:44:14 +00:00
|
|
|
#include "fwd-object.h"
|
2020-02-26 05:07:34 +00:00
|
|
|
#include "fwd-segment.h"
|
2021-11-01 03:37:19 +00:00
|
|
|
#include "fwd-wall.h"
|
2020-08-24 01:31:28 +00:00
|
|
|
#include "fwd-weapon.h"
|
2017-01-09 11:09:34 +00:00
|
|
|
#include "fwd-window.h"
|
2021-06-28 03:37:51 +00:00
|
|
|
#include "dsx-ns.h"
|
2012-11-11 22:12:51 +00:00
|
|
|
|
2009-11-15 08:22:08 +00:00
|
|
|
#define ND_STATE_NORMAL 0
|
|
|
|
#define ND_STATE_RECORDING 1
|
|
|
|
#define ND_STATE_PLAYBACK 2
|
|
|
|
#define ND_STATE_PAUSED 3
|
|
|
|
#define ND_STATE_REWINDING 4
|
|
|
|
#define ND_STATE_FASTFORWARD 5
|
|
|
|
#define ND_STATE_ONEFRAMEFORWARD 6
|
|
|
|
#define ND_STATE_ONEFRAMEBACKWARD 7
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
#define DEMO_DIR "demos/"
|
2013-11-26 22:19:52 +00:00
|
|
|
#define DEMO_EXT "dem"
|
2020-05-02 21:18:42 +00:00
|
|
|
extern const std::array<file_extension_t, 1> demo_file_extensions;
|
2013-11-26 22:19:52 +00:00
|
|
|
|
2016-09-30 01:49:57 +00:00
|
|
|
#if DXX_WORDS_BIGENDIAN
|
2009-11-15 08:22:08 +00:00
|
|
|
#define DEMO_BACKUP_EXT "386"
|
|
|
|
#else
|
|
|
|
#define DEMO_BACKUP_EXT "ppc"
|
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
// Gives state of recorder
|
|
|
|
extern int Newdemo_state;
|
|
|
|
extern int NewdemoFrameCount;
|
|
|
|
|
|
|
|
extern int Newdemo_vcr_state;
|
|
|
|
extern sbyte Newdemo_do_interpolate;
|
2008-10-16 17:27:02 +00:00
|
|
|
extern int Newdemo_show_percentage;
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
//Does demo start automatically?
|
|
|
|
extern int Auto_demo;
|
2012-11-11 00:14:30 +00:00
|
|
|
extern int Newdemo_num_written;
|
|
|
|
|
2021-06-28 03:37:51 +00:00
|
|
|
namespace dcx {
|
|
|
|
enum class sound_pan : int;
|
|
|
|
}
|
|
|
|
|
2012-11-11 00:14:30 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
|
|
|
extern ubyte DemoDoRight,DemoDoLeft;
|
|
|
|
extern struct object DemoRightExtra,DemoLeftExtra;
|
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
// Functions called during recording process...
|
2016-08-25 04:05:32 +00:00
|
|
|
#ifdef dsx
|
|
|
|
namespace dsx {
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_start_demo();
|
2008-10-16 17:27:02 +00:00
|
|
|
extern void newdemo_record_start_frame(fix frame_time );
|
2017-06-10 03:31:02 +00:00
|
|
|
void newdemo_record_render_object(vmobjptridx_t obj);
|
2018-09-25 03:44:09 +00:00
|
|
|
void newdemo_record_viewer_object(vcobjptridx_t obj);
|
2017-06-10 03:31:02 +00:00
|
|
|
icobjptridx_t newdemo_find_object(object_signature_t signature);
|
2015-11-26 02:56:55 +00:00
|
|
|
void newdemo_record_kill_sound_linked_to_object(vcobjptridx_t);
|
2016-01-09 16:38:12 +00:00
|
|
|
void newdemo_start_playback(const char *filename);
|
2020-02-26 05:07:34 +00:00
|
|
|
void newdemo_record_morph_frame(vcobjptridx_t);
|
2016-01-09 16:38:12 +00:00
|
|
|
}
|
2015-11-26 02:56:55 +00:00
|
|
|
#endif
|
2021-06-28 03:37:51 +00:00
|
|
|
void newdemo_record_sound_3d_once( int soundno, sound_pan angle, int volume );
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_sound_once( int soundno );
|
|
|
|
extern void newdemo_record_sound( int soundno );
|
2013-12-29 04:28:07 +00:00
|
|
|
void newdemo_record_wall_hit_process( segnum_t segnum, int side, int damage, int playernum );
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_player_stats(int shields, int energy, int score );
|
2013-12-29 04:28:07 +00:00
|
|
|
void newdemo_record_wall_toggle(segnum_t segnum, int side );
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_control_center_destroyed();
|
2013-06-23 16:24:43 +00:00
|
|
|
extern void newdemo_record_hud_message(const char *s);
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_palette_effect(short r, short g, short b);
|
2010-07-15 05:40:25 +00:00
|
|
|
extern void newdemo_record_player_energy(int);
|
|
|
|
extern void newdemo_record_player_shields(int);
|
2016-07-14 01:59:02 +00:00
|
|
|
extern void newdemo_record_player_flags(unsigned);
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_player_weapon(int, int);
|
2014-10-26 21:36:35 +00:00
|
|
|
void newdemo_record_effect_blowup(segnum_t, int, const vms_vector &);
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_homing_distance(fix);
|
|
|
|
extern void newdemo_record_letterbox(void);
|
|
|
|
extern void newdemo_record_rearview(void);
|
|
|
|
extern void newdemo_record_restore_cockpit(void);
|
2019-05-04 18:27:37 +00:00
|
|
|
#ifdef dsx
|
2020-09-11 03:08:02 +00:00
|
|
|
void newdemo_record_wall_set_tmap_num1(vcsegidx_t seg, unsigned side, vcsegidx_t cseg, unsigned cside, texture1_value tmap);
|
2020-08-24 01:31:28 +00:00
|
|
|
void newdemo_record_wall_set_tmap_num2(vcsegidx_t seg, unsigned side, vcsegidx_t cseg, unsigned cside, texture2_value tmap);
|
2019-05-04 18:27:37 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_multi_cloak(int pnum);
|
|
|
|
extern void newdemo_record_multi_decloak(int pnum);
|
2016-08-25 04:05:32 +00:00
|
|
|
#ifdef dsx
|
|
|
|
namespace dsx {
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_set_new_level(int level_num);
|
2016-08-25 04:05:32 +00:00
|
|
|
}
|
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_restore_rearview(void);
|
|
|
|
|
|
|
|
extern void newdemo_record_multi_death(int pnum);
|
|
|
|
extern void newdemo_record_multi_kill(int pnum, sbyte kill);
|
2017-08-13 20:38:31 +00:00
|
|
|
void newdemo_record_multi_connect(unsigned pnum, unsigned new_player, const char *new_callsign);
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_record_multi_reconnect(int pnum);
|
|
|
|
extern void newdemo_record_multi_disconnect(int pnum);
|
|
|
|
extern void newdemo_record_player_score(int score);
|
2017-08-13 20:38:31 +00:00
|
|
|
void newdemo_record_multi_score(unsigned pnum, int score);
|
2010-07-15 05:40:25 +00:00
|
|
|
extern void newdemo_record_primary_ammo(int new_ammo);
|
|
|
|
extern void newdemo_record_secondary_ammo(int new_ammo);
|
2013-12-29 04:28:07 +00:00
|
|
|
void newdemo_record_door_opening(segnum_t segnum, int side);
|
2020-08-24 01:31:28 +00:00
|
|
|
void newdemo_record_laser_level(laser_level old_level, laser_level new_level);
|
2020-02-26 05:07:34 +00:00
|
|
|
|
2020-05-17 23:35:25 +00:00
|
|
|
#ifdef dsx
|
2020-02-26 05:07:34 +00:00
|
|
|
namespace dsx {
|
2013-03-03 01:03:33 +00:00
|
|
|
#if defined(DXX_BUILD_DESCENT_II)
|
2020-02-26 05:07:34 +00:00
|
|
|
void newdemo_record_player_afterburner(fix afterburner);
|
2021-11-01 03:37:19 +00:00
|
|
|
void newdemo_record_cloaking_wall(wallnum_t front_wall_num, wallnum_t back_wall_num, ubyte type, wall_state state, fix cloak_value, fix l0, fix l1, fix l2, fix l3);
|
2020-02-26 05:07:34 +00:00
|
|
|
void newdemo_record_guided_start();
|
|
|
|
void newdemo_record_guided_end();
|
|
|
|
void newdemo_record_secret_exit_blown(int truth);
|
2019-03-03 00:31:09 +00:00
|
|
|
void newdemo_record_trigger(vcsegidx_t segnum, unsigned side, objnum_t objnum, unsigned shot);
|
2013-03-03 01:03:33 +00:00
|
|
|
#endif
|
2020-02-26 05:07:34 +00:00
|
|
|
}
|
2020-05-17 23:35:25 +00:00
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
// Functions called during playback process...
|
|
|
|
extern void newdemo_object_move_all();
|
2017-01-09 11:09:34 +00:00
|
|
|
extern window_event_result newdemo_playback_one_frame();
|
2016-08-25 04:05:32 +00:00
|
|
|
#ifdef dsx
|
|
|
|
namespace dsx {
|
2017-01-09 11:09:34 +00:00
|
|
|
extern window_event_result newdemo_goto_end(int to_rewrite);
|
2016-08-25 04:05:32 +00:00
|
|
|
}
|
|
|
|
#endif
|
2017-01-09 11:09:34 +00:00
|
|
|
extern window_event_result newdemo_goto_beginning();
|
2006-03-20 17:12:09 +00:00
|
|
|
|
|
|
|
// Interactive functions to control playback/record;
|
2016-08-25 04:05:32 +00:00
|
|
|
#ifdef dsx
|
|
|
|
namespace dsx {
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_stop_playback();
|
2016-08-25 04:05:32 +00:00
|
|
|
}
|
|
|
|
#endif
|
2006-03-20 17:12:09 +00:00
|
|
|
extern void newdemo_start_recording();
|
|
|
|
extern void newdemo_stop_recording();
|
|
|
|
|
2013-06-08 22:24:17 +00:00
|
|
|
extern int newdemo_swap_endian(const char *filename);
|
2009-11-15 08:22:08 +00:00
|
|
|
|
2006-03-20 17:12:09 +00:00
|
|
|
extern int newdemo_get_percent_done();
|
|
|
|
|
2015-12-03 03:26:49 +00:00
|
|
|
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 );
|
2013-08-17 14:46:50 +00:00
|
|
|
int newdemo_count_demos();
|
2006-03-20 17:12:09 +00:00
|
|
|
|
2012-11-11 22:12:51 +00:00
|
|
|
#endif
|