keybode

Swastika CrossHair

Jan 19th, 2014
1,902
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.98 KB | None | 0 0
  1. void CrossHair( int iSize )
  2. {
  3.     int x = 0;
  4.     int y = 0;
  5.  
  6.     HL2::m_pEngine->GetScreenSize( x, y );
  7.  
  8.     x /= 2;
  9.     y /= 2;
  10.  
  11.     if( cvars::misc_crosshair == 1 )
  12.     {
  13.         gRenderer.DrawRect( x - iSize, y, iSize * 2 + 1, 1, COLORCODE( 255, 0, 0, 255 ) );
  14.         gRenderer.DrawRect( x, y - iSize, 1, iSize * 2 + 1, COLORCODE( 255, 0, 0, 255 ) );
  15.     }
  16.     else if( cvars::misc_crosshair == 2 )
  17.     {
  18.         gRenderer.DrawRect( x - iSize, y, iSize * 2 + 1, 1, COLORCODE( 255, 0, 0, 255 ) );
  19.         gRenderer.DrawRect( x, y - iSize, 1, iSize * 2 + 1, COLORCODE( 255, 0, 0, 255 ) );
  20.  
  21.         /*
  22.                    2
  23.                    _
  24.             1-> |_|_
  25.                  _| |  <-3
  26.  
  27.                  4
  28.         */
  29.  
  30.         gRenderer.DrawRect( x - iSize, y - iSize, 1, iSize, COLORCODE( 255, 0, 0, 255 ) ); // 1
  31.         gRenderer.DrawRect( x, y - iSize, iSize + 1, 1, COLORCODE( 255, 0, 0, 255 ) ); // 2
  32.         gRenderer.DrawRect( x + iSize + 1, y, 1, iSize + 1, COLORCODE( 255, 0, 0, 255 ) ); // 3
  33.         gRenderer.DrawRect( x - iSize, y + iSize, iSize + 1, 1, COLORCODE( 255, 0, 0, 255 ) ); // 4
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment