diff options
author | Einar Johan Trøan Sømåen | 2013-04-20 18:11:47 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2013-04-20 18:11:47 +0200 |
commit | 51e17d9f86d9063dd98924046c78ad23946b4ae9 (patch) | |
tree | eadc51a3321f5ec7d1421201d12066691d647edb /engines/wintermute/base | |
parent | 2625f3931a946180de617fa0e04b8b4d3f30cb2d (diff) | |
download | scummvm-rg350-51e17d9f86d9063dd98924046c78ad23946b4ae9.tar.gz scummvm-rg350-51e17d9f86d9063dd98924046c78ad23946b4ae9.tar.bz2 scummvm-rg350-51e17d9f86d9063dd98924046c78ad23946b4ae9.zip |
WINTERMUTE: Further reduce the amount of int->int32-confusion.
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r-- | engines/wintermute/base/base_game.cpp | 10 | ||||
-rw-r--r-- | engines/wintermute/base/base_persistence_manager.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/base/base_region.cpp | 2 | ||||
-rw-r--r-- | engines/wintermute/base/base_sprite.cpp | 4 | ||||
-rw-r--r-- | engines/wintermute/base/base_viewport.cpp | 6 | ||||
-rw-r--r-- | engines/wintermute/base/base_viewport.h | 2 | ||||
-rw-r--r-- | engines/wintermute/base/font/base_font_truetype.cpp | 2 |
7 files changed, 15 insertions, 15 deletions
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index f5b63e46cc..e97e342149 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -1090,11 +1090,11 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack ////////////////////////////////////////////////////////////////////////// else if (strcmp(name, "SetMousePos") == 0) { stack->correctParams(2); - int x = stack->pop()->getInt(); - int y = stack->pop()->getInt(); - x = MAX(x, 0); + int32 x = stack->pop()->getInt(); + int32 y = stack->pop()->getInt(); + x = MAX<int32>(x, 0); x = MIN(x, _renderer->getWidth()); - y = MAX(y, 0); + y = MAX<int32>(y, 0); y = MIN(y, _renderer->getHeight()); Point32 p; p.x = x + _renderer->_drawOffsetX; @@ -2486,7 +2486,7 @@ bool BaseGame::scSetProperty(const char *name, ScValue *value) { ////////////////////////////////////////////////////////////////////////// else if (strcmp(name, "SoundBufferSize") == 0) { _soundBufferSizeSec = value->getInt(); - _soundBufferSizeSec = MAX(3, _soundBufferSizeSec); + _soundBufferSizeSec = MAX<int32>(3, _soundBufferSizeSec); return STATUS_OK; } diff --git a/engines/wintermute/base/base_persistence_manager.cpp b/engines/wintermute/base/base_persistence_manager.cpp index 48c1583f3d..5dbacb157b 100644 --- a/engines/wintermute/base/base_persistence_manager.cpp +++ b/engines/wintermute/base/base_persistence_manager.cpp @@ -533,7 +533,7 @@ TimeDate BasePersistenceManager::getTimeDate() { } void BasePersistenceManager::putFloat(float val) { - int32 exponent = 0; + int exponent = 0; float significand = frexp(val, &exponent); Common::String str = Common::String::format("FS%f", significand); _saveStream->writeUint32LE(str.size()); @@ -556,7 +556,7 @@ float BasePersistenceManager::getFloat() { } void BasePersistenceManager::putDouble(double val) { - int32 exponent = 0; + int exponent = 0; double significand = frexp(val, &exponent); Common::String str = Common::String::format("DS%f", significand); _saveStream->writeUint32LE(str.size()); diff --git a/engines/wintermute/base/base_region.cpp b/engines/wintermute/base/base_region.cpp index 51d222be4c..2dabe6ae44 100644 --- a/engines/wintermute/base/base_region.cpp +++ b/engines/wintermute/base/base_region.cpp @@ -493,7 +493,7 @@ bool BaseRegion::getBoundingRect(Rect32 *rect) { if (_points.size() == 0) { BasePlatform::setRectEmpty(rect); } else { - int minX = INT_MAX, minY = INT_MAX, maxX = INT_MIN, maxY = INT_MIN; + int32 minX = INT_MAX, minY = INT_MAX, maxX = INT_MIN, maxY = INT_MIN; for (uint32 i = 0; i < _points.size(); i++) { minX = MIN(minX, _points[i]->x); diff --git a/engines/wintermute/base/base_sprite.cpp b/engines/wintermute/base/base_sprite.cpp index 4e01fa5251..c920da9ee9 100644 --- a/engines/wintermute/base/base_sprite.cpp +++ b/engines/wintermute/base/base_sprite.cpp @@ -298,8 +298,8 @@ bool BaseSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSpriteCa case TOKEN_EDITOR_BG_ALPHA: parser.scanStr((char *)params, "%d", &_editorBgAlpha); - _editorBgAlpha = MIN(_editorBgAlpha, 255); - _editorBgAlpha = MAX(_editorBgAlpha, 0); + _editorBgAlpha = MIN<int32>(_editorBgAlpha, 255); + _editorBgAlpha = MAX<int32>(_editorBgAlpha, 0); break; case TOKEN_FRAME: { diff --git a/engines/wintermute/base/base_viewport.cpp b/engines/wintermute/base/base_viewport.cpp index 557ba74037..f79e5c9f13 100644 --- a/engines/wintermute/base/base_viewport.cpp +++ b/engines/wintermute/base/base_viewport.cpp @@ -65,10 +65,10 @@ bool BaseViewport::persist(BasePersistenceManager *persistMgr) { ////////////////////////////////////////////////////////////////////////// -bool BaseViewport::setRect(int left, int top, int right, int bottom, bool noCheck) { +bool BaseViewport::setRect(int32 left, int32 top, int32 right, int32 bottom, bool noCheck) { if (!noCheck) { - left = MAX(left, 0); - top = MAX(top, 0); + left = MAX<int32>(left, 0); + top = MAX<int32>(top, 0); right = MIN(right, BaseEngine::instance().getRenderer()->getWidth()); bottom = MIN(bottom, BaseEngine::instance().getRenderer()->getHeight()); } diff --git a/engines/wintermute/base/base_viewport.h b/engines/wintermute/base/base_viewport.h index 75b9989080..584e5a78f9 100644 --- a/engines/wintermute/base/base_viewport.h +++ b/engines/wintermute/base/base_viewport.h @@ -41,7 +41,7 @@ public: int getHeight() const; int getWidth() const; Rect32 *getRect(); - bool setRect(int left, int top, int right, int bottom, bool noCheck = false); + bool setRect(int32 left, int32 top, int32 right, int32 bottom, bool noCheck = false); DECLARE_PERSISTENT(BaseViewport, BaseClass) int32 _offsetY; int32 _offsetX; diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp index 246c6befb7..63ccfd91a1 100644 --- a/engines/wintermute/base/font/base_font_truetype.cpp +++ b/engines/wintermute/base/font/base_font_truetype.cpp @@ -509,7 +509,7 @@ bool BaseFontTT::persist(BasePersistenceManager *persistMgr) { // persist layers - int numLayers; + int32 numLayers; if (persistMgr->getIsSaving()) { numLayers = _layers.size(); persistMgr->transfer(TMEMBER(numLayers)); |