http://www.noteme.com/doomsharp/img/img001.jpg
Printable View
Following on from the previous post, this is the next incarnation of the blitter, that uses horizontal scan lines instead of sloping ones, the framerate is MUCH better. :D
There are some fat hairy bugs though as you can see, this weird effect is most likely caused by a miscalculation in the texture pointer allocation.
http://www.noteme.com/doomsharp/img/blitter1.PNG
Preliminary alg is now working!!!!
Its slow because there are lots of flops in it at the moment. There's still a huge amount of optimisation to be done.
Current limitations:
* doesn't detect off-screen points (the image wraps around to the next line of pixels)
* curently requires a clockwise quad.
Finally!
This version now achieves much faster framerates than before due to my weird and probably over complicated Ward-Bresenham algorithm.
Basically it uses the Bresenham algorithm to quickly trace a path through the source image. Each pixel it lands on is copied to a int32 array.
This means we only have to fetch the bare minimum number of pixels form the source image, which is a good thing because that was what causes the slowness in the first place. Lets say a texture is 128x128, then we never have to fetch more than 128 pixels from it for each scanline. This happens once per scanline.
Then in the inner scanline loop we simply fetch the pixels from the small pixel buffer, this means we can circumvent the whole x/y pointer increment problem.
This gives us an algorithm almost twice as fast as the old 100% floating point version.
I remember algorithm 1 several weeks ago yielded about 1 frame per second :D Now I need to see if it will go any faster. I'm sure it will.
SPEEEEEEEEEED!
compiled to Release version with all a few compiler options ON and using "unchecked{}" blocks this thing flies now!! Its approximately as fast as the isometric renderer!!!
check the framerate :D
http://www.noteme.com/doomsharp/img/fps500.png