mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 12:32:34 +00:00
- fixed sprite rotation in automap submission
This commit is contained in:
parent
9ed829c3af
commit
7006df8d96
1 changed files with 8 additions and 4 deletions
|
@ -2361,16 +2361,20 @@ void AM_drawThings ()
|
||||||
const size_t spriteIndex = sprite.spriteframes + (am_showthingsprites > 1 ? t->frame : 0);
|
const size_t spriteIndex = sprite.spriteframes + (am_showthingsprites > 1 ? t->frame : 0);
|
||||||
|
|
||||||
const spriteframe_t& frame = SpriteFrames[spriteIndex];
|
const spriteframe_t& frame = SpriteFrames[spriteIndex];
|
||||||
const angle_t rotation = (frame.Texture[0] == frame.Texture[1])
|
angle_t angle = ANGLE_270 - t->angle;
|
||||||
? (t->angle + (angle_t)(ANGLE_45 / 2) * 9) >> 28
|
if (frame.Texture[0] != frame.Texture[1]) angle += (ANGLE_180 / 16);
|
||||||
: (t->angle + (angle_t)(ANGLE_45 / 2) * 9 - (angle_t)(ANGLE_180 / 16)) >> 28;
|
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||||
|
{
|
||||||
|
angle += players[consoleplayer].camera->angle - ANGLE_90;
|
||||||
|
}
|
||||||
|
const angle_t rotation = angle >> 28;
|
||||||
|
|
||||||
const FTextureID textureID = frame.Texture[am_showthingsprites > 2 ? rotation : 0];
|
const FTextureID textureID = frame.Texture[am_showthingsprites > 2 ? rotation : 0];
|
||||||
FTexture* texture = TexMan(textureID);
|
FTexture* texture = TexMan(textureID);
|
||||||
|
|
||||||
const fixed_t spriteScale = 10 * scale_mtof;
|
const fixed_t spriteScale = 10 * scale_mtof;
|
||||||
|
|
||||||
DrawMarker (texture, p.x, p.y, 0, 0,
|
DrawMarker (texture, p.x, p.y, 0, !!(frame.Flip & (1 << rotation)),
|
||||||
spriteScale, spriteScale, 0, FRACUNIT, 0, LegacyRenderStyles[STYLE_Normal]);
|
spriteScale, spriteScale, 0, FRACUNIT, 0, LegacyRenderStyles[STYLE_Normal]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue