Skip to content

Reimplement 23 UI, Credits, Rendering, Text and Audio functions - #404

Open
6and8 wants to merge 9 commits into
sourcehold:mainfrom
6and8:pr-ui-100
Open

6and8 wants to merge 9 commits into
sourcehold:mainfrom
6and8:pr-ui-100

Conversation

@6and8

@6and8 6and8 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Reimplements 23 functions from UI, Rendering, Text and Audio:

  • UI::Credits (14): AppendCreditsBinkVideoCommand, AppendCreditsBinkVideoWithAudioCommand, AppendCreditsFixedImageCommand, AppendCreditsImageEndCommand, AppendCreditsImageTransitionCommand, AppendCreditsShowImageCommand, AppendCreditsSoundEntry, AppendCreditsTextCommand, AppendCreditsTextEndCommand, EndCreditsSegmentAndAdvanceToNext, InsertElementIntoAnArrayAt_ec0348, InsertElementIntoArrayAt_ec0348_3, RenderScrollingCreditsTextFrame, ResetCredits
  • UI (4): Menu::loadMenuElements, MenuHandlerState::initializeUI, MenuViews::Credits::MenuView_Credits_DoEveryFrame, BottomLeftTextDisplayState::renderCurrentlyDisplayedTextConstructionCost
  • Rendering (2): InitializeColors, Bink::AIMessageQueue::playNextStoredBinkVideo
  • Text::TextManager (1): loadCRTex
  • Audio::SFX (2): ComputeCurrentPlayerRanking, ComputePlayerPoints1

One header change, in its own commit: INT_00ec083c is a float (was int). ResetCredits clears it with fldz/fstp in the original; no other source file on main uses it.

The only status lines touched are these 23.

Checked with a build of this branch on top of main, containing every source file of the touched folders (51 files): 18 of the 23 measure 100%. The other five differ only in symbols that reccmp leaves unnamed in the original (it has no relocations): the loop-end compare against the next global in ResetCredits (95.0%), EndCreditsSegmentAndAdvanceToNext (98.4%) and InsertElementIntoArrayAt_ec0348_3 (97.0%), plus float constants and _ftol2_sse in InsertElementIntoAnArrayAt_ec0348 (95.7%) and RenderScrollingCreditsTextFrame (97.0%). The instructions are identical.

Main's own 28 functions in those folders keep their scores. Six of them are below 100% in this build for the same unnamed-symbol reason, with or without this PR: TicksStartCounter, RenderActiveCreditsElements, Constructor_Menu, handleMenuItems, renderConstructionMenu, and UpdateUnitLossSpeechFeedback (84.4%, listed at 84.0%).

🤖 Generated with Claude Code

loamifi-jake and others added 2 commits November 13, 2026 09:55
ResetCredits clears it with fldz/fstp in the original.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the declaration/type change This requires changes to the generated/exported types or definitions. label Nov 13, 2026
@github-actions

Copy link
Copy Markdown

Style guide reading (advisory, posted once)

4 possible deviation(s) from REIMPLEMENTATION_STYLE_GUIDE.md across 4 of the 23 reimplemented .cpp file(s) in this PR.

The match comes first. Where the ugly form is what matched, it stays -- that is the guide's own overriding rule, and rule 21 asks for a one-line comment saying what was measured so the next reader does not retry it. This report is posted once, when the PR opens, and is not repeated on later pushes.

rule what it asks hits
14 The shape of a file 4
Where

Rule 14 — The shape of a file

  • src/OpenSHC/UI/Credits/EndCreditsSegmentAndAdvanceToNext.cpp:1 — first include is not Credits; the folder is the class
  • src/OpenSHC/UI/Credits/RenderScrollingCreditsTextFrame.cpp:1 — first include is not Credits; the folder is the class
  • src/OpenSHC/UI/MenuHandlerState/initializeUI.cpp:1 — first include is not MenuHandlerState; the folder is the class
  • src/OpenSHC/UI/MenuViews/Credits/MenuView_Credits_DoEveryFrame.cpp:1 — first include is not Credits; the folder is the class

gynt added a commit that referenced this pull request Nov 13, 2026
Comment thread src/OpenSHC/Globals/INT_00ec083c.hpp Resolved
this->helpTextLinkActive = FALSE;
this->textSurfaceTarget = Rendering::Enums::RT_SCREEN_MENU;
this->field_0x1348 = 0;
int file = MACRO_CALL(OS_Func::_ucrt_open)("cr.tex", _O_BINARY, 0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use the string-literals include. for this. Applies to all literals here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. _ucrt_open takes a char*, so cr.tex uses the macro from string-macros.hpp; the language names use string-literals.hpp.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, can you adapt the signature of _ucrt_open then? It should have the same signature like _open which it is proxied to in OS.cpp.
This should allow to use the sting-literals file instead of the macro.

If it becomes clear that a param should actually be const (like when taking a literal), you are free to change the signature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: _ucrt_open takes char const* like _open now (its own commit, OS.hpp / OS.func.hpp / OS.cpp), and cr.tex uses s_cr_tex_005a6334 from string-literals.hpp. All callers of _ucrt_open compile and score the same as before.

loamifi-jake and others added 5 commits November 15, 2026 20:41
# Conflicts:
#	src/OpenSHC/Globals/FLOAT_00ec083c.hpp
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…and colours in the construction-cost text, string-literals in loadCRTex, loadMenuElements uses the declared member, no needless casts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@TheRedDaemon TheRedDaemon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A single comment remaining.

loamifi-jake and others added 2 commits November 16, 2026 17:12
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

declaration/type change This requires changes to the generated/exported types or definitions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants