Fixed water scroll speed
This commit is contained in:
@@ -134,6 +134,14 @@ namespace Barotrauma
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Update()
|
||||||
|
{
|
||||||
|
if (Hull.renderer != null)
|
||||||
|
{
|
||||||
|
Hull.renderer.ScrollWater();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool drawn;
|
bool drawn;
|
||||||
public IEnumerable<object> DoLoading(IEnumerable<object> loader)
|
public IEnumerable<object> DoLoading(IEnumerable<object> loader)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -308,7 +308,11 @@ namespace Barotrauma
|
|||||||
|
|
||||||
bool paused = false;
|
bool paused = false;
|
||||||
|
|
||||||
if (hasLoaded && !titleScreenOpen)
|
if (titleScreenOpen)
|
||||||
|
{
|
||||||
|
TitleScreen.Update();
|
||||||
|
}
|
||||||
|
else if (hasLoaded)
|
||||||
{
|
{
|
||||||
SoundPlayer.Update();
|
SoundPlayer.Update();
|
||||||
|
|
||||||
|
|||||||
@@ -64,9 +64,6 @@ namespace Barotrauma
|
|||||||
waterEffect.Parameters["xBlurDistance"].SetValue(blurAmount);
|
waterEffect.Parameters["xBlurDistance"].SetValue(blurAmount);
|
||||||
//waterEffect.CurrentTechnique.Passes[0].Apply();
|
//waterEffect.CurrentTechnique.Passes[0].Apply();
|
||||||
|
|
||||||
wavePos.X += 0.0001f;
|
|
||||||
wavePos.Y += 0.0001f;
|
|
||||||
|
|
||||||
#if WINDOWS
|
#if WINDOWS
|
||||||
waterEffect.Parameters["xTexture"].SetValue(texture);
|
waterEffect.Parameters["xTexture"].SetValue(texture);
|
||||||
spriteBatch.Draw(waterTexture, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
|
spriteBatch.Draw(waterTexture, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), Color.White);
|
||||||
@@ -77,6 +74,12 @@ namespace Barotrauma
|
|||||||
spriteBatch.End();
|
spriteBatch.End();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ScrollWater()
|
||||||
|
{
|
||||||
|
wavePos.X += 0.0001f;
|
||||||
|
wavePos.Y += 0.0001f;
|
||||||
|
}
|
||||||
|
|
||||||
public void Render(GraphicsDevice graphicsDevice, Camera cam, RenderTarget2D texture, Matrix transform)
|
public void Render(GraphicsDevice graphicsDevice, Camera cam, RenderTarget2D texture, Matrix transform)
|
||||||
{
|
{
|
||||||
if (vertices == null) return;
|
if (vertices == null) return;
|
||||||
|
|||||||
@@ -83,6 +83,11 @@ namespace Barotrauma
|
|||||||
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
/// <param name="gameTime">Provides a snapshot of timing values.</param>
|
||||||
public override void Update(double deltaTime)
|
public override void Update(double deltaTime)
|
||||||
{
|
{
|
||||||
|
if (Hull.renderer != null)
|
||||||
|
{
|
||||||
|
Hull.renderer.ScrollWater();
|
||||||
|
}
|
||||||
|
|
||||||
//the accumulator code is based on this article:
|
//the accumulator code is based on this article:
|
||||||
//http://gafferongames.com/game-physics/fix-your-timestep/
|
//http://gafferongames.com/game-physics/fix-your-timestep/
|
||||||
Physics.accumulator += deltaTime;
|
Physics.accumulator += deltaTime;
|
||||||
|
|||||||
@@ -490,6 +490,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public override void Update(double deltaTime)
|
public override void Update(double deltaTime)
|
||||||
{
|
{
|
||||||
|
GameMain.TitleScreen.Update();
|
||||||
|
|
||||||
foreach (GUIButton button in menuButtons)
|
foreach (GUIButton button in menuButtons)
|
||||||
{
|
{
|
||||||
button.Update((float)deltaTime);
|
button.Update((float)deltaTime);
|
||||||
|
|||||||
@@ -336,6 +336,8 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public override void Update(double deltaTime)
|
public override void Update(double deltaTime)
|
||||||
{
|
{
|
||||||
|
GameMain.TitleScreen.Update();
|
||||||
|
|
||||||
menu.Update((float)deltaTime);
|
menu.Update((float)deltaTime);
|
||||||
|
|
||||||
GUI.Update((float)deltaTime);
|
GUI.Update((float)deltaTime);
|
||||||
|
|||||||
Reference in New Issue
Block a user