1
0
Fork 0

Play into subsequent track(s) if playback length exceeds the the current track

Issue reported by Dagar and Pr3tty F1y, and confirmed as a bug by ripsaw8080.
Thank you!

This fixes the GoG release of Betrayal at Krondor which (either due to CD mastering
issues or a faulty rip), requests playback of a given track at the tail end
of the prior track.

In debugging and performing this fix, many debug messages were improved as well
as making some small small code adjustments, such as using iterators to point to
individual tracks (track->attribute) instead of using the tracks array
(tracks[track -1].attribute).
This commit is contained in:
krcroft 2019-11-20 00:04:14 -08:00 committed by Patryk Obara
parent 90e5e0e82a
commit eaeb001b17
9 changed files with 590 additions and 429 deletions

View file

@ -20,6 +20,7 @@
#ifndef DOSBOX_SUPPORT_H
#define DOSBOX_SUPPORT_H
#include <algorithm>
#include <string.h>
#include <string>
#include <ctype.h>
@ -38,6 +39,14 @@
#include <strings.h>
#endif
// Clamp: given a value that can be compared with the given minimum and maximum
// values, this function will:
// * return the value if it's in-between or equal to either bounds, or
// * return either bound depending on which bound the value is beyond
template <class T> T clamp(const T& n, const T& lower, const T& upper) {
return std::max<T>(lower, std::min<T>(n, upper));
}
void strreplace(char * str,char o,char n);
char *ltrim(char *str);
char *rtrim(char *str);