--- deliantra/server/include/util.h 2009/10/15 21:09:32 1.91 +++ deliantra/server/include/util.h 2009/10/20 05:57:08 1.92 @@ -216,6 +216,20 @@ return (int)sqrtf ((float)n); } +// this is kind of like the ^^ operator, if it would exist, without sequence point. +// more handy than it looks like, due to the implicit !! done on its arguments +inline bool +logical_xor (bool a, bool b) +{ + return a != b; +} + +inline bool +logical_implies (bool a, bool b) +{ + return a <= b; +} + // this is only twice as fast as naive sqrtf (dx*dy+dy*dy) #if 0 // and has a max. error of 6 in the range -100..+100.