aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2014-07-11 00:38:31 +0200
committerJohannes Schickel2014-07-11 00:38:31 +0200
commitf8d0a48dcd7efc9194cc3ae13bfbbd883d6a3836 (patch)
treed01519649b9ed1316ad4bf032ce9fc6149344e87
parentc528af49eb164254bba3bbeaf728b139b1b53cbb (diff)
downloadscummvm-rg350-f8d0a48dcd7efc9194cc3ae13bfbbd883d6a3836.tar.gz
scummvm-rg350-f8d0a48dcd7efc9194cc3ae13bfbbd883d6a3836.tar.bz2
scummvm-rg350-f8d0a48dcd7efc9194cc3ae13bfbbd883d6a3836.zip
Revert "MT32: Avoid runtime abort due to non-POD object pass in MT32 Emulator."
This reverts commit 6731eb21e3e4c1fa2470ed03a3547d45b3dff6e3.
-rw-r--r--audio/softsynth/mt32/Synth.cpp14
-rw-r--r--audio/softsynth/mt32/Synth.h4
2 files changed, 16 insertions, 2 deletions
diff --git a/audio/softsynth/mt32/Synth.cpp b/audio/softsynth/mt32/Synth.cpp
index 50b3fe610c..c6ecf47cad 100644
--- a/audio/softsynth/mt32/Synth.cpp
+++ b/audio/softsynth/mt32/Synth.cpp
@@ -15,6 +15,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+//#include <cerrno>
+//#include <cmath>
+//#include <cstdlib>
+//#include <cstring>
+
#include "mt32emu.h"
#include "mmath.h"
#include "PartialManager.h"
@@ -94,6 +99,11 @@ void ReportHandler::showLCDMessage(const char *data) {
debug("\n");
}
+void ReportHandler::printDebug(const char *fmt, va_list list) {
+ debug(fmt, list);
+ debug("\n");
+}
+
void Synth::polyStateChanged(int partNum) {
reportHandler->onPolyStateChanged(partNum);
}
@@ -106,9 +116,9 @@ void Synth::printDebug(const char *fmt, ...) {
va_list ap;
va_start(ap, fmt);
#if MT32EMU_DEBUG_SAMPLESTAMPS > 0
- debug("[%u] ", renderedSampleCount);
+ reportHandler->printDebug("[%u] ", renderedSampleCount);
#endif
- debug(fmt, ap);
+ reportHandler->printDebug(fmt, ap);
va_end(ap);
}
diff --git a/audio/softsynth/mt32/Synth.h b/audio/softsynth/mt32/Synth.h
index 2ad0028e1f..37fb7b280a 100644
--- a/audio/softsynth/mt32/Synth.h
+++ b/audio/softsynth/mt32/Synth.h
@@ -236,6 +236,10 @@ public:
virtual ~ReportHandler() {}
protected:
+
+ // Callback for debug messages, in vprintf() format
+ virtual void printDebug(const char *fmt, va_list list);
+
// Callbacks for reporting various errors and information
virtual void onErrorControlROM() {}
virtual void onErrorPCMROM() {}