From 4ba0ff8deb57aba3b034462c6c00ecf13ee281c9 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 11 Feb 2016 16:25:33 -0600 Subject: 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. --- common/rational.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'common') 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: -- cgit v1.2.3