Пример #1
0
void DINGUXSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) {
	if (!_overlayVisible) {
		if (_videoMode.mode == GFX_HALF) {
			point.x *= 2;
			point.y *= 2;
		}
		point.x /= _videoMode.scaleFactor;
		point.y /= _videoMode.scaleFactor;
		if (_videoMode.aspectRatioCorrection)
			point.y = aspect2Real(point.y);
	}
}
void OSystem_IPOD::fillMouseEvent(Event &event, int x, int y) {
	event.mouse.x = x;
	event.mouse.y = y;

	// Update the "keyboard mouse" coords
	_km.x = x;
	_km.y = y;

	// Adjust for the screen scaling
	if (!_overlayVisible) {
		event.mouse.x /= _scaleFactor;
		event.mouse.y /= _scaleFactor;
		if (_adjustAspectRatio)
			event.mouse.y = aspect2Real(event.mouse.y);
	}
}
Пример #3
0
// Basically it is kVeryFastAndUglyAspectMode of stretch200To240 from
// common/scale/aspect.cpp
static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY) {
	int maxDstY = real2Aspect(origSrcY + height - 1);
	int y;
	const uint8 *startSrcPtr = buf + srcX * 2 + (srcY - origSrcY) * pitch;
	uint8 *dstPtr = buf + srcX * 2 + maxDstY * pitch;

	for (y = maxDstY; y >= srcY; y--) {
		const uint8 *srcPtr = startSrcPtr + aspect2Real(y) * pitch;

		if (srcPtr == dstPtr)
			break;
		memcpy(dstPtr, srcPtr, width * 2);
		dstPtr -= pitch;
	}

	return 1 + maxDstY - srcY;
}
Пример #4
0
void LinuxmotoSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
	if (!event.synthetic) {
		Common::Event newEvent(event);
		newEvent.synthetic = true;
		if (!_overlayVisible) {
			if (_videoMode.mode == GFX_HALF) {
				newEvent.mouse.x *= 2;
				newEvent.mouse.y *= 2;
			}
			newEvent.mouse.x /= _videoMode.scaleFactor;
			newEvent.mouse.y /= _videoMode.scaleFactor;
			if (_videoMode.aspectRatioCorrection)
				newEvent.mouse.y = aspect2Real(newEvent.mouse.y);
		}
		g_system->getEventManager()->pushEvent(newEvent);
	}
}
Пример #5
0
void WINCESdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
	if (!event.synthetic) {
		Common::Event newEvent(event);
		newEvent.synthetic = true;
		if (!_overlayVisible) {
			/*
			newEvent.mouse.x = newEvent.mouse.x * _scaleFactorXd / _scaleFactorXm;
			newEvent.mouse.y = newEvent.mouse.y * _scaleFactorYd / _scaleFactorYm;
			newEvent.mouse.x /= _videoMode.scaleFactor;
			newEvent.mouse.y /= _videoMode.scaleFactor;
			*/
			if (_videoMode.aspectRatioCorrection)
				newEvent.mouse.y = aspect2Real(newEvent.mouse.y);
		}
		g_system->getEventManager()->pushEvent(newEvent);
	}
}
Пример #6
0
void OSystem_GP2XWIZ::fillMouseEvent(Common::Event &event, int x, int y) {
    if(_videoMode.mode == GFX_HALF && !_overlayVisible){
	    event.mouse.x = x*2;
	    event.mouse.y = y*2;
    } else {
        event.mouse.x = x;
	    event.mouse.y = y;
    }

	// Update the "keyboard mouse" coords
	_km.x = x;
	_km.y = y;

	// Adjust for the screen scaling
	if (!_overlayVisible) {
		event.mouse.x /= _videoMode.scaleFactor;
		event.mouse.y /= _videoMode.scaleFactor;
		if (_videoMode.aspectRatioCorrection)
			event.mouse.y = aspect2Real(event.mouse.y);
	}
}
Пример #7
0
int stretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY) {
	int maxDstY = real2Aspect(origSrcY + height - 1);
	int y;
	const uint8 *startSrcPtr = buf + srcX * 2 + (srcY - origSrcY) * pitch;
	uint8 *dstPtr = buf + srcX * 2 + maxDstY * pitch;

	for (y = maxDstY; y >= srcY; y--) {
		const uint8 *srcPtr = startSrcPtr + aspect2Real(y) * pitch;

#if ASPECT_MODE == kSuperFastAndUglyAspectMode
		if (srcPtr == dstPtr)
			break;
		memcpy(dstPtr, srcPtr, sizeof(uint16) * width);
#else
		// Bilinear filter
		switch (y % 6) {
		case 0:
		case 5:
			if (srcPtr != dstPtr)
				memcpy(dstPtr, srcPtr, sizeof(uint16) * width);
			break;
		case 1:
			interpolate5Line<ColorMask, 1>((uint16 *)dstPtr, (const uint16 *)(srcPtr - pitch), (const uint16 *)srcPtr, width);
			break;
		case 2:
			interpolate5Line<ColorMask, 2>((uint16 *)dstPtr, (const uint16 *)(srcPtr - pitch), (const uint16 *)srcPtr, width);
			break;
		case 3:
			interpolate5Line<ColorMask, 2>((uint16 *)dstPtr, (const uint16 *)srcPtr, (const uint16 *)(srcPtr - pitch), width);
			break;
		case 4:
			interpolate5Line<ColorMask, 1>((uint16 *)dstPtr, (const uint16 *)srcPtr, (const uint16 *)(srcPtr - pitch), width);
			break;
		}
#endif
		dstPtr -= pitch;
	}

	return 1 + maxDstY - srcY;
}
Пример #8
0
void OSystem_SDL::hideOverlay() {
	assert (_transactionMode == kTransactionNone);

	if (!_overlayVisible)
		return;

	int x, y;

	_overlayVisible = false;

	// Since resolution could change, put mouse to adjusted position
	// Fixes bug #1349059
	x = _mouseCurState.x / _scaleFactor;
	y = _mouseCurState.y / _scaleFactor;
	if (_adjustAspectRatio)
		y = aspect2Real(y);

	warpMouse(x, y);

	clearOverlay();

	_forceFull = true;
}