Jump to content
  • Advertisement
Sign in to follow this  
Samsonite

SDL:Multiple color keys?

This topic is 4899 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I was wondering how i could do several color keys for one image.A sprite in this case. I thought maybe i could do:

SDL_Surface* grasstile=SDL_LoadBMP("grass.bmp");
SDL_SetColorKey(grasstile, SDL_SRCCOLORKEY, SDL_MapRGB(grasstile->format, 0, 255, 0);
SDL_SetColorKey(grasstile, SDL_SRCCOLORKEY, SDL_MapRGB(grasstile->format, 0, 0, 255);


But that only overrides the first call to SDL_SetColorKey. So is there a way to have several color keys for one image, or do i have to use a different way? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
It's only been two hours, at a time when many of the people who visit the forums are sleeping. I think you have an unreasonable expectation for turn around time on your questions. In any case, no, you can't set multiple values as color keys for an image in SDL.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!