diff --git a/common/rect.h b/common/rect.h index 96437d752f2..f7d7a6606c5 100644 --- a/common/rect.h +++ b/common/rect.h @@ -44,15 +44,15 @@ namespace Common { * Simple class for handling both 2D position and size. */ struct Point { - int16 x; /*!< The horizontal position of the point. */ - int16 y; /*!< The vertical position of the point. */ + int32 x; /*!< The horizontal position of the point. */ + int32 y; /*!< The vertical position of the point. */ Point() : x(0), y(0) {} /** * Create a point with position defined by @p x1 and @p y1. */ - Point(int16 x1, int16 y1) : x(x1), y(y1) {} + Point(int32 x1, int32 y1) : x(x1), y(y1) {} /** * Determine whether the position of two points is the same. */ @@ -143,21 +143,21 @@ static inline Point operator*(double multiplier, const Point &p) { return Point( * When writing code using our Rect class, always keep this principle in mind! */ struct Rect { - int16 top, left; /*!< The point at the top left of the rectangle (part of the Rect). */ - int16 bottom, right; /*!< The point at the bottom right of the rectangle (not part of the Rect). */ + int32 top, left; /*!< The point at the top left of the rectangle (part of the Rect). */ + int32 bottom, right; /*!< The point at the bottom right of the rectangle (not part of the Rect). */ Rect() : top(0), left(0), bottom(0), right(0) {} /** * Create a rectangle with the top-left corner at position (0, 0) and the given width @p w and height @p h. */ - Rect(int16 w, int16 h) : top(0), left(0), bottom(h), right(w) {} + Rect(int32 w, int32 h) : top(0), left(0), bottom(h), right(w) {} /** * Create a rectangle with the top-left corner at the given position (x1, y1) * and the bottom-right corner at the position (x2, y2). * * The @p x2 value must be greater or equal @p x1 and @p y2 must be greater or equal @p y1. */ - Rect(int16 x1, int16 y1, int16 x2, int16 y2) : top(y1), left(x1), bottom(y2), right(x2) { + Rect(int32 x1, int32 y1, int32 x2, int32 y2) : top(y1), left(x1), bottom(y2), right(x2) { assert(isValidRect()); } /** @@ -173,14 +173,14 @@ struct Rect { */ bool operator!=(const Rect &rhs) const { return !equals(rhs); } - int16 width() const { return right - left; } /*!< Return the width of a rectangle. */ - int16 height() const { return bottom - top; } /*!< Return the height of a rectangle. */ + int32 width() const { return right - left; } /*!< Return the width of a rectangle. */ + int32 height() const { return bottom - top; } /*!< Return the height of a rectangle. */ - void setWidth(int16 aWidth) { /*!< Set the width to @p aWidth value. */ + void setWidth(int32 aWidth) { /*!< Set the width to @p aWidth value. */ right = left + aWidth; } - void setHeight(int16 aHeight) { /*!< Set the height to @p aHeight value. */ + void setHeight(int32 aHeight) { /*!< Set the height to @p aHeight value. */ bottom = top + aHeight; } @@ -192,7 +192,7 @@ struct Rect { * * @return True if the given position is inside this rectangle, false otherwise. */ - bool contains(int16 x, int16 y) const { + bool contains(int32 x, int32 y) const { return (left <= x) && (x < right) && (top <= y) && (y < bottom); } @@ -272,7 +272,7 @@ struct Rect { * * @param offset The size to grow by. */ - void grow(int16 offset) { + void grow(int32 offset) { top -= offset; left -= offset; bottom += offset; @@ -302,7 +302,7 @@ struct Rect { /** * Reduce the dimensions of this rectangle by setting max width and max heigth. */ - void clip(int16 maxw, int16 maxh) { + void clip(int32 maxw, int32 maxh) { clip(Rect(0, 0, maxw, maxh)); } @@ -326,7 +326,7 @@ struct Rect { /** * Move this rectangle to the position defined by @p x, @p y. */ - void moveTo(int16 x, int16 y) { + void moveTo(int32 x, int32 y) { bottom += y - top; right += x - left; top = y; @@ -336,7 +336,7 @@ struct Rect { /** * Move the rectangle by the given delta x and y values. */ - void translate(int16 dx, int16 dy) { + void translate(int32 dx, int32 dy) { left += dx; right += dx; top += dy; bottom += dy; } @@ -359,7 +359,7 @@ struct Rect { * Create a rectangle around the given center. * @note The center point is rounded up and left when given an odd width and height. */ - static Rect center(int16 cx, int16 cy, int16 w, int16 h) { + static Rect center(int32 cx, int32 cy, int32 w, int32 h) { int x = cx - w / 2, y = cy - h / 2; return Rect(x, y, x + w, y + h); } diff --git a/engines/access/bubble_box.cpp b/engines/access/bubble_box.cpp index 063062291df..63d318c32a8 100644 --- a/engines/access/bubble_box.cpp +++ b/engines/access/bubble_box.cpp @@ -67,7 +67,7 @@ void BubbleBox::clearBubbles() { _vm->_screen->_screenYOff = 0; Common::Rect r = _bubbles[i]; r.left -= 2; - r.right = MIN(r.right, (int16)_vm->_screen->w); + r.right = MIN(r.right, (int32)_vm->_screen->w); _vm->_screen->copyBlock(&_vm->_buffer1, r); } diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp index 6ef98f252a5..75618838977 100644 --- a/engines/bladerunner/bladerunner.cpp +++ b/engines/bladerunner/bladerunner.cpp @@ -1026,8 +1026,8 @@ bool BladeRunnerEngine::loadSplash() { Common::Point BladeRunnerEngine::getMousePos() const { Common::Point p = _eventMan->getMousePos(); - p.x = CLIP(p.x, int16(0), int16(639)); - p.y = CLIP(p.y, int16(0), int16(479)); + p.x = CLIP(p.x, int32(0), int32(639)); + p.y = CLIP(p.y, int32(0), int32(479)); return p; } diff --git a/engines/bladerunner/ui/esper.cpp b/engines/bladerunner/ui/esper.cpp index e6f3012030d..569c58ba985 100644 --- a/engines/bladerunner/ui/esper.cpp +++ b/engines/bladerunner/ui/esper.cpp @@ -957,10 +957,10 @@ void ESPER::drawPhotoWithGrid(Graphics::Surface &surface) { } void ESPER::drawSelection(Graphics::Surface &surface, bool crosshair, int style) { - int left = CLIP(_selection.left, _screen.left, (int16)(_screen.right - 1)); - int top = CLIP(_selection.top, _screen.top, (int16)(_screen.bottom - 1)); - int right = CLIP(_selection.right, _screen.left, (int16)(_screen.right - 1)); - int bottom = CLIP(_selection.bottom, _screen.top, (int16)(_screen.bottom - 1)); + int left = CLIP(_selection.left, _screen.left, (int32)(_screen.right - 1)); + int top = CLIP(_selection.top, _screen.top, (int32)(_screen.bottom - 1)); + int right = CLIP(_selection.right, _screen.left, (int32)(_screen.right - 1)); + int bottom = CLIP(_selection.bottom, _screen.top, (int32)(_screen.bottom - 1)); int color = surface.format.RGBToColor(0, 144, 0); if (style) { diff --git a/engines/cruise/cruise_main.cpp b/engines/cruise/cruise_main.cpp index 0857712e0a6..3250c19fdee 100644 --- a/engines/cruise/cruise_main.cpp +++ b/engines/cruise/cruise_main.cpp @@ -1389,8 +1389,8 @@ bool checkInput(int16 *buttonPtr) { extern bool manageEvents(); int CruiseEngine::processInput() { - int16 mouseX = 0; - int16 mouseY = 0; + int32 mouseX = 0; + int32 mouseY = 0; int16 button = 0; /*if (inputSub1keyboad()) @@ -1746,7 +1746,7 @@ bool manageEvents() { return false; } -void getMouseStatus(int16 *pMouseVar, int16 *pMouseX, int16 *pMouseButton, int16 *pMouseY) { +void getMouseStatus(int16 *pMouseVar, int32 *pMouseX, int16 *pMouseButton, int32 *pMouseY) { *pMouseX = currentMouseX; *pMouseY = currentMouseY; *pMouseButton = currentMouseButton; @@ -1757,7 +1757,7 @@ void CruiseEngine::mainLoop() { //int32 t_start,t_left; //uint32 t_end; //int32 q=0; /* Dummy */ - int16 mouseX, mouseY; + int32 mouseX, mouseY; int16 mouseButton; int enableUser = 0; diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h index f9d0e2fc786..ea3bb5fb54c 100644 --- a/engines/cruise/cruise_main.h +++ b/engines/cruise/cruise_main.h @@ -101,7 +101,7 @@ void getFileExtention(const char *name, char *buffer); void *allocAndZero(int size); void freeStuff2(); void mainLoop(); -void getMouseStatus(int16 *pMouseVar, int16 *pMouseX, int16 *pMouseButton, int16 *pMouseY); +void getMouseStatus(int16 *pMouseVar, int32 *pMouseX, int16 *pMouseButton, int32 *pMouseY); bool testMask(int x, int y, unsigned char* pData, int stride); menuElementSubStruct *getSelectedEntryInMenu(menuStruct *pMenu); void closeAllMenu(); diff --git a/engines/cruise/function.cpp b/engines/cruise/function.cpp index 18dcaeeb508..11a4a6821d9 100644 --- a/engines/cruise/function.cpp +++ b/engines/cruise/function.cpp @@ -164,8 +164,8 @@ int16 Op_Narrator() { int16 Op_GetMouseX() { int16 dummy; - int16 mouseX; - int16 mouseY; + int32 mouseX; + int32 mouseY; int16 mouseButton; getMouseStatus(&dummy, &mouseX, &mouseButton, &mouseY); @@ -175,8 +175,8 @@ int16 Op_GetMouseX() { int16 Op_GetMouseY() { int16 dummy; - int16 mouseX; - int16 mouseY; + int32 mouseX; + int32 mouseY; int16 mouseButton; getMouseStatus(&dummy, &mouseX, &mouseButton, &mouseY); @@ -705,8 +705,8 @@ int16 Op_FadeIn() { int16 Op_GetMouseButton() { int16 dummy; - int16 mouseX; - int16 mouseY; + int32 mouseX; + int32 mouseY; int16 mouseButton; getMouseStatus(&dummy, &mouseX, &mouseButton, &mouseY); diff --git a/engines/cruise/gfxModule.cpp b/engines/cruise/gfxModule.cpp index 9fd94d7ea6c..937574f7e9a 100644 --- a/engines/cruise/gfxModule.cpp +++ b/engines/cruise/gfxModule.cpp @@ -230,8 +230,8 @@ void gfxModuleData_flipScreen() { } void gfxModuleData_addDirtyRect(const Common::Rect &r) { - _vm->_dirtyRects.push_back(Common::Rect( MAX(r.left, (int16)0), MAX(r.top, (int16)0), - MIN(r.right, (int16)320), MIN(r.bottom, (int16)200))); + _vm->_dirtyRects.push_back(Common::Rect( MAX(r.left, (int32)0), MAX(r.top, (int32)0), + MIN(r.right, (int32)320), MIN(r.bottom, (int32)200))); } /** diff --git a/engines/cruise/mainDraw.cpp b/engines/cruise/mainDraw.cpp index 015d0b07e93..c952a1dc9aa 100644 --- a/engines/cruise/mainDraw.cpp +++ b/engines/cruise/mainDraw.cpp @@ -1561,8 +1561,8 @@ void mainDraw(bool waitFl) { return; } } else if ((linkedRelation) && (linkedMsgList)) { - int16 mouseX; - int16 mouseY; + int32 mouseX; + int32 mouseY; int16 button; getMouseStatus(&main10, &mouseX, &button, &mouseY); diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp index 295eef4d480..cc2c5c2adee 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -152,8 +152,8 @@ void updateMenuMouse(int mouseX, int mouseY, menuStruct *pMenu) { bool manageEvents(); int processMenu(menuStruct *pMenu) { - int16 mouseX; - int16 mouseY; + int32 mouseX; + int32 mouseY; int16 mouseButton; int di; int si; diff --git a/engines/glk/selection.cpp b/engines/glk/selection.cpp index 63d900b5025..df4b17fcbad 100644 --- a/engines/glk/selection.cpp +++ b/engines/glk/selection.cpp @@ -147,8 +147,8 @@ void Selection::startSelection(const Point &pos) { return; } - tx = MIN(pos.x, (int16)_hor); - ty = MIN(pos.y, (int16)_ver); + tx = MIN(pos.x, (int32)_hor); + ty = MIN(pos.y, (int32)_ver); _select.left = _select.right = _last.x = tx; _select.top = _select.bottom = _last.y = ty; @@ -167,8 +167,8 @@ void Selection::moveSelection(const Point &pos) { return; } - tx = MIN(pos.x, (int16)_hor); - ty = MIN(pos.y, (int16)_ver); + tx = MIN(pos.x, (int32)_hor); + ty = MIN(pos.y, (int32)_ver); _select.right = _last.x = tx; _select.bottom = _last.y = ty; diff --git a/engines/glk/window_text_grid.h b/engines/glk/window_text_grid.h index 60f74b61f0e..eb272be3c7d 100644 --- a/engines/glk/window_text_grid.h +++ b/engines/glk/window_text_grid.h @@ -101,8 +101,8 @@ public: */ void setSize(const Point &newSize) override { Window::setSize(newSize); - _curX = CLIP((int16)_curX, _bbox.left, _bbox.right); - _curY = CLIP((int16)_curY, _bbox.top, _bbox.bottom); + _curX = CLIP((int32)_curX, _bbox.left, _bbox.right); + _curY = CLIP((int32)_curY, _bbox.top, _bbox.bottom); } /** @@ -110,8 +110,8 @@ public: */ void setPosition(const Point &newPos) override { _bbox.moveTo(newPos); - _curX = CLIP((int16)_curX, _bbox.left, _bbox.right); - _curY = CLIP((int16)_curY, _bbox.top, _bbox.bottom); + _curX = CLIP((int32)_curX, _bbox.left, _bbox.right); + _curY = CLIP((int32)_curY, _bbox.top, _bbox.bottom); } /** diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 86a25c5ea44..ab9ad12da2d 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -1227,10 +1227,10 @@ void GraphicsManager::displayDebugRect(Graphics::Surface *surface, const Common: // Move for scrolling offset and adjust to crop on-screen r.translate(-_scrollPosX, 0); - r.left = MAX(r.left, (int16)0); - r.top = MAX(r.top, (int16)0); - r.right = MIN(r.right, (int16)SCREEN_WIDTH); - r.bottom = MIN(r.bottom, (int16)SCREEN_HEIGHT); + r.left = MAX(r.left, (int32)0); + r.top = MAX(r.top, (int32)0); + r.right = MIN(r.right, (int32)SCREEN_WIDTH); + r.bottom = MIN(r.bottom, (int32)SCREEN_HEIGHT); // If there's an on-screen portion, display it if (r.isValidRect()) diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index 6551a8d2ffb..075ad02196a 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -738,8 +738,8 @@ void Gui::drawDraggedObject() { ImageAsset *asset = _assets[_draggedObj.id]; // In case of overflow from the right/top - uint w = asset->getWidth() + MIN((int16)0, _draggedObj.pos.x); - uint h = asset->getHeight() + MIN((int16)0, _draggedObj.pos.y); + uint w = asset->getWidth() + MIN((int32)0, _draggedObj.pos.x); + uint h = asset->getHeight() + MIN((int32)0, _draggedObj.pos.y); // In case of overflow from the bottom/left if (_draggedObj.pos.x > 0 && _draggedObj.pos.x + w > kScreenWidth) { @@ -766,7 +766,7 @@ void Gui::drawDraggedObject() { target.x + _draggedSurface.w, target.y + _draggedSurface.h), Common::Point(0, 0)); - asset->blitInto(&_draggedSurface, MIN((int16)0, _draggedObj.pos.x), MIN((int16)0, _draggedObj.pos.y), kBlitBIC); + asset->blitInto(&_draggedSurface, MIN((int32)0, _draggedObj.pos.x), MIN((int32)0, _draggedObj.pos.y), kBlitBIC); g_system->copyRectToScreen( _draggedSurface.getBasePtr(0, 0), diff --git a/engines/mads/camera.cpp b/engines/mads/camera.cpp index eb5942842ae..75288ea768c 100644 --- a/engines/mads/camera.cpp +++ b/engines/mads/camera.cpp @@ -83,7 +83,7 @@ void Camera::camPanTo(int target) { } } -bool Camera::camPan(int16 *picture_view, int16 *player_loc, int display_size, int picture_size) { +bool Camera::camPan(int32 *picture_view, int32 *player_loc, int display_size, int picture_size) { bool panningFl = false; if (_panAllowedFl) { Scene &scene = _vm->_game->_scene; diff --git a/engines/mads/camera.h b/engines/mads/camera.h index 63f1f9f7ff0..ccf4c4cac39 100644 --- a/engines/mads/camera.h +++ b/engines/mads/camera.h @@ -53,7 +53,7 @@ public: Camera(MADSEngine *vm); void camPanTo(int target); - bool camPan(int16 *picture_view, int16 *player_loc, int display_size, int picture_size); + bool camPan(int32 *picture_view, int32 *player_loc, int display_size, int picture_size); void setDefaultPanX(); void setDefaultPanY(); }; diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index f1fe7eaf59f..bcd2f708573 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -342,7 +342,7 @@ void Player::update() { scene._spriteSlots[slotIndex]._flags = IMG_ERASE; int newDepth = 1; - int yp = MIN(_playerPos.y, (int16)(MADS_SCENE_HEIGHT - 1)); + int yp = MIN(_playerPos.y, (int32)(MADS_SCENE_HEIGHT - 1)); for (int idx = 1; idx < DEPTH_BANDS_SIZE; ++idx) { if (scene._sceneInfo->_depthList[newDepth] >= yp) diff --git a/engines/pegasus/types.h b/engines/pegasus/types.h index 3ffbf7ac17a..5ef7efadb2f 100644 --- a/engines/pegasus/types.h +++ b/engines/pegasus/types.h @@ -46,7 +46,7 @@ typedef uint32 NotificationFlags; // Mac types. typedef int16 ResIDType; -typedef int16 CoordType; +typedef int32 CoordType; enum SlideDirection { kSlideLeftMask = 1, diff --git a/engines/prince/cursor.cpp b/engines/prince/cursor.cpp index a4e58dc4a28..0bd2eb1f206 100644 --- a/engines/prince/cursor.cpp +++ b/engines/prince/cursor.cpp @@ -80,8 +80,8 @@ void PrinceEngine::changeCursor(uint16 curId) { case 3: curSurface = _cursor3->getSurface(); Common::Point mousePos = _system->getEventManager()->getMousePos(); - mousePos.x = CLIP(mousePos.x, (int16) 315, (int16) 639); - mousePos.y = CLIP(mousePos.y, (int16) 0, (int16) 170); + mousePos.x = CLIP(mousePos.x, (int32) 315, (int32) 639); + mousePos.y = CLIP(mousePos.y, (int32) 0, (int32) 170); _system->warpMouse(mousePos.x, mousePos.y); break; } diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 81177a45169..ebdf1bc1961 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -1016,9 +1016,9 @@ void PrinceEngine::mouseWeirdo() { default: break; } - mousePos.x = CLIP(mousePos.x, (int16) 315, (int16) 639); + mousePos.x = CLIP(mousePos.x, (int32) 315, (int32) 639); _flags->setFlagValue(Flags::MXFLAG, mousePos.x); - mousePos.y = CLIP(mousePos.y, (int16) 0, (int16) 170); + mousePos.y = CLIP(mousePos.y, (int32) 0, (int32) 170); _flags->setFlagValue(Flags::MYFLAG, mousePos.y); _system->warpMouse(mousePos.x, mousePos.y); } diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp index b57b43ac960..b95f21a8a65 100644 --- a/engines/sci/engine/kevent.cpp +++ b/engines/sci/engine/kevent.cpp @@ -323,8 +323,8 @@ reg_t kGlobalToLocal(EngineState *s, int argc, reg_t *argv) { SegManager *segMan = s->_segMan; if (obj.getSegment()) { - int16 x = readSelectorValue(segMan, obj, SELECTOR(x)); - int16 y = readSelectorValue(segMan, obj, SELECTOR(y)); + int32 x = readSelectorValue(segMan, obj, SELECTOR(x)); + int32 y = readSelectorValue(segMan, obj, SELECTOR(y)); g_sci->_gfxCoordAdjuster->kernelGlobalToLocal(x, y); @@ -341,8 +341,8 @@ reg_t kLocalToGlobal(EngineState *s, int argc, reg_t *argv) { SegManager *segMan = s->_segMan; if (obj.getSegment()) { - int16 x = readSelectorValue(segMan, obj, SELECTOR(x)); - int16 y = readSelectorValue(segMan, obj, SELECTOR(y)); + int32 x = readSelectorValue(segMan, obj, SELECTOR(x)); + int32 y = readSelectorValue(segMan, obj, SELECTOR(y)); g_sci->_gfxCoordAdjuster->kernelLocalToGlobal(x, y); diff --git a/engines/sci/graphics/coordadjuster.cpp b/engines/sci/graphics/coordadjuster.cpp index 2f22d191d07..50525679649 100644 --- a/engines/sci/graphics/coordadjuster.cpp +++ b/engines/sci/graphics/coordadjuster.cpp @@ -39,13 +39,13 @@ GfxCoordAdjuster16::GfxCoordAdjuster16(GfxPorts *ports) GfxCoordAdjuster16::~GfxCoordAdjuster16() { } -void GfxCoordAdjuster16::kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject) { +void GfxCoordAdjuster16::kernelGlobalToLocal(int32 &x, int32 &y, reg_t planeObject) { Port *curPort = _ports->getPort(); x -= curPort->left; y -= curPort->top; } -void GfxCoordAdjuster16::kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject) { +void GfxCoordAdjuster16::kernelLocalToGlobal(int32 &x, int32 &y, reg_t planeObject) { Port *curPort = _ports->getPort(); x += curPort->left; y += curPort->top; diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h index f7ebd3ec75f..789f3a6af44 100644 --- a/engines/sci/graphics/coordadjuster.h +++ b/engines/sci/graphics/coordadjuster.h @@ -40,8 +40,8 @@ public: GfxCoordAdjuster16(GfxPorts *ports); ~GfxCoordAdjuster16(); - void kernelGlobalToLocal(int16 &x, int16 &y, reg_t planeObject = NULL_REG); - void kernelLocalToGlobal(int16 &x, int16 &y, reg_t planeObject = NULL_REG); + void kernelGlobalToLocal(int32 &x, int32 &y, reg_t planeObject = NULL_REG); + void kernelLocalToGlobal(int32 &x, int32 &y, reg_t planeObject = NULL_REG); Common::Rect onControl(Common::Rect rect); void setCursorPos(Common::Point &pos); diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index 45f0ba3402a..bde998f9c58 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -363,8 +363,8 @@ void GfxMenu::drawBar() { listIterator = _list.begin(); while (listIterator != listEnd) { listEntry = *listIterator; - int16 textWidth; - int16 textHeight; + int32 textWidth; + int32 textHeight; if (g_sci->isLanguageRTL()) { _text16->StringWidth(listEntry->textSplit.c_str(), _text16->GetFontId(), textWidth, textHeight); _ports->_curPort->curLeft -= textWidth; @@ -383,7 +383,7 @@ void GfxMenu::calculateMenuWidth() { GuiMenuList::iterator menuIterator; GuiMenuList::iterator menuEnd = _list.end(); GuiMenuEntry *menuEntry; - int16 dummyHeight; + int32 dummyHeight; menuIterator = _list.begin(); while (menuIterator != menuEnd) { @@ -400,7 +400,7 @@ void GfxMenu::calculateMenuAndItemWidth() { GuiMenuItemList::iterator itemIterator; GuiMenuItemList::iterator itemEnd = _itemList.end(); GuiMenuItemEntry *itemEntry; - int16 dummyHeight; + int32 dummyHeight; calculateMenuWidth(); @@ -1024,8 +1024,8 @@ void GfxMenu::kernelDrawStatus(const char *text, int16 colorPen, int16 colorBack if (!g_sci->isLanguageRTL()) { _ports->moveTo(0, 1); } else { - int16 textWidth; - int16 textHeight; + int32 textWidth; + int32 textHeight; _text16->StringWidth(text, _text16->GetFontId(), textWidth, textHeight); _ports->moveTo(_screen->getWidth() - textWidth, 1); } diff --git a/engines/sci/graphics/menu.h b/engines/sci/graphics/menu.h index 95fd4f6c202..1ad12fbfb14 100644 --- a/engines/sci/graphics/menu.h +++ b/engines/sci/graphics/menu.h @@ -43,7 +43,7 @@ struct GuiMenuEntry { uint16 id; Common::String text; Common::String textSplit; - int16 textWidth; + int32 textWidth; GuiMenuEntry(uint16 curId) : id(curId), textWidth(0) { } @@ -62,9 +62,9 @@ struct GuiMenuItemEntry { Common::String text; Common::String textSplit; reg_t textVmPtr; - int16 textWidth; + int32 textWidth; Common::String textRightAligned; - int16 textRightAlignedWidth; + int32 textRightAlignedWidth; GuiMenuItemEntry(uint16 curMenuId, uint16 curId) : menuId(curMenuId), id(curId), diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 86fe891f39c..f8c30b70e95 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -82,9 +82,9 @@ void GfxPicture::draw(bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) { } void GfxPicture::reset() { - int16 startY = _ports->getPort()->top; - int16 startX = 0; - int16 x, y; + int32 startY = _ports->getPort()->top; + int32 startX = 0; + int32 x, y; _screen->vectorAdjustCoordinate(&startX, &startY); for (y = startY; y < _screen->getHeight(); y++) { for (x = startX; x < _screen->getWidth(); x++) { @@ -868,11 +868,11 @@ void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, by } // hard borders for filling - int16 borderLeft = curPort->rect.left + curPort->left; - int16 borderTop = curPort->rect.top + curPort->top; - int16 borderRight = curPort->rect.right + curPort->left - 1; - int16 borderBottom = curPort->rect.bottom + curPort->top - 1; - int16 curToLeft, curToRight, a_set, b_set; + int32 borderLeft = curPort->rect.left + curPort->left; + int32 borderTop = curPort->rect.top + curPort->top; + int32 borderRight = curPort->rect.right + curPort->left - 1; + int32 borderBottom = curPort->rect.bottom + curPort->top - 1; + int32 curToLeft, curToRight, a_set, b_set; // Translate coordinates, if required (needed for Macintosh 480x300) _screen->vectorAdjustCoordinate(&borderLeft, &borderTop); diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 24b6569f041..486f6530dee 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -980,12 +980,12 @@ struct UpScaledAdjust { int denominator; }; -void GfxScreen::adjustToUpscaledCoordinates(int16 &y, int16 &x) { +void GfxScreen::adjustToUpscaledCoordinates(int32 &y, int32 &x) { x = _upscaledWidthMapping[x]; y = _upscaledHeightMapping[y]; } -void GfxScreen::adjustBackUpscaledCoordinates(int16 &y, int16 &x) { +void GfxScreen::adjustBackUpscaledCoordinates(int32 &y, int32 &x) { switch (_upscaledHires) { case GFX_SCREEN_UPSCALED_480x300: x = (x * 4) / 6; diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index 7311232ee96..c9d5af0afd7 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -128,8 +128,8 @@ public: void scale2x(const SciSpan &src, SciSpan &dst, int16 srcWidth, int16 srcHeight, byte bytesPerPixel = 1); - void adjustToUpscaledCoordinates(int16 &y, int16 &x); - void adjustBackUpscaledCoordinates(int16 &y, int16 &x); + void adjustToUpscaledCoordinates(int32 &y, int32 &x); + void adjustBackUpscaledCoordinates(int32 &y, int32 &x); void dither(bool addToFlag); @@ -459,7 +459,7 @@ public: return vectorGetPixel(_controlScreen, x, y); } - void vectorAdjustCoordinate(int16 *x, int16 *y) { + void vectorAdjustCoordinate(int32 *x, int32 *y) { switch (_upscaledHires) { case GFX_SCREEN_UPSCALED_480x300: *x = (*x * 3) / 2; diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index f354e6f048d..cf36873eab6 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -367,7 +367,7 @@ int16 GfxText16::GetLongest(const char *&textPtr, int16 maxWidth, GuiResourceId return resultCharCount; } -void GfxText16::Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight, bool restoreFont) { +void GfxText16::Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int32 &textWidth, int32 &textHeight, bool restoreFont) { uint16 curChar; GuiResourceId previousFontId = GetFontId(); int16 previousPenColor = _ports->_curPort->penClr; @@ -412,7 +412,7 @@ void GfxText16::Width(const char *text, int16 from, int16 len, GuiResourceId org return; } -void GfxText16::StringWidth(const Common::String &str, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight) { +void GfxText16::StringWidth(const Common::String &str, GuiResourceId orgFontId, int32 &textWidth, int32 &textHeight) { Width(str.c_str(), 0, str.size(), orgFontId, textWidth, textHeight, true); } @@ -423,12 +423,12 @@ void GfxText16::DrawString(const Common::String &str, GuiResourceId orgFontId, i Draw(str.c_str(), 0, str.size(), orgFontId, orgPenColor); } -int16 GfxText16::Size(Common::Rect &rect, const char *text, uint16 languageSplitter, GuiResourceId fontId, int16 maxWidth) { +int16 GfxText16::Size(Common::Rect &rect, const char *text, uint16 languageSplitter, GuiResourceId fontId, int32 maxWidth) { GuiResourceId previousFontId = GetFontId(); int16 previousPenColor = _ports->_curPort->penClr; int16 charCount; - int16 maxTextWidth = 0, textWidth; - int16 totalHeight = 0, textHeight; + int32 maxTextWidth = 0, textWidth; + int32 totalHeight = 0, textHeight; if (fontId != -1) SetFont(fontId); @@ -538,7 +538,7 @@ void GfxText16::Show(const char *text, int16 from, int16 len, GuiResourceId orgF // Draws a text in rect. void GfxText16::Box(const char *text, uint16 languageSplitter, bool show, const Common::Rect &rect, TextAlignment alignment, GuiResourceId fontId) { - int16 textWidth, maxTextWidth, textHeight, charCount; + int32 textWidth, maxTextWidth, textHeight, charCount; int16 offset = 0; int16 hline = 0; GuiResourceId previousFontId = GetFontId(); diff --git a/engines/sci/graphics/text16.h b/engines/sci/graphics/text16.h index 1f53c5b4b0c..98647314005 100644 --- a/engines/sci/graphics/text16.h +++ b/engines/sci/graphics/text16.h @@ -52,11 +52,11 @@ public: void ClearChar(int16 chr); int16 GetLongest(const char *&text, int16 maxWidth, GuiResourceId orgFontId); - void Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight, bool restoreFont); - void StringWidth(const Common::String &str, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight); + void Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int32 &textWidth, int32 &textHeight, bool restoreFont); + void StringWidth(const Common::String &str, GuiResourceId orgFontId, int32 &textWidth, int32 &textHeight); void ShowString(const Common::String &str, GuiResourceId orgFontId, int16 orgPenColor); void DrawString(const Common::String &str, GuiResourceId orgFontId, int16 orgPenColor); - int16 Size(Common::Rect &rect, const char *text, uint16 textLanguage, GuiResourceId fontId, int16 maxWidth); + int16 Size(Common::Rect &rect, const char *text, uint16 textLanguage, GuiResourceId fontId, int32 maxWidth); void Draw(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor); void Show(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor); void Box(const char *text, uint16 languageSplitter, bool show, const Common::Rect &rect, TextAlignment alignment, GuiResourceId fontId); diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index 96ed3eacb6f..dc429f49873 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -462,7 +462,7 @@ void GfxTransitions::straight(int16 number, bool blackoutFlag) { } } -void GfxTransitions::scrollCopyOldToScreen(Common::Rect screenRect, int16 x, int16 y) { +void GfxTransitions::scrollCopyOldToScreen(Common::Rect screenRect, int32 x, int32 y) { if (_screen->getUpscaledHires()) { _screen->adjustToUpscaledCoordinates(screenRect.top, screenRect.left); _screen->adjustToUpscaledCoordinates(screenRect.bottom, screenRect.right); diff --git a/engines/sci/graphics/transitions.h b/engines/sci/graphics/transitions.h index d02121e7fa1..c7ffcb9d313 100644 --- a/engines/sci/graphics/transitions.h +++ b/engines/sci/graphics/transitions.h @@ -80,7 +80,7 @@ private: void pixelation(bool blackoutFlag); void blocks(bool blackoutFlag); void straight(int16 number, bool blackoutFlag); - void scrollCopyOldToScreen(Common::Rect screenRect, int16 x, int16 y); + void scrollCopyOldToScreen(Common::Rect screenRect, int32 x, int32 y); void scroll(int16 number); void verticalRollFromCenter(bool blackoutFlag); void verticalRollToCenter(bool blackoutFlag); diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 095804e13c8..d362c4bf7d8 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -805,8 +805,8 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const const Palette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette; const CelInfo *celInfo = getCelInfo(loopNo, celNo); const SciSpan &bitmap = getBitmap(loopNo, celNo); - const int16 celHeight = celInfo->height; - const int16 celWidth = celInfo->width; + const int32 celHeight = celInfo->height; + const int32 celWidth = celInfo->width; const byte clearKey = celInfo->clearKey; const byte drawMask = priority > 15 ? GFX_SCREEN_MASK_VISUAL : GFX_SCREEN_MASK_VISUAL|GFX_SCREEN_MASK_PRIORITY; @@ -814,8 +814,8 @@ void GfxView::draw(const Common::Rect &rect, const Common::Rect &clipRect, const // Merge view palette in... _palette->set(&_viewPalette, false); - const int16 width = MIN(clipRect.width(), celWidth); - const int16 height = MIN(clipRect.height(), celHeight); + const int32 width = MIN(clipRect.width(), celWidth); + const int32 height = MIN(clipRect.height(), celHeight); if (!width || !height) { return; @@ -886,11 +886,11 @@ void GfxView::drawScaled(const Common::Rect &rect, const Common::Rect &clipRect, createScalingTable(scalingX, celWidth, _screen->getWidth(), scaleX); createScalingTable(scalingY, celHeight, _screen->getHeight(), scaleY); - int16 scaledWidth = MIN(clipRect.width(), (int16)scalingX.size()); - int16 scaledHeight = MIN(clipRect.height(), (int16)scalingY.size()); + int32 scaledWidth = MIN(clipRect.width(), (int32)scalingX.size()); + int32 scaledHeight = MIN(clipRect.height(), (int32)scalingY.size()); - const int16 offsetY = clipRect.top - rect.top; - const int16 offsetX = clipRect.left - rect.left; + const int32 offsetY = clipRect.top - rect.top; + const int32 offsetX = clipRect.left - rect.left; const byte *bitmapData = bitmap.getUnsafeDataAt(0, celWidth * celHeight); for (int y = 0; y < scaledHeight; y++) { @@ -930,11 +930,11 @@ void GfxView::createScalingTable(Common::Array &table, int16 celSize, ui } } -void GfxView::adjustToUpscaledCoordinates(int16 &y, int16 &x) { +void GfxView::adjustToUpscaledCoordinates(int32 &y, int32 &x) { _screen->adjustToUpscaledCoordinates(y, x); } -void GfxView::adjustBackUpscaledCoordinates(int16 &y, int16 &x) { +void GfxView::adjustBackUpscaledCoordinates(int32 &y, int32 &x) { _screen->adjustBackUpscaledCoordinates(y, x); } diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h index de62b36eb05..3d44786f8d2 100644 --- a/engines/sci/graphics/view.h +++ b/engines/sci/graphics/view.h @@ -78,8 +78,8 @@ public: bool isScaleable(); - void adjustToUpscaledCoordinates(int16 &y, int16 &x); - void adjustBackUpscaledCoordinates(int16 &y, int16 &x); + void adjustToUpscaledCoordinates(int32 &y, int32 &x); + void adjustBackUpscaledCoordinates(int32 &y, int32 &x); private: void initData(GuiResourceId resourceId); diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 364a51092e3..a0e98f47dbe 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -1806,7 +1806,7 @@ AdjustBoxResult Actor_v2::adjustXYToBeInBox(const int dstX, const int dstY) { AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY) { const uint thresholdTable[] = { 30, 80, 0 }; AdjustBoxResult abr; - int16 tmpX, tmpY; + int32 tmpX, tmpY; int tmpDist, bestDist, threshold, numBoxes; byte flags, bestBox; int box; diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp index 0b5f5d6b3d0..0410c90f300 100644 --- a/engines/scumm/boxes.cpp +++ b/engines/scumm/boxes.cpp @@ -643,7 +643,7 @@ BoxCoords ScummEngine::getBoxCoordinates(int boxnum) { return *box; } -int getClosestPtOnBox(const BoxCoords &box, int x, int y, int16& outX, int16& outY) { +int getClosestPtOnBox(const BoxCoords &box, int x, int y, int32 &outX, int32 &outY) { const Common::Point p(x, y); Common::Point tmp; uint dist; diff --git a/engines/scumm/boxes.h b/engines/scumm/boxes.h index 4fd1947848a..8c409a7df36 100644 --- a/engines/scumm/boxes.h +++ b/engines/scumm/boxes.h @@ -49,7 +49,7 @@ struct BoxCoords { /* Box coordinates */ Common::Point lr; }; -int getClosestPtOnBox(const BoxCoords &box, int x, int y, int16& outX, int16& outY); +int getClosestPtOnBox(const BoxCoords &box, int x, int y, int32 & outX, int32 & outY); } // End of namespace Scumm diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index f55cc6ea1a0..7778cec67d9 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -2091,7 +2091,7 @@ void Wiz::drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, i bbox[3].x = 0; bbox[3].y = wizH - 1; - int16 xmin_p, xmax_p, ymin_p, ymax_p; + int32 xmin_p, xmax_p, ymin_p, ymax_p; xmin_p = ymin_p = (int16)0x7FFF; xmax_p = ymax_p = (int16)0x8000; @@ -2102,7 +2102,7 @@ void Wiz::drawWizPolygonImage(uint8 *dst, const uint8 *src, const uint8 *mask, i ymax_p = MAX(wp[i].y, ymax_p); } - int16 xmin_b, xmax_b, ymin_b, ymax_b; + int32 xmin_b, xmax_b, ymin_b, ymax_b; xmin_b = ymin_b = (int16)0x7FFF; xmax_b = ymax_b = (int16)0x8000; diff --git a/engines/scumm/verbs.h b/engines/scumm/verbs.h index f4aafb7636c..bc037418228 100644 --- a/engines/scumm/verbs.h +++ b/engines/scumm/verbs.h @@ -56,7 +56,7 @@ struct VerbSlot { bool center; uint8 prep; uint16 imgindex; - int16 origLeft; + int32 origLeft; }; enum VerbsV0 { diff --git a/engines/sherlock/events.cpp b/engines/sherlock/events.cpp index 39208d45fe3..002cd8098ba 100644 --- a/engines/sherlock/events.cpp +++ b/engines/sherlock/events.cpp @@ -154,7 +154,7 @@ void Events::setCursor(CursorId cursorId, const Common::Point &cursorPos, const s.SHblitFrom(surface, Common::Point(drawPos.x, drawPos.y)); // Draw the cursor image - drawPos = Common::Point(MAX(cursorPt.x, (int16)0), MAX(cursorPt.y, (int16)0)); + drawPos = Common::Point(MAX(cursorPt.x, (int32)0), MAX(cursorPt.y, (int32)0)); s.SHtransBlitFrom(cursorImg, Common::Point(drawPos.x, drawPos.y)); // Set up hotspot position for cursor, adjusting for cursor image's position within the surface diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp index fdc6a02b47f..71bebfc0905 100644 --- a/engines/sherlock/screen.cpp +++ b/engines/sherlock/screen.cpp @@ -204,8 +204,8 @@ void Screen::slamRect(const Common::Rect &r) { } } -void Screen::flushImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp, - int16 *width_, int16 *height_) { +void Screen::flushImage(ImageFrame *frame, const Common::Point &pt, int32 *xp, int32 *yp, + int32 *width_, int32 *height_) { Common::Point imgPos = pt + frame->_offset; Common::Rect newBounds(imgPos.x, imgPos.y, imgPos.x + frame->_frame.w, imgPos.y + frame->_frame.h); Common::Rect oldBounds(*xp, *yp, *xp + *width_, *yp + *height_); @@ -232,8 +232,8 @@ void Screen::flushImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, i *height_ = newBounds.height(); } -void Screen::flushScaleImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp, - int16 *width_, int16 *height_, int scaleVal) { +void Screen::flushScaleImage(ImageFrame *frame, const Common::Point &pt, int32 *xp, int32 *yp, + int32 *width_, int32 *height_, int scaleVal) { Common::Point imgPos(pt.x + frame->sDrawXOffset(scaleVal), pt.y + frame->sDrawYOffset(scaleVal)); Common::Rect newBounds(imgPos.x, imgPos.y, imgPos.x + frame->sDrawXSize(scaleVal), imgPos.y + frame->sDrawYSize(scaleVal)); diff --git a/engines/sherlock/screen.h b/engines/sherlock/screen.h index 93df9aeaaab..13625425ecf 100644 --- a/engines/sherlock/screen.h +++ b/engines/sherlock/screen.h @@ -132,15 +132,15 @@ public: * Copy an image from the back buffer to the screen, taking care of both the * new area covered by the shape as well as the old area, which must be restored */ - void flushImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp, - int16 *width, int16 *height); + void flushImage(ImageFrame *frame, const Common::Point &pt, int32 *xp, int32 *yp, + int32 *width, int32 *height); /** * Similar to flushImage, this method takes in an extra parameter for the scale proporation, * which affects the calculated bounds accordingly */ - void flushScaleImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp, - int16 *width, int16 *height, int scaleVal); + void flushScaleImage(ImageFrame *frame, const Common::Point &pt, int32 *xp, int32 *yp, + int32 *width, int32 *height, int scaleVal); /** * Variation of flushImage/flushScaleImage that takes in and updates a rect diff --git a/engines/touche/saveload.cpp b/engines/touche/saveload.cpp index 36ffcc1d9ca..0257f89918a 100644 --- a/engines/touche/saveload.cpp +++ b/engines/touche/saveload.cpp @@ -46,10 +46,18 @@ static void saveOrLoad(Common::WriteStream &stream, int16 &i) { stream.writeSint16LE(i); } +static void saveOrLoad(Common::WriteStream &stream, int32 &i) { + stream.writeSint16LE(i); +} + static void saveOrLoad(Common::ReadStream &stream, int16 &i) { i = stream.readSint16LE(); } +static void saveOrLoad(Common::ReadStream &stream, int32 &i) { + i = stream.readSint16LE(); +} + static void saveOrLoadPtr(Common::WriteStream &stream, int16 *&p, int16 *base) { int32 offset = (int32)(p - base); stream.writeSint32LE(offset); diff --git a/engines/tsage/blue_force/blueforce_dialogs.cpp b/engines/tsage/blue_force/blueforce_dialogs.cpp index e91034a3fab..7d61a1947d0 100644 --- a/engines/tsage/blue_force/blueforce_dialogs.cpp +++ b/engines/tsage/blue_force/blueforce_dialogs.cpp @@ -511,7 +511,7 @@ OptionsDialog::OptionsDialog() { // Set all the buttons to the widest button GfxButton *btnList[6] = {&_btnRestore, &_btnSave, &_btnRestart, &_btnQuit, &_btnSound, &_btnResume}; - int16 btnWidth = 0; + int32 btnWidth = 0; for (int idx = 0; idx < 6; ++idx) btnWidth = MAX(btnWidth, btnList[idx]->_bounds.width()); for (int idx = 0; idx < 6; ++idx) diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index dfaf99f2e23..bd51b9e5ab2 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -2841,7 +2841,7 @@ GfxSurface SceneObject::getFrame() { void SceneObject::reposition() { if (g_vm->getGameID() == GType_Ringworld2) { if (!(_flags & OBJFLAG_ZOOMED)) { - setZoom(g_globals->_sceneManager._scene->_zoomPercents[MIN(_position.y, (int16)255)]); + setZoom(g_globals->_sceneManager._scene->_zoomPercents[MIN(_position.y, (int32)255)]); } } diff --git a/engines/tsage/ringworld/ringworld_dialogs.cpp b/engines/tsage/ringworld/ringworld_dialogs.cpp index afb600fd1cb..7c9af997b12 100644 --- a/engines/tsage/ringworld/ringworld_dialogs.cpp +++ b/engines/tsage/ringworld/ringworld_dialogs.cpp @@ -282,7 +282,7 @@ OptionsDialog::OptionsDialog() { // Set all the buttons to the widest button GfxButton *btnList[6] = {&_btnRestore, &_btnSave, &_btnRestart, &_btnQuit, &_btnSound, &_btnResume}; - int16 btnWidth = 0; + int32 btnWidth = 0; for (int idx = 0; idx < 6; ++idx) btnWidth = MAX(btnWidth, btnList[idx]->_bounds.width()); for (int idx = 0; idx < 6; ++idx) diff --git a/engines/ultima/shared/core/map.cpp b/engines/ultima/shared/core/map.cpp index 807a7007d52..68272e75f4c 100644 --- a/engines/ultima/shared/core/map.cpp +++ b/engines/ultima/shared/core/map.cpp @@ -144,8 +144,8 @@ void Map::MapBase::shiftViewport(const Point &delta) { topLeft += delta; // Shift the viewport, but constraining the map to fill up the screen - topLeft.x = CLIP(topLeft.x, (int16)0, (int16)(width() - _viewportPos._size.x)); - topLeft.y = CLIP(topLeft.y, (int16)0, (int16)(height() - _viewportPos._size.y)); + topLeft.x = CLIP(topLeft.x, (int32)0, (int32)(width() - _viewportPos._size.x)); + topLeft.y = CLIP(topLeft.y, (int32)0, (int32)(height() - _viewportPos._size.y)); } void Map::MapBase::addWidget(MapWidget *widget) { diff --git a/engines/ultima/shared/maps/map_base.cpp b/engines/ultima/shared/maps/map_base.cpp index d51e378929b..b94f84526f0 100644 --- a/engines/ultima/shared/maps/map_base.cpp +++ b/engines/ultima/shared/maps/map_base.cpp @@ -156,8 +156,8 @@ void MapBase::shiftViewport(const Point &delta) { topLeft += delta; // Shift the viewport, but constraining the map to fill up the screen - topLeft.x = CLIP(topLeft.x, (int16)0, (int16)(width() - _viewportPos._size.x)); - topLeft.y = CLIP(topLeft.y, (int16)0, (int16)(height() - _viewportPos._size.y)); + topLeft.x = CLIP(topLeft.x, (int32)0, (int32)(width() - _viewportPos._size.x)); + topLeft.y = CLIP(topLeft.y, (int32)0, (int32)(height() - _viewportPos._size.y)); } void MapBase::addWidget(MapWidget *widget) { diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index 7a57501a7cd..744da5aa05f 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -195,7 +195,7 @@ bool Design::isPointOpaque(int x, int y) { return pixel != kColorGreen; } -void Design::adjustBounds(int16 x, int16 y) { +void Design::adjustBounds(int32 x, int32 y) { _bounds->right = MAX(x, _bounds->right); _bounds->bottom = MAX(y, _bounds->bottom); } diff --git a/engines/wage/design.h b/engines/wage/design.h index 7ed70ff9de1..ec3a69f23a6 100644 --- a/engines/wage/design.h +++ b/engines/wage/design.h @@ -83,7 +83,7 @@ public: static void drawVLine(Graphics::ManagedSurface *surface, int x, int y1, int y2, int thickness, int color, Graphics::MacPatterns &patterns, byte fillType); bool isBoundsCalculation() { return _boundsCalculationMode; } - void adjustBounds(int16 x, int16 y); + void adjustBounds(int32 x, int32 y); private: byte *_data; diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp index 35c9ac1467f..ac653e8591e 100644 --- a/engines/xeen/sprites.cpp +++ b/engines/xeen/sprites.cpp @@ -370,7 +370,7 @@ void SpriteDrawer::draw(XSurface &dest, uint16 offset, const Common::Point &pt, (flags & SPRFLAG_SCENE_CLIPPED) ? SCENE_CLIP_LEFT : clipRect.left, destPos.y); _destRight = (byte *)dest.getBasePtr( (flags & SPRFLAG_SCENE_CLIPPED) ? SCENE_CLIP_RIGHT : clipRect.right, destPos.y); - int16 xp = destPos.x; + int32 xp = destPos.x; lineP = &tempLine[SCREEN_WIDTH]; for (int xCtr = 0; xCtr < width; ++xCtr, ++lineP) { diff --git a/graphics/macgui/macwindowmanager.cpp b/graphics/macgui/macwindowmanager.cpp index 49a4a42dded..4f2a4c397ac 100644 --- a/graphics/macgui/macwindowmanager.cpp +++ b/graphics/macgui/macwindowmanager.cpp @@ -765,7 +765,7 @@ void MacWindowManager::draw() { } adjustDimensions(clip, innerDims, adjWidth, adjHeight); - g_system->copyRectToScreen(w->getWindowSurface()->getBasePtr(MAX(clip.left - innerDims.left, 0), MAX(clip.top - innerDims.top, 0)), w->getWindowSurface()->pitch,MAX(innerDims.left, (int16)0), MAX(innerDims.top, (int16)0), adjWidth, adjHeight); + g_system->copyRectToScreen(w->getWindowSurface()->getBasePtr(MAX(clip.left - innerDims.left, 0), MAX(clip.top - innerDims.top, 0)), w->getWindowSurface()->pitch,MAX(innerDims.left, (int32)0), MAX(innerDims.top, (int32)0), adjWidth, adjHeight); dirtyRects.push_back(clip); } diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 8ec8ac4b269..966b709030f 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -1163,7 +1163,7 @@ void ThemeEngine::drawSlider(const Common::Rect &r, int width, WidgetStateInfo s dd = kDDSliderDisabled; Common::Rect r2 = r; - r2.setWidth(MIN((int16)width, r.width())); + r2.setWidth(MIN((int32)width, r.width())); // r2.top++; r2.bottom--; r2.left++; r2.right--; if (rtl) {