diff options
author | Max Horn | 2009-12-07 18:22:18 +0000 |
---|---|---|
committer | Max Horn | 2009-12-07 18:22:18 +0000 |
commit | f8126d9da676e69dff384b8a8f7136ad27fb014d (patch) | |
tree | df1b86f98b4792fa4c44f71237f0722aca762584 /engines/m4/graphics.h | |
parent | 6d1e4dd0344f9baef12709e2c90ac98e17392786 (diff) | |
download | scummvm-rg350-f8126d9da676e69dff384b8a8f7136ad27fb014d.tar.gz scummvm-rg350-f8126d9da676e69dff384b8a8f7136ad27fb014d.tar.bz2 scummvm-rg350-f8126d9da676e69dff384b8a8f7136ad27fb014d.zip |
M4: Make M4Surface member w, h, pixels protected; some cleanup
svn-id: r46280
Diffstat (limited to 'engines/m4/graphics.h')
-rw-r--r-- | engines/m4/graphics.h | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/m4/graphics.h b/engines/m4/graphics.h index 0fc448dad1..ca33f6150b 100644 --- a/engines/m4/graphics.h +++ b/engines/m4/graphics.h @@ -83,7 +83,7 @@ struct SpriteInfo { RGB8 *palette; }; -class M4Surface : public Graphics::Surface { +class M4Surface : protected Graphics::Surface { private: byte _color; bool _isScreen; @@ -96,7 +96,10 @@ public: create(g_system->getWidth(), g_system->getHeight(), 1); _isScreen = isScreen; } - M4Surface(int Width, int Height) { create(Width, Height, 1); _isScreen = false; } + M4Surface(int width_, int height_) { + create(width_, height_, 1); + _isScreen = false; + } // loads a .COD file into the M4Surface // TODO: maybe move this to the rail system? check where it makes sense @@ -110,7 +113,7 @@ public: void madsloadInterface(int index, RGBList **palData); void setColor(byte value) { _color = value; } - byte getColor() { return _color; } + inline byte getColor() const { return _color; } void vLine(int x, int y1, int y2); void hLine(int x1, int x2, int y); void vLineXor(int x, int y1, int y2); @@ -122,8 +125,8 @@ public: void drawSprite(int x, int y, SpriteInfo &info, const Common::Rect &clipRect); // Surface methods - int width() { return w; } - int height() { return h; } + inline int width() const { return w; } + inline int height() const { return h; } void setSize(int sizeX, int sizeY) { create(sizeX, sizeY, 1); } inline byte *getBasePtr() { return (byte *)pixels; @@ -149,13 +152,13 @@ public: } // copyTo methods - void copyTo(M4Surface *dest, int transparentColor = -1) { + inline void copyTo(M4Surface *dest, int transparentColor = -1) { dest->copyFrom(this, Common::Rect(width(), height()), 0, 0, transparentColor); } - void copyTo(M4Surface *dest, int x, int y, int transparentColor = -1) { + inline void copyTo(M4Surface *dest, int x, int y, int transparentColor = -1) { dest->copyFrom(this, Common::Rect(width(), height()), x, y, transparentColor); } - void copyTo(M4Surface *dest, const Common::Rect &srcBounds, int destX, int destY, + inline void copyTo(M4Surface *dest, const Common::Rect &srcBounds, int destX, int destY, int transparentColor = -1) { dest->copyFrom(this, srcBounds, destX, destY, transparentColor); } |