Why are screenshots saved as BMP?
Thu, 2011-08-25 16:36
As they explained me, there are 2 reasons of the subj:
1) saving to png demands extra dependencies;
2) saving to png will make game to slow down.
But really, it is no so. It turns out that libpng depends on libsdl-image (at least, in Debian):
http://packages.debian.org/sid/libsdl-image1.2
Then, if writing a screenshot to a file (after copying it to a buffer in RAM) be done in a background thread, it can not slowdown a game, since Hedgewars run normally together with other programs.
A header of libpng for Free Pascal exists. So, why don't save a picture to png?
Ah. I wasn't sure if PNG encoding was available by default. Obviously decoding is or the game wouldn't function.
Running in a background thread could still slow down the game on any non-multiprocessor computer.
Not to mention extra memory demands.
But. Dunno, I suppose it could be an optional config param. Just leave it turned off on android or wimpy computers.
If you wanna implement it, go for it!
--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev