aboutsummaryrefslogtreecommitdiff
path: root/graphics/surface.h
diff options
context:
space:
mode:
authorMax Horn2004-11-25 23:33:21 +0000
committerMax Horn2004-11-25 23:33:21 +0000
commitf5da05f80d0a24ccb3e77ae5740c89ebed4cc2fe (patch)
treece07df5b7524e5186c2a55d610f1fc06162424c0 /graphics/surface.h
parente79e0dec7498088ca6519d3f0ddb4219c4a58bcd (diff)
downloadscummvm-rg350-f5da05f80d0a24ccb3e77ae5740c89ebed4cc2fe.tar.gz
scummvm-rg350-f5da05f80d0a24ccb3e77ae5740c89ebed4cc2fe.tar.bz2
scummvm-rg350-f5da05f80d0a24ccb3e77ae5740c89ebed4cc2fe.zip
Added some graphic primitives
svn-id: r15885
Diffstat (limited to 'graphics/surface.h')
-rw-r--r--graphics/surface.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/graphics/surface.h b/graphics/surface.h
index a45df31748..510a5c274c 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -22,6 +22,7 @@
#define GRAPHICS_SURFACE_H
#include "common/scummsys.h"
+#include "common/rect.h"
namespace Graphics {
@@ -37,6 +38,15 @@ struct Surface {
uint16 pitch;
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);
+ }
+
+ 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;
};