MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / RideUpdateMusicPosition

Function RideUpdateMusicPosition

src/openrct2/ride/RideAudio.cpp:298–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

296 }
297
298 static void RideUpdateMusicPosition(Ride& ride)
299 {
300 auto [trackOffset, trackLength] = RideMusicGetTrackOffsetLength(ride);
301 auto position = ride.musicPosition + trackOffset;
302 if (position < trackLength)
303 {
304 ride.musicPosition = position;
305 }
306 else
307 {
308 ride.musicTuneId = kTuneIDNull;
309 ride.musicPosition = 0;
310 }
311 }
312
313 static void RideUpdateMusicPosition(
314 Ride& ride, size_t offset, size_t length, int16_t volume, int16_t pan, uint16_t sampleRate)

Callers 1

UpdateMusicInstanceFunction · 0.85

Calls 6

endMethod · 0.65
sizeMethod · 0.45
beginMethod · 0.45
IsPlayingMethod · 0.45
GetOffsetMethod · 0.45

Tested by

no test coverage detected