From fc33d2d7625e3a3967f17b0c01f7bdef1e1dec8b Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 25 Nov 2012 21:25:14 +1100 Subject: [PATCH] HOPKINS: Replaced many occurrences of 640 with SCREEN_WIDTH --- engines/hopkins/anim.cpp | 16 ++++++++-------- engines/hopkins/events.cpp | 14 +++++++------- engines/hopkins/graphics.cpp | 2 +- engines/hopkins/hopkins.cpp | 12 ++++++------ engines/hopkins/objects.cpp | 16 ++++++++-------- engines/hopkins/talk.cpp | 16 ++++++++-------- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp index ee959d169d5..cf69e7164be 100644 --- a/engines/hopkins/anim.cpp +++ b/engines/hopkins/anim.cpp @@ -74,7 +74,7 @@ LABEL_2: _vm->_graphicsManager.Cls_Video(); _vm->_graphicsManager.DD_Unlock(); } - if (_vm->_graphicsManager.WinScan / _vm->_graphicsManager.Winbpp > 640) { + if (_vm->_graphicsManager.WinScan / _vm->_graphicsManager.Winbpp > SCREEN_WIDTH) { hasScreenCopy = true; screenCopy = _vm->_globals.dos_malloc2(0x4B000u); memcpy(screenCopy, v10, 0x4B000u); @@ -88,15 +88,15 @@ LABEL_2: _vm->_graphicsManager.DD_Lock(); if (_vm->_graphicsManager.Winbpp == 2) { if (hasScreenCopy) - _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); else - _vm->_graphicsManager.m_scroll16(v10, 0, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll16(v10, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } if (_vm->_graphicsManager.Winbpp == 1) { if (hasScreenCopy) - _vm->_graphicsManager.m_scroll2A(screenCopy, 0, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll2A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); else - _vm->_graphicsManager.m_scroll2(v10, 0, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll2(v10, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } _vm->_graphicsManager.DD_Unlock(); _vm->_graphicsManager.DD_VBL(); @@ -151,9 +151,9 @@ LABEL_38: if (*v10 != kByteStop) { _vm->_graphicsManager.Copy_WinScan_Vbe3(v10, screenCopy); if (_vm->_graphicsManager.Winbpp == 2) - _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll16A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); else - _vm->_graphicsManager.m_scroll2A(screenCopy, 0, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll2A(screenCopy, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } } else if (*v10 != kByteStop) { if (_vm->_graphicsManager.Winbpp == 1) @@ -190,7 +190,7 @@ LABEL_57: _vm->_globals.dos_free2(ptr); f.close(); - if (1 /*hasScreenCopy <= 640 */) + if (1 /*hasScreenCopy <= SCREEN_WIDTH */) goto LABEL_2; goto LABEL_55; } diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index 5dc68064f26..2271bff7b47 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -441,8 +441,8 @@ LABEL_65: } if (_vm->_graphicsManager.SCROLL < 0) _vm->_graphicsManager.SCROLL = 0; - if (_vm->_graphicsManager.SCROLL > 640) - _vm->_graphicsManager.SCROLL = 640; + if (_vm->_graphicsManager.SCROLL > SCREEN_WIDTH) + _vm->_graphicsManager.SCROLL = SCREEN_WIDTH; if (_vm->_graphicsManager.SDL_ECHELLE) v4 = _vm->_graphicsManager.Magic_Number(_vm->_graphicsManager.SCROLL); else @@ -455,10 +455,10 @@ LABEL_65: if (_vm->_graphicsManager.SDL_ECHELLE) { if (_vm->_graphicsManager.Winbpp == 2) { int v5 = _vm->_graphicsManager.Reel_Zoom(0x14u, _vm->_graphicsManager.SDL_ECHELLE); - _vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, v4, 20, 640, 440, 0, v5); + _vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_BUFFER, v4, 20, SCREEN_WIDTH, 440, 0, v5); } else { int v6 = _vm->_graphicsManager.Reel_Zoom(0x14u, _vm->_graphicsManager.SDL_ECHELLE); - _vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_BUFFER, v4, 20, 640, 440, 0, v6); + _vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_BUFFER, v4, 20, SCREEN_WIDTH, 440, 0, v6); } _vm->_graphicsManager.DD_Unlock(); _vm->_graphicsManager.dstrect[0].left = _vm->_graphicsManager.Reel_Zoom(0, _vm->_graphicsManager.SDL_ECHELLE); @@ -467,11 +467,11 @@ LABEL_65: _vm->_graphicsManager.dstrect[0].setHeight(_vm->_graphicsManager.Reel_Zoom(0x1B8u, _vm->_graphicsManager.SDL_ECHELLE)); } else { if (_vm->_graphicsManager.Winbpp == 2) - _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, v4, 20, 640, 440, 0, 20); + _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_BUFFER, v4, 20, SCREEN_WIDTH, 440, 0, 20); else - _vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, v4, 20, 640, 440, 0, 20); + _vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_BUFFER, v4, 20, SCREEN_WIDTH, 440, 0, 20); _vm->_graphicsManager.DD_Unlock(); - _vm->_graphicsManager.dstrect[0] = Common::Rect(0, 20, 640, 460); + _vm->_graphicsManager.dstrect[0] = Common::Rect(0, 20, SCREEN_WIDTH, 460); } // CHECKME: Useless? diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index a5d97683191..3b204ba057c 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -1207,7 +1207,7 @@ void GraphicsManager::Copy_Video_Vbe16(const byte *srcData) { } } - if (destOffset > 640 * 480) { + if (destOffset > SCREEN_WIDTH * SCREEN_HEIGHT) { warning("HACK: Stopping anim, out of bounds - 0x%x %d", srcByte, destOffset); return; } diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 190a6ad679b..dc9db140bfb 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -1349,7 +1349,7 @@ LABEL_243: _globals.PERSO = _fileManager.CHARGE_FICHIER(_globals.NFICHIER); _globals.PERSO_TYPE = 0; _globals.iRegul = 0; - _graphicsManager.nbrligne = 640; + _graphicsManager.nbrligne = SCREEN_WIDTH; break; } } @@ -1402,7 +1402,7 @@ void HopkinsEngine::processIniParams(Common::StringMap &iniParams) { void HopkinsEngine::INIT_SYSTEM() { // Set graphics mode - _graphicsManager.SET_MODE(640, 480); + _graphicsManager.SET_MODE(SCREEN_WIDTH, SCREEN_HEIGHT); // Synchronise the sound settings from ScummVM _soundManager.syncSoundSettings(); @@ -1749,8 +1749,8 @@ void HopkinsEngine::ENDEMO() { } void HopkinsEngine::BOOM() { - _graphicsManager.nbrligne = 640; - _graphicsManager.SCANLINE(640); + _graphicsManager.nbrligne = SCREEN_WIDTH; + _graphicsManager.SCANLINE(SCREEN_WIDTH); _graphicsManager.DD_Lock(); _graphicsManager.Cls_Video(); _graphicsManager.DD_Unlock(); @@ -1875,7 +1875,7 @@ void HopkinsEngine::INCENDIE() { void HopkinsEngine::BASE() { _globals.iRegul = 1; - _graphicsManager.nbrligne = 640; + _graphicsManager.nbrligne = SCREEN_WIDTH; _graphicsManager.DD_Lock(); _graphicsManager.Cls_Video(); _graphicsManager.DD_Unlock(); @@ -2138,7 +2138,7 @@ void HopkinsEngine::JOUE_FIN() { void HopkinsEngine::AVION() { _soundManager.WSOUND(28); _globals.iRegul = 1; - _globals.nbrligne = 640; + _globals.nbrligne = SCREEN_WIDTH; _graphicsManager.DD_Lock(); _graphicsManager.Cls_Video(); _graphicsManager.DD_Unlock(); diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 43c7d163c09..eaca054036d 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -2929,8 +2929,8 @@ LABEL_64: _vm->_graphicsManager.SCROLL = 0; v1 = 1; } - if (_vm->_graphicsManager.SCROLL > 640) { - _vm->_graphicsManager.SCROLL = 640; + if (_vm->_graphicsManager.SCROLL > SCREEN_WIDTH) { + _vm->_graphicsManager.SCROLL = SCREEN_WIDTH; v1 = 1; } if (_vm->_eventsManager.XMOUSE() > _vm->_graphicsManager.SCROLL + 620) { @@ -2948,8 +2948,8 @@ LABEL_64: _vm->_graphicsManager.SCROLL = 0; v1 = 1; } - if (_vm->_graphicsManager.SCROLL > 640) { - _vm->_graphicsManager.SCROLL = 640; + if (_vm->_graphicsManager.SCROLL > SCREEN_WIDTH) { + _vm->_graphicsManager.SCROLL = SCREEN_WIDTH; v1 = 1; } if (_vm->_eventsManager.XMOUSE() < _vm->_graphicsManager.SCROLL + 10) { @@ -4263,15 +4263,15 @@ void ObjectsManager::SPECIAL_JEU() { _vm->_graphicsManager.DD_Lock(); if (_vm->_graphicsManager.Winbpp == 2) { if (_vm->_graphicsManager.SDL_ECHELLE) - _vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); else - _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } if (_vm->_graphicsManager.Winbpp == 1) { if (_vm->_graphicsManager.SDL_ECHELLE) - _vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); else - _vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } _vm->_graphicsManager.DD_Unlock(); v2 = _vm->_graphicsManager.VESA_BUFFER; diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index 0e57e574373..20bf11b13cb 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -165,15 +165,15 @@ void TalkManager::PARLER_PERSO(const Common::String &filename) { _vm->_graphicsManager.DD_LOCK(); if (_vm->_graphicsManager.Winbpp == 2) { if (_vm->_graphicsManager.SDL_ECHELLE) - _vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); else - _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } if (_vm->_graphicsManager.Winbpp == 1) { if (_vm->_graphicsManager.SDL_ECHELLE) - _vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); else - _vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } _vm->_graphicsManager.DD_UNLOCK(); v8 = _vm->_graphicsManager.VESA_BUFFER; @@ -1334,15 +1334,15 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) { _vm->_graphicsManager.DD_Lock(); if (_vm->_graphicsManager.Winbpp == 2) { if (_vm->_graphicsManager.SDL_ECHELLE) - _vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll16A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); else - _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll16(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } if (_vm->_graphicsManager.Winbpp == 1) { if (_vm->_graphicsManager.SDL_ECHELLE) - _vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll2A(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); else - _vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, 640, 480, 0, 0); + _vm->_graphicsManager.m_scroll2(_vm->_graphicsManager.VESA_SCREEN, _vm->_eventsManager.start_x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0); } _vm->_graphicsManager.DD_Unlock(); _vm->_graphicsManager.setpal_vga256(_vm->_graphicsManager.Palette);