Esempio n. 1
0
void AGOSEngine_Feeble::off_mouseOn() {
	// 180: force mouseOn
	if (_mouseCursor != 5) {
		resetVerbs();
		_noRightClick = 0;
	}
	_mouseHideCount = 0;
}
Esempio n. 2
0
void AGOSEngine::disableBox(uint hitarea) {
	HitArea *ha = findBox(hitarea);
	if (ha != NULL) {
		ha->flags |= kBFBoxDead;
		ha->flags &= ~kBFBoxSelected;
		if ((getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) &&
			hitarea == 102) {
			resetVerbs();
		}
	}
}
Esempio n. 3
0
void ScummEngine_v0::setMode(byte mode) {
	int state;

	_currentMode = mode;

	switch (_currentMode) {
	case kModeCutscene:
		if (_game.features & GF_DEMO) {
			if (VAR(11) != 0)
				_drawDemo = true;
		}
		_redrawSentenceLine = false;
		// Note: do not change freeze state here
		state = USERSTATE_SET_IFACE |
			USERSTATE_SET_CURSOR;
		
		break;
	case kModeKeypad:
		if (_game.features & GF_DEMO) {
			if (VAR(11) != 0)
				_drawDemo = true;
		}
		_redrawSentenceLine = false;
		state = USERSTATE_SET_IFACE |
			USERSTATE_SET_CURSOR | USERSTATE_CURSOR_ON |
			USERSTATE_SET_FREEZE | USERSTATE_FREEZE_ON;
		break;
	case kModeNormal:
	case kModeNoNewKid:
		if (_game.features & GF_DEMO) {
			resetVerbs();
			_activeVerb = kVerbWalkTo;
			_redrawSentenceLine = true;
			_drawDemo = false;
		}
		state = USERSTATE_SET_IFACE | USERSTATE_IFACE_ALL |
			USERSTATE_SET_CURSOR | USERSTATE_CURSOR_ON |
			USERSTATE_SET_FREEZE;
		break;
	default:
		error("Invalid mode: %d", mode);
	}

	setUserState(state);
}
Esempio n. 4
0
void AGOSEngine_Feeble::invertBox(HitArea *ha, bool state) {
	if (getBitFlag(205) || getBitFlag(206)) {
		if (state != 0) {
			_mouseAnimMax = _oldMouseAnimMax;
			_mouseCursor = _oldMouseCursor;
		} else if (_mouseCursor != 18) {
			_oldMouseCursor = _mouseCursor;
			_animatePointer = false;
			_oldMouseAnimMax = _mouseAnimMax;
			_mouseAnimMax = 2;
			_mouseCursor = 18;
		}
	} else {
		if (getBitFlag(207)) {
			if (state != 0) {
				_noRightClick = 0;
				resetVerbs();
			} else {
				int cursor = ha->id + 9;
				if (cursor >= 23)
					cursor = 21;
				_mouseCursor = cursor;
				_mouseAnimMax = 8;
				_noRightClick = 1;
			}
		} else {
			VgaSprite *vsp = _vgaSprites;

			int id = ha->id - 43;
			while (vsp->id) {
				if (vsp->id == id && vsp->zoneNum == 2) {
					if (state == 0)
						vsp->flags |= kDFShaded;
					else
						vsp->flags &= ~kDFShaded;
					break;
				}
				vsp++;
			}
		}
	}
}
Esempio n. 5
0
void AGOSEngine_Simon1::handleMouseMoved() {
	uint x;

	if (_mouseHideCount) {
		CursorMan.showMouse(false);
		return;
	}

	CursorMan.showMouse(true);
	_mouse = _eventMan->getMousePos();

	if (_defaultVerb) {
		uint id = 101;
		if (_mouse.y >= 136)
			id = 102;
		if (_defaultVerb != id)
			resetVerbs();
	}

	if (getGameType() == GType_FF) {
		if (getBitFlag(99)) { // Oracle
			if (_mouse.x >= 10 && _mouse.x <= 635 && _mouse.y >= 5 && _mouse.y <= 475) {
				setBitFlag(98, true);
			} else {
				if (getBitFlag(98)) {
					_variableArray[254] = 63;
				}
			}
		} else if (getBitFlag(88)) { // Close Up
			if (_mouse.x >= 10 && _mouse.x <= 635 && _mouse.y >= 5 && _mouse.y <= 475) {
				setBitFlag(87, true);
			} else {
				if (getBitFlag(87)) {
					_variableArray[254] = 75;
				}
			}
		}

		if (_rightButtonDown) {
			_rightButtonDown = false;
			setVerb(NULL);
		}
	} else if (getGameType() == GType_SIMON2) {
		if (getBitFlag(79)) {
			if (!_vgaVar9) {
				if (_mouse.x >= 315 || _mouse.x < 9)
					goto get_out2;
				_vgaVar9 = 1;
			}
			if (_scrollCount == 0) {
				if (_mouse.x >= 315) {
					if (_scrollX != _scrollXMax)
						_scrollFlag = 1;
				} else if (_mouse.x < 8) {
					if (_scrollX != 0)
						_scrollFlag = -1;
				}
			}
		} else {
		get_out2:;
			_vgaVar9 = 0;
		}
	}

	if (_mouse != _mouseOld)
		_needHitAreaRecalc++;

	if (_leftButtonOld == 0 && _leftButtonCount != 0) {
		boxController(_mouse.x, _mouse.y, 3);
	}
	_leftButtonOld = _leftButton;

	x = 0;
	if (_lastHitArea3 == 0 && _leftButtonDown) {
		_leftButtonDown = false;
		x = 1;
	} else {
		if (!_litBoxFlag && _needHitAreaRecalc == 0)
			goto get_out;
	}

	boxController(_mouse.x, _mouse.y, x);
	_lastHitArea3 = _lastHitArea;
	if (x == 1 && _lastHitArea == NULL)
		_lastHitArea3 = (HitArea *) -1;

get_out:
	_mouseOld = _mouse;
	drawMousePointer();

	_needHitAreaRecalc = 0;
	_litBoxFlag = false;
}