bug in the rect() function
Displaying 1-9 of 9 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Technetium

I have encountered an instance of the rect() function in my code which does not work correctly. In the code, it is supposed to draw a brown rectangle based on the position of the mouse. The object it draws is not even a rectangle.

If we assume the points x1, y1, x2, and y2, it draws the two horizontal lines ({x1,y1} to {x2,y1}, and {x1,y2} to {x2,y2}) correctly. The two vertical lines (supposed to be {x1,y1} to {x1,y2}, and {x2,y1} to {x2,y2}) are instead drawn as horizontal lines the length they should be vertically, as if they were rotated counterclockwise from the uppermost point.
What I get looks something like this:

________________________________

__________ ___________


________________________________

Yeah, it's totally whacked. The weird thing is that rect() works fine in other circumstances. And I am not doing any weird alterations to the rectangle before it is drawn; it goes directly to the screen.



Specifically, I am calling from within a hookretrace function that is based on the position of the mouse. The actual line of code is:

rect(mouse.x,mouse.y-30,mouse.x+150,mouse.y,rgb(150,123,68),screen);

However, that line is contained within a fairly large-sized function, and so it is difficult to be certain that the cause is actually contained in the function call itself.

I should note that I also call a rectfill function which is almost identical to that line (it is contained within the box that should be made by the rect), and it works correctly. So to whoever may try to find what is wrong with rect(), it is something that is not wrong with rectfill().

Has anyone else been able to observe this bug?

EDIT: Oh yeah, on the subject of bugs, here's a weird one I also got today. Normally, I have several other windows open while testing things in Verge. Usually they are Maped, Textpad, and Photoshop. Normally, it's not a problem. I discovered today that if the "color picker" window is open in Photoshop (well, PS 6, at least), Verge gets weird. It'll force-minimize a full-screen Verge game, and if you try to re-maximize the game, it'll minimize it again right away. Very weird. When it does this, it also puts Photoshop and the color picker window on top.

Posted on 2004-07-19 07:03:34 (last edited on 2004-07-19 07:20:31)

Gayo

Just as an aside, you should really assign an RGB value to a variable rather than calling it every redraw! But, uh, I have no idea re: problem.

Posted on 2004-07-19 18:19:45

vecna

Photoshop thing seems like a problem with photoshop behaving badly and trying to steal focus, OR, not playing well with fullscreen directdraw modes. I doubt if there's anything I can do about it. It might work in windowed mode.

As for the rectangle bug, I'll look into it... Can you tell me, what bitdepth it was running in, fullscreen or windowed, and what video card? Also, was it being rendered lucently?

Posted on 2004-07-19 19:07:53

Technetium

The problem is in a game running in 640x480 mode fullscreen. The video card is...... RVIDIA RIVA TNT2 Model 64/Model 64 Pro.

I just copied that from the Device Manager.

Posted on 2004-07-20 01:45:07

vecna

Can you do this and tell me the output:


void autoexec()
{
Exit(str(rgb(0,255,0)));
}


Also, can you tell me if the rectangle is being blittted lucently or not? It effects which blitter the bug is likely to be in.

Posted on 2004-07-22 02:50:25

Technetium

65280

Posted on 2004-07-23 00:34:05

grenideer

Originally posted by vecna


Also, can you tell me if the rectangle is being blittted lucently or not? It effects which blitter the bug is likely to be in.

Posted on 2004-07-26 22:43:48 (last edited on 2004-07-26 22:45:20)

Technetium

Unfortunately, I honestly can't tell. It's just the rect() function, not the rectfill, and I can't tell if the narrow lines that make up the box are actually translucent or not.

Posted on 2004-07-27 18:21:07

Zip

So... EXPERIMENT! Put either SetLucent(0) or SetLucent(50) in front and see if both, or just one are bugged. Use some initiative man! :)

Zip

Posted on 2004-07-27 18:30:12


Displaying 1-9 of 9 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.