high,
im new to this whole mailing list thing. but hello everyone. im a fairly new
programmer and i love SDL. ive just recently (almost) finished my first 2d
game using this wonderfull API. its a pong clone (what else?). anyway, the
game is pretty much done, BUT, before i released it to have others play/test
it, i wanted to change all of my images from .bmp to a .jpg or something
else thats small. i cant be sending this game out with all bmp’s cause then
the file would be huge!!! anyway, heres the problem : i downloaded SDL_image
and i installed everything. first thing i did was change my intro screen to
a .jpg, then in my code i changed the line
data.intro = SDL_LoadBMP(“intro.bmp”);
to
data.intro = IMG_Load(“intro.jpg”);
everything worked fine! so im all excited, thinking this would work. i then
change all my in game objects(the paddle’s and ball) from bmps to jpgs in
the same way. but theres a problem. the background isnt transparant
anymore!!! the background color(magenta aka 255,0,255) shows up now on my
screen!! not only does it show up, but it almost looks like bits and pieces
of it are transparant. why is this so? can you only do transparancy with a
.bmp file? how do i make the transparancy work with a .jpg? could someone
please help me!!! thank you very much everyone. BTW here is a piece of my
code, the first half loads the images, and the second half makes them
transparant. maybe the SetColorKey has to change somehow to work with
.jpgs??? thanks for any help!!! i appreciate it
data.back = IMG_Load(“Background.jpg”);
data.player_paddle = IMG_Load(“PlayerPaddle.bmp”);
data.enemy_paddle = IMG_Load(“EnemyPaddle.bmp”);
SDL_SetColorKey(data.player_paddle,
SDL_SRCCOLORKEY,SDL_MapRGB(data.player_paddle->format, 255, 0, 255));
SDL_SetColorKey(data.enemy_paddle,
SDL_SRCCOLORKEY,SDL_MapRGB(data.enemy_paddle->format, 255, 0, 255));_________________________________________________________________
Get a FREE online computer virus scan from McAfee when you click here.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963