diff --git a/commandline.cpp b/commandline.cpp index fd495d79..c8d366bb 100644 --- a/commandline.cpp +++ b/commandline.cpp @@ -142,7 +142,7 @@ int arg::readCommon() { PHASE(3); drawscreen(); } else if(argis("-rotate")) { - PHASE(3); + PHASE(3); start_game(); shift(); ld a = argf(); shift(); ld b = argf(); View = View * spin(M_PI * 2 * a / b); diff --git a/config.cpp b/config.cpp index 488de1b2..9aacc08e 100644 --- a/config.cpp +++ b/config.cpp @@ -1761,18 +1761,23 @@ int read_config_args() { shift(); vid.aurasmoothen = argi(); } else if(argis("-nofps")) { + PHASEFROM(2); nofps = true; } else if(argis("-nohud")) { + PHASEFROM(2); nohud = true; } else if(argis("-nomenu")) { + PHASEFROM(2); nomenukey = true; } else if(argis("-nohelp")) { + PHASEFROM(2); nohelp = true; } else if(argis("-dont_face_pc")) { + PHASEFROM(2); dont_face_pc = true; } diff --git a/polygons.cpp b/polygons.cpp index 730e180a..111bf61b 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -443,7 +443,7 @@ void glflush() { if(isize(text_vertices)) { // printf("%08X | %d texts, %d vertices\n", text_color, texts_merged, isize(text_vertices)); - current_display->set_projection(0, false); + if(!svg::in) current_display->set_projection(0, false); glhr::be_textured(); glBindTexture(GL_TEXTURE_2D, text_texture); glhr::color2(text_color); @@ -462,7 +462,7 @@ void glflush() { GLERR("print"); } - if(current_display->stereo_active() && text_shift) current_display->set_mask(0); + if(current_display->stereo_active() && text_shift && !svg::in) current_display->set_mask(0); texts_merged = 0; text_vertices.clear(); diff --git a/screenshot.cpp b/screenshot.cpp index 9078fb07..1eabb294 100644 --- a/screenshot.cpp +++ b/screenshot.cpp @@ -181,7 +181,7 @@ namespace svg { x.document.close(); }, f.s.c_str()); #else - fclose(f.f); + fclose(f.f); f.f = NULL; #endif } @@ -203,7 +203,8 @@ int read_args() { else if(argis("-svgshot")) { PHASE(3); shift(); start_game(); printf("saving SVG screenshot to %s\n", argcs()); - svg::render(argcs()); + shot::make_svg = true; + shot::take(argcs()); } else return 1; return 0; @@ -321,6 +322,7 @@ void take(string fname, const function& what) { vid.xres = shotx * multiplier; vid.yres = shoty * multiplier; calcparam(); + conformal::configure(); if(make_svg) { #if CAP_SVG @@ -378,6 +380,9 @@ int png_read_args() { else if(argis("-pngformat")) { shift(); shotformat = argi(); } + else if(argis("-shotxy")) { + shift(); shotformat = -1; shotx = argi(); shift(); shoty = argi(); + } else if(argis("-shott")) { shift(); shot::transparent = argi(); } diff --git a/shaders.cpp b/shaders.cpp index 651185f4..38bba15e 100644 --- a/shaders.cpp +++ b/shaders.cpp @@ -305,6 +305,7 @@ bool operator != (const glmatrix& m1, const glmatrix& m2) { } void set_modelview(const glmatrix& modelview) { + if(!current) return; if(current_shader_projection != shader_projection::standard) { if(modelview != current_modelview) { current_modelview = modelview; @@ -328,6 +329,7 @@ void set_modelview(const glmatrix& modelview) { } void id_modelview() { + if(!current) return; if(current_shader_projection != shader_projection::standard) { set_modelview(id); return; } #if MINIMIZE_GL_CALLS if(projection == current_matrix) return; @@ -344,6 +346,7 @@ void color2(color_t color, ld part) { for(int i=0; i<4; i++) cols[i] = c[3-i] / 255.0 * part; #if CAP_SHADER // glUniform4fv(current->uFog, 4, cols); + if(!current) return; glUniform4f(current->uColor, cols[0], cols[1], cols[2], cols[3]); #else glColor4f(cols[0], cols[1], cols[2], cols[3]);