mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-10 16:49:36 +00:00
fix random splash file selection logic in SplashScreenView (#2999)
This commit is contained in:
@@ -1089,7 +1089,7 @@ void SplashScreenView::get_random_splash_file(std::filesystem::path& path) {
|
|||||||
(ext[3] == 'P' || ext[3] == 'p')) {
|
(ext[3] == 'P' || ext[3] == 'p')) {
|
||||||
valid_count++;
|
valid_count++;
|
||||||
// Reservoir Sampling:
|
// Reservoir Sampling:
|
||||||
if ((myrand(&rng_state) % valid_count) == 0) {
|
if (((rng_state = myrand(&rng_state)) % valid_count) == 0) {
|
||||||
path = splash_dir / fno.fname;
|
path = splash_dir / fno.fname;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user