aboutsummaryrefslogtreecommitdiff
path: root/engines/draci
diff options
context:
space:
mode:
authorJohannes Schickel2010-10-13 03:57:44 +0000
committerJohannes Schickel2010-10-13 03:57:44 +0000
commit75e8452b6e6a2bf4fb2f588aa00b428a60d873b5 (patch)
treef29541d55309487a94bd1d38e8b53bb3dde9aec6 /engines/draci
parent48ee83b88957dab86bc763e9ef21a70179fa8679 (diff)
parente9f50882ea5b6beeefa994040be9d3bab6a1f107 (diff)
downloadscummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.gz
scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.tar.bz2
scummvm-rg350-75e8452b6e6a2bf4fb2f588aa00b428a60d873b5.zip
OPENGL: Merged from trunk, from rev 52105 to 53396.
This includes an rather hacky attempt to merge all the recent gp2x backend changes into the branch. I suppose the gp2x backend and probably all new backends, i.e. gph, dingux etc., might not compile anymore. Since I have no way of testing those it would be nice if porters could look into getting those up to speed in this branch. svn-id: r53399
Diffstat (limited to 'engines/draci')
-rw-r--r--engines/draci/draci.cpp1
-rw-r--r--engines/draci/music.cpp16
-rw-r--r--engines/draci/script.cpp4
3 files changed, 13 insertions, 8 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index cd3920b30d..814159dbbb 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -170,6 +170,7 @@ int DraciEngine::init() {
_music = new MusicPlayer(_midiDriver, musicPathMask);
_music->setNativeMT32(native_mt32);
+ _music->open();
//_music->setAdLib(adlib);
// Load the game's fonts
diff --git a/engines/draci/music.cpp b/engines/draci/music.cpp
index 8186d36068..95b7ae08da 100644
--- a/engines/draci/music.cpp
+++ b/engines/draci/music.cpp
@@ -38,15 +38,10 @@ namespace Draci {
MusicPlayer::MusicPlayer(MidiDriver *driver, const char *pathMask) : _parser(0), _driver(driver), _pathMask(pathMask), _looping(false), _isPlaying(false), _passThrough(false), _isGM(false), _track(-1) {
memset(_channel, 0, sizeof(_channel));
- memset(_channelVolume, 255, sizeof(_channelVolume));
+ memset(_channelVolume, 127, sizeof(_channelVolume));
_masterVolume = 0;
- this->open();
_smfParser = MidiParser::createParser_SMF();
_midiMusicData = NULL;
-
- // TODO: Load cmf.ins with the instrument table. It seems that an
- // interface for such an operation is supported for AdLib. Maybe for
- // this card, setting instruments is necessary.
}
MusicPlayer::~MusicPlayer() {
@@ -89,6 +84,15 @@ int MusicPlayer::open() {
if (ret)
return ret;
+ if (_nativeMT32)
+ _driver->sendMT32Reset();
+ else
+ _driver->sendGMReset();
+
+ // TODO: Load cmf.ins with the instrument table. It seems that an
+ // interface for such an operation is supported for AdLib. Maybe for
+ // this card, setting instruments is necessary.
+
_driver->setTimerCallback(this, &onTimer);
return 0;
}
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp
index 7a6a68618d..f657dfe33c 100644
--- a/engines/draci/script.cpp
+++ b/engines/draci/script.cpp
@@ -967,7 +967,7 @@ int Script::handleMathExpression(Common::MemoryReadStream *reader) const {
func = _functionList[value-1];
// If not yet implemented
- if (func._handler == NULL) {
+ if (func._handler == 0) {
stk.pop();
// Pushing dummy value
@@ -1170,7 +1170,7 @@ void Script::run(const GPL2Program &program, uint16 offset) {
GPLHandler handler = cmd->_handler;
- if (handler != NULL) {
+ if (handler != 0) {
// Call the handler for the current command
(this->*(cmd->_handler))(params);
}