View Issue Details

IDProjectCategoryView StatusLast Update
0003089FSSCPuser interfacepublic2014-08-10 03:28
ReporterYarn Assigned ToMageKing17  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx64OSWindows 7 
Product Version3.7.2 RC3 
Summary0003089: Ship model in ship selection screen rendered over help overlay
DescriptionIn the ship selection screen, if 3D ship models are enabled, the ship model is rendered above the help overlay. The first attached screenshot shows what this looks like. This does not happen in the loadout screen.
Additional InformationI attempted to fix this by moving the call to help_overlay_maybe_blit() so that it happens after the model is rendered. The patch is attached. This fixes the problem; however, it introduces two new problems with the help overlay: the gray shading is too bright (on the ship selection screen only), and the black box that's supposed to be behind the "Choose your ship type" text is missing. The second attached screenshot shows what this looks like. Removing the call to draw_model_rotating() fixed both problems, although the ship model disappeared (duh).
TagsNo tags attached.

Activities

Yarn

2014-08-09 02:25

developer  

mantis3089_ss1.png (115,319 bytes)   
mantis3089_ss1.png (115,319 bytes)   

Yarn

2014-08-09 02:25

developer  

mantis3089_attempt.patch (1,374 bytes)   
Index: code/missionui/missionshipchoice.cpp
===================================================================
--- code/missionui/missionshipchoice.cpp	(revision 10978)
+++ code/missionui/missionshipchoice.cpp	(working copy)
@@ -1507,17 +1507,6 @@
 
 	ss_maybe_flash_button();
 
-	// blit help overlay if active
-	help_overlay_maybe_blit(Ship_select_overlay_id, gr_screen.res);
-
-	// If the commit button was pressed, do the commit button actions.  Done at the end of the
-	// loop so there isn't a skip in the animation (since ship_create() can take a long time if
-	// the ship model is not in memory
-	if ( Commit_pressed ) {		
-		commit_pressed();		
-		Commit_pressed = 0;
-	}
-
 	// The new rendering code for 3D ships courtesy your friendly UnknownPlayer :)
 
 	//////////////////////////////////
@@ -1559,7 +1548,6 @@
 	}
 
 	gr_reset_clip();
-	gr_flip();
 
 	///////////////////////////////////
 	// Done Rendering and Drawing 3D //
@@ -1570,6 +1558,10 @@
 			Net_player->p_info.ship_class = Selected_ss_class;
 	}	 
 
+	// blit help overlay if active
+	help_overlay_maybe_blit(Ship_select_overlay_id, gr_screen.res);
+	gr_flip();
+
 	// If the commit button was pressed, do the commit button actions.  Done at the end of the
 	// loop so there isn't a skip in the animation (since ship_create() can take a long time if
 	// the ship model is not in memory
mantis3089_attempt.patch (1,374 bytes)   

Yarn

2014-08-09 02:26

developer  

mantis3089_ss2.png (106,810 bytes)   
mantis3089_ss2.png (106,810 bytes)   

MageKing17

2014-08-09 05:13

developer  

missionshipchoice.cpp.patch (3,692 bytes)   
Index: code/missionui/missionshipchoice.cpp
===================================================================
--- code/missionui/missionshipchoice.cpp	(revision 10978)
+++ code/missionui/missionshipchoice.cpp	(working copy)
@@ -1454,10 +1454,42 @@
 		ship_select_redraw_pressed_buttons();
 		common_render_selected_screen_button();
 	}
