diff options
-rw-r--r-- | bitmapfont.mod/bitmapfont.bmx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bitmapfont.mod/bitmapfont.bmx b/bitmapfont.mod/bitmapfont.bmx index 86c29f8..56a36ad 100644 --- a/bitmapfont.mod/bitmapfont.bmx +++ b/bitmapfont.mod/bitmapfont.bmx @@ -14,7 +14,7 @@ Strict Type BitmapFont - Const NOCHR=96 + Const NOCHR=95 Field img:TImage[NOCHR] Field height:Int[NOCHR] @@ -24,6 +24,7 @@ Type BitmapFont Function Load:BitmapFont(path:String) Local fnt:BitmapFont Local str:TStream + Local magic:String Local f,x,y Local r,g,b @@ -33,6 +34,13 @@ Type BitmapFont fnt=New BitmapFont + magic=ReadString(str,4) + + If (magic<>"BMF1") + CloseStream(str) + Return Null + EndIf + fnt.is_fixed=Readint(str) GetMaskColor(r,g,b) |