Skip to content

Modernize barracks pilot-stats line storage - #7740

Open
Goober5000 wants to merge 1 commit into
scp-fs2open:masterfrom
Goober5000:refactor/barracks_modernization
Open

Modernize barracks pilot-stats line storage#7740
Goober5000 wants to merge 1 commit into
scp-fs2open:masterfrom
Goober5000:refactor/barracks_modernization

Conversation

@Goober5000

Copy link
Copy Markdown
Contributor

The pilot-stats panel built its display lines into two hand-rolled fixed-width C arrays with manual dynamic memory management. Replace all of that with a growable SCP_vector<barracks_stat_line>. Most manual management goes away; the display output is unchanged.

Add a reusable SCP_string overload of font::force_fit_string() so the width-fitting pass can operate on the vector's strings directly; it forwards to the existing char* version (which only ever shortens) and resizes to the result.

@Goober5000 Goober5000 added cleanup A modification or rewrite of code to make it more understandable or easier to maintain. ui A feature or issue specific to the menus portion of the user interface labels Aug 25, 2026
The pilot-stats panel built its display lines into two hand-rolled fixed-width C arrays with manual dynamic memory management.  Replace all of that with a growable SCP_vector<barracks_stat_line>.  Most manual management goes away; the display output is unchanged.

Add a reusable SCP_string overload of font::force_fit_string() so the width-fitting pass can operate on the vector's strings directly; it forwards to the existing char* version (which only ever shortens) and resizes to the result.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Goober5000
Goober5000 force-pushed the refactor/barracks_modernization branch from 7cfd915 to 0fe0e98 Compare August 25, 2026 03:44
@Goober5000 Goober5000 added this to the Release 27.0 milestone Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup A modification or rewrite of code to make it more understandable or easier to maintain. ui A feature or issue specific to the menus portion of the user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant