Hi all, I'm using the EasyCE code, and I've come up with the following code to copy one picture (smaller) inside of another (larger), my question is can it be done faster?, I know it can be for non-trans as you can use memcpy....?:
- Code:
void place_item_trans(int destsizex, int xpos, int ypos, int xsize, int ysize, int number_items, int item, int transcolor, PIXEL* src, PIXEL* dest)
//
//destsizex: is the number of "pixels" in the destination buffer
//xpos, ypos: the destination location of picture
//sizex, sizey: the sources' picture size in pixels.
//number_items: if the source is a picture array, the number of them,
//item: the tile to retrieve 0 to number_items-1;
//transcolor: the trans color in the tile.
//src, dest: pointers to the buffers....
{
for (int y = 0; y < ysize; y++)
{
for (int x = 0; x < xsize; x++)
{
if (src[xsize * number_items * y + (item * xsize) + x] != transcolor)
dest[destsizex * (y + ypos) + xpos + x] = src[xsize * number_items * y + (item * xsize) + x];
}
}
}