aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorVincent Bénony2016-01-06 16:19:03 +0100
committerVincent Bénony2016-01-06 16:19:03 +0100
commit64f50761ec22243fe9964271a8554c9f3356a6b5 (patch)
treec4aa7991cad01deaa5f8a7683938d4899ff450d0 /graphics
parentfae79955e5ce6e215dcf457059c5744a85c76a80 (diff)
parent3fab9056296fbf491372f66f7fbb23d6312ad2ad (diff)
downloadscummvm-rg350-64f50761ec22243fe9964271a8554c9f3356a6b5.tar.gz
scummvm-rg350-64f50761ec22243fe9964271a8554c9f3356a6b5.tar.bz2
scummvm-rg350-64f50761ec22243fe9964271a8554c9f3356a6b5.zip
IOS: Merge master
Diffstat (limited to 'graphics')
-rw-r--r--graphics/transparent_surface.cpp2
-rw-r--r--graphics/transparent_surface.h38
2 files changed, 26 insertions, 14 deletions
diff --git a/graphics/transparent_surface.cpp b/graphics/transparent_surface.cpp
index 992a5dc879..19e7655a93 100644
--- a/graphics/transparent_surface.cpp
+++ b/graphics/transparent_surface.cpp
@@ -116,7 +116,7 @@ void doBlitBinaryFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32
in = ino;
for (uint32 j = 0; j < width; j++) {
uint32 pix = *(uint32 *)in;
- int a = (pix >> kAModShift) & 0xff;
+ int a = in[kAIndex];
if (a != 0) { // Full opacity (Any value not exactly 0 is Opaque here)
*(uint32 *)out = pix;
diff --git a/graphics/transparent_surface.h b/graphics/transparent_surface.h
index efb28149a5..0cd7d5b2e9 100644
--- a/graphics/transparent_surface.h
+++ b/graphics/transparent_surface.h
@@ -50,22 +50,22 @@ namespace Graphics {
@brief The possible flipping parameters for the blit method.
*/
enum FLIP_FLAGS {
- /// The image will not be flipped.
- FLIP_NONE = 0,
- /// The image will be flipped at the horizontal axis.
- FLIP_H = 1,
- /// The image will be flipped at the vertical axis.
- FLIP_V = 2,
- /// The image will be flipped at the horizontal and vertical axis.
- FLIP_HV = FLIP_H | FLIP_V,
- /// The image will be flipped at the horizontal and vertical axis.
- FLIP_VH = FLIP_H | FLIP_V
+ /// The image will not be flipped.
+ FLIP_NONE = 0,
+ /// The image will be flipped at the horizontal axis.
+ FLIP_H = 1,
+ /// The image will be flipped at the vertical axis.
+ FLIP_V = 2,
+ /// The image will be flipped at the horizontal and vertical axis.
+ FLIP_HV = FLIP_H | FLIP_V,
+ /// The image will be flipped at the horizontal and vertical axis.
+ FLIP_VH = FLIP_H | FLIP_V
};
enum AlphaType {
- ALPHA_OPAQUE = 0,
- ALPHA_BINARY = 1,
- ALPHA_FULL = 2
+ ALPHA_OPAQUE = 0,
+ ALPHA_BINARY = 1,
+ ALPHA_FULL = 2
};
/**
@@ -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();