| Summary: | Colour distortion when playing a game in windowed mode | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Kieran P <kieran776> |
| Component: | *don't know* | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | ||
| Version: | 1.2.14 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X 10.6 | ||
| Attachments: | Fix for Globulation 2 | ||
|
Description
Kieran P
2009-10-16 12:35:09 UTC
I haven't been able to build it, but I think the problem is in these functions:
// Color
Uint32 Color::pack() const
{
return (SDL_MapRGB(&_glFormat, r, g, b) & 0x00ffffff) | (a << 24);
}
void Color::unpack(const Uint32 packedValue)
{
SDL_GetRGB(packedValue, &_glFormat, &r, &g, &b);
a = packedValue >> 24;
}
They assume that the alpha is in the high bits, which isn't necessarily the case. I believe they want to use SDL_MapRGBA() and SDL_GetRGBA() instead.
(In reply to comment #1) > I haven't been able to build it, but I think the problem is in these functions: The mac scons scripts looks for libraries in /opt/local. Will probably need to add /usr and /usr/local at some point. You can just do a find and replace of /opt/local in SConstruct with the prefix where boost etc are installed. > // Color > Uint32 Color::pack() const > { > return (SDL_MapRGB(&_glFormat, r, g, b) & 0x00ffffff) | (a << > 24); > } > > void Color::unpack(const Uint32 packedValue) > { > SDL_GetRGB(packedValue, &_glFormat, &r, &g, &b); > a = packedValue >> 24; > } > > They assume that the alpha is in the high bits, which isn't necessarily the > case. I believe they want to use SDL_MapRGBA() and SDL_GetRGBA() instead. Are you able to provide a quick diff for testing please? As I stated earlier, I don't know c++ myself, and given the release of this version within a day or two, it would be good to get this sorted beforehand. Created attachment 420 [details]
Fix for Globulation 2
Yep this was a bug in Globulation where it assumed that the alpha channel was in the high bits. I suspect all of the other windowed color issues on Snow Leopard will be the same thing. (In reply to comment #4) > Yep this was a bug in Globulation where it assumed that the alpha channel was > in the high bits. I suspect all of the other windowed color issues on Snow > Leopard will be the same thing. Hmm, there are still some graphics issues, though thankfully not as much now :-D http://skitch.com/k776/ndt19/dock Any ideas? I did a search for SDL_MapRGB and SDL_GetRGB but there are no more. Nope, you can contact the authors and let them know about this bug though, and they'll hopefully be able to track it down. |