diff --git a/basegraph.cpp b/basegraph.cpp index c3b9fa2e..defc3f5b 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -55,9 +55,12 @@ int qpixel3(SDL_Surface *surf, int x, int y) { #endif #if CAP_SDLTTF + +string fontpath = ISWEB ? "sans-serif" : HYPERPATH "DejaVuSans-Bold.ttf"; + void loadfont(int siz) { if(!font[siz]) { - font[siz] = TTF_OpenFont(ISWEB ? "sans-serif" : HYPERPATH "DejaVuSans-Bold.ttf", siz); + font[siz] = TTF_OpenFont(fontpath.c_str(), siz); // Destination set by ./configure (in the GitHub repository) #ifdef FONTDESTDIR if (font[siz] == NULL) { @@ -65,7 +68,7 @@ void loadfont(int siz) { } #endif if (font[siz] == NULL) { - printf("error: Font file not found\n"); + printf("error: Font file not found: %s\n", fontpath.c_str()); exit(1); } } diff --git a/commandline.cpp b/commandline.cpp index 7f684ca8..a16c9a63 100644 --- a/commandline.cpp +++ b/commandline.cpp @@ -67,6 +67,7 @@ int arg::readCommon() { else if(argis("-lev")) { shift(); levelfile = args(); } else if(argis("-pic")) { shift(); picfile = args(); } else if(argis("-load")) { PHASE(3); shift(); mapstream::loadMap(args()); } + else if(argis("-font")) { PHASE(1); shift(); fontpath = args(); } else if(argis("-picload")) { PHASE(3); shift(); mapeditor::loadPicFile(args()); } #endif else if(argis("-canvas")) { @@ -302,6 +303,12 @@ else if(args()[0] == '-' && args()[1] == x && args()[2] == '0') { showstartmenu else if(argis("--run")) { PHASE(3); mainloop(); quitmainloop = false; } + else if(argis("--msg")) { + shift(); addMessage(args()); + } + else if(argis("--msg0")) { + clearMessages(); + } #if CAP_TOUR else if(argis("--tour")) { PHASE(3); tour::start();