Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load samples asynchronously in a separate thread
Whenever Dirt needs to load up a new sample from disk, it now creates a thread for reading and loading sound data into cache. Meanwhile the main thread continues playing, solving the problem with large sample files blocking the main execution thread. To keep it simple, there can only be one thread for file reading (no queue), and to enforce that, there is a boolean variable (and its corresponding mutex) that determines if there is actually one running.
- Loading branch information
Showing
2 changed files
with
101 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters