예제 #1
0
파일: talk.cpp 프로젝트: alexnikleo/scummvm
void DreamWebEngine::doSomeTalk() {
	while (true) {
		const uint8 *str = getPersonText(_character & 0x7F, _talkPos);

		if (*str == 0) {
			// endheartalk
			_pointerMode = 0;
			return;
		}

		createPanel();
		showPanel();
		showMan();
		showExit();
		convIcons();

		printDirect(str, 164, 64, 144, false);

		loadSpeech('R', _realLocation, 'C', (64 * (_character & 0x7F)) + _talkPos);
		if (_speechLoaded)
			playChannel1(62);

		_pointerMode = 3;
		workToScreenM();
		if (hangOnPQ())
			return;

		_talkPos++;

		str = getPersonText(_character & 0x7F, _talkPos);
		if (*str == 0) {
			// endheartalk
			_pointerMode = 0;
			return;
		}

		if (*str != ':' && *str != 32) {
			createPanel();
			showPanel();
			showMan();
			showExit();
			convIcons();
			printDirect(str, 48, 128, 144, false);

			loadSpeech('R', _realLocation, 'C', (64 * (_character & 0x7F)) + _talkPos);
			if (_speechLoaded)
				playChannel1(62);

			_pointerMode = 3;
			workToScreenM();
			if (hangOnPQ())
				return;
		}

		_talkPos++;
	}
}
예제 #2
0
파일: object.cpp 프로젝트: murgo/scummvm
void DreamWebEngine::selectOpenOb() {
	uint8 slotSize, slotCount;
	getAnyAd(&slotSize, &slotCount);
	if (slotCount == 255) {
		// Can't open the object
		blank();
		return;
	}

	if (_commandType != 224) {
		_commandType = 224;
		commandWithOb(38, _objectType, _command);
	}

	if (_mouseButton == _oldButton || !(_mouseButton & 1))
		return;

	_openedOb = _command;
	_openedType = _objectType;
	createPanel();
	showPanel();
	showMan();
	examIcon();
	showExit();
	openInv();
	openOb();
	underTextLine();
	readMouse();
	showPointer();
	workToScreen();
	delPointer();
}
예제 #3
0
파일: object.cpp 프로젝트: murgo/scummvm
void DreamWebEngine::inventory() {
	if (_vars._manDead == 1 || _vars._watchingTime != 0) {
		blank();
		return;
	}

	commandOnlyCond(32, 239);

	if (_mouseButton == _oldButton)
		return;
	if (!(_mouseButton & 1)) // only on left mouse button
		return;


	_timeCount = 0;
	_pointerMode = 0;
	_inMapArea = 0;
	animPointer();
	createPanel();
	showPanel();
	examIcon();
	showMan();
	showExit();
	underTextLine();
	_pickUp = 0;
	_invOpen = 2;
	openInv();
	readMouse();
	showPointer();
	workToScreen();
	delPointer();
	_openedOb = 255;
	examineOb(false);
}
예제 #4
0
파일: talk.cpp 프로젝트: alexnikleo/scummvm
void DreamWebEngine::redes() {
	if (_channel1Playing != 255 || _talkMode != 2) {
		blank();
		return;
	}

	if (_commandType != 217) {
		_commandType = 217;
		commandOnly(50);
	}

	if (!(_mouseButton & 1))
		return;

	delPointer();
	createPanel();
	showPanel();
	showMan();
	showExit();
	convIcons();
	startTalk();
	readMouse();
	showPointer();
	workToScreen();
	delPointer();
}
예제 #5
0
파일: talk.cpp 프로젝트: alexnikleo/scummvm
void DreamWebEngine::talk() {
	_talkPos = 0;
	_inMapArea = 0;
	_character = _command;
	createPanel();
	showPanel();
	showMan();
	showExit();
	underTextLine();
	convIcons();
	startTalk();
	_commandType = 255;
	readMouse();
	showPointer();
	workToScreen();

	RectWithCallback<DreamWebEngine> talkList[] = {
		{ 273,320,157,198,&DreamWebEngine::getBack1 },
		{ 240,290,2,44,&DreamWebEngine::moreTalk },
		{ 0,320,0,200,&DreamWebEngine::blank },
		{ 0xFFFF,0,0,0,0 }
	};

	do {
		delPointer();
		readMouse();
		animPointer();
		showPointer();
		vSync();
		dumpPointer();
		dumpTextLine();
		_getBack = 0;
		checkCoords(talkList);
		if (_quitRequested)
			break;
	} while (!_getBack);

	if (_talkPos >= 4)
		_personData->b7 |= 128;

	redrawMainScrn();
	workToScreenM();
	if (_speechLoaded) {
		cancelCh1();
		_volumeDirection = -1;
		_volumeTo = 0;
	}
}
예제 #6
0
void DreamWebEngine::examineInventory() {
	commandOnlyCond(32, 249);

	if (!(_mouseButton & 1))
		return;

	createPanel();
	showPanel();
	showMan();
	showExit();
	examIcon();
	_pickUp = 0;
	_invOpen = 2;
	openInv();
	workToScreenM();
}
예제 #7
0
파일: object.cpp 프로젝트: murgo/scummvm
void DreamWebEngine::setPickup() {
	if (_objectType != kSetObjectType1 && _objectType != kSetObjectType3) {
		// Object types 1 and 3 are excluded, so the resulting object is a DynObject
		uint8 dummy;
		DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy);
		if (object->mapad[0] == 4) {
			blank();
			return;
		}
	} else {
		blank();
		return;
	}

	if (_commandType != 209) {
		_commandType = 209;
		commandWithOb(33, _objectType, _command);
	}

	if (_mouseButton != 1 || _mouseButton == _oldButton)
		return;

	createPanel();
	showPanel();
	showMan();
	showExit();
	examIcon();
	_pickUp = 1;
	_invOpen = 2;

	if (_objectType != kExObjectType) {
		assert(_objectType == kFreeObjectType);
		_openedOb = 255;
		_itemFrame = transferToEx(_command);
		_objectType = kExObjectType;
		DynObject *object = getExAd(_itemFrame);
		object->mapad[0] = 20;
		object->mapad[1] = 255;
	} else {
		_itemFrame = _command;
		_openedOb = 255;
	}

	openInv();
	workToScreenM();
}
예제 #8
0
void DreamWebEngine::selectLocation() {
	_inMapArea = 0;
	clearBeforeLoad();
	_getBack = 0;
	_pointerFrame = 22;
	readCityPic();
	showCity();
	_cityGraphics.clear();
	readDestIcon();
	loadTravelText();
	showPanel();
	showMan();
	showArrows();
	showExit();
	locationPic();
	underTextLine();
	_commandType = 255;
	readMouse();
	_pointerFrame = 0;
	showPointer();
	workToScreen();
	_sound->playChannel0(9, 255);
	_newLocation = 255;

	while (_newLocation == 255) {
		if (_quitRequested)
			break;

		delPointer();
		readMouse();
		showPointer();
		waitForVSync();
		dumpPointer();
		dumpTextLine();

		if (_getBack == 1)
			break;

		RectWithCallback destList[] = {
			{ 238,258,4,44,&DreamWebEngine::nextDest },
			{ 104,124,4,44,&DreamWebEngine::lastDest },
			{ 280,308,4,44,&DreamWebEngine::lookAtPlace },
			{ 104,216,138,192,&DreamWebEngine::destSelect },
			{ 273,320,157,198,&DreamWebEngine::getBack1 },
			{ 0,320,0,200,&DreamWebEngine::blank },
			{ 0xFFFF,0,0,0,0 }
		};
		checkCoords(destList);
	}

	if (_quitRequested || _getBack == 1 || _newLocation == _vars._location) {
		_newLocation = _realLocation;
		_getBack = 0;
	}

	_newplaceGraphics.clear();
	_newplaceGraphics2.clear();
	_newplaceGraphics3.clear();

	_travelText.clear();
}
예제 #9
0
파일: object.cpp 프로젝트: murgo/scummvm
void DreamWebEngine::examineOb(bool examineAgain) {
	_pointerMode = 0;
	_timeCount = 0;

	while (true) {
		if (examineAgain) {
			_inMapArea = 0;
			_examAgain = 0;
			_openedOb = 255;
			_openedType = 255;
			_invOpen = 0;
			_objectType = _commandType;
			_itemFrame = 0;
			_pointerFrame = 0;
			createPanel();
			showPanel();
			showMan();
			showExit();
			obIcons();
			obPicture();
			describeOb();
			underTextLine();
			_commandType = 255;
			readMouse();
			showPointer();
			workToScreen();
			delPointer();
			examineAgain = false;
		}

		readMouse();
		showPointer();
		waitForVSync();
		dumpPointer();
		dumpTextLine();
		delPointer();
		_getBack = 0;

		switch (_invOpen) {
		case 0: {
			RectWithCallback examList[] = {
				{ 273,320,157,198,&DreamWebEngine::getBackFromOb },
				{ 260,300,0,44,&DreamWebEngine::useObject },
				{ 210,254,0,44,&DreamWebEngine::selectOpenOb },
				{ 144,176,64,96,&DreamWebEngine::setPickup },
				{ 0,50,50,200,&DreamWebEngine::examineInventory },
				{ 0,320,0,200,&DreamWebEngine::blank },
				{ 0xFFFF,0,0,0,0 }
			};
			checkCoords(examList);
			break;
		}
		case 1: {
			// Note: This table contains the non-constant _openChangeSize!
			RectWithCallback invList1[] = {
				{ 273,320,157,198,&DreamWebEngine::getBackFromOb },
				{ 255,294,0,24,&DreamWebEngine::dropObject },
				{ kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamWebEngine::incRyanPage },
				{ kInventx,_openChangeSize,kInventy+100,kInventy+100+kItempicsize,&DreamWebEngine::useOpened },
				{ kInventx,kInventx+(5*kItempicsize),kInventy,kInventy+(2*kItempicsize),&DreamWebEngine::inToInv },
				{ 0,320,0,200,&DreamWebEngine::blank },
				{ 0xFFFF,0,0,0,0 }
			};
			checkCoords(invList1);
			break;
		}
		default: {
			RectWithCallback withList1[] = {
				{ 273,320,157,198,&DreamWebEngine::getBackFromOb },
				{ kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamWebEngine::incRyanPage },
				{ kInventx,kInventx+(5*kItempicsize), kInventy,kInventy+(2*kItempicsize),&DreamWebEngine::selectOb },
				{ 0,320,0,200,&DreamWebEngine::blank },
				{ 0xFFFF,0,0,0,0 }
			};
			checkCoords(withList1);
			break;
		}
		}

		if (_quitRequested)
			break;
		if (_examAgain != 0)
			examineAgain = true;
		else if (_getBack != 0)
			break;
	}

	_pickUp = 0;
	if (_vars._watchingTime != 0 || _newLocation == 255) {
		// isWatching
		makeMainScreen();
	}

	_invOpen = 0;
	_openedOb = 255;
}