From 101d9de3c3371a904b3a6e49e8b48f746d2cfbbb Mon Sep 17 00:00:00 2001 From: Choupom Date: Wed, 1 Jun 2011 19:27:36 +0200 Subject: added aspect ratio in display modes list in settings --- src/base/math.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/base') diff --git a/src/base/math.h b/src/base/math.h index 1234f681..549c8405 100644 --- a/src/base/math.h +++ b/src/base/math.h @@ -39,6 +39,17 @@ inline float frandom() { return rand()/(float)(RAND_MAX); } inline int f2fx(float v) { return (int)(v*(float)(1<<10)); } inline float fx2f(int v) { return v*(1.0f/(1<<10)); } +inline unsigned gcd(unsigned a, unsigned b) +{ + while(b != 0) + { + unsigned c = a % b; + a = b; + b = c; + } + return a; +} + class fxp { int value; -- cgit 1.4.1