I'm developing a tile-based, zoomable, and rotatable blitter for a game. I have it working, but I'm wondering if there may be a quicker way to blit my pixels.
Currently, I use the following pseudo code:
This works well on a toshiba (30 fps), but gets really bad results (10 fps) on an older iPaq (seems like I saw something about the screen memory being laid out differently).
Any ideas on how to make the blitting quicker? The actual code is a bunch of pointer math using fixed point float code. I can post a demo at the file exchange if anyone is interested.
Jason
Currently, I use the following pseudo code:
- Code:
display->GetBackBuffer()->Lock( screen );
for(y=0...)
{
Pixel aline = &(screen.pixels[y]); //pointer to first pixel in row.
for(x=0...)
{
*(aline++) = PixelCalc(...) //set pixel value
...
}
}
display->GetBackBuffer()->Unlock();
This works well on a toshiba (30 fps), but gets really bad results (10 fps) on an older iPaq (seems like I saw something about the screen memory being laid out differently).
Any ideas on how to make the blitting quicker? The actual code is a bunch of pointer math using fixed point float code. I can post a demo at the file exchange if anyone is interested.
Jason