aboutsummaryrefslogtreecommitdiff
path: root/common/util.h
diff options
context:
space:
mode:
authorMax Horn2003-05-15 21:40:36 +0000
committerMax Horn2003-05-15 21:40:36 +0000
commit128f793be03e389891a0fe92373269bfb8b39114 (patch)
treec7e6978c8c0047bcae5744472a928bd47ee1b5e8 /common/util.h
parentc0e8eb0cb77807236897a764f4414cb5e33e7ba9 (diff)
downloadscummvm-rg350-128f793be03e389891a0fe92373269bfb8b39114.tar.gz
scummvm-rg350-128f793be03e389891a0fe92373269bfb8b39114.tar.bz2
scummvm-rg350-128f793be03e389891a0fe92373269bfb8b39114.zip
make SWAP a template function, so that it works for swapping non-int stuff, too; 'int16' should be sufficient for points/rects
svn-id: r7540
Diffstat (limited to 'common/util.h')
-rw-r--r--common/util.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/common/util.h b/common/util.h
index 7123a8e4a1..330d9d369b 100644
--- a/common/util.h
+++ b/common/util.h
@@ -35,7 +35,9 @@
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#endif
-static inline void SWAP(int &a, int &b) { int tmp = a; a = b; b = tmp; }
+template<class T>
+static inline void SWAP(T &a, T &b) { T tmp = a; a = b; b = tmp; }
+
#define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
int RGBMatch(byte *palette, int r, int g, int b);