Example #1
0
void GUI::processHighlights(Menu &menu) {
	int x1, y1, x2, y2;
	Common::Point p = _vm->getMousePos();
	int mouseX = p.x;
	int mouseY = p.y;

	if (_vm->game() == GI_LOL && menu.highlightedItem != 255) {
		// LoL doesnt't have default highlighted items.
		// We use a highlightedItem value of 255 for this.

		// With LoL no highlighting should take place unless the
		// mouse cursor moves over a button. The highlighting should end
		// when the mouse cursor leaves the button.
		if (menu.item[menu.highlightedItem].enabled)
			redrawText(menu);
	}

	for (int i = 0; i < menu.numberOfItems; ++i) {
		if (!menu.item[i].enabled)
			continue;

		x1 = menu.x + menu.item[i].x;
		y1 = menu.y + menu.item[i].y;

		x2 = x1 + menu.item[i].width;
		y2 = y1 + menu.item[i].height;

		if (mouseX > x1 && mouseX < x2 &&
			mouseY > y1 && mouseY < y2) {

			if (menu.highlightedItem != i || _vm->game() == GI_LOL) {
				if (_vm->game() != GI_LOL) {
					if (menu.item[menu.highlightedItem].enabled)
						redrawText(menu);
				}

				menu.highlightedItem = i;
				redrawHighlight(menu);
			}
		}
	}

	_screen->updateScreen();
}
Example #2
0
static void redraw() {

    sortSelectionCorners();
    if (krtOn) {
        redrawKrt();
        //redrawKrt();
    } else {
        redrawText();
    }

}
Example #3
0
void
TextPainter::draw(
		const util::rect<double>&  roi,
		const util::point<double>& resolution) {

	// only update texture if necessary
	//if (resolution != _lastResolution || roi != _lastRoi [> TODO: make this more efficient <]) {

		LOG_ALL(textpainterlog) << "need update" << endl;

		_lastRoi        = roi;
		_lastResolution = resolution;

		redrawText(roi, resolution);

		// if there is nothing to do, don't do it
		if (_glRoi.width() <= 0 || _glRoi.height() <= 0)
			return;

		LOG_ALL(textpainterlog) << "(re)loaded texture" << endl;
	//}

	drawText();
}