LAB: The second parameter of fade() is always 0
This commit is contained in:
parent
a5695f6bfd
commit
7c33862a09
5 changed files with 39 additions and 39 deletions
|
@ -981,19 +981,19 @@ uint16 DisplayMan::fadeNumOut(uint16 num, uint16 res, uint16 counter) {
|
||||||
return (num - ((((int32) counter) * ((int32)(num - res))) / 15));
|
return (num - ((((int32) counter) * ((int32)(num - res))) / 15));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DisplayMan::fade(bool fadeIn, uint16 res) {
|
void DisplayMan::fade(bool fadeIn) {
|
||||||
uint16 newPal[16];
|
uint16 newPal[16];
|
||||||
|
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
for (int palIdx = 0; palIdx < 16; palIdx++) {
|
for (int palIdx = 0; palIdx < 16; palIdx++) {
|
||||||
if (fadeIn)
|
if (fadeIn)
|
||||||
newPal[palIdx] = (0x00F & fadeNumIn(0x00F & _fadePalette[palIdx], 0x00F & res, i)) +
|
newPal[palIdx] = (0x00F & fadeNumIn(0x00F & _fadePalette[palIdx], 0, i)) +
|
||||||
(0x0F0 & fadeNumIn(0x0F0 & _fadePalette[palIdx], 0x0F0 & res, i)) +
|
(0x0F0 & fadeNumIn(0x0F0 & _fadePalette[palIdx], 0, i)) +
|
||||||
(0xF00 & fadeNumIn(0xF00 & _fadePalette[palIdx], 0xF00 & res, i));
|
(0xF00 & fadeNumIn(0xF00 & _fadePalette[palIdx], 0, i));
|
||||||
else
|
else
|
||||||
newPal[palIdx] = (0x00F & fadeNumOut(0x00F & _fadePalette[palIdx], 0x00F & res, i)) +
|
newPal[palIdx] = (0x00F & fadeNumOut(0x00F & _fadePalette[palIdx], 0, i)) +
|
||||||
(0x0F0 & fadeNumOut(0x0F0 & _fadePalette[palIdx], 0x0F0 & res, i)) +
|
(0x0F0 & fadeNumOut(0x0F0 & _fadePalette[palIdx], 0, i)) +
|
||||||
(0xF00 & fadeNumOut(0xF00 & _fadePalette[palIdx], 0xF00 & res, i));
|
(0xF00 & fadeNumOut(0xF00 & _fadePalette[palIdx], 0, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
setAmigaPal(newPal);
|
setAmigaPal(newPal);
|
||||||
|
|
|
@ -252,7 +252,7 @@ public:
|
||||||
* Scrolls the display in the y direction by blitting.
|
* Scrolls the display in the y direction by blitting.
|
||||||
*/
|
*/
|
||||||
void scrollDisplayY(int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte *buffer);
|
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.
|
* Closes a font and frees all memory associated with it.
|
||||||
|
|
|
@ -88,7 +88,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is
|
||||||
if (begin)
|
if (begin)
|
||||||
begin = false;
|
begin = false;
|
||||||
else if (isScreen)
|
else if (isScreen)
|
||||||
_vm->_graphics->fade(false, 0);
|
_vm->_graphics->fade(false);
|
||||||
|
|
||||||
int charDrawn = 0;
|
int charDrawn = 0;
|
||||||
if (isScreen) {
|
if (isScreen) {
|
||||||
|
@ -96,7 +96,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is
|
||||||
_vm->_graphics->rectFillScaled(10, 10, 310, 190);
|
_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);
|
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
|
} else
|
||||||
charDrawn = _vm->_graphics->longDrawMessage(Common::String((char *)curText), false);
|
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 (_quitIntro) {
|
||||||
if (isScreen)
|
if (isScreen)
|
||||||
_vm->_graphics->fade(false, 0);
|
_vm->_graphics->fade(false);
|
||||||
|
|
||||||
delete[] textBuffer;
|
delete[] textBuffer;
|
||||||
return;
|
return;
|
||||||
|
@ -132,7 +132,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is
|
||||||
if (elapsedSeconds > timeDelay) {
|
if (elapsedSeconds > timeDelay) {
|
||||||
if (doneFl) {
|
if (doneFl) {
|
||||||
if (isScreen)
|
if (isScreen)
|
||||||
_vm->_graphics->fade(false, 0);
|
_vm->_graphics->fade(false);
|
||||||
|
|
||||||
delete[] textBuffer;
|
delete[] textBuffer;
|
||||||
return;
|
return;
|
||||||
|
@ -150,7 +150,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is
|
||||||
_quitIntro = true;
|
_quitIntro = true;
|
||||||
|
|
||||||
if (isScreen)
|
if (isScreen)
|
||||||
_vm->_graphics->fade(false, 0);
|
_vm->_graphics->fade(false);
|
||||||
|
|
||||||
delete[] textBuffer;
|
delete[] textBuffer;
|
||||||
return;
|
return;
|
||||||
|
@ -158,7 +158,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is
|
||||||
if (msgClass == kMessageLeftClick) {
|
if (msgClass == kMessageLeftClick) {
|
||||||
if (doneFl) {
|
if (doneFl) {
|
||||||
if (isScreen)
|
if (isScreen)
|
||||||
_vm->_graphics->fade(false, 0);
|
_vm->_graphics->fade(false);
|
||||||
|
|
||||||
delete[] textBuffer;
|
delete[] textBuffer;
|
||||||
return;
|
return;
|
||||||
|
@ -170,7 +170,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is
|
||||||
|
|
||||||
if (_quitIntro) {
|
if (_quitIntro) {
|
||||||
if (isScreen)
|
if (isScreen)
|
||||||
_vm->_graphics->fade(false, 0);
|
_vm->_graphics->fade(false);
|
||||||
|
|
||||||
delete[] textBuffer;
|
delete[] textBuffer;
|
||||||
return;
|
return;
|
||||||
|
@ -179,7 +179,7 @@ void Intro::doPictText(const Common::String filename, TextFont *msgFont, bool is
|
||||||
|
|
||||||
if (doneFl) {
|
if (doneFl) {
|
||||||
if (isScreen)
|
if (isScreen)
|
||||||
_vm->_graphics->fade(false, 0);
|
_vm->_graphics->fade(false);
|
||||||
|
|
||||||
delete[] textBuffer;
|
delete[] textBuffer;
|
||||||
return;
|
return;
|
||||||
|
@ -269,7 +269,7 @@ void Intro::introSequence() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_vm->updateMusicAndEvents();
|
_vm->updateMusicAndEvents();
|
||||||
_vm->_graphics->fade(true, 0);
|
_vm->_graphics->fade(true);
|
||||||
|
|
||||||
for (int times = 0; times < 150; times++) {
|
for (int times = 0; times < 150; times++) {
|
||||||
if (_quitIntro)
|
if (_quitIntro)
|
||||||
|
@ -287,7 +287,7 @@ void Intro::introSequence() {
|
||||||
_vm->waitTOF();
|
_vm->waitTOF();
|
||||||
}
|
}
|
||||||
|
|
||||||
_vm->_graphics->fade(false, 0);
|
_vm->_graphics->fade(false);
|
||||||
_vm->_graphics->blackAllScreen();
|
_vm->_graphics->blackAllScreen();
|
||||||
_vm->updateMusicAndEvents();
|
_vm->updateMusicAndEvents();
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,7 @@ void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fad
|
||||||
_event->mouseHide();
|
_event->mouseHide();
|
||||||
|
|
||||||
if (fadeOut)
|
if (fadeOut)
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
|
|
||||||
_graphics->setPen(0);
|
_graphics->setPen(0);
|
||||||
_graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1);
|
_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());
|
_graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 148, 134, 186), _rooms[curMsg]._roomMsg.c_str());
|
||||||
|
|
||||||
if (fadeIn)
|
if (fadeIn)
|
||||||
_graphics->fade(true, 0);
|
_graphics->fade(true);
|
||||||
|
|
||||||
_event->mouseShow();
|
_event->mouseShow();
|
||||||
}
|
}
|
||||||
|
@ -452,18 +452,18 @@ void LabEngine::processMap(uint16 curRoom) {
|
||||||
uint16 upperFloor = getUpperFloor(curFloor);
|
uint16 upperFloor = getUpperFloor(curFloor);
|
||||||
if (upperFloor != kFloorNone) {
|
if (upperFloor != kFloorNone) {
|
||||||
curFloor = upperFloor;
|
curFloor = upperFloor;
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
drawMap(curRoom, curMsg, curFloor, false, false);
|
drawMap(curRoom, curMsg, curFloor, false, false);
|
||||||
_graphics->fade(true, 0);
|
_graphics->fade(true);
|
||||||
}
|
}
|
||||||
} else if (msgCode == 2) {
|
} else if (msgCode == 2) {
|
||||||
// Down arrow
|
// Down arrow
|
||||||
uint16 lowerFloor = getLowerFloor(curFloor);
|
uint16 lowerFloor = getLowerFloor(curFloor);
|
||||||
if (lowerFloor != kFloorNone) {
|
if (lowerFloor != kFloorNone) {
|
||||||
curFloor = lowerFloor;
|
curFloor = lowerFloor;
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
drawMap(curRoom, curMsg, curFloor, false, false);
|
drawMap(curRoom, curMsg, curFloor, false, false);
|
||||||
_graphics->fade(true, 0);
|
_graphics->fade(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (msgClass == kMessageLeftClick) {
|
} else if (msgClass == kMessageLeftClick) {
|
||||||
|
@ -471,30 +471,30 @@ void LabEngine::processMap(uint16 curRoom) {
|
||||||
&& floorVisited(kFloorSurMaze)) {
|
&& floorVisited(kFloorSurMaze)) {
|
||||||
curFloor = kFloorSurMaze;
|
curFloor = kFloorSurMaze;
|
||||||
|
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
drawMap(curRoom, curMsg, curFloor, false, 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)
|
} else if ((curFloor == kFloorMiddle) && _utils->mapRectScale(358, 71, 452, 147).contains(mouseX, mouseY)
|
||||||
&& floorVisited(kFloorCarnival)) {
|
&& floorVisited(kFloorCarnival)) {
|
||||||
curFloor = kFloorCarnival;
|
curFloor = kFloorCarnival;
|
||||||
|
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
drawMap(curRoom, curMsg, curFloor, false, 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)
|
} else if ((curFloor == kFloorMiddle) && _utils->mapRectScale(557, 325, 653, 401).contains(mouseX, mouseY)
|
||||||
&& floorVisited(kFloorMedMaze)) {
|
&& floorVisited(kFloorMedMaze)) {
|
||||||
curFloor = kFloorMedMaze;
|
curFloor = kFloorMedMaze;
|
||||||
|
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
drawMap(curRoom, curMsg, curFloor, false, 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)
|
} else if ((curFloor == kFloorUpper) && _utils->mapRectScale(524, 97, 645, 207).contains(mouseX, mouseY)
|
||||||
&& floorVisited(kFloorHedgeMaze)) {
|
&& floorVisited(kFloorHedgeMaze)) {
|
||||||
curFloor = kFloorHedgeMaze;
|
curFloor = kFloorHedgeMaze;
|
||||||
|
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
drawMap(curRoom, curMsg, curFloor, false, false);
|
drawMap(curRoom, curMsg, curFloor, false, false);
|
||||||
_graphics->fade(true, 0);
|
_graphics->fade(true);
|
||||||
} else if (mouseX > _utils->mapScaleX(314)) {
|
} else if (mouseX > _utils->mapScaleX(314)) {
|
||||||
uint16 oldMsg = curMsg;
|
uint16 oldMsg = curMsg;
|
||||||
Common::Rect curCoords;
|
Common::Rect curCoords;
|
||||||
|
@ -563,7 +563,7 @@ void LabEngine::doMap(uint16 curRoom) {
|
||||||
_graphics->screenUpdate();
|
_graphics->screenUpdate();
|
||||||
processMap(curRoom);
|
processMap(curRoom);
|
||||||
_event->attachButtonList(nullptr);
|
_event->attachButtonList(nullptr);
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
_graphics->blackAllScreen();
|
_graphics->blackAllScreen();
|
||||||
_event->mouseHide();
|
_event->mouseHide();
|
||||||
_graphics->setPen(0);
|
_graphics->setPen(0);
|
||||||
|
|
|
@ -213,7 +213,7 @@ void LabEngine::drawJournal(uint16 wipenum, bool needFade) {
|
||||||
_event->toggleButton(_event->getButton(2), 15, (!_lastPage)); // forward button
|
_event->toggleButton(_event->getButton(2), 15, (!_lastPage)); // forward button
|
||||||
|
|
||||||
if (needFade)
|
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
|
// 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);
|
memcpy(_journalBackImage->_imageData, _blankJournal, _graphics->_screenWidth * _graphics->_screenHeight);
|
||||||
|
@ -276,7 +276,7 @@ void LabEngine::doJournal() {
|
||||||
_event->mouseShow();
|
_event->mouseShow();
|
||||||
processJournal();
|
processJournal();
|
||||||
_event->attachButtonList(nullptr);
|
_event->attachButtonList(nullptr);
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
_event->mouseHide();
|
_event->mouseHide();
|
||||||
|
|
||||||
delete[] _blankJournal;
|
delete[] _blankJournal;
|
||||||
|
@ -370,9 +370,9 @@ void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool is
|
||||||
_monitorTextFilename = test;
|
_monitorTextFilename = test;
|
||||||
|
|
||||||
Common::String text = _resource->getText(_monitorTextFilename);
|
Common::String text = _resource->getText(_monitorTextFilename);
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
|
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);
|
_graphics->loadBackPict(background, _highPalette);
|
||||||
drawMonText(ntext.c_str(), monitorFont, scaledRect, isinteractive);
|
drawMonText(ntext.c_str(), monitorFont, scaledRect, isinteractive);
|
||||||
_event->mouseShow();
|
_event->mouseShow();
|
||||||
_graphics->fade(true, 0);
|
_graphics->fade(true);
|
||||||
processMonitor(ntext.c_str(), monitorFont, isinteractive, scaledRect);
|
processMonitor(ntext.c_str(), monitorFont, isinteractive, scaledRect);
|
||||||
_graphics->fade(false, 0);
|
_graphics->fade(false);
|
||||||
_event->mouseHide();
|
_event->mouseHide();
|
||||||
_graphics->closeFont(&monitorFont);
|
_graphics->closeFont(&monitorFont);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue