Clipped line routine

Here you can ask questions or provide insights about how to use efficiently 6502 assembly code on the Oric.
User avatar
Chema
Game master
Posts: 2067
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema » Thu Oct 23, 2008 8:23 am

Great!

Thanks.

User avatar
Dbug
Site Admin
Posts: 2366
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug » Wed Nov 05, 2008 9:35 pm

Chema wrote:Greetings.

Working on a possible radar display for the 3D game, I noticed the line drawer does NOT draw a line when origin and destination are the same.

Drying to draw a line from (24,24) to (24,24) I expected to see a dot at that position, but nothing was drawn.

Don't know if this is the desired behaviour or not...

Cheers.
Was it using the DrawLine or the DrawClippedLine routines ? What are the clipping parameters you used ?

I tried this:

Code: Select all

		LargeX0=24;
		LargeY0=24;
		LargeX1=24;
		LargeY1=24;
		
		DrawClippedLine();
and that

Code: Select all

		CurrentPixelX=24;
		CurrentPixelY=24;
		OtherPixelX=24;
		OtherPixelY=24;

		DrawLine();
Both correctly displayed one single dot in (24,24).

User avatar
Chema
Game master
Posts: 2067
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Post by Chema » Thu Nov 06, 2008 1:08 pm

Dbug wrote: Both correctly displayed one single dot in (24,24).
Ok, I am completely embarssed. I don't know what I did or what I broke, but it is working now :oops:

I'd swear I made several tests and notice that behaviour. I did one today and it displayed the dot correctly, so I am completely confused. Most probably some kind of bug in my code that now has disappeared.

Sorry Dbug.

User avatar
Dbug
Site Admin
Posts: 2366
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug » Thu Nov 06, 2008 6:16 pm

Don't feel bad :) After all there's a real bug somewhere, I still did not find why I have this +/- 1 pixel on the lines.

User avatar
Twilighte
Game master
Posts: 819
Joined: Sat Jan 07, 2006 12:07 am
Location: Luton, UK
Contact:

Post by Twilighte » Thu Nov 06, 2008 6:24 pm

I get that sometimes, bugs disappearing. I had one the other day with Wurlde whereupon you walked to a particular screen and it worked for about 30 seconds then crashed. I had left it for some time before i decided to try and fix it and strangely the bug was not happening anymore.

Sometimes i have found that the bug is when you have lots of source files (like Wurlde) and they all refer to a zeropage source file but i change this file and realise i must recompile all the other files again. In Wurlde now thats about 25 recompilations! :P

User avatar
Dbug
Site Admin
Posts: 2366
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Post by Dbug » Thu Nov 06, 2008 7:09 pm

Which is why I rebuild everything all the time on the Oric :)
This way, no surprises :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest