diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-23 19:29:03 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-01-23 19:29:03 +0000 |
commit | cc5c3f01c6958685130a9a037abaa4dd3df86b20 (patch) | |
tree | ada1f1aa398d95d87faa84aa4fd0f0c342a91492 /src/utils | |
parent | ddc5e14034a837142ee7a49059e3715ad30ab9d2 (diff) | |
download | libcss-cc5c3f01c6958685130a9a037abaa4dd3df86b20.tar.gz libcss-cc5c3f01c6958685130a9a037abaa4dd3df86b20.tar.bz2 |
Introduce fixed point constants.
Range check azimuth angles.
svn path=/trunk/libcss/; revision=6183
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/fpconstants.h | 20 | ||||
-rw-r--r-- | src/utils/fpmath.h | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/utils/fpconstants.h b/src/utils/fpconstants.h new file mode 100644 index 0000000..0718209 --- /dev/null +++ b/src/utils/fpconstants.h @@ -0,0 +1,20 @@ +/* + * This file is part of LibCSS. + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + * Copyright 2008 John-Mark Bell <jmb@netsurf-browser.org> + */ + +#ifndef css_utils_fpconstants_h_ +#define css_utils_fpconstants_h_ + +/* Useful angles */ +#define F_PI 0x00000c91 /* 3.1415 (PI) */ +#define F_2PI 0x00001922 /* 2 PI */ + +#define F_360 0x0005a000 /* 360 */ + +#define F_100 0x00019000 /* 100 */ + +#endif + diff --git a/src/utils/fpmath.h b/src/utils/fpmath.h index edf6471..c4db605 100644 --- a/src/utils/fpmath.h +++ b/src/utils/fpmath.h @@ -41,5 +41,7 @@ typedef int32_t fixed; /* Convert a fixed point value to an integer */ #define FIXTOINT(a) ((a) >> 10) +#include "utils/fpconstants.h" + #endif |