GOB: Add Pixel::isValid() and ConstPixel::isValid()
svn-id: r55573
This commit is contained in:
parent
b25a5d1862
commit
6513748c46
2 changed files with 12 additions and 0 deletions
|
@ -103,6 +103,10 @@ void Pixel::set(uint32 p) {
|
||||||
*((uint16 *) _vidMem) = (uint16) 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) :
|
ConstPixel::ConstPixel(const byte *vidMem, uint8 bpp, const byte *min, const byte *max) :
|
||||||
_vidMem(vidMem), _bpp(bpp), _min(min), _max(max) {
|
_vidMem(vidMem), _bpp(bpp), _min(min), _max(max) {
|
||||||
|
@ -157,6 +161,10 @@ uint32 ConstPixel::get() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ConstPixel::isValid() const {
|
||||||
|
return (_vidMem >= _min) && (_vidMem < _max);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Surface::Surface(uint16 width, uint16 height, uint8 bpp, byte *vidMem) :
|
Surface::Surface(uint16 width, uint16 height, uint8 bpp, byte *vidMem) :
|
||||||
_width(width), _height(height), _bpp(bpp), _vidMem(vidMem) {
|
_width(width), _height(height), _bpp(bpp), _vidMem(vidMem) {
|
||||||
|
|
|
@ -49,6 +49,8 @@ public:
|
||||||
uint32 get() const;
|
uint32 get() const;
|
||||||
void set(uint32 p);
|
void set(uint32 p);
|
||||||
|
|
||||||
|
bool isValid() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
byte *_vidMem;
|
byte *_vidMem;
|
||||||
byte *_min, *_max;
|
byte *_min, *_max;
|
||||||
|
@ -71,6 +73,8 @@ public:
|
||||||
|
|
||||||
uint32 get() const;
|
uint32 get() const;
|
||||||
|
|
||||||
|
bool isValid() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const byte *_vidMem;
|
const byte *_vidMem;
|
||||||
const byte *_min, *_max;
|
const byte *_min, *_max;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue