[Scummvm-git-logs] scummvm master -> 0e4e606e3600c0b0933601de9704c7e88759ad5e

criezy criezy at scummvm.org
Mon Sep 7 18:11:26 UTC 2020


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

Summary:
81fe49242a MORPHOS: Add OpenURL support
0e4e606e36 MORPHOS : add kFeatureOpenUrl


Commit: 81fe49242a6e2237b2bfa5c0559db3e310f421c2
    https://github.com/scummvm/scummvm/commit/81fe49242a6e2237b2bfa5c0559db3e310f421c2
Author: BeWorld (36823759+BeWorld2018 at users.noreply.github.com)
Date: 2020-09-07T19:10:05+01:00

Commit Message:
MORPHOS: Add OpenURL support

- add OpenURL support
- setupIcon doesnt working with SDL2 MorphOS

Changed paths:
    backends/platform/sdl/morphos/morphos.cpp
    backends/platform/sdl/morphos/morphos.h
    backends/platform/sdl/sdl-window.cpp


diff --git a/backends/platform/sdl/morphos/morphos.cpp b/backends/platform/sdl/morphos/morphos.cpp
index ecf94bcd6f..7e99a806a8 100644
--- a/backends/platform/sdl/morphos/morphos.cpp
+++ b/backends/platform/sdl/morphos/morphos.cpp
@@ -26,6 +26,8 @@
 
 #include "backends/platform/sdl/morphos/morphos.h"
 #include "backends/fs/morphos/morphos-fs-factory.h"
+#include <proto/exec.h>
+#include <proto/openurl.h>
 
 void OSystem_MorphOS::init() {
 	// Initialze File System Factory
@@ -35,4 +37,18 @@ void OSystem_MorphOS::init() {
 	OSystem_SDL::init();
 }
 
+bool OSystem_MorphOS::openUrl(const Common::String &url) {
+
+	struct Library *OpenURLBase = OpenLibrary("openurl.library",0);
+	static struct TagItem URLTags[] = {{TAG_DONE, (ULONG) NULL}};
+
+	if (OpenURLBase){
+		URL_OpenA((STRPTR)url.c_str(), (struct TagItem*) URLTags);
+		CloseLibrary(OpenURLBase);
+		return true;
+	}
+
+	return false;
+
+}
 #endif
diff --git a/backends/platform/sdl/morphos/morphos.h b/backends/platform/sdl/morphos/morphos.h
index c8e3b63c90..277bd6871a 100644
--- a/backends/platform/sdl/morphos/morphos.h
+++ b/backends/platform/sdl/morphos/morphos.h
@@ -27,10 +27,8 @@
 
 class OSystem_MorphOS : public OSystem_SDL {
 public:
-	OSystem_MorphOS() {}
-	virtual ~OSystem_MorphOS() {}
-
-	virtual void init();
+	virtual void init() override;
+	virtual bool openUrl(const Common::String &url) override;
 };
 
 #endif
diff --git a/backends/platform/sdl/sdl-window.cpp b/backends/platform/sdl/sdl-window.cpp
index 68370941b6..217734bd44 100644
--- a/backends/platform/sdl/sdl-window.cpp
+++ b/backends/platform/sdl/sdl-window.cpp
@@ -62,6 +62,7 @@ SdlWindow::~SdlWindow() {
 }
 
 void SdlWindow::setupIcon() {
+#ifndef __MORPHOS__
 	int x, y, w, h, ncols, nbytes, i;
 	unsigned int rgba[256];
 	unsigned int *icon;
@@ -130,6 +131,7 @@ void SdlWindow::setupIcon() {
 
 	SDL_FreeSurface(sdl_surf);
 	free(icon);
+#endif
 }
 
 void SdlWindow::setWindowCaption(const Common::String &caption) {


Commit: 0e4e606e3600c0b0933601de9704c7e88759ad5e
    https://github.com/scummvm/scummvm/commit/0e4e606e3600c0b0933601de9704c7e88759ad5e
Author: BeWorld (36823759+BeWorld2018 at users.noreply.github.com)
Date: 2020-09-07T19:10:16+01:00

Commit Message:
MORPHOS : add kFeatureOpenUrl

Enable OpenURL

Changed paths:
    backends/platform/sdl/morphos/morphos.cpp
    backends/platform/sdl/morphos/morphos.h


diff --git a/backends/platform/sdl/morphos/morphos.cpp b/backends/platform/sdl/morphos/morphos.cpp
index 7e99a806a8..96a7dfd169 100644
--- a/backends/platform/sdl/morphos/morphos.cpp
+++ b/backends/platform/sdl/morphos/morphos.cpp
@@ -26,7 +26,6 @@
 
 #include "backends/platform/sdl/morphos/morphos.h"
 #include "backends/fs/morphos/morphos-fs-factory.h"
-#include <proto/exec.h>
 #include <proto/openurl.h>
 
 void OSystem_MorphOS::init() {
@@ -37,14 +36,19 @@ void OSystem_MorphOS::init() {
 	OSystem_SDL::init();
 }
 
+bool OSystem_MorphOS::hasFeature(Feature f) {
+	if (f == kFeatureOpenUrl)
+		return true;
+
+	return OSystem_SDL::hasFeature(f);
+}
+
 bool OSystem_MorphOS::openUrl(const Common::String &url) {
 
-	struct Library *OpenURLBase = OpenLibrary("openurl.library",0);
 	static struct TagItem URLTags[] = {{TAG_DONE, (ULONG) NULL}};
 
 	if (OpenURLBase){
 		URL_OpenA((STRPTR)url.c_str(), (struct TagItem*) URLTags);
-		CloseLibrary(OpenURLBase);
 		return true;
 	}
 
diff --git a/backends/platform/sdl/morphos/morphos.h b/backends/platform/sdl/morphos/morphos.h
index 277bd6871a..28507d0166 100644
--- a/backends/platform/sdl/morphos/morphos.h
+++ b/backends/platform/sdl/morphos/morphos.h
@@ -28,6 +28,7 @@
 class OSystem_MorphOS : public OSystem_SDL {
 public:
 	virtual void init() override;
+	virtual bool hasFeature(Feature f);
 	virtual bool openUrl(const Common::String &url) override;
 };
 




More information about the Scummvm-git-logs mailing list