aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/hdb.cpp
diff options
context:
space:
mode:
authorStrangerke2019-09-19 08:05:36 +0200
committerStrangerke2019-09-19 08:10:49 +0200
commit0344e0adce3361f68c3ec0b92c86878e635e80ad (patch)
tree596b8dd7ee4a1ebe0efc7680b67e15cec5ec2399 /engines/hdb/hdb.cpp
parentcd2f87942f79f11afdf63af26e91edc089b96973 (diff)
downloadscummvm-rg350-0344e0adce3361f68c3ec0b92c86878e635e80ad.tar.gz
scummvm-rg350-0344e0adce3361f68c3ec0b92c86878e635e80ad.tar.bz2
scummvm-rg350-0344e0adce3361f68c3ec0b92c86878e635e80ad.zip
HDB: Simplify some code
Diffstat (limited to 'engines/hdb/hdb.cpp')
-rw-r--r--engines/hdb/hdb.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index 0de3f32eda..bc780f66a5 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -550,15 +550,8 @@ void HDBGame::moveMap(int x, int y) {
ox += (_dx - x) / 8;
oy += (_dy - y) / 8;
- if (ox < 0)
- ox = 0;
- else if (ox > g_hdb->_map->mapPixelWidth() - 240)
- ox = g_hdb->_map->mapPixelWidth() - 240;
-
- if (oy < 0)
- oy = 0;
- else if (oy > g_hdb->_map->mapPixelHeight() - 320)
- oy = g_hdb->_map->mapPixelHeight() - 320;
+ ox = CLIP(ox, 0, g_hdb->_map->mapPixelWidth() - 240);
+ oy = CLIP(oy, 0, g_hdb->_map->mapPixelHeight() - 320)
g_hdb->_map->setMapXY(ox, oy);
}