summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sterrett <mr_bones_@gentoo.org>2003-11-07 08:17:38 +0000
committerMichael Sterrett <mr_bones_@gentoo.org>2003-11-07 08:17:38 +0000
commit15fc8355462502005d367adcffbf9c1f25d711e9 (patch)
tree91cb35e06c1d588447a9b97c58cdef94206680b3 /games-arcade/njam/files
parentversion bump for bug 32790 (diff)
downloadgentoo-2-15fc8355462502005d367adcffbf9c1f25d711e9.tar.gz
gentoo-2-15fc8355462502005d367adcffbf9c1f25d711e9.tar.bz2
gentoo-2-15fc8355462502005d367adcffbf9c1f25d711e9.zip
version bump for bug 32790
Diffstat (limited to 'games-arcade/njam/files')
-rw-r--r--games-arcade/njam/files/digest-njam-1.001
-rw-r--r--games-arcade/njam/files/njam-1.00-conf.patch112
2 files changed, 113 insertions, 0 deletions
diff --git a/games-arcade/njam/files/digest-njam-1.00 b/games-arcade/njam/files/digest-njam-1.00
new file mode 100644
index 000000000000..89bc9b172246
--- /dev/null
+++ b/games-arcade/njam/files/digest-njam-1.00
@@ -0,0 +1 @@
+MD5 88b276a1334477295fc3ba3cc44e05fd njam-1.00-src.tar.gz 1342417
diff --git a/games-arcade/njam/files/njam-1.00-conf.patch b/games-arcade/njam/files/njam-1.00-conf.patch
new file mode 100644
index 000000000000..d0acc9699367
--- /dev/null
+++ b/games-arcade/njam/files/njam-1.00-conf.patch
@@ -0,0 +1,112 @@
+--- njam.cpp.orig 2003-11-06 23:59:22.000000000 -0800
++++ njam.cpp 2003-11-06 23:59:50.000000000 -0800
+@@ -33,6 +33,8 @@
+ // needed for chdir
+ #ifdef __linux__
+ #include <unistd.h>
++#include <sys/stat.h>
++#include <sys/types.h>
+ #endif
+
+ #include <stdio.h>
+@@ -213,16 +215,30 @@
+ if (m_NetworkAvailable)
+ SDLNet_Quit();
+
++ FILE *fp;
+ // write configuration options
+- char filename[] = "njam.conf";
+- FILE *fp = fopen(filename, "w+");
+- if (fp)
++ if (getenv("HOME") && !chdir(getenv("HOME")))
+ {
+- fprintf(fp, "M=%d\n", (m_GameOptions.PlayMusic ? 1 : 0));
+- fprintf(fp, "S=%d\n", (m_GameOptions.PlaySound ? 1 : 0));
+- fprintf(fp, "A=%d\n", (m_GameOptions.UseAllSkins ? 1 : 0));
+- fprintf(fp, "I=%s\n", m_GameOptions.ServerIP);
+- fclose(fp);
++ mkdir(".njam", 0774);
++ if (!chdir(".njam"))
++ {
++ char filename[] = "njam.conf";
++ fp = fopen(filename, "w+");
++
++ if (fp)
++ {
++ fprintf(fp,
++ "M=%d\n"
++ "S=%d\n"
++ "A=%d\n"
++ "I=%s\n",
++ (m_GameOptions.PlayMusic ? 1 : 0),
++ (m_GameOptions.PlaySound ? 1 : 0),
++ (m_GameOptions.UseAllSkins ? 1 : 0),
++ m_GameOptions.ServerIP);
++ fclose(fp);
++ }
++ }
+ }
+
+ // format: NAME#POINTS#LEVEL#
+@@ -597,35 +613,39 @@
+ m_FontBlue = new NjamFont("data/font-blue.bmp", 6, 9);
+ m_FontYellow = new NjamFont("data/font-yellow.bmp", 10, 15);
+
++ FILE *fp;
+ // Load user settings from .conf file
+- char filename[] = "njam.conf";
+- FILE *fp = fopen(filename, "r");
+- if (fp)
++ if (getenv("HOME") && !chdir(getenv("HOME")) && !chdir(".njam"))
+ {
+- LogFile("Reading njam.conf file.\n");
+- char buff[20];
+- while (!feof(fp))
+- {
+- fgets(buff, 20, fp);
+- if (buff[1] == '=')
++ char filename[] = "njam.conf";
++ fp = fopen(filename, "r");
++ if (fp)
++ {
++ LogFile("Reading njam.conf file.\n");
++ char buff[20];
++ while (!feof(fp))
+ {
+- int i;
+- switch (buff[0])
++ fgets(buff, 20, fp);
++ if (buff[1] == '=')
+ {
+- case 'M': m_GameOptions.PlayMusic = (buff[2] == '1'); break;
+- case 'S': m_GameOptions.PlaySound = (buff[2] == '1'); break;
+- case 'A': m_GameOptions.UseAllSkins = (buff[2] == '1'); break;
+- case 'I': // serverIP
+- for (i=2; buff[i] != '\n' && buff[i] && i<17; i++)
+- m_GameOptions.ServerIP[i-2] = buff[i];
+- m_GameOptions.ServerIP[i] = '\0';
+- break;
+- default:
+- printf("Unknown configuration file option: %c\n", buff[0]);
++ int i;
++ switch (buff[0])
++ {
++ case 'M': m_GameOptions.PlayMusic = (buff[2] == '1'); break;
++ case 'S': m_GameOptions.PlaySound = (buff[2] == '1'); break;
++ case 'A': m_GameOptions.UseAllSkins = (buff[2] == '1'); break;
++ case 'I': // serverIP
++ for (i=2; buff[i] != '\n' && buff[i] && i<17; i++)
++ m_GameOptions.ServerIP[i-2] = buff[i];
++ m_GameOptions.ServerIP[i] = '\0';
++ break;
++ default:
++ printf("Unknown configuration file option: %c\n", buff[0]);
++ }
+ }
+ }
++ fclose(fp);
+ }
+- fclose(fp);
+ }
+
+ // create default hiscore