Skip to content

Commit 3c769b0

Browse files
committed
Release v6.9: center print screen-center scaling model
1 parent ac6e272 commit 3c769b0

5 files changed

Lines changed: 23 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## v6.9
4+
5+
### Scaled UI — center print scaling (screen-center model)
6+
7+
- **Center print / yellow subtitles:** Scale uniformly from **screen center (X)** and the **first-line Y anchor** (`g_centerPrintAnchorY`) — matches how center-print lines use absolute Y, not pause-style inset/pivot.
8+
- **Removed `R_DrawFont` screenX pre-compensation** for center print; glyph positions are handled entirely in the vertex scaler.
9+
10+
## v6.8
11+
12+
### Scaled UI — center print scaling fix
13+
14+
- **Center print / yellow subtitles:** Reverted the v6.7 bottom-anchor path to standard **pivot-based X/Y scaling** (same model as pause text) — fixes misaligned or drifting multi-line center-print blocks.
15+
- **`R_DrawFont`:** Center-print horizontal compensation no longer pixel-snaps `screenX`; `screenY` is treated as absolute line Y, not a pause-style inset.
16+
317
## v6.7
418

519
### Updates — SofVault release list & per-tag manifests (XP)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.8
1+
6.9

hdr/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
Increment version using: ./increment_version.sh
88
*/
99

10-
#define SOFBUDDY_VERSION "6.8"
10+
#define SOFBUDDY_VERSION "6.9"

src/features/scaled_ui_base/hooks/r_drawfont.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,6 @@ void hkR_DrawFont(int screenX, int screenY, char * text, int colorPalette, char
6868
g_missionStatusAnchorY = static_cast<float>(screenY);
6969
}
7070

71-
if (g_currentFontCaller == FontCaller::SCR_DrawCenterPrint) {
72-
float s = fontScale;
73-
if (s <= 0.0f) s = 1.0f;
74-
if (s != 1.0f) {
75-
// screenX is line start; screenY is absolute line Y (not a pause-style inset).
76-
const float textW = static_cast<float>(current_vid_w - 2 * screenX);
77-
screenX -= static_cast<int>(textW * (s - 1.0f) * 0.5f);
78-
}
79-
}
80-
8171
SOFBUDDY_ASSERT(font != nullptr);
8272
if (font) {
8373
realFont = getRealFontEnum((char*)(* (int * )(font + 4)));

src/features/scaled_ui_base/text_scaling.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,13 @@ inline void handleFontVertex(float x, float y, bool scaleX, bool scaleY, bool in
136136
float s = fontScale;
137137
if (s <= 0.0f) s = 1.0f;
138138
if (s != 1.0f) {
139-
if (scaleX) x = pivotx + (x - pivotx) * s;
140-
if (scaleY) y = pivoty + (y - pivoty) * s;
141-
orig_glVertex2f(x + (characterIndex * realFontSizes[realFont]) * (s - 1), y);
139+
// Uniform scale from screen center (X) + first-line Y anchor.
140+
// Unlike pause, center print uses absolute line Y — no pivot/charIndex model.
141+
const float cx = (current_vid_w > 0) ? current_vid_w * 0.5f : 320.0f;
142+
x = cx + (x - cx) * s;
143+
if (g_centerPrintAnchorY > 0.0f)
144+
y = g_centerPrintAnchorY + (y - g_centerPrintAnchorY) * s;
145+
orig_glVertex2f(x, y);
142146
} else {
143147
orig_glVertex2f(x, y);
144148
}

0 commit comments

Comments
 (0)