Replace OSystem::hasAlpha with a feature flag
svn-id: r17695
This commit is contained in:
parent
2cfb9322e2
commit
25d56525c8
4 changed files with 8 additions and 10 deletions
|
@ -133,7 +133,6 @@ class OSystem_Dreamcast : public OSystem {
|
||||||
void clearOverlay();
|
void clearOverlay();
|
||||||
void grabOverlay(int16 *buf, int pitch);
|
void grabOverlay(int16 *buf, int pitch);
|
||||||
void copyRectToOverlay(const int16 *buf, int pitch, int x, int y, int w, int h);
|
void copyRectToOverlay(const int16 *buf, int pitch, int x, int y, int w, int h);
|
||||||
bool hasAlpha() const { return true; }
|
|
||||||
OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b) { return ARGBToColor(255, r, g, b); }
|
OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b) { return ARGBToColor(255, r, g, b); }
|
||||||
void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
|
void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
|
||||||
uint8 tmp; colorToARGB(color, tmp, r, g, b);
|
uint8 tmp; colorToARGB(color, tmp, r, g, b);
|
||||||
|
|
|
@ -151,6 +151,7 @@ bool OSystem_Dreamcast::hasFeature(Feature f)
|
||||||
switch(f) {
|
switch(f) {
|
||||||
case kFeatureAspectRatioCorrection:
|
case kFeatureAspectRatioCorrection:
|
||||||
case kFeatureVirtualKeyboard:
|
case kFeatureVirtualKeyboard:
|
||||||
|
case kFeatureOverlaySupportsAlpha:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -110,7 +110,12 @@ public:
|
||||||
* Entertainment games. If backend doesn't implement this feature then
|
* Entertainment games. If backend doesn't implement this feature then
|
||||||
* engine switches to b/w version of cursors.
|
* engine switches to b/w version of cursors.
|
||||||
*/
|
*/
|
||||||
kFeatureCursorHasPalette
|
kFeatureCursorHasPalette,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set to true if the overlay pixel format has an alpha channel.
|
||||||
|
*/
|
||||||
|
kFeatureOverlaySupportsAlpha
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -460,13 +465,6 @@ public:
|
||||||
virtual int overlayToScreenX(int x) { return x; }
|
virtual int overlayToScreenX(int x) { return x; }
|
||||||
virtual int overlayToScreenY(int y) { return y; }
|
virtual int overlayToScreenY(int y) { return y; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true if the overlay pixel format has an alpha channel.
|
|
||||||
*/
|
|
||||||
virtual bool hasAlpha() const {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert the given RGB triplet into an OverlayColor. A OverlayColor can
|
* Convert the given RGB triplet into an OverlayColor. A OverlayColor can
|
||||||
* be 8bit, 16bit or 32bit, depending on the target system. The default
|
* be 8bit, 16bit or 32bit, depending on the target system. The default
|
||||||
|
|
|
@ -365,7 +365,7 @@ void NewGui::blendRect(int x, int y, int w, int h, OverlayColor color, int level
|
||||||
if (!rect.isValidRect())
|
if (!rect.isValidRect())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_system->hasAlpha()) {
|
if (_system->hasFeature(OSystem::kFeatureOverlaySupportsAlpha)) {
|
||||||
|
|
||||||
int a, r, g, b;
|
int a, r, g, b;
|
||||||
uint8 aa, ar, ag, ab;
|
uint8 aa, ar, ag, ab;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue