libsaria: Improve random_next()

Limiting rand to plist.size() * (3 / 4) kept causing songs at the end of
the range to get selected.  This caused a backwards-scrolling effect as
songs were played.  Instead, I want to pick from the next half of the
list to create a forward-scrolling effect.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-04-13 08:08:07 -04:00
parent 570374f53d
commit 45c839c04a
1 changed files with 1 additions and 1 deletions

View File

@ -62,7 +62,7 @@ namespace libsaria
return picked_next();
}
n = rand() % ((size * 3) / 4);
n = rand() % (size / 2);
for (unsigned int i = 0; i < n; i++)
incr_iter();