diff options
Diffstat (limited to 'graphics/surface.h')
-rw-r--r-- | graphics/surface.h | 16 |
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); }; |