WINTERMUTE: Do not include standard headers

This commit is contained in:
Eugene Sandulenko 2020-03-25 10:32:37 +01:00
parent 42f4eeea8f
commit 4e7f9ee808
5 changed files with 13 additions and 14 deletions

View File

@ -60,7 +60,6 @@
#include "engines/wintermute/ui/ui_window.h"
#include "engines/wintermute/utils/utils.h"
#include "engines/wintermute/wintermute.h"
#include <limits.h>
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

View File

@ -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 <limits.h>
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;
}

View File

@ -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 <limits.h>
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);

View File

@ -38,7 +38,6 @@
#include "graphics/fonts/ttf.h"
#include "graphics/fontman.h"
#include "common/unzip.h"
#include <limits.h>
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;

View File

@ -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