Some more bfxfnt fixes with gx2. Also fix the character selector

This commit is contained in:
KillzXGaming 2020-03-23 20:38:39 -04:00
parent c9ea004446
commit 446568f641
2 changed files with 14 additions and 8 deletions

View file

@ -27,10 +27,10 @@ namespace FirstPlugin
Format = ConvertToGeneric(BFNTFormat);
if (Format == TEX_FORMAT.BC4_UNORM)
{
RedChannel = STChannelType.One;
/* RedChannel = STChannelType.One;
GreenChannel = STChannelType.One;
BlueChannel = STChannelType.One;
AlphaChannel = STChannelType.Red;
AlphaChannel = STChannelType.Red;*/
}
ImageKey = "Texture";
@ -78,7 +78,15 @@ namespace FirstPlugin
Width = ftex.texture.Width;
Height = ftex.texture.Height;
UpdateEditor();
if (Format == TEX_FORMAT.BC4_UNORM)
{
/* RedChannel = STChannelType.One;
GreenChannel = STChannelType.One;
BlueChannel = STChannelType.One;
AlphaChannel = STChannelType.Red;*/
}
// UpdateEditor();
}
}

View file

@ -289,12 +289,13 @@ namespace FirstPlugin.Forms
PanelImage = BitmapExtension.Resize(PanelImage, textureGlyph.SheetWidth, textureGlyph.SheetHeight);
int y = 0;
for (int c = 0; c < (int)textureGlyph.ColumnCount; c++)
{
int x = 0;
for (int r = 0; r < (int)textureGlyph.RowCount; r++)
{
int x = r * textureGlyph.CellWidth;
int y = c * textureGlyph.CellHeight;
var rect = new Rectangle(x, y, textureGlyph.CellWidth, textureGlyph.CellHeight);
Cells.Add(new FontCell()
@ -307,10 +308,7 @@ namespace FirstPlugin.Forms
glyphImage.Image.Save($"Glpyh{c} {r}.png");
images.Add(glyphImage);*/
x += (int)textureGlyph.CellWidth;
}
y += (int)textureGlyph.CellHeight;
}
GlyphImages = images.ToArray();