aboutsummaryrefslogtreecommitdiff
path: root/engines/m4
diff options
context:
space:
mode:
authorFilippos Karapetis2010-07-02 14:39:13 +0000
committerFilippos Karapetis2010-07-02 14:39:13 +0000
commit7fa26648283b1940f952c33251c27eb38d5b89e7 (patch)
tree3fcb92999d268687c29cfc286ff5d3957eaffb56 /engines/m4
parentdcb92c83521794af87fc64f941e7d3bf71818c36 (diff)
downloadscummvm-rg350-7fa26648283b1940f952c33251c27eb38d5b89e7.tar.gz
scummvm-rg350-7fa26648283b1940f952c33251c27eb38d5b89e7.tar.bz2
scummvm-rg350-7fa26648283b1940f952c33251c27eb38d5b89e7.zip
Some slight fixes so that Phantom/Dragon start again
svn-id: r50598
Diffstat (limited to 'engines/m4')
-rw-r--r--engines/m4/globals.cpp4
-rw-r--r--engines/m4/m4.cpp15
-rw-r--r--engines/m4/mads_scene.cpp43
3 files changed, 40 insertions, 22 deletions
diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp
index b9039e3afd..fb95adf29f 100644
--- a/engines/m4/globals.cpp
+++ b/engines/m4/globals.cpp
@@ -528,7 +528,9 @@ void MadsObject::load(Common::SeekableReadStream *stream) {
roomNumber = READ_LE_UINT16(&obj[2]);
article = (MADSArticles)obj[4];
vocabCount = obj[5] & 0x7f;
- assert(vocabCount <= 3);
+ // Phantom / Dragon
+ if (vocabCount > 3)
+ warning("MadsObject::load(), vocab cound > 3 (it's %d)", vocabCount);
for (int i = 0; i < vocabCount; ++i) {
vocabList[i].flags1 = obj[6 + i * 4];
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index fc1caec883..f5c6d260a9 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -537,19 +537,18 @@ Common::Error MadsEngine::run() {
//for (int i = 0; i < _globals->getMessagesSize(); i++)
//printf("%s\n----------\n", _globals->loadMessage(i));
- if ((getGameType() == GType_RexNebular) || (getGameType() == GType_DragonSphere)) {
+ if (getGameType() == GType_RexNebular) {
_scene = NULL;
loadMenu(MAIN_MENU);
-
} else {
+ // Test code
_scene = new MadsScene(this);
- if (getGameType() == GType_DragonSphere) {
- _scene->loadScene(FIRST_SCENE);
- } else if (getGameType() == GType_Phantom) {
- //_scene->loadScene(FIRST_SCENE);
- _scene->loadScene(106); // a more interesting scene
- }
+ startScene(FIRST_SCENE);
+ RGBList *_bgPalData;
+ _scene->loadBackground(FIRST_SCENE, &_bgPalData);
+ _palette->addRange(_bgPalData);
+ _scene->translate(_bgPalData);
_scene->show();
diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp
index 73388a2325..f4581ed629 100644
--- a/engines/m4/mads_scene.cpp
+++ b/engines/m4/mads_scene.cpp
@@ -129,11 +129,13 @@ void MadsScene::loadScene(int sceneNumber) {
// Add the scene if necessary to the list of scenes that have been visited
_vm->globals()->addVisitedScene(sceneNumber);
- // Secondary scene load routine
- loadScene2("*I0.AA");
+ if (_vm->getGameType() == GType_RexNebular) {
+ // Secondary scene load routine
+ loadScene2("*I0.AA");
- // Do any scene specific setup
- _sceneLogic.enterScene();
+ // Do any scene specific setup
+ _sceneLogic.enterScene();
+ }
// Purge resources
_vm->res()->purge();
@@ -234,12 +236,14 @@ void MadsScene::leftClick(int x, int y) {
}
void MadsScene::rightClick(int x, int y) {
- // ***DEBUG*** - sample dialog display
- int idx = 3; //_madsVm->_globals->messageIndexOf(0x277a);
- const char *msg = _madsVm->globals()->loadMessage(idx);
- Dialog *dlg = new Dialog(_vm, msg, "TEST DIALOG");
- _vm->_viewManager->addView(dlg);
- _vm->_viewManager->moveToFront(dlg);
+ if (_vm->getGameType() == GType_RexNebular) {
+ // ***DEBUG*** - sample dialog display
+ int idx = 3; //_madsVm->_globals->messageIndexOf(0x277a);
+ const char *msg = _madsVm->globals()->loadMessage(idx);
+ Dialog *dlg = new Dialog(_vm, msg, "TEST DIALOG");
+ _vm->_viewManager->addView(dlg);
+ _vm->_viewManager->moveToFront(dlg);
+ }
}
void MadsScene::setAction(int action, int objectId) {
@@ -338,7 +342,8 @@ void MadsScene::loadPlayerSprites(const char *prefix) {
}
}
- error("Couldn't find player sprites");
+ // Phantom/Dragon
+ warning("Couldn't find player sprites");
}
enum boxSprites {
@@ -646,8 +651,20 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su
// Basic scene info
Common::SeekableReadStream *stream = sceneInfo.getItemStream(0);
- int resSceneId = stream->readUint16LE();
- assert(resSceneId == sceneNumber);
+ if (_vm->getGameType() == GType_RexNebular) {
+ int resSceneId = stream->readUint16LE();
+ assert(resSceneId == sceneNumber);
+ } else {
+ char roomFilename[10];
+ char roomFilenameExpected[10];
+ sprintf(roomFilenameExpected, "*RM%d", sceneNumber);
+
+ stream->read(roomFilename, 6);
+ roomFilename[6] = 0;
+ assert(!strcmp(roomFilename, roomFilenameExpected));
+ }
+
+ // TODO: The following is wrong for Phantom/Dragon
artFileNum = stream->readUint16LE();
depthStyle = stream->readUint16LE();
width = stream->readUint16LE();