aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/game.cpp
diff options
context:
space:
mode:
authorRobert Špalek2009-10-22 07:34:43 +0000
committerRobert Špalek2009-10-22 07:34:43 +0000
commit819449d09907f97c09048268eb52e54b9d9b33c0 (patch)
tree2771cbcd5dbab1d93be7e33b4fd4520ae24613bf /engines/draci/game.cpp
parent93517e7649da286cd5b86efb3ee2e5cf7e7be436 (diff)
downloadscummvm-rg350-819449d09907f97c09048268eb52e54b9d9b33c0.tar.gz
scummvm-rg350-819449d09907f97c09048268eb52e54b9d9b33c0.tar.bz2
scummvm-rg350-819449d09907f97c09048268eb52e54b9d9b33c0.zip
Implemented GPL2 commands for music.
Debugged everything. svn-id: r45330
Diffstat (limited to 'engines/draci/game.cpp')
-rw-r--r--engines/draci/game.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp
index 773f97ce64..da94c261d3 100644
--- a/engines/draci/game.cpp
+++ b/engines/draci/game.cpp
@@ -1009,7 +1009,8 @@ void Game::loadRoom(int roomNum) {
roomReader.readUint16LE(); // Program length, not used
roomReader.readUint32LE(); // Pointer to room title, not used
- _currentRoom._music = roomReader.readByte();
+ // Music will be played by the GPL2 command startMusic when needed.
+ setMusicTrack(roomReader.readByte());
int mapID = roomReader.readByte() - 1;
loadWalkingMap(mapID);
@@ -1044,7 +1045,7 @@ void Game::loadRoom(int roomNum) {
_currentRoom._escRoom = roomReader.readByte() - 1;
_currentRoom._numGates = roomReader.readByte();
- debugC(4, kDraciLogicDebugLevel, "Music: %d", _currentRoom._music);
+ debugC(4, kDraciLogicDebugLevel, "Music: %d", getMusicTrack());
debugC(4, kDraciLogicDebugLevel, "Map: %d", mapID);
debugC(4, kDraciLogicDebugLevel, "Palette: %d", _currentRoom._palette);
debugC(4, kDraciLogicDebugLevel, "Overlays: %d", _currentRoom._numOverlays);
@@ -1123,12 +1124,6 @@ void Game::loadRoom(int roomNum) {
Animation *map = _vm->_anims->addAnimation(kWalkingMapOverlay, 255, false);
map->addFrame(ov, NULL);
-
- if (_currentRoom._music) {
- _vm->_music->playSMF(_currentRoom._music, true);
- } else {
- _vm->_music->stop();
- }
}
int Game::loadAnimation(uint animNum, uint z) {
@@ -1430,6 +1425,14 @@ double Game::getPersStep() const {
return _currentRoom._persStep;
}
+int Game::getMusicTrack() const {
+ return _currentRoom._music;
+}
+
+void Game::setMusicTrack(int num) {
+ _currentRoom._music = num;
+}
+
int Game::getRoomNum() const {
return _currentRoom._roomNum;
}