paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [paragui-users] LoadSurface & alpha + patch


From: Eric Ross
Subject: Re: [paragui-users] LoadSurface & alpha + patch
Date: Sat, 17 Aug 2002 17:53:34 -0400 (CLT)

On 11 Aug 2002, Guillaume Schmid wrote:

> 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.

Yup, you're right. The code comments say one thing and the code a 
different thing. Fixed

> 
> 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 ? 

The stable release mantains binary compatibility. The change to use 
SDL_DisplayFormatAlpha doesnt change the method signature, so mantaints 
the compatibility.

> 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.

I think your idea is good, so im going to apply your patch. Get the new 
version in a cvs near to you :)

Have fun.

--






reply via email to

[Prev in Thread] Current Thread [Next in Thread]