Shipwright/soh/src
Malkierian 778f548b01
Move Game Saving to Separate Thread (#2820)
* Refactor `Vec2f`, `Vec3f`, `Vec3s` in `z64math` to avoid reserved identifiers.

* Include `z64save` in SaveManager, which requires encapsulating `#include gameplaystats.h` and `InitStatTracker` in the cpp to fix compile issues.

Adds SaveContext reference parameters to SaveFunc and existing implementations in preparation for threaded saves.

* Threaded saves fully implemented.

Platform-specific save code removed.

Thread safety added. Will wait for thread pool tasks to finish before resetting or closing.

* Converted gSaveContext copy for save threads to the heap with `new`, deleted at the end of the threaded function to prevent possible issues with the stack.

* Turns out leaving the call to `ThreadPoolWait` in a `GameInteractor::OnExitGame` hook seems to be just fine.

* Removed unnecessary references to `SaveManager::ThreadPoolWait()`, game hooks are the only places it's called now.

* Re-added WiiU/Switch performance save code.

* Added call to `SaveManager::ThreadPoolWait` in `Sram_InitSave` to prevent trying to load a newly "created" save before the save file was actually written.

---------

Co-authored-by: Christopher Leggett <chris@leggett.dev>
2023-05-05 17:20:34 -04:00
..
boot Add version info and other details to windows exe properties (#2743) 2023-04-25 10:36:35 -04:00
buffers Add Support for macOS (#441) 2022-06-22 14:59:21 -04:00
code Move Game Saving to Separate Thread (#2820) 2023-05-05 17:20:34 -04:00
dmadata git subrepo clone https://github.com/HarbourMasters/soh.git 2022-03-22 02:51:23 +01:00
elf_message git subrepo clone https://github.com/HarbourMasters/soh.git 2022-03-22 02:51:23 +01:00
libultra refactor: use LUS 1.0 RC 2023-01-17 00:33:56 -05:00
overlays Tweak: Reset trade item cycling when pausing or changing pages (#2808) 2023-05-03 21:45:41 -04:00