diff options
author | Denis Kasak | 2009-07-13 19:08:04 +0000 |
---|---|---|
committer | Denis Kasak | 2009-07-13 19:08:04 +0000 |
commit | 224d8c087acac4e3f21913b6268f82c1ab9faca8 (patch) | |
tree | 76587b42ddf830fa889e396df9c7aac52ddcb9db /engines | |
parent | 77a810c0c9beed930a4b0ffe8e715bd22d7be448 (diff) | |
download | scummvm-rg350-224d8c087acac4e3f21913b6268f82c1ab9faca8.tar.gz scummvm-rg350-224d8c087acac4e3f21913b6268f82c1ab9faca8.tar.bz2 scummvm-rg350-224d8c087acac4e3f21913b6268f82c1ab9faca8.zip |
Added Surface::fill() method and made Screen::fillScreen() use that instead of filling the surface manually. Changed Surface to use uint instead of uint8 throughout.
svn-id: r42447
Diffstat (limited to 'engines')
-rw-r--r-- | engines/draci/screen.cpp | 5 | ||||
-rw-r--r-- | engines/draci/surface.cpp | 13 | ||||
-rw-r--r-- | engines/draci/surface.h | 7 |
3 files changed, 16 insertions, 9 deletions
diff --git a/engines/draci/screen.cpp b/engines/draci/screen.cpp index b6c740e20c..781147806f 100644 --- a/engines/draci/screen.cpp +++ b/engines/draci/screen.cpp @@ -134,11 +134,8 @@ void Screen::clearScreen() const { * Fills the screen with the specified colour and marks the whole screen dirty. */ void Screen::fillScreen(uint8 colour) const { - byte *ptr = (byte *)_surface->getBasePtr(0, 0); - + _surface->fill(colour); _surface->markDirty(); - - memset(ptr, colour, kScreenWidth * kScreenHeight); } /** diff --git a/engines/draci/surface.cpp b/engines/draci/surface.cpp index 148c24633b..636ec0c4ac 100644 --- a/engines/draci/surface.cpp +++ b/engines/draci/surface.cpp @@ -106,15 +106,24 @@ Common::List<Common::Rect> *Surface::getDirtyRects() { /** * @brief Returns the current transparent colour of the surface */ -uint8 Surface::getTransparentColour() { +uint Surface::getTransparentColour() { return _transparentColour; } /** * @brief Sets the surface's transparent colour */ -void Surface::setTransparentColour(uint8 colour) { +void Surface::setTransparentColour(uint colour) { _transparentColour = colour; } +/** + * @ brief Fills the surface with the specified colour + */ +void Surface::fill(uint colour) { + byte *ptr = (byte *)getBasePtr(0, 0); + + memset(ptr, colour, w * h); +} + } // End of namespace Draci diff --git a/engines/draci/surface.h b/engines/draci/surface.h index 20df29d7f9..db564ec2e5 100644 --- a/engines/draci/surface.h +++ b/engines/draci/surface.h @@ -42,14 +42,15 @@ public: void markDirty(); void markClean(); bool needsFullUpdate(); - uint8 getTransparentColour(); - void setTransparentColour(uint8 colour); + uint getTransparentColour(); + void setTransparentColour(uint colour); + void fill(uint colour); private: /** The current transparent colour of the surface. See getTransparentColour() and * setTransparentColour(). */ - uint8 _transparentColour; + uint _transparentColour; /** Set when the surface is scheduled for a full update. * See markDirty(), markClean(). Accessed via needsFullUpdate(). |