[SCM] Packaging for Liero branch, debian, updated. 7d7084ac811a94d3788af9f229bc6437632f0951

Martin Erik Werner martinerikwerner at gmail.com
Tue Nov 22 00:52:15 UTC 2011


The following commit has been merged in the debian branch:
commit b1c232e21fcce021eef9dbb5d4c7fff626331e79
Author: Martin Erik Werner <martinerikwerner at gmail.com>
Date:   Tue Nov 22 01:16:44 2011 +0100

    patch for custom settings handling
    
     * debian/patches/01_custom-settings-load-write-handling.diff:
       Patch to fix http://code.google.com/p/liero/issues/detail?id=4
     * Refreshed datapath_integration patch, no modifications to main

diff --git a/debian/patches/custom-settings-load-write-handling.diff b/debian/patches/custom-settings-load-write-handling.diff
new file mode 100644
index 0000000..e4d09aa
--- /dev/null
+++ b/debian/patches/custom-settings-load-write-handling.diff
@@ -0,0 +1,71 @@
+From 49a9dacbafcf67d7582761dad8d9661401321c74 Mon Sep 17 00:00:00 2001
+From: Martin Erik Werner <martinerikwerner at gmail.com>
+Date: Mon, 21 Nov 2011 23:50:40 +0100
+Subject: [PATCH] main.cpp: fix custom settings load/write handling
+
+* Make Liero write settings to the currently active settings file
+  on exit, rather that always writing to LIERO.DAT
+  (Closes: http://code.google.com/p/liero/issues/detail?id=3)
+* Re-enable using LIERO.OPT to get the name of the settings file
+  that should be loaded on start
+---
+ main.cpp |   17 +++++++----------
+ 1 files changed, 7 insertions(+), 10 deletions(-)
+
+diff --git a/main.cpp b/main.cpp
+index fc933e8..d6a3a16 100644
+--- a/main.cpp
++++ b/main.cpp
+@@ -148,25 +148,23 @@ try
+ 	
+ 	gfx.settingsFile = "LIERO";
+ 	
+-#if 0 // This is just stupid, no need to emulate it
+-	if(!fileExists(lieroOPT)) // NOTE: Liero doesn't seem to use the contents of LIERO.OPT for anything useful
++	if(!fileExists(lieroOPT)) // NOTE: Liero uses LIERO.OPT to store the name of the currently active settings file
+ 	{
+ 		gfx.settings.reset(new Settings);
+ 		gfx.saveSettings();
+ 	}
+ 	else
+-#endif
+ 	{
+-	/*
++	
+ 		FILE* f = fopen(lieroOPT.c_str(), "rb");
+ 		std::size_t len = fileLength(f);
+ 		if(len > 255) len = 255;
+ 		char buf[256];
+ 		fread(buf, 1, len, f);
+-		game.settingsFile.assign(buf, len);
++		gfx.settingsFile.assign(buf, len);
++		
++		rtrim(gfx.settingsFile);
+ 		
+-		rtrim(game.settingsFile);
+-		*/
+ 		if(!gfx.loadSettings())
+ 		{
+ 			gfx.settingsFile = "LIERO";
+@@ -174,7 +172,7 @@ try
+ 			gfx.saveSettings();
+ 		}
+ 
+-		//fclose(f);
++		fclose(f);
+ 	}
+ 	
+ 	gfx.setVideoMode();
+@@ -183,8 +181,7 @@ try
+ 	//game.initGame();
+ 	gfx.mainLoop();
+ 	
+-	gfx.settingsFile = "LIERO";
+-	gfx.settings->save(joinPath(lieroEXERoot, "LIERO.DAT"));
++	gfx.saveSettings();
+ 	
+ 	FILE* f = fopen(lieroOPT.c_str(), "wb");
+ 	fwrite(gfx.settingsFile.data(), 1, gfx.settingsFile.size(), f);
+-- 
+1.7.6.rc1.1.g2c162b
+
diff --git a/debian/patches/datapath_integration.diff b/debian/patches/datapath_integration.diff
index c70834a..d96433f 100644
--- a/debian/patches/datapath_integration.diff
+++ b/debian/patches/datapath_integration.diff
@@ -90,17 +90,6 @@ Last-Update: 2011-11-15
  			generateRandom(common, settings, rand);
  
  	}
---- a/main.cpp
-+++ b/main.cpp
-@@ -184,7 +184,7 @@
- 	gfx.mainLoop();
- 	
- 	gfx.settingsFile = "LIERO";
--	gfx.settings->save(joinPath(lieroEXERoot, "LIERO.DAT"));
-+	gfx.settings->save(data_path->file("LIERO.DAT"));
- 	
- 	FILE* f = fopen(lieroOPT.c_str(), "wb");
- 	fwrite(gfx.settingsFile.data(), 1, gfx.settingsFile.size(), f);
 --- a/reader.cpp
 +++ b/reader.cpp
 @@ -5,7 +5,9 @@
diff --git a/debian/patches/series b/debian/patches/series
index fadd717..e76b457 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
+custom-settings-load-write-handling.diff
 no-press-any-key.diff
 datapath.diff
 datapath_integration.diff

-- 
Packaging for Liero



More information about the Pkg-games-commits mailing list