diff --git a/common/main/morph.h b/common/main/morph.h index 79121cd61..cbc01d748 100644 --- a/common/main/morph.h +++ b/common/main/morph.h @@ -36,6 +36,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #ifdef dsx #include "compiler-span.h" #include "fwd-object.h" +#include "physics_info.h" #include #include diff --git a/common/main/newdemo.h b/common/main/newdemo.h index 725e7d877..c9ba5d2df 100644 --- a/common/main/newdemo.h +++ b/common/main/newdemo.h @@ -134,6 +134,7 @@ extern void newdemo_record_secondary_ammo(int new_ammo); void newdemo_record_door_opening(segnum_t segnum, int side); extern void newdemo_record_laser_level(sbyte old_level, sbyte new_level); +#ifdef dsx namespace dsx { #if defined(DXX_BUILD_DESCENT_II) void newdemo_record_player_afterburner(fix afterburner); @@ -144,6 +145,7 @@ void newdemo_record_secret_exit_blown(int truth); void newdemo_record_trigger(vcsegidx_t segnum, unsigned side, objnum_t objnum, unsigned shot); #endif } +#endif // Functions called during playback process... extern void newdemo_object_move_all(); diff --git a/common/main/object.h b/common/main/object.h index f81d7edd9..58b693b48 100644 --- a/common/main/object.h +++ b/common/main/object.h @@ -48,6 +48,7 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include "weapon.h" #include "powerup.h" #include "compiler-poison.h" +#include "physics_info.h" #include "player-flags.h" #if defined(DXX_BUILD_DESCENT_II) #include "escort.h" @@ -213,32 +214,6 @@ struct quaternionpos : prohibit_void_ptr vms_vector rotvel; }; -// information for physics sim for an object -struct physics_info : prohibit_void_ptr -{ - vms_vector velocity; // velocity vector of this object - vms_vector thrust; // constant force applied to this object - fix mass; // the mass of this object - fix drag; // how fast this slows down - vms_vector rotvel; // rotational velecity (angles) - vms_vector rotthrust; // rotational acceleration - fixang turnroll; // rotation caused by turn banking - ushort flags; // misc physics flags -}; - -struct physics_info_rw -{ - vms_vector velocity; // velocity vector of this object - vms_vector thrust; // constant force applied to this object - fix mass; // the mass of this object - fix drag; // how fast this slows down - fix obsolete_brakes; // how much brakes applied - vms_vector rotvel; // rotational velecity (angles) - vms_vector rotthrust; // rotational acceleration - fixang turnroll; // rotation caused by turn banking - ushort flags; // misc physics flags -} __pack__; - // stuctures for different kinds of simulation struct laser_parent diff --git a/common/main/physics_info.h b/common/main/physics_info.h new file mode 100644 index 000000000..bc898cf1b --- /dev/null +++ b/common/main/physics_info.h @@ -0,0 +1,43 @@ +/* + * 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. + * See COPYING.txt for license details. + */ + +#pragma once +#include "vecmat.h" +#include "pack.h" +#include "dxxsconf.h" +#include "dsx-ns.h" + +namespace dcx { + +// information for physics sim for an object +struct physics_info : prohibit_void_ptr +{ + vms_vector velocity; // velocity vector of this object + vms_vector thrust; // constant force applied to this object + fix mass; // the mass of this object + fix drag; // how fast this slows down + vms_vector rotvel; // rotational velecity (angles) + vms_vector rotthrust; // rotational acceleration + fixang turnroll; // rotation caused by turn banking + uint16_t flags; // misc physics flags +}; + +struct physics_info_rw +{ + vms_vector velocity; // velocity vector of this object + vms_vector thrust; // constant force applied to this object + fix mass; // the mass of this object + fix drag; // how fast this slows down + fix obsolete_brakes; // how much brakes applied + vms_vector rotvel; // rotational velecity (angles) + vms_vector rotthrust; // rotational acceleration + fixang turnroll; // rotation caused by turn banking + uint16_t flags; // misc physics flags +} __pack__; + +} diff --git a/common/main/state.h b/common/main/state.h index 0c5842c50..8819868b4 100644 --- a/common/main/state.h +++ b/common/main/state.h @@ -80,12 +80,12 @@ enum class deny_save_result }; int state_get_game_id(const d_game_unique_state::savegame_file_path &filename); -deny_save_result deny_save_game(fvcobjptr &vcobjptr, const d_level_unique_control_center_state &LevelUniqueControlCenterState); } #ifdef dsx namespace dsx { +deny_save_result deny_save_game(fvcobjptr &vcobjptr, const d_level_unique_control_center_state &LevelUniqueControlCenterState); deny_save_result deny_save_game(fvcobjptr &vcobjptr, const d_level_unique_control_center_state &LevelUniqueControlCenterState, const d_game_unique_state &GameUniqueState); void state_poll_autosave_game(d_game_unique_state &GameUniqueState, const d_level_unique_object_state &LevelUniqueObjectState); void state_set_immediate_autosave(d_game_unique_state &GameUniqueState); diff --git a/similar/main/state.cpp b/similar/main/state.cpp index 8a3d2359b..353fd5881 100644 --- a/similar/main/state.cpp +++ b/similar/main/state.cpp @@ -539,7 +539,7 @@ deny_save_result deny_save_game(fvcobjptr &vcobjptr, const d_level_unique_contro if (GameUniqueState.Final_boss_countdown_time) //don't allow save while final boss is dying return deny_save_result::denied; #endif - return ::dcx::deny_save_game(vcobjptr, LevelUniqueControlCenterState); + return deny_save_game(vcobjptr, LevelUniqueControlCenterState); } namespace { @@ -2319,10 +2319,6 @@ int state_restore_all_sub(const d_level_shared_destructible_light_state &LevelSh return 1; } -} - -namespace dcx { - deny_save_result deny_save_game(fvcobjptr &vcobjptr, const d_level_unique_control_center_state &LevelUniqueControlCenterState) { if (LevelUniqueControlCenterState.Control_center_destroyed) @@ -2338,6 +2334,10 @@ deny_save_result deny_save_game(fvcobjptr &vcobjptr, const d_level_unique_contro return deny_save_result::allowed; } +} + +namespace dcx { + int state_get_game_id(const d_game_unique_state::savegame_file_path &filename) { int version;