diff options
author | Travis Howell | 2006-04-03 14:40:07 +0000 |
---|---|---|
committer | Travis Howell | 2006-04-03 14:40:07 +0000 |
commit | 36270561167d384654ba515fe5c1b8462cd3c8ca (patch) | |
tree | f06e004f27c4d0aeeb8764e9046615ddee96c4f6 /engines | |
parent | 41f71238f2b0e420cc641a249ddc2b2e3c345b6b (diff) | |
download | scummvm-rg350-36270561167d384654ba515fe5c1b8462cd3c8ca.tar.gz scummvm-rg350-36270561167d384654ba515fe5c1b8462cd3c8ca.tar.bz2 scummvm-rg350-36270561167d384654ba515fe5c1b8462cd3c8ca.zip |
Add initial support for oracle icons in FF
svn-id: r21579
Diffstat (limited to 'engines')
-rw-r--r-- | engines/simon/icons.cpp | 13 | ||||
-rw-r--r-- | engines/simon/oracle.cpp | 68 | ||||
-rw-r--r-- | engines/simon/simon.cpp | 11 | ||||
-rw-r--r-- | engines/simon/simon.h | 5 |
4 files changed, 95 insertions, 2 deletions
diff --git a/engines/simon/icons.cpp b/engines/simon/icons.cpp index e508002468..c81c686c87 100644 --- a/engines/simon/icons.cpp +++ b/engines/simon/icons.cpp @@ -52,6 +52,19 @@ void SimonEngine::loadIconFile() { in.close(); } +void SimonEngine::loadIconData() { + loadZone(8); + VgaPointersEntry *vpe = &_vgaBufferPointers[8]; + byte *src = vpe->vgaFile2; + + _iconFilePtr = (byte *)malloc(43 * 336); + if (_iconFilePtr == NULL) + error("Out of icon memory"); + + memcpy(_iconFilePtr, src, 43 * 336); + o_unfreezeBottom(); +} + // Thanks to Stuart Caie for providing the original // C conversion upon which this function is based. void decompress_icon_amiga (byte *dst, byte *src, byte base, uint pitch) { diff --git a/engines/simon/oracle.cpp b/engines/simon/oracle.cpp index eadfee6ce8..716aa16fd6 100644 --- a/engines/simon/oracle.cpp +++ b/engines/simon/oracle.cpp @@ -52,4 +52,72 @@ void SimonEngine::hyperLinkOff() _hyperLink = 0; } +void SimonEngine::oracleLogo() { + Common::Rect srcRect, dstRect; + byte *src, *dst; + uint16 w, h; + + dstRect.left = 16; + dstRect.top = 16; + dstRect.right = 58; + dstRect.bottom = 59; + + srcRect.left = 0; + srcRect.top = 0; + srcRect.right = 42; + srcRect.bottom = 43; + + src = _iconFilePtr; + dst = getBackBuf() + _screenWidth * dstRect.top + dstRect.left; + + for (h = 0; h < dstRect.height(); h++) { + for (w = 0; w < dstRect.width(); w++) { + if (src[w]) + dst[w] = src[w]; + } + src += 336; + dst += _screenWidth; + } +} + +void SimonEngine::swapCharacterLogo() { + Common::Rect srcRect, dstRect; + byte *src, *dst; + uint16 w, h; + int x; + + dstRect.left = 64; + dstRect.top = 16; + dstRect.right = 106; + dstRect.bottom = 59; + + srcRect.top = 0; + srcRect.bottom = 43; + + x = _variableArray[91]; + if (x > _variableArray[90]) + x--; + if( x < _variableArray[90]) + x++; + _variableArray[91] = x; + + x++; + x *= 42; + + srcRect.left = x; + srcRect.right = srcRect.left + 42; + + src = _iconFilePtr + srcRect.top * 336 + srcRect.left; + dst = getBackBuf() + _screenWidth * dstRect.top + dstRect.left; + + for (h = 0; h < dstRect.height(); h++) { + for (w = 0; w < dstRect.width(); w++) { + if (src[w]) + dst[w] = src[w]; + } + src += 336; + dst += _screenWidth; + } +} + } // End of namespace Simon diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index 93e5a7f563..1d4ab3f5d6 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -2857,6 +2857,13 @@ void SimonEngine::timer_proc1() { } if (_updateScreen) { + if (getGameType() == GType_FF) { + if (vcGetBit(78) == false) { + oracleLogo(); + } else if (vcGetBit(76) == true) { + swapCharacterLogo(); + } + } handle_mouse_moved(); dx_update_screen_and_palette(); _updateScreen = false; @@ -3817,7 +3824,9 @@ void SimonEngine::openGameFile() { #endif } - if (getGameType() != GType_FF) + if (getGameType() == GType_FF) + loadIconData(); + else loadIconFile(); vc34_setMouseOff(); diff --git a/engines/simon/simon.h b/engines/simon/simon.h index 1c763c5f7c..a7d1b17bca 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -589,7 +589,9 @@ protected: void hyperLinkOn(uint16 x); void hyperLinkOff(); - + void oracleLogo(); + void swapCharacterLogo(); + void mouseOff(); void mouseOn(); @@ -647,6 +649,7 @@ protected: uint setup_icon_hit_area(FillOrCopyStruct *fcs, uint x, uint y, uint icon_number, Item *item_ptr); void addArrows(FillOrCopyStruct *fcs, uint fcs_index); + void loadIconData(); void loadIconFile(); void processSpecialKeys(); void hitarea_stuff_helper(); |