Read-only archive of the Armageddon Games Forums Archive (2000–2026) · About this archive

Screen->Ellipse() is backwards

10 replies · 1,734 views · Started 21 February 2009

Yeah, the only way to describe this is with a picture:

User posted image

global script slot2 {
void run() {
while(true) {
Screen->Ellipse(1, Link->X + 8 , Link->Y + 15, 32, 16,130,1,0,0,0,true,128);
Waitframe();
}
}
}

Note that the ground is the standard beige, and I'm drawing in orange.

Also note that if possible, it would be nice if this behaviour was retained as a "Screen->InvEllipse" function.

Anyone care to fathom exactly how this is even possible?

Also, please note that I am totally serious about keeping this behaviour, either as a flag or as a different drawing function. And, it would be totally awesome if this could be added to the other drawing functions as well.

Immediate edit: Oh, durr, I know what's going on. It probably looks something like this:

void Screen_Ellipse(Screen* scrn, ...) {
for(int x = 0; x < 320; x++) {
for(int y = STATUS_BAR_HEIGHT; y <= 240; y++) {
if(!<formula for drawing the ellipse>)
scrn->setpixel(x,y,col);
}
}
}

The key being the NOT operator, which makes it draw every pixel not in the ellipse.

(Granted, I have absolutely no idea how the internals actually work, but hey.)

I briefly looked at the code. The problem is that the fill point for the ellipse (in your example) is actually outside the ellipse. So, the outside of the ellipse is getting filled instead of the inside. Not sure why this is but I'll keep looking.

Dark Nation wrote:I briefly looked at the code. The problem is that the fill point for the ellipse (in your example) is actually outside the ellipse. So, the outside of the ellipse is getting filled instead of the inside. Not sure why this is but I'll keep looking.

Oh? Where is it? Shouldn't it be in the very centre of the ellipse? That would always put it inside the ellipse.

Gleeok wrote:Yeah, I already reported this last year. Turns out you're doing it wrong and here's the thread: </long-story-short>
http://www.armageddongames.net/forums//thread/101657/

Well, you were using arcs, while I'm using an ellipse. The only way I could pass invalid arguments would be to make the radii negative, which I'm not.

pkmnfrk wrote:
Well, you were using arcs, while I'm using an ellipse. The only way I could pass invalid arguments would be to make the radii negative, which I'm not.

Ah yeah, that's true. I didn't really look at the code. ....hmm, that is odd....

Well at least we can preserve this "bug" simply by not changing the 'screen->arc' function, since it'll do the same weird thing. :shrug: