From 317bd9ebd088ed1e0329d14d9571015e31cc8de6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 24 Feb 2013 22:03:38 -0500 Subject: HOPKINS: Beginnings of implementing dirty rect support --- engines/hopkins/graphics.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 6dc8ec6849..c0d14f06e0 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -31,6 +31,7 @@ namespace Hopkins { +#define DIRTY_RECTS_SIZE 250 #define PALETTE_SIZE 256 #define PALETTE_BLOCK_SIZE (PALETTE_SIZE * 3) #define PALETTE_EXT_BLOCK_SIZE 800 @@ -63,7 +64,8 @@ private: bool _initGraphicsFl; int _screenWidth; int _screenHeight; - Graphics::Surface *_videoPtr; + byte *_videoPtr; + bool _isPhysicalPtr; int _width; int _posXClipped, _posYClipped; bool _clipFl; @@ -94,6 +96,7 @@ public: byte _oldPalette[PALETTE_EXT_BLOCK_SIZE]; byte *_vesaScreen; byte *_vesaBuffer; + byte *_screenBuffer; int _scrollOffset; int _scrollPosX; bool _largeScreenFl; @@ -108,8 +111,8 @@ public: bool _skipVideoLockFl; int _fadeDefaultSpeed; - int NBBLOC; - BlocItem BLOC[250]; + int _dirtyRectCount; + BlocItem _dirtyRects[DIRTY_RECTS_SIZE]; int WinScan; byte *PAL_PIXELS; bool MANU_SCROLL; @@ -119,7 +122,7 @@ public: ~GraphicsManager(); void setParent(HopkinsEngine *vm); - void lockScreen(); + void lockScreen(bool shouldUsePhysicalScreen = false); void unlockScreen(); void clearPalette(); void clearScreen(); -- cgit v1.2.3 From 54924de6cbd07e8b8cb2eb91067a0d31d08b55c8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 25 Feb 2013 22:00:36 -0500 Subject: HOPKINS: Home-screen now displaying correctly with dirty rects --- engines/hopkins/graphics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index c0d14f06e0..0db51a09a1 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -126,7 +126,7 @@ public: void unlockScreen(); void clearPalette(); void clearScreen(); - void addVesaSegment(int x1, int y1, int x2, int y2); + void addDirtyRect(int x1, int y1, int x2, int y2); void copySurface(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY); void loadImage(const Common::String &file); void loadVgaImage(const Common::String &file); -- cgit v1.2.3 From d738802bc1d1441fee8bce3881cd5233044305d6 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Mar 2013 17:30:42 -0500 Subject: HOPKINS: Converted dirty rects to use Common::Array --- engines/hopkins/graphics.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 0db51a09a1..72fd87c7c3 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -24,6 +24,7 @@ #define HOPKINS_GRAPHICS_H #include "common/scummsys.h" +#include "common/array.h" #include "common/endian.h" #include "common/rect.h" #include "common/str.h" @@ -46,14 +47,6 @@ struct RGB8 { byte b; }; -struct BlocItem { - uint16 _activeFl; - int _x1; - int _y1; - int _x2; - int _y2; -}; - class HopkinsEngine; class GraphicsManager { @@ -111,8 +104,7 @@ public: bool _skipVideoLockFl; int _fadeDefaultSpeed; - int _dirtyRectCount; - BlocItem _dirtyRects[DIRTY_RECTS_SIZE]; + Common::Array _dirtyRects; int WinScan; byte *PAL_PIXELS; bool MANU_SCROLL; -- cgit v1.2.3 From 7c862d586ede81d759eafae831f8fd54684d92bd Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Mar 2013 18:56:14 -0500 Subject: HOPKINS: Preparatory work for a refresh rect list --- engines/hopkins/graphics.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 72fd87c7c3..367b0a2755 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -99,12 +99,18 @@ public: int _minX, _minY; int _maxX, _maxY; bool _noFadingFl; - Common::Rect dstrect[50]; int _scrollStatus; bool _skipVideoLockFl; int _fadeDefaultSpeed; + /** + * The _dirtyRects list contains paletted game areas that need to be redrawn. + * The _dstrect array is the list of areas of the screen that ScummVM needs to be redrawn. + * Some areas, such as the animation managers, skip the _dirtyRects and use _dstrec directly. + */ Common::Array _dirtyRects; + Common::Array _refreshRects; + int WinScan; byte *PAL_PIXELS; bool MANU_SCROLL; @@ -118,7 +124,12 @@ public: void unlockScreen(); void clearPalette(); void clearScreen(); + void resetVesaSegment(); + void resetRefreshRects(); void addDirtyRect(int x1, int y1, int x2, int y2); + void addRefreshRect(const Common::Rect &r); + void displayVesaSegment(); + void displayRefreshRects(); void copySurface(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY); void loadImage(const Common::String &file); void loadVgaImage(const Common::String &file); @@ -131,8 +142,6 @@ public: void fadeOutLong(); void fadeOutShort(); void fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex, bool addSegment = true); - void displayVesaSegment(); - void resetVesaSegment(); void copyWinscanVbe3(const byte *srcData, byte *destSurface); void copyWinscanVbe(const byte *srcP, byte *destP); void copyVideoVbe16(const byte *srcData); -- cgit v1.2.3 From 95aca78bcdc42a2765220c2fbd990539168b15b5 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Mar 2013 20:40:03 -0500 Subject: HOPKINS: Renamed dirty rect methods --- engines/hopkins/graphics.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 367b0a2755..bdd8fee578 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -124,11 +124,11 @@ public: void unlockScreen(); void clearPalette(); void clearScreen(); - void resetVesaSegment(); + void resetDirtyRects(); void resetRefreshRects(); void addDirtyRect(int x1, int y1, int x2, int y2); void addRefreshRect(const Common::Rect &r); - void displayVesaSegment(); + void displayDirtyRects(); void displayRefreshRects(); void copySurface(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY); void loadImage(const Common::String &file); -- cgit v1.2.3 From 7a7b2b35e2be1e6526d8aeea2576e8c9231aa73c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Mar 2013 22:36:38 -0500 Subject: HOPKINS: Added a debugger command to frame dirty rects --- engines/hopkins/graphics.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index bdd8fee578..54e4156982 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -110,6 +110,7 @@ public: */ Common::Array _dirtyRects; Common::Array _refreshRects; + bool _showDirtyRects; int WinScan; byte *PAL_PIXELS; -- cgit v1.2.3 From f93275b3109943a76bd75163d5f4e5bc2cee982c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 5 Mar 2013 09:42:06 -0500 Subject: HOPKINS: Removed usage of g_system->lockScreen --- engines/hopkins/graphics.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 54e4156982..bbc3b87c0a 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -58,7 +58,6 @@ private: int _screenWidth; int _screenHeight; byte *_videoPtr; - bool _isPhysicalPtr; int _width; int _posXClipped, _posYClipped; bool _clipFl; @@ -121,7 +120,7 @@ public: ~GraphicsManager(); void setParent(HopkinsEngine *vm); - void lockScreen(bool shouldUsePhysicalScreen = false); + void lockScreen(); void unlockScreen(); void clearPalette(); void clearScreen(); -- cgit v1.2.3 From 83480c5784dd4193fa6b5dd3bb2f7a75ac67715d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 6 Mar 2013 09:46:05 -0500 Subject: HOPKINS: Fix transition between initial version display to intro animation --- engines/hopkins/graphics.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index bbc3b87c0a..33edc6f86c 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -124,9 +124,11 @@ public: void unlockScreen(); void clearPalette(); void clearScreen(); + void clearVesaScreen(); void resetDirtyRects(); void resetRefreshRects(); void addDirtyRect(int x1, int y1, int x2, int y2); + void addDirtyRect(const Common::Rect &r) { addDirtyRect(r.left, r.top, r.right, r.bottom); } void addRefreshRect(const Common::Rect &r); void displayDirtyRects(); void displayRefreshRects(); -- cgit v1.2.3 From 55c024494d80b343fc23d8e534153fd9c873f040 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 9 Mar 2013 09:44:46 -0500 Subject: HOPKINS: Fix problem with scrolling not working properly --- engines/hopkins/graphics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 33edc6f86c..3739bbf3a3 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -129,7 +129,7 @@ public: void resetRefreshRects(); void addDirtyRect(int x1, int y1, int x2, int y2); void addDirtyRect(const Common::Rect &r) { addDirtyRect(r.left, r.top, r.right, r.bottom); } - void addRefreshRect(const Common::Rect &r); + void addRefreshRect(int x1, int y1, int x2, int y2); void displayDirtyRects(); void displayRefreshRects(); void copySurface(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY); -- cgit v1.2.3 From 3d06a93be163d9cc99d5c06036408e3020d5e76e Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 9 Mar 2013 22:04:41 -0500 Subject: HOPKINS: Merged dirty/refresh rect rect adding into a single method --- engines/hopkins/graphics.h | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 3739bbf3a3..45bc202d59 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -130,6 +130,7 @@ public: void addDirtyRect(int x1, int y1, int x2, int y2); void addDirtyRect(const Common::Rect &r) { addDirtyRect(r.left, r.top, r.right, r.bottom); } void addRefreshRect(int x1, int y1, int x2, int y2); + void addRectToArray(Common::Array &rects, const Common::Rect &newRect); void displayDirtyRects(); void displayRefreshRects(); void copySurface(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY); -- cgit v1.2.3 From 39ffd06839531cb9a2e81e9c89b820b6332327d8 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 13 Mar 2013 22:58:48 -0400 Subject: HOPKINS: Bugfix for refreshing Breakout lives when one is lost --- engines/hopkins/graphics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/hopkins/graphics.h') diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 45bc202d59..cdf9962400 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -141,7 +141,7 @@ public: void fadeInDefaultLength(const byte *surface); void fadeInShort(); void fadeOutDefaultLength(const byte *surface); - void fateOutBreakout(); + void fadeOutBreakout(); void fadeOutLong(); void fadeOutShort(); void fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex, bool addSegment = true); -- cgit v1.2.3