diff options
author | Max Horn | 2005-05-18 08:50:06 +0000 |
---|---|---|
committer | Max Horn | 2005-05-18 08:50:06 +0000 |
commit | 9e0c72868b819d5a77c9a494556f280149664a29 (patch) | |
tree | 39e8cb9ba27c0668051fd58cf608482d35bc10ba | |
parent | e72b33e56f6ccc6ffd6f97d0bb114d8229885288 (diff) | |
download | scummvm-rg350-9e0c72868b819d5a77c9a494556f280149664a29.tar.gz scummvm-rg350-9e0c72868b819d5a77c9a494556f280149664a29.tar.bz2 scummvm-rg350-9e0c72868b819d5a77c9a494556f280149664a29.zip |
No need to declare a full method if all you need is a tiny local function
svn-id: r18158
-rw-r--r-- | scumm/logic_he.cpp | 15 | ||||
-rw-r--r-- | scumm/logic_he.h | 2 |
2 files changed, 6 insertions, 11 deletions
diff --git a/scumm/logic_he.cpp b/scumm/logic_he.cpp index fea0087c68..fe40560e43 100644 --- a/scumm/logic_he.cpp +++ b/scumm/logic_he.cpp @@ -37,11 +37,8 @@ LogicHE::~LogicHE() { free(_userDataD); } -double LogicHE::round(double arg) { - if (floor(arg) + 0.5 > arg) - return floor(arg); - else - return ceil(arg); +static int32 scumm_round(double arg) { + return (int32)(arg + 0.5); } int LogicHE::versionID() { @@ -449,8 +446,8 @@ void LogicHEfunshop::op_1004(int32 *args) { data[i] -= data[minx]; data[i + 1] -= data[miny]; - putInArray(args[0], 0, 519 + i, (int32)round(data[i])); - putInArray(args[0], 0, 519 + i + 1, (int32)round(data[i + 1])); + putInArray(args[0], 0, 519 + i, scumm_round(data[i])); + putInArray(args[0], 0, 519 + i + 1, scumm_round(data[i + 1])); } } @@ -472,8 +469,8 @@ void LogicHEfunshop::op_1005(int32 *args) { } for (int i = 520; i <= 526; i += 2) { - putInArray(args[0], 0, i - 1, (int32)round(data[i - 520])); - putInArray(args[0], 0, i, (int32)round(data[i - 520 + 1])); + putInArray(args[0], 0, i - 1, scumm_round(data[i - 520])); + putInArray(args[0], 0, i, scumm_round(data[i - 520 + 1])); } } diff --git a/scumm/logic_he.h b/scumm/logic_he.h index f07e682691..66c4333d02 100644 --- a/scumm/logic_he.h +++ b/scumm/logic_he.h @@ -49,8 +49,6 @@ public: virtual int versionID(); virtual int32 dispatch(int op, int numArgs, int32 *args); - - double round(double arg); }; class LogicHErace : public LogicHE { |