diff options
author | Paul Gilbert | 2016-03-20 14:49:30 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-03-20 14:49:30 -0400 |
commit | 509a00109e79156e91c062f145ac3aa86ec8584e (patch) | |
tree | e625fd93b3b21feabae1eff92e3efbf23a7d7a83 /engines/mads/screen.h | |
parent | f6c3363cf54af1c01efc12a98ab27a8af52aad3e (diff) | |
parent | 390487aa43e5507d4d0fb4ae57e7cf726a94f4c1 (diff) | |
download | scummvm-rg350-509a00109e79156e91c062f145ac3aa86ec8584e.tar.gz scummvm-rg350-509a00109e79156e91c062f145ac3aa86ec8584e.tar.bz2 scummvm-rg350-509a00109e79156e91c062f145ac3aa86ec8584e.zip |
Merge pull request #652 from dreammaster/screen
ALL: Removing code duplication via new managed surface & screen classes
Diffstat (limited to 'engines/mads/screen.h')
-rw-r--r-- | engines/mads/screen.h | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/engines/mads/screen.h b/engines/mads/screen.h index d910e88633..626080580e 100644 --- a/engines/mads/screen.h +++ b/engines/mads/screen.h @@ -25,6 +25,7 @@ #include "common/scummsys.h" #include "common/array.h" +#include "graphics/screen.h" #include "mads/msurface.h" #include "mads/action.h" @@ -207,11 +208,10 @@ public: void synchronize(Common::Serializer &s); }; -class ScreenSurface : public MSurface { +class Screen : virtual public Graphics::Screen, virtual public MSurface { private: uint16 _random; - byte *_surfacePixels; - Common::Rect _clipBounds; + MSurface _rawSurface; void panTransition(MSurface &newScreen, byte *palData, int entrySide, const Common::Point &srcPos, const Common::Point &destPos, @@ -226,36 +226,40 @@ public: /** * Constructor */ - ScreenSurface(); + Screen(); /** * Destructor */ - ~ScreenSurface(); + virtual ~Screen() {} /** - * Initialize the surface + * Updates the physical screen with contents of the internal surface */ - void init(); + virtual void update(); /** - * Copys an area of the screen surface to the ScmmVM physical screen buffer - * @param bounds Area of screen surface to copy + * Transition to a new screen with a given effect */ - void copyRectToScreen(const Common::Rect &bounds); + void transition(ScreenTransition transitionType, bool surfaceFlag); /** - * Updates the screen with the contents of the surface + * Set the screen drawing area to a sub-section of the real screen */ - void updateScreen(); - - void transition(ScreenTransition transitionType, bool surfaceFlag); - void setClipBounds(const Common::Rect &r); + /** + * Reset back to drawing on the entirety of the screen + */ void resetClipBounds(); - const Common::Rect &getClipBounds() { return _clipBounds; } + /** + * Return the current drawing/clip area + */ + const Common::Rect getClipBounds() const { + const Common::Point pt = getOffsetFromOwner(); + return Common::Rect(pt.x, pt.y, pt.x + this->w, pt.y + this->h); + } }; } // End of namespace MADS |