[Scummvm-cvs-logs] scummvm master -> 756a343cb85760093d1906cc91644e4d10522382

Strangerke arnaud.boutonne at gmail.com
Sat Feb 26 14:07:03 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:
756a343cb8 HUGO: Fix graphic glitches in DOS versions


Commit: 756a343cb85760093d1906cc91644e4d10522382
    https://github.com/scummvm/scummvm/commit/756a343cb85760093d1906cc91644e4d10522382
Author: strangerke (arnaud.boutonne at gmail.com)
Date: 2011-02-26T05:06:30-08:00

Commit Message:
HUGO: Fix graphic glitches in DOS versions

Changed paths:
    engines/hugo/display.cpp
    engines/hugo/display.h



diff --git a/engines/hugo/display.cpp b/engines/hugo/display.cpp
index 6c36318..42cde6f 100644
--- a/engines/hugo/display.cpp
+++ b/engines/hugo/display.cpp
@@ -233,24 +233,6 @@ void Screen::setBackgroundColor(const uint16 color) {
 }
 
 /**
- * Return the overlay state (Foreground/Background) of the currently
- * processed object by looking down the current column for an overlay
- * base bit set (in which case the object is foreground).
- */
-overlayState_t Screen::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 bits
-		if (ovb & (0x80 >> ((uint16)(dst_p - _frontBuffer) & 7))) // Overlay bit is set
-			return kOvlForeground;                  // Found a bit - must be foreground
-		dst_p += kXPix;
-	}
-
-	return kOvlBackground;                          // No bits set, must be background
-}
-
-/**
  * Merge an object frame into _frontBuffer at sx, sy and update rectangle list.
  * If fore TRUE, force object above any overlay
  */
@@ -740,6 +722,24 @@ void Screen_v1d::loadFontArr(Common::ReadStream &in) {
 	}
 }
 
+/**
+ * Return the overlay state (Foreground/Background) of the currently
+ * processed object by looking down the current column for an overlay
+ * base byte set (in which case the object is foreground).
+ */
+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. 
+			return kOvlForeground;
+		dst_p += kXPix;
+	}
+
+	return kOvlBackground;                          // No bits set, must be background
+}
+
 Screen_v1w::Screen_v1w(HugoEngine *vm) : Screen(vm) {
 }
 
@@ -790,5 +790,23 @@ void Screen_v1w::loadFontArr(Common::ReadStream &in) {
 	}
 }
 
+/**
+ * Return the overlay state (Foreground/Background) of the currently
+ * processed object by looking down the current column for an overlay
+ * base bit set (in which case the object is foreground).
+ */
+overlayState_t Screen_v1w::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 bits
+		if (ovb & (0x80 >> ((uint16)(dst_p - _frontBuffer) & 7))) // Overlay bit is set
+			return kOvlForeground;                  // Found a bit - must be foreground
+		dst_p += kXPix;
+	}
+
+	return kOvlBackground;                          // No bits set, must be background
+}
+
 } // End of namespace Hugo
 
diff --git a/engines/hugo/display.h b/engines/hugo/display.h
index f234f76..91e1752 100644
--- a/engines/hugo/display.h
+++ b/engines/hugo/display.h
@@ -101,10 +101,6 @@ protected:
 	static const byte stdMouseCursorHeight = 20;
 	static const byte stdMouseCursorWidth = 12;
 
-	inline bool isInX(const int16 x, const rect_t *rect) const;
-	inline bool isInY(const int16 y, const rect_t *rect) const;
-	inline bool isOverlapping(const rect_t *rectA, const rect_t *rectB) const;
-
 	bool fontLoadedFl[kNumFonts];
 
 	// Fonts used in dib (non-GDI)
@@ -115,6 +111,14 @@ protected:
 	byte *_mainPalette;
 	int16 _arrayFontSize[kNumFonts];
 
+	viewdib_t _frontBuffer;
+
+	inline bool isInX(const int16 x, const rect_t *rect) const;
+	inline bool isInY(const int16 y, const rect_t *rect) const;
+	inline bool isOverlapping(const rect_t *rectA, const rect_t *rectB) const;
+
+	virtual overlayState_t findOvl(seq_t *seq_p, image_pt dst_p, uint16 y) = 0;
+
 private:
 	byte     *_curPalette;
 	byte      _iconImage[kInvDx * kInvDy];
@@ -125,9 +129,6 @@ private:
 	int16 mergeLists(rect_t *list, rect_t *blist, const int16 len, int16 blen);
 	int16 center(const char *s) const;
 
-	overlayState_t findOvl(seq_t *seq_p, image_pt dst_p, uint16 y);
-
-	viewdib_t _frontBuffer;
 	viewdib_t _backBuffer;
 	viewdib_t _GUIBuffer;                              // User interface images
 	viewdib_t _backBufferBackup;                       // Backup _backBuffer during inventory
@@ -151,6 +152,8 @@ public:
 
 	void loadFont(int16 fontId);
 	void loadFontArr(Common::ReadStream &in);
+protected:
+	overlayState_t findOvl(seq_t *seq_p, image_pt dst_p, uint16 y);
 };
 
 class Screen_v1w : public Screen {
@@ -160,6 +163,8 @@ public:
 
 	void loadFont(int16 fontId);
 	void loadFontArr(Common::ReadStream &in);
+protected:
+	overlayState_t findOvl(seq_t *seq_p, image_pt dst_p, uint16 y);
 };
 
 } // End of namespace Hugo






More information about the Scummvm-git-logs mailing list