[SCM] Packaging for Liero branch, master, updated. 88c0f12a1f7c717f2b7de2396a188bf9c47c4f4a

Martin Erik Werner martinerikwerner at gmail.com
Fri Dec 16 21:50:12 UTC 2011


The following commit has been merged in the master branch:
commit f60babb39edf25e301b5725559642d45a7aaeec0
Author: Martin Erik Werner <martinerikwerner at gmail.com>
Date:   Fri Dec 16 21:26:39 2011 +0100

    Refresh patches

diff --git a/debian/patches/custom-settings-load-write-handling.patch b/debian/patches/custom-settings-load-write-handling.patch
index b08020a..be2cc7f 100644
--- a/debian/patches/custom-settings-load-write-handling.patch
+++ b/debian/patches/custom-settings-load-write-handling.patch
@@ -11,60 +11,53 @@ Forwarded: http://code.google.com/p/liero/issues/detail?id=4
  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);
- 	}
- 	
+@@ -148,25 +148,21 @@
+ 	
+ 	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(game.settingsFile);
+-		*/
++		rtrim(gfx.settingsFile);
+ 		if(!gfx.loadSettings())
+ 		{
+ 			gfx.settingsFile = "LIERO";
+@@ -174,7 +170,7 @@
+ 			gfx.saveSettings();
+ 		}
+ 
+-		//fclose(f);
++		fclose(f);
+ 	}
+ 	
  	gfx.setVideoMode();
-@@ -183,8 +181,7 @@ try
- 	//game.initGame();
- 	gfx.mainLoop();
- 	
--	gfx.settingsFile = "LIERO";
+@@ -183,8 +179,7 @@
+ 	//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
-
+ 	
+ 	FILE* f = fopen(lieroOPT.c_str(), "wb");
+ 	fwrite(gfx.settingsFile.data(), 1, gfx.settingsFile.size(), f);
diff --git a/debian/patches/datapath_integration.patch b/debian/patches/datapath_integration.patch
index 0250f2d..50aee12 100644
--- a/debian/patches/datapath_integration.patch
+++ b/debian/patches/datapath_integration.patch
@@ -8,167 +8,167 @@ Last-Update: 2011-11-15
 --- a/controller/localController.cpp
 +++ b/controller/localController.cpp
 @@ -220,7 +220,7 @@
- 					
- 					
- 				}
--				std::string path = joinPath(lieroEXERoot, prefix + buf);
-+				std::string path = joinPath(data_path->configdir(), prefix + buf);
- 				replay.reset(new ReplayWriter(gvl::stream_ptr(new gvl::fstream(path.c_str(), "wb"))));
- 				replay->beginRecord(game);
- 			}
+ 					
+ 					
+ 				}
+-				std::string path = joinPath(lieroEXERoot, prefix + buf);
++				std::string path = joinPath(data_path->configdir(), prefix + buf);
+ 				replay.reset(new ReplayWriter(gvl::stream_ptr(new gvl::fstream(path.c_str(), "wb"))));
+ 				replay->beginRecord(game);
+ 			}
 --- a/gfx.cpp
 +++ b/gfx.cpp
 @@ -953,7 +953,7 @@
