Commit Graph

3 Commits

Author SHA1 Message Date
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
briaguya ba13e6b2c4 refactor: use LUS 1.0 RC
Co-authored-by: kenix3 <kenixwhisperwind@gmail.com>
Co-authored-by: David Chavez <david@dcvz.io>
Co-authored-by: KiritoDv <kiritodev01@gmail.com>
Co-authored-by: Christopher Leggett <chris@leggett.dev>
2023-01-17 00:33:56 -05:00
M4xw 39cc86c260 git subrepo clone https://github.com/HarbourMasters/soh.git
subrepo:
  subdir:   "soh"
  merged:   "ba904bbd0"
upstream:
  origin:   "https://github.com/HarbourMasters/soh.git"
  branch:   "master"
  commit:   "ba904bbd0"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-22 02:51:23 +01:00