[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-users] LoadSurface & alpha + patch
From: |
Guillaume Schmid |
Subject: |
[paragui-users] LoadSurface & alpha + patch |
Date: |
11 Aug 2002 23:04:15 +0200 |
Hello,
I noticed that if I use PG_FileArchive::LoadSurface to load a bitmap
(user as a sprite in my game), I cannot use the convertion to display
format (as a side note, the doc is contradictory, the boolean parameter
to LoadSurface defaukt to false (no convertion) ans the text in the
documentation says otherwise) because I loose the alpha channel info.
Browsing the source, it seems that if the convert parameter is true, the
LoadSurface method call SDL_DisplayFormat. This is the problem as this
SDL function does not convert the alpha info (it is destroyed).
A super-easy-instant-fix would be to replace SDL_DisplayFormat by
SDL_DisplayFormatAlpha(this function appeared in SDL 1.1.5).
So, here is my question: Is there a good reason to use DisplayFormat
instead of DisplayFormatAlpha ? Is it possible to change this in the
stable release ?
Attached is the small patch I suggest (created against the latest stable
branch).
It has been tested with my game and it works very well.
Thank you for your attention.
patch-gui
Description: Text Data
- [paragui-users] LoadSurface & alpha + patch,
Guillaume Schmid <=