From 69220505b6109227984f0d5de97180e989d1adce Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 14 Dec 2015 05:14:09 +0100 Subject: GRAPHICS: Add function to query TransparentSurface's builtin PixelFormat. --- graphics/transparent_surface.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/graphics/transparent_surface.h b/graphics/transparent_surface.h index 4a23522aab..0cd7d5b2e9 100644 --- a/graphics/transparent_surface.h +++ b/graphics/transparent_surface.h @@ -75,6 +75,18 @@ struct TransparentSurface : public Graphics::Surface { TransparentSurface(); TransparentSurface(const Graphics::Surface &surf, bool copyData = false); + /** + * Returns the pixel format all operations of TransparentSurface support. + * + * Unlike Surface TransparentSurface only works with a fixed pixel format. + * This format can be queried using this static function. + * + * @return Supported pixel format. + */ + static PixelFormat getSupportedPixelFormat() { + return PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0); + } + void setColorKey(char r, char g, char b); void disableColorKey(); -- cgit v1.2.3