Skip to content

Commit a33c844

Browse files
committed
Respect HUD anchoring for fullscreen HUD
1 parent e922186 commit a33c844

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

client/src/st_new.cpp

+15-3
Original file line numberDiff line numberDiff line change
@@ -791,17 +791,28 @@ void drawNetdemo() {
791791
}
792792
}
793793

794-
static void drawLevelStats() {
794+
static void drawLevelStats()
795+
{
795796
if (!G_IsCoopGame())
796797
return;
797798

798799
if (AM_ClassicAutomapVisible() || AM_OverlayAutomapVisible())
799800
return;
800801

802+
unsigned int xscale, yscale;
803+
xscale = hud_scale ? CleanXfac : 1;
804+
int num_ax = 0, text_ax = 0;
805+
if (hud_anchoring.value() < 1.0f)
806+
{
807+
num_ax = (((float)I_GetSurfaceWidth() - (float)I_GetSurfaceHeight() * 4.0f / 3.0f) / 2.0f) * (1.0f - hud_anchoring.value());
808+
num_ax = MAX(0, num_ax);
809+
text_ax = num_ax / xscale;
810+
}
811+
801812
std::string line;
802813
const int LINE_SPACING = V_LineHeight() + 1;
803814
int font_offset = 0;
804-
int x = 2, y = R_StatusBarVisible() ? statusBarY() + 1 : 33;
815+
unsigned int x = R_StatusBarVisible() ? 2 : (text_ax + 10), y = R_StatusBarVisible() ? statusBarY() + 1 : 44;
805816

806817
if (hud_extendedinfo == 1 || hud_extendedinfo == 3)
807818
{
@@ -819,7 +830,8 @@ static void drawLevelStats() {
819830
}
820831
else
821832
{
822-
if (hud_extendedinfo >= 3 || !R_StatusBarVisible()){
833+
if (hud_extendedinfo >= 3 || !R_StatusBarVisible())
834+
{
823835
std::string killrow;
824836
std::string itemrow;
825837
std::string secretrow;

0 commit comments

Comments
 (0)