-	if(!Cmdline_ship_choice_3d)
+	if(!Cmdline_ship_choice_3d && ((Selected_ss_class >= 0) && (Ss_icons[Selected_ss_class].ss_anim.num_frames > 0)))
 	{
-		if ( (Selected_ss_class >= 0) && (Ss_icons[Selected_ss_class].ss_anim.num_frames > 0) ) {
-			generic_anim_render(&Ss_icons[Selected_ss_class].ss_anim, (help_overlay_active(Ship_select_overlay_id)) ? 0 : frametime, Ship_anim_coords[gr_screen.res][0], Ship_anim_coords[gr_screen.res][1], true);
+		generic_anim_render(&Ss_icons[Selected_ss_class].ss_anim, (help_overlay_active(Ship_select_overlay_id)) ? 0 : frametime, Ship_anim_coords[gr_screen.res][0], Ship_anim_coords[gr_screen.res][1], true);
+	} else {
+		// The new rendering code for 3D ships courtesy your friendly UnknownPlayer :)
+
+		// check we have a valid ship class selected
+		if ( (Selected_ss_class >= 0) && (ShipSelectModelNum >= 0) )
+		{
+			ship_info *sip = &Ship_info[Selected_ss_class];
+			float rev_rate = REVOLUTION_RATE;
+			if (sip->flags & SIF_BIG_SHIP) {
+				rev_rate *= 1.7f;
+			}
+			if (sip->flags & SIF_HUGE_SHIP) {
+				rev_rate *= 3.0f;
+			}
+
+			if (sip->uses_team_colors) {
+				gr_set_team_color(sip->default_team_name, "none", 0, 0);
+			}
+
+			draw_model_rotating(ShipSelectModelNum,
+				Ship_anim_coords[gr_screen.res][0],
+				Ship_anim_coords[gr_screen.res][1],
+				Tech_ship_display_coords[gr_screen.res][2],
+				Tech_ship_display_coords[gr_screen.res][3],
+				&ShipSelectScreenShipRot,
+				&sip->closeup_pos,
+				sip->closeup_zoom * 1.3f,
+				rev_rate,
+				MR_LOCK_DETAIL | MR_AUTOCENTER | MR_NO_FOGGING,
+				GR_RESIZE_MENU,
+				sip->selection_effect);
+
+			gr_disable_team_color();
 		}
 	}
 
@@ -1510,54 +1542,6 @@
 	// blit help overlay if active
 	help_overlay_maybe_blit(Ship_select_overlay_id, gr_screen.res);
 
-	// If the commit button was pressed, do the commit button actions.  Done at the end of the
-	// loop so there isn't a skip in the animation (since ship_create() can take a long time if
-	// the ship model is not in memory
-	if ( Commit_pressed ) {		
-		commit_pressed();		
-		Commit_pressed = 0;
-	}
-
-	// The new rendering code for 3D ships courtesy your friendly UnknownPlayer :)
-
-	//////////////////////////////////
-	// Render and draw the 3D model //
-	//////////////////////////////////
-	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) )
-		{
-			ship_info *sip = &Ship_info[Selected_ss_class];
-			float rev_rate = REVOLUTION_RATE;
-			if (sip->flags & SIF_BIG_SHIP) {
-				rev_rate *= 1.7f;
-			}
-			if (sip->flags & SIF_HUGE_SHIP) {
-				rev_rate *= 3.0f;
-			}
-
-			if (sip->uses_team_colors) {
-				gr_set_team_color(sip->default_team_name, "none", 0, 0);
-			}
-
-			draw_model_rotating(ShipSelectModelNum,
-				Ship_anim_coords[gr_screen.res][0],
-				Ship_anim_coords[gr_screen.res][1],
-				Tech_ship_display_coords[gr_screen.res][2],
-				Tech_ship_display_coords[gr_screen.res][3],
-				&ShipSelectScreenShipRot,
-				&sip->closeup_pos,
-				sip->closeup_zoom * 1.3f,
-				rev_rate,
-				MR_LOCK_DETAIL | MR_AUTOCENTER | MR_NO_FOGGING,
-				GR_RESIZE_MENU,
-				sip->selection_effect);
-
-			gr_disable_team_color();
-		}
-	}
-
 	gr_reset_clip();
 	gr_flip();
 
missionshipchoice.cpp.patch (3,692 bytes)   

MageKing17

2014-08-09 05:14

developer   ~0016191

Since moving the maybe_blit_help_overlay() call later didn't work, I decided to try the opposite and move the draw_model_rotating() call earlier (specifically, I placed it next to the 2D animation call and removed the redundant conditional in the process). For some reason, this fixes the problem. Patch attached.

Yarn

2014-08-09 05:31

developer   ~0016192

I have confirmed that your patch fixes this problem without introducing the other two problems that my patch introduces.

niffiwan

2014-08-10 03:28

developer   ~0016194

code looks good to me, I'll commit it shortly.

niffiwan

2014-08-10 03:28

developer   ~0016195

Fix committed to trunk@10983.

Related Changesets

fs2open: trunk r10983

2014-08-09 23:56

niffiwan


Ported: N/A

Details Diff
Fix mantis 3089 (From MageKing17)

Move 3D ship select model drawing earlier so that the help overlay is
drawn over the top, not underneath
Affected Issues
0003089
mod - /trunk/fs2_open/code/missionui/missionshipchoice.cpp Diff File

Issue History

Date Modified Username Field Change
2014-08-09 02:24 Yarn New Issue
2014-08-09 02:24 Yarn File Added: mantis3000_ss1.png
2014-08-09 02:25 Yarn File Deleted: mantis3000_ss1.png
2014-08-09 02:25 Yarn File Added: mantis3089_ss1.png
2014-08-09 02:25 Yarn File Added: mantis3089_attempt.patch
2014-08-09 02:26 Yarn File Added: mantis3089_ss2.png
2014-08-09 05:13 MageKing17 File Added: missionshipchoice.cpp.patch
2014-08-09 05:14 MageKing17 Note Added: 0016191
2014-08-09 05:16 MageKing17 Assigned To => MageKing17
2014-08-09 05:16 MageKing17 Status new => code review
2014-08-09 05:31 Yarn Note Added: 0016192
2014-08-10 03:28 niffiwan Note Added: 0016194
2014-08-10 03:28 niffiwan Changeset attached => fs2open trunk r10983
2014-08-10 03:28 niffiwan Note Added: 0016195
2014-08-10 03:28 niffiwan Status code review => resolved
2014-08-10 03:28 niffiwan Resolution open => fixed