mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	3d:: mapeditor works
This commit is contained in:
		
							
								
								
									
										20
									
								
								graph.cpp
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								graph.cpp
									
									
									
									
									
								
							| @@ -2983,6 +2983,7 @@ void setcolors(cell *c, color_t& wcol, color_t& fcol) { | |||||||
|       break; |       break; | ||||||
|     case laCanvas: |     case laCanvas: | ||||||
|       fcol = c->landparam; |       fcol = c->landparam; | ||||||
|  |       if(c->wall == waWaxWall) wcol = c->landparam; | ||||||
|       break; |       break; | ||||||
|     case laPalace: |     case laPalace: | ||||||
|       fcol = floorcolors[c->land]; |       fcol = floorcolors[c->land]; | ||||||
| @@ -5244,9 +5245,9 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { | |||||||
|      |      | ||||||
| #if CAP_EDIT | #if CAP_EDIT | ||||||
|     if((cmode & sm::MAP) && lmouseover && darken == 0 && |     if((cmode & sm::MAP) && lmouseover && darken == 0 && | ||||||
|       !mouseout() &&  |       (DIM == 3 || !mouseout()) &&  | ||||||
|       (patterns::whichPattern ? patterns::getpatterninfo0(c).id == patterns::getpatterninfo0(lmouseover).id : c == lmouseover)) { |       (patterns::whichPattern ? patterns::getpatterninfo0(c).id == patterns::getpatterninfo0(lmouseover).id : c == lmouseover)) { | ||||||
|       queuecircle(V, .78, 0x00FFFFFF); |       queuecircleat(c, .78, 0x00FFFFFF); | ||||||
|       } |       } | ||||||
|  |  | ||||||
|     mapeditor::drawGhosts(c, V, ctype); |     mapeditor::drawGhosts(c, V, ctype); | ||||||
| @@ -5357,7 +5358,7 @@ void queuecircleat(cell *c, double rad, color_t col) { | |||||||
| #define MOBON true | #define MOBON true | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| cell *mouseover3() { | cell *forwardcell() { | ||||||
|   movedir md = vectodir(move_destination_vec(6)); |   movedir md = vectodir(move_destination_vec(6)); | ||||||
|   cellwalker xc = cwt + md.d + wstep; |   cellwalker xc = cwt + md.d + wstep; | ||||||
|   return xc.at; |   return xc.at; | ||||||
| @@ -5476,7 +5477,7 @@ void drawMarkers() { | |||||||
|       } |       } | ||||||
|      |      | ||||||
|     if(DIM == 3 && !inHighQual && !shmup::on && vid.axes) { |     if(DIM == 3 && !inHighQual && !shmup::on && vid.axes) { | ||||||
|       cell *c = mouseover3(); |       cell *c = forwardcell(); | ||||||
|       IG(c) queuecircleat(c, .8, getcs().uicolor); |       IG(c) queuecircleat(c, .8, getcs().uicolor); | ||||||
|       } |       } | ||||||
|     #endif |     #endif | ||||||
| @@ -5624,7 +5625,16 @@ transmatrix cview() { | |||||||
|   } |   } | ||||||
|  |  | ||||||
| void precise_mouseover() { | void precise_mouseover() { | ||||||
|   if(DIM == 3) { mouseover2 = viewctr.at->c7; mouseover = mouseover3(); return; } |   if(DIM == 3) {  | ||||||
|  |     mouseover2 = mouseover = viewctr.at->c7;  | ||||||
|  |     ld best = HUGE_VAL; | ||||||
|  |     hyperpoint h = cpush(2, 1) * C0; | ||||||
|  |     forCellEx(c1, mouseover2) { | ||||||
|  |       ld dist = hdist(tC0(ggmatrix(c1)), h); | ||||||
|  |       if(dist < best) mouseover = c1, best = dist; | ||||||
|  |       } | ||||||
|  |     return;  | ||||||
|  |     } | ||||||
|   if(!mouseover) return; |   if(!mouseover) return; | ||||||
|   cell *omouseover = mouseover; |   cell *omouseover = mouseover; | ||||||
|   for(int loop = 0; loop < 10; loop++) {  |   for(int loop = 0; loop < 10; loop++) {  | ||||||
|   | |||||||
							
								
								
									
										1
									
								
								hyper.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								hyper.h
									
									
									
									
									
								
							| @@ -994,6 +994,7 @@ bool displayfrSP(int x, int y, int sh, int b, int size, const string &s, color_t | |||||||
| bool outofmap(hyperpoint h); | bool outofmap(hyperpoint h); | ||||||
| void applymodel(hyperpoint H, hyperpoint& Hscr); | void applymodel(hyperpoint H, hyperpoint& Hscr); | ||||||
| void drawCircle(int x, int y, int size, color_t color, color_t fillcolor = 0); | void drawCircle(int x, int y, int size, color_t color, color_t fillcolor = 0); | ||||||
|  | void queuecircleat(cell *c, double rad, color_t col); | ||||||
| void fixcolor(int& col); | void fixcolor(int& col); | ||||||
| ld displayspin(cell *c, int d); | ld displayspin(cell *c, int d); | ||||||
| bool non_spatial_model(); | bool non_spatial_model(); | ||||||
|   | |||||||
| @@ -734,7 +734,7 @@ namespace mapeditor { | |||||||
|         break; |         break; | ||||||
|       case 6: |       case 6: | ||||||
|         c->land = laCanvas; |         c->land = laCanvas; | ||||||
|         c->wall = waNone; |         c->wall = DIM == 3 ? waWaxWall : waNone; | ||||||
|         c->landparam = paintwhat >> 8; |         c->landparam = paintwhat >> 8; | ||||||
|         break; |         break; | ||||||
|       case 4: |       case 4: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 ?
					?