Replace OSystem::hasAlpha with a feature flag

svn-id: r17695
This commit is contained in:
Max Horn 2005-04-19 20:35:48 +00:00
parent 2cfb9322e2
commit 25d56525c8
4 changed files with 8 additions and 10 deletions

View File

@ -133,7 +133,6 @@ class OSystem_Dreamcast : public OSystem {
void clearOverlay();
void grabOverlay(int16 *buf, int pitch);
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); }
void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
uint8 tmp; colorToARGB(color, tmp, r, g, b);

View File

@ -151,6 +151,7 @@ bool OSystem_Dreamcast::hasFeature(Feature f)
switch(f) {
case kFeatureAspectRatioCorrection:
case kFeatureVirtualKeyboard:
case kFeatureOverlaySupportsAlpha:
return true;
default:
return false;

View File

@ -110,7 +110,12 @@ public:
* Entertainment games. If backend doesn't implement this feature then
* 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 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
* be 8bit, 16bit or 32bit, depending on the target system. The default

View File

@ -365,7 +365,7 @@ void NewGui::blendRect(int x, int y, int w, int h, OverlayColor color, int level
if (!rect.isValidRect())
return;
if (_system->hasAlpha()) {
if (_system->hasFeature(OSystem::kFeatureOverlaySupportsAlpha)) {
int a, r, g, b;
uint8 aa, ar, ag, ab;