@@ -35,6 +35,7 @@ extern int model_render_flags_size;
3535#define MOVEMENT_TYPE_ROT_SPECIAL 2 // for turrets only
3636#define MOVEMENT_TYPE_TRIGGERED 3 // triggered rotation
3737#define MOVEMENT_TYPE_LOOK_AT 4 // the subobject is always looking at a 'look at' subobject, as best it can - Bobboau
38+ #define MOVEMENT_TYPE_DUMB_ROTATE 5
3839
3940
4041// DA 11/13/98 Reordered to account for difference between max and game
@@ -121,19 +122,18 @@ typedef struct polymodel_instance {
121122#define MSS_FLAG_NO_SS_TARGETING (1 << 16 ) // toggles the subsystem targeting for the turret
122123#define MSS_FLAG_TURRET_RESET_IDLE (1 << 17 ) // makes turret reset to their initial position if the target is out of field of view
123124#define MSS_FLAG_TURRET_ALT_MATH (1 << 18 ) // tells the game to use additional calculations should turret have a defined y fov
124- #define MSS_FLAG_DUM_ROTATES (1 << 19 ) // Bobboau
125- #define MSS_FLAG_CARRY_SHOCKWAVE (1 << 20 ) // subsystem - even with 'carry no damage' flag - will carry shockwave damage to the hull
126- #define MSS_FLAG_ALLOW_LANDING (1 << 21 ) // This subsystem can be landed on
127- #define MSS_FLAG_FOV_EDGE_CHECK (1 << 22 ) // Tells the game to use better FOV edge checking with this turret
128- #define MSS_FLAG_FOV_REQUIRED (1 << 23 ) // Tells game not to allow this turret to attempt targeting objects out of FOV
129- #define MSS_FLAG_NO_REPLACE (1 << 24 ) // set the subsys not to draw replacement ('destroyed') model
130- #define MSS_FLAG_NO_LIVE_DEBRIS (1 << 25 ) // sets the subsys not to release live debris
131- #define MSS_FLAG_IGNORE_IF_DEAD (1 << 26 ) // tells homing missiles to ignore the subsys if its dead and home on to hull instead of earlier subsys pos
132- #define MSS_FLAG_ALLOW_VANISHING (1 << 27 ) // allows subsystem to vanish (prevents explosions & sounds effects from being played)
133- #define MSS_FLAG_DAMAGE_AS_HULL (1 << 28 ) // applies armor damage to subsystem instead of subsystem damage - FUBAR
134- #define MSS_FLAG_TURRET_LOCKED (1 << 29 ) // Turret starts locked by default - Sushi
135- #define MSS_FLAG_NO_AGGREGATE (1 << 30 ) // Don't include with aggregate subsystem types - Goober5000
136- #define MSS_FLAG_TURRET_ANIM_WAIT (1 << 31 ) // Turret won't fire until animation is complete - Sushi
125+ #define MSS_FLAG_CARRY_SHOCKWAVE (1 << 19 ) // subsystem - even with 'carry no damage' flag - will carry shockwave damage to the hull
126+ #define MSS_FLAG_ALLOW_LANDING (1 << 20 ) // This subsystem can be landed on
127+ #define MSS_FLAG_FOV_EDGE_CHECK (1 << 21 ) // Tells the game to use better FOV edge checking with this turret
128+ #define MSS_FLAG_FOV_REQUIRED (1 << 22 ) // Tells game not to allow this turret to attempt targeting objects out of FOV
129+ #define MSS_FLAG_NO_REPLACE (1 << 23 ) // set the subsys not to draw replacement ('destroyed') model
130+ #define MSS_FLAG_NO_LIVE_DEBRIS (1 << 24 ) // sets the subsys not to release live debris
131+ #define MSS_FLAG_IGNORE_IF_DEAD (1 << 25 ) // tells homing missiles to ignore the subsys if its dead and home on to hull instead of earlier subsys pos
132+ #define MSS_FLAG_ALLOW_VANISHING (1 << 26 ) // allows subsystem to vanish (prevents explosions & sounds effects from being played)
133+ #define MSS_FLAG_DAMAGE_AS_HULL (1 << 27 ) // applies armor damage to subsystem instead of subsystem damage - FUBAR
134+ #define MSS_FLAG_TURRET_LOCKED (1 << 28 ) // Turret starts locked by default - Sushi
135+ #define MSS_FLAG_NO_AGGREGATE (1 << 29 ) // Don't include with aggregate subsystem types - Goober5000
136+ #define MSS_FLAG_TURRET_ANIM_WAIT (1 << 30 ) // Turret won't fire until animation is complete - Sushi
137137
138138#define MSS_FLAG2_PLAYER_TURRET_SOUND (1 << 0 )
139139#define MSS_FLAG2_TURRET_ONLY_TARGET_IF_CAN_FIRE (1 << 1 ) // Turrets only target things they're allowed to shoot at (e.g. if check-hull fails, won't keep targeting)
@@ -300,7 +300,7 @@ class bsp_info
300300public:
301301 bsp_info ()
302302 : movement_type(-1 ), movement_axis(0 ), can_move(false ), bsp_data_size(0 ), bsp_data(NULL ), collision_tree_index(-1 ),
303- rad (0 .0f ), blown_off(0 ), my_replacement(-1 ), i_replace(-1 ), is_live_debris(0 ), num_live_debris(0 ), sii( NULL ),
303+ rad (0 .0f ), blown_off(0 ), my_replacement(-1 ), i_replace(-1 ), is_live_debris(0 ), num_live_debris(0 ),
304304 is_thruster(0 ), is_damaged(0 ), parent(-1 ), num_children(0 ), first_child(-1 ), next_sibling(-1 ), num_details(0 ),
305305 num_arcs(0 ), outline_buffer(NULL ), n_verts_outline(0 ), render_sphere_radius(0 .0f ), use_render_box(0 ), use_render_box_offset(false ),
306306 use_render_sphere(0 ), use_render_sphere_offset(false ), gun_rotation(false ), no_collisions(false ),
@@ -352,8 +352,6 @@ class bsp_info
352352 int num_live_debris; // num live debris models assocaiated with a submodel
353353 int live_debris[MAX_LIVE_DEBRIS]; // array of live debris submodels for a submodel
354354
355- submodel_instance_info *sii; // stuff needed for collision from rotations
356-
357355 int is_thruster;
358356 int is_damaged;
359357
@@ -623,6 +621,7 @@ typedef struct insignia {
623621#define PM_FLAG_AUTOCEN (1 <<1 ) // contains autocentering info
624622#define PM_FLAG_TRANS_BUFFER (1 <<2 ) // render transparency buffer
625623#define PM_FLAG_BATCHED (1 <<3 ) // this model can be batch rendered
624+ #define PM_FLAG_HAS_DUMB_ROTATE (1 <<4 ) // whether this model has a dumb-rotate submodel somewhere
626625
627626// Goober5000
628627class texture_info
@@ -831,7 +830,7 @@ void model_instance_free_all();
831830// Loads a model from disk and returns the model number it loaded into.
832831int model_load (char *filename, int n_subsystems, model_subsystem *subsystems, int ferror = 1 , int duplicate = 0 );
833832
834- int model_create_instance (int model_num);
833+ int model_create_instance (bool is_ship, int model_num);
835834void model_delete_instance (int model_instance_num);
836835
837836// Goober5000
@@ -998,7 +997,8 @@ extern void model_make_turret_matrix(int model_num, model_subsystem * turret );
998997
999998// Rotates the angle of a submodel. Use this so the right unlocked axis
1000999// gets stuffed.
1001- extern void submodel_rotate (model_subsystem *psub, submodel_instance_info * sii);
1000+ extern void submodel_rotate (model_subsystem *psub, submodel_instance_info *sii);
1001+ extern void submodel_rotate (bsp_info *sm, submodel_instance_info *sii);
10021002
10031003// Rotates the angle of a submodel. Use this so the right unlocked axis
10041004// gets stuffed. Does this for stepped rotations
@@ -1054,8 +1054,8 @@ void model_set_instance_info(submodel_instance_info *sii, float turn_rate, float
10541054extern void model_clear_instance_info (submodel_instance_info * sii);
10551055
10561056// Sets the submodel instance data in a submodel
1057- extern void model_set_instance (int model_num, int sub_model_num, submodel_instance_info * sii, int flags = 0 );
1058- extern void model_set_instance_techroom (int model_num, int sub_model_num, float angle_1, float angle_2 );
1057+ extern void model_set_instance (int model_num, int sub_model_num, submodel_instance_info *sii, int flags = 0 );
1058+ extern void model_set_instance_techroom (int model_num, int sub_model_num, float angle_1, float angle_2);
10591059
10601060void model_update_instance (int model_instance_num, int sub_model_num, submodel_instance_info *sii, int flags);
10611061void model_instance_dumb_rotation (int model_instance_num);
@@ -1370,7 +1370,7 @@ void model_finish_cloak(int full_cloak);
13701370
13711371void model_do_look_at (int model_num); // Bobboau
13721372
1373- void model_do_dumb_rotation (int modelnum); // Bobboau
1373+ void model_do_dumb_rotations (int model_instance_num = - 1 );
13741374
13751375int model_should_render_engine_glow (int objnum, int bank_obj);
13761376
0 commit comments