aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins/graphics.h
diff options
context:
space:
mode:
authorPaul Gilbert2013-03-17 11:29:00 -0400
committerPaul Gilbert2013-03-17 11:29:00 -0400
commit4372bd830608f8617fc005713f4ab75774b32462 (patch)
treeb420c4f0c7c4d18020b270b8ff49df72141aecfd /engines/hopkins/graphics.h
parent43b9f5daff882f1ebc6cc4ffd962c64fd43f7930 (diff)
parent39ffd06839531cb9a2e81e9c89b820b6332327d8 (diff)
downloadscummvm-rg350-4372bd830608f8617fc005713f4ab75774b32462.tar.gz
scummvm-rg350-4372bd830608f8617fc005713f4ab75774b32462.tar.bz2
scummvm-rg350-4372bd830608f8617fc005713f4ab75774b32462.zip
Merge branch 'hopkins_dirtyRects'
Conflicts: engines/hopkins/anim.cpp engines/hopkins/computer.cpp engines/hopkins/dialogs.cpp engines/hopkins/graphics.cpp engines/hopkins/hopkins.cpp
Diffstat (limited to 'engines/hopkins/graphics.h')
-rw-r--r--engines/hopkins/graphics.h39
1 files changed, 23 insertions, 16 deletions
diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h
index 620c1b7d32..eb1a79d707 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"
@@ -31,6 +32,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
@@ -45,14 +47,6 @@ struct RGB8 {
byte b;
};
-struct BlocItem {
- uint16 _activeFl;
- int _x1;
- int _y1;
- int _x2;
- int _y2;
-};
-
class HopkinsEngine;
class GraphicsManager {
@@ -63,7 +57,7 @@ private:
bool _initGraphicsFl;
int _screenWidth;
int _screenHeight;
- Graphics::Surface *_videoPtr;
+ byte *_videoPtr;
int _width;
int _posXClipped, _posYClipped;
bool _clipFl;
@@ -94,6 +88,7 @@ public:
byte _oldPalette[PALETTE_EXT_BLOCK_SIZE];
byte *_vesaScreen;
byte *_vesaBuffer;
+ byte *_screenBuffer;
int _scrollOffset;
int _scrollPosX;
bool _largeScreenFl;
@@ -103,13 +98,19 @@ public:
int _minX, _minY;
int _maxX, _maxY;
bool _noFadingFl;
- Common::Rect dstrect[50];
int _scrollStatus;
bool _skipVideoLockFl;
int _fadeDefaultSpeed;
- int NBBLOC;
- BlocItem BLOC[250];
+ /**
+ * 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<Common::Rect> _dirtyRects;
+ Common::Array<Common::Rect> _refreshRects;
+ bool _showDirtyRects;
+
int WinScan;
byte *PAL_PIXELS;
bool MANU_SCROLL;
@@ -123,7 +124,15 @@ public:
void unlockScreen();
void clearPalette();
void clearScreen();
- void addVesaSegment(int x1, int y1, int x2, int y2);
+ 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(int x1, int y1, int x2, int y2);
+ void addRectToArray(Common::Array<Common::Rect> &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);
void loadImage(const Common::String &file);
void loadVgaImage(const Common::String &file);
@@ -132,12 +141,10 @@ 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);
- void displayVesaSegment();
- void resetVesaSegment();
void copyWinscanVbe3(const byte *srcData, byte *destSurface);
void copyWinscanVbe(const byte *srcP, byte *destP);
void copyVideoVbe16(const byte *srcData);