[Scummvm-git-logs] scummvm master -> 07e10b5cc3339ab19cf59edd532bf804a2dd6f44

spleen1981 noreply at scummvm.org
Fri May 10 22:58:12 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
07e10b5cc3 LIBRETRO: add displayMessageOnOSD to sw graphics manager


Commit: 07e10b5cc3339ab19cf59edd532bf804a2dd6f44
    https://github.com/scummvm/scummvm/commit/07e10b5cc3339ab19cf59edd532bf804a2dd6f44
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-05-11T00:58:00+02:00

Commit Message:
LIBRETRO: add displayMessageOnOSD to sw graphics manager

Changed paths:
    backends/platform/libretro/include/libretro-graphics.h
    backends/platform/libretro/src/libretro-graphics.cpp


diff --git a/backends/platform/libretro/include/libretro-graphics.h b/backends/platform/libretro/include/libretro-graphics.h
index 1a5020f3de3..20aef9d8049 100644
--- a/backends/platform/libretro/include/libretro-graphics.h
+++ b/backends/platform/libretro/include/libretro-graphics.h
@@ -120,6 +120,8 @@ public:
 	void fillScreen(const Common::Rect &r, uint32 col) override {}
 	void setFocusRectangle(const Common::Rect &rect) override {}
 	void clearFocusRectangle() override {}
+	void displayMessageOnOSD(const Common::U32String &msg) override;
+	void displayActivityIconOnOSD(const Graphics::Surface *icon) override {}
 
 	void realUpdateScreen(void);
 
diff --git a/backends/platform/libretro/src/libretro-graphics.cpp b/backends/platform/libretro/src/libretro-graphics.cpp
index cc30176174f..d190b3d1110 100644
--- a/backends/platform/libretro/src/libretro-graphics.cpp
+++ b/backends/platform/libretro/src/libretro-graphics.cpp
@@ -27,6 +27,8 @@
 #include "backends/platform/libretro/include/libretro-timer.h"
 #include "backends/platform/libretro/include/libretro-graphics.h"
 
+#include "gui/message.h"
+
 #ifdef USE_OPENGL
 #include "backends/graphics/opengl/opengl-graphics.h"
 #include "backends/graphics/opengl/framebuffer.h"
@@ -446,6 +448,12 @@ void LibretroGraphics::setFeatureState(OSystem::Feature f, bool enable) {
 		_mousePaletteEnabled = enable;
 }
 
+void LibretroGraphics::displayMessageOnOSD(const Common::U32String &msg) {
+	// Display the message for 3 seconds
+	GUI::TimedMessageDialog dialog(msg, 3000);
+	dialog.runModal();
+}
+
 bool LibretroGraphics::getFeatureState(OSystem::Feature f) const {
 	return (f == OSystem::kFeatureCursorPalette) ? _mousePaletteEnabled : false;
 }




More information about the Scummvm-git-logs mailing list