aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus
diff options
context:
space:
mode:
authorMatthew Hoops2011-05-11 22:48:42 -0400
committerMatthew Hoops2011-05-11 22:48:42 -0400
commit866a8dddd1733734eb47091a21ccff00c416120b (patch)
tree97de61e52026113d8095e4d8669b68717c035475 /engines/pegasus
parent6067a46e9d4ac580d3dca7d38dfe4cc4a6c3f0cd (diff)
downloadscummvm-rg350-866a8dddd1733734eb47091a21ccff00c416120b.tar.gz
scummvm-rg350-866a8dddd1733734eb47091a21ccff00c416120b.tar.bz2
scummvm-rg350-866a8dddd1733734eb47091a21ccff00c416120b.zip
PEGASUS: Begin work on the interface overview
Diffstat (limited to 'engines/pegasus')
-rw-r--r--engines/pegasus/menu.cpp2
-rw-r--r--engines/pegasus/module.mk1
-rw-r--r--engines/pegasus/overview.cpp81
-rw-r--r--engines/pegasus/pegasus.cpp8
-rw-r--r--engines/pegasus/pegasus.h1
-rw-r--r--engines/pegasus/video.h6
6 files changed, 87 insertions, 12 deletions
diff --git a/engines/pegasus/menu.cpp b/engines/pegasus/menu.cpp
index 8f587c3095..ae8fba55e4 100644
--- a/engines/pegasus/menu.cpp
+++ b/engines/pegasus/menu.cpp
@@ -175,7 +175,7 @@ void PegasusEngine::setGameMode(int buttonSelected) {
} else {
switch (buttonSelected) {
case kInterfaceOverviewButton:
- warning("No overview just yet");
+ runInterfaceOverview();
break;
case kStartButton:
_gameMode = kMainGameMode;
diff --git a/engines/pegasus/module.mk b/engines/pegasus/module.mk
index 28a92aa800..5222c81be0 100644
--- a/engines/pegasus/module.mk
+++ b/engines/pegasus/module.mk
@@ -4,6 +4,7 @@ MODULE_OBJS = \
detection.o \
graphics.o \
menu.o \
+ overview.o \
pegasus.o \
sound.o \
video.o
diff --git a/engines/pegasus/overview.cpp b/engines/pegasus/overview.cpp
new file mode 100644
index 0000000000..249d76a3cd
--- /dev/null
+++ b/engines/pegasus/overview.cpp
@@ -0,0 +1,81 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/events.h"
+#include "common/textconsole.h"
+#include "graphics/cursorman.h"
+#include "video/qt_decoder.h"
+
+#include "pegasus/pegasus.h"
+
+namespace Pegasus {
+
+void PegasusEngine::runInterfaceOverview() {
+ CursorMan.showMouse(true);
+ _gfx->setCursor(kPointingCursor);
+
+ Video::QuickTimeDecoder *overviewVideo = new Video::QuickTimeDecoder();
+ if (!overviewVideo->loadFile("Images/Interface/Overview Mac.movie"))
+ error("Could not open overview video");
+
+ // Pause the video, we're only getting frames from it
+ overviewVideo->pauseVideo(true);
+
+ // Draw the main image
+ overviewVideo->seekToTime(1000);
+ _video->copyFrameToScreen(overviewVideo->decodeNextFrame(), overviewVideo->getWidth(), overviewVideo->getHeight(), kViewScreenOffset, kViewScreenOffset);
+
+ // Draw the rest of the interface
+ drawInterfaceOverview();
+
+ bool continueLooping = true;
+ while (!shouldQuit() && continueLooping) {
+ Common::Event event;
+ while (_eventMan->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_MOUSEMOVE:
+ _system->updateScreen();
+ break;
+ case Common::EVENT_KEYDOWN:
+ continueLooping = false;
+ break;
+ default:
+ break;
+ }
+ }
+
+ _system->delayMillis(10);
+ }
+
+ CursorMan.showMouse(false);
+ delete overviewVideo;
+}
+
+void PegasusEngine::drawInterfaceOverview() {
+ _gfx->drawPict("Images/Interface/OVTop.mac", 0, 0, false);
+ _gfx->drawPict("Images/Interface/OVLeft.mac", 0, kViewScreenOffset, false);
+ _gfx->drawPict("Images/Interface/OVRight.mac", 640 - kViewScreenOffset, kViewScreenOffset, false);
+ _gfx->drawPict("Images/Interface/OVBottom.mac", 0, kViewScreenOffset + 256, false);
+ _system->updateScreen();
+}
+
+} // End of namespace Pegasus
diff --git a/engines/pegasus/pegasus.cpp b/engines/pegasus/pegasus.cpp
index 9688a99c73..bd281cdae5 100644
--- a/engines/pegasus/pegasus.cpp
+++ b/engines/pegasus/pegasus.cpp
@@ -173,14 +173,6 @@ void PegasusEngine::drawInterface() {
_system->updateScreen();
}
-void PegasusEngine::drawInterfaceOverview() {
- _gfx->drawPict("Images/Interface/OVTop.mac", 0, 0, false);
- _gfx->drawPict("Images/Interface/OVLeft.mac", 0, kViewScreenOffset, false);
- _gfx->drawPict("Images/Interface/OVRight.mac", 640 - kViewScreenOffset, kViewScreenOffset, false);
- _gfx->drawPict("Images/Interface/OVBottom.mac", 0, kViewScreenOffset + 256, false);
- _system->updateScreen();
-}
-
void PegasusEngine::mainGameLoop() {
// TODO: Yeah...
_system->fillScreen(0);
diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h
index 30199f1755..1f9f92a032 100644
--- a/engines/pegasus/pegasus.h
+++ b/engines/pegasus/pegasus.h
@@ -214,6 +214,7 @@ private:
//void drawCompass();
//void runPauseMenu();
void showLoadDialog();
+ void runInterfaceOverview();
// Interface Overview
void drawInterfaceOverview();
diff --git a/engines/pegasus/video.h b/engines/pegasus/video.h
index ac071c03a5..56339e4c42 100644
--- a/engines/pegasus/video.h
+++ b/engines/pegasus/video.h
@@ -74,14 +74,14 @@ public:
void seekToTime(VideoHandle handle, uint32 time);
+ // Helper functions
+ void copyFrameToScreen(const Graphics::Surface *frame, int width, int height, int x, int y);
+
private:
PegasusEngine *_vm;
Video::QuickTimeDecoder *_timeZoneVideo;
- // Helper functions
- void copyFrameToScreen(const Graphics::Surface *frame, int width, int height, int x, int y);
-
// Keep tabs on any videos playing
Common::Array<VideoEntry> _videoStreams;
uint32 _pauseStart;