VOYEUR: In progress work on fixing initial apartment animation

This commit is contained in:
Paul Gilbert 2013-12-18 08:53:44 -05:00
parent b99176fee6
commit 23f9cb19b4
4 changed files with 39 additions and 6 deletions

View File

@ -201,8 +201,8 @@ void EventsManager::videoTimer() {
if (_gameData._hasPalette) {
_gameData._hasPalette = false;
g_system->getPaletteManager()->setPalette(_gameData._palette,
_gameData._palStartIndex,
g_system->getPaletteManager()->setPalette(_gameData._palette +
_gameData._palStartIndex * 3, _gameData._palStartIndex,
_gameData._palEndIndex - _gameData._palStartIndex + 1);
}
}
@ -423,14 +423,13 @@ void EventsManager::getMouseInfo() {
if ((_gameCounter - _joe) > 8) {
_joe = _gameCounter;
// TODO: Figure out difference between setOneColor and setColor calls
if (_vm->_bob) {
_vm->_bob = false;
//_vm->_graphicsManager.setColor(128, 55, 5, 5);
_vm->_graphicsManager.setOneColor(128, 55, 5, 5);
_vm->_graphicsManager.setColor(128, 220, 20, 20);
} else {
_vm->_bob = true;
//_vm->_graphicsManager.setColor(128, 55, 55, 55);
_vm->_graphicsManager.setOneColor(128, 55, 55, 55);
_vm->_graphicsManager.setColor(128, 220, 20, 20);
}
}

View File

@ -1575,12 +1575,13 @@ void ThreadResource::doAptAnim(int mode) {
for (int idx = 0; (idx < 6) && !_vm->shouldQuit(); ++idx) {
PictureResource *pic = _vm->_bVoy->boltEntry(id + idx + 1)._picResource;
(*_vm->_graphicsManager._vPort)->setupViewPort(pic);
pal->startFade();
(*_vm->_graphicsManager._vPort)->_flags |= 8;
_vm->_graphicsManager.flipPage();
_vm->_eventsManager.sWaitFlip();
_vm->_eventsManager.delay(5);
_vm->_eventsManager.delay(50);
}
_vm->_bVoy->freeBoltGroup(id);

View File

@ -56,6 +56,7 @@ GraphicsManager::GraphicsManager():
_backgroundPage = NULL;
_vPort = NULL;
_fontPtr = NULL;
Common::fill(&_VGAColors[0], &_VGAColors[PALETTE_SIZE], 0);
}
void GraphicsManager::sInitGraphics() {
@ -350,6 +351,7 @@ void GraphicsManager::sDrawPic(DisplayResource *srcDisplay, DisplayResource *des
// loc_25D40
if (srcFlags & DISPFLAG_100) {
// loc_25D4A
error("TODO: sDrawPic");
} else {
// loc_2606D
destP = (byte *)_screenSurface.getPixels() + screenOffset;
@ -453,13 +455,35 @@ error("TODO: var22/var24/var2C not initialised before use?");
}
} else {
if (srcFlags & 0x100) {
// Simple run-length encoded image
srcP = srcImgData;
if (isClipped) {
// loc_26424
error("TODO: sDrawPic");
} else {
// loc_26543
for (int yp = 0; yp < height1; ++yp) {
int runLength = 0;
for (int xp = 0; xp < width2; ++xp, --runLength) {
if (runLength <= 0) {
// Start of run length, so get pixel and repeat length
pixel = *srcP++;
if (pixel & 0x80) {
pixel &= 0x7f;
runLength = *srcP++;
if (runLength == 0)
runLength = width2;
}
}
// Copy pixel to output
*destP++ = pixel;
}
destP += widthDiff2;
}
}
} else {
for (int yp = 0; yp < height1; ++yp) {
@ -646,6 +670,14 @@ void GraphicsManager::setColor(int idx, byte r, byte g, byte b) {
_vm->_eventsManager._intPtr._palEndIndex = MAX(_vm->_eventsManager._intPtr._palEndIndex, idx);
}
void GraphicsManager::setOneColor(int idx, byte r, byte g, byte b) {
byte palEntry[3];
palEntry[0] = r;
palEntry[1] = g;
palEntry[2] = b;
g_system->getPaletteManager()->setPalette(&palEntry[0], idx, 1);
}
void GraphicsManager::screenReset() {
resetPalette();

View File

@ -110,6 +110,7 @@ public:
void setPalette(const byte *palette, int start, int count);
void resetPalette();
void setColor(int idx, byte r, byte g, byte b);
void setOneColor(int idx, byte r, byte g, byte b);
void screenReset();
void doScroll(const Common::Point &pt);
void fadeDownICF1(int steps);