diff options
Diffstat (limited to 'games-arcade/amphetamine/files/amphetamine-0.8.10-etc.patch')
-rw-r--r-- | games-arcade/amphetamine/files/amphetamine-0.8.10-etc.patch | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/games-arcade/amphetamine/files/amphetamine-0.8.10-etc.patch b/games-arcade/amphetamine/files/amphetamine-0.8.10-etc.patch new file mode 100644 index 000000000000..f4ad132dce64 --- /dev/null +++ b/games-arcade/amphetamine/files/amphetamine-0.8.10-etc.patch @@ -0,0 +1,126 @@ +description: use /etc/amphetamine for config files +Index: amphetamine-0.8.10/src/ConstVal.cpp +=================================================================== +--- amphetamine-0.8.10.orig/src/ConstVal.cpp 2006-05-15 19:16:56.000000000 +0200 ++++ amphetamine-0.8.10/src/ConstVal.cpp 2006-05-15 19:17:02.000000000 +0200 +@@ -19,7 +19,7 @@ + { + char levelSetString[11] = "xxLevelSet"; + char levelBkgndString[13] = "xxLevelBkgnd"; +- FILE *paramFile = fopen(gSystem->QualifyDataDir(kParFileName), "r"); // by LL ++ FILE *paramFile = fopen(gSystem->QualifyEtcDir(kParFileName), "r"); // by LL + + gConst = new tConstValues; + +@@ -159,7 +159,7 @@ + fclose(paramFile); + + // Hier sollte auch im Home Directory gesucht werden... +- paramFile = gSystem->FindFile(gConst->kFileConfig); // by LL ++ paramFile = fopen(gSystem->QualifyEtcDir(gConst->kFileConfig), "r"); // by LL + + gConfigData->leftKey = GetLongConstant(paramFile, "LeftKey"); + GetStringConstant(paramFile, "LeftKeyText", gConfigData->leftKeyText); +@@ -212,6 +212,7 @@ + char c = 0; + short n; + ++ key[0] = '\0'; + fseek(f, 0, SEEK_SET); + + while (strcmp(key, constName)) { +Index: amphetamine-0.8.10/src/Gui.cpp +=================================================================== +--- amphetamine-0.8.10.orig/src/Gui.cpp 2006-05-15 19:16:56.000000000 +0200 ++++ amphetamine-0.8.10/src/Gui.cpp 2006-05-15 19:17:02.000000000 +0200 +@@ -688,7 +688,7 @@ + + void CGUI::LoadMessages() + { +- FILE *f = fopen(gSystem->QualifyDataDir(kParFileName), "r"); // by LL ++ FILE *f = fopen(gSystem->QualifyEtcDir(kParFileName), "r"); // by LL + char msgString[6] = "msgxx"; + short n; + +@@ -724,7 +724,7 @@ + + void LoadGUIParameters() + { +- FILE *f = fopen(gSystem->QualifyDataDir(kParFileName), "r"); // by LL ++ FILE *f = fopen(gSystem->QualifyEtcDir(kParFileName), "r"); // by LL + + gGUIConst = new tGUIConstants; + +Index: amphetamine-0.8.10/src/System.cpp +=================================================================== +--- amphetamine-0.8.10.orig/src/System.cpp 2006-05-15 19:16:56.000000000 +0200 ++++ amphetamine-0.8.10/src/System.cpp 2006-05-15 19:17:02.000000000 +0200 +@@ -143,6 +143,14 @@ + return tmp;
+ }
+
++char *CSystem::QualifyEtcDir(const char *fname)
++{
++ char *tmp = new char[strlen(etcDir)+strlen(fname)+2];
++ sprintf(tmp, "%s/%s", etcDir, fname);
++
++ return tmp;
++}
++
+ void CSystem::GetHomeDir()
+ {
+ char *tmp;
+@@ -169,7 +177,9 @@ + GetHomeDir();
+ dataDir = new char[strlen(INSTALL_DIR)+1];
+ strcpy(dataDir, INSTALL_DIR);
+-
++ etcDir = new char[strlen(ETC_DIR)+1];
++ strcpy(etcDir, ETC_DIR);
++
+ char *logFileName = QualifyHomeDir(kLogFileName);
+
+ logFile = fopen(logFileName, "w"); // by LL
+@@ -180,6 +190,8 @@ + if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO) < 0 ) {
+ MSG("SDL_Init_Failed.");
+ MSG(SDL_GetError());
++ /* Ouput to stdout too. */
++ printf("SDL_Init_Failed: %s\n", SDL_GetError());
+
+ exit(1);
+ }
+Index: amphetamine-0.8.10/src/System.hpp +=================================================================== +--- amphetamine-0.8.10.orig/src/System.hpp 2006-05-15 19:16:57.000000000 +0200 ++++ amphetamine-0.8.10/src/System.hpp 2006-05-15 19:17:02.000000000 +0200 +@@ -16,6 +16,10 @@ + #define INSTALL_DIR "/usr/local/games/amph" + #endif + ++#ifndef ETC_DIR ++#define ETC_DIR "/etc/amphetamine" ++#endif ++ + #if SDL_BYTEORDER == SDL_LIL_ENDIAN + #undef __BIG_ENDIAN__ + #else +@@ -76,6 +80,7 @@ + RGBcolor *palColors; + char *homeDir; + char *dataDir; ++ char *etcDir; + int workingSound; + + //"""""""""""""""" System Stuff +@@ -107,8 +112,10 @@ + void GetHomeDir(); + char *QualifyDataDir(const char *fname); + char *QualifyHomeDir(const char *fname); ++ char *QualifyEtcDir(const char *fname); + void ScreenShot(); + FILE *FindFile(const char *fname); + }; + + #endif ++ |