PDA

View Full Version : regarding the ZScript function PutPixel()



beefster09
12-20-2007, 01:42 AM
No, this is not a question. Don't you find the parameters of putpixel--specifically rx, ry, and rangle--redundant? I think they should be removed or nulled to increase interpretation speed.

pkmnfrk
12-20-2007, 02:00 AM
I don't know if they're redundant as I don't know what they do. The docs speak of rotation and stuff, but last I checked, you can't rotate pixels.

Unless, ohhh, hang on. I know what it does. If we pretend that each layer is a transparency for an overhead projector (commonly found in grade school classrooms), then putpixel will put a dot on the transparency, and then stick a pencil at (rx,ry), and rotate the transparency rangle degrees.

That is a useful feature, really. I think that all drawing primitives should have versions without the rotation stuff, though, since it's rarely used. Especially DrawTile, which can't rotate at all.

DarkDragon
12-20-2007, 02:05 AM
Rotation is useful if you're using pixels along with other primitives (for, say, particle effects), and want to rotate the whole scene without needing to do extra computation for some of the primitives.

However, there's no reason not to do some optimizations to the interpreter, such as short-circuiting the rotation code if rangle is 0. Moreover ZC currently uses a fixed-point arithmetic class, which is almost certainly much slower than real floating-point on modern CPUs. Bring it up after 2.50.