[Scummvm-cvs-logs] SF.net SVN: scummvm: [25921] scummvm/trunk/engines/gob
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Fri Mar 2 12:37:43 CET 2007
Revision: 25921
http://scummvm.svn.sourceforge.net/scummvm/?rev=25921&view=rev
Author: drmccoy
Date: 2007-03-02 03:37:42 -0800 (Fri, 02 Mar 2007)
Log Message:
-----------
- Fixed the actor freeze issue in the garage in Bargon Attack
- Some minor fixes
Modified Paths:
--------------
scummvm/trunk/engines/gob/game_v2.cpp
scummvm/trunk/engines/gob/inter_v2.cpp
scummvm/trunk/engines/gob/scenery.cpp
Modified: scummvm/trunk/engines/gob/game_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/game_v2.cpp 2007-03-01 17:25:49 UTC (rev 25920)
+++ scummvm/trunk/engines/gob/game_v2.cpp 2007-03-02 11:37:42 UTC (rev 25921)
@@ -1038,8 +1038,15 @@
WRITE_VAR(16, _activeCollResId & 0xFFF);
if (collPtr->funcLeave != 0) {
+ int16 collResIdBak = _activeCollResId;
+ int16 collIndexBak = _activeCollIndex;
+
timeKey = _vm->_util->getTimeKey();
collSub(collPtr->funcLeave);
+
+ _activeCollResId = collResIdBak;
+ _activeCollIndex = collIndexBak;
+
_vm->_inter->animPalette();
deltaTime = timeVal - (_vm->_util->getTimeKey() - timeKey);
Modified: scummvm/trunk/engines/gob/inter_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/inter_v2.cpp 2007-03-01 17:25:49 UTC (rev 25920)
+++ scummvm/trunk/engines/gob/inter_v2.cpp 2007-03-02 11:37:42 UTC (rev 25921)
@@ -774,7 +774,7 @@
_vm->_global->_inter_execPtr++;
if (!found && (value == (int8) *_vm->_global->_inter_execPtr))
found = true;
- _vm->_global->_inter_execPtr += 2;
+ _vm->_global->_inter_execPtr += 2;
break;
default:
@@ -1539,11 +1539,13 @@
int16 freq2;
int16 repCount; // di
int16 index; // si
+ int16 endRep;
index = _vm->_parse->parseValExpr();
repCount = _vm->_parse->parseValExpr();
frequency = _vm->_parse->parseValExpr();
+ warning("playSound(%d, %d, %d)", index, repCount, frequency);
_soundEndTimeKey = 0;
if (_vm->_game->_soundSamples[index] == 0)
return false;
@@ -1555,17 +1557,15 @@
repCount = -repCount;
_soundEndTimeKey = _vm->_util->getTimeKey();
- if (frequency == 0)
- freq2 = _vm->_game->_soundSamples[index]->frequency;
- else
- freq2 = frequency;
+ freq2 = frequency ? frequency : _vm->_game->_soundSamples[index]->frequency;
+ endRep = MAX(repCount - 1, 1);
+
_soundStopVal =
(10 * (_vm->_game->_soundSamples[index]->size / 2)) / freq2;
_soundEndTimeKey +=
- ((_vm->_game->_soundSamples[index]->size * repCount -
+ ((_vm->_game->_soundSamples[index]->size * endRep -
_vm->_game->_soundSamples[index]->size / 2) * 1000) / freq2;
}
- // loc_E2F3
if ((_vm->_game->_soundTypes[index] & 8)) {
if (_vm->_adlib) {
_vm->_adlib->load((byte *) _vm->_game->_soundSamples[index]->data, index);
@@ -1574,7 +1574,7 @@
}
} else {
_vm->_snd->stopSound(0);
- _vm->_snd->playSample(_vm->_game->_soundSamples[index], repCount, frequency);
+ _vm->_snd->playSample(_vm->_game->_soundSamples[index], repCount - 1, frequency);
}
return false;
@@ -1962,6 +1962,16 @@
posYVar = _vm->_parse->parseVarIndex();
animDataVar = _vm->_parse->parseVarIndex();
+ if (_vm->_mult->_objects && (oldObjCount != _vm->_mult->_objCount)) {
+ warning("Initializing new objects without having cleaned up the old ones at first");
+ delete[] _vm->_mult->_objects;
+ delete[] _vm->_mult->_renderData2;
+ delete[] _vm->_mult->_orderArray;
+ _vm->_mult->_objects = 0;
+ _vm->_mult->_renderData2 = 0;
+ _vm->_mult->_orderArray = 0;
+ }
+
if (_vm->_mult->_objects == 0) {
_vm->_mult->_renderData2 = new Mult::Mult_Object*[_vm->_mult->_objCount];
memset(_vm->_mult->_renderData2, 0, _vm->_mult->_objCount * sizeof(Mult::Mult_Object*));
@@ -1990,9 +2000,6 @@
_vm->_mult->_objects[i].goblinX = 1;
_vm->_mult->_objects[i].goblinY = 1;
}
- } else if (oldObjCount != _vm->_mult->_objCount) {
- error("o2_initMult: Object count changed, but storage didn't (old count = %d, new count = %d)",
- oldObjCount, _vm->_mult->_objCount);
}
if (_vm->_anim->_animSurf != 0 &&
Modified: scummvm/trunk/engines/gob/scenery.cpp
===================================================================
--- scummvm/trunk/engines/gob/scenery.cpp 2007-03-01 17:25:49 UTC (rev 25920)
+++ scummvm/trunk/engines/gob/scenery.cpp 2007-03-02 11:37:42 UTC (rev 25921)
@@ -222,6 +222,7 @@
delete[] _statics[index].pieces;
delete[] _statics[index].piecesFromExt;
+ _statics[index].layersCount = 0;
_staticPictCount[index] = -1;
}
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