[Scummvm-git-logs] scummvm branch-2-2 -> c4d418d3531b28c8f0d576ec16a789de2a83016c

criezy criezy at scummvm.org
Mon Sep 7 18:12:18 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:
c979087aa1 MORPHOS: Add OpenURL support
c4d418d353 MORPHOS : add kFeatureOpenUrl


Commit: c979087aa1d178e82d0c1831a47c2d2278b4e5ad
    https://github.com/scummvm/scummvm/commit/c979087aa1d178e82d0c1831a47c2d2278b4e5ad
Author: BeWorld (36823759+BeWorld2018 at users.noreply.github.com)
Date: 2020-09-07T19:11:54+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: c4d418d3531b28c8f0d576ec16a789de2a83016c
    https://github.com/scummvm/scummvm/commit/c4d418d3531b28c8f0d576ec16a789de2a83016c
Author: BeWorld (36823759+BeWorld2018 at users.noreply.github.com)
Date: 2020-09-07T19:12:03+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