Fix for Mantis 2210 (Ship models in ship selection do not always show up properly)

This commit is contained in:
The_E committed 2010-06-15 12:04:50 +00:00
1 parent 0d2c96ba09
commit c0e55de8f0
1 file changed
+13 -2
+13 -2
View File
@@ -1481,7 +1481,7 @@ void ship_select_do(float frametime)
//////////////////////////////////
// Render and draw the 3D model //
//////////////////////////////////
if( Cmdline_ship_choice_3d || ((Ss_icons != NULL) && (Selected_ss_class >= 0) && (Ss_icons[Selected_ss_class].ss_anim.num_frames > 0)) )
if( Cmdline_ship_choice_3d || ( (Selected_ss_class >= 0) && (Ss_icons[Selected_ss_class].ss_anim.num_frames == 0)) )
{
// check we have a valid ship class selected
if ( (Selected_ss_class >= 0) && (ShipSelectModelNum >= 0) )
@@ -1713,6 +1713,12 @@ void start_ship_animation(int ship_class, int play_sound)
return;
}
//Unload Anim if one was playing
if(Ship_anim_class > 0 && Ss_icons[Ship_anim_class].ss_anim.num_frames > 0) {
generic_anim_unload(&Ss_icons[Ship_anim_class].ss_anim);
Ship_anim_class = -1;
}
// Load the necessary model file
ShipSelectModelNum = model_load(sip->pof_file, sip->n_subsystems, &sip->subsystems[0]);
@@ -1733,6 +1739,12 @@ void start_ship_animation(int ship_class, int play_sound)
ss_icon = &Ss_icons[ship_class];
//If there was a model loaded for the previous ship, unload it
if (ShipSelectModelNum >= 0 ) {
model_unload(ShipSelectModelNum);
ShipSelectModelNum = -1;
}
//unload the previous anim
if(Ship_anim_class > 0 && Ss_icons[Ship_anim_class].ss_anim.num_frames > 0)
generic_anim_unload(&Ss_icons[Ship_anim_class].ss_anim);
@@ -1764,7 +1776,6 @@ void start_ship_animation(int ship_class, int play_sound)
// if ( play_sound ) {
gamesnd_play_iface(SND_SHIP_ICON_CHANGE);
// }
}
void ss_unload_all_anims()