mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-02 23:26:44 +00:00
GUI: Add getOSDFormat() and make OSD 32 bpp
This commit is contained in:
parent
b32c2be78d
commit
1b9987ddc9
@ -48,6 +48,11 @@ void BaseBackend::clearOSD() {
|
||||
//what should I do? Remove all TimedMessageDialogs?
|
||||
}
|
||||
|
||||
Graphics::PixelFormat BaseBackend::getOSDFormat() {
|
||||
warning("BaseBackend::getOSDFormat not implemented");
|
||||
return Graphics::PixelFormat();
|
||||
}
|
||||
|
||||
void BaseBackend::initBackend() {
|
||||
// Init Event manager
|
||||
#ifndef DISABLE_DEFAULT_EVENT_MANAGER
|
||||
|
@ -35,6 +35,7 @@ public:
|
||||
virtual void displayMessageOnOSD(const char *msg);
|
||||
virtual void copyRectToOSD(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void clearOSD();
|
||||
virtual Graphics::PixelFormat getOSDFormat();
|
||||
virtual void fillScreen(uint32 col);
|
||||
};
|
||||
|
||||
|
@ -86,6 +86,8 @@ public:
|
||||
virtual void displayMessageOnOSD(const char *msg) {}
|
||||
virtual void copyRectToOSD(const void *buf, int pitch, int x, int y, int w, int h) {}
|
||||
virtual void clearOSD() {}
|
||||
virtual Graphics::PixelFormat getOSDFormat() { return Graphics::PixelFormat(); }
|
||||
|
||||
|
||||
// Graphics::PaletteManager interface
|
||||
//virtual void setPalette(const byte *colors, uint start, uint num) = 0;
|
||||
|
@ -774,6 +774,8 @@ void OpenGLGraphicsManager::clearOSD() {
|
||||
#endif
|
||||
}
|
||||
|
||||
Graphics::PixelFormat OpenGLGraphicsManager::getOSDFormat() { return Graphics::PixelFormat(); } //TODO
|
||||
|
||||
void OpenGLGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
|
||||
assert(_gameScreen->hasPalette());
|
||||
|
||||
|
@ -117,6 +117,7 @@ public:
|
||||
virtual void displayMessageOnOSD(const char *msg);
|
||||
virtual void copyRectToOSD(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void clearOSD();
|
||||
virtual Graphics::PixelFormat getOSDFormat();
|
||||
|
||||
// PaletteManager interface
|
||||
virtual void setPalette(const byte *colors, uint start, uint num);
|
||||
|
@ -883,13 +883,26 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
|
||||
_osdSurface = SDL_CreateRGBSurface(SDL_SWSURFACE | SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA,
|
||||
_hwscreen->w,
|
||||
_hwscreen->h,
|
||||
16,
|
||||
_hwscreen->format->Rmask,
|
||||
_hwscreen->format->Gmask,
|
||||
_hwscreen->format->Bmask,
|
||||
_hwscreen->format->Amask);
|
||||
32,
|
||||
0xFF000000,
|
||||
0x00FF0000,
|
||||
0x0000FF00,
|
||||
0x000000FF
|
||||
);
|
||||
if (_osdSurface == NULL)
|
||||
error("allocating _osdSurface failed");
|
||||
|
||||
_osdFormat.bytesPerPixel = _osdSurface->format->BytesPerPixel;
|
||||
|
||||
_osdFormat.rLoss = _osdSurface->format->Rloss;
|
||||
_osdFormat.gLoss = _osdSurface->format->Gloss;
|
||||
_osdFormat.bLoss = _osdSurface->format->Bloss;
|
||||
_osdFormat.aLoss = _osdSurface->format->Aloss;
|
||||
|
||||
_osdFormat.rShift = _osdSurface->format->Rshift;
|
||||
_osdFormat.gShift = _osdSurface->format->Gshift;
|
||||
_osdFormat.bShift = _osdSurface->format->Bshift;
|
||||
_osdFormat.aShift = _osdSurface->format->Ashift;
|
||||
SDL_SetColorKey(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kOSDColorKey);
|
||||
#endif
|
||||
|
||||
@ -2277,6 +2290,10 @@ void SurfaceSdlGraphicsManager::clearOSD() {
|
||||
// Ensure a full redraw takes place next time the screen is updated
|
||||
_forceFull = true;
|
||||
}
|
||||
|
||||
Graphics::PixelFormat SurfaceSdlGraphicsManager::getOSDFormat() {
|
||||
return _osdFormat;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool SurfaceSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
|
||||
|
@ -147,6 +147,7 @@ public:
|
||||
virtual void displayMessageOnOSD(const char *msg);
|
||||
virtual void copyRectToOSD(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void clearOSD();
|
||||
virtual Graphics::PixelFormat getOSDFormat();
|
||||
#endif
|
||||
|
||||
// Override from Common::EventObserver
|
||||
@ -175,6 +176,8 @@ protected:
|
||||
kOSDColorKey = 1, /** < Transparent color key */
|
||||
kOSDInitialAlpha = 80 /** < Initial alpha level, in percent */
|
||||
};
|
||||
/** OSD pixel format */
|
||||
Graphics::PixelFormat _osdFormat;
|
||||
#endif
|
||||
|
||||
/** Hardware screen */
|
||||
|
@ -249,6 +249,10 @@ void ModularBackend::clearOSD() {
|
||||
_graphicsManager->clearOSD();
|
||||
}
|
||||
|
||||
Graphics::PixelFormat ModularBackend::getOSDFormat() {
|
||||
return _graphicsManager->getOSDFormat();
|
||||
}
|
||||
|
||||
void ModularBackend::quit() {
|
||||
exit(0);
|
||||
}
|
||||
|
@ -129,6 +129,7 @@ public:
|
||||
virtual void displayMessageOnOSD(const char *msg);
|
||||
virtual void copyRectToOSD(const void *buf, int pitch, int x, int y, int w, int h);
|
||||
virtual void clearOSD();
|
||||
virtual Graphics::PixelFormat getOSDFormat();
|
||||
|
||||
//@}
|
||||
|
||||
|
@ -1118,6 +1118,12 @@ public:
|
||||
|
||||
virtual void clearOSD() = 0;
|
||||
|
||||
/**
|
||||
* Returns 'on screen display' pixel format.
|
||||
*/
|
||||
|
||||
virtual Graphics::PixelFormat getOSDFormat() = 0;
|
||||
|
||||
/**
|
||||
* Return the SaveFileManager, used to store and load savestates
|
||||
* and other modifiable persistent game data. For more information,
|
||||
|
Loading…
Reference in New Issue
Block a user