aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2010-09-07 09:02:46 +0000
committerWillem Jan Palenstijn2010-09-07 09:02:46 +0000
commit8f1143bfdc972d86cf5fbbf85a0084a9d0c71447 (patch)
tree3c7689e4da4f66f8298000ddf1cccac8e40b561a
parentdd0095f1a210aa54f379fe51967def65a0dc5fdf (diff)
downloadscummvm-rg350-8f1143bfdc972d86cf5fbbf85a0084a9d0c71447.tar.gz
scummvm-rg350-8f1143bfdc972d86cf5fbbf85a0084a9d0c71447.tar.bz2
scummvm-rg350-8f1143bfdc972d86cf5fbbf85a0084a9d0c71447.zip
COMMON: Remove Rational::operator int/double
This prevents accidental implicit rounding and might also fix compilation on AmigaOS4 (bug #3060981). svn-id: r52616
-rw-r--r--common/rational.cpp8
-rw-r--r--common/rational.h3
-rw-r--r--engines/agos/animation.cpp4
-rw-r--r--graphics/video/coktel_decoder.cpp2
4 files changed, 3 insertions, 14 deletions
diff --git a/common/rational.cpp b/common/rational.cpp
index 38aae94def..999dc7feb8 100644
--- a/common/rational.cpp
+++ b/common/rational.cpp
@@ -258,14 +258,6 @@ frac_t Rational::toFrac() const {
return (_num * FRAC_ONE) / _denom;
}
-Rational::operator int() const {
- return toInt();
-}
-
-Rational::operator double() const {
- return toDouble();
-}
-
const Rational operator+(int left, const Rational &right) {
Rational tmp = right;
tmp += left;
diff --git a/common/rational.h b/common/rational.h
index 5826839ac6..bee09d8ddb 100644
--- a/common/rational.h
+++ b/common/rational.h
@@ -76,9 +76,6 @@ public:
bool operator>=(int right) const;
bool operator<=(int right) const;
- operator int() const;
- operator double() const;
-
void invert();
Rational getInverse() const;
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index 1b3ac9fd65..af85c50114 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -372,10 +372,10 @@ bool MoviePlayerDXA::processFrame() {
_vm->_system->unlockScreen();
Common::Rational soundTime(_mixer->getSoundElapsedTime(_bgSound), 1000);
- if ((_bgSoundStream == NULL) || ((int)(soundTime * getFrameRate()) / 1000 < getCurFrame() + 1)) {
+ if ((_bgSoundStream == NULL) || ((soundTime * getFrameRate()).toInt() / 1000 < getCurFrame() + 1)) {
if (_bgSoundStream && _mixer->isSoundHandleActive(_bgSound)) {
- while (_mixer->isSoundHandleActive(_bgSound) && ((int) (soundTime * getFrameRate())) < getCurFrame()) {
+ while (_mixer->isSoundHandleActive(_bgSound) && (soundTime * getFrameRate()).toInt() < getCurFrame()) {
_vm->_system->delayMillis(10);
soundTime = Common::Rational(_mixer->getSoundElapsedTime(_bgSound), 1000);
}
diff --git a/graphics/video/coktel_decoder.cpp b/graphics/video/coktel_decoder.cpp
index 37aad8f2c8..b1cbad2820 100644
--- a/graphics/video/coktel_decoder.cpp
+++ b/graphics/video/coktel_decoder.cpp
@@ -581,7 +581,7 @@ uint32 CoktelDecoder::getTimeToNextFrame() const {
// the middle of a long video.
if (!hasSound())
- return Common::Rational(1000, _frameRate).toInt();
+ return (1000 / _frameRate).toInt();
// If there /is/ audio, we do need to keep video and audio
// in sync, though.