[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:44 UTC 2010


The following commit has been merged in the master branch:
commit 2547579f925a556d467f635082a1b1e36638f88a
Author: Peter Pentchev <roam at ringlet.net>
Date:   Fri Sep 17 13:45:45 2010 +0300

    Look in /usr/share/asciiportal for the sounds, too.

diff --git a/debian/changelog b/debian/changelog
index a0aa467..ead5db8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,6 @@ asciiportal (1.2c-1) UNRELEASED; urgency=low
 
   WAITSFOR: libxcurses (ITP #548070)
 
-  TODO: teach the binary to look for sounds in /usr/share/asciiportal
   TODO: write a manpage
   TODO: remove the unneeded dh_make template files
   TODO: policy 3.9.1
diff --git a/debian/patches/03-data-in-usr-share.patch b/debian/patches/03-data-in-usr-share.patch
index ad84570..24246b6 100644
--- a/debian/patches/03-data-in-usr-share.patch
+++ b/debian/patches/03-data-in-usr-share.patch
@@ -1,8 +1,7 @@
 Description: Look for the maps and sounds in /usr/share/asciiportal
- TODO: do the sounds, too
 Forwarded: no
 Author: Peter Pentchev <roam at ringlet.net>
-Last-Update: 2010-09-12
+Last-Update: 2010-09-15
 
 --- a/main.cpp
 +++ b/main.cpp
@@ -10,7 +9,7 @@ Last-Update: 2010-09-12
  vector<unsigned int> rawmaps_maxwidth;
  extern int maxlevel;
  
-+string mapbase = "/usr/share/asciiportal/";
++string data_prefix = "/usr/share/asciiportal/";
 +
  int loadmaps (string mappack) {    // Looks for the mappack directory and loads
            // the files mappack001.txt, mappack002.txt etc and stores it in maps.
@@ -22,10 +21,10 @@ Last-Update: 2010-09-12
 +  name = mappack + "/001.txt";
 +  ifstream testfile(name.c_str());
 +  if (!testfile.is_open()) {
-+	  name = mapbase + name;
++	  name = data_prefix + name;
 +	  testfile.open(name.c_str());
 +	  if (testfile.is_open()) {
-+		  mappack = mapbase + mappack;
++		  mappack = data_prefix + mappack;
 +		  testfile.close();
 +	  }
 +  } else {
@@ -35,3 +34,51 @@ Last-Update: 2010-09-12
    maxlevel = 0;
    // load maxlevel
    string maxlevelfilename;
+--- a/ap_sound.cpp
++++ b/ap_sound.cpp
+@@ -83,12 +83,12 @@
+   if( Mix_OpenAudio( 22050, MIX_DEFAULT_FORMAT, 2, 1024 ) == -1 ) return false; //Initialize SDL_mixer
+ 
+   for (int c = 0; c < MAXSound; c++) {
+-    name = "media/" + sound_files[c];
++    name = data_prefix + "media/" + sound_files[c];
+     soundEffects[c] = Mix_LoadWAV(name.c_str());
+     name.clear();
+   }
+ 
+-  name = "media/" + music_files[0];
++  name = data_prefix + "media/" + music_files[0];
+   ambience = Mix_LoadMUS(name.c_str ());
+   name.clear();
+   if (ambience == NULL) return 0;
+@@ -102,7 +102,7 @@
+   if (current_music == music_files[selection]) return 2;
+   if( Mix_PlayingMusic() == 0 ) Mix_HaltMusic();
+   Mix_FreeMusic(ambience);
+-    name = "media/" + music_files[selection];
++    name = data_prefix + "media/" + music_files[selection];
+   ambience = Mix_LoadMUS(name.c_str ());
+   if (ambience == NULL) return 0;
+   current_music = music_files[selection];
+@@ -117,6 +117,10 @@
+   Mix_FreeMusic(ambience);
+     name = mappack + "/" + filename;
+   ambience = Mix_LoadMUS(name.c_str ());
++  if (ambience == NULL && !data_prefix.empty()) {
++    name = data_prefix + name;
++    ambience = Mix_LoadMUS(name.c_str ());
++  }
+   if (ambience == NULL) {
+     default_ambience(0);
+     return 0;
+--- a/asciiportal.h
++++ b/asciiportal.h
+@@ -69,6 +69,8 @@
+   };
+ };
+ 
++extern std::string data_prefix;
++
+ int loadmaps (std::string);
+ 
+ #endif // ASCIIPORTAL_H_INCLUDED

-- 
asciiportal - a puzzle jump'n'run adventure game



More information about the Pkg-games-commits mailing list