Bug 65401 - KSnake graphics are horrible in KDE 3.1.92
Summary: KSnake graphics are horrible in KDE 3.1.92
Status: RESOLVED FIXED
Alias: None
Product: ksnake
Classification: Applications
Component: general (show other bugs)
Version: 0.3.1
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Andrew Chant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-02 22:57 UTC by Albert Astals Cid
Modified: 2003-11-23 11:38 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Albert Astals Cid 2003-10-02 22:57:03 UTC
Version:           0.3.1 (using KDE 3.1.92 (alpha2, CVS >= 20030921), compiled sources)
Compiler:          gcc version 3.2.2 (Mandrake Linux 9.1 3.2.2-3mdk)
OS:          Linux (i686) release 2.4.21-0.25mdk

I've found 3 graphic errors in KSnake of KDE 3.1.92
 - The snake is horrible
 - The letters saying Snake race at the beginning are not "textured"
 - The icons on the top marking how many lives you have left are also ugly

I've looked at the code and nothing important has changed since KDE 3.1.0 and it looks good in it (Mandrake 9.1)
Comment 1 Albert Astals Cid 2003-11-18 00:57:30 UTC
Subject: kdegames/ksnake

CVS commit by aacid: 

Using BarIcon to load icons that are not bar icons is VERY BAD, that fixes bug #65401, fixing my own bugs makes me fell better 8-)
Some cleaning at ball.cpp and ball.h, remove empty destructors, use polimorphism and inheritance to remove DumbKillerBall::nextMove() as its code was the same as KillerBall::nextMove() except one line

CCMAIL:65401-done@bugs.kde.org


  M +8 -28     ball.cpp   1.4
  M +7 -7      ball.h   1.5
  M +5 -5      pixServer.cpp   1.22
  M +2 -1      trys.cpp   1.11



Comment 2 John Tapsell 2003-11-22 17:11:50 UTC
dude - I think you made a bad mistake taking out the destructor.  If you make the class virtual, then you really should make the destructor virtual as well, especially if you are using polymorphism!  Otherwise you are just looking for some bad memory problems.
please put it back in.
Comment 3 Albert Astals Cid 2003-11-23 11:00:09 UTC
I don't think so (i can be wrong of course).

First, ALL the destructors were empty, even the base class Ball had an empty destructor.

Second, even if you don't define the destructor, it is called(see http://www.parashift.com/c++-faq-lite/dtors.html#faq-11.1 it says "A class's destructor (whether or not you explicitly define one) automagically invokes the destructors for member objects.")

Third, there is not any object creation in ball.cpp (i mean "new foo"), so why do we need destructors?

As i said, i can be wrong, but if i am wrong could you care to explain why so the next time i won't have the same error.
Comment 4 Albert Astals Cid 2003-11-23 11:38:27 UTC
Uhh, found that "make your destructor virtual if your class has any virtual functions" at http://www.parashift.com/c++-faq-lite/virtual-functions.html#faq-20.5

I've changed the code and i've added a virtual empty destructor to Ball and to KillerBall. Do you think it's fine now? 

Albert.