- 	
- 	void onUpdate(Menu& menu, int item)
- 	{
--		std::string levelPath = joinPath(lieroEXERoot, gfx.settings->levelFile + ".lev");
-+		std::string levelPath = joinPath(data_path->configdir(), gfx.settings->levelFile + ".lev");
- 		if(!gfx.settings->randomLevel && fileExists(levelPath))
- 		{
- 			menu.items[Settings::SiLevel].value = '"' + gfx.settings->levelFile + '"';
+ 	
+ 	void onUpdate(Menu& menu, int item)
+ 	{
+-		std::string levelPath = joinPath(lieroEXERoot, gfx.settings->levelFile + ".lev");
++		std::string levelPath = joinPath(data_path->configdir(), gfx.settings->levelFile + ".lev");
+ 		if(!gfx.settings->randomLevel && fileExists(levelPath))
+ 		{
+ 			menu.items[Settings::SiLevel].value = '"' + gfx.settings->levelFile + '"';
 @@ -1109,7 +1109,7 @@
- 	
- 	bool altName = settings->extensions ? false : true;
- 	
--	DirectoryIterator di(joinPath(lieroEXERoot, ".")); // TODO: Fix lieroEXERoot to be "." instead of ""
-+	DirectoryIterator di(joinPath(data_path->configdir(), ".")); // TODO: Fix lieroEXERoot to be "." instead of ""
- 	
- 	std::vector<std::pair<std::string, std::string> > levels;
- 	
+ 	
+ 	bool altName = settings->extensions ? false : true;
+ 	
+-	DirectoryIterator di(joinPath(lieroEXERoot, ".")); // TODO: Fix lieroEXERoot to be "." instead of ""
++	DirectoryIterator di(joinPath(data_path->configdir(), ".")); // TODO: Fix lieroEXERoot to be "." instead of ""
+ 	
+ 	std::vector<std::pair<std::string, std::string> > levels;
+ 	
 @@ -1226,7 +1226,7 @@
- 	
- 	profileMenu.setHeight(14);
- 		
+ 	
+ 	profileMenu.setHeight(14);
+ 		
 -	DirectoryIterator di(joinPath(lieroEXERoot, ".")); // TODO: Fix lieroEXERoot to be "." instead of ""
 +	DirectoryIterator di(joinPath(data_path->configdir(), ".")); // TODO: Fix lieroEXERoot to be "." instead of ""
  	
- 	std::vector<std::string> profiles;
- 	
+ 	std::vector<std::string> profiles;
+ 	
 @@ -1315,7 +1315,7 @@
- 	
- 	replayMenu.setHeight(14);
- 		
+ 	
+ 	replayMenu.setHeight(14);
+ 		
 -	DirectoryIterator di(joinPath(lieroEXERoot, ".")); // TODO: Fix lieroEXERoot to be "." instead of ""
 +	DirectoryIterator di(joinPath(data_path->configdir(), ".")); // TODO: Fix lieroEXERoot to be "." instead of ""
  	
- 	std::vector<std::string> replays;
- 	
+ 	std::vector<std::string> replays;
+ 	
 @@ -1367,7 +1367,7 @@
- 			if(replayMenu.isSelectionValid())
- 			{
- 				std::string replayName = replayMenu.items[replayMenu.selection()].string + ".lrp";			
--				std::string fullPath = joinPath(lieroEXERoot, replayName);
-+				std::string fullPath = joinPath(data_path->configdir(), replayName);
- 				
- 				// Reset controller before opening the replay, since we may be recording it
- 				controller.reset();
+ 			if(replayMenu.isSelectionValid())
+ 			{
+ 				std::string replayName = replayMenu.items[replayMenu.selection()].string + ".lrp";			
+-				std::string fullPath = joinPath(lieroEXERoot, replayName);
++				std::string fullPath = joinPath(data_path->configdir(), replayName);
+ 				
+ 				// Reset controller before opening the replay, since we may be recording it
+ 				controller.reset();
 @@ -1798,13 +1798,13 @@
- 
- void Gfx::saveSettings()
- {
--	settings->save(joinPath(lieroEXERoot, settingsFile + ".DAT"));
-+	settings->save(data_path->file(settingsFile + ".DAT"));
- }
- 
- bool Gfx::loadSettings()
- {
- 	settings.reset(new Settings);
--	return settings->load(joinPath(lieroEXERoot, settingsFile + ".DAT"));
-+	return settings->load(data_path->file(settingsFile + ".DAT"));
- }
- 
- void Gfx::drawBasicMenu(/*int curSel*/)
+ 
+ void Gfx::saveSettings()
+ {
+-	settings->save(joinPath(lieroEXERoot, settingsFile + ".DAT"));
++	settings->save(data_path->file(settingsFile + ".DAT"));
+ }
+ 
+ bool Gfx::loadSettings()
+ {
+ 	settings.reset(new Settings);
+-	return settings->load(joinPath(lieroEXERoot, settingsFile + ".DAT"));
++	return settings->load(data_path->file(settingsFile + ".DAT"));
+ }
+ 
+ void Gfx::drawBasicMenu(/*int curSel*/)
 --- a/level.cpp
 +++ b/level.cpp
 @@ -269,7 +269,7 @@
- 	else
- 	{
- 		// TODO: Check .LEV as well as .lev
--		if(!load(common, settings, joinPath(lieroEXERoot, settings.levelFile + ".lev")))
-+		if(!load(common, settings, joinPath(data_path->configdir(), settings.levelFile + ".lev")))
- 			generateRandom(common, settings, rand);
- 
- 	}
+ 	else
+ 	{
+ 		// TODO: Check .LEV as well as .lev
+-		if(!load(common, settings, joinPath(lieroEXERoot, settings.levelFile + ".lev")))
++		if(!load(common, settings, joinPath(data_path->configdir(), settings.levelFile + ".lev")))
+ 			generateRandom(common, settings, rand);
+ 
+ 	}
 --- a/reader.cpp
 +++ b/reader.cpp
 @@ -5,7 +5,9 @@
- #include <stdexcept>
- 
- std::string lieroOPT;
--std::string lieroEXERoot;
-+
-+DataPath* data_path = NULL;
-+// DATAPATH std::string lieroEXERoot;
- 
- namespace
- {
+ #include <stdexcept>
+ 
+ std::string lieroOPT;
+-std::string lieroEXERoot;
++
++DataPath* data_path = NULL;
++// DATAPATH std::string lieroEXERoot;
+ 
+ namespace
+ {
 @@ -94,11 +96,13 @@
- void setLieroEXE(std::string const& path)
- {
- 	//TODO: Close cached files
--	
--	lieroEXE = path;
--	lieroCHR = changeLeaf(path, "LIERO.CHR");
--	lieroSND = changeLeaf(path, "LIERO.SND");
--	lieroOPT = changeLeaf(path, "LIERO.OPT");
--	
--	lieroEXERoot = getRoot(lieroEXE);
-+
-+	data_path = new DataPath(getRoot(path));
-+
-+	lieroEXE = data_path->file("LIERO.EXE");
-+	lieroCHR = data_path->file("LIERO.CHR");
-+	lieroSND = data_path->file("LIERO.SND");
-+	lieroOPT = data_path->file("LIERO.OPT");
-+
-+// DATAPATH	lieroEXERoot = getRoot(lieroEXE);
- }
+ void setLieroEXE(std::string const& path)
+ {
+ 	//TODO: Close cached files
+-	
+-	lieroEXE = path;
+-	lieroCHR = changeLeaf(path, "LIERO.CHR");
+-	lieroSND = changeLeaf(path, "LIERO.SND");
+-	lieroOPT = changeLeaf(path, "LIERO.OPT");
+-	
+-	lieroEXERoot = getRoot(lieroEXE);
++
++	data_path = new DataPath(getRoot(path));
++
++	lieroEXE = data_path->file("LIERO.EXE");
++	lieroCHR = data_path->file("LIERO.CHR");
++	lieroSND = data_path->file("LIERO.SND");
++	lieroOPT = data_path->file("LIERO.OPT");
++
++// DATAPATH	lieroEXERoot = getRoot(lieroEXE);
+ }
 --- a/reader.hpp
 +++ b/reader.hpp
 @@ -1,11 +1,14 @@
- #ifndef LIERO_READER_HPP
- #define LIERO_READER_HPP
- 
-+#include "dataPath.hpp"
- #include <cstdio>
+ #ifndef LIERO_READER_HPP
+ #define LIERO_READER_HPP
+ 
++#include "dataPath.hpp"
+ #include <cstdio>
  #include <string>
- #include <stdexcept>
- #include <SDL/SDL.h>
- 
+ #include <stdexcept>
+ #include <SDL/SDL.h>
+ 
 +extern DataPath* data_path;
 +
- extern std::string lieroEXERoot;
- extern std::string lieroOPT;
- 
+ extern std::string lieroEXERoot;
+ extern std::string lieroOPT;
+ 
 --- a/settings.cpp
 +++ b/settings.cpp
 @@ -127,7 +127,7 @@
- 
- void Settings::generateName(WormSettings& ws)
- {
--	FILE* f = fopen(joinPath(lieroEXERoot, "NAMES.DAT").c_str(), "rb");
-+	FILE* f = fopen(data_path->file("NAMES.DAT").c_str(), "rb");
- 	
- 	if(!f)
- 		return;
+ 
+ void Settings::generateName(WormSettings& ws)
+ {
+-	FILE* f = fopen(joinPath(lieroEXERoot, "NAMES.DAT").c_str(), "rb");
++	FILE* f = fopen(data_path->file("NAMES.DAT").c_str(), "rb");
+ 	
+ 	if(!f)
+ 		return;
 --- a/worm.cpp
 +++ b/worm.cpp
 @@ -40,7 +40,7 @@
- {
- 	try
- 	{
--		std::string path(joinPath(lieroEXERoot, newProfileName) + ".lpf");
-+		std::string path(joinPath(data_path->configdir(), newProfileName) + ".lpf");
- 		gvl::stream_ptr str(new gvl::fstream(path.c_str(), "wb"));
- 		
- 		gvl::octet_stream_writer writer(str);
+ {
+ 	try
+ 	{
+-		std::string path(joinPath(lieroEXERoot, newProfileName) + ".lpf");
++		std::string path(joinPath(data_path->configdir(), newProfileName) + ".lpf");
+ 		gvl::stream_ptr str(new gvl::fstream(path.c_str(), "wb"));
+ 		
+ 		gvl::octet_stream_writer writer(str);
 @@ -60,7 +60,7 @@
- 	int oldColor = color;
- 	try
- 	{
--		std::string path(joinPath(lieroEXERoot, newProfileName) + ".lpf");
-+		std::string path(joinPath(data_path->configdir(), newProfileName) + ".lpf");
- 		gvl::stream_ptr str(new gvl::fstream(path.c_str(), "rb"));
- 		
- 		gvl::octet_stream_reader reader(str);
+ 	int oldColor = color;
+ 	try
+ 	{
+-		std::string path(joinPath(lieroEXERoot, newProfileName) + ".lpf");
++		std::string path(joinPath(data_path->configdir(), newProfileName) + ".lpf");
+ 		gvl::stream_ptr str(new gvl::fstream(path.c_str(), "rb"));
+ 		
+ 		gvl::octet_stream_reader reader(str);
diff --git a/debian/patches/no-press-any-key.patch b/debian/patches/no-press-any-key.patch
index 66f3a8c..b5bbedb 100644
--- a/debian/patches/no-press-any-key.patch
+++ b/debian/patches/no-press-any-key.patch
@@ -8,11 +8,11 @@ Last-Update: 2011-11-15
 --- a/main.cpp
 +++ b/main.cpp
 @@ -140,7 +140,7 @@
- 	Console::writeLine(common->S[OK2]);
- 	
- 	Console::writeLine("");
--	Console::write(common->S[PressAnyKey]);
-+	//Console::write(common->S[PressAnyKey]);
- 	Console::waitForAnyKey();
- 	Console::clear();
- 	
+ 	Console::writeLine(common->S[OK2]);
+ 	
+ 	Console::writeLine("");
+-	Console::write(common->S[PressAnyKey]);
++	//Console::write(common->S[PressAnyKey]);
+ 	Console::waitForAnyKey();
+ 	Console::clear();
+ 	

-- 
Packaging for Liero



More information about the Pkg-games-commits mailing list