hello i'm doing a game for psp using sdl. I want to know if there is a way to make a fast collision test between 2 sprites i need to not detect the colorkey... so i can't use squares.
I've been thinking in use a prod (i'm not sure of this word) first i will test if the two images get in touch if they did now i make a more intensive test for knowing if they are in a colorkey zone.
Use the bounding squares first to get an idea whether they might be colliding. Then you're down to the hard yards of checking whether the box that's the intersection of the two squares has pixels from both sprites in it at the same location.
so as i was thinking... the only way of doing collision is with 2 collision test one using bounding box and one using pixel per pixel colorkey in the zone of collision.
Not the only one. Just the most appropriate to your cause (though you could still optimize with something like a smaller transparency map for each sprite and equal).
One way is to have a bitmask for each sprite. Basically have a bit set if there's sprite data, and clear if it's colourkey. Then you can just SHIFT and AND the two masks together to see if there's a collision.
but having a map for all the images would waste a lot of memory and also will need a preprocess i'll try the first one and if i need more speed here i'll improve it.