I notice that dunelegacy lags quite badly on my modern x230t thinkpad running OpenBSD, but only when fog of war is enabled and when I am zoomed right out.
A friend and I did some experimentation and found that the lines of code which caused the lag are (in the fog loop in Game.cpp):
SDL_Surface** hiddenSurf = pGFXManager->getObjPic(ObjPic_Terrain_Hidden);
Assuming that hiddenSurf does not change in all iterations of the fog loop, we can move the allocation, lock and unlocking of hiddenSurf outside the fog loop to remove the lag. The attached patch does exactly this and it appears to work. The question now is, is it correct?
Log in to post a comment.