From 2b71af3de942d46093d5d929085669d9c21dfd21 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 2 May 2005 18:00:05 +0000 Subject: Const correctness svn-id: r17898 --- graphics/surface.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'graphics/surface.h') 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(static_cast(pixels) + y * pitch + x * bytesPerPixel); + } + + inline void *getBasePtr(int x, int y) { + return static_cast(static_cast(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); }; -- cgit v1.2.3