aboutsummaryrefslogtreecommitdiff
path: root/scumm/gfx.h
diff options
context:
space:
mode:
authorMax Horn2004-08-14 19:42:00 +0000
committerMax Horn2004-08-14 19:42:00 +0000
commit152a5e97fe5197a5494fdde8967301888f360d2c (patch)
treeed39818d7a6b2f3e1fce0f3b379bedb3652f0d63 /scumm/gfx.h
parentd5f20cacd7061b4cff302f5b4f50c61a14461425 (diff)
downloadscummvm-rg350-152a5e97fe5197a5494fdde8967301888f360d2c.tar.gz
scummvm-rg350-152a5e97fe5197a5494fdde8967301888f360d2c.tar.bz2
scummvm-rg350-152a5e97fe5197a5494fdde8967301888f360d2c.zip
Modified VirtScreen to inherit from Graphics::Surface, and added getPixels()/getBackPixels() accessors (these changes make it a bit easier to implement smooth scrolling); also replaced some uses of rtBuffer by proper access through the corresponding VirtScreen
svn-id: r14612
Diffstat (limited to 'scumm/gfx.h')
-rw-r--r--scumm/gfx.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/scumm/gfx.h b/scumm/gfx.h
index 0bee946897..6f6b17be76 100644
--- a/scumm/gfx.h
+++ b/scumm/gfx.h
@@ -79,7 +79,7 @@ enum VirtScreenNumber {
* Each of these virtual screens has a fixed number or id (see also
* \ref VirtScreenNumber).
*/
-struct VirtScreen {
+struct VirtScreen : Graphics::Surface {
/**
* The unique id of this screen (corresponds to its position in the
* ScummEngine:virtscr array).
@@ -96,12 +96,6 @@ struct VirtScreen {
*/
uint16 topline;
- /** Width of the virtual screen (currently always identical to _screenWidth). */
- uint16 width;
-
- /** Height of the virtual screen. */
- uint16 height;
-
/**
* Horizontal scroll offset, tells how far the screen is scrolled to the
* right. Only used for the main screen. After all, verbs and the
@@ -120,12 +114,6 @@ struct VirtScreen {
bool hasTwoBuffers;
/**
- * Pointer to the screen's data buffer. This is where the content of
- * the screen is stored. Just as one would expect :-).
- */
- byte *screenPtr;
-
- /**
* Pointer to the screen's back buffer, if it has one (see also
* the hasTwoBuffers member).
* The backBuf is used by drawBitmap to store the background graphics of
@@ -167,6 +155,14 @@ struct VirtScreen {
bdirty[i] = bottom;
}
}
+
+ byte *getPixels(int x, int y) const {
+ return (byte *)pixels + xstart + y * pitch + x;
+ }
+
+ byte *getBackPixels(int x, int y) const {
+ return (byte *)backBuf + xstart + y * pitch + x;
+ }
};
/** Palette cycles */