Diffstat (limited to 'noncore/games/sfcave-sdl/bfont.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/sfcave-sdl/bfont.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/games/sfcave-sdl/bfont.cpp b/noncore/games/sfcave-sdl/bfont.cpp index 7dec8f5..3ba0f4f 100644 --- a/noncore/games/sfcave-sdl/bfont.cpp +++ b/noncore/games/sfcave-sdl/bfont.cpp | |||
@@ -1,36 +1,36 @@ | |||
1 | /***********************************************************/ | 1 | /***********************************************************/ |
2 | /* */ | 2 | /* */ |
3 | /* BFONT.c v. 1.0.2 - Billi Font Library by Diego Billi */ | 3 | /* BFONT.c v. 1.0.2 - Billi Font Library by Diego Billi */ |
4 | /* BFONT++ C++ port by Gianluigi Davassi */ | 4 | /* BFONT++ C++ port by Gianluigi Davassi */ |
5 | /***********************************************************/ | 5 | /***********************************************************/ |
6 | #include "iostream" | 6 | #include "iostream" |
7 | using namespace std; | 7 | using namespace std; |
8 | #include "string.h" | 8 | #include "string.h" |
9 | #include "stdlib.h" | 9 | #include "stdlib.h" |
10 | #include "stdarg.h" | 10 | #include "stdarg.h" |
11 | 11 | ||
12 | #include "SDL_image.h" | 12 | #include <SDL/SDL_image.h> |
13 | #include "bfont.h" | 13 | #include "bfont.h" |
14 | 14 | ||
15 | void BFont::InitFont() | 15 | void BFont::InitFont() |
16 | { | 16 | { |
17 | int x = 0, i = '!'; | 17 | int x = 0, i = '!'; |
18 | Uint32 sentry = GetPixel(0,0); | 18 | Uint32 sentry = GetPixel(0,0); |
19 | 19 | ||
20 | if (SDL_MUSTLOCK(Surface)) | 20 | if (SDL_MUSTLOCK(Surface)) |
21 | SDL_LockSurface(Surface); | 21 | SDL_LockSurface(Surface); |
22 | 22 | ||
23 | while ( x < (Surface->w-1)) | 23 | while ( x < (Surface->w-1)) |
24 | { | 24 | { |
25 | if(GetPixel(x,0) != sentry) | 25 | if(GetPixel(x,0) != sentry) |
26 | { | 26 | { |
27 | Chars[i].x = x; | 27 | Chars[i].x = x; |
28 | Chars[i].y = 1; | 28 | Chars[i].y = 1; |
29 | Chars[i].h = Surface->h; | 29 | Chars[i].h = Surface->h; |
30 | for (; GetPixel(x, 0) != sentry && x < (Surface->w); ++x) ; | 30 | for (; GetPixel(x, 0) != sentry && x < (Surface->w); ++x) ; |
31 | Chars[i].w = (x - Chars[i].x); | 31 | Chars[i].w = (x - Chars[i].x); |
32 | i++; | 32 | i++; |
33 | } else | 33 | } else |
34 | { x++; } | 34 | { x++; } |
35 | } | 35 | } |
36 | Chars[' '].x = 0; | 36 | Chars[' '].x = 0; |