void TComb::insertFrame(PVideoFrame &src, int pos, int fnum, int lc, IScriptEnvironment *env) { TCombFrame *tf = tdc->frames[tdc->getCachePos(pos)]; tf->setFNum(fnum); tf->orig->copyFrom(src, vi); if (pos > 1) tf->sc = checkSceneChange(tf->orig, tdc->frames[tdc->getCachePos(pos - 2)]->orig, fnum, env); if (lc & 0x1) { HorizontalBlur3(tf->orig, tf->b[0], 0x1, env); VerticalBlur3(tf->orig, tf->b[1], 0x1, env); HorizontalBlur3(tf->b[1], tf->b[2], 0x1, env); HorizontalBlur6(tf->orig, tf->b[3], 0x1, env); VerticalBlur3(tf->b[1], tf->b[4], 0x1, env); HorizontalBlur6(tf->b[4], tf->b[5], 0x1, env); } memset(tf->isValid, 1, 7 * sizeof(bool)); }
int KyraEngine_HoF::trySceneChange(int *moveTable, int unk1, int updateChar) { bool running = true; bool unkFlag = false; int8 updateType = -1; int changedScene = 0; const int *moveTableStart = moveTable; _unk4 = 0; while (running && !shouldQuit()) { if (*moveTable >= 0 && *moveTable <= 7) { _mainCharacter.facing = getOppositeFacingDirection(*moveTable); unkFlag = true; } else { if (*moveTable == 8) { running = false; } else { ++moveTable; unkFlag = false; } } if (checkSceneChange()) { running = false; changedScene = 1; } if (unk1) { if (skipFlag()) { resetSkipFlag(false); running = false; _unk4 = 1; } } if (!unkFlag || !running) continue; int ret = 0; if (moveTable == moveTableStart || moveTable[1] == 8) ret = updateCharPos(0); else ret = updateCharPos(moveTable); if (ret) ++moveTable; ++updateType; if (!updateType) { update(); } else if (updateType == 1) { refreshAnimObjectsIfNeed(); updateType = -1; } delay(10); } if (updateChar) _mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing]; updateCharacterAnim(0); refreshAnimObjectsIfNeed(); return changedScene; }