Imported Debian patch 0.52-6 debian/0.52-6
authorGerfried Fuchs <alfie@debian.org>
Fri, 8 Sep 2006 19:08:42 +0000 (14:08 -0500)
committerGerfried Fuchs <rhonda@debian.at>
Wed, 14 Jul 2010 19:42:42 +0000 (21:42 +0200)
curses.c
debian/changelog
debian/control
debian/copyright
game.c
netris.h

index cdbc9f5..dc708bd 100644 (file)
--- a/curses.c
+++ b/curses.c
@@ -20,6 +20,7 @@
  */
 
 #include "netris.h"
+#include <time.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include <term.h>
@@ -264,6 +265,12 @@ ExtFunc void PlotUnderline(int scr, int x, int flag)
 
 ExtFunc void ShowDisplayInfo(void)
 {
+       if (game == GT_classicTwo) {
+               move(statusYPos - 5, statusXPos);
+               printw("Enemy lines: %3d/%4d", enemyLinesCleared, enemyTotalLinesCleared);
+       }
+       move(statusYPos - 4, statusXPos);
+       printw("My lines:    %3d/%4d", myLinesCleared, myTotalLinesCleared);
        move(statusYPos - 3, statusXPos);
        printw("Won:  %3d", won);
        move(statusYPos - 2, statusXPos);
@@ -288,7 +295,7 @@ ExtFunc void ShowDisplayInfo(void)
        printw("Speed: %dms", speed / 1000);
        clrtoeol();
        if (robotEnable) {
-               move(statusYPos - 6, statusXPos);
+               move(statusYPos - 7, statusXPos);
                if (fairRobot)
                        addstr("Controlled by a fair robot");
                else
@@ -296,7 +303,7 @@ ExtFunc void ShowDisplayInfo(void)
                clrtoeol();
        }
        if (opponentFlags & SCF_usingRobot) {
-               move(statusYPos - 5, statusXPos);
+               move(statusYPos - 6, statusXPos);
                if (opponentFlags & SCF_fairRobot)
                        addstr("The opponent is a fair robot");
                else
index e8e5b83..a1e40ec 100644 (file)
@@ -1,3 +1,13 @@
+netris (0.52-6) unstable; urgency=low
+
+  * #include <time.h> in curses.c (closes: #345305)
+  * Add patch to display line count, contributed by Piotr Krukowiecki
+    (closes: #304224)
+  * Bumped Standards-Version to 3.7.2, no changes needed.
+  * Updated FSF address in copyright file.
+
+ -- Gerfried Fuchs <alfie@debian.org>  Fri, 08 Sep 2006 14:08:42 -0500
+
 netris (0.52-5) unstable; urgency=low
 
   * Erm, add small fix for 64bit machines from #325926 which was meant to be
index 0f451be..d097518 100644 (file)
@@ -3,7 +3,7 @@ Section: games
 Priority: optional
 Maintainer: Gerfried Fuchs <alfie@debian.org>
 Build-Depends: libncurses5-dev
-Standards-Version: 3.6.2
+Standards-Version: 3.7.2
 
 Package: netris
 Architecture: any
index d677c00..63c4f91 100644 (file)
@@ -17,8 +17,8 @@ It was downloaded from ftp://ftp.netris.org/pub/netris/
     
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
-    Foundation, 59 Temple Place - Suite 330,
-    Boston, MA 02111-1307, USA.
+    Foundation, 51 Franklin Street, Fifth Floor,
+    Boston, MA 02110-1301 USA.
 
 On Debian GNU/Linux systems, the complete text of the GNU General
 Public License can be found in `/usr/share/common-licenses/GPL'.
diff --git a/game.c b/game.c
index ad188cf..e57e7ca 100644 (file)
--- a/game.c
+++ b/game.c
@@ -103,6 +103,7 @@ ExtFunc void OneGame(int scr, int scr2)
        int key;
        char *p, *cmd;
 
+       myLinesCleared = enemyLinesCleared = 0;
        speed = stepDownInterval;
        ResetBaseTime();
        InitBoard(scr);
@@ -297,7 +298,15 @@ ExtFunc void OneGame(int scr, int scr2)
                                                        DropPiece(scr2);
                                                        break;
                                                case NP_clear:
-                                                       ClearFullLines(scr2);
+                                                       {
+                                                               int cleared = ClearFullLines(scr2);
+                                                               if (cleared) {
+                                                                       enemyLinesCleared += cleared;
+                                                                       enemyTotalLinesCleared += cleared;
+                                                                       ShowDisplayInfo();
+                                                                       RefreshScreen();
+                                                               }
+                                                       }
                                                        break;
                                                case NP_insertJunk:
                                                {
@@ -343,7 +352,12 @@ ExtFunc void OneGame(int scr, int scr2)
        nextPiece:
                dropMode = 0;
                FreezePiece(scr);
-               linesCleared = ClearFullLines(scr);
+               myLinesCleared += linesCleared = ClearFullLines(scr);           
+               myTotalLinesCleared += linesCleared;
+               if (linesCleared) {
+                       ShowDisplayInfo();
+                       RefreshScreen();
+               }
                if (linesCleared > 0 && spied)
                        SendPacket(NP_clear, 0, NULL);
                if (game == GT_classicTwo && linesCleared > 1) {
index 24f3578..db746e5 100644 (file)
--- a/netris.h
+++ b/netris.h
@@ -182,6 +182,11 @@ EXT char scratch[1024];
 extern ShapeOption stdOptions[];
 extern char *version_string;
 
+EXT int myLinesCleared;
+EXT int enemyLinesCleared;
+EXT int myTotalLinesCleared;
+EXT int enemyTotalLinesCleared;
+
 #include "proto.h"
 
 #endif /* NETRIS_H */