aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2007-05-12 19:33:00 +0000
committerNicola Mettifogo2007-05-12 19:33:00 +0000
commit1c6ab01f9e0ad2a25dc54f3fcc85893b2695b6d2 (patch)
tree1c24f8f1d098670af7f95f3ec88393c032eabb07 /engines
parentd0635b8677e6e8f47e1885ed01451b320b9e6f5f (diff)
downloadscummvm-rg350-1c6ab01f9e0ad2a25dc54f3fcc85893b2695b6d2.tar.gz
scummvm-rg350-1c6ab01f9e0ad2a25dc54f3fcc85893b2695b6d2.tar.bz2
scummvm-rg350-1c6ab01f9e0ad2a25dc54f3fcc85893b2695b6d2.zip
Fixed crashes when changing location in the introduction and removed useless code from the original engine.
svn-id: r26813
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/location.cpp31
-rw-r--r--engines/parallaction/parallaction.cpp19
2 files changed, 17 insertions, 33 deletions
diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp
index d2daeaaddf..84dc62a2e5 100644
--- a/engines/parallaction/location.cpp
+++ b/engines/parallaction/location.cpp
@@ -315,7 +315,7 @@ void Parallaction::showSlide(const char *name) {
is commented out, and would definitely crash the current implementation.
*/
void Parallaction::changeLocation(char *location) {
- debugC(1, kDebugLocation, "changeLocation to '%s'", location);
+ debugC(1, kDebugLocation, "changeLocation(%s)", location);
_soundMan->playLocationMusic(location);
@@ -333,15 +333,11 @@ void Parallaction::changeLocation(char *location) {
_hoverZone = NULL;
if (_engineFlags & kEngineMouse) {
changeCursor( kCursorArrow );
- debugC(2, kDebugLocation, "changeLocation: changed cursor");
}
_animations.remove(&_char._ani);
- debugC(2, kDebugLocation, "changeLocation: removed character from the animation list");
freeLocation();
- debugC(1, kDebugLocation, "changeLocation: old location free'd");
-
char buf[100];
strcpy(buf, location);
@@ -370,14 +366,10 @@ void Parallaction::changeLocation(char *location) {
}
_animations.push_front(&_char._ani);
- debugC(2, kDebugLocation, "changeLocation: new character added to the animation list");
strcpy(_saveData1, list[0].c_str());
parseLocation(list[0].c_str());
- _gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
- debugC(1, kDebugLocation, "changeLocation: new location '%s' parsed", _saveData1);
-
_char._ani._oldPos.x = -1000;
_char._ani._oldPos.y = -1000;
@@ -388,40 +380,28 @@ void Parallaction::changeLocation(char *location) {
_char._ani._frame = _location._startFrame;
_location._startPosition.y = -1000;
_location._startPosition.x = -1000;
-
- debugC(2, kDebugLocation, "changeLocation: initial position set to x: %i, y: %i, f: %i", _location._startPosition.x, _location._startPosition.y, _location._startFrame);
}
byte palette[PALETTE_SIZE];
for (uint16 _si = 0; _si < PALETTE_SIZE; _si++) palette[_si] = 0;
_gfx->setPalette(palette);
- _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
+
+ _gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
if (_location._commands.size() > 0) {
runCommands(_location._commands);
- runJobs();
- _gfx->swapBuffers();
- runJobs();
- _gfx->swapBuffers();
}
- if (_location._comment) {
- doLocationEnterTransition();
- debugC(2, kDebugLocation, "changeLocation: shown location comment");
- }
-
- runJobs();
- _gfx->swapBuffers();
+ _gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
_gfx->setPalette(_gfx->_palette);
if (_location._aCommands.size() > 0) {
runCommands(_location._aCommands);
- debugC(1, kDebugLocation, "changeLocation: location acommands run");
}
// _soundMan->playSfx(0);
- debugC(1, kDebugLocation, "changeLocation completed");
+ debugC(1, kDebugLocation, "changeLocation() done");
return;
@@ -462,7 +442,6 @@ void Parallaction::doLocationEnterTransition() {
r.grow(-1);
_gfx->floodFill(Gfx::kBitFront, r, 1);
_gfx->displayWrappedString(_location._comment, 3, 5, 130, 0);
-
// FIXME: ???
#if 0
do {
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 55cef1a3c1..9e134baf9e 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -362,8 +362,6 @@ void Parallaction::runGame() {
if (_location._commands.size() > 0)
runCommands(_location._commands);
- runJobs();
-
_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
if (_location._comment)
@@ -707,6 +705,7 @@ void Parallaction::changeCursor(int32 index) {
void Parallaction::freeCharacter() {
+ debugC(3, kDebugLocation, "freeCharacter()");
if (!IS_DUMMY_CHARACTER(_vm->_characterName)) {
if (_objectsNames)
@@ -715,22 +714,27 @@ void Parallaction::freeCharacter() {
if (_vm->_char._ani._cnv)
delete _vm->_char._ani._cnv;
+ _vm->_char._ani._cnv = NULL;
if (_vm->_char._talk)
delete _vm->_char._talk;
+ _vm->_char._talk = NULL;
_vm->_gfx->freeStaticCnv(_vm->_char._head);
if (_vm->_char._head)
delete _vm->_char._head;
+ _vm->_char._head = NULL;
if (_vm->_char._objs)
delete _vm->_char._objs;
+ _vm->_char._objs = NULL;
}
return;
}
void Parallaction::changeCharacter(const char *name) {
+ debugC(1, kDebugLocation, "changeCharacter(%s)", name);
char baseName[20];
if (IS_MINI_CHARACTER(name)) {
@@ -751,6 +755,7 @@ void Parallaction::changeCharacter(const char *name) {
freeCharacter();
_disk->selectArchive((_vm->getPlatform() == Common::kPlatformPC) ? "disk1" : "disk0");
+ _vm->_char._ani._cnv = _disk->loadFrames(fullName);
if (!IS_DUMMY_CHARACTER(name)) {
_vm->_char._head = _disk->loadHead(baseName);
@@ -759,17 +764,17 @@ void Parallaction::changeCharacter(const char *name) {
_objectsNames = _disk->loadTable(baseName);
refreshInventory(baseName);
- _vm->_char._ani._cnv = _disk->loadFrames(fullName);
-
_soundMan->playCharacterMusic(name);
+
+ if ((getFeatures() & GF_DEMO) == 0)
+ parseLocation("common");
}
}
- if (!(getFeatures() & GF_DEMO))
- parseLocation("common");
-
strcpy(_characterName1, fullName);
+ debugC(1, kDebugLocation, "changeCharacter() done");
+
return;
}