mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	fixed some issues with commandline arguments (svg shots made correctly from cli)
This commit is contained in:
		| @@ -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); | ||||
|   | ||||
| @@ -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; | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -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(); | ||||
|   | ||||
| @@ -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<void()>& 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(); | ||||
|     } | ||||
|   | ||||
| @@ -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]); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue