TombRunners / autosplitters

Tomb Raider Livesplit autosplitter code.
MIT License
1 stars 4 forks source link

Extracted common code into a referenced utility project. #44

Closed MidgeOnGithub closed 2 years ago

MidgeOnGithub commented 2 years ago

The general idea was to simplify and minimize each project's code as much as possible. To that end, this work has done fairly well, minimizing several classes down to boilerplate and/or game-specific logic code.

A utility project called TRUtil was created. Each of the game projects reference this one; thus, TRUtil.dll must be distributed along with the game's autosplitting DLL. Thus, TRUtil.dll was added to each project's update.xml.

MidgeOnGithub commented 2 years ago

I am confident I didn't break any TR3 functionality, since that is what the Classic classes were based upon.

I am reasonably confident I didn't break any TR2/TR2G functionality, but these were not extensively tested. If one works, the other should as well with the same changes. (Side note: there is a possibility to "combine" these autosplitters by moving TR2G-specific GameData logic into TR2's GameData. This would require a change to LS's XML, which is outside of this repo.)

I am not very confident I didn't break any TR1 (TR1996) functionality, since it required the most deviations from Classic classes; also, I did not test how the Alt-F4 trick works with the new code setup.

MidgeOnGithub commented 2 years ago

A note on Issue #34: The relevant code has been moved to ClassicGameData, inside of SetGameProcessAndVersion. I don't believe I have ever experienced the described crash, so I cannot say one way or another whether this work affected it. If needed, the code can be re-commented; otherwise, this issue could also be closed by this PR.