aboutsummaryrefslogtreecommitdiff
path: root/engines/hugo
diff options
context:
space:
mode:
authorArnaud Boutonné2010-12-15 20:37:09 +0000
committerArnaud Boutonné2010-12-15 20:37:09 +0000
commit76eb9d7f6430a3528ba0688e8c3f8519b23fb8a5 (patch)
tree1ea586bed4a3f7e50d79a8f0cea14a1d6389b1ac /engines/hugo
parentca547118e39fb723d59c96487e3bfc451f0f46b4 (diff)
downloadscummvm-rg350-76eb9d7f6430a3528ba0688e8c3f8519b23fb8a5.tar.gz
scummvm-rg350-76eb9d7f6430a3528ba0688e8c3f8519b23fb8a5.tar.bz2
scummvm-rg350-76eb9d7f6430a3528ba0688e8c3f8519b23fb8a5.zip
HUGO: Clean-up, move MidiPlayer class definition to .h file
svn-id: r54923
Diffstat (limited to 'engines/hugo')
-rw-r--r--engines/hugo/hugo.cpp2
-rw-r--r--engines/hugo/object_v1d.cpp4
-rw-r--r--engines/hugo/object_v1w.cpp4
-rw-r--r--engines/hugo/object_v2d.cpp4
-rw-r--r--engines/hugo/object_v3d.cpp2
-rw-r--r--engines/hugo/parser.cpp2
-rw-r--r--engines/hugo/parser_v1w.cpp2
-rw-r--r--engines/hugo/sound.cpp47
-rw-r--r--engines/hugo/sound.h47
9 files changed, 56 insertions, 58 deletions
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 152e755cab..3093cd988f 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -354,7 +354,7 @@ void HugoEngine::runMachine() {
gameStatus.viewState = V_INTRO;
break;
case V_INTRO: // Do any game-dependant preamble
- if (_intro->introPlay()) { // Process intro screen
+ if (_intro->introPlay()) { // Process intro screen
_scheduler->newScreen(0); // Initialize first screen
gameStatus.viewState = V_PLAY;
}
diff --git a/engines/hugo/object_v1d.cpp b/engines/hugo/object_v1d.cpp
index 176acfb401..13233eb8df 100644
--- a/engines/hugo/object_v1d.cpp
+++ b/engines/hugo/object_v1d.cpp
@@ -209,7 +209,7 @@ void ObjectHandler_v1d::moveObjects() {
// Set first image in sequence (if multi-seq object)
if (obj->seqNumb == 4) {
if (!obj->vx) { // Got 4 directions
- if (obj->vx != dxOld) { // vx just stopped
+ if (obj->vx != dxOld) { // vx just stopped
if (dy > 0)
obj->currImagePtr = obj->seqList[DOWN].seqPtr;
else
@@ -243,7 +243,7 @@ void ObjectHandler_v1d::moveObjects() {
// Set first image in sequence (if multi-seq object)
if (obj->seqNumb > 1) {
if (!obj->vx && (obj->seqNumb > 2)) {
- if (obj->vx != dxOld) { // vx just stopped
+ if (obj->vx != dxOld) { // vx just stopped
if (obj->vy > 0)
obj->currImagePtr = obj->seqList[DOWN].seqPtr;
else
diff --git a/engines/hugo/object_v1w.cpp b/engines/hugo/object_v1w.cpp
index cec8ef032a..685a3fee23 100644
--- a/engines/hugo/object_v1w.cpp
+++ b/engines/hugo/object_v1w.cpp
@@ -210,7 +210,7 @@ void ObjectHandler_v1w::moveObjects() {
switch (obj->seqNumb) {
case 4:
if (!obj->vx) { // Got 4 directions
- if (obj->vx != obj->oldvx) { // vx just stopped
+ if (obj->vx != obj->oldvx) { // vx just stopped
if (dy >= 0)
obj->currImagePtr = obj->seqList[DOWN].seqPtr;
else
@@ -254,7 +254,7 @@ void ObjectHandler_v1w::moveObjects() {
// Set first image in sequence (if multi-seq object)
if (obj->seqNumb > 1) {
if (!obj->vx && (obj->seqNumb >= 4)) {
- if (obj->vx != obj->oldvx) { // vx just stopped
+ if (obj->vx != obj->oldvx) { // vx just stopped
if (obj->vy > 0)
obj->currImagePtr = obj->seqList[DOWN].seqPtr;
else
diff --git a/engines/hugo/object_v2d.cpp b/engines/hugo/object_v2d.cpp
index 2e1413a4a5..b75c73ac7b 100644
--- a/engines/hugo/object_v2d.cpp
+++ b/engines/hugo/object_v2d.cpp
@@ -213,7 +213,7 @@ void ObjectHandler_v2d::moveObjects() {
switch (obj->seqNumb) {
case 4:
if (!obj->vx) { // Got 4 directions
- if (obj->vx != obj->oldvx) { // vx just stopped
+ if (obj->vx != obj->oldvx) { // vx just stopped
if (dy > 0)
obj->currImagePtr = obj->seqList[DOWN].seqPtr;
else
@@ -257,7 +257,7 @@ void ObjectHandler_v2d::moveObjects() {
// Set first image in sequence (if multi-seq object)
if (obj->seqNumb > 1) {
if (!obj->vx && (obj->seqNumb >= 4)) {
- if (obj->vx != obj->oldvx) { // vx just stopped
+ if (obj->vx != obj->oldvx) { // vx just stopped
if (obj->vy > 0)
obj->currImagePtr = obj->seqList[DOWN].seqPtr;
else
diff --git a/engines/hugo/object_v3d.cpp b/engines/hugo/object_v3d.cpp
index e7408f0504..035bec33df 100644
--- a/engines/hugo/object_v3d.cpp
+++ b/engines/hugo/object_v3d.cpp
@@ -138,7 +138,7 @@ void ObjectHandler_v3d::moveObjects() {
// Set first image in sequence (if multi-seq object)
if (obj->seqNumb > 1) {
if (!obj->vx && (obj->seqNumb >= 4)) {
- if (obj->vx != obj->oldvx) { // vx just stopped
+ if (obj->vx != obj->oldvx) { // vx just stopped
if (obj->vy > 0)
obj->currImagePtr = obj->seqList[DOWN].seqPtr;
else
diff --git a/engines/hugo/parser.cpp b/engines/hugo/parser.cpp
index 7e2157039b..a07fbff319 100644
--- a/engines/hugo/parser.cpp
+++ b/engines/hugo/parser.cpp
@@ -62,7 +62,7 @@ void Parser::keyHandler(uint16 nChar, uint16 nFlags) {
bool repeatedFl = (nFlags & 0x4000); // TRUE if key is a repeat
// Process key down event - called from OnKeyDown()
- switch (nChar) { // Set various toggle states
+ switch (nChar) { // Set various toggle states
case Common::KEYCODE_ESCAPE: // Escape key, may want to QUIT
if (gameStatus.inventoryState == I_ACTIVE) // Remove inventory, if displayed
gameStatus.inventoryState = I_UP;
diff --git a/engines/hugo/parser_v1w.cpp b/engines/hugo/parser_v1w.cpp
index 51795be9c3..1fbf41a476 100644
--- a/engines/hugo/parser_v1w.cpp
+++ b/engines/hugo/parser_v1w.cpp
@@ -58,7 +58,7 @@ void Parser_v1w::keyHandler(uint16 nChar, uint16 nFlags) {
bool repeatedFl = (nFlags & 0x4000); // TRUE if key is a repeat
// Process key down event - called from OnKeyDown()
- switch (nChar) { // Set various toggle states
+ switch (nChar) { // Set various toggle states
case Common::KEYCODE_ESCAPE: // Escape key, may want to QUIT
if (gameStatus.inventoryState == I_ACTIVE) // Remove inventory, if displayed
gameStatus.inventoryState = I_UP;
diff --git a/engines/hugo/sound.cpp b/engines/hugo/sound.cpp
index 52ba60d2ac..2d674ce31d 100644
--- a/engines/hugo/sound.cpp
+++ b/engines/hugo/sound.cpp
@@ -36,8 +36,6 @@
#include "sound/decoders/raw.h"
#include "sound/audiostream.h"
-#include "sound/midiparser.h"
-#include "sound/mididrv.h"
#include "hugo/hugo.h"
#include "hugo/game.h"
@@ -46,51 +44,6 @@
namespace Hugo {
-class MidiPlayer : public MidiDriver {
-public:
-
- enum {
- NUM_CHANNELS = 16
- };
-
- MidiPlayer(MidiDriver *driver);
- ~MidiPlayer();
-
- void play(uint8 *stream, uint16 size);
- void stop();
- void pause(bool p);
- void updateTimer();
- void adjustVolume(int diff);
- void setVolume(int volume);
- int getVolume() const { return _masterVolume; }
- void setLooping(bool loop) { _isLooping = loop; }
-
- // MidiDriver interface
- int open();
- void close();
- void send(uint32 b);
- void metaEvent(byte type, byte *data, uint16 length);
- void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { }
- uint32 getBaseTempo() { return _driver ? _driver->getBaseTempo() : 0; }
- MidiChannel *allocateChannel() { return 0; }
- MidiChannel *getPercussionChannel() { return 0; }
-
-private:
-
- static void timerCallback(void *p);
-
- MidiDriver *_driver;
- MidiParser *_parser;
- uint8 *_midiData;
- bool _isLooping;
- bool _isPlaying;
- bool _paused;
- int _masterVolume;
- MidiChannel *_channelsTable[NUM_CHANNELS];
- uint8 _channelsVolume[NUM_CHANNELS];
- Common::Mutex _mutex;
-};
-
MidiPlayer::MidiPlayer(MidiDriver *driver)
: _driver(driver), _parser(0), _midiData(0), _isLooping(false), _isPlaying(false), _paused(false), _masterVolume(0) {
assert(_driver);
diff --git a/engines/hugo/sound.h b/engines/hugo/sound.h
index 202e497215..ab26e749a0 100644
--- a/engines/hugo/sound.h
+++ b/engines/hugo/sound.h
@@ -34,10 +34,55 @@
#define HUGO_SOUND_H
#include "sound/mixer.h"
+#include "sound/mididrv.h"
+#include "sound/midiparser.h"
namespace Hugo {
-class MidiPlayer;
+class MidiPlayer : public MidiDriver {
+public:
+
+ enum {
+ NUM_CHANNELS = 16
+ };
+
+ MidiPlayer(MidiDriver *driver);
+ ~MidiPlayer();
+
+ void play(uint8 *stream, uint16 size);
+ void stop();
+ void pause(bool p);
+ void updateTimer();
+ void adjustVolume(int diff);
+ void setVolume(int volume);
+ int getVolume() const { return _masterVolume; }
+ void setLooping(bool loop) { _isLooping = loop; }
+
+ // MidiDriver interface
+ int open();
+ void close();
+ void send(uint32 b);
+ void metaEvent(byte type, byte *data, uint16 length);
+ void setTimerCallback(void *timerParam, void (*timerProc)(void *)) { }
+ uint32 getBaseTempo() { return _driver ? _driver->getBaseTempo() : 0; }
+ MidiChannel *allocateChannel() { return 0; }
+ MidiChannel *getPercussionChannel() { return 0; }
+
+private:
+
+ static void timerCallback(void *p);
+
+ MidiDriver *_driver;
+ MidiParser *_parser;
+ uint8 *_midiData;
+ bool _isLooping;
+ bool _isPlaying;
+ bool _paused;
+ int _masterVolume;
+ MidiChannel *_channelsTable[NUM_CHANNELS];
+ uint8 _channelsVolume[NUM_CHANNELS];
+ Common::Mutex _mutex;
+};
class SoundHandler {
public: