Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jul 2016 07:31:14 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r418266 - head/emulators/ppsspp/files
Message-ID:  <201607090731.u697VEOk098264@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sat Jul  9 07:31:13 2016
New Revision: 418266
URL: https://svnweb.freebsd.org/changeset/ports/418266

Log:
  emulators/ppsspp: unbreak runtime on DragonFly
  
  $ ppsspp
  Unable to initialize SDL: SDL not built with joystick support

Added:
  head/emulators/ppsspp/files/patch-no-joystick   (contents, props changed)

Added: head/emulators/ppsspp/files/patch-no-joystick
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/ppsspp/files/patch-no-joystick	Sat Jul  9 07:31:13 2016	(r418266)
@@ -0,0 +1,53 @@
+commit 3fc255b
+Author: Henrik RydgÄrd <hrydgard@gmail.com>
+Date:   Sat Jul 9 09:15:11 2016 +0200
+
+    Make it possible to run even if SDL was built with joystick disabled.  Should fix #8851.
+---
+ ext/native/base/PCMain.cpp | 18 ++++++++++++++----
+ 1 file changed, 14 insertions(+), 4 deletions(-)
+
+diff --git ext/native/base/PCMain.cpp ext/native/base/PCMain.cpp
+index cead0d7..00ec49a 100644
+--- ext/native/base/PCMain.cpp
++++ ext/native/base/PCMain.cpp
+@@ -426,9 +426,13 @@ int main(int argc, char *argv[]) {
+ 
+ 	net::Init();
+ 
++	bool joystick_enabled = true;
+ 	if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0) {
+-		fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError());
+-		return 1;
++		joystick_enabled = false;
++		if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
++			fprintf(stderr, "Unable to initialize SDL: %s\n", SDL_GetError());
++			return 1;
++		}
+ 	}
+ 
+ #ifdef __APPLE__
+@@ -659,7 +663,11 @@ int main(int argc, char *argv[]) {
+ 	// Audio must be unpaused _after_ NativeInit()
+ 	SDL_PauseAudio(0);
+ #ifndef _WIN32
+-	joystick = new SDLJoystick();
++	if (joystick_enabled) {
++		joystick = new SDLJoystick();
++	} else {
++		joystick = nullptr;
++	}
+ #endif
+ 	EnableFZ();
+ 
+@@ -848,7 +856,9 @@ int main(int argc, char *argv[]) {
+ 				break;
+ 			default:
+ #ifndef _WIN32
+-				joystick->ProcessInput(event);
++				if (joystick) {
++					joystick->ProcessInput(event);
++				}
+ #endif
+ 				break;
+ 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607090731.u697VEOk098264>