mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-29 13:00:32 +01:00
735e405bd2
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
106 lines
2.7 KiB
Diff
106 lines
2.7 KiB
Diff
diff -Naur openjazz-20190106/src/io/file.cpp openjazz-20190106.patched/src/io/file.cpp
|
|
--- openjazz-20190106/src/io/file.cpp 2018-06-18 17:54:50.791926735 -0400
|
|
+++ openjazz-20190106.patched/src/io/file.cpp 2021-10-26 19:57:37.051448527 -0400
|
|
@@ -48,6 +48,16 @@
|
|
* @param write Whether or not the file can be written to
|
|
*/
|
|
File::File (const char* name, bool write) {
|
|
+#ifdef HOMEDIR
|
|
+ if(write) {
|
|
+ char *writepath = createString(getenv("HOME"), "/.openjazz/");
|
|
+ bool ok = open(writepath, name, write);
|
|
+ delete [] writepath;
|
|
+ if(ok) return;
|
|
+ log("Could not open file for writing in $HOME", name);
|
|
+ throw E_FILE;
|
|
+ }
|
|
+#endif
|
|
|
|
Path* path;
|
|
|
|
@@ -60,7 +70,7 @@
|
|
|
|
}
|
|
|
|
- log("Could not open file", name);
|
|
+ log("Could not find file in path", name);
|
|
|
|
throw E_FILE;
|
|
|
|
@@ -74,9 +84,7 @@
|
|
|
|
fclose(file);
|
|
|
|
-#ifdef VERBOSE
|
|
log("Closed file", filePath);
|
|
-#endif
|
|
|
|
delete[] filePath;
|
|
|
|
diff -Naur openjazz-20190106/src/io/sound.cpp openjazz-20190106.patched/src/io/sound.cpp
|
|
--- openjazz-20190106/src/io/sound.cpp 2018-10-08 05:17:30.504617277 -0400
|
|
+++ openjazz-20190106.patched/src/io/sound.cpp 2021-10-26 19:58:53.975443489 -0400
|
|
@@ -27,6 +27,8 @@
|
|
*/
|
|
|
|
|
|
+#include <ctype.h>
|
|
+#include <string.h>
|
|
#include "file.h"
|
|
#include "sound.h"
|
|
|
|
@@ -280,7 +282,15 @@
|
|
|
|
} catch (int e) {
|
|
|
|
- return;
|
|
+ char *upperName = strdup(fileName);
|
|
+ for(char *ch = upperName; *ch; ++ch)
|
|
+ *ch = toupper(*ch);
|
|
+ try {
|
|
+ file = new File(upperName, false);
|
|
+ free(upperName);
|
|
+ } catch(int e) {
|
|
+ return;
|
|
+ }
|
|
|
|
}
|
|
|
|
diff -Naur openjazz-20190106/src/main.cpp openjazz-20190106.patched/src/main.cpp
|
|
--- openjazz-20190106/src/main.cpp 2018-03-29 22:03:53.319965677 -0400
|
|
+++ openjazz-20190106.patched/src/main.cpp 2021-10-26 20:03:30.167425404 -0400
|
|
@@ -31,6 +31,7 @@
|
|
|
|
#define EXTERN
|
|
|
|
+#include <sys/stat.h>
|
|
#include "game/game.h"
|
|
#include "io/controls.h"
|
|
#include "io/file.h"
|
|
@@ -194,7 +195,9 @@
|
|
#ifdef _WIN32
|
|
firstPath = new Path(firstPath, createString(getenv("HOME"), "\\"));
|
|
#else
|
|
- firstPath = new Path(firstPath, createString(getenv("HOME"), "/."));
|
|
+ char *homeSubDir = createString(getenv("HOME"), "/.openjazz/");
|
|
+ mkdir(homeSubDir, 0700); /* ignore errors */
|
|
+ firstPath = new Path(firstPath, homeSubDir);
|
|
#endif
|
|
#endif
|
|
|
|
diff -Naur openjazz-20190106/src/menu/mainmenu.cpp openjazz-20190106.patched/src/menu/mainmenu.cpp
|
|
--- openjazz-20190106/src/menu/mainmenu.cpp 2019-01-06 07:14:31.696191429 -0500
|
|
+++ openjazz-20190106.patched/src/menu/mainmenu.cpp 2021-10-26 20:04:32.023421353 -0400
|
|
@@ -58,7 +58,11 @@
|
|
|
|
} catch (int e) {
|
|
|
|
- throw e;
|
|
+ try {
|
|
+ file = new File("/usr/share/games/openjazz/openjazz.000", false);
|
|
+ } catch(int e) {
|
|
+ throw e;
|
|
+ }
|
|
|
|
}
|
|
|