/// <summary> /// Update surface to new bitmap /// </summary> /// <param name="bmp">Bitmap which used to update surface</param> public void UpdateFromBitmap(Bitmap bmp) { if (pendingUpdateIndexs != null && LastFrame != null) { foreach (TileIndex index in pendingUpdateIndexs) { LastFrame.UpdateTileRgb(index, CurrentFrame.GetRgbTile(index)); } } else { LastFrame = CurrentFrame; } CurrentFrame = SurfaceFrame.GetFromImage(Id, bmp); pendingUpdateIndexs = CurrentFrame.GetAllIndexes(); }