From 868717b444ff0755663037a6c9aa4ccdc8437010 Mon Sep 17 00:00:00 2001 From: Arnaud Boutonné Date: Fri, 7 Jan 2011 15:14:38 +0000 Subject: TOOLS: Add Dos intro music number in hugo.dat svn-id: r55145 --- engines/hugo/hugo.cpp | 1 + engines/hugo/hugo.h | 2 +- engines/hugo/intro_v3d.cpp | 2 ++ engines/hugo/sound.cpp | 8 ++++++++ engines/hugo/sound.h | 3 ++- 5 files changed, 14 insertions(+), 2 deletions(-) (limited to 'engines/hugo') diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp index 64b4116527..db0d7d5995 100644 --- a/engines/hugo/hugo.cpp +++ b/engines/hugo/hugo.cpp @@ -754,6 +754,7 @@ bool HugoEngine::loadHugoDat() { _object->loadNumObj(in); _scheduler->loadAlNewscrIndex(in); + _sound->loadIntroSong(in); _screen->loadFontArr(in); _topMenu->loadBmpArr(in); diff --git a/engines/hugo/hugo.h b/engines/hugo/hugo.h index 270ca25a48..119a9c3f6b 100644 --- a/engines/hugo/hugo.h +++ b/engines/hugo/hugo.h @@ -36,7 +36,7 @@ #include "hugo/file.h" #define HUGO_DAT_VER_MAJ 0 // 1 byte -#define HUGO_DAT_VER_MIN 36 // 1 byte +#define HUGO_DAT_VER_MIN 37 // 1 byte #define DATAALIGNMENT 4 #define EDGE 10 // Closest object can get to edge of screen #define EDGE2 (EDGE * 2) // Push object further back on edge collision diff --git a/engines/hugo/intro_v3d.cpp b/engines/hugo/intro_v3d.cpp index c56d740c2f..3afe7decd8 100644 --- a/engines/hugo/intro_v3d.cpp +++ b/engines/hugo/intro_v3d.cpp @@ -37,6 +37,7 @@ #include "hugo/file.h" #include "hugo/display.h" #include "hugo/util.h" +#include "hugo/sound.h" namespace Hugo { @@ -81,6 +82,7 @@ void intro_v3d::introInit() { _vm->_file->readBackground(22); // display screen MAP_3d _vm->_screen->displayBackground(); introTicks = 0; + _vm->_sound->DOSSongPtr = _vm->_sound->DOSIntroSong; } /** diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp index d79146401e..1ce85b9da5 100644 --- a/engines/hugo/sound.cpp +++ b/engines/hugo/sound.cpp @@ -472,4 +472,12 @@ void SoundHandler::pcspkr_player() { } } +void SoundHandler::loadIntroSong(Common::File &in) { + for (int varnt = 0; varnt < _vm->_numVariant; varnt++) { + uint16 numBuf = in.readUint16BE(); + if (varnt == _vm->_gameVariant) + DOSIntroSong = _vm->_textData[numBuf]; + } +} + } // End of namespace Hugo diff --git a/engines/hugo/sound.h b/engines/hugo/sound.h index 74f87d790e..096c66be15 100644 --- a/engines/hugo/sound.h +++ b/engines/hugo/sound.h @@ -75,7 +75,6 @@ public: MidiChannel *getPercussionChannel() { return 0; } private: - static void timerCallback(void *p); MidiDriver *_driver; @@ -96,6 +95,7 @@ public: ~SoundHandler(); char *DOSSongPtr; + char *DOSIntroSong; void toggleMusic(); void toggleSound(); @@ -106,6 +106,7 @@ public: void initSound(); void syncVolume(); void checkMusic(); + void loadIntroSong(Common::File &in); private: HugoEngine *_vm; -- cgit v1.2.3