Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit c3d551c

Browse files
committed
Fix TextPrimitive not drawing blended if not rotating
1 parent 6f9e913 commit c3d551c

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

System/GraphicalPrimitive.cpp

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -473,28 +473,41 @@ namespace RTE {
473473
if (!g_SceneMan.SceneWrapsX() && !g_SceneMan.SceneWrapsY()) {
474474
Vector drawStart = m_StartPos - targetPos;
475475

476-
if (m_BlendMode > DrawBlendMode::NoBlend && m_RotAngle != 0) {
477-
rotate_sprite_trans(drawScreen, tempDrawBitmap, drawStart.GetFloorIntX(), drawStart.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
478-
} else if (m_RotAngle != 0) {
479-
rotate_sprite(drawScreen, tempDrawBitmap, drawStart.GetFloorIntX(), drawStart.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
476+
if (m_BlendMode > DrawBlendMode::NoBlend) {
477+
if (m_RotAngle != 0) {
478+
rotate_sprite_trans(drawScreen, tempDrawBitmap, drawStart.GetFloorIntX(), drawStart.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
479+
} else {
480+
draw_trans_sprite(drawScreen, tempDrawBitmap, drawStart.GetFloorIntX(), drawStart.GetFloorIntY());
481+
}
480482
} else {
481-
font->DrawAligned(&playerGUIBitmap, drawStart.GetFloorIntX(), drawStart.GetFloorIntY(), m_Text, m_Alignment);
483+
if (m_RotAngle != 0) {
484+
rotate_sprite(drawScreen, tempDrawBitmap, drawStart.GetFloorIntX(), drawStart.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
485+
} else {
486+
font->DrawAligned(&playerGUIBitmap, drawStart.GetFloorIntX(), drawStart.GetFloorIntY(), m_Text, m_Alignment);
487+
}
482488
}
483489
} else {
484490
Vector drawStartLeft;
485491
Vector drawStartRight;
486492

487493
TranslateCoordinates(targetPos, m_StartPos, drawStartLeft, drawStartRight);
488494

489-
if (m_BlendMode > DrawBlendMode::NoBlend && m_RotAngle != 0) {
490-
rotate_sprite_trans(drawScreen, tempDrawBitmap, drawStartLeft.GetFloorIntX(), drawStartLeft.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
491-
rotate_sprite_trans(drawScreen, tempDrawBitmap, drawStartRight.GetFloorIntX(), drawStartRight.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
492-
} else if (m_RotAngle != 0) {
493-
rotate_sprite(drawScreen, tempDrawBitmap, drawStartLeft.GetFloorIntX(), drawStartLeft.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
494-
rotate_sprite(drawScreen, tempDrawBitmap, drawStartRight.GetFloorIntX(), drawStartRight.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
495+
if (m_BlendMode > DrawBlendMode::NoBlend) {
496+
if (m_RotAngle != 0) {
497+
rotate_sprite_trans(drawScreen, tempDrawBitmap, drawStartLeft.GetFloorIntX(), drawStartLeft.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
498+
rotate_sprite_trans(drawScreen, tempDrawBitmap, drawStartRight.GetFloorIntX(), drawStartRight.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
499+
} else {
500+
draw_trans_sprite(drawScreen, tempDrawBitmap, drawStartLeft.GetFloorIntX(), drawStartLeft.GetFloorIntY());
501+
draw_trans_sprite(drawScreen, tempDrawBitmap, drawStartRight.GetFloorIntX(), drawStartRight.GetFloorIntY());
502+
}
495503
} else {
496-
font->DrawAligned(&playerGUIBitmap, drawStartLeft.GetFloorIntX(), drawStartLeft.GetFloorIntY(), m_Text, m_Alignment);
497-
font->DrawAligned(&playerGUIBitmap, drawStartRight.GetFloorIntX(), drawStartRight.GetFloorIntY(), m_Text, m_Alignment);
504+
if (m_RotAngle != 0) {
505+
rotate_sprite(drawScreen, tempDrawBitmap, drawStartLeft.GetFloorIntX(), drawStartLeft.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
506+
rotate_sprite(drawScreen, tempDrawBitmap, drawStartRight.GetFloorIntX(), drawStartRight.GetFloorIntY(), ftofix(rotation.GetAllegroAngle()));
507+
} else {
508+
font->DrawAligned(&playerGUIBitmap, drawStartLeft.GetFloorIntX(), drawStartLeft.GetFloorIntY(), m_Text, m_Alignment);
509+
font->DrawAligned(&playerGUIBitmap, drawStartRight.GetFloorIntX(), drawStartRight.GetFloorIntY(), m_Text, m_Alignment);
510+
}
498511
}
499512
}
500513
if (tempDrawBitmap) { destroy_bitmap(tempDrawBitmap); }

0 commit comments

Comments
 (0)