mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-30 21:42:59 +00:00 
			
		
		
		
	rogueviz::ads:: do not show numerically unstable convergent/divergent stars in dsgame
This commit is contained in:
		| @@ -113,7 +113,7 @@ struct rock_generator { | |||||||
|     ld step = rand_range(0.17, 0.23); |     ld step = rand_range(0.17, 0.23); | ||||||
|     for(int i=0; i<45; i++) { |     for(int i=0; i<45; i++) { | ||||||
|       cshift += step; |       cshift += step; | ||||||
|       add(spin(alpha + i * TAU / 30) * div_matrix()); |       add(spin(alpha + i * TAU / 30) * div_matrix())->subtype = 1; | ||||||
|       } |       } | ||||||
|     cshift += rand_range(.3, .7); |     cshift += rand_range(.3, .7); | ||||||
|     } |     } | ||||||
| @@ -125,7 +125,7 @@ struct rock_generator { | |||||||
|     ld step = rand_range(0.17, 0.23); |     ld step = rand_range(0.17, 0.23); | ||||||
|     for(int i=0; i<45; i++) { |     for(int i=0; i<45; i++) { | ||||||
|       cshift += step; |       cshift += step; | ||||||
|       add(spin(alpha + i * TAU / 30) * conv_matrix()); |       add(spin(alpha + i * TAU / 30) * conv_matrix())->subtype = 2; | ||||||
|       } |       } | ||||||
|     cshift += rand_range(.3, .7); |     cshift += rand_range(.3, .7); | ||||||
|     } |     } | ||||||
| @@ -214,6 +214,8 @@ rock_generator rockgen, rsrcgen; | |||||||
|  |  | ||||||
| auto future_shown = 5 * TAU; | auto future_shown = 5 * TAU; | ||||||
|  |  | ||||||
|  | auto future_shown_condiv = 2 * TAU; | ||||||
|  |  | ||||||
| /** start with a fixed good-looking sequence */ | /** start with a fixed good-looking sequence */ | ||||||
| bool demo; | bool demo; | ||||||
|  |  | ||||||
| @@ -526,8 +528,8 @@ void view_ds_game() { | |||||||
|       poly_outline = 0xFF; |       poly_outline = 0xFF; | ||||||
|       if(rock.type == oMainRock) rock.at.shift = current.shift; |       if(rock.type == oMainRock) rock.at.shift = current.shift; | ||||||
|      |      | ||||||
|       if(rock.at.shift < current.shift - future_shown) continue; |       if(current.shift < rock.at.shift - (rock.subtype == 1 ? future_shown_condiv : future_shown)) continue; | ||||||
|       if(rock.at.shift > current.shift + future_shown) continue; |       if(current.shift > rock.at.shift + (rock.subtype == 2 ? future_shown_condiv : future_shown)) continue; | ||||||
|  |  | ||||||
|       if(1) { |       if(1) { | ||||||
|         dynamicval<eGeometry> g(geometry, gSpace435); |         dynamicval<eGeometry> g(geometry, gSpace435); | ||||||
|   | |||||||
| @@ -198,10 +198,12 @@ struct ads_object { | |||||||
|   ld life_start, life_end; |   ld life_start, life_end; | ||||||
|   cross_result pt_main; |   cross_result pt_main; | ||||||
|   vector<cross_result> pts; |   vector<cross_result> pts; | ||||||
|  |   int subtype; | ||||||
|  |  | ||||||
|   ads_object(eObjType t, cell *_owner, const ads_matrix& T, color_t _col) : type(t), owner(_owner), at(T), col(_col) { |   ads_object(eObjType t, cell *_owner, const ads_matrix& T, color_t _col) : type(t), owner(_owner), at(T), col(_col) { | ||||||
|     life_start = -HUGE_VAL; |     life_start = -HUGE_VAL; | ||||||
|     life_end = HUGE_VAL; |     life_end = HUGE_VAL; | ||||||
|  |     subtype = 0; | ||||||
|     } |     } | ||||||
|   }; |   }; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue