-
-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #827 from craftworkgames/fix_tiled_bigobject_tileset
Add support of "Collection of Images" tileset type.
- Loading branch information
Showing
15 changed files
with
131 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/cs/MonoGame.Extended.Content.Pipeline/ContentImporterContextExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System.IO; | ||
using Microsoft.Xna.Framework.Content.Pipeline; | ||
|
||
namespace MonoGame.Extended.Content.Pipeline; | ||
|
||
public static class ContentImporterContextExtensions | ||
{ | ||
public static string AddDependencyWithLogging(this ContentImporterContext context, string filePath, string source) | ||
{ | ||
source = Path.Combine(Path.GetDirectoryName(filePath), source); | ||
ContentLogger.Log($"Adding dependency '{source}'"); | ||
context.AddDependency(source); | ||
return source; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/cs/MonoGame.Extended.Content.Pipeline/Tiled/TiledContentItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using Microsoft.Xna.Framework.Content.Pipeline; | ||
using Microsoft.Xna.Framework.Content.Pipeline.Graphics; | ||
using MonoGame.Extended.Tiled.Serialization; | ||
|
||
namespace MonoGame.Extended.Content.Pipeline.Tiled; | ||
|
||
public class TiledContentItem<T>: ContentItem<T> | ||
{ | ||
public TiledContentItem(T data) : base(data) | ||
{ | ||
} | ||
|
||
public void BuildExternalReference<T>(ContentProcessorContext context, TiledMapImageContent image) | ||
{ | ||
var parameters = new OpaqueDataDictionary | ||
{ | ||
{ "ColorKeyColor", image.TransparentColor }, | ||
{ "ColorKeyEnabled", true } | ||
}; | ||
BuildExternalReference<Texture2DContent>(context, image.Source, parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
src/cs/MonoGame.Extended.Content.Pipeline/Tiled/TiledMapTilesetContentItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
using MonoGame.Extended.Tiled.Serialization; | ||
using Microsoft.Xna.Framework.Content.Pipeline; | ||
using Microsoft.Xna.Framework.Content.Pipeline.Graphics; | ||
using MonoGame.Extended.Tiled.Serialization; | ||
|
||
namespace MonoGame.Extended.Content.Pipeline.Tiled | ||
{ | ||
public class TiledMapTilesetContentItem : ContentItem<TiledMapTilesetContent> | ||
public class TiledMapTilesetContentItem : TiledContentItem<TiledMapTilesetContent> | ||
{ | ||
public TiledMapTilesetContentItem(TiledMapTilesetContent data) | ||
public TiledMapTilesetContentItem(TiledMapTilesetContent data) | ||
: base(data) | ||
{ | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.