Codechange: Implement SoundLoader interface and cache loaded sounds in memory.
Sounds are loaded into memory on first use, using the SoundLoader interface to support format conversion. Sounds are retained in memory to avoid reloading every time a sound is played. This deduplicates WAV header parsing between NewGRF and baseset sounds, and will allow different audio formats to be supported.
This commit is contained in:
committed by
Peter Nelson
parent
7e8bcf44f7
commit
ce5279a8dc
@@ -7914,6 +7914,7 @@ static void LoadGRFSound(size_t offs, SoundEntry *sound)
|
||||
/* Sound is present in the NewGRF. */
|
||||
sound->file = _cur.file;
|
||||
sound->file_offset = offs;
|
||||
sound->source = SoundSource::NewGRF;
|
||||
sound->grf_container_ver = _cur.file->GetContainerVersion();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user