Commit 960dac6e authored by cutealien's avatar cutealien

Add irr::s64 back in (using long long for non VS compilers). If there's any...

Add irr::s64 back in (using long long for non VS compilers). If there's any problem with this please inform me, I'd like that to stay in as it makes Irrlicht a lot easier to use in combination with the Clipper library (a boost-licensed library for working with 2d polygons).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4114 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 4ae59497
......@@ -39,6 +39,7 @@ namespace core
//! Rounding error constant often used when comparing f32 values.
const s32 ROUNDING_ERROR_S32 = 0;
const s64 ROUNDING_ERROR_S64 = 0;
const f32 ROUNDING_ERROR_f32 = 0.000001f;
const f64 ROUNDING_ERROR_f64 = 0.00000001;
......@@ -210,6 +211,12 @@ namespace core
return (a + tolerance >= b) && (a - tolerance <= b);
}
//! returns if a equals b, taking an explicit rounding tolerance into account
inline bool equals(const s64 a, const s64 b, const s64 tolerance = ROUNDING_ERROR_S64)
{
return (a + tolerance >= b) && (a - tolerance <= b);
}
//! returns if a equals zero, taking rounding errors into account
inline bool iszero(const f64 a, const f64 tolerance = ROUNDING_ERROR_f64)
......
......@@ -68,11 +68,13 @@ typedef signed int s32;
// 64 bit signed variable.
// This is a typedef for __int64, it ensures portability of the engine.
// This type is currently not used by the engine and not supported by compilers
// other than Microsoft Compilers, so it is outcommented.
//typedef __int64 s64;
//! 64 bit signed variable.
/** This is a typedef for __int64, it ensures portability of the engine. */
#ifdef _MSC_VER
typedef __int64 s64;
#else
typedef long long s64;
#endif
......
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_layout_file>
<ActiveTarget name="All" />
<File name="main.cpp" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor1 position="363" topLine="6" />
<File name="main.cpp" open="0" top="0" tabpos="0">
<Cursor position="363" topLine="6" />
</File>
</CodeBlocks_layout_file>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment