aboutsummaryrefslogtreecommitdiff
path: root/graphics/surface.h
diff options
context:
space:
mode:
authorMax Horn2005-05-02 18:00:05 +0000
committerMax Horn2005-05-02 18:00:05 +0000
commit2b71af3de942d46093d5d929085669d9c21dfd21 (patch)
treecf0851e632e58ef921e53105b97d956e4a6b7a0d /graphics/surface.h
parent7947fa5d8a3dafa500edf206c777528f67edfae2 (diff)
downloadscummvm-rg350-2b71af3de942d46093d5d929085669d9c21dfd21.tar.gz
scummvm-rg350-2b71af3de942d46093d5d929085669d9c21dfd21.tar.bz2
scummvm-rg350-2b71af3de942d46093d5d929085669d9c21dfd21.zip
Const correctness
svn-id: r17898
Diffstat (limited to 'graphics/surface.h')
-rw-r--r--graphics/surface.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/graphics/surface.h b/graphics/surface.h
index 8cd93298d1..8407b73bbe 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -39,14 +39,18 @@ struct Surface {
uint8 bytesPerPixel;
Surface() : pixels(0), w(0), h(0), pitch(0), bytesPerPixel(0) {}
- inline void *getBasePtr(int x, int y) const {
- return (void *)((byte *)pixels + y * pitch + x * bytesPerPixel);
+ inline const void *getBasePtr(int x, int y) const {
+ return static_cast<const void *>(static_cast<const byte *>(pixels) + y * pitch + x * bytesPerPixel);
+ }
+
+ inline void *getBasePtr(int x, int y) {
+ return static_cast<void *>(static_cast<byte *>(pixels) + y * pitch + x * bytesPerPixel);
}
- void hLine(int x, int y, int x2, uint32 color) const;
- void vLine(int x, int y, int y2, uint32 color) const;
- void fillRect(const Common::Rect &r, uint32 color) const;
- void frameRect(const Common::Rect &r, uint32 color) const;
+ void hLine(int x, int y, int x2, uint32 color);
+ void vLine(int x, int y, int y2, uint32 color);
+ void fillRect(const Common::Rect &r, uint32 color);
+ void frameRect(const Common::Rect &r, uint32 color);
};