mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	swords in mirrors are now displayed correctly
This commit is contained in:
		
							
								
								
									
										14
									
								
								graph.cpp
									
									
									
									
									
								
							
							
						
						
									
										14
									
								
								graph.cpp
									
									
									
									
									
								
							| @@ -342,7 +342,7 @@ void drawCurse(const shiftmatrix& V, eItem it) { | |||||||
|  |  | ||||||
| #define UNTRANS (GDIM == 3 ? 0x000000FF : 0) | #define UNTRANS (GDIM == 3 ? 0x000000FF : 0) | ||||||
|  |  | ||||||
| EX void drawPlayerEffects(const shiftmatrix& V, cell *c, eMonster m) { | EX void drawPlayerEffects(const shiftmatrix& V, const shiftmatrix& Vparam, cell *c, eMonster m) { | ||||||
|   bool onplayer = m == moPlayer; |   bool onplayer = m == moPlayer; | ||||||
|   if(!onplayer && !items[itOrbEmpathy]) return; |   if(!onplayer && !items[itOrbEmpathy]) return; | ||||||
|   if(items[itOrbShield] > (shmup::on ? 0 : ORBBASE)) drawShield(V, itOrbShield); |   if(items[itOrbShield] > (shmup::on ? 0 : ORBBASE)) drawShield(V, itOrbShield); | ||||||
| @@ -369,7 +369,7 @@ EX void drawPlayerEffects(const shiftmatrix& V, cell *c, eMonster m) { | |||||||
| #if CAP_SHAPES | #if CAP_SHAPES | ||||||
|       shiftmatrix Vsword =  |       shiftmatrix Vsword =  | ||||||
|         shmup::on ? V * shmup::swordmatrix[multi::cpid] * cspin(2, 0, M_PI/2)  |         shmup::on ? V * shmup::swordmatrix[multi::cpid] * cspin(2, 0, M_PI/2)  | ||||||
|                   : gmatrix[c] * rgpushxto0(inverse_shift(gmatrix[c], tC0(V))) * sword::dir[multi::cpid].T; |                   : Vparam * rgpushxto0(inverse_shift(gmatrix[c], tC0(V))) * sword::dir[multi::cpid].T; | ||||||
|  |  | ||||||
|       if(items[itOrbSword]) |       if(items[itOrbSword]) | ||||||
|         queuepoly(Vsword * cspin(1,2, ticks / 150.), (peace::on ? cgi.shMagicShovel : cgi.shMagicSword), darkena(iinf[itOrbSword].color, 0, 0xC0 + 0x30 * sintick(200))); |         queuepoly(Vsword * cspin(1,2, ticks / 150.), (peace::on ? cgi.shMagicShovel : cgi.shMagicSword), darkena(iinf[itOrbSword].color, 0, 0xC0 + 0x30 * sintick(200))); | ||||||
| @@ -384,7 +384,7 @@ EX void drawPlayerEffects(const shiftmatrix& V, cell *c, eMonster m) { | |||||||
|       ang %= sword::sword_angles; |       ang %= sword::sword_angles; | ||||||
|  |  | ||||||
| #if CAP_QUEUE || CAP_SHAPES | #if CAP_QUEUE || CAP_SHAPES | ||||||
|       shiftmatrix Vnow = gmatrix[c] * rgpushxto0(inverse_shift(gmatrix[c], tC0(V))) * ddspin(c,0,M_PI); |       shiftmatrix Vnow = Vparam * rgpushxto0(inverse_shift(Vparam, tC0(V))) * ddspin(c,0,M_PI); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|       int adj = 1 - ((sword_angles/cwt.at->type)&1); |       int adj = 1 - ((sword_angles/cwt.at->type)&1); | ||||||
| @@ -2874,7 +2874,7 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col | |||||||
|       if(!nospins && flipplayer) Vs = Vs * pispin; |       if(!nospins && flipplayer) Vs = Vs * pispin; | ||||||
|        |        | ||||||
|       res = res && drawMonsterType(moMimic, c, Vs, col, footphase, asciicol); |       res = res && drawMonsterType(moMimic, c, Vs, col, footphase, asciicol); | ||||||
|       drawPlayerEffects(Vs, c, c->monst); |       drawPlayerEffects(Vs, Vparam, c, c->monst); | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|    |    | ||||||
| @@ -2884,7 +2884,7 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col | |||||||
|     multi::cpid = 0; |     multi::cpid = 0; | ||||||
|     if(c->monmirror) Vs = Vs * Mirror; |     if(c->monmirror) Vs = Vs * Mirror; | ||||||
|     drawMonsterType(c->monst, c, Vs, col, footphase, asciicol); |     drawMonsterType(c->monst, c, Vs, col, footphase, asciicol); | ||||||
|     drawPlayerEffects(Vs, c, c->monst); |     drawPlayerEffects(Vs, Vparam, c, c->monst); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   // wolves face the heat |   // wolves face the heat | ||||||
| @@ -2941,7 +2941,7 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col | |||||||
|     if(!nospins && c->mondir < c->type) Vs = Vs * ddspin(c, c->mondir, M_PI); |     if(!nospins && c->mondir < c->type) Vs = Vs * ddspin(c, c->mondir, M_PI); | ||||||
|     if(c->monst == moPair) Vs = Vs * xpush(-.12); |     if(c->monst == moPair) Vs = Vs * xpush(-.12); | ||||||
|     if(c->monmirror) Vs = Vs * Mirror; |     if(c->monmirror) Vs = Vs * Mirror; | ||||||
|     if(isFriendly(c)) drawPlayerEffects(Vs, c, c->monst); |     if(isFriendly(c)) drawPlayerEffects(Vs, Vparam, c, c->monst); | ||||||
|     res = res && drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase, asciicol); |     res = res && drawMonsterTypeDH(m, c, Vs, col, darkhistory, footphase, asciicol); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -2995,7 +2995,7 @@ EX bool drawMonster(const shiftmatrix& Vparam, int ct, cell *c, color_t col, col | |||||||
|  |  | ||||||
|     asciicol = getcs().uicolor >> 8; |     asciicol = getcs().uicolor >> 8; | ||||||
|  |  | ||||||
|     drawPlayerEffects(Vs, c, moPlayer); |     drawPlayerEffects(Vs, Vparam, c, moPlayer); | ||||||
|     if(inmirrorcount && !mouseout() && !nospins && GDIM == 2) { |     if(inmirrorcount && !mouseout() && !nospins && GDIM == 2) { | ||||||
|       hyperpoint h = inverse_shift(ocwtV, mouseh); |       hyperpoint h = inverse_shift(ocwtV, mouseh); | ||||||
|       if(flipplayer) h = pispin * h; |       if(flipplayer) h = pispin * h; | ||||||
|   | |||||||
| @@ -3049,7 +3049,7 @@ bool celldrawer::draw_shmup_monster() { | |||||||
|         bool ths = subscreens::is_current_player(m->pid); |         bool ths = subscreens::is_current_player(m->pid); | ||||||
|          |          | ||||||
|         if(!ths || !h) { |         if(!ths || !h) { | ||||||
|           drawPlayerEffects(view, c, m->type); |           drawPlayerEffects(view, V, c, m->type); | ||||||
|           if(WDIM == 3) { |           if(WDIM == 3) { | ||||||
|             if(prod) { |             if(prod) { | ||||||
|               hyperpoint h = m->ori * C0; // ztangent(1) |               hyperpoint h = m->ori * C0; // ztangent(1) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue