[Scummvm-git-logs] scummvm master -> 668e2b66affdd6cadb5c8f1717a2dc30fcbcbffb

spleen1981 noreply at scummvm.org
Mon Sep 16 21:34:51 UTC 2024


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

Summary:
5653e16f26 LIBRETRO: BUILD: add 'noengine' target
b7c2e361b2 LIBRETRO: add context reset on retroarch graphic driver reset
fa206df0d9 LIBRETRO: BUILD: fix genode TARGET string
668e2b66af LIBRETRO: fix cursor glitch


Commit: 5653e16f26fe8cb69a66031bb49b7e72aab34632
    https://github.com/scummvm/scummvm/commit/5653e16f26fe8cb69a66031bb49b7e72aab34632
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-09-16T23:33:31+02:00

Commit Message:
LIBRETRO: BUILD: add 'noengine' target

Changed paths:
    backends/platform/libretro/Makefile.common


diff --git a/backends/platform/libretro/Makefile.common b/backends/platform/libretro/Makefile.common
index ff24b44065d..f9e1af97bbb 100644
--- a/backends/platform/libretro/Makefile.common
+++ b/backends/platform/libretro/Makefile.common
@@ -194,18 +194,17 @@ endif
 
 # Engine modules
 # Following script generates configuration engines files (build/config.mk.engines, engines/engines.mk, engines/plugins_table.h, engines/detection_table.h) from actual source in $(SCUMMVM_PATH).
-ifeq (,$(filter clean datafiles coreinfo,$(MAKECMDGOALS)))
+ifeq (,$(filter clean datafiles coreinfo noengine,$(MAKECMDGOALS)))
 $(info Configuring ScummVM engines...)
 ifneq ($(shell cd $(SCRIPTS_PATH); ./configure_engines.sh $(ROOT_PATH) $(SCUMMVM_PATH) $(NO_WIP) $(STATIC_LINKING) $(LITE) $(UNAVAILABLE_DEPS)),0)
    $(error Configuring ScummVM engines failed)
 else
+-include $(SCUMMVM_PATH)/config.mk.engines
+-include $(SCUMMVM_PATH)/engines/engines.mk
    $(info - ScummVM engines configured)
 endif
 endif
 
--include $(SCUMMVM_PATH)/config.mk.engines
--include $(SCUMMVM_PATH)/engines/engines.mk
-
 ifeq ($(USE_MT32EMU),1)
    INCLUDES    += -I$(SCUMMVM_PATH)/audio/softsynth/mt32/sha1
    DEFINES += -DUSE_MT32EMU
@@ -237,6 +236,8 @@ endif
 
 core: $(TARGET)
 
+noengine: $(TARGET)
+
 datafiles: scummvm.zip
 
 coreinfo: $(TARGET_NAME)_libretro.info


Commit: b7c2e361b2745dd71190cbc4dd257b231f7d4a50
    https://github.com/scummvm/scummvm/commit/b7c2e361b2745dd71190cbc4dd257b231f7d4a50
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-09-16T23:33:51+02:00

Commit Message:
LIBRETRO: add context reset on retroarch graphic driver reset

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


diff --git a/backends/platform/libretro/include/libretro-graphics.h b/backends/platform/libretro/include/libretro-graphics.h
index 20aef9d8049..7dd88a48a19 100644
--- a/backends/platform/libretro/include/libretro-graphics.h
+++ b/backends/platform/libretro/include/libretro-graphics.h
@@ -90,7 +90,7 @@ public:
 	bool hasFeature(OSystem::Feature f) const override;
 	void setFeatureState(OSystem::Feature f, bool enable) override;
 	bool getFeatureState(OSystem::Feature f) const override;
-	
+
 	int getDefaultGraphicsMode() const override {
 		return 0;
 	}
@@ -141,6 +141,7 @@ public:
 	bool isOverlayInGUI(void){ return _overlayInGUI; }
 	void setMousePosition(int x, int y);
 	Common::Point convertWindowToVirtual(int x, int y) const;
+	void resetContext(OpenGL::ContextType contextType);
 };
 
 class LibretroHWFramebuffer : public OpenGL::Backbuffer {
diff --git a/backends/platform/libretro/include/libretro-os.h b/backends/platform/libretro/include/libretro-os.h
index baef84681b7..5d6248efc79 100644
--- a/backends/platform/libretro/include/libretro-os.h
+++ b/backends/platform/libretro/include/libretro-os.h
@@ -93,6 +93,7 @@ public:
 	bool isOverlayInGUI(void);
 
 #ifdef USE_OPENGL
+	void resetGraphicsContext(void);
 	void *getOpenGLProcAddress(const char *name) const override;
 #endif
 
diff --git a/backends/platform/libretro/src/libretro-core.cpp b/backends/platform/libretro/src/libretro-core.cpp
index 99c1cbd5802..a6737ef2e01 100644
--- a/backends/platform/libretro/src/libretro-core.cpp
+++ b/backends/platform/libretro/src/libretro-core.cpp
@@ -110,6 +110,8 @@ static struct retro_hw_render_callback hw_render;
 
 static void context_reset(void) {
 	retro_log_cb(RETRO_LOG_DEBUG, "HW context reset\n");
+	if (retro_emu_thread_started())
+		LIBRETRO_G_SYSTEM->resetGraphicsContext();
 }
 
 static void context_destroy(void) {
diff --git a/backends/platform/libretro/src/libretro-graphics.cpp b/backends/platform/libretro/src/libretro-graphics.cpp
index d190b3d1110..79eace5d4a5 100644
--- a/backends/platform/libretro/src/libretro-graphics.cpp
+++ b/backends/platform/libretro/src/libretro-graphics.cpp
@@ -460,14 +460,7 @@ bool LibretroGraphics::getFeatureState(OSystem::Feature f) const {
 
 #ifdef USE_OPENGL
 LibretroOpenGLGraphics::LibretroOpenGLGraphics(OpenGL::ContextType contextType) {
-	const Graphics::PixelFormat rgba8888 =
-#ifdef SCUMM_LITTLE_ENDIAN
-									   Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24);
-#else
-									   Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
-#endif
-	notifyContextCreate(contextType, new LibretroHWFramebuffer(), rgba8888, rgba8888);
-	handleResize(RES_W_OVERLAY, RES_H_OVERLAY);
+	resetContext(contextType);
 }
 
 void LibretroOpenGLGraphics::refreshScreen(){
@@ -485,4 +478,17 @@ Common::Point LibretroOpenGLGraphics::convertWindowToVirtual(int x, int y) const
 void LibretroHWFramebuffer::activateInternal(){
 	GL_CALL(glBindFramebuffer(GL_FRAMEBUFFER, retro_get_hw_fb()));
 }
+
+void LibretroOpenGLGraphics::resetContext(OpenGL::ContextType contextType) {
+	const Graphics::PixelFormat rgba8888 =
+#ifdef SCUMM_LITTLE_ENDIAN
+									   Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24);
+#else
+									   Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+#endif
+	notifyContextDestroy();
+	notifyContextCreate(contextType, new LibretroHWFramebuffer(), rgba8888, rgba8888);
+	handleResize(RES_W_OVERLAY, RES_H_OVERLAY);
+}
+
 #endif
diff --git a/backends/platform/libretro/src/libretro-os-base.cpp b/backends/platform/libretro/src/libretro-os-base.cpp
index 6c3fd1bf25b..21ed77fb049 100644
--- a/backends/platform/libretro/src/libretro-os-base.cpp
+++ b/backends/platform/libretro/src/libretro-os-base.cpp
@@ -181,6 +181,13 @@ void OSystem_libretro::refreshScreen(void) {
 void *OSystem_libretro::getOpenGLProcAddress(const char *name) const {
 	return retro_get_proc_address(name);
 }
+
+void OSystem_libretro::resetGraphicsContext(void) {
+	if ((retro_get_video_hw_mode() & VIDEO_GRAPHIC_MODE_REQUEST_HW) && (retro_get_video_hw_mode() & VIDEO_GRAPHIC_MODE_HAVE_OPENGL))
+		dynamic_cast<LibretroOpenGLGraphics *>(_graphicsManager)->resetContext(OpenGL::kContextGL);
+	else if ((retro_get_video_hw_mode() & VIDEO_GRAPHIC_MODE_REQUEST_HW) && (retro_get_video_hw_mode() & VIDEO_GRAPHIC_MODE_HAVE_OPENGLES2))
+		dynamic_cast<LibretroOpenGLGraphics *>(_graphicsManager)->resetContext(OpenGL::kContextGLES2);
+}
 #endif
 
 int16 OSystem_libretro::getScreenWidth(void){


Commit: fa206df0d92976df008184702073c55edc8b88a7
    https://github.com/scummvm/scummvm/commit/fa206df0d92976df008184702073c55edc8b88a7
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-09-16T23:34:19+02:00

Commit Message:
LIBRETRO: BUILD: fix genode TARGET string

Changed paths:
    backends/platform/libretro/Makefile


diff --git a/backends/platform/libretro/Makefile b/backends/platform/libretro/Makefile
index 638d77cbc3a..420a520c804 100644
--- a/backends/platform/libretro/Makefile
+++ b/backends/platform/libretro/Makefile
@@ -109,7 +109,7 @@ else ifeq ($(platform), qnx)
 
 # Genode
 else ifeq ($(platform), genode)
-   TARGET  := libretro.so
+   TARGET  := $(TARGET_NAME)_libretro_$(platform).so
    DEFINES += -fPIC -DSYSTEM_NOT_SUPPORTING_D_TYPE -DDEFAULT_PERF_TUNER
    C_PKGS   = libc
    CXX_PKGS = stdcxx genode-base


Commit: 668e2b66affdd6cadb5c8f1717a2dc30fcbcbffb
    https://github.com/scummvm/scummvm/commit/668e2b66affdd6cadb5c8f1717a2dc30fcbcbffb
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2024-09-16T23:34:36+02:00

Commit Message:
LIBRETRO: fix cursor glitch

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 7dd88a48a19..13db3146cf1 100644
--- a/backends/platform/libretro/include/libretro-graphics.h
+++ b/backends/platform/libretro/include/libretro-graphics.h
@@ -137,6 +137,7 @@ public:
 	bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) override { return true; };
 	void refreshScreen() override;
 	void setSystemMousePosition(const int x, const int y) override {};
+	void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format, const byte *mask) override;
 
 	bool isOverlayInGUI(void){ return _overlayInGUI; }
 	void setMousePosition(int x, int y);
diff --git a/backends/platform/libretro/src/libretro-graphics.cpp b/backends/platform/libretro/src/libretro-graphics.cpp
index 79eace5d4a5..a6fd1aa7f7b 100644
--- a/backends/platform/libretro/src/libretro-graphics.cpp
+++ b/backends/platform/libretro/src/libretro-graphics.cpp
@@ -471,6 +471,16 @@ void LibretroOpenGLGraphics::setMousePosition(int x, int y){
 	OpenGL::OpenGLGraphicsManager::setMousePosition(x,y);
 }
 
+void LibretroOpenGLGraphics::setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale, const Graphics::PixelFormat *format, const byte *mask) {
+	/* Workaround to fix a cursor glich (e.g. GUI with Classic theme) occurring when any overlay is activated from retroarch (e.g. keyboard overlay).
+	   Currently no feedback is available from frontend to detect if overlays are toggled to delete _cursor only if needed.
+	   @TODO: root cause to be investigated. */
+	delete _cursor;
+	_cursor = nullptr;
+	OpenGL::OpenGLGraphicsManager::setMouseCursor(buf, w, h, hotspotX, hotspotY, keycolor, dontScale, format, mask);
+}
+
+
 Common::Point LibretroOpenGLGraphics::convertWindowToVirtual(int x, int y) const {
 	return OpenGL::OpenGLGraphicsManager::convertWindowToVirtual(x, y);
 }




More information about the Scummvm-git-logs mailing list