Results 1 to 8 of 8

Thread: [SIMBA] Drawing TPA's in the debug image form?

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

    Default [SIMBA] Drawing TPA's in the debug image form?

    Hey I was wonderin if someone had the function to draw TPA's in the Debug Image Form in Simba. Thanks!
    Extinct.

    Formally known as Drags111.

  2. #2
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Debug.scar? Doesnt srl work with simba?
    There used to be something meaningful here.

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

    Default

    SCAR Code:
    {.Include SRL\SRL\Misc\DeBug.SCAR}
    DeBugTPA(TPA, '');
    DeBugATPA(ATPA, '');
    DeBugATPA([TPA], '');
    DeBugATPABounds(ATPA);
    DeBugATPABounds([TPA]);

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

    Default

    Better use {$I File.extension} than {.include File.EXTENSION}
    And don't uppercase extensions when they aren't uppercased in the actual file name.



    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)

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

    Default

    Quote Originally Posted by Wizzup? View Post
    Better use {$I File.extension} than {.include File.EXTENSION}
    And don't uppercase extensions when they aren't uppercased in the actual file name.
    It's an OCD code style thing, yea use {$ for simba

  6. #6
    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
    It's an OCD code style thing, yea use {$ for simba
    OCD? As in Obsessive-compulsive disorder?
    The extension should just match the file's extension because otherwise it won't even load on other OS'es like Mac and Linux, as those are case sensitive.



    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)

  7. #7
    Join Date
    Oct 2006
    Posts
    1,211
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah thanks, I wasnt aware of debug.scar :P I have been out for over a year
    Extinct.

    Formally known as Drags111.

  8. #8
    Join Date
    Oct 2009
    Posts
    30
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    From wizzup,

    PHP Code:
    Function DebugTPA(PointsTPointArrayBmpNameString): Boolean;

    Var
       
    WidthHeightClientBMPInteger;
       
    xsysxeyeInteger;

    Begin
      
    Try
      
    Begin
        xe 
    := xs xor xs;
        
    ye := ys xor ys;
        
    xs := 1 shl 20;
        
    ys := 1 shl 20;

        For 
    := 0 To High(Points) Do
        
    Begin
          xs 
    := Min(xsPoints[i].X);
          
    ys := Min(ysPoints[i].Y);

          
    xe := Max(xePoints[i].X);
          
    ye := Max(yePoints[i].Y);
        
    End;

        
    Width := xe xs;
        
    Height := ye ys;

        
    DisplayDebugImgWindow(00);
        
    DisplayDebugImgWindow(WidthHeight);
        
    ClientBMP := BitmapFromString(WidthHeight'');

        
    CopyClientToBitmap(ClientBMPxsysxeye);
        For 
    := 0 To High(Points) Do
          
    FastSetPixel(ClientBMPPoints[i].xsPoints[i].ys255);
        If 
    BmpName <> '' Then
          SaveBitmap
    (ClientBMPScriptPath BmpName '.bmp');
        
    SafeDrawBitmap(ClientBMPGetDebugCanvas00);
        
    DisplayDebugImgWindow(WidthHeight);

        
    FreeBitmap(ClientBMP);
      
    End
      Except
        FreeBitmap
    (ClientBMP);
      
    End;
      
    Result := True;
    End;

    Function 
    DebugATPA(aPoints: Array Of TPointArrayBmpNameString): Boolean;

    Var
       
    WidthHeightClientBMPILCColInteger;
       
    xsysxeyeInteger;
       
    OuterPointsTPointArray;

    Begin
      
    For := 0 To High(aPoints) Do
        
    := Length(aPoints[i]);
      
    SetLength(OuterPoints1);
      
    := 0;
      For 
    := 0 To High(aPoints) Do
        For 
    := 0 To High(aPoints[i]) Do
        
    Begin
          C 
    := 1;
          
    OuterPoints[C] := aPoints[i][L];
        
    End;

      Try
      
    Begin
        xe 
    := xs xor xs;
        
    ye := ys xor ys;
        
    xs := 1 shl 20;
        
    ys := 1 shl 20;

        For 
    := 0 To High(OuterPoints) Do
        
    Begin
          xs 
    := Min(xsOuterPoints[i].X);
          
    ys := Min(ysOuterPoints[i].Y);

          
    xe := Max(xeOuterPoints[i].X);
          
    ye := Max(yeOuterPoints[i].Y);
        
    End;

        
    Width := xe xs;
        
    Height := ye ys;

        
    DisplayDebugImgWindow(00);
        
    DisplayDebugImgWindow(WidthHeight);
        
    ClientBMP := BitmapFromString(WidthHeight'');

        
    CopyClientToBitmap(ClientBMPxsysxeye)
        For 
    := 0 To High(aPoints) Do
        
    Begin
          Col 
    := Random(16777215);
          For 
    := 0 To High(aPoints[i]) Do
            
    FastSetPixel(ClientBMPaPoints[i][L].xsaPoints[i][L].ysCol);
        
    End;

        
    SafeDrawBitmap(ClientBMPGetDebugCanvas00);
        
    DisplayDebugImgWindow(WidthHeight);
        If 
    BmpName <> '' Then
          SaveBitmap
    (ClientBMPScriptPath BmpName '.bmp');

        
    FreeBitmap(ClientBMP);
      
    End
      Except
        FreeBitmap
    (ClientBMP);
      
    End;
      
    Result := True;
    End

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
  •