The Forgotten Planet Game Music

The Forgotten Planet - Menu Music - By Josef Falkensköld ( www.falconshield.com )


Thursday, 6 October 2011

Huge Performance Increase!

Hi!

I noticed this morning that I had not set the "SDL_RLEACCEL" flag on the background surface. This stands for "run length encoding acceleration", and usually gives a good performance increase. However, in this case it was a HUGE difference.


Before the fix, the game was running in about 134-137 frames/second (on my computer). Now it runs with 475-520 frames / second, depending on how many tiles that has to be drawn on screen. More graphics on screen = less fps, naturally.

The game speed gained is about 3.5 - 3.7 faster!! Not bad at all :)

So remember to go over old code you've written sometimes and make sure things have been set up properly.

For the SDL interested ones, this is how you set it up:
SDL_SetAlpha(Your_SDL_Surface_Here,SDL_SRCALPHA|SDL_RLEACCEL,255);

Until next post!

SolarStrings

No comments:

Post a Comment