Code: Select all
# if __FB_LANG__ = "fb"
const PI = 4 * atn(1)
sub multiput(xmid as integer,ymid as integer,src as any ptr,rot as double)
dim as integer sx,sy,nx,ny
dim as double ang,dist
sx = cptr(image ptr,src)->width
sy = cptr(image ptr,src)->height
for cy as double = 0 to (sy - 1) step 0.5
for cx as double = 0 to (sx - 1) step 0.5
ang = atan2(cy - (sy / 2),cx - (sx / 2))
dist = sqr(((cx - (sx / 2)) ^ 2) + ((cy - (sy / 2)) ^ 2))
nx = xmid + (cos(ang + rot) * dist)
ny = ymid + (sin(ang + rot) * dist)
If I make the For...Next integers, the rotated image gets holes in it, but with doubles, it's damn slow with only 4 sprites. Can anyone help me?