mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-28 16:24:45 +02:00
Fixed OpenTK issues in NewInventoryScreen.
This commit is contained in:
parent
498c0b29ee
commit
9c6e11a1fa
@ -10,6 +10,11 @@ Public Class NewInventoryScreen
|
|||||||
|
|
||||||
Private _translation As Globalization.Classes.LOCAL_InventoryScreen
|
Private _translation As Globalization.Classes.LOCAL_InventoryScreen
|
||||||
|
|
||||||
|
Private target_1 As RenderTarget2D
|
||||||
|
Private target_2 As RenderTarget2D
|
||||||
|
Private itemBatch As CoreSpriteBatch
|
||||||
|
Private infoBatch As CoreSpriteBatch
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Texture from file: GUI\Menus\General
|
''' Texture from file: GUI\Menus\General
|
||||||
''' </summary>
|
''' </summary>
|
||||||
@ -112,6 +117,10 @@ Public Class NewInventoryScreen
|
|||||||
|
|
||||||
Public Sub New(ByVal currentScreen As Screen)
|
Public Sub New(ByVal currentScreen As Screen)
|
||||||
_translation = New Globalization.Classes.LOCAL_InventoryScreen()
|
_translation = New Globalization.Classes.LOCAL_InventoryScreen()
|
||||||
|
target_1 = New RenderTarget2D(GraphicsDevice, 816, 400 - 32, False, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.PreserveContents)
|
||||||
|
target_2 = New RenderTarget2D(GraphicsDevice, 500, 368)
|
||||||
|
itemBatch = New CoreSpriteBatch(GraphicsDevice)
|
||||||
|
infoBatch = New CoreSpriteBatch(GraphicsDevice)
|
||||||
|
|
||||||
Identification = Identifications.InventoryScreen
|
Identification = Identifications.InventoryScreen
|
||||||
PreScreen = currentScreen
|
PreScreen = currentScreen
|
||||||
@ -248,12 +257,11 @@ Public Class NewInventoryScreen
|
|||||||
|
|
||||||
'Bring back when Monogame begins supporting this stuff
|
'Bring back when Monogame begins supporting this stuff
|
||||||
' Dim target As New RenderTarget2D(GraphicsDevice, 816, CInt(_enrollY) - 32, False, GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.PreserveContents)
|
' Dim target As New RenderTarget2D(GraphicsDevice, 816, CInt(_enrollY) - 32, False, GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.PreserveContents)
|
||||||
Dim target As New RenderTarget2D(GraphicsDevice, 816, CInt(_enrollY) - 32, False, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.PreserveContents)
|
GraphicsDevice.SetRenderTarget(target_1)
|
||||||
GraphicsDevice.SetRenderTarget(target)
|
|
||||||
GraphicsDevice.Clear(Color.Transparent)
|
GraphicsDevice.Clear(Color.Transparent)
|
||||||
|
|
||||||
'Create a designated sprite batch:
|
'Create a designated sprite batch:
|
||||||
Dim itemBatch As New CoreSpriteBatch(GraphicsDevice)
|
|
||||||
itemBatch.BeginBatch()
|
itemBatch.BeginBatch()
|
||||||
|
|
||||||
Dim itemPanelAlpha As Integer = CInt(If(_tabInControl, 180, 255) * _interfaceFade)
|
Dim itemPanelAlpha As Integer = CInt(If(_tabInControl, 180, 255) * _interfaceFade)
|
||||||
@ -294,7 +302,7 @@ Public Class NewInventoryScreen
|
|||||||
|
|
||||||
'When the info is visible, draw it:
|
'When the info is visible, draw it:
|
||||||
If _infoSize > 0 Then
|
If _infoSize > 0 Then
|
||||||
DrawInfo(itemBatch, target)
|
DrawInfo(itemBatch, target_1)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
itemBatch.EndBatch()
|
itemBatch.EndBatch()
|
||||||
@ -307,7 +315,7 @@ Public Class NewInventoryScreen
|
|||||||
drawheight = CInt(_enrollY) - 32
|
drawheight = CInt(_enrollY) - 32
|
||||||
End If
|
End If
|
||||||
|
|
||||||
SpriteBatch.Draw(target, New Rectangle(halfWidth - 400, halfHeight - 200 + 48, 816, drawheight), mainBackgroundColor)
|
SpriteBatch.Draw(target_1, New Rectangle(halfWidth - 400, halfHeight - 200 + 48, 816, drawheight), mainBackgroundColor)
|
||||||
|
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@ -320,11 +328,9 @@ Public Class NewInventoryScreen
|
|||||||
|
|
||||||
'Bring back when Monogame begins supporting this stuff
|
'Bring back when Monogame begins supporting this stuff
|
||||||
' Dim target As New RenderTarget2D(GraphicsDevice, _infoSize, 368, False, GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.PreserveContents)
|
' Dim target As New RenderTarget2D(GraphicsDevice, _infoSize, 368, False, GraphicsDevice.PresentationParameters.BackBufferFormat, DepthFormat.Depth24Stencil8, 0, RenderTargetUsage.PreserveContents)
|
||||||
Dim target As New RenderTarget2D(GraphicsDevice, _infoSize, 368, False, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.DiscardContents)
|
GraphicsDevice.SetRenderTarget(target_2)
|
||||||
GraphicsDevice.SetRenderTarget(target)
|
|
||||||
|
|
||||||
'Render background:
|
'Render background:
|
||||||
Dim infoBatch As New CoreSpriteBatch(GraphicsDevice)
|
|
||||||
infoBatch.BeginBatch()
|
infoBatch.BeginBatch()
|
||||||
For y = 0 To 368 Step 16
|
For y = 0 To 368 Step 16
|
||||||
For x = 0 To _infoSize + 16 Step 16
|
For x = 0 To _infoSize + 16 Step 16
|
||||||
@ -383,7 +389,7 @@ Public Class NewInventoryScreen
|
|||||||
|
|
||||||
'Set the target that was previously active and render the new target on top of that:
|
'Set the target that was previously active and render the new target on top of that:
|
||||||
GraphicsDevice.SetRenderTarget(preTarget)
|
GraphicsDevice.SetRenderTarget(preTarget)
|
||||||
preBatch.Draw(target, New Rectangle(_infoPosition + 80, 0, target.Width, target.Height), Color.White)
|
preBatch.Draw(target_2, New Rectangle(_infoPosition + 80, 0, target_2.Width, target_2.Height), Color.White)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user