mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 09:53:00 +02:00
Found that the crosshair function was wasting compute cycles by
drawing out-of-bounds when the crosshair was turned off rather than just not drawing it.
This commit is contained in:
@@ -457,6 +457,9 @@ DBWDrawCrosshair(window, plane)
|
||||
{
|
||||
Point p;
|
||||
|
||||
/* Crosshair is disabled by setting to MINFINITY */
|
||||
if (crosshairPos.p_x == MINFINITY) return;
|
||||
|
||||
WindPointToScreen(window, &crosshairPos, &p);
|
||||
|
||||
GrSetStuff(STYLE_YELLOW1);
|
||||
|
||||
@@ -146,13 +146,6 @@ int nb;
|
||||
TCairoData *tcairodata = (TCairoData *)tcairoCurrent.mw->w_grdata2;
|
||||
int i;
|
||||
|
||||
// Diagnostic
|
||||
Display *disp = cairo_xlib_surface_get_display(tcairodata->surface);
|
||||
Screen *screen = cairo_xlib_surface_get_screen(tcairodata->surface);
|
||||
Drawable draw = cairo_xlib_surface_get_drawable(tcairodata->surface);
|
||||
int w = cairo_xlib_surface_get_width(tcairodata->surface);
|
||||
int h = cairo_xlib_surface_get_height(tcairodata->surface);
|
||||
|
||||
cairo_save(tcairodata->context);
|
||||
for (i = 0; i < nb; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user