updated on Thu Jan 12 08:01:00 UTC 2012
[aur-mirror.git] / syzygymantra / mantra.patch
blob3416d68895e9d4a467d2d5ec1f28c823496869fc
1 diff -rupN src//LoadData.c ../../../../Projects/syzygymantra/src//LoadData.c
2 --- src//LoadData.c 2010-07-01 21:06:36.745866154 -0700
3 +++ ../../../../Projects/syzygymantra/src//LoadData.c 2010-07-01 18:44:27.850885113 -0700
4 @@ -928,7 +928,7 @@ void createTempFiles(void)
5 DATAFILE *datafile;
7 packfile_password("musicman3320");
8 - datafile = load_datafile_callback("GameData.dat", writeDatafile);
9 + datafile = load_datafile_callback("/usr/share/syzygymantra/GameData.dat", writeDatafile);
11 unload_datafile(datafile);
13 @@ -938,7 +938,7 @@ void deleteTempFiles(void)
14 DATAFILE *datafile;
16 packfile_password("musicman3320");
17 - datafile = load_datafile_callback("GameData.dat", deleteDatafile);
18 + datafile = load_datafile_callback("/usr/share/syzygymantra/GameData.dat", deleteDatafile);
20 unload_datafile(datafile);
22 @@ -978,7 +978,7 @@ int readItemData(void)
25 packfile_password("musicman3320");
26 - file = pack_fopen("GameData.dat#ItemData", "r");
27 + file = pack_fopen("/usr/share/syzygymantra/GameData.dat#ItemData", "r");
29 if (!file)
31 @@ -1118,7 +1118,7 @@ int readMapData(void)
32 int i, j;
34 packfile_password("musicman3320");
35 - file = pack_fopen("GameData.dat#MapArea", "r");
36 + file = pack_fopen("/usr/share/syzygymantra/GameData.dat#MapArea", "r");
38 if (!file)
40 @@ -1148,7 +1148,7 @@ int readMapData(void)
41 printf("Finished loading map area from file!\n");
43 packfile_password("musicman3320");
44 - file = pack_fopen("GameData.dat#MapData", "r");
45 + file = pack_fopen("/usr/share/syzygymantra/GameData.dat#MapData", "r");
47 if (!file)
49 @@ -1200,7 +1200,7 @@ int readTmplEnemyData(void)
50 int i;
52 packfile_password("musicman3320");
53 - file = pack_fopen("GameData.dat#TmplData", "r");
54 + file = pack_fopen("/usr/share/syzygymantra/GameData.dat#TmplData", "r");
56 if (!file)
58 @@ -1279,7 +1279,7 @@ int readMessageData(void)
59 int i, j, tempchar;
61 packfile_password("musicman3320");
62 - file = pack_fopen("GameData.dat#TextData", "rb");
63 + file = pack_fopen("/usr/share/syzygymantra/GameData.dat#TextData", "rb");
65 if (!file)
67 @@ -1315,7 +1315,7 @@ int readPalette(void)
68 int i;
70 packfile_password("musicman3320");
71 - paletteFile = pack_fopen("GameData.dat#SystemPalette", "r");
72 + paletteFile = pack_fopen("/usr/share/syzygymantra/GameData.dat#SystemPalette", "r");
74 if (!paletteFile)
76 @@ -1370,7 +1370,7 @@ int readGraphicsData(void)
78 // Read map graphics file
79 packfile_password("musicman3320");
80 - spriteData = pack_fopen("GameData.dat#MapGraphics", "r");
81 + spriteData = pack_fopen("/usr/share/syzygymantra/GameData.dat#MapGraphics", "r");
83 if (!spriteData)
85 @@ -1479,7 +1479,7 @@ int readGraphicsData(void)
87 // Read sprite file
88 packfile_password("musicman3320");
89 - spriteData = pack_fopen("GameData.dat#GameSprites", "r");
90 + spriteData = pack_fopen("/usr/share/syzygymantra/GameData.dat#GameSprites", "r");
92 if (!spriteData)
94 @@ -1649,7 +1649,7 @@ int readGraphicsData(void)
95 bossIcons = (unsigned char *)malloc(4096 * NUM_BOSS_ICONS * sizeof(unsigned char));
97 packfile_password("musicman3320");
98 - bossFile = pack_fopen("GameData.dat#BossData", "r");
99 + bossFile = pack_fopen("/usr/share/syzygymantra/GameData.dat#BossData", "r");
101 if (!bossFile)
103 @@ -1679,7 +1679,7 @@ int readGraphicsData(void)
105 // Read map graphics file
106 packfile_password("musicman3320");
107 - spriteData = pack_fopen("GameData.dat#IconData", "r");
108 + spriteData = pack_fopen("/usr/share/syzygymantra/GameData.dat#IconData", "r");
110 if (!spriteData)
112 @@ -2011,7 +2011,7 @@ int readFontData(void)
115 packfile_password("musicman3320");
116 - file = pack_fopen("GameData.dat#FontData", "r");
117 + file = pack_fopen("/usr/share/syzygymantra/GameData.dat#FontData", "r");
119 if (!file)
121 @@ -2071,7 +2071,7 @@ int readStoreData(void)
122 memset(g_Stores, 0, sizeof(g_Stores));
124 packfile_password("musicman3320");
125 - file = pack_fopen("GameData.dat#StoreData", "rb");
126 + file = pack_fopen("/usr/share/syzygymantra/GameData.dat#StoreData", "rb");
128 if (!file)
130 @@ -2156,7 +2156,7 @@ int readAnimData(void)
131 memset(g_SwordAnimData, 0, sizeof(g_SwordAnimData));
133 packfile_password("musicman3320");
134 - infile = pack_fopen("GameData.dat#AnimData", "rb");
135 + infile = pack_fopen("/usr/share/syzygymantra/GameData.dat#AnimData", "rb");
137 if (!infile)
139 @@ -2295,12 +2295,17 @@ int readSavedGameData(void)
140 int i;
142 packfile_password(NULL);
143 - file = pack_fopen("Saved.dat", "r");
144 + char homedir[100];
145 + strcpy(homedir,getenv("HOME"));
146 + strcat(homedir,"/.syzygymantra/Saved.dat");
147 + if (system("stat $HOME/.syzygymantra/Saved.dat &> /dev/null")) {
148 + system("mkdir -p $HOME/.syzygymantra");
149 + system("cp /usr/share/syzygymantra/Saved.dat $HOME/.syzygymantra/Saved.dat");
151 + file = pack_fopen(homedir, "r");
153 if (!file)
155 return 0;
158 for(i = 0;i < MAX_SAVED_GAMES;i++)
160 @@ -2325,7 +2330,10 @@ int writeSavedGameData(void)
161 int i;
163 packfile_password(NULL);
164 - file = pack_fopen("Saved.dat", "w");
165 + char homedir[100];
166 + strcpy(homedir,getenv("HOME"));
167 + strcat(homedir,"/.syzygymantra/Saved.dat");
168 + file = pack_fopen(homedir, "w");
170 if (!file)
172 @@ -2405,7 +2413,7 @@ int readImagesData(void)
173 g_HelpBitmap = NULL;
175 packfile_password("musicman3320");
176 - dfile = load_datafile("Images.dat");
177 + dfile = load_datafile("/usr/share/syzygymantra/Images.dat");
179 if (!dfile)
181 @@ -2606,7 +2614,7 @@ void freeFontData(void)
182 destroy_font(g_Font);
183 g_Font = 0;
185 - */
187 if (g_Font)
189 alfont_destroy_font(g_Font);
190 @@ -2624,7 +2632,7 @@ void freeFontData(void)
191 alfont_destroy_font(g_LargeFont);
192 g_LargeFont = NULL;
195 + */
196 alfont_exit();
199 diff -rupN src//Sound.c ../../../../Projects/syzygymantra/src//Sound.c
200 --- src//Sound.c 2010-07-01 21:06:36.752529607 -0700
201 +++ ../../../../Projects/syzygymantra/src//Sound.c 2010-07-01 16:59:40.066588466 -0700
202 @@ -60,7 +60,7 @@ int initSoundData()
203 memset(g_SongFiles, 0, sizeof(g_SongFiles));
205 packfile_password("musicman3320");
206 - datafile = load_datafile("Music.dat");
207 + datafile = load_datafile("/usr/share/syzygymantra/Music.dat");
209 if (!datafile)
211 @@ -86,7 +86,7 @@ int initSoundData()
212 unload_datafile(datafile);
214 packfile_password("musicman3320");
215 - g_SoundEffectsDatafile = load_datafile("Sound.dat");
216 + g_SoundEffectsDatafile = load_datafile("/usr/share/syzygymantra/Sound.dat");
218 if (!g_SoundEffectsDatafile)
221 diff -rupN src//Utils.c ../../../../Projects/syzygymantra/src//Utils.c
222 --- src//Utils.c 2010-07-01 21:06:36.745866154 -0700
223 +++ ../../../../Projects/syzygymantra/src//Utils.c 2010-05-16 21:27:32.937197137 -0700
224 @@ -76,7 +76,7 @@ int createWindow()
226 // for now, we play in a window
227 // will mess with full screen later...
228 - if (set_gfx_mode(GFX_AUTODETECT, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0))
229 + if (set_gfx_mode(GFX_AUTODETECT_WINDOWED, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0))
231 printf("Error setting 512x320x8 gfx mode:\n%s\n", allegro_error);
232 return 0;