diff options
author | Paul Gilbert | 2015-04-29 18:11:35 -1000 |
---|---|---|
committer | Paul Gilbert | 2015-04-29 18:11:35 -1000 |
commit | 0ef0b4570a861d117c27b5f72af991506814820c (patch) | |
tree | fc907df13fa075328dd0063fa8c5a6eb58e00cf6 /engines/sherlock | |
parent | 4b53d6a54b121e20d6bd4bfb6f1851b120817101 (diff) | |
download | scummvm-rg350-0ef0b4570a861d117c27b5f72af991506814820c.tar.gz scummvm-rg350-0ef0b4570a861d117c27b5f72af991506814820c.tar.bz2 scummvm-rg350-0ef0b4570a861d117c27b5f72af991506814820c.zip |
SHERLOCK: Minor bugfix and cleanup for dartScore
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/scalpel/darts.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/sherlock/scalpel/darts.cpp b/engines/sherlock/scalpel/darts.cpp index 0f3c36420e..476a3071c5 100644 --- a/engines/sherlock/scalpel/darts.cpp +++ b/engines/sherlock/scalpel/darts.cpp @@ -485,13 +485,14 @@ bool Darts::dartHit() { */ int Darts::dartScore(const Common::Point &pt) { Common::Point pos(pt.x - 37, pt.y - 33); + Graphics::Surface &scoreImg = (*_dartImages)[1]._frame; - if (pos.x < 0 || pos.y < 0 || pos.x >= 147 || pt.y >= 132) + if (pos.x < 0 || pos.y < 0 || pos.x >= scoreImg.w || pos.y >= scoreImg.h) // Not on the board return 0; // On board, so get the score from the pixel at that position - int score = *(const byte *)(*_dartImages)[1]._frame.getBasePtr(pos.x, pos.y); + int score = *(const byte *)scoreImg.getBasePtr(pos.x, pos.y); return score; } |