public void SpriteVertices_AreNotReuploaded_OnceSpriteHasBeenRemovedFromBatch() { var sprite = new Sprite(spriteSheet.Object.GetRegion(0), 10, 10); spriteBatch.Add(sprite); vbo.ResetCalls(); spriteBatch.Remove(sprite); sprite.Modify((s) => s.X = 80); vbo.Verify( v => v.FillPartial(It.IsAny<IntPtr>(), It.IsAny<IntPtr>(), sprite.Vertices), Times.Never ); }
public void SpriteHandlers_AreRemovedFromBatch_OnDisposal() { var sprite = new Sprite(spriteSheet.Object.GetRegion(0), 10, 10); var sprite2 = new Sprite(spriteSheet.Object.GetRegion(1), 20, 10); spriteBatch.Add(sprite, sprite2); vbo.ResetCalls(); spriteBatch.Dispose(); sprite.Modify((s) => s.Width = 100); sprite2.Modify((s) => s.Colour = Colour4.ForestGreen); vbo.Verify( (v) => v.FillPartial(It.IsAny<IntPtr>(), It.IsAny<IntPtr>(), It.IsAny<VertexPositionColourTexture[]>()), Times.Never ); }
public void SpriteVertices_AreReuploaded_WhenSpriteHasBeenModified() { var sprite = new Sprite(spriteSheet.Object.GetRegion(0), 10, 10); spriteBatch.Add(sprite); vbo.ResetCalls(); sprite.Modify((s) => { s.X = 80; s.Y = 160; }); vbo.Verify( v => v.FillPartial(It.IsAny<IntPtr>(), It.IsAny<IntPtr>(), sprite.Vertices), Times.Once ); }