From 600287f275063dde1ea6f55fd9aa5247d27256cf Mon Sep 17 00:00:00 2001 From: Ian C Date: Sat, 21 May 2005 02:38:48 +0000 Subject: Changed use of uints to ints (casting was getting silly). Fixed some funnies with edits -- font import now seem to work, somehow. --- Util.cs | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) (limited to 'Util.cs') 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