Ejemplo n.º 1
0
void ClientMap::render () const
{
	ExecutionTime renderTime("ClientMapRender", 2000L);
	const int x = _screenRumbleOffsetX + _x + _camera.getViewportX();
	const int y = _screenRumbleOffsetY + _y + _camera.getViewportY();

	const int scissorX = std::max(0, x);
	const int scissorY = std::max(0, y);
	const bool debug = Config.isDebug();
	if (debug) {
		_frontend->renderRect(scissorX, scissorY, getPixelWidth() * _zoom, getPixelHeight() * _zoom, colorRed);
	} else {
		_frontend->enableScissor(scissorX, scissorY, getPixelWidth() * _zoom, getPixelHeight() * _zoom);
	}
	renderLayer(x, y, LAYER_BACK);
	renderLayer(x, y, LAYER_MIDDLE);
	renderLayer(x, y, LAYER_FRONT);

	if (_restartDue != 0) {
		renderFadeOutOverlay();
	}

	Config.setDebugRendererData(x, y, getWidth(), getHeight(), _scale * _zoom);
	Config.getDebugRenderer().render();

	renderParticles(x, y);

	if (!debug) {
		_frontend->disableScissor();
	}
}
Ejemplo n.º 2
0
void ClientMap::renderFadeOutOverlay () const
{
	const uint32_t now = _time;
	const uint32_t delay = _restartDue - _restartInitialized;
	const float restartFadeStepWidth = 1.0 / delay;
	const uint32_t delta = now > _restartDue ? 0U : _restartDue - now;
	const float alpha = 1.0 - delta * restartFadeStepWidth;
	const Color color = { 0.0, 0.0, 0.0, alpha };
	_frontend->renderFilledRect(_x, _y, getPixelWidth() * _zoom, getPixelHeight() * _zoom, color);
}
Ejemplo n.º 3
0
	int getWaterWidth () const override { return getPixelWidth(); }
UT_uint32 AP_Win32Toolbar_FontCombo::getDroppedWidth() const
{
	// TODO make better calculation of dropped width
	return getPixelWidth() + 100;
}