mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-24 03:56:31 +00:00
8b3c2f0e1b
* Remove logging statement, not needed * Add bmfont texture as dependency * Remove existing instance check, this will always be null * Fix BitmapFontContentReader * Remove TODO comment This was added 8 years ago, and I don't see any determinant to the states being global. * Renamed `Refresh` to `Update` * Added documentation comments * file scoped namespace * Remove unnecessary using * Add file header * Remove obsolete methods and update documentation * file scoped namespace * Remove TODO comment The fields being static is fine. * Renamed `Refersh` to `Update` * Add documentation * file scoped namespace * Add documentation * Remove deprecated methods
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using System;
|
|
using System.IO;
|
|
using Microsoft.Xna.Framework.Content.Pipeline;
|
|
using MonoGame.Extended.Content.BitmapFonts;
|
|
|
|
namespace MonoGame.Extended.Content.Pipeline.BitmapFonts
|
|
{
|
|
[ContentProcessor(DisplayName = "BMFont Processor - MonoGame.Extended")]
|
|
public class BitmapFontProcessor : ContentProcessor<ContentImporterResult<BitmapFontFileContent>, BitmapFontProcessorResult>
|
|
{
|
|
public override BitmapFontProcessorResult Process(ContentImporterResult<BitmapFontFileContent> importerResult, ContentProcessorContext context)
|
|
{
|
|
try
|
|
{
|
|
BitmapFontFileContent bmfFile = importerResult.Data;
|
|
var result = new BitmapFontProcessorResult(bmfFile);
|
|
|
|
foreach (var page in bmfFile.Pages)
|
|
{
|
|
|
|
context.AddDependency(Path.GetFileName(page));
|
|
result.TextureAssets.Add(Path.GetFileNameWithoutExtension(page));
|
|
}
|
|
|
|
return result;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
context.Logger.LogMessage("Error {0}", ex);
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
}
|