diff --git a/P3D/Content/Textures/Backdrops/Water.png b/P3D/Content/Textures/Backdrops/Water.png index 21dd68079..d3d7b49c5 100644 Binary files a/P3D/Content/Textures/Backdrops/Water.png and b/P3D/Content/Textures/Backdrops/Water.png differ diff --git a/P3D/Entites/Enviroment/Water.vb b/P3D/Entites/Enviroment/Water.vb index 1a507a070..c40160eb9 100644 --- a/P3D/Entites/Enviroment/Water.vb +++ b/P3D/Entites/Enviroment/Water.vb @@ -8,10 +8,12 @@ Dim WaterAnimation As Animation Dim currentRectangle As New Rectangle(0, 0, 0, 0) + Public Shared Property WaterSpeed As Integer = 8 + Public Overrides Sub Initialize() MyBase.Initialize() - WaterAnimation = New Animation(TextureManager.GetTexture("Textures\Routes"), 1, 3, 16, 16, 9, 15, 0) + WaterAnimation = New Animation(TextureManager.GetTexture("Textures\Routes"), 1, 3, 16, 16, WaterSpeed, 15, 0) CreateWaterTextureTemp() End Sub @@ -161,7 +163,7 @@ Public Overrides Sub UpdateEntity() If Not WaterAnimation Is Nothing Then - WaterAnimation.Update(0.01) + WaterAnimation.Update(0.005) If currentRectangle <> WaterAnimation.TextureRectangle Then ChangeTexture() diff --git a/P3D/Overworld/BackdropRenderer.vb b/P3D/Overworld/BackdropRenderer.vb index 4b944c503..54d274600 100644 --- a/P3D/Overworld/BackdropRenderer.vb +++ b/P3D/Overworld/BackdropRenderer.vb @@ -23,7 +23,7 @@ Dim tempRasterizer = GraphicsDevice.RasterizerState GraphicsDevice.RasterizerState = RasterizerState.CullNone - GraphicsDevice.SamplerStates(0) = New SamplerState() With {.AddressU = TextureAddressMode.Wrap, .AddressV = TextureAddressMode.Wrap} + GraphicsDevice.SamplerStates(0) = New SamplerState() With {.Filter = TextureFilter.Point, .AddressU = TextureAddressMode.Wrap, .AddressV = TextureAddressMode.Wrap} For Each b As Backdrop In Me._backdrops b.Draw({0, 1, 3, 2, 3, 0}) @@ -75,11 +75,12 @@ Private _position As Vector3 Private _rotation As Vector3 Private _shader As Effect - Private _width As Integer = 0 Private _height As Integer = 0 - Private _waterAnimationDelay As Single = 1.0F + Dim WaterAnimation As Animation + + Private _waterAnimationDelay As Single = CSng(1 / Water.WaterSpeed) Private _waterAnimationIndex As Integer = 0 Private _setTexture As Boolean = False @@ -106,7 +107,8 @@ Select Case BackdropType.ToLower() Case "water" Me._backdropType = BackdropTypes.Water - _backdropTexture = TextureManager.GetTexture("Backdrops\Water", New Rectangle(0, 0, 64, 64)) + WaterAnimation = New Animation(TextureManager.GetTexture("Textures\Backdrops\Water"), 1, 3, 64, 64, Water.WaterSpeed, 0, 0) + _backdropTexture = TextureManager.GetTexture("Textures\Backdrops\Water", WaterAnimation.TextureRectangle, "") Case "grass" Me._backdropType = BackdropTypes.Grass Case "texture" @@ -121,16 +123,11 @@ Select Case Me._backdropType Case BackdropTypes.Water - _waterAnimationDelay -= 0.1F - If _waterAnimationDelay <= 0.0F Then - _waterAnimationDelay = 1.0F - - _waterAnimationIndex += 1 - If _waterAnimationIndex = 3 Then - _waterAnimationIndex = 0 + If Core.GameOptions.GraphicStyle = 1 Then + If Not WaterAnimation Is Nothing Then + WaterAnimation.Update(0.005) + _backdropTexture = TextureManager.GetTexture("Textures\Backdrops\Water", WaterAnimation.TextureRectangle, "") End If - - _backdropTexture = TextureManager.GetTexture("Backdrops\Water", New Rectangle(64 * _waterAnimationIndex, 0, 64, 64)) End If Case BackdropTypes.Grass If Me._setTexture = False Then diff --git a/P3D/Resources/ContentPackManager.vb b/P3D/Resources/ContentPackManager.vb index 93d58e9da..13b992a9f 100644 --- a/P3D/Resources/ContentPackManager.vb +++ b/P3D/Resources/ContentPackManager.vb @@ -9,27 +9,31 @@ If System.IO.File.Exists(ContentPackFile) = True Then Dim Lines() As String = System.IO.File.ReadAllLines(ContentPackFile) For Each Line As String In Lines - Select Case Line.CountSplits("|") - Case 2 'ResolutionChange - Dim TextureName As String = Line.GetSplit(0, "|") - Dim Resolution As Single = CSng(Line.GetSplit(1, "|").Replace(".", GameController.DecSeparator)) + If Line.GetSplit(0, "|").ToLower = "waterspeed" Then + Water.WaterSpeed = CInt(Line.GetSplit(1, "|")) + Else + Select Case Line.CountSplits("|") + Case 2 'ResolutionChange + Dim TextureName As String = Line.GetSplit(0, "|") + Dim Resolution As Single = CSng(Line.GetSplit(1, "|").Replace(".", GameController.DecSeparator)) - If TextureResolutions.ContainsKey(TextureName) = False Then - TextureResolutions.Add(TextureName, Resolution) - End If - Case 4 'TextureReplacement - Dim oldTextureName As String = Line.GetSplit(0, "|") - Dim newTextureName As String = Line.GetSplit(2, "|") - Dim oRS As String = Line.GetSplit(1, "|") 'oRS = oldRectangleSource - Dim nRS As String = Line.GetSplit(3, "|") 'nRS = newRectangleSource + If TextureResolutions.ContainsKey(TextureName) = False Then + TextureResolutions.Add(TextureName, Resolution) + End If + Case 4 'TextureReplacement + Dim oldTextureName As String = Line.GetSplit(0, "|") + Dim newTextureName As String = Line.GetSplit(2, "|") + Dim oRS As String = Line.GetSplit(1, "|") 'oRS = oldRectangleSource + Dim nRS As String = Line.GetSplit(3, "|") 'nRS = newRectangleSource - Dim oldTextureSource As New TextureSource(oldTextureName, New Rectangle(CInt(oRS.GetSplit(0)), CInt(oRS.GetSplit(1)), CInt(oRS.GetSplit(2)), CInt(oRS.GetSplit(3)))) - Dim newTextureSource As New TextureSource(newTextureName, New Rectangle(CInt(nRS.GetSplit(0)), CInt(nRS.GetSplit(1)), CInt(nRS.GetSplit(2)), CInt(nRS.GetSplit(3)))) + Dim oldTextureSource As New TextureSource(oldTextureName, New Rectangle(CInt(oRS.GetSplit(0)), CInt(oRS.GetSplit(1)), CInt(oRS.GetSplit(2)), CInt(oRS.GetSplit(3)))) + Dim newTextureSource As New TextureSource(newTextureName, New Rectangle(CInt(nRS.GetSplit(0)), CInt(nRS.GetSplit(1)), CInt(nRS.GetSplit(2)), CInt(nRS.GetSplit(3)))) - If TextureReplacements.ContainsKey(oldTextureSource) = False Then - TextureReplacements.Add(oldTextureSource, newTextureSource) - End If - End Select + If TextureReplacements.ContainsKey(oldTextureSource) = False Then + TextureReplacements.Add(oldTextureSource, newTextureSource) + End If + End Select + End If Next End If End If diff --git a/P3D/Screens/NewOptionScreen.vb b/P3D/Screens/NewOptionScreen.vb index 85c2d327c..44f75d5fd 100644 --- a/P3D/Screens/NewOptionScreen.vb +++ b/P3D/Screens/NewOptionScreen.vb @@ -504,6 +504,7 @@ Core.GameOptions.SaveOptions() MusicManager.PlayNoMusic() ContentPackManager.Clear() + Water.WaterSpeed = 8 For Each s As String In Core.GameOptions.ContentPackNames ContentPackManager.Load(GameController.GamePath & "\ContentPacks\" & s & "\exceptions.dat") Next