diff options
author | Bastien Bouclet | 2016-09-13 20:35:05 +0200 |
---|---|---|
committer | Bastien Bouclet | 2016-09-13 20:41:26 +0200 |
commit | 9cbaad61405f0a4c8b88eb4e6637b84a12633c1a (patch) | |
tree | e4c26a252fb7876c7ed59b6407fa2cbb6011b659 /backends/graphics/opengl/opengl-graphics.h | |
parent | 05bc82b6225f79ad42e6259be8e227aed6e7c0dc (diff) | |
download | scummvm-rg350-9cbaad61405f0a4c8b88eb4e6637b84a12633c1a.tar.gz scummvm-rg350-9cbaad61405f0a4c8b88eb4e6637b84a12633c1a.tar.bz2 scummvm-rg350-9cbaad61405f0a4c8b88eb4e6637b84a12633c1a.zip |
SDL: Switch the OpenGL renderer to use small textures to draw the OSD
Diffstat (limited to 'backends/graphics/opengl/opengl-graphics.h')
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.h | 77 |
1 files changed, 63 insertions, 14 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index 55d2c5c826..366ad48fad 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -30,6 +30,8 @@ #include "common/frac.h" #include "common/mutex.h" +#include "graphics/surface.h" + namespace Graphics { class Font; } // End of namespace Graphics @@ -115,9 +117,7 @@ public: virtual void setCursorPalette(const byte *colors, uint start, uint num); 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 displayActivityIconOnOSD(const Graphics::Surface *icon); // PaletteManager interface virtual void setPalette(const byte *colors, uint start, uint num); @@ -548,30 +548,79 @@ protected: private: /** - * The OSD's contents. + * Request for the OSD icon surface to be updated. */ - Surface *_osd; + bool _osdMessageChangeRequest; /** - * Current opacity level of the OSD. + * The next OSD message. + * + * If this value is not empty, the OSD message will be set + * to it on the next frame. */ - uint8 _osdAlpha; + Common::String _osdMessageNextData; /** - * When fading the OSD has started. + * Set the OSD message surface with the value of the next OSD message. */ - uint32 _osdFadeStartTime; + void osdMessageUpdateSurface(); /** - * Mutex to allow displayMessageOnOSD to be used from the audio thread. + * The OSD message's contents. */ - Common::Mutex _osdMutex; + Surface *_osdMessageSurface; + + /** + * Current opacity level of the OSD message. + */ + uint8 _osdMessageAlpha; + + /** + * When fading the OSD message has started. + */ + uint32 _osdMessageFadeStartTime; + + enum { + kOSDMessageFadeOutDelay = 2 * 1000, + kOSDMessageFadeOutDuration = 500, + kOSDMessageInitialAlpha = 80 + }; + + /** + * Request for the OSD icon surface to be updated. + */ + bool _osdIconChangeRequest; + + /** + * The next OSD background activity icon. + * + * The OSD icon will be updated with this data on the next frame. + * Can be an unallocated surface if the OSD icon should not be displayed. + */ + Graphics::Surface _osdIconNextData; + + /** + * Set the OSD icon surface with the value of the next OSD icon. + */ + void osdIconUpdateSurface(); + + /** + * The OSD background activity icon's contents. + */ + Surface *_osdIconSurface; enum { - kOSDFadeOutDelay = 2 * 1000, - kOSDFadeOutDuration = 500, - kOSDInitialAlpha = 80 + kOSDIconTopMargin = 10, + kOSDIconRightMargin = 10 }; + + /** + * Mutex for the OSD draw calls. + * + * Mutex to allow displayMessageOnOSD and displayActivityIconOnOSD + * to be used from the audio and network threads. + */ + Common::Mutex _osdMutex; #endif }; |