As I said in the subject of the topic. The fillPolygon method in the Nokia UI Api does not work correctly. And drawPolygon method and fillPolygon method does draw different polygons.
I want to inform all of you.
In the emulators( 7210 SDK, Epoc S60 ) and S60 Version 2 devices( 6600, 7610 ) , there was no problem. This bug is in the S40 real devices. I tried it in 6610, 7250i and 3220. All of them are same. But I haven't tried it in 3510i. So I can not get any screen shot from an emulator. Because they works successfully. But I drew it myself:
while testing our game on multiple Nokia S40 Devices we encountered the same problem. have a look at the courts (screenshots) of our game: minigolf-challenge (http://www.nowadays-interactive.com) - the base-layer is a always a (quite complex) polygon which prerendered and then "decorated" by adding more details.
I tried a lot but couldn't get rid of that bug. Mostly the fillPolygon failed with vertices on the same y-line (like in your example).
One "cheap" solution ist to change the vertice-coords of a vertice which is causing problems. But this is often not practicable and to be honest: this left me a quite bad feeling. =)
At the end I implemented my own poly-/trifiller. this is easily done by:
a) triangulate your polygon
b) go through all triangles and fill them by using a scanline-filler
this adds just a little more code to your app. (this may be a problem - I'm always fighting with space problems , but the result is very satisfying. Processing time is also good - wouldn't claim it's faster than the native function - but nearly equal...
.. and the best is: no big deal to port your game to other devices. and that is quite an issue, if you want to go public on devices like SE-T6xx devices, which offer NO polyfill functionality at all.
if you want, I will post a part of the the polyfill-code in here.
It always feels good to beat the system. HA HA HA!! Well done... I can remember writing my first polygon flood fill in BASIC, on a RM380Z, in school, about 25 years ago and boy was it slooowwww! You could actually watch it filling dit by dot.
It always amazes me how clever phones are, they are dismissed by most but compared to the computer that landed the first moon mission, they are incredibly powerful things.
If there is one question that I would ask for some advice on it is this: how do you actually sell the games over the air without having to involve Nokia??? I had an argument with them a long time ago about the so called 'testing procedures' for a Nokia Software Marketplace 'badge' or something, they charged about $400 and in the small print there was no guarantee that the product wouldn't crash anyway so I asked them exactly what the fee was for... no reply.
Any comments or pointers to information would be greatly appreciated as my first 3510i game is almost done (Blackjack, gotta start somewhere!) and I want to know how I can charge people for downloading it etc etc
Yes please ysuter, I will be very glad if you post some part of your fill polygon method here. Because I don't understand your way very well. I think I would encounter some spaces, filling a polygon with triangles.
The example source is spezialized for triangles positioned inside the Canvas (no clipping needed). but it's quite easy to adapt it for a more general purpose. The only thing you need to do is to modify the border-offset precalc by adding y-pos clipping. the rendering-part doesn't need any adaptations at all, as the drawline method already handles every kind of clipping needed.
Performance was good. we used the trifiller only to prerender courts - never for rendering per frame.
note: the polygon-triangulation part is not included. I implemented it as part of the creating-process of the data-file in our export procedure. you will find a lot documents covering this topic on the internet.