Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

would this work better than bresenham?

Name: Anonymous 2013-08-08 12:39

function drawline(x0,y0,x1,y1){
dx = x1-x0
dy = y1-y0
len = sqrt(dx*dx+dy*dy)
dx /= len
dy /= len
    for (k=0;k<=len;k++){
        paint(floor(x0),floor(y0))
        x0 += dx
        y0 += dy
    }
}

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-08-10 9:48

Sorry, Only C is accepted.
Fuck that, I decided to benchmark it myself:

fvdrawline: 1917 cycles
asmdrawline: 1203 cycles


I win.

Name: Anonymous 2013-08-10 9:52

>How would you compress all the information of the earth in a smaller volume
>You just compress the earth mechanically.
7zip just compressed my harddisk into a smaller volume.
The more you know.jpg

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2013-08-10 9:56

And sizes:

fvdrawline + fvputpixel: 72 + 27 = 99 bytes
asmdrawline + asmputpixel : 39 + 16 = 55 bytes


1917 / 1203 = 1.6
99 / 55 = 1.8

1.6x faster and 1.8x smaller, or around 2.9x more efficient.

Name: Anonymous 2013-08-10 10:05

OpenGL vertex call to draw a line will be at least x500 faster.
I win.

Name: Anonymous 2013-08-10 10:40

>>44
If you draw about 30 thousand lines at once. That microsecond communication penalty really hurts.

Name: 'cause thread != ASM 2013-08-10 11:01

>>44
Good thing its getting there…

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List