[Scummvm-cvs-logs] scummvm master -> a99b394836150bef7be8bc79cf656c343d703782
Strangerke
arnaud.boutonne at gmail.com
Sun Feb 27 01:05:11 CET 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a99b394836 HUGO: Better fix for graphics glitches in DOS versions, fix H3 ending animation
Commit: a99b394836150bef7be8bc79cf656c343d703782
https://github.com/scummvm/scummvm/commit/a99b394836150bef7be8bc79cf656c343d703782
Author: strangerke (arnaud.boutonne at gmail.com)
Date: 2011-02-26T16:04:49-08:00
Commit Message:
HUGO: Better fix for graphics glitches in DOS versions, fix H3 ending animation
Changed paths:
engines/hugo/display.cpp
engines/hugo/hugo.cpp
diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 42cde6f..f9b8923 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -243,7 +243,7 @@ void Screen::displayFrame(const int sx, const int sy, seq_t *seq, const bool for
image_pt subFrontBuffer = &_frontBuffer[sy * kXPix + sx]; // Ptr to offset in _frontBuffer
int16 frontBufferwrap = kXPix - seq->x2 - 1; // Wraps dest_p after each line
int16 imageWrap = seq->bytesPerLine8 - seq->x2 - 1;
- overlayState_t overlayState = kOvlUndef; // Overlay state of object
+ overlayState_t overlayState = (foreFl) ? kOvlForeground : kOvlUndef; // Overlay state of object
for (uint16 y = 0; y < seq->lines; y++) { // Each line in object
for (uint16 x = 0; x <= seq->x2; x++) {
if (*image) { // Non-transparent
@@ -251,7 +251,7 @@ void Screen::displayFrame(const int sx, const int sy, seq_t *seq, const bool for
if (ovlBound & (0x80 >> ((uint16)(subFrontBuffer - _frontBuffer) & 7))) { // Overlay bit is set
if (overlayState == kOvlUndef) // Overlay defined yet?
overlayState = findOvl(seq, subFrontBuffer, y);// No, find it.
- if (foreFl || overlayState == kOvlForeground) // Object foreground
+ if (overlayState == kOvlForeground) // Object foreground
*subFrontBuffer = *image; // Copy pixel
} else { // No overlay
*subFrontBuffer = *image; // Copy pixel
@@ -730,11 +730,12 @@ void Screen_v1d::loadFontArr(Common::ReadStream &in) {
overlayState_t Screen_v1d::findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) {
debugC(4, kDebugDisplay, "findOvl()");
- for (; y < seq_p->lines; y++) { // Each line in object
- byte ovb = _vm->_object->getBaseBoundary((uint16)(dst_p - _frontBuffer) >> 3); // Ptr into overlay bytes
- if (ovb) // If any overlay base byte is non-zero then the object is foreground, else back.
+ uint16 index = (uint16)(dst_p - _frontBuffer) >> 3;
+
+ for (int i = 0; i < seq_p->lines-y; i++) { // Each line in object
+ if (_vm->_object->getBaseBoundary(index)) // If any overlay base byte is non-zero then the object is foreground, else back.
return kOvlForeground;
- dst_p += kXPix;
+ index += kCompLineSize;
}
return kOvlBackground; // No bits set, must be background
diff --git a/engines/hugo/hugo.cpp b/engines/hugo/hugo.cpp
index 8d5fa87..226009e 100644
--- a/engines/hugo/hugo.cpp
+++ b/engines/hugo/hugo.cpp
@@ -631,6 +631,13 @@ void HugoEngine::readScreenFiles(const int screenNum) {
_file->readBackground(screenNum); // Scenery file
memcpy(_screen->getBackBuffer(), _screen->getFrontBuffer(), sizeof(_screen->getFrontBuffer())); // Make a copy
+
+ // Workaround for graphic glitches in DOS versions. Cleaning the overlays fix the problem
+ memset(_object->_objBound, '\0', sizeof(overlay_t));
+ memset(_object->_boundary, '\0', sizeof(overlay_t));
+ memset(_object->_overlay, '\0', sizeof(overlay_t));
+ memset(_object->_ovlBase, '\0', sizeof(overlay_t));
+
_file->readOverlay(screenNum, _object->_boundary, kOvlBoundary); // Boundary file
_file->readOverlay(screenNum, _object->_overlay, kOvlOverlay); // Overlay file
_file->readOverlay(screenNum, _object->_ovlBase, kOvlBase); // Overlay base file
More information about the Scummvm-git-logs
mailing list