mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	ray:: hard limit
This commit is contained in:
		| @@ -30,6 +30,10 @@ EX ld minstep = .001; | ||||
|  | ||||
| EX ld reflect_val = 0; | ||||
|  | ||||
| static const int NO_LIMIT = 999999; | ||||
|  | ||||
| EX ld hard_limit = NO_LIMIT; | ||||
|  | ||||
| EX int max_iter_sol = 600, max_iter_iso = 60; | ||||
|  | ||||
| EX int max_cells = 2048; | ||||
| @@ -563,6 +567,9 @@ void enable_raycaster() { | ||||
|       "  vec4 col = texture2D(tWallcolor, u);\n" | ||||
|       "  if(col[3] > 0.0) {\n"; | ||||
|  | ||||
|     if(hard_limit < NO_LIMIT) | ||||
|       fmain += "    if(go > float(" + fts(hard_limit) + ")) { gl_FragDepth = 1.; return; }\n"; | ||||
|      | ||||
|     if(!(levellines && disable_texture)) fmain += | ||||
|       "    vec2 inface = map_texture(position, which);\n" | ||||
|       "    vec3 tmap = texture2D(tTextureMap, u).rgb;\n" | ||||
| @@ -954,6 +961,20 @@ EX void configure() { | ||||
|       ); | ||||
|     }); | ||||
|  | ||||
|   if(hard_limit < NO_LIMIT) | ||||
|     dialog::addSelItem(XLAT("hard limit"), fts(hard_limit), 'H'); | ||||
|   else | ||||
|     dialog::addBoolItem(XLAT("hard limit"), false, 'H'); | ||||
|   dialog::add_action([&] { | ||||
|     if(hard_limit >= NO_LIMIT) hard_limit = 10; | ||||
|     dialog::editNumber(hard_limit, 0, 100, 1, 10, XLAT("hard limit"), ""); | ||||
|     dialog::reaction = reset_raycaster; | ||||
|     dialog::extra_options = [] { | ||||
|       dialog::addItem("no limit", 'N'); | ||||
|       dialog::add_action([] { hard_limit = NO_LIMIT; reset_raycaster(); }); | ||||
|       }; | ||||
|     }); | ||||
|    | ||||
|   if(!nil) { | ||||
|     dialog::addSelItem(XLAT("reflective walls"), fts(reflect_val), 'R'); | ||||
|     dialog::add_action([&] { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue