diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 0e81f7062ab..bd475348b24 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -148,6 +148,12 @@ void Actor::setActorWalkSpeed(uint newSpeedX, uint newSpeedY) { speedx = newSpeedX; speedy = newSpeedY; +if (newSpeedX == 10 && newSpeedY == 5) { + speedx = 5; + speedy = 5; +} + + if (moving) { calcMovementFactor(walkdata.next); } @@ -171,17 +177,15 @@ int ScummEngine::getAngleFromPos(int x, int y) const { } int Actor::calcMovementFactor(Common::Point next) { - Common::Point actorPos(_pos); - int diffX, diffY; - int32 deltaXFactor, deltaYFactor; + int deltaXFactor, deltaYFactor; - if (actorPos == next) + if (_pos == next) return 0; - diffX = next.x - actorPos.x; - diffY = next.y - actorPos.y; - deltaYFactor = speedy << 16; + const int diffX = next.x - _pos.x; + const int diffY = next.y - _pos.y; + deltaYFactor = speedy << 16; if (diffY < 0) deltaYFactor = -deltaYFactor; @@ -192,7 +196,7 @@ int Actor::calcMovementFactor(Common::Point next) { deltaYFactor = 0; } - if ((uint) abs((int)(deltaXFactor >> 16)) > speedx) { + if ((uint) abs(deltaXFactor >> 16) > speedx) { deltaXFactor = speedx << 16; if (diffX < 0) deltaXFactor = -deltaXFactor; @@ -205,7 +209,7 @@ int Actor::calcMovementFactor(Common::Point next) { } } - walkdata.cur = actorPos; + walkdata.cur = _pos; walkdata.next = next; walkdata.deltaXFactor = deltaXFactor; walkdata.deltaYFactor = deltaYFactor; @@ -379,8 +383,11 @@ int Actor::actorWalkStep() { distX = abs(walkdata.next.x - walkdata.cur.x); distY = abs(walkdata.next.y - walkdata.cur.y); +if (number == 6) printf("actorWalkStep: actor %d at (%d,%d); ", number, actorPos.x, actorPos.y); if (abs(actorPos.x - walkdata.cur.x) >= distX && abs(actorPos.y - walkdata.cur.y) >= distY) { moving &= ~MF_IN_LEG; +if (number == 6) printf("MF_IN_LEG: walkdata.cur=(%d,%d), walkdata.next=(%d,%d)\n", + walkdata.cur.x, walkdata.cur.y, walkdata.next.x, walkdata.next.y); return 0; } @@ -400,6 +407,11 @@ int Actor::actorWalkStep() { actorPos.y = walkdata.next.y; } +if (number == 6) printf("new pos (%d,%d): delta=(%d,%d), delta>>8=(%d,%d)\n", + actorPos.x, actorPos.y, + walkdata.deltaXFactor, walkdata.deltaYFactor, + (walkdata.deltaXFactor >> 8), (walkdata.deltaYFactor >> 8)); + _pos = actorPos; return 1; } diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index b842a1a44d4..63f977725ed 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -1389,8 +1389,6 @@ void ScummEngine_v2::o2_roomOps() { } void ScummEngine_v2::o2_cutscene() { - //warning("TODO o2_cutscene()"); - vm.cutSceneData[0] = _userState | (_userPut ? 16 : 0); vm.cutSceneData[1] = (int16)VAR(VAR_CURSORSTATE); vm.cutSceneData[2] = _currentRoom; @@ -1413,8 +1411,6 @@ void ScummEngine_v2::o2_cutscene() { } void ScummEngine_v2::o2_endCutscene() { - //warning("TODO o2_endCutscene()"); - vm.cutSceneStackPointer = 0; VAR(VAR_OVERRIDE) = 0; diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index e53908e240b..7de4f2d40d7 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -858,7 +858,6 @@ void ScummEngine_v5::o5_drawObject() { } void ScummEngine_v5::o5_getStringWidth() { - // TODO - not sure if this is correct... needs testing int string, width = 0; byte *ptr; @@ -874,7 +873,6 @@ void ScummEngine_v5::o5_getStringWidth() { } void ScummEngine_v5::o5_saveLoadVars() { - // TODO if (fetchScriptByte() == 1) saveVars(); else diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index fa8e9deb2cc..f652bfa5045 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -1063,7 +1063,6 @@ void ScummEngine_v8::o8_actorOps() { } void ScummEngine_v8::o8_cameraOps() { - // TODO byte subOp = fetchScriptByte(); switch (subOp) { case 0x32: // SO_CAMERA_PAUSE @@ -1368,7 +1367,6 @@ void ScummEngine_v8::o8_kernelSetFunctions() { } void ScummEngine_v8::o8_kernelGetFunctions() { - // TODO int args[30]; int len = getStackList(args, ARRAYSIZE(args)); diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index 2652288cdc7..d6109bf5f7a 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -439,9 +439,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS // The first step is to check whether one of them is present (we do that // here); the rest is handled by the ScummFile class and code in // openResourceFile() (and in the Sound class, for MONSTER.SOU handling). - // - // TODO: Smush/iMuse need to be extended to be able to load files from the - // container, too (for The Dig and FT, as well as their demos). if (gs.detectFilename) { if (_fileHandle.open(gs.detectFilename)) { _containerFile = gs.detectFilename; @@ -1197,7 +1194,7 @@ void ScummEngine::scummInit() { setupV1ActorTalkColor(); } else if (_gameId == GID_MANIAC && _version == 2 && _demoMode) { // HACK Some palette changes needed for demo script - // in Maniac Mansion (Enchanced) + // in Maniac Mansion (Enhanced) _actors[3].setPalette(3, 1); _actors[9].talkColor = 15; _actors[10].talkColor = 7; @@ -1441,7 +1438,6 @@ void ScummEngine::mainRun() { if (_quit) { // TODO: Maybe perform an autosave on exit? - // TODO: Also, we could optionally show a "Do you really want to quit?" dialog here } } } @@ -2608,7 +2604,7 @@ void ScummEngine::initRoomSubBlocks() { } if (_features & GF_OLD_BUNDLE) - ptr = 0; // TODO ? do 16 bit games use a palette?!? + ptr = 0; else if (_features & GF_SMALL_HEADER) ptr = findResourceSmall(MKID('CLUT'), roomptr); else diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 8ad7775417d..5289fbc6853 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -464,12 +464,12 @@ void Sound::playSound(int soundID, int offset) { int track = -1; if (soundID == 50) track = 17; - else if (ptr[6] == 0x7F && ptr[7] == 0x00 && ptr[8] == 0x80) - { - char tracks[16] = {13,14,10,3,4,9,16,5,1,8,2,15,6,7,11,12}; + else if (ptr[6] == 0x7F && ptr[7] == 0x00 && ptr[8] == 0x80) { + static const char tracks[16] = {13,14,10,3,4,9,16,5,1,8,2,15,6,7,11,12}; if (ptr[9] == 0x0E) track = 18; - else track = tracks[ptr[9] - 0x23]; + else + track = tracks[ptr[9] - 0x23]; } if (track != -1) { playCDTrack(track,((track < 5) || (track > 16)) ? 1 : -1,0,0); diff --git a/scumm/string.cpp b/scumm/string.cpp index 9a8a3b5617e..a6bc7241899 100644 --- a/scumm/string.cpp +++ b/scumm/string.cpp @@ -246,9 +246,9 @@ void ScummEngine::CHARSET_1() { _sound->talkSound(talk_sound_a, talk_sound_b, 2); // Set flag that speech variant exist of this msg. - // TODO: This does not work for the speech system in V7+ games - // since they encode the voice information differently, and it - // is being stripped from the string before it ever gets here. + // This is actually a hack added by ScummVM; the original did + // subtitle hiding in some other way. I am not sure exactly + // how, though. if (_haveMsg == 0xFF) _haveMsg = 0xFE; break; @@ -871,7 +871,6 @@ void ScummEngine::translateText(const byte *text, byte *trans_buff) { if (found != NULL) { strcpy((char *)trans_buff, _languageBuffer + found->offset); - // FIXME / TODO: Maybe this should be enabled for Full Throttle, too? if ((_gameId == GID_DIG) && !(_features & GF_DEMO)) { // Replace any '%___' by the corresponding special codes in the source text const byte *src = text;