[SCM] asciiportal - a puzzle jump'n'run adventure game branch, master, updated. upstream/1.2c-16-g3aa90d7
Peter Pentchev
roam at ringlet.net
Sun Oct 24 13:30:43 UTC 2010
The following commit has been merged in the master branch:
commit dcf195c2d5044d48d6c6e3cc3d67891ee949e052
Author: Peter Pentchev <roam at ringlet.net>
Date: Tue Sep 14 17:48:22 2010 +0300
Since a slash also works under Windows, remove the #ifdef's.
diff --git a/debian/patches/02-always-slash.patch b/debian/patches/02-always-slash.patch
new file mode 100644
index 0000000..cfca6fe
--- /dev/null
+++ b/debian/patches/02-always-slash.patch
@@ -0,0 +1,119 @@
+Description: A slash is a valid pathname separator under Windows, too.
+Forwarded: no
+Author: Peter Pentchev <roam at ringlet.net>
+Last-Update: 2010-09-14
+
+--- a/ap_play.cpp
++++ b/ap_play.cpp
+@@ -1062,11 +1062,7 @@
+ maxlevel = level;
+ // save maxlevel
+ string maxlevelfilename;
+-#ifdef WIN32
+- maxlevelfilename = mappack + "\\save.dat";
+-#else
+ maxlevelfilename = mappack + "/save.dat";
+-#endif
+ ofstream maxlevelfile;
+ maxlevelfile.open (maxlevelfilename.c_str());
+ maxlevelfile << maxlevel;
+--- a/ap_sound.cpp
++++ b/ap_sound.cpp
+@@ -83,20 +83,12 @@
+ if( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 1024 ) == -1 ) return false; //Initialize SDL_mixer
+
+ for (int c = 0; c < MAXSound; c++) {
+-#ifdef WIN32
+- name = "media\\" + sound_files[c];
+-#else
+ name = "media/" + sound_files[c];
+-#endif
+ soundEffects[c] = Mix_LoadWAV(name.c_str());
+ name.clear();
+ }
+
+-#ifdef WIN32
+- name = "media\\" + music_files[0];
+-#else
+ name = "media/" + music_files[0];
+-#endif
+ ambience = Mix_LoadMUS(name.c_str ());
+ name.clear();
+ if (ambience == NULL) return 0;
+@@ -110,11 +102,7 @@
+ if (current_music == music_files[selection]) return 2;
+ if( Mix_PlayingMusic() == 0 ) Mix_HaltMusic();
+ Mix_FreeMusic(ambience);
+-#ifdef WIN32
+- name = "media\\" + music_files[selection];
+-#else
+ name = "media/" + music_files[selection];
+-#endif
+ ambience = Mix_LoadMUS(name.c_str ());
+ if (ambience == NULL) return 0;
+ current_music = music_files[selection];
+@@ -127,11 +115,7 @@
+ if (filename == current_music) return 2;
+ if( Mix_PlayingMusic() == 0 ) Mix_HaltMusic();
+ Mix_FreeMusic(ambience);
+-#ifdef WIN32
+- name = mappack + "\\" + filename;
+-#else
+ name = mappack + "/" + filename;
+-#endif
+ ambience = Mix_LoadMUS(name.c_str ());
+ if (ambience == NULL) {
+ default_ambience(0);
+--- a/main.cpp
++++ b/main.cpp
+@@ -60,11 +60,7 @@
+ maxlevel = 0;
+ // load maxlevel
+ string maxlevelfilename;
+-#ifdef WIN32
+- maxlevelfilename = mappack + "\\save.dat"; // have to add conditional for linux
+-#else
+- maxlevelfilename = mappack + "/save.dat"; // have to add conditional for linux
+-#endif
++ maxlevelfilename = mappack + "/save.dat";
+ ifstream maxlevelfile;
+ maxlevelfile.open (maxlevelfilename.c_str());
+ if (maxlevelfile.is_open()) {
+@@ -77,11 +73,7 @@
+ unsigned int maxwidth = 0;
+ stringstream num;
+ num << setw(3) << setfill( '0' ) << level;
+-#ifdef WIN32
+- name = mappack + "\\" + num.str() + ".txt";
+-#else
+ name = mappack + "/" + num.str() + ".txt";
+-#endif
+ ifstream mapfile(name.c_str());
+ if (mapfile.is_open()) {
+ vector<string> map;
+--- a/menu.cpp
++++ b/menu.cpp
+@@ -226,11 +226,7 @@
+ #ifndef __NOSOUND__
+ load_ambience ("media", "menumusic.ogg");
+ #endif
+-#ifdef WIN32
+- name = mappack + "\\inscreen.txt";
+-#else
+ name = mappack + "/inscreen.txt";
+-#endif
+ ifstream mapfile(name.c_str());
+ if (mapfile.is_open()) {
+ vector<string> map;
+@@ -398,11 +394,7 @@
+ vector <string> credits;
+ string line, name;
+
+-#ifdef WIN32
+- name = mappack + "\\credits.txt";
+-#else
+ name = mappack + "/credits.txt";
+-#endif
+ ifstream mapfile(name.c_str());
+ if (mapfile.is_open()) {
+ vector<string> map;
diff --git a/debian/patches/series b/debian/patches/series
index 8bb7f44..d1893c3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
01-Makefile.patch
+02-always-slash.patch
03-data-in-usr-share.patch
--
asciiportal - a puzzle jump'n'run adventure game
More information about the Pkg-games-commits
mailing list