MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / LoadBasesetSound

Function LoadBasesetSound

src/soundloader.cpp:53–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53static bool LoadBasesetSound(SoundEntry &sound, bool new_format, SoundID sound_id)
54{
55 sound.file->SeekTo(sound.file_offset, SEEK_SET);
56
57 /* Read name of sound for diagnostics. */
58 size_t name_len = sound.file->ReadByte();
59 std::string name(name_len, '\0');
60 sound.file->ReadBlock(name.data(), name_len);
61
62 return LoadSoundData(sound, new_format, sound_id, StrMakeValid(name));
63}
64
65bool LoadSound(SoundEntry &sound, SoundID sound_id)
66{

Callers 1

LoadSoundFunction · 0.85

Calls 6

LoadSoundDataFunction · 0.85
SeekToMethod · 0.80
ReadBlockMethod · 0.80
StrMakeValidFunction · 0.70
ReadByteMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected