Skip to content

Commit

Permalink
Improved handling of switching files between using content pipeline a…
Browse files Browse the repository at this point in the history
…nd not.
  • Loading branch information
vchelaru committed Dec 16, 2023
1 parent 463c715 commit 5f09d5c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions FRBDK/Glue/Glue/Elements/AssetTypeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ public string QualifiedSaveTypeName
Type mSaveType;

public bool MustBeAddedToContentPipeline;
// This was added December 13, 2023. Prior to this date,
// all objects assumed they could be added to content pipeline.
// Therefore, we will set this to true for now to assume that it can
// be, and we can set this to false over time to exclude items that cannot
// be in content pipeline.
public bool CanBeAddedToContentPipeline = true;
public bool ShouldBeDisposed;

public bool CanBeCloned;
Expand Down
4 changes: 2 additions & 2 deletions FRBDK/Glue/NAudioPlugin/Embedded/NAudio_Song.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public bool IsRepeating
public NAudio_Song(string fileName)
{
var fullFile = fileName;
if (FileManager.IsRelative(fullFile))
if (FlatRedBall.IO.FileManager.IsRelative(fullFile))
{
fullFile = FileManager.RelativeDirectory + fileName;
fullFile = FlatRedBall.IO.FileManager.RelativeDirectory + fileName;
}
var extension = FlatRedBall.IO.FileManager.GetExtension(fullFile);
if (extension == "mp3")
Expand Down
1 change: 1 addition & 0 deletions FRBDK/Glue/NAudioPlugin/Managers/AssetTypeInfoManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private static AssetTypeInfo CreateSongAti(string extension)
ati.ContentImporter = null;
ati.ContentProcessor = null;
ati.Extension = extension;
ati.CanBeAddedToContentPipeline = false;
ati.QualifiedRuntimeTypeName = new PlatformSpecificType()
{
QualifiedType = NAudioQualifiedType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,13 @@ public static bool IsBuiltByContentPipeline(ReferencedFileSave file, bool forceP
{
var ati = file.GetAssetTypeInfo();

return IsBuiltByContentPipeline(file.Name, file.UseContentPipeline || ati?.MustBeAddedToContentPipeline == true, forcePngsToContentPipeline);
var supportsContentPipeline = file.UseContentPipeline || ati?.MustBeAddedToContentPipeline == true;
if(supportsContentPipeline && ati != null)
{
supportsContentPipeline = ati.CanBeAddedToContentPipeline;
}

return IsBuiltByContentPipeline(file.Name, supportsContentPipeline, forcePngsToContentPipeline);
}

private static bool IsBuiltByContentPipeline(string fileName, bool rfsUseContentPipeline, bool forcePngsToContentPipeline)
Expand Down

0 comments on commit 5f09d5c

Please sign in to comment.