mirror of
https://github.com/Pathoschild/SMAPI.git
synced 2026-10-12 02:08:51 +00:00
Optimize map edits by skipping expensive tile index property copies
This commit is contained in:
@@ -8,6 +8,7 @@ using StardewValley;
|
||||
using xTile;
|
||||
using xTile.Dimensions;
|
||||
using xTile.Layers;
|
||||
using xTile.ObjectModel;
|
||||
using xTile.Tiles;
|
||||
using Rectangle = Microsoft.Xna.Framework.Rectangle;
|
||||
|
||||
@@ -90,8 +91,7 @@ internal class AssetDataForMap : AssetData<Map>, IAssetDataForMap
|
||||
|
||||
// add tilesheet
|
||||
targetSheet = new TileSheet(id, target, sourceSheet.ImageSource, sourceSheet.SheetSize, sourceSheet.TileSize);
|
||||
for (int i = 0, tileCount = sourceSheet.TileCount; i < tileCount; ++i)
|
||||
targetSheet.TileIndexProperties[i].CopyFrom(sourceSheet.TileIndexProperties[i]);
|
||||
this.Reflection.GetField<PropertyCollection>(targetSheet, "m_propertyCollection").SetValue((PropertyCollection)sourceSheet.Properties);
|
||||
target.AddTileSheet(targetSheet);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user