about summary refs log tree commit diff
path: root/src/base
diff options
context:
space:
mode:
authorChoupom <andycootlapin@hotmail.fr>2011-06-01 19:27:36 +0200
committeroy <Tom_Adams@web.de>2011-06-02 17:36:17 +0200
commit101d9de3c3371a904b3a6e49e8b48f746d2cfbbb (patch)
tree4b9d537a6f768f78908b12b8b03fb38c46be6cb7 /src/base
parent9f323857af6316ee183d928107033d82a6459f2b (diff)
downloadzcatch-101d9de3c3371a904b3a6e49e8b48f746d2cfbbb.tar.gz
zcatch-101d9de3c3371a904b3a6e49e8b48f746d2cfbbb.zip
added aspect ratio in display modes list in settings
Diffstat (limited to 'src/base')
-rw-r--r--src/base/math.h11
1 files changed, 11 insertions, 0 deletions
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;