aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorColin Snover2016-02-11 16:25:33 -0600
committerColin Snover2016-02-18 13:18:02 -0600
commit4ba0ff8deb57aba3b034462c6c00ecf13ee281c9 (patch)
tree82822210546cb4839acc077c5fb3fc69cefae586 /common
parent7d54f0aaaf1854e421ee0e8eac3292c7bc0db284 (diff)
downloadscummvm-rg350-4ba0ff8deb57aba3b034462c6c00ecf13ee281c9.tar.gz
scummvm-rg350-4ba0ff8deb57aba3b034462c6c00ecf13ee281c9.tar.bz2
scummvm-rg350-4ba0ff8deb57aba3b034462c6c00ecf13ee281c9.zip
COMMON: Add convenience method to Common::Rational for 1:1 ratios
For SCI engine games, ratios may not be normalised and so to avoid extra scaling, there needs to be a way to simply check whether a ratio is 1:1.
Diffstat (limited to 'common')
-rw-r--r--common/rational.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/common/rational.h b/common/rational.h
index 55fb361774..89caaf25b4 100644
--- a/common/rational.h
+++ b/common/rational.h
@@ -84,6 +84,8 @@ public:
int getNumerator() const { return _num; }
int getDenominator() const { return _denom; }
+ bool isOne() const { return _num == _denom; }
+
void debugPrint(int debuglevel = 0, const char *caption = "Rational:") const;
private: