[Kde-games-devel] Bugs (showstoppers?) in KGoldrunner
Luciano Montanaro
mikelima at gmail.com
Thu Nov 29 10:25:09 CET 2007
Il Thursday 29 November 2007 05:37:41 Ian Wadham ha scritto:
> On Thu, 29 Nov 2007 05:26 am, Luciano Montanaro wrote:
> > I find that kgoldrunner crashes on startup on my development
> > laptop. It seems to work on the desktop, when I installed the packages,
> > however I can't see why.
> >
> > The line
> > if (success && (resizeCount > 0)) { // If startup, do not render or
> > paint
> >
> > in kgrcanvas.cpp, changeTheme function seem to be the responsible for
> > this. If I remove the resizeCount check, the program starts up and works
> > correctly.
>
> That line is there to prevent SVG rendering happening until the size
> of the central widget is finally known, which is not until after
> TWO resize events. I thought it was worth doing the theme's SVG load
> during the startup sequence, to spread the overhead around a bit, rather
> than having it all concentrated in the resize event. The rendering o'head
> is huge on some themes now, so I would not like to render prematurely
> and uselessly, as would happen if that check were removed.
>
I know, but this does not work for me. It is not my build either, also the
Kubuntu packages crash.
> Luciano, the code works for me and perhaps for everybody else.
> It has been in KGoldrunner for several months now ...
>
I know, but I can't see how.
Here is the console log of a session of KGoldrunner:
--------------
The games data and handbook should be in the following locations:
System games: /usr/lib/kde4/share/kde4/apps/kgoldrunner/system/
User data: /home/mikelima/.kde4/share/apps/kgoldrunner/user/
Handbook: /usr/lib/kde4/share/doc/kde4/HTML/en/kgoldrunner/
Called KGrCanvas::KGrCanvas ... QSize(100,30)
Scale 1.75 Scaled Step 7
Calling initView() ...
kgoldrunner(7631) KGrGame::initCollections: Config() Game and Level "sot" 0 3
Calling view->setBaseScale() ...
kgoldrunner(7631)/kdeui (KXmlGui) KXMLGUIFactory::removeClient:
KXMLGUIFactory::removeClient( 0x72ddb8 )
kgoldrunner(7631)/kdeui (KXmlGui) KXMLGUIFactory::addClient:
KXMLGUIFactory::addClient( 0x72ddb8 )
kgoldrunner(7631)/kdeui (KXmlGui) KXMLGUIFactory::addClient:
KXMLGUIFactory::addClient( 0x83aa10 )
KGoldrunner::sizeHint() called ... 640x600
Config()
Theme "/usr/lib/kde4/share/kde4/apps/kgoldrunner/themes/kgr_geek.desktop"
0 msec. New
Theme - "/usr/lib/kde4/share/kde4/apps/kgoldrunner/themes/kgr_geek.desktop"
kgoldrunner(7631) KGrTheme::load: New
Theme - "/usr/lib/kde4/share/kde4/apps/kgoldrunner/themes/kgr_geek.desktop"
250 msec. Finish loading new theme.
KGrCanvas::resizeEvent: 1 QSize(640,507)
Resize pending? true
ASSERT: "m_tileset" in
file /build/buildd/kdegames-kde4-3.96.0/kgoldrunner/src/kgrplayfield.cpp,
line 39
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = kgoldrunner path = <unknown> pid = 7631
sock_file=/home/mikelima/.kde/socket-zaphod/kdeinit4__0
Warning: connect() failed: : No such file or directory
-----------
Now the ASSERT up there is due to a Q_ASSERT macro I added there to trace the
problem. It's just a warning.
But m_tileset is not the only unset variable; at least m_tileSprites is not
initialised, and the crash is really due to Qt trying to access non-existent
pixmaps a few lines below. However, if I workaround that problem too, the
program still crashes.
> > The problem is that in the kgrplayground setTile() method, the m_tileset
> > seem to be null, and the m_tileSprites list seem to be empty, so the
> > drawTheScene() method in kgrcanvas should really be called before the
> > game initialization proceeds.
>
> The pixmap lists will be null until resize time. drawTheScene() renders
> them.
>
> > The other problem is less critical, but annoying. Many keyboard shortcuts
> > do not seem to work for me. The Esc or p keys do not, for sure, but there
> > are others.
>
> I have had a lot of trouble with this, going back over a year, I think.
> The problems have come from the shortcut-handling functions moving from KDE
> to Qt libs and the Configure Shortcuts dialog being re-written. Your
> particular problem is probably because the syntax for alternate shortcuts
> has changed. You now need, for example:
>
> <Action shortcut="P; Escape" name="game_pause" />
>
I know that - although I think I also patched kconfig to accept it without
spaces... however, the rc file is correct, and the game_pause line reads
exactly as for you. I had to zap my .kde4 directory once to fix kwin
shortcuts too, but I don't think it would help here. I'll try to do that
anyway.
> in the ui.rc file. Note the *space* after the semi-colon. If you delete
> (or edit) the ui.rc file down in ~/.kde, the shortcuts might come right.
> The SVN copy of the kgoldrunnerui.rc file has the correct syntax.
>
> > Fortunately the digging and movement shortcuts work, at least.
>
> Heh, you must be a masochist, Luciano ... :-) Don't you use the mouse?
>
With drawing programs, mostly. And with some game too, but it looks like it
does not work for me in KGoldrunner. I don't use a mouse on the laptop, so
that may make things worse for me in this case. All things considered, I feel
I have a better control of our hero with the keyboard.
One thing that I may find annoying is having the pointer on the game scheme.
Ciao,
Luciano
More information about the kde-games-devel
mailing list