Exemple #1
0
bool TizenGraphicsManager::moveMouse(int16 &x, int16 &y) {
	int16 currentX, currentY;
	getMousePosition(currentX, currentY);

	// save the current hardware coordinates
	setMousePosition(x, y);

	// return x/y as game coordinates
	adjustMousePosition(x, y);

	// convert current x/y to game coordinates
	adjustMousePosition(currentX, currentY);

	// return whether game coordinates have changed
	return (currentX != x || currentY != y);
}
Exemple #2
0
bool BadaGraphicsManager::moveMouse(int16 &x, int16 &y) {
	int16 currentX = _cursorState.x;
	int16 currentY = _cursorState.y;

	// save the current hardware coordinates
	_cursorState.x = x;
	_cursorState.y = y;

	// return x/y as game coordinates
	adjustMousePosition(x, y);

	// convert current x/y to game coordinates
	adjustMousePosition(currentX, currentY);

	// return whether game coordinates have changed
	return (currentX != x || currentY != y);
}
void OpenGLGraphicsManager::warpMouse(int x, int y) {
	int16 currentX = _cursorX;
	int16 currentY = _cursorY;
	adjustMousePosition(currentX, currentY);

	// Check whether the (virtual) coordinate actually changed. If not, then
	// simply do nothing. This avoids ugly "jittering" due to the actual
	// output screen having a bigger resolution than the virtual coordinates.
	if (currentX == x && currentY == y) {
		return;
	}

	// Scale the virtual coordinates into actual physical coordinates.
	if (_overlayVisible) {
		if (!_overlay) {
			return;
		}
	
		// It might be confusing that we actually have to handle something
		// here when the overlay is visible. This is because for very small
		// resolutions we have a minimal overlay size and have to adjust
		// for that.
		x = (x * _outputScreenWidth)  / _overlay->getWidth();
		y = (y * _outputScreenHeight) / _overlay->getHeight();
	} else {
		if (!_gameScreen) {
			return;
		}

		x = (x * _displayWidth)  / _gameScreen->getWidth();
		y = (y * _displayHeight) / _gameScreen->getHeight();

		x += _displayX;
		y += _displayY;
	}

	setMousePosition(x, y);
	setInternalMousePosition(x, y);
}
void OpenGLSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) {
	adjustMousePosition(point.x, point.y);
}