filter pointer events by /16, so that the game cursor is not redrawn

needlessly each time the mouse moves by one pixel.

Makes the game playable for me.

okay deanna@
This commit is contained in:
espie 2008-01-27 18:16:22 +00:00
parent 4a8a2cc4a5
commit d7347a427b
2 changed files with 20 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.6 2008/01/27 16:34:32 deanna Exp $
# $OpenBSD: Makefile,v 1.7 2008/01/27 18:16:22 espie Exp $
COMMENT= city-building simulation
@ -6,6 +6,7 @@ DISTNAME= micropolis-20080126
WRKDIST= ${WRKDIR}/micropolis
WRKSRC= ${WRKDIST}/src
MAKE_FILE= makefile
PKGNAME= ${DISTNAME}p0
CATEGORIES= games

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-src_sim_w_tk_c,v 1.3 2008/01/27 18:16:22 espie Exp $
--- src/sim/w_tk.c.orig Sun Jan 27 16:10:47 2008
+++ src/sim/w_tk.c Sun Jan 27 16:19:46 2008
@@ -472,11 +472,12 @@ TileViewEventProc(ClientData clientData, XEvent *event
view->tool_x = x; view->tool_y = y;
}
+
/* XXX: redraw all views showing cursor */
/* XXX: also, make sure switching tools works w/out moving */
if (((view->tool_showing != last_showing) ||
- (view->tool_x != last_x) ||
- (view->tool_y != last_y))) {
+ ((view->tool_x >> 4) != (last_x >> 4)) ||
+ ((view->tool_y >> 4) != (last_y >> 4)))) {
#if 1
EventuallyRedrawView(view);
#else