C++ D3D9 2D ESP Box [Source]

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
/×\ 飢餓的狼 /×\
Banlı Üye
Katılım
23 Ağu 2017
Mesajlar
689
Tepki puanı
153
8 HİZMET YILI
Beyler güncel mi değil mi bilmiyorum ama arşivde buldum paylaşalım dedim :)

C++:
cBoxInfo cEngine::DrawBoundingBox( Vector vHead, Vector vFoot, DWORD color, int edge, bool CalcOnly )//edge == 1 edge only, edge == 2 box + edge box::DrawBoundingBox( Vector vHead, Vector vFoot, DWORD color, int edge, bool CalcOnly )//edge == 1 edge only, edge == 2 box + edge box
{{
    CVector2i iHead, iFoot;CVector2i iHead, iFoot;
    cBoxInfo m_Box = {0};= {0};

    //center boxes & add correction's//center boxes & add correction's
    vFoot.x = vHead.x;.x = vHead.x;
    vFoot.z = vHead.z;.z = vHead.z;

    if( WorldToScreen( vHead, iHead ) && WorldToScreen( vFoot, iFoot ) )if( WorldToScreen( vHead, iHead ) && WorldToScreen( vFoot, iFoot ) )
    {{
        m_Box.iHead = iHead;.iHead = iHead;
        m_Box.iFoot = iFoot;.iFoot = iFoot;

        iFoot.y += 5;//some corrections.y += 5;//some corrections
        iHead.y -= 7;//some corrections.y -= 7;//some corrections
        int w = ( iFoot.y - iHead.y ) / 4;int w = ( iFoot.y - iHead.y ) / 4;

        if( CalcOnly == false )if( CalcOnly == false )
        {{
            if( edge == 1 )if( edge == 1 )
            {{
                DrawEdgeBoundingBox( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), color, 8 );DrawEdgeBoundingBox( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), color, 8 );
            } else if( edge == 2 ) {} else if( edge == 2 ) {
                m_pDx11Renderer.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );
                DrawEdgeBoundingBox( ( iHead.x - w - 3 ), iHead.y - 3, ( w * 2 ) + 6, ( iFoot.y - iHead.y ) + 6, txtYellow, 6 );//draw 3 px biggerDrawEdgeBoundingBox( ( iHead.x - w - 3 ), iHead.y - 3, ( w * 2 ) + 6, ( iFoot.y - iHead.y ) + 6, txtYellow, 6 );//draw 3 px bigger
            } else {} else {
                m_pDx11Renderer.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );.DrawBorder( ( iHead.x - w ), iHead.y, ( w * 2 ), ( iFoot.y - iHead.y ), 1, color );
            }}

        }}

        m_Box.x = ( iHead.x - w );.x = ( iHead.x - w );
        m_Box.y = iHead.y;.y = iHead.y;
        m_Box.w = ( w * 2 );.w = ( w * 2 );
        m_Box.h = ( iFoot.y - iHead.y );.h = ( iFoot.y - iHead.y );
        m_Box.middle_x = iHead.x;.middle_x = iHead.x;
    }}
    return m_Box;return m_Box;
}}

void cEngine::DrawEdgeBoundingBox( int x, int y, int w, int h, DWORD BorderColor, int override_le, bool midpoint, bool center )void cEngine::DrawEdgeBoundingBox( int x, int y, int w, int h, DWORD BorderColor, int override_le, bool midpoint, bool center )
{{
    //draw circle on center of box//draw circle on center of box
    if( midpoint )if( midpoint )
        m_pDx11Renderer.DrawCircle( x, y, 2, txtGreen );.DrawCircle( x, y, 2, txtGreen );

    //center x y in the box//center x y in the box
    if( center )if( center )
    {{
        x -= ( w / 2 );-= ( w / 2 );
        y -= ( h / 2 );-= ( h / 2 );
    }}

    int le = w / 4;int le = w / 4;

    if( le > ( h / 4 ) )if( le > ( h / 4 ) )
        le = ( h / 4 );= ( h / 4 );

    if( override_le > 0 )if( override_le > 0 )
        le = override_le;= override_le;

    m_pDx11Renderer.DrawLine( x, y, x + le, y, BorderColor );.DrawLine( x, y, x + le, y, BorderColor );
    m_pDx11Renderer.DrawLine( x, y, x, y + le, BorderColor );.DrawLine( x, y, x, y + le, BorderColor );
    m_pDx11Renderer.DrawLine( x + w, y, x + w - le, y, BorderColor );.DrawLine( x + w, y, x + w - le, y, BorderColor );
    m_pDx11Renderer.DrawLine( x + w, y, x + w, y + le, BorderColor );.DrawLine( x + w, y, x + w, y + le, BorderColor );
    m_pDx11Renderer.DrawLine( x, y + h, x, y + h - le, BorderColor );.DrawLine( x, y + h, x, y + h - le, BorderColor );
    m_pDx11Renderer.DrawLine( x, y + h, x + le, y + h, BorderColor );.DrawLine( x, y + h, x + le, y + h, BorderColor );
    m_pDx11Renderer.DrawLine( x + w, y + h, x +w - le, y + h, BorderColor );.DrawLine( x + w, y + h, x +w - le, y + h, BorderColor );
    m_pDx11Renderer.DrawLine( x + w, y + h, x + w, y + h - le, BorderColor );.DrawLine( x + w, y + h, x + w, y + h - le, BorderColor );
}}
 
Banlı Üye
Katılım
11 Tem 2017
Mesajlar
1,777
Çözümler
2
Tepki puanı
695
8 HİZMET YILI
Arşiv Kaç Yılından kalma Eyer Eskiyse Ben Birtane Konu açacam
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...
Üst