aboutsummaryrefslogtreecommitdiff
path: root/graphics/surface.h
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-17 15:17:42 +0200
committerJohannes Schickel2011-04-17 15:17:42 +0200
commit4fd3e3d6fe72b6b978fbc5e9e0b5218741d15c83 (patch)
tree1f81a65bd83045e39794067a4e1adf958188ef10 /graphics/surface.h
parent886ea29bbfe5556729843d97637ea9f691382ddc (diff)
downloadscummvm-rg350-4fd3e3d6fe72b6b978fbc5e9e0b5218741d15c83.tar.gz
scummvm-rg350-4fd3e3d6fe72b6b978fbc5e9e0b5218741d15c83.tar.bz2
scummvm-rg350-4fd3e3d6fe72b6b978fbc5e9e0b5218741d15c83.zip
GRAPHICS: Add a PixelFormat member to Surface.
Diffstat (limited to 'graphics/surface.h')
-rw-r--r--graphics/surface.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/graphics/surface.h b/graphics/surface.h
index f9cb6cc474..3cc69fafdd 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -28,6 +28,8 @@
#include "common/scummsys.h"
#include "common/rect.h"
+#include "graphics/pixelformat.h"
+
namespace Graphics {
/**
@@ -70,9 +72,14 @@ struct Surface {
uint8 bytesPerPixel;
/**
+ * The pixel format of the surface.
+ */
+ PixelFormat format;
+
+ /**
* Construct a simple Surface object.
*/
- Surface() : w(0), h(0), pitch(0), pixels(0), bytesPerPixel(0) {
+ Surface() : w(0), h(0), pitch(0), pixels(0), bytesPerPixel(0), format() {
}
/**
@@ -110,6 +117,18 @@ struct Surface {
void create(uint16 width, uint16 height, uint8 bytesPP);
/**
+ * Allocate memory for the pixel data of the surface.
+ *
+ * Note that you are responsible for calling free yourself.
+ * @see free
+ *
+ * @param width Width of the surface object.
+ * @param height Height of the surface object.
+ * @param format The pixel format the surface should use.
+ */
+ void create(uint16 width, uint16 height, const PixelFormat &format);
+
+ /**
* Release the memory used by the pixels memory of this surface. This is the
* counterpart to create().
*