you might be better off using memcpy as it will be faster (remember every pixel is 2 bytes)
so instead your x loop you could have something like
- Code:
memcpy(dst,source,480); //(240*2=480)
PS.actually looked on your code, do you really need the if statement?
- Code:
[b]if (spritepixel != 0)[/b] *dst = spritepixel;
I'm not sure if you're aware of the fact, that:
1.Because of this if, it copies only pixels with color value other then 0 (doesn't seem like something for a scroller)
2.It's much slower with the if statement (althrought you need it for transparent sprites)
3.If this if statement is what you wish, memcpy won't be able to reproduce your effect so you can't use it. Althrought if you don't want this if statement to be there simple leave
- Code:
*dst = spritepixel;
, better idea yet would be to do the copy without the spritepixel variable (not sure exactly how EasyCE works so I might be wrong here, I'm guessing the meaning of spritepixel variable)
- Code:
*dst=*source++;
, still, memcpy will be much faster (up to nearly 100% I would say, at least on IPAQ's)