Why are screenshots saved as BMP?

1 reply [Last post]
Blackflame
User offline. Last seen 9 years 31 weeks ago. Offline
Joined: 2011-08-09
Posts: 17

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?

nemo
nemo's picture
User offline. Last seen 3 weeks 2 days ago. Offline
Joined: 2009-01-28
Posts: 1861

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

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]