Results 1 to 24 of 24

Thread: DebugATPABounds

  1. #1
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Exclamation DebugATPABounds

    hey,

    not sure if this is the right place but yeh.

    i am trying to use DebugATPABounds(); in my script but it doesnt seem to work right any more, it use to make a square box with different colours for a ATPA, but it doesnt do that anymore, well at least not in Simba.

    DebugATPA(); work like it did in scar in Simba but i dont find it as good as DebugATPABounds(), is it possible to have it fixed?

    thanks

    edit: forgot to say what its doing, its simply putting a number in black text in the relevant area, its not easy to read.
    Last edited by Bobzilla69; 09-09-2010 at 08:31 PM.

  2. #2
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    DebugATPABounds hasn't changed in quite some time.

    I'm not familiar enough with SCAR's canvases as it is, maybe someone else can take a look at this.

  3. #3
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmmm, must just be the way Simba is written that somehow makes it handle it differently.

    anyone els have any ideas or solutions it would be greatly appreciated

  4. #4
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    finally got round to making a comparison of the two and there differences in case people didnt really understand what i meant.

    This is what DebugATPABounds looks like when run in Scar with S.M.A.R.T



    This is what DebugATPABounds looks like when run in Simba with S.M.A.R.T


    edit: sorry for bump, added larger Simba DebugATPABound image
    Last edited by Bobzilla69; 09-10-2010 at 09:52 AM.

  5. #5
    Join Date
    Feb 2006
    Location
    Belgium
    Posts
    3,137
    Mentioned
    3 Post(s)
    Quoted
    5 Post(s)

    Default

    If this were SCAR, I'm sure someone would tell you to just use Simba...

  6. #6
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Freddy1990 View Post
    If this were SCAR, I'm sure someone would tell you to just use Simba...
    ok..... it aint a life or death situation i just found it weird that they worked differently in the two programs, it would be nice to have it working the same in both.

    also if i simply use DebugTPA it works the same in both programs

  7. #7
    Join Date
    Feb 2006
    Location
    Belgium
    Posts
    3,137
    Mentioned
    3 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by bobzilla69 View Post
    ok..... it aint a life or death situation i just found it weird that they worked differently in the two programs, it would be nice to have it working the same in both.

    also if i simply use DebugTPA it works the same in both programs
    I'm not entirely sure, but while SRL uses mostly canvases for this kind of method in SCAR, it uses FastDraw functions to achieve the same thing in Simba, maybe something went wrong with the conversion there...

  8. #8
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    hmmmm, interesting, thanks for the info Freddy1990, on a side note looking forward to the next Scar release.

  9. #9
    Join Date
    Feb 2006
    Location
    Belgium
    Posts
    3,137
    Mentioned
    3 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by bobzilla69 View Post
    hmmmm, interesting, thanks for the info Freddy1990, on a side note looking forward to the next Scar release.
    I've taken a look for you, and it looks like I was right, Simba draws the boxes using the FastSetPixel function and such, though I'm not sure why it wouldn't work, while debugging SCAR's core I had an issue with canvases in SRL and I rewrote that function so it would use the same code for SCAR as it does for Simba right now and it worked fine back then.

  10. #10
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok, so essentially its the same code, but its being interpreted differently for some reason.

    is there another way to draw the boxes in Simba?

    the DebugATPABounds cant be the only function that is being affected (even if it isnt that critical)

  11. #11
    Join Date
    Feb 2006
    Location
    Belgium
    Posts
    3,137
    Mentioned
    3 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by bobzilla69 View Post
    ok, so essentially its the same code, but its being interpreted differently for some reason.

    is there another way to draw the boxes in Simba?

    the DebugATPABounds cant be the only function that is being affected (even if it isnt that critical)
    I'm not sure, if Simba supports canvases, you could use those like they're used for SCAR I suppose, though I'm not sure if Simba has the required routines to draw the canvas to it's debug window...

    EDIT: Another solution would possibly be to move the function into a plugin and have it generate a bitmap in there, then get the bitmap from a DC inside of SCAR/Simba, it would speed up the function in the process.
    Last edited by Freddy1990; 09-10-2010 at 03:11 PM.

  12. #12
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    Quote Originally Posted by Freddy1990 View Post
    If this were SCAR, I'm sure someone would tell you to just use Simba...
    Well.. yeah... of course.. SCAR 3.22 had so many bugs in it that you couldn't even open it without getting an error, so switching to Simba would erase a lot of bugs.

    The newest SCAR looks fabulous though. Great job!

  13. #13
    Join Date
    Feb 2006
    Location
    Belgium
    Posts
    3,137
    Mentioned
    3 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Zyt3x View Post
    Well.. yeah... of course.. SCAR 3.22 had so many bugs in it that you couldn't even open it without getting an error, so switching to Simba would erase a lot of bugs.

    The newest SCAR looks fabulous though. Great job!
    Yea that's true, that's why I put so much effort into SCAR 3.25, I rewrote tons and tons of code for it to ensure as many bugs as possible were eliminated

    But to get back on topic, as I said, it could be resolved by moving the function into a plugin, it may not be a bad idea to move all of these tpa debugging functions into WizzyPlugin, they seem to execute fairly slowly, I guess they aren't used as much in scripts, but it might be a good idea anyway, also with the plugin it will certainly let you use canvases for the Simba version on the FPC side.

  14. #14
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    You can use the FastDrawTPA function if you create a TPA from the bounds. It was added with all the WizzyPlugin functions to Simba.

    Also, can you file a bug for this? (Preferably use SRL as project) I'm quite confident it's a coding error in the debug code rather than an error in Simba, but I'll have a look at it anyway.
    Last edited by Wizzup?; 09-10-2010 at 04:48 PM.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  15. #15
    Join Date
    Feb 2006
    Location
    Belgium
    Posts
    3,137
    Mentioned
    3 Post(s)
    Quoted
    5 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    You can use the FastDrawTPA function if you create a TPA from the bounds. Can you file a bug for this? I'm quite confident it's a coding error in the debug code rather than an error in Simba, but I'll have a look at it anyway.
    I'm not quite sure what the problem could be either, DebugATPA uses pretty much the same functions, so I doubt the problem is in Simba as well, but I tested the simba code for DebugATPABounds with SCAR a while back and it worked for SCAR back then so most of the code should be correct, maybe one of the functions that's really Simba specific is called incorrectly somewhere in there.

  16. #16
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I believe this can be coded to worked in simba, but I have no idea how. The problem can be fixed include side or simba-side. You just have to work around things.


    Edit: The original version of DebugATPABounds didn't work either


    Simba Code:
    {$include SRL\SRL.scar}

    {*******************************************************************************
    function DebugATPABounds2(aPoints: T2DPointArray; BmpName: string): Boolean;
    By: Wizzup? & lordsaturn
    Description: Shows an image of the client, plotting each TPA's bounds as a box
                 of different colour per TPA. If a name is specified, an image
                 will be saved.
    *******************************************************************************}

    function DebugATPABounds2(aPoints: T2DPointArray; BmpName: string): Boolean;
    Var
       Width, Height, ClientBMP, I, L, Col, x2, y2, h, hh : Integer;
       ClientBox : tbox;
       Box : tbox;
       p: TPointArray;
       Colours: TIntegerArray;
    Begin
      Try
      begin
        h := High(aPoints);
        for i := 0 to h do
        begin
          clientbox := GetTPABounds(APoints[i]);
          x2 :=  max(x2, clientbox.x2);
          y2 :=  max(y2, clientbox.y2);
        end;
        width := x2 + 5;
        height := y2 + 5;
        DisplayDebugImgWindow(Width, Height);
        ClientBMP := BitmapFromString(Width, Height, '');
        CopyClientToBitmap(ClientBMP, 0, 0, width, height)
        For I := 0 To h Do
        Begin
          Colours := [clRed, clBlue, clBlack, clGreen, clYellow];
          col := Colours[Random(Length(Colours))];
          box := GetTPABounds(APoints[i]);
          box.x1 := box.x1 - 3;
          box.y1 := box.y1 - 3;
          box.x2 := box.x2 + 3;
          box.y2 := box.y2 + 3;

          p := LoadTextTPA(IntToStr(i), UpChars, hh);
          hh := High(p);
          for L := 0 to hh do
            FastSetPixel(ClientBmp, p[L].x + box.x1 + 3, p[L].y + box.y1 + 3, col);

          //For L := box.x1 To box.x2 Do
          for L := 0 to box.x2- box.x1 do
          begin
            FastSetPixel(ClientBMP, L, box.y1 - box.y1, Col);
            FastSetPixel(ClientBMP, L, box.y2 - box.y1, Col);
          end;
          //For L := box.y1 To box.y2 Do
          for L := 0 to box.y2- box.y1 do
          begin
            FastSetPixel(ClientBMP, box.x1 - box.x1, L, Col);
            FastSetPixel(ClientBMP, box.x2 - box.x1, L, Col);
          end;
        End;
        DisplayDebugImgWindow(Width, Height);
        {$ifdef Simba}
        DrawBitmapDebugImg(ClientBMP);
        {$else}
        SafeDrawBitmap(ClientBMP, GetDebugCanvas, 0, 0);
        {$endif}
        If BmpName <> '' Then
          SaveBitmap(ClientBMP, ScriptPath + BmpName + '.bmp');
        FreeBitmap(ClientBMP);
      End;
      Except
        FreeBitmap(ClientBMP);
        Writeln('Error in DebugATPABounds');
      End;
      Result := True;
    End;

    var
      TPA: TPointArray;
      ATPA: T2DPointArray;

    begin
      SetUpSRL;
      TPA := TPAFromBox(IntToBox(0, 0, 500, 500));
      ATPA := TPAToATPAEx(TPA, 10, 10);
      DebugATPABounds2(ATPA, '');
    end.
    Last edited by Wanted; 09-10-2010 at 08:05 PM.

  17. #17
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Fixed it.. (It worked when I created it, no doubt)
    Verrekte Koekwous

  18. #18
    Join Date
    Oct 2006
    Posts
    1,190
    Mentioned
    0 Post(s)
    Quoted
    2 Post(s)

    Default

    I know it works if you set a name for the image to be saved to

    Just wondering how you fixed it ray?



  19. #19
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Fixed it.. (It worked when I created it, no doubt)
    What caused it to break? I tried the original code and it didn't work either

  20. #20
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    What caused it to break? I tried the original code and it didn't work either
    Code:
    procedure DebugATPABounds(aPoints: array Of TPointArray);
    var
      Width, Height, ClientBMP, I: Integer;
      B: TBox;
      BoxColors : Array Of Integer;
      SelColor: Integer;
    {$IFDEF SIMBA}
      x,y : integer;
      BMP : Integer;
    {$ENDIF}
    begin
      GetClientDimensions(width,height);
      DisplayDebugImgWindow(Width, Height);
      BoxColors := [clRed, clBlue, clBlack, clGreen, clYellow];
    {$IFDEF Simba}
      ClientBMP := BitmapFromClient(0,0,width-1,height-1);
    {$ELSE}
      ClientBMP := BitmapFromString(Width, Height, '');
      CopyClientToBitmap(ClientBMP, 0, 0, width, height);
      SafeDrawBitmap(ClientBmp, GetDebugCanvas, 0, 0);
      GetDebugCanvas.Font.Style := [fsBold];
      GetDebugCanvas.Brush.Style := bsClear;
    {$ENDIF}
      for i:= 0 to high(aPoints) do
      begin
        SelColor := BoxColors[Random(length(Boxcolors))];
    
        B := GetTPABounds(aPoints[i]);
      {$IFDEF Simba}
        for x := B.X1 to B.X2 do
        begin
          FastSetPixel(ClientBMP,x,B.y1,SelColor);
          FastSetPixel(ClientBMP,x,B.y2,SelColor);
        end;
        for y := B.y1 to B.y2 do
        begin
          FastSetPixel(ClientBMP,B.X1,y,SelColor);
          FastSetPixel(ClientBMP,B.X2,y,SelColor);
        end;
        BMP := BitmapFromText(inttostr(i),StatChars);
        FastReplaceColor(bmp,clblack,clyellow);
        FastReplaceColor(bmp,clwhite,clblack);
        SetTransparentColor(bmp,clYellow);
        FastDrawTransparent(B.x1 + 2,b.y1 + 2,bmp,clientbmp);
        FreeBitmap(BMP);
      {$ELSE}
        GetDebugCanvas.Pen.Color := SelColor;
        GetDebugCanvas.Font.Color := SelColor;
        GetDebugCanvas.Rectangle(B.x1,B.y1,B.x2,B.y2);
        GetDebugCanvas.TextOut(B.x1,B.y1,inttostr(i));
      {$ENDIF}
      end;
      {$IFDEF Simba}
      DrawBitmapDebugImg(clientBMP);
      {$ENDIF}
      FreeBitmap(ClientBmp);
    end;
    The original code rev 433.. Works, no?
    Verrekte Koekwous

  21. #21
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    What caused it to break? I tried the original code and it didn't work either
    I'm pretty sure there has been no change in Simba itself. (If there was, you could have seen it in the source)

    Log for Debug:

    Code:
    commit ca85febf21c627917dce86a80af21599e0b3545b
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Fri Sep 10 22:47:53 2010 +0000
    
        Fixed DebugATPABounds bug in Simba
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@605 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 332d020d768b7e02e565ce1c76395f3b947b1168
    Author: Coh3n <Coh3n@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Mon Jun 21 01:25:40 2010 +0000
    
        - Fixed compiling issues in Debug.scar (2 forgotten semicolons)
        
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@540 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 1bf4059a57cca75485d1ec0298ebea20490fb523
    Author: IceFire908 <IceFire908@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun Jun 20 18:33:43 2010 +0000
    
        DebugATPABounds fix simba portion by Nava2
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@538 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 559f1150146b84398e1fd311badcc06cdd1be36b
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Wed May 12 13:23:18 2010 +0000
    
        Lamp solves perfectly, just needs to slow down a bit :). + Unused variable.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@489 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 2371149674e597d845abbe006c0c30aeca563999
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat May 8 22:57:08 2010 +0000
    
        Added ReadLn and edited the debugging methods a bit..
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@470 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 63ab06c9d8748e7041bb1e0e7dc8181b616c65c7
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun Apr 11 19:20:20 2010 +0000
    
        Added some simba stuff :).
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@433 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 7f0c4ca3cd09b7fd8e8beb817c0622a856e48240
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat Mar 27 23:01:39 2010 +0000
    
        Added other standard fixes, by Dgby714
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@423 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 9fe4a1668a709be4ed6a11b3709187aed60c9b42
    Author: IceFire908 <IceFire908@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Mon Mar 22 02:25:14 2010 +0000
    
        Made RandomID multi possible now, Fixed Forester, fixed Drag Item, cleaned up some DebugATPABounds mess lol. Rev 420.. epic pwnage
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@420 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit cbe44f5e395a4d133fd76c8695203f43da050e58
    Author: IceFire908 <IceFire908@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun Mar 21 19:31:11 2010 +0000
    
        LevelUp fix, Hopefully Arnav fix. Inventory standards fix, DeBugATPABounds fix
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@419 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit f0246e846800770dd49e5a3fa783cef1b13c9253
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Wed Mar 3 15:55:13 2010 +0000
    
        Fixed issues where it would search outside the client.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@403 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 8e6e2b24ad9b5683a220db84cbd2afd01d9de181
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat Feb 6 18:22:39 2010 +0000
    
        More Simba changes.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@371 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit e0adaf68711dd9d27b499b90bff018c43433d822
    Author: Nava2 <Nava2@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Wed Dec 30 22:13:41 2009 +0000
    
        Loads of shit fixed and updated.
        
        Worked with some small things, making the Color functions work in Color.scar.
        
        Removed some compiling errors in SmartColors.scar.
        
        Changed something in Debug.scar, to be honest I have no idea what it was.
        
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@329 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit d066656c926eb4d18aecca7ae91e32dc1447eb91
    Author: Nava2 <Nava2@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun Nov 29 01:01:02 2009 +0000
    
        Fixed small things that really made no sense..
        
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@291 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 74c05a059dd96e5fd21f37d865f85b4cf360fef2
    Author: EvilChicken! <EvilChicken!@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat Oct 17 00:55:15 2009 +0000
    
        Fixed.
        
        God, I can't do a single commit correctly these days.
        
        Sorry, guys.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@271 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 0345fa816109ed3e0608d1fc0f53e9740c7c0cd2
    Author: EvilChicken! <EvilChicken!@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Fri Oct 16 09:34:16 2009 +0000
    
        Small changes, mostly TakeScreenShotEx.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@269 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 232bf1ddc4d263e6f1e18911a98c2106e351b196
    Author: ZephyrsFury <ZephyrsFury@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Thu Sep 10 18:46:55 2009 +0000
    
        Stuff.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@235 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit b6fbf521502ebf7b444d8563e3dd957d57aedc30
    Author: ZephyrsFury <ZephyrsFury@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat Jun 20 20:47:34 2009 +0000
    
        Minor edits. Added DebugBitmap to Debug.scar.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@88 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 8519792392734a00c08d417b0832a4fca8ab5e70
    Author: Nava2 <Nava2@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun May 31 02:20:52 2009 +0000
    
        Added Fighting fixes.
        Changed TakeScreenshot
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@34 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 947febf8aecb1f9a1b0ef87d286ffc5cc4214c5f
    Author: Nava2 <Nava2@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat May 23 14:23:17 2009 +0000
    
        Exiting Mordaut should be fixed.. Not sure.
        
        Close Window, needs some testing..
        
        I broked DebugATPABounds, its in the text writing, someone look at it please.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@11 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit b286550bc6df862a3c76f00992c1b3aa86f8625f
    Author: Wizzup? <Wizzup?@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Mon May 18 20:19:48 2009 +0000
    
        Recommit.
        
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@1 6aa993dd-eb45-4ab4-881a-589510b4aab8



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  22. #22
    Join Date
    Apr 2007
    Location
    Colchester, UK
    Posts
    1,220
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Fixed it.. (It worked when I created it, no doubt)
    i can confirm it now works for me, both in scar (wasnt broken there) and in Simba.

    thanks alot for the fix

  23. #23
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mastaraymond View Post
    Code:
    procedure DebugATPABounds(aPoints: array Of TPointArray);
    var
      Width, Height, ClientBMP, I: Integer;
      B: TBox;
      BoxColors : Array Of Integer;
      SelColor: Integer;
    {$IFDEF SIMBA}
      x,y : integer;
      BMP : Integer;
    {$ENDIF}
    begin
      GetClientDimensions(width,height);
      DisplayDebugImgWindow(Width, Height);
      BoxColors := [clRed, clBlue, clBlack, clGreen, clYellow];
    {$IFDEF Simba}
      ClientBMP := BitmapFromClient(0,0,width-1,height-1);
    {$ELSE}
      ClientBMP := BitmapFromString(Width, Height, '');
      CopyClientToBitmap(ClientBMP, 0, 0, width, height);
      SafeDrawBitmap(ClientBmp, GetDebugCanvas, 0, 0);
      GetDebugCanvas.Font.Style := [fsBold];
      GetDebugCanvas.Brush.Style := bsClear;
    {$ENDIF}
      for i:= 0 to high(aPoints) do
      begin
        SelColor := BoxColors[Random(length(Boxcolors))];
    
        B := GetTPABounds(aPoints[i]);
      {$IFDEF Simba}
        for x := B.X1 to B.X2 do
        begin
          FastSetPixel(ClientBMP,x,B.y1,SelColor);
          FastSetPixel(ClientBMP,x,B.y2,SelColor);
        end;
        for y := B.y1 to B.y2 do
        begin
          FastSetPixel(ClientBMP,B.X1,y,SelColor);
          FastSetPixel(ClientBMP,B.X2,y,SelColor);
        end;
        BMP := BitmapFromText(inttostr(i),StatChars);
        FastReplaceColor(bmp,clblack,clyellow);
        FastReplaceColor(bmp,clwhite,clblack);
        SetTransparentColor(bmp,clYellow);
        FastDrawTransparent(B.x1 + 2,b.y1 + 2,bmp,clientbmp);
        FreeBitmap(BMP);
      {$ELSE}
        GetDebugCanvas.Pen.Color := SelColor;
        GetDebugCanvas.Font.Color := SelColor;
        GetDebugCanvas.Rectangle(B.x1,B.y1,B.x2,B.y2);
        GetDebugCanvas.TextOut(B.x1,B.y1,inttostr(i));
      {$ENDIF}
      end;
      {$IFDEF Simba}
      DrawBitmapDebugImg(clientBMP);
      {$ENDIF}
      FreeBitmap(ClientBmp);
    end;
    The original code rev 433.. Works, no?
    Nope

    Quote Originally Posted by Wizzup? View Post
    I'm pretty sure there has been no change in Simba itself. (If there was, you could have seen it in the source)

    Log for Debug:

    Code:
    commit ca85febf21c627917dce86a80af21599e0b3545b
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Fri Sep 10 22:47:53 2010 +0000
    
        Fixed DebugATPABounds bug in Simba
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@605 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 332d020d768b7e02e565ce1c76395f3b947b1168
    Author: Coh3n <Coh3n@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Mon Jun 21 01:25:40 2010 +0000
    
        - Fixed compiling issues in Debug.scar (2 forgotten semicolons)
        
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@540 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 1bf4059a57cca75485d1ec0298ebea20490fb523
    Author: IceFire908 <IceFire908@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun Jun 20 18:33:43 2010 +0000
    
        DebugATPABounds fix simba portion by Nava2
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@538 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 559f1150146b84398e1fd311badcc06cdd1be36b
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Wed May 12 13:23:18 2010 +0000
    
        Lamp solves perfectly, just needs to slow down a bit :). + Unused variable.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@489 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 2371149674e597d845abbe006c0c30aeca563999
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat May 8 22:57:08 2010 +0000
    
        Added ReadLn and edited the debugging methods a bit..
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@470 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 63ab06c9d8748e7041bb1e0e7dc8181b616c65c7
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun Apr 11 19:20:20 2010 +0000
    
        Added some simba stuff :).
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@433 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 7f0c4ca3cd09b7fd8e8beb817c0622a856e48240
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat Mar 27 23:01:39 2010 +0000
    
        Added other standard fixes, by Dgby714
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@423 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 9fe4a1668a709be4ed6a11b3709187aed60c9b42
    Author: IceFire908 <IceFire908@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Mon Mar 22 02:25:14 2010 +0000
    
        Made RandomID multi possible now, Fixed Forester, fixed Drag Item, cleaned up some DebugATPABounds mess lol. Rev 420.. epic pwnage
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@420 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit cbe44f5e395a4d133fd76c8695203f43da050e58
    Author: IceFire908 <IceFire908@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun Mar 21 19:31:11 2010 +0000
    
        LevelUp fix, Hopefully Arnav fix. Inventory standards fix, DeBugATPABounds fix
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@419 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit f0246e846800770dd49e5a3fa783cef1b13c9253
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Wed Mar 3 15:55:13 2010 +0000
    
        Fixed issues where it would search outside the client.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@403 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 8e6e2b24ad9b5683a220db84cbd2afd01d9de181
    Author: Raymond <Raymond@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat Feb 6 18:22:39 2010 +0000
    
        More Simba changes.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@371 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit e0adaf68711dd9d27b499b90bff018c43433d822
    Author: Nava2 <Nava2@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Wed Dec 30 22:13:41 2009 +0000
    
        Loads of shit fixed and updated.
        
        Worked with some small things, making the Color functions work in Color.scar.
        
        Removed some compiling errors in SmartColors.scar.
        
        Changed something in Debug.scar, to be honest I have no idea what it was.
        
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@329 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit d066656c926eb4d18aecca7ae91e32dc1447eb91
    Author: Nava2 <Nava2@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun Nov 29 01:01:02 2009 +0000
    
        Fixed small things that really made no sense..
        
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@291 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 74c05a059dd96e5fd21f37d865f85b4cf360fef2
    Author: EvilChicken! <EvilChicken!@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat Oct 17 00:55:15 2009 +0000
    
        Fixed.
        
        God, I can't do a single commit correctly these days.
        
        Sorry, guys.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@271 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 0345fa816109ed3e0608d1fc0f53e9740c7c0cd2
    Author: EvilChicken! <EvilChicken!@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Fri Oct 16 09:34:16 2009 +0000
    
        Small changes, mostly TakeScreenShotEx.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@269 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 232bf1ddc4d263e6f1e18911a98c2106e351b196
    Author: ZephyrsFury <ZephyrsFury@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Thu Sep 10 18:46:55 2009 +0000
    
        Stuff.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@235 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit b6fbf521502ebf7b444d8563e3dd957d57aedc30
    Author: ZephyrsFury <ZephyrsFury@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat Jun 20 20:47:34 2009 +0000
    
        Minor edits. Added DebugBitmap to Debug.scar.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@88 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 8519792392734a00c08d417b0832a4fca8ab5e70
    Author: Nava2 <Nava2@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sun May 31 02:20:52 2009 +0000
    
        Added Fighting fixes.
        Changed TakeScreenshot
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@34 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit 947febf8aecb1f9a1b0ef87d286ffc5cc4214c5f
    Author: Nava2 <Nava2@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Sat May 23 14:23:17 2009 +0000
    
        Exiting Mordaut should be fixed.. Not sure.
        
        Close Window, needs some testing..
        
        I broked DebugATPABounds, its in the text writing, someone look at it please.
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@11 6aa993dd-eb45-4ab4-881a-589510b4aab8
    
    commit b286550bc6df862a3c76f00992c1b3aa86f8625f
    Author: Wizzup? <Wizzup?@6aa993dd-eb45-4ab4-881a-589510b4aab8>
    Date:   Mon May 18 20:19:48 2009 +0000
    
        Recommit.
        
        
        git-svn-id: http://villavu.com/repositories/srl-opendev@1 6aa993dd-eb45-4ab4-881a-589510b4aab8
    Maybe it never worked? I could of sworn I ran that thing in simba before.

  24. #24
    Join Date
    May 2006
    Location
    Amsterdam
    Posts
    3,620
    Mentioned
    5 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    Nope
    Simba Code:
    {$include SRL\SRL.scar}

    {*******************************************************************************
    function DebugATPABounds2(aPoints: T2DPointArray; BmpName: string): Boolean;
    By: Wizzup? & lordsaturn
    Description: Shows an image of the client, plotting each TPA's bounds as a box
                 of different colour per TPA. If a name is specified, an image
                 will be saved.
    *******************************************************************************}

    procedure DebugATPABounds2(aPoints: array Of TPointArray);
    var
      Width, Height, ClientBMP, I: Integer;
      B: TBox;
      BoxColors : Array Of Integer;
      SelColor: Integer;
    {$IFDEF SIMBA}
      x,y : integer;
      BMP : Integer;
    {$ENDIF}
    begin
      GetClientDimensions(width,height);
      DisplayDebugImgWindow(Width, Height);
      BoxColors := [clRed, clBlue, clBlack, clGreen, clYellow];
    {$IFDEF Simba}
      ClientBMP := BitmapFromClient(0,0,width-1,height-1);
    {$ELSE}
      ClientBMP := BitmapFromString(Width, Height, '');
      CopyClientToBitmap(ClientBMP, 0, 0, width, height);
      SafeDrawBitmap(ClientBmp, GetDebugCanvas, 0, 0);
      GetDebugCanvas.Font.Style := [fsBold];
      GetDebugCanvas.Brush.Style := bsClear;
    {$ENDIF}
      for i:= 0 to high(aPoints) do
      begin
        SelColor := BoxColors[Random(length(Boxcolors))];

        B := GetTPABounds(aPoints[i]);
      {$IFDEF Simba}
        for x := B.X1 to B.X2 do
        begin
          FastSetPixel(ClientBMP,x,B.y1,SelColor);
          FastSetPixel(ClientBMP,x,B.y2,SelColor);
        end;
        for y := B.y1 to B.y2 do
        begin
          FastSetPixel(ClientBMP,B.X1,y,SelColor);
          FastSetPixel(ClientBMP,B.X2,y,SelColor);
        end;
        BMP := BitmapFromText(inttostr(i),StatChars);
        FastReplaceColor(bmp,clblack,clyellow);
        FastReplaceColor(bmp,clwhite,clblack);
        SetTransparentColor(bmp,clYellow);
        FastDrawTransparent(B.x1 + 2,b.y1 + 2,bmp,clientbmp);
        FreeBitmap(BMP);
      {$ELSE}
        GetDebugCanvas.Pen.Color := SelColor;
        GetDebugCanvas.Font.Color := SelColor;
        GetDebugCanvas.Rectangle(B.x1,B.y1,B.x2,B.y2);
        GetDebugCanvas.TextOut(B.x1,B.y1,inttostr(i));
      {$ENDIF}
      end;
      {$IFDEF Simba}
      DrawBitmapDebugImg(clientBMP);
      {$ENDIF}
      FreeBitmap(ClientBmp);
    end;

    var
      TPA: TPointArray;
      ATPA: T2DPointArray;

    begin
      SetUpSRL;
      TPA := TPAFromBox(IntToBox(0, 0, 500, 500));
      ATPA := TPAToATPAEx(TPA, 10, 10);
      DebugATPABounds2(ATPA);
    end.
    Verrekte Koekwous

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •