diff options
author | Willem Jan Palenstijn | 2009-02-26 20:08:04 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2009-02-26 20:08:04 +0000 |
commit | f8648767e4882de9adb8f23c9bae8d5146dc3fd9 (patch) | |
tree | a08d33686bdddd887b0f46f2a2c088d5f8f9869f /engines | |
parent | dbe632e8edc54591d30bbe141494d329ba0d141b (diff) | |
download | scummvm-rg350-f8648767e4882de9adb8f23c9bae8d5146dc3fd9.tar.gz scummvm-rg350-f8648767e4882de9adb8f23c9bae8d5146dc3fd9.tar.bz2 scummvm-rg350-f8648767e4882de9adb8f23c9bae8d5146dc3fd9.zip |
fix graphics regression in Iceman caused by r38909
svn-id: r38914
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/gfx/gfx_tools.cpp | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/engines/sci/gfx/gfx_tools.cpp b/engines/sci/gfx/gfx_tools.cpp index db6fa7f834..86229372ee 100644 --- a/engines/sci/gfx/gfx_tools.cpp +++ b/engines/sci/gfx/gfx_tools.cpp @@ -56,14 +56,21 @@ gfx_mode_t *gfx_new_mode(int xfact, int yfact, const Graphics::PixelFormat &form // And those are pretty weird, so I am not sure I interpreted them correctly. // They also seem somewhat inefficient and and should probably just be // replaced resp. rewritten from scratch. - mode->red_mask = format.ARGBToColor(0, 0xFF, 0, 0); - mode->green_mask = format.ARGBToColor(0, 0, 0xFF, 0); - mode->blue_mask = format.ARGBToColor(0, 0, 0, 0xFF); - mode->alpha_mask = format.ARGBToColor(0xFF, 0, 0, 0); - mode->red_shift = format.rLoss; - mode->green_shift = format.gLoss; - mode->blue_shift = format.bLoss; - mode->alpha_shift = format.aLoss; + if (format.bytesPerPixel > 1) { + mode->red_mask = format.ARGBToColor(0, 0xFF, 0, 0); + mode->green_mask = format.ARGBToColor(0, 0, 0xFF, 0); + mode->blue_mask = format.ARGBToColor(0, 0, 0, 0xFF); + mode->alpha_mask = format.ARGBToColor(0xFF, 0, 0, 0); + mode->red_shift = format.rLoss; + mode->green_shift = format.gLoss; + mode->blue_shift = format.bLoss; + mode->alpha_shift = format.aLoss; + } else { + mode->red_mask = mode->green_mask = mode->blue_mask = 0; + mode->alpha_mask = 0; + mode->red_shift = mode->green_shift = mode->blue_shift = 0; + mode->alpha_shift = 0; + } mode->flags = flags; if (palette) { |