Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- -----------------------------------------
- * Game hacking QTS ( Quickie Tip Series )
- * no. 9 - Primitive arrow drawing function
- -----------------------------------------
- * Author: SEGnosis - GHAnon.net
- * Thanks to:
- * bitterbanana - No known site
- * Drunken Cheetah - No known site
- * fatboy88 - No known site
- * Geek4Ever - No known site
- * learn_more - www.uc-forum.com
- * Novocaine - http://ilsken.net/blog/?page_id=64
- * Philly0494 - No known site
- * Roverturbo - www.uc-forum.com
- * SilentKarma - www.halocoders.com - offline
- * Strife - www.uc-forum.com
- * Wieter20 - No known site
- */
- #define PI 3.14159265
- #define TWO_PI ( PI * 2 )
- #define DegreeToRadian(a)( ( ( a * PI ) / 180.0f ) )
- #define LimitTwoPI(a)while( a > TWO_PI )a -= TWO_PI
- #define Limit360(a)while( a > 360.0f )a -= 360.0f
- //----------------------------------//
- void DrawArrow( long x, long y, float fDegrees, DWORD dwLength, DWORD dwAngleDivisor, DWORD dwLineWidth, D3DCOLOR Color )
- {
- Limit360( fDegrees );
- DWORD dwAngleLength = dwLength/dwAngleDivisor;
- float fRightAngle = 135.0f + fDegrees,
- fLeftAngle = 225.0f + fDegrees;
- Limit360(fRightAngle);
- Limit360(fLeftAngle);
- fRightAngle = DegreeToRadian( fRightAngle );
- fLeftAngle = DegreeToRadian( fLeftAngle );
- fDegrees = DegreeToRadian( fDegrees );
- POINT pt = { cos( fDegrees ) * dwLength + x, sin( fDegrees ) * dwLength + y };
- CDraw.Line( x, y, pt.x, pt.y, dwLineWidth, Color );
- CDraw.Line( pt.x, pt.y, cos( fRightAngle ) * dwAngleLength + pt.x,
- sin( fRightAngle ) * dwAngleLength + pt.y, dwLineWidth, Color );
- CDraw.Line( pt.x, pt.y, cos( fLeftAngle ) * dwAngleLength + pt.x,
- sin( fLeftAngle ) * dwAngleLength + pt.y, dwLineWidth, Color );
- }
- //----------------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement