aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/lab/eventman.cpp23
-rw-r--r--engines/lab/eventman.h42
-rw-r--r--engines/lab/image.cpp15
-rw-r--r--engines/lab/image.h15
-rw-r--r--engines/lab/interface.cpp10
-rw-r--r--engines/lab/music.cpp34
-rw-r--r--engines/lab/music.h44
7 files changed, 101 insertions, 82 deletions
diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp
index 000aaa7cb6..d2cf508391 100644
--- a/engines/lab/eventman.cpp
+++ b/engines/lab/eventman.cpp
@@ -59,10 +59,6 @@ static const byte mouseData[] = {
#define MOUSE_WIDTH 10
#define MOUSE_HEIGHT 15
-/**
- * Checks whether or not the cords fall within one of the buttons in a list
- * of buttons.
- */
Button *EventManager::checkButtonHit(ButtonList *buttonList, Common::Point pos) {
for (ButtonList::iterator buttonItr = buttonList->begin(); buttonItr != buttonList->end(); ++buttonItr) {
Button *button = *buttonItr;
@@ -151,9 +147,6 @@ void EventManager::updateMouse() {
_vm->_graphics->screenUpdate();
}
-/**
- * Initializes the mouse.
- */
void EventManager::initMouse() {
g_system->setMouseCursor(mouseData, MOUSE_WIDTH, MOUSE_HEIGHT, 0, 0, 0);
g_system->showMouse(false);
@@ -161,9 +154,6 @@ void EventManager::initMouse() {
setMousePos(Common::Point(0, 0));
}
-/**
- * Shows the mouse.
- */
void EventManager::mouseShow() {
if (_mouseHidden) {
processInput();
@@ -173,9 +163,6 @@ void EventManager::mouseShow() {
g_system->showMouse(true);
}
-/**
- * Hides the mouse.
- */
void EventManager::mouseHide() {
if (!_mouseHidden) {
_mouseHidden = true;
@@ -184,10 +171,6 @@ void EventManager::mouseHide() {
}
}
-/**
- * Gets the current mouse co-ordinates. NOTE: On IBM version, will scale
- * from virtual to screen co-ordinates automatically.
- */
Common::Point EventManager::getMousePos() {
if (_vm->_isHiRes)
return _mousePos;
@@ -195,9 +178,6 @@ Common::Point EventManager::getMousePos() {
return Common::Point(_mousePos.x / 2, _mousePos.y);
}
-/**
- * Moves the mouse to new co-ordinates.
- */
void EventManager::setMousePos(Common::Point pos) {
if (_vm->_isHiRes)
g_system->warpMouse(pos.x, pos.y);
@@ -208,9 +188,6 @@ void EventManager::setMousePos(Common::Point pos) {
processInput();
}
-/**
- * Checks whether or not a key has been pressed.
- */
bool EventManager::keyPress(Common::KeyCode *keyCode) {
if (haveNextChar()) {
*keyCode = getNextChar();
diff --git a/engines/lab/eventman.h b/engines/lab/eventman.h
index eab5f31c80..963972165d 100644
--- a/engines/lab/eventman.h
+++ b/engines/lab/eventman.h
@@ -87,11 +87,28 @@ private:
Common::KeyState _keyPressed;
private:
+ /**
+ * Checks whether or not the cords fall within one of the buttons in a list
+ * of buttons.
+ */
Button *checkButtonHit(ButtonList *buttonList, Common::Point pos);
+
+ /**
+ * Checks whether or not a key has been pressed.
+ */
bool keyPress(Common::KeyCode *keyCode);
bool haveNextChar();
Common::KeyCode getNextChar();
+
+ /**
+ * Checks whether or not the coords fall within one of the buttons in a list
+ * of buttons.
+ */
Button *checkNumButtonHit(ButtonList *buttonList, uint16 key);
+
+ /**
+ * Make a key press have the right case for a button KeyEquiv value.
+ */
uint16 makeButtonKeyEquiv(uint16 key);
public:
@@ -100,15 +117,40 @@ public:
void attachButtonList(ButtonList *buttonList);
Button *createButton(uint16 x, uint16 y, uint16 id, uint16 key, Image *image, Image *altImage);
void toggleButton(Button *button, uint16 penColor, bool enable);
+
+ /**
+ * Draws a button list to the screen.
+ */
void drawButtonList(ButtonList *buttonList);
void freeButtonList(ButtonList *buttonList);
Button *getButton(uint16 id);
+
+ /**
+ * Gets the current mouse co-ordinates. NOTE: On IBM version, will scale
+ * from virtual to screen co-ordinates automatically.
+ */
Common::Point getMousePos();
IntuiMessage *getMsg();
+
+ /**
+ * Initializes the mouse.
+ */
void initMouse();
+
+ /**
+ * Shows the mouse.
+ */
void mouseShow();
+
+ /**
+ * Hides the mouse.
+ */
void mouseHide();
void processInput();
+
+ /**
+ * Moves the mouse to new co-ordinates.
+ */
void setMousePos(Common::Point pos);
void updateMouse();
Common::Point updateAndGetMousePos();
diff --git a/engines/lab/image.cpp b/engines/lab/image.cpp
index 9b2b99d241..ce0d5431b6 100644
--- a/engines/lab/image.cpp
+++ b/engines/lab/image.cpp
@@ -37,9 +37,6 @@
namespace Lab {
-/**
- * Reads in an image from disk.
- */
Image::Image(Common::File *s, LabEngine *vm) : _vm(vm) {
_width = s->readUint16LE();
_height = s->readUint16LE();
@@ -57,9 +54,6 @@ Image::~Image() {
delete[] _imageData;
}
-/**
- * Blits a piece of one image to another.
- */
void Image::blitBitmap(uint16 xs, uint16 ys, Image *imDest,
uint16 xd, uint16 yd, uint16 width, uint16 height, byte masked) {
int w = width;
@@ -106,23 +100,14 @@ void Image::blitBitmap(uint16 xs, uint16 ys, Image *imDest,
}
}
-/**
- * Draws an image to the screen.
- */
void Image::drawImage(uint16 x, uint16 y) {
blitBitmap(0, 0, nullptr, x, y, _width, _height, false);
}
-/**
- * Draws an image to the screen with transparency.
- */
void Image::drawMaskImage(uint16 x, uint16 y) {
blitBitmap(0, 0, nullptr, x, y, _width, _height, true);
}
-/**
- * Reads an image from the screen.
- */
void Image::readScreenImage(uint16 x, uint16 y) {
int w = _width;
int h = _height;
diff --git a/engines/lab/image.h b/engines/lab/image.h
index e95125eaab..bac32cd763 100644
--- a/engines/lab/image.h
+++ b/engines/lab/image.h
@@ -52,9 +52,24 @@ public:
Image(Common::File *s, LabEngine *vm);
virtual ~Image();
+ /**
+ * Draws an image to the screen.
+ */
void drawImage(uint16 x, uint16 y);
+
+ /**
+ * Draws an image to the screen with transparency.
+ */
void drawMaskImage(uint16 x, uint16 y);
+
+ /**
+ * Reads an image from the screen.
+ */
void readScreenImage(uint16 x, uint16 y);
+
+ /**
+ * Blits a piece of one image to another.
+ */
void blitBitmap(uint16 xs, uint16 ys, Image *ImDest, uint16 xd, uint16 yd, uint16 width, uint16 height, byte masked);
};
diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp
index 41749f1256..7fb3ba2af1 100644
--- a/engines/lab/interface.cpp
+++ b/engines/lab/interface.cpp
@@ -67,9 +67,6 @@ void EventManager::freeButtonList(ButtonList *buttonList) {
buttonList->clear();
}
-/**
- * Draws a button list to the screen.
- */
void EventManager::drawButtonList(ButtonList *buttonList) {
for (ButtonList::iterator button = buttonList->begin(); button != buttonList->end(); ++button) {
toggleButton((*button), 1, true);
@@ -88,9 +85,6 @@ void EventManager::toggleButton(Button *button, uint16 disabledPenColor, bool en
button->_isEnabled = enable;
}
-/**
- * Make a key press have the right case for a button KeyEquiv value.
- */
uint16 EventManager::makeButtonKeyEquiv(uint16 key) {
if (Common::isAlnum(key))
key = tolower(key);
@@ -98,10 +92,6 @@ uint16 EventManager::makeButtonKeyEquiv(uint16 key) {
return key;
}
-/**
- * Checks whether or not the coords fall within one of the buttons in a list
- * of buttons.
- */
Button *EventManager::checkNumButtonHit(ButtonList *buttonList, uint16 key) {
uint16 gkey = key - '0';
diff --git a/engines/lab/music.cpp b/engines/lab/music.cpp
index 5ff23ea87b..78887f1780 100644
--- a/engines/lab/music.cpp
+++ b/engines/lab/music.cpp
@@ -63,10 +63,6 @@ Music::Music(LabEngine *vm) : _vm(vm) {
_waitTillFinished = false;
}
-/**
- * Figures out which buffer is currently playing based on messages sent to
- * it from the Audio device.
- */
void Music::updateMusic() {
_vm->_event->processInput();
_vm->_event->updateMouse();
@@ -149,9 +145,6 @@ void Music::fillbuffer(byte *musicBuffer) {
}
}
-/**
- * Starts up the music initially.
- */
void Music::startMusic(bool restartFl) {
if (!_musicOn)
return;
@@ -167,9 +160,6 @@ void Music::startMusic(bool restartFl) {
updateMusic();
}
-/**
- * Initializes the music buffers.
- */
bool Music::initMusic(const Common::String filename) {
_musicOn = true;
_musicPaused = false;
@@ -178,9 +168,6 @@ bool Music::initMusic(const Common::String filename) {
return true;
}
-/**
- * Frees up the music buffers and closes the file.
- */
void Music::freeMusic() {
_musicOn = false;
@@ -192,9 +179,6 @@ void Music::freeMusic() {
_file = nullptr;
}
-/**
- * Pauses the background music.
- */
void Music::pauseBackMusic() {
if (!_musicPaused && _musicOn) {
updateMusic();
@@ -207,9 +191,6 @@ void Music::pauseBackMusic() {
}
}
-/**
- * Resumes the paused background music.
- */
void Music::resumeBackMusic() {
if (_musicPaused) {
stopSoundEffect();
@@ -222,9 +203,6 @@ void Music::resumeBackMusic() {
}
}
-/**
- * Turns the music on and off.
- */
void Music::setMusic(bool on) {
stopSoundEffect();
@@ -238,9 +216,6 @@ void Music::setMusic(bool on) {
_musicOn = on;
}
-/**
- * Checks the music that should be playing in a particular room.
- */
void Music::checkRoomMusic() {
if ((_lastMusicRoom == _vm->_roomNum) || !_musicOn)
return;
@@ -255,9 +230,6 @@ void Music::checkRoomMusic() {
_lastMusicRoom = _vm->_roomNum;
}
-/**
- * Changes the background music to something else.
- */
void Music::changeMusic(const Common::String filename) {
if (!_tFile) {
_tFile = _file;
@@ -278,9 +250,6 @@ void Music::changeMusic(const Common::String filename) {
setMusic(true);
}
-/**
- * Changes the background music to the original piece playing.
- */
void Music::resetMusic() {
if (!_tFile)
return;
@@ -308,9 +277,6 @@ void Music::resetMusic() {
_tFile = 0;
}
-/**
- * Reads in a music file. Ignores any graphics.
- */
bool Music::readMusic(const Common::String filename, bool waitTillFinished) {
Common::File *file = _vm->_resource->openDataFile(filename, MKTAG('D', 'I', 'F', 'F'));
updateMusic();
diff --git a/engines/lab/music.h b/engines/lab/music.h
index a6f836952c..857ea81569 100644
--- a/engines/lab/music.h
+++ b/engines/lab/music.h
@@ -69,8 +69,16 @@ private:
private:
void fillbuffer(byte *musicBuffer);
uint16 getPlayingBufferCount();
+
+ /**
+ * Pauses the background music.
+ */
void pauseBackMusic();
void readSound(bool waitTillFinished, Common::File *file);
+
+ /**
+ * Starts up the music initially.
+ */
void startMusic(bool restartFl);
public:
@@ -80,18 +88,54 @@ public:
public:
Music(LabEngine *vm);
+ /**
+ * Changes the background music to something else.
+ */
void changeMusic(const Common::String filename);
+
+ /**
+ * Checks the music that should be playing in a particular room.
+ */
void checkRoomMusic();
+
+ /**
+ * Frees up the music buffers and closes the file.
+ */
void freeMusic();
+
+ /**
+ * Initializes the music buffers.
+ */
bool initMusic(const Common::String filename);
bool isSoundEffectActive() const;
void playSoundEffect(uint16 sampleSpeed, uint32 length, Common::File *dataFile);
+
+ /**
+ * Reads in a music file. Ignores any graphics.
+ */
bool readMusic(const Common::String filename, bool waitTillFinished);
+
+ /**
+ * Changes the background music to the original piece playing.
+ */
void resetMusic();
+
+ /**
+ * Resumes the paused background music.
+ */
void resumeBackMusic();
+
+ /**
+ * Turns the music on and off.
+ */
void setMusic(bool on);
void setMusicReset(bool reset) { _doReset = reset; }
void stopSoundEffect();
+
+ /**
+ * Figures out which buffer is currently playing based on messages sent to
+ * it from the Audio device.
+ */
void updateMusic();
};