Results 1 to 2 of 2

Thread: rsc_GetCompassAngleDegrees;

  1. #1
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default rsc_GetCompassAngleDegrees;

    Code:
    {*******************************************************************************
    function rsc_GetCompassAngleDegrees: Extended;
    By: Wizzup?. Modded for rsc by antti mies.
    Description: Returns the compass angle in degrees.
    *******************************************************************************}
    function rsc_GetCompassAngleDegrees: Extended;
    
    Var
       North, Compass: TPointArray;
       MyPoint, MiddleCompass: TPoint;
    
    Begin
      Result := -1;
      GameTabRSC(5);
      FindColors(North, 264324, RSSX1+353, 36, RSSX1+393, 75);
      FindColors(Compass, 4026033, RSSX1+353, 36, RSSX1+393, 75);
      If (Length(North) < 1) or (Length(Compass) < 1) Then
        Exit;
      MyPoint := MiddleTPA(North);
      MiddleCompass := MiddleTPA(Compass);
      Result := Degrees(ArcTan2(-(MyPoint.Y - MiddleCompass.Y), MyPoint.X - MiddleCompass.X)) - 90;
      If (Result < 0) Then
        Result := Result + 360;
    End;
    Now someone make RSC_MakeCompass

  2. #2
    Join Date
    May 2007
    Location
    knoxville
    Posts
    2,873
    Mentioned
    7 Post(s)
    Quoted
    70 Post(s)

    Default

    i'll commit this when i get on tonight, unless someone else wants too
    <TViYH> i had a dream about you again awkwardsaw
    Malachi 2:3

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
  •