mirror of
https://github.com/P3D-Legacy/P3D-Legacy.git
synced 2025-07-27 15:54:25 +02:00
Fix water textures not rotating on fast graphics
This commit is contained in:
parent
fef6b689ea
commit
d516a1e152
@ -15,6 +15,7 @@
|
|||||||
WaterAnimation = New Animation(TextureManager.GetTexture("Textures\Routes"), 1, 3, 16, 16, GameModeManager.ActiveGameMode.WaterSpeed, 15, 0)
|
WaterAnimation = New Animation(TextureManager.GetTexture("Textures\Routes"), 1, 3, 16, 16, GameModeManager.ActiveGameMode.WaterSpeed, 15, 0)
|
||||||
|
|
||||||
CreateWaterTextureTemp()
|
CreateWaterTextureTemp()
|
||||||
|
ChangeTexture()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Shared Sub ClearAnimationResources()
|
Public Shared Sub ClearAnimationResources()
|
||||||
@ -195,65 +196,64 @@
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Overrides Sub UpdateEntity()
|
Public Overrides Sub UpdateEntity()
|
||||||
If Not WaterAnimation Is Nothing Then
|
If Core.GameOptions.GraphicStyle = 1 Then
|
||||||
WaterAnimation.Update(0.005)
|
If Not WaterAnimation Is Nothing Then
|
||||||
If currentRectangle <> WaterAnimation.TextureRectangle Then
|
WaterAnimation.Update(0.005)
|
||||||
ChangeTexture()
|
If currentRectangle <> WaterAnimation.TextureRectangle Then
|
||||||
|
ChangeTexture()
|
||||||
|
|
||||||
currentRectangle = WaterAnimation.TextureRectangle
|
currentRectangle = WaterAnimation.TextureRectangle
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
MyBase.UpdateEntity()
|
MyBase.UpdateEntity()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ChangeTexture()
|
Private Sub ChangeTexture()
|
||||||
If Core.GameOptions.GraphicStyle = 1 Then
|
If WaterTexturesTemp.Count = 0 OrElse Water.WaterTexturesTemp.ContainsKey("_0") = False OrElse Water.WaterTexturesTemp.ContainsKey(AdditionalValue & "_0") = False Then
|
||||||
If WaterTexturesTemp.Count = 0 OrElse Water.WaterTexturesTemp.ContainsKey("_0") = False OrElse Water.WaterTexturesTemp.ContainsKey(AdditionalValue & "_0") = False Then
|
ClearAnimationResources()
|
||||||
ClearAnimationResources()
|
AddDefaultWaterAnimationResources()
|
||||||
AddDefaultWaterAnimationResources()
|
CreateWaterTextureTemp()
|
||||||
CreateWaterTextureTemp()
|
|
||||||
End If
|
|
||||||
|
|
||||||
Select Case Me.Rotation.Y
|
|
||||||
Case 0, MathHelper.TwoPi
|
|
||||||
Select Case WaterAnimation.CurrentColumn
|
|
||||||
Case 0
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_0")
|
|
||||||
Case 1
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_1")
|
|
||||||
Case 2
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_2")
|
|
||||||
End Select
|
|
||||||
Case MathHelper.Pi * 0.5F
|
|
||||||
Select Case WaterAnimation.CurrentColumn
|
|
||||||
Case 0
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_3")
|
|
||||||
Case 1
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_4")
|
|
||||||
Case 2
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_5")
|
|
||||||
End Select
|
|
||||||
Case MathHelper.Pi
|
|
||||||
Select Case WaterAnimation.CurrentColumn
|
|
||||||
Case 0
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_6")
|
|
||||||
Case 1
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_7")
|
|
||||||
Case 2
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_8")
|
|
||||||
End Select
|
|
||||||
Case MathHelper.Pi * 1.5
|
|
||||||
Select Case WaterAnimation.CurrentColumn
|
|
||||||
Case 0
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_9")
|
|
||||||
Case 1
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_10")
|
|
||||||
Case 2
|
|
||||||
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_11")
|
|
||||||
End Select
|
|
||||||
End Select
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Select Case Me.Rotation.Y
|
||||||
|
Case 0, MathHelper.TwoPi
|
||||||
|
Select Case WaterAnimation.CurrentColumn
|
||||||
|
Case 0
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_0")
|
||||||
|
Case 1
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_1")
|
||||||
|
Case 2
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_2")
|
||||||
|
End Select
|
||||||
|
Case MathHelper.Pi * 0.5F
|
||||||
|
Select Case WaterAnimation.CurrentColumn
|
||||||
|
Case 0
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_3")
|
||||||
|
Case 1
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_4")
|
||||||
|
Case 2
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_5")
|
||||||
|
End Select
|
||||||
|
Case MathHelper.Pi
|
||||||
|
Select Case WaterAnimation.CurrentColumn
|
||||||
|
Case 0
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_6")
|
||||||
|
Case 1
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_7")
|
||||||
|
Case 2
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_8")
|
||||||
|
End Select
|
||||||
|
Case MathHelper.Pi * 1.5
|
||||||
|
Select Case WaterAnimation.CurrentColumn
|
||||||
|
Case 0
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_9")
|
||||||
|
Case 1
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_10")
|
||||||
|
Case 2
|
||||||
|
Me.Textures(0) = Water.WaterTexturesTemp(waterTextureName & "_11")
|
||||||
|
End Select
|
||||||
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides Sub ResultFunction(ByVal Result As Integer)
|
Public Overrides Sub ResultFunction(ByVal Result As Integer)
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
WaterAnimation = New Animation(TextureManager.GetTexture("Textures\Routes"), 1, 3, 16, 16, 9, 13, 0)
|
WaterAnimation = New Animation(TextureManager.GetTexture("Textures\Routes"), 1, 3, 16, 16, 9, 13, 0)
|
||||||
|
|
||||||
CreateWaterTextureTemp()
|
CreateWaterTextureTemp()
|
||||||
|
ChangeTexture()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub CreateWaterTextureTemp()
|
Private Sub CreateWaterTextureTemp()
|
||||||
@ -116,12 +117,15 @@
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides Sub UpdateEntity()
|
Public Overrides Sub UpdateEntity()
|
||||||
If Not WaterAnimation Is Nothing Then
|
|
||||||
WaterAnimation.Update(0.01)
|
|
||||||
If currentRectangle <> WaterAnimation.TextureRectangle Then
|
|
||||||
ChangeTexture()
|
|
||||||
|
|
||||||
currentRectangle = WaterAnimation.TextureRectangle
|
If Core.GameOptions.GraphicStyle = 1 Then
|
||||||
|
If Not WaterAnimation Is Nothing Then
|
||||||
|
WaterAnimation.Update(0.01)
|
||||||
|
If currentRectangle <> WaterAnimation.TextureRectangle Then
|
||||||
|
ChangeTexture()
|
||||||
|
|
||||||
|
currentRectangle = WaterAnimation.TextureRectangle
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@ -129,60 +133,58 @@
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ChangeTexture()
|
Private Sub ChangeTexture()
|
||||||
If Core.GameOptions.GraphicStyle = 1 Then
|
If WaterfallTexturesTemp.Count = 0 Or WaterTexturesTemp.Count = 0 OrElse Waterfall.WaterTexturesTemp.ContainsKey("_0") = False OrElse Waterfall.WaterTexturesTemp.ContainsKey(AdditionalValue & "_0") = False Then
|
||||||
If WaterfallTexturesTemp.Count = 0 Or WaterTexturesTemp.Count = 0 OrElse Waterfall.WaterTexturesTemp.ContainsKey("_0") = False OrElse Waterfall.WaterTexturesTemp.ContainsKey(AdditionalValue & "_0") = False Then
|
ClearAnimationResources()
|
||||||
ClearAnimationResources()
|
AddDefaultWaterAnimationResources()
|
||||||
AddDefaultWaterAnimationResources()
|
CreateWaterTextureTemp()
|
||||||
CreateWaterTextureTemp()
|
|
||||||
End If
|
|
||||||
|
|
||||||
Select Case WaterAnimation.CurrentColumn
|
|
||||||
Case 0
|
|
||||||
Me.Textures(0) = Waterfall.WaterfallTexturesTemp(waterFallTextureName & "_0")
|
|
||||||
Case 1
|
|
||||||
Me.Textures(0) = Waterfall.WaterfallTexturesTemp(waterFallTextureName & "_1")
|
|
||||||
Case 2
|
|
||||||
Me.Textures(0) = Waterfall.WaterfallTexturesTemp(waterFallTextureName & "_2")
|
|
||||||
End Select
|
|
||||||
Select Case Me.Rotation.Y
|
|
||||||
Case 0, MathHelper.TwoPi
|
|
||||||
Select Case WaterAnimation.CurrentColumn
|
|
||||||
Case 0
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_0")
|
|
||||||
Case 1
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_1")
|
|
||||||
Case 2
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_2")
|
|
||||||
End Select
|
|
||||||
Case MathHelper.Pi * 0.5F
|
|
||||||
Select Case WaterAnimation.CurrentColumn
|
|
||||||
Case 0
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_3")
|
|
||||||
Case 1
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_4")
|
|
||||||
Case 2
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_5")
|
|
||||||
End Select
|
|
||||||
Case MathHelper.Pi
|
|
||||||
Select Case WaterAnimation.CurrentColumn
|
|
||||||
Case 0
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_6")
|
|
||||||
Case 1
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_7")
|
|
||||||
Case 2
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_8")
|
|
||||||
End Select
|
|
||||||
Case MathHelper.Pi * 1.5
|
|
||||||
Select Case WaterAnimation.CurrentColumn
|
|
||||||
Case 0
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_9")
|
|
||||||
Case 1
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_10")
|
|
||||||
Case 2
|
|
||||||
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_11")
|
|
||||||
End Select
|
|
||||||
End Select
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
Select Case WaterAnimation.CurrentColumn
|
||||||
|
Case 0
|
||||||
|
Me.Textures(0) = Waterfall.WaterfallTexturesTemp(waterFallTextureName & "_0")
|
||||||
|
Case 1
|
||||||
|
Me.Textures(0) = Waterfall.WaterfallTexturesTemp(waterFallTextureName & "_1")
|
||||||
|
Case 2
|
||||||
|
Me.Textures(0) = Waterfall.WaterfallTexturesTemp(waterFallTextureName & "_2")
|
||||||
|
End Select
|
||||||
|
Select Case Me.Rotation.Y
|
||||||
|
Case 0, MathHelper.TwoPi
|
||||||
|
Select Case WaterAnimation.CurrentColumn
|
||||||
|
Case 0
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_0")
|
||||||
|
Case 1
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_1")
|
||||||
|
Case 2
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_2")
|
||||||
|
End Select
|
||||||
|
Case MathHelper.Pi * 0.5F
|
||||||
|
Select Case WaterAnimation.CurrentColumn
|
||||||
|
Case 0
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_3")
|
||||||
|
Case 1
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_4")
|
||||||
|
Case 2
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_5")
|
||||||
|
End Select
|
||||||
|
Case MathHelper.Pi
|
||||||
|
Select Case WaterAnimation.CurrentColumn
|
||||||
|
Case 0
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_6")
|
||||||
|
Case 1
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_7")
|
||||||
|
Case 2
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_8")
|
||||||
|
End Select
|
||||||
|
Case MathHelper.Pi * 1.5
|
||||||
|
Select Case WaterAnimation.CurrentColumn
|
||||||
|
Case 0
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_9")
|
||||||
|
Case 1
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_10")
|
||||||
|
Case 2
|
||||||
|
Me.Textures(1) = Waterfall.WaterTexturesTemp(waterTextureName & "_11")
|
||||||
|
End Select
|
||||||
|
End Select
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Public Overrides Sub Render()
|
Public Overrides Sub Render()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user