From: Tim H. <ho...@wu...> - 2010-06-10 11:54:18
|
Hi Wenyuan, That's great! I really look forward to checking it out, when I return to more convenient internet access in late June. (This was written from 2.4km elevation.) Best, --Tim On Wednesday, June 09, 2010 02:19:19 am Wenyuan Guo wrote: > Hi all, > > I have updated our Git repository, master branch with an improved version > of SVG sprite loader. It caches prerendered PNG versions of SVG sprites on > harddisk, and I'm happy to report that it greatly improves the initial > loading time as well as delay in switching between fullscreen and windowed > mode in-game! No new cache files will be generated as long as the user > doesn't change the resolution of his/her desktop. Please try it out if you > have time! > > The modification is entirely transparent to other parts of the program and > the function signatures and usages are completely unchanged. > > One difficulty I had was I had intended to use BMP files as cache, since > SDL has native "save" functions into that format. But it turns out that > SDL's saveBMP doesn't support alpha transparency, causing scrambled > sprites. After a good amount of googling, to my surprise, tuxpaint has a > function to save SDL surfaces into PNG format! So in my implementation I > have "borrowed" that function (after modifying it a bit to support alpha > channel) and > everything's fine :D! Maybe that part can eventually to be factored out in > the common? > > Cheers > Wenyuan |