From a2f2423ce56841b39badee043c0416e203756812 Mon Sep 17 00:00:00 2001
From: Scott McCreary <scottmc2@gmail.com>
Date: Wed, 1 Feb 2017 21:23:54 -0800
Subject: Add Window title


diff --git a/gfx.c b/gfx.c
index 4a5e1bc..81935d1 100644
--- a/gfx.c
+++ b/gfx.c
@@ -295,6 +295,7 @@ unsigned char r,g,b;
 	}
 	stride=thescreen->pitch;
 	videomem=(void *)thescreen->pixels;
+	SDL_WM_SetCaption("SDL Lopan", "SDL Lopan");
 //	SDL_ShowCursor(0);
 
 	for(i=0;i<65536;++i)
-- 
2.23.0


From 958f5393c18e0b3891e6778247438dc72c072811 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Thu, 28 Nov 2013 20:44:31 +0100
Subject: Search data in app directory.


diff --git a/lopan.c b/lopan.c
index d653914..a597b9f 100644
--- a/lopan.c
+++ b/lopan.c
@@ -1,3 +1,4 @@
+#include <libgen.h>
 #include <stdlib.h>
 #include <sys/time.h>
 #include <unistd.h>
@@ -543,6 +544,8 @@ int code;
 unsigned char redraw;
 int backup;
 
+	chdir(dirname(argv[0]));
+
 	bgsetnumber=tilesetnumber=-1;
 	randomize();
 	opendisplay(640,400);
diff --git a/lopan.rdef b/lopan.rdef
new file mode 100644
index 0000000..78d07c4
--- /dev/null
+++ b/lopan.rdef
@@ -0,0 +1,31 @@
+resource app_signature "application/x-vnd.dave.ashley.lopan";
+
+resource app_flags B_SINGLE_LAUNCH;
+
+resource app_version {
+	major  = 1,
+	middle = 0,
+	minor  = 0,
+
+	/* 0 = development	1 = alpha			2 = beta
+	   3 = gamma		4 = golden master	5 = final */
+	variety = 5,
+
+	internal = 0,
+
+	short_info = "The well known Lopan (Mah Jongg) game",
+	long_info  = "The well known Lopan (Mah Jongg) game."
+};
+
+resource vector_icon {
+	$"6E6369660603010000020006023CADF1B9F5753B2AF93E24E54728E447795600"
+	$"FFFCE8FED7D3B4020006023C96323A4D3FBAFC013D5A974B57A549844D006662"
+	$"4DFFA4A08202000602BC592FBB29A73C0CE4BD0B7C4892C04B796600C3BC8FFF"
+	$"C3BFA3040180020106023D60000000000000003CE00049000048800000FF0000"
+	$"FFB70000070A06224222494159593B59323B280A042242414F59323B280A0441"
+	$"4E4159593B59320A04224222494159414E0A04415B475B603A59390606EE0E41"
+	$"2E4130422F4031304536433542374244324731C22EB9F349300204393238313A"
+	$"334B384B374B39453D443C463E353839383637070A040104000A000100100117"
+	$"8400040A010101000A020102000A030103000A0501052021210A050106100117"
+	$"830004"
+};
-- 
2.23.0


From d26493aefb5049ef5afb473fb81d2381043aadfc Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Tue, 5 Nov 2019 13:43:02 +0100
Subject: Fix launch from DeskbarMenu


diff --git a/lopan.c b/lopan.c
index a597b9f..6d18c68 100644
--- a/lopan.c
+++ b/lopan.c
@@ -544,7 +544,11 @@ int code;
 unsigned char redraw;
 int backup;
 
-	chdir(dirname(argv[0]));
+char *binpath = realpath(argv[0], NULL);
+if (binpath != NULL) {
+	chdir(dirname(binpath));
+	free(binpath);
+}
 
 	bgsetnumber=tilesetnumber=-1;
 	randomize();
-- 
2.23.0

