[Scummvm-cvs-logs] scummvm master -> 5af474ec7c6a613aa6fc825f822a66b8d290a586
clone2727
clone2727 at gmail.com
Sat Mar 26 16:11:28 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5af474ec7c MOHAWK: Stub off LB mini games
Commit: 5af474ec7c6a613aa6fc825f822a66b8d290a586
https://github.com/scummvm/scummvm/commit/5af474ec7c6a613aa6fc825f822a66b8d290a586
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-03-26T08:09:07-07:00
Commit Message:
MOHAWK: Stub off LB mini games
greeneggs can now continue to completion in 'play' mode
Changed paths:
engines/mohawk/livingbooks.cpp
engines/mohawk/livingbooks.h
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 482aade..b25a1a7 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 186502d..6c22187 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;
More information about the Scummvm-git-logs
mailing list