I havn't tried the code yet, but it is really straight forward and easy. It looks like it will work perfectly for polygons with 3 or more points (and that's the definition of a polygon I guess). The soft spot is a single point polygon, where it will produce an index out of bounds error, and any horizontal two point polygon, where it won't draw the line at all.
Another thing is that it only works on a resolution/window size with height <= 320 pixels. Since most PPC:s use the 240x320 this is not a problem. But for me (and perhaps others) who have a maximum resolution of 800x600, it will be =)
The algoritm only manages convex polygons. Any concave polygon will be drawn as convex with it's concavities removed. This is to be considered as a flaw if you have concave polygons, otherwise not.
This perticular algoritm seems to be implemented almost as optimized as possible, using fixed point aritmetic instead of floating point. And it's so simple it's hard to reduce.
I do have some suggestions though. Why not keep track of the maximum and minimum y value. An average polygon (this is taken right out of the air) has six points. This will result in a maximum of 6x2 compares to see if the current yval is below global minimum or above global maximum. Then you won't have to loop through all the yvalues from 0 to 320 (or the given screen/window height). Just loop through the ones we know are occupied with the polygon. The 12 compares to find the ymin and ymax should be less than the amount of compares to see if a given yval has a polygon xval. Not shure if this will have a noticeable impact on performance, but it's an optimization never the less.
And, the DrawHLine might be faster than DrawLine, although I seem to recall (I currently have no access to pocketfrog so I can't double check) that DrawLine will call DrawHLine (or DrawVLine) if the line is horizontal (or vertical).
As some of you must have noticed by now, I'm picky about how the code is written. Although it will produce the same result, I always try to write code acording to a standard (my own =). For instance: finding good descriptive names, always use namespaces, never use global variables (unless it's absolutely necessary), comment a lot, etc, etc. Most of what I personally think is good coding style is also part of the C++ Coding Standard by Todd (or perhapps it's the other way around =) at the following link:
http://www.possibility.com/Cpp/CppCodingStandard.html
Finding a good standard (whether it's strictly someone elses or a modified version of your own) and sticking to it will reduce the amount of errors you make, specially during larger projects.
For those who don't give a #¤&%#¤& about this, that's fine too. It's your problem =)
So, naturally, I have a few suggestions about the code in general, how it might be restructured and presented. For instance: it doesn't make any sense to have PFE_FPStartX (and Y) defined as unsigned int and then assign a negative value. And why is the int unsigned in the first place?
But like I said, it's just a matter of taste.
I need to test the code (and my sugestions) before I can say anything more (heh, like this wasn't enough. *cackle*). But basicly, it looks really good! I'll mail you any modifications I make (or perhaps post it at Pocketfrog's Devcorner and add a link to it from this thread)
Oh, one more thing. Sorry I misspelled you name in the previous note fzammetti. I'm a bit "word blind" sometimes.