From fa2ea4fc6190043386f1ee0909d48af72ff7da69 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Tue, 10 Dec 2013 01:40:46 +0200 Subject: SCI: Add handling for the RAVE resource type, found in KQ6CD This contains the sync data in the Windows version of KQ6CD. Note that currently the sync36 resource is 2 bytes bigger (it contains 2 bytes from the RAVE resource). Some test code has also been added to dump the RAVE sync resources --- engines/sci/graphics/portrait.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index d5227126e2..a39bcfcd88 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -21,6 +21,7 @@ */ #include "common/archive.h" +#include "common/file.h" // for DumpFile #include "common/system.h" #include "sci/sci.h" @@ -140,6 +141,27 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint Resource *syncResource = _resMan->findResource(syncResourceId, true); uint syncOffset = 0; +#if 0 + // Dump the sync resources to disk + Common::DumpFile *outFile = new Common::DumpFile(); + Common::String outName = syncResourceId.toPatchNameBase36() + ".sync36"; + outFile->open(outName); + syncResource->writeToStream(outFile); + outFile->finalize(); + outFile->close(); + + ResourceId raveResourceId = ResourceId(kResourceTypeRave, resourceId, noun, verb, cond, seq); + Resource *raveResource = _resMan->findResource(raveResourceId, true); + outName = raveResourceId.toPatchNameBase36() + ".rave"; + outFile->open(outName); + raveResource->writeToStream(outFile); + outFile->finalize(); + outFile->close(); + _resMan->unlockResource(raveResource); + + delete outFile; +#endif + // Set the portrait palette _palette->set(&_portraitPalette, false, true); -- cgit v1.2.3 From 693d5e662595f60eed41feb5254a28bbd318094e Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Wed, 11 Dec 2013 08:25:23 +0100 Subject: SCI: rave support (KQ6 hires portrait lip sync) Thanks to wjp and [md5] for helping --- engines/sci/graphics/portrait.cpp | 222 +++++++++++++++++++++++++++++++++++++- engines/sci/graphics/portrait.h | 11 ++ 2 files changed, 229 insertions(+), 4 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index a39bcfcd88..7217af51f7 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -40,6 +40,7 @@ Portrait::Portrait(ResourceManager *resMan, EventManager *event, GfxScreen *scre } Portrait::~Portrait() { + delete[] _lipSyncDataOffsetTable; delete[] _bitmaps; delete[] _fileData; } @@ -52,7 +53,7 @@ void Portrait::init() { // 2 bytes main height (should be the same as first bitmap header height) // 2 bytes animation count // 2 bytes unknown - // 2 bytes unknown + // 2 bytes lip sync ID count // 4 bytes paletteSize (base 1) // -> 17 bytes // paletteSize bytes paletteData @@ -82,6 +83,8 @@ void Portrait::init() { _width = READ_LE_UINT16(_fileData + 3); _height = READ_LE_UINT16(_fileData + 5); _bitmapCount = READ_LE_UINT16(_fileData + 7); + _lipSyncIDCount = READ_LE_UINT16(_fileData + 11); + _bitmaps = new PortraitBitmap[_bitmapCount]; uint16 portraitPaletteSize = READ_LE_UINT16(_fileData + 13); @@ -129,7 +132,48 @@ void Portrait::init() { } data += offsetTableSize; - // raw lip-sync data follows + // raw lip-sync ID table follows + uint32 lipSyncIDTableSize; + + lipSyncIDTableSize = READ_LE_UINT32(data); + data += 4; + assert( lipSyncIDTableSize == (_lipSyncIDCount * 4) ); + _lipSyncIDTable = data; + data += lipSyncIDTableSize; + + // raw lip-sync frame table follows + uint32 lipSyncDataTableSize; + uint32 lipSyncDataTableLastOffset; + byte lipSyncData; + uint16 lipSyncDataNr; + uint16 lipSyncCurOffset; + + lipSyncDataTableSize = READ_LE_UINT32(data); + data += 4; + assert( lipSyncDataTableSize == 0x220 ); // always this size, just a safety-check + + _lipSyncData = data; + lipSyncDataTableLastOffset = lipSyncDataTableSize - 1; + _lipSyncDataOffsetTable = new uint16[ _lipSyncIDCount ]; + + lipSyncDataNr = 0; + lipSyncCurOffset = 0; + while ( (lipSyncCurOffset < lipSyncDataTableSize) && (lipSyncDataNr < _lipSyncIDCount) ) { + // We are currently at the start of ID-frame data + _lipSyncDataOffsetTable[lipSyncDataNr] = lipSyncCurOffset; + + // Look for end of ID-frame data + lipSyncData = *data++; lipSyncCurOffset++; + while ( (lipSyncData != 0xFF) && (lipSyncCurOffset < lipSyncDataTableLastOffset) ) { + // Either terminator (0xFF) or frame-data (1 byte tick count and 1 byte bitmap ID) + data++; + lipSyncData = *data++; + lipSyncCurOffset += 2; + } + lipSyncDataNr++; + } + _lipSyncDataOffsetTableEnd = data; + // last 4 bytes seem to be garbage } void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq) { @@ -137,10 +181,20 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint // Now init audio and sync resource uint32 audioNumber = ((noun & 0xff) << 24) | ((verb & 0xff) << 16) | ((cond & 0xff) << 8) | (seq & 0xff); - ResourceId syncResourceId = ResourceId(kResourceTypeSync36, resourceId, noun, verb, cond, seq); - Resource *syncResource = _resMan->findResource(syncResourceId, true); + //ResourceId syncResourceId = ResourceId(kResourceTypeSync36, resourceId, noun, verb, cond, seq); + //Resource *syncResource = _resMan->findResource(syncResourceId, true); + ResourceId raveResourceId = ResourceId(kResourceTypeRave, resourceId, noun, verb, cond, seq); + Resource *raveResource = _resMan->findResource(raveResourceId, true); + +#if 0 uint syncOffset = 0; +#endif + // TODO: play through the game if this is 100% accurate + // TODO: maybe try to create the missing sync resources for low-res KQ6 out of the rave resources + + uint raveOffset = 0; + #if 0 // Dump the sync resources to disk Common::DumpFile *outFile = new Common::DumpFile(); @@ -172,7 +226,92 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint // Start playing audio... _audio->stopAudio(); _audio->startAudio(resourceId, audioNumber); + + if (!raveResource) { + warning("kPortrait: no rave resource %d %X", resourceId, audioNumber); + return; + } + + // Do animation depending on rave resource till audio is done playing + int16 raveTicks; + uint16 raveID; + byte *raveLipSyncData; + byte raveLipSyncTicks; + byte raveLipSyncBitmapNr; + int timerPosition = 0; + int timerPositionWithin = 0; + int curPosition; + SciEvent curEvent; + bool userAbort = false; + + while ((raveOffset < raveResource->size) && (!userAbort)) { + // rave string starts with tick count, followed by lipSyncID, tick count and so on + raveTicks = raveGetTicks(raveResource, &raveOffset); + if (raveTicks < 0) + break; + + // get lipSyncID + raveID = raveGetID(raveResource, &raveOffset); + if (raveID) { + raveLipSyncData = raveGetLipSyncData(raveID); + } else { + raveLipSyncData = NULL; + } + + timerPosition += raveTicks; + // Wait till syncTime passed, then show specific animation bitmap + if (timerPosition > 0) { + do { + g_sci->getEngineState()->wait(1); + curEvent = _event->getSciEvent(SCI_EVENT_ANY); + if (curEvent.type == SCI_EVENT_MOUSE_PRESS || + (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.data == SCI_KEY_ESC) || + g_sci->getEngineState()->abortScriptProcessing == kAbortQuitGame) + userAbort = true; + curPosition = _audio->getAudioPosition(); + } while ((curPosition != -1) && (curPosition < timerPosition) && (!userAbort)); + } + + if (raveLipSyncData) { + // lip sync data is + // Tick:Byte, Bitmap-Nr:BYTE + // Tick = 0xFF is the terminator for the data + timerPositionWithin = timerPosition; + raveLipSyncTicks = *raveLipSyncData++; + while ( (raveLipSyncData < _lipSyncDataOffsetTableEnd) && (raveLipSyncTicks != 0xFF) ) { + timerPositionWithin += raveLipSyncTicks; + + do { + g_sci->getEngineState()->wait(1); + curEvent = _event->getSciEvent(SCI_EVENT_ANY); + if (curEvent.type == SCI_EVENT_MOUSE_PRESS || + (curEvent.type == SCI_EVENT_KEYBOARD && curEvent.data == SCI_KEY_ESC) || + g_sci->getEngineState()->abortScriptProcessing == kAbortQuitGame) + userAbort = true; + curPosition = _audio->getAudioPosition(); + } while ((curPosition != -1) && (curPosition < timerPositionWithin) && (!userAbort)); + + raveLipSyncBitmapNr = *raveLipSyncData++; + + // bitmap nr within sync data is base 1, we need base 0 + raveLipSyncBitmapNr--; + + if (raveLipSyncBitmapNr < _bitmapCount) { + drawBitmap(0); + drawBitmap(raveLipSyncBitmapNr); + bitsShow(); + } else { + warning("kPortrait: rave lip sync data tried to draw non-existent bitmap %d", raveLipSyncBitmapNr); + } + + raveLipSyncTicks = *raveLipSyncData++; + } + } + } + +// old sync resource code +#if 0 if (!syncResource) { // Getting the book in the book shop calls kPortrait where no sync exists // TODO: find out what to do then @@ -219,6 +358,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint } } } +#endif if (userAbort) { // Reset the portrait bitmap to "closed mouth" state, when skipping dialogs @@ -227,7 +367,81 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint _audio->stopAudio(); } + _resMan->unlockResource(raveResource); + +#if 0 _resMan->unlockResource(syncResource); +#endif +} + +// returns ASCII ticks from lip sync string as uint16 +int16 Portrait::raveGetTicks(Resource *resource, uint *offset) { + uint curOffset = *offset; + byte *curData = resource->data + curOffset; + byte curByte; + uint16 curValue = 0; + + if (curOffset >= resource->size) + return -1; + + while (curOffset < resource->size) { + curByte = *curData++; curOffset++; + if ( curByte == ' ' ) + break; + if ( (curByte >= '0') && (curByte <= '9') ) { + curValue = curValue * 10 + ( curByte - '0' ); + } else { + // no number -> assume there is an ID at current offset + return 0; + } + } + *offset = curOffset; + return curValue; +} + +// returns ASCII ID from lip sync string as uint16 +uint16 Portrait::raveGetID(Resource *resource, uint *offset) { + uint curOffset = *offset; + byte *curData = resource->data + curOffset; + byte curByte = 0; + uint16 curValue = 0; + + while (curOffset < resource->size) { + curByte = *curData++; curOffset++; + if ( curByte == ' ' ) + break; + if (!curValue) { + curValue = curByte << 8; + } else { + curValue |= curByte; + } + } + + *offset = curOffset; + return curValue; +} + +// Searches for a specific lip sync ID and returns pointer to lip sync data or NULL in case ID was not found +byte *Portrait::raveGetLipSyncData(uint16 raveID) { + uint lipSyncIDNr = 0; + byte *lipSyncIDPtr = _lipSyncIDTable; + byte lipSyncIDByte1, lipSyncIDByte2; + uint16 lipSyncID; + + lipSyncIDPtr++; // skip over first byte + while (lipSyncIDNr < _lipSyncIDCount) { + lipSyncIDByte1 = *lipSyncIDPtr++; + lipSyncIDByte2 = *lipSyncIDPtr++; + lipSyncID = ( lipSyncIDByte1 << 8 ) | lipSyncIDByte2; + + if ( lipSyncID == raveID ) { + return _lipSyncData + _lipSyncDataOffsetTable[lipSyncIDNr]; + } + + lipSyncIDNr++; + lipSyncIDPtr += 2; // ID is every 4 bytes + } + return NULL; } void Portrait::drawBitmap(uint16 bitmapNr) { diff --git a/engines/sci/graphics/portrait.h b/engines/sci/graphics/portrait.h index 75baa9a56b..de0dbffb3f 100644 --- a/engines/sci/graphics/portrait.h +++ b/engines/sci/graphics/portrait.h @@ -52,6 +52,10 @@ private: void drawBitmap(uint16 bitmapNr); void bitsShow(); + int16 raveGetTicks(Resource *resource, uint *offset); + uint16 raveGetID(Resource *resource, uint *offset); + byte *raveGetLipSyncData(uint16 raveID); + ResourceManager *_resMan; EventManager *_event; GfxPalette *_palette; @@ -68,6 +72,13 @@ private: Common::String _resourceName; byte *_fileData; + + uint32 _lipSyncIDCount; + byte *_lipSyncIDTable; + + byte *_lipSyncData; + uint16 *_lipSyncDataOffsetTable; + byte *_lipSyncDataOffsetTableEnd; Common::Point _position; }; -- cgit v1.2.3 From 60de25fb69f4821e601fb9fb7a3076e2586a7268 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Wed, 18 Dec 2013 20:51:50 +0100 Subject: SCI: debug code to print out kq6 raw lipsync data --- engines/sci/graphics/portrait.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index 7217af51f7..e2abe32a45 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -190,6 +190,16 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint uint syncOffset = 0; #endif +#if 0 + // prints out the current lip sync ASCII data + char debugPrint[4000]; + if (raveResource->size < 4000) { + memcpy(debugPrint, raveResource->data, raveResource->size); + debugPrint[raveResource->size] = 0; // set terminating NUL + debug("kPortrait: %s", debugPrint); + } +#endif + // TODO: play through the game if this is 100% accurate // TODO: maybe try to create the missing sync resources for low-res KQ6 out of the rave resources -- cgit v1.2.3 From c2a2a760e9f634b7e24b8fe66d75054d80d1f435 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Mon, 23 Dec 2013 23:41:35 +0100 Subject: SCI: change floodfill to fix sq4 ship taking off fixes bug #6446 --- engines/sci/graphics/picture.cpp | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 8ad4f535f9..d78b48884d 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -919,15 +919,30 @@ void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, by } // This logic was taken directly from sierra sci, floodfill will get aborted on various occations - if (screenMask & GFX_SCREEN_MASK_VISUAL) { - if ((color == _screen->getColorWhite()) || (searchColor != _screen->getColorWhite())) - return; - } else if (screenMask & GFX_SCREEN_MASK_PRIORITY) { - if ((priority == 0) || (searchPriority != 0)) - return; - } else if (screenMask & GFX_SCREEN_MASK_CONTROL) { - if ((control == 0) || (searchControl != 0)) - return; + if (isEGA) { + if (screenMask & GFX_SCREEN_MASK_VISUAL) { + if ((color == _screen->getColorWhite()) || (searchColor != _screen->getColorWhite())) + return; + } else if (screenMask & GFX_SCREEN_MASK_PRIORITY) { + if ((priority == 0) || (searchPriority != 0)) + return; + } else if (screenMask & GFX_SCREEN_MASK_CONTROL) { + if ((control == 0) || (searchControl != 0)) + return; + } + } else { + // VGA logic (SCI1 early w/o QfG2) + // fixes Space Quest 4 orange ship lifting off (bug #6446) + if (screenMask & GFX_SCREEN_MASK_VISUAL) { + if (color == _screen->getColorWhite()) + return; + } else if (screenMask & GFX_SCREEN_MASK_PRIORITY) { + if (priority == 0) + return; + } else if (screenMask & GFX_SCREEN_MASK_CONTROL) { + if (control == 0) + return; + } } // Now remove screens, that already got the right color/priority/control -- cgit v1.2.3 From 8b3efba40f637a8f5e972ba793a6e59895356355 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 24 Dec 2013 10:39:42 +0100 Subject: SCI: change floodfill fix for sq4 behaviour wasn't changed in SCI1, instead it seems that SSCI draws overlays to separate memory and then copies them over. Previous commit caused regression in qfg1vga (funny room) --- engines/sci/graphics/picture.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index d78b48884d..651eac75ea 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -919,7 +919,7 @@ void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, by } // This logic was taken directly from sierra sci, floodfill will get aborted on various occations - if (isEGA) { + if (!_addToFlag) { if (screenMask & GFX_SCREEN_MASK_VISUAL) { if ((color == _screen->getColorWhite()) || (searchColor != _screen->getColorWhite())) return; @@ -931,7 +931,9 @@ void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, by return; } } else { - // VGA logic (SCI1 early w/o QfG2) + // When adding a picture onto another picture, don't abort in case current pixel was already drawn previously + // It seems Sierra SCI unpacks such pictures separately and then copies them over + // We draw directly to the screen. // fixes Space Quest 4 orange ship lifting off (bug #6446) if (screenMask & GFX_SCREEN_MASK_VISUAL) { if (color == _screen->getColorWhite()) @@ -982,6 +984,12 @@ void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, by _screen->putPixel(--w, p.y, screenMask, color, priority, control); while (e < r && (matchedMask = _screen->isFillMatch(e + 1, p.y, matchMask, searchColor, searchPriority, searchControl, isEGA))) _screen->putPixel(++e, p.y, screenMask, color, priority, control); +#if 0 + // debug code for floodfill + _screen->copyToScreen(); + g_system->updateScreen(); + g_system->delayMillis(100); +#endif // checking lines above and below for possible flood targets a_set = b_set = 0; while (w <= e) { -- cgit v1.2.3 From a72d7d3932eb2c1f98be87c7d387da6c3bb5ebd8 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 24 Dec 2013 22:24:42 +0100 Subject: SCI: injecting "dual" view into Laura Bow 2 CD for dual mode (text+speech at the same time) --- engines/sci/graphics/view.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 36aaae9232..d473bc41ef 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -55,6 +55,20 @@ static const byte EGAmappingStraight[SCI_VIEW_EGAMAPPING_SIZE] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; +static const byte ViewInject_LauraBow2_Dual[] = { + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x37,0x37,0x37,0x37,0x00,0x00,0x37,0x37,0x00,0x00,0x37,0x37,0x00,0x00,0x00,0x37,0x37,0x37,0x00,0x00,0x37,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x08,0x08,0x08,0x37,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x08,0x08,0x37,0x00,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x33,0x32,0x37,0x08,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x32,0x33,0x08,0x32,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x33,0x37,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x08,0x08,0x08,0x08,0x32,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x32,0x32,0x33,0x08,0x32,0x37,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x33,0x37,0x37,0x08,0x32,0x37,0x08,0x33,0x37,0x37,0x08,0x32,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x33,0x37,0x37,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x08,0x08,0x08,0x08,0x32,0x00,0x00,0x37,0x08,0x08,0x08,0x32,0x00,0x37,0x08,0x32,0x00,0x37,0x08,0x32,0x37,0x08,0x08,0x08,0x08,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x32,0x32,0x32,0x32,0x00,0x00,0x00,0x00,0x32,0x32,0x32,0x00,0x00,0x00,0x32,0x32,0x00,0x00,0x32,0x32,0x00,0x32,0x32,0x32,0x32,0x32,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 +}; + void GfxView::initData(GuiResourceId resourceId) { _resource = _resMan->findResource(ResourceId(kResourceTypeView, resourceId), true); if (!_resource) { @@ -316,6 +330,41 @@ void GfxView::initData(GuiResourceId resourceId) { default: error("ViewType was not detected, can't continue"); } + + // Inject our own views + // Currently only used for Dual mode (speech + text) for games, that do not have a "dual" icon already + // Which is Laura Bow 2 + King's Quest 6 + switch (g_sci->getGameId()) { + case GID_LAURABOW2: + // View 995, Loop 13, Cel 0 = "TEXT" + // View 995, Loop 13, Cel 1 = "SPEECH" + // View 995, Loop 13, Cel 2 = "DUAL" (<- our injected view) + if ((g_sci->isCD()) && (resourceId == 995)) { + // security checks + if (_loopCount >= 14) { + if ((_loop[13].celCount == 2) && (_loop[13].cel[0].width == 46) && (_loop[13].cel[0].height == 11)) { + // copy current cels over + CelInfo *newCels = new CelInfo[3]; + memcpy(newCels, _loop[13].cel, sizeof(CelInfo) * 2); + delete[] _loop[13].cel; + _loop[13].celCount++; + _loop[13].cel = newCels; + // Duplicate cel 0 to cel 2 + memcpy(&_loop[13].cel[2], &_loop[13].cel[0], sizeof(CelInfo)); + // copy over our data (which is uncompressed bitmap data) + _loop[13].cel[2].rawBitmap = new byte[sizeof(ViewInject_LauraBow2_Dual)]; + memcpy(_loop[13].cel[2].rawBitmap, ViewInject_LauraBow2_Dual, sizeof(ViewInject_LauraBow2_Dual)); + } + } + } + break; + case GID_KQ6: + if ((g_sci->isCD()) && (resourceId == 947)) { + } + break; + default: + break; + } } GuiResourceId GfxView::getResourceId() const { -- cgit v1.2.3 From a4bde6dade3f107e194d49766643eda38976b631 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 24 Dec 2013 23:31:17 +0100 Subject: SCI: injecting "dual" view into King's Quest 6 CD for dual mode (text+speech at the same time) --- engines/sci/graphics/view.cpp | 63 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index d473bc41ef..3d72743ff4 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -69,6 +69,42 @@ static const byte ViewInject_LauraBow2_Dual[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }; +static const byte ViewInject_KingsQuest6_Dual1[] = { + 0x17,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x13, + 0x17,0x17,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x16,0x13,0x11, + 0x16,0x17,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x17,0x16,0x16,0x16,0x16,0x13,0x13,0x17,0x16,0x13,0x13,0x17,0x16,0x13,0x13,0x13,0x17,0x16,0x16,0x13,0x13,0x17,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x10,0x10,0x10,0x16,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x10,0x10,0x16,0x13,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x11,0x11,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x11,0x13,0x10,0x11,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x13,0x16,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x10,0x10,0x10,0x10,0x11,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x11,0x11,0x13,0x10,0x11,0x16,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x13,0x16,0x16,0x10,0x11,0x16,0x10,0x13,0x16,0x16,0x10,0x11,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x10,0x13,0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x16,0x10,0x10,0x10,0x10,0x11,0x11,0x13,0x16,0x10,0x10,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x10,0x10,0x10,0x10,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x13,0x13,0x13,0x11,0x11,0x11,0x13,0x13,0x13,0x11,0x11,0x13,0x13,0x11,0x11,0x13,0x11,0x11,0x11,0x11,0x11,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x11, + 0x16,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11, + 0x13,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x12,0x11 +}; + +static const byte ViewInject_KingsQuest6_Dual2[] = { + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x10,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x10, + 0x10,0x13,0x16,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x13,0x11,0x10,0x10, + 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x16,0x13,0x13,0x13,0x13,0x11,0x11,0x16,0x13,0x11,0x11,0x16,0x13,0x11,0x11,0x11,0x16,0x13,0x13,0x11,0x11,0x16,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x16,0x16,0x16,0x13,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x16,0x16,0x13,0x11,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x10,0x10,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x10,0x11,0x16,0x10,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x11,0x13,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x16,0x16,0x16,0x16,0x10,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x10,0x10,0x11,0x16,0x10,0x13,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x11,0x13,0x13,0x16,0x10,0x13,0x16,0x11,0x13,0x13,0x16,0x10,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x13,0x16,0x11,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x13,0x16,0x16,0x16,0x16,0x10,0x10,0x11,0x13,0x16,0x16,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x13,0x16,0x10,0x11,0x16,0x16,0x16,0x16,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x13,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x10,0x10,0x10,0x11,0x11,0x11,0x10,0x10,0x11,0x11,0x10,0x10,0x11,0x10,0x10,0x10,0x10,0x10,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x13,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x11,0x10,0x10, + 0x10,0x11,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, + 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10 +}; + void GfxView::initData(GuiResourceId resourceId) { _resource = _resMan->findResource(ResourceId(kResourceTypeView, resourceId), true); if (!_resource) { @@ -359,7 +395,34 @@ void GfxView::initData(GuiResourceId resourceId) { } break; case GID_KQ6: + // View 947, Loop 8, Cel 0 = "SPEECH" (not pressed) + // View 947, Loop 8, Cel 1 = "SPEECH" (pressed) + // View 947, Loop 9, Cel 0 = "TEXT" (not pressed) + // View 947, Loop 9, Cel 1 = "TEXT" (pressed) + // View 947, Loop 12, Cel 0 = "DUAL" (not pressed) (<- our injected view) + // View 947, Loop 12, Cel 1 = "DUAL" (pressed) (<- our injected view) if ((g_sci->isCD()) && (resourceId == 947)) { + // security checks + if (_loopCount == 12) { + if ((_loop[8].celCount == 2) && (_loop[8].cel[0].width == 50) && (_loop[8].cel[0].height == 15)) { + // add another loop + LoopInfo *newLoops = new LoopInfo[_loopCount + 1]; + memcpy(newLoops, _loop, sizeof(LoopInfo) * _loopCount); + delete[] _loop; + _loop = newLoops; + _loopCount++; + // copy loop 8 to loop 12 + memcpy(&_loop[12], &_loop[8], sizeof(LoopInfo)); + _loop[12].cel = new CelInfo[2]; + // duplicate all cels of loop 8 and into loop 12 + memcpy(_loop[12].cel, _loop[8].cel, sizeof(CelInfo) * _loop[8].celCount); + // copy over our data (which is uncompressed bitmap data) + _loop[12].cel[0].rawBitmap = new byte[sizeof(ViewInject_KingsQuest6_Dual1)]; + memcpy(_loop[12].cel[0].rawBitmap, ViewInject_KingsQuest6_Dual1, sizeof(ViewInject_KingsQuest6_Dual1)); + _loop[12].cel[1].rawBitmap = new byte[sizeof(ViewInject_KingsQuest6_Dual2)]; + memcpy(_loop[12].cel[1].rawBitmap, ViewInject_KingsQuest6_Dual2, sizeof(ViewInject_KingsQuest6_Dual2)); + } + } } break; default: -- cgit v1.2.3 From fd80030f76252b7481c52b23d331f12564ba6637 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 24 Dec 2013 23:59:22 +0100 Subject: SCI: portraits cleanup + show base picture at end --- engines/sci/graphics/portrait.cpp | 43 +++++++++++++++++++++------------------ 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index e2abe32a45..d589ee17f9 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -176,36 +176,40 @@ void Portrait::init() { // last 4 bytes seem to be garbage } +// use this to print out kPortrait debug data +//#define DEBUG_PORTRAIT +// use this to use sync resources instead of rave resources (rave resources are better though) +//#define DEBUG_PORTRAIT_USE_SYNC_RESOURCES + void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint16 verb, uint16 cond, uint16 seq) { _position = position; // Now init audio and sync resource uint32 audioNumber = ((noun & 0xff) << 24) | ((verb & 0xff) << 16) | ((cond & 0xff) << 8) | (seq & 0xff); - //ResourceId syncResourceId = ResourceId(kResourceTypeSync36, resourceId, noun, verb, cond, seq); - //Resource *syncResource = _resMan->findResource(syncResourceId, true); +#ifndef DEBUG_PORTRAIT_USE_SYNC_RESOURCES ResourceId raveResourceId = ResourceId(kResourceTypeRave, resourceId, noun, verb, cond, seq); Resource *raveResource = _resMan->findResource(raveResourceId, true); - -#if 0 + uint raveOffset = 0; +#else + ResourceId syncResourceId = ResourceId(kResourceTypeSync36, resourceId, noun, verb, cond, seq); + Resource *syncResource = _resMan->findResource(syncResourceId, true); uint syncOffset = 0; #endif - -#if 0 + +#ifdef DEBUG_PORTRAIT // prints out the current lip sync ASCII data char debugPrint[4000]; if (raveResource->size < 4000) { memcpy(debugPrint, raveResource->data, raveResource->size); debugPrint[raveResource->size] = 0; // set terminating NUL + debug("kPortrait (noun %d, verb %d, cond %d, seq %d)", noun, verb, cond, seq); debug("kPortrait: %s", debugPrint); } #endif - // TODO: play through the game if this is 100% accurate // TODO: maybe try to create the missing sync resources for low-res KQ6 out of the rave resources - uint raveOffset = 0; - -#if 0 +#ifdef DEBUG_PORTRAIT_USE_SYNC_RESOURCES // Dump the sync resources to disk Common::DumpFile *outFile = new Common::DumpFile(); Common::String outName = syncResourceId.toPatchNameBase36() + ".sync36"; @@ -236,7 +240,8 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint // Start playing audio... _audio->stopAudio(); _audio->startAudio(resourceId, audioNumber); - + +#ifndef DEBUG_PORTRAIT_USE_SYNC_RESOURCES if (!raveResource) { warning("kPortrait: no rave resource %d %X", resourceId, audioNumber); return; @@ -319,9 +324,7 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint } } } - -// old sync resource code -#if 0 +#else if (!syncResource) { // Getting the book in the book shop calls kPortrait where no sync exists // TODO: find out what to do then @@ -369,17 +372,17 @@ void Portrait::doit(Common::Point position, uint16 resourceId, uint16 noun, uint } } #endif - + + // Reset the portrait bitmap to "closed mouth" state (rave.dll seems to do the same) + drawBitmap(0); + bitsShow(); if (userAbort) { - // Reset the portrait bitmap to "closed mouth" state, when skipping dialogs - drawBitmap(0); - bitsShow(); _audio->stopAudio(); } +#ifndef DEBUG_PORTRAIT_USE_SYNC_RESOURCES _resMan->unlockResource(raveResource); - -#if 0 +#else _resMan->unlockResource(syncResource); #endif } -- cgit v1.2.3 From f3691700436e647e808023180430263a6567bfaf Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Thu, 26 Dec 2013 11:39:01 +0100 Subject: SCI: floodfill reverted, was sci1early difference fixes sq4 floppy properly --- engines/sci/graphics/picture.cpp | 43 +++++++++++++++------------------------- 1 file changed, 16 insertions(+), 27 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 651eac75ea..7d7bca22a1 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -783,7 +783,13 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { case PIC_OPX_VGA_EMBEDDED_VIEW: // draw cel vectorGetAbsCoordsNoMirror(data, curPos, x, y); size = READ_LE_UINT16(data + curPos); curPos += 2; - _priority = pic_priority; // set global priority so the cel gets drawn using current priority as well + if (getSciVersion() <= SCI_VERSION_1_EARLY) { + // During SCI1Early sierra always used 0 as priority for cels inside picture resources + // fixes Space Quest 4 orange ship lifting off (bug #6446) + _priority = 0; + } else { + _priority = pic_priority; // set global priority so the cel gets drawn using current priority as well + } drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, 0, 0); curPos += size; break; @@ -919,32 +925,15 @@ void GfxPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, by } // This logic was taken directly from sierra sci, floodfill will get aborted on various occations - if (!_addToFlag) { - if (screenMask & GFX_SCREEN_MASK_VISUAL) { - if ((color == _screen->getColorWhite()) || (searchColor != _screen->getColorWhite())) - return; - } else if (screenMask & GFX_SCREEN_MASK_PRIORITY) { - if ((priority == 0) || (searchPriority != 0)) - return; - } else if (screenMask & GFX_SCREEN_MASK_CONTROL) { - if ((control == 0) || (searchControl != 0)) - return; - } - } else { - // When adding a picture onto another picture, don't abort in case current pixel was already drawn previously - // It seems Sierra SCI unpacks such pictures separately and then copies them over - // We draw directly to the screen. - // fixes Space Quest 4 orange ship lifting off (bug #6446) - if (screenMask & GFX_SCREEN_MASK_VISUAL) { - if (color == _screen->getColorWhite()) - return; - } else if (screenMask & GFX_SCREEN_MASK_PRIORITY) { - if (priority == 0) - return; - } else if (screenMask & GFX_SCREEN_MASK_CONTROL) { - if (control == 0) - return; - } + if (screenMask & GFX_SCREEN_MASK_VISUAL) { + if ((color == _screen->getColorWhite()) || (searchColor != _screen->getColorWhite())) + return; + } else if (screenMask & GFX_SCREEN_MASK_PRIORITY) { + if ((priority == 0) || (searchPriority != 0)) + return; + } else if (screenMask & GFX_SCREEN_MASK_CONTROL) { + if ((control == 0) || (searchControl != 0)) + return; } // Now remove screens, that already got the right color/priority/control -- cgit v1.2.3 From 488375effa17f6df74741d0a5c33881c701699c0 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Thu, 26 Dec 2013 16:44:51 +0100 Subject: SCI: fix sci1early+ ega picture issues also remove hacks for kq5ega + sq4ega --- engines/sci/graphics/picture.cpp | 134 +++++++++++++++++++++++++-------------- engines/sci/graphics/picture.h | 2 +- 2 files changed, 86 insertions(+), 50 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 7d7bca22a1..374f7208d8 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -132,7 +132,7 @@ void GfxPicture::drawSci11Vga() { _palette->createFromData(inbuffer + palette_data_ptr, size - palette_data_ptr, &palette); _palette->set(&palette, true); - drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, 0, 0, 0, 0); + drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, 0, 0, 0, 0, false); } // process vector data @@ -224,14 +224,14 @@ void GfxPicture::drawSci32Vga(int16 celNo, int16 drawX, int16 drawY, int16 pictu cel_RlePos = READ_SCI11ENDIAN_UINT32(inbuffer + cel_headerPos + 24); cel_LiteralPos = READ_SCI11ENDIAN_UINT32(inbuffer + cel_headerPos + 28); - drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, drawX, drawY, pictureX, pictureY); + drawCelData(inbuffer, size, cel_headerPos, cel_RlePos, cel_LiteralPos, drawX, drawY, pictureX, pictureY, false); cel_headerPos += 42; } #endif extern void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCount, int rlePos, int literalPos, ViewType viewType, uint16 width, bool isMacSci11ViewData); -void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY) { +void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY, bool isEGA) { byte *celBitmap = NULL; byte *ptr = NULL; byte *headerPtr = inbuffer + headerPos; @@ -239,13 +239,17 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos // displaceX, displaceY fields are ignored, and may contain garbage // (e.g. pic 261 in Dr. Brain 1 Spanish - bug #3614914) //int16 displaceX, displaceY; - byte priority = _addToFlag ? _priority : 0; + byte priority = _priority; byte clearColor; bool compression = true; byte curByte; int16 y, lastY, x, leftX, rightX; int pixelCount; uint16 width, height; + + // if the picture is not an overlay and we are also not in EGA mode, use priority 0 + if (!isEGA && !_addToFlag) + priority = 0; #ifdef ENABLE_SCI32 if (_resourceType != SCI_PICTURE_TYPE_SCI32) { @@ -360,37 +364,78 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos ptr = celBitmap; ptr += skipCelBitmapPixels; ptr += skipCelBitmapLines * width; - if (!_mirroredFlag) { - // Draw bitmap to screen - x = leftX; - while (y < lastY) { - curByte = *ptr++; - if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) - _screen->putPixel(x, y, drawMask, curByte, priority, 0); - - x++; - - if (x >= rightX) { - ptr += sourcePixelSkipPerRow; - x = leftX; - y++; + + if ((!isEGA) || (priority < 16)) { + // VGA + EGA, EGA only checks priority, when given priority is below 16 + if (!_mirroredFlag) { + // Draw bitmap to screen + x = leftX; + while (y < lastY) { + curByte = *ptr++; + if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) + _screen->putPixel(x, y, drawMask, curByte, priority, 0); + + x++; + + if (x >= rightX) { + ptr += sourcePixelSkipPerRow; + x = leftX; + y++; + } + } + } else { + // Draw bitmap to screen (mirrored) + x = rightX - 1; + while (y < lastY) { + curByte = *ptr++; + if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) + _screen->putPixel(x, y, drawMask, curByte, priority, 0); + + if (x == leftX) { + ptr += sourcePixelSkipPerRow; + x = rightX; + y++; + } + + x--; } } } else { - // Draw bitmap to screen (mirrored) - x = rightX - 1; - while (y < lastY) { - curByte = *ptr++; - if ((curByte != clearColor) && (priority >= _screen->getPriority(x, y))) - _screen->putPixel(x, y, drawMask, curByte, priority, 0); - - if (x == leftX) { - ptr += sourcePixelSkipPerRow; - x = rightX; - y++; + // EGA, when priority is above 15 + // we don't check priority and also won't set priority at all + // fixes picture 48 of kq5 (island overview). Bug #5182 + if (!_mirroredFlag) { + // EGA+priority>15: Draw bitmap to screen + x = leftX; + while (y < lastY) { + curByte = *ptr++; + if (curByte != clearColor) + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, curByte, 0, 0); + + x++; + + if (x >= rightX) { + ptr += sourcePixelSkipPerRow; + x = leftX; + y++; + } } + } else { + // EGA+priority>15: Draw bitmap to screen (mirrored) + x = rightX - 1; + while (y < lastY) { + curByte = *ptr++; + if (curByte != clearColor) + _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, curByte, 0, 0); + + if (x == leftX) { + ptr += sourcePixelSkipPerRow; + x = rightX; + y++; + } - x--; + x--; + } } } } @@ -540,22 +585,6 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { if ((_screen->isUnditheringEnabled()) && ((_resourceId >= 53 && _resourceId <= 58) || (_resourceId == 61))) icemanDrawFix = true; } - if (g_sci->getGameId() == GID_KQ5) { - // WORKAROUND: ignore the seemingly broken priority of picture 48 - // (island overview). Fixes bug #3041044. - if (_resourceId == 48) - ignoreBrokenPriority = true; - } - if (g_sci->getGameId() == GID_SQ4) { - // WORKAROUND: ignore the seemingly broken priority of pictures 546 - // and 547 (Vohaul's head and Roger Jr trapped). Fixes bug #3046543. - if (_resourceId == 546 || _resourceId == 547) - ignoreBrokenPriority = true; - // WORKAROUND: ignore the seemingly broken priority of picture 631 - // (SQ1 view from the cockpit). Fixes bug #3046513. - if (_resourceId == 631) - ignoreBrokenPriority = true; - } } // Drawing @@ -740,8 +769,15 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { case PIC_OPX_EGA_EMBEDDED_VIEW: vectorGetAbsCoordsNoMirror(data, curPos, x, y); size = READ_LE_UINT16(data + curPos); curPos += 2; - _priority = pic_priority; // set global priority so the cel gets drawn using current priority as well - drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, 0, 0); + // hardcoded in SSCI, 16 for SCI1early excluding Space Quest 4, 0 for anything else + // fixes sq4 pictures 546+547 (Vohaul's head and Roger Jr trapped). Bug #5250 + // fixes sq4 picture 631 (SQ1 view from cockpit). Bug 5249 + if ((getSciVersion() <= SCI_VERSION_1_EARLY) && (g_sci->getGameId() != GID_SQ4)) { + _priority = 16; + } else { + _priority = 0; + } + drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, 0, 0, true); curPos += size; break; case PIC_OPX_EGA_SET_PRIORITY_TABLE: @@ -790,7 +826,7 @@ void GfxPicture::drawVectorData(byte *data, int dataSize) { } else { _priority = pic_priority; // set global priority so the cel gets drawn using current priority as well } - drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, 0, 0); + drawCelData(data, _resource->size, curPos, curPos + 8, 0, x, y, 0, 0, false); curPos += size; break; case PIC_OPX_VGA_PRIORITY_TABLE_EQDIST: diff --git a/engines/sci/graphics/picture.h b/engines/sci/graphics/picture.h index 4f075a6226..53f83bc09f 100644 --- a/engines/sci/graphics/picture.h +++ b/engines/sci/graphics/picture.h @@ -65,7 +65,7 @@ private: void initData(GuiResourceId resourceId); void reset(); void drawSci11Vga(); - void drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY); + void drawCelData(byte *inbuffer, int size, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY, bool isEGA); void drawVectorData(byte *data, int size); bool vectorIsNonOpcode(byte pixel); void vectorGetAbsCoords(byte *data, int &curPos, int16 &x, int16 &y); -- cgit v1.2.3 From ac4087856f02725c288e1cef6b089acf7a6121aa Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 15 Dec 2013 08:17:57 +0000 Subject: ALL: Remove optimization unstable code on checking for null after new. These issues were identified by the STACK tool. By default, the C++ new operator will throw an exception on allocation failure, rather than returning a null pointer. The result is that testing the returned pointer for null is redundant and _may_ be removed by the compiler. This is thus optimization unstable and may result in incorrect behaviour at runtime. However, we do not use exceptions as they are not supported by all compilers and may be disabled. To make this stable without removing the null check, you could qualify the new operator call with std::nothrow to indicate that this should return a null, rather than throwing an exception. However, using (std::nothrow) was not desirable due to the Symbian toolchain lacking a header. A global solution to this was also not easy by redefining "new" as "new (std::nothrow)" due to custom constructors in NDS toolchain and various common classes. Also, this would then need explicit checks for OOM adding to all new usages as per C malloc which is untidy. For now to remove this optimisation unstable code is best as it is likely to not be present anyway, and OOM will cause a system library exception instead, even without exceptions enabled in the application code. --- engines/sci/graphics/picture.cpp | 2 -- engines/sci/graphics/ports.cpp | 5 ----- 2 files changed, 7 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 374f7208d8..caab1d80da 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -283,8 +283,6 @@ void GfxPicture::drawCelData(byte *inbuffer, int size, int headerPos, int rlePos // That needs to be done cause a mirrored picture may be requested pixelCount = width * height; celBitmap = new byte[pixelCount]; - if (!celBitmap) - error("Unable to allocate temporary memory for picture drawing"); if (g_sci->getPlatform() == Common::kPlatformMacintosh && getSciVersion() >= SCI_VERSION_2) { // See GfxView::unpackCel() for why this black/white swap is done diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index 6d9dc03195..ed0013b491 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -300,11 +300,6 @@ Window *GfxPorts::addWindow(const Common::Rect &dims, const Common::Rect *restor Window *pwnd = new Window(id); Common::Rect r; - if (!pwnd) { - error("Can't open window"); - return 0; - } - _windowsById[id] = pwnd; // KQ1sci, KQ4, iceman, QfG2 always add windows to the back of the list. -- cgit v1.2.3 From ed400d57fce69a88c9cdaf6dde03c89e22925968 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 17 Feb 2014 11:57:18 +0200 Subject: SCI: Fix NS rect calculation in GK1 (and SCI32 in general) This fixes the regressions caused by refactoring in SCI32. Thanks to Timo Korvola for tracking down the issue and providing an initial patch in bug #6452 --- engines/sci/graphics/compare.cpp | 10 +--------- engines/sci/graphics/compare.h | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp index b42063b119..8b89cf4a65 100644 --- a/engines/sci/graphics/compare.cpp +++ b/engines/sci/graphics/compare.cpp @@ -241,21 +241,13 @@ void GfxCompare::kernelBaseSetter(reg_t object) { } } -Common::Rect GfxCompare::getNSRect(reg_t object, bool fixRect) { +Common::Rect GfxCompare::getNSRect(reg_t object) { Common::Rect nsRect; nsRect.top = readSelectorValue(_segMan, object, SELECTOR(nsTop)); nsRect.left = readSelectorValue(_segMan, object, SELECTOR(nsLeft)); nsRect.bottom = readSelectorValue(_segMan, object, SELECTOR(nsBottom)); nsRect.right = readSelectorValue(_segMan, object, SELECTOR(nsRight)); - if (fixRect) { - // nsRect top/left may be negative, adjust accordingly - if (nsRect.top < 0) - nsRect.top = 0; - if (nsRect.left < 0) - nsRect.left = 0; - } - return nsRect; } diff --git a/engines/sci/graphics/compare.h b/engines/sci/graphics/compare.h index 0080406a3b..48e9e376b5 100644 --- a/engines/sci/graphics/compare.h +++ b/engines/sci/graphics/compare.h @@ -42,7 +42,7 @@ public: reg_t kernelCanBeHere(reg_t curObject, reg_t listReference); bool kernelIsItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position); void kernelBaseSetter(reg_t object); - Common::Rect getNSRect(reg_t object, bool fixRect = false); + Common::Rect getNSRect(reg_t object); void setNSRect(reg_t object, Common::Rect nsRect); private: -- cgit v1.2.3 From 8fc7d60febcadcaff901b331c5d1f454c073aef2 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:24 +0100 Subject: SCI: Make GPL headers consistent in themselves. --- engines/sci/graphics/animate.cpp | 4 ++-- engines/sci/graphics/animate.h | 4 ++-- engines/sci/graphics/cache.cpp | 4 ++-- engines/sci/graphics/cache.h | 4 ++-- engines/sci/graphics/compare.cpp | 4 ++-- engines/sci/graphics/compare.h | 4 ++-- engines/sci/graphics/controls16.cpp | 4 ++-- engines/sci/graphics/controls16.h | 4 ++-- engines/sci/graphics/controls32.cpp | 4 ++-- engines/sci/graphics/controls32.h | 4 ++-- engines/sci/graphics/coordadjuster.cpp | 4 ++-- engines/sci/graphics/coordadjuster.h | 4 ++-- engines/sci/graphics/cursor.cpp | 4 ++-- engines/sci/graphics/cursor.h | 4 ++-- engines/sci/graphics/font.cpp | 4 ++-- engines/sci/graphics/font.h | 4 ++-- engines/sci/graphics/fontsjis.cpp | 4 ++-- engines/sci/graphics/fontsjis.h | 4 ++-- engines/sci/graphics/frameout.cpp | 4 ++-- engines/sci/graphics/frameout.h | 4 ++-- engines/sci/graphics/helpers.h | 4 ++-- engines/sci/graphics/maciconbar.cpp | 4 ++-- engines/sci/graphics/maciconbar.h | 4 ++-- engines/sci/graphics/menu.cpp | 4 ++-- engines/sci/graphics/menu.h | 4 ++-- engines/sci/graphics/paint.cpp | 4 ++-- engines/sci/graphics/paint.h | 4 ++-- engines/sci/graphics/paint16.cpp | 4 ++-- engines/sci/graphics/paint16.h | 4 ++-- engines/sci/graphics/paint32.cpp | 4 ++-- engines/sci/graphics/paint32.h | 4 ++-- engines/sci/graphics/palette.cpp | 4 ++-- engines/sci/graphics/palette.h | 4 ++-- engines/sci/graphics/picture.cpp | 4 ++-- engines/sci/graphics/picture.h | 4 ++-- engines/sci/graphics/portrait.cpp | 4 ++-- engines/sci/graphics/portrait.h | 4 ++-- engines/sci/graphics/ports.cpp | 4 ++-- engines/sci/graphics/ports.h | 4 ++-- engines/sci/graphics/screen.cpp | 4 ++-- engines/sci/graphics/screen.h | 4 ++-- engines/sci/graphics/text16.cpp | 4 ++-- engines/sci/graphics/text16.h | 4 ++-- engines/sci/graphics/text32.cpp | 4 ++-- engines/sci/graphics/text32.h | 4 ++-- engines/sci/graphics/transitions.cpp | 4 ++-- engines/sci/graphics/transitions.h | 4 ++-- engines/sci/graphics/view.cpp | 4 ++-- engines/sci/graphics/view.h | 4 ++-- 49 files changed, 98 insertions(+), 98 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index 53715613fc..73cd7240d3 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/animate.h b/engines/sci/graphics/animate.h index 52da7d6ec6..6c1822c903 100644 --- a/engines/sci/graphics/animate.h +++ b/engines/sci/graphics/animate.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/cache.cpp b/engines/sci/graphics/cache.cpp index 55f8624c49..59af8334eb 100644 --- a/engines/sci/graphics/cache.cpp +++ b/engines/sci/graphics/cache.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/cache.h b/engines/sci/graphics/cache.h index 2f462fe042..33fa4fe399 100644 --- a/engines/sci/graphics/cache.h +++ b/engines/sci/graphics/cache.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp index 8b89cf4a65..3c2285a470 100644 --- a/engines/sci/graphics/compare.cpp +++ b/engines/sci/graphics/compare.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/compare.h b/engines/sci/graphics/compare.h index 48e9e376b5..88b44aeeb1 100644 --- a/engines/sci/graphics/compare.h +++ b/engines/sci/graphics/compare.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/controls16.cpp b/engines/sci/graphics/controls16.cpp index 0098f7b9ef..f2b2ccdfe6 100644 --- a/engines/sci/graphics/controls16.cpp +++ b/engines/sci/graphics/controls16.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/controls16.h b/engines/sci/graphics/controls16.h index 2cde86d4b1..6a70c71aae 100644 --- a/engines/sci/graphics/controls16.h +++ b/engines/sci/graphics/controls16.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/controls32.cpp b/engines/sci/graphics/controls32.cpp index 5b61e1a86a..90b5cd558c 100644 --- a/engines/sci/graphics/controls32.cpp +++ b/engines/sci/graphics/controls32.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/controls32.h b/engines/sci/graphics/controls32.h index 1b705988c2..5af7c20f16 100644 --- a/engines/sci/graphics/controls32.h +++ b/engines/sci/graphics/controls32.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/coordadjuster.cpp b/engines/sci/graphics/coordadjuster.cpp index 1446888cf4..93dff10382 100644 --- a/engines/sci/graphics/coordadjuster.cpp +++ b/engines/sci/graphics/coordadjuster.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/coordadjuster.h b/engines/sci/graphics/coordadjuster.h index 25279b34b1..cb0227fbe4 100644 --- a/engines/sci/graphics/coordadjuster.h +++ b/engines/sci/graphics/coordadjuster.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index a9c741670f..048ec1e9b9 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/cursor.h b/engines/sci/graphics/cursor.h index 369bd22a0b..c2d7998eb3 100644 --- a/engines/sci/graphics/cursor.h +++ b/engines/sci/graphics/cursor.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/font.cpp b/engines/sci/graphics/font.cpp index 30184cc091..e4684ff134 100644 --- a/engines/sci/graphics/font.cpp +++ b/engines/sci/graphics/font.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/font.h b/engines/sci/graphics/font.h index 8e5c980e2c..58b2ba4813 100644 --- a/engines/sci/graphics/font.h +++ b/engines/sci/graphics/font.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/fontsjis.cpp b/engines/sci/graphics/fontsjis.cpp index ac58c55423..9c942eadd1 100644 --- a/engines/sci/graphics/fontsjis.cpp +++ b/engines/sci/graphics/fontsjis.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/fontsjis.h b/engines/sci/graphics/fontsjis.h index ae5eaa43f9..57403ad98e 100644 --- a/engines/sci/graphics/fontsjis.h +++ b/engines/sci/graphics/fontsjis.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 76510fa53b..ffed7b596e 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index 5ef770486f..e0c60f92c1 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/helpers.h b/engines/sci/graphics/helpers.h index 773f83a00e..4889f12bd2 100644 --- a/engines/sci/graphics/helpers.h +++ b/engines/sci/graphics/helpers.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/maciconbar.cpp b/engines/sci/graphics/maciconbar.cpp index 4df80b289f..db9843ffb3 100644 --- a/engines/sci/graphics/maciconbar.cpp +++ b/engines/sci/graphics/maciconbar.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/maciconbar.h b/engines/sci/graphics/maciconbar.h index eca10b804c..86cbc74039 100644 --- a/engines/sci/graphics/maciconbar.h +++ b/engines/sci/graphics/maciconbar.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/menu.cpp b/engines/sci/graphics/menu.cpp index d2416ab4e0..8e8c1d64c2 100644 --- a/engines/sci/graphics/menu.cpp +++ b/engines/sci/graphics/menu.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/menu.h b/engines/sci/graphics/menu.h index aa3550da4e..95fd4f6c20 100644 --- a/engines/sci/graphics/menu.h +++ b/engines/sci/graphics/menu.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/paint.cpp b/engines/sci/graphics/paint.cpp index 7befa99afe..482b81aff1 100644 --- a/engines/sci/graphics/paint.cpp +++ b/engines/sci/graphics/paint.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/paint.h b/engines/sci/graphics/paint.h index 27f7e428b6..b2277131d5 100644 --- a/engines/sci/graphics/paint.h +++ b/engines/sci/graphics/paint.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp index 940a1ac3cf..b835eb92ca 100644 --- a/engines/sci/graphics/paint16.cpp +++ b/engines/sci/graphics/paint16.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/paint16.h b/engines/sci/graphics/paint16.h index e06021c3e7..882f311a5b 100644 --- a/engines/sci/graphics/paint16.h +++ b/engines/sci/graphics/paint16.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index a03e77dfa6..f94c65c76b 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/paint32.h b/engines/sci/graphics/paint32.h index 81e355f77f..e7a3ec256d 100644 --- a/engines/sci/graphics/paint32.h +++ b/engines/sci/graphics/paint32.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index d8d788b00a..a3624c7959 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h index e974781d49..347695deb8 100644 --- a/engines/sci/graphics/palette.h +++ b/engines/sci/graphics/palette.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index caab1d80da..434a490109 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/picture.h b/engines/sci/graphics/picture.h index 53f83bc09f..2404f99b41 100644 --- a/engines/sci/graphics/picture.h +++ b/engines/sci/graphics/picture.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/portrait.cpp b/engines/sci/graphics/portrait.cpp index d589ee17f9..488450485d 100644 --- a/engines/sci/graphics/portrait.cpp +++ b/engines/sci/graphics/portrait.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/portrait.h b/engines/sci/graphics/portrait.h index de0dbffb3f..877b253bcf 100644 --- a/engines/sci/graphics/portrait.h +++ b/engines/sci/graphics/portrait.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index ed0013b491..bd0b5f4081 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/ports.h b/engines/sci/graphics/ports.h index 1818eaddb3..51aca09f54 100644 --- a/engines/sci/graphics/ports.h +++ b/engines/sci/graphics/ports.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 0df163dd7b..15717239d8 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index 01fb899edb..c334638703 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp index 56e9ea8b69..245d6996cb 100644 --- a/engines/sci/graphics/text16.cpp +++ b/engines/sci/graphics/text16.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/text16.h b/engines/sci/graphics/text16.h index 321c7fc25e..ab0cb13a64 100644 --- a/engines/sci/graphics/text16.h +++ b/engines/sci/graphics/text16.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/text32.cpp b/engines/sci/graphics/text32.cpp index f14ae2ef0b..56ce73e8fa 100644 --- a/engines/sci/graphics/text32.cpp +++ b/engines/sci/graphics/text32.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/text32.h b/engines/sci/graphics/text32.h index ce78003fdf..7ba7df50e4 100644 --- a/engines/sci/graphics/text32.h +++ b/engines/sci/graphics/text32.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index b385c2c1db..5e7dbc6c15 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/transitions.h b/engines/sci/graphics/transitions.h index 246f681690..ae9ca4b48a 100644 --- a/engines/sci/graphics/transitions.h +++ b/engines/sci/graphics/transitions.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index 3d72743ff4..f3f352e5b8 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h index d3473f1024..d8803db208 100644 --- a/engines/sci/graphics/view.h +++ b/engines/sci/graphics/view.h @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3 From 740b6e8fbdece44ae2a5295cb0549a53b6dc6ae7 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 27 Feb 2014 21:27:23 -0500 Subject: IMAGE: Move all ImageDecoders to image/ --- engines/sci/graphics/maciconbar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/maciconbar.cpp b/engines/sci/graphics/maciconbar.cpp index db9843ffb3..8e2e12b7bd 100644 --- a/engines/sci/graphics/maciconbar.cpp +++ b/engines/sci/graphics/maciconbar.cpp @@ -32,7 +32,7 @@ #include "common/memstream.h" #include "common/system.h" #include "graphics/surface.h" -#include "graphics/decoders/pict.h" +#include "image/pict.h" namespace Sci { @@ -201,12 +201,12 @@ void GfxMacIconBar::setInventoryIcon(int16 icon) { } Graphics::Surface *GfxMacIconBar::loadPict(ResourceId id) { - Graphics::PICTDecoder pictDecoder; Resource *res = g_sci->getResMan()->findResource(id, false); if (!res || res->size == 0) return 0; + Image::PICTDecoder pictDecoder; Common::MemoryReadStream stream(res->data, res->size); if (!pictDecoder.loadStream(stream)) return 0; -- cgit v1.2.3 From daa8d57a866e2866369e432cf1d624179edc8875 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 27 May 2014 02:04:07 +0200 Subject: ALL: Rename Debugger::DebugPrintf to Debugger::debugPrintf. --- engines/sci/graphics/animate.cpp | 2 +- engines/sci/graphics/frameout.cpp | 10 +++++----- engines/sci/graphics/ports.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index 73cd7240d3..7957ed6a55 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -726,7 +726,7 @@ void GfxAnimate::printAnimateList(Console *con) { Script *scr = _s->_segMan->getScriptIfLoaded(it->object.getSegment()); int16 scriptNo = scr ? scr->getScriptNumber() : -1; - con->DebugPrintf("%04x:%04x (%s), script %d, view %d (%d, %d), pal %d, " + con->debugPrintf("%04x:%04x (%s), script %d, view %d (%d, %d), pal %d, " "at %d, %d, scale %d, %d / %d (z: %d, prio: %d, shown: %d, signal: %d)\n", PRINT_REG(it->object), _s->_segMan->getObjectName(it->object), scriptNo, it->viewId, it->loopNo, it->celNo, it->paletteNo, diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index ffed7b596e..a322eb8e61 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -852,21 +852,21 @@ void GfxFrameout::printPlaneList(Console *con) { Common::Rect r = p.upscaledPlaneRect; Common::Rect cr = p.upscaledPlaneClipRect; - con->DebugPrintf("%04x:%04x (%s): prio %d, lastprio %d, offsetX %d, offsetY %d, pic %d, mirror %d, back %d\n", + con->debugPrintf("%04x:%04x (%s): prio %d, lastprio %d, offsetX %d, offsetY %d, pic %d, mirror %d, back %d\n", PRINT_REG(p.object), curPlaneName.c_str(), (int16)p.priority, (int16)p.lastPriority, p.planeOffsetX, p.planeOffsetY, p.pictureId, p.planePictureMirrored, p.planeBack); - con->DebugPrintf(" rect: (%d, %d, %d, %d), clip rect: (%d, %d, %d, %d)\n", + con->debugPrintf(" rect: (%d, %d, %d, %d), clip rect: (%d, %d, %d, %d)\n", r.left, r.top, r.right, r.bottom, cr.left, cr.top, cr.right, cr.bottom); if (p.pictureId != 0xffff && p.pictureId != 0xfffe) { - con->DebugPrintf("Pictures:\n"); + con->debugPrintf("Pictures:\n"); for (PlanePictureList::iterator pictureIt = _planePictures.begin(); pictureIt != _planePictures.end(); pictureIt++) { if (pictureIt->object == p.object) { - con->DebugPrintf(" Picture %d: x %d, y %d\n", pictureIt->pictureId, pictureIt->startX, pictureIt->startY); + con->debugPrintf(" Picture %d: x %d, y %d\n", pictureIt->pictureId, pictureIt->startX, pictureIt->startY); } } } @@ -883,7 +883,7 @@ void GfxFrameout::printPlaneItemList(Console *con, reg_t planeObject) { Common::Rect icr = e->celRect; GuiResourceId picId = e->picture ? e->picture->getResourceId() : 0; - con->DebugPrintf("%d: %04x:%04x (%s), view %d, loop %d, cel %d, x %d, y %d, z %d, " + con->debugPrintf("%d: %04x:%04x (%s), view %d, loop %d, cel %d, x %d, y %d, z %d, " "signal %d, scale signal %d, scaleX %d, scaleY %d, rect (%d, %d, %d, %d), " "pic %d, picX %d, picY %d, visible %d\n", e->givenOrderNr, PRINT_REG(e->object), curItemName.c_str(), diff --git a/engines/sci/graphics/ports.cpp b/engines/sci/graphics/ports.cpp index bd0b5f4081..56c63a7b12 100644 --- a/engines/sci/graphics/ports.cpp +++ b/engines/sci/graphics/ports.cpp @@ -748,7 +748,7 @@ void GfxPorts::printWindowList(Console *con) { for (PortList::const_iterator it = _windowList.begin(); it != _windowList.end(); ++it) { if ((*it)->isWindow()) { Window *wnd = ((Window *)*it); - con->DebugPrintf("%d: '%s' at %d, %d, (%d, %d, %d, %d), drawn: %d, style: %d\n", + con->debugPrintf("%d: '%s' at %d, %d, (%d, %d, %d, %d), drawn: %d, style: %d\n", wnd->id, wnd->title.c_str(), wnd->left, wnd->top, wnd->rect.left, wnd->rect.top, wnd->rect.right, wnd->rect.bottom, wnd->bDrawn, wnd->wndStyle); -- cgit v1.2.3 From 94160a28e37326237abf990d280a211349197060 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sun, 1 Jun 2014 13:41:14 +0200 Subject: SCI: work on SCI0/01 Mac 480x300 scaling --- engines/sci/graphics/screen.cpp | 158 ++++++++++++++++++++++++---------------- engines/sci/graphics/screen.h | 14 ++-- 2 files changed, 106 insertions(+), 66 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 15717239d8..6b1cab95c6 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -50,6 +50,11 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { _upscaledHires = GFX_SCREEN_UPSCALED_640x480; #endif } + + if (g_sci->getPlatform() == Common::kPlatformMacintosh) { + if (getSciVersion() <= SCI_VERSION_01) + _upscaledHires = GFX_SCREEN_UPSCALED_480x300; + } #ifdef ENABLE_SCI32 // GK1 Mac uses a 640x480 resolution too @@ -84,28 +89,48 @@ GfxScreen::GfxScreen(ResourceManager *resMan) : _resMan(resMan) { _pixels = _pitch * _height; switch (_upscaledHires) { + case GFX_SCREEN_UPSCALED_480x300: + // Space Quest 3, Hoyle 1+2 on MAC use this one + // TODO: Sierra's upscaling worked differently. We need to figure out the exact algo + _displayWidth = 480; + _displayHeight = 300; + for (int i = 0; i <= _height; i++) + _upscaledHeightMapping[i] = (i * 3) >> 1; + for (int i = 0; i <= _width; i++) + _upscaledWidthMapping[i] = (i * 3) >> 1; + break; case GFX_SCREEN_UPSCALED_640x400: + // Police Quest 2 and Quest For Glory on PC9801 (Japanese) _displayWidth = 640; _displayHeight = 400; for (int i = 0; i <= _height; i++) - _upscaledMapping[i] = i * 2; + _upscaledHeightMapping[i] = i * 2; + for (int i = 0; i <= _width; i++) + _upscaledWidthMapping[i] = i * 2; break; case GFX_SCREEN_UPSCALED_640x440: + // used by King's Quest 6 on Windows _displayWidth = 640; _displayHeight = 440; for (int i = 0; i <= _height; i++) - _upscaledMapping[i] = (i * 11) / 5; + _upscaledHeightMapping[i] = (i * 11) / 5; + for (int i = 0; i <= _width; i++) + _upscaledWidthMapping[i] = i * 2; break; case GFX_SCREEN_UPSCALED_640x480: + // Gabriel Knight 1 (VESA, Mac) _displayWidth = 640; _displayHeight = 480; for (int i = 0; i <= _height; i++) - _upscaledMapping[i] = (i * 12) / 5; + _upscaledHeightMapping[i] = (i * 12) / 5; + for (int i = 0; i <= _width; i++) + _upscaledWidthMapping[i] = i * 2; break; default: _displayWidth = _pitch; _displayHeight = _height; - memset(&_upscaledMapping, 0, sizeof(_upscaledMapping) ); + memset(&_upscaledHeightMapping, 0, sizeof(_upscaledHeightMapping) ); + memset(&_upscaledWidthMapping, 0, sizeof(_upscaledWidthMapping) ); break; } @@ -185,8 +210,9 @@ void GfxScreen::copyRectToScreen(const Common::Rect &rect) { if (!_upscaledHires) { g_system->copyRectToScreen(_activeScreen + rect.top * _displayWidth + rect.left, _displayWidth, rect.left, rect.top, rect.width(), rect.height()); } else { - int rectHeight = _upscaledMapping[rect.bottom] - _upscaledMapping[rect.top]; - g_system->copyRectToScreen(_activeScreen + _upscaledMapping[rect.top] * _displayWidth + rect.left * 2, _displayWidth, rect.left * 2, _upscaledMapping[rect.top], rect.width() * 2, rectHeight); + int rectHeight = _upscaledHeightMapping[rect.bottom] - _upscaledHeightMapping[rect.top]; + int rectWidth = _upscaledWidthMapping[rect.right] - _upscaledWidthMapping[rect.left]; + g_system->copyRectToScreen(_activeScreen + _upscaledHeightMapping[rect.top] * _displayWidth + _upscaledWidthMapping[rect.left], _displayWidth, _upscaledWidthMapping[rect.left], _upscaledHeightMapping[rect.top], rectWidth, rectHeight); } } @@ -204,8 +230,10 @@ void GfxScreen::copyRectToScreen(const Common::Rect &rect, int16 x, int16 y) { if (!_upscaledHires) { g_system->copyRectToScreen(_activeScreen + rect.top * _displayWidth + rect.left, _displayWidth, x, y, rect.width(), rect.height()); } else { - int rectHeight = _upscaledMapping[rect.bottom] - _upscaledMapping[rect.top]; - g_system->copyRectToScreen(_activeScreen + _upscaledMapping[rect.top] * _displayWidth + rect.left * 2, _displayWidth, x * 2, _upscaledMapping[y], rect.width() * 2, rectHeight); + int rectHeight = _upscaledHeightMapping[rect.bottom] - _upscaledHeightMapping[rect.top]; + int rectWidth = _upscaledWidthMapping[rect.right] - _upscaledWidthMapping[rect.left]; + + g_system->copyRectToScreen(_activeScreen + _upscaledHeightMapping[rect.top] * _displayWidth + _upscaledWidthMapping[rect.left], _displayWidth, _upscaledWidthMapping[x], _upscaledHeightMapping[y], rectWidth, rectHeight); } } @@ -228,14 +256,7 @@ void GfxScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, if (!_upscaledHires) { _displayScreen[offset] = color; } else { - int displayOffset = _upscaledMapping[y] * _displayWidth + x * 2; - int heightOffsetBreak = (_upscaledMapping[y + 1] - _upscaledMapping[y]) * _displayWidth; - int heightOffset = 0; - do { - _displayScreen[displayOffset + heightOffset] = color; - _displayScreen[displayOffset + heightOffset + 1] = color; - heightOffset += _displayWidth; - } while (heightOffset != heightOffsetBreak); + putScaledPixelOnDisplay(x, y, color); } } if (drawMask & GFX_SCREEN_MASK_PRIORITY) @@ -250,22 +271,21 @@ void GfxScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, * Sierra SCI didn't do this */ void GfxScreen::putFontPixel(int startingY, int x, int y, byte color) { + int actualY = startingY + y; if (_fontIsUpscaled) { // Do not scale ourselves, but put it on the display directly - putPixelOnDisplay(x, y + startingY, color); + putPixelOnDisplay(x, actualY, color); } else { - int offset = (startingY + y) * _pitch + x; + int offset = actualY * _pitch + x; _visualScreen[offset] = color; - if (!_upscaledHires) { + switch (_upscaledHires) { + case GFX_SCREEN_UPSCALED_DISABLED: _displayScreen[offset] = color; - } else { - int displayOffset = (_upscaledMapping[startingY] + y * 2) * _displayWidth + x * 2; - _displayScreen[displayOffset] = color; - _displayScreen[displayOffset + 1] = color; - displayOffset += _displayWidth; - _displayScreen[displayOffset] = color; - _displayScreen[displayOffset + 1] = color; + break; + default: + putScaledPixelOnDisplay(x, actualY, color); + break; } } } @@ -280,6 +300,21 @@ void GfxScreen::putPixelOnDisplay(int x, int y, byte color) { _displayScreen[offset] = color; } +void GfxScreen::putScaledPixelOnDisplay(int x, int y, byte color) { + int displayOffset = _upscaledHeightMapping[y] * _displayWidth + _upscaledWidthMapping[x]; + int heightOffsetBreak = (_upscaledHeightMapping[y + 1] - _upscaledHeightMapping[y]) * _displayWidth; + int heightOffset = 0; + int widthOffsetBreak = _upscaledWidthMapping[x + 1] - _upscaledWidthMapping[x]; + do { + int widthOffset = 0; + do { + _displayScreen[displayOffset + heightOffset + widthOffset] = color; + widthOffset++; + } while (widthOffset != widthOffsetBreak); + heightOffset += _displayWidth; + } while (heightOffset != heightOffsetBreak); +} + /** * Sierra's Bresenham line drawing. * WARNING: Do not replace this with Graphics::drawLine(), as this causes issues @@ -409,8 +444,9 @@ int GfxScreen::bitsGetDataSize(Common::Rect rect, byte mask) { if (!_upscaledHires) { byteCount += pixels; // _displayScreen } else { - int rectHeight = _upscaledMapping[rect.bottom] - _upscaledMapping[rect.top]; - byteCount += rectHeight * rect.width() * 2; // _displayScreen (upscaled hires) + int rectHeight = _upscaledHeightMapping[rect.bottom] - _upscaledHeightMapping[rect.top]; + int rectWidth = _upscaledWidthMapping[rect.right] - _upscaledWidthMapping[rect.left]; + byteCount += rectHeight * rect.width() * rectWidth; // _displayScreen (upscaled hires) } } if (mask & GFX_SCREEN_MASK_PRIORITY) { @@ -463,16 +499,17 @@ void GfxScreen::bitsSaveScreen(Common::Rect rect, byte *screen, uint16 screenWid void GfxScreen::bitsSaveDisplayScreen(Common::Rect rect, byte *&memoryPtr) { byte *screen = _displayScreen; - int width = rect.width(); + int width; int y; if (!_upscaledHires) { + width = rect.width(); screen += (rect.top * _displayWidth) + rect.left; } else { - screen += (_upscaledMapping[rect.top] * _displayWidth) + rect.left * 2; - width *= 2; - rect.top = _upscaledMapping[rect.top]; - rect.bottom = _upscaledMapping[rect.bottom]; + screen += (_upscaledHeightMapping[rect.top] * _displayWidth) + _upscaledWidthMapping[rect.left]; + width = _upscaledWidthMapping[rect.right] - _upscaledWidthMapping[rect.left]; + rect.top = _upscaledHeightMapping[rect.top]; + rect.bottom = _upscaledHeightMapping[rect.bottom]; } for (y = rect.top; y < rect.bottom; y++) { @@ -528,16 +565,17 @@ void GfxScreen::bitsRestoreScreen(Common::Rect rect, byte *&memoryPtr, byte *scr void GfxScreen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) { byte *screen = _displayScreen; - int width = rect.width(); + int width; int y; if (!_upscaledHires) { screen += (rect.top * _displayWidth) + rect.left; + width = rect.width(); } else { - screen += (_upscaledMapping[rect.top] * _displayWidth) + rect.left * 2; - width *= 2; - rect.top = _upscaledMapping[rect.top]; - rect.bottom = _upscaledMapping[rect.bottom]; + screen += (_upscaledHeightMapping[rect.top] * _displayWidth) + _upscaledWidthMapping[rect.left]; + width = _upscaledWidthMapping[rect.right] - _upscaledWidthMapping[rect.left]; + rect.top = _upscaledHeightMapping[rect.top]; + rect.bottom = _upscaledHeightMapping[rect.bottom]; } for (y = rect.top; y < rect.bottom; y++) { @@ -550,7 +588,7 @@ void GfxScreen::setVerticalShakePos(uint16 shakePos) { if (!_upscaledHires) g_system->setShakePos(shakePos); else - g_system->setShakePos(shakePos * 2); + g_system->setShakePos(_upscaledHeightMapping[shakePos]); } void GfxScreen::kernelShakeScreen(uint16 shakeCount, uint16 directions) { @@ -583,20 +621,19 @@ void GfxScreen::dither(bool addToFlag) { if (color & 0xF0) { color ^= color << 4; color = ((x^y) & 1) ? color >> 4 : color & 0x0F; - *displayPtr = color; - if (_upscaledHires) { - *(displayPtr + 1) = color; - *(displayPtr + _displayWidth) = color; - *(displayPtr + _displayWidth + 1) = color; + switch (_upscaledHires) { + case GFX_SCREEN_UPSCALED_DISABLED: + *displayPtr = color; + displayPtr++; + break; + default: + putScaledPixelOnDisplay(x, y, color); + break; } *visualPtr = color; } - visualPtr++; displayPtr++; - if (_upscaledHires) - displayPtr++; + visualPtr++; } - if (_upscaledHires) - displayPtr += _displayWidth; } } else { if (!addToFlag) @@ -616,21 +653,20 @@ void GfxScreen::dither(bool addToFlag) { } else { ditheredColor = color << 4; } - *displayPtr = ditheredColor; - if (_upscaledHires) { - *(displayPtr + 1) = ditheredColor; - *(displayPtr + _displayWidth) = ditheredColor; - *(displayPtr + _displayWidth + 1) = ditheredColor; + switch (_upscaledHires) { + case GFX_SCREEN_UPSCALED_DISABLED: + *displayPtr = ditheredColor; + displayPtr++; + break; + default: + putScaledPixelOnDisplay(x, y, ditheredColor); + break; } color = ((x^y) & 1) ? color >> 4 : color & 0x0F; *visualPtr = color; } - visualPtr++; displayPtr++; - if (_upscaledHires) - displayPtr++; + visualPtr++; } - if (_upscaledHires) - displayPtr += _displayWidth; } } } @@ -722,8 +758,8 @@ static const UpScaledAdjust s_upscaledAdjustTable[] = { }; void GfxScreen::adjustToUpscaledCoordinates(int16 &y, int16 &x, Sci32ViewNativeResolution viewNativeRes) { - x *= 2; - y = _upscaledMapping[y]; + x = _upscaledWidthMapping[x]; + y = _upscaledHeightMapping[y]; for (int i = 0; i < ARRAYSIZE(s_upscaledAdjustTable); i++) { if (s_upscaledAdjustTable[i].gameHiresMode == _upscaledHires && diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index c334638703..e266a4ed16 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -32,12 +32,14 @@ namespace Sci { #define SCI_SCREEN_UPSCALEDMAXHEIGHT 200 +#define SCI_SCREEN_UPSCALEDMAXWIDTH 320 enum GfxScreenUpscaledMode { GFX_SCREEN_UPSCALED_DISABLED = 0, - GFX_SCREEN_UPSCALED_640x400 = 1, - GFX_SCREEN_UPSCALED_640x440 = 2, - GFX_SCREEN_UPSCALED_640x480 = 3 + GFX_SCREEN_UPSCALED_480x300 = 1, + GFX_SCREEN_UPSCALED_640x400 = 2, + GFX_SCREEN_UPSCALED_640x440 = 3, + GFX_SCREEN_UPSCALED_640x480 = 4 }; enum GfxScreenMasks { @@ -83,6 +85,7 @@ public: void putPixel(int x, int y, byte drawMask, byte color, byte prio, byte control); void putFontPixel(int startingY, int x, int y, byte color); void putPixelOnDisplay(int x, int y, byte color); + void putScaledPixelOnDisplay(int x, int y, byte color); void drawLine(Common::Point startPoint, Common::Point endPoint, byte color, byte prio, byte control); void drawLine(int16 left, int16 top, int16 right, int16 bottom, byte color, byte prio, byte control) { drawLine(Common::Point(left, top), Common::Point(right, bottom), color, prio, control); @@ -184,10 +187,11 @@ private: GfxScreenUpscaledMode _upscaledHires; /** - * This here holds a translation for vertical coordinates between native + * This here holds a translation for vertical+horizontal coordinates between native * (visual) and actual (display) screen. */ - int _upscaledMapping[SCI_SCREEN_UPSCALEDMAXHEIGHT + 1]; + int _upscaledHeightMapping[SCI_SCREEN_UPSCALEDMAXHEIGHT + 1]; + int _upscaledWidthMapping[SCI_SCREEN_UPSCALEDMAXWIDTH + 1]; /** * This defines whether or not the font we're drawing is already scaled -- cgit v1.2.3 From c1e895d7992bd5937604eb8d64cdc1c1611a11bd Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Mon, 2 Jun 2014 01:37:08 +0200 Subject: SCI: fix regression introduced by 480x300 commit fix EGA graphic corruption --- engines/sci/graphics/screen.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 6b1cab95c6..806881cc2a 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -624,7 +624,6 @@ void GfxScreen::dither(bool addToFlag) { switch (_upscaledHires) { case GFX_SCREEN_UPSCALED_DISABLED: *displayPtr = color; - displayPtr++; break; default: putScaledPixelOnDisplay(x, y, color); @@ -632,7 +631,7 @@ void GfxScreen::dither(bool addToFlag) { } *visualPtr = color; } - visualPtr++; + visualPtr++; displayPtr++; } } } else { @@ -656,7 +655,6 @@ void GfxScreen::dither(bool addToFlag) { switch (_upscaledHires) { case GFX_SCREEN_UPSCALED_DISABLED: *displayPtr = ditheredColor; - displayPtr++; break; default: putScaledPixelOnDisplay(x, y, ditheredColor); @@ -665,7 +663,7 @@ void GfxScreen::dither(bool addToFlag) { color = ((x^y) & 1) ? color >> 4 : color & 0x0F; *visualPtr = color; } - visualPtr++; + visualPtr++; displayPtr++; } } } -- cgit v1.2.3 From cebb3e340a5c7ab74e7ea1a34a39c7dab0040022 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 3 Jun 2014 22:42:56 +0200 Subject: SCI32: fix crash during gabriel knight intro --- engines/sci/graphics/paint32.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index f94c65c76b..7d106b5b02 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -43,8 +43,12 @@ GfxPaint32::~GfxPaint32() { void GfxPaint32::fillRect(Common::Rect rect, byte color) { int16 y, x; - for (y = rect.top; y < rect.bottom; y++) { - for (x = rect.left; x < rect.right; x++) { + Common::Rect clipRect = rect; + + clipRect.clip(_screen->getWidth(), _screen->getHeight()); + + for (y = clipRect.top; y < clipRect.bottom; y++) { + for (x = clipRect.left; x < clipRect.right; x++) { _screen->putPixel(x, y, GFX_SCREEN_MASK_VISUAL, color, 0, 0); } } -- cgit v1.2.3 From 924f1f1fee3f46a6bfcd6182631bdd91f61c279e Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Sun, 8 Jun 2014 23:09:35 +0200 Subject: SCI: fix coordination translation for 480x300 mac --- engines/sci/graphics/screen.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/sci/graphics') diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 806881cc2a..c5c94d7991 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -778,6 +778,10 @@ void GfxScreen::adjustBackUpscaledCoordinates(int16 &y, int16 &x, Sci32ViewNativ } switch (_upscaledHires) { + case GFX_SCREEN_UPSCALED_480x300: + x = (x << 1) / 3; + y = (y << 1) / 3; + break; case GFX_SCREEN_UPSCALED_640x400: x /= 2; y /= 2; -- cgit v1.2.3