aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins/graphics.cpp
diff options
context:
space:
mode:
authorStrangerke2013-01-03 23:20:54 +0100
committerStrangerke2013-01-03 23:20:54 +0100
commit9a089929b261e600a753b83bd2393ad7ba23612a (patch)
tree86aadadfa6844272fcab6ced05c45b10620f4031 /engines/hopkins/graphics.cpp
parent0958eaddc5da2beac94b5611f356a67f3d8a0620 (diff)
downloadscummvm-rg350-9a089929b261e600a753b83bd2393ad7ba23612a.tar.gz
scummvm-rg350-9a089929b261e600a753b83bd2393ad7ba23612a.tar.bz2
scummvm-rg350-9a089929b261e600a753b83bd2393ad7ba23612a.zip
HOPKINS: Simplify a bit more fade out function. Reduce fade out delay time.
Diffstat (limited to 'engines/hopkins/graphics.cpp')
-rw-r--r--engines/hopkins/graphics.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index c6af572428..03181cf8ca 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -604,34 +604,28 @@ void GraphicsManager::fadeOut(const byte *palette, int step, const byte *surface
fadeStep = 2;
if (palette) {
- for (int f = 0; f < fadeStep; f++) {
- for (int32 i = 0; i < 256; i++) {
- palData[i * 3 + 0] = (fadeStep - f - 1) * palette[i * 3 + 0] / (fadeStep - 1);
- palData[i * 3 + 1] = (fadeStep - f - 1) * palette[i * 3 + 1] / (fadeStep - 1);
- palData[i * 3 + 2] = (fadeStep - f - 1) * palette[i * 3 + 2] / (fadeStep - 1);
+ for (int fadeIndex = 0; fadeIndex < fadeStep; fadeIndex++) {
+ for (int palOffset = 0; palOffset < PALETTE_BLOCK_SIZE; palOffset += 3) {
+ palData[palOffset + 0] = (fadeStep - fadeIndex - 1) * palette[palOffset + 0] / (fadeStep - 1);
+ palData[palOffset + 1] = (fadeStep - fadeIndex - 1) * palette[palOffset + 1] / (fadeStep - 1);
+ palData[palOffset + 2] = (fadeStep - fadeIndex - 1) * palette[palOffset + 2] / (fadeStep - 1);
}
setpal_vga256(palData);
m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
DD_VBL();
- _vm->_eventsManager.delay(100);
+ _vm->_eventsManager.delay(20);
}
+ }
- for (int i = 0; i < PALETTE_BLOCK_SIZE; i++)
- palData[i] = 0;
-
- setpal_vga256(palData);
- m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
- return DD_VBL();
- } else {
- for (int i = 0; i < PALETTE_BLOCK_SIZE; i++)
- palData[i] = 0;
+ // No initial palette, or end of fading
+ for (int i = 0; i < PALETTE_BLOCK_SIZE; i++)
+ palData[i] = 0;
- setpal_vga256(palData);
- m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
- return DD_VBL();
- }
+ setpal_vga256(palData);
+ m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
+ return DD_VBL();
}
/**