diff options
author | Jody Northup | 2009-06-15 10:10:22 +0000 |
---|---|---|
committer | Jody Northup | 2009-06-15 10:10:22 +0000 |
commit | c97bfd16f94873a437cb92a30ebd11879f114e0c (patch) | |
tree | 7dfd7195e2c5f0f0fb5cef3586c03e8082af5195 | |
parent | 8d306ebccfa7e88b2e4f4635bff3987e550f98d3 (diff) | |
download | scummvm-rg350-c97bfd16f94873a437cb92a30ebd11879f114e0c.tar.gz scummvm-rg350-c97bfd16f94873a437cb92a30ebd11879f114e0c.tar.bz2 scummvm-rg350-c97bfd16f94873a437cb92a30ebd11879f114e0c.zip |
made Graphics::PixelFormat(ColorMode) constructor explicit, removed Graphics::PixelFormat(int bitFormat) constructor that was never really implemented anyway
svn-id: r41540
-rw-r--r-- | base/main.cpp | 2 | ||||
-rw-r--r-- | engines/engine.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 2 | ||||
-rw-r--r-- | graphics/pixelformat.h | 35 |
4 files changed, 4 insertions, 37 deletions
diff --git a/base/main.cpp b/base/main.cpp index 5c1ca7dc20..6f3bacebb7 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -227,7 +227,7 @@ static void setupGraphics(OSystem &system) { system.setGraphicsMode(ConfMan.get("gfx_mode").c_str()); #ifdef ENABLE_16BIT - system.initFormat(Graphics::kFormatCLUT8); + system.initFormat(Graphics::PixelFormat(Graphics::kFormatCLUT8)); #endif system.initSize(320, 200); diff --git a/engines/engine.cpp b/engines/engine.cpp index 213f69e7b1..77ce7c44ad 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -126,7 +126,7 @@ void initCommonGFX(bool defaultTo1XScaler) { } void initGraphics(int width, int height, bool defaultTo1xScaler) { #ifdef ENABLE_16BIT - Graphics::PixelFormat format = Graphics::kFormatCLUT8; + Graphics::PixelFormat format(Graphics::kFormatCLUT8); initGraphics(width,height,defaultTo1xScaler, format); } void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 5fec6ec835..9469a15e54 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1085,7 +1085,7 @@ Common::Error ScummEngine::init() { (_screenWidth * _textSurfaceMultiplier > 320)); #ifdef ENABLE_16BIT } else if (_game.features & GF_16BIT_COLOR) { - Graphics::PixelFormat format = Graphics::kFormatRGB555; + Graphics::PixelFormat format(Graphics::kFormatRGB555); initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format); if (format != _system->getScreenFormat()) return Common::kUnsupportedColorMode; diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h index ef856e8735..b08321efd7 100644 --- a/graphics/pixelformat.h +++ b/graphics/pixelformat.h @@ -91,43 +91,10 @@ struct PixelFormat { rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift; } - //Copy constructor - //Is this necessary? - inline PixelFormat(const PixelFormat &format) { - bytesPerPixel = format.bytesPerPixel; - - rLoss = format.rLoss; - gLoss = format.gLoss; - bLoss = format.bLoss; - aLoss = format.aLoss; - - rShift = format.rShift; - gShift = format.gShift; - bShift = format.bShift; - aShift = format.aShift; - } - - //Convenience constructor from bitformat number - //TODO: BGR support - //TODO: Specify alpha position -/* PixelFormat(int bitFormat) { - bytesPerPixel = ColorMasks<bitFormat>::kBytesPerPixel; - - rLoss = 8 - ColorMasks<bitFormat>::kRedBits; - gLoss = 8 - ColorMasks<bitFormat>::kGreenBits; - bLoss = 8 - ColorMasks<bitFormat>::kBlueBits; - aLoss = 8 - ColorMasks<bitFormat>::kAlphaBits; - - rShift = ColorMasks<bitFormat>::kRedShift; - gShift = ColorMasks<bitFormat>::kGreenShift; - bShift = ColorMasks<bitFormat>::kBlueShift; - aShift = ColorMasks<bitFormat>::kAlphaShift; - };*/ - //Convenience constructor from enum type //TODO: BGR support //TODO: Specify alpha position - inline PixelFormat(ColorMode mode) { + explicit inline PixelFormat(ColorMode mode) { switch (mode) { case kFormatRGB555: aLoss = 8; |