Water tile fix. More info below:

Water tile now support multiple rectangle in one texture. As such, this fix the ability to use multiple water texture in the game.
This commit is contained in:
jianmingyong 2016-11-11 15:50:41 +08:00
parent 1524fbadce
commit db9b3ed673
1 changed files with 27 additions and 27 deletions

View File

@ -11,7 +11,7 @@
Public Overrides Sub Initialize()
MyBase.Initialize()
WaterAnimation = New Animation(net.Pokemon3D.Game.TextureManager.GetTexture("Textures\Routes"), 1, 3, 16, 16, 9, 15, 0)
WaterAnimation = New Animation(TextureManager.GetTexture("Textures\Routes"), 1, 3, 16, 16, 9, 15, 0)
CreateWaterTextureTemp()
End Sub
@ -26,35 +26,35 @@
If textureData.Count >= 5 Then
Dim r As New Rectangle(CInt(textureData(1)), CInt(textureData(2)), CInt(textureData(3)), CInt(textureData(4)))
Dim texturePath As String = textureData(0)
Me.waterTextureName = texturePath
If Water.WaterTexturesTemp.ContainsKey(texturePath & "_0") = False Then
Water.WaterTexturesTemp.Add(texturePath & "_0", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_1", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_2", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 2, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_3", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 3, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_4", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 4, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_5", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 5, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_6", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 6, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_7", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 7, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_8", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 8, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_9", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 9, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_10", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 10, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(texturePath & "_11", net.Pokemon3D.Game.TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 11, r.Y, r.Width, r.Height)))
Me.waterTextureName = AdditionalValue
If Water.WaterTexturesTemp.ContainsKey(texturePath & r.ToString() & "_0") = False Then
Water.WaterTexturesTemp.Add(AdditionalValue & "_0", TextureManager.GetTexture(texturePath, New Rectangle(r.X, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_1", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_2", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 2, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_3", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 3, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_4", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 4, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_5", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 5, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_6", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 6, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_7", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 7, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_8", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 8, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_9", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 9, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_10", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 10, r.Y, r.Width, r.Height)))
Water.WaterTexturesTemp.Add(AdditionalValue & "_11", TextureManager.GetTexture(texturePath, New Rectangle(r.X + r.Width * 11, r.Y, r.Width, r.Height)))
End If
Else
If Water.WaterTexturesTemp.ContainsKey("_0") = False Then
Water.WaterTexturesTemp.Add("_0", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(0, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_1", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(20, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_2", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(40, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_3", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(60, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_4", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(80, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_5", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(100, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_6", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(120, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_7", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(140, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_8", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(160, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_9", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(180, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_10", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(200, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_11", net.Pokemon3D.Game.TextureManager.GetTexture("Routes", New Rectangle(220, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_0", TextureManager.GetTexture("Routes", New Rectangle(0, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_1", TextureManager.GetTexture("Routes", New Rectangle(20, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_2", TextureManager.GetTexture("Routes", New Rectangle(40, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_3", TextureManager.GetTexture("Routes", New Rectangle(60, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_4", TextureManager.GetTexture("Routes", New Rectangle(80, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_5", TextureManager.GetTexture("Routes", New Rectangle(100, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_6", TextureManager.GetTexture("Routes", New Rectangle(120, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_7", TextureManager.GetTexture("Routes", New Rectangle(140, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_8", TextureManager.GetTexture("Routes", New Rectangle(160, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_9", TextureManager.GetTexture("Routes", New Rectangle(180, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_10", TextureManager.GetTexture("Routes", New Rectangle(200, 220, 20, 20)))
Water.WaterTexturesTemp.Add("_11", TextureManager.GetTexture("Routes", New Rectangle(220, 220, 20, 20)))
End If
End If
End If