mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	removed the MAX_EDGE limitation
This commit is contained in:
		| @@ -552,7 +552,7 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i | ||||
|           } | ||||
|  | ||||
|         finishshape(); | ||||
|         ensure_vertex_number(*last); | ||||
|         ensure_vertex_number(fsh.levels[k][id]); | ||||
|         } | ||||
|        | ||||
|       for(int co=0; co<2; co++) { | ||||
| @@ -584,18 +584,16 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i | ||||
|           } | ||||
|  | ||||
|         finishshape(); | ||||
|         ensure_vertex_number(*last); | ||||
|         ensure_vertex_number(fsh.cone[co][id]); | ||||
|         } | ||||
|  | ||||
|       for(int l=0; l<SIDEPARS; l++) { | ||||
|         for(auto& li: fsh.side[l]) { | ||||
|           li.tinf = &floor_texture_vertices[fsh.id]; | ||||
|           ensure_vertex_number(li); | ||||
|           } | ||||
|         for(auto& gs: fsh.gpside[l]) | ||||
|           for(auto& li: gs) { | ||||
|             li.tinf = &floor_texture_vertices[fsh.id]; | ||||
|             ensure_vertex_number(li); | ||||
|         for(auto& li: fsh.side[l])  | ||||
|           bind_floor_texture(li, fsh.id); | ||||
|         fsh.gpside[l].resize(c->type); | ||||
|         for(auto& gs: fsh.gpside[l]) { | ||||
|           for(auto& li: gs)  | ||||
|             bind_floor_texture(li, fsh.id); | ||||
|           } | ||||
|         } | ||||
|       } | ||||
| @@ -606,19 +604,20 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i | ||||
|       for(int l=0; l<SIDEPARS; l++) { | ||||
|         fsh.levels[l] = shFullFloor.levels[l]; | ||||
|         fsh.shadow = shFullFloor.shadow; | ||||
|         for(auto& li: fsh.levels[l]) li.tinf = &floor_texture_vertices[fsh.id]; | ||||
|         for(auto& li: fsh.levels[l]) bind_floor_texture(li, fsh.id); | ||||
|         fsh.side[l] = shFullFloor.side[l]; | ||||
|         for(auto& li: fsh.side[l]) li.tinf = &floor_texture_vertices[fsh.id]; | ||||
|         for(auto& li: fsh.side[l]) bind_floor_texture(li, fsh.id); | ||||
|         fsh.gpside[l].resize(c->type); | ||||
|         for(int e=0; e<c->type; e++) { | ||||
|           fsh.gpside[l][e] = shFullFloor.gpside[l][e]; | ||||
|           for(auto& li: fsh.gpside[l][e]) li.tinf = &floor_texture_vertices[fsh.id]; | ||||
|           for(auto& li: fsh.gpside[l][e])  | ||||
|             bind_floor_texture(li, fsh.id); | ||||
|           } | ||||
|         fsh.cone[0] = shFullFloor.cone[0]; | ||||
|         fsh.cone[1] = shFullFloor.cone[1]; | ||||
|         for(int c=0; c<2; c++) | ||||
|           for(auto& li: fsh.cone[c]) | ||||
|             li.tinf = &floor_texture_vertices[fsh.id]; | ||||
|             bind_floor_texture(li, fsh.id); | ||||
|         } | ||||
|       } | ||||
|     finishshape(); | ||||
| @@ -1058,6 +1057,11 @@ EX void ensure_vertex_number(hpcshape& sh) { | ||||
|   ensure_vertex_number(*sh.tinf, sh.e - sh.s); | ||||
|   } | ||||
|  | ||||
| EX void bind_floor_texture(hpcshape& li, int id) { | ||||
|   li.tinf = &floor_texture_vertices[id]; | ||||
|   ensure_vertex_number(li); | ||||
|   } | ||||
|  | ||||
| const int FLOORTEXTURESIZE = 4096; | ||||
|  | ||||
| void geometry_information::make_floor_textures_here() { | ||||
|   | ||||
							
								
								
									
										12
									
								
								hyper.h
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								hyper.h
									
									
									
									
									
								
							| @@ -339,7 +339,7 @@ extern videopar vid; | ||||
|  | ||||
| #define self (*this) | ||||
|  | ||||
| #define MODFIXER (2*10090080*17) | ||||
| // #define MODFIXER (2*10090080*17) | ||||
|  | ||||
| #define BUGCOLORS 3 | ||||
|  | ||||
| @@ -370,6 +370,16 @@ extern videopar vid; | ||||
| // size casted to int, to prevent warnings and actual errors caused by the unsignedness of x.size() | ||||
| template<class T> int isize(const T& x) {return x.size(); } | ||||
|  | ||||
| // automatically growing vector | ||||
| template<class T> struct grow_vector : public vector<T> { | ||||
|   T& grow(size_t index) { | ||||
|     if(index >= this->size()) { | ||||
|       this->resize(index + 1); | ||||
|       } | ||||
|     return (vector<T>::operator[]) (index); | ||||
|     } | ||||
|   }; | ||||
|  | ||||
| // game forward declarations | ||||
|  | ||||
| namespace anticheat { extern bool tampered; } | ||||
|   | ||||
| @@ -150,13 +150,10 @@ EX namespace netgen { | ||||
|      | ||||
|     for(int i=0; i<CELLS; i++) scan(f, ct[i]); | ||||
|  | ||||
|     for(int i=0; i<CELLS; i++) nei[i].resize(ct[i]); | ||||
|     for(int i=0; i<CELLS; i++) nei[i].clear(), nei[i].resize(ct[i], -1); | ||||
|  | ||||
|     for(int i=0; i<CELLS; i++) for(int j=0; j<16; j++) scan(f, vx[i][j]); | ||||
|  | ||||
|     for(int i=0; i<CELLS; i++)  | ||||
|     for(int j=0; j<7; j++) nei[i][j] = -1; | ||||
|  | ||||
|     while(true) { | ||||
|       int a, b, c; | ||||
|       scan(f, a, b, c); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue