|
|
Joined: Jul 2006
Posts: 4,149
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2006
Posts: 4,149 |
The command /drawrot dont work if the angle is different of 180°. The new picture is out of place of 1 pixel and the ligne was not good and why it is so long to use /drawrot :] ?
|
|
|
|
Joined: Oct 2003
Posts: 25
Ameglian cow
|
Ameglian cow
Joined: Oct 2003
Posts: 25 |
well, for the "slowy" part, I think it's because Khaled actually 'coded' /drawrot, which implies a lot of calculus (1 per pixel of the rotated surface, with the use of trigonometrics functions). that's a supposition, though.
i noticed this bug too, long time ago : when i rotated tiles by 90°, a black line appeared on one of the side. quite annoying for map drawing engines... /drawrot looks like some kind of "unfinished" command.
|
|
|
|
Joined: Jul 2006
Posts: 4,149
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2006
Posts: 4,149 |
yes but i have test a snippet who do the same as /drawrot for 90° , drawing pixel/pixel with a lot of calcul and it's not speed as /drawrot
|
|
|
|
Joined: Oct 2003
Posts: 25
Ameglian cow
|
Ameglian cow
Joined: Oct 2003
Posts: 25 |
(putain Wims ton anglais me pique les yeux)
sure, /drawrot is re-scriptable, but as you (mis)told it, it's way slower. no need for it now, thx :tongue:
|
|
|
|
Joined: Dec 2002
Posts: 5,420
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 5,420 |
I haven't been able to reproduce a problem here, I've tested /drawrot in v6.2 with different angles and types/sizes of bmp/jpg/gif files and it seems fine.
Can you provide a short /window and /drawrot script and a link to a bmp/jpg/gif file that reproduces the problem?
|
|
|
|
Joined: Oct 2003
Posts: 25
Ameglian cow
|
Ameglian cow
Joined: Oct 2003
Posts: 25 |
ok, i just found another bug. here is the code for both of them, and the picture that shows them in action. i hope it is sufficiently clear.. ; type /khaled 0 for the new bug
; type /khaled 1 for the "line" bug
alias khaled {
;first bug - the new one
if !$1 {
window -dpBCfo @brr 0 0 300 300
drawrect -fnr @brr 16498742 0 1 0 0 300 300
;two imbricated whiles to generate a 100x100 'faded' square
var %a 100,%b
while %a {
%b = 100
;multithreading would be fine for this !
while %b { drawdot -nr @brr $calc(32896+%a +256*%b) 1 $calc(100+%a) $calc(100+%b) | dec %b }
dec %a
}
;please take into consideration the /drawtext -i suggestion !
drawdot @brr
;now for the serious part :
;rotation without -n
.timerbleh 1 3 drawrot @brr 90 100 100 100 100
;see that weird thing ? 'refresh' (-n) can fix this
.timerbleh2 1 5 drawdot @brr
;so i assume this is a refresh bug for this command
}
else {
;second bug - the old one
;opening another window, which fits the squares. no borders this time folks !
window -dpBCfo +d @brr2 -1 -1 100 100
window -dpBCfo @brr -1 -1 300 300
drawrect -fnr @brr 16498742 0 1 0 0 300 300
drawrect -fnr @brr2 0 0 1 0 0 101 101
var %a 100,%b
while %a > -1 {
%b = 100
;multithreading would be fine for this (again) !
while %b > -1 { drawdot -nr @brr2 $calc(32896+%a +256*%b) 1 %a %b | dec %b }
dec %a
}
;1st copy of that square on a non-black background window :
drawcopy -n @brr2 0 0 100 100 @brr 20 20
;rotation - i have to use -b since i really don't know how's your @window background color config...
drawrot -nb @brr2 0 90
;another copy of the new thing - EXACTLY the same command, 2nd x coord just different
drawcopy -n @brr2 0 0 100 100 @brr 140 20
drawdot @brr
}
} picture :
Last edited by Zerg; 07/08/06 02:13 AM.
|
|
|
|
Joined: Oct 2003
Posts: 25
Ameglian cow
|
Ameglian cow
Joined: Oct 2003
Posts: 25 |
i'd like to point out it's only visible for 90° turns (which are sadly the useful ones :/), and for 270° too i suppose. Wims told me /drawrot worked fine with 180° angles. as for 'intermediate' angles, i don't really know if there's a problem... it's highly possible though.
|
|
|
|
Joined: Jul 2006
Posts: 4,149
Hoopy frood
|
OP
Hoopy frood
Joined: Jul 2006
Posts: 4,149 |
here is an image of the bug i spoke about in my first post (it wasn't very clear, sorry). you can see clearly the distortion due to /drawrot : http://img356.imageshack.us/my.php?image=bugnn0.pngand i do this : drawrot -n @labyrinthe 90 660 31 80 80 drawdot @labyrinthe
|
|
|
|
Joined: Dec 2002
Posts: 5,420
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 5,420 |
Thanks I was able to reproduce the problem, I've implemented a fix and it should work correctly in the next version.
|
|
|
|
|
|