diff --git a/engines/wintermute/ad/ad_scene.cpp b/engines/wintermute/ad/ad_scene.cpp index ac84496cce5..269dbc2a845 100644 --- a/engines/wintermute/ad/ad_scene.cpp +++ b/engines/wintermute/ad/ad_scene.cpp @@ -60,7 +60,6 @@ #include "engines/wintermute/ui/ui_window.h" #include "engines/wintermute/utils/utils.h" #include "engines/wintermute/wintermute.h" -#include namespace Wintermute { @@ -235,7 +234,7 @@ bool AdScene::getPath(const BasePoint &source, const BasePoint &target, AdPath * // last point //_pfPath.add(new AdPathPoint(target.x, target.y, INT_MAX)); - pfPointsAdd(target.x, target.y, INT_MAX); + pfPointsAdd(target.x, target.y, INT_MAX_VALUE); // active waypoints for (uint32 i = 0; i < _waypointGroups.size(); i++) { @@ -275,7 +274,7 @@ void AdScene::pfAddWaypointGroup(AdWaypointGroup *wpt, BaseObject *requester) { } //_pfPath.add(new AdPathPoint(Wpt->_points[i]->x, Wpt->_points[i]->y, INT_MAX)); - pfPointsAdd(wpt->_points[i]->x, wpt->_points[i]->y, INT_MAX); + pfPointsAdd(wpt->_points[i]->x, wpt->_points[i]->y, INT_MAX_VALUE); } } @@ -473,7 +472,7 @@ int AdScene::getPointsDist(const BasePoint &p1, const BasePoint &p2, BaseObject void AdScene::pathFinderStep() { int i; // get lowest unmarked - int lowestDist = INT_MAX; + int lowestDist = INT_MAX_VALUE; AdPathPoint *lowestPt = nullptr; for (i = 0; i < _pfPointsNum; i++) @@ -1225,7 +1224,7 @@ bool AdScene::displayRegionContentOld(AdRegion *region) { // display all objects in region sorted by _posY do { obj = nullptr; - int minY = INT_MAX; + int minY = INT_MAX_VALUE; // global objects for (uint32 i = 0; i < adGame->_objects.size(); i++) { @@ -2483,7 +2482,7 @@ bool AdScene::correctTargetPoint(int32 startX, int32 startY, int32 *argX, int32 return STATUS_OK; } - int offsetX = INT_MAX, offsetY = INT_MAX; + int offsetX = INT_MAX_VALUE, offsetY = INT_MAX_VALUE; if (foundLeft && foundRight) { if (abs(lengthLeft) < abs(lengthRight)) { @@ -3018,4 +3017,3 @@ Common::String AdScene::debuggerToString() const { return Common::String::format("%p: Scene \"%s\", paralax: %d, autoscroll: %d", (const void *)this, getName(), _paralaxScrolling, _autoScroll); } } // End of namespace Wintermute - diff --git a/engines/wintermute/ad/ad_waypoint_group.cpp b/engines/wintermute/ad/ad_waypoint_group.cpp index 39515e82529..64947ac0a28 100644 --- a/engines/wintermute/ad/ad_waypoint_group.cpp +++ b/engines/wintermute/ad/ad_waypoint_group.cpp @@ -26,6 +26,7 @@ * Copyright (c) 2011 Jan Nedoma */ +#include "engines/wintermute/wintermute.h" #include "engines/wintermute/ad/ad_waypoint_group.h" #include "engines/wintermute/base/base_dynamic_buffer.h" #include "engines/wintermute/base/base_game.h" @@ -33,7 +34,6 @@ #include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_region.h" #include "engines/wintermute/base/scriptables/script_value.h" -#include namespace Wintermute { @@ -44,7 +44,7 @@ AdWaypointGroup::AdWaypointGroup(BaseGame *inGame) : BaseObject(inGame) { _active = true; _editorSelectedPoint = -1; _lastMimicScale = -1; - _lastMimicX = _lastMimicY = INT_MIN; + _lastMimicX = _lastMimicY = -INT_MAX_VALUE; } diff --git a/engines/wintermute/base/base_region.cpp b/engines/wintermute/base/base_region.cpp index cf32e042899..be8aa1d9d11 100644 --- a/engines/wintermute/base/base_region.cpp +++ b/engines/wintermute/base/base_region.cpp @@ -26,6 +26,7 @@ * Copyright (c) 2011 Jan Nedoma */ +#include "engines/wintermute/wintermute.h" #include "engines/wintermute/base/base_region.h" #include "engines/wintermute/base/base_parser.h" #include "engines/wintermute/base/base_dynamic_buffer.h" @@ -35,7 +36,6 @@ #include "engines/wintermute/base/scriptables/script_value.h" #include "engines/wintermute/base/base_file_manager.h" #include "engines/wintermute/platform_osystem.h" -#include namespace Wintermute { @@ -46,7 +46,7 @@ BaseRegion::BaseRegion(BaseGame *inGame) : BaseObject(inGame) { _active = true; _editorSelectedPoint = -1; _lastMimicScale = -1; - _lastMimicX = _lastMimicY = INT_MIN; + _lastMimicX = _lastMimicY = -INT_MAX_VALUE; _rect.setEmpty(); } @@ -496,7 +496,7 @@ bool BaseRegion::getBoundingRect(Rect32 *rect) { if (_points.size() == 0) { rect->setEmpty(); } else { - int32 minX = INT_MAX, minY = INT_MAX, maxX = INT_MIN, maxY = INT_MIN; + int32 minX = INT_MAX_VALUE, minY = INT_MAX_VALUE, maxX = -INT_MAX_VALUE, maxY = -INT_MAX_VALUE; for (uint32 i = 0; i < _points.size(); i++) { minX = MIN(minX, _points[i]->x); diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp index 98eb4fac8f9..cf79f3bbbc8 100644 --- a/engines/wintermute/base/font/base_font_truetype.cpp +++ b/engines/wintermute/base/font/base_font_truetype.cpp @@ -38,7 +38,6 @@ #include "graphics/fonts/ttf.h" #include "graphics/fontman.h" #include "common/unzip.h" -#include namespace Wintermute { @@ -174,7 +173,7 @@ void BaseFontTT::drawText(const byte *text, int x, int y, int width, TTextAlign BaseRenderer *renderer = _gameRef->_renderer; // find cached surface, if exists - uint32 minUseTime = UINT_MAX; + uint32 minUseTime = INT_MAX_VALUE; int minIndex = -1; BaseSurface *surface = nullptr; int textOffset = 0; diff --git a/engines/wintermute/wintermute.h b/engines/wintermute/wintermute.h index 8042e0e6fa2..fcadb1bba86 100644 --- a/engines/wintermute/wintermute.h +++ b/engines/wintermute/wintermute.h @@ -35,6 +35,8 @@ class SystemClassRegistry; class DebuggerController; struct WMEGameDescription; +const int INT_MAX_VALUE = 0x7fffffff; + // our engine debug channels enum { kWintermuteDebugLog = 1 << 0, // The debug-logs from the original engine