bad performance on low spec machine
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Freenukum |
Fix Released
|
Medium
|
Wolfgang Silbermayr |
Bug Description
Hi silwol
The reason freenukum is slow on my machine is because you are requesting a video surface of 24bpp and if SDL cannot give you this it will emulate it! This is very bad; my desktop is 32bpp. If I set FN_COLOR_DEPTH to 32 it's fast with pixelsize=2 :)
Therefore you can do this: pass "SDL_SWSURFACE | SDL_ANYFORMAT" as the flags when settting the video mode and this will use whatever bpp is available, or you can pass 0 as the bpp and SDL will use the desktop bpp. See here -> http://
Now, when you create surfaces for tiles and pictures, you want them to be the same format as the screen otherwise SDL will have to convert the source pixel to the destination pixel format, so instead of FN_COLOR_DEPTH use "screen-
Regards
Changed in freenukum: | |
assignee: | nobody → silwol |
importance: | Undecided → Medium |
milestone: | none → 0.3 |
status: | New → Confirmed |
Changed in freenukum: | |
status: | In Progress → Fix Released |
I hacked my copy of the source. This is what I did :-
Delete FN_COLOR_DEPTH from fn.h
In every function that uses FN_COLOR_DEPTH except main, place "int color_depth = SDL_GetVideoSur face()- >format- >BitsPerPixel; " at the top and change FN_COLOR_DEPTH to color_depth.
There is one problem: the tiles are loaded before the video mode is set, and fn_tile_load in fn_tile.c creates surfaces and it needs to know the screen bpp! The SDL docs state that SDL_CreateRBGSu rface must be called after SDL_SetVideoMode, so you should set the video mode first and then load the tiles -> http:// www.libsdl. org/cgi/ docwiki. cgi/SDL_ CreateRGBSurfac e
Also I noticed that you are not calling SDL_Quit(), or I can't find it. This is important -> http:// www.libsdl. org/cgi/ docwiki. cgi/SDL_ Quit
Regards