Exemple #1
0
void CMouseHandler::DrawCursor(void)
{
	if (guihandler)
		guihandler->DrawCentroidCursor();

	if (hide || (cursorText == "none"))
		return;

	if (!currentCursor || (hardwareCursor && currentCursor->hwValid)) {
		return;
	}

	// draw the 'software' cursor
	if (cursorScale >= 0.0f) {
		currentCursor->Draw(lastx, lasty, cursorScale);
	}
	else {
		CMouseCursor* nc = cursorFileMap["cursornormal"];
		if (nc == NULL) {
			currentCursor->Draw(lastx, lasty, -cursorScale);
		}
		else {
			nc->Draw(lastx, lasty, 1.0f);
			if (currentCursor != nc) {
				currentCursor->Draw(lastx + nc->GetMaxSizeX(),
				                    lasty + nc->GetMaxSizeY(), -cursorScale);
			}
		}
	}
}
Exemple #2
0
void CMouseHandler::DrawCursor()
{
	assert(currentCursor);
	
	if (guihandler)
		guihandler->DrawCentroidCursor();

	if (locked) {
		if (crossSize > 0.0f) {
			const float xscale = (crossSize / globalRendering->viewSizeX);
			const float yscale = (crossSize / globalRendering->viewSizeY);

			glPushMatrix();
			glTranslatef(0.5f - globalRendering->pixelX * 0.5f, 0.5f - globalRendering->pixelY * 0.5f, 0.f);
			glScalef(xscale, yscale, 1.f);

			if (gu->fpsMode) {
				DrawFPSCursor();
			} else {
				DrawScrollCursor();
			}

			glPopMatrix();
		}

		glEnable(GL_TEXTURE_2D);
		return;
	}

	if (hide)
		return;

	if (hardwareCursor && currentCursor->hwValid)
		return;

	// draw the 'software' cursor
	if (cursorScale >= 0.0f) {
		currentCursor->Draw(lastx, lasty, cursorScale);
	}
	else {
		// hovered minimap, show default cursor and draw `special` cursor scaled-down bottom right of the default one
		CMouseCursor* nc = cursorFileMap["cursornormal"];
		if (nc == NULL) {
			currentCursor->Draw(lastx, lasty, -cursorScale);
		}
		else {
			nc->Draw(lastx, lasty, 1.0f);
			if (currentCursor != nc) {
				currentCursor->Draw(lastx + nc->GetMaxSizeX(),
				                    lasty + nc->GetMaxSizeY(), -cursorScale);
			}
		}
	}
}
void CMouseHandler::DrawCursor(void)
{
	if (guihandler) {
		guihandler->DrawCentroidCursor();
	}
	
	if (hide || (cursorText == "none")) {
		return;
	}

	CMouseCursor* mc;
	map<string, CMouseCursor*>::iterator it = cursorCommandMap.find(cursorText);
	if (it != cursorCommandMap.end()) {
		mc = it->second;
	} else {
		mc = cursorFileMap["cursornormal"];
	}
	
	if (mc == NULL) {
		return;
	}

	if (cursorScale >= 0.0f) {
		mc->Draw(lastx, lasty, cursorScale);
	}
	else {
		CMouseCursor* nc = cursorFileMap["cursornormal"];
		if (nc == NULL) {
			mc->Draw(lastx, lasty, -cursorScale);
		}
		else {
			nc->Draw(lastx, lasty, 1.0f);
			if (mc != nc) {
				mc->Draw(lastx + nc->GetMaxSizeX(),
								 lasty + nc->GetMaxSizeY(), -cursorScale);
			}
		}
	}
}
void CMouseHandler::DrawCursor(void)
{
	if (hide)
		return;

	CMouseCursor *mc;
	map<string, CMouseCursor *>::iterator i;
	if ((i = cursors.find(cursorText)) != cursors.end()) {
		mc = i->second;
	}
	else {
		//info->AddLine("Unknown cursor: %s", cursorText.c_str());		
		mc = cursors[""];
	}

	mc->Draw(lastx, lasty);
}