aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/kyra/kyra_v2.cpp24
-rw-r--r--engines/kyra/kyra_v2.h4
-rw-r--r--engines/kyra/kyra_v3.cpp14
3 files changed, 21 insertions, 21 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp
index 1d61a12b8b..56512eb030 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -1250,7 +1250,7 @@ void KyraEngine_v2::loadNPCScript() {
_scriptInterpreter->loadScript(filename, &_npcScriptData, &_opcodes);
}
-void KyraEngine_v2::runTemporaryScript(const char *filename, int unk1, int unk2, int newShapes, int shapeUnload) {
+void KyraEngine_v2::runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload) {
memset(&_temporaryScriptData, 0, sizeof(_temporaryScriptData));
memset(&_temporaryScriptState, 0, sizeof(_temporaryScriptState));
@@ -1262,19 +1262,19 @@ void KyraEngine_v2::runTemporaryScript(const char *filename, int unk1, int unk2,
_newShapeFlag = -1;
+ if (_newShapeFiledata && newShapes) {
+ resetNewShapes(_newShapeCount, _newShapeFiledata);
+ _newShapeFiledata = 0;
+ _newShapeCount = 0;
+ }
+
while (_scriptInterpreter->validScript(&_temporaryScriptState))
_scriptInterpreter->runScript(&_temporaryScriptState);
uint8 *fileData = 0;
- if (newShapes) {
- if (_newShapeFiledata) {
- resetNewShapes(_newShapeCount, _newShapeFiledata);
- _newShapeFiledata = 0;
- _newShapeCount = 0;
- }
+ if (newShapes)
_newShapeFiledata = _res->fileData(_newShapeFilename, 0);
- }
fileData = _newShapeFiledata;
@@ -1286,7 +1286,7 @@ void KyraEngine_v2::runTemporaryScript(const char *filename, int unk1, int unk2,
if (newShapes)
_newShapeCount = initNewShapes(fileData);
- processNewShapes(unk1, unk2);
+ processNewShapes(allowSkip, resetChar);
if (shapeUnload) {
resetNewShapes(_newShapeCount, fileData);
@@ -1639,7 +1639,7 @@ int KyraEngine_v2::initNewShapes(uint8 *filedata) {
return lastEntry;
}
-void KyraEngine_v2::processNewShapes(int unk1, int unk2) {
+void KyraEngine_v2::processNewShapes(int allowSkip, int resetChar) {
setCharacterAnimDim(_newShapeWidth, _newShapeHeight);
_scriptInterpreter->initScript(&_temporaryScriptState, &_temporaryScriptData);
@@ -1664,7 +1664,7 @@ void KyraEngine_v2::processNewShapes(int unk1, int unk2) {
uint32 delayEnd = _system->getMillis() + _newShapeDelay * _tickLength;
- while ((!skipFlag() || !unk1) && _system->getMillis() < delayEnd) {
+ while ((!skipFlag() || !allowSkip) && _system->getMillis() < delayEnd) {
if (_chatText)
updateWithText();
else
@@ -1677,7 +1677,7 @@ void KyraEngine_v2::processNewShapes(int unk1, int unk2) {
resetSkipFlag();
}
- if (unk2) {
+ if (resetChar) {
if (_newShapeFlag >= 0) {
_mainCharacter.animFrame = _newShapeFlag + 33;
updateCharacterAnim(0);
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index d63f8d6e99..7a7aec803f 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -446,7 +446,7 @@ protected:
int _newShapeDelay;
int initNewShapes(uint8 *filedata);
- void processNewShapes(int unk1, int unk2);
+ void processNewShapes(int allowSkip, int resetChar);
void resetNewShapes(int count, uint8 *filedata);
// animator
@@ -1070,7 +1070,7 @@ protected:
bool _temporaryScriptExecBit;
Common::Array<const Opcode*> _opcodesTemporary;
- void runTemporaryScript(const char *filename, int unk1, int unk2, int newShapes, int shapeUnload);
+ void runTemporaryScript(const char *filename, int allowSkip, int resetChar, int newShapes, int shapeUnload);
// pathfinder
int _pathfinderFlag;
diff --git a/engines/kyra/kyra_v3.cpp b/engines/kyra/kyra_v3.cpp
index 4e490f2711..8a445b3548 100644
--- a/engines/kyra/kyra_v3.cpp
+++ b/engines/kyra/kyra_v3.cpp
@@ -1569,19 +1569,19 @@ void KyraEngine_v3::runTemporaryScript(const char *filename, int allowSkip, int
_newShapeFlag = -1;
+ if (_newShapeFiledata && newShapes) {
+ resetNewShapes(_newShapeCount, _newShapeFiledata);
+ _newShapeFiledata = 0;
+ _newShapeCount = 0;
+ }
+
while (_scriptInterpreter->validScript(&_temporaryScriptState))
_scriptInterpreter->runScript(&_temporaryScriptState);
uint8 *fileData = 0;
- if (newShapes) {
- if (_newShapeFiledata) {
- resetNewShapes(_newShapeCount, _newShapeFiledata);
- _newShapeFiledata = 0;
- _newShapeCount = 0;
- }
+ if (newShapes)
_newShapeFiledata = _res->fileData(_newShapeFilename, 0);
- }
fileData = _newShapeFiledata;