r8301 - in packages/trunk/blocks-of-the-undead/debian: . patches

Evgeni Golov sargentd-guest at alioth.debian.org
Sun Oct 26 07:41:32 UTC 2008


Author: sargentd-guest
Date: 2008-10-26 07:41:32 +0000 (Sun, 26 Oct 2008)
New Revision: 8301

Modified:
   packages/trunk/blocks-of-the-undead/debian/changelog
   packages/trunk/blocks-of-the-undead/debian/patches/02_accept_mousepress_as_anykey.patch
Log:
Update the patch to accept a mousepress during the splashscreen too.


Modified: packages/trunk/blocks-of-the-undead/debian/changelog
===================================================================
--- packages/trunk/blocks-of-the-undead/debian/changelog	2008-10-25 19:24:00 UTC (rev 8300)
+++ packages/trunk/blocks-of-the-undead/debian/changelog	2008-10-26 07:41:32 UTC (rev 8301)
@@ -1,3 +1,10 @@
+blocks-of-the-undead (1.0-3) UNRELEASED; urgency=low
+
+  * debian/patches/02_accept_mousepress_as_anykey.patch:
+    + Update the patch to accept a mousepress during the splashscreen too.
+
+ -- Evgeni Golov <sargentd at die-welt.net>  Sun, 26 Oct 2008 08:40:31 +0100
+
 blocks-of-the-undead (1.0-2) unstable; urgency=low
 
   [ Evgeni Golov ]

Modified: packages/trunk/blocks-of-the-undead/debian/patches/02_accept_mousepress_as_anykey.patch
===================================================================
--- packages/trunk/blocks-of-the-undead/debian/patches/02_accept_mousepress_as_anykey.patch	2008-10-25 19:24:00 UTC (rev 8300)
+++ packages/trunk/blocks-of-the-undead/debian/patches/02_accept_mousepress_as_anykey.patch	2008-10-26 07:41:32 UTC (rev 8301)
@@ -1,8 +1,52 @@
-Index: BlocksOfTheUndead-1.0/TetrisAttack/src/CTetrisGame.cpp
+Index: blocks-of-the-undead-1.0/TetrisAttack/src/CTetrisGame.cpp
 ===================================================================
---- BlocksOfTheUndead-1.0.orig/TetrisAttack/src/CTetrisGame.cpp	2008-10-25 21:01:18.000000000 +0200
-+++ BlocksOfTheUndead-1.0/TetrisAttack/src/CTetrisGame.cpp	2008-10-25 21:02:59.000000000 +0200
-@@ -439,6 +439,12 @@
+--- blocks-of-the-undead-1.0.orig/TetrisAttack/src/CTetrisGame.cpp	2008-10-26 08:33:57.000000000 +0100
++++ blocks-of-the-undead-1.0/TetrisAttack/src/CTetrisGame.cpp	2008-10-26 08:33:58.000000000 +0100
+@@ -362,42 +362,7 @@
+ 		
+ 		case Splash:
+ 		{
+-			state = SinglePlayerPuzzle;
+-			int a = 1, b = 1;
+-			
+-                        string file;
+-#if defined(WIN32) || defined(_WIN32)
+-                        file = CImgLoader::getPath() + "/progress.txt";
+-#else
+-                        char *homedir = getenv("HOME");
+-                        if (homedir != NULL)
+-                        {
+-                            file = string(homedir) + "/.blocks-progress";
+-                        }
+-                        else
+-                        {
+-                            file = "blocks-progress";
+-                        }
+-#endif
+-
+-			ifstream data( file.c_str() );
+-			if (data)
+-			{
+-				data >> a;
+-				data >> b;
+-			}
+-
+-			if (a != 1)
+-			{
+-				CTetrisTheme* tmptheme = new CTetrisTheme( stringify(a) );
+-				CVector pos = fields[0]->getPos();
+-				delete fields[0];
+-				fields.clear();
+-				fields.push_back(new CPlayingField(pos, *(tmptheme->getBlockSet()), tmptheme, 100) );
+-				delete theme;
+-				theme = tmptheme;
+-			}
+-			fields[0]->load(a,b);
++			startGame();
+ 		}break;
+ 
+ 		default:
+@@ -439,12 +404,63 @@
  		case SinglePlayerPuzzle:
  		case SinglePlayer:
  		{
@@ -15,3 +59,67 @@
  			int x, y;
  			bool cords;
  			/*if ( (cords = fields[0]->boardCords(mouseloc, x, y)) && (fields[0]->blockExists(x, y) || fields[0]->blockExists(x+1, y)))
+ 			{*/
+ 				fields[0]->swap();
+ 			//}
+-		}
++		} break;
++
++		case Splash:
++		{
++			startGame();
++		}break;
+ 	}
+ }
++
++void CTetrisGame::startGame()
++{
++			state = SinglePlayerPuzzle;
++			int a = 1, b = 1;
++
++                        string file;
++#if defined(WIN32) || defined(_WIN32)
++                        file = CImgLoader::getPath() + "/progress.txt";
++#else
++                        char *homedir = getenv("HOME");
++                        if (homedir != NULL)
++                        {
++                            file = string(homedir) + "/.blocks-progress";
++                        }
++                        else
++                        {
++                            file = "blocks-progress";
++                        }
++#endif
++
++			ifstream data( file.c_str() );
++			if (data)
++			{
++				data >> a;
++				data >> b;
++			}
++
++			if (a != 1)
++			{
++				CTetrisTheme* tmptheme = new CTetrisTheme( stringify(a) );
++				CVector pos = fields[0]->getPos();
++				delete fields[0];
++				fields.clear();
++				fields.push_back(new CPlayingField(pos, *(tmptheme->getBlockSet()), tmptheme, 100) );
++				delete theme;
++				theme = tmptheme;
++			}
++			fields[0]->load(a,b);
++}
+Index: blocks-of-the-undead-1.0/TetrisAttack/src/CTetrisGame.h
+===================================================================
+--- blocks-of-the-undead-1.0.orig/TetrisAttack/src/CTetrisGame.h	2008-10-26 08:34:05.000000000 +0100
++++ blocks-of-the-undead-1.0/TetrisAttack/src/CTetrisGame.h	2008-10-26 08:34:13.000000000 +0100
+@@ -37,6 +37,7 @@
+ 	void handleKeypress(const SDL_KeyboardEvent &e);
+ 	void handleMouseMotion(const SDL_MouseMotionEvent &e);
+ 	void handleMouseButton(const SDL_MouseButtonEvent &e);
++	void startGame();
+ 
+ 	vector<CPlayingField*> fields;
+ 	list<CSprite*> sprites;




More information about the Pkg-games-commits mailing list