made Graphics::PixelFormat(ColorMode) constructor explicit, removed Graphics::PixelFormat(int bitFormat) constructor that was never really implemented anyway
svn-id: r41540
This commit is contained in:
parent
8d306ebccf
commit
c97bfd16f9
4 changed files with 4 additions and 37 deletions
|
@ -227,7 +227,7 @@ static void setupGraphics(OSystem &system) {
|
||||||
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
|
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
|
||||||
|
|
||||||
#ifdef ENABLE_16BIT
|
#ifdef ENABLE_16BIT
|
||||||
system.initFormat(Graphics::kFormatCLUT8);
|
system.initFormat(Graphics::PixelFormat(Graphics::kFormatCLUT8));
|
||||||
#endif
|
#endif
|
||||||
system.initSize(320, 200);
|
system.initSize(320, 200);
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,7 @@ void initCommonGFX(bool defaultTo1XScaler) {
|
||||||
}
|
}
|
||||||
void initGraphics(int width, int height, bool defaultTo1xScaler) {
|
void initGraphics(int width, int height, bool defaultTo1xScaler) {
|
||||||
#ifdef ENABLE_16BIT
|
#ifdef ENABLE_16BIT
|
||||||
Graphics::PixelFormat format = Graphics::kFormatCLUT8;
|
Graphics::PixelFormat format(Graphics::kFormatCLUT8);
|
||||||
initGraphics(width,height,defaultTo1xScaler, format);
|
initGraphics(width,height,defaultTo1xScaler, format);
|
||||||
}
|
}
|
||||||
void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) {
|
void initGraphics(int width, int height, bool defaultTo1xScaler, Graphics::PixelFormat format) {
|
||||||
|
|
|
@ -1085,7 +1085,7 @@ Common::Error ScummEngine::init() {
|
||||||
(_screenWidth * _textSurfaceMultiplier > 320));
|
(_screenWidth * _textSurfaceMultiplier > 320));
|
||||||
#ifdef ENABLE_16BIT
|
#ifdef ENABLE_16BIT
|
||||||
} else if (_game.features & GF_16BIT_COLOR) {
|
} else if (_game.features & GF_16BIT_COLOR) {
|
||||||
Graphics::PixelFormat format = Graphics::kFormatRGB555;
|
Graphics::PixelFormat format(Graphics::kFormatRGB555);
|
||||||
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
|
initGraphics(_screenWidth, _screenHeight, _screenWidth > 320, format);
|
||||||
if (format != _system->getScreenFormat())
|
if (format != _system->getScreenFormat())
|
||||||
return Common::kUnsupportedColorMode;
|
return Common::kUnsupportedColorMode;
|
||||||
|
|
|
@ -91,43 +91,10 @@ struct PixelFormat {
|
||||||
rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift;
|
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
|
//Convenience constructor from enum type
|
||||||
//TODO: BGR support
|
//TODO: BGR support
|
||||||
//TODO: Specify alpha position
|
//TODO: Specify alpha position
|
||||||
inline PixelFormat(ColorMode mode) {
|
explicit inline PixelFormat(ColorMode mode) {
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case kFormatRGB555:
|
case kFormatRGB555:
|
||||||
aLoss = 8;
|
aLoss = 8;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue