Ejemplo n.º 1
0
void Cursor::render() {
	updateFadeLevel();
	updateHintDelay();

	if (!_gfx->isPosInScreenBounds(_mousePos)) {
		setCursorType(Cursor::kPassive);
	}

	if (_mouseText && _gfx->gameViewport().contains(_mousePos) && _hintDisplayDelay <= 0) {
		_gfx->setScreenViewport(false);

		// TODO: Should probably query the image for the width of the cursor
		// TODO: Add delay to the mouse hints like in the game
		const int16 cursorDistance = 32;
		Common::Rect mouseRect = _mouseText->getRect();
		Common::Point pos = _gfx->convertCoordinateCurrentToOriginal(_mousePos);
		pos.x = CLIP<int16>(pos.x, 48, Gfx::Driver::kOriginalWidth - 48);
		pos.y = CLIP<int16>(pos.y, Gfx::Driver::kTopBorderHeight, Gfx::Driver::kOriginalHeight - Gfx::Driver::kBottomBorderHeight - cursorDistance - mouseRect.height());
		pos.x -= mouseRect.width() / 2;
		pos.y += cursorDistance;

		_mouseText->render(pos);
	}

	if (_currentCursorType != kImage) {
		_cursorImage = StarkStaticProvider->getCursorImage(_currentCursorType);
	}

	if (_cursorImage) {
		_gfx->setScreenViewport(true); // Unscaled viewport so that cursor is drawn on native pixel space, thus no 'skipping', perform scaling below instead

		_cursorImage->setFadeLevel(_fadeLevel);
		_cursorImage->render(_mousePos, true, false); // Draws image (scaled)
	}
}
Ejemplo n.º 2
0
void VisualFlashingImage::render(const Common::Point &position) {
	updateFadeLevel();

	_surfaceRenderer->setFadeLevel(_fadeLevel);
	_surfaceRenderer->render(_texture, position);
}