summaryrefslogtreecommitdiff
path: root/Util.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Util.cs')
-rw-r--r--Util.cs47
1 files changed, 25 insertions, 22 deletions
diff --git a/Util.cs b/Util.cs
index 314cc3d..4589775 100644
--- a/Util.cs
+++ b/Util.cs
@@ -22,6 +22,7 @@ using System.Windows.Forms;
using System.Text;
using System.IO;
using System.Drawing;
+using System.Diagnostics;
namespace BitmapFontEd
{
@@ -53,19 +54,6 @@ namespace BitmapFontEd
MessageBoxButtons.OK,MessageBoxIcon.Information);
}
- public static uint ReadUint(Stream str)
- {
- uint l=0;
-
- for(int f=0;f<4;f++)
- {
- int b=str.ReadByte();
- l|=(uint)(b<<(f*8));
- }
-
- return l;
- }
-
public static int ReadInt(Stream str)
{
int l=0;
@@ -79,15 +67,6 @@ namespace BitmapFontEd
return l;
}
- public static void WriteUint(Stream str, uint l)
- {
- for(uint f=0;f<4;f++)
- {
- str.WriteByte((byte)(l&0xff));
- l=l>>8;
- }
- }
-
public static void WriteInt(Stream str, int l)
{
for(uint f=0;f<4;f++)
@@ -111,6 +90,30 @@ namespace BitmapFontEd
str.Read(b,0,len);
return Encoding.ASCII.GetString(b);
}
+
+ public static void DumpAlpha(string title, Color[,] col)
+ {
+ Debug.WriteLine("**** "+title+" ****");
+
+ for(int y=0;y<col.GetLength(1);y++)
+ {
+ string s="";
+
+ for(int x=0;x<col.GetLength(0);x++)
+ {
+ if (col[x,y].A==0)
+ {
+ s+=".";
+ }
+ else
+ {
+ s+=Encoding.ASCII.GetString(new byte[] {(byte)(65+col[x,y].A/10)});
+ }
+ }
+
+ Debug.WriteLine(s);
+ }
+ }
private Util()
{