aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-11-23 15:34:34 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit3e8ed4eafcfe3fd8198c65b0838022c1dd32eea8 (patch)
tree5ca8d130e09fb926de13b38e7f2576ea853ce131
parent0b1e695f249d695333279eaf711b779c43b7b13d (diff)
downloadscummvm-rg350-3e8ed4eafcfe3fd8198c65b0838022c1dd32eea8.tar.gz
scummvm-rg350-3e8ed4eafcfe3fd8198c65b0838022c1dd32eea8.tar.bz2
scummvm-rg350-3e8ed4eafcfe3fd8198c65b0838022c1dd32eea8.zip
GRAPHICS: Add convertToInPlace method to ManagedSurface
-rw-r--r--graphics/managed_surface.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/graphics/managed_surface.h b/graphics/managed_surface.h
index 422b4610be..a7cf70f857 100644
--- a/graphics/managed_surface.h
+++ b/graphics/managed_surface.h
@@ -368,9 +368,22 @@ public:
addDirtyRect(area);
return _innerSurface.getSubArea(area);
}
+
+ /**
+ * Convert the data to another pixel format.
+ *
+ * This works in-place. This means it will not create an additional buffer
+ * for the conversion process. The value of 'pixels' might change though
+ * (that means it might realloc the pixel data).
+ *
+ * @param dstFormat The desired format
+ * @param palette The palette (in RGB888), if the source format has a Bpp of 1
+ */
+ void convertToInPlace(const PixelFormat &dstFormat, const byte *palette = 0) {
+ _innerSurface.convertToInPlace(dstFormat, palette);
+ }
};
} // End of namespace Graphics
-
#endif