hedgewars/uFloat.pas
changeset 1629 9f12da88d769
parent 1586 2c6f1d1f43c1
child 1640 31cf38df07ef
--- a/hedgewars/uFloat.pas	Sat Jan 10 12:02:58 2009 +0000
+++ b/hedgewars/uFloat.pas	Sat Jan 10 12:36:05 2009 +0000
@@ -19,6 +19,8 @@
 unit uFloat;
 interface
 
+{$INCLUDE options.inc}
+
 {$IFDEF FPC}
 {$ifdef FPC_LITTLE_ENDIAN}
 type hwFloat = record
@@ -332,6 +334,9 @@
 
 function AngleSin(const Angle: Longword): hwFloat;
 begin
+{$IFDEF DEBUGFILE}
+TryDo((Angle >= 0) and (Angle < 2048), 'Sin param exceeds limits', true);
+{$ENDIF}
 AngleSin.isNegative:= false;
 if Angle < 1024 then AngleSin.QWordValue:= SinTable[Angle]
                 else AngleSin.QWordValue:= SinTable[2048 - Angle]
@@ -339,6 +344,9 @@
 
 function AngleCos(const Angle: Longword): hwFloat;
 begin
+{$IFDEF DEBUGFILE}
+TryDo((Angle >= 0) and (Angle < 2048), 'Cos param exceeds limits', true);
+{$ENDIF}
 AngleCos.isNegative:= Angle > 1024;
 if Angle < 1024 then AngleCos.QWordValue:= SinTable[1024 - Angle]
                 else AngleCos.QWordValue:= SinTable[Angle - 1024]