コード例 #1
0
void ScummEngine::actorFollowCamera(int act) {
	if (!(_game.features & GF_NEW_CAMERA)) {
		int old;

		old = camera._follows;
		setCameraFollows(derefActor(act, "actorFollowCamera"));
		if (camera._follows != old)
			runInventoryScript(0);

		camera._movingToActor = false;
	}
}
コード例 #2
0
ファイル: script_v0.cpp プロジェクト: AlbanBedel/scummvm
void ScummEngine_v0::o_loadRoomWithEgo() {
	Actor_v0 *a;
	int obj, room, x, y, dir;

	obj = fetchScriptByte();
	room = fetchScriptByte();

	a = (Actor_v0 *)derefActor(VAR(VAR_EGO), "o_loadRoomWithEgo");

	//0x634F
	if (a->_miscflags & kActorMiscFlagFreeze) {
		stopObjectCode();
		return;
	}

	// The original interpreter sets the actors new room X/Y to the last rooms X/Y
	// This fixes a problem with MM: script 158 in room 12, the 'Oomph!' script
	// This scripts runs before the actor position is set to the correct room entry location
	a->putActor(a->getPos().x, a->getPos().y, room);
	_egoPositioned = false;

	startScene(a->_room, a, obj);

	getObjectXYPos(obj, x, y, dir);
	AdjustBoxResult r = a->adjustXYToBeInBox(x, y);
	x = r.x;
	y = r.y;
	a->putActor(x, y, _currentRoom);

	camera._dest.x = camera._cur.x = a->getPos().x;
	setCameraAt(a->getPos().x, a->getPos().y);
	setCameraFollows(a);

	_fullRedraw = true;

	resetSentence();

	if (x >= 0 && y >= 0) {
		a->startWalkActor(x, y, -1);
	}
}