[Kde-games-devel] Hope for Kolf

Ian Wadham ianw2 at optusnet.com.au
Sat Jul 4 15:47:54 CEST 2009


I am almost certain now that the problem with Kolf is not
to do with graphics, but rather that it is failing to pick up
its data correctly from kolf/courses/<course-name> when
it starts a new hole, so what it draws is only a fragment
of what it should draw.  Further evidence is that, after the
first hole, the ball is always in the center (its default
position), because it fails to find the ball-data.

I also noticed that the Kolf executable files for KDE 4.2
and KDE 4.3 are quite different in size.  So I ran the "strings"
command against each, piped the output into a "sort"
command and ran a "diff" between the results.  I got this:

/kde-devel/src/4.2/kdegames/kolf>
diff  strings /kde-devel/src/4.3/kdegames/kolf/strings
30c30
< /kde-devel/install/4.2/kde/lib:/kde-devel/install/4.2/kde/lib:/kde-devel/qt/4.4/qt-copy/lib
---
> /kde-devel/install/4.3/kde/lib:/kde-devel/install/4.3/kde/lib:/kde-devel/qt/4.5/qt-copy/lib
39d38
< libkde3support.so.4
42d40
< libkdegames.so.5
44d41
< libkio.so.5
48d44
< libphonon.so.4
50d45
< libQt3Support.so.4
54d48
< libQtNetwork.so.4
56d49
< libQtXml.so.4

I am not sure how to interprete this stuff, but I suspect some libraries
Kolf was relying on are no longer there in KDE 4.3 and Qt 4.5 and
possibly that there has been semantic drift in the functions Kolf uses,
most likely in the functions that access groups and named-values
in KConfig-style files (which are what the Course files are).

Evidence?  At the end of this email is a patch that logs the items
(KConfig groups) in each hole as the hole is loaded and started.

The holes after the demo hole (on the splash screen) and Hole 1
only ever get one item each, which is why the picture looks rather
empty after Hole 1.

Also, even in Hole 1, the group (item) names are not in sorted order
when read, whereas they are sorted in the KDE 4.2 case.

I think Kolf can be fixed by choosing the proper KDE 4 functions
and parameters for reading the Course file and not some KDE 3
transitional functions that Kolf may be using.  See KolfGame::openFile().

It's past my bedtime here in Australia, so maybe someone can look
at this further while I sleep.  If you do, I found the only way to get
output from my patch was by doing make -s and make install,
then kolf &.  This is some weird program!  I usually do make -s
and ./kolf &, but that was driving me crazy for a while because
it gave me no output !

FWIW, my output follows.  As you can see, holes 2, 3, 4 and 5 are
severely lacking in data ... :-)

Good luck guys, Ian W.

Using the "Easy Course" ...

/kde-devel/build/4.3/kdegames/kolf>which kolf
/kde-devel/install/4.3/kde/bin/kolf
/kde-devel/build/4.3/kdegames/kolf>kolf &
Hole 1 slope at 193,262 id 11
Hole 1 slope at 286,141 id 21
Hole 1 blackhole at 48,356 id 7
Hole 1 slope at 243,141 id 20
Hole 1 slope at 281,234 id 27
Hole 1 slope at 48,263 id 8
Hole 1 puddle at 95,336 id 12
Hole 1 slope at 326,-30 id 23
Hole 1 blackhole at 258,282 id 5
Hole 1 slope at 283,262 id 26
Hole 1 slope at 242,-1 id 19
Hole 1 slope at 284,302 id 29
Hole 1 slope at 153,262 id 10
Hole 1 slope at 232,224 id 6
Hole 1 slope at 88,263 id 9
Hole 1 slope at 167,301 id 30
Hole 1 blackhole at 126,146 id 6
Hole 1 sand at 300,37 id 16
Hole 1 slope at 16,22 id 3
Hole 1 hole at -50,-50 id 0
Hole 1 bridge at -15,261 id 13
Hole 1 bridge at 23,339 id 14
Hole 1 slope at 92,236 id 31
Hole 1 slope at 326,143 id 22
Hole 1 slope at 132,237 id 28
Hole 1 sand at -6,255 id 19
Hole 1 sand at 37,261 id 1
Hole 1 wall at 0,0 id 10
Hole 1 wall at 0,0 id 11
Hole 1 wall at 0,0 id 12
Hole 1 wall at 0,0 id 13
Hole 1 wall at 0,0 id 3
Hole 1 wall at 0,0 id 4
Hole 1 wall at 0,0 id 5
Hole 1 wall at 0,0 id 6
Hole 1 wall at 0,0 id 7
Hole 1 wall at 0,0 id 8
Hole 1 wall at 0,0 id 9
Hole 1 slope at 211,282 id 21
Hole 1 sand at -6,368 id 18
Hole 1 puddle at 69,72 id 14
Hole 1 sand at 40,303 id 2
Hole 1 sand at 33,295 id 0
Hole 1 puddle at 84,103 id 19
Hole 1 hole at -50,-50 id 0
Hole 1 cup at 313,325 id 22
Hole 2 cup at 343,362 id 3
Hole 3 hole at -50,-50 id 0
Hole 4 slope at 28,155 id 19
Hole 5 puddle at 198,207 id 11


Index: game.cpp
===================================================================
--- game.cpp    (revision 989051)
+++ game.cpp    (working copy)
@@ -1,3 +1,5 @@
+#include <stdio.h>
+
 /*
     Copyright (C) 2002-2005, Jason Katz-Brown <jasonkb at mit.edu>

@@ -4058,6 +4060,8 @@
                }

                const int id = (*it).right(len - (pipeIndex + 1)).toInt();
+                fprintf (stderr,  "Hole %d %s at %d,%d id %d\n",
+                         curHole, name.toLatin1().constData(), x, y, id);

                bool loaded = false;

<End of patch>


More information about the kde-games-devel mailing list