From 0344e0adce3361f68c3ec0b92c86878e635e80ad Mon Sep 17 00:00:00 2001 From: Strangerke Date: Thu, 19 Sep 2019 08:05:36 +0200 Subject: HDB: Simplify some code --- engines/hdb/hdb.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'engines/hdb/hdb.cpp') 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); } -- cgit v1.2.3