Hi, I tried during long hours to optimize Wormux because I have something like 8 fps :-( I tried *a lot* of combinaisons. No one was really interesting.
But, after long hours, I found a very good optimization! Instead of redrawing sky+ground at each frame, I only redraw them when the camera move. I also set default bits/pixel to 32 instead of 16. With this, I get 40 fps instea of 8 fps !!! But you have to know that my video card really sucks, it doesn't use hardware acceleration. My trick can't be used yet, because when an objet move, the background isn't redisplayed. So it's quite ugly. If you would like to test it, just set 0 to 1 in "#if 0" in (Sky|Ground)::Draw(). --- I also wrote statistics tools: StatStart("name"), StatStop("name"), and StatOutput() which can be used to benchmark Wormux (and find what should be improvment). I should write a Python script to naviguate in the results. It would be cool to have a GTK interface with a tree, like that: http://www.haypocalc.com/wiki/Image:Hachoir-0.0.png Hachoir is my last programming project: http://www.haypocalc.com/wiki/Hachoir (website only in french but program only in english :-)) Haypo -- Victor Stinner - étudiant à l'UTBM (Belfort, France) http://www.haypocalc.com/wiki/Accueil
signature.asc
Description: This is a digitally signed message part