Skip to content

Reimplement 176 static initializers and GetStringBasedOnHardcodedMaps - #405

Merged
gynt merged 1 commit into
sourcehold:mainfrom
6and8:pr-init-100
Nov 13, 2026
Merged

gynt merged 1 commit into
sourcehold:mainfrom
6and8:pr-init-100

Conversation

@6and8

@6and8 6and8 commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Reimplements 176 functions, almost all of them static initializers:

  • Global::Init (174): 148 Constructor_* static constructors and 26 Create*DisplayElement initializers. The constructors build their global and register its destructor with atexit; the Create* ones construct a display element with its position and render callback.
  • Meta (1): Destructor_MenuModal_UnusedWinCondition.
  • Global (1): GetStringBasedOnHardcodedMaps.

No header changes. The only status lines touched are these 176. None of these functions is in another open PR: I checked every open PR by path, file name and function address, and left out the 8 constructors that are already in #241, #242, #265, #275, #291, #292, #295, #366 and #392.

Checked with a build of this branch on top of main, containing every source file in Global/Init, Meta and Global (471 files), compared function by function with a full build of my working branch: the instructions are identical in all 176. 149 of them measure 70-94% in this build only because they push a callback or atexit destructor address that reccmp leaves unnamed in the original (it has no relocations); 174 status lines say so (counted: only the pushed callback address is unnamed in the original). The numbers depend on which callbacks are reimplemented in the build: when the callback itself is reimplemented the push resolves to a trampoline to the same address. Main's 295 functions there keep their scores.

🤖 Generated with Claude Code

…gBasedOnHardcodedMaps

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

Copy link
Copy Markdown

Style guide reading (advisory, posted once)

11 possible deviation(s) from REIMPLEMENTATION_STYLE_GUIDE.md across 11 of the 176 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 11
Where

Rule 14 — The shape of a file

  • src/OpenSHC/Global/Init/Constructor_AICState.cpp:1 — first include is not Init; the folder is the class
  • src/OpenSHC/Global/Init/Constructor_AIVState.cpp:1 — first include is not Init; the folder is the class
  • src/OpenSHC/Global/Init/Constructor_MenuModal_EditorMapTypeQuickChange.cpp:1 — first include is not Init; the folder is the class
  • src/OpenSHC/Global/Init/Constructor_MenuModal_TriggerEventOrInvasion.cpp:1 — first include is not Init; the folder is the class
  • src/OpenSHC/Global/Init/Constructor_MenuModal_UnusedWinCondition.cpp:1 — first include is not Init; the folder is the class
  • src/OpenSHC/Global/Init/Constructor_MenuView_Unknown33.cpp:1 — first include is not Init; the folder is the class
  • src/OpenSHC/Global/Init/Constructor_MenuView_Unknown49DoesNothingUnk.cpp:1 — first include is not Init; the folder is the class
  • src/OpenSHC/Global/Init/Constructor_MenuView_UnusedChooseGameType.cpp:1 — first include is not Init; the folder is the class
  • src/OpenSHC/Global/Init/Constructor_MenuView_UnusedOldTitleMenu.cpp:1 — first include is not Init; the folder is the class
  • src/OpenSHC/Global/Init/CreateUnknownDisplayElement0.cpp:1 — first include is not Init; the folder is the class
  • ... and 1 more

@gynt
gynt added this pull request to the merge queue Nov 13, 2026
Merged via the queue into sourcehold:main with commit 89ddd27 Nov 13, 2026
5 checks passed
kotijekriv added a commit to kotijekriv/OpenSHC that referenced this pull request Nov 13, 2026
Brings in sourcehold#397 (merged as 5ec4011), so this PR no longer shows its
commits, plus sourcehold#290, sourcehold#402 and sourcehold#405.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants