Hello community,
here is the log from the commit of package black-box for openSUSE:Factory
checked in at Mon Jan 12 12:02:40 CET 2009.
--------
--- black-box/black-box.changes 2006-05-28 02:59:13.000000000 +0200
+++ /mounts/work_src_done/STABLE/black-box/black-box.changes 2009-01-09 11:39:51.000000000 +0100
@@ -1,0 +2,17 @@
+Fri Jan 9 11:32:05 CET 2009 - mseben@suse.cz
+
+- upgrade to version 1.4.8
+ * Updated autotools files
+ * Updated acinclude.m4 (for SDL)
+ * Applied patch by Javier Serrano Polo:
+ - Remove compilation warnings
+ - Fix buffer overflows
+ - Erase previous level text
+ - Fix level command option
+ - Reuse path calculation function
+ - Avoid repeated crystal generation
+ - Fix window title
+- obsoletes black-box-*-uninitialized.patch
+- updated black-box-*-range.patch
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
black-box-1.4.7.patch
black-box-1.4.7-range.patch
black-box-1.4.7.tar.bz2
black-box-1.4.7-uninitialized.patch
New:
----
black-box-1.4.8.patch
black-box-1.4.8-range.patch
black-box-1.4.8.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ black-box.spec ++++++
--- /var/tmp/diff_new_pack.Nv8167/_old 2009-01-12 11:59:44.000000000 +0100
+++ /var/tmp/diff_new_pack.Nv8167/_new 2009-01-12 11:59:44.000000000 +0100
@@ -1,27 +1,34 @@
#
-# spec file for package black-box (Version 1.4.7)
+# spec file for package black-box (Version 1.4.8)
#
-# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
-# This file and all modifications and additions to the pristine
-# package are under the same license as the package itself.
+# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
+# All modifications and additions to the file contributed by third parties
+# remain the property of their copyright owners, unless otherwise agreed
+# upon. The license for this file, and modifications and additions to the
+# file, is the same license as for the pristine package itself (unless the
+# license for the pristine package is not an Open Source License, in which
+# case the license is the MIT License). An "Open Source License" is a
+# license that conforms to the Open Source Definition (Version 1.9)
+# published by the Open Source Initiative.
+
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
+
Name: black-box
BuildRequires: SDL_image-devel SDL_mixer-devel xorg-x11
-License: GPL
+License: GPL v2 or later
Group: Amusements/Games/Board/Puzzle
Summary: Puzzle Game
-Version: 1.4.7
-Release: 14
-URL: http://www.linux-games.com/black-box/
-Source: black-box-%{version}.tar.bz2
-Patch: black-box-%{version}.patch
-Patch1: black-box-1.4.7-uninitialized.patch
-Patch2: black-box-1.4.7-range.patch
+Version: 1.4.8
+Release: 1
+Url: http://www.linux-games.com/black-box/
+Source: %{name}-%{version}.tar.bz2
+Patch: %{name}-%{version}.patch
+Patch2: %{name}-%{version}-range.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -36,7 +43,6 @@
%prep
%setup
%patch
-%patch1
%patch2
%build
@@ -55,54 +61,68 @@
%files
%defattr(-,root,root)
-%doc AUTHORS COPYING ChangeLog README NEWS
+%doc AUTHORS COPYING ChangeLog README
/usr/bin/black-box
/usr/share/black-box
-%changelog -n black-box
-* Sat May 27 2006 - schwab@suse.de
+%changelog
+* Fri Jan 09 2009 mseben@suse.cz
+- upgrade to version 1.4.8
+ * Updated autotools files
+ * Updated acinclude.m4 (for SDL)
+ * Applied patch by Javier Serrano Polo:
+ - Remove compilation warnings
+ - Fix buffer overflows
+ - Erase previous level text
+ - Fix level command option
+ - Reuse path calculation function
+ - Avoid repeated crystal generation
+ - Fix window title
+- obsoletes black-box-*-uninitialized.patch
+- updated black-box-*-range.patch
+* Sat May 27 2006 schwab@suse.de
- Don't strip binaries.
- Fix out-of-range array access.
-* Fri Feb 24 2006 - lmichnovic@suse.cz
+* Fri Feb 24 2006 lmichnovic@suse.cz
- fixed uninitialized variable [#152888]
-* Wed Jan 25 2006 - mls@suse.de
+* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
-* Wed Oct 05 2005 - lmichnovic@suse.cz
+* Wed Oct 05 2005 lmichnovic@suse.cz
- upgrade to version 1.4.7
-* Tue Sep 20 2005 - lmichnovic@suse.cz
+* Tue Sep 20 2005 lmichnovic@suse.cz
- fixed gcc warnings
-* Thu May 13 2004 - ro@suse.de
+* Thu May 13 2004 ro@suse.de
- get rid of some compiler warnings
-* Wed Apr 28 2004 - ltinkl@suse.cz
+* Wed Apr 28 2004 ltinkl@suse.cz
- fix build problems with aliasing and possible buffer overflow
-* Sat Jan 10 2004 - adrian@suse.de
+* Sat Jan 10 2004 adrian@suse.de
- build as user
-* Thu Jan 23 2003 - ro@suse.de
+* Thu Jan 23 2003 ro@suse.de
- fixed macro definitions for gcc-3.3
-* Fri Feb 01 2002 - ro@suse.de
+* Fri Feb 01 2002 ro@suse.de
- changed neededforbuild <libpng> to <libpng-devel-packages>
-* Fri Nov 23 2001 - cihlar@suse.cz
+* Fri Nov 23 2001 cihlar@suse.cz
- update to version 1.4.3
-* Fri Oct 26 2001 - ro@suse.de
+* Fri Oct 26 2001 ro@suse.de
- use neededforbuild aliases: SDL_devel-pakages, SDL_mixer-packages
-* Thu Aug 16 2001 - ro@suse.de
+* Thu Aug 16 2001 ro@suse.de
- changed neededforbuild <smpeg> to <smpeg smpeg-devel>
-* Wed Aug 08 2001 - ro@suse.de
+* Wed Aug 08 2001 ro@suse.de
- changed neededforbuild <kdelibs kdelibs-devel> to <kdelibs-artsd>
-* Wed Aug 08 2001 - ro@suse.de
+* Wed Aug 08 2001 ro@suse.de
- changed neededforbuild <sdl> to <SDL>
- changed neededforbuild <sdl-devel> to <SDL-devel>
-* Wed Jun 20 2001 - cihlar@suse.cz
+* Wed Jun 20 2001 cihlar@suse.cz
- added kdelibs and kdelibs-devel to neededforbuild
-* Mon Mar 26 2001 - ro@suse.de
+* Mon Mar 26 2001 ro@suse.de
- changed neededforbuild <sdl> to <sdl sdl-devel>
-* Mon Mar 12 2001 - cihlar@suse.cz
+* Mon Mar 12 2001 cihlar@suse.cz
- fixed neededforbuild
-* Fri Mar 09 2001 - ro@suse.de
+* Fri Mar 09 2001 ro@suse.de
- neededforbuild sdlmixer -> SDL_mixer
-* Mon Mar 05 2001 - cihlar@suse.cz
+* Mon Mar 05 2001 cihlar@suse.cz
- updated to version 1.4
-* Wed Feb 21 2001 - uli@suse.de
+* Wed Feb 21 2001 uli@suse.de
- added alsa, esound, audiofile to neededforbuild (reqd. by new SDL)
-* Fri Dec 01 2000 - cihlar@suse.cz
+* Fri Dec 01 2000 cihlar@suse.cz
- package created
++++++ black-box-1.4.7.patch -> black-box-1.4.8.patch ++++++
--- black-box/black-box-1.4.7.patch 2005-10-05 16:41:36.000000000 +0200
+++ /mounts/work_src_done/STABLE/black-box/black-box-1.4.8.patch 2009-01-08 15:21:04.000000000 +0100
@@ -1,12 +1,13 @@
--- src/blackbox.c
+++ src/blackbox.c
-@@ -27,10 +27,14 @@
+@@ -27,11 +27,15 @@
#include
#include
+#include
+#include
#include
+ #include
#include
#include
+#include
@@ -15,7 +16,7 @@
#include "SFont.h"
int fullscreen=1,difficulty=4,trihigh=1,sound=1; //settings
-@@ -116,7 +120,7 @@
+@@ -117,7 +121,7 @@
SDL_Surface *LoadImage(char *datafile, int transparent) // reads one GIF into the memory
{
SDL_Surface *pic,*pic2;
@@ -24,7 +25,7 @@
int i=0;
sprintf(filename,"%s/gfx/%s",DATAPATH,datafile);
-@@ -644,6 +648,8 @@
+@@ -553,6 +557,8 @@
SDL_UpdateRect(screen,0,0,0,0);
}
@@ -32,13 +33,13 @@
+
void generate_field()
{
- int x,y,crystal_num;
-@@ -983,7 +989,7 @@
+ int x,y;
+@@ -895,7 +901,7 @@
}
}
-main(int argc, char *argv[])
+int main(int argc, char *argv[])
{
- printf("\nBlack-Box version %s, Copyright (C) 2000 Karl Bartel\n",VERSION);
+ printf("\nBlack-Box version %s, Copyright (C) 2000-2008 Karl Bartel\n",VERSION);
printf("Black-Box comes with ABSOLUTELY NO WARRANTY; for details see COPYING'.\n");
++++++ black-box-1.4.7-range.patch -> black-box-1.4.8-range.patch ++++++
--- black-box/black-box-1.4.7-range.patch 2006-05-28 02:58:02.000000000 +0200
+++ /mounts/work_src_done/STABLE/black-box/black-box-1.4.8-range.patch 2009-01-11 21:22:08.000000000 +0100
@@ -1,123 +1,42 @@
--- src/blackbox.c
+++ src/blackbox.c
-@@ -408,29 +408,29 @@
- if (dir==0)
+@@ -406,26 +406,26 @@
{
+ case 0:
if (y==0) {end=1;} else
-- if (real[x-1][y-1]==1) {dir=1;} else
-- if (real[x][y-1]==1) {dir=3;}
-+ if (x!=0&&real[x-1][y-1]==1) {dir=1;} else
-+ if (x!=11&&real[x][y-1]==1) {dir=3;}
+- if (map[x-1][y-1]==1) {dir=1;} else
+- if (map[x][y-1]==1) {dir=3;}
++ if (x!=0&&map[x-1][y-1]==1) {dir=1;} else
++ if (x<10&&map[x][y-1]==1) {dir=3;}
else {y--;}
- }
- if (dir==1)
- {
+ break;
+ case 1:
- if (x==12) {end=1;} else
-- if (real[x][y]==1) {dir=0;} else
-- if (real[x][y-1]==1) {dir=2;}
+- if (map[x][y]==1) {dir=0;} else
+- if (map[x][y-1]==1) {dir=2;}
+ if (x==11) {end=1;} else
-+ if (y!=9&&real[x][y]==1) {dir=0;} else
-+ if (y!=0&&real[x][y-1]==1) {dir=2;}
++ if (y<8&&map[x][y]==1) {dir=0;} else
++ if (y!=0&&map[x][y-1]==1) {dir=2;}
else {x++;}
- }
- if (dir==2)
- {
+ break;
+ case 2:
if (y==9) {end=1;} else
-- if (real[x][y]==1) {dir=3;} else
-- if (real[x-1][y]==1) {dir=1;}
-+ if (x!=11&&real[x][y]==1) {dir=3;} else
-+ if (x!=0&&real[x-1][y]==1) {dir=1;}
+- if (map[x][y]==1) {dir=3;} else
+- if (map[x-1][y]==1) {dir=1;}
++ if (x<10&&map[x][y]==1) {dir=3;} else
++ if (x!=0&&map[x-1][y]==1) {dir=1;}
else {y++;}
- }
- if (dir==3)
- {
+ break;
+ case 3:
if (x==0) {end=1;} else
-- if (real[x-1][y]==1) {dir=0;} else
-- if (real[x-1][y-1]==1) {dir=2;}
-+ if (y!=9&&real[x-1][y]==1) {dir=0;} else
-+ if (y!=0&&real[x-1][y-1]==1) {dir=2;}
+- if (map[x-1][y]==1) {dir=0;} else
+- if (map[x-1][y-1]==1) {dir=2;}
++ if (y<8&&map[x-1][y]==1) {dir=0;} else
++ if (y!=0&&map[x-1][y-1]==1) {dir=2;}
else {x--;}
+ break;
}
- if ((x>30)||(y>20)||(y<0)||(y<0))
-@@ -457,29 +457,29 @@
- if (dir==0)
- {
- if (y==0) {end=1;} else
-- if (think[x-1][y-1]==1) {dir=1;} else
-- if (think[x][y-1]==1) {dir=3;}
-+ if (x!=0&&think[x-1][y-1]==1) {dir=1;} else
-+ if (x!=11&&think[x][y-1]==1) {dir=3;}
- else {y--;}
- }
- if (dir==1)
- {
-- if (x==12) {end=1;} else
-- if (think[x][y]==1) {dir=0;} else
-- if (think[x][y-1]==1) {dir=2;}
-+ if (x==11) {end=1;} else
-+ if (y!=9&&think[x][y]==1) {dir=0;} else
-+ if (y!=0&&think[x][y-1]==1) {dir=2;}
- else {x++;}
- }
- if (dir==2)
- {
- if (y==9) {end=1;} else
-- if (think[x][y]==1) {dir=3;} else
-- if (think[x-1][y]==1) {dir=1;}
-+ if (x!=11&&think[x][y]==1) {dir=3;} else
-+ if (x!=0&&think[x-1][y]==1) {dir=1;}
- else {y++;}
- }
- if (dir==3)
- {
- if (x==0) {end=1;} else
-- if (think[x-1][y]==1) {dir=0;} else
-- if (think[x-1][y-1]==1) {dir=2;}
-+ if (y!=9&&think[x-1][y]==1) {dir=0;} else
-+ if (y!=0&&think[x-1][y-1]==1) {dir=2;}
- else {x--;}
- }
- if ((x>30)||(y>20)||(y<0)||(y<0))
-@@ -581,29 +581,29 @@
- if (dir==0)
- {
- if (y==0) {end=1;} else
-- if (real[x-1][y-1]==1) {dir=1;} else
-- if (real[x][y-1]==1) {dir=3;}
-+ if (x!=0&&real[x-1][y-1]==1) {dir=1;} else
-+ if (x!=11&&real[x][y-1]==1) {dir=3;}
- else {y--;}
- }
- if (dir==1)
- {
-- if (x==12) {end=1;} else
-- if (real[x][y]==1) {dir=0;} else
-- if (real[x][y-1]==1) {dir=2;}
-+ if (x==11) {end=1;} else
-+ if (y!=9&&real[x][y]==1) {dir=0;} else
-+ if (y!=0&&real[x][y-1]==1) {dir=2;}
- else {x++;}
- }
- if (dir==2)
- {
- if (y==9) {end=1;} else
-- if (real[x][y]==1) {dir=3;} else
-- if (real[x-1][y]==1) {dir=1;}
-+ if (x!=11&&real[x][y]==1) {dir=3;} else
-+ if (x!=0&&real[x-1][y]==1) {dir=1;}
- else {y++;}
- }
- if (dir==3)
- {
- if (x==0) {end=1;} else
-- if (real[x-1][y]==1) {dir=0;} else
-- if (real[x-1][y-1]==1) {dir=2;}
-+ if (y!=9&&real[x-1][y]==1) {dir=0;} else
-+ if (y!=0&&real[x-1][y-1]==1) {dir=2;}
- else {x--;}
- }
- if ((x>30)||(y>20)||(y<0)||(y<0))
-@@ -834,15 +834,15 @@
+@@ -740,15 +740,15 @@
{
//block highlighting
case SDL_BUTTON(3):
@@ -139,7 +58,7 @@
{
light[div(mouse_x+25,50).quot-2][div(mouse_y+25,50).quot-2]=0;
}
-@@ -889,15 +889,15 @@
+@@ -795,15 +795,15 @@
break;
case SDL_BUTTON(1):
//think
@@ -160,4 +79,4 @@
+ &&(think[div(mouse_x,50).quot-2][div(mouse_y,50).quot-2]==1))
{
think[div(mouse_x,50).quot-2][div(mouse_y,50).quot-2]=0;
- }
+ }
\ No newline at end of file
++++++ black-box-1.4.7.tar.bz2 -> black-box-1.4.8.tar.bz2 ++++++
++++ 15410 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/black-box-1.4.7/acinclude.m4 new/black-box-1.4.8/acinclude.m4
--- old/black-box-1.4.7/acinclude.m4 2001-11-02 20:51:43.000000000 +0100
+++ new/black-box-1.4.8/acinclude.m4 2007-12-31 05:48:39.000000000 +0100
@@ -8,7 +8,7 @@
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
-AC_DEFUN(AM_PATH_SDL,
+AC_DEFUN([AM_PATH_SDL],
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
@@ -20,39 +20,43 @@
, enable_sdltest=yes)
if test x$sdl_exec_prefix != x ; then
- sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
- if test x${SDL_CONFIG+set} != xset ; then
- SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
- fi
+ sdl_config_args="$sdl_config_args --exec-prefix=$sdl_exec_prefix"
+ if test x${SDL_CONFIG+set} != xset ; then
+ SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
+ fi
fi
if test x$sdl_prefix != x ; then
- sdl_args="$sdl_args --prefix=$sdl_prefix"
- if test x${SDL_CONFIG+set} != xset ; then
- SDL_CONFIG=$sdl_prefix/bin/sdl-config
- fi
+ sdl_config_args="$sdl_config_args --prefix=$sdl_prefix"
+ if test x${SDL_CONFIG+set} != xset ; then
+ SDL_CONFIG=$sdl_prefix/bin/sdl-config
+ fi
fi
- AC_REQUIRE([AC_CANONICAL_TARGET])
- AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
+ if test "x$prefix" != xNONE; then
+ PATH="$prefix/bin:$prefix/usr/bin:$PATH"
+ fi
+ AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
no_sdl=""
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
- SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
- SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
+ SDL_CFLAGS=`$SDL_CONFIG $sdl_config_args --cflags`
+ SDL_LIBS=`$SDL_CONFIG $sdl_config_args --libs`
- sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
+ sdl_major_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
+ sdl_minor_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
+ ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $SDL_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl
dnl Now check if the installed SDL is sufficiently new. (Also sanity
@@ -118,6 +122,7 @@
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
@@ -137,6 +142,7 @@
else
echo "*** Could not run SDL test program, checking why..."
CFLAGS="$CFLAGS $SDL_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AC_TRY_LINK([
#include
@@ -161,6 +167,7 @@
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
+ CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/black-box-1.4.7/ChangeLog new/black-box-1.4.8/ChangeLog
--- old/black-box-1.4.7/ChangeLog 2005-05-20 11:57:07.000000000 +0200
+++ new/black-box-1.4.8/ChangeLog 2008-10-04 22:15:47.000000000 +0200
@@ -1,3 +1,16 @@
+
+Version 1.4.8
+ -Updated autotools files
+ -Updated acinclude.m4 (for SDL)
+ -Applied patch by Javier Serrano Polo:
+ * Remove compilation warnings
+ * Fix buffer overflows
+ * Erase previous level text
+ * Fix level command option
+ * Reuse path calculation function
+ * Avoid repeated crystal generation
+ * Fix window title
+
Version 1.4.7
-removed SDL_mixer and SDL_image code and
added them as external dependencies
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/black-box-1.4.7/configure.in new/black-box-1.4.8/configure.in
--- old/black-box-1.4.7/configure.in 2005-05-20 11:38:59.000000000 +0200
+++ new/black-box-1.4.8/configure.in 2008-10-04 21:25:26.000000000 +0200
@@ -8,7 +8,7 @@
######## Setup for automake
NAME="black-box"
SDL_VERSION=1.1.5
-AM_INIT_AUTOMAKE($NAME, 1.4.7)
+AM_INIT_AUTOMAKE($NAME, 1.4.8)
######## Check for tools
AC_PROG_CC
@@ -18,32 +18,13 @@
######## Check for compiler environment
AC_C_CONST
-######## Figure out which math library to use
-case "$target" in
- *-*-mingw32*)
- MATHLIB=""
- ;;
- *-*-beos*)
- MATHLIB=""
- ;;
- *)
- MATHLIB="-lm"
- AC_CHECK_LIB(m, main, , AC_MSG_ERROR(Your system is missing libm (mathlib)!))
- ;;
-esac
-AC_SUBST(MATHLIB)
-
######## Check for SDL
AM_PATH_SDL($SDL_VERSION,
:,
AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
)
-######## Check for headers
-AC_CHECK_HEADERS(math.h, , AC_MSG_ERROR(Your system is missing math.h !))
-
######## Check for other libs
-AC_CHECK_LIB(m, main, , AC_MSG_ERROR(Your system is missing libm!))
AC_CHECK_LIB(SDL_mixer, main, , AC_MSG_ERROR(Your system is missing SDL_mixer! see http://www.libsdl.org/projects/SDL_mixer/), $SDL_LIBS)
AC_CHECK_LIB(SDL_image, main, , AC_MSG_ERROR(Your system is missing libSDL_image!), $SDL_LIBS)
@@ -60,4 +41,5 @@
data/Makefile
data/gfx/Makefile
data/sound/Makefile
-])
\ No newline at end of file
+])
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/black-box-1.4.7/missing new/black-box-1.4.8/missing
--- old/black-box-1.4.7/missing 2001-10-16 19:13:30.000000000 +0200
+++ new/black-box-1.4.8/missing 2006-10-19 06:51:14.000000000 +0200
@@ -1,6 +1,10 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-# Copyright 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
+
+scriptversion=2006-05-10.23
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard , 1996.
# This program is free software; you can redistribute it and/or modify
@@ -15,8 +19,8 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -29,6 +33,8 @@
fi
run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -38,18 +44,24 @@
configure_ac=configure.in
fi
-case "$1" in
+msg="missing on your system"
+
+case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
-h|--h|--he|--hel|--help)
echo "\
@@ -67,6 +79,7 @@
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -74,11 +87,15 @@
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
- yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to ."
+ exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing 0.3 - GNU automake"
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
;;
-*)
@@ -87,9 +104,44 @@
exit 1
;;
- aclocal)
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+ aclocal*)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
@@ -98,7 +150,7 @@
autoconf)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
@@ -107,7 +159,7 @@
autoheader)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
@@ -115,7 +167,7 @@
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case "$f" in
+ case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -124,9 +176,9 @@
touch $touch_files
;;
- automake)
+ automake*)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
@@ -135,71 +187,92 @@
while read f; do touch "$f"; done
;;
+ autom4te)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
bison|yacc)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' $msg. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if [ ! -f y.tab.h ]; then
+ if test ! -f y.tab.h; then
echo >y.tab.h
fi
- if [ ! -f y.tab.c ]; then
+ if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if [ ! -f lex.yy.c ]; then
+ if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
@@ -209,54 +282,58 @@
;;
makeinfo)
- if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
- # We have makeinfo, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
-WARNING: \`$1' is missing on your system. You should only need it if
+WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
- fi
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
touch $file
;;
tar)
shift
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
- gnutar ${1+"$@"} && exit 0
+ gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
- gtar ${1+"$@"} && exit 0
+ gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
- case "$firstarg" in
+ case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
- tar "$firstarg" ${1+"$@"} && exit 0
+ tar "$firstarg" "$@" && exit 0
;;
esac
- case "$firstarg" in
+ case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
- tar "$firstarg" ${1+"$@"} && exit 0
+ tar "$firstarg" "$@" && exit 0
;;
esac
fi
@@ -270,10 +347,10 @@
*)
echo 1>&2 "\
-WARNING: \`$1' is needed, and you do not seem to have it handy on your
- system. You might have modified some files without having the
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequirements for installing
+ it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
@@ -281,3 +358,10 @@
esac
exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/black-box-1.4.7/NEWS new/black-box-1.4.8/NEWS
--- old/black-box-1.4.7/NEWS 2005-05-20 11:57:07.000000000 +0200
+++ new/black-box-1.4.8/NEWS 2008-10-04 22:15:47.000000000 +0200
@@ -1,3 +1,16 @@
+
+Version 1.4.8
+ -Updated autotools files
+ -Updated acinclude.m4 (for SDL)
+ -Applied patch by Javier Serrano Polo:
+ * Remove compilation warnings
+ * Fix buffer overflows
+ * Erase previous level text
+ * Fix level command option
+ * Reuse path calculation function
+ * Avoid repeated crystal generation
+ * Fix window title
+
Version 1.4.7
-removed SDL_mixer and SDL_image code and
added them as external dependencies
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/black-box-1.4.7/src/blackbox.c new/black-box-1.4.8/src/blackbox.c
--- old/black-box-1.4.7/src/blackbox.c 2005-05-20 11:52:35.000000000 +0200
+++ new/black-box-1.4.8/src/blackbox.c 2008-10-04 22:00:24.000000000 +0200
@@ -1,5 +1,5 @@
/* Black-box: guess where the crystals are !
- Copyright (C) 2000 Karl Bartel
+ Copyright (C) 2000-2008 Karl Bartel
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -48,9 +49,9 @@
char text[80];
char xline[9];
char yline[11];
- char think[11][9];
+ char think[12][9];
char light[11][9];
- char real[11][9];
+ char real[12][9];
#define PATHNUM 5
char DATAPATH[200]=DATADIR;
@@ -235,9 +236,9 @@
blit(695,480,help_pic);
sprintf(text,"Level %d",level_num);
- rect.x=800-TextWidth(text);
+ rect.x=800-111;
rect.y=300;
- rect.w=TextWidth(text);
+ rect.w=111;
rect.h=Font->h;
SDL_FillRect(screen, &rect, SDL_MapRGB(screen->format,0,0,0));
PutString(screen,800-TextWidth(text),300,text);
@@ -252,7 +253,7 @@
if ((strcmp(argv[i],"--nofullscreen")==0)||(strcmp(argv[i],"-f")==0)) {fullscreen=0;} else
if ((strcmp(argv[i],"--nosound")==0)||(strcmp(argv[i],"-s")==0)) {sound=0;} else
if (((strcmp(argv[i],"--levelnum")==0)&&(argv[i+1]))||((strcmp(argv[i],"-l")==0)&&(argv[i+1])))
- {i++;level_num=atoi(argv[i]);printf("starting with level #%d\n",level_num);LevelGiven=1;} else
+ {i++;level_num=atoi(argv[i])%100000;printf("starting with level #%d\n",level_num);LevelGiven=1;} else
{
if (!((strcmp(argv[i],"-h")==0)||(strcmp(argv[i],"--help")==0))) printf("Unknown parameter: \"%s\"\n", argv[i]);
puts("\nCommand line options:\n");
@@ -394,44 +395,43 @@
}
}
-output calc_real(int x,int y,int dir)
+output calc_out(char map[12][9],int x,int y,int dir)
{
int end=0;
output out;
while (!end)
{
- if (dir==0)
+ switch (dir)
{
+ case 0:
if (y==0) {end=1;} else
- if (real[x-1][y-1]==1) {dir=1;} else
- if (real[x][y-1]==1) {dir=3;}
+ if (map[x-1][y-1]==1) {dir=1;} else
+ if (map[x][y-1]==1) {dir=3;}
else {y--;}
- }
- if (dir==1)
- {
+ break;
+ case 1:
if (x==12) {end=1;} else
- if (real[x][y]==1) {dir=0;} else
- if (real[x][y-1]==1) {dir=2;}
+ if (map[x][y]==1) {dir=0;} else
+ if (map[x][y-1]==1) {dir=2;}
else {x++;}
- }
- if (dir==2)
- {
+ break;
+ case 2:
if (y==9) {end=1;} else
- if (real[x][y]==1) {dir=3;} else
- if (real[x-1][y]==1) {dir=1;}
+ if (map[x][y]==1) {dir=3;} else
+ if (map[x-1][y]==1) {dir=1;}
else {y++;}
- }
- if (dir==3)
- {
+ break;
+ case 3:
if (x==0) {end=1;} else
- if (real[x-1][y]==1) {dir=0;} else
- if (real[x-1][y-1]==1) {dir=2;}
+ if (map[x-1][y]==1) {dir=0;} else
+ if (map[x-1][y-1]==1) {dir=2;}
else {x--;}
+ break;
}
- if ((x>30)||(y>20)||(y<0)||(y<0))
+ if ((x>12)||(y>9)||(x<0)||(y<0))
{
- printf("ERROR: x or y out of range in function hidden, quitting now.\n");
+ fprintf(stderr,"ERROR: calc_out: x or y out of range, quitting now.\n");
free_memory();
exit(1);
}
@@ -443,55 +443,6 @@
return(out);
}
-output calc_think(int x,int y,int dir)
-{
- int end=0;
- output out;
-
- while (!end)
- {
- if (dir==0)
- {
- if (y==0) {end=1;} else
- if (think[x-1][y-1]==1) {dir=1;} else
- if (think[x][y-1]==1) {dir=3;}
- else {y--;}
- }
- if (dir==1)
- {
- if (x==12) {end=1;} else
- if (think[x][y]==1) {dir=0;} else
- if (think[x][y-1]==1) {dir=2;}
- else {x++;}
- }
- if (dir==2)
- {
- if (y==9) {end=1;} else
- if (think[x][y]==1) {dir=3;} else
- if (think[x-1][y]==1) {dir=1;}
- else {y++;}
- }
- if (dir==3)
- {
- if (x==0) {end=1;} else
- if (think[x-1][y]==1) {dir=0;} else
- if (think[x-1][y-1]==1) {dir=2;}
- else {x--;}
- }
- if ((x>30)||(y>20)||(y<0)||(y<0))
- {
- printf("ERROR: x or y out of range in function hidden, quitting now.\n");
- free_memory();
- exit(1);
- }
- }
- out.x=x;
- out.y=y;
- out.dir=dir;
-
- return(out);
-}
-
void blit_screen()
{
int x,y;
@@ -523,23 +474,23 @@
}
}
for (x=0;x<=10;x++){
- if ((calc_real(x,0,2).x==calc_think(x,0,2).x)
- &&(calc_real(x,0,2).y==calc_think(x,0,2).y)
- &&(calc_real(x,0,2).dir==calc_think(x,0,2).dir))
+ if ((calc_out(real,x,0,2).x==calc_out(think,x,0,2).x)
+ &&(calc_out(real,x,0,2).y==calc_out(think,x,0,2).y)
+ &&(calc_out(real,x,0,2).dir==calc_out(think,x,0,2).dir))
{blit(x*50+75,0,edge1_pic);}
else {blit(x*50+75,0,edge1red_pic);}
}
for (y=0;y<=8;y++){
- if ((calc_real(0,y,1).x==calc_think(0,y,1).x)
- &&(calc_real(0,y,1).y==calc_think(0,y,1).y)
- &&(calc_real(0,y,1).dir==calc_think(0,y,1).dir))
+ if ((calc_out(real,0,y,1).x==calc_out(think,0,y,1).x)
+ &&(calc_out(real,0,y,1).y==calc_out(think,0,y,1).y)
+ &&(calc_out(real,0,y,1).dir==calc_out(think,0,y,1).dir))
{blit(0,y*50+75,edge2_pic);}
else {blit(0,y*50+75,edge2red_pic);}
}
for (x=0;x<=10;x++){
- if ((calc_real(x,9,0).x==calc_think(x,9,0).x)
- &&(calc_real(x,9,0).y==calc_think(x,9,0).y)
- &&(calc_real(x,9,0).dir==calc_think(x,9,0).dir))
+ if ((calc_out(real,x,9,0).x==calc_out(think,x,9,0).x)
+ &&(calc_out(real,x,9,0).y==calc_out(think,x,9,0).y)
+ &&(calc_out(real,x,9,0).dir==calc_out(think,x,9,0).dir))
{blit(x*50+75,562,edge3_pic);}
else {blit(x*50+75,562,edge3red_pic);}
}
@@ -564,63 +515,21 @@
void hidden(int x,int y,int dir) //0=up 1=right 2=down 3=left
{
- int end=0,x_in,y_in,dir_in;
-
- x_in=x;
- y_in=y;
- dir_in=dir;
-
select_shot(x,y,dir,0);
- while (!end)
- {
-// printf("x:%d y:%d dir=%d\n",x,y,dir);
- if (dir==0)
- {
- if (y==0) {end=1;} else
- if (real[x-1][y-1]==1) {dir=1;} else
- if (real[x][y-1]==1) {dir=3;}
- else {y--;}
- }
- if (dir==1)
- {
- if (x==12) {end=1;} else
- if (real[x][y]==1) {dir=0;} else
- if (real[x][y-1]==1) {dir=2;}
- else {x++;}
- }
- if (dir==2)
- {
- if (y==9) {end=1;} else
- if (real[x][y]==1) {dir=3;} else
- if (real[x-1][y]==1) {dir=1;}
- else {y++;}
- }
- if (dir==3)
- {
- if (x==0) {end=1;} else
- if (real[x-1][y]==1) {dir=0;} else
- if (real[x-1][y-1]==1) {dir=2;}
- else {x--;}
- }
- if ((x>30)||(y>20)||(y<0)||(y<0))
- {
- printf("ERROR: x or y out of range in function hidden, quitting now.\n");
- free_memory();
- exit(1);
- }
- }
- if ((x==x_in)&&(y==y_in)&&((dir_in==dir+2)||(dir_in==dir-2)))
+ output out=calc_out(real,x,y,dir);
+
+ if ((out.x==x)&&(out.y==y)&&((dir==out.dir+2)||(dir==out.dir-2)))
{
- select_shot(x,y,dir_in,1);
- select_shot(x,y,dir,0);
- select_shot(x,y,dir,1);
+ select_shot(x,y,dir,1);
+ select_shot(x,y,out.dir,0);
+ select_shot(x,y,out.dir,1);
}
else
{
- select_shot(x,y,dir,0);
+ select_shot(out.x,out.y,out.dir,0);
SDL_Delay(500);
- select_shot(x_in,y_in,dir_in,1);
select_shot(x,y,dir,1);
+ select_shot(out.x,out.y,out.dir,1);
}
}
@@ -646,7 +555,7 @@
void generate_field()
{
- int x,y,crystal_num;
+ int x,y;
for (x=0;x<=10;x++){
for (y=0;y<=8;y++){
@@ -654,9 +563,9 @@
light[x][y]=0;
}
}
- while ((crystal_num>difficulty*3)||(crystal_num<(difficulty-1)*3))
+ for (;;)
{
- crystal_num=0;
+ int crystal_num=0;
srand(level_num);
for (x=0;x<=9;x++){
for (y=0;y<=7;y++){
@@ -669,14 +578,17 @@
if (real[x][y]==1) {crystal_num++;}
}
}
- sprintf(text,"Black-Box: Level #%d",level_num);
if (LevelGiven) {
LevelGiven=0;
break;
}
- level_num=(((unsigned)time(NULL)+SDL_GetTicks())%100000);
+ if (((difficulty-1)*3<=crystal_num)&&(crystal_num<=difficulty*3)) {
+ break;
+ }
+ level_num=(level_num+1)%100000;
// printf("%d\n",crystal_num);
}
+ sprintf(text,"Black-Box: Level #%d",level_num);
for (x=0;x<=10;x++)
{
yline[x]=0;
@@ -801,21 +713,21 @@
int x,y,won=1;
for (x=0;x<=11;x++)
{
- if (calc_real(x,0,2).x!=calc_think(x,0,2).x) {won=0;}
- if (calc_real(x,0,2).y!=calc_think(x,0,2).y) {won=0;}
- if (calc_real(x,0,2).dir!=calc_think(x,0,2).dir) {won=0;}
+ if (calc_out(real,x,0,2).x!=calc_out(think,x,0,2).x) {won=0;}
+ if (calc_out(real,x,0,2).y!=calc_out(think,x,0,2).y) {won=0;}
+ if (calc_out(real,x,0,2).dir!=calc_out(think,x,0,2).dir) {won=0;}
}
for (x=0;x<=11;x++)
{
- if (calc_real(x,9,0).x!=calc_think(x,9,0).x) {won=0;}
- if (calc_real(x,9,0).y!=calc_think(x,9,0).y) {won=0;}
- if (calc_real(x,9,0).dir!=calc_think(x,9,0).dir) {won=0;}
+ if (calc_out(real,x,9,0).x!=calc_out(think,x,9,0).x) {won=0;}
+ if (calc_out(real,x,9,0).y!=calc_out(think,x,9,0).y) {won=0;}
+ if (calc_out(real,x,9,0).dir!=calc_out(think,x,9,0).dir) {won=0;}
}
for (y=0;y<=9;y++)
{
- if (calc_real(0,y,1).x!=calc_think(0,y,1).x) {won=0;}
- if (calc_real(0,y,1).y!=calc_think(0,y,1).y) {won=0;}
- if (calc_real(0,y,1).dir!=calc_think(0,y,1).dir) {won=0;}
+ if (calc_out(real,0,y,1).x!=calc_out(think,0,y,1).x) {won=0;}
+ if (calc_out(real,0,y,1).y!=calc_out(think,0,y,1).y) {won=0;}
+ if (calc_out(real,0,y,1).dir!=calc_out(think,0,y,1).dir) {won=0;}
}
return(won);
}
@@ -985,7 +897,7 @@
main(int argc, char *argv[])
{
- printf("\nBlack-Box version %s, Copyright (C) 2000 Karl Bartel\n",VERSION);
+ printf("\nBlack-Box version %s, Copyright (C) 2000-2008 Karl Bartel\n",VERSION);
printf("Black-Box comes with ABSOLUTELY NO WARRANTY; for details see COPYING'.\n");
printf("This is free software, and you are welcome to redistribute it\n");
printf("under certain conditions.\n");
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org