X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fmain.h;fp=src%2Fmain.h;h=d7945e6f8b3d29bcfa62620267b5937c681698c3;hp=bd43c12ec60710b50c15bef39905b8355a7abb78;hb=c786732a062b493be1e53c0223d7cb1858fd3d0f;hpb=180d764223a3568f734434a15d56f18e9ddc012b diff --git a/src/main.h b/src/main.h index bd43c12..d7945e6 100644 --- a/src/main.h +++ b/src/main.h @@ -77,16 +77,25 @@ void RatCatcher(int x, int y, int buttons, int wheel, Screen * scr, View * view) void MainLoop(Document & doc, Screen & scr, View & view, int max_frames = -1) { // order is important... segfaults occur when screen (which inits GL) is not constructed first -_- - DebugScript script; + scr.DebugFontInit("fonts/DejaVuSansMono.ttf", 12); //scr.DebugFontInit("fonts/DejaVuSansMono.ttf", 18); scr.SetMouseHandler(RatCatcher); - if (script_filename) + ifstream tmp; + istream * script_input = NULL; + if (script_filename != NULL) { - script.Load(script_filename); + if (strcmp(script_filename, "stdin") == 0) + script_input = &cin; + else + { + tmp.open(script_filename); + script_input = &tmp; + } } + DebugScript script(script_input); double total_cpu_time = 0; double total_gpu_time = 0;