diff options
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/surface.cpp | 8 | ||||
-rw-r--r-- | engines/gob/surface.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/engines/gob/surface.cpp b/engines/gob/surface.cpp index d621ce5a97..58482a6424 100644 --- a/engines/gob/surface.cpp +++ b/engines/gob/surface.cpp @@ -103,6 +103,10 @@ void Pixel::set(uint32 p) { *((uint16 *) _vidMem) = (uint16) p; } +bool Pixel::isValid() const { + return (_vidMem >= _min) && (_vidMem < _max); +} + ConstPixel::ConstPixel(const byte *vidMem, uint8 bpp, const byte *min, const byte *max) : _vidMem(vidMem), _bpp(bpp), _min(min), _max(max) { @@ -157,6 +161,10 @@ uint32 ConstPixel::get() const { return 0; } +bool ConstPixel::isValid() const { + return (_vidMem >= _min) && (_vidMem < _max); +} + Surface::Surface(uint16 width, uint16 height, uint8 bpp, byte *vidMem) : _width(width), _height(height), _bpp(bpp), _vidMem(vidMem) { diff --git a/engines/gob/surface.h b/engines/gob/surface.h index b8426989f3..a8d52c7b36 100644 --- a/engines/gob/surface.h +++ b/engines/gob/surface.h @@ -49,6 +49,8 @@ public: uint32 get() const; void set(uint32 p); + bool isValid() const; + private: byte *_vidMem; byte *_min, *_max; @@ -71,6 +73,8 @@ public: uint32 get() const; + bool isValid() const; + private: const byte *_vidMem; const byte *_min, *_max; |