Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Reusable game strings #28

Merged
merged 4 commits into from
Sep 17, 2024
Merged

Reusable game strings #28

merged 4 commits into from
Sep 17, 2024

Conversation

rr-
Copy link
Contributor

@rr- rr- commented Sep 17, 2024

I know I've made refactors to the game string management several times, but I just keep encountering issues. Recently, while integrating game string support into libtrx, I realized there was no way to declare the GAME_STRING_ID enum in libtrx and allow users (TR1X, TR2X) to add their own strings (or the other way around).

To address this, this PR switches from using integers to strings for keys. It maintains existing macros for minimal disruption and includes the uthash library for performance.

As a result, the default string table initialization must occur at runtime, not compile time. Consumers need to declare their default strings at runtime using the new GameString_Init and GameString_Shutdown() functions.

libtrx will provide its own game_string.def table, which consumers will need to #include in their GameString_Init and GameString_Shutdown() routines.

Related changes:

@rr- rr- self-assigned this Sep 17, 2024
@rr- rr- requested a review from a team as a code owner September 17, 2024 21:18
@rr- rr- requested review from lahm86 and walkawayy and removed request for a team September 17, 2024 21:18
The amount of bugs encountered in this software during trx development
outweighs the benefits of its continued usage.
@rr- rr- merged commit c1f3ab5 into main Sep 17, 2024
2 checks passed
@rr- rr- deleted the reusable-game-strings branch September 17, 2024 21:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants