Merge remote-tracking branch 'origin/main'

This commit is contained in:
Ivan Filipenkov 2023-08-14 18:49:50 +03:00
commit 503eb9f063

View file

@ -13,15 +13,15 @@ namespace DangerousD.GameCore.Graphics
private List<Texture2D> textures; private List<Texture2D> textures;
private List<string> texturesNames; private List<string> texturesNames;
private AnimationContainer currentAnimation; private AnimationContainer currentAnimation;
private SpriteBatch _spriteBatch; //private SpriteBatch _spriteBatch;
private string lastAnimationId; private string lastAnimationId;
private int currentFrame; private int currentFrame;
private int interval; private int interval;
private int lastInterval; private int lastInterval;
private Rectangle sourceRectangle; private Rectangle sourceRectangle;
public GraphicsComponent(List<string> animationsId, SpriteBatch _spriteBatch) public GraphicsComponent(List<string> animationsId)
{ {
this._spriteBatch = _spriteBatch; //this._spriteBatch = _spriteBatch;
currentFrame = 0; currentFrame = 0;
lastInterval = 1; lastInterval = 1;
lastAnimationId = null; lastAnimationId = null;
@ -52,7 +52,7 @@ namespace DangerousD.GameCore.Graphics
} }
} }
} }
public void DrawAnimation(Rectangle destinationRectangle, string animationId) public void DrawAnimation(Rectangle destinationRectangle, string animationId, SpriteBatch _spriteBatch)
{ {
if (animationId != lastAnimationId) if (animationId != lastAnimationId)