aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2011-03-26 11:08:07 -0400
committerMatthew Hoops2011-03-26 11:09:07 -0400
commit5af474ec7c6a613aa6fc825f822a66b8d290a586 (patch)
tree20b319aa2b6888340a2a00ee3abb92d8f199a2a9
parent153e67b37c6b510e975e16bf6ccc591fdc60838f (diff)
downloadscummvm-rg350-5af474ec7c6a613aa6fc825f822a66b8d290a586.tar.gz
scummvm-rg350-5af474ec7c6a613aa6fc825f822a66b8d290a586.tar.bz2
scummvm-rg350-5af474ec7c6a613aa6fc825f822a66b8d290a586.zip
MOHAWK: Stub off LB mini games
greeneggs can now continue to completion in 'play' mode
-rw-r--r--engines/mohawk/livingbooks.cpp40
-rw-r--r--engines/mohawk/livingbooks.h9
2 files changed, 49 insertions, 0 deletions
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 482aade99d..b25a1a7d8f 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -36,6 +36,8 @@
#include "engines/util.h"
+#include "gui/message.h"
+
namespace Mohawk {
// read a null-terminated string from a stream
@@ -595,6 +597,9 @@ void MohawkEngine_LivingBooks::loadBITL(uint16 resourceId) {
case kLBMovieItem:
res = new LBMovieItem(this, rect);
break;
+ case kLBMiniGameItem:
+ res = new LBMiniGameItem(this, rect);
+ break;
default:
warning("Unknown item type %04x", type);
case 3: // often used for buttons
@@ -3470,4 +3475,39 @@ bool LBMovieItem::togglePlaying(bool playing, bool restart) {
return LBItem::togglePlaying(playing, restart);
}
+LBMiniGameItem::LBMiniGameItem(MohawkEngine_LivingBooks *vm, Common::Rect rect) : LBItem(vm, rect) {
+ debug(3, "new LBMiniGameItem");
+}
+
+LBMiniGameItem::~LBMiniGameItem() {
+}
+
+bool LBMiniGameItem::togglePlaying(bool playing, bool restart) {
+ // HACK: Since we don't support any of these hardcoded mini games yet,
+ // just skip to the most logical page. For optional minigames, this
+ // will return the player to the previous page. For mandatory minigames,
+ // this will send the player to the next page.
+ // TODO: Document mini games from Arthur's Reading Race
+
+ uint16 destPage;
+
+ // Figure out what minigame we have and bring us back to a page where
+ // the player can continue
+ if (_desc == "Kitch") // Green Eggs and Ham: Kitchen minigame
+ destPage = 4;
+ else if (_desc == "Eggs") // Green Eggs and Ham: Eggs minigame
+ destPage = 5;
+ else if (_desc == "Fall") // Green Eggs and Ham: Fall minigame
+ destPage = 13;
+ else
+ error("Unknown minigame '%s'", _desc.c_str());
+
+ GUI::MessageDialog dialog(Common::String::format("The '%s' minigame is not supported yet.", _desc.c_str()));
+ dialog.runModal();
+
+ _vm->addNotifyEvent(NotifyEvent(kLBNotifyChangePage, destPage));
+
+ return false;
+}
+
} // End of namespace Mohawk
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 186502d532..6c22187cf3 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -88,6 +88,7 @@ enum {
kLBPaletteAItem = 0x44, // unused?
kLBPaletteItem = 0x45,
kLBProxyItem = 0x46,
+ kLBMiniGameItem = 666, // EVIL!!!!
kLBXDataFileItem = 0x3e9,
kLBDiscDectectorItem = 0xfa1
};
@@ -537,6 +538,14 @@ public:
bool togglePlaying(bool playing, bool restart);
};
+class LBMiniGameItem : public LBItem {
+public:
+ LBMiniGameItem(MohawkEngine_LivingBooks *_vm, Common::Rect rect);
+ ~LBMiniGameItem();
+
+ bool togglePlaying(bool playing, bool restart);
+};
+
struct NotifyEvent {
NotifyEvent(uint t, uint p) : type(t), param(p) { }
uint type;