mIRC Home    About    Download    Register    News    Help

Print Thread
/drawrot #154855 01/08/06 05:52 PM
Joined: Jul 2006
Posts: 3,745
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,745
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 :] ?

Re: /drawrot #154856 01/08/06 06:09 PM
Joined: Oct 2003
Posts: 25
Z
Zerg Offline
Ameglian cow
Offline
Ameglian cow
Z
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.

Re: /drawrot #154857 01/08/06 07:22 PM
Joined: Jul 2006
Posts: 3,745
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,745
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

Re: /drawrot #154858 01/08/06 07:39 PM
Joined: Oct 2003
Posts: 25
Z
Zerg Offline
Ameglian cow
Offline
Ameglian cow
Z
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:

Re: /drawrot #154859 04/08/06 12:10 PM
Joined: Dec 2002
Posts: 4,894
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,894
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?

Re: /drawrot #154860 07/08/06 01:19 AM
Joined: Oct 2003
Posts: 25
Z
Zerg Offline
Ameglian cow
Offline
Ameglian cow
Z
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..
Code:
;  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.
Re: /drawrot #154861 07/08/06 02:29 AM
Joined: Oct 2003
Posts: 25
Z
Zerg Offline
Ameglian cow
Offline
Ameglian cow
Z
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.

Re: /drawrot #154862 07/08/06 03:20 AM
Joined: Jul 2006
Posts: 3,745
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,745
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.png

and i do this :

drawrot -n @labyrinthe 90 660 31 80 80
drawdot @labyrinthe

Re: /drawrot #154863 09/08/06 09:17 PM
Joined: Dec 2002
Posts: 4,894
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,894
Thanks I was able to reproduce the problem, I've implemented a fix and it should work correctly in the next version.