From 7c33862a099ffe9cfe308183ca6cd8e16f23b804 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Thu, 24 Dec 2015 00:41:53 +0200 Subject: LAB: The second parameter of fade() is always 0 --- engines/lab/dispman.cpp | 14 +++++++------- engines/lab/dispman.h | 2 +- engines/lab/intro.cpp | 20 ++++++++++---------- engines/lab/map.cpp | 30 +++++++++++++++--------------- engines/lab/special.cpp | 12 ++++++------ 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp index 8def025629..f490503145 100644 --- a/engines/lab/dispman.cpp +++ b/engines/lab/dispman.cpp @@ -981,19 +981,19 @@ uint16 DisplayMan::fadeNumOut(uint16 num, uint16 res, uint16 counter) { return (num - ((((int32) counter) * ((int32)(num - res))) / 15)); } -void DisplayMan::fade(bool fadeIn, uint16 res) { +void DisplayMan::fade(bool fadeIn) { uint16 newPal[16]; for (int i = 0; i < 16; i++) { for (int palIdx = 0; palIdx < 16; palIdx++) { if (fadeIn) - newPal[palIdx] = (0x00F & fadeNumIn(0x00F & _fadePalette[palIdx], 0x00F & res, i)) + - (0x0F0 & fadeNumIn(0x0F0 & _fadePalette[palIdx], 0x0F0 & res, i)) + - (0xF00 & fadeNumIn(0xF00 & _fadePalette[palIdx], 0xF00 & res, i)); + newPal[palIdx] = (0x00F & fadeNumIn(0x00F & _fadePalette[palIdx], 0, i)) + + (0x0F0 & fadeNumIn(0x0F0 & _fadePalette[palIdx], 0, i)) + + (0xF00 & fadeNumIn(0xF00 & _fadePalette[palIdx], 0, i)); else - newPal[palIdx] = (0x00F & fadeNumOut(0x00F & _fadePalette[palIdx], 0x00F & res, i)) + - (0x0F0 & fadeNumOut(0x0F0 & _fadePalette[palIdx], 0x0F0 & res, i)) + - (0xF00 & fadeNumOut(0xF00 & _fadePalette[palIdx], 0xF00 & res, i)); + newPal[palIdx] = (0x00F & fadeNumOut(0x00F & _fadePalette[palIdx], 0, i)) + + (0x0F0 & fadeNumOut(0x0F0 & _fadePalette[palIdx], 0, i)) + + (0xF00 & fadeNumOut(0xF00 & _fadePalette[palIdx], 0, i)); } setAmigaPal(newPal); diff --git a/engines/lab/dispman.h b/engines/lab/dispman.h index 4be5e69fbb..3761e31be9 100644 --- a/engines/lab/dispman.h +++ b/engines/lab/dispman.h @@ -252,7 +252,7 @@ public: * Scrolls the display in the y direction by blitting. */ void scrollDisplayY(int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte *buffer); - void fade(bool fadein, uint16 res); + void fade(bool fadein); /** * Closes a font and frees all memory associated with it. diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp index 1b4310ac07..d8612764e7 100644 --- a/engines/lab/intro.cpp +++ b/engines/lab/intro.cpp @@ -88,7 +88,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is if (begin) begin = false; else if (isScreen) - _vm->_graphics->fade(false, 0); + _vm->_graphics->fade(false); int charDrawn = 0; if (isScreen) { @@ -96,7 +96,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is _vm->_graphics->rectFillScaled(10, 10, 310, 190); charDrawn = _vm->_graphics->flowText(msgFont, (!_vm->_isHiRes) * -1, 5, 7, false, false, true, true, _vm->_utils->vgaRectScale(14, 11, 306, 189), (char *)curText); - _vm->_graphics->fade(true, 0); + _vm->_graphics->fade(true); } else charDrawn = _vm->_graphics->longDrawMessage(Common::String((char *)curText), false); @@ -108,7 +108,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is if (_quitIntro) { if (isScreen) - _vm->_graphics->fade(false, 0); + _vm->_graphics->fade(false); delete[] textBuffer; return; @@ -132,7 +132,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is if (elapsedSeconds > timeDelay) { if (doneFl) { if (isScreen) - _vm->_graphics->fade(false, 0); + _vm->_graphics->fade(false); delete[] textBuffer; return; @@ -150,7 +150,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is _quitIntro = true; if (isScreen) - _vm->_graphics->fade(false, 0); + _vm->_graphics->fade(false); delete[] textBuffer; return; @@ -158,7 +158,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is if (msgClass == kMessageLeftClick) { if (doneFl) { if (isScreen) - _vm->_graphics->fade(false, 0); + _vm->_graphics->fade(false); delete[] textBuffer; return; @@ -170,7 +170,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is if (_quitIntro) { if (isScreen) - _vm->_graphics->fade(false, 0); + _vm->_graphics->fade(false); delete[] textBuffer; return; @@ -179,7 +179,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is if (doneFl) { if (isScreen) - _vm->_graphics->fade(false, 0); + _vm->_graphics->fade(false); delete[] textBuffer; return; @@ -269,7 +269,7 @@ void Intro::introSequence() { } _vm->updateMusicAndEvents(); - _vm->_graphics->fade(true, 0); + _vm->_graphics->fade(true); for (int times = 0; times < 150; times++) { if (_quitIntro) @@ -287,7 +287,7 @@ void Intro::introSequence() { _vm->waitTOF(); } - _vm->_graphics->fade(false, 0); + _vm->_graphics->fade(false); _vm->_graphics->blackAllScreen(); _vm->updateMusicAndEvents(); diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp index 082925a3fc..21b0804e66 100644 --- a/engines/lab/map.cpp +++ b/engines/lab/map.cpp @@ -333,7 +333,7 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad _event->mouseHide(); if (fadeOut) - _graphics->fade(false, 0); + _graphics->fade(false); _graphics->setPen(0); _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1); @@ -385,7 +385,7 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad _graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 148, 134, 186), _rooms[curMsg]._roomMsg.c_str()); if (fadeIn) - _graphics->fade(true, 0); + _graphics->fade(true); _event->mouseShow(); } @@ -452,18 +452,18 @@ void LabEngine::processMap(uint16 curRoom) { uint16 upperFloor = getUpperFloor(curFloor); if (upperFloor != kFloorNone) { curFloor = upperFloor; - _graphics->fade(false, 0); + _graphics->fade(false); drawMap(curRoom, curMsg, curFloor, false, false); - _graphics->fade(true, 0); + _graphics->fade(true); } } else if (msgCode == 2) { // Down arrow uint16 lowerFloor = getLowerFloor(curFloor); if (lowerFloor != kFloorNone) { curFloor = lowerFloor; - _graphics->fade(false, 0); + _graphics->fade(false); drawMap(curRoom, curMsg, curFloor, false, false); - _graphics->fade(true, 0); + _graphics->fade(true); } } } else if (msgClass == kMessageLeftClick) { @@ -471,30 +471,30 @@ void LabEngine::processMap(uint16 curRoom) { && floorVisited(kFloorSurMaze)) { curFloor = kFloorSurMaze; - _graphics->fade(false, 0); + _graphics->fade(false); drawMap(curRoom, curMsg, curFloor, false, false); - _graphics->fade(true, 0); + _graphics->fade(true); } else if ((curFloor == kFloorMiddle) && _utils->mapRectScale(358, 71, 452, 147).contains(mouseX, mouseY) && floorVisited(kFloorCarnival)) { curFloor = kFloorCarnival; - _graphics->fade(false, 0); + _graphics->fade(false); drawMap(curRoom, curMsg, curFloor, false, false); - _graphics->fade(true, 0); + _graphics->fade(true); } else if ((curFloor == kFloorMiddle) && _utils->mapRectScale(557, 325, 653, 401).contains(mouseX, mouseY) && floorVisited(kFloorMedMaze)) { curFloor = kFloorMedMaze; - _graphics->fade(false, 0); + _graphics->fade(false); drawMap(curRoom, curMsg, curFloor, false, false); - _graphics->fade(true, 0); + _graphics->fade(true); } else if ((curFloor == kFloorUpper) && _utils->mapRectScale(524, 97, 645, 207).contains(mouseX, mouseY) && floorVisited(kFloorHedgeMaze)) { curFloor = kFloorHedgeMaze; - _graphics->fade(false, 0); + _graphics->fade(false); drawMap(curRoom, curMsg, curFloor, false, false); - _graphics->fade(true, 0); + _graphics->fade(true); } else if (mouseX > _utils->mapScaleX(314)) { uint16 oldMsg = curMsg; Common::Rect curCoords; @@ -563,7 +563,7 @@ void LabEngine::doMap(uint16 curRoom) { _graphics->screenUpdate(); processMap(curRoom); _event->attachButtonList(nullptr); - _graphics->fade(false, 0); + _graphics->fade(false); _graphics->blackAllScreen(); _event->mouseHide(); _graphics->setPen(0); diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp index 7dd42dcf9b..cdbaa7b5bc 100644 --- a/engines/lab/special.cpp +++ b/engines/lab/special.cpp @@ -213,7 +213,7 @@ void LabEngine::drawJournal(uint16 wipenum, bool needFade) { _event->toggleButton(_event->getButton(2), 15, (!_lastPage)); // forward button if (needFade) - _graphics->fade(true, 0); + _graphics->fade(true); // Reset the journal background, so that all the text that has been blitted on it is erased memcpy(_journalBackImage->_imageData, _blankJournal, _graphics->_screenWidth * _graphics->_screenHeight); @@ -276,7 +276,7 @@ void LabEngine::doJournal() { _event->mouseShow(); processJournal(); _event->attachButtonList(nullptr); - _graphics->fade(false, 0); + _graphics->fade(false); _event->mouseHide(); delete[] _blankJournal; @@ -370,9 +370,9 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is _monitorTextFilename = test; Common::String text = _resource->getText(_monitorTextFilename); - _graphics->fade(false, 0); + _graphics->fade(false); drawMonText(text.c_str(), monitorFont, textRect, isInteractive); - _graphics->fade(true, 0); + _graphics->fade(true); } } @@ -463,9 +463,9 @@ void LabEngine::doMonitor(const Common::String background, const Common::String _graphics->loadBackPict(background, _highPalette); drawMonText(ntext.c_str(), monitorFont, scaledRect, isinteractive); _event->mouseShow(); - _graphics->fade(true, 0); + _graphics->fade(true); processMonitor(ntext.c_str(), monitorFont, isinteractive, scaledRect); - _graphics->fade(false, 0); + _graphics->fade(false); _event->mouseHide(); _graphics->closeFont(&monitorFont); -- cgit v1.2.3