
Originally Posted by
n3ss3s
If you mean the offset of the compass and the minimap, you could try making something that gets the real angle from walls... Infact it's been made, but you can search for it by yourself...
i mean the offset of the mm and mainscreen....

EDIT: woups, sorry about dble post
EDIT: maybe we should look into this!!!
SCAR Code:
function GetMMOffset(X1, Y1, X2, Y2: Integer): Extended; //Wizzup modded by Zeph
Var
L, I, C: Integer;
ATPA, gATPA: T2DPointArray;
P, P2: TPoint;
B: TBox;
Ps: TPointArray;
Begin
FindColorsTolerance(Ps, RGBToColor(255, 255, 255), X1, Y1, X2, Y2, 50);
Result := -1.0;
If High(Ps) = -1 Then
Exit;
SortTPAFrom(Ps, Point((550 + 703) / 2, 0)); // Sort it from the center.
ATPA := SplitTPAEx(Ps, 1, 0); //horizontal lines
SortATPASize(ATPA, True); // longest 'line'.
L := High(aTPA);
If L = -1 Then
Exit;
SetLength(gATPA, L + 1);
C := 1;
gATPA[0] := aTPA[0];
P := MiddleTPA(aTPA[0]); // get middle of the line.
For I := 1 To L Do
Begin // this loops adds any points that are in a dist of 10 pixels.
// if vert, then x, hori then y (A wall isn't straight.)
If Length(aTPA[I]) < 4 Then
Continue;
P2 := MiddleTPA(aTPA[I]);
If Abs(P.Y - P2.Y) < 10 Then
Begin
gATPA[C] := aTPA[I];
C := C + 1;
End;
End;
SetLength(gATPA, C);
SetLength(Ps, 0);
Ps := MergeATPA(gATPA); //Combine all the points. within 10pix
B := GetTPABounds(Ps);
SortTPAFrom(Ps, Point((B.X1 + B.X2) / 2, 0)); // sort from center
SetLength(ATPA, 0);
ATPA := SplitTPA(Ps, 3); // split dist three, the left over walls
// were all in Ps, and now we split them again.
SetLength(Ps, 0);
SortATPASize(ATPA, True); // longest wall.
Ps := ATPA[0];
L := High(Ps); //angle getting
Result := ArcTan2(Ps[L].Y - Ps[0].Y, Ps[L].X - Ps[0].X);
while (Result > Pi / 2) do
Result := Result - Pi;
while (Result < -Pi / 2) do
Result := Result + Pi;
{$IFDEF DEBUG} WriteLn('OffsetAngle: ' + FloatToStr(Degrees(Result))); {$ENDIF}
End;