SDL_PixelFormat colorkey field in 1.3?

Just tried out SDL 1.3, and am attempting to get some legacy code working with it. The main thing I’m running into at the moment is the code uses

key = surface->format->colorkey;

but SDL_PixelFormat no longer contains a “colorkey” field, and from what I can tell, SDL_Surface doesn’t contain this data either. I’m not the one who wrote the legacy code I’m trying to get to compile, so I don’t know much about what is going on. Hoping thought that someone can explain what happened in the move between 1.2.14 and 1.3 where the colorkey went, and what I should do here.

You want SDL_GetColorKey(), and you can find the syntax in SDL_surface.hOn Thu, Dec 10, 2009 at 8:13 PM, VernJensen wrote:

Just tried out SDL 1.3, and am attempting to get some legacy code working
with it. The main thing I’m running into at the moment is the code uses

key = surface->format->colorkey;

but SDL_PixelFormat no longer contains a “colorkey” field, and from what I
can tell, SDL_Surface doesn’t contain this data either. I’m not the one who
wrote the legacy code I’m trying to get to compile, so I don’t know much
about what is going on. Hoping thought that someone can explain what
happened in the move between 1.2.14 and 1.3 where the colorkey went, and
what I should do here.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

In 1.3, there’s an SDL_GetColorKey and a SDL_SetColorKey API to do this for you. You can find them in SDL_Surface.h________________________________
From: vern@actionsoft.com (VernJensen)
Subject: [SDL] SDL_PixelFormat colorkey field in 1.3?

Just tried out SDL 1.3, and am attempting to get some legacy code working with it. The main thing I’m running into at the moment is the code uses

key = surface->format->colorkey;

but SDL_PixelFormat no longer contains a “colorkey” field, and from what I can tell, SDL_Surface doesn’t contain this data either. I’m not the one who wrote the legacy code I’m trying to get to compile, so I don’t know much about what is going on. Hoping thought that someone can explain what happened in the move between 1.2.14 and 1.3 where the colorkey went, and what I should do here.