problem with the gomoku sample

6 views
Skip to first unread message

Martin DeMello

unread,
Oct 11, 2009, 3:53:49 AM10/11/09
to jazzs...@googlegroups.com
When I run the gomoku sample, the board isn't redrawn until both I and
the computer have played. That is, I click, nothing happens, there is
a perceptible delay while the computer thinks, and then two pieces
appear at once.Is there an issue with invalidate-view?

Running the latest jedi and gambit from git, under linux.

martin

Guillaume Cartier

unread,
Oct 13, 2009, 2:35:00 PM10/13/09
to jazzs...@googlegroups.com
Strange, it works correctly (e.g. with an animation making the piece
slide down the column) on both Windows and the X11-based version in
Mac OS X.

If you want to take a look at the code (I do not have access to a pure
Linux station), all happens in the move-animation method of the
C4-Board class. It's a very simple few lines method. If your catalogs
are up-to-date, typing move-animation and pressing F12 should edit the
code.

One thing in that method is that the animation loop doesn't have any
code for slowdown. I remember when doing it that Windows's redraw-view
was slow enough as it was :-). Maybe adding a sleep in there will
help? Or maybe it is something specific to the X11 implementation that
makes the redraw-view calls not render immediatly on your X11
implementation and we are missing some X11 call to force a refresh?

Guillaume

Martin DeMello

unread,
Oct 13, 2009, 2:42:21 PM10/13/09
to jazzs...@googlegroups.com
No, C4 works fine, it's gomoku that has the problem. Here are the
details from xorg.log, in case they help:

X.Org X Server 1.6.3.901 (1.6.4 RC 1)
Release Date: 2009-8-25
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.30-ARCH i686
Current Operating System: Linux mercury 2.6.31-ARCH #1 SMP PREEMPT Thu
Oct 8 14:35:12 CEST
2009 i686
Build Date: 04 September 2009 03:37:03PM

martin

Guillaume Cartier

unread,
Oct 13, 2009, 3:23:14 PM10/13/09
to jazzs...@googlegroups.com
Sorry about that, I had read C4 :-)

Then, everything is as it should be. It does the same thing on Windows
and Mac. I'll add a redraw-view, so apart from being nicer, no one
else will go thinking it's a platform specific bug ;-)

Thanks!

Guillaume

Martin DeMello

unread,
Oct 13, 2009, 3:29:05 PM10/13/09
to jazzs...@googlegroups.com
ah, okay :) why does invalidate-view not cause a redraw?

martin

On Wed, Oct 14, 2009 at 12:53 AM, Guillaume Cartier

Guillaume Cartier

unread,
Oct 13, 2009, 3:35:48 PM10/13/09
to jazzs...@googlegroups.com
That's the difference between invalidate-view and redraw-view.

invalidate-view tells the windowing system a certain area must be
refreshed at the next paint. So multiple calls to invalidate-view will
just accumulate and the next paint will draw the union of those
invalidated areas. This is usually what we want.

redraw-view forces an immediate redraw.

Guillaume
Reply all
Reply to author
Forward
0 new messages