diff options
author | Matthew Hoops | 2011-05-12 12:14:47 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-05-12 12:14:47 -0400 |
commit | 5a86c56b8ccefcbb3111148f93ab774bc0e13372 (patch) | |
tree | 7f9dbae1175e109b73e54d964cf0fa64c6cbc08a /engines/pegasus | |
parent | 02b023e2660612f7dadc8cca0233c123ae41b950 (diff) | |
download | scummvm-rg350-5a86c56b8ccefcbb3111148f93ab774bc0e13372.tar.gz scummvm-rg350-5a86c56b8ccefcbb3111148f93ab774bc0e13372.tar.bz2 scummvm-rg350-5a86c56b8ccefcbb3111148f93ab774bc0e13372.zip |
PEGASUS: Finish overview implementation
Only thick rects remain there
Diffstat (limited to 'engines/pegasus')
-rw-r--r-- | engines/pegasus/menu.cpp | 2 | ||||
-rw-r--r-- | engines/pegasus/overview.cpp | 67 | ||||
-rw-r--r-- | engines/pegasus/pegasus.h | 13 |
3 files changed, 71 insertions, 11 deletions
diff --git a/engines/pegasus/menu.cpp b/engines/pegasus/menu.cpp index ae8fba55e4..0febdd6fb0 100644 --- a/engines/pegasus/menu.cpp +++ b/engines/pegasus/menu.cpp @@ -175,7 +175,9 @@ void PegasusEngine::setGameMode(int buttonSelected) { } else { switch (buttonSelected) { case kInterfaceOverviewButton: + _sound->stopSound(); runInterfaceOverview(); + _sound->playSound("Sounds/Main Menu.aiff", true); break; case kStartButton: _gameMode = kMainGameMode; diff --git a/engines/pegasus/overview.cpp b/engines/pegasus/overview.cpp index 7ba4d65c93..5772707acd 100644 --- a/engines/pegasus/overview.cpp +++ b/engines/pegasus/overview.cpp @@ -39,31 +39,65 @@ void PegasusEngine::runInterfaceOverview() { // 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); + + static const OverviewHotspot overviewHotspots[] = { + { Common::Rect(0, 0, 640, 480), 1000 }, // Main + { Common::Rect(131, 39, 212, 63), 660 }, // Date + { Common::Rect(210, 33, 326, 63), 330 }, // Compass + { Common::Rect(324, 39, 448, 63), 800 }, // Energy Bar + { Common::Rect(531, 35, 601, 57), 2330 }, // Energy Alert + { Common::Rect(63, 63, 577, 321), 1730 }, // View Window + { Common::Rect(69, 317, 355, 331), 1360 }, // Inventory Panel + { Common::Rect(353, 317, 559, 331), 130 }, // BioChip Panel + { Common::Rect(75, 333, 173, 431), 1460 }, // Inventory Box + { Common::Rect(171, 333, 365, 431), 2060 }, // Inventory/BioChip Display + { Common::Rect(363, 333, 461, 431), 1860 }, // BioChip Box + { Common::Rect(540, 348, 640, 468), 530 }, // Keyboard + }; // Draw the rest of the interface - drawInterfaceOverview(); + int curHotspot; + for (int i = 0; i < ARRAYSIZE(overviewHotspots); i++) + if (overviewHotspots[i].rect.contains(_eventMan->getMousePos())) + curHotspot = i; + drawInterfaceOverview(overviewHotspots[curHotspot], overviewVideo); + _system->updateScreen(); bool continueLooping = true; while (!shouldQuit() && continueLooping) { Common::Event event; while (_eventMan->pollEvent(event)) { + bool updateScreen = false; + switch (event.type) { case Common::EVENT_MOUSEMOVE: - // TODO: Highlighted images and changing the viewscreen image - _system->updateScreen(); + updateScreen = true; break; case Common::EVENT_KEYDOWN: // Break on any keypress, but ignore the meta keys // Except for num lock! num lock on OS9 is 'clear' and we need that for the inventory panel (along with the tilde) continueLooping = (event.kbd.keycode == Common::KEYCODE_INVALID || (event.kbd.keycode >= Common::KEYCODE_CAPSLOCK && event.kbd.keycode <= Common::KEYCODE_COMPOSE)); break; + case Common::EVENT_LBUTTONDOWN: + continueLooping = false; + break; default: break; } + + int oldHotspot = curHotspot; + + for (int i = 0; i < ARRAYSIZE(overviewHotspots); i++) + if (overviewHotspots[i].rect.contains(_eventMan->getMousePos())) + curHotspot = i; + + if (oldHotspot != curHotspot) { + drawInterfaceOverview(overviewHotspots[curHotspot], overviewVideo); + updateScreen = true; + } + + if (updateScreen) + _system->updateScreen(); } _system->delayMillis(10); @@ -73,12 +107,27 @@ void PegasusEngine::runInterfaceOverview() { delete overviewVideo; } -void PegasusEngine::drawInterfaceOverview() { +void PegasusEngine::drawInterfaceOverview(const OverviewHotspot &hotspot, Video::QuickTimeDecoder *video) { _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(); + + video->seekToTime(hotspot.time); + _video->copyFrameToScreen(video->decodeNextFrame(), video->getWidth(), video->getHeight(), kViewScreenOffset, kViewScreenOffset); + + if (hotspot.time == 530) { + // The keyboard is special + // Interesting how the file is "controller" and not keyboard. The PlayStation/Pippin versions probably + // had similar names... + _gfx->drawPict("Images/Interface/OVcontrollerHilite.mac", hotspot.rect.left, hotspot.rect.top, false); + } else if (hotspot.time != 1000) { + // TODO: Thicker line (=4px) with rounded edges + uint32 color = _system->getScreenFormat().RGBToColor(232, 232, 0); // Yellow + Graphics::Surface *screen = _system->lockScreen(); + screen->frameRect(hotspot.rect, color); + _system->unlockScreen(); + } } } // End of namespace Pegasus diff --git a/engines/pegasus/pegasus.h b/engines/pegasus/pegasus.h index 1f9f92a032..bb69429a59 100644 --- a/engines/pegasus/pegasus.h +++ b/engines/pegasus/pegasus.h @@ -35,6 +35,10 @@ #include "pegasus/graphics.h" #include "pegasus/video.h" +namespace Video { + class Video::QuickTimeDecoder; +} + namespace Pegasus { struct PegasusGameDescription; @@ -134,6 +138,11 @@ struct RightAreaData { uint32 time; }; +struct OverviewHotspot { + Common::Rect rect; + uint32 time; +}; + enum TimeZone { kLocPrehistoric = 0, kLocMars = 1, @@ -214,10 +223,10 @@ private: //void drawCompass(); //void runPauseMenu(); void showLoadDialog(); - void runInterfaceOverview(); // Interface Overview - void drawInterfaceOverview(); + void runInterfaceOverview(); + void drawInterfaceOverview(const OverviewHotspot &hotspot, Video::QuickTimeDecoder *video); // Main Game Functions void mainGameLoop(); |