Fixed editor bug - need to laod fonts before loading imagesets now

This commit is contained in:
Rob Pearce 2008-10-15 05:20:47 +00:00
parent 9ad9277585
commit 6b33fbe7de
1 changed files with 11 additions and 10 deletions

21
edit.c
View File

@ -142,6 +142,17 @@ int main (int argc, char **argv) {
screen = SDL_SetVideoMode(EDITORW,EDITORH,16,SDL_SWSURFACE|SDL_DOUBLEBUF|vidargs); screen = SDL_SetVideoMode(EDITORW,EDITORH,16,SDL_SWSURFACE|SDL_DOUBLEBUF|vidargs);
#endif #endif
/* load fonts */
TTF_Init();
sprintf(filename, "%s/editfont.ttf",datadir);
for (i = 1; i < MAXLETTERHEIGHT; i++) {
font[i] = TTF_OpenFont(filename,i);
if (!font[i]) {
printf("Error opening font: %s\n", TTF_GetError());
return 1;
}
}
/* init tiles */ /* init tiles */
if (loadtiletypes("green.tiles")) { if (loadtiletypes("green.tiles")) {
printf("Cannot initialise tiles\n"); printf("Cannot initialise tiles\n");
@ -179,16 +190,6 @@ int main (int argc, char **argv) {
/* load fonts */
TTF_Init();
sprintf(filename, "%s/editfont.ttf",datadir);
for (i = 1; i < MAXLETTERHEIGHT; i++) {
font[i] = TTF_OpenFont(filename,i);
if (!font[i]) {
printf("Error opening font: %s\n", TTF_GetError());
return 1;
}
}
state = LS_EDIT; state = LS_EDIT;