[Scummvm-cvs-logs] SF.net SVN: scummvm:[50598] scummvm/trunk/engines/m4
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Fri Jul 2 16:39:14 CEST 2010
Revision: 50598
http://scummvm.svn.sourceforge.net/scummvm/?rev=50598&view=rev
Author: thebluegr
Date: 2010-07-02 14:39:13 +0000 (Fri, 02 Jul 2010)
Log Message:
-----------
Some slight fixes so that Phantom/Dragon start again
Modified Paths:
--------------
scummvm/trunk/engines/m4/globals.cpp
scummvm/trunk/engines/m4/m4.cpp
scummvm/trunk/engines/m4/mads_scene.cpp
Modified: scummvm/trunk/engines/m4/globals.cpp
===================================================================
--- scummvm/trunk/engines/m4/globals.cpp 2010-07-02 14:29:50 UTC (rev 50597)
+++ scummvm/trunk/engines/m4/globals.cpp 2010-07-02 14:39:13 UTC (rev 50598)
@@ -528,7 +528,9 @@
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];
Modified: scummvm/trunk/engines/m4/m4.cpp
===================================================================
--- scummvm/trunk/engines/m4/m4.cpp 2010-07-02 14:29:50 UTC (rev 50597)
+++ scummvm/trunk/engines/m4/m4.cpp 2010-07-02 14:39:13 UTC (rev 50598)
@@ -537,19 +537,18 @@
//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();
Modified: scummvm/trunk/engines/m4/mads_scene.cpp
===================================================================
--- scummvm/trunk/engines/m4/mads_scene.cpp 2010-07-02 14:29:50 UTC (rev 50597)
+++ scummvm/trunk/engines/m4/mads_scene.cpp 2010-07-02 14:39:13 UTC (rev 50598)
@@ -129,11 +129,13 @@
// 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::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 @@
}
}
- error("Couldn't find player sprites");
+ // Phantom/Dragon
+ warning("Couldn't find player sprites");
}
enum boxSprites {
@@ -646,8 +651,20 @@
// 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();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list