diff --git a/P3D/Battle/BattleSystemV2/BattleScreen.vb b/P3D/Battle/BattleSystemV2/BattleScreen.vb index b10085531..9f2114096 100644 --- a/P3D/Battle/BattleSystemV2/BattleScreen.vb +++ b/P3D/Battle/BattleSystemV2/BattleScreen.vb @@ -937,6 +937,8 @@ #End Region Public Overrides Sub Draw() + DebugDisplay.MaxVertices = 0 + DebugDisplay.MaxVisibleVertices = 0 Dim ForegroundEntities As New List(Of Entity) @@ -1024,6 +1026,9 @@ nextIndexBackground: GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.Transparent) For i = 0 To ForegroundEntities.Count - 1 ForegroundEntities(i).Render() + If ForegroundEntities(i).Visible = True Then + DebugDisplay.MaxVisibleVertices += ForegroundEntities(i).VertexCount + End If DebugDisplay.MaxVertices += ForegroundEntities(i).VertexCount Next diff --git a/P3D/Debug/DebugDisplay.vb b/P3D/Debug/DebugDisplay.vb index 0b2760717..c53b5d1f2 100644 --- a/P3D/Debug/DebugDisplay.vb +++ b/P3D/Debug/DebugDisplay.vb @@ -68,7 +68,7 @@ Public Class DebugDisplay Dim s As String = GameController.GAMENAME & " " & GameController.GAMEDEVELOPMENTSTAGE & " " & GameController.GAMEVERSION & " / FPS: " & Math.Round(Core.GameInstance.FPSMonitor.Value, 0) & isDebugString & Environment.NewLine & cameraInformation & - "E: " & _drawnVertices.ToString() & "/" & _maxVertices.ToString() & Environment.NewLine & + "E: " & _drawnVertices.ToString() & "/" & _maxVertices.ToString() & " (" & _maxVisibleVertices & ")" & Environment.NewLine & "C: " & _maxDistance.ToString() & " A: " & ActionscriptActive.ToString() & MapPath @@ -96,6 +96,7 @@ Public Class DebugDisplay 'Values for tracking render data of the level. Private Shared _drawnVertices As Integer = 0 Private Shared _maxVertices As Integer = 0 + Private Shared _maxVisibleVertices As Integer = 0 Private Shared _maxDistance As Integer = 0 ''' @@ -110,6 +111,18 @@ Public Class DebugDisplay End Set End Property + ''' + ''' The maximum amount of visible vertices that are present in the current scene. + ''' + Public Shared Property MaxVisibleVertices() As Integer + Get + Return _maxVisibleVertices + End Get + Set(value As Integer) + _maxVisibleVertices = value + End Set + End Property + ''' ''' The maximum amount of vertices that are present in the current scene. ''' diff --git a/P3D/World/Level.vb b/P3D/World/Level.vb index ba02c7157..d791c4372 100644 --- a/P3D/World/Level.vb +++ b/P3D/World/Level.vb @@ -849,6 +849,7 @@ Public Class Level ' Reset the Debug values: DebugDisplay.DrawnVertices = 0 + DebugDisplay.MaxVisibleVertices = 0 DebugDisplay.MaxVertices = 0 DebugDisplay.MaxDistance = 0 @@ -870,6 +871,9 @@ Public Class Level For i = 0 To AllFloors.Count - 1 If i <= AllFloors.Count - 1 Then AllFloors(i).Render() + If AllFloors(i).Visible = True Then + DebugDisplay.MaxVisibleVertices += AllFloors(i).VertexCount + End If DebugDisplay.MaxVertices += AllFloors(i).VertexCount End If Next @@ -878,6 +882,9 @@ Public Class Level For i = 0 To AllEntities.Count - 1 If i <= AllEntities.Count - 1 Then AllEntities(i).Render() + If AllEntities(i).Visible = True Then + DebugDisplay.MaxVisibleVertices += AllEntities(i).VertexCount + End If DebugDisplay.MaxVertices += AllEntities(i).VertexCount End If Next @@ -1015,6 +1022,9 @@ Public Class Level If i <= Me.OffsetmapFloors.Count - 1 Then If Not Me.OffsetmapFloors(i) Is Nothing Then Me.OffsetmapFloors(i).Render() + If OffsetmapFloors(i).Visible = True Then + DebugDisplay.MaxVisibleVertices += OffsetmapFloors(i).VertexCount + End If DebugDisplay.MaxVertices += Me.OffsetmapFloors(i).VertexCount End If End If @@ -1024,6 +1034,9 @@ Public Class Level For i = 0 To Me.OffsetmapEntities.Count - 1 If i <= Me.OffsetmapEntities.Count - 1 Then If Not Me.OffsetmapEntities(i) Is Nothing Then + If OffsetmapEntities(i).Visible = True Then + DebugDisplay.MaxVisibleVertices += OffsetmapEntities(i).VertexCount + End If Me.OffsetmapEntities(i).Render() DebugDisplay.MaxVertices += Me.OffsetmapEntities(i).VertexCount End If