fillets-ng-1.0.1/0000777000175000017500000000000011632204502010555 500000000000000fillets-ng-1.0.1/NEWS0000644000175000017500000001114311632203633011174 00000000000000Fish Fillets NG - 1.0.1 * Fixed a bug in the last levels. Fish were unable to swim to some places. It happened next to the room border. The bug was introduced in version 0.9.2. Big thanks Radek and Mirek Olsak for discovering it. Fish Fillets NG - 1.0.0 * Dutch spoken dialogs (by Astrid de Wijn and friends). * Disallowed a move, to be consistent with the original Fish Fillets. Pushing of partially supported objects is disallowed. The object has to be supported by a wall or by a fish who isn't directly under it. You could switch back to the less restrictive rules by using "strict_rules=0" config option. Thanks Brian Raiter for reporting the discrepancy. * Provided music looping without fading (by Brian Raiter). Fish Fillets NG - 0.9.3 * Fixed compilation with the newer fribidi-0.19.2. Fish Fillets NG - 0.9.2 * Fixed undefined behavior in the last levels. The outgoing objects could be stopped by an obstacle (thanks Josef Peterka for pointing it out). * Fixed strange background colors on the F10 and F1 screens. SDL-1.2.14 would fix these too. Fish Fillets NG - 0.9.1 * Used sound frequency 44100 to prevent crackles (thanks to Josef Peterka). Fish Fillets NG - 0.9.0 * Level 'linux' (by Mirek Olsak). * Level 'electromagnet' (by Stephan Barth). * Embedded intro video (thanks to Mirek Olsak). * Faster undo (hold -) (thanks to Mirek Olsak). * Redo (hold +). * Czech spoken dialogs for level 'keys' (thanks to Mirek Olsak). * Updated Bulgarian translation (by Damyan Ivanov). * Updated Swedish translation (by Olov Gustavsson). * Enhanced graphics for the NG levels (by Fank Skalicky). Fish Fillets NG - 0.8.1 * Two extra levels (by Stephan Barth and Mirek Olsak). * Added support for translated images (by Leonid Myravjev). * Prevented music restart on undo. * Fixed checking for solvable room before undo saving. * Fixed checking for second dead fish. Fish Fillets NG - 0.8.0 * Undo (on key '-') * Five extra levels (by Mirek Olsak) * Slovenian translation (by Marko Burjek) * Brazilian Portuguese translation (by Ricardo Faria) * Russian translation (by Leonid Myravjev, Maria Antropova, Gregory Bonik) Fish Fillets NG - 0.7.4 * One extra level (by Mirek Olsak) * Bulgarian translation (by Damyan Ivanov) * Swedish translation (by Olov Gustavsson) * Fixed table iterations for lua5.1 Fish Fillets NG - 0.7.3 * Fixed missing n_selected.png. It is not needed any more. Fish Fillets NG - 0.7.2 * Experimental support for RTL texts * Tab/Enter are usable on worldmap * Flags show language tips * Lua is statically linked again Fish Fillets NG - 0.7.1 * Spanish translation * Dutch translation * minor bug fixes (default speech, mingw32 build) Fish Fillets NG - 0.7.0 * Italian translation * Polish translation * correction of English dialogs * step counter color depends on active fish * options menu is refreshed when lang is changed * added menu to choose speech ("cs" or "none") * enabled speech=cs as default * fixed fullscreen on win32 * updated halloffame score (thanks to many) Fish Fillets NG - 0.6.1 * fixed crash with empty lang Fish Fillets NG - 0.6.0 * 24 new levels + final level * better mouse support - see How to Play http://fillets.sourceforge.net/manual.php#mouse * menu tooltips * level help on F1 * hall of fame integration for pedometer * intro.avi as a separate file http://fillets.sourceforge.net/intro.avi * complete French translation * complete German translation * fbcon support * win32 binary package Fish Fillets NG - 0.5.1 * fixed crash in level 'corals' Fish Fillets NG - 0.5.0 * removed libboost dependence * options menu on F10 * 19 new levels * credits * initial German translation * some new options, see man page Fish Fillets NG - 0.4.1 * fixed level wreck crash * fixed pyramid animation, level music music ;) * added man page Fish Fillets NG - 0.4.0 * 19 new levels * French translation * pedometer counts moves * reworked font rendering * F5 key to show/hide level move counter * Shift key for faster game * wavy background * changed install method, see README Fish Fillets NG - 0.3.0 * game world map * save/load (F2/F3) * two new levels * two animated videos * optional controls with spacebar and arrow keys * How to Play manual (http://fillets.sourceforge.net/manual.php) Fish Fillets NG - 0.2.1 * fixed crash on random(0) * changed config directory from $HOME/fillets-ng to $HOME/.fillets-ng Fish Fillets NG - 0.2.0 * 6 playable levels * use keys A, S, D, W to control the small fish and keys J, K, L, I to control the bigger fish * object animations in level * english/czech subtitles, czech dialogs * level music Fish Fillets NG - 0.1.0 * first public release * one playable level fillets-ng-1.0.1/aclocal.m40000644000175000017500000010734711632204472012353 00000000000000# generated automatically by aclocal 1.9.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # 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 # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # 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. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.9.6])]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 7 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 12 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.58])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. # # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories # created by `make install' are always world readable, even if the # installer happens to have an overly restrictive umask (e.g. 077). # This was a mistake. There are at least two reasons why we must not # use `-m 0755': # - it causes special bits like SGID to be ignored, # - it may be too restrictive (some setups expect 775 directories). # # Do not use -m 0755 and let people choose whatever they expect by # setting umask. # # We cannot accept any implementation of `mkdir' that recognizes `-p'. # Some implementations (such as Solaris 8's) are not thread-safe: if a # parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' # concurrently, both version can detect that a/ is missing, but only # one can create it and the other will error out. Consequently we # restrict ourselves to GNU make (using the --version option ensures # this.) AC_DEFUN([AM_PROG_MKDIR_P], [if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi AC_SUBST([mkdir_p])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([sdl.m4]) fillets-ng-1.0.1/COPYING0000644000175000017500000004312110702117635011534 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. fillets-ng-1.0.1/install-sh0000755000175000017500000001440610702117635012511 00000000000000#!/bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: chmodcmd="" else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 fillets-ng-1.0.1/mkinstalldirs0000755000175000017500000000132210702117635013304 00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr fi fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here fillets-ng-1.0.1/config.guess0000755000175000017500000012706110707444443013034 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-07-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # 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., 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 # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa:Linux:*:*) echo xtensa-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: fillets-ng-1.0.1/configure0000755000175000017500000061256611632204473012427 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.67. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software # Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= PACKAGE_URL= ac_unique_file="AUTHORS" ac_subst_vars='LTLIBOBJS LIBOBJS HAVE_WINDRES_FALSE HAVE_WINDRES_TRUE WINDRES BOOST_LIBS BOOST_CFLAGS WITH_BOOST_FALSE WITH_BOOST_TRUE X_LIBS SDL_LIBS SDL_CFLAGS SDL_CONFIG LUA_LIBS LUA_CFLAGS LUACONFIG FRIBIDI_LIBS FRIBIDI_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_os target_vendor target_cpu target host_os host_vendor host_cpu host build_os build_vendor build_cpu build target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking with_lua with_sdl_prefix with_sdl_exec_prefix enable_sdltest with_X with_boost enable_debug ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR FRIBIDI_CFLAGS FRIBIDI_LIBS LUA_CFLAGS LUA_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-sdltest Do not try to compile and run a test SDL program --enable-debug Print debug messages Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-lua=PFX Prefix where Lua is installed --with-sdl-prefix=PFX Prefix where SDL is installed (optional) --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional) --with-x enable X window manager support [default=detect] --with-boost=PFX Prefix where boost is installed Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path FRIBIDI_CFLAGS C compiler flags for FRIBIDI, overriding pkg-config FRIBIDI_LIBS linker flags for FRIBIDI, overriding pkg-config LUA_CFLAGS C compiler flags for LUA, overriding pkg-config LUA_LIBS linker flags for LUA, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} as_fn_set_status $ac_retval } # ac_fn_cxx_try_link cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5 ; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; *) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' set x $ac_cv_target shift target_cpu=$1 target_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: target_os=$* IFS=$ac_save_IFS case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- # The AM_INIT_AUTOMAKE macro tells automake the name and version number # of the software package so it can generate rules for building a source # archive. am__api_version="1.9" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then # We used to keeping the `.' as first argument, in order to # allow $(mkdir_p) to be used without argument. As in # $(mkdir_p) $(somedir) # where $(somedir) is conditionally defined. However this is wrong # for two reasons: # 1. if the package is installed by a user who cannot write `.' # make install will fail, # 2. the above comment should most certainly read # $(mkdir_p) $(DESTDIR)$(somedir) # so it does not work when $(somedir) is undefined and # $(DESTDIR) is not. # To support the latter case, we have to write # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir), # so the `.' trick is pointless. mkdir_p='mkdir -p --' else # On NextStep and OpenStep, the `mkdir' command does not # recognize any option. It will interpret all options as # directories to create, and then abort because `.' already # exists. for d in ./-p ./--version; do test -d $d && rmdir $d done # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. if test -f "$ac_aux_dir/mkinstalldirs"; then mkdir_p='$(mkinstalldirs)' else mkdir_p='$(install_sh) -d' fi fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE=fillets-ng VERSION=1.0.1 cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' # Checks for programs. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ################################################### # Check for libm { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 $as_echo_n "checking for sin in -lm... " >&6; } if test "${ac_cv_lib_m_sin+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sin (); int main () { return sin (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_sin=yes else ac_cv_lib_m_sin=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 $as_echo "$ac_cv_lib_m_sin" >&6; } if test "x$ac_cv_lib_m_sin" = x""yes; then : LIBS="$LIBS -lm" fi ################################################### # Test FriBidi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FRIBIDI" >&5 $as_echo_n "checking for FRIBIDI... " >&6; } if test -n "$FRIBIDI_CFLAGS"; then pkg_cv_FRIBIDI_CFLAGS="$FRIBIDI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fribidi\""; } >&5 ($PKG_CONFIG --exists --print-errors "fribidi") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FRIBIDI_CFLAGS=`$PKG_CONFIG --cflags "fribidi" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$FRIBIDI_LIBS"; then pkg_cv_FRIBIDI_LIBS="$FRIBIDI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"fribidi\""; } >&5 ($PKG_CONFIG --exists --print-errors "fribidi") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_FRIBIDI_LIBS=`$PKG_CONFIG --libs "fribidi" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "fribidi" 2>&1` else FRIBIDI_PKG_ERRORS=`$PKG_CONFIG --print-errors "fribidi" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$FRIBIDI_PKG_ERRORS" >&5 have_fribidi="no" elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_fribidi="no" else FRIBIDI_CFLAGS=$pkg_cv_FRIBIDI_CFLAGS FRIBIDI_LIBS=$pkg_cv_FRIBIDI_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } have_fribidi="yes" fi if test "x$have_fribidi" = xyes; then $as_echo "#define HAVE_FRIBIDI 1" >>confdefs.h fi ################################################### # Check for lua and define LUA_CFLAGS and LUA_LIBS # Check whether --with-lua was given. if test "${with_lua+set}" = set; then : withval=$with_lua; LUAPFX="$withval" else LUAPFX="" fi if test "x$LUAPFX" != x ; then LUA_CFLAGS="-I$LUAPFX" LUA_LIBS="-L$LUAPFX -llua -llualib" else for ac_prog in lua-config lua-config50 lua-config5.0 do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LUACONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$LUACONFIG"; then ac_cv_prog_LUACONFIG="$LUACONFIG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LUACONFIG="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LUACONFIG=$ac_cv_prog_LUACONFIG if test -n "$LUACONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LUACONFIG" >&5 $as_echo "$LUACONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LUACONFIG" && break done test -n "$LUACONFIG" || LUACONFIG="""" if test "x$LUACONFIG" != x; then LUA_CFLAGS="`$LUACONFIG --include`" LUA_LIBS="`$LUACONFIG --static`" else pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LUA" >&5 $as_echo_n "checking for LUA... " >&6; } if test -n "$LUA_CFLAGS"; then pkg_cv_LUA_CFLAGS="$LUA_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 ($PKG_CONFIG --exists --print-errors "lua") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LUA_CFLAGS=`$PKG_CONFIG --cflags "lua" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$LUA_LIBS"; then pkg_cv_LUA_LIBS="$LUA_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"lua\""; } >&5 ($PKG_CONFIG --exists --print-errors "lua") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_LUA_LIBS=`$PKG_CONFIG --libs "lua" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then LUA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "lua" 2>&1` else LUA_PKG_ERRORS=`$PKG_CONFIG --print-errors "lua" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LUA_PKG_ERRORS" >&5 LUA_CFLAGS="" LUA_LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua_setfenv in -llua" >&5 $as_echo_n "checking for lua_setfenv in -llua... " >&6; } if test "${ac_cv_lib_lua_lua_setfenv+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llua $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lua_setfenv (); int main () { return lua_setfenv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lua_lua_setfenv=yes else ac_cv_lib_lua_lua_setfenv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lua_lua_setfenv" >&5 $as_echo "$ac_cv_lib_lua_lua_setfenv" >&6; } if test "x$ac_cv_lib_lua_lua_setfenv" = x""yes; then : LUA_LIBS="$LUA_LIBS -llua" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua_setfenv in -llua50" >&5 $as_echo_n "checking for lua_setfenv in -llua50... " >&6; } if test "${ac_cv_lib_lua50_lua_setfenv+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llua50 $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lua_setfenv (); int main () { return lua_setfenv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lua50_lua_setfenv=yes else ac_cv_lib_lua50_lua_setfenv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lua50_lua_setfenv" >&5 $as_echo "$ac_cv_lib_lua50_lua_setfenv" >&6; } if test "x$ac_cv_lib_lua50_lua_setfenv" = x""yes; then : LUA_LIBS="$LUA_LIBS -llua50" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua_setfenv in -llua5.0" >&5 $as_echo_n "checking for lua_setfenv in -llua5.0... " >&6; } if test "${ac_cv_lib_lua5_0_lua_setfenv+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llua5.0 $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lua_setfenv (); int main () { return lua_setfenv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lua5_0_lua_setfenv=yes else ac_cv_lib_lua5_0_lua_setfenv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lua5_0_lua_setfenv" >&5 $as_echo "$ac_cv_lib_lua5_0_lua_setfenv" >&6; } if test "x$ac_cv_lib_lua5_0_lua_setfenv" = x""yes; then : LUA_LIBS="$LUA_LIBS -llua5.0" else as_fn_error $? "*** Lua5 is required. Try --with-lua=PREFIX You can download lua from http://www.lua.org" "$LINENO" 5 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaopen_base in -llualib" >&5 $as_echo_n "checking for luaopen_base in -llualib... " >&6; } if test "${ac_cv_lib_lualib_luaopen_base+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llualib $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char luaopen_base (); int main () { return luaopen_base (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lualib_luaopen_base=yes else ac_cv_lib_lualib_luaopen_base=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lualib_luaopen_base" >&5 $as_echo "$ac_cv_lib_lualib_luaopen_base" >&6; } if test "x$ac_cv_lib_lualib_luaopen_base" = x""yes; then : LUA_LIBS="$LUA_LIBS -llualib" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaopen_base in -llualib50" >&5 $as_echo_n "checking for luaopen_base in -llualib50... " >&6; } if test "${ac_cv_lib_lualib50_luaopen_base+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llualib50 $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char luaopen_base (); int main () { return luaopen_base (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lualib50_luaopen_base=yes else ac_cv_lib_lualib50_luaopen_base=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lualib50_luaopen_base" >&5 $as_echo "$ac_cv_lib_lualib50_luaopen_base" >&6; } if test "x$ac_cv_lib_lualib50_luaopen_base" = x""yes; then : LUA_LIBS="$LUA_LIBS -llualib50" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaopen_base in -llualib5.0" >&5 $as_echo_n "checking for luaopen_base in -llualib5.0... " >&6; } if test "${ac_cv_lib_lualib5_0_luaopen_base+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llualib5.0 $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char luaopen_base (); int main () { return luaopen_base (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lualib5_0_luaopen_base=yes else ac_cv_lib_lualib5_0_luaopen_base=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lualib5_0_luaopen_base" >&5 $as_echo "$ac_cv_lib_lualib5_0_luaopen_base" >&6; } if test "x$ac_cv_lib_lualib5_0_luaopen_base" = x""yes; then : LUA_LIBS="$LUA_LIBS -llualib5.0" else as_fn_error $? "*** Lualib5 is required. You can download lua from http://www.lua.org" "$LINENO" 5 fi fi fi elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } LUA_CFLAGS="" LUA_LIBS="" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua_setfenv in -llua" >&5 $as_echo_n "checking for lua_setfenv in -llua... " >&6; } if test "${ac_cv_lib_lua_lua_setfenv+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llua $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lua_setfenv (); int main () { return lua_setfenv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lua_lua_setfenv=yes else ac_cv_lib_lua_lua_setfenv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lua_lua_setfenv" >&5 $as_echo "$ac_cv_lib_lua_lua_setfenv" >&6; } if test "x$ac_cv_lib_lua_lua_setfenv" = x""yes; then : LUA_LIBS="$LUA_LIBS -llua" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua_setfenv in -llua50" >&5 $as_echo_n "checking for lua_setfenv in -llua50... " >&6; } if test "${ac_cv_lib_lua50_lua_setfenv+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llua50 $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lua_setfenv (); int main () { return lua_setfenv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lua50_lua_setfenv=yes else ac_cv_lib_lua50_lua_setfenv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lua50_lua_setfenv" >&5 $as_echo "$ac_cv_lib_lua50_lua_setfenv" >&6; } if test "x$ac_cv_lib_lua50_lua_setfenv" = x""yes; then : LUA_LIBS="$LUA_LIBS -llua50" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lua_setfenv in -llua5.0" >&5 $as_echo_n "checking for lua_setfenv in -llua5.0... " >&6; } if test "${ac_cv_lib_lua5_0_lua_setfenv+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llua5.0 $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char lua_setfenv (); int main () { return lua_setfenv (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lua5_0_lua_setfenv=yes else ac_cv_lib_lua5_0_lua_setfenv=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lua5_0_lua_setfenv" >&5 $as_echo "$ac_cv_lib_lua5_0_lua_setfenv" >&6; } if test "x$ac_cv_lib_lua5_0_lua_setfenv" = x""yes; then : LUA_LIBS="$LUA_LIBS -llua5.0" else as_fn_error $? "*** Lua5 is required. Try --with-lua=PREFIX You can download lua from http://www.lua.org" "$LINENO" 5 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaopen_base in -llualib" >&5 $as_echo_n "checking for luaopen_base in -llualib... " >&6; } if test "${ac_cv_lib_lualib_luaopen_base+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llualib $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char luaopen_base (); int main () { return luaopen_base (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lualib_luaopen_base=yes else ac_cv_lib_lualib_luaopen_base=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lualib_luaopen_base" >&5 $as_echo "$ac_cv_lib_lualib_luaopen_base" >&6; } if test "x$ac_cv_lib_lualib_luaopen_base" = x""yes; then : LUA_LIBS="$LUA_LIBS -llualib" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaopen_base in -llualib50" >&5 $as_echo_n "checking for luaopen_base in -llualib50... " >&6; } if test "${ac_cv_lib_lualib50_luaopen_base+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llualib50 $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char luaopen_base (); int main () { return luaopen_base (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lualib50_luaopen_base=yes else ac_cv_lib_lualib50_luaopen_base=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lualib50_luaopen_base" >&5 $as_echo "$ac_cv_lib_lualib50_luaopen_base" >&6; } if test "x$ac_cv_lib_lualib50_luaopen_base" = x""yes; then : LUA_LIBS="$LUA_LIBS -llualib50" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for luaopen_base in -llualib5.0" >&5 $as_echo_n "checking for luaopen_base in -llualib5.0... " >&6; } if test "${ac_cv_lib_lualib5_0_luaopen_base+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llualib5.0 $LUA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char luaopen_base (); int main () { return luaopen_base (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lualib5_0_luaopen_base=yes else ac_cv_lib_lualib5_0_luaopen_base=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lualib5_0_luaopen_base" >&5 $as_echo "$ac_cv_lib_lualib5_0_luaopen_base" >&6; } if test "x$ac_cv_lib_lualib5_0_luaopen_base" = x""yes; then : LUA_LIBS="$LUA_LIBS -llualib5.0" else as_fn_error $? "*** Lualib5 is required. You can download lua from http://www.lua.org" "$LINENO" 5 fi fi fi else LUA_CFLAGS=$pkg_cv_LUA_CFLAGS LUA_LIBS=$pkg_cv_LUA_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi fi ################################################### # Check for SDL, and define SDL_CFLAGS and SDL_LIBS SDL_VERSION=1.2.0 # Check whether --with-sdl-prefix was given. if test "${with_sdl_prefix+set}" = set; then : withval=$with_sdl_prefix; sdl_prefix="$withval" else sdl_prefix="" fi # Check whether --with-sdl-exec-prefix was given. if test "${with_sdl_exec_prefix+set}" = set; then : withval=$with_sdl_exec_prefix; sdl_exec_prefix="$withval" else sdl_exec_prefix="" fi # Check whether --enable-sdltest was given. if test "${enable_sdltest+set}" = set; then : enableval=$enable_sdltest; else enable_sdltest=yes fi 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 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 fi PATH="$prefix/bin:$prefix/usr/bin:$PATH" # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SDL_CONFIG+set}" = set; then : $as_echo_n "(cached) " >&6 else case $SDL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no" ;; esac fi SDL_CONFIG=$ac_cv_path_SDL_CONFIG if test -n "$SDL_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SDL_CONFIG" >&5 $as_echo "$SDL_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi min_sdl_version=$SDL_VERSION { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SDL - version >= $min_sdl_version" >&5 $as_echo_n "checking for SDL - version >= $min_sdl_version... " >&6; } 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_major_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` sdl_minor_version=`$SDL_CONFIG $sdl_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_LIBS="$LIBS" CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" rm -f conf.sdltest if test "$cross_compiling" = yes; then : echo $ac_n "cross compiling; assumed OK... $ac_c" else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include "SDL.h" char* my_strdup (char *str) { char *new_str; if (str) { new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main (int argc, char *argv[]) { int major, minor, micro; char *tmp_version; /* This hangs on some systems (?) system ("touch conf.sdltest"); */ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_sdl_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_sdl_version"); exit(1); } if (($sdl_major_version > major) || (($sdl_major_version == major) && ($sdl_minor_version > minor)) || (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) { return 0; } else { printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); printf("*** to point to the correct copy of sdl-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else no_sdl=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sdl" = x ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } : else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$SDL_CONFIG" = "no" ; then echo "*** The sdl-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SDL_CONFIG environment variable to the" echo "*** full path to sdl-config." else if test -f conf.sdltest ; then : else echo "*** Could not run SDL test program, checking why..." CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include "SDL.h" int main(int argc, char *argv[]) { return 0; } #undef main #define main K_and_R_C_main int main () { return 0; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SDL or finding the wrong" echo "*** version of SDL. If it is not finding SDL, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" 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" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi SDL_CFLAGS="" SDL_LIBS="" as_fn_error $? "*** library SDL-devel version $SDL_VERSION not found!" "$LINENO" 5 fi rm -f conf.sdltest ################################################### # Checks for C libraries. # SDL_mixer { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mix_OpenAudio in -lSDL_mixer" >&5 $as_echo_n "checking for Mix_OpenAudio in -lSDL_mixer... " >&6; } if test "${ac_cv_lib_SDL_mixer_Mix_OpenAudio+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lSDL_mixer $SDL_CFLAGS $SDL_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char Mix_OpenAudio (); int main () { return Mix_OpenAudio (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_SDL_mixer_Mix_OpenAudio=yes else ac_cv_lib_SDL_mixer_Mix_OpenAudio=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_mixer_Mix_OpenAudio" >&5 $as_echo "$ac_cv_lib_SDL_mixer_Mix_OpenAudio" >&6; } if test "x$ac_cv_lib_SDL_mixer_Mix_OpenAudio" = x""yes; then : SDL_LIBS="-lSDL_mixer $SDL_LIBS" else as_fn_error $? "*** SDL_mixer-devel library not found!" "$LINENO" 5 fi # SDL_image { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IMG_Load in -lSDL_image" >&5 $as_echo_n "checking for IMG_Load in -lSDL_image... " >&6; } if test "${ac_cv_lib_SDL_image_IMG_Load+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lSDL_image $SDL_CFLAGS $SDL_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IMG_Load (); int main () { return IMG_Load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_SDL_image_IMG_Load=yes else ac_cv_lib_SDL_image_IMG_Load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_image_IMG_Load" >&5 $as_echo "$ac_cv_lib_SDL_image_IMG_Load" >&6; } if test "x$ac_cv_lib_SDL_image_IMG_Load" = x""yes; then : SDL_LIBS="-lSDL_image $SDL_LIBS" else as_fn_error $? "*** SDL_image-devel library not found!" "$LINENO" 5 fi # SDL_ttf { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TTF_OpenFont in -lSDL_ttf" >&5 $as_echo_n "checking for TTF_OpenFont in -lSDL_ttf... " >&6; } if test "${ac_cv_lib_SDL_ttf_TTF_OpenFont+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lSDL_ttf $SDL_CFLAGS $SDL_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char TTF_OpenFont (); int main () { return TTF_OpenFont (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_SDL_ttf_TTF_OpenFont=yes else ac_cv_lib_SDL_ttf_TTF_OpenFont=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_SDL_ttf_TTF_OpenFont" >&5 $as_echo "$ac_cv_lib_SDL_ttf_TTF_OpenFont" >&6; } if test "x$ac_cv_lib_SDL_ttf_TTF_OpenFont" = x""yes; then : SDL_LIBS="-lSDL_ttf $SDL_LIBS" else as_fn_error $? "*** SDL_ttf-devel library not found!" "$LINENO" 5 fi ################################################### # Test X11 X_LIBS="" have_x11="no" # Check whether --with-X was given. if test "${with_X+set}" = set; then : withval=$with_X; with_x11=$withval else with_x11="maybe" fi if test "x$with_x11" != "xno" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Xutf8TextListToTextProperty in -lX11" >&5 $as_echo_n "checking for Xutf8TextListToTextProperty in -lX11... " >&6; } if test "${ac_cv_lib_X11_Xutf8TextListToTextProperty+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char Xutf8TextListToTextProperty (); int main () { return Xutf8TextListToTextProperty (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_Xutf8TextListToTextProperty=yes else ac_cv_lib_X11_Xutf8TextListToTextProperty=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_Xutf8TextListToTextProperty" >&5 $as_echo "$ac_cv_lib_X11_Xutf8TextListToTextProperty" >&6; } if test "x$ac_cv_lib_X11_Xutf8TextListToTextProperty" = x""yes; then : with_x11="yes" else with_x11="no" fi if test "x$with_x11" != "xno" ; then OLD_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $SDL_CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "SDL.h" #include "SDL_syswm.h" #include int main () { SDL_SysWMinfo info; info.subsystem = SDL_SYSWM_X11; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : have_x11="yes" else have_x11="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CPPFLAGS="$OLD_CPPFLAGS" if test "x$have_x11" = xyes; then $as_echo "#define HAVE_X11 1" >>confdefs.h X_LIBS="-lX11" fi fi fi ################################################### # enable C++ language ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ################################################### # Checks for C++ libraries. # boost_filesystem, only need for nonPOSIX systems # Check whether --with-boost was given. if test "${with_boost+set}" = set; then : withval=$with_boost; BOOSTPFX="$withval" else BOOSTPFX="" fi if test "x$BOOSTPFX" != x ; then BOOST_LIBS="-lboost_filesystem" if test "x$BOOSTPFX" != xyes ; then BOOST_CFLAGS="-I$BOOSTPFX" BOOST_LIBS="-L$BOOSTPFX $BOOST_LIBS" fi fi if test "x$BOOSTPFX" != x; then WITH_BOOST_TRUE= WITH_BOOST_FALSE='#' else WITH_BOOST_TRUE='#' WITH_BOOST_FALSE= fi ################################################### # Check for SMPEG { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SMPEG_new in -lsmpeg" >&5 $as_echo_n "checking for SMPEG_new in -lsmpeg... " >&6; } if test "${ac_cv_lib_smpeg_SMPEG_new+set}" = set; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsmpeg $SDL_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char SMPEG_new (); int main () { return SMPEG_new (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_smpeg_SMPEG_new=yes else ac_cv_lib_smpeg_SMPEG_new=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smpeg_SMPEG_new" >&5 $as_echo "$ac_cv_lib_smpeg_SMPEG_new" >&6; } if test "x$ac_cv_lib_smpeg_SMPEG_new" = x""yes; then : have_smpeg="yes" else have_smpeg="no" fi if test "x$have_smpeg" = xyes; then SDL_LIBS="-lsmpeg $SDL_LIBS" $as_echo "#define HAVE_SMPEG 1" >>confdefs.h fi ################################################### # Check for windres for win32 icon. case "$target" in *-mingw32*) for ac_prog in i386-mingw32msvc-windres i586-mingw32msvc-windres do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_WINDRES+set}" = set; then : $as_echo_n "(cached) " >&6 else if test -n "$WINDRES"; then ac_cv_prog_WINDRES="$WINDRES" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_WINDRES="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi WINDRES=$ac_cv_prog_WINDRES if test -n "$WINDRES"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WINDRES" >&5 $as_echo "$WINDRES" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$WINDRES" && break done test -n "$WINDRES" || WINDRES="""" if test "x$WINDRES" != x; then HAVE_WINDRES_TRUE= HAVE_WINDRES_FALSE='#' else HAVE_WINDRES_TRUE='#' HAVE_WINDRES_FALSE= fi have_windres="yes" ;; *) WINDRES="" if false; then HAVE_WINDRES_TRUE= HAVE_WINDRES_FALSE='#' else HAVE_WINDRES_TRUE='#' HAVE_WINDRES_FALSE= fi have_windres="no" ;; esac ################################################### # Mung up datadir if need be if test "${datadir}" = '${datarootdir}' ; then datadir='${datarootdir}/games/${PACKAGE}' fi ################################################### # Debug on/off # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; case "${enableval}" in yes) debug=true ;; no) debug=false ;; *) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;; esac else debug=false fi CXXFLAGS="$CXXFLAGS -Wall -W -Wpointer-arith -Wcast-qual \ -Wcast-align -Woverloaded-virtual \ -Wconversion -Wshadow" if test "x$debug" = "xtrue"; then CXXFLAGS="$CXXFLAGS -pedantic -ansi -pipe -g3 -O0" fi ################################################### ac_config_files="$ac_config_files Makefile src/Makefile src/SDL_gfx/Makefile src/gengine/Makefile src/effect/Makefile src/widget/Makefile src/plan/Makefile src/option/Makefile src/state/Makefile src/level/Makefile src/menu/Makefile src/game/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_BOOST_TRUE}" && test -z "${WITH_BOOST_FALSE}"; then as_fn_error $? "conditional \"WITH_BOOST\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_WINDRES_TRUE}" && test -z "${HAVE_WINDRES_FALSE}"; then as_fn_error $? "conditional \"HAVE_WINDRES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_WINDRES_TRUE}" && test -z "${HAVE_WINDRES_FALSE}"; then as_fn_error $? "conditional \"HAVE_WINDRES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in #( -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by $as_me, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/SDL_gfx/Makefile") CONFIG_FILES="$CONFIG_FILES src/SDL_gfx/Makefile" ;; "src/gengine/Makefile") CONFIG_FILES="$CONFIG_FILES src/gengine/Makefile" ;; "src/effect/Makefile") CONFIG_FILES="$CONFIG_FILES src/effect/Makefile" ;; "src/widget/Makefile") CONFIG_FILES="$CONFIG_FILES src/widget/Makefile" ;; "src/plan/Makefile") CONFIG_FILES="$CONFIG_FILES src/plan/Makefile" ;; "src/option/Makefile") CONFIG_FILES="$CONFIG_FILES src/option/Makefile" ;; "src/state/Makefile") CONFIG_FILES="$CONFIG_FILES src/state/Makefile" ;; "src/level/Makefile") CONFIG_FILES="$CONFIG_FILES src/level/Makefile" ;; "src/menu/Makefile") CONFIG_FILES="$CONFIG_FILES src/menu/Makefile" ;; "src/game/Makefile") CONFIG_FILES="$CONFIG_FILES src/game/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # So let's grep whole file. if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: Fish Fillets NG are now configured. Checked components: X11=$have_x11, WINDRES=$have_windres, FRIBIDI=$have_fribidi, SMPEG=$have_smpeg You can now run make. " >&5 $as_echo " Fish Fillets NG are now configured. Checked components: X11=$have_x11, WINDRES=$have_windres, FRIBIDI=$have_fribidi, SMPEG=$have_smpeg You can now run make. " >&6; } fillets-ng-1.0.1/configure.in0000644000175000017500000001557311632202416013017 00000000000000# Process this file with autoconf to produce a configure script. AC_INIT(AUTHORS) AC_CANONICAL_TARGET # The AM_INIT_AUTOMAKE macro tells automake the name and version number # of the software package so it can generate rules for building a source # archive. AM_INIT_AUTOMAKE(fillets-ng, 1.0.1) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB ################################################### # Check for libm AC_CHECK_LIB(m, sin, LIBS="$LIBS -lm") ################################################### # Test FriBidi PKG_CHECK_MODULES(FRIBIDI, fribidi, [have_fribidi="yes"], [have_fribidi="no"]) AC_SUBST(FRIBIDI_CFLAGS) AC_SUBST(FRIBIDI_LIBS) if test "x$have_fribidi" = xyes; then AC_DEFINE(HAVE_FRIBIDI) fi ################################################### # Check for lua and define LUA_CFLAGS and LUA_LIBS dnl ---- lua check ------------- (stolen from Stratagus) AC_ARG_WITH(lua, [ --with-lua=PFX Prefix where Lua is installed], LUAPFX="$withval", LUAPFX="") if test "x$LUAPFX" != x ; then LUA_CFLAGS="-I$LUAPFX" LUA_LIBS="-L$LUAPFX -llua -llualib" else dnl Debian, and possibly other systems, include this script... AC_CHECK_PROGS(LUACONFIG, [lua-config lua-config50 lua-config5.0], "") if test "x$LUACONFIG" != x; then LUA_CFLAGS="`[$LUACONFIG --include]`" LUA_LIBS="`[$LUACONFIG --static]`" else dnl ...otherwise, attempt to guess PKG_CHECK_MODULES(LUA, lua, [], [ LUA_CFLAGS="" LUA_LIBS="" AC_CHECK_LIB(lua, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua", [AC_CHECK_LIB(lua50, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua50", [AC_CHECK_LIB(lua5.0, lua_setfenv, LUA_LIBS="$LUA_LIBS -llua5.0", [AC_MSG_ERROR([*** Lua5 is required. Try --with-lua=PREFIX You can download lua from http://www.lua.org])], $LUA_LIBS)], $LUA_LIBS)], $LUA_LIBS) AC_CHECK_LIB(lualib, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib", [AC_CHECK_LIB(lualib50, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib50", [AC_CHECK_LIB(lualib5.0, luaopen_base, LUA_LIBS="$LUA_LIBS -llualib5.0", [AC_MSG_ERROR([*** Lualib5 is required. You can download lua from http://www.lua.org])], $LUA_LIBS)], $LUA_LIBS)], $LUA_LIBS) ]) fi fi AC_SUBST(LUA_CFLAGS) AC_SUBST(LUA_LIBS) dnl ---- end of lua check ------ ################################################### # Check for SDL, and define SDL_CFLAGS and SDL_LIBS SDL_VERSION=1.2.0 AM_PATH_SDL($SDL_VERSION, :, [AC_MSG_ERROR([*** library SDL-devel version $SDL_VERSION not found!])] ) ################################################### # Checks for C libraries. # SDL_mixer AC_CHECK_LIB([SDL_mixer], [Mix_OpenAudio], SDL_LIBS="-lSDL_mixer $SDL_LIBS", [AC_MSG_ERROR([*** SDL_mixer-devel library not found!])], $SDL_CFLAGS $SDL_LIBS ) # SDL_image AC_CHECK_LIB([SDL_image], [IMG_Load], SDL_LIBS="-lSDL_image $SDL_LIBS", [AC_MSG_ERROR([*** SDL_image-devel library not found!])], $SDL_CFLAGS $SDL_LIBS ) # SDL_ttf AC_CHECK_LIB([SDL_ttf], [TTF_OpenFont], SDL_LIBS="-lSDL_ttf $SDL_LIBS", [AC_MSG_ERROR([*** SDL_ttf-devel library not found!])], $SDL_CFLAGS $SDL_LIBS ) ################################################### # Test X11 X_LIBS="" have_x11="no" AC_ARG_WITH(X, [AC_HELP_STRING([--with-x],[enable X window manager support [default=detect]])], [with_x11=$withval],[with_x11="maybe"]) if test "x$with_x11" != "xno" ; then AC_CHECK_LIB([X11], [Xutf8TextListToTextProperty], [with_x11="yes"], [with_x11="no"]) if test "x$with_x11" != "xno" ; then OLD_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $SDL_CFLAGS" AC_TRY_COMPILE([ #include "SDL.h" #include "SDL_syswm.h" #include ], [ SDL_SysWMinfo info; info.subsystem = SDL_SYSWM_X11; ], [have_x11="yes"], [have_x11="no"]) CPPFLAGS="$OLD_CPPFLAGS" if test "x$have_x11" = xyes; then AC_DEFINE(HAVE_X11) X_LIBS="-lX11" fi fi fi AC_SUBST(X_LIBS) ################################################### # enable C++ language AC_LANG(C++) ################################################### # Checks for C++ libraries. # boost_filesystem, only need for nonPOSIX systems AC_ARG_WITH(boost, [ --with-boost=PFX Prefix where boost is installed], BOOSTPFX="$withval", BOOSTPFX="") if test "x$BOOSTPFX" != x ; then BOOST_LIBS="-lboost_filesystem" if test "x$BOOSTPFX" != xyes ; then BOOST_CFLAGS="-I$BOOSTPFX" BOOST_LIBS="-L$BOOSTPFX $BOOST_LIBS" fi fi AM_CONDITIONAL(WITH_BOOST, test "x$BOOSTPFX" != x) AC_SUBST(BOOST_CFLAGS) AC_SUBST(BOOST_LIBS) ################################################### # Check for SMPEG AC_CHECK_LIB([smpeg], [SMPEG_new], [have_smpeg="yes"], [have_smpeg="no"], $SDL_LIBS) if test "x$have_smpeg" = xyes; then SDL_LIBS="-lsmpeg $SDL_LIBS" AC_DEFINE(HAVE_SMPEG) fi ################################################### # Check for windres for win32 icon. case "$target" in *-mingw32*) AC_CHECK_PROGS(WINDRES, [i386-mingw32msvc-windres i586-mingw32msvc-windres], "") AM_CONDITIONAL(HAVE_WINDRES, test "x$WINDRES" != x) AC_SUBST(WINDRES) have_windres="yes" ;; *) WINDRES="" AM_CONDITIONAL(HAVE_WINDRES, false) have_windres="no" ;; esac ################################################### # Mung up datadir if need be if test "${datadir}" = '${datarootdir}' ; then datadir='${datarootdir}/games/${PACKAGE}' fi ################################################### # Debug on/off AC_ARG_ENABLE(debug, [ --enable-debug Print debug messages], [case "${enableval}" in yes) debug=true ;; no) debug=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; esac],[debug=false] ) CXXFLAGS="$CXXFLAGS -Wall -W -Wpointer-arith -Wcast-qual \ -Wcast-align -Woverloaded-virtual \ -Wconversion -Wshadow" if test "x$debug" = "xtrue"; then CXXFLAGS="$CXXFLAGS -pedantic -ansi -pipe -g3 -O0" fi ################################################### AC_OUTPUT([ Makefile src/Makefile src/SDL_gfx/Makefile src/gengine/Makefile src/effect/Makefile src/widget/Makefile src/plan/Makefile src/option/Makefile src/state/Makefile src/level/Makefile src/menu/Makefile src/game/Makefile ]) AC_MSG_RESULT([ Fish Fillets NG are now configured. Checked components: X11=$have_x11, WINDRES=$have_windres, FRIBIDI=$have_fribidi, SMPEG=$have_smpeg You can now run make. ]) fillets-ng-1.0.1/ltmain.sh0000755000175000017500000073341511632204471012336 00000000000000# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6b # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" TIMESTAMP="" package_revision=1.3017 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/bin/grep -E"} : ${FGREP="/bin/grep -F"} : ${GREP="/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/bin/sed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "X$my_tmpdir" | $Xsed } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $ECHO "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done $ECHO $ECHO "If you ever happen to want to link against installed libraries" $ECHO "in a given directory, LIBDIR, you must either use libtool, and" $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" $ECHO "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" $ECHO " during execution" fi if test -n "$runpath_var"; then $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" $ECHO " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $ECHO $ECHO "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" $ECHO "pages." ;; *) $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper_part2 # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # Path separators are also converted from $build format to # $host format. If ARG begins or ends with a path separator # character, it is preserved (but converted to $host format) # on output. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because the file extensions .$libext of this argument makes me believe" $ECHO "*** that it is just a static archive that I should not use here." else $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $ECHO $ECHO "*** And there doesn't seem to be a static archive available" $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $ECHO "*** But as you try to build a module library, libtool will still create " $ECHO "*** a static module, that should work as long as the dlopening application" $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type \`$version_type'" ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $ECHO $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" $ECHO "*** a static module, that should work as long as the dlopening" $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $ECHO "*** The inter-library dependencies that have been dropped here will be" $ECHO "*** automatically added whenever a program is linked with this library" $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $ECHO $ECHO "*** Since this library must not contain undefined symbols," $ECHO "*** because either the platform does not support them or" $ECHO "*** it was explicitly requested with -no-undefined," $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" $ECHO 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 fillets-ng-1.0.1/Makefile.in0000644000175000017500000005021511632204473012550 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ ChangeLog INSTALL NEWS TODO config.guess config.sub depcomp \ install-sh ltmain.sh missing mkinstalldirs subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno configure.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive man6dir = $(mandir)/man6 am__installdirs = "$(DESTDIR)$(man6dir)" NROFF = nroff MANS = $(man_MANS) ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SUBDIRS = src man_MANS = fillets.6 EXTRA_DIST = ChangeLog $(man_MANS) all: all-recursive .SUFFIXES: am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ cd $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) uninstall-info-am: install-man6: $(man6_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man6dir)" || $(mkdir_p) "$(DESTDIR)$(man6dir)" @list='$(man6_MANS) $(dist_man6_MANS) $(nodist_man6_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.6*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 6*) ;; \ *) ext='6' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man6dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man6dir)/$$inst"; \ done uninstall-man6: @$(NORMAL_UNINSTALL) @list='$(man6_MANS) $(dist_man6_MANS) $(nodist_man6_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.6*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 6*) ;; \ *) ext='6' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man6dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man6dir)/$$inst"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man6dir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man install-exec-am: install-info: install-info-recursive install-man: install-man6 installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-man uninstall-info: uninstall-info-recursive uninstall-man: uninstall-man6 .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ check-am clean clean-generic clean-recursive ctags \ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-generic \ distclean-recursive distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-man6 install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-recursive \ mostlyclean mostlyclean-generic mostlyclean-recursive pdf \ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-info-am uninstall-man uninstall-man6 ChangeLog: touch ChangeLog # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/missing0000755000175000017500000002540611341557373012115 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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 # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # 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., 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 # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi 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 ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' 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 help2man touch the output file 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] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; 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 $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." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ 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." touch configure ;; autoheader) echo 1>&2 "\ 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." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ 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." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | 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 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` 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' $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 eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ 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 eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ 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 touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ 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." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... 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 # 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 "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ 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 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 ;; 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: fillets-ng-1.0.1/ChangeLog0000644000175000017500000031102311632204471012250 000000000000002011-09-08 20:21 fidlej * AUTHORS, NEWS, configure.in: Preparing fillets 1.0.1. 2011-08-26 23:12 fidlej * src/level/: Room.cpp, Rules.cpp, Rules.h: Fixed unmasking from old locations (thanks Radek and Mirek Olsak for finding the problem). 2010-12-23 16:10 fidlej * NEWS, configure.in: Preparing 1.0.0 release. 2010-10-26 21:04 fidlej * src/gengine/OptionAgent.cpp: Fixed a possible strlen(NULL) bug (thanks to SandySandy). 2010-07-25 11:56 fidlej * NEWS: Started to prepare new NEWS. 2010-07-25 11:03 fidlej * src/game/Application.cpp: Renamed leaning objects to partially supported objects. 2010-07-25 00:08 fidlej * src/level/: MarkMask.cpp, MarkMask.h, Rules.cpp, Rules.h: Implemented the exact strict logic. 2010-07-24 13:10 fidlej * src/game/: Application.cpp, GameAgent.cpp, GameAgent.h: Allowed to replay a level from the command line. 2010-07-24 12:01 fidlej * src/game/Application.cpp: Mentioned the used default. 2010-07-23 22:47 fidlej * src/: game/Application.cpp, level/Rules.cpp: Used the strict rules by default. 2010-05-17 09:02 fidlej * src/menu/WorldBranch.cpp: Allowed to use a newer worldfame.lua (thanks to Brian Raiter). 2010-05-16 15:22 fidlej * src/gengine/: Makefile.am, SDLMusicLooper.cpp, SDLMusicLooper.h, SDLSoundAgent.cpp, SDLSoundAgent.h: Allowed music looping without fading (by Brian Raiter). 2010-02-25 21:38 fidlej * NEWS, configure.in: Preparing 0.9.3. 2010-02-25 21:13 fidlej * src/effect/Font.cpp: Used the generic fribidi_charset_to_unicode(). 2009-12-02 18:28 asmbsd * AUTHORS: Changed email. 2009-10-16 22:56 fidlej * NEWS: Fixed English grammar. 2009-10-16 19:41 fidlej * NEWS, configure.in: Preparing 0.9.2. 2009-10-15 23:54 fidlej * src/: option/MenuHelp.cpp, option/MenuOptions.cpp, widget/Slider.cpp: The SDL_SetAlpha with alpha 128 is broken in the Jaunty version of SDL. 2009-10-15 22:14 fidlej * src/game/Application.cpp: Allowed to flush output from init.lua. 2009-10-13 20:41 fidlej * src/level/: Cube.cpp, Cube.h, MarkMask.cpp, Rules.cpp: Made the outgoing object unmovable for other movements. 2009-10-11 21:44 fidlej * src/level/Rules.cpp: Used undo-safer code. 2009-10-11 20:59 fidlej * src/level/: Cube.h, MarkMask.cpp, MarkMask.h, Rules.cpp, Rules.h: Allowed an object to push other objects out when they should also go out (thanks Josef Peterka for spotting the bug). 2009-07-03 20:41 fidlej * NEWS, configure.in: Preparing 0.9.1. 2009-07-03 11:07 fidlej * src/: game/Application.cpp, gengine/SDLSoundAgent.cpp: Used sound_frequency=44100 by default. 2009-06-14 19:09 fidlej * configure.in: Prevented the SDL_main() when checking for smpeg. 2009-06-12 13:38 fidlej * src/: game/Application.cpp, gengine/ResImagePack.cpp, gengine/ResImagePack.h: Allowed to disable the image cache (use cache_images=false). 2009-06-07 20:34 fidlej * README-binary: Updated README. 2009-06-07 20:33 fidlej * NEWS, README, configure.in: Updated NEWS. 2009-06-07 19:57 fidlej * src/: level/Level.cpp, plan/StateManager.cpp: Stopped undoing when leaving the level state. 2009-06-07 18:55 fidlej * src/level/Level.cpp: Renamed forceSave to keepLast. 2009-06-07 09:44 fidlej * src/level/: Level.cpp: Used simpler code. 2009-06-07 09:43 fidlej * src/level/Level.cpp: Updated a comment. 2009-06-07 08:22 fidlej * src/level/LevelInput.cpp: Disabled F3 and undo when showing a demo. 2009-06-07 08:15 fidlej * src/level/Level.cpp: Killed talks when undoing. 2009-06-07 08:08 fidlej * src/level/Level.cpp: Prevent level finishing when undoing. 2009-06-07 00:11 fidlej * src/level/: Anim.cpp, Level.cpp, Level.h, LevelScript.cpp, Room.cpp, Room.h, StatusDisplay.cpp, game-script.cpp, game-script.h, level-script.cpp: Allowed to get the bg. 2009-06-06 23:16 fidlej * src/gengine/ResImagePack.cpp: Fixed grammar typo. 2009-06-06 22:11 fidlej * src/level/Anim.cpp: It is not needed to save special anims. They don't survive a round. 2009-06-06 21:56 fidlej * src/level/: Anim.cpp: Restored the full anim state. 2009-06-06 21:47 fidlej * src/level/: Anim.cpp, Anim.h, game-script.cpp: Restored the basic anim state. 2009-06-06 21:02 fidlej * src/level/: Anim.h, game-script.cpp: Restored model anim effects when undoing. 2009-06-06 20:50 fidlej * src/: effect/EffectDisintegrate.cpp, effect/EffectDisintegrate.h, effect/EffectInvisible.h, effect/EffectMirror.cpp, effect/EffectMirror.h, effect/EffectNone.cpp, effect/EffectNone.h, effect/EffectReverse.cpp, effect/EffectReverse.h, effect/EffectZx.cpp, effect/EffectZx.h, effect/ViewEffect.h, level/game-script.cpp: Named the visual effects. 2009-06-06 20:17 fidlej * src/: gengine/Random.cpp, level/Cube.cpp, level/Cube.h, level/Rules.h, level/game-script.cpp: Prevented shifted drawing of previously falling objects when undoing. 2009-06-06 19:00 fidlej * src/: gengine/InputAgent.cpp, gengine/InputHandler.h, level/Level.cpp, level/Level.h, level/LevelInput.cpp, level/LevelInput.h: Allowed to hold the undo key. 2009-06-05 18:20 fidlej * src/level/Level.cpp: Allowed to compare the current state with the saved undo. 2009-06-05 09:34 fidlej * src/level/Level.cpp: Moved the seenByScript condition into the script. 2009-06-05 00:28 fidlej * src/level/Level.cpp: Calling saveUndo() whenever possible. 2009-06-04 22:01 fidlej * src/level/: Level.cpp, Level.h, LevelInput.cpp, LevelInput.h, level-script.cpp: Prepared redo on key +. 2009-05-31 15:57 fidlej * src/level/: Controls.cpp, Level.cpp, Level.h, Room.h: Forced undo save after a dangerous move (thanks to Mirek Olsak). 2009-05-30 19:06 fidlej * configure.in: Moved SMPEG check under C++ tests. 2009-05-23 22:13 fidlej * TODO, src/menu/NodeDrawer.cpp, src/menu/Pedometer.cpp, src/menu/WorldMap.cpp: Updated TODO. 2009-05-23 19:32 fidlej * src/state/: MovieState.cpp, MovieState.h: Exited from the intro state at its end. 2009-05-23 14:58 fidlej * src/state/Makefile.am: Fixed a path in a Makefile.am. 2009-05-23 14:35 fidlej * configure.in, src/gengine/SDLSoundAgent.cpp, src/gengine/SDLSoundAgent.h, src/gengine/SoundAgent.cpp, src/gengine/SoundAgent.h, src/menu/WorldMap.cpp, src/plan/StateManager.cpp, src/state/Makefile.am, src/state/MovieState.cpp, src/state/MovieState.h, src/state/SDL_Movie.h: Used SMPEG to play the intro movie (thanks Mirek Olsak for hints). 2009-05-22 18:38 fidlej * src/level/Level.cpp: Incremented the delay for autorestart. The smrt-m-obe dialog needed a bit longer time. 2009-05-22 18:24 fidlej * src/: effect/ResColorPack.h, gengine/Makefile.am, gengine/ResCache.h, gengine/ResDialogPack.h, gengine/ResImagePack.cpp, gengine/ResImagePack.h, gengine/ResSoundPack.h, gengine/ResourcePack.h: Used caching of images. 2009-05-11 21:05 fidlej * src/SDL_gfx/: Makefile.am, SDL_rotozoom.c, SDL_rotozoom.h: Removed SDL_rotozoom until its needed. 2009-04-09 14:23 asmbsd * src/SDL_gfx/: Makefile.am, SDL_rotozoom.c, SDL_rotozoom.h: Add rotozoom functions from SDL-gfx. 2009-04-09 11:34 asmbsd * src/gengine/InputAgent.cpp: Release button on SDL_MOUSEBUTTONUP event. 2009-01-14 13:46 fidlej * src/gengine/: Path.cpp, Path.h, ResImagePack.cpp, ResImagePack.h: Moved localized path construction into Path.cpp. 2009-01-14 10:51 fidlej * src/gengine/Path.cpp: Reverted Path.cpp. 2009-01-14 10:48 fidlej * src/gengine/ResImagePack.cpp: Forgotten to commit __ format. 2009-01-14 02:14 asmbsd * src/gengine/: Path.cpp, ResImagePack.cpp: Fix img error. 2009-01-13 23:00 fidlej * src/gengine/ResImagePack.cpp: Fixed check for valid dot pos. 2009-01-13 22:46 fidlej * src/gengine/: ResImagePack.cpp, ResImagePack.h: Added search for localized images. 2009-01-03 00:24 fidlej * README-binary: Added README for binary downloads. 2009-01-03 00:12 fidlej * NEWS, configure.in: Updated NEWS. 2009-01-01 13:19 fidlej * src/gengine/VideoAgent.cpp: Added fallback to windowed mode when the required resolution is too big for fullscreen. 2008-12-29 11:45 fidlej * src/gengine/: OptionAgent.cpp, OptionParams.cpp, OptionParams.h: Accepted just valid options. 2008-12-25 23:45 fidlej * src/level/Level.cpp: Fixed checking for solvable room before undo saving. 2008-12-25 22:18 fidlej * src/level/Rules.cpp: Fixed checking for second dead fish. 2008-12-25 20:06 fidlej * src/level/: ShapeBuilder.cpp, ShapeBuilder.h: Based a shape color on the shape. 2008-12-25 19:20 fidlej * src/level/: ShapeBuilder.cpp, ShapeBuilder.h: Moved color selection into prepareColor(). 2008-12-25 18:54 fidlej * src/: effect/SurfaceTool.cpp, effect/SurfaceTool.h, level/Anim.cpp, level/Anim.h, level/Makefile.am, level/ShapeBuilder.cpp, level/ShapeBuilder.h, level/game-script.cpp: Allowed to use empty image path to get a shape based image. 2008-01-02 23:43 fidlej * src/: gengine/OptionAgent.cpp, gengine/StringTool.cpp, level/Landslip.cpp: Fixed missing includes. 2007-12-28 21:27 fidlej * src/: gengine/SDLSoundAgent.cpp, gengine/SDLSoundAgent.h, level/Level.cpp: Prevented music restart on undo. 2007-12-22 00:55 fidlej * AUTHORS: Updated AUTHORS. 2007-12-22 00:53 fidlej * README: Updated README. 2007-12-21 23:36 fidlej * fillets.6: Updated man page. 2007-12-21 23:26 fidlej * NEWS, configure.in: Preparing release 0.8. 2007-12-21 23:25 fidlej * src/: level/Controls.cpp, plan/ConsoleInput.cpp: Replaced std::string.push_back() with append() (for BeOS). 2007-12-15 17:25 fidlej * NEWS: Fixed NEWS. 2007-12-15 17:20 fidlej * NEWS: Updated NEWS. 2007-12-15 17:09 fidlej * NEWS, configure.in: Prepared release-0_8_0-pre2. 2007-12-15 14:31 fidlej * src/level/: Controls.cpp, Controls.h, Level.cpp, StepCounter.h, Unit.cpp, Unit.h: Undo is saved before every move down. 2007-12-09 19:41 fidlej * src/level/: Level.cpp, Level.h: Simplified undo saving. 2007-12-09 18:26 fidlej * src/level/Level.cpp: Fixed force undo save. 2007-12-09 17:59 fidlej * src/level/Level.cpp: Fixed saving of state to the correct moves. 2007-12-01 17:39 fidlej * src/level/: Cube.cpp, game-script.cpp: Optimized undo saving for normal models. 2007-12-01 16:31 fidlej * src/level/: Controls.cpp, Controls.h, Level.cpp, Rules.h, StepCounter.h, Unit.cpp: Saved only pushing and every 10th undo. 2007-10-21 13:49 fidlej * NEWS, configure.in: Preparing 0.8.0-pre1 release. 2007-09-28 23:29 fidlej * src/level/Rules.cpp: Fixed support for nowall moving stars. 2007-09-28 22:55 fidlej * src/level/: Cube.cpp, Cube.h, LevelScript.cpp, game-script.cpp, game-script.h: Added support to save extra parameters. 2007-09-28 20:55 fidlej * src/level/: Controls.cpp, Controls.h, Level.cpp, Unit.cpp, Unit.h: Last moving fish is activated after undo. 2007-09-28 20:01 fidlej * src/level/: Level.cpp, Rules.cpp: Fixed undo when a fish is out. 2007-09-28 18:08 fidlej * src/level/: Controls.h, Cube.h, Field.cpp, Field.h, Level.cpp, Level.h, LevelInput.cpp, LevelInput.h, LevelLoading.h, LevelScript.cpp, MarkMask.cpp, MarkMask.h, Room.cpp, Room.h, Rules.cpp, Rules.h, game-script.cpp, game-script.h: Provided undo on key minus. 2007-09-28 18:06 fidlej * src/level/LevelCountDown.cpp: Fixed English. 2007-09-28 18:03 fidlej * src/effect/EffectMirror.cpp: Fixed English. 2007-06-30 17:31 fidlej * src/plan/Title.cpp: Proper UTF-8 length calculation. 2007-06-30 17:04 fidlej * src/gengine/: Dialog.cpp, StringTool.cpp, StringTool.h: Fixed dialog duration (thanks to Gregory Bonik and Egmont Koblinger). 2007-06-30 16:50 fidlej * NEWS: Used sentences without dots. 2006-12-20 23:18 fidlej * configure.in: More informative have_x11. 2006-12-17 23:02 fidlej * NEWS: Updated news by Swedish translation. 2006-12-17 22:25 fidlej * AUTHORS: Added new translators. 2006-12-10 23:09 fidlej * configure.in: First PKG_CHECK_MODULES has to be unconditioned. 2006-12-10 19:30 fidlej * src/level/: Level.cpp, Rules.cpp, game-script.cpp: Fixed typos in comments. 2006-12-10 19:29 fidlej * NEWS, configure.in: Preparing 0.7.4 release. 2006-09-20 22:52 fidlej * Makefile.cvs, configure.in, src/game/Makefile.am, src/gengine/Makefile.am: Applied patch from Mike Frysinger: - autogen-makefile: copy files, don't symlink them - check-for-X: if you use X funcs, you need to link against them - no-local-paths: the compiler should be handling local paths ... forcing these flags can easily break cross-compilers - use-lua-pkg-config: newer lua's install a lua.pc so as a fall back, lets use that if we can't find lua ourselves - custom-datadir: allow people to override the location of datafiles by specifying --datadir to the configure script 2006-02-12 13:15 fidlej * src/: SDL_gfx/SDL_gfxPrimitives.c, SDL_gfx/SDL_gfxPrimitives.h, game/Application.cpp, gengine/OptionAgent.cpp, gengine/ScriptAgent.cpp, gengine/ScriptAgent.h: Debug console now could use file_include(). 2006-01-05 23:31 fidlej * src/effect/Font.cpp: ISO C++ does not allow to create array with run-time dependent length. 2005-10-04 20:10 fidlej * NEWS, configure.in: Prepared bug fix release 0.7.3 2005-10-04 20:09 fidlej * src/menu/NodeDrawer.cpp: Image n_selected.png is not needed any more. 2005-10-03 21:43 fidlej * NEWS: Updated NEWS. 2005-10-02 22:50 fidlej * NEWS, configure.in: Version 0.7.2 with RTL support. 2005-10-02 21:51 fidlej * configure.in, src/effect/Font.cpp: LibLua should be statically linked. 2005-09-28 22:21 fidlej * configure.in, src/effect/Font.cpp, src/effect/Font.h, src/effect/Makefile.am, src/game/Makefile.am, src/level/Makefile.am, src/menu/Makefile.am, src/option/Makefile.am, src/plan/Makefile.am, src/state/Makefile.am, src/widget/Makefile.am: Library FriBidi is used for RTL texts. 2005-09-03 10:01 fidlej * TODO: Beos is already working. 2005-08-21 23:23 fidlej * src/: option/SelectLang.cpp, widget/WiBox.cpp: Added language tooltips over the flags. 2005-08-21 00:32 fidlej * src/: game/Application.cpp, gengine/V2.h, menu/LevelNode.cpp, menu/LevelNode.h, menu/NodeDrawer.cpp, menu/NodeDrawer.h, menu/WorldInput.cpp, menu/WorldInput.h, menu/WorldMap.cpp, menu/WorldMap.h, plan/Title.cpp: Unsolved nodes can be selected by pressing TAB. 2005-07-16 16:21 fidlej * src/: SDL_gfx/.cvsignore, game/.cvsignore: Added .cvsignore. 2005-07-16 16:15 fidlej * NEWS: Preparing 0.7.1 release. 2005-07-14 23:23 fidlej * configure.in: Fixed configure.in for mingw32 (thanks Toth Marton). 2005-07-06 20:50 fidlej * src/: gengine/ScriptState.cpp, menu/WorldMap.cpp: Fixed usage of garbage. 2005-07-02 20:49 fidlej * AUTHORS: Added Cesar and Astrid to the Credits. 2005-06-28 22:50 fidlej * src/menu/WorldMap.cpp: Fixed Cancel button for Ending level. 2005-06-28 22:00 fidlej * src/: effect/Font.cpp, effect/Outline.cpp, option/MenuOptions.cpp: Fixed default speech=cs. 2005-04-18 17:08 fidlej * AUTHORS, fillets.6: Added Przemek Bojczuk as Polish translator. 2005-04-17 14:23 fidlej * README: Fillets-data contains czech dialogs as well. 2005-04-17 13:44 fidlej * NEWS, TODO, configure.in: Preparation for 0.7 release. 2005-03-13 09:32 fidlej * src/gengine/Environ.cpp: Added warning about bad numeric value. 2005-03-13 03:28 fidlej * src/: game/Application.cpp, gengine/Environ.cpp, gengine/Environ.h, gengine/OptionAgent.cpp, gengine/OptionAgent.h, gengine/ResSoundPack.cpp, gengine/VideoAgent.cpp, level/Room.cpp, level/StepDecor.cpp, plan/StateInput.cpp, plan/SubTitleAgent.cpp: User can enter 1/0, true/false, on/off, yes/no as boolean value. 2005-03-12 12:20 fidlej * src/option/: MenuOptions.cpp, SelectLang.h: Added new icons to the menu options. 2005-03-12 10:27 fidlej * AUTHORS: Added Simone to the AUTHORS. 2005-01-29 11:05 fidlej * src/gengine/: OptionParams.h, ResDialogPack.cpp: Some cleaning. 2005-01-19 05:14 fidlej * src/: gengine/ResDialogPack.cpp, plan/dialog-script.cpp, state/DemoMode.cpp: Improved doc comments. 2004-12-07 19:20 fidlej * src/: effect/Picture.cpp, effect/Picture.h, gengine/BaseListener.cpp, gengine/BaseListener.h, gengine/Environ.cpp, gengine/Environ.h, gengine/OptionAgent.cpp, gengine/OptionAgent.h, menu/Pedometer.cpp, menu/Pedometer.h, option/MenuOptions.cpp, plan/GameState.cpp: Texts below pedometer are refreshed too. 2004-12-07 08:03 fidlej * src/: option/MenuOptions.cpp, option/MenuOptions.h, plan/GameState.cpp, plan/GameState.h: Options menu is refreshed when lang is changed. 2004-11-30 04:20 fidlej * src/: level/LevelStatus.cpp, level/LevelStatus.h, menu/SolverDrawer.cpp: Added state solver_equals -- as good as the best. 2004-11-19 00:18 fidlej * src/level/: Controls.cpp, Controls.h, Level.cpp, LevelCountDown.cpp, Room.cpp, Room.h, StepCounter.h, StepDecor.cpp, Unit.cpp, Unit.h: Step counter color depends on power of active fish. 2004-11-18 23:40 fidlej * src/: game/GameAgent.cpp, gengine/VideoAgent.cpp, gengine/VideoAgent.h: Fullscreen should toggle straight off. 2004-11-15 00:36 fidlej * Makefile.cvs: Fixed aclocal search directory. 2004-11-11 23:53 fidlej * src/option/MenuOptions.cpp: Added comment about speech menu. 2004-11-11 23:52 fidlej * src/: gengine/Dialog.h, gengine/DialogStack.cpp, gengine/ResDialogPack.cpp, gengine/ResDialogPack.h, option/MenuOptions.cpp, option/MenuOptions.h, option/SelectLang.cpp, option/SelectLang.h: Added menu to choose 'speech'. 2004-11-11 23:03 mrpaja * NEWS: NEWS update 2004-11-11 22:29 fidlej * NEWS: 0.7.0 is not realeased yet. 2004-10-19 19:55 fidlej * src/: effect/Font.cpp, menu/LevelNode.cpp: SDL_RLEACCEL is not much usefull in rendered text. 2004-10-19 19:55 fidlej * src/level/Controls.cpp: Fixed case of level with no fish. 2004-10-15 23:20 mrpaja * TODO: support for theora 2004-10-15 23:12 mrpaja * NEWS: 0.6.1 release 2004-10-15 16:41 fidlej * configure.in: Version 0.6.2 2004-10-14 21:30 fidlej * TODO: Fillets are working on MacOS X, see http://www.toast442.org/fillets 2004-10-14 21:17 fidlej * src/game/: Makefile.am, fillets.rc: Specified icon as preload. 2004-10-14 17:59 fidlej * TODO, configure.in, src/game/Makefile.am, src/game/fillets.ico, src/game/fillets.rc: Added win32 icon resource. 2004-10-12 02:53 fidlej * configure.in: Enhanced X11 checking. 2004-10-11 22:44 mrpaja * NEWS: Mac OS X support 2004-10-11 20:59 fidlej * src/gengine/VideoAgent.cpp: Removed unused code. 2004-10-11 19:43 fidlej * src/gengine/SysVideo.cpp: X11 can be available on MacOSX but not used. 2004-10-11 02:03 mrpaja * NEWS: formatting fix 2004-10-10 01:05 fidlej * configure.in, src/game/main.cpp, src/gengine/Name.cpp, src/gengine/VideoAgent.h: Preparing fillets-ng 0.6.0 2004-10-09 02:53 fidlej * Makefile.am: Removed doxygen from Makefile targets. 2004-10-08 21:33 fidlej * configure.in: Preparing 0.6.0rc3. 2004-10-08 21:30 fidlej * src/: gengine/Makefile.am, gengine/MessagerAgent.cpp, gengine/NewPtr.cpp, gengine/NewPtr.h, gengine/Object.h, level/Cube.h, level/LevelScript.cpp, level/Unit.h: std::auto_ptr is used instead of NewPtr. 2004-10-03 23:03 fidlej * src/level/Controls.cpp: Fixed fish switching. 2004-10-03 21:48 fidlej * configure.in: Fixed bug in lua checking. 2004-10-03 18:26 mrpaja * NEWS: NEWS update 2004-10-03 01:08 fidlej * configure.in: Preparing RC2. 2004-10-03 00:12 fidlej * configure.in: Less pedantic configure.in 2004-10-02 23:08 mrpaja * TODO: TODO update 2004-10-02 22:42 mrpaja * fillets.6: man page update 2004-10-02 22:36 mrpaja * TODO: TODO update 2004-10-02 21:56 fidlej * TODO: Updated TODO. 2004-10-02 21:52 mrpaja * NEWS: NEWS update 2004-10-02 19:58 fidlej * src/menu/WorldMap.cpp: Added text message to devel Intro. 2004-09-29 14:20 fidlej * src/gengine/VideoAgent.cpp: Fixed invisible cursor on FullScreen. 2004-09-29 14:11 fidlej * src/gengine/VideoAgent.cpp: Fixed invisible cursor on FullScreen. 2004-09-28 04:43 fidlej * configure.in, src/plan/Title.h: More strict ISO C++. 2004-09-28 04:15 fidlej * src/gengine/VideoAgent.cpp: Nicer code for getVideoFlags. 2004-09-27 21:08 fidlej * README, TODO: Preparing release-0_6_0rc1. 2004-09-27 20:32 fidlej * src/: effect/EffectZx.cpp, effect/EffectZx.h, gengine/OptionParams.cpp, gengine/OptionParams.h: Fixed iso c++ errors. 2004-09-27 20:14 fidlej * configure.in, src/gengine/SysVideo.cpp: SDL_syswm.h is not included when not needed. 2004-09-27 18:34 fidlej * src/gengine/SysVideo.cpp: Removed debug message. 2004-09-27 18:13 fidlej * src/gengine/: OptionAgent.cpp, SysVideo.cpp: Fixed empty $HOME. 2004-09-27 16:38 fidlej * src/gengine/SysVideo.cpp: UTF-8 window title for WIN32. 2004-09-27 12:27 fidlej * src/SDL_gfx/: Makefile.am, SDL_gfxPrimitives.h: Removed SDL_gfxPrimitives_font. 2004-09-27 03:17 fidlej * src/gengine/: InputAgent.cpp, InputHandler.cpp, InputHandler.h, InputProvider.h: Fixed state of mouse buttons. 2004-09-27 02:42 fidlej * src/gengine/: InputAgent.cpp, InputAgent.h, VideoAgent.cpp: Mouse cursor is placed in the middle of new window. 2004-09-27 01:59 fidlej * src/: effect/Font.cpp, gengine/FsPath.cpp, gengine/InputHandler.cpp, gengine/InputHandler.h, gengine/MouseStroke.h, gengine/Path.cpp, level/LevelInput.cpp, level/LevelInput.h, option/HelpInput.cpp, option/HelpInput.h, plan/StateInput.cpp, plan/StateInput.h: Fixed uninitialized mouse buttons. 2004-09-27 00:34 fidlej * src/: SDL_gfx/SDL_gfxPrimitives.c, SDL_gfx/SDL_gfxPrimitives.h, SDL_gfx/SDL_gfxPrimitives_font.h, gengine/FsPath.cpp: Fixed SDL_gfx for mingw. 2004-09-26 14:42 fidlej * src/option/MenuOptions.cpp: Smaller font for menu statusbar. 2004-09-26 14:37 fidlej * src/: effect/Font.cpp, menu/SolverDrawer.cpp, option/MenuHelp.cpp, option/MenuHelp.h, widget/Makefile.am, widget/WiPara.cpp, widget/WiPara.h: Implemented multi line paragraph. 2004-09-25 23:35 fidlej * src/: level/FinderAlg.cpp, menu/WorldMap.cpp: Fixed usage of 'and' operator. 2004-09-25 22:34 fidlej * src/gengine/DialogStack.h: Fixed missing include. 2004-09-25 18:24 fidlej * src/: gengine/Dialog.cpp, gengine/Dialog.h, gengine/DialogStack.cpp, gengine/InputHandler.h, gengine/PlannedDialog.cpp, gengine/PlannedDialog.h, gengine/ResDialogPack.cpp, gengine/ResDialogPack.h, gengine/ResourcePack.h, level/Controls.cpp, menu/WorldMap.cpp, option/MenuOptions.cpp, option/MenuOptions.h, state/DemoInput.h, widget/IWidget.cpp, widget/IWidget.h, widget/Labels.cpp, widget/Labels.h, widget/Makefile.am, widget/WiBox.cpp, widget/WiBox.h, widget/WiStatusBar.cpp, widget/WiStatusBar.h: Implemented menu tooltips. 2004-09-25 15:20 fidlej * src/: level/LevelStatus.cpp, menu/PedoInput.cpp, menu/PedoInput.h, menu/WorldInput.h: Help is only enabled in level. 2004-09-25 14:34 fidlej * configure.in, fillets.6: Updated man page. 2004-09-25 04:09 fidlej * src/level/Level.cpp: unwanted mouse press will not move a fish 2004-09-25 03:15 fidlej * src/: level/LevelInput.cpp, level/LevelInput.h, menu/Labels.cpp, menu/Labels.h, menu/Makefile.am, option/HelpInput.cpp, option/HelpInput.h, option/Makefile.am, option/MenuHelp.cpp, option/MenuHelp.h, plan/Makefile.am, plan/StateInput.cpp, plan/StateInput.h, state/DemoInput.cpp, state/GameInput.cpp, state/GameInput.h, widget/Labels.cpp, widget/Labels.h, widget/Makefile.am: Implemented real help screen. Use F1 and translate script/labels.lua. 2004-09-25 01:00 fidlej * src/: game/Application.cpp, game/GameAgent.cpp, menu/WorldBranch.cpp, menu/WorldBranch.h, menu/WorldMap.cpp, menu/WorldMap.h, menu/worldmap-script.cpp, menu/worldmap-script.h: Only 'worldmap' parameter is needed for extra levels. 2004-09-24 22:57 fidlej * src/level/: LevelScript.cpp, Room.cpp, Room.h, game-script.cpp, game-script.h: Implemented setFastFalling() for script. 2004-09-24 20:33 fidlej * src/menu/SolverDrawer.cpp: Reformated solution info. 2004-09-24 19:26 fidlej * src/: menu/SolverDrawer.cpp, widget/VBox.cpp, widget/VBox.h: Solver info is centered. 2004-09-24 19:08 fidlej * src/: effect/Font.cpp, effect/Font.h, gengine/ResourcePack.h, level/LevelStatus.cpp, level/LevelStatus.h, menu/Labels.cpp, menu/Labels.h, menu/Makefile.am, menu/Pedometer.cpp, menu/SolverDrawer.cpp, menu/SolverDrawer.h, menu/WorldMap.cpp, plan/SubTitleAgent.cpp, plan/SubTitleAgent.h, widget/Makefile.am, widget/WiButton.h, widget/WiLabel.cpp, widget/WiLabel.h, widget/WiPicture.h: Info about the best solver is under pedometer. 2004-09-24 16:09 fidlej * src/: gengine/Makefile.am, gengine/ScriptState.cpp, gengine/ScriptState.h, gengine/Scripter.cpp, gengine/Scripter.h, gengine/def-script.cpp, gengine/def-script.h, gengine/options-script.cpp, level/LevelStatus.cpp, level/LevelStatus.h, level/MouseControl.cpp, level/Room.cpp, level/game-script.cpp, level/level-script.cpp, menu/LevelNode.cpp, menu/LevelNode.h, menu/WorldBranch.cpp, menu/WorldBranch.h, menu/WorldMap.cpp, menu/WorldMap.h, menu/worldmap-script.cpp, option/SelectLang.cpp, option/SelectLang.h, plan/Planner.cpp, plan/Planner.h, plan/dialog-script.cpp, plan/dialog-script.h, state/demo-script.cpp: Wrapped script leader as Scripter. 2004-09-14 16:48 fidlej * src/level/: LevelScript.cpp, Rules.cpp, Rules.h, game-script.cpp, game-script.h: New script function model_getTouchDir(). 'touched' state was removed. 2004-09-14 15:51 fidlej * src/level/: Field.cpp, Rules.cpp, Rules.h: Implemented state 'touched' for touched but not pushed objects. 2004-09-12 13:51 fidlej * src/menu/WorldMap.cpp: Ending is only shown after a final level. 2004-09-10 22:27 fidlej * src/: gengine/DialogStack.h, level/CountAdvisor.h, level/Level.cpp, level/Level.h, level/LevelCountDown.cpp, level/LevelCountDown.h, level/Makefile.am: Shorted countdown when the is no sound. 2004-09-10 21:13 fidlej * src/: level/Level.cpp, level/Level.h, level/LevelCountDown.cpp, level/LevelCountDown.h, level/LevelStatus.cpp, level/LevelStatus.h, level/Makefile.am, level/RoomAccess.cpp, level/RoomAccess.h, level/level-script.cpp, menu/Pedometer.cpp: Reworked level countdown. 2004-09-10 16:51 fidlej * src/: gengine/InputAgent.cpp, gengine/InputAgent.h, gengine/InputHandler.cpp, gengine/InputHandler.h, gengine/InputProvider.h, gengine/Makefile.am, level/Controls.cpp, level/Controls.h, level/Field.h, level/FinderAlg.cpp, level/FinderAlg.h, level/FinderField.cpp, level/FinderField.h, level/FinderPlace.h, level/Makefile.am, level/MarkMask.cpp, level/MarkMask.h, level/MouseControl.cpp, level/MouseControl.h, level/Room.cpp, level/Room.h, level/Rules.cpp, level/Rules.h, level/Unit.cpp, level/Unit.h: Implemented mouse controls. Press left or right mouse button. 2004-09-10 16:45 fidlej * src/menu/WorldMap.cpp: Fixed case when ending is not present. 2004-09-10 00:59 fidlej * src/: gengine/V2.h, level/Controls.cpp, level/Controls.h, level/Level.cpp, level/Level.h, level/LevelInput.cpp, level/LevelInput.h, level/Room.cpp, level/Room.h, level/Unit.cpp, level/Unit.h, level/View.cpp, level/View.h: Mouse click can select fish. 2004-09-09 23:50 fidlej * src/game/GameAgent.cpp: Implemented playtime storing. 2004-09-09 23:01 fidlej * src/menu/: LevelNode.cpp, LevelNode.h, WorldBranch.cpp, WorldBranch.h, WorldMap.cpp, WorldMap.h: Ending node is started when all levels were solved. 2004-09-09 21:42 fidlej * src/: gengine/Makefile.am, gengine/NewPtr.cpp, gengine/NewPtr.h, gengine/Object.h, level/Cube.h, level/LevelScript.cpp, level/Unit.h, menu/Pedometer.cpp, plan/StateManager.cpp: Fixed shutdown. 2004-09-08 23:10 fidlej * src/: gengine/DialogStack.cpp, gengine/DialogStack.h, plan/Planner.cpp, plan/dialog-script.cpp, plan/dialog-script.h: Fixed waiting for dialog end. 2004-09-08 15:33 fidlej * src/state/DemoMode.cpp: Subtitles are scrolling non-stop on final poster. 2004-09-08 01:02 fidlej * src/gengine/: options-script.cpp, options-script.h: Added missing files. 2004-09-08 01:01 fidlej * src/: gengine/Makefile.am, gengine/ScriptAgent.cpp, plan/Planner.cpp: Exported options_getParam() function to the script. 2004-09-07 13:45 fidlej * src/: game/Application.cpp, game/main.cpp, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/DialogStack.cpp, gengine/DialogStack.h, gengine/Makefile.am, gengine/Name.cpp, gengine/Name.h, gengine/ScriptState.cpp, level/Cube.cpp, level/Cube.h, level/Level.cpp, level/Level.h, level/LevelScript.cpp, level/LevelStatus.cpp, level/LevelStatus.h, level/Room.cpp, level/Room.h, level/Rules.cpp, menu/Pedometer.cpp, plan/GameState.cpp, plan/GameState.h, plan/Planner.cpp, plan/Planner.h, plan/StateManager.cpp, plan/SubTitleAgent.cpp, plan/SubTitleAgent.h, plan/Title.cpp, plan/dialog-script.cpp, state/DemoMode.cpp, state/DemoMode.h, state/PosterState.cpp, state/PosterState.h: Implemented scrolling subtitles on final poster. Reworked dialogAgent. 2004-09-06 13:56 fidlej * src/gengine/: def-script.cpp, def-script.h: Reduced number of warning messages. 2004-09-06 13:43 fidlej * src/gengine/: ScriptState.cpp, ScriptState.h, def-script.cpp, def-script.h: Implemented stack traceback. 2004-09-06 01:44 fidlej * src/level/Level.cpp: Exported CODENAME to the script. 2004-09-04 01:15 fidlej * src/: gengine/InputAgent.cpp, gengine/ResourcePack.h, level/Room.cpp: Fixed fullscreen without mouse focus. 2004-09-02 21:13 fidlej * src/level/: LevelScript.cpp, game-script.cpp, game-script.h: Implemented script functions model_countAnims() and model_getDir(). 2004-09-02 18:52 fidlej * src/game/GameAgent.cpp: Fixed typo worlmap/worldmap. 2004-09-02 18:36 fidlej * src/effect/: PixelIterator.cpp, PixelIterator.h: Enhanced pixel iterator. 2004-09-02 18:22 fidlej * src/: effect/WavyPicture.cpp, effect/WavyPicture.h, game/GameAgent.cpp, game/main.cpp, level/Level.cpp, level/Level.h, level/LevelStatus.cpp, level/LevelStatus.h, level/Room.cpp, level/Room.h, level/game-script.cpp, menu/Pedometer.cpp, menu/WorldMap.cpp, plan/StateManager.cpp: Implemented way to play external levels. Use worlmap=level/worldmap.lua worlddesc=level/worlddesc.lua 2004-08-30 18:18 fidlej * src/effect/: PixelIterator.h, PixelTool.cpp: Fixed missing file. 2004-08-30 13:34 fidlej * src/effect/: PixelIterator.cpp, PixelTool.cpp, PixelTool.h: Removed duplicite code. 2004-08-29 22:52 fidlej * src/effect/: EffectZx.cpp, Makefile.am, PixelIterator.cpp, PixelTool.cpp: Implemented PixelIterator for speed. 2004-08-29 21:29 fidlej * configure.in: libm is not on BeOS. 2004-08-29 17:50 fidlej * src/effect/WavyPicture.cpp: Fixed wavy background. 2004-08-29 02:08 fidlej * src/: gengine/def-script.cpp, gengine/def-script.h, level/Anim.cpp, level/Anim.h, level/LevelScript.cpp, level/game-script.cpp, level/game-script.h: Removed ugly model_addDuplexAnim() function from script interface. 2004-08-28 21:31 fidlej * src/: level/Dir.h, level/game-script.cpp, level/game-script.h, state/PosterScroller.cpp, state/PosterScroller.h: Enhanced scrolling poster used for credits. 2004-08-28 12:13 fidlej * src/level/Level.cpp: Added few documentation notes. 2004-08-28 02:38 fidlej * src/level/: Controls.cpp, Controls.h, LevelScript.cpp, Room.cpp, Room.h, game-script.cpp, game-script.h: Reduced anim phases for ex-fishes. 2004-08-27 22:41 fidlej * src/level/Dir.cpp: Fixed missing assert.h 2004-08-27 20:53 fidlej * src/level/: Anim.cpp, Controls.cpp, Controls.h, Cube.cpp, Cube.h, Dir.cpp, Dir.h, Landslip.cpp, Makefile.am, MarkMask.cpp, MarkMask.h, ModelFactory.cpp, ModelFactory.h, OnStack.h, Room.cpp, Rules.cpp, Rules.h, Unit.cpp, View.cpp: Implemented output_DIR for level windoze. 2004-08-25 21:24 fidlej * src/level/: Level.cpp, LevelLoading.cpp, LevelLoading.h: Fixed loading + restart problem. 2004-08-20 23:50 fidlej * src/level/: Level.cpp, Level.h, LevelLoading.h, View.cpp: Loading is paused when menu appears. 2004-08-20 23:36 fidlej * src/effect/: EffectZx.cpp, PixelTool.cpp, PixelTool.h, WavyPicture.cpp: Optimized Zx for speed. 2004-08-20 22:38 fidlej * src/level/: Level.cpp, Level.h, LevelLoading.cpp, LevelLoading.h, LevelScript.cpp, LevelScript.h, Makefile.am, RoomAccess.cpp, RoomAccess.h: Refactorized level loading code. 2004-08-20 20:56 fidlej * configure.in: Removed C specific warning flags. 2004-08-19 17:32 fidlej * src/level/Rules.cpp: Fixed fall propagation, falling object on fish is not on wall. 2004-08-19 16:52 fidlej * src/: gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/InputAgent.cpp, gengine/KeyStroke.cpp, gengine/StringTool.cpp, gengine/StringTool.h, gengine/V2.h, level/Anim.cpp, level/Anim.h, level/Controls.cpp, level/Controls.h, level/Level.cpp, level/MarkMask.cpp, level/MarkMask.h, level/ModelFactory.cpp, level/ModelFactory.h, level/Rules.cpp, level/Rules.h, level/Shape.cpp, level/Shape.h, level/Unit.cpp, level/Unit.h: Added support for more that three fishes. Fixed fallout at corners. 2004-08-17 22:57 fidlej * src/: gengine/ResDialogPack.cpp, gengine/ResDialogPack.h, level/LevelStatus.cpp, level/LevelStatus.h: Fixed string handling. 2004-08-17 22:25 fidlej * src/: gengine/ResDialogPack.cpp, gengine/ResDialogPack.h, level/Room.cpp, level/Room.h: Nicer code. 2004-08-17 22:07 fidlej * src/level/: Controls.cpp, Controls.h, Cube.h, Room.cpp, Room.h, Rules.cpp, Rules.h: Optimized checking for dead fish. 2004-08-17 21:17 fidlej * src/level/: Landslip.cpp, Landslip.h, Level.cpp, Makefile.am, ModelList.cpp, ModelList.h, Room.cpp, Rules.cpp, Rules.h: Optimized stack falling. 2004-08-17 00:44 fidlej * src/level/game-script.cpp: Fixed model_equals for border. 2004-08-16 15:01 fidlej * src/level/: Level.h, LevelScript.cpp, level-script.cpp, level-script.h: Added script function level_isSolved(). 2004-08-16 11:26 fidlej * src/: gengine/Dialog.cpp, gengine/Dialog.h, gengine/DialogAgent.cpp, gengine/StringTool.cpp, gengine/StringTool.h, gengine/TimerAgent.cpp, gengine/TimerAgent.h, plan/FishDialog.cpp, plan/FishDialog.h: Added support for formated subtitles. 2004-08-16 10:33 fidlej * src/gengine/SysVideo.cpp: Fixed utf-8 -> WM_Name conversion (thanks to Eric Estievenart). 2004-08-14 12:36 fidlej * src/level/Anim.cpp: Fixed modulo 0 when anim phase overflows. 2004-08-14 00:45 fidlej * src/: effect/Picture.cpp, effect/Picture.h, level/Level.cpp, level/Level.h, level/LevelScript.cpp, level/LevelScript.h, level/Room.cpp, level/Room.h, level/game-script.cpp, level/game-script.h, level/level-script.cpp, level/level-script.h: Bg picture can be changed. Renamed level_setRoomWaves to game_setRoomWaves. 2004-08-14 00:21 fidlej * src/gengine/DialogAgent.cpp: Fixed segfail when dialog is missing. 2004-08-11 22:24 fidlej * Makefile.am, README, main.aap, src/Makefile.am, src/main.aap: Removed obsolete main.aap for AAP. 2004-08-11 11:41 fidlej * configure.in: Preparing new release 0.5.0 2004-08-11 11:08 fidlej * src/state/PosterScroller.cpp: Speed up credits a bit. 2004-08-11 10:54 fidlej * README, TODO, fillets.6: Updated README, TODO, man. 2004-08-11 10:32 fidlej * src/gengine/: KeyStroke.cpp, KeyStroke.h, VideoAgent.h: Shift is ignored for keystrokes. 2004-08-10 23:34 fidlej * src/gengine/PlannedDialog.cpp: Fixed fish talking anim. 2004-08-10 20:48 fidlej * src/: level/LevelInput.cpp, level/LevelInput.h, plan/SubTitleAgent.cpp: Implemented temporary help on F1. 2004-08-10 20:28 mrpaja * fillets.6: man page update 2004-08-10 19:35 fidlej * src/: effect/SurfaceTool.cpp, gengine/PlannedDialog.cpp, level/Controls.cpp: Updated api docs. 2004-08-10 19:32 fidlej * src/: gengine/OptionParams.cpp, widget/Slider.cpp, widget/Slider.h: Renamed local variables not to shadow globals on FreeBSD. 2004-08-10 12:16 fidlej * src/: gengine/OptionAgent.cpp, gengine/SDLSoundAgent.cpp, level/Cube.cpp, option/MenuOptions.cpp, option/MenuOptions.h: Revised TODO. 2004-08-10 12:07 fidlej * src/: menu/WorldMap.cpp, state/Makefile.am, state/PosterScroller.cpp, state/PosterScroller.h, state/PosterState.cpp, state/PosterState.h: Implemented credits. 2004-08-10 11:07 fidlej * src/: gengine/BaseListener.cpp, gengine/OptionAgent.cpp, gengine/OptionAgent.h, gengine/VideoAgent.cpp, level/Level.cpp, menu/WorldMap.cpp: User and system config is reread when userdir or systemdir changes. 2004-08-09 11:40 fidlej * src/level/: Controls.cpp, Controls.h, Level.cpp, Level.h, Room.cpp, Room.h, Unit.cpp, Unit.h: Level is only solved when nothing is falling. 2004-08-08 19:33 fidlej * src/level/Room.cpp: Background is not shifted. 2004-08-08 18:50 fidlej * src/: effect/Picture.h, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/PlannedDialog.cpp, gengine/PlannedDialog.h, level/LevelScript.cpp, level/Room.cpp, level/Room.h, level/View.cpp, level/View.h, level/game-script.cpp, level/game-script.h: Special handling for cycling dialogs. Implemented screen shift. 2004-08-08 15:26 fidlej * src/level/: StatusDisplay.cpp, StatusDisplay.h: Added missing files. 2004-08-08 14:44 fidlej * src/: gengine/Drawable.h, level/Level.cpp, level/Level.h, level/Makefile.am, level/Room.h, level/StepDecor.h, menu/Pedometer.cpp, menu/WorldMap.cpp, option/MenuOptions.cpp, plan/GameState.cpp, plan/GameState.h, plan/KeyConsole.cpp, state/DemoMode.cpp, state/PosterState.cpp: Game saved status is displayed. 2004-08-08 11:54 fidlej * src/: game/Application.cpp, level/LevelInput.h, menu/PedoInput.h, menu/WorldInput.h, option/MenuOptions.cpp, option/MenuOptions.h, plan/ConsoleInput.h, plan/StateInput.cpp, plan/StateInput.h, state/DemoInput.h, state/GameInput.cpp, state/GameInput.h: Fixed '-' as unicode char bug. Added button to turn subtitles on/off. 2004-08-08 10:23 fidlej * src/: game/Application.cpp, gengine/OptionAgent.cpp, level/LevelInput.cpp, level/LevelInput.h, plan/StateInput.cpp, plan/StateInput.h, plan/SubTitleAgent.cpp, plan/Title.cpp, state/DemoInput.h, state/GameInput.cpp, state/GameInput.h: F6 will disable subtitles. 2004-08-08 00:32 mrpaja * fillets.6: man page update 2004-08-08 00:26 fidlej * src/gengine/SysVideo.cpp: SDL_syswm.h should not be included when X11 is not found. 2004-08-07 23:47 fidlej * src/: game/Application.cpp, gengine/Dialog.cpp, gengine/Dialog.h, gengine/DialogAgent.cpp, gengine/PlannedDialog.cpp, gengine/PlannedDialog.h, gengine/ResDialogPack.cpp, gengine/ResDialogPack.h, plan/FishDialog.cpp, plan/FishDialog.h: Implemented 'speech' config var to set different lang for speech. 2004-08-07 20:30 fidlej * src/menu/WorldMap.cpp: Implemented 'intro under construction'. 2004-08-07 19:32 fidlej * src/: game/Application.cpp, game/Application.h, gengine/Makefile.am, gengine/OptionAgent.cpp, gengine/OptionAgent.h, gengine/OptionParams.cpp, gengine/OptionParams.h: Enhanced help formating. 2004-08-07 17:18 fidlej * src/gengine/OptionAgent.cpp: Changed help format. 2004-08-07 16:54 fidlej * src/gengine/: Environ.cpp, OptionAgent.cpp: Changed help format. 2004-08-07 16:38 fidlej * src/: game/main.cpp, gengine/BaseAgent.cpp, gengine/Environ.cpp, gengine/Environ.h, gengine/HelpException.h, gengine/Makefile.am, gengine/Name.h, gengine/OptionAgent.cpp, gengine/OptionAgent.h: Added --help and --version. 2004-08-07 16:00 mrpaja * fillets.6: man page update 2004-08-07 14:24 fidlej * src/: level/LevelScript.cpp, level/Rules.cpp, level/Rules.h, level/game-script.cpp, level/game-script.h, menu/LevelNode.cpp: Fixed level depth. Added model_isAtBorder() script function. 2004-08-07 11:40 fidlej * src/level/: Field.h, MarkMask.cpp, MarkMask.h, Rules.cpp, Rules.h: Object can go out of room only when there is no resist. 2004-08-07 02:04 fidlej * src/option/: LangFlag.cpp, LangFlag.h: LangFlag is not need any more. 2004-08-07 02:03 fidlej * src/menu/: LuaTable.cpp, LuaTable.h, Makefile.am: LuaTable is not need any more. 2004-08-07 01:59 fidlej * src/: game/Application.cpp, gengine/OptionAgent.cpp, gengine/OptionAgent.h, gengine/SoundAgent.cpp: Specified default values for sound. 2004-08-07 01:00 fidlej * src/level/Level.cpp: Changed info about no-save. 2004-08-07 00:20 fidlej * src/: game/GameAgent.cpp, gengine/Path.h, gengine/def-script.h, level/Level.cpp, level/LevelStatus.cpp, level/LevelStatus.h, menu/LevelNode.cpp, menu/LevelNode.h, menu/Makefile.am, menu/Pedometer.cpp, menu/WorldBranch.cpp, menu/WorldBranch.h, menu/WorldMap.cpp, menu/WorldMap.h, menu/WorldWay.cpp, menu/WorldWay.h, plan/GameState.h, state/DemoInput.cpp, state/DemoInput.h, state/Makefile.am, state/PosterState.cpp, state/PosterState.h: Reworked worldmap parsing. Added support for poster in final levels. 2004-08-06 19:44 fidlej * src/: gengine/MouseStroke.cpp, gengine/MouseStroke.h, level/Goal.cpp, level/Goal.h, level/game-script.cpp, menu/WorldInput.cpp: Fixed mouse button diagnostic. Added 'alive' goal. 2004-08-06 15:48 fidlej * src/: level/Controls.cpp, level/LevelScript.cpp, level/LevelScript.h, level/Room.cpp, level/Room.h, plan/Planner.cpp, plan/Planner.h: Fixed busy+interrupt bug. 2004-08-06 14:54 fidlej * src/option/: MenuOptions.cpp, MenuOptions.h: Implemented background tone. 2004-08-06 14:23 fidlej * src/level/: Room.cpp, Rules.cpp: Fixed fish switching when one is out of room. 2004-08-06 14:01 fidlej * src/option/MenuOptions.cpp: Removed magical constant. 2004-08-06 13:26 fidlej * src/: level/Level.cpp, level/Level.h, level/level-script.cpp, state/DemoMode.cpp, state/DemoMode.h: Fixed DemoMode + MenuOptions redraw. 2004-08-06 12:38 fidlej * src/: gengine/InputAgent.cpp, gengine/InputAgent.h, gengine/InputHandler.h, gengine/InputProvider.h, gengine/Makefile.am, gengine/MouseStroke.h, level/Controls.cpp, level/Controls.h, level/Level.cpp, level/Room.cpp, level/Room.h, level/Unit.cpp, level/Unit.h, menu/Pedometer.cpp, menu/WorldMap.cpp, plan/GameState.cpp, plan/GameState.h: Wrapped input for game states. 2004-08-06 02:50 fidlej * src/option/MenuOptions.cpp: Moved back button closer to menu. 2004-08-06 02:10 fidlej * src/level/Level.cpp: Updated countdown to reflect border shout. 2004-08-06 00:43 fidlej * src/level/: Level.cpp, MarkMask.cpp, MarkMask.h, Room.cpp, Room.h, Rules.cpp, Rules.h: Implemented shout at room border. 2004-08-03 23:46 fidlej * src/: effect/Makefile.am, effect/Outline.cpp, effect/SurfaceTool.cpp, effect/SurfaceTool.h, widget/Slider.cpp: Implemented alphaFill. 2004-08-03 20:17 fidlej * src/state/demo-script.cpp: Added missing include. 2004-08-03 19:56 fidlej * src/plan/GameState.cpp: Remove few debug messages. 2004-08-03 19:53 fidlej * src/: gengine/BaseListener.h, option/MenuOptions.cpp, option/RadioBox.cpp, option/RadioBox.h, option/SelectLang.h, plan/GameState.cpp, plan/GameState.h, widget/Makefile.am, widget/Slider.h, widget/WiButton.cpp, widget/WiButton.h, widget/WiContainer.cpp, widget/WiContainer.h: Added back button from menu. 2004-08-03 17:55 fidlej * src/: effect/Font.cpp, effect/Font.h, effect/LayeredPicture.cpp, effect/Picture.cpp, effect/Picture.h, game/Application.cpp, gengine/DialogAgent.h, gengine/Environ.cpp, gengine/Environ.h, gengine/ResDialogPack.h, gengine/ResImagePack.cpp, gengine/ResImagePack.h, gengine/ResSoundPack.cpp, gengine/ResSoundPack.h, gengine/SDLSoundAgent.cpp, gengine/ScriptAgent.cpp, gengine/ScriptAgent.h, gengine/ScriptState.cpp, gengine/ScriptState.h, gengine/SoundAgent.h, gengine/VideoAgent.cpp, gengine/VideoAgent.h, level/Anim.h, level/Field.cpp, level/Field.h, level/LevelScript.cpp, level/LevelScript.h, level/LevelStatus.cpp, level/ModelFactory.cpp, level/ModelFactory.h, level/Room.h, menu/NodeDrawer.cpp, menu/NodeDrawer.h, menu/WorldMap.cpp, menu/WorldMap.h, menu/WorldWay.cpp, menu/WorldWay.h, option/SelectLang.cpp, plan/Planner.h, plan/SubTitleAgent.cpp, plan/SubTitleAgent.h: Changed not necessary includes to forward delearations. 2004-08-03 17:40 fidlej * src/gengine/: Makefile.am, RectBinder.cpp, RectBinder.h: Removed unused RectBinder. 2004-08-03 17:03 fidlej * src/: option/Makefile.am, option/RadioBox.cpp, option/RadioBox.h, option/SelectLang.cpp, option/SelectLang.h, widget/WiBox.h, widget/WiPicture.h: Rewritten SelectLang widget. 2004-08-01 15:27 fidlej * configure.in, src/Makefile.am, src/game/KeyConsole.cpp, src/game/KeyConsole.h, src/game/Makefile.am, src/gengine/IKeyConsole.h, src/gengine/InputAgent.cpp, src/gengine/KeyStroke.cpp, src/gengine/KeyStroke.h, src/gengine/Makefile.am, src/level/LevelInput.cpp, src/level/LevelInput.h, src/level/Makefile.am, src/menu/Makefile.am, src/menu/PedoInput.cpp, src/menu/PedoInput.h, src/menu/WorldInput.cpp, src/menu/WorldInput.h, src/option/OptionsInput.cpp, src/option/OptionsInput.h, src/plan/ConsoleInput.cpp, src/plan/ConsoleInput.h, src/plan/DemoInput.cpp, src/plan/DemoInput.h, src/plan/DemoMode.cpp, src/plan/DemoMode.h, src/plan/GameState.h, src/plan/KeyConsole.cpp, src/plan/KeyConsole.h, src/plan/Makefile.am, src/plan/StateInput.cpp, src/plan/StateInput.h, src/plan/demo-script.cpp, src/plan/demo-script.h, src/state/.cvsignore, src/state/DemoInput.cpp, src/state/DemoInput.h, src/state/DemoMode.cpp, src/state/DemoMode.h, src/state/GameInput.cpp, src/state/GameInput.h, src/state/Makefile.am, src/state/demo-script.cpp, src/state/demo-script.h, src/widget/Slider.cpp: Debug console is back. Use F10 for options menu. 2004-08-01 13:09 fidlej * src/: effect/LayeredPicture.cpp, effect/LayeredPicture.h, effect/Picture.cpp, effect/Picture.h, effect/WavyPicture.cpp, effect/WavyPicture.h, game/GameAgent.cpp, game/GameAgent.h, game/KeyConsole.cpp, game/KeyConsole.h, gengine/Drawable.h, gengine/IDrawer.cpp, gengine/IDrawer.h, gengine/IKeyConsole.h, gengine/InputAgent.cpp, gengine/InputAgent.h, gengine/Makefile.am, gengine/MultiDrawer.cpp, gengine/MultiDrawer.h, gengine/SysVideo.cpp, gengine/SysVideo.h, gengine/VideoAgent.cpp, gengine/VideoAgent.h, level/Level.cpp, level/Level.h, level/Room.cpp, level/Room.h, level/View.cpp, level/View.h, menu/Pedometer.cpp, menu/Pedometer.h, menu/WorldMap.cpp, menu/WorldMap.h, option/MenuOptions.cpp, option/MenuOptions.h, plan/DemoMode.cpp, plan/DemoMode.h, plan/GameState.cpp, plan/GameState.h, plan/StateManager.cpp, plan/StateManager.h, plan/SubTitleAgent.cpp, plan/SubTitleAgent.h, plan/Title.cpp, plan/Title.h, widget/IWidget.h, widget/Makefile.am, widget/WidgetContainer.cpp, widget/WidgetContainer.h: Reworked list of drawers. 2004-07-31 16:31 fidlej * src/: game/GameAgent.cpp, gengine/VideoAgent.cpp, level/Level.cpp, level/Level.h, level/LevelStatus.h, menu/Pedometer.cpp, menu/WorldMap.cpp, plan/GameState.cpp, plan/GameState.h, plan/StateManager.cpp, plan/StateManager.h: Enhanced StateManager for better support states running on background. Drawers list still needs change. 2004-07-30 22:17 fidlej * src/gengine/SDLSoundAgent.cpp: Changed setSoundVolume function to set volume for already running sounds too. 2004-07-30 22:04 fidlej * src/: level/DescFinder.h, level/Level.cpp, level/Level.h, level/LevelInput.cpp, level/LevelInput.h, level/Makefile.am, menu/WorldMap.cpp, menu/WorldMap.h, option/MenuOptions.cpp, option/MenuOptions.h, option/OptionsInput.cpp, option/SelectLang.cpp, option/SelectLang.h, plan/GameState.cpp, plan/GameState.h, plan/StateManager.cpp, plan/StateManager.h: Added foreground menu to levels. 2004-07-30 12:23 fidlej * src/widget/: Slider.cpp, Slider.h: Fixed slider width. 2004-07-30 04:20 fidlej * src/: game/GameAgent.cpp, gengine/BaseListener.cpp, gengine/BaseListener.h, gengine/DummySoundAgent.h, gengine/SDLSoundAgent.cpp, gengine/SDLSoundAgent.h, gengine/SoundAgent.cpp, gengine/SoundAgent.h, gengine/VideoAgent.cpp, gengine/VideoAgent.h, option/MenuOptions.cpp: Volume control is working. 2004-07-30 03:44 fidlej * configure.in, src/Makefile.am, src/game/Makefile.am, src/gengine/MouseStroke.cpp, src/gengine/MouseStroke.h, src/level/Makefile.am, src/menu/LangFlag.cpp, src/menu/LangFlag.h, src/menu/Makefile.am, src/menu/MenuOptions.cpp, src/menu/MenuOptions.h, src/menu/OptionsInput.cpp, src/menu/OptionsInput.h, src/menu/PedoInput.cpp, src/menu/SelectLang.cpp, src/menu/SelectLang.h, src/menu/WorldInput.cpp, src/option/.cvsignore, src/option/LangFlag.cpp, src/option/LangFlag.h, src/option/Makefile.am, src/option/MenuOptions.cpp, src/option/MenuOptions.h, src/option/OptionsInput.cpp, src/option/OptionsInput.h, src/option/SelectLang.cpp, src/option/SelectLang.h, src/widget/.cvsignore, src/widget/HBox.cpp, src/widget/HBox.h, src/widget/IWidget.cpp, src/widget/IWidget.h, src/widget/Makefile.am, src/widget/Slider.cpp, src/widget/Slider.h, src/widget/VBox.cpp, src/widget/VBox.h, src/widget/WiBox.cpp, src/widget/WiBox.h, src/widget/WiPicture.cpp, src/widget/WiPicture.h, src/widget/WiSpace.h, src/widget/WidgetContainer.cpp, src/widget/WidgetContainer.h: Implemented sliders for volume control. 2004-07-29 13:10 fidlej * src/: gengine/InputAgent.cpp, gengine/InputAgent.h, gengine/RectBinder.cpp, gengine/RectBinder.h, menu/LangFlag.cpp, menu/LangFlag.h, menu/Makefile.am, menu/MenuOptions.cpp, menu/MenuOptions.h, menu/OptionsInput.cpp, menu/OptionsInput.h, menu/SelectLang.cpp, menu/SelectLang.h, menu/WorldMap.cpp: Implemented lang selection menu. 2004-07-27 18:47 fidlej * src/gengine/Name.cpp: Moved timer delay after video output and before user input. 2004-07-27 11:50 fidlej * src/: effect/Picture.h, game/GameAgent.cpp, gengine/InputAgent.cpp, gengine/InputAgent.h, menu/Pedometer.cpp, menu/WorldMap.cpp, menu/WorldMap.h: Implemeted button selection at worldmap. 2004-07-26 23:42 fidlej * src/effect/EffectDisintegrate.cpp: Fixed skeletons disintegration. 2004-07-26 23:31 fidlej * src/: effect/EffectDisintegrate.cpp, effect/EffectDisintegrate.h, effect/EffectInvisible.h, effect/EffectMirror.cpp, effect/EffectMirror.h, effect/EffectNone.cpp, effect/EffectNone.h, effect/EffectReverse.cpp, effect/EffectReverse.h, effect/EffectZx.cpp, effect/EffectZx.h, effect/Makefile.am, effect/ViewEffect.cpp, effect/ViewEffect.h, effect/WavyPicture.cpp, level/Anim.cpp, level/Anim.h, level/Cube.cpp, level/game-script.cpp: Implemented 'zx' view effect. More OO code for effects. 2004-07-26 19:51 fidlej * src/gengine/SDLSoundAgent.cpp: Incremented number of sound channels. 2004-07-26 19:49 fidlej * src/level/Anim.cpp: Added warning about anim phase over-flow. 2004-07-25 13:47 mrpaja * AUTHORS: added Ronny Standtke to AUTHORS 2004-07-24 13:38 fidlej * configure.in: Replaced AS_HELP_STRING with raw text. Removed too new macros. 2004-07-23 19:27 fidlej * configure.in: Autoupdated configure.in. 2004-07-23 11:49 fidlej * README: Updated README - libboost_filesystem is optional. 2004-07-23 02:12 fidlej * configure.in: Enhanced X11/Xutil.h checking. 2004-07-23 01:37 fidlej * src/level/: Level.cpp, PhaseLocker.cpp, PhaseLocker.h: Fixed locked phases on start. 2004-07-23 01:29 fidlej * src/gengine/KeyStroke.h: Generalized STROKE_IGNORE. 2004-07-23 00:47 fidlej * src/gengine/VideoAgent.cpp: unlock_func() call XSync too. 2004-07-23 00:37 fidlej * configure.in, src/gengine/VideoAgent.cpp, src/gengine/VideoAgent.h: Implemented setCaption for UTF-8 strings. 2004-07-19 23:21 fidlej * src/gengine/Dialog.cpp: Readded warning about missing dialog sound. 2004-07-19 23:19 fidlej * src/level/Level.cpp: Added info message about saved game. 2004-07-19 23:15 fidlej * src/gengine/Path.cpp: Fixed creation of new files. 2004-07-19 23:09 fidlej * src/gengine/Path.cpp: Fixed persistent store of multiple options. 2004-07-16 03:05 fidlej * src/gengine/FsPath.cpp: Fixed empty paths. 2004-07-16 02:30 fidlej * configure.in: Added explanation to configure.in 2004-07-16 02:27 fidlej * Makefile.am, configure.in, src/gengine/FsPath.cpp, src/gengine/FsPath.h, src/gengine/FsPath_boost.cpp, src/gengine/Makefile.am, src/gengine/OptionAgent.cpp, src/gengine/Path.cpp, src/gengine/Path.h, src/gengine/PathException.h, src/level/Room.cpp: Boost library is not need for POSIX systems. 2004-07-15 21:41 fidlej * src/gengine/ResDialogPack.cpp: Fixed lang 'de_' confusion. 2004-07-15 13:52 fidlej * src/gengine/: OptionAgent.cpp, ResDialogPack.cpp, ResDialogPack.h: Locale territory codes are supported. 2004-07-14 23:02 fidlej * src/level/Room.cpp: Old dialogs are released. 2004-07-14 21:24 fidlej * README, configure.in: Described lang=cs in README. 2004-07-14 20:58 mrpaja * fillets.6: updated man page 2004-07-14 01:17 fidlej * src/gengine/Dialog.cpp: Missing 'en' sound effect are reported. 2004-07-12 16:40 fidlej * src/gengine/VideoAgent.cpp: Removed SDL_HWACCEL from video flags. 2004-07-12 02:12 mrpaja * fillets.6: added fillets man page 2004-07-11 17:00 fidlej * src/: effect/Font.cpp, effect/Font.h, game/Application.cpp: Removed TTF_WasInit to support SDL_ttf <= 2.0.6 2004-07-10 23:43 fidlej * src/level/: Level.cpp, Level.h, LevelScript.cpp, level-script.cpp, level-script.h: Implemented level_isNewRound(). 2004-07-10 20:19 fidlej * src/gengine/Dialog.cpp: Turned off warning when dialog sound is not found. 2004-07-08 09:39 fidlej * src/: effect/Font.cpp, gengine/BaseAgent.cpp, level/StepDecor.cpp: Fixed memory leak in StepDecor. 2004-07-08 01:58 fidlej * AUTHORS: Updated authors info. 2004-07-08 00:58 fidlej * README: Updated authors info. 2004-07-08 00:26 fidlej * src/gengine/OptionAgent.cpp: Fixed peristent options. 2004-07-08 00:26 fidlej * README: Removed x.y. version numbers. 2004-07-07 23:07 mrpaja * README: README update 2004-07-07 21:35 fidlej * Makefile.am, configure.in: Preparing for 0.4.0. 2004-07-07 20:36 mrpaja * TODO: updated TODO 2004-07-07 20:27 fidlej * README: Updated README. 2004-07-07 20:17 mrpaja * README: controls update 2004-07-07 19:50 fidlej * src/: effect/Color.h, effect/Font.h, effect/Outline.cpp, effect/Outline.h, game/GameAgent.h, game/main.cpp, gengine/IDrawer.h, gengine/KeyStroke.h, gengine/MouseStroke.cpp, gengine/Name.h, gengine/ScriptAgent.h, gengine/VideoAgent.h, level/Controls.h, level/Decor.h, level/Field.h, level/Level.cpp, level/LevelInput.cpp, level/LevelInput.h, level/LevelScript.cpp, level/Makefile.am, level/MarkMask.h, level/ModelFactory.h, level/Room.cpp, level/Room.h, level/RopeDecor.cpp, level/Shape.h, level/StepCounter.h, level/StepDecor.cpp, level/StepDecor.h, level/View.cpp, plan/GameState.cpp, plan/GameState.h: Press F5 to show number of steps. 2004-07-06 20:30 fidlej * src/: game/Application.cpp, gengine/Dialog.cpp, gengine/Environ.cpp, gengine/SDLSoundAgent.cpp, level/Anim.cpp, level/Anim.h, level/Cube.cpp, level/Cube.h, level/LevelScript.cpp, level/View.cpp, level/game-script.cpp, level/game-script.h: Implemented view shift. 2004-07-06 16:53 fidlej * src/level/game-script.cpp: lua_checkboolean is not need. 2004-07-06 13:01 fidlej * src/level/RopeDecor.cpp: Changed rope color to steel color. 2004-07-06 12:42 fidlej * src/level/RopeDecor.h: Added missing file. 2004-07-05 22:15 fidlej * src/: level/Cube.h, level/Decor.h, level/LevelScript.cpp, level/Makefile.am, level/ModelList.cpp, level/Room.cpp, level/Room.h, level/RopeDecor.cpp, level/View.cpp, level/View.h, level/game-script.cpp, level/game-script.h, menu/Makefile.am, plan/Makefile.am: Implemented rope decoration. 2004-07-05 20:04 fidlej * src/: gengine/Makefile.am, menu/WorldMap.cpp, plan/StateManager.cpp, plan/StateManager.h: No level is selected after return to worldmap. 2004-07-05 12:33 fidlej * src/: effect/LayeredPicture.cpp, effect/Outline.cpp, level/Cube.h: Renamed few variables not to shadow global declaration on FreeBSD. 2004-07-05 01:49 fidlej * src/: gengine/Environ.cpp, gengine/VideoAgent.cpp, gengine/VideoAgent.h, level/Level.cpp, menu/WorldMap.cpp: New window is only opened when resolution changed. 2004-07-04 22:15 fidlej * src/gengine/ResSoundPack.cpp: Default is sound=1. 2004-07-04 20:49 fidlej * src/gengine/Makefile.am: Using @PACKAGE@ instead of fillets-ng. 2004-07-04 20:20 fidlej * src/: game/Application.cpp, game/Application.h, gengine/Makefile.am, gengine/OptionAgent.cpp: Changed datadir to $datadir/games/fillets-ng. 2004-07-04 18:38 fidlej * configure.in, src/gengine/Makefile.am: SYSTEM_DATA_DIR can be specified by --datadir. 2004-07-04 14:58 fidlej * src/level/LevelStatus.h: Fixed stoped music in worldmap. 2004-07-04 13:44 fidlej * src/: level/Level.cpp, level/Level.h, level/LevelInput.cpp, level/LevelStatus.cpp, level/LevelStatus.h, menu/Pedometer.cpp, menu/WorldMap.cpp: Improved switching from pedometer back to menu. Saving during replay is forbidden. 2004-07-04 04:30 fidlej * src/plan/DemoMode.cpp: Improved bg at briefcase demo. 2004-07-04 04:18 fidlej * src/level/: Level.cpp, Level.h, Room.cpp: Fixed updateScript during replay. 2004-07-04 03:40 fidlej * src/menu/: Pedometer.cpp, Pedometer.h: Implemented rotating numbers in pedometer. 2004-07-04 03:16 fidlej * src/: effect/Font.cpp, effect/LayeredPicture.cpp, effect/LayeredPicture.h, effect/Makefile.am, effect/Outline.cpp, effect/Picture.cpp, effect/Picture.h, effect/PixelTool.cpp, effect/PixelTool.h, effect/ViewEffect.cpp, effect/ViewEffect.h, effect/WavyPicture.cpp, game/GameAgent.cpp, gengine/MouseStroke.cpp, gengine/MouseStroke.h, gengine/TimerAgent.cpp, gengine/TimerAgent.h, gengine/V2.h, level/Level.cpp, level/Level.h, level/LevelStatus.cpp, level/LevelStatus.h, level/MarkMask.cpp, level/Rules.cpp, level/View.cpp, menu/LevelNode.h, menu/Makefile.am, menu/PedoInput.cpp, menu/PedoInput.h, menu/Pedometer.cpp, menu/Pedometer.h, menu/WorldInput.cpp, menu/WorldMap.cpp, menu/WorldWay.cpp, plan/StateManager.cpp, plan/StateManager.h: Implemented pedometer. 2004-07-03 19:30 fidlej * src/: gengine/ScriptState.h, level/Cube.cpp, level/Cube.h, level/Field.cpp, level/Level.cpp, level/LevelStatus.cpp, level/LevelStatus.h, level/Makefile.am, level/ModelFactory.cpp, level/ModelFactory.h: Moved saveSolution() to LeveStatus. Moved createBorder() to ModelFactory. 2004-07-03 16:15 fidlej * src/: gengine/OptionAgent.cpp, level/game-script.cpp: Fixed problem with decimal point and locales in Lua. 2004-07-02 23:57 fidlej * src/level/: Anim.h, Cube.cpp, Cube.h, Makefile.am, OnCondition.h, OnStack.h, OnStrongPad.h, OnWall.h, Rules.cpp, Rules.h: Fixed checkDeadMove for special shapes. 2004-07-02 18:42 fidlej * src/level/level-script.cpp: Fixed wavy amplitude. 2004-07-02 17:59 fidlej * src/: effect/.cvsignore, level/.cvsignore, menu/.cvsignore, plan/.cvsignore: Added .cvsignore. 2004-07-02 17:56 fidlej * src/: effect/Makefile.am, effect/Picture.cpp, effect/Picture.h, effect/ViewEffect.cpp, effect/ViewEffect.h, effect/WavyPicture.cpp, effect/WavyPicture.h, level/Level.cpp, level/Level.h, level/LevelScript.cpp, level/Room.cpp, level/Room.h, level/level-script.cpp, level/level-script.h, plan/Makefile.am, plan/Picture.cpp, plan/Picture.h: Implemented wavy background. 2004-07-01 18:53 fidlej * src/: gengine/Dialog.cpp, gengine/Dialog.h, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/DummySoundAgent.h, gengine/PlannedDialog.cpp, gengine/PlannedDialog.h, gengine/SDLSoundAgent.cpp, gengine/SDLSoundAgent.h, gengine/SoundAgent.h, level/LevelScript.cpp, level/LevelScript.h, level/Room.cpp, level/Room.h, level/game-script.cpp, plan/Planner.cpp, plan/dialog-script.cpp, plan/dialog-script.h: Dialogs can have different volume and number of loops. 2004-06-29 22:42 fidlej * src/: effect/Outline.cpp, effect/ViewEffect.cpp, effect/ViewEffect.h, gengine/InputAgent.cpp, level/Anim.h, level/Cube.cpp, level/Cube.h, level/Rules.cpp: Fixed conflict between disint x invisible effect. 2004-06-28 01:49 fidlej * src/main.aap: Added -lSDL_ttf to the main.app 2004-06-27 22:50 fidlej * src/effect/Makefile.am: Added missing Makefile.am 2004-06-27 22:36 fidlej * AUTHORS, configure.in, src/Makefile.am, src/main.aap, src/effect/Color.h, src/effect/Font.cpp, src/effect/Font.h, src/effect/Outline.cpp, src/effect/Outline.h, src/effect/ResColorPack.h, src/effect/SurfaceLock.cpp, src/effect/SurfaceLock.h, src/effect/TTFException.cpp, src/effect/TTFException.h, src/effect/ViewEffect.cpp, src/effect/ViewEffect.h, src/game/GameAgent.cpp, src/game/GameAgent.h, src/game/KeyConsole.cpp, src/game/KeyConsole.h, src/game/Makefile.am, src/gengine/IKeyConsole.h, src/gengine/InputAgent.cpp, src/gengine/InputAgent.h, src/gengine/KeyConsole.cpp, src/gengine/KeyConsole.h, src/gengine/Makefile.am, src/gengine/ResFontPack.cpp, src/gengine/ResFontPack.h, src/level/Makefile.am, src/level/SurfaceLock.cpp, src/level/SurfaceLock.h, src/level/ViewEffect.cpp, src/level/ViewEffect.h, src/menu/Makefile.am, src/menu/NodeDrawer.cpp, src/menu/NodeDrawer.h, src/plan/Makefile.am, src/plan/SubTitleAgent.cpp, src/plan/SubTitleAgent.h, src/plan/Title.cpp, src/plan/Title.h, src/plan/dialog-script.cpp: SDL_ttf is used for fonts. Font can have outline. UTF-8 is expected. 2004-06-26 21:08 fidlej * src/: gengine/KeyConsole.cpp, plan/GameState.cpp: Minor debug features. 2004-06-26 16:22 fidlej * src/: level/ViewEffect.cpp, level/ViewEffect.h, level/game-script.cpp, plan/GameState.cpp: Implemented 'reverse' view effect. 2004-06-26 02:40 fidlej * src/level/ModelFactory.cpp: Added possibility to add extra fish. 2004-06-25 23:17 fidlej * src/level/: ViewEffect.cpp, ViewEffect.h: Fixed view effects for 16 bpp. 2004-06-25 21:58 fidlej * src/level/ViewEffect.cpp: Fixed typo. 2004-06-25 21:54 fidlej * src/: game/GameAgent.cpp, level/LevelScript.cpp, level/ViewEffect.cpp, level/game-script.cpp, level/game-script.h, plan/Planner.cpp, plan/dialog-script.cpp, plan/dialog-script.h: Exported model_killSound and model_change_setLocation. 2004-06-25 20:39 mrpaja * AUTHORS: added Frederic Panico 2004-06-25 19:05 fidlej * src/level/: LevelScript.cpp, LevelScript.h, level-script.cpp, level-script.h: Added missing files. 2004-06-25 16:43 fidlej * src/: gengine/Actor.cpp, gengine/Actor.h, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/Makefile.am, gengine/OptionAgent.cpp, gengine/PlannedDialog.cpp, gengine/PlannedDialog.h, gengine/SDLSoundAgent.cpp, level/Cube.cpp, level/Cube.h, level/Level.cpp, level/Level.h, level/LevelInput.cpp, level/Makefile.am, level/Room.cpp, level/Room.h, level/Rules.cpp, level/Unit.cpp, level/game-script.cpp, level/game-script.h, plan/CommandQueue.cpp, plan/CommandQueue.h, plan/DemoMode.cpp, plan/DemoMode.h, plan/Planner.cpp, plan/Planner.h, plan/SubTitleAgent.cpp, plan/SubTitleAgent.h, plan/dialog-script.cpp, plan/dialog-script.h: Implemented new flexible level planing. 2004-06-24 17:47 fidlej * src/: gengine/InputAgent.cpp, gengine/KeyStroke.h, level/ControlSym.h, level/Controls.cpp, level/Controls.h, level/Level.cpp, level/Level.h, level/LevelInput.cpp, level/Room.cpp, level/Room.h, level/Unit.cpp, level/Unit.h: Improved fish controls. First key press is now interpreted. 2004-06-24 16:13 fidlej * src/: gengine/InputAgent.cpp, gengine/InputAgent.h, gengine/InputHandler.h, gengine/KeyBinder.cpp, gengine/KeyBinder.h, gengine/KeyStroke.cpp, gengine/KeyStroke.h, gengine/Makefile.am, gengine/MouseStroke.cpp, gengine/MouseStroke.h, level/Level.cpp, level/Level.h, level/LevelInput.cpp, level/LevelInput.h, menu/WorldInput.cpp, menu/WorldInput.h, menu/WorldMap.cpp, menu/WorldMap.h, plan/DemoInput.cpp, plan/DemoInput.h, plan/DemoMode.cpp, plan/DemoMode.h, plan/GameState.cpp, plan/GameState.h, plan/KeyDesc.cpp, plan/KeyDesc.h, plan/Keymap.cpp, plan/Keymap.h, plan/Makefile.am: Improved input handling. InputHandler is installed for every GameState. 2004-06-24 04:40 fidlej * src/level/: Level.cpp, ViewEffect.cpp, ViewEffect.h, game-script.cpp, game-script.h: Implemented the Mirror view effect. 2004-06-23 23:03 fidlej * configure.in, src/Makefile.am, src/main.aap, src/game/Anim.cpp, src/game/Anim.h, src/game/Command.h, src/game/CommandQueue.cpp, src/game/CommandQueue.h, src/game/ControlSym.h, src/game/Controls.cpp, src/game/Controls.h, src/game/Cube.cpp, src/game/Cube.h, src/game/DemoMode.cpp, src/game/DemoMode.h, src/game/Field.cpp, src/game/Field.h, src/game/FishDialog.cpp, src/game/FishDialog.h, src/game/GameAgent.cpp, src/game/GameAgent.h, src/game/Goal.cpp, src/game/Goal.h, src/game/KeyControl.cpp, src/game/KeyControl.h, src/game/LayoutException.h, src/game/Level.cpp, src/game/Level.h, src/game/LevelDesc.cpp, src/game/LevelDesc.h, src/game/LevelNode.cpp, src/game/LevelNode.h, src/game/LoadException.h, src/game/LuaTable.cpp, src/game/LuaTable.h, src/game/Makefile.am, src/game/MarkMask.cpp, src/game/MarkMask.h, src/game/ModelFactory.cpp, src/game/ModelFactory.h, src/game/NodeDrawer.cpp, src/game/NodeDrawer.h, src/game/Picture.cpp, src/game/Picture.h, src/game/Planner.cpp, src/game/Planner.h, src/game/Room.cpp, src/game/Room.h, src/game/Rules.cpp, src/game/Rules.h, src/game/ScriptCmd.cpp, src/game/ScriptCmd.h, src/game/Shape.cpp, src/game/Shape.h, src/game/SubTitleAgent.cpp, src/game/SubTitleAgent.h, src/game/SurfaceLock.cpp, src/game/SurfaceLock.h, src/game/Title.cpp, src/game/Title.h, src/game/Unit.cpp, src/game/Unit.h, src/game/View.cpp, src/game/View.h, src/game/ViewEffect.cpp, src/game/ViewEffect.h, src/game/WorldMap.cpp, src/game/WorldMap.h, src/game/WorldWay.cpp, src/game/WorldWay.h, src/game/demo-script.cpp, src/game/demo-script.h, src/game/dialog-script.cpp, src/game/dialog-script.h, src/game/game-script.cpp, src/game/game-script.h, src/game/worldmap-script.cpp, src/game/worldmap-script.h, src/gengine/Environ.cpp, src/gengine/KeyStroke.cpp, src/gengine/KeyStroke.h, src/gengine/Makefile.am, src/gengine/OptionAgent.cpp, src/gengine/ScriptState.cpp, src/gengine/ScriptState.h, src/gengine/def-script.cpp, src/gengine/def-script.h, src/level/Anim.cpp, src/level/Anim.h, src/level/ControlSym.h, src/level/Controls.cpp, src/level/Controls.h, src/level/Cube.cpp, src/level/Cube.h, src/level/Field.cpp, src/level/Field.h, src/level/Goal.cpp, src/level/Goal.h, src/level/KeyControl.cpp, src/level/KeyControl.h, src/level/LayoutException.h, src/level/Level.cpp, src/level/Level.h, src/level/LevelInput.cpp, src/level/LevelInput.h, src/level/LevelStatus.h, src/level/LoadException.h, src/level/Makefile.am, src/level/MarkMask.cpp, src/level/MarkMask.h, src/level/ModelFactory.cpp, src/level/ModelFactory.h, src/level/ModelList.cpp, src/level/ModelList.h, src/level/PhaseLocker.cpp, src/level/PhaseLocker.h, src/level/Room.cpp, src/level/Room.h, src/level/Rules.cpp, src/level/Rules.h, src/level/Shape.cpp, src/level/Shape.h, src/level/SurfaceLock.cpp, src/level/SurfaceLock.h, src/level/Unit.cpp, src/level/Unit.h, src/level/View.cpp, src/level/View.h, src/level/ViewEffect.cpp, src/level/ViewEffect.h, src/level/game-script.cpp, src/level/game-script.h, src/menu/LevelDesc.cpp, src/menu/LevelDesc.h, src/menu/LevelNode.cpp, src/menu/LevelNode.h, src/menu/LuaTable.cpp, src/menu/LuaTable.h, src/menu/Makefile.am, src/menu/NodeDrawer.cpp, src/menu/NodeDrawer.h, src/menu/WorldInput.cpp, src/menu/WorldInput.h, src/menu/WorldMap.cpp, src/menu/WorldMap.h, src/menu/WorldWay.cpp, src/menu/WorldWay.h, src/menu/worldmap-script.cpp, src/menu/worldmap-script.h, src/plan/Command.h, src/plan/CommandQueue.cpp, src/plan/CommandQueue.h, src/plan/DemoInput.cpp, src/plan/DemoInput.h, src/plan/DemoMode.cpp, src/plan/DemoMode.h, src/plan/FishDialog.cpp, src/plan/FishDialog.h, src/plan/GameState.cpp, src/plan/GameState.h, src/plan/Keymap.cpp, src/plan/Keymap.h, src/plan/Makefile.am, src/plan/Picture.cpp, src/plan/Picture.h, src/plan/Planner.cpp, src/plan/Planner.h, src/plan/ScriptCmd.cpp, src/plan/ScriptCmd.h, src/plan/StateManager.cpp, src/plan/StateManager.h, src/plan/SubTitleAgent.cpp, src/plan/SubTitleAgent.h, src/plan/Title.cpp, src/plan/Title.h, src/plan/demo-script.cpp, src/plan/demo-script.h, src/plan/dialog-script.cpp, src/plan/dialog-script.h: Big refactoring. StateManager is used to manage GameStates. 2004-05-12 04:01 fidlej * src/: game/Application.cpp, game/Application.h, game/Level.cpp, gengine/OptionAgent.cpp, gengine/ResSoundPack.cpp, gengine/SDLSoundAgent.cpp: Fixed config storing. Improved sound on/off switching. 2004-05-10 01:33 fidlej * README: Updated README. 2004-05-10 01:06 fidlej * configure.in, src/gengine/DummySoundAgent.h: Removed unused parameter. 2004-05-10 01:03 fidlej * src/gengine/: OptionAgent.cpp, SDLSoundAgent.cpp: Fixed 'or' -> '||' bug. 2004-05-10 00:27 fidlej * TODO: Update TODO. 2004-05-09 23:42 fidlej * src/: game/Controls.cpp, game/Field.cpp, game/Level.cpp, game/Rules.cpp, game/Shape.cpp, gengine/Dialog.cpp, gengine/KeyConsole.cpp, gengine/KeyStroke.cpp, gengine/MessagerAgent.cpp, gengine/RectBinder.cpp, gengine/SDLSoundAgent.cpp, gengine/ScriptAgent.cpp, gengine/TimerAgent.cpp: Cleaned comments. Shorted dialog min time. 2004-05-09 22:26 fidlej * src/game/: Cube.cpp, Cube.h, Goal.cpp, Goal.h, Level.cpp, Room.cpp, Room.h: Save is not allowed on wrong way. Object out of room have weight=NONE and so it does not sounds after impact. 2004-05-09 21:42 fidlej * src/game/: Controls.cpp, Controls.h, GameAgent.cpp, Level.cpp, Level.h, Room.cpp, Room.h, Rules.cpp, Unit.cpp, Unit.h, ViewEffect.cpp: Countdown before restart or finish. 2004-05-09 17:09 fidlej * src/: game/Level.cpp, game/Level.h, game/Room.cpp, game/Room.h, game/dialog-script.cpp, game/game-script.cpp, game/game-script.h, gengine/DummySoundAgent.h, gengine/SDLSoundAgent.cpp, gengine/SDLSoundAgent.h, gengine/SoundAgent.h: Added possibility to deprioritize sound. 2004-05-09 15:46 fidlej * src/: game/Application.cpp, game/Cube.cpp, game/GameAgent.cpp, game/Level.cpp, game/Level.h, game/LevelNode.cpp, game/LevelNode.h, game/WorldWay.cpp, game/WorldWay.h, game/game-script.cpp, game/game-script.h, gengine/BaseAgent.cpp, gengine/ResSoundPack.cpp: Added function script_game_getDept(). 2004-05-09 13:16 fidlej * src/gengine/Path.cpp: Compilable for BOOST_VERSION < 103100. 2004-05-09 12:18 fidlej * src/: game/Application.cpp, game/GameAgent.cpp, game/Level.cpp, game/Level.h, game/Picture.cpp, game/Room.cpp, game/WorldMap.cpp, game/main.cpp, gengine/Dialog.cpp, gengine/KeyConsole.cpp, gengine/Makefile.am, gengine/Name.cpp, gengine/Name.h, gengine/ResFontPack.cpp, gengine/ResImageAgent.cpp, gengine/ResImageAgent.h, gengine/ResImagePack.h, gengine/ResSoundAgent.cpp, gengine/ResSoundAgent.h, gengine/ResSoundPack.h: Removed useless Res*Agents. 2004-05-09 02:25 fidlej * src/game/Planner.cpp: Implemented framework for a graphic demo, e.g. Briefcase message. 2004-05-09 01:31 fidlej * src/: game/Cube.cpp, game/Cube.h, game/DemoMode.cpp, game/DemoMode.h, game/GameAgent.cpp, game/GameAgent.h, game/Level.cpp, game/Level.h, game/Makefile.am, game/Picture.cpp, game/Picture.h, game/Planner.h, game/Room.cpp, game/Room.h, game/SubTitleAgent.cpp, game/SubTitleAgent.h, game/Title.h, game/View.h, game/WorldMap.cpp, game/WorldMap.h, game/WorldWay.cpp, game/demo-script.cpp, game/demo-script.h, game/dialog-script.cpp, game/dialog-script.h, game/game-script.cpp, game/game-script.h, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/IDrawer.cpp, gengine/IDrawer.h, gengine/KeyConsole.cpp, gengine/KeyConsole.h: Implemented framework for a graphic demo, e.g. Briefcase message. 2004-05-08 17:28 fidlej * src/gengine/ResourcePack.h: Fixed nosound run. 2004-05-08 16:04 fidlej * src/game/WorldWay.cpp: Fixed stack overflow. 2004-05-08 14:18 fidlej * src/game/NodeDrawer.cpp: Slower blinking dots. 2004-05-08 13:29 fidlej * src/: game/NodeDrawer.cpp, game/NodeDrawer.h, gengine/VideoAgent.cpp: Blinking dots. 2004-05-08 04:08 mrpaja * AUTHORS: AUTHORS update 2004-05-08 03:25 fidlej * src/game/: LevelNode.cpp, NodeDrawer.cpp, WorldMap.cpp: Fixed set_open/solved bug. 2004-05-08 02:26 fidlej * src/: game/GameAgent.cpp, game/GameAgent.h, game/Level.cpp, game/Level.h, game/LevelDesc.cpp, game/LevelDesc.h, game/LevelNode.cpp, game/LevelNode.h, game/Makefile.am, game/ModelFactory.h, game/NodeDrawer.cpp, game/NodeDrawer.h, game/ViewEffect.h, game/WorldMap.cpp, game/WorldMap.h, game/WorldWay.cpp, game/game-script.cpp, game/worldmap-script.cpp, game/worldmap-script.h, gengine/BaseAgent.h, gengine/Dialog.cpp, gengine/Dialog.h, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/Makefile.am, gengine/ResDialogPack.cpp, gengine/ResDialogPack.h, gengine/ResFontPack.h, gengine/ScriptAgent.cpp, gengine/VideoAgent.cpp, gengine/def-script.h: Level names are shown in menu and in caption. 2004-05-07 22:15 fidlej * configure.in, src/Makefile.am, src/main.aap, src/SDL_gfx/Makefile.am, src/SDL_gfx/SDL_gfxPrimitives.c, src/SDL_gfx/SDL_gfxPrimitives.h, src/SDL_gfx/SDL_gfxPrimitives_font.h, src/game/Makefile.am, src/game/NodeDrawer.cpp: Used SDL_gfx for lines. 2004-05-07 21:54 fidlej * src/game/: GameAgent.cpp, GameAgent.h, Level.cpp, Level.h, LevelNode.cpp, LevelNode.h, LuaTable.cpp, LuaTable.h, Makefile.am, NodeDrawer.cpp, WorldMap.cpp, WorldMap.h, WorldWay.cpp, WorldWay.h: WorldMap is scriptable from lua. See script/worldmap.lua. 2004-05-07 13:19 fidlej * src/: game/Anim.cpp, game/Application.cpp, game/CommandQueue.cpp, game/Controls.cpp, game/FishDialog.cpp, game/GameAgent.cpp, game/Goal.cpp, game/Level.cpp, game/Room.cpp, game/Rules.cpp, game/SubTitleAgent.cpp, game/Unit.cpp, game/View.cpp, game/WorldMap.cpp, gengine/AgentPack.cpp, gengine/BaseAgent.cpp, gengine/Dialog.cpp, gengine/DialogAgent.cpp, gengine/Environ.cpp, gengine/KeyBinder.cpp, gengine/KeyConsole.cpp, gengine/OptionAgent.cpp, gengine/ScriptAgent.cpp, gengine/StringTool.cpp: Replaced 'false == ' with '!'. 2004-05-07 03:44 fidlej * src/game/GameAgent.cpp: Fixed compile time error. 2004-05-07 03:32 fidlej * src/: game/GameAgent.cpp, game/GameAgent.h, game/Level.cpp, game/Level.h, game/LevelNode.cpp, game/LevelNode.h, game/Makefile.am, game/NodeDrawer.cpp, game/NodeDrawer.h, game/Room.cpp, game/Room.h, game/WorldMap.cpp, game/WorldMap.h, game/game-script.cpp, game/game-script.h, gengine/KeyConsole.cpp: Beginning of menu with world map. 2004-05-06 16:52 fidlej * src/: game/Anim.cpp, game/Anim.h, game/Cube.cpp, game/Cube.h, game/Rules.cpp, game/Rules.h, game/Unit.cpp, game/Unit.h, game/ViewEffect.cpp, game/ViewEffect.h, gengine/Name.cpp, gengine/PlannedDialog.cpp, gengine/VideoAgent.cpp: Modified timing for disint. effect. 2004-05-06 02:54 fidlej * autogen.sh: Added autogen.sh 2004-05-06 02:25 fidlej * src/game/: GameAgent.cpp, Level.cpp, Level.h, game-script.cpp, game-script.h: Fixed demo planning and interrupts. 2004-05-06 01:55 fidlej * src/game/: Anim.h, Cube.cpp, Cube.h, Room.cpp, Rules.cpp, Rules.h, View.cpp, ViewEffect.h: Added nice disintegration animation for skeleton. 2004-05-06 00:44 fidlej * README, TODO, configure.in, main.aap, src/main.aap: Updated build scripts. 2004-05-05 02:48 fidlej * src/: game/Anim.cpp, game/Anim.h, game/Makefile.am, game/SurfaceLock.cpp, game/SurfaceLock.h, game/ViewEffect.cpp, game/ViewEffect.h, gengine/Random.cpp, gengine/Random.h: Disintegrate view effect is prepared for use. 2004-05-04 23:12 fidlej * src/game/: Room.cpp, Room.h: Fixed lockPhases for planning. 2004-05-04 21:03 fidlej * src/: game/Cube.cpp, game/GameAgent.cpp, gengine/Actor.cpp, gengine/Environ.cpp, gengine/Environ.h, gengine/ExInfo.h, gengine/Makefile.am, gengine/OptionAgent.cpp, gengine/OptionAgent.h, gengine/ResourcePack.h, gengine/ScriptAgent.cpp, gengine/ScriptAgent.h: Only persistent options are stored. 2004-05-04 14:17 fidlej * src/gengine/VideoAgent.cpp: Param 'caption' is displayed in caption title. 2004-05-04 13:50 fidlej * src/: game/Cube.cpp, game/GameAgent.cpp, game/GameAgent.h, game/Level.cpp, game/Level.h, game/Makefile.am, game/ModelFactory.cpp, game/ModelFactory.h, game/Room.cpp, game/Room.h, game/View.cpp, game/View.h, game/game-script.cpp, gengine/Dialog.cpp, gengine/DummySoundAgent.h, gengine/Makefile.am, gengine/OptionAgent.cpp, gengine/OptionAgent.h, gengine/ResDialogPack.h, gengine/ResFontPack.h, gengine/ResImageAgent.cpp, gengine/ResImageAgent.h, gengine/ResImagePack.h, gengine/ResSoundAgent.cpp, gengine/ResSoundAgent.h, gengine/ResSoundPack.cpp, gengine/ResSoundPack.h, gengine/SDLSoundAgent.cpp, gengine/SDLSoundAgent.h, gengine/ScriptState.cpp, gengine/SoundAgent.h: GameAgent is splited into Level and ModelFactory 2004-05-03 16:48 fidlej * src/gengine/: VideoAgent.cpp, VideoAgent.h: Icon is showed. 2004-05-03 16:27 fidlej * src/game/: Controls.cpp, Controls.h, GameAgent.cpp, Unit.cpp, Unit.h: Small fish always start as active. 2004-05-03 15:30 fidlej * src/game/Controls.cpp: Altered fish speedup. 2004-05-02 19:16 fidlej * src/game/GameAgent.cpp: Fixed locking of phases. 2004-05-02 18:53 fidlej * src/: game/Command.h, game/CommandQueue.cpp, game/CommandQueue.h, game/Controls.cpp, game/GameAgent.cpp, game/GameAgent.h, game/Makefile.am, game/Room.cpp, game/Room.h, game/ScriptCmd.cpp, game/ScriptCmd.h, game/game-script.cpp, game/game-script.h, game/main.cpp, gengine/ScriptState.cpp, gengine/ScriptState.h: New CommandQueue for action planning. 2004-04-30 00:07 fidlej * src/gengine/: Dialog.cpp, Dialog.h, PlannedDialog.cpp, PlannedDialog.h: Dialogs are lazy loaded. 2004-04-28 01:17 fidlej * src/game/: LoadException.h, Makefile.am: Added forgotten file. 2004-04-27 22:36 fidlej * src/: game/Controls.cpp, game/Controls.h, game/GameAgent.cpp, game/GameAgent.h, game/Room.cpp, game/Room.h, game/Unit.cpp, game/Unit.h, game/game-script.cpp, game/game-script.h, gengine/ResSoundAgent.cpp: Load and Save is working. 2004-04-27 03:42 fidlej * src/: game/ControlSym.h, game/Controls.cpp, game/Controls.h, game/Cube.cpp, game/Cube.h, game/Driver.h, game/GameAgent.cpp, game/GameAgent.h, game/KeyDriver.cpp, game/KeyDriver.h, game/Makefile.am, game/Room.cpp, game/Room.h, game/Rules.cpp, game/Rules.h, game/Unit.cpp, game/Unit.h, game/game-script.cpp, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/TimerAgent.h: New controls. Fishes can be controled by arrows and space. 2004-04-26 16:47 fidlej * src/: game/GameAgent.cpp, game/GameAgent.h, game/Room.cpp, game/Room.h, game/game-script.cpp, game/game-script.h, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/OptionAgent.cpp: Fixed bug with killed dialogs. Work on save/load has begun. 2004-04-26 00:16 fidlej * src/game/: GameAgent.cpp, Room.cpp, Room.h, Rules.cpp, main.cpp: Dialogs are killed when a fish leave. 2004-04-23 16:43 fidlej * src/gengine/Path.cpp: Stricter path checking. 2004-04-23 12:56 fidlej * Makefile.am: '#' is not portable in Makefile.am 2004-04-22 20:18 fidlej * AUTHORS, README, TODO, src/game/GameAgent.cpp, src/game/Title.cpp, src/game/main.cpp, src/gengine/DialogAgent.cpp, src/gengine/DialogAgent.h, src/gengine/OptionAgent.cpp, src/gengine/Path.cpp, src/gengine/Path.h: Updated authors info. Moved userdir to ~/.fillets-ng 2004-04-22 08:07 fidlej * src/: game/KeyDriver.cpp, gengine/Dialog.cpp, gengine/DialogAgent.cpp, gengine/DialogAgent.h: Dialog 'pause' is used to delay dialogs. 2004-04-21 15:14 fidlej * src/: game/KeyDriver.cpp, game/game-script.cpp, gengine/ResourcePack.h, gengine/SDLSoundAgent.cpp: Fixed no_music bug. 2004-04-21 14:08 fidlej * src/game/: KeyDriver.cpp, KeyDriver.h: Fixed compile time bug. 2004-04-21 14:06 fidlej * src/: game/KeyDriver.cpp, gengine/OptionAgent.cpp: LC_MESSAGES is not on win32. LC_ALL will be used. 2004-04-21 07:14 fidlej * src/: game/Cube.cpp, game/GameAgent.cpp, game/SubTitleAgent.cpp, gengine/Dialog.cpp, gengine/DialogAgent.cpp, gengine/InputAgent.cpp, gengine/OptionAgent.cpp, gengine/OptionAgent.h, gengine/ResDialogPack.cpp: User lang is set according to locale. 2004-04-21 02:25 fidlej * README, TODO, configure.in, src/game/GameAgent.cpp, src/game/KeyDriver.cpp, src/game/KeyDriver.h, src/game/Room.cpp: Fishes are speedup on long trace. 2004-04-20 23:57 fidlej * src/: game/Field.cpp, game/GameAgent.cpp, game/GameAgent.h, game/Room.cpp, game/Room.h, game/game-script.cpp, game/game-script.h, gengine/Actor.h: Function model_equals is alternative for FArray. 2004-04-20 23:18 fidlej * src/game/: GameAgent.cpp, GameAgent.h, game-script.cpp, game-script.h: Implemented game_getRestartCounter() 2004-04-20 20:11 fidlej * src/: game/GameAgent.cpp, gengine/Dialog.cpp, gengine/Dialog.h, gengine/PlannedDialog.cpp, gengine/PlannedDialog.h: New controls = ijkl,wasd. Fishes are talking even when there is no adequate wav 2004-04-20 16:29 fidlej * src/game/: GameAgent.cpp, GameAgent.h: Restart button = BackSpace. 2004-04-20 16:16 fidlej * src/game/: Cube.cpp, GameAgent.cpp: Added sound of dead. 2004-04-20 06:24 fidlej * src/game/Cube.cpp: Removed xplo sound. 2004-04-20 05:58 fidlej * src/: game/Cube.cpp, game/Cube.h, game/GameAgent.cpp, game/Room.cpp, game/Room.h, game/Rules.cpp, game/Rules.h, game/game-script.cpp, game/game-script.h, gengine/Random.cpp, gengine/ResourcePack.h: Fixed randint(0) bug. Added sound of impact. 2004-04-20 04:34 fidlej * src/: game/Cube.cpp, game/Cube.h, game/GameAgent.cpp, game/GameAgent.h, game/Rules.cpp, game/game-script.cpp, game/game-script.h, gengine/Actor.cpp, gengine/Actor.h, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/Makefile.am, gengine/PlannedDialog.cpp, gengine/PlannedDialog.h, gengine/SDLSoundAgent.cpp, gengine/TimerAgent.cpp: Expanded planDialog() with busy parameter. 2004-04-16 01:02 fidlej * src/game/game: Removed tmp file. 2004-04-16 00:32 fidlej * src/: game/FishDialog.cpp, game/FishDialog.h, game/GameAgent.cpp, game/game-script.cpp, game/game-script.h, gengine/Dialog.cpp, gengine/Dialog.h, gengine/DialogAgent.cpp, gengine/PlannedDialog.cpp, gengine/TimerAgent.cpp, gengine/TimerAgent.h: Fixed dialogs planning. Added some functions for scripts. 2004-04-15 02:35 fidlej * src/gengine/minmax.h: Offered min() and max() inline functions. 2004-04-15 02:35 fidlej * src/: game/Cube.cpp, game/Cube.h, game/GameAgent.cpp, game/Makefile.am, game/MarkMask.cpp, game/Shape.cpp, game/Shape.h, game/SubTitleAgent.cpp, game/game-script.cpp, game/game-script.h, gengine/KeyConsole.cpp, gengine/Makefile.am, gengine/ResourcePack.h, gengine/SDLSoundAgent.cpp, gengine/ScriptAgent.cpp, gengine/ScriptState.cpp, gengine/VideoAgent.cpp: Offered min() and max() inline functions. Added shape->getW() and getH() functions. 2004-04-13 01:03 fidlej * src/game/: Cube.cpp, Cube.h, Field.cpp, Field.h, GameAgent.cpp, Goal.cpp, Goal.h, Rules.cpp, game, game-script.cpp, game-script.h: Normal objects must not go out of screen. 2004-04-13 00:06 fidlej * src/: game/Cube.cpp, game/Cube.h, game/GameAgent.cpp, game/Goal.cpp, game/Goal.h, game/KeyDriver.cpp, game/Makefile.am, game/MarkMask.cpp, game/MarkMask.h, game/Room.cpp, game/Room.h, game/Rules.cpp, game/Rules.h, game/View.h, game/game, game/game-script.cpp, game/game-script.h, gengine/ScriptState.cpp: Goals can be set. 2004-04-12 19:18 fidlej * src/game/: Cube.h, GameAgent.cpp, KeyDriver.cpp, View.cpp, game, game-script.cpp, game-script.h, main.cpp: Offered change_turnSide() to the script. 2004-04-12 02:51 fidlej * src/: game/Anim.cpp, game/Application.cpp, game/Application.h, game/GameAgent.cpp, game/GameAgent.h, game/SubTitleAgent.cpp, game/SubTitleAgent.h, game/Title.cpp, game/Title.h, game/View.cpp, game/View.h, game/game, game/game-script.cpp, game/game-script.h, gengine/BaseAgent.h, gengine/BaseMsg.h, gengine/INamed.h, gengine/InputAgent.cpp, gengine/Name.cpp, gengine/Name.h, gengine/Path.cpp, gengine/Path.h, gengine/ResDialogPack.h, gengine/ResFontPack.h, gengine/ResImagePack.h, gengine/ResourcePack.h, gengine/ScriptAgent.cpp, gengine/SoundAgent.cpp, gengine/VideoAgent.cpp: Fixed dstrect-bliting bug. Added file_exists() script function. Changed getName() to return const char. 2004-04-11 05:42 fidlej * src/: game/Application.cpp, game/FishDialog.cpp, game/FishDialog.h, game/GameAgent.cpp, game/Makefile.am, game/SubTitleAgent.cpp, game/SubTitleAgent.h, game/Title.cpp, game/Title.h, game/View.h, game/game, game/game-script.cpp, game/game-script.h, gengine/Dialog.cpp, gengine/Dialog.h, gengine/DialogAgent.cpp, gengine/Makefile.am, gengine/Name.cpp, gengine/Name.h, gengine/Path.cpp, gengine/PlannedDialog.cpp, gengine/ResDialogPack.cpp, gengine/ResFontPack.cpp, gengine/ResFontPack.h, gengine/ResImageAgent.h, gengine/ResImagePack.h, gengine/ResourcePack.h, gengine/VideoAgent.cpp: Dialogs are working. 2004-04-10 21:03 fidlej * TODO, src/game/GameAgent.cpp, src/game/Rules.cpp: Updated TODO. 2004-04-10 20:21 fidlej * src/game/Rules.cpp: Fixed dead checking. 2004-04-10 19:47 fidlej * src/: game/Cube.cpp, game/Cube.h, game/Room.cpp, game/Rules.h, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/PlannedDialog.cpp, gengine/PlannedDialog.h: Dead fishes does not talk. 2004-04-10 19:01 fidlej * src/gengine/OptionAgent.cpp: Fixed command line options parsing. 2004-04-10 18:46 fidlej * src/: game/Anim.cpp, game/Anim.h, game/Cube.cpp, game/Cube.h, game/GameAgent.cpp, game/GameAgent.h, game/KeyDriver.cpp, game/Makefile.am, game/MarkMask.cpp, game/MarkMask.h, game/Room.cpp, game/Rules.cpp, game/Rules.h, game/View.cpp, game/View.h, game/game-script.cpp, game/game-script.h, gengine/V2.h: Cube.cpp is split in Rules. 2004-04-10 03:28 fidlej * src/game/: Cube.cpp, Cube.h: Fixed checking of dead states. 2004-04-10 02:15 fidlej * src/: game/Anim.cpp, game/Anim.h, game/Application.cpp, game/Cube.cpp, game/GameAgent.cpp, game/View.cpp, game/game-script.cpp, game/game-script.h, gengine/Dialog.cpp, gengine/Dialog.h, gengine/DialogAgent.cpp, gengine/DialogAgent.h, gengine/DummySoundAgent.h, gengine/Makefile.am, gengine/Name.cpp, gengine/Name.h, gengine/PlannedDialog.cpp, gengine/PlannedDialog.h, gengine/ResDialogPack.cpp, gengine/ResDialogPack.h, gengine/ResSoundAgent.cpp, gengine/ResSoundAgent.h, gengine/ResourcePack.h, gengine/SDLSoundAgent.cpp, gengine/SDLSoundAgent.h, gengine/SoundAgent.h, gengine/VideoAgent.cpp: Fishes can talk. addSpecialAnim() is for talking heads. 2004-04-09 14:32 fidlej * src/game/Cube.cpp: Fixed cyclic moveDirBrute bug. 2004-04-08 03:21 fidlej * configure.in, src/game/Anim.cpp, src/game/Anim.h, src/game/Cube.cpp, src/game/Cube.h, src/game/Driver.h, src/game/GameAgent.cpp, src/game/KeyDriver.cpp, src/game/Makefile.am, src/game/Room.cpp, src/game/View.cpp, src/game/View.h, src/game/game-script.cpp, src/game/game-script.h, src/gengine/ResourcePack.h, src/gengine/TimerAgent.h: Fish body animation. 2004-04-07 18:15 fidlej * TODO, src/game/Field.cpp, src/game/GameAgent.cpp, src/game/game-script.cpp, src/game/game-script.h, src/game/main.cpp, src/gengine/OptionAgent.cpp, src/gengine/OptionAgent.h, src/gengine/ResourcePack.h: Compilable on Win32. Added script_model_getDir(). 2004-04-06 03:04 fidlej * src/: game/GameAgent.cpp, game/Shape.cpp, gengine/ScriptState.cpp: '.' is used in levels for empty space. 2004-04-05 03:27 fidlej * src/: game/Cube.cpp, game/Cube.h, game/KeyDriver.cpp, game/KeyDriver.h, game/Room.cpp, game/View.cpp, gengine/TimerAgent.h: More stepless fish animation. 2004-04-04 05:53 fidlej * src/game/Application.cpp: './game sound=0' turns sound off 2004-04-04 05:46 fidlej * README, src/gengine/OptionAgent.cpp: Changed '/home/ivo/.fillets-ng' to 'HOME/fillets-ng'. Periods in directories and at the beginning of name are not portable. 2004-04-04 05:28 fidlej * configure.ac, configure.in: configure.ac renamed to configure.in for FreeBSD. 2004-04-04 05:27 fidlej * src/: game/Cube.cpp, game/Cube.h, game/GameAgent.cpp, game/GameAgent.h, game/Room.cpp, game/game-script.cpp, game/game-script.h, gengine/BaseAgent.h, gengine/InputAgent.cpp, gengine/InputAgent.h, gengine/KeyConsole.cpp, gengine/Log.cpp, gengine/NoCopy.h, gengine/Path.cpp, gengine/RectBinder.h, gengine/ResSoundAgent.cpp, gengine/ResourcePack.h, gengine/ScriptAgent.cpp, gengine/ScriptAgent.h, gengine/ScriptState.cpp: Ready for FreeBSD. 2004-04-04 03:19 fidlej * Makefile.cvs: Libtoolize generate config.sub but libtool is not need. 2004-04-04 02:57 fidlej * configure.ac: More helpful messages. 2004-04-04 02:39 fidlej * configure.ac: Support for boost compiler abbreviation. 2004-04-04 02:24 fidlej * configure.ac: Removed -I/usr/include -I/usr/local/include 2004-04-04 00:59 fidlej * configure.ac, src/game/Makefile.am, src/gengine/Makefile.am: Tweaked boost in configure.ac 2004-04-03 23:43 fidlej * configure.ac: Next lua tweak in configure.ac 2004-04-03 23:18 fidlej * src/gengine/: ScriptState.cpp, ScriptState.h: Added ScriptState 2004-04-03 23:16 fidlej * Makefile.cvs: libtoolize should generate config.sub 2004-04-03 23:01 fidlej * Makefile.cvs: Tweaked cvs2cl in Makefile.cvs 2004-04-03 22:47 fidlej * configure.ac, src/game/Makefile.am, src/gengine/Makefile.am: Improved configure.ac for lua checking. 2004-04-03 00:58 fidlej * src/game/: Cube.cpp, Cube.h, GameAgent.cpp, Room.cpp, Room.h: All fishes are dead at the same moment. 2004-04-02 20:50 fidlej * src/gengine/ResourceAgent.h: Removed old ResourceAgent.h 2004-04-02 20:49 fidlej * configure.ac, src/game/View.h: Fixed public members in Views. 2004-04-02 14:59 fidlej * README: Updated README 2004-04-02 02:41 fidlej * README, TODO: Polished README and TODO. 2004-04-02 00:56 fidlej * src/gengine/: ResImagePack.cpp, ResImagePack.h, ResourcePack.h: Forgotten files. 2004-04-02 00:55 fidlej * src/: game/GameAgent.cpp, game/View.cpp, game/View.h, gengine/Makefile.am, gengine/ResImageAgent.cpp, gengine/ResImageAgent.h, gengine/ResSoundAgent.cpp, gengine/ResSoundAgent.h: ResourceAgent is split to ResourcePack and agents. 2004-04-02 00:22 fidlej * src/: game/Cube.cpp, game/GameAgent.cpp, game/Room.cpp, game/game-script.cpp, gengine/Log.cpp, gengine/Makefile.am, gengine/OptionAgent.cpp, gengine/Path.cpp, gengine/Path.h, gengine/ScriptAgent.cpp, gengine/ScriptException.h: User options are read before system options. 2004-04-01 22:56 fidlej * README, src/game/Application.cpp, src/game/Application.h, src/gengine/OptionAgent.cpp, src/gengine/OptionAgent.h, src/gengine/Path.cpp, src/gengine/Path.h: Creating not existing user paths. 2004-04-01 21:11 fidlej * .cvsignore, AUTHORS, Doxyfile, Makefile.am, Makefile.cvs, NEWS, README, TODO, configure.ac, main.aap, sdl.m4, src/.cvsignore, src/Makefile.am, src/main.aap, src/game/.cvsignore, src/game/Application.cpp, src/game/Application.h, src/game/Cube.cpp, src/game/Cube.h, src/game/Driver.h, src/game/Field.cpp, src/game/Field.h, src/game/GameAgent.cpp, src/game/GameAgent.h, src/game/KeyControl.cpp, src/game/KeyControl.h, src/game/KeyDriver.cpp, src/game/KeyDriver.h, src/game/LayoutException.h, src/game/Makefile.am, src/game/MarkMask.cpp, src/game/MarkMask.h, src/game/Picture.cpp, src/game/Picture.h, src/game/Room.cpp, src/game/Room.h, src/game/Shape.cpp, src/game/Shape.h, src/game/View.cpp, src/game/View.h, src/game/game-script.cpp, src/game/game-script.h, src/game/main.cpp, src/gengine/.cvsignore, src/gengine/AgentPack.cpp, src/gengine/AgentPack.h, src/gengine/BaseAgent.cpp, src/gengine/BaseAgent.h, src/gengine/BaseException.cpp, src/gengine/BaseException.h, src/gengine/BaseListener.cpp, src/gengine/BaseListener.h, src/gengine/BaseMsg.cpp, src/gengine/BaseMsg.h, src/gengine/DummySoundAgent.h, src/gengine/ExInfo.cpp, src/gengine/ExInfo.h, src/gengine/IDrawer.cpp, src/gengine/IDrawer.h, src/gengine/INamed.h, src/gengine/ImgException.cpp, src/gengine/ImgException.h, src/gengine/InputAgent.cpp, src/gengine/InputAgent.h, src/gengine/IntMsg.cpp, src/gengine/IntMsg.h, src/gengine/KeyBinder.cpp, src/gengine/KeyBinder.h, src/gengine/KeyConsole.cpp, src/gengine/KeyConsole.h, src/gengine/KeyStroke.cpp, src/gengine/KeyStroke.h, src/gengine/Log.cpp, src/gengine/Log.h, src/gengine/LogicException.h, src/gengine/Makefile.am, src/gengine/MessagerAgent.cpp, src/gengine/MessagerAgent.h, src/gengine/MixException.cpp, src/gengine/MixException.h, src/gengine/Name.cpp, src/gengine/Name.h, src/gengine/NameException.h, src/gengine/NoCopy.h, src/gengine/OptionAgent.cpp, src/gengine/OptionAgent.h, src/gengine/Path.cpp, src/gengine/Path.h, src/gengine/Random.cpp, src/gengine/Random.h, src/gengine/RectBinder.cpp, src/gengine/RectBinder.h, src/gengine/ResImageAgent.cpp, src/gengine/ResImageAgent.h, src/gengine/ResSoundAgent.cpp, src/gengine/ResSoundAgent.h, src/gengine/ResourceAgent.h, src/gengine/ResourceException.h, src/gengine/SDLException.cpp, src/gengine/SDLException.h, src/gengine/SDLSoundAgent.cpp, src/gengine/SDLSoundAgent.h, src/gengine/ScriptAgent.cpp, src/gengine/ScriptAgent.h, src/gengine/SimpleMsg.h, src/gengine/SoundAgent.cpp, src/gengine/SoundAgent.h, src/gengine/StringMsg.cpp, src/gengine/StringMsg.h, src/gengine/StringTool.cpp, src/gengine/StringTool.h, src/gengine/TimerAgent.cpp, src/gengine/TimerAgent.h, src/gengine/UnknownMsgException.h, src/gengine/V2.h, src/gengine/VideoAgent.cpp, src/gengine/VideoAgent.h: 2004-04-01 18:39 fidlej * fillets-ng = Fish Fillets - Next Generation 2004-04-01 18:35 fidlej * Updated documentation. 2004-04-01 13:36 fidlej * Preparation for sf.net 2004-04-01 02:54 fidlej * Optinal anim phase number. Simpler checkDead. 2004-03-31 06:29 fidlej * Skeleton animation. 2004-03-31 03:30 fidlej * Command line args are parsed. Usage: bash [name=value ...] 2004-03-30 19:39 fidlej * Check dead states. 2004-03-30 04:16 fidlej * Fixed mask/unmask problem. 2004-03-30 03:34 fidlej * Setting direction before move. All moves are made at start of nextRound. Basic animation. 2004-03-29 05:31 fidlej * Beginning of animation 2004-03-29 04:50 fidlej * Added script to convert all .bmp to .png 2004-03-29 04:49 fidlej * Level Pravidla.lua 2004-03-29 00:45 fidlej * Support aplha in PNG. 2004-03-28 23:34 fidlej * Typedefs are private now. 2004-03-28 23:28 fidlej * Level example. 2004-03-28 23:27 fidlej * New level format with pictures. 2004-03-26 19:11 fidlej * Added forgotten files for resource agents. 2004-03-26 01:25 fidlej * Proper console name. 2004-03-25 01:07 fidlej * Removed old console.bmp 2004-03-25 01:07 fidlej * New console font 2004-03-24 22:36 fidlej * Moved loadImage to ResImageAgent. Added SDL_image library (allows transparent PNG). 2004-03-24 22:11 fidlej * ResouceAgent template and ResSound and ResImage 2004-03-24 19:39 fidlej * IDrawer accepts screen in constructor and removes from drawers in destructor. 2004-03-23 16:36 fidlej * Added mini_app example 2004-03-23 02:50 fidlej * Big-edian safe getPixel 2004-03-23 01:38 fidlej * VideoAgent handle screen_* params change 2004-03-22 11:05 fidlej * Smaller console font 2004-03-22 10:52 fidlej * Proper shutdown after exception. 2004-03-22 01:08 fidlej * Updated automake scripts 2004-03-22 00:30 fidlej * Play sound at crash 2004-03-22 00:10 fidlej * See script/level.lua for level placement 2004-03-21 22:31 fidlej * Big and small fish with different controls 2004-03-21 21:01 fidlej * Open Can engine 2004-03-16 22:06 fidlej * Window moves with KP_4,... 2004-03-16 16:51 fidlej * Options is saved on shutdown. 2004-03-16 16:38 fidlej * User x System data path. Updated param watchers registery 2004-03-16 03:12 fidlej * Normal screen width. 2004-03-16 03:07 fidlej * New SFont library, SDL_gfx is out. 2004-03-15 03:00 fidlej * OptionAgent ... game options, script/init.lua contain screen size 2004-03-14 16:44 fidlej * rotozoomSurface discard colorKey (in 32bpp) 2004-03-07 21:00 fidlej * Recipe for data install 2004-03-07 20:16 fidlej * Try a-a-p.org 2004-03-05 16:38 fidlej * Removed useless AC_DEFINE 2004-03-05 15:45 fidlej * Game data are searched in . 2004-03-04 06:13 fidlej * Enabled key repeat. Written README. 2004-03-03 22:26 fidlej * Debug LUA script console. 2004-03-02 23:36 fidlej * Modern lua_dofile with lua_pcall(luaL_loadFile()), dofile is obsolete. 2004-03-02 15:46 fidlej * lua scripts are moved to data/script/ 2004-03-02 15:44 fidlej * SDL_gfx = rotozoom, is now part of package 2004-03-02 04:28 fidlej * Dangerous uninstall-data-local 2004-03-02 04:19 fidlej * Install hooks for directories. 2004-03-02 03:17 fidlej * ChangeLog is generated by cvs2cl 2004-03-02 02:58 fidlej * Added automake install scripts. 2004-03-02 02:58 fidlej * Initial revision 2004-04-01 21:11 fidlej * .cvsignore, AUTHORS, Doxyfile, Makefile.am, Makefile.cvs, NEWS, README, TODO, configure.ac, main.aap, sdl.m4, src/.cvsignore, src/Makefile.am, src/main.aap, src/game/.cvsignore, src/game/Application.cpp, src/game/Application.h, src/game/Cube.cpp, src/game/Cube.h, src/game/Driver.h, src/game/Field.cpp, src/game/Field.h, src/game/GameAgent.cpp, src/game/GameAgent.h, src/game/KeyControl.cpp, src/game/KeyControl.h, src/game/KeyDriver.cpp, src/game/KeyDriver.h, src/game/LayoutException.h, src/game/Makefile.am, src/game/MarkMask.cpp, src/game/MarkMask.h, src/game/Picture.cpp, src/game/Picture.h, src/game/Room.cpp, src/game/Room.h, src/game/Shape.cpp, src/game/Shape.h, src/game/View.cpp, src/game/View.h, src/game/game-script.cpp, src/game/game-script.h, src/game/main.cpp, src/gengine/.cvsignore, src/gengine/AgentPack.cpp, src/gengine/AgentPack.h, src/gengine/BaseAgent.cpp, src/gengine/BaseAgent.h, src/gengine/BaseException.cpp, src/gengine/BaseException.h, src/gengine/BaseListener.cpp, src/gengine/BaseListener.h, src/gengine/BaseMsg.cpp, src/gengine/BaseMsg.h, src/gengine/DummySoundAgent.h, src/gengine/ExInfo.cpp, src/gengine/ExInfo.h, src/gengine/IDrawer.cpp, src/gengine/IDrawer.h, src/gengine/INamed.h, src/gengine/ImgException.cpp, src/gengine/ImgException.h, src/gengine/InputAgent.cpp, src/gengine/InputAgent.h, src/gengine/IntMsg.cpp, src/gengine/IntMsg.h, src/gengine/KeyBinder.cpp, src/gengine/KeyBinder.h, src/gengine/KeyConsole.cpp, src/gengine/KeyConsole.h, src/gengine/KeyStroke.cpp, src/gengine/KeyStroke.h, src/gengine/Log.cpp, src/gengine/Log.h, src/gengine/LogicException.h, src/gengine/Makefile.am, src/gengine/MessagerAgent.cpp, src/gengine/MessagerAgent.h, src/gengine/MixException.cpp, src/gengine/MixException.h, src/gengine/Name.cpp, src/gengine/Name.h, src/gengine/NameException.h, src/gengine/NoCopy.h, src/gengine/OptionAgent.cpp, src/gengine/OptionAgent.h, src/gengine/Path.cpp, src/gengine/Path.h, src/gengine/Random.cpp, src/gengine/Random.h, src/gengine/RectBinder.cpp, src/gengine/RectBinder.h, src/gengine/ResImageAgent.cpp, src/gengine/ResImageAgent.h, src/gengine/ResSoundAgent.cpp, src/gengine/ResSoundAgent.h, src/gengine/ResourceAgent.h, src/gengine/ResourceException.h, src/gengine/SDLException.cpp, src/gengine/SDLException.h, src/gengine/SDLSoundAgent.cpp, src/gengine/SDLSoundAgent.h, src/gengine/ScriptAgent.cpp, src/gengine/ScriptAgent.h, src/gengine/SimpleMsg.h, src/gengine/SoundAgent.cpp, src/gengine/SoundAgent.h, src/gengine/StringMsg.cpp, src/gengine/StringMsg.h, src/gengine/StringTool.cpp, src/gengine/StringTool.h, src/gengine/TimerAgent.cpp, src/gengine/TimerAgent.h, src/gengine/UnknownMsgException.h, src/gengine/V2.h, src/gengine/VideoAgent.cpp, src/gengine/VideoAgent.h: Initial revision fillets-ng-1.0.1/depcomp0000755000175000017500000003710011124710416012051 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # 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 # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # 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., 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 # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: fillets-ng-1.0.1/Makefile.am0000644000175000017500000000014610131633232012525 00000000000000 SUBDIRS = src man_MANS = fillets.6 EXTRA_DIST = ChangeLog $(man_MANS) ChangeLog: touch ChangeLog fillets-ng-1.0.1/AUTHORS0000644000175000017500000000202111632203503011534 00000000000000Ivo Danihelka - main developer - developed new game engine Pavel Danihelka - webmaster, level data, documentation Mirek Olsak - many new levels, undo Frederic Panico - French translation Ronny Standtke - German translation Simone Cociancich - Italian translation Przemek Bojczuk - Polish translation César Catrián C. - Spanish translation Astrid de Wijn - Dutch translation Damyan Ivanov - Bulgarian translation Olov Gustavsson - Swedish translation Marko Burjek - Slovenian translation Ricardo Faria - Brazilian Portuguese translation Leonid Myravjev - Russian translation ALTAR interactive - developed original game in 1998 (for Win32) - released code and data under GNU/GPL in 03/2004 fillets-ng-1.0.1/config.sub0000755000175000017500000007772410707444443012511 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2007-06-28' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # 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., 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 # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: fillets-ng-1.0.1/fillets.60000644000175000017500000001072411047536024012235 00000000000000.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH fillets 6 "April 18, 2005" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME fillets \- puzzle game about witty fish saving the world sokoban style .SH SYNOPSIS .B fillets .RI [ options ] .br .SH DESCRIPTION .PP \fBFish Fillets \fPis strictly a puzzle game. The goal in every of the seventy levels is always the same: find a safe way out. The fish utter witty remarks about their surroundings, the various inhabitants of their underwater realm quarrel among themselves or comment on the efforts of your fish. The whole game is accompanied by quiet, comforting music. .PP There is an excellent in game tutorial available, so you can start playing right away. .PP .SH OPTIONS .TP .B \-h, \-\-help Show summary of options. .TP .B \-v, \-\-version Show version of program. .TP .B \-c, \-\-config Show config variables and values. .TP .B fullscreen= Turn fullscreen on/off. .br Default: fullscreen=0 .TP .B lang= ISO 639 2-letter code (for ex.: en, cs, fr, de) .br see http://www.w3.org/WAI/ER/IG/ert/iso639.htm .br Default: lang=LC_MESSAGES .TP .B loglevel= Loglevel uses same numbers as syslog. .br for ex.: 3 for ERROR, 4 for WARNING, 6 for INFO, 7 for DEBUG .br Default: loglevel=6 .TP .B show_steps= Show step counter in level. .br Default: show_steps=0 .TP .B sound= Turn sound on/off. .br Default: sound=1 .TP .B speech= ISO 639 2-letter code (for ex.: en, cs, fr, de) .br see http://www.w3.org/WAI/ER/IG/ert/iso639.htm .br Default: same as lang .TP .B subtitles= Show subtitles in level. .br Default: subtitles=1 .TP .B systemdir= Path to game data. .TP .B userdir= Path to game data. .br Default: userdir=$HOME/.fillets-ng .TP .B volume_sound= Sound volume in percentage. .br Default: volume_sound=90 .TP .B volume_music= Music volume in percentage. .br Default: volume_music=50 .TP .B worldmap= Relative path to worldmap file. .br Useful for external levels. .br Default: worldmap=script/worldmap.lua .PP .SH USAGE Up, down, left and right arrow keys control the current fish. .br Use space bar to switch between the fish. .PP restart level - Backspace .br undo - - .br help - F1 .br save game - F2 .br load game - F3 .br show/hide level move counter - F5 .br show/hide subtitles - F6 .br game menu - F10 .br toggle fullscreen - F11 .br increase game speed - hold down Shift .PP Find more information in the "How to Play" html manual listed below. .PP .SH SEE ALSO .BR /usr/share/doc/fillets-ng/html/manual.html .br .BR http://fillets.sf.net .br .SH AUTHORS .PP Fish Fillets - Next Generation was written by .PP Ivo Danihelka .br - main developer .br - developed new game engine .PP Pavel Danihelka .br - webmaster, level data, documentation .PP Frederic Panico .br - French translation .PP Ronny Standtke .br - German translation .PP Simone Cociancich .br - Italian translation .PP Przemek Bojczuk .br - Polish translation .PP César Catrián C. .br - Spanish translation .PP Astrid de Wijn .br - Dutch translation .PP Damyan Ivanov .br - Bulgarian translation .PP Olov Gustavsson .br - Swedish translation .PP Marko Burjek .br - Slovenian translation .PP Ricardo Faria .br - Brazilian Portuguese translation .PP Leonid Myravjev .br - Russian translation .PP ALTAR interactive .br - developed original game in 1998 (for Win32) .br - released code and data under GNU/GPL in 03/2004 .PP This manual page was written for the Debian distribution because the original program did not have a manual page. .PP This manual page was written by fabian linzberger , for the Debian project (but may be used by others). fillets-ng-1.0.1/TODO0000644000175000017500000000015011206053570011161 00000000000000TODO - draw nice curves at worldmap - tooltips for pedometer - level editor - does anybody need this? fillets-ng-1.0.1/README0000644000175000017500000000254711213003704011355 00000000000000Fish Fillets - Next Generation http://fillets.sf.net Compile requirements ==================== Library SDL = Simple DirectMedia Layer (video, input, sound) - libSDL >= 1.2, www.libsdl.org Library SDL_mixer (multiple sounds) - libSDL_mixer >= 1.2.5, http://www.libsdl.org/projects/SDL_mixer/ Library SDL_image (PNG support) - libSDL_image, http://www.libsdl.org/projects/SDL_image/ Library SDL_ttf (TrueType UTF-8 fonts) - libSDL_ttf, http://www.libsdl.org/projects/SDL_ttf/ Library LUA (script language, used for debug console, configuration, levels,...) - liblua50, www.lua.org - liblualib50 How to run ========== I. Compile ---------- - Compile the game: $ tar xzf fillets-ng.tar.gz $ cd fillets-ng $ ./configure $ make $ make install II. Install data ---------------- - Download fillets-ng-data from http://fillets.sourceforge.net/download.php - Extract fillets-ng-data.tar.gz to a $datadir. default: /usr/local/share/games/fillets-ng/ III. Run it ----------- $ ./src/game/fillets systemdir=$datadir Controls ======== Up, down, left and right arrow keys control the current fish. Use space bar to switch between the fish. See also "How to Play" $datadir/doc/html/manual.html restart level - Backspace undo - -/+ help - F1 save game - F2 load game - F3 show/hide move counter - F5 show/hide subtitles - F6 game menu - F10 fullscreen - F11 faster game - Shift fillets-ng-1.0.1/INSTALL0000644000175000017500000001722710702117635011542 00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. fillets-ng-1.0.1/sdl.m40000644000175000017500000001410710033064516011523 00000000000000# Configure paths for SDL # Sam Lantinga 9/21/99 # stolen from Manish Singh # stolen back from Frank Belew # stolen from Manish Singh # Shamelessly stolen from Owen Taylor 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], [dnl dnl Get the cflags and libraries from the sdl-config script dnl AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], sdl_prefix="$withval", sdl_prefix="") AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], sdl_exec_prefix="$withval", sdl_exec_prefix="") AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], , 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 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 fi AC_REQUIRE([AC_CANONICAL_TARGET]) PATH="$prefix/bin:$prefix/usr/bin:$PATH" 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_major_version=`$SDL_CONFIG $sdl_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` sdl_minor_version=`$SDL_CONFIG $sdl_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_LIBS="$LIBS" CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" dnl dnl Now check if the installed SDL is sufficiently new. (Also sanity dnl checks the results of sdl-config to some extent dnl rm -f conf.sdltest AC_TRY_RUN([ #include #include #include #include "SDL.h" char* my_strdup (char *str) { char *new_str; if (str) { new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); strcpy (new_str, str); } else new_str = NULL; return new_str; } int main (int argc, char *argv[]) { int major, minor, micro; char *tmp_version; /* This hangs on some systems (?) system ("touch conf.sdltest"); */ { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = my_strdup("$min_sdl_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_sdl_version"); exit(1); } if (($sdl_major_version > major) || (($sdl_major_version == major) && ($sdl_minor_version > minor)) || (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) { return 0; } else { printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); printf("*** best to upgrade to the required version.\n"); printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); printf("*** to point to the correct copy of sdl-config, and remove the file\n"); printf("*** config.cache before re-running configure\n"); return 1; } } ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_sdl" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$SDL_CONFIG" = "no" ; then echo "*** The sdl-config script installed by SDL could not be found" echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SDL_CONFIG environment variable to the" echo "*** full path to sdl-config." else if test -f conf.sdltest ; then : else echo "*** Could not run SDL test program, checking why..." CFLAGS="$CFLAGS $SDL_CFLAGS" LIBS="$LIBS $SDL_LIBS" AC_TRY_LINK([ #include #include "SDL.h" int main(int argc, char *argv[]) { return 0; } #undef main #define main K_and_R_C_main ], [ return 0; ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding SDL or finding the wrong" echo "*** version of SDL. If it is not finding SDL, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means SDL was incorrectly installed" 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" LIBS="$ac_save_LIBS" fi fi SDL_CFLAGS="" SDL_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(SDL_CFLAGS) AC_SUBST(SDL_LIBS) rm -f conf.sdltest ]) fillets-ng-1.0.1/src/0000777000175000017500000000000011632204504011346 500000000000000fillets-ng-1.0.1/src/level/0000777000175000017500000000000011632204504012455 500000000000000fillets-ng-1.0.1/src/level/Decor.h0000644000175000017500000000037310073033757013611 00000000000000#ifndef HEADER_DECOR_H #define HEADER_DECOR_H class View; #include "SDL.h" /** * Screen decoration. */ class Decor { public: virtual ~Decor() {} virtual void drawOnScreen(const View *view, SDL_Surface *screen) = 0; }; #endif fillets-ng-1.0.1/src/level/Goal.cpp0000644000175000017500000000414110104741577013770 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Goal.h" #include "Cube.h" //----------------------------------------------------------------- Goal::Goal(eSATISFY out, eSATISFY alive) { m_out = out; m_alive = alive; } //----------------------------------------------------------------- Goal Goal::noGoal() { return Goal(SATISFY_IGNORE, SATISFY_IGNORE); } //----------------------------------------------------------------- Goal Goal::outGoal() { return Goal(SATISFY_TRUE, SATISFY_IGNORE); } //----------------------------------------------------------------- Goal Goal::escapeGoal() { return Goal(SATISFY_TRUE, SATISFY_TRUE); } //----------------------------------------------------------------- Goal Goal::aliveGoal() { return Goal(SATISFY_IGNORE, SATISFY_TRUE); } //----------------------------------------------------------------- bool Goal::isSatisfy(const Cube *model) const { bool result = true; if (SATISFY_TRUE == m_out) { result &= model->isOut(); } else if (SATISFY_FALSE == m_out) { result &= (!model->isOut()); } if (SATISFY_TRUE == m_alive) { result &= model->isAlive(); } else if (SATISFY_FALSE == m_alive) { result &= (!model->isAlive()); } return result; } //----------------------------------------------------------------- /** * Return whether goal cannot by solved any more. * Dead fish cannot be revived. * Object out of room cannot go back. */ bool Goal::isWrong(const Cube *model) const { bool wrong = false; if (SATISFY_TRUE == m_alive) { wrong |= !model->isAlive(); } if (SATISFY_FALSE == m_out) { wrong |= model->isOut(); } return wrong; } //----------------------------------------------------------------- bool Goal::shouldGoOut() const { return SATISFY_TRUE == m_out; } fillets-ng-1.0.1/src/level/ModelList.h0000644000175000017500000000075010110454734014442 00000000000000#ifndef HEADER_MODELLIST_H #define HEADER_MODELLIST_H class View; class Landslip; #include "Cube.h" #include /** * Wrapper around list of models. */ class ModelList { private: const Cube::t_models *m_models; public: ModelList(const Cube::t_models *models); int size() const { return m_models->size(); } void drawOn(View *view) const; bool stoneOn(Landslip *slip) const; bool fallOn(Landslip *slip) const; }; #endif fillets-ng-1.0.1/src/level/Field.h0000644000175000017500000000100610677223343013574 00000000000000#ifndef HEADER_FIELD_H #define HEADER_FIELD_H class V2; class Cube; #include "NoCopy.h" /** * Two dimensional game field. */ class Field : public NoCopy { private: int m_w; int m_h; Cube ***m_marks; Cube *m_border; public: Field(int w, int h); ~Field(); int getW() const { return m_w; } int getH() const { return m_h; } Cube *getModel(const V2 &loc); void setModel(const V2 &loc, Cube *model, Cube *toOverride); }; #endif fillets-ng-1.0.1/src/level/LevelInput.h0000644000175000017500000000150611212501736014634 00000000000000#ifndef HEADER_LEVELINPUT_H #define HEADER_LEVELINPUT_H class Level; class Keymap; class KeyStroke; #include "GameInput.h" /** * Handle input for level. */ class LevelInput : public GameInput { private: static const int KEY_SWITCH = 101; static const int KEY_SAVE = 102; static const int KEY_LOAD = 103; static const int KEY_RESTART = 104; static const int KEY_UNDO = 105; static const int KEY_REDO = 106; static const int KEY_SHOW_STEPS = 107; private: Level *getLevel(); protected: virtual void specKey(int keyIndex); virtual void specStroke(const KeyStroke &stroke); public: LevelInput(Level *level); virtual void mouseEvent(const MouseStroke &buttons); virtual void keyUp(const KeyStroke &stroke); }; #endif fillets-ng-1.0.1/src/level/OnWall.h0000644000175000017500000000062611264423267013754 00000000000000#ifndef HEADER_ONWALL_H #define HEADER_ONWALL_H #include "OnCondition.h" #include "Cube.h" /** * Test whether model is on Wall. */ class OnWall : public OnCondition { public: virtual bool isSatisfy(Cube *model) const { return model->isWall(); } virtual bool isWrong(Cube *model) const { return model->isAlive(); } }; #endif fillets-ng-1.0.1/src/level/StatusDisplay.h0000644000175000017500000000065210105424776015367 00000000000000#ifndef HEADER_STATUSDISPLAY_H #define HEADER_STATUSDISPLAY_H class Picture; #include "Drawable.h" /** * Show status change. */ class StatusDisplay : public Drawable { private: Picture *m_picture; int m_time; public: StatusDisplay(); virtual ~StatusDisplay(); void displayStatus(Picture *new_picture, int time); virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/level/FinderField.cpp0000644000175000017500000000354510120337565015264 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "FinderField.h" #include "V2.h" #include // memset() //----------------------------------------------------------------- /** * Two dimensional array of booleans. */ FinderField::FinderField(int w, int h) { m_w = w; m_h = h; //NOTE: [y][x] indexes m_closed = new bool*[m_h]; for (int y = 0; y < m_h; ++y) { m_closed[y] = new bool[m_w]; memset(m_closed[y], false, sizeof(bool) * m_w); } } //----------------------------------------------------------------- FinderField::~FinderField() { for (int y = 0; y < m_h; ++y) { delete[] m_closed[y]; } delete[] m_closed; } //----------------------------------------------------------------- /** * Erase all marks. */ void FinderField::reset() { for (int y = 0; y < m_h; ++y) { memset(m_closed[y], false, sizeof(bool) * m_w); } } //----------------------------------------------------------------- /** * Mark given place as closed. */ void FinderField::markClosed(const V2 &loc) { int x = loc.getX(); int y = loc.getY(); if ((0 <= x && x < m_w) && (0 <= y && y < m_h)) { m_closed[y][x] = true; } } //----------------------------------------------------------------- /** * Returns true when place is closed. * NOTE: all places outside array are marked as closed */ bool FinderField::isClosed(const V2 &loc) const { int x = loc.getX(); int y = loc.getY(); bool result = true; if ((0 <= x && x < m_w) && (0 <= y && y < m_h)) { result = m_closed[y][x]; } return result; } fillets-ng-1.0.1/src/level/Controls.cpp0000644000175000017500000002273711210313354014707 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Controls.h" #include "Unit.h" #include "PhaseLocker.h" #include "KeyStroke.h" #include "MouseStroke.h" //----------------------------------------------------------------- /** * Create list of drivers. * @param locker shared locker for anim */ Controls::Controls(PhaseLocker *locker) : m_units(), m_moves() { m_locker = locker; m_active = m_units.begin(); m_speedup = 0; m_switch = true; m_strokeSymbol = ControlSym::SYM_NONE; } //----------------------------------------------------------------- /** * Delete drivers. */ Controls::~Controls() { t_units::iterator end = m_units.end(); for (t_units::iterator i = m_units.begin(); i != end; ++i) { delete (*i); } } //----------------------------------------------------------------- /** * Add unit under our control. * @return model index */ void Controls::addUnit(Unit *unit) { m_units.push_back(unit); //NOTE: insertion invalidates m_active t_units::iterator end = m_units.end(); for (t_units::iterator i = m_units.begin(); i != end; ++i) { if ((*i)->startActive()) { setActive(i); return; } } setActive(m_units.begin()); } //----------------------------------------------------------------- /** * Returns active unit or NULL. */ const Unit * Controls::getActive() { Unit *result = NULL; if (m_active != m_units.end()) { result = *m_active; } return result; } //----------------------------------------------------------------- /** * Let drivers to drive. * Only one driver can drive at the same time. * @param input wrapped input * @return true when a fish has moved (switch does not count) */ bool Controls::driving(const InputProvider *input) { bool moved = false; if (!useSwitch()) { if (!useStroke()) { moved = driveUnit(input); } else { moved = true; } } return moved; } //----------------------------------------------------------------- /** * Returns true when a switch was done. */ bool Controls::useSwitch() { bool result = false; if (m_active != m_units.end()) { if (!(*m_active)->willMove()) { checkActive(); } if (m_switch && m_active != m_units.end()) { m_locker->ensurePhases(3); (*m_active)->activate(); result = true; } } m_switch = false; return result; } //----------------------------------------------------------------- /** * Use gathered stroke. * NOTE: returns true even for bad move (not used) * @return true for used stroke */ bool Controls::useStroke() { bool result = false; if (m_strokeSymbol != ControlSym::SYM_NONE) { makeMove(m_strokeSymbol); m_strokeSymbol = ControlSym::SYM_NONE; result = true; } return result; } //----------------------------------------------------------------- bool Controls::driveUnit(const InputProvider *input) { char moved = ControlSym::SYM_NONE; if (m_active != m_units.end()) { moved = (*m_active)->driveBorrowed(input, m_arrows); } if (ControlSym::SYM_NONE == moved) { t_units::iterator end = m_units.end(); for (t_units::iterator i = m_units.begin(); i != end; ++i) { moved = (*i)->drive(input); if (moved != ControlSym::SYM_NONE) { setActive(i); break; } } } if (moved != ControlSym::SYM_NONE) { m_moves.append(1, moved); } return (moved != ControlSym::SYM_NONE); } //----------------------------------------------------------------- void Controls::lockPhases() { if (m_active != m_units.end() && (*m_active)->isMoving()) { if ((*m_active)->isPushing()) { m_speedup = 0; } else if (!(*m_active)->isTurning()) { m_speedup++; } m_locker->ensurePhases(getNeededPhases(m_speedup)); } else { m_speedup = 0; } } //----------------------------------------------------------------- int Controls::getNeededPhases(int speedup) const { static const int SPEED_WARP1 = 6; static const int SPEED_WARP2 = 10; int phases = 3; if (m_active != m_units.end()) { if ((*m_active)->isTurning()) { phases = (*m_active)->countAnimPhases("turn"); } else if (speedup > SPEED_WARP2) { phases = (*m_active)->countAnimPhases("swam") / 6; } else if (speedup > SPEED_WARP1) { phases = (*m_active)->countAnimPhases("swam") / 3; } else { phases = (*m_active)->countAnimPhases("swam") / 2; } } return phases; } //----------------------------------------------------------------- /** * Check whether active unit can still drive, * otherwise make switch. */ void Controls::checkActive() { if (m_active == m_units.end() || !(*m_active)->canDrive()) { switchActive(); } } //----------------------------------------------------------------- /** * Switch active unit. * Activate next driveable unit. */ void Controls::switchActive() { if (!m_units.empty()) { t_units::iterator start = m_active; do { if (m_active == m_units.end() || m_active + 1 == m_units.end()) { m_active = m_units.begin(); } else { ++m_active; } } while (m_active != start && !(*m_active)->canDrive()); if (start != m_active) { m_speedup = 0; m_switch = true; } } } //----------------------------------------------------------------- /** * Obtain first control symbol from keyboard events. */ void Controls::controlEvent(const KeyStroke &stroke) { SDLKey key = stroke.getKey(); if (m_strokeSymbol == ControlSym::SYM_NONE) { if (m_active != m_units.end()) { m_strokeSymbol = (*m_active)->mySymbolBorrowed(key, m_arrows); } if (m_strokeSymbol == ControlSym::SYM_NONE) { t_units::iterator end = m_units.end(); for (t_units::iterator i = m_units.begin(); i != end; ++i) { m_strokeSymbol = (*i)->mySymbol(key); if (m_strokeSymbol != ControlSym::SYM_NONE) { return; } } } } } //----------------------------------------------------------------- /** * Activate fish under cursor. * @param occupant model to activate * @return true when fish was selected */ bool Controls::activateSelected(const Cube *occupant) { t_units::iterator end = m_units.end(); for (t_units::iterator i = m_units.begin(); i != end; ++i) { if ((*i)->equalsModel(occupant)) { m_active = i; m_switch = true; return true; } } return false; } //----------------------------------------------------------------- void Controls::setMoves(const std::string &moves) { m_moves = moves; if (!m_moves.empty()) { activateDriven(m_moves[m_moves.size() - 1]); } } //----------------------------------------------------------------- /** * Activate fish driven by given symbol. * @param symbol one of fish symbols * @return true when fish was selected */ bool Controls::activateDriven(char symbol) { t_units::iterator end = m_units.end(); for (t_units::iterator i = m_units.begin(); i != end; ++i) { if ((*i)->isDrivenBy(symbol)) { m_active = i; m_switch = true; return true; } } return false; } //----------------------------------------------------------------- /** * Change active unit. * NOTE: change is without switch animation */ void Controls::setActive(t_units::iterator active) { if (m_active != active) { m_speedup = 0; m_active = active; } } //----------------------------------------------------------------- /** * Make this move. * @return false for bad move */ bool Controls::makeMove(char move) { t_units::iterator end = m_units.end(); for (t_units::iterator i = m_units.begin(); i != end; ++i) { if ((*i)->driveOrder(move) == move) { setActive(i); m_moves.append(1, move); return true; } } return false; } //----------------------------------------------------------------- /** * Returns true when there is no unit which will be able to move. */ bool Controls::cannotMove() const { t_units::const_iterator end = m_units.end(); for (t_units::const_iterator i = m_units.begin(); i != end; ++i) { if ((*i)->willMove()) { return false; } } return true; } //----------------------------------------------------------------- /** * Returns true when active fish is powerful. */ bool Controls::isPowerful() const { bool result = false; if (m_active != m_units.end()) { result = (*m_active)->isPowerful(); } return result; } //----------------------------------------------------------------- /** * Returns true when the active fish is doing a dangerous move. */ bool Controls::isDangerousMove() const { bool result = false; if (m_active != m_units.end()) { result = (*m_active)->isPushing(); } return result; } fillets-ng-1.0.1/src/level/Cube.h0000644000175000017500000000602611265140505013426 00000000000000#ifndef HEADER_CUBE_H #define HEADER_CUBE_H class Shape; class Anim; class Rules; class DialogStack; #include "V2.h" #include "Goal.h" #include "NoCopy.h" #include "Dir.h" #include /** * A object in game. */ class Cube : public NoCopy { public: typedef std::vector t_models; enum eWeight { NONE, LIGHT, HEAVY, FIXED }; enum eAction { ACTION_NO, ACTION_FALL, ACTION_MOVE }; private: int m_index; bool m_busy; V2 m_loc; bool m_alive; bool m_out; eWeight m_weight; eWeight m_power; bool m_lookLeft; bool m_lost; Shape *m_shape; Anim *m_anim; Rules *m_rules; Goal m_goal; Dir::eDir m_outDir; int m_outCapacity; const DialogStack *m_dialogs; public: Cube(const V2 &location, eWeight weight, eWeight power, bool alive, Shape *shape); ~Cube(); void setGoal(const Goal &goal) { m_goal = goal; } void setIndex(int model_index) { m_index = model_index; } int getIndex() const { return m_index; } bool isBusy() const { return m_busy; } void setBusy(bool busy) { m_busy = busy; } void change_die(); void change_goingOut(); void change_goOut(); void change_remove(); void change_turnSide(); void change_setLocation(const V2 &loc) { m_loc = loc; } V2 getLocation() const { return m_loc; } bool isAlive() const { return m_alive; } bool isLeft() const { return m_lookLeft; } bool isOut() const { return m_out; } bool isLost() const { return m_lost; } bool isSatisfy() const { return m_goal.isSatisfy(this); } bool isWrong() const { return m_goal.isWrong(this); } bool isWall() const { return m_weight >= Cube::FIXED; } bool shouldGoOut() const { return m_goal.shouldGoOut(); } bool isBorder() const { return m_index == -1; } eWeight getWeight() const { return m_weight; } eWeight getPower() const { return m_power; } const Shape *shape() const { return m_shape; } Dir::eDir getLastMoveDir() const; bool isOutDir(Dir::eDir dir) const { return m_outDir == dir; } Dir::eDir getOutDir() { return m_outDir; } int getOutCapacity() { return m_outCapacity; } void setOutDir(Dir::eDir outDir, int capacity=2, eWeight weight=Cube::FIXED); void decOutCapacity(); void setExtraParams(); bool isTalking() const; void takeDialogs(const DialogStack *dialogs) { m_dialogs = dialogs; } bool isDisintegrated(); bool isInvisible(); Anim *anim() { return m_anim; } const Anim *const_anim() const { return m_anim; } Rules *rules() { return m_rules; } const Rules *const_rules() const { return m_rules; } virtual std::string toString() const; }; #endif fillets-ng-1.0.1/src/level/KeyControl.cpp0000644000175000017500000000107710066370030015171 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "KeyControl.h" //----------------------------------------------------------------- /** * Default control are arrows. */ KeyControl::KeyControl() { m_up = SDLK_UP; m_down = SDLK_DOWN; m_left = SDLK_LEFT; m_right = SDLK_RIGHT; } fillets-ng-1.0.1/src/level/Shape.cpp0000644000175000017500000000332510702133741014141 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Shape.h" #include "LayoutException.h" #include "minmax.h" //----------------------------------------------------------------- /** * Read shape in format: * "XXX...\n" * ".XXXXX\n" * "XX...X\n" * * NOTE: rows does not need to have the same length * * @throws LayoutException when shape has bad format */ Shape::Shape(const std::string &shape) { int x = 0; int y = 0; int max_x = -1; int max_y = -1; for (unsigned int i = 0; i < shape.size(); ++i) { switch (shape[i]) { case '\n': ++y; x = 0; break; case 'X': m_marks.push_back(V2(x, y)); max_x = max(max_x, x); max_y = max(max_y, y); ++x; break; case '.': ++x; break; default: throw LayoutException(ExInfo("bad shape char") .addInfo("char", shape[i]) .addInfo("shape", shape)); } } m_w = max_x + 1; m_h = max_y + 1; } //----------------------------------------------------------------- std::string Shape::toString() const { std::string result; t_marks::const_iterator end = m_marks.end(); for (t_marks::const_iterator i = m_marks.begin(); i != end; ++i) { result.append(i->toString()); } return result; } fillets-ng-1.0.1/src/level/Rules.cpp0000644000175000017500000004545211631744545014216 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Rules.h" #include "Cube.h" #include "MarkMask.h" #include "Log.h" #include "LayoutException.h" #include "OnStack.h" #include "OnWall.h" #include "OnStrongPad.h" #include "OptionAgent.h" #include //----------------------------------------------------------------- /** * Create new rules for model. */ Rules::Rules(Cube *model) { m_readyToDie = false; m_readyToTurn = false; m_readyToActive = false; m_dir = Dir::DIR_NO; m_pushing = false; m_outDepth = 0; m_touchDir = Dir::DIR_NO; m_model = model; m_mask = NULL; m_lastFall = false; } //----------------------------------------------------------------- /** * Unmask from field. */ Rules::~Rules() { if (m_mask) { m_mask->unmask(); delete m_mask; } } //----------------------------------------------------------------- /** * Connect model with field. * @throws LayoutException when location is occupied */ void Rules::takeField(Field *field) { if (m_mask) { m_mask->unmask(); delete m_mask; m_mask = NULL; } m_mask = new MarkMask(m_model, field); Cube::t_models resist = m_mask->getResist(Dir::DIR_NO); if (!resist.empty()) { throw LayoutException(ExInfo("position is occupied") .addInfo("model", m_model->toString()) .addInfo("resist", resist.front()->toString())); } m_mask->mask(); } //----------------------------------------------------------------- /** * Accomplish last move in m_dir direction. * Mask to a new position. * Change model position. * * It complements the unmasking in freeOldPos(). */ void Rules::occupyNewPos() { m_touchDir = Dir::DIR_NO; if (m_dir != Dir::DIR_NO) { m_pushing = false; V2 shift = Dir::dir2xy(m_dir); V2 oldLoc = m_model->getLocation(); m_model->change_setLocation(oldLoc.plus(shift)); m_mask->mask(); } } //----------------------------------------------------------------- /** * Force model to a new position. * Used just for undo loading. */ void Rules::change_setLocation(const V2 &loc) { m_mask->unmask(); //HACK: model.out flag is recognized by its location if (loc.getX() < 0 && loc.getY() < 0) { m_model->change_goOut(); } else { m_model->change_setLocation(loc); m_mask->mask(); } } //----------------------------------------------------------------- /** * Check dead fishes. * Fish is dead: * - when any model moves in dir != Dir::DIR_UP * and new position is SOLELY on a fish * - when any model moves in Dir::DIR_DOWN * and new position is SOLELY on models SOLELY on a fish * - when any model rests SOLELY on models SOLELY on a fish * with fish.power < model.weight * * @return true when fish has died */ bool Rules::checkDead(Cube::eAction lastAction) { //NOTE: after falling phase is sufficient to check only DeadFall bool dead = false; if (m_model->isAlive()) { switch (lastAction) { case Cube::ACTION_FALL: dead = checkDeadFall(); break; case Cube::ACTION_MOVE: dead = checkDeadMove(); break; default: dead = false; break; } if (!dead) { dead = checkDeadStress(); } if (dead) { m_readyToDie = true; } } return dead; } //----------------------------------------------------------------- /** * Return true when any model moves in dir != Dir::DIR_UP * and new position is SOLELY on a fish. * @return true when fish is dead */ bool Rules::checkDeadMove() { bool strict = OptionAgent::agent()->getAsBool("strict_rules", true); Cube::t_models resist = m_mask->getResist(Dir::DIR_UP); Cube::t_models::iterator end = resist.end(); for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) { if (!(*i)->isAlive()) { Dir::eDir resist_dir = (*i)->rules()->getDir(); if (resist_dir != Dir::DIR_NO && resist_dir != Dir::DIR_UP) { if (strict) { if ((*i)->rules()->isOnHolderBacks()) { return true; } } else { if (!(*i)->rules()->isOnStack()) { return true; } } } } } return false; } //----------------------------------------------------------------- /** * Whether object is under falling object. * * @return true when fish is dead */ bool Rules::checkDeadFall() { Cube::t_models killers = whoIsFalling(); Cube::t_models::iterator end = killers.end(); for (Cube::t_models::iterator i = killers.begin(); i != end; ++i) { if (!(*i)->rules()->isOnWall()) { return true; } } return false; } //----------------------------------------------------------------- /** * Whether object is under hight stress. * * @return true when fish is dead */ bool Rules::checkDeadStress() { Cube::t_models killers = whoIsHeavier(m_model->getPower()); Cube::t_models::iterator end = killers.end(); for (Cube::t_models::iterator i = killers.begin(); i != end; ++i) { if (!(*i)->rules()->isOnStrongPad((*i)->getWeight())) { return true; } } return false; } //----------------------------------------------------------------- /** * Finish events from last round. * Change model state. */ void Rules::changeState() { m_dir = Dir::DIR_NO; if (!m_model->isLost() && m_model->isDisintegrated()) { m_mask->unmask(); m_model->change_remove(); } if (m_readyToTurn) { m_readyToTurn = false; m_model->change_turnSide(); } m_readyToActive = false; if (m_readyToDie) { m_readyToDie = false; m_model->change_die(); } } //----------------------------------------------------------------- /** * Let model to go out of room. * @return out depth, 0 for normal, 1 for going out, * 2... for on the way, -1 for out of screen */ int Rules::actionOut() { if (!m_model->isLost() && !m_model->isBusy() && m_dir == Dir::DIR_NO) { //NOTE: normal objects are not allowed to go out of screen if (m_model->shouldGoOut()) { if (m_mask->isFullyOut()) { m_model->change_goOut(); m_outDepth = -1; } else { Dir::eDir borderDir = m_mask->getBorderDir(); if (borderDir != Dir::DIR_NO) { m_model->change_goingOut(); moveDirBrute(borderDir); m_outDepth += 1; } else { m_outDepth = 0; } } } } return m_outDepth; } //----------------------------------------------------------------- /** * Let model fall. */ void Rules::actionFall() { m_dir = Dir::DIR_DOWN; m_lastFall = true; } //----------------------------------------------------------------- /** * Unset falling flag. * @return last value of the flag */ bool Rules::clearLastFall() { bool last = m_lastFall; m_lastFall = false; return last; } //----------------------------------------------------------------- /** * Unmask from old position. */ void Rules::freeOldPos() { if (m_dir != Dir::DIR_NO) { m_mask->unmask(); } } //----------------------------------------------------------------- /** * Whether object is direct or undirect on something specific. * @param cond condition which will be satify when object is on. */ bool Rules::isOnCond(const OnCondition &cond) { bool result = false; if (cond.isSatisfy(m_model)) { result = true; } else if (cond.isWrong(m_model)) { result = false; } else { m_mask->unmask(); result = false; Cube::t_models resist = m_mask->getResist(Dir::DIR_DOWN); Cube::t_models::iterator end = resist.end(); for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) { if ((*i)->rules()->isOnCond(cond)) { //NOTE: don't forget to mask() result = true; break; } } m_mask->mask(); } return result; } //----------------------------------------------------------------- /** * Whether object is on another unalive object. * And this another object must be on something fixed * (except on original object). * * Such object can be moved over fish. */ bool Rules::isOnStack() { return isOnCond(OnStack()); } //----------------------------------------------------------------- /** * Whether object is direct or undirect on a wall. */ bool Rules::isOnWall() { return isOnCond(OnWall()); } //----------------------------------------------------------------- /** * Whether object is direct or undirect on Wall or on powerful fish. * * @param weight stress weight which must fish carry * @return whether Wall or a strong fish carry this object */ bool Rules::isOnStrongPad(Cube::eWeight weight) { return isOnCond(OnStrongPad(weight)); } //----------------------------------------------------------------- /** * Returns true if the object is laying just on alive holders * and they all have at least a part of their backs * directly under this object. * * Pushing the object would kill all the holders. * The object would be free to fall. */ bool Rules::isOnHolderBacks() { unsigned int numDirectHolders = 0; Cube::t_models resist = m_mask->getResist(Dir::DIR_DOWN); Cube::t_models::iterator end = resist.end(); for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) { if ((*i)->isAlive()) { ++numDirectHolders; } } Cube::t_models pads = getPads(); MarkMask::unique(&pads); return numDirectHolders == pads.size(); } //----------------------------------------------------------------- /** * Returns all alive fish and walls under this object. */ Cube::t_models Rules::getPads() { Cube::t_models pads; m_mask->unmask(); Cube::t_models resist = m_mask->getResist(Dir::DIR_DOWN); Cube::t_models::iterator end = resist.end(); for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) { if ((*i)->isAlive() || (*i)->isWall()) { pads.push_back(*i); } else { Cube::t_models distance_pads = (*i)->rules()->getPads(); pads.insert(pads.end(), distance_pads.begin(), distance_pads.end()); } } m_mask->mask(); return pads; } //----------------------------------------------------------------- /** * Whether object is falling. */ bool Rules::isFalling() const { bool result = false; if (!m_model->isAlive()) { result = (m_dir == Dir::DIR_DOWN); } return result; } //----------------------------------------------------------------- /** * Who is falling on us. * @return array of killers, they can fall undirect on us */ Cube::t_models Rules::whoIsFalling() { Cube::t_models result; m_mask->unmask(); Cube::t_models resist = m_mask->getResist(Dir::DIR_UP); Cube::t_models::iterator end = resist.end(); for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) { //NOTE: falling is not propagated over fish if (!(*i)->isWall() && !(*i)->isAlive()) { if ((*i)->rules()->isFalling()) { result.push_back(*i); } else { Cube::t_models distance_killers = (*i)->rules()->whoIsFalling(); result.insert(result.end(), distance_killers.begin(), distance_killers.end()); } } } m_mask->mask(); return result; } //----------------------------------------------------------------- /** * Whether object is heavier than our power. * @param power our max power * @return whether object is heavier */ bool Rules::isHeavier(Cube::eWeight power) const { bool result = false; if (!m_model->isWall() && !m_model->isAlive()) { if (m_model->getWeight() > power) { result = true; } } return result; } //----------------------------------------------------------------- /** * Who is heavier than our power. * @param power our max power * @return array of killers, they can lie undirect on us */ Cube::t_models Rules::whoIsHeavier(Cube::eWeight power) { Cube::t_models result; m_mask->unmask(); Cube::t_models resist = m_mask->getResist(Dir::DIR_UP); Cube::t_models::iterator end = resist.end(); for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) { if (!(*i)->isWall()) { if ((*i)->rules()->isHeavier(power)) { result.push_back(*i); } else { Cube::t_models distance_killers = (*i)->rules()->whoIsHeavier(power); result.insert(result.end(), distance_killers.begin(), distance_killers.end()); } } } m_mask->mask(); return result; } //----------------------------------------------------------------- /** * Whether other will retreat before us. * * @param power we will use this power */ bool Rules::canMoveOthers(Dir::eDir dir, Cube::eWeight power) { bool result = true; //NOTE: make place after oneself, e.g. fish in U m_mask->unmask(); Cube::t_models resist = m_mask->getResist(dir); Cube::t_models::iterator end = resist.end(); for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) { if (m_model->shouldGoOut() && (*i)->isBorder()) { continue; } if (!(*i)->rules()->canDir(dir, power)) { result = false; break; } } m_mask->mask(); return result; } //----------------------------------------------------------------- /** * Whether others can move us. * Live models cannot be moved by others. * Power and weight is compared. * * @param dir move direction * @param power others power * @return whether we can move */ bool Rules::canDir(Dir::eDir dir, Cube::eWeight power) { bool result = false; if (!m_model->isAlive() && power >= m_model->getWeight()) { // A special case when outgoing object is pushing with FIXED power. if (m_model->isWall() && !m_model->shouldGoOut()) { return false; } result = canMoveOthers(dir, power); } return result; } //----------------------------------------------------------------- /** * There is one special case. * When model touches output_DIR then it goes out. * This is used only in level 'windoze'. */ bool Rules::touchSpec(Dir::eDir dir) { bool result = false; Cube::t_models resist = m_mask->getResist(dir); if (resist.size() == 1) { if (resist[0]->isOutDir(dir)) { resist[0]->decOutCapacity(); m_mask->unmask(); m_model->change_goOut(); result = true; } } return result; } //----------------------------------------------------------------- /** * Marks all resisted models as touched. */ void Rules::setTouched(Dir::eDir dir) { m_touchDir = dir; if (!m_model->isWall()) { m_mask->unmask(); Cube::t_models resist = m_mask->getResist(dir); Cube::t_models::iterator end = resist.end(); for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) { if (!(*i)->isAlive()) { (*i)->rules()->setTouched(dir); } } m_mask->mask(); } } //----------------------------------------------------------------- /** * Try to move. * Only m_dir will be set. * NOTE: we can move all resist or none * * @return whether we have moved */ bool Rules::actionMoveDir(Dir::eDir dir) { bool result = false; if (canMoveOthers(dir, m_model->getPower())) { moveDirBrute(dir); result = true; } else { if (touchSpec(dir)) { result = true; } else { setTouched(dir); } } return result; } //----------------------------------------------------------------- /** * Irrespective move. * Set m_dir to this dir and do the same for all resist. * Only m_dir and m_pushing will be set. */ void Rules::moveDirBrute(Dir::eDir dir) { //NOTE: make place after oneself, e.g. object in U m_mask->unmask(); Cube::t_models resist = m_mask->getResist(dir); Cube::t_models::iterator end = resist.end(); for (Cube::t_models::iterator i = resist.begin(); i != end; ++i) { if (!(*i)->isBorder()) { (*i)->rules()->moveDirBrute(dir); m_pushing = true; } } m_dir = dir; m_mask->mask(); } //----------------------------------------------------------------- /** * Return what we do the last round. * Useful for script functions. * NOTE: dead is not action */ std::string Rules::getAction() const { if (m_readyToTurn) { return "turn"; } else if (m_readyToActive) { return "activate"; } else if (m_model->isBusy()) { return "busy"; } switch (m_dir) { case Dir::DIR_LEFT: return "move_left"; case Dir::DIR_RIGHT: return "move_right"; case Dir::DIR_UP: return "move_up"; case Dir::DIR_DOWN: return "move_down"; case Dir::DIR_NO: return "rest"; default: assert(!"unknown dir"); break; } return "rest"; } //----------------------------------------------------------------- /** * Return how we have feel the last round. * Useful for script functions. * * States: * "goout" ... go out of room * "dead" ... is dead * "talking" ... is talking * "pushing" ... is pushing * "normal" ... is alive and resting */ std::string Rules::getState() const { if (m_outDepth == 1) { return "goout"; } else if (!m_model->isAlive()) { return "dead"; } else if (m_model->isTalking()) { return "talking"; } else if (m_pushing) { return "pushing"; } else { return "normal"; } } //----------------------------------------------------------------- bool Rules::isAtBorder() const { return m_mask->getBorderDir() != Dir::DIR_NO; } //----------------------------------------------------------------- bool Rules::isFreePlace(const V2 &loc) const { return m_mask->getPlacedResist(loc).empty(); } //----------------------------------------------------------------- const Cube::t_models Rules::getResist(Dir::eDir dir) const { return m_mask->getResist(dir); } fillets-ng-1.0.1/src/level/MarkMask.cpp0000644000175000017500000001116211626005424014607 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "MarkMask.h" #include "Cube.h" #include "Shape.h" #include "Field.h" #include "Rules.h" #include //----------------------------------------------------------------- MarkMask::MarkMask(Cube *model, Field *field) { m_model = model; m_field = field; } //----------------------------------------------------------------- /** * Return others which resist us to move this direction. * Pointers to NULL and own model are not included. * * @return unique pointers, not NULL */ Cube::t_models MarkMask::getResist(Dir::eDir dir) const { V2 shift = Dir::dir2xy(dir); V2 shift_loc = shift.plus(m_model->getLocation()); return getPlacedResist(shift_loc); } //----------------------------------------------------------------- /** * Return others which resist at given location. * Pointers to NULL and own model are not included. * * @return unique pointers, not NULL */ Cube::t_models MarkMask::getPlacedResist(const V2 &loc) const { Cube::t_models models; const Shape *shape = m_model->shape(); Shape::const_iterator end = shape->marksEnd(); for (Shape::const_iterator i = shape->marksBegin(); i != end; ++i) { V2 mark = loc.plus(*i); Cube *resist = m_field->getModel(mark); if (NULL != resist && m_model != resist) { models.push_back(resist); } } unique(&models); return models; } //----------------------------------------------------------------- /** * Write our position to the field. */ void MarkMask::mask() { writeModel(m_model, NULL); } //----------------------------------------------------------------- /** * Clear our position from the field. */ void MarkMask::unmask() { writeModel(NULL, m_model); } //----------------------------------------------------------------- void MarkMask::writeModel(Cube *model, Cube *toOverride) { V2 loc = m_model->getLocation(); const Shape *shape = m_model->shape(); Shape::const_iterator end = shape->marksEnd(); for (Shape::const_iterator i = shape->marksBegin(); i != end; ++i) { V2 mark = loc.plus(*i); m_field->setModel(mark, model, toOverride); } } //----------------------------------------------------------------- /** * Returns dir to out of room. * The direction must be without resist. * @return return dir or DIR_NO when model is not at the border. */ Dir::eDir MarkMask::getBorderDir() const { V2 loc = m_model->getLocation(); const Shape *shape = m_model->shape(); Shape::const_iterator end = shape->marksEnd(); for (Shape::const_iterator i = shape->marksBegin(); i != end; ++i) { V2 mark = loc.plus(*i); if (mark.getX() == 0 && canGo(Dir::DIR_LEFT)) { return Dir::DIR_LEFT; } else if (mark.getX() == m_field->getW() - 1 && canGo(Dir::DIR_RIGHT)) { return Dir::DIR_RIGHT; } else if (mark.getY() == 0 && canGo(Dir::DIR_UP)) { return Dir::DIR_UP; } else if (mark.getY() == m_field->getH() - 1 && canGo(Dir::DIR_DOWN)) { return Dir::DIR_DOWN; } } return Dir::DIR_NO; } //----------------------------------------------------------------- /** * Test whether there is only border * or other unblocked objects that should go out * in the given direction. */ bool MarkMask::canGo(Dir::eDir dir) const { return m_model->rules()->canMoveOthers(dir, Cube::FIXED); } //----------------------------------------------------------------- /** * Returns true when the object is fully out of the field. */ bool MarkMask::isFullyOut() const { V2 loc = m_model->getLocation(); const Shape *shape = m_model->shape(); Shape::const_iterator end = shape->marksEnd(); for (Shape::const_iterator i = shape->marksBegin(); i != end; ++i) { V2 mark = loc.plus(*i); Cube *place = m_field->getModel(mark); if (place == NULL || !place->isBorder()) { return false; } } return true; } //----------------------------------------------------------------- /** * Removes duplicities from the given models. */ void MarkMask::unique(Cube::t_models *models) { std::sort(models->begin(), models->end()); Cube::t_models::iterator last = std::unique(models->begin(), models->end()); models->erase(last, models->end()); } fillets-ng-1.0.1/src/level/LevelLoading.cpp0000644000175000017500000000442310113163522015442 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "LevelLoading.h" #include "RoomAccess.h" #include "Room.h" #include "LoadException.h" #include "minmax.h" //----------------------------------------------------------------- LevelLoading::LevelLoading(RoomAccess *access) { m_access = access; reset(); } //----------------------------------------------------------------- void LevelLoading::reset() { m_paused = false; m_replayMode = false; m_loadSpeed = 1; m_loadedMoves = ""; } //----------------------------------------------------------------- bool LevelLoading::isLoading() const { return !m_loadedMoves.empty() || m_replayMode; } //----------------------------------------------------------------- /** * Start loading mode. * @param moves saved moves to load */ void LevelLoading::loadGame(const std::string &moves) { m_loadedMoves = moves; m_loadSpeed = min(50, max(5, m_loadedMoves.size() / 150)); } //----------------------------------------------------------------- /** * Start replay mode. * @param moves saved moves to load */ void LevelLoading::loadReplay(const std::string &moves) { m_loadedMoves = moves; m_loadSpeed = 1; m_replayMode = true; } //----------------------------------------------------------------- /** * Load a few moves. * @throws LoadException for bad load */ void LevelLoading::nextLoadAction() { if (m_paused) { return; } if (m_loadedMoves.empty()) { m_access->room()->beginFall(false); m_access->room()->finishRound(false); } else { for (int i = 0; i < m_loadSpeed && !m_loadedMoves.empty(); ++i) { try { char symbol = m_loadedMoves[0]; m_loadedMoves.erase(0, 1); m_access->room()->loadMove(symbol); } catch (LoadException &e) { throw LoadException(ExInfo(e.info()) .addInfo("remain", m_loadedMoves)); } } } } fillets-ng-1.0.1/src/level/Unit.h0000644000175000017500000000305711047536121013471 00000000000000#ifndef HEADER_UNIT_H #define HEADER_UNIT_H class Cube; class InputProvider; #include "KeyControl.h" #include "ControlSym.h" #include "Dir.h" #include "V2.h" #include "SDL.h" #include /** * Unit to drive. */ class Unit { private: KeyControl m_buttons; ControlSym m_symbols; Cube *m_model; bool m_startActive; private: char goLeft(); char goRight(); char goUp(); char goDown(); public: Unit(const KeyControl &buttons, const ControlSym &symbols, bool startActive=false); void takeModel(Cube *model) { m_model = model; } bool startActive() { return m_startActive; } bool canDrive() const; bool willMove() const; char drive(const InputProvider *input); char driveBorrowed(const InputProvider *input, const KeyControl &buttons); void activate(); char mySymbol(SDLKey key) const; char mySymbolBorrowed(SDLKey key, const KeyControl &buttons) const; char myOrder(Dir::eDir dir) const; char driveOrder(char move); bool isMoving() const; bool isMovingDown() const; bool isTurning() const; bool isPushing() const; bool isDrivenBy(char symbol) const; bool equalsModel(const Cube *other) const; V2 getLoc() const; int getW() const; int getH() const; bool isFreePlace(const V2 &loc) const; int countAnimPhases(const std::string &anim) const; bool isPowerful() const; }; #endif fillets-ng-1.0.1/src/level/Rules.h0000644000175000017500000000423611626003671013646 00000000000000#ifndef HEADER_RULES_H #define HEADER_RULES_H class V2; class MarkMask; class Field; class OnCondition; #include "NoCopy.h" #include "Cube.h" #include "Dir.h" /** * Game rules. */ class Rules : public NoCopy { private: Dir::eDir m_dir; bool m_readyToDie; bool m_readyToTurn; bool m_readyToActive; bool m_pushing; bool m_lastFall; int m_outDepth; Dir::eDir m_touchDir; Cube *m_model; MarkMask *m_mask; private: bool checkDeadMove(); bool checkDeadFall(); bool checkDeadStress(); bool isOnStack(); bool isOnCond(const OnCondition &cond); bool isOnWall(); bool isOnHolderBacks(); Cube::t_models getPads(); bool isFalling() const; Cube::t_models whoIsFalling(); bool isHeavier(Cube::eWeight power) const; Cube::t_models whoIsHeavier(Cube::eWeight power); bool canDir(Dir::eDir dir, Cube::eWeight power); bool touchSpec(Dir::eDir dir); void setTouched(Dir::eDir dir); void moveDirBrute(Dir::eDir dir); public: Rules(Cube *model); ~Rules(); void takeField(Field *field); void change_setLocation(const V2 &loc); void occupyNewPos(); bool checkDead(Cube::eAction lastAction); void changeState(); void freeOldPos(); int actionOut(); void actionFall(); bool clearLastFall(); bool actionMoveDir(Dir::eDir dir); void actionTurnSide() { m_readyToTurn = true; } void actionActivate() { m_readyToActive = true; } Dir::eDir getDir() const { return m_dir; } Dir::eDir getTouchDir() const { return m_touchDir; } std::string getAction() const; std::string getState() const; bool isOnStrongPad(Cube::eWeight weight); bool isAtBorder() const; bool isFreePlace(const V2 &loc) const; const Cube::t_models getResist(Dir::eDir dir) const; bool isPushing() const { return m_pushing; }; void resetLastDir() { m_dir = Dir::DIR_NO; } bool canMoveOthers(Dir::eDir dir, Cube::eWeight weight); }; #endif fillets-ng-1.0.1/src/level/LevelLoading.h0000644000175000017500000000144410677223344015125 00000000000000#ifndef HEADER_LEVELLOADING_H #define HEADER_LEVELLOADING_H class RoomAccess; #include "NoCopy.h" #include /** * Game loading. */ class LevelLoading : public NoCopy { private: static const int SPEED_REPLAY = 1; bool m_paused; bool m_replayMode; int m_loadSpeed; std::string m_loadedMoves; RoomAccess *m_access; public: LevelLoading(RoomAccess *access); void setLoadSpeed(int loadSpeed) { m_loadSpeed = loadSpeed; } void reset(); void loadGame(const std::string &moves); void loadReplay(const std::string &moves); void togglePause() { m_paused = !m_paused; } bool isPaused() const { return m_paused; } bool isLoading() const; void nextLoadAction(); }; #endif fillets-ng-1.0.1/src/level/LevelInput.cpp0000644000175000017500000000676511212655662015213 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "LevelInput.h" #include "Level.h" #include "Keymap.h" #include "KeyStroke.h" #include "OptionAgent.h" #include "MenuOptions.h" #include "SubTitleAgent.h" //----------------------------------------------------------------- LevelInput::LevelInput(Level *level) : GameInput(level) { m_keymap->registerKey(KeyStroke(SDLK_SPACE, KMOD_NONE), KeyDesc(KEY_SWITCH, "switch")); m_keymap->registerKey(KeyStroke(SDLK_F2, KMOD_NONE), KeyDesc(KEY_SAVE, "save")); m_keymap->registerKey(KeyStroke(SDLK_F3, KMOD_NONE), KeyDesc(KEY_LOAD, "load")); m_keymap->registerKey(KeyStroke(SDLK_BACKSPACE, KMOD_NONE), KeyDesc(KEY_RESTART, "restart")); m_keymap->registerKey(KeyStroke(SDLK_F5, KMOD_NONE), KeyDesc(KEY_SHOW_STEPS, "show number of steps")); KeyDesc undo = KeyDesc(KEY_UNDO, "undo"); m_keymap->registerKey(KeyStroke(SDLK_MINUS, KMOD_NONE), undo); m_keymap->registerKey(KeyStroke(SDLK_KP_MINUS, KMOD_NONE), undo); KeyDesc redo = KeyDesc(KEY_REDO, "redo"); m_keymap->registerKey(KeyStroke(SDLK_PLUS, KMOD_NONE), redo); m_keymap->registerKey(KeyStroke(SDLK_EQUALS, KMOD_NONE), redo); m_keymap->registerKey(KeyStroke(SDLK_KP_PLUS, KMOD_NONE), redo); } //----------------------------------------------------------------- Level * LevelInput::getLevel() { return dynamic_cast(m_state); } //----------------------------------------------------------------- void LevelInput::specKey(int keyIndex) { switch (keyIndex) { case KEY_SWITCH: if (!getLevel()->isActing()) { getLevel()->switchFish(); } break; case KEY_SAVE: if (!getLevel()->isActing()) { getLevel()->action_save(); } break; case KEY_LOAD: if (!getLevel()->isShowing()) { getLevel()->action_load(); } break; case KEY_RESTART: getLevel()->interruptShow(); getLevel()->action_restart(1); break; case KEY_UNDO: if (!getLevel()->isShowing()) { getLevel()->action_undo(1); } break; case KEY_REDO: if (!getLevel()->isShowing()) { getLevel()->action_undo(-1); } break; case KEY_SHOW_STEPS: toggleParam("show_steps"); break; default: GameInput::specKey(keyIndex); } } //----------------------------------------------------------------- void LevelInput::specStroke(const KeyStroke &stroke) { if (!getLevel()->isActing()) { getLevel()->controlEvent(stroke); } } //----------------------------------------------------------------- void LevelInput::mouseEvent(const MouseStroke &buttons) { getLevel()->controlMouse(buttons); } //----------------------------------------------------------------- void LevelInput::keyUp(const KeyStroke &stroke) { int index = m_keymap->indexPressed(stroke); switch (index) { case KEY_UNDO: case KEY_REDO: getLevel()->action_undo_finish(); break; default: break; } } fillets-ng-1.0.1/src/level/OnStack.h0000644000175000017500000000132110113701456014102 00000000000000#ifndef HEADER_ONSTACK_H #define HEADER_ONSTACK_H #include "OnCondition.h" #include "Cube.h" #include "Rules.h" /** * Test whether object can carry moved stack. */ class OnStack : public OnCondition { public: virtual bool isSatisfy(Cube *model) const { bool result = false; if (!model->isAlive()) { if (model->rules()->getDir() == Dir::DIR_NO && model->rules()->isOnStrongPad(Cube::LIGHT)) { result = true; } } return result; } virtual bool isWrong(Cube *model) const { return model->isAlive(); } }; #endif fillets-ng-1.0.1/src/level/MarkMask.h0000644000175000017500000000141011422656660014257 00000000000000#ifndef HEADER_MARKMASK_H #define HEADER_MARKMASK_H class V2; class Field; #include "NoCopy.h" #include "Dir.h" #include "Cube.h" /** * Marks and unmasks object from game field. */ class MarkMask : public NoCopy { private: Cube *m_model; Field *m_field; private: void writeModel(Cube *model, Cube *toOverride); bool canGo(Dir::eDir dir) const; bool isInRoom() const; public: MarkMask(Cube *model, Field *field); Cube::t_models getResist(Dir::eDir dir) const; Cube::t_models getPlacedResist(const V2 &loc) const; void mask(); void unmask(); Dir::eDir getBorderDir() const; bool isFullyOut() const; static void unique(Cube::t_models *models); }; #endif fillets-ng-1.0.1/src/level/game-script.cpp0000644000175000017500000004760511264361230015325 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "game-script.h" #include "Log.h" #include "KeyControl.h" #include "Path.h" #include "V2.h" #include "Anim.h" #include "Shape.h" #include "Cube.h" #include "Rules.h" #include "LevelScript.h" #include "ModelFactory.h" #include "Room.h" #include "RopeDecor.h" #include "ShapeBuilder.h" #include "def-script.h" //----------------------------------------------------------------- inline LevelScript * getLevelScript(lua_State *L) { return dynamic_cast(script_getLeader(L)); } //----------------------------------------------------------------- inline Cube * getModel(lua_State *L, int model_index) { return getLevelScript(L)->getModel(model_index); } //----------------------------------------------------------------- /** * void game_setRoomWaves(amplitude, periode, speed) */ int script_game_setRoomWaves(lua_State *L) throw() { BEGIN_NOEXCEPTION; float amp = luaL_checknumber(L, 1); float periode = luaL_checknumber(L, 2); float speed = luaL_checknumber(L, 3); getLevelScript(L)->room()->setWaves(amp, periode, speed); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * int game_addModel(kind, x, y, shape) * Return model index. * * table = addModel("light", 10, 30, * [[ * XXXXX * ..X * ..X * ]]) */ int script_game_addModel(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *kind = luaL_checkstring(L, 1); int x = luaL_checkint(L, 2); int y = luaL_checkint(L, 3); const char *shape = luaL_checkstring(L, 4); Cube *model = ModelFactory::createModel(kind, V2(x, y), shape); Unit *unit = ModelFactory::createUnit(kind); int model_index = getLevelScript(L)->addModel(model, unit); lua_pushnumber(L, model_index); END_NOEXCEPTION; //NOTE: return model_index return 1; } //----------------------------------------------------------------- /** * int game_getCycles() */ int script_game_getCycles(lua_State *L) throw() { BEGIN_NOEXCEPTION; int cycles = getLevelScript(L)->room()->getCycles(); lua_pushnumber(L, cycles); END_NOEXCEPTION; //NOTE: return cycles return 1; } //----------------------------------------------------------------- /** * void game_addDecor(decor_name, params...) * * decor_name: * "rope" ... draw rope between models * params = (model_index1, model_index2, * shift_x1, shift_y1, shift_x2, shift_y2) */ int script_game_addDecor(lua_State *L) throw() { BEGIN_NOEXCEPTION; std::string decor_name = luaL_checkstring(L, 1); if ("rope" == decor_name) { int model_index1 = luaL_checkint(L, 2); int model_index2 = luaL_checkint(L, 3); int shift_x1 = luaL_checkint(L, 4); int shift_y1 = luaL_checkint(L, 5); int shift_x2 = luaL_checkint(L, 6); int shift_y2 = luaL_checkint(L, 7); Cube *model1 = getModel(L, model_index1); Cube *model2 = getModel(L, model_index2); getLevelScript(L)->room()->addDecor(new RopeDecor(model1, model2, V2(shift_x1, shift_y1), V2(shift_x2, shift_y2))); } else { LOG_WARNING(ExInfo("unknown decor") .addInfo("decor_name", decor_name)); } END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void game_setScreenShift(x, y) */ int script_game_setScreenShift(lua_State *L) throw() { BEGIN_NOEXCEPTION; int x = luaL_checkint(L, 1); int y = luaL_checkint(L, 2); getLevelScript(L)->room()->setScreenShift(V2(x, y)); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void game_changeBg(picture) */ int script_game_changeBg(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *picture = luaL_checkstring(L, 1); getLevelScript(L)->room()->changeBg(picture); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * string game_getBg() * Return the name of the currently used bg picture. */ int script_game_getBg(lua_State *L) throw() { BEGIN_NOEXCEPTION; lua_pushstring(L, getLevelScript(L)->room()->getBg().c_str()); END_NOEXCEPTION; //NOTE: return bg return 1; } //----------------------------------------------------------------- /** * void game_checkActive() * Check active fish, switch to non busy alive fish. */ int script_game_checkActive(lua_State *L) throw() { BEGIN_NOEXCEPTION; getLevelScript(L)->room()->checkActive(); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void game_setFastFalling(value) * Value==true sets fast falling for all objets. */ int script_game_setFastFalling(lua_State *L) throw() { BEGIN_NOEXCEPTION; bool value = lua_toboolean(L, 1); getLevelScript(L)->room()->setFastFalling(value); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void model_addAnim(model_index, anim_name, picture, lookDir) * Sides: * LOOK_LEFT = 0 * LOOK_RIGHT = 1 */ int script_model_addAnim(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); const char *anim_name = luaL_checkstring(L, 2); const char *picture = luaL_checkstring(L, 3); Anim::eSide lookDir = static_cast( luaL_optint(L, 4, Anim::SIDE_LEFT)); Cube *model = getModel(L, model_index); if (picture[0] == '\0') { model->anim()->addAnim(anim_name, ShapeBuilder::createImage(model->shape(), model->getWeight()), lookDir); } else { model->anim()->addAnim(anim_name, Path::dataReadPath(picture), lookDir); } END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void model_runAnim(model_index, anim_name, phase=0) */ int script_model_runAnim(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); const char *anim_name = luaL_checkstring(L, 2); int phase = luaL_optint(L, 3, 0); Cube *model = getModel(L, model_index); model->anim()->runAnim(anim_name, phase); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void model_setAnim(model_index, anim_name, phase) */ int script_model_setAnim(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); const char *anim_name = luaL_checkstring(L, 2); int phase = luaL_checkint(L, 3); Cube *model = getModel(L, model_index); model->anim()->setAnim(anim_name, phase); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void model_useSpecialAnim(model_index, anim_name, phase) * * Set special anim for one phase. */ int script_model_useSpecialAnim(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); const char *anim_name = luaL_checkstring(L, 2); int phase = luaL_checkint(L, 3); Cube *model = getModel(L, model_index); model->anim()->useSpecialAnim(anim_name, phase); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * int model_countAnims(model_index, anim_name) */ int script_model_countAnims(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); const char *anim_name = luaL_checkstring(L, 2); Cube *model = getModel(L, model_index); int anims = model->anim()->countAnimPhases(anim_name); lua_pushnumber(L, anims); END_NOEXCEPTION; //NOTE: return anims return 1; } //----------------------------------------------------------------- /** * void model_setEffect(model_index, effect_name) * * Set special view effect. * available effects: "none", "mirror", "invisible", "reverse", "zx" */ int script_model_setEffect(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); std::string effectName = luaL_checkstring(L, 2); Cube *model = getModel(L, model_index); model->anim()->setEffect(effectName); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * (x, y) model_getLoc(model_index) */ int script_model_getLoc(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); V2 loc = model->getLocation(); lua_pushnumber(L, loc.getX()); lua_pushnumber(L, loc.getY()); END_NOEXCEPTION; //NOTE: return (x, y) return 2; } //----------------------------------------------------------------- /** * string model_getAction(model_index) */ int script_model_getAction(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); std::string action = model->rules()->getAction(); lua_pushlstring(L, action.c_str(), action.size()); END_NOEXCEPTION; //NOTE: return action return 1; } //----------------------------------------------------------------- /** * string model_getState(model_index) */ int script_model_getState(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); std::string state = model->rules()->getState(); lua_pushlstring(L, state.c_str(), state.size()); END_NOEXCEPTION; //NOTE: return state return 1; } //----------------------------------------------------------------- /** * Dir::eDir model_getDir(model_index) */ int script_model_getDir(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); Dir::eDir dir = model->getLastMoveDir(); lua_pushnumber(L, dir); END_NOEXCEPTION; //NOTE: return dir return 1; } //----------------------------------------------------------------- /** * Dir::eDir model_getTouchDir(model_index) */ int script_model_getTouchDir(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); Dir::eDir dir = model->rules()->getTouchDir(); lua_pushnumber(L, dir); END_NOEXCEPTION; //NOTE: return dir return 1; } //----------------------------------------------------------------- /** * bool model_isAlive(model_index) */ int script_model_isAlive(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); bool alive = model->isAlive(); lua_pushboolean(L, alive); END_NOEXCEPTION; //NOTE: return alive return 1; } //----------------------------------------------------------------- /** * bool model_isOut(model_index) * * Returns true when model is out of room. */ int script_model_isOut(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); bool out = model->isOut(); lua_pushboolean(L, out); END_NOEXCEPTION; //NOTE: return out return 1; } //----------------------------------------------------------------- /** * bool model_isLeft(model_index) * * Returns true when model is looking to the left. */ int script_model_isLeft(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); bool left = model->isLeft(); lua_pushboolean(L, left); END_NOEXCEPTION; //NOTE: return left return 1; } //----------------------------------------------------------------- /** * bool model_isAtBorder(model_index) * * Returns true when model is at room border. */ int script_model_isAtBorder(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); bool atBorder = model->rules()->isAtBorder(); lua_pushboolean(L, atBorder); END_NOEXCEPTION; //NOTE: return atBorder return 1; } //----------------------------------------------------------------- /** * int model_getW(model_index) * * Returns model width. */ int script_model_getW(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); int width = model->shape()->getW(); lua_pushnumber(L, width); END_NOEXCEPTION; //NOTE: return width return 1; } //----------------------------------------------------------------- /** * int model_getH(model_index) * * Returns model height. */ int script_model_getH(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); int height = model->shape()->getH(); lua_pushnumber(L, height); END_NOEXCEPTION; //NOTE: return height return 1; } //----------------------------------------------------------------- /** * void model_setGoal(model_index, goalname) * Choose: * - "goal_no" .. no goal * - "goal_out" ... go out * - "goal_escape" ... go alive out */ int script_model_setGoal(lua_State *L) throw() { //NOTE: (const char*)== does not compare string equality BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); std::string goalname = luaL_checkstring(L, 2); Cube *model = getModel(L, model_index); Goal goal = Goal::noGoal(); if ("goal_no" == goalname) { goal = Goal::noGoal(); } else if ("goal_out" == goalname) { goal = Goal::outGoal(); } else if ("goal_escape" == goalname) { goal = Goal::escapeGoal(); } else if ("goal_alive" == goalname) { goal = Goal::aliveGoal(); } else { ExInfo error = ExInfo("unknown goal") .addInfo("goal", goalname); LOG_WARNING(error); luaL_error(L, error.what()); } model->setGoal(goal); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void model_change_turnSide(model_index) * * Change look side. */ int script_model_change_turnSide(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); model->change_turnSide(); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void model_change_setLocation(model_index, x, y) * Change model position (used to load undo). */ int script_model_change_setLocation(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); int x = luaL_checkint(L, 2); int y = luaL_checkint(L, 3); Cube *model = getModel(L, model_index); model->rules()->change_setLocation(V2(x, y)); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void model_setViewShift(model_index, shift_x, shift_y) * Shift view (used for obsolete animation effects). */ int script_model_setViewShift(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); int shift_x = luaL_checkint(L, 2); int shift_y = luaL_checkint(L, 3); Cube *model = getModel(L, model_index); model->anim()->setViewShift(V2(shift_x, shift_y)); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * shift_x, shift_y model_getViewShift(model_index) */ int script_model_getViewShift(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); V2 shift = model->anim()->getViewShift(); lua_pushnumber(L, shift.getX()); lua_pushnumber(L, shift.getY()); END_NOEXCEPTION; //NOTE: return shift_x, shift_y return 2; } //----------------------------------------------------------------- /** * void model_setBusy(model_index, value) */ int script_model_setBusy(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); bool busy = lua_toboolean(L, 2); Cube *model = getModel(L, model_index); model->setBusy(busy); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * table model_getExtraParams(model_index) * * Returns extra parameters needed to restore after undo. */ int script_model_getExtraParams(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); Cube *model = getModel(L, model_index); lua_newtable(L); lua_pushstring(L, "outDir"); lua_pushnumber(L, model->getOutDir()); lua_settable(L, -3); lua_pushstring(L, "outCapacity"); lua_pushnumber(L, model->getOutCapacity()); lua_settable(L, -3); lua_pushstring(L, "weight"); lua_pushnumber(L, model->getWeight()); lua_settable(L, -3); lua_pushstring(L, "anim"); lua_pushstring(L, model->anim()->getState().c_str()); lua_settable(L, -3); END_NOEXCEPTION; return 1; } //----------------------------------------------------------------- /** * void model_change_setExtraParams(model_index, table) * * Restores extra parameters after undo. */ int script_model_change_setExtraParams(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); lua_pushstring(L, "outDir"); lua_gettable(L, 2); int outDir = luaL_checkint(L, -1); lua_pushstring(L, "outCapacity"); lua_gettable(L, 2); int outCapacity = luaL_checkint(L, -1); lua_pushstring(L, "weight"); lua_gettable(L, 2); int weight = luaL_checkint(L, -1); lua_pushstring(L, "anim"); lua_gettable(L, 2); std::string animState = luaL_checkstring(L, -1); Cube *model = getModel(L, model_index); model->setOutDir((Dir::eDir)outDir, outCapacity, (Cube::eWeight)weight); model->setExtraParams(); model->anim()->restoreState(animState); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void model_equals(model_index, x, y) * * Returns whether object at location(x, y) is equal. * NOTE: model_index can be -1 for empty water. * NOTE: boder is as wall (even thought border.index == -1) */ int script_model_equals(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); int x = luaL_checkint(L, 2); int y = luaL_checkint(L, 3); Cube *other = getLevelScript(L)->askField(V2(x, y)); bool equals = false; if (other) { if (model_index == -1) { equals = false; } else { equals = (model_index == other->getIndex()); } } else { if (model_index == -1) { equals = true; } } lua_pushboolean(L, equals); END_NOEXCEPTION; //NOTE: return equals return 1; } //----------------------------------------------------------------- /** * void sound_addSound(name, file) * * Store this sound resource under this name. */ int script_sound_addSound(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *name = luaL_checkstring(L, 1); const char *file = luaL_checkstring(L, 2); getLevelScript(L)->addSound(name, Path::dataReadPath(file)); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void sound_playSound(name, volume) */ int script_sound_playSound(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *name = luaL_checkstring(L, 1); int volume = luaL_optint(L, 2, 100); getLevelScript(L)->playSound(name, volume); END_NOEXCEPTION; return 0; } fillets-ng-1.0.1/src/level/RoomAccess.h0000644000175000017500000000076110120376304014603 00000000000000#ifndef HEADER_ROOMACCESS_H #define HEADER_ROOMACCESS_H class Room; #include "NoCopy.h" /** * Interface to access changing room. */ class RoomAccess : public NoCopy { private: Room *m_room; private: void checkRoom() const; public: RoomAccess(); ~RoomAccess(); void takeRoom(Room *new_room); void cleanRoom(); bool isRoom() const { return !!m_room; } Room *room(); const Room *const_room() const; }; #endif fillets-ng-1.0.1/src/level/Controls.h0000644000175000017500000000314011047536072014353 00000000000000#ifndef HEADER_CONTROLS_H #define HEADER_CONTROLS_H class V2; class Unit; class Cube; class PhaseLocker; class KeyStroke; class InputProvider; class MouseStroke; #include "NoCopy.h" #include "KeyControl.h" #include "StepCounter.h" #include #include /** * Keyboard and mouse controls. */ class Controls : public StepCounter, public NoCopy { private: typedef std::vector t_units; t_units m_units; t_units::iterator m_active; int m_speedup; KeyControl m_arrows; bool m_switch; std::string m_moves; PhaseLocker *m_locker; char m_strokeSymbol; private: bool useSwitch(); bool useStroke(); bool driveUnit(const InputProvider *input); void setActive(t_units::iterator active); int getNeededPhases(int speedup) const; bool activateDriven(char symbol); public: Controls(PhaseLocker *locker); ~Controls(); void setMoves(const std::string &moves); void addUnit(Unit *unit); const Unit *getActive(); bool driving(const InputProvider *input); void lockPhases(); void checkActive(); void switchActive(); bool makeMove(char move); bool cannotMove() const; void controlEvent(const KeyStroke &stroke); bool activateSelected(const Cube *occupant); virtual int getStepCount() const { return m_moves.size(); } virtual std::string getMoves() const { return m_moves; } virtual bool isPowerful() const; virtual bool isDangerousMove() const; }; #endif fillets-ng-1.0.1/src/level/FinderPlace.h0000644000175000017500000000071110120337565014722 00000000000000#ifndef HEADER_FINDERPLACE_H #define HEADER_FINDERPLACE_H #include "Dir.h" #include "V2.h" /** * Place with some info used for finding. */ class FinderPlace { private: Dir::eDir m_startDir; V2 m_loc; public: FinderPlace(Dir::eDir startDir, const V2 &loc) : m_startDir(startDir), m_loc(loc) {} V2 getLoc() const { return m_loc; } Dir::eDir getStartDir() const { return m_startDir; } }; #endif fillets-ng-1.0.1/src/level/RopeDecor.h0000644000175000017500000000102310072501016014413 00000000000000#ifndef HEADER_ROPEDECOR_H #define HEADER_ROPEDECOR_H class Cube; class View; #include "Decor.h" #include "V2.h" #include "SDL.h" /** * Draw rope between two models. */ class RopeDecor : public Decor { private: const Cube *m_model1; const Cube *m_model2; V2 m_shift1; V2 m_shift2; public: RopeDecor(const Cube *model1, const Cube *model2, const V2 &shift1, const V2 &shift2); virtual void drawOnScreen(const View *view, SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/level/KeyControl.h0000644000175000017500000000124210066370030014630 00000000000000#ifndef HEADER_KEYCONTROL_H #define HEADER_KEYCONTROL_H #include "SDL.h" /** * Keyboard controls. */ class KeyControl { private: SDLKey m_up; SDLKey m_down; SDLKey m_left; SDLKey m_right; public: KeyControl(); void setUp(SDLKey key) { m_up = key; } void setDown(SDLKey key) { m_down = key; } void setLeft(SDLKey key) { m_left = key; } void setRight(SDLKey key) { m_right = key; } SDLKey getUp() const { return m_up; } SDLKey getDown() const { return m_down; } SDLKey getLeft() const { return m_left; } SDLKey getRight() const { return m_right; } }; #endif fillets-ng-1.0.1/src/level/ModelList.cpp0000644000175000017500000000336210110454734014777 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ModelList.h" #include "View.h" #include "Landslip.h" //----------------------------------------------------------------- /** * Create new wrapper. * @param models wrapped models. */ ModelList::ModelList(const Cube::t_models *models) { m_models = models; } //----------------------------------------------------------------- void ModelList::drawOn(View *view) const { Cube::t_models::const_iterator end = m_models->end(); for (Cube::t_models::const_iterator i = m_models->begin(); i != end; ++i) { view->drawModel(*i); } } //----------------------------------------------------------------- /** * Stone all models on fixed pad. * @return true when new model was stoned */ bool ModelList::stoneOn(Landslip *slip) const { bool change = false; Cube::t_models::const_iterator end = m_models->end(); for (Cube::t_models::const_iterator i = m_models->begin(); i != end; ++i) { if (slip->stoneModel(*i)) { change = true; } } return change; } //----------------------------------------------------------------- /** * Let all not stoned models to fall. * @return true when something is falling */ bool ModelList::fallOn(Landslip *slip) const { bool falling = false; Cube::t_models::const_iterator end = m_models->end(); for (Cube::t_models::const_iterator i = m_models->begin(); i != end; ++i) { falling |= slip->fallModel(*i); } return falling; } fillets-ng-1.0.1/src/level/LevelStatus.cpp0000644000175000017500000001041110152763433015354 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "LevelStatus.h" #include "def-script.h" #include "Path.h" #include "ScriptState.h" #include "ScriptException.h" #include "DemoMode.h" extern "C" { #include "lua.h" } #include //----------------------------------------------------------------- inline LevelStatus * getStatus(lua_State *L) { return dynamic_cast(script_getLeader(L)); } //----------------------------------------------------------------- /** * void status_readMoves(saved_moves) */ static int script_status_readMoves(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *saved_moves = luaL_checkstring(L, 1); getStatus(L)->readMoves(saved_moves); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- LevelStatus::LevelStatus() { m_bestMoves = -1; m_complete = false; m_wasRunning = false; m_script->registerFunc("status_readMoves", script_status_readMoves); } //----------------------------------------------------------------- void LevelStatus::readMoves(const std::string &savedMoves) { m_savedMoves = savedMoves; } //----------------------------------------------------------------- void LevelStatus::prepareRun(const std::string &codename, const std::string &poster, int bestMoves, const std::string &bestAuthor) { m_complete = false; m_wasRunning = false; m_codename = codename; m_poster = poster; m_bestMoves = bestMoves; m_bestAuthor = bestAuthor; } //----------------------------------------------------------------- std::string LevelStatus::getSolutionFilename(const std::string &codename) { return "solved/" + codename + ".lua"; } //----------------------------------------------------------------- std::string LevelStatus::getSolutionFilename() const { return getSolutionFilename(m_codename); } //----------------------------------------------------------------- /** * Read the best solution. * @return saved_moves or empty string */ std::string LevelStatus::readSolvedMoves() { m_savedMoves = ""; Path oldSolution = Path::dataReadPath(getSolutionFilename()); if (oldSolution.exists()) { try { scriptDo("saved_moves=nil"); scriptInclude(oldSolution); scriptDo("status_readMoves(saved_moves)"); } catch (ScriptException &e) { LOG_WARNING(e.info()); } } return m_savedMoves; } //----------------------------------------------------------------- /** * Write best solution to the file. * Save moves and models state. */ void LevelStatus::writeSolvedMoves(const std::string &moves) { std::string prevMoves = readSolvedMoves(); if (prevMoves.empty() || moves.size() < prevMoves.size()) { Path file = Path::dataWritePath(getSolutionFilename()); FILE *saveFile = fopen(file.getNative().c_str(), "w"); if (saveFile) { fputs("\nsaved_moves = '", saveFile); fputs(moves.c_str(), saveFile); fputs("'\n", saveFile); fclose(saveFile); } else { LOG_WARNING(ExInfo("cannot save solution") .addInfo("file", file.getNative()) .addInfo("moves", moves)); } } } //----------------------------------------------------------------- /** * Returns DemoMode or NULL. */ GameState * LevelStatus::createPoster() const { DemoMode *result = NULL; if (!m_poster.empty()) { result = new DemoMode(Path::dataReadPath(m_poster)); } return result; } //----------------------------------------------------------------- /** * Compares this player and the best one. * @returns -1 (this is worse), 0 (equals) or 1 (the best) */ int LevelStatus::compareToBest() { int moves = readSolvedMoves().size(); int result = 1; if (m_bestMoves > 0) { if (m_bestMoves < moves) { result = -1; } else if (m_bestMoves == moves) { result = 0; } } return result; } fillets-ng-1.0.1/src/level/Room.cpp0000644000175000017500000003310111626004213014005 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Room.h" #include "WavyPicture.h" #include "Field.h" #include "FinderAlg.h" #include "ResSoundPack.h" #include "Controls.h" #include "PhaseLocker.h" #include "Planner.h" #include "View.h" #include "Log.h" #include "Rules.h" #include "LogicException.h" #include "LoadException.h" #include "Unit.h" #include "TimerAgent.h" #include "SubTitleAgent.h" #include "DialogStack.h" #include "SoundAgent.h" #include "OptionAgent.h" #include "ModelList.h" #include "Landslip.h" #include "MouseStroke.h" #include "MouseControl.h" #include "Path.h" #include //----------------------------------------------------------------- /** * Create room holder. * @param w room width * @param h room height * @param picture room background * @param locker shared locker for anim * @param levelScript shared planner to interrupt */ Room::Room(int w, int h, const std::string &picture, PhaseLocker *locker, Planner *levelScript) { m_locker = locker; m_levelScript = levelScript; m_fastFalling = false; m_bg = new WavyPicture(Path::dataReadPath(picture), V2(0, 0)); m_bgFilename = picture; m_field = new Field(w, h); m_finder = new FinderAlg(w, h); m_controls = new Controls(m_locker); m_view = new View(ModelList(&m_models)); m_lastAction = Cube::ACTION_NO; m_soundPack = new ResSoundPack(); m_startTime = TimerAgent::agent()->getCycles(); } //----------------------------------------------------------------- /** * Delete field and models. */ Room::~Room() { m_soundPack->removeAll(); delete m_soundPack; m_levelScript->killPlan(); m_levelScript->dialogs()->removeAll(); SubTitleAgent::agent()->removeAll(); delete m_controls; delete m_view; //NOTE: models must be removed before field because they unmask self Cube::t_models::iterator end = m_models.end(); for (Cube::t_models::iterator i = m_models.begin(); i != end; ++i) { delete (*i); } delete m_finder; delete m_field; delete m_bg; } //----------------------------------------------------------------- /** * Set waves on background. */ void Room::setWaves(float amplitude, float periode, float speed) { m_bg->setWamp(amplitude); m_bg->setWperiode(periode); m_bg->setWspeed(speed); } //----------------------------------------------------------------- void Room::addDecor(Decor *new_decor) { m_view->addDecor(new_decor); } //----------------------------------------------------------------- /** * Add model at scene. * @param new_model new object * @param new_unit driver for the object or NULL * @return model index */ int Room::addModel(Cube *new_model, Unit *new_unit) { new_model->rules()->takeField(m_field); m_models.push_back(new_model); if (new_unit) { new_unit->takeModel(new_model); m_controls->addUnit(new_unit); } int model_index = m_models.size() - 1; new_model->setIndex(model_index); return model_index; } //----------------------------------------------------------------- /** * Return model at index. * @throws LogicException when model_index is out of range */ Cube * Room::getModel(int model_index) { Cube *result = NULL; if (0 <= model_index && model_index < (int)m_models.size()) { result = m_models[model_index]; } else { throw LogicException(ExInfo("bad model index") .addInfo("model_index", model_index)); } return result; } //----------------------------------------------------------------- /** * Return model at location. */ Cube * Room::askField(const V2 &loc) { return m_field->getModel(loc); } //----------------------------------------------------------------- /** * Update all models. * Prepare new move, let models fall, let models drive, release old position. */ void Room::nextRound(const InputProvider *input) { if (m_fastFalling) { while (beginFall()) { finishRound(); } } else { beginFall(); } if (isFresh()) { if (m_controls->driving(input)) { m_lastAction = Cube::ACTION_MOVE; } else { MouseControl rat(m_controls, m_view, m_finder); if (rat.mouseDrive(input)) { m_lastAction = Cube::ACTION_MOVE; } } } finishRound(); } //----------------------------------------------------------------- /** * Play sound like some object has fall. * NOTE: only one sound is played even more objects have fall */ void Room::playImpact(Cube::eWeight impact) { switch (impact) { case Cube::NONE: break; case Cube::LIGHT: playSound("impact_light", 50); break; case Cube::HEAVY: playSound("impact_heavy", 50); break; default: assert(!"unknown impact weight"); } } //----------------------------------------------------------------- /** * Play sound like a fish die. * @param model fresh dead fish */ void Room::playDead(Cube *model) { m_levelScript->dialogs()->killSound(model->getIndex()); switch (model->getPower()) { case Cube::LIGHT: playSound("dead_small"); break; case Cube::HEAVY: playSound("dead_big"); break; default: LOG_WARNING(ExInfo("curious power of dead fish") .addInfo("power", model->getPower())); break; } } //----------------------------------------------------------------- /** * Move all models to new position * and check dead fihes. */ void Room::prepareRound() { bool interrupt = false; //NOTE: we must call this functions sequential for all objects Cube::t_models::iterator end = m_models.end(); for (Cube::t_models::iterator i = m_models.begin(); i != end; ++i) { (*i)->rules()->freeOldPos(); } for (Cube::t_models::iterator i = m_models.begin(); i != end; ++i) { (*i)->rules()->occupyNewPos(); } for (Cube::t_models::iterator j = m_models.begin(); j != end; ++j) { bool die = (*j)->rules()->checkDead(m_lastAction); interrupt |= die; if (die) { playDead(*j); } } for (Cube::t_models::iterator l = m_models.begin(); l != end; ++l) { (*l)->rules()->changeState(); } if (interrupt) { m_levelScript->interruptPlan(); } } //----------------------------------------------------------------- /** * Let models to go out of screen. * @param interactive whether do anim * @return true when a model went out */ bool Room::fallout(bool interactive) { bool wentOut = false; Cube::t_models::iterator end = m_models.end(); for (Cube::t_models::iterator i = m_models.begin(); i != end; ++i) { if (!(*i)->isLost()) { int outDepth = (*i)->rules()->actionOut(); if (outDepth > 0) { wentOut = true; if (interactive) { m_locker->ensurePhases(3); } } else if (outDepth == -1) { m_levelScript->interruptPlan(); } } } return wentOut; } //----------------------------------------------------------------- /** * Let things fall. * @return true when something is falling. */ bool Room::falldown(bool interactive) { ModelList models(&m_models); Landslip slip(models); bool falling = slip.computeFall(); if (interactive) { playImpact(slip.getImpact()); } return falling; } //----------------------------------------------------------------- /** * Let models to release their old position. * @param interactive whether ensure phases for motion animation */ void Room::finishRound(bool interactive) { if (interactive) { m_controls->lockPhases(); } m_view->noteNewRound(m_locker->getLocked()); } //----------------------------------------------------------------- void Room::switchFish() { m_controls->switchActive(); } //----------------------------------------------------------------- void Room::controlEvent(const KeyStroke &stroke) { m_controls->controlEvent(stroke); } //----------------------------------------------------------------- void Room::controlMouse(const MouseStroke &button) { if (button.isLeft()) { V2 fieldPos = m_view->getFieldPos(button.getLoc()); Cube *model = askField(fieldPos); m_controls->activateSelected(model); } } //----------------------------------------------------------------- const StepCounter * Room::stepCounter() const { return m_controls; } //----------------------------------------------------------------- void Room::setMoves(const std::string &moves) { m_controls->setMoves(moves); } //----------------------------------------------------------------- void Room::checkActive() { return m_controls->checkActive(); } //----------------------------------------------------------------- void Room::unBusyUnits() { Cube::t_models::iterator end = m_models.end(); for (Cube::t_models::iterator i = m_models.begin(); i != end; ++i) { (*i)->setBusy(false); } } //----------------------------------------------------------------- /** * Load this move, let object to fall fast. * Don't play sound. * @throws LoadException for bad moves */ void Room::loadMove(char move) { static const bool NO_INTERACTIVE = false; bool falling = true; while (falling) { falling = beginFall(NO_INTERACTIVE); makeMove(move); finishRound(NO_INTERACTIVE); } } //----------------------------------------------------------------- /** * Begin round. * Let objects fall. * First objects can fall out of room (even upward), * when nothing is going out, then objects can fall down by gravity. * * @param interactive whether play sound and do anim * @return true when something was falling */ bool Room::beginFall(bool interactive) { prepareRound(); m_lastAction = Cube::ACTION_NO; if (fallout(interactive)) { m_lastAction = Cube::ACTION_MOVE; } else { if (falldown(interactive)) { m_lastAction = Cube::ACTION_FALL; } } return m_lastAction != Cube::ACTION_NO; } //----------------------------------------------------------------- /** * Try make single move. * @return true for success or false when something has moved before * @throws LoadException for bad moves */ bool Room::makeMove(char move) { bool result = false; if (isFresh()) { if (!m_controls->makeMove(move)) { throw LoadException(ExInfo("load error - bad move") .addInfo("move", std::string(1, move))); } m_lastAction = Cube::ACTION_MOVE; result = true; } return result; } //----------------------------------------------------------------- /** * Returns true when there is no unit which will be able to move. */ bool Room::cannotMove() const { return m_controls->cannotMove(); } //----------------------------------------------------------------- /** * Returns true when all goals can be solved. */ bool Room::isSolvable() const { Cube::t_models::const_iterator end = m_models.end(); for (Cube::t_models::const_iterator i = m_models.begin(); i != end; ++i) { if ((*i)->isWrong()) { return false; } } return true; } //----------------------------------------------------------------- /** * Returns true when all goal all satisfied. * Right time to ask is after finishRound. * NOTE: room is not solved when somethig is still falling */ bool Room::isSolved() const { if (!isFresh()) { return false; } Cube::t_models::const_iterator end = m_models.end(); for (Cube::t_models::const_iterator i = m_models.begin(); i != end; ++i) { if (!(*i)->isSatisfy()) { return false; } } return true; } //----------------------------------------------------------------- int Room::getW() const { return m_field->getW(); } //----------------------------------------------------------------- int Room::getH() const { return m_field->getH(); } //----------------------------------------------------------------- int Room::getCycles() const { return TimerAgent::agent()->getCycles() - m_startTime; } //----------------------------------------------------------------- void Room::addSound(const std::string &name, const Path &file) { m_soundPack->addSound(name, file); } //----------------------------------------------------------------- void Room::playSound(const std::string &name, int volume) { if (OptionAgent::agent()->getAsBool("sound", true)) { SoundAgent::agent()->playSound( m_soundPack->getRandomRes(name), volume); } } //----------------------------------------------------------------- /** * Shift room content. * NOTE: background is not shifted */ void Room::setScreenShift(const V2 &shift) { m_view->setScreenShift(shift); } //----------------------------------------------------------------- void Room::changeBg(const std::string &picture) { if (picture != m_bgFilename) { m_bg->changePicture(Path::dataReadPath(picture)); m_bgFilename = picture; } } //----------------------------------------------------------------- void Room::drawOn(SDL_Surface *screen) { m_bg->drawOn(screen); m_view->drawOn(screen); } fillets-ng-1.0.1/src/level/FinderAlg.cpp0000644000175000017500000000555210125362242014737 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "FinderAlg.h" #include "V2.h" #include "Unit.h" #include "FinderPlace.h" //----------------------------------------------------------------- FinderAlg::FinderAlg(int w, int h) : m_closed(w, h) { m_unit = NULL; } //----------------------------------------------------------------- /** * Finds the best start direction to the destination. * @param unit unit which finds path * @param dest destination, final destination must be under unit * @return direction or DIR_NO */ Dir::eDir FinderAlg::findDir(const Unit *unit, const V2 &dest) { if (m_unit) { m_closed.reset(); m_fifo.clear(); } m_unit = unit; V2 uLoc = unit->getLoc(); int w = unit->getW(); int h = unit->getH(); if (isInRect(uLoc, w, h, dest)) { return Dir::DIR_NO; } //TODO: don't compute when dest is on the wall m_closed.markClosed(uLoc); m_fifo.push_back(FinderPlace(Dir::DIR_LEFT, uLoc.plus(V2(-1, 0)))); m_fifo.push_back(FinderPlace(Dir::DIR_RIGHT, uLoc.plus(V2(+1, 0)))); m_fifo.push_back(FinderPlace(Dir::DIR_UP, uLoc.plus(V2(0, -1)))); m_fifo.push_back(FinderPlace(Dir::DIR_DOWN, uLoc.plus(V2(0, +1)))); while (!m_fifo.empty()) { FinderPlace place = m_fifo.front(); m_fifo.pop_front(); if (tryPlace(place)) { if (isInRect(place.getLoc(), w, h, dest)) { return place.getStartDir(); } pushNext(place, V2(-1, 0)); pushNext(place, V2(+1, 0)); pushNext(place, V2(0, -1)); pushNext(place, V2(0, +1)); } } return Dir::DIR_NO; } //----------------------------------------------------------------- /** * Push neighbour to the fifo. * Only open place is stored. */ void FinderAlg::pushNext(const FinderPlace &parent, const V2 &shift) { V2 loc = parent.getLoc().plus(shift); if (!m_closed.isClosed(loc)) { m_closed.markClosed(loc); m_fifo.push_back(FinderPlace(parent.getStartDir(), loc)); } } //----------------------------------------------------------------- /** * Whether dest in inside given rectangle. */ bool FinderAlg::isInRect(const V2 &rectLoc, int w, int h, const V2 &dest) const { int rX = rectLoc.getX(); int rY = rectLoc.getY(); int destX = dest.getX(); int destY = dest.getY(); return (rX <= destX && destX < rX + w) && (rY <= destY && destY < rY + h); } //----------------------------------------------------------------- bool FinderAlg::tryPlace(const FinderPlace &place) const { return m_unit->isFreePlace(place.getLoc()); } fillets-ng-1.0.1/src/level/ControlSym.h0000644000175000017500000000130010066573632014660 00000000000000#ifndef HEADER_CONTROLSYM_H #define HEADER_CONTROLSYM_H /** * Control symbols to save. * Symbols can be printable characters only * (are stored in saved_moves as plain text). */ class ControlSym { public: static const char SYM_NONE = 0; private: char m_up; char m_down; char m_left; char m_right; public: ControlSym(char up, char down, char left, char right) : m_up(up), m_down(down), m_left(left), m_right(right) {} char getUp() const { return m_up; } char getDown() const { return m_down; } char getLeft() const { return m_left; } char getRight() const { return m_right; } }; #endif fillets-ng-1.0.1/src/level/CountAdvisor.h0000644000175000017500000000043310120407100015146 00000000000000#ifndef HEADER_COUNTADVISOR_H #define HEADER_COUNTADVISOR_H /** * Interface to advise countdown. */ class CountAdvisor { public: virtual ~CountAdvisor() {} virtual int getCountForSolved() const = 0; virtual int getCountForWrong() const = 0; }; #endif fillets-ng-1.0.1/src/level/Makefile.in0000644000175000017500000004110211632204473014441 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/level DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru liblevel_a_AR = $(AR) $(ARFLAGS) liblevel_a_LIBADD = am_liblevel_a_OBJECTS = Anim.$(OBJEXT) Controls.$(OBJEXT) \ Cube.$(OBJEXT) Field.$(OBJEXT) Goal.$(OBJEXT) \ KeyControl.$(OBJEXT) Level.$(OBJEXT) MarkMask.$(OBJEXT) \ ModelFactory.$(OBJEXT) Room.$(OBJEXT) Rules.$(OBJEXT) \ Shape.$(OBJEXT) ShapeBuilder.$(OBJEXT) Unit.$(OBJEXT) \ View.$(OBJEXT) PhaseLocker.$(OBJEXT) LevelStatus.$(OBJEXT) \ LevelScript.$(OBJEXT) ModelList.$(OBJEXT) LevelInput.$(OBJEXT) \ RopeDecor.$(OBJEXT) StepDecor.$(OBJEXT) game-script.$(OBJEXT) \ level-script.$(OBJEXT) StatusDisplay.$(OBJEXT) \ Landslip.$(OBJEXT) LevelLoading.$(OBJEXT) \ LevelCountDown.$(OBJEXT) RoomAccess.$(OBJEXT) Dir.$(OBJEXT) \ MouseControl.$(OBJEXT) FinderAlg.$(OBJEXT) \ FinderField.$(OBJEXT) liblevel_a_OBJECTS = $(am_liblevel_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(liblevel_a_SOURCES) DIST_SOURCES = $(liblevel_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan -I@top_srcdir@/src/option -I@top_srcdir@/src/state $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = liblevel.a liblevel_a_SOURCES = Anim.cpp Anim.h ControlSym.h Controls.cpp Controls.h Cube.cpp Cube.h Field.cpp Field.h Goal.cpp Goal.h KeyControl.cpp KeyControl.h LayoutException.h Level.cpp Level.h LoadException.h MarkMask.cpp MarkMask.h ModelFactory.cpp ModelFactory.h Room.cpp Room.h Rules.cpp Rules.h Shape.cpp Shape.h ShapeBuilder.cpp ShapeBuilder.h Unit.cpp Unit.h View.cpp View.h PhaseLocker.cpp PhaseLocker.h LevelStatus.cpp LevelStatus.h LevelScript.cpp LevelScript.h ModelList.cpp ModelList.h LevelInput.cpp LevelInput.h OnCondition.h OnStack.h OnWall.h OnStrongPad.h Decor.h RopeDecor.cpp RopeDecor.h StepCounter.h StepDecor.cpp StepDecor.h game-script.cpp game-script.h level-script.cpp level-script.h DescFinder.h StatusDisplay.cpp StatusDisplay.h Landslip.cpp Landslip.h LevelLoading.cpp LevelLoading.h LevelCountDown.cpp LevelCountDown.h RoomAccess.cpp RoomAccess.h Dir.cpp Dir.h MouseControl.cpp MouseControl.h FinderAlg.cpp FinderAlg.h FinderPlace.h FinderField.cpp FinderField.h CountAdvisor.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/level/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/level/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) liblevel.a: $(liblevel_a_OBJECTS) $(liblevel_a_DEPENDENCIES) -rm -f liblevel.a $(liblevel_a_AR) liblevel.a $(liblevel_a_OBJECTS) $(liblevel_a_LIBADD) $(RANLIB) liblevel.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Anim.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Controls.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Cube.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Field.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FinderAlg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FinderField.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Goal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KeyControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Landslip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Level.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LevelCountDown.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LevelInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LevelLoading.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LevelScript.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LevelStatus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MarkMask.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModelFactory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ModelList.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MouseControl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PhaseLocker.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Room.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RoomAccess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RopeDecor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Rules.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Shape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ShapeBuilder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StatusDisplay.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StepDecor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Unit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/View.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/game-script.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/level-script.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/level/StepDecor.cpp0000644000175000017500000000300710214722463014771 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "StepDecor.h" #include "StepCounter.h" #include "Path.h" #include "StringTool.h" #include "OptionAgent.h" //----------------------------------------------------------------- StepDecor::StepDecor(const StepCounter *counter) : m_font(Path::dataReadPath("font/font_console.ttf"), 20) { m_counter = counter; } //----------------------------------------------------------------- /** * Draw number of steps in right-top corner. */ void StepDecor::drawOnScreen(const View * /*view*/, SDL_Surface *screen) { static const SDL_Color COLOR_ORANGE = {255, 197, 102, 255}; static const SDL_Color COLOR_BLUE = {162, 244, 255, 255}; if (OptionAgent::agent()->getAsBool("show_steps")) { SDL_Color color; if (m_counter->isPowerful()) { color = COLOR_BLUE; } else { color = COLOR_ORANGE; } std::string steps = StringTool::toString(m_counter->getStepCount()); SDL_Surface *text_surface = m_font.renderTextOutlined(steps, color); SDL_Rect rect; rect.x = screen->w - text_surface->w; rect.y = 10; SDL_BlitSurface(text_surface, NULL, screen, &rect); SDL_FreeSurface(text_surface); } } fillets-ng-1.0.1/src/level/StepCounter.h0000644000175000017500000000060311047536117015024 00000000000000#ifndef HEADER_STEPCOUNTER_H #define HEADER_STEPCOUNTER_H #include /** * Interface to number of steps. */ class StepCounter { public: virtual ~StepCounter() {} virtual int getStepCount() const = 0; virtual std::string getMoves() const = 0; virtual bool isPowerful() const = 0; virtual bool isDangerousMove() const = 0; }; #endif fillets-ng-1.0.1/src/level/MouseControl.cpp0000644000175000017500000000510610125025230015521 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "MouseControl.h" #include "Controls.h" #include "View.h" #include "FinderAlg.h" #include "Unit.h" #include "InputProvider.h" //----------------------------------------------------------------- MouseControl::MouseControl(Controls *controls, const View *view, FinderAlg *finder) { m_controls = controls; m_view = view; m_finder = finder; } //----------------------------------------------------------------- /** * Left button finds shortest path. * Right button moves to the cursor. * @return whether a move was made */ bool MouseControl::mouseDrive(const InputProvider *input) const { bool moved = false; V2 field = m_view->getFieldPos(input->getMouseLoc()); if (input->isLeftPressed()) { moved = moveTo(field); } else if (input->isRightPressed()) { moved = moveHardTo(field); } return moved; } //----------------------------------------------------------------- /** * Move along shortest path without pushing. * @param field destination field * @return whether a move was made */ bool MouseControl::moveTo(const V2 &field) const { bool moved = false; const Unit *unit = m_controls->getActive(); if (unit) { Dir::eDir dir = m_finder->findDir(unit, field); if (dir != Dir::DIR_NO) { moved = m_controls->makeMove(unit->myOrder(dir)); } } return moved; } //----------------------------------------------------------------- /** * Move direct to the destination. * @param field destination field * @return whether a move was made */ bool MouseControl::moveHardTo(const V2 &field) const { bool moved = false; const Unit *unit = m_controls->getActive(); if (unit) { V2 loc = unit->getLoc(); if (field.getX() < loc.getX()) { moved = m_controls->makeMove(unit->myOrder(Dir::DIR_LEFT)); } else if (loc.getX() + unit->getW() <= field.getX()) { moved = m_controls->makeMove(unit->myOrder(Dir::DIR_RIGHT)); } else if (field.getY() < loc.getY()) { moved = m_controls->makeMove(unit->myOrder(Dir::DIR_UP)); } else if (loc.getY() + unit->getH() <= field.getY()) { moved = m_controls->makeMove(unit->myOrder(Dir::DIR_DOWN)); } } return moved; } fillets-ng-1.0.1/src/level/LevelCountDown.h0000644000175000017500000000137610120407100015445 00000000000000#ifndef HEADER_LEVELCOUNTDOWN_H #define HEADER_LEVELCOUNTDOWN_H class LevelStatus; class RoomAccess; class Room; class GameState; class CountAdvisor; /** * Countdowns finished or wrong state. */ class LevelCountDown { private: int m_countdown; const RoomAccess *m_access; LevelStatus *m_levelStatus; private: void setCountDown(const CountAdvisor *advisor); public: LevelCountDown(const RoomAccess *access); void fillStatus(LevelStatus *status) { m_levelStatus = status; } void reset(); bool countDown(const CountAdvisor *advisor); bool isFinishedEnough() const; bool isWrongEnough() const; void saveSolution(); GameState *createNextState(); }; #endif fillets-ng-1.0.1/src/level/OnStrongPad.h0000644000175000017500000000121711264423267014753 00000000000000#ifndef HEADER_ONSTRONGPAD_H #define HEADER_ONSTRONGPAD_H #include "OnCondition.h" #include "Cube.h" /** * Test whether model is on Wall or on powerful fish. */ class OnStrongPad : public OnCondition { private: Cube::eWeight m_weight; public: OnStrongPad(Cube::eWeight weight) { m_weight = weight; } virtual bool isSatisfy(Cube *model) const { return model->isWall() || (model->isAlive() && model->getPower() >= m_weight); } virtual bool isWrong(Cube *model) const { return model->isAlive() && model->getPower() < m_weight; } }; #endif fillets-ng-1.0.1/src/level/OnCondition.h0000644000175000017500000000043510071355133014770 00000000000000#ifndef HEADER_ONCONDITION_H #define HEADER_ONCONDITION_H class Cube; /** * Test condition. */ class OnCondition { public: virtual ~OnCondition() {} virtual bool isSatisfy(Cube *model) const = 0; virtual bool isWrong(Cube *model) const = 0; }; #endif fillets-ng-1.0.1/src/level/Goal.h0000644000175000017500000000115010104741577013432 00000000000000#ifndef HEADER_GOAL_H #define HEADER_GOAL_H class Cube; /** * Goal for model. */ class Goal { private: enum eSATISFY { SATISFY_TRUE, SATISFY_FALSE, SATISFY_IGNORE }; eSATISFY m_alive; eSATISFY m_out; private: Goal(eSATISFY out, eSATISFY alive); public: static Goal noGoal(); static Goal outGoal(); static Goal escapeGoal(); static Goal aliveGoal(); bool isSatisfy(const Cube *model) const; bool isWrong(const Cube *model) const; bool shouldGoOut() const; }; #endif fillets-ng-1.0.1/src/level/StepDecor.h0000644000175000017500000000062710105420020014422 00000000000000#ifndef HEADER_STEPDECOR_H #define HEADER_STEPDECOR_H class View; class StepCounter; #include "Decor.h" #include "Font.h" /** * Draw number of steps. */ class StepDecor : public Decor { private: Font m_font; const StepCounter *m_counter; public: StepDecor(const StepCounter *counter); virtual void drawOnScreen(const View *view, SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/level/Field.cpp0000644000175000017500000000422110677223343014131 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Field.h" #include "V2.h" #include "Cube.h" #include "Rules.h" #include "ModelFactory.h" #include // memset() //----------------------------------------------------------------- /** * Two dimensional array of Cube pointers. */ Field::Field(int w, int h) { m_w = w; m_h = h; m_border = ModelFactory::createBorder(); m_border->rules()->takeField(this); //NOTE: [y][x] indexes m_marks = new Cube**[m_h]; for (int y = 0; y < m_h; ++y) { m_marks[y] = new Cube*[m_w]; memset(m_marks[y], 0, sizeof(Cube *) * m_w); } } //----------------------------------------------------------------- Field::~Field() { for (int y = 0; y < m_h; ++y) { delete [] m_marks[y]; } delete [] m_marks; delete m_border; } //----------------------------------------------------------------- /** * Get model which occupied this location. * Empty locations are NULL filled. * Locations out of field are filled with border object. */ Cube * Field::getModel(const V2 &loc) { int x = loc.getX(); int y = loc.getY(); //NOTE: hack border everywhere in outher space Cube *result = m_border; if ((0 <= x && x < m_w) && (0 <= y && y < m_h)) { result = m_marks[y][x]; } return result; } //----------------------------------------------------------------- /** * Mark this location as occupied by model. * Locations out of field will not be filled. * @param loc write location * @param model model to put on given location * @param toOverride allowed model to overwrite or NULL */ void Field::setModel(const V2 &loc, Cube *model, Cube *toOverride) { int x = loc.getX(); int y = loc.getY(); if ((0 <= x && x < m_w) && (0 <= y && y < m_h)) { if (toOverride == NULL || m_marks[y][x] == toOverride) { m_marks[y][x] = model; } } } fillets-ng-1.0.1/src/level/PhaseLocker.h0000644000175000017500000000055210100047663014744 00000000000000#ifndef HEADER_PHASELOCKER_H #define HEADER_PHASELOCKER_H /** * Lock game for anim phases. */ class PhaseLocker { private: int m_lockPhases; public: PhaseLocker(); void reset() { m_lockPhases = 0; } int getLocked() const { return m_lockPhases; } void decLock(); void ensurePhases(int count); }; #endif fillets-ng-1.0.1/src/level/ShapeBuilder.h0000644000175000017500000000113711124753156015123 00000000000000#ifndef HEADER_SHAPE_BUILDER_H #define HEADER_SHAPE_BUILDER_H class Shape; #include "Cube.h" #include "SDL.h" /** * Creator of images from shapes. * Useable for testing of new levels. */ class ShapeBuilder { private: /** * ShapeBuilder is not meant to be instantiated. */ ShapeBuilder() {} static void prepareColor(SDL_Color *color, const Shape *shape, Cube::eWeight weight); static Uint32 calcShapeHash(const Shape *shape); public: static SDL_Surface *createImage(const Shape *shape, Cube::eWeight weight); }; #endif fillets-ng-1.0.1/src/level/Makefile.am0000644000175000017500000000245411124717656014447 00000000000000SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan -I@top_srcdir@/src/option -I@top_srcdir@/src/state $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = liblevel.a liblevel_a_SOURCES = Anim.cpp Anim.h ControlSym.h Controls.cpp Controls.h Cube.cpp Cube.h Field.cpp Field.h Goal.cpp Goal.h KeyControl.cpp KeyControl.h LayoutException.h Level.cpp Level.h LoadException.h MarkMask.cpp MarkMask.h ModelFactory.cpp ModelFactory.h Room.cpp Room.h Rules.cpp Rules.h Shape.cpp Shape.h ShapeBuilder.cpp ShapeBuilder.h Unit.cpp Unit.h View.cpp View.h PhaseLocker.cpp PhaseLocker.h LevelStatus.cpp LevelStatus.h LevelScript.cpp LevelScript.h ModelList.cpp ModelList.h LevelInput.cpp LevelInput.h OnCondition.h OnStack.h OnWall.h OnStrongPad.h Decor.h RopeDecor.cpp RopeDecor.h StepCounter.h StepDecor.cpp StepDecor.h game-script.cpp game-script.h level-script.cpp level-script.h DescFinder.h StatusDisplay.cpp StatusDisplay.h Landslip.cpp Landslip.h LevelLoading.cpp LevelLoading.h LevelCountDown.cpp LevelCountDown.h RoomAccess.cpp RoomAccess.h Dir.cpp Dir.h MouseControl.cpp MouseControl.h FinderAlg.cpp FinderAlg.h FinderPlace.h FinderField.cpp FinderField.h CountAdvisor.h fillets-ng-1.0.1/src/level/Anim.cpp0000644000175000017500000001767711361565603014014 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Anim.h" #include "Log.h" #include "Path.h" #include "ResImagePack.h" #include "LogicException.h" #include "StringTool.h" #include "EffectNone.h" #include "EffectMirror.h" #include "EffectInvisible.h" #include "EffectReverse.h" #include "EffectZx.h" //----------------------------------------------------------------- /** * Create new animation sprite. */ Anim::Anim() : m_viewShift(0, 0) { m_animPack[SIDE_LEFT] = new ResImagePack(); m_animPack[SIDE_RIGHT] = new ResImagePack(); m_animName = ""; m_animPhase = 0; m_run = false; m_specialAnimName = ""; m_specialAnimPhase = 0; m_effect = new EffectNone(); } //----------------------------------------------------------------- Anim::~Anim() { m_animPack[SIDE_LEFT]->removeAll(); m_animPack[SIDE_RIGHT]->removeAll(); delete m_animPack[SIDE_LEFT]; delete m_animPack[SIDE_RIGHT]; delete m_effect; } //----------------------------------------------------------------- /** * Draw anim phase at screen position. * Increase phase when anim is running. */ void Anim::drawAt(SDL_Surface *screen, int x, int y, eSide side) { if (!m_effect->isInvisible()) { SDL_Surface *surface = m_animPack[side]->getRes(m_animName, m_animPhase); m_effect->blit(screen, surface, x, y); if (m_run) { m_animPhase++; if (m_animPhase >= m_animPack[side]->countRes(m_animName)) { m_animPhase = 0; } } if (!m_specialAnimName.empty()) { surface = m_animPack[side]->getRes(m_specialAnimName, m_specialAnimPhase); m_effect->blit(screen, surface, x, y); } } m_effect->updateEffect(); } //----------------------------------------------------------------- /** * Add picture to anim, * default side is left side. */ void Anim::addAnim(const std::string &name, const Path &picture, eSide side) { m_usedPath = picture.getPosixName(); m_animPack[side]->addImage(name, picture); } //----------------------------------------------------------------- /** * Add prepared picture to anim, * default side is left side. */ void Anim::addAnim(const std::string &name, SDL_Surface *new_image, eSide side) { m_animPack[side]->addRes(name, new_image); } //----------------------------------------------------------------- /** * Run this animation. * Nothing is changed when animation is already running. */ void Anim::runAnim(const std::string &name, int start_phase) { if (m_animName != name) { setAnim(name, start_phase); } m_run = true; } //----------------------------------------------------------------- /** * Set static visage. */ void Anim::setAnim(const std::string &name, int phase) { m_run = false; m_animName = name; m_animPhase = phase; int count = m_animPack[SIDE_LEFT]->countRes(name); if (m_animPhase >= count) { if (count == 0) { m_animPhase = 0; } else { m_animPhase %= count; } LOG_WARNING(ExInfo("anim phase over-flow") .addInfo("anim", name) .addInfo("phase", phase) .addInfo("count", count) .addInfo("usedPath", m_usedPath)); } } //----------------------------------------------------------------- /** * Use special efect for one phase. * Efect will be blited in second layer. * * @param name anim name, empty is no anim * @param phase anim phase */ void Anim::useSpecialAnim(const std::string &name, int phase) { m_specialAnimName = name; m_specialAnimPhase = phase; if (m_specialAnimName.empty()) { return; } int count = m_animPack[SIDE_LEFT]->countRes(name); if (m_specialAnimPhase >= count) { if (count == 0) { m_specialAnimName = ""; m_specialAnimPhase = 0; } else { m_specialAnimPhase %= count; } LOG_WARNING(ExInfo("special anim phase over-flow") .addInfo("anim", name) .addInfo("phase", phase) .addInfo("count", count)); } } //----------------------------------------------------------------- /** * Change effect. * @throws LogicException when new_effect is NULL. */ void Anim::changeEffect(ViewEffect *new_effect) { if (NULL == new_effect) { throw LogicException(ExInfo("new_effect is NULL") .addInfo("animName", m_animName) .addInfo("specialAnimName", m_specialAnimName)); } delete m_effect; m_effect = new_effect; } //----------------------------------------------------------------- int Anim::countAnimPhases(const std::string &anim, eSide side) const { return m_animPack[side]->countRes(anim); } //----------------------------------------------------------------- void Anim::setEffect(const std::string &effectName) { if (EffectNone::NAME == effectName) { changeEffect(new EffectNone()); } else if (EffectMirror::NAME == effectName) { changeEffect(new EffectMirror()); } else if (EffectInvisible::NAME == effectName) { changeEffect(new EffectInvisible()); } else if (EffectReverse::NAME == effectName) { changeEffect(new EffectReverse()); } else if (EffectZx::NAME == effectName) { changeEffect(new EffectZx()); } else { ExInfo error = ExInfo("unknown view effect") .addInfo("effect", effectName); LOG_WARNING(error); } } //----------------------------------------------------------------- static std::string encode(const std::string &input) { std::string output = input; StringTool::replace(output, "&", "&"); StringTool::replace(output, ",", ","); return output; } //----------------------------------------------------------------- static std::string encode(int value) { return StringTool::toString(value); } //----------------------------------------------------------------- static std::string decode(const std::string &input) { std::string output = input; StringTool::replace(output, ",", ","); StringTool::replace(output, "&", "&"); return output; } //----------------------------------------------------------------- static int decodeInt(const std::string &input) { bool ok; int result = StringTool::readInt(input.c_str(), &ok); if (!ok) { LOG_WARNING(ExInfo("invalid int") .addInfo("input", input)); } return result; } //----------------------------------------------------------------- std::string Anim::getState() const { std::string output; output += encode(m_effect->getName()); output += "," + encode(m_viewShift.getX()); output += "," + encode(m_viewShift.getY()); output += "," + encode(m_animName); output += "," + encode(m_animPhase); output += "," + encode(m_run); output += "," + encode(m_specialAnimName); output += "," + encode(m_specialAnimPhase); return output; } //----------------------------------------------------------------- void Anim::restoreState(const std::string &state) { StringTool::t_args values = StringTool::split(state, ','); if (values.size() != 8) { LOG_WARNING(ExInfo("invalid anim state") .addInfo("state", state)); return; } int i = 0; std::string effectName = decode(values[i++]); int x = decodeInt(values[i++]); int y = decodeInt(values[i++]); m_animName = decode(values[i++]); m_animPhase = decodeInt(values[i++]); m_run = decodeInt(values[i++]); m_specialAnimName = decode(values[i++]); m_specialAnimPhase = decodeInt(values[i++]); setEffect(effectName); m_viewShift = V2(x, y); } fillets-ng-1.0.1/src/level/RoomAccess.cpp0000644000175000017500000000322210120376304015131 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "RoomAccess.h" #include "Room.h" #include "LogicException.h" //----------------------------------------------------------------- /** * Room is not set. */ RoomAccess::RoomAccess() { m_room = NULL; } //----------------------------------------------------------------- RoomAccess::~RoomAccess() { cleanRoom(); } //----------------------------------------------------------------- void RoomAccess::takeRoom(Room *new_room) { cleanRoom(); m_room = new_room; } //----------------------------------------------------------------- /** * Remove old room. */ void RoomAccess::cleanRoom() { if (m_room) { delete m_room; m_room = NULL; } } //----------------------------------------------------------------- /** * Check whether room is ready. * @throws LogicException when room is not ready */ void RoomAccess::checkRoom() const { if (NULL == m_room) { throw LogicException(ExInfo("room is not ready")); } } //----------------------------------------------------------------- /** * Returns room or throws exception. */ Room * RoomAccess::room() { checkRoom(); return m_room; } //----------------------------------------------------------------- /** * Returns room or throws exception. */ const Room * RoomAccess::const_room() const { checkRoom(); return m_room; } fillets-ng-1.0.1/src/level/ShapeBuilder.cpp0000644000175000017500000000466111124754445015465 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ShapeBuilder.h" #include "Shape.h" #include "View.h" #include "SurfaceTool.h" //----------------------------------------------------------------- /** * Prepare color values * based on the given shape and weight. */ void ShapeBuilder::prepareColor(SDL_Color *color, const Shape *shape, Cube::eWeight weight) { if (NULL == color) { return; } color->r = 0; color->g = 0; color->b = 0; color->unused = 255; switch (weight) { case Cube::LIGHT: color->g = ShapeBuilder::calcShapeHash(shape) % 255; color->r = 255 - color->g; break; case Cube::HEAVY: color->b = 50 + ShapeBuilder::calcShapeHash(shape) % (255 - 50); break; default: color->r = 128; color->g = 128; color->b = 128; break; } } //----------------------------------------------------------------- /** * Calc an almost unique hash of the shape. */ Uint32 ShapeBuilder::calcShapeHash(const Shape *shape) { Uint32 hash = 0; Shape::const_iterator end = shape->marksEnd(); for (Shape::const_iterator i = shape->marksBegin(); i != end; ++i) { hash = 31 * hash + i->getX(); hash = 31 * hash + i->getY(); } return hash; } //----------------------------------------------------------------- /** * Create new image for the given shape. */ SDL_Surface * ShapeBuilder::createImage(const Shape *shape, Cube::eWeight weight) { static const SDL_Color TRANSPARENT = {255, 0, 255, 255}; SDL_Surface *surface = SurfaceTool::createTransparent( shape->getW() * View::SCALE, shape->getH() * View::SCALE, TRANSPARENT); SDL_Rect rect; rect.w = View::SCALE; rect.h = View::SCALE; SDL_Color color; prepareColor(&color, shape, weight); Shape::const_iterator end = shape->marksEnd(); for (Shape::const_iterator i = shape->marksBegin(); i != end; ++i) { rect.x = i->getX() * View::SCALE; rect.y = i->getY() * View::SCALE; SurfaceTool::alphaFill(surface, &rect, color); } return surface; } fillets-ng-1.0.1/src/level/FinderAlg.h0000644000175000017500000000123310120337565014401 00000000000000#ifndef HEADER_FINDERALG_H #define HEADER_FINDERALG_H class V2; class Unit; #include "Dir.h" #include "FinderField.h" #include "FinderPlace.h" #include /** * Algorithm to find shortest path. */ class FinderAlg { private: const Unit *m_unit; FinderField m_closed; std::deque m_fifo; private: void pushNext(const FinderPlace &parent, const V2 &shift); bool isInRect(const V2 &rectLoc, int w, int h, const V2 &dest) const; bool tryPlace(const FinderPlace &place) const; public: FinderAlg(int w, int h); Dir::eDir findDir(const Unit *unit, const V2 &dest); }; #endif fillets-ng-1.0.1/src/level/LevelScript.cpp0000644000175000017500000001532311212561121015330 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "LevelScript.h" #include "V2.h" #include "Room.h" #include "ScriptState.h" #include "ScriptCmd.h" #include "LogicException.h" #include "Cube.h" #include "Unit.h" #include "game-script.h" #include "level-script.h" #include // for auto_ptr //----------------------------------------------------------------- /** * Create new plan holder. */ LevelScript::LevelScript(Level *aLevel) { m_level = aLevel; registerGameFuncs(); } //----------------------------------------------------------------- /** * Create ScriptCmd for show. * Command will be executed in this script context. * @param funcRef index of lua function * @return new command */ Command * LevelScript::createCommand(int funcRef) { return new ScriptCmd(m_script, funcRef); } //----------------------------------------------------------------- /** * Update level (plan dialogs, do anim, ...). */ void LevelScript::updateScript() { m_script->doString("script_update()"); satisfyPlan(); } //----------------------------------------------------------------- void LevelScript::interruptPlan() { Planner::interruptPlan(); //NOTE: checkActive is before unBusyUnits to allow script // make busy unwanted fishes room()->checkActive(); room()->unBusyUnits(); } //----------------------------------------------------------------- /** * Add model at scene. * @param new_model new object * @param new_unit driver for the object or NULL * @return model index * @throws LogicException when room is not created yet */ int LevelScript::addModel(Cube *new_model, Unit *new_unit) { std::auto_ptr ptr_model(new_model); std::auto_ptr ptr_unit(new_unit); ptr_model->takeDialogs(dialogs()); return room()->addModel(ptr_model.release(), ptr_unit.release()); } //----------------------------------------------------------------- Cube * LevelScript::getModel(int model_index) { return room()->getModel(model_index); } //----------------------------------------------------------------- /** * Returns model at location. */ Cube * LevelScript::askField(const V2 &loc) { return room()->askField(loc); } //----------------------------------------------------------------- void LevelScript::addSound(const std::string &name, const Path &file) { room()->addSound(name, file); } //----------------------------------------------------------------- void LevelScript::playSound(const std::string &name, int volume) { room()->playSound(name, volume); } //----------------------------------------------------------------- /** * Register functions usable from script. */ void LevelScript::registerGameFuncs() { m_script->registerFunc("game_setRoomWaves", script_game_setRoomWaves); m_script->registerFunc("game_addModel", script_game_addModel); m_script->registerFunc("game_getCycles", script_game_getCycles); m_script->registerFunc("game_addDecor", script_game_addDecor); m_script->registerFunc("game_setScreenShift", script_game_setScreenShift); m_script->registerFunc("game_changeBg", script_game_changeBg); m_script->registerFunc("game_getBg", script_game_getBg); m_script->registerFunc("game_checkActive", script_game_checkActive); m_script->registerFunc("game_setFastFalling", script_game_setFastFalling); m_script->registerFunc("model_addAnim", script_model_addAnim); m_script->registerFunc("model_runAnim", script_model_runAnim); m_script->registerFunc("model_setAnim", script_model_setAnim); m_script->registerFunc("model_useSpecialAnim", script_model_useSpecialAnim); m_script->registerFunc("model_countAnims", script_model_countAnims); m_script->registerFunc("model_setEffect", script_model_setEffect); m_script->registerFunc("model_getLoc", script_model_getLoc); m_script->registerFunc("model_getAction", script_model_getAction); m_script->registerFunc("model_getState", script_model_getState); m_script->registerFunc("model_getDir", script_model_getDir); m_script->registerFunc("model_getTouchDir", script_model_getTouchDir); m_script->registerFunc("model_isAlive", script_model_isAlive); m_script->registerFunc("model_isOut", script_model_isOut); m_script->registerFunc("model_isLeft", script_model_isLeft); m_script->registerFunc("model_isAtBorder", script_model_isAtBorder); m_script->registerFunc("model_getW", script_model_getW); m_script->registerFunc("model_getH", script_model_getH); m_script->registerFunc("model_setGoal", script_model_setGoal); m_script->registerFunc("model_change_turnSide", script_model_change_turnSide); m_script->registerFunc("model_change_setLocation", script_model_change_setLocation); m_script->registerFunc("model_setViewShift", script_model_setViewShift); m_script->registerFunc("model_getViewShift", script_model_getViewShift); m_script->registerFunc("model_setBusy", script_model_setBusy); m_script->registerFunc("model_getExtraParams", script_model_getExtraParams); m_script->registerFunc("model_change_setExtraParams", script_model_change_setExtraParams); m_script->registerFunc("model_equals", script_model_equals); m_script->registerFunc("sound_addSound", script_sound_addSound); m_script->registerFunc("sound_playSound", script_sound_playSound); registerLevelFuncs(); } //----------------------------------------------------------------- void LevelScript::registerLevelFuncs() { m_script->registerFunc("level_save", script_level_save); m_script->registerFunc("level_load", script_level_load); m_script->registerFunc("level_action_move", script_level_action_move); m_script->registerFunc("level_action_save", script_level_action_save); m_script->registerFunc("level_action_load", script_level_action_load); m_script->registerFunc("level_action_restart", script_level_action_restart); m_script->registerFunc("level_createRoom", script_level_createRoom); m_script->registerFunc("level_getRestartCounter", script_level_getRestartCounter); m_script->registerFunc("level_getDepth", script_level_getDepth); m_script->registerFunc("level_isNewRound", script_level_isNewRound); m_script->registerFunc("level_isSolved", script_level_isSolved); m_script->registerFunc("level_newDemo", script_level_newDemo); m_script->registerFunc("level_planShow", script_level_planShow); m_script->registerFunc("level_isShowing", script_level_isShowing); } fillets-ng-1.0.1/src/level/LayoutException.h0000644000175000017500000000046410066370030015700 00000000000000#ifndef HEADER_LAYOUTEXCEPTION_H #define HEADER_LAYOUTEXCEPTION_H #include "BaseException.h" /** * Exception about placement fail. */ class LayoutException : public BaseException { public: LayoutException(const ExInfo &problem) : BaseException(problem) {} }; #endif fillets-ng-1.0.1/src/level/RopeDecor.cpp0000644000175000017500000000216610073033757014774 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "RopeDecor.h" #include "Cube.h" #include "View.h" #include "SDL_gfxPrimitives.h" //----------------------------------------------------------------- RopeDecor::RopeDecor(const Cube *model1, const Cube *model2, const V2 &shift1, const V2 &shift2) : m_shift1(shift1), m_shift2(shift2) { m_model1 = model1; m_model2 = model2; } //----------------------------------------------------------------- /** * Draw line from one model to second model. */ void RopeDecor::drawOnScreen(const View *view, SDL_Surface *screen) { V2 loc1 = view->getScreenPos(m_model1).plus(m_shift1); V2 loc2 = view->getScreenPos(m_model2).plus(m_shift2); //NOTE: steel color Uint32 colorRGBA = 0x30404eff; lineColor(screen, loc1.getX(), loc1.getY(), loc2.getX(), loc2.getY(), colorRGBA); } fillets-ng-1.0.1/src/level/Anim.h0000644000175000017500000000340011212542656013432 00000000000000#ifndef HEADER_ANIM_H #define HEADER_ANIM_H class Path; class ResImagePack; #include "ViewEffect.h" #include "NoCopy.h" #include "V2.h" #include "SDL.h" /** * Animation sprite. */ class Anim : public NoCopy { public: enum eSide { SIDE_LEFT = 0, SIDE_RIGHT = 1 }; private: ViewEffect *m_effect; V2 m_viewShift; ResImagePack *m_animPack[2]; std::string m_animName; int m_animPhase; bool m_run; std::string m_specialAnimName; int m_specialAnimPhase; std::string m_usedPath; private: void blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y); public: Anim(); virtual ~Anim(); void drawAt(SDL_Surface *screen, int x, int y, eSide side); void addAnim(const std::string &name, const Path &picture, eSide side=SIDE_LEFT); void addAnim(const std::string &name, SDL_Surface *new_image, eSide side=SIDE_LEFT); void runAnim(const std::string &name, int start_phase=0); void setAnim(const std::string &name, int phase); void useSpecialAnim(const std::string &name, int phase); bool isDisintegrated() const { return m_effect->isDisintegrated(); } bool isInvisible() const { return m_effect->isInvisible(); } void changeEffect(ViewEffect *new_effect); void setViewShift(const V2 &shift) { m_viewShift = shift; } V2 getViewShift() const { return m_viewShift; }; void setEffect(const std::string &effectName); int countAnimPhases(const std::string &anim, eSide side=SIDE_LEFT) const; std::string getState() const; void restoreState(const std::string &state); }; #endif fillets-ng-1.0.1/src/level/game-script.h0000644000175000017500000000425111212561131014753 00000000000000#ifndef HEADER_GAME_SCRIPT_H #define HEADER_GAME_SCRIPT_H extern "C" { #include "lua.h" } extern int script_game_setRoomWaves(lua_State *L) throw(); extern int script_game_addModel(lua_State *L) throw(); extern int script_game_getCycles(lua_State *L) throw(); extern int script_game_addDecor(lua_State *L) throw(); extern int script_game_setScreenShift(lua_State *L) throw(); extern int script_game_changeBg(lua_State *L) throw(); extern int script_game_getBg(lua_State *L) throw(); extern int script_game_checkActive(lua_State *L) throw(); extern int script_game_setFastFalling(lua_State *L) throw(); extern int script_model_addAnim(lua_State *L) throw(); extern int script_model_runAnim(lua_State *L) throw(); extern int script_model_setAnim(lua_State *L) throw(); extern int script_model_useSpecialAnim(lua_State *L) throw(); extern int script_model_countAnims(lua_State *L) throw(); extern int script_model_setEffect(lua_State *L) throw(); extern int script_model_getLoc(lua_State *L) throw(); extern int script_model_getAction(lua_State *L) throw(); extern int script_model_getState(lua_State *L) throw(); extern int script_model_getDir(lua_State *L) throw(); extern int script_model_getTouchDir(lua_State *L) throw(); extern int script_model_isAlive(lua_State *L) throw(); extern int script_model_isOut(lua_State *L) throw(); extern int script_model_isLeft(lua_State *L) throw(); extern int script_model_isAtBorder(lua_State *L) throw(); extern int script_model_getW(lua_State *L) throw(); extern int script_model_getH(lua_State *L) throw(); extern int script_model_setGoal(lua_State *L) throw(); extern int script_model_change_turnSide(lua_State *L) throw(); extern int script_model_change_setLocation(lua_State *L) throw(); extern int script_model_setViewShift(lua_State *L) throw(); extern int script_model_getViewShift(lua_State *L) throw(); extern int script_model_setBusy(lua_State *L) throw(); extern int script_model_getExtraParams(lua_State *L) throw(); extern int script_model_change_setExtraParams(lua_State *L) throw(); extern int script_model_equals(lua_State *L) throw(); extern int script_sound_addSound(lua_State *L) throw(); extern int script_sound_playSound(lua_State *L) throw(); #endif fillets-ng-1.0.1/src/level/Landslip.cpp0000644000175000017500000000565511264423456014670 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Landslip.h" #include "Rules.h" #include "minmax.h" #include //----------------------------------------------------------------- Landslip::Landslip(const ModelList &models) : m_models(models) { m_impact = Cube::NONE; m_stoned = new bool[m_models.size()]; memset(m_stoned, false, sizeof(bool) * m_models.size()); } //----------------------------------------------------------------- Landslip::~Landslip() { delete[] m_stoned; } //----------------------------------------------------------------- /** * Indentify falling objects. * @return whether something is falling. */ bool Landslip::computeFall() { while (m_models.stoneOn(this)) { /* empty */ } return m_models.fallOn(this); } //----------------------------------------------------------------- bool Landslip::stoneModel(const Cube *model) { bool change = false; if (!isStoned(model)) { if (isFixed(model) || isOnPad(model)) { stone(model); change = true; } } return change; } //----------------------------------------------------------------- bool Landslip::isOnPad(const Cube *model) const { const Cube::t_models pad = model->const_rules()->getResist(Dir::DIR_DOWN); Cube::t_models::const_iterator end = pad.end(); for (Cube::t_models::const_iterator i = pad.begin(); i != end; ++i) { if (isFixed(*i)) { return true; } } return false; } //----------------------------------------------------------------- bool Landslip::isFixed(const Cube *model) const { return isStoned(model) || model->isWall() || model->isAlive() || model->isLost(); } //----------------------------------------------------------------- bool Landslip::isStoned(const Cube *model) const { int index = model->getIndex(); if (index > -1) { return m_stoned[index]; } else { return true; } } //----------------------------------------------------------------- void Landslip::stone(const Cube *model) { int index = model->getIndex(); if (index > -1) { m_stoned[index] = true; } } //----------------------------------------------------------------- /** * Let model to fall. * @return true when model is falling */ bool Landslip::fallModel(Cube *model) { bool falling = false; if (!isFixed(model)) { model->rules()->actionFall(); falling = true; } else { bool lastFall = model->rules()->clearLastFall(); if (lastFall && m_impact < model->getWeight()) { m_impact = model->getWeight(); } } return falling; } fillets-ng-1.0.1/src/level/View.h0000644000175000017500000000203411205550027013453 00000000000000#ifndef HEADER_VIEW_H #define HEADER_VIEW_H class Cube; class PhaseLocker; class Decor; #include "Drawable.h" #include "ModelList.h" #include "V2.h" /** * View for model. */ class View : public Drawable { public: static const int SCALE = 15; private: typedef std::vector t_decors; t_decors m_decors; ModelList m_models; int m_animShift; int m_shiftSize; SDL_Surface *m_screen; V2 m_screenShift; private: void computeShiftSize(int phases); void drawDecors(); public: View(const ModelList &models); virtual ~View(); void setScreenShift(const V2 &shift) { m_screenShift = shift; } void noteNewRound(int phases); void drawModel(Cube *model); virtual void drawOn(SDL_Surface *screen); V2 getScreenPos(const Cube *model) const; V2 getFieldPos(const V2 &cursor) const; void addDecor(Decor *new_decor) { m_decors.push_back(new_decor); } void removeDecors(); }; #endif fillets-ng-1.0.1/src/level/LoadException.h0000644000175000017500000000045410066370030015301 00000000000000#ifndef HEADER_LOADEXCEPTION_H #define HEADER_LOADEXCEPTION_H #include "BaseException.h" /** * Exception about load game fail. */ class LoadException : public BaseException { public: LoadException(const ExInfo &problem) : BaseException(problem) {} }; #endif fillets-ng-1.0.1/src/level/Cube.cpp0000644000175000017500000001016211265140466013763 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Cube.h" #include "Shape.h" #include "Rules.h" #include "LayoutException.h" #include "Anim.h" #include "EffectDisintegrate.h" #include "DialogStack.h" //----------------------------------------------------------------- /** * Create new model. */ Cube::Cube(const V2 &location, eWeight weight, eWeight power, bool alive, Shape *new_shape) : m_loc(location), m_goal(Goal::noGoal()) { m_index = -1; m_busy = false; m_weight = weight; m_power = power; m_alive = alive; m_out = false; m_lookLeft = true; m_lost = false; m_outDir = Dir::DIR_NO; m_outCapacity = 0; m_shape = new_shape; m_rules = new Rules(this); m_anim = new Anim(); m_dialogs = NULL; } //----------------------------------------------------------------- /** * Delete all member but not field. */ Cube::~Cube() { //NOTE: rules must be destroyed before shape because they unmask self delete m_rules; delete m_shape; delete m_anim; } //----------------------------------------------------------------- /** * Die. */ void Cube::change_die() { m_alive = false; anim()->changeEffect(new EffectDisintegrate()); } //----------------------------------------------------------------- /** * Make the object unmovable * when it is going out of the room. */ void Cube::change_goingOut() { m_weight = Cube::FIXED; } //----------------------------------------------------------------- /** * Go out of room. */ void Cube::change_goOut() { m_out = true; change_remove(); } //----------------------------------------------------------------- /** * Go out of game, e.g. disintegrated skeleton. */ void Cube::change_remove() { m_lost = true; m_weight = NONE; //NOTE: hack, object is moved out m_loc = V2(-1000, -1000); } //----------------------------------------------------------------- void Cube::change_turnSide() { m_lookLeft = !m_lookLeft; } //----------------------------------------------------------------- Dir::eDir Cube::getLastMoveDir() const { return m_rules->getDir(); } //----------------------------------------------------------------- /** * Set params for special 'output_DIR' model. * Used just for the 'spuntik' in windoze level. */ void Cube::setOutDir(Dir::eDir dir, int capacity, eWeight weight) { m_outCapacity = capacity; m_outDir = dir; m_weight = weight; } //----------------------------------------------------------------- /** * Set extra parameters from a saved undo state. * They have to restore just the parameters used by the View. */ void Cube::setExtraParams() { m_lost = false; m_rules->resetLastDir(); } //----------------------------------------------------------------- /** * Special model 'output_DIR' has capacity to absorb two fishes, * then it changes to normal 'item_light'. */ void Cube::decOutCapacity() { if (m_outCapacity > 0) { m_outCapacity--; if (m_outCapacity == 0) { m_outDir = Dir::DIR_NO; m_weight = LIGHT; m_outCapacity = -1; } } } //----------------------------------------------------------------- bool Cube::isDisintegrated() { return m_anim->isDisintegrated(); } //----------------------------------------------------------------- bool Cube::isInvisible() { return m_anim->isInvisible(); } //----------------------------------------------------------------- bool Cube::isTalking() const { return (m_dialogs && m_dialogs->isTalking(m_index)); } //----------------------------------------------------------------- std::string Cube::toString() const { return ExInfo("model") .addInfo("loc", m_loc.toString()) .addInfo("alive", m_alive) .addInfo("weight", m_weight) .addInfo("power", m_power) .addInfo("shape", m_shape->toString()).info(); } fillets-ng-1.0.1/src/level/Landslip.h0000644000175000017500000000133110110454734014310 00000000000000#ifndef HEADER_LANDSLIP_H #define HEADER_LANDSLIP_H #include "NoCopy.h" #include "Cube.h" #include "ModelList.h" /** * Landslip for every round. */ class Landslip : public NoCopy { private: ModelList m_models; Cube::eWeight m_impact; bool *m_stoned; private: bool isOnPad(const Cube *model) const; bool isFixed(const Cube *model) const; bool isStoned(const Cube *model) const; void stone(const Cube *model); public: Landslip(const ModelList &models); ~Landslip(); bool computeFall(); Cube::eWeight getImpact() { return m_impact; } bool stoneModel(const Cube *model); bool fallModel(Cube *model); }; #endif fillets-ng-1.0.1/src/level/Dir.h0000644000175000017500000000050211124716667013273 00000000000000#ifndef HEADER_DIR_H #define HEADER_DIR_H #include "V2.h" /** * Direction. */ class Dir { public: enum eDir { DIR_NO = 0, DIR_UP = 1, DIR_DOWN = 2, DIR_LEFT = 3, DIR_RIGHT = 4 }; public: static V2 dir2xy(eDir dir); }; #endif fillets-ng-1.0.1/src/level/Room.h0000644000175000017500000000515211212561012013453 00000000000000#ifndef HEADER_ROOM_H #define HEADER_ROOM_H class Path; class Field; class FinderAlg; class WavyPicture; class Controls; class KeyStroke; class MouseStroke; class Unit; class ResSoundPack; class PhaseLocker; class Planner; class View; class Decor; class InputProvider; class StepCounter; #include "Drawable.h" #include "Cube.h" #include /** * Room with level. */ class Room : public Drawable { private: WavyPicture *m_bg; std::string m_bgFilename; Field *m_field; FinderAlg *m_finder; ResSoundPack *m_soundPack; Controls *m_controls; PhaseLocker *m_locker; Planner *m_levelScript; View *m_view; Cube::t_models m_models; Cube::eAction m_lastAction; int m_startTime; bool m_fastFalling; private: void prepareRound(); bool fallout(bool interactive=true); bool falldown(bool interactive=true); void playImpact(Cube::eWeight impact); void playDead(Cube *model); bool isFresh() const { return m_lastAction == Cube::ACTION_NO; } public: Room(int w, int h, const std::string &picture, PhaseLocker *locker, Planner *levelScript); ~Room(); void setWaves(float amplitude, float periode, float speed); void addDecor(Decor *new_decor); void setFastFalling(bool value) { m_fastFalling = value; } int addModel(Cube *new_model, Unit *new_unit); Cube *getModel(int model_index); Cube *askField(const V2 &loc); bool beginFall(bool interactive=true); void nextRound(const InputProvider *input); void finishRound(bool interactive=true); void switchFish(); void controlEvent(const KeyStroke &stroke); void controlMouse(const MouseStroke &button); void loadMove(char move); bool makeMove(char move); bool cannotMove() const; bool isSolvable() const; bool isSolved() const; bool isFalling() const { return m_lastAction == Cube::ACTION_FALL; } void checkActive(); void unBusyUnits(); const StepCounter *stepCounter() const; void setMoves(const std::string &moves); int getW() const; int getH() const; int getCycles() const; void addSound(const std::string &name, const Path &file); void playSound(const std::string &name, int volume=100); void setScreenShift(const V2 &shift); void changeBg(const std::string &picture); std::string getBg() const { return m_bgFilename; } virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/level/Dir.cpp0000644000175000017500000000165510113716217013624 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Dir.h" #include //----------------------------------------------------------------- /** * Convert dir to relative coordinations. */ V2 Dir::dir2xy(eDir dir) { int x = 0; int y = 0; switch (dir) { case DIR_UP: y = -1; break; case DIR_DOWN: y = +1; break; case DIR_LEFT: x = -1; break; case DIR_RIGHT: x = +1; break; case DIR_NO: break; default: assert(!"unknown dir"); break; } return V2(x, y); } fillets-ng-1.0.1/src/level/MouseControl.h0000644000175000017500000000107710120337565015205 00000000000000#ifndef HEADER_MOUSECONTROL_H #define HEADER_MOUSECONTROL_H class V2; class Controls; class View; class InputProvider; class FinderAlg; /** * Mouse controls move. */ class MouseControl { private: Controls *m_controls; const View *m_view; FinderAlg *m_finder; private: bool moveTo(const V2 &field) const; bool moveHardTo(const V2 &field) const; public: MouseControl(Controls *controls, const View *m_view, FinderAlg *finder); bool mouseDrive(const InputProvider *input) const; }; #endif fillets-ng-1.0.1/src/level/level-script.h0000644000175000017500000000161510110130044015141 00000000000000#ifndef HEADER_LEVEL_SCRIPT_H #define HEADER_LEVEL_SCRIPT_H extern "C" { #include "lua.h" } extern int script_level_save(lua_State *L) throw(); extern int script_level_load(lua_State *L) throw(); extern int script_level_action_move(lua_State *L) throw(); extern int script_level_action_save(lua_State *L) throw(); extern int script_level_action_load(lua_State *L) throw(); extern int script_level_action_restart(lua_State *L) throw(); extern int script_level_createRoom(lua_State *L) throw(); extern int script_level_getRestartCounter(lua_State *L) throw(); extern int script_level_getDepth(lua_State *L) throw(); extern int script_level_isNewRound(lua_State *L) throw(); extern int script_level_isSolved(lua_State *L) throw(); extern int script_level_newDemo(lua_State *L) throw(); extern int script_level_planShow(lua_State *L) throw(); extern int script_level_isShowing(lua_State *L) throw(); #endif fillets-ng-1.0.1/src/level/View.cpp0000644000175000017500000000635611205550023014015 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "View.h" #include "PhaseLocker.h" #include "ModelList.h" #include "Decor.h" #include "Cube.h" #include "Anim.h" #include "Dir.h" #include "minmax.h" //----------------------------------------------------------------- /** * Create new view. * @param models wrapper arount models */ View::View(const ModelList &models) : m_models(models), m_screenShift(0, 0) { m_animShift = 0; m_shiftSize = SCALE; m_screen = NULL; } //----------------------------------------------------------------- View::~View() { removeDecors(); } //----------------------------------------------------------------- void View::removeDecors() { t_decors::iterator end = m_decors.end(); for (t_decors::iterator i = m_decors.begin(); i != end; ++i) { delete *i; } m_decors.clear(); } //----------------------------------------------------------------- void View::drawDecors() { t_decors::iterator end = m_decors.end(); for (t_decors::iterator i = m_decors.begin(); i != end; ++i) { (*i)->drawOnScreen(this, m_screen); } } //----------------------------------------------------------------- /** * Prepare new anim. */ void View::noteNewRound(int phases) { m_animShift = 0; computeShiftSize(phases); } //----------------------------------------------------------------- void View::drawOn(SDL_Surface *screen) { m_screen = screen; m_animShift = min(SCALE, m_animShift + m_shiftSize); m_models.drawOn(this); drawDecors(); } //----------------------------------------------------------------- /** * Draw model. * Care about model shift during move. */ void View::drawModel(Cube *model) { if (!model->isLost()) { V2 screenPos = getScreenPos(model); Anim::eSide side = Anim::SIDE_LEFT; if (!model->isLeft()) { side = Anim::SIDE_RIGHT; } model->anim()->drawAt(m_screen, screenPos.getX(), screenPos.getY(), side); } } //----------------------------------------------------------------- /** * Split move in a few phases. */ void View::computeShiftSize(int phases) { if (phases > 0) { m_shiftSize = SCALE / phases; } else { m_shiftSize = SCALE; } } //----------------------------------------------------------------- /** * Returns position on screen when model will be drawn. */ V2 View::getScreenPos(const Cube *model) const { V2 shift(0, 0); Dir::eDir dir = model->getLastMoveDir(); if (dir != Dir::DIR_NO) { shift = Dir::dir2xy(dir); shift = shift.scale(m_animShift); } shift = shift.plus(m_screenShift); V2 anim_shift = model->const_anim()->getViewShift(); return model->getLocation().plus(anim_shift).scale(SCALE).plus(shift); } //----------------------------------------------------------------- /** * Returns position of tile under cursor. */ V2 View::getFieldPos(const V2 &cursor) const { return cursor.minus(m_screenShift).shrink(SCALE); } fillets-ng-1.0.1/src/level/ModelFactory.cpp0000644000175000017500000001322710113701456015473 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ModelFactory.h" #include "V2.h" #include "Unit.h" #include "Shape.h" #include "LogicException.h" #include "StringTool.h" //----------------------------------------------------------------- /** * Add model at scene. * @param kind kind of item (e.g. "fish_big", "item_light", ...) * @param loc placement location * @param shape see Shape for format * @return model * * @throws LogicException for unknown kind * @throws LayoutException when shape or location is bad */ Cube * ModelFactory::createModel(const std::string &kind, const V2 &loc, const std::string &shape) { if (StringTool::startsWith(kind, "output_")) { return createOutputItem(kind, loc, shape); } Cube::eWeight weight; Cube::eWeight power; bool alive; createParams(kind, &weight, &power, &alive); Shape *newShape = new Shape(shape); Cube *model = new Cube(loc, weight, power, alive, newShape); return model; } //----------------------------------------------------------------- /** * Determine object params. * @throws LogicException when kind is unkown */ void ModelFactory::createParams(const std::string &kind, Cube::eWeight *out_weight, Cube::eWeight *out_power, bool *out_alive) { if ("fish_small" == kind) { *out_weight = Cube::LIGHT; *out_power = Cube::LIGHT; *out_alive = true; } else if ("fish_big" == kind) { *out_weight = Cube::LIGHT; *out_power = Cube::HEAVY; *out_alive = true; } else if (StringTool::startsWith(kind, "fish_extra")) { *out_weight = Cube::LIGHT; *out_power = Cube::LIGHT; *out_alive = true; } else if (StringTool::startsWith(kind, "fish_EXTRA")) { *out_weight = Cube::LIGHT; *out_power = Cube::HEAVY; *out_alive = true; } else { *out_power = Cube::NONE; *out_alive = false; if ("item_light" == kind) { *out_weight = Cube::LIGHT; } else if ("item_heavy" == kind) { *out_weight = Cube::HEAVY; } else if ("item_fixed" == kind) { *out_weight = Cube::FIXED; } else { throw LogicException(ExInfo("unknown model kind") .addInfo("kind", kind)); } } } //----------------------------------------------------------------- /** * Create unit for driveable fish. * @param kind kind of item (e.g. "fish_big", "item_light", ...) * @return new unit or NULL */ Unit * ModelFactory::createUnit(const std::string &kind) { Unit *result = NULL; if ("fish_small" == kind) { KeyControl smallfish; smallfish.setUp(SDLK_i); smallfish.setDown(SDLK_k); smallfish.setLeft(SDLK_j); smallfish.setRight(SDLK_l); result = new Unit(smallfish, ControlSym('u', 'd', 'l', 'r'), true); } else if ("fish_big" == kind) { KeyControl bigfish; bigfish.setUp(SDLK_w); bigfish.setDown(SDLK_s); bigfish.setLeft(SDLK_a); bigfish.setRight(SDLK_d); result = new Unit(bigfish, ControlSym('U', 'D', 'L', 'R')); } else if (StringTool::startsWith(kind, "fish_extra") || StringTool::startsWith(kind, "fish_EXTRA")) { KeyControl extrafish; extrafish.setUp(SDLK_LAST); extrafish.setDown(SDLK_LAST); extrafish.setLeft(SDLK_LAST); extrafish.setRight(SDLK_LAST); result = new Unit(extrafish, parseExtraControlSym(kind)); } return result; } //----------------------------------------------------------------- /** * Create special model, which will be used for outher space. * NOTE: hack border around field */ Cube * ModelFactory::createBorder() { Cube *border = new Cube(V2(-1,-1), Cube::FIXED, Cube::NONE, false, new Shape("X\n")); return border; } //----------------------------------------------------------------- /** * Create one way output out of room. * @throws LogicException when output_DIR is not known */ Cube * ModelFactory::createOutputItem(const std::string &kind, const V2 &loc, const std::string &shape) { Dir::eDir outDir = Dir::DIR_NO; if ("output_left" == kind) { outDir = Dir::DIR_LEFT; } else if ("output_right" == kind) { outDir = Dir::DIR_RIGHT; } else if ("output_up" == kind) { outDir = Dir::DIR_UP; } else if ("output_down" == kind) { outDir = Dir::DIR_DOWN; } else { throw LogicException(ExInfo("unknown border dir") .addInfo("kind", kind)); } Cube *model = new Cube(loc, Cube::FIXED, Cube::NONE, false, new Shape(shape)); model->setOutDir(outDir); return model; } //----------------------------------------------------------------- /** * Define controls symbols for extra fish. * Format: "fish_extra-UDLR" * @throws LogicException when symbols are not specified */ ControlSym ModelFactory::parseExtraControlSym(const std::string &kind) { static const std::string PREFIX = "fish_extra-"; if (kind.size() != PREFIX.size() + 4) { throw LogicException(ExInfo("you must specify control symbols") .addInfo("kind", kind)); } char up = kind[PREFIX.size()]; char down = kind[PREFIX.size() + 1]; char left = kind[PREFIX.size() + 2]; char right = kind[PREFIX.size() + 3]; return ControlSym(up, down, left, right); } fillets-ng-1.0.1/src/level/DescFinder.h0000644000175000017500000000063410102524747014560 00000000000000#ifndef HEADER_DESCFINDER_H #define HEADER_DESCFINDER_H class Level; #include /** * Allows to find level name and description. */ class DescFinder { public: virtual ~DescFinder() {} virtual std::string findLevelName( const std::string &codename) const = 0; virtual std::string findDesc( const std::string &codename) const = 0; }; #endif fillets-ng-1.0.1/src/level/FinderField.h0000644000175000017500000000067710120337565014734 00000000000000#ifndef HEADER_FINDERFIELD_H #define HEADER_FINDERFIELD_H class V2; #include "NoCopy.h" /** * Array of closed nodes used for finding. */ class FinderField : public NoCopy { private: bool **m_closed; int m_w; int m_h; public: FinderField(int w, int h); virtual ~FinderField(); void reset(); void markClosed(const V2 &loc); bool isClosed(const V2 &loc) const; }; #endif fillets-ng-1.0.1/src/level/LevelCountDown.cpp0000644000175000017500000000564111212653675016026 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "LevelCountDown.h" #include "LevelStatus.h" #include "RoomAccess.h" #include "Room.h" #include "StepCounter.h" #include "LogicException.h" #include "CountAdvisor.h" //----------------------------------------------------------------- /** * Prepare countdown. */ LevelCountDown::LevelCountDown(const RoomAccess *access) { m_countdown = -1; m_access = access; m_levelStatus = NULL; } //----------------------------------------------------------------- /** * Resets counter. * @throws LogicException when levelStatus is not filled */ void LevelCountDown::reset() { if (NULL == m_levelStatus) { throw LogicException(ExInfo("level status is NULL")); } m_levelStatus->setRunning(true); m_countdown = -1; } //----------------------------------------------------------------- /** * Countdown to zero. * @param advisor advisor which know usable coundown values * @return true when counter is at zero */ bool LevelCountDown::countDown(const CountAdvisor *advisor) { bool result = false; if (m_countdown < 0) { setCountDown(advisor); } else if (m_countdown > 0) { m_countdown--; } else { result = true; } return result; } //----------------------------------------------------------------- void LevelCountDown::setCountDown(const CountAdvisor *advisor) { if (m_access->const_room()->isSolved()) { m_countdown = advisor->getCountForSolved(); } else if (m_access->const_room()->cannotMove()) { m_countdown = advisor->getCountForWrong(); } else { m_countdown = -1; } } //----------------------------------------------------------------- bool LevelCountDown::isFinishedEnough() const { return m_countdown == 0 && m_access->const_room()->isSolved(); } //----------------------------------------------------------------- bool LevelCountDown::isWrongEnough() const { return m_countdown == 0 && m_access->const_room()->cannotMove() && !m_access->const_room()->isSolved(); } //----------------------------------------------------------------- /** * Write best solution to the file. * Save moves and models state. */ void LevelCountDown::saveSolution() { m_levelStatus->setComplete(); std::string current_moves = m_access->const_room()->stepCounter()->getMoves(); m_levelStatus->writeSolvedMoves(current_moves); } //----------------------------------------------------------------- /** * Creates next state or returns NULL. * @return returns NULL when only quitState() is needed */ GameState * LevelCountDown::createNextState() { return m_levelStatus->createPoster(); } fillets-ng-1.0.1/src/level/PhaseLocker.cpp0000644000175000017500000000160610100047663015300 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "PhaseLocker.h" #include "minmax.h" //----------------------------------------------------------------- PhaseLocker::PhaseLocker() { m_lockPhases = 0; } //----------------------------------------------------------------- /** * Reserve game cycle for blocking animation. * @param count how much phases we need */ void PhaseLocker::ensurePhases(int count) { m_lockPhases = max(m_lockPhases, count); } //----------------------------------------------------------------- void PhaseLocker::decLock() { if (m_lockPhases > 0) { m_lockPhases--; } } fillets-ng-1.0.1/src/level/level-script.cpp0000644000175000017500000001351411212560625015515 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "level-script.h" #include "Log.h" #include "Path.h" #include "V2.h" #include "Level.h" #include "LevelScript.h" #include "Room.h" #include "Picture.h" #include "def-script.h" //----------------------------------------------------------------- inline LevelScript * getLevelScript(lua_State *L) { return dynamic_cast(script_getLeader(L)); } //----------------------------------------------------------------- inline Level * getLevel(lua_State *L) { return getLevelScript(L)->level(); } //----------------------------------------------------------------- /** * void level_save(serialized) */ int script_level_save(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *serialized = luaL_checkstring(L, 1); getLevel(L)->saveGame(serialized); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void level_load(moves) */ int script_level_load(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *moves = luaL_checkstring(L, 1); getLevel(L)->loadGame(moves); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * bool level_action_move(symbol) */ int script_level_action_move(lua_State *L) throw() { BEGIN_NOEXCEPTION; size_t size; const char *symbol = luaL_checklstring(L, 1, &size); if (size != 1) { ExInfo error = ExInfo("bad symbol length") .addInfo("length", size) .addInfo("symbol", symbol); LOG_WARNING(error); luaL_error(L, error.what()); } bool sucess = getLevel(L)->action_move(symbol[0]); lua_pushboolean(L, sucess); END_NOEXCEPTION; //NOTE: return sucess return 1; } //----------------------------------------------------------------- /** * bool level_action_save() */ int script_level_action_save(lua_State *L) throw() { BEGIN_NOEXCEPTION; bool sucess = getLevel(L)->action_save(); lua_pushboolean(L, sucess); END_NOEXCEPTION; //NOTE: return sucess return 1; } //----------------------------------------------------------------- /** * bool level_action_load() */ int script_level_action_load(lua_State *L) throw() { BEGIN_NOEXCEPTION; bool sucess = getLevel(L)->action_load(); lua_pushboolean(L, sucess); END_NOEXCEPTION; //NOTE: return sucess return 1; } //----------------------------------------------------------------- /** * bool level_action_restart() */ int script_level_action_restart(lua_State *L) throw() { BEGIN_NOEXCEPTION; bool sucess = getLevel(L)->action_restart(1); lua_pushboolean(L, sucess); END_NOEXCEPTION; //NOTE: return sucess return 1; } //----------------------------------------------------------------- /** * void level_createRoom(width, height, picture) * Example: * createRoom(40, 50, "kitchen-bg.png") */ int script_level_createRoom(lua_State *L) throw() { BEGIN_NOEXCEPTION; int w = luaL_checkint(L, 1); int h = luaL_checkint(L, 2); const char *picture = luaL_checkstring(L, 3); getLevel(L)->createRoom(w, h, picture); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * int level_getRestartCounter() * * Returns number of attemps, starts from 1. */ int script_level_getRestartCounter(lua_State *L) throw() { BEGIN_NOEXCEPTION; int counter = getLevel(L)->getRestartCounter(); lua_pushnumber(L, counter); END_NOEXCEPTION; //NOTE: return counter return 1; } //----------------------------------------------------------------- /** * int level_getDepth() * */ int script_level_getDepth(lua_State *L) throw() { BEGIN_NOEXCEPTION; int depth = getLevel(L)->getDepth(); lua_pushnumber(L, depth); END_NOEXCEPTION; //NOTE: return depth return 1; } //----------------------------------------------------------------- /** * bool level_isNewRound() * */ int script_level_isNewRound(lua_State *L) throw() { BEGIN_NOEXCEPTION; bool newRound = getLevel(L)->isNewRound(); lua_pushboolean(L, newRound); END_NOEXCEPTION; //NOTE: return newRound return 1; } //----------------------------------------------------------------- /** * bool level_isSolved() * */ int script_level_isSolved(lua_State *L) throw() { BEGIN_NOEXCEPTION; bool solved = getLevelScript(L)->room()->isSolved(); lua_pushboolean(L, solved); END_NOEXCEPTION; //NOTE: return solved return 1; } //----------------------------------------------------------------- /** * void level_newDemo(demofile) */ int script_level_newDemo(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *demofile = luaL_checkstring(L, 1); getLevel(L)->newDemo(Path::dataReadPath(demofile)); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void level_planShow(func) */ int script_level_planShow(lua_State *L) throw() { BEGIN_NOEXCEPTION; luaL_checktype(L, 1, LUA_TFUNCTION); int funcRef = luaL_ref(L, LUA_REGISTRYINDEX); Command *command = getLevelScript(L)->createCommand(funcRef); getLevel(L)->planShow(command); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * bool level_isShowing() */ int script_level_isShowing(lua_State *L) throw() { BEGIN_NOEXCEPTION; bool showing = getLevel(L)->isShowing(); lua_pushboolean(L, showing); END_NOEXCEPTION; //NOTE: return showing return 1; } fillets-ng-1.0.1/src/level/StatusDisplay.cpp0000644000175000017500000000226411212556411015713 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "StatusDisplay.h" #include "Picture.h" //----------------------------------------------------------------- StatusDisplay::StatusDisplay() { m_picture = NULL; m_time = 0; } //----------------------------------------------------------------- StatusDisplay::~StatusDisplay() { if (m_picture) { delete m_picture; } } //----------------------------------------------------------------- /** * Dislay this picture the given number of times. */ void StatusDisplay::displayStatus(Picture *new_picture, int time) { if (m_picture) { delete m_picture; } m_picture = new_picture; m_time = time; } //----------------------------------------------------------------- void StatusDisplay::drawOn(SDL_Surface *screen) { if (m_time > 0) { m_time--; if (m_picture) { m_picture->drawOn(screen); } } } fillets-ng-1.0.1/src/level/LevelStatus.h0000644000175000017500000000243610152763433015031 00000000000000#ifndef HEADER_LEVELSTATUS_H #define HEADER_LEVELSTATUS_H class GameState; #include "Scripter.h" /** * Status of level after a game. */ class LevelStatus : public Scripter { private: bool m_complete; bool m_wasRunning; std::string m_codename; std::string m_poster; std::string m_savedMoves; int m_bestMoves; std::string m_bestAuthor; private: std::string getSolutionFilename() const; public: LevelStatus(); void prepareRun(const std::string &codename, const std::string &poster, int bestMoves, const std::string &bestAuthor); GameState *createPoster() const; int getBestMoves() const { return m_bestMoves; } std::string getBestAuthor() const { return m_bestAuthor; } int compareToBest(); void setComplete() { m_complete = true; } bool isComplete() const { return m_complete; } void setRunning(bool value) { m_wasRunning = value; } bool wasRunning() const { return m_wasRunning; } void readMoves(const std::string &moves); std::string readSolvedMoves(); void writeSolvedMoves(const std::string &moves); static std::string getSolutionFilename(const std::string &codename); }; #endif fillets-ng-1.0.1/src/level/ModelFactory.h0000644000175000017500000000147510113701456015142 00000000000000#ifndef HEADER_MODELFACTORY_H #define HEADER_MODELFACTORY_H class V2; class Unit; #include "Cube.h" #include "ControlSym.h" #include "Dir.h" #include /** * Knows how to create new models. */ class ModelFactory { private: static void createParams(const std::string &kind, Cube::eWeight *out_weight, Cube::eWeight *out_power, bool *out_alive); static ControlSym parseExtraControlSym(const std::string &kind); static Cube *createOutputItem(const std::string &kind, const V2 &loc, const std::string &shape); public: static Cube *createModel(const std::string &kind, const V2 &loc, const std::string &shape); static Unit *createUnit(const std::string &kind); static Cube *createBorder(); }; #endif fillets-ng-1.0.1/src/level/LevelScript.h0000644000175000017500000000161610111460506014777 00000000000000#ifndef HEADER_LEVELSCRIPT_H #define HEADER_LEVELSCRIPT_H class V2; class Path; class Cube; class Unit; class Level; class Command; #include "Planner.h" #include "RoomAccess.h" #include /** * Handle plan for dialogs and planned actions. */ class LevelScript : public Planner, public RoomAccess { private: Level *m_level; private: void registerGameFuncs(); void registerLevelFuncs(); public: LevelScript(Level *aLevel); void updateScript(); virtual void interruptPlan(); Level *level() { return m_level; } Command *createCommand(int funcRef); int addModel(Cube *new_model, Unit *new_unit); Cube *getModel(int model_index); Cube *askField(const V2 &loc); void addSound(const std::string &name, const Path &file); void playSound(const std::string &name, int volume); }; #endif fillets-ng-1.0.1/src/level/Level.h0000644000175000017500000000607211212560610013613 00000000000000#ifndef HEADER_LEVEL_H #define HEADER_LEVEL_H class Cube; class Unit; class DescFinder; class PhaseLocker; class Picture; class DemoMode; class KeyStroke; class MouseStroke; class LevelScript; class LevelLoading; class LevelStatus; class LevelCountDown; class CommandQueue; class Command; class MultiDrawer; class StatusDisplay; #include "Path.h" #include "GameState.h" #include "CountAdvisor.h" #include /** * Game level with room. */ class Level : public GameState, public CountAdvisor { private: static const int SPEED_REPLAY = 1; int m_depth; const DescFinder *m_desc; std::string m_codename; Path m_datafile; PhaseLocker *m_locker; bool m_newRound; LevelScript *m_levelScript; LevelLoading *m_loading; LevelCountDown *m_countdown; CommandQueue *m_show; int m_restartCounter; int m_undoSteps; bool m_wasDangerousMove; MultiDrawer *m_background; StatusDisplay *m_statusDisplay; private: void initScreen(); void nextAction(); void updateLevel(); void saveUndo(const std::string &oldMoves); void finishLevel(); void nextLoadAction(); void nextShowAction(); void nextUndoAction(); void nextPlayerAction(); void saveSolution(); void displaySaveStatus(); bool isUndoing() const; protected: virtual void own_initState(); virtual void own_updateState(); virtual void own_pauseState(); virtual void own_resumeState(); virtual void own_cleanState(); virtual void own_noteBg(); virtual void own_noteFg(); public: Level(const std::string &codename, const Path &datafile, int depth); virtual ~Level(); virtual const char *getName() const { return "state_level"; }; void fillDesc(const DescFinder *desc) { m_desc = desc; } void fillStatus(LevelStatus *status); void saveGame(const std::string &models); void loadGame(const std::string &moves); void loadReplay(const std::string &moves); bool action_restart(int increment); bool action_move(char symbol); bool action_save(); bool action_load(); void action_undo(int steps); void action_undo_finish(); void switchFish(); void controlEvent(const KeyStroke &stroke); void controlMouse(const MouseStroke &button); std::string getLevelName() const; int getRestartCounter() const { return m_restartCounter; } int getDepth() const { return m_depth; } bool isNewRound() const { return m_newRound; } void createRoom(int w, int h, const std::string &picture); void newDemo(const Path &demofile); bool isActing() const; bool isLoading() const; void togglePause(); bool isShowing() const; void interruptShow(); void planShow(Command *new_command); virtual int getCountForSolved() const; virtual int getCountForWrong() const; }; #endif fillets-ng-1.0.1/src/level/Unit.cpp0000644000175000017500000001732511047536120014026 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Unit.h" #include "Cube.h" #include "Rules.h" #include "InputProvider.h" #include "Anim.h" #include "Shape.h" #include //----------------------------------------------------------------- /** * Create new driveable unit. * @param buttons control buttons * @param symbols move symbols stored in load/save * @param a_startActive whether unit should be active at start */ Unit::Unit(const KeyControl &buttons, const ControlSym &symbols, bool a_startActive) : m_buttons(buttons), m_symbols(symbols) { m_model = NULL; m_startActive = a_startActive; } //----------------------------------------------------------------- bool Unit::canDrive() const { return m_model->isAlive() && !m_model->isLost() && !m_model->isBusy(); } //----------------------------------------------------------------- /** * Return true when we can move in future. */ bool Unit::willMove() const { return m_model->isAlive() && !m_model->isLost(); } //----------------------------------------------------------------- /** * Test keys and try move. * @return a symbol when unit has moved */ char Unit::drive(const InputProvider *input) { return driveBorrowed(input, m_buttons); } //----------------------------------------------------------------- /** * Test keys and try move, use borrowed controls. * @return a symbol when unit has moved or SYM_NONE */ char Unit::driveBorrowed(const InputProvider *input, const KeyControl &buttons) { if (canDrive()) { if (input->isPressed(buttons.getLeft())) { return goLeft(); } if (input->isPressed(buttons.getRight())) { return goRight(); } if (input->isPressed(buttons.getUp())) { return goUp(); } if (input->isPressed(buttons.getDown())) { return goDown(); } } return ControlSym::SYM_NONE; } //----------------------------------------------------------------- /** * Greet the player. */ void Unit::activate() { m_model->rules()->actionActivate(); } //----------------------------------------------------------------- /** * Translate this key to symbol. * @return symbol or SYM_NONE for unknown key */ char Unit::mySymbol(SDLKey key) const { return mySymbolBorrowed(key, m_buttons); } //----------------------------------------------------------------- /** * Translate this key to symbol, compare with borrowed buttons. * @return symbol or SYM_NONE for unknown key */ char Unit::mySymbolBorrowed(SDLKey key, const KeyControl &buttons) const { if (key == buttons.getLeft()) { return m_symbols.getLeft(); } if (key == buttons.getRight()) { return m_symbols.getRight(); } if (key == buttons.getUp()) { return m_symbols.getUp(); } if (key == buttons.getDown()) { return m_symbols.getDown(); } return ControlSym::SYM_NONE; } //----------------------------------------------------------------- /** * Returns symbol for this direction. */ char Unit::myOrder(Dir::eDir dir) const { switch (dir) { case Dir::DIR_LEFT: return m_symbols.getLeft(); case Dir::DIR_RIGHT: return m_symbols.getRight(); case Dir::DIR_UP: return m_symbols.getUp(); case Dir::DIR_DOWN: return m_symbols.getDown(); default: assert(!"unknown dir"); } return ControlSym::SYM_NONE; } //----------------------------------------------------------------- /** * Make move. * @return move symbol or SYM_NONE for bad move */ char Unit::driveOrder(char move) { if (canDrive()) { if (m_symbols.getLeft() == move) { return goLeft(); } if (m_symbols.getRight() == move) { return goRight(); } if (m_symbols.getUp() == move) { return goUp(); } if (m_symbols.getDown() == move) { return goDown(); } } return ControlSym::SYM_NONE; } //----------------------------------------------------------------- char Unit::goLeft() { char symbol = ControlSym::SYM_NONE; if (m_model->isLeft()) { if (m_model->rules()->actionMoveDir(Dir::DIR_LEFT)) { symbol = m_symbols.getLeft(); } } else { m_model->rules()->actionTurnSide(); symbol = m_symbols.getLeft(); } return symbol; } //----------------------------------------------------------------- char Unit::goRight() { char symbol = ControlSym::SYM_NONE; if (!m_model->isLeft()) { if (m_model->rules()->actionMoveDir(Dir::DIR_RIGHT)) { symbol = m_symbols.getRight(); } } else { m_model->rules()->actionTurnSide(); symbol = m_symbols.getRight(); } return symbol; } //----------------------------------------------------------------- char Unit::goUp() { char symbol = ControlSym::SYM_NONE; if (m_model->rules()->actionMoveDir(Dir::DIR_UP)) { symbol = m_symbols.getUp(); } return symbol; } //----------------------------------------------------------------- char Unit::goDown() { char symbol = ControlSym::SYM_NONE; if (m_model->rules()->actionMoveDir(Dir::DIR_DOWN)) { symbol = m_symbols.getDown(); } return symbol; } //----------------------------------------------------------------- bool Unit::isMoving() const { bool result = false; if (canDrive()) { std::string action = m_model->rules()->getAction(); result = action == "move_left" || action == "move_right" || action == "move_up" || action == "move_down" || action == "turn"; } return result; } //----------------------------------------------------------------- bool Unit::isMovingDown() const { return m_model->rules()->getDir() == Dir::DIR_DOWN; } //----------------------------------------------------------------- bool Unit::isTurning() const { std::string action = m_model->rules()->getAction(); return action == "turn"; } //----------------------------------------------------------------- bool Unit::isPushing() const { return m_model->rules()->isPushing(); } //----------------------------------------------------------------- bool Unit::isDrivenBy(char symbol) const { return m_symbols.getLeft() == symbol || m_symbols.getRight() == symbol || m_symbols.getUp() == symbol || m_symbols.getDown() == symbol; } //----------------------------------------------------------------- /** * Returns true when models are equal. */ bool Unit::equalsModel(const Cube *other) const { return m_model == other; } //----------------------------------------------------------------- V2 Unit::getLoc() const { return m_model->getLocation(); } //----------------------------------------------------------------- int Unit::getW() const { return m_model->shape()->getW(); } //----------------------------------------------------------------- int Unit::getH() const { return m_model->shape()->getH(); } //----------------------------------------------------------------- bool Unit::isFreePlace(const V2 &loc) const { return m_model->const_rules()->isFreePlace(loc); } //----------------------------------------------------------------- int Unit::countAnimPhases(const std::string &anim) const { return m_model->anim()->countAnimPhases(anim); } //----------------------------------------------------------------- bool Unit::isPowerful() const { return m_model->getPower() >= Cube::HEAVY; } fillets-ng-1.0.1/src/level/Shape.h0000644000175000017500000000134110111137226013576 00000000000000#ifndef HEADER_SHAPE_H #define HEADER_SHAPE_H #include "NoCopy.h" #include "V2.h" #include #include /** * Stores model shape. * It is uses by MarkMask to ask Field under shape. */ class Shape : public NoCopy { public: typedef std::vector t_marks; typedef t_marks::const_iterator const_iterator; private: t_marks m_marks; int m_w; int m_h; public: Shape(const std::string &shape); const_iterator marksBegin() const { return m_marks.begin(); } const_iterator marksEnd() const { return m_marks.end(); } int getW() const { return m_w; } int getH() const { return m_h; } std::string toString() const; }; #endif fillets-ng-1.0.1/src/level/Level.cpp0000644000175000017500000003633011265147427014165 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Level.h" #include "StateManager.h" #include "DescFinder.h" #include "PhaseLocker.h" #include "LevelInput.h" #include "LevelScript.h" #include "LevelLoading.h" #include "LevelCountDown.h" #include "CommandQueue.h" #include "MultiDrawer.h" #include "Log.h" #include "Room.h" #include "StepCounter.h" #include "View.h" #include "OptionAgent.h" #include "VideoAgent.h" #include "ScriptException.h" #include "LogicException.h" #include "DemoMode.h" #include "SoundAgent.h" #include "SubTitleAgent.h" #include "StepDecor.h" #include "StatusDisplay.h" #include "Picture.h" #include "DialogStack.h" #include "StringTool.h" #include #include //----------------------------------------------------------------- /** * Create new level. */ Level::Level(const std::string &codename, const Path &datafile, int depth) : m_codename(codename), m_datafile(datafile) { m_desc = NULL; m_restartCounter = 1; m_undoSteps = 0; m_wasDangerousMove = false; m_depth = depth; m_newRound = false; m_locker = new PhaseLocker(); m_levelScript = new LevelScript(this); m_loading = new LevelLoading(m_levelScript); m_countdown = new LevelCountDown(m_levelScript); m_show = new CommandQueue(); m_background = new MultiDrawer(); m_statusDisplay = new StatusDisplay(); takeHandler(new LevelInput(this)); registerDrawable(m_background); registerDrawable(SubTitleAgent::agent()); registerDrawable(m_statusDisplay); } //----------------------------------------------------------------- Level::~Level() { own_cleanState(); delete m_locker; //NOTE: m_show must be removed before levelScript // because it uses the same script delete m_show; delete m_countdown; delete m_loading; delete m_levelScript; delete m_background; delete m_statusDisplay; } //----------------------------------------------------------------- void Level::fillStatus(LevelStatus *status) { m_countdown->fillStatus(status); } //----------------------------------------------------------------- /** * Start gameplay. * fillDesc() and fillStatus() must be called before. */ void Level::own_initState() { if (NULL == m_desc) { throw LogicException(ExInfo("level description is NULL") .addInfo("codename", m_codename)); } m_countdown->reset(); m_loading->reset(); //NOTE: let level first to draw and then play m_locker->reset(); m_locker->ensurePhases(1); if (!isUndoing()) { SoundAgent::agent()->stopMusic(); } //TODO: escape "codename" m_levelScript->scriptDo("CODENAME = [[" + m_codename + "]]"); m_levelScript->scriptInclude(m_datafile); } //----------------------------------------------------------------- /** * Update level. */ void Level::own_updateState() { m_newRound = false; if (m_locker->getLocked() == 0) { m_newRound = true; nextAction(); } updateLevel(); m_locker->decLock(); if (m_countdown->countDown(this)) { finishLevel(); } } //----------------------------------------------------------------- void Level::own_pauseState() { m_levelScript->killPlan(); action_undo_finish(); } //----------------------------------------------------------------- void Level::own_resumeState() { if (m_levelScript->isRoom()) { initScreen(); } } //----------------------------------------------------------------- /** * Clean room after visit. */ void Level::own_cleanState() { m_levelScript->cleanRoom(); } //----------------------------------------------------------------- /** * Loading is paused on background. */ void Level::own_noteBg() { if (m_loading->isLoading() && !m_loading->isPaused()) { m_loading->togglePause(); } action_undo_finish(); } //----------------------------------------------------------------- void Level::own_noteFg() { initScreen(); if (m_loading->isLoading() && m_loading->isPaused()) { m_loading->togglePause(); } //NOTE: ensure that an unwanted mouse press will not move a fish m_locker->ensurePhases(3); } //----------------------------------------------------------------- bool Level::isUndoing() const { return m_undoSteps != 0; } //----------------------------------------------------------------- bool Level::isActing() const { return isShowing() || isLoading() || isUndoing(); } //----------------------------------------------------------------- bool Level::isLoading() const { return m_loading->isLoading(); } //----------------------------------------------------------------- void Level::togglePause() { return m_loading->togglePause(); } //----------------------------------------------------------------- /** * Process next action. */ void Level::nextAction() { if (isUndoing()) { nextUndoAction(); } else if (isLoading()) { nextLoadAction(); } else if (isShowing()) { nextShowAction(); } else { nextPlayerAction(); } } //----------------------------------------------------------------- /** * Update level (plan dialogs, do anim, ...). */ void Level::updateLevel() { if (!isUndoing() && !isLoading()) { m_levelScript->updateScript(); } } //----------------------------------------------------------------- /** * Save state for undo. * Should be called after a player move, * but still before level script update. * @param oldMoves moves before the last move */ void Level::saveUndo(const std::string &oldMoves) { if (m_levelScript->isRoom()) { Room *room = m_levelScript->room(); bool keepLast = m_wasDangerousMove; m_wasDangerousMove = room->stepCounter()->isDangerousMove(); std::string keepLastValue = keepLast ? "true" : "false"; m_levelScript->scriptDo("script_saveUndo(\"" + oldMoves + "\"," + keepLastValue + ")"); } } //----------------------------------------------------------------- /** * Finish complete level. * Save solution. */ void Level::finishLevel() { if (m_countdown->isFinishedEnough()) { m_countdown->saveSolution(); GameState *nextState = m_countdown->createNextState(); if (nextState) { changeState(nextState); } else { quitState(); } } else if (m_countdown->isWrongEnough()) { action_restart(1); } } //----------------------------------------------------------------- /* * Update room. * Let objects to move. */ void Level::nextPlayerAction() { if (m_levelScript->isRoom()) { Room *room = m_levelScript->room(); std::string oldMoves = room->stepCounter()->getMoves(); room->nextRound(getInput()); // The old positions are now occupied, so check the isSolvable(). bool wasSolvable = room->isSolvable(); m_wasDangerousMove = m_wasDangerousMove || room->isFalling(); if (wasSolvable && !room->isFalling()) { saveUndo(oldMoves); } } } //----------------------------------------------------------------- /** * Write save to the file. * Save moves and models state. * @param models saved models */ void Level::saveGame(const std::string &models) { if (m_levelScript->isRoom()) { Path file = Path::dataWritePath("saves/" + m_codename + ".lua"); FILE *saveFile = fopen(file.getNative().c_str(), "w"); if (saveFile) { std::string moves = m_levelScript->room()->stepCounter()->getMoves(); fputs("\nsaved_moves = '", saveFile); fputs(moves.c_str(), saveFile); fputs("'\n", saveFile); fputs("\nsaved_models = ", saveFile); fputs(models.c_str(), saveFile); fclose(saveFile); displaySaveStatus(); } else { LOG_WARNING(ExInfo("cannot save game") .addInfo("file", file.getNative())); } } } //----------------------------------------------------------------- void Level::displaySaveStatus() { static const int TIME = 3; LOG_INFO(ExInfo("game is saved") .addInfo("codename", m_codename)); m_statusDisplay->displayStatus( new Picture(Path::dataReadPath("images/menu/status/saved.png"), V2(0, 0)), TIME); } //----------------------------------------------------------------- /** * Start loading mode. * @param moves saved moves to load */ void Level::loadGame(const std::string &moves) { if (isUndoing()) { if (m_levelScript->isRoom()) { m_levelScript->room()->setMoves(moves); } } else { m_loading->loadGame(moves); } } //----------------------------------------------------------------- /** * Start replay mode. * @param moves saved moves to load */ void Level::loadReplay(const std::string &moves) { m_loading->loadReplay(moves); } //----------------------------------------------------------------- /** * Load next move. */ void Level::nextLoadAction() { m_loading->nextLoadAction(); if (!isLoading()) { m_levelScript->scriptDo("script_loadState()"); } } //----------------------------------------------------------------- /** * Let show execute. */ void Level::nextShowAction() { if (m_levelScript->isRoom()) { m_levelScript->room()->beginFall(); m_show->executeFirst(); m_levelScript->room()->finishRound(); } } //----------------------------------------------------------------- /** * Do the next undo step. */ void Level::nextUndoAction() { if (m_levelScript->isRoom()) { std::string moves = m_levelScript->room()->stepCounter()->getMoves(); std::string strSteps = StringTool::toString(m_undoSteps); m_levelScript->scriptDo("script_loadUndo(\"" + moves + "\"," + strSteps + ")"); } } //----------------------------------------------------------------- /** * (re)start room. * @return true */ bool Level::action_restart(int increment) { if (increment > 0) { m_undoSteps = 0; } own_cleanState(); m_restartCounter += increment; //NOTE: The script is just overridden by itself, // so planned shows and undo remain after restart. own_initState(); return true; } //----------------------------------------------------------------- /** * Move a fish. * @param symbol move symbol, e.g. 'U', 'D', 'L', 'R' * @return true when move is done */ bool Level::action_move(char symbol) { return m_levelScript->room()->makeMove(symbol); } //----------------------------------------------------------------- /** * Save position. * @return true */ bool Level::action_save() { if (m_levelScript->room()->isSolvable()) { m_levelScript->scriptDo("script_save()"); } else { LOG_INFO(ExInfo("bad level condition, level cannot be finished, " "no save is made")); } return true; } //----------------------------------------------------------------- /** * Load position. * @return true */ bool Level::action_load() { Path file = Path::dataReadPath("saves/" + m_codename + ".lua"); if (file.exists()) { m_undoSteps = 0; m_restartCounter--; action_restart(1); m_levelScript->scriptInclude(file); m_levelScript->scriptDo("script_load()"); } else { LOG_INFO(ExInfo("there is no file to load") .addInfo("file", file.getNative())); } return true; } //----------------------------------------------------------------- /** * Start the undoing. * @param steps 1 for undo, -1 for redo */ void Level::action_undo(int steps) { m_undoSteps = steps; m_levelScript->killPlan(); m_countdown->reset(); nextUndoAction(); } //----------------------------------------------------------------- /** * Restart the room at the current undo position. */ void Level::action_undo_finish() { if (!isUndoing()) { return; } action_restart(0); m_levelScript->scriptDo("script_loadFinalUndo()"); m_undoSteps = 0; } //----------------------------------------------------------------- void Level::switchFish() { if (m_levelScript->isRoom()) { m_levelScript->room()->switchFish(); } } //----------------------------------------------------------------- void Level::controlEvent(const KeyStroke &stroke) { if (m_levelScript->isRoom()) { m_levelScript->room()->controlEvent(stroke); } } //----------------------------------------------------------------- void Level::controlMouse(const MouseStroke &button) { if (m_levelScript->isRoom()) { m_levelScript->room()->controlMouse(button); } } //----------------------------------------------------------------- /** * Create new room * and change screen resolution. */ void Level::createRoom(int w, int h, const std::string &picture) { Room *room = new Room(w, h, picture, m_locker, m_levelScript); room->addDecor(new StepDecor(room->stepCounter())); m_levelScript->takeRoom(room); m_background->removeAll(); m_background->acceptDrawer(room); initScreen(); } //----------------------------------------------------------------- void Level::initScreen() { if (m_levelScript->isRoom()) { std::string title = m_desc->findDesc(m_codename); title.append(": " + m_desc->findLevelName(m_codename)); OptionAgent *options = OptionAgent::agent(); options->setParam("caption", title); options->setParam("screen_width", m_levelScript->room()->getW() * View::SCALE); options->setParam("screen_height", m_levelScript->room()->getH() * View::SCALE); VideoAgent::agent()->initVideoMode(); } } //----------------------------------------------------------------- void Level::newDemo(const Path &demofile) { m_levelScript->interruptPlan(); DemoMode *demo = new DemoMode(demofile); pushState(demo); } //----------------------------------------------------------------- bool Level::isShowing() const { return !m_show->empty(); } //----------------------------------------------------------------- void Level::interruptShow() { m_show->removeAll(); } //----------------------------------------------------------------- void Level::planShow(Command *new_command) { m_show->planCommand(new_command); } //----------------------------------------------------------------- std::string Level::getLevelName() const { return m_desc->findLevelName(m_codename); } //----------------------------------------------------------------- int Level::getCountForSolved() const { int countdown = 10; if (isUndoing()) { countdown = -1; } else if (isLoading()) { countdown = 0; } else if (m_levelScript->dialogs()->areRunning()) { countdown = 30; } return countdown; } //----------------------------------------------------------------- int Level::getCountForWrong() const { //NOTE: don't forget to change briefcase_help_demo too return 75; } fillets-ng-1.0.1/src/game/0000777000175000017500000000000011632204504012257 500000000000000fillets-ng-1.0.1/src/game/Application.cpp0000644000175000017500000001677411422776726015202 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Application.h" #include "Log.h" #include "Path.h" #include "Random.h" #include "AgentPack.h" #include "MessagerAgent.h" #include "VideoAgent.h" #include "InputAgent.h" #include "TimerAgent.h" #include "GameAgent.h" #include "SoundAgent.h" #include "SDLSoundAgent.h" #include "DummySoundAgent.h" #include "ScriptAgent.h" #include "OptionAgent.h" #include "SubTitleAgent.h" #include "ResourceException.h" #include "OptionParams.h" #include "Font.h" #include "SimpleMsg.h" #include "StringMsg.h" #include "SDL.h" #include // for fflush, stdout //----------------------------------------------------------------- Application::Application() { m_quit = false; Random::init(); Font::init(); m_agents = new AgentPack(); //NOTE: MessagerAgent is added by AgentPack //NOTE: creating order is not significant, names are significant, // like rc.d scripts m_agents->addAgent(new ScriptAgent()); m_agents->addAgent(new OptionAgent()); m_agents->addAgent(new VideoAgent()); m_agents->addAgent(new InputAgent()); m_agents->addAgent(new SubTitleAgent()); m_agents->addAgent(new GameAgent()); m_agents->addAgent(new TimerAgent()); } //----------------------------------------------------------------- Application::~Application() { delete m_agents; Font::shutdown(); } //----------------------------------------------------------------- void Application::init(int argc, char *argv[]) { MessagerAgent::agent()->addListener(this); m_agents->init(Name::VIDEO_NAME); prepareLogLevel(); prepareOptions(argc, argv); customizeGame(); m_agents->init(Name::TIMER_NAME); addSoundAgent(); m_agents->init(); } //----------------------------------------------------------------- void Application::run() { while (!m_quit) { m_agents->update(); } } //----------------------------------------------------------------- void Application::shutdown() { m_agents->shutdown(); } //----------------------------------------------------------------- /** * Set loglevel according option. * Prepare to change. */ void Application::prepareLogLevel() { OptionAgent *options = OptionAgent::agent(); StringMsg *event = new StringMsg(this, "param_changed", "loglevel"); options->addWatcher("loglevel", event); options->setDefault("loglevel", Log::getLogLevel()); } //----------------------------------------------------------------- void Application::prepareOptions(int argc, char *argv[]) { OptionParams params; params.addParam("loglevel", OptionParams::TYPE_NUMBER, "Debug with loglevel 7 (default=6)"); params.addParam("systemdir", OptionParams::TYPE_PATH, "Path to game data"); params.addParam("userdir", OptionParams::TYPE_PATH, "Path to game data"); params.addParam("lang", OptionParams::TYPE_STRING, "2-letter code (e.g., en, cs, fr, de)"); params.addParam("speech", OptionParams::TYPE_STRING, "Lang for speech"); params.addParam("subtitles", OptionParams::TYPE_BOOLEAN, "Enable subtitles"); params.addParam("fullscreen", OptionParams::TYPE_BOOLEAN, "Turn fullscreen on/off"); params.addParam("show_steps", OptionParams::TYPE_BOOLEAN, "Show a step counter in levels"); params.addParam("sound", OptionParams::TYPE_BOOLEAN, "Turn sound on/off"); params.addParam("volume_sound", OptionParams::TYPE_NUMBER, "Sound volume in percentage"); params.addParam("volume_music", OptionParams::TYPE_NUMBER, "Music volume in percentage"); params.addParam("worldmap", OptionParams::TYPE_STRING, "Path to the worldmap file"); params.addParam("cache_images", OptionParams::TYPE_BOOLEAN, "Cache images (default=true)"); params.addParam("sound_frequency", OptionParams::TYPE_NUMBER, "Sound sample rate (default=44100)"); params.addParam("strict_rules", OptionParams::TYPE_BOOLEAN, "Disallow pushing of partially supported objects (default=true)"); params.addParam("replay_level", OptionParams::TYPE_STRING, "Replay the solution for the given level codename"); OptionAgent::agent()->parseCmdOpt(argc, argv, params); } //----------------------------------------------------------------- /** * Run init script. * @throws ResourceException when data are not available */ void Application::customizeGame() { Path initfile = Path::dataReadPath("script/init.lua"); if (initfile.exists()) { ScriptAgent::agent()->scriptInclude(initfile); } else { throw ResourceException(ExInfo("init file not found") .addInfo("path", initfile.getNative()) .addInfo("systemdir", OptionAgent::agent()->getParam("systemdir")) .addInfo("userdir", OptionAgent::agent()->getParam("userdir")) .addInfo("hint", "try command line option \"systemdir=path/to/data\"")); } } //----------------------------------------------------------------- /** * Choose SDL or Dummy sound agent. * Reads 'sound' config option. */ void Application::addSoundAgent() { //TODO: better setting sound on/off //TODO: move to the SoundAgent SoundAgent *soundAgent = NULL; if (OptionAgent::agent()->getAsBool("sound", true)) { soundAgent = new SDLSoundAgent(); try { soundAgent->init(); } catch (BaseException &e) { LOG_WARNING(e.info()); delete soundAgent; soundAgent = new DummySoundAgent(); } } else { soundAgent = new DummySoundAgent(); } m_agents->addAgent(soundAgent); } //----------------------------------------------------------------- /** * Handle incoming message. * Messages: * - quit ... application quit * - inc_loglevel ... inc loglevel by 1 (max LEVEL_DEBUG) * - dec_loglevel ... dec loglevel by 1 (min LEVEL_ERROR) */ void Application::receiveSimple(const SimpleMsg *msg) { if (msg->equalsName("quit")) { m_quit = true; } else if (msg->equalsName("inc_loglevel")) { int level = Log::getLogLevel() + 1; if (level <= Log::LEVEL_DEBUG) { OptionAgent::agent()->setParam("loglevel", level); } } else if (msg->equalsName("dec_loglevel")) { int level = Log::getLogLevel() - 1; if (level >= Log::LEVEL_ERROR) { OptionAgent::agent()->setParam("loglevel", level); } } else if (msg->equalsName("flush_stdout")) { fflush(stdout); } else { LOG_WARNING(ExInfo("unknown msg") .addInfo("msg", msg->toString())); } } //----------------------------------------------------------------- /** * Handle incoming message. * Messages: * - param_changed(loglevel) ... set loglevel */ void Application::receiveString(const StringMsg *msg) { if (msg->equalsName("param_changed")) { std::string param = msg->getValue(); if ("loglevel" == param) { Log::setLogLevel(OptionAgent::agent()->getAsInt("loglevel")); } } else { LOG_WARNING(ExInfo("unknown msg") .addInfo("msg", msg->toString())); } } fillets-ng-1.0.1/src/game/main.cpp0000644000175000017500000000723510132067321013630 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ /** * * \mainpage * * GenGine is work name for our Game Engine. * Engine architecture composes of agents responsible for specific action. * * \section AgentPack * * AgentPack groups agents which have something to do. It inits agents, update them and shutdown them at the end. * * Every agent has init(), update() and shutdown() methods. These methods are empty by default. * * Available agents: * - MessagerAgent - allows sending messages to agent and other listeners * - ScriptAgent - makes scripting possible * - OptionAgent - contains global game options * - VideoAgent - inits video mode and calls drawers drawOn() method * - SoundAgent - plays music and sound * - TimerAgent - sleeps constant delay = makes stable FPS * - InputAgent - reads input events and handles keystrokes * - SubTitleAgent - scrolls subtitles on display * - GameAgent - updates game states * * AgentPack will call agents ordered by their names. See Name.cpp for names. * AgentPack::init() calls init() on all agents. AgentPack::update() calls * update() on all agents. AgentPack::shutdown() calls shutdown() on all agents. * * * \subsection mini_app Minimal application * \code * * AgentPack *agents = new AgentPack(); * try { * agents->addAgent(new ScriptAgent()); * agents->addAgent(new OptionAgent()); * agents->init(); * * while (true) { * agents->update(); * } * } * catch (BaseException &e) { * LOG_ERROR(e.info()); * agents->shutdown(); * } * * delete agents; * \endcode * * * \note * MessagerAgent is always included in AgentPack. * It is need to register every agent as listener during AgentPack::addAgent(). * * \section BaseAgent * * Every agent inherits from BaseAgent. * * Rules for agents: * -# Agent must not call other agents in his constructor. * -# Agent can call only agents with lower names and oneself in his init(). * -# Agent can call only agents with higher names * and oneself in his shutdown(). * * For example, * agent "30video" can ask agent "20option" about screen_width in his init(). * * \section Communication * * Every agent has static method agent(). It asks AgentPack::getAgent() * for agent instance. * * agent() method is made by AGENT(TYPE, NAME) macro. This allows us * to obtain agent of preferred type and is not need * to write agent() method for every agent. * * \subsection comm-example How to get screen_width * \code * OptionAgent::agent()->getAsInt("screen_width"); * \endcode * */ #include "SDL.h" #include "Log.h" #include "Application.h" #include "HelpException.h" #include "BaseException.h" #include //printf //----------------------------------------------------------------- int main(int argc, char *argv[]) { try { Application app; try { app.init(argc, argv); app.run(); } catch (HelpException &e) { printf("%s\n", e.what()); } catch (BaseException &e) { LOG_ERROR(e.info()); } app.shutdown(); return 0; } catch (BaseException &e) { LOG_ERROR(e.info()); } catch (std::exception &e) { LOG_ERROR(ExInfo("std::exception") .addInfo("what", e.what())); } catch (...) { LOG_ERROR(ExInfo("unknown exception")); } return 1; } fillets-ng-1.0.1/src/game/GameAgent.h0000644000175000017500000000112511422543242014175 00000000000000#ifndef HEADER_GAMEAGENT_H #define HEADER_GAMEAGENT_H class StateManager; #include "BaseAgent.h" #include "Name.h" #include /** * Create game. * GameAgent uses StateManager to manage * WorldMap, Pedometer, Level and DemoMode. */ class GameAgent : public BaseAgent { AGENT(GameAgent, Name::GAME_NAME); private: StateManager *m_manager; private: void replaySolution(const std::string &codename); void keyBinding(); protected: virtual void own_init(); virtual void own_update(); virtual void own_shutdown(); }; #endif fillets-ng-1.0.1/src/game/Makefile.in0000644000175000017500000003557611632204472014264 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ bin_PROGRAMS = fillets$(EXEEXT) subdir = src/game DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_fillets_OBJECTS = Application.$(OBJEXT) GameAgent.$(OBJEXT) \ main.$(OBJEXT) fillets_OBJECTS = $(am_fillets_OBJECTS) @HAVE_WINDRES_TRUE@am__DEPENDENCIES_1 = fillets_ico.o am__DEPENDENCIES_2 = ../SDL_gfx/libSDL_gfx.a am__DEPENDENCIES_3 = fillets_DEPENDENCIES = $(am__DEPENDENCIES_1) ../menu/libmenu.a \ ../level/liblevel.a ../state/libstate.a ../option/liboption.a \ ../plan/libplan.a ../widget/libwidget.a ../effect/libeffect.a \ ../gengine/libgengine.a $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_3) \ $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_3) \ $(am__DEPENDENCIES_3) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(fillets_SOURCES) DIST_SOURCES = $(fillets_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx SDL_GFX_LIBS = ../SDL_gfx/libSDL_gfx.a INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan -I@top_srcdir@/src/option -I@top_srcdir@/src/state -I@top_srcdir@/src/level -I@top_srcdir@/src/menu $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) fillets_SOURCES = Application.cpp Application.h GameAgent.cpp GameAgent.h main.cpp EXTRA_DIST = fillets.rc fillets.ico @HAVE_WINDRES_FALSE@ICON_LIBS = @HAVE_WINDRES_TRUE@ICON_LIBS = fillets_ico.o fillets_LDADD = $(ICON_LIBS) ../menu/libmenu.a ../level/liblevel.a ../state/libstate.a ../option/liboption.a ../plan/libplan.a ../widget/libwidget.a ../effect/libeffect.a ../gengine/libgengine.a $(SDL_GFX_LIBS) $(SDL_LIBS) $(LUA_LIBS) $(BOOST_LIBS) $(FRIBIDI_LIBS) $(X_LIBS) all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/game/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/game/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) fillets$(EXEEXT): $(fillets_OBJECTS) $(fillets_DEPENDENCIES) @rm -f fillets$(EXEEXT) $(CXXLINK) $(fillets_LDFLAGS) $(fillets_OBJECTS) $(fillets_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Application.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GameAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-info install-info-am install-man install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-info-am @HAVE_WINDRES_TRUE@fillets_ico.o: fillets.rc fillets.ico @HAVE_WINDRES_TRUE@ @WINDRES@ fillets.rc -O coff -o $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/game/Makefile.am0000644000175000017500000000165410504324773014245 00000000000000SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx SDL_GFX_LIBS = ../SDL_gfx/libSDL_gfx.a INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan -I@top_srcdir@/src/option -I@top_srcdir@/src/state -I@top_srcdir@/src/level -I@top_srcdir@/src/menu $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) bin_PROGRAMS = fillets fillets_SOURCES = Application.cpp Application.h GameAgent.cpp GameAgent.h main.cpp EXTRA_DIST = fillets.rc fillets.ico if HAVE_WINDRES ICON_LIBS = fillets_ico.o fillets_ico.o: fillets.rc fillets.ico @WINDRES@ fillets.rc -O coff -o $@ else ICON_LIBS = endif fillets_LDADD = $(ICON_LIBS) ../menu/libmenu.a ../level/liblevel.a ../state/libstate.a ../option/liboption.a ../plan/libplan.a ../widget/libwidget.a ../effect/libeffect.a ../gengine/libgengine.a $(SDL_GFX_LIBS) $(SDL_LIBS) $(LUA_LIBS) $(BOOST_LIBS) $(FRIBIDI_LIBS) $(X_LIBS) fillets-ng-1.0.1/src/game/fillets.rc0000644000175000017500000000004310133550331014155 00000000000000fillets ICON PRELOAD "fillets.ico" fillets-ng-1.0.1/src/game/GameAgent.cpp0000644000175000017500000000622311422543472014541 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "GameAgent.h" #include "StateManager.h" #include "Log.h" #include "WorldMap.h" #include "InputAgent.h" #include "KeyStroke.h" #include "KeyBinder.h" #include "SimpleMsg.h" #include "IntMsg.h" #include "Path.h" #include "OptionAgent.h" #include "LevelStatus.h" #include "Level.h" #include "SDL.h" //----------------------------------------------------------------- void GameAgent::own_init() { m_manager = new StateManager(); std::string replayLevel = OptionAgent::agent()->getParam("replay_level"); if (replayLevel == "") { Path pathMap = Path::dataReadPath(OptionAgent::agent()->getParam( "worldmap", "script/worldmap.lua")); WorldMap *worldmap = new WorldMap(); worldmap->initMap(pathMap); m_manager->pushState(NULL, worldmap); } else { replaySolution(replayLevel); } keyBinding(); } //----------------------------------------------------------------- /** * Replays the given solution instead of starting the game. * It is used only for testing. */ void GameAgent::replaySolution(const std::string &codename) { static LevelStatus *levelStatus = NULL; static DescFinder *desc = NULL; if (levelStatus == NULL) { levelStatus = new LevelStatus(); desc = new WorldMap(); } levelStatus->prepareRun(codename, "", 0, ""); std::string moves = levelStatus->readSolvedMoves(); Path datafile = Path::dataReadPath( "script/" + codename + "/init.lua"); Level *level = new Level(codename, datafile, 0); level->fillStatus(levelStatus); level->fillDesc(desc); m_manager->pushState(NULL, level); level->loadReplay(moves); } //----------------------------------------------------------------- /** * Update game. * Play level or show menu. */ void GameAgent::own_update() { m_manager->updateGame(); } //----------------------------------------------------------------- /** * Remember playtime. */ void GameAgent::own_shutdown() { OptionAgent *options = OptionAgent::agent(); int playtime = options->getAsInt("playtime"); playtime += SDL_GetTicks() / 1000; options->setPersistent("playtime", playtime); delete m_manager; } //----------------------------------------------------------------- /** * Global keystrokes. */ void GameAgent::keyBinding() { BaseMsg *msg; KeyBinder *keyBinder = InputAgent::agent()->keyBinder(); // fullscreen KeyStroke fs(SDLK_F11, KMOD_NONE); msg = new SimpleMsg(Name::VIDEO_NAME, "fullscreen"); keyBinder->addStroke(fs, msg); // log KeyStroke log_plus(SDLK_KP_PLUS, KMOD_RALT); msg = new SimpleMsg(Name::APP_NAME, "inc_loglevel"); keyBinder->addStroke(log_plus, msg); KeyStroke log_minus(SDLK_KP_MINUS, KMOD_RALT); msg = new SimpleMsg(Name::APP_NAME, "dec_loglevel"); keyBinder->addStroke(log_minus, msg); } fillets-ng-1.0.1/src/game/Application.h0000644000175000017500000000144410105211106014600 00000000000000#ifndef HEADER_APPLICATION_H #define HEADER_APPLICATION_H class AgentPack; #include "NoCopy.h" #include "BaseListener.h" #include "Name.h" /** * Main application */ class Application : public NoCopy, public BaseListener { private: AgentPack *m_agents; bool m_quit; private: void prepareLogLevel(); void prepareOptions(int argc, char *argv[]); void customizeGame(); void addSoundAgent(); public: Application(); virtual ~Application(); virtual const char *getName() const { return Name::APP_NAME; } void init(int argc, char *argv[]); void run(); void shutdown(); virtual void receiveSimple(const SimpleMsg *msg); virtual void receiveString(const StringMsg *msg); }; #endif fillets-ng-1.0.1/src/game/fillets.ico0000644000175000017500000000137610133521162014335 00000000000000 è( @€€€€€€€€€€ÀÀÀ€€€ÿÿÿÿÿÿÿÿÿÿÿÿ;»»³»»»»»»;»0»³ »0»°»° » »»°»° »»»0 ° °»0»» »» °»³ »»»» »°;0 °»°»°»;° ° °»»;³ ° ° ° °;»0 ° ° ° ° °;»0 ° ° °»°»;³ ° ° °»°»°»;° °³ »»»» »°;0» »» °»»0» ° °»»0»° » »»°»° » »0»°;»0»³»»»»»»;»»³ÿàÿÿ€ÿþü?øðàÀÀ€€€€ÀÀàðøü?þÿ€ÿÿàÿfillets-ng-1.0.1/src/gengine/0000777000175000017500000000000011632204503012761 500000000000000fillets-ng-1.0.1/src/gengine/Log.h0000644000175000017500000000203110033064516013565 00000000000000#ifndef HEADER_LOG_H #define HEADER_LOG_H #include "ExInfo.h" /** * Log utils. */ class Log { private: static int ms_logLevel; public: /** * Log priority, like syslog. */ static const int LEVEL_DEBUG = 7; static const int LEVEL_INFO = 6; static const int LEVEL_WARNING = 4; static const int LEVEL_ERROR = 3; public: static void setLogLevel(int logLevel) { ms_logLevel = logLevel; } static int getLogLevel() { return ms_logLevel; } static void log(int level, const char *file, int line, const ExInfo &info) throw(); }; #define LOG_DEBUG(info) do { Log::log(Log::LEVEL_DEBUG, __FILE__, __LINE__, info); } while (false) #define LOG_INFO(info) do { Log::log(Log::LEVEL_INFO, __FILE__, __LINE__, info); } while (false) #define LOG_WARNING(info) do { Log::log(Log::LEVEL_WARNING, __FILE__, __LINE__, info); } while (false) #define LOG_ERROR(info) do { Log::log(Log::LEVEL_ERROR, __FILE__, __LINE__, info); } while (false) #endif fillets-ng-1.0.1/src/gengine/Path.cpp0000644000175000017500000001060611133356651014310 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Path.h" #include "Log.h" #include "OptionAgent.h" #include "Dialog.h" #include "FsPath.h" #include "PathException.h" #include //----------------------------------------------------------------- Path::Path(const std::string &file) : m_path(file) { /* empty */ } //----------------------------------------------------------------- /** * Try return user data path, * otherwise return system data path. * NOTE: OptionAgent must be initialized before this * * @param file path to file * @param writeable whether we want write to the file * @return path to user or system file */ Path Path::dataPath(const std::string &file, bool writeable) { Path datapath = dataUserPath(file); if (!datapath.exists()) { FILE *try_open = NULL; if (writeable) { try { LOG_INFO(ExInfo("creating path") .addInfo("path", datapath.getNative())); FsPath::createPath(datapath.getPosixName()); try_open = fopen(datapath.getNative().c_str(), "wb"); } catch (PathException &e) { LOG_WARNING(e.info()); } } if (try_open) { fclose(try_open); } else { datapath = dataSystemPath(file); } } return datapath; } //----------------------------------------------------------------- Path Path::dataReadPath(const std::string &file) { return dataPath(file, false); } //----------------------------------------------------------------- Path Path::dataWritePath(const std::string &file) { return dataPath(file, true); } //----------------------------------------------------------------- /** * Return path to system file. * Path does not need to exist. */ Path Path::dataSystemPath(const std::string &file) { std::string systemdir = OptionAgent::agent()->getParam("systemdir"); return constructPath(systemdir, file); } //----------------------------------------------------------------- /** * Return path to user file. * Path does not need to exist. */ Path Path::dataUserPath(const std::string &file) { std::string userdir = OptionAgent::agent()->getParam("userdir"); return constructPath(userdir, file); } //----------------------------------------------------------------- /** * Create path to the given file in the given directory. * Tries to use path to a localized resource if it exists. */ Path Path::constructPath(const std::string &dir, const std::string &file) { std::string localized = localizePath(file); Path localizedPath = Path(FsPath::join(dir, localized)); if (localized == file) { return localizedPath; } else if (localizedPath.exists()) { LOG_INFO(ExInfo("localized") .addInfo("path", localizedPath.getNative())); return localizedPath; } else { return Path(FsPath::join(dir, file)); } } //----------------------------------------------------------------- /** * Return path to a localized resource or the original path. * The localized path has format: __. * * @param original original path * @return localized path if it is meaningful or the original path */ std::string Path::localizePath(const std::string &original) { std::string::size_type dotPos = original.rfind('.'); if (dotPos == std::string::npos) { return original; } std::string lang = OptionAgent::agent()->getParam("lang"); if (Dialog::DEFAULT_LANG == lang || lang.empty()) { return original; } std::string appendix = "__" + lang; std::string::size_type dirPos = original.rfind('/'); if (dirPos != std::string::npos && dotPos < dirPos) { return original; } std::string path = original; path.insert(dotPos, appendix); return path; } //----------------------------------------------------------------- std::string Path::getNative() const { return FsPath::getNative(m_path); } //----------------------------------------------------------------- bool Path::exists() const { return FsPath::exists(m_path); } fillets-ng-1.0.1/src/gengine/KeyBinder.cpp0000644000175000017500000000421210066560630015262 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "KeyBinder.h" #include "Log.h" #include "LogicException.h" #include "BaseMsg.h" #include "SDL.h" //----------------------------------------------------------------- KeyBinder::~KeyBinder() { t_strokes::iterator end = m_strokes.end(); for (t_strokes::iterator i = m_strokes.begin(); i != end; ++i) { delete i->second; } } //----------------------------------------------------------------- /** * Bind keystroke. * @param stroke keystroke * @param msg message to raise, will be deleted * @throws LogicException when keystroke is occupied */ void KeyBinder::addStroke(const KeyStroke &stroke, BaseMsg *msg) { std::pair status = m_strokes.insert( std::pair(stroke, msg)); if (!status.second) { throw LogicException(ExInfo("keystroke is occupied") .addInfo("keystroke", stroke.toString())); } else { LOG_DEBUG(ExInfo("binding keystroke") .addInfo("keystroke", stroke.toString()) .addInfo("msg", msg->toString())); } } //----------------------------------------------------------------- void KeyBinder::removeStroke(const KeyStroke &stroke) { t_strokes::iterator it = m_strokes.find(stroke); if (m_strokes.end() != it) { delete it->second; m_strokes.erase(it); } else { LOG_WARNING(ExInfo("keystroke does not exist") .addInfo("keystroke", stroke.toString())); } } //----------------------------------------------------------------- /** * Handle keydown event, * find keystroke and send message. */ void KeyBinder::keyDown(const SDL_keysym &keysym) const { KeyStroke stroke(keysym); t_strokes::const_iterator it = m_strokes.find(stroke); if (m_strokes.end() != it) { it->second->sendClone(); } } fillets-ng-1.0.1/src/gengine/OptionParams.h0000644000175000017500000000210611126124722015463 00000000000000#ifndef HEADER_OPTIONPARAMS_H #define HEADER_OPTIONPARAMS_H class Environ; #include "NoCopy.h" #include #include /** * Describe command line params. */ class OptionParams : public NoCopy { public: enum eType { TYPE_NUMBER, TYPE_BOOLEAN, TYPE_STRING, TYPE_PATH }; private: struct Param { eType type; std::string help; Param(eType aType, const std::string &aHelp) : type(aType), help(aHelp) {} }; typedef std::map t_params; t_params m_params; int m_maxSize; private: std::string getType(eType type) const; public: OptionParams() { m_maxSize = 0; } void addParam(const std::string &name, eType type, const std::string &help); std::string getHelp(const Environ *options) const; std::string getConfig(const Environ *options) const; void checkValidity(const std::string &name, const std::string &value) const; }; #endif fillets-ng-1.0.1/src/gengine/Name.cpp0000644000175000017500000000163610132067321014266 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Name.h" //NOTE: timerAgent is before inputAgent. This gives player // the fastest rection on his input (there is no delay between input, // game and video update). const char *Name::APP_NAME = "App"; const char *Name::MESSAGER_NAME = "10messager"; const char *Name::SCRIPT_NAME = "15script"; const char *Name::OPTION_NAME = "20option"; const char *Name::VIDEO_NAME = "30video"; const char *Name::SOUND_NAME = "40sound"; const char *Name::TIMER_NAME = "50timer"; const char *Name::INPUT_NAME = "60input"; const char *Name::SUBTITLE_NAME = "70subtitle"; const char *Name::GAME_NAME = "80game"; fillets-ng-1.0.1/src/gengine/SimpleMsg.h0000644000175000017500000000111310033064516014744 00000000000000#ifndef HEADER_SIMPLEMSG_H #define HEADER_SIMPLEMSG_H #include "BaseMsg.h" #include "BaseListener.h" /** * Simple text messgage. */ class SimpleMsg : public BaseMsg { public: CLONE(SimpleMsg); SimpleMsg(BaseListener *listener, const std::string &name) : BaseMsg(listener->getName(), name) {} SimpleMsg(const std::string &listenerName, const std::string &name) : BaseMsg(listenerName, name) {} virtual void sendActual(BaseListener *listener) const { listener->receiveSimple(this); } }; #endif fillets-ng-1.0.1/src/gengine/Scripter.cpp0000644000175000017500000000223610125025227015177 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Scripter.h" #include "ScriptState.h" #include "def-script.h" //----------------------------------------------------------------- Scripter::Scripter() { m_script = new ScriptState(); m_script->registerLeader(this); m_script->registerFunc("file_include", script_file_include); m_script->registerFunc("file_exists", script_file_exists); } //----------------------------------------------------------------- Scripter::~Scripter() { delete m_script; } //----------------------------------------------------------------- /** * Include this script file. */ void Scripter::scriptInclude(const Path &filename) { m_script->doFile(filename); } //----------------------------------------------------------------- /** * Run this command. */ void Scripter::scriptDo(const std::string &input) { m_script->doString(input); } fillets-ng-1.0.1/src/gengine/Random.h0000644000175000017500000000063210046034756014300 00000000000000#ifndef HEADER_RANDOM_H #define HEADER_RANDOM_H /** * Utils for random numbers. */ class Random { private: static const int ARRAY_SIZE = 255; static unsigned char ms_randArray[ARRAY_SIZE]; public: static void init(); static int randomInt(int bound); static double randomReal(double bound); static unsigned char aByte(unsigned int index); }; #endif fillets-ng-1.0.1/src/gengine/ScriptException.h0000644000175000017500000000046110033113053016163 00000000000000#ifndef HEADER_SCRIPTEXCEPTION_H #define HEADER_SCRIPTEXCEPTION_H #include "BaseException.h" /** * Exception about script fail. */ class ScriptException : public BaseException { public: ScriptException(const ExInfo &problem) : BaseException(problem) {} }; #endif fillets-ng-1.0.1/src/gengine/ResourcePack.h0000644000175000017500000001104711212041056015433 00000000000000#ifndef HEADER_RESOURCEPACK_H #define HEADER_RESOURCEPACK_H #include "Log.h" #include "Random.h" #include "INamed.h" #include "ResourceException.h" #include #include #include /** * Share resources. */ template class ResourcePack : public INamed { public: typedef std::vector t_range; protected: typedef std::multimap t_reses; typedef typename t_reses::iterator t_resIterator; typedef typename t_reses::const_iterator t_constIterator; t_reses m_reses; public: /** * Frees the given resource. */ virtual void unloadRes(T res) = 0; //NOTE: we cannot call virtual functions from desctructor, // call removeAll before delete virtual ~ResourcePack() { if (!m_reses.empty()) { LOG_WARNING(ExInfo("resources are not released") .addInfo("pack", toString())); } } //----------------------------------------------------------------- /** * Free all resources. * NOTE: we cannot call virtual functions from desctructor */ void removeAll() { t_resIterator end = m_reses.end(); for (t_resIterator item = m_reses.begin(); item != end; ++item) { unloadRes(item->second); } m_reses.clear(); } //----------------------------------------------------------------- /** * Unload all resources with this name. */ void removeRes(const std::string &name) { std::pair range = m_reses.equal_range(name); while (range.first != range.second) { unloadRes(range.first->second); ++(range.first); } m_reses.erase(name); LOG_DEBUG(ExInfo("removed resources") .addInfo("name", name)); } //----------------------------------------------------------------- /** * Store resource under this name. */ void addRes(const std::string &name, T res) { m_reses.insert( std::pair(name, res)); } //----------------------------------------------------------------- /** * Get resource with this name. */ T getRes(const std::string &name, int rank=0) { std::pair range = m_reses.equal_range(name); for (int i = 0; i < rank && range.first != range.second; ++i) { ++(range.first); } if (range.second == range.first) { throw ResourceException(ExInfo("no such resource at index") .addInfo("name", name) .addInfo("index", rank) .addInfo("pack", toString())); } return range.first->second; } //----------------------------------------------------------------- /** * Get all resources with this name. * NOTE: range can be empty. */ t_range getRange(const std::string &name) { t_range result; std::pair range = m_reses.equal_range(name); while (range.first != range.second) { result.push_back(range.first->second); range.first++; } return result; } //----------------------------------------------------------------- /** * Get resource at random index or return NULL. */ T getRandomRes(const std::string &name) { T result = NULL; typename t_reses::size_type count = m_reses.count(name); if (count > 0) { result = getRes(name, Random::randomInt(count)); } else { LOG_WARNING(ExInfo("no such resource") .addInfo("name", name) .addInfo("pack", toString())); } return result; } //----------------------------------------------------------------- /** * Count resources with this name. */ int countRes(const std::string &name) { return m_reses.count(name); } //----------------------------------------------------------------- std::string toString() const { ExInfo available_res = ExInfo("resources") .addInfo("name", getName()); t_constIterator end = m_reses.end(); for (t_constIterator item = m_reses.begin(); item != end; ++item) { available_res.addInfo("key", item->first); } return available_res.info(); } }; #endif fillets-ng-1.0.1/src/gengine/Dialog.cpp0000644000175000017500000000500210641470370014603 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Dialog.h" #include "Log.h" #include "SoundAgent.h" #include "ResSoundPack.h" #include "Path.h" #include "minmax.h" const std::string Dialog::DEFAULT_LANG = "en"; //----------------------------------------------------------------- /** * Create new dialog. * Both sound file and subtitles are optional. */ Dialog::Dialog(const std::string &lang, const std::string &soundfile, const std::string &subtitle) : m_soundfile(soundfile), m_lang(lang), m_subtitle(subtitle) { m_sound = NULL; } //----------------------------------------------------------------- Dialog::~Dialog() { if (m_sound) { Mix_FreeChunk(m_sound); } } //----------------------------------------------------------------- /** * Run dialog. * Do lazy loading of sound. * * @param volume sound volume * @param loops numer of loops. 0=play once, 1=play twice, -1=play infinite * @return channel number where the sound is played or -1 */ int Dialog::talk(int volume, int loops) const { if (NULL == m_sound && !m_soundfile.empty()) { Path soundPath = Path::dataReadPath(m_soundfile); m_sound = ResSoundPack::loadSound(soundPath); } int channel = SoundAgent::agent()->playSound(m_sound, volume, loops); return channel; } //----------------------------------------------------------------- /** * Override this method to run subtitles. */ void Dialog::runSubtitle(const StringTool::t_args &args) const { LOG_INFO(ExInfo("subtitle") .addInfo("content", getFormatedSubtitle(args))); } //----------------------------------------------------------------- /** * Replace %1, %2, ... with the arguments. * NOTE: %0 is not expanded */ std::string Dialog::getFormatedSubtitle(const StringTool::t_args &args) const { std::string buffer = m_subtitle; for (unsigned int i = 1; i < args.size(); ++i) { StringTool::replace(buffer, "%" + StringTool::toString(i), args[i]); } return buffer; } //----------------------------------------------------------------- /** * Minimal time according subtitle length. * @return minimal number of cycles for talk */ int Dialog::getMinTime() const { return min(180, StringTool::utf8Length(m_subtitle)); } fillets-ng-1.0.1/src/gengine/KeyBinder.h0000644000175000017500000000100210066560630014721 00000000000000#ifndef HEADER_KEYBINDER_H #define HEADER_KEYBINDER_H class BaseMsg; #include "NoCopy.h" #include "KeyStroke.h" #include /** * Key binder. */ class KeyBinder : public NoCopy { private: typedef std::map t_strokes; t_strokes m_strokes; public: ~KeyBinder(); void addStroke(const KeyStroke &stroke, BaseMsg *msg); void removeStroke(const KeyStroke &stroke); void keyDown(const SDL_keysym &keysym) const; }; #endif fillets-ng-1.0.1/src/gengine/ImgException.cpp0000644000175000017500000000120210033064516015771 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ImgException.h" #include "SDL_image.h" //----------------------------------------------------------------- /** * Add IMG_GetError to info. * @param problem detail info */ ImgException::ImgException(const ExInfo &problem) : BaseException(ExInfo(problem).addInfo("IMG", IMG_GetError())) { /* empty */ } fillets-ng-1.0.1/src/gengine/MessagerAgent.h0000644000175000017500000000101210033064516015567 00000000000000#ifndef HEADER_MESSAGERAGENT_H #define HEADER_MESSAGERAGENT_H #include "BaseAgent.h" #include "Name.h" #include /** * List of listeners. */ class MessagerAgent : public BaseAgent { AGENT(MessagerAgent, Name::MESSAGER_NAME); private: typedef std::map t_listeners; t_listeners m_listeners; public: void addListener(BaseListener *listener); void removeListener(const std::string &name); void forwardNewMsg(BaseMsg *msg); }; #endif fillets-ng-1.0.1/src/gengine/ImgException.h0000644000175000017500000000036510033064516015447 00000000000000#ifndef HEADER_IMGEXCEPTION_H #define HEADER_IMGEXCEPTION_H #include "BaseException.h" /** * Exception about SDL_image fail. */ class ImgException : public BaseException { public: ImgException(const ExInfo &problem); }; #endif fillets-ng-1.0.1/src/gengine/AgentPack.cpp0000644000175000017500000001003210046670304015236 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "AgentPack.h" #include "BaseAgent.h" #include "LogicException.h" #include "NameException.h" #include "MessagerAgent.h" AgentPack *AgentPack::ms_singleton = NULL; //----------------------------------------------------------------- AgentPack::AgentPack() { //NOTE: this is not thread safe if (ms_singleton) { throw LogicException(ExInfo("AgentPack is singleton")); } ms_singleton = this; //NOTE: MessagerAgent must be the first MessagerAgent *messager = new MessagerAgent(); messager->init(); addAgent(messager); } //----------------------------------------------------------------- AgentPack::~AgentPack() { t_agents::iterator end = m_agents.end(); for (t_agents::iterator i = m_agents.begin(); i != end; ++i) { delete i->second; } ms_singleton = NULL; } //----------------------------------------------------------------- /** * Insert agent to pack * and insert his to listeners too. * NOTE: agent->init() is not called yet * * @param agent agent * @throws NameEception if agent with this name already exists. */ void AgentPack::addAgent(BaseAgent *agent) { std::pair status = m_agents.insert( std::pair(agent->getName(), agent)); if (!status.second) { throw NameException(ExInfo("agent already exists") .addInfo("name", agent->getName())); } MessagerAgent::agent()->addListener(agent); } //----------------------------------------------------------------- /** * Remove agent from pack * and remove his from listeners too. * @param name agent's name */ void AgentPack::removeAgent(const std::string &name) { t_agents::iterator it = m_agents.find(name); if (m_agents.end() != it) { MessagerAgent::agent()->removeListener(name); delete it->second; m_agents.erase(it); } } //----------------------------------------------------------------- /** * Return agent according his name. * @param name agent's name * @return agent * @throws NameException when agent cannot be found * @throws LogicException when agent is not initialized */ BaseAgent * AgentPack::getAgent(const std::string &name) { if (NULL == ms_singleton) { throw LogicException(ExInfo("AgentPack is not ready")); } t_agents::iterator it = ms_singleton->m_agents.find(name); if (ms_singleton->m_agents.end() == it) { throw NameException(ExInfo("cannot find agent") .addInfo("name", name)); } if (!it->second->isInitialized()) { throw LogicException(ExInfo("agent is not initialized") .addInfo("name", name)); } return it->second; } //----------------------------------------------------------------- /** * Init all agents bellow stopAgent. * Init all agents when stopAgent is not found. */ void AgentPack::init(const std::string &stopAgent) { t_agents::iterator stop = m_agents.find(stopAgent); for (t_agents::iterator i = m_agents.begin(); i != stop; ++i) { if (!i->second->isInitialized()) { i->second->init(); } } } //----------------------------------------------------------------- void AgentPack::update() { t_agents::iterator end = m_agents.end(); for (t_agents::iterator i = m_agents.begin(); i != end; ++i) { i->second->update(); } } //----------------------------------------------------------------- /** * Shutdown initialized agents in reverse order. */ void AgentPack::shutdown() { t_agents::reverse_iterator rend = m_agents.rend(); for (t_agents::reverse_iterator i = m_agents.rbegin(); i != rend; ++i) { if (i->second->isInitialized()) { i->second->shutdown(); } } } fillets-ng-1.0.1/src/gengine/TimerAgent.h0000644000175000017500000000117010110076713015104 00000000000000#ifndef HEADER_TIMERAGENT_H #define HEADER_TIMERAGENT_H #include "BaseAgent.h" #include "Name.h" #include "SDL.h" /** * Delay and framerame. */ class TimerAgent : public BaseAgent { AGENT(TimerAgent, Name::TIMER_NAME); private: int m_timeinterval; Uint32 m_lastTime; Uint32 m_nextTime; Uint32 m_deltaTime; int m_count; private: int getTimeInterval(); protected: virtual void own_init(); virtual void own_update(); public: Uint32 getDeltaTime() const { return m_deltaTime; } int getCycles() const { return m_count; } }; #endif fillets-ng-1.0.1/src/gengine/ResSoundPack.cpp0000644000175000017500000000267610214722462015761 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ResSoundPack.h" #include "Path.h" #include "OptionAgent.h" //----------------------------------------------------------------- void ResSoundPack::unloadRes(Mix_Chunk *res) { Mix_FreeChunk(res); } //----------------------------------------------------------------- /** * Load unshared sound from file. * @return sound or NULL */ Mix_Chunk * ResSoundPack::loadSound(const Path &file) { Mix_Chunk *chunk = NULL; //TODO: ask SoundAgent to load this sound if (OptionAgent::agent()->getAsBool("sound", true)) { chunk = Mix_LoadWAV(file.getNative().c_str()); if (NULL == chunk) { LOG_WARNING(ExInfo("cannot load sound") .addInfo("path", file.getNative()) .addInfo("MixError", Mix_GetError())); } } return chunk; } //----------------------------------------------------------------- /** * Store sound under this name. * Nothing is stored when sound cannot be loaded. */ void ResSoundPack::addSound(const std::string &name, const Path &file) { Mix_Chunk *chunk = loadSound(file); if (chunk) { addRes(name, chunk); } } fillets-ng-1.0.1/src/gengine/StringTool.cpp0000644000175000017500000000577411047536057015536 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "StringTool.h" #include #include //----------------------------------------------------------------- /** * Convert string to number. * @param strNum string * @param ok true on sucess * @return number or zero */ long StringTool::readInt(const char *strNum, bool *ok) { long result = 0; *ok = false; if (strNum != NULL) { char *endptr; result = strtol(strNum, &endptr, 0); if (strNum[0] != '\0' && endptr[0] == '\0') { *ok = true; } } if (!ok) { result = 0; } return result; } //----------------------------------------------------------------- /** * Convert long to string * @return string value */ std::string StringTool::toString(long value) { std::ostringstream buffer; buffer << value; return buffer.str(); } //----------------------------------------------------------------- bool StringTool::startsWith(const std::string &str, const std::string &prefix) { return prefix == str.substr(0, prefix.size()); } //----------------------------------------------------------------- /** * Replace one substring with another * @param buffer string to change * @param pattern what replace * @param newstring what to place */ void StringTool::replace(std::string &buffer, const std::string &pattern, const std::string &newstring) { std::string::size_type pos = buffer.find(pattern); while (pos != std::string::npos) { buffer.replace(pos, pattern.size(), newstring); pos = buffer.find(pattern, pos + newstring.size()); } } //----------------------------------------------------------------- /** * Split string. * @return splited segments without separator */ StringTool::t_args StringTool::split(const std::string &str, char separator) { std::string remain = str; t_args args; std::string::size_type pos = remain.find(separator); while (pos != std::string::npos) { args.push_back(remain.substr(0, pos)); remain.erase(0, pos + 1); pos = remain.find(separator); } if (remain.size() > 0) { args.push_back(remain); } return args; } //----------------------------------------------------------------- /** * Return number of Unicode entities inside given UTF-8 text. */ int StringTool::utf8Length(const std::string &str) { int length = 0; const char *p = str.c_str(); char c; // How to recognize entity: // Unicode entities start with 0xxxxxxx or 11xxxxxx, // the other bytes start with 10xxxxxx. // (thanks to Egmont Koblinger) while ((c = *p++) != 0) { if ((c & 0xC0) != 0x80) { length++; } } return length; } fillets-ng-1.0.1/src/gengine/FsPath.h0000644000175000017500000000066610075620342014246 00000000000000#ifndef HEADER_FSPATH_H #define HEADER_FSPATH_H #include /** * File system path. * System dependent operations. */ class FsPath { public: static std::string getNative(const std::string &file); static bool exists(const std::string &file); static std::string join(const std::string &dir, const std::string &file); static void createPath(const std::string &dir); }; #endif fillets-ng-1.0.1/src/gengine/InputAgent.h0000644000175000017500000000130210125660732015126 00000000000000#ifndef HEADER_INPUTAGENT_H #define HEADER_INPUTAGENT_H class KeyBinder; class InputHandler; #include "BaseAgent.h" #include "Name.h" #include "V2.h" #include "SDL.h" /** * Forward input events to handlers. */ class InputAgent : public BaseAgent { AGENT(InputAgent, Name::INPUT_NAME); private: Uint8 *m_keys; KeyBinder *m_keyBinder; InputHandler *m_handler; private: V2 getMouseState(Uint8 *out_buttons); protected: virtual void own_init(); virtual void own_update(); virtual void own_shutdown(); public: void installHandler(InputHandler *handler); KeyBinder *keyBinder() { return m_keyBinder; } }; #endif fillets-ng-1.0.1/src/gengine/OptionParams.cpp0000644000175000017500000000530311214435353016023 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "OptionParams.h" #include "Log.h" #include "Environ.h" #include "LogicException.h" //----------------------------------------------------------------- void OptionParams::addParam(const std::string &name, eType type, const std::string &help) { Param param(type, help); m_params.insert( std::pair(name, param)); int paramSize = name.size() + getType(type).size(); if (paramSize > m_maxSize) { m_maxSize = paramSize; } } //----------------------------------------------------------------- std::string OptionParams::getHelp(const Environ * /*options*/) const { std::string help; t_params::const_iterator end = m_params.end(); for (t_params::const_iterator i = m_params.begin(); i != end; ++i) { int paramSize = i->first.size() + getType(i->second.type).size(); std::string space = std::string(m_maxSize - paramSize, ' '); help += " " + i->first + "=<" + getType(i->second.type) + ">"; help += space + " " + i->second.help + "\n"; } return help; } //----------------------------------------------------------------- std::string OptionParams::getConfig(const Environ *options) const { std::string config; t_params::const_iterator end = m_params.end(); for (t_params::const_iterator i = m_params.begin(); i != end; ++i) { config += i->first + "='" + options->getParam(i->first) + "'\n"; } return config; } //----------------------------------------------------------------- std::string OptionParams::getType(eType type) const { switch (type) { case TYPE_NUMBER: return "number"; case TYPE_BOOLEAN: return "boolean"; case TYPE_STRING: return "string"; case TYPE_PATH: return "path"; default: LOG_WARNING(ExInfo("unknown param type") .addInfo("type", type)); } return "unknown"; } //----------------------------------------------------------------- /** * Throws LogicException when the given option name or value is invalid. */ void OptionParams::checkValidity(const std::string &name, const std::string &/*value*/) const { t_params::const_iterator it = m_params.find(name); if (m_params.end() == it) { throw LogicException(ExInfo("unknown option") .addInfo("name", name)); } //TODO: check value type } fillets-ng-1.0.1/src/gengine/LogicException.h0000644000175000017500000000045610033064516015771 00000000000000#ifndef HEADER_LOGICEXCEPTION_H #define HEADER_LOGICEXCEPTION_H #include "BaseException.h" /** * Exception about program fail. */ class LogicException : public BaseException { public: LogicException(const ExInfo &problem) : BaseException(problem) {} }; #endif fillets-ng-1.0.1/src/gengine/PlannedDialog.cpp0000644000175000017500000000461310125315643016112 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "PlannedDialog.h" #include "Dialog.h" #include "TimerAgent.h" //----------------------------------------------------------------- /** * Structure to store planned dialog. * @param actor who will talk * @param dialog what will talk, shared resource * @param minTime minimal time to talk when sound resource is not available */ PlannedDialog::PlannedDialog(int actor, const Dialog *dialog, int minTime) { m_actor = actor; m_dialog = dialog; m_channel = -1; m_endtime = 0; m_minTime = minTime; } //----------------------------------------------------------------- /** * Run talk. * @param volume sound volume * @param loops numer of loops. 0=play once, 1=play twice, -1=play infinite */ void PlannedDialog::talk(int volume, int loops) { m_channel = m_dialog->talk(volume, loops); if (loops == -1) { m_endtime = 1 << 30; } else { m_endtime = m_minTime * (loops + 1) + TimerAgent::agent()->getCycles(); } } //----------------------------------------------------------------- bool PlannedDialog::equalsActor(int other) const { return m_actor == other; } //----------------------------------------------------------------- /** * Stop talking. */ void PlannedDialog::killTalk() { if (isPlaying()) { Mix_HaltChannel(m_channel); } } //----------------------------------------------------------------- /** * Return true when our channel is playing and * our chunk is the last one on this channel. */ bool PlannedDialog::isPlaying() const { bool result = false; if (m_channel > -1) { if (Mix_Playing(m_channel)) { result = m_dialog->equalSound(Mix_GetChunk(m_channel)); } } return result; } //----------------------------------------------------------------- /** * Return true when is playing or * return true for minimal time according subtitle length. */ bool PlannedDialog::isTalking() const { bool result = false; if (m_channel > -1) { result = isPlaying(); } else { result = m_endtime > TimerAgent::agent()->getCycles(); } return result; } fillets-ng-1.0.1/src/gengine/StringMsg.cpp0000644000175000017500000000112010033064516015312 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "StringMsg.h" //----------------------------------------------------------------- std::string StringMsg::toString() const { std::string result = m_listenerName; result.append("->" + m_name); result.append("(\"" + m_value + "\")"); return result; } fillets-ng-1.0.1/src/gengine/OptionAgent.cpp0000644000175000017500000002575411461622560015654 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "OptionAgent.h" #include "Environ.h" #include "Log.h" #include "Path.h" #include "FsPath.h" #include "ScriptAgent.h" #include "StringTool.h" #include "HelpException.h" #include "LogicException.h" #include "ScriptException.h" #include "OptionParams.h" #include "StringMsg.h" #include "UnknownMsgException.h" #include "minmax.h" #include //getenv #include //strlen #include //setlocale #ifndef LC_MESSAGES #define LC_MESSAGES LC_CTYPE #endif //NOTE: SYSTEM_DATA_DIR is set to "$(datadir)/games/@PACKAGE@" #ifndef SYSTEM_DATA_DIR #define SYSTEM_DATA_DIR "" #endif //NOTE: userdir = $HOME + USER_DATA_DIR #ifndef USER_DATA_DIR #define USER_DATA_DIR ".fillets-ng" #endif const char *OptionAgent::CONFIG_FILE = "script/options.lua"; //----------------------------------------------------------------- /** * Set user and sytem dir * and process "script/options.lua" - this will set user and system paths * and process "script/init.lua". */ void OptionAgent::own_init() { m_environ = new Environ(); prepareVersion(); prepareDataPaths(); prepareLang(); } //----------------------------------------------------------------- /** * Save user config. * Delete left messages. */ void OptionAgent::own_shutdown() { delete m_environ; } //----------------------------------------------------------------- /** * Set program version. */ void OptionAgent::prepareVersion() { #ifdef VERSION setParam("version", VERSION); #else setParam("version", "0.0.1"); #endif #ifdef PACKAGE setParam("package", PACKAGE); #else setParam("package", "A game"); #endif } //----------------------------------------------------------------- /** * Set user and sytem dir options. * Userdir="$HOME/.fillets-ng" or "" */ void OptionAgent::prepareDataPaths() { registerWatcher("systemdir"); registerWatcher("userdir"); OptionAgent::agent()->setParam("systemdir", SYSTEM_DATA_DIR); std::string userdir = ""; const char *home = getenv("HOME"); if (home) { userdir = FsPath::join(home, USER_DATA_DIR); OptionAgent::agent()->setParam("userdir", userdir); } else { readUserConfig(); } } //----------------------------------------------------------------- /** * Prepare user lang option. * For 2-letter lang codes * see http://www.w3.org/WAI/ER/IG/ert/iso639.htm */ void OptionAgent::prepareLang() { setlocale(LC_ALL, ""); //NOTE: '.' will be decimal point for Lua setlocale(LC_NUMERIC, "C"); if (getParam("lang").empty()) { char *form = setlocale(LC_MESSAGES, NULL); if (form) { int size = min(5, strlen(form)); if (size >= 2) { setParam("lang", std::string(form, size)); } } } } //----------------------------------------------------------------- /** * Parse command line options. * Format: $0 [name=value ...] * * @throws LogicException when format is wrong */ void OptionAgent::parseCmdOpt(int argc, char *argv[], const OptionParams ¶ms) { if (argc >= 1) { setParam("program", argv[0]); } for (int i = 1; i < argc; ++i) { if (argv[i][0] == '-') { parseDashOpt(argv[i], params); } else { parseParamOpt(argv[i], params); } } } //----------------------------------------------------------------- /** * Supported options are '-h', '-v'. * @throws HelpException when only help is need * @throws LogicException when used option is unknown */ void OptionAgent::parseDashOpt(const std::string &arg, const OptionParams ¶ms) { if ("-h" == arg || "--help" == arg) { throw HelpException(ExInfo(getHelpInfo(params))); } else if ("-v" == arg || "--version" == arg) { throw HelpException(ExInfo(getVersionInfo())); } else if ("-c" == arg || "--config" == arg) { throw HelpException(ExInfo(params.getConfig(m_environ))); } else { throw LogicException(ExInfo("unknown option") .addInfo("arg", arg) .addInfo("use", getParam("program") + " --help")); } } //----------------------------------------------------------------- void OptionAgent::parseParamOpt(const std::string &arg, const OptionParams ¶ms) { std::string name; std::string value; if (splitOpt(arg, &name, &value)) { params.checkValidity(name, value); setParam(name, value); } else { throw LogicException(ExInfo("unknown option") .addInfo("arg", arg) .addInfo("use", getParam("program") + " --help")); } } //----------------------------------------------------------------- /** * Split "name=value". * @return true for success */ bool OptionAgent::splitOpt(const std::string &option, std::string *out_name, std::string *out_value) { bool result = false; std::string::size_type pos = option.find('='); if (pos != std::string::npos) { if (pos + 1 < option.size()) { *out_name = option.substr(0, pos); *out_value = option.substr(pos + 1, std::string::npos); result = true; } } return result; } //----------------------------------------------------------------- /** * Set param. * Notice watchers. * When watcher is not available, it will be removed. * * @param name param name * @param value param value */ void OptionAgent::setParam(const std::string &name, const std::string &value) { m_environ->setParam(name, value); } //----------------------------------------------------------------- /** * Store this integer value like string param. */ void OptionAgent::setParam(const std::string &name, long value) { m_environ->setParam(name, value); } //----------------------------------------------------------------- /** * Return value. * Implicit value is "". * * @param name param name * @param implicit default value = "" * @return value or implicit value */ std::string OptionAgent::getParam(const std::string &name, const std::string &implicit) const { return m_environ->getParam(name, implicit); } //----------------------------------------------------------------- /** * Returns number value. * Implicit value is zero. * * @param name param name * @param implicit default value = 0 * @return number or implicit */ int OptionAgent::getAsInt(const std::string &name, int implicit) const { return m_environ->getAsInt(name, implicit); } //----------------------------------------------------------------- /** * Returns boolean value. * Implicit value is false. * * @param name param name * @param implicit default value = false * @return stored boolean value or implicit value */ bool OptionAgent::getAsBool(const std::string &name, bool implicit) const { return m_environ->getAsBool(name, implicit); } //----------------------------------------------------------------- /** * Set param also on disk. * Preserve all current params in options file. */ void OptionAgent::setPersistent(const std::string &name, const std::string &value) { //NOTE: path must be created before change of environ Path config = Path::dataWritePath(CONFIG_FILE); Environ *swap_env = m_environ; m_environ = new Environ(); try { if (config.exists()) { ScriptAgent::agent()->scriptInclude(config); } } catch (ScriptException &e) { LOG_WARNING(e.info()); } setParam(name, value); m_environ->store(config); delete m_environ; m_environ = swap_env; setParam(name, value); } //----------------------------------------------------------------- void OptionAgent::setPersistent(const std::string &name, long value) { setPersistent(name, StringTool::toString(value)); } //----------------------------------------------------------------- /** * Set value when it is empty. */ void OptionAgent::setDefault(const std::string &name, const std::string &value) { m_environ->setParam(name, m_environ->getParam(name, value)); } //----------------------------------------------------------------- void OptionAgent::setDefault(const std::string &name, int value) { m_environ->setParam(name, m_environ->getAsInt(name, value)); } //----------------------------------------------------------------- void OptionAgent::addWatcher(const std::string &name, BaseMsg *msg) { m_environ->addWatcher(name, msg); } //----------------------------------------------------------------- void OptionAgent::removeWatchers(const std::string &listenerName) { m_environ->removeWatchers(listenerName); } //----------------------------------------------------------------- /** * Get help text. */ std::string OptionAgent::getHelpInfo(const OptionParams ¶ms) const { std::string help = "Usage: " + getParam("program") + " [options] [name=value ...]\n"; help += " -h, --help Show this help\n"; help += " -v, --version Show version\n"; help += " -c, --config Show config\n"; help += "\n"; help += "Config variables:\n"; help += params.getHelp(m_environ); return help; } //----------------------------------------------------------------- std::string OptionAgent::getVersionInfo() const { return getParam("package") + " " + getParam("version"); } //----------------------------------------------------------------- /** * Handle incoming message. * Messages: * - param_changed(systemdir) ... reread system options * - param_changed(userdir) ... reread user options * * @throws UnknownMsgException */ void OptionAgent::receiveString(const StringMsg *msg) { if (msg->equalsName("param_changed")) { std::string param = msg->getValue(); if ("systemdir" == param) { readSystemConfig(); } else if ("userdir" == param) { readUserConfig(); } else { throw UnknownMsgException(msg); } } else { throw UnknownMsgException(msg); } } //----------------------------------------------------------------- void OptionAgent::readSystemConfig() { try { Path systemConfig = Path::dataSystemPath(CONFIG_FILE); if (systemConfig.exists()) { ScriptAgent::agent()->scriptInclude(systemConfig); } } catch (ScriptException &e) { LOG_WARNING(e.info()); } } //----------------------------------------------------------------- void OptionAgent::readUserConfig() { try { Path userConfig = Path::dataUserPath(CONFIG_FILE); if (userConfig.exists()) { ScriptAgent::agent()->scriptInclude(userConfig); } } catch (ScriptException &e) { LOG_WARNING(e.info()); } } fillets-ng-1.0.1/src/gengine/InputHandler.h0000644000175000017500000000235511212500523015443 00000000000000#ifndef HEADER_INPUTHANDLER_H #define HEADER_INPUTHANDLER_H class KeyStroke; class MouseStroke; #include "NoCopy.h" #include "InputProvider.h" /** * Handle input events. * Events: * - keyEvent() is called when new key is pressed. * - mouseEvent() is called when there is a mouse click. * - mouseState() is called every cycle to update mouse position * * Pressed keys are stored in m_pressed array, this array is shared * and updated by InputAgent. */ class InputHandler : public InputProvider, public NoCopy { private: Uint8 *m_pressed; Uint8 m_buttons; V2 m_mouseLoc; public: InputHandler(); void takePressed(Uint8 *pressed) { m_pressed = pressed; } void mouseState(const V2 &loc, Uint8 buttons); virtual void keyEvent(const KeyStroke &/*stroke*/) {} virtual void keyUp(const KeyStroke &/*stroke*/) {} virtual void mouseEvent(const MouseStroke &/*buttons*/) {} virtual bool isPressed(SDLKey key) const; virtual bool isLeftPressed() const; virtual bool isMiddlePressed() const; virtual bool isRightPressed() const; virtual V2 getMouseLoc() const { return m_mouseLoc; } virtual std::string toString() const; }; #endif fillets-ng-1.0.1/src/gengine/BaseException.cpp0000644000175000017500000000205410033064516016135 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "BaseException.h" #include //----------------------------------------------------------------- /** * Mother of all exception. * * @param exinfo detail info about problem */ BaseException::BaseException(const ExInfo &exinfo) : std::exception(), m_info(exinfo) { /* empty */ } //----------------------------------------------------------------- /** * Return text info. * @return text info, valid with exception live */ const char * BaseException::what() const throw() { return m_info.what(); } //----------------------------------------------------------------- /** * Return detail info. * @return detail info, valid with exception live */ const ExInfo & BaseException::info() const throw() { return m_info; } fillets-ng-1.0.1/src/gengine/NoCopy.h0000644000175000017500000000044610033700234014255 00000000000000#ifndef HEADER_NOCOPY_H #define HEADER_NOCOPY_H /** * Class with private copy constructor and assign operator. */ class NoCopy { private: NoCopy(const NoCopy &) {} void operator=(const NoCopy &) {} public: NoCopy() {} virtual ~NoCopy() {} }; #endif fillets-ng-1.0.1/src/gengine/MessagerAgent.cpp0000644000175000017500000000333110131565271016133 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "MessagerAgent.h" #include "Log.h" #include "BaseMsg.h" #include "BaseListener.h" #include "NameException.h" #include // for auto_ptr //----------------------------------------------------------------- /** * Remember listener under his name. * NOTE: listeners may be added before own_init() * * @param listener listener, borowed pointer */ void MessagerAgent::addListener(BaseListener *listener) { m_listeners[listener->getName()] = listener; } //----------------------------------------------------------------- /** * Forget listener. * @param listenerName listener name */ void MessagerAgent::removeListener(const std::string &listenerName) { m_listeners.erase(listenerName); } //----------------------------------------------------------------- /** * Forward message to her destination. * @param msg message, will be deleted * @throws NameException when listener cannot be found */ void MessagerAgent::forwardNewMsg(BaseMsg *msg) { std::auto_ptr sure_delete(msg); const std::string &listenerName = msg->getListenerName(); LOG_DEBUG(ExInfo("received new message") .addInfo("msg", msg->toString())); t_listeners::iterator it = m_listeners.find(listenerName); if (m_listeners.end() == it) { throw NameException(ExInfo("cannot find listener") .addInfo("name", listenerName)); } msg->sendActual(it->second); } fillets-ng-1.0.1/src/gengine/DialogStack.h0000644000175000017500000000235111265147426015250 00000000000000#ifndef HEADER_DIALOGSTACK_H #define HEADER_DIALOGSTACK_H #define HEADER_DIALOGAGENT_H class Dialog; class ResDialogPack; class PlannedDialog; #include "NoCopy.h" #include #include /** * Stack of running dialogs. */ class DialogStack : public NoCopy { private: ResDialogPack *m_dialogs; typedef std::list t_running; t_running m_running; t_running m_cycling; PlannedDialog *m_activeDialog; private: void removeFirstNotTalking(); bool isTalkingIn(int actor, const t_running &fifo) const; void killSoundIn(int actor, t_running &fifo); void killTalksIn(t_running &fifo); void releaseDialog(PlannedDialog *dialog); public: DialogStack(); virtual ~DialogStack(); void updateStack(); void addDialog(const std::string &name, Dialog *dialog); void actorTalk(int actor, const std::string &name, int volume, int loops=0, bool dialogFlag=false); bool isTalking(int actor) const; void killSound(int actor); bool isDialog() const; bool areRunning() const { return !m_running.empty(); } void killTalks(); void removeAll(); }; #endif fillets-ng-1.0.1/src/gengine/Dialog.h0000644000175000017500000000216210144766434014263 00000000000000#ifndef HEADER_DIALOG_H #define HEADER_DIALOG_H #include "NoCopy.h" #include "StringTool.h" #include "SDL_mixer.h" #include /** * Dialog with sound and subtitle. * Dialog is const class only sound is lazy loaded. */ class Dialog: public NoCopy { public: static const std::string DEFAULT_LANG; private: mutable Mix_Chunk *m_sound; std::string m_soundfile; std::string m_lang; std::string m_subtitle; public: Dialog(const std::string &lang, const std::string &soundfile, const std::string &subtitle); virtual ~Dialog(); bool isSpeechless() const { return m_soundfile.empty(); } int talk(int volume, int loops=0) const; virtual void runSubtitle(const StringTool::t_args &args) const; std::string getLang() const { return m_lang; } std::string getSubtitle() const { return m_subtitle; } std::string getFormatedSubtitle(const StringTool::t_args &args) const; int getMinTime() const; bool equalSound(const Mix_Chunk *other) const { return m_sound == other; } }; #endif fillets-ng-1.0.1/src/gengine/SDLSoundAgent.h0000644000175000017500000000176711373765614015514 00000000000000#ifndef HEADER_SDLSOUNDAGENT_H #define HEADER_SDLSOUNDAGENT_H #include "SoundAgent.h" #include "SDLMusicLooper.h" #include "SDL.h" #include "SDL_mixer.h" #include /** * Sound and music. */ class SDLSoundAgent : public SoundAgent { private: static BaseMsg *ms_finished; Mix_Music *m_music; SDLMusicLooper *m_looper; std::string m_playingPath; int m_soundVolume; int m_musicVolume; private: std::string generateIdName(const Path &file); Mix_Chunk *findChunk(const std::string &name); static void musicFinished(); protected: virtual void own_init(); virtual void own_shutdown(); virtual void reinit(); virtual void setSoundVolume(int volume); virtual void setMusicVolume(int volume); public: virtual int playSound(Mix_Chunk *sound, int volume, int loops=0); virtual void playMusic(const Path &file, BaseMsg *finished); virtual void stopMusic(); }; #endif fillets-ng-1.0.1/src/gengine/BaseMsg.h0000644000175000017500000000155410036364004014374 00000000000000#ifndef HEADER_BASEMSG_H #define HEADER_BASEMSG_H class BaseListener; #include /** * Messgage. */ class BaseMsg { protected: std::string m_listenerName; std::string m_name; public: BaseMsg(const std::string &listenerName, const std::string &name); virtual ~BaseMsg() {} virtual BaseMsg *clone() const = 0; virtual void sendActual(BaseListener *listener) const = 0; void sendClone() const; bool equalsName(const std::string &name) const { return m_name == name; } const std::string &getMsgName() const { return m_name; } const std::string &getListenerName() const { return m_listenerName; } virtual std::string toString() const; }; /** * Allow clone typed message. */ #define CLONE(TYPE) \ virtual TYPE *clone() const { return new TYPE(*this); } #endif fillets-ng-1.0.1/src/gengine/minmax.h0000644000175000017500000000040510037354327014346 00000000000000#ifndef HEADER_MINMAX_H #define HEADER_MINMAX_H /** * Minimum. */ inline int min(int one, int second) { return one <= second ? one : second; } /** * Maximum. */ inline int max(int one, int second) { return one >= second ? one : second; } #endif fillets-ng-1.0.1/src/gengine/SoundAgent.h0000644000175000017500000000144311205763625015132 00000000000000#ifndef HEADER_SOUNDAGENT_H #define HEADER_SOUNDAGENT_H class Path; class BaseMsg; #include "BaseAgent.h" #include "Name.h" #include "IntMsg.h" #include "SDL.h" #include "SDL_mixer.h" #include /** * Sound and music interface. */ class SoundAgent : public BaseAgent { AGENT(SoundAgent, Name::SOUND_NAME); protected: virtual void own_init(); virtual void setSoundVolume(int volume) = 0; virtual void setMusicVolume(int volume) = 0; public: virtual void reinit(); virtual int playSound(Mix_Chunk *sound, int volume, int loops=0) = 0; virtual void playMusic(const Path &file, BaseMsg *finished) = 0; virtual void stopMusic() = 0; void receiveString(const StringMsg *msg); }; #endif fillets-ng-1.0.1/src/gengine/ExInfo.cpp0000644000175000017500000000313110033064516014571 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ExInfo.h" #include "StringTool.h" //----------------------------------------------------------------- /** * Info about problem. * @param problem short info */ ExInfo::ExInfo(const std::string &problem) throw() : m_what(problem) { /* empty */ } //----------------------------------------------------------------- /** * Return info about problem. * @return pointer to info which is valid only with this ExInfo */ const char * ExInfo::what() const throw() { return m_what.c_str(); } //----------------------------------------------------------------- /** * Add more info. * @param name description * @param value value * @return *this */ ExInfo & ExInfo::addInfo(const std::string &name, const std::string &value) throw() { m_what.append("; "); m_what.append(name); m_what.append("='"); m_what.append(value); m_what.append("'"); return *this; } //----------------------------------------------------------------- /** * Add more info, numeric value. * @param name description * @param value value * @return *this */ ExInfo & ExInfo::addInfo(const std::string &name, long value) throw() { m_what.append("; "); m_what.append(name); m_what.append("="); m_what.append(StringTool::toString(value)); return *this; } fillets-ng-1.0.1/src/gengine/BaseAgent.h0000644000175000017500000000226510047024466014713 00000000000000#ifndef HEADER_BASEAGENT_H #define HEADER_BASEAGENT_H #include "NoCopy.h" #include "BaseListener.h" #include "ExInfo.h" #include "NameException.h" #include "AgentPack.h" #include /** * Ancestor for all agents. */ class BaseAgent : public NoCopy, public BaseListener { private: bool m_initialized; protected: virtual void own_init() {} virtual void own_update() {} virtual void own_shutdown() {} public: BaseAgent(); virtual ~BaseAgent() {} bool isInitialized() { return m_initialized; } void init(); void update(); void shutdown(); }; /** * Example: AGENT(VideoAgent, Name::VIDEO_NAME) * * Enables to obtain typed pointer * static VideoAgent *VideoAgent::agent(); */ #define AGENT(TYPE, NAME) \ public: \ virtual const char *getName() const { return (NAME); } \ static TYPE *agent() \ { \ TYPE *result = dynamic_cast(AgentPack::getAgent(sName())); \ if (NULL == result) { \ throw NameException(ExInfo("cannot cast agent") \ .addInfo("name", sName())); \ } \ return result; \ } \ private: \ static const char *sName() { return (NAME); } #endif fillets-ng-1.0.1/src/gengine/Makefile.in0000644000175000017500000005001611632204473014752 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/gengine DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libgengine_a_AR = $(AR) $(ARFLAGS) libgengine_a_LIBADD = am__libgengine_a_SOURCES_DIST = AgentPack.cpp AgentPack.h \ BaseAgent.cpp BaseAgent.h BaseException.cpp BaseException.h \ BaseListener.cpp BaseListener.h BaseMsg.cpp BaseMsg.h \ Dialog.cpp Dialog.h DialogStack.cpp DialogStack.h \ DummySoundAgent.h ExInfo.cpp ExInfo.h INamed.h \ ImgException.cpp ImgException.h InputAgent.cpp InputAgent.h \ IntMsg.cpp IntMsg.h KeyBinder.cpp KeyBinder.h KeyStroke.cpp \ KeyStroke.h Log.cpp Log.h HelpException.h LogicException.h \ MessagerAgent.cpp MessagerAgent.h MixException.cpp \ MixException.h Name.cpp Name.h NameException.h NoCopy.h \ OptionAgent.cpp OptionAgent.h OptionParams.cpp OptionParams.h \ Path.cpp Path.h Random.cpp Random.h ResDialogPack.cpp \ ResDialogPack.h ResImagePack.cpp ResImagePack.h \ ResourceException.h ResourcePack.h ResCache.h SDLException.cpp \ SDLException.h SDLSoundAgent.cpp SDLSoundAgent.h \ SDLMusicLooper.cpp SDLMusicLooper.h ScriptAgent.cpp \ ScriptAgent.h ScriptException.h ScriptState.cpp ScriptState.h \ SimpleMsg.h SoundAgent.cpp SoundAgent.h StringMsg.cpp \ StringMsg.h StringTool.cpp StringTool.h TimerAgent.cpp \ TimerAgent.h UnknownMsgException.h V2.h VideoAgent.cpp \ VideoAgent.h PlannedDialog.cpp PlannedDialog.h minmax.h \ ResSoundPack.cpp ResSoundPack.h Environ.cpp Environ.h \ InputHandler.cpp InputHandler.h InputProvider.h \ MouseStroke.cpp MouseStroke.h def-script.cpp def-script.h \ options-script.cpp options-script.h SysVideo.cpp SysVideo.h \ Drawable.h MultiDrawer.cpp MultiDrawer.h PathException.h \ Scripter.cpp Scripter.h FsPath.h FsPath.cpp FsPath_boost.cpp @WITH_BOOST_FALSE@am__objects_1 = FsPath.$(OBJEXT) @WITH_BOOST_TRUE@am__objects_1 = FsPath_boost.$(OBJEXT) am_libgengine_a_OBJECTS = AgentPack.$(OBJEXT) BaseAgent.$(OBJEXT) \ BaseException.$(OBJEXT) BaseListener.$(OBJEXT) \ BaseMsg.$(OBJEXT) Dialog.$(OBJEXT) DialogStack.$(OBJEXT) \ ExInfo.$(OBJEXT) ImgException.$(OBJEXT) InputAgent.$(OBJEXT) \ IntMsg.$(OBJEXT) KeyBinder.$(OBJEXT) KeyStroke.$(OBJEXT) \ Log.$(OBJEXT) MessagerAgent.$(OBJEXT) MixException.$(OBJEXT) \ Name.$(OBJEXT) OptionAgent.$(OBJEXT) OptionParams.$(OBJEXT) \ Path.$(OBJEXT) Random.$(OBJEXT) ResDialogPack.$(OBJEXT) \ ResImagePack.$(OBJEXT) SDLException.$(OBJEXT) \ SDLSoundAgent.$(OBJEXT) SDLMusicLooper.$(OBJEXT) \ ScriptAgent.$(OBJEXT) ScriptState.$(OBJEXT) \ SoundAgent.$(OBJEXT) StringMsg.$(OBJEXT) StringTool.$(OBJEXT) \ TimerAgent.$(OBJEXT) VideoAgent.$(OBJEXT) \ PlannedDialog.$(OBJEXT) ResSoundPack.$(OBJEXT) \ Environ.$(OBJEXT) InputHandler.$(OBJEXT) MouseStroke.$(OBJEXT) \ def-script.$(OBJEXT) options-script.$(OBJEXT) \ SysVideo.$(OBJEXT) MultiDrawer.$(OBJEXT) Scripter.$(OBJEXT) \ $(am__objects_1) libgengine_a_OBJECTS = $(am_libgengine_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libgengine_a_SOURCES) DIST_SOURCES = $(am__libgengine_a_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ INCLUDES = $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) AM_CPPFLAGS = -DSYSTEM_DATA_DIR=\""@datadir@"\" @WITH_BOOST_FALSE@FSPATH_IMPL = FsPath.cpp @WITH_BOOST_TRUE@FSPATH_IMPL = FsPath_boost.cpp EXTRA_DIST = FsPath.cpp FsPath_boost.cpp noinst_LIBRARIES = libgengine.a libgengine_a_SOURCES = AgentPack.cpp AgentPack.h BaseAgent.cpp \ BaseAgent.h BaseException.cpp BaseException.h BaseListener.cpp \ BaseListener.h BaseMsg.cpp BaseMsg.h Dialog.cpp Dialog.h \ DialogStack.cpp DialogStack.h DummySoundAgent.h ExInfo.cpp \ ExInfo.h INamed.h ImgException.cpp ImgException.h \ InputAgent.cpp InputAgent.h IntMsg.cpp IntMsg.h KeyBinder.cpp \ KeyBinder.h KeyStroke.cpp KeyStroke.h Log.cpp Log.h \ HelpException.h LogicException.h MessagerAgent.cpp \ MessagerAgent.h MixException.cpp MixException.h Name.cpp \ Name.h NameException.h NoCopy.h OptionAgent.cpp OptionAgent.h \ OptionParams.cpp OptionParams.h Path.cpp Path.h Random.cpp \ Random.h ResDialogPack.cpp ResDialogPack.h ResImagePack.cpp \ ResImagePack.h ResourceException.h ResourcePack.h ResCache.h \ SDLException.cpp SDLException.h SDLSoundAgent.cpp \ SDLSoundAgent.h SDLMusicLooper.cpp SDLMusicLooper.h \ ScriptAgent.cpp ScriptAgent.h ScriptException.h \ ScriptState.cpp ScriptState.h SimpleMsg.h SoundAgent.cpp \ SoundAgent.h StringMsg.cpp StringMsg.h StringTool.cpp \ StringTool.h TimerAgent.cpp TimerAgent.h UnknownMsgException.h \ V2.h VideoAgent.cpp VideoAgent.h PlannedDialog.cpp \ PlannedDialog.h minmax.h ResSoundPack.cpp ResSoundPack.h \ Environ.cpp Environ.h InputHandler.cpp InputHandler.h \ InputProvider.h MouseStroke.cpp MouseStroke.h def-script.cpp \ def-script.h options-script.cpp options-script.h SysVideo.cpp \ SysVideo.h Drawable.h MultiDrawer.cpp MultiDrawer.h \ PathException.h Scripter.cpp Scripter.h FsPath.h \ $(FSPATH_IMPL) all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gengine/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/gengine/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libgengine.a: $(libgengine_a_OBJECTS) $(libgengine_a_DEPENDENCIES) -rm -f libgengine.a $(libgengine_a_AR) libgengine.a $(libgengine_a_OBJECTS) $(libgengine_a_LIBADD) $(RANLIB) libgengine.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/AgentPack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BaseAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BaseException.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BaseListener.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BaseMsg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Dialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DialogStack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Environ.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ExInfo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FsPath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FsPath_boost.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ImgException.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InputAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/InputHandler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IntMsg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KeyBinder.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KeyStroke.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MessagerAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MixException.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MouseStroke.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MultiDrawer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Name.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OptionAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OptionParams.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Path.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PlannedDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Random.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResDialogPack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResImagePack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ResSoundPack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SDLException.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SDLMusicLooper.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SDLSoundAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScriptAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScriptState.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Scripter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SoundAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringMsg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StringTool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SysVideo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TimerAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VideoAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/def-script.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options-script.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am #NOTE: OptionAgent depends on SYSTEM_DATA_DIR OptionAgent.o: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/gengine/ScriptAgent.h0000644000175000017500000000110210373623377015302 00000000000000#ifndef HEADER_SCRIPTAGENT_H #define HEADER_SCRIPTAGENT_H class Path; class ScriptState; #include "BaseAgent.h" #include "Name.h" #include "Scripter.h" #include extern "C" { #include "lua.h" } /** * Global scripting. * It is used by OptionAgent and debug console. */ class ScriptAgent : public BaseAgent, public Scripter { AGENT(ScriptAgent, Name::SCRIPT_NAME); protected: virtual void own_init(); public: void registerFunc(const char *name, lua_CFunction func); virtual void receiveString(const StringMsg *msg); }; #endif fillets-ng-1.0.1/src/gengine/SysVideo.h0000644000175000017500000000032710103147555014622 00000000000000#ifndef HEADER_SYSVIDEO_H #define HEADER_SYSVIDEO_H #include /** * System dependend video functions. */ class SysVideo { public: static void setCaption(const std::string &title); }; #endif fillets-ng-1.0.1/src/gengine/SDLMusicLooper.cpp0000644000175000017500000001002211373763423016215 00000000000000/* * Copyright (C) 2010 Brian Raiter * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SDLMusicLooper.h" #include "Path.h" #include "StringTool.h" #include "Log.h" #include //memset //----------------------------------------------------------------- /** * Initialize the player for a specific piece of music. */ SDLMusicLooper::SDLMusicLooper(const Path &file) : m_volume(MIX_MAX_VOLUME), m_position(0) { Uint16 fmt; int freq, channels; Mix_QuerySpec(&freq, &fmt, &channels); int sampleSize = fmt == AUDIO_S8 || fmt == AUDIO_U8 ? 1 : 2; m_music = Mix_LoadWAV(file.getNative().c_str()); if (m_music) { lookupLoopData(file, sampleSize * channels * freq / 22050); } else { LOG_WARNING(ExInfo("cannot play music") .addInfo("music", file.getNative()) .addInfo("Mix", Mix_GetError())); } } //----------------------------------------------------------------- SDLMusicLooper::~SDLMusicLooper() { stop(); if (m_music) { Mix_FreeChunk(m_music); } } //----------------------------------------------------------------- void SDLMusicLooper::setVolume(int volume) { m_volume = volume; if (m_volume > MIX_MAX_VOLUME) { m_volume = MIX_MAX_VOLUME; } else if (m_volume < 0) { m_volume = 0; } } //----------------------------------------------------------------- void SDLMusicLooper::start() { if (m_music) { Mix_HookMusic(musicOutput, (void*)this); } } //----------------------------------------------------------------- void SDLMusicLooper::stop() { Mix_HookMusic(NULL, NULL); } //----------------------------------------------------------------- /** * Check for a loop associated with this filename. If not, then * loop over the entire chunk. * * In the original game, the music loop definitions were stored as metadata * inside the sampler chunk of the WAV files. * Now we store them in *.ogg.meta. * * File format: * loop_start * loop_end */ void SDLMusicLooper::lookupLoopData(const Path &file, int multiplier) { m_startLoop = 0; m_endLoop = m_music->alen; std::string metafile = file.getNative() + ".meta"; char buffer[1024]; memset(buffer, 0, sizeof(buffer)); FILE *meta = fopen(metafile.c_str(), "r"); if(!meta) { return; } if (!fread(&buffer, 1, sizeof(buffer) - 1, meta)) { LOG_WARNING(ExInfo("unable to read music meta data") .addInfo("file", metafile)); return; } StringTool::t_args lines = StringTool::split(buffer, '\n'); if (lines.size() < 2) { LOG_WARNING(ExInfo("unrecognized music meta data format") .addInfo("file", metafile)); return; } m_startLoop = strtol(lines[0].c_str(), NULL, 10) * multiplier; m_endLoop = strtol(lines[1].c_str(), NULL, 10) * multiplier; if ((unsigned int)m_endLoop > m_music->alen) { m_endLoop = m_music->alen; } LOG_DEBUG(ExInfo("looping music") .addInfo("start", m_startLoop / multiplier) .addInfo("end", m_endLoop / multiplier)); } //----------------------------------------------------------------- /** * Callback function that provides the music data to the mixer. */ void SDLMusicLooper::musicOutput(void *udata, Uint8 *stream, int length) { SDLMusicLooper *that = (SDLMusicLooper*)udata; int n; memset(stream, 0, length); while (length >= that->m_endLoop - that->m_position) { n = that->m_endLoop - that->m_position; SDL_MixAudio(stream, that->m_music->abuf + that->m_position, n, that->m_volume); stream += n; length -= n; that->m_position = that->m_startLoop; } SDL_MixAudio(stream, that->m_music->abuf + that->m_position, length, that->m_volume); that->m_position += length; } fillets-ng-1.0.1/src/gengine/KeyStroke.cpp0000644000175000017500000000413010111137225015314 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "KeyStroke.h" #include "StringTool.h" //----------------------------------------------------------------- /** * Create new keystroke from event. */ KeyStroke::KeyStroke(const SDL_keysym &keysym) { m_sym = keysym.sym; m_mod = modStrip(keysym.mod); m_unicode = keysym.unicode; } //----------------------------------------------------------------- /** * Create new keystroke. * NOTE: KMOD_ALT mean (KMOD_LALT and KMOD_RALT), * i.e. either ALTs pressed! * * @param sym SDLKey * @param mod SDLMod ored */ KeyStroke::KeyStroke(SDLKey sym, int mod) { m_sym = sym; m_mod = modStrip(mod); m_unicode = 0; } //----------------------------------------------------------------- /** * Strip ignored modes. * KMOD_SHIFT|KMOD_NUM|KMOD_CAPS|KMOD_MODE are ignored. */ int KeyStroke::modStrip(int mod) { return mod & ~STROKE_IGNORE; } //----------------------------------------------------------------- /** * KeyStroke comparation. * * @param other other keystroke * @return this < other */ bool KeyStroke::less(const KeyStroke &other) const { bool result = m_sym < other.m_sym; if (m_sym == other.m_sym) { result = m_mod < other.m_mod; } return result; } //----------------------------------------------------------------- /** * Test keyStroke equality. * KMOD_NUM|KMOD_CAPS|KMOD_MODE are ignored. * * @param other other keystroke * @return this == other */ bool KeyStroke::equals(const KeyStroke &other) const { return m_sym == other.m_sym && m_mod == other.m_mod; } //----------------------------------------------------------------- /** * Return text fashion. */ std::string KeyStroke::toString() const { std::string result = SDL_GetKeyName(m_sym); result.append("+" + StringTool::toString(m_mod)); return result; } fillets-ng-1.0.1/src/gengine/V2.h0000644000175000017500000000213710301727627013351 00000000000000#ifndef HEADER_V2_H #define HEADER_V2_H #include "StringTool.h" #include #include /** * Vector x,y. * Constant object. */ class V2 { private: int m_x; int m_y; public: V2(int x, int y) { m_x = x; m_y = y; } inline int getX() const { return m_x; } inline int getY() const { return m_y; } V2 plus(const V2 &other) const { return V2(m_x + other.m_x, m_y + other.m_y); } V2 minus(const V2 &other) const { return V2(m_x - other.m_x, m_y - other.m_y); } V2 scale(int rate) const { return V2(m_x * rate, m_y * rate); } V2 shrink(int rate) const { assert(rate != 0); return V2(m_x / rate, m_y / rate); } bool equals(const V2 &other) { return m_x == other.m_x && m_y == other.m_y; } std::string toString() const { return "[" + StringTool::toString(m_x) + "," + StringTool::toString(m_y) + "]"; } }; #endif fillets-ng-1.0.1/src/gengine/InputProvider.h0000644000175000017500000000104510125665032015664 00000000000000#ifndef HEADER_INPUTPROVIDER_H #define HEADER_INPUTPROVIDER_H #include "V2.h" #include "SDL.h" #include /** * Interface to pressed keys and mouse location. */ class InputProvider { public: virtual ~InputProvider() {} virtual bool isPressed(SDLKey key) const = 0; virtual bool isLeftPressed() const = 0; virtual bool isRightPressed() const = 0; virtual bool isMiddlePressed() const = 0; virtual V2 getMouseLoc() const = 0; virtual std::string toString() const = 0; }; #endif fillets-ng-1.0.1/src/gengine/Name.h0000644000175000017500000000100010117317527013725 00000000000000#ifndef HEADER_NAME_H #define HEADER_NAME_H /** * Contains agent names. */ class Name { public: static const char *APP_NAME; static const char *MESSAGER_NAME; static const char *SCRIPT_NAME; static const char *OPTION_NAME; static const char *VIDEO_NAME; static const char *SOUND_NAME; static const char *TIMER_NAME; static const char *INPUT_NAME; static const char *SUBTITLE_NAME; static const char *GAME_NAME; }; #endif fillets-ng-1.0.1/src/gengine/PathException.h0000644000175000017500000000046510075620342015631 00000000000000#ifndef HEADER_PATHEXCEPTION_H #define HEADER_PATHEXCEPTION_H #include "BaseException.h" /** * Exception about filename and filesystem. */ class PathException : public BaseException { public: PathException(const ExInfo &problem) : BaseException(problem) {} }; #endif fillets-ng-1.0.1/src/gengine/BaseException.h0000644000175000017500000000067110033064516015605 00000000000000#ifndef HEADER_BASEEXCEPTION_H #define HEADER_BASEEXCEPTION_H #include "ExInfo.h" #include /** * Generic exception. */ class BaseException : public std::exception { private: ExInfo m_info; public: explicit BaseException(const ExInfo &exinfo); virtual ~BaseException() throw() {} virtual const char *what() const throw(); virtual const ExInfo &info() const throw(); }; #endif fillets-ng-1.0.1/src/gengine/SDLMusicLooper.h0000644000175000017500000000115111373744274015670 00000000000000#ifndef HEADER_SDLMUSICLOOPER_H #define HEADER_SDLMUSICLOOPER_H class Path; #include "SDL.h" #include "SDL_mixer.h" /** * Playing music in a loop. */ class SDLMusicLooper { private: int m_volume; int m_position; Mix_Chunk *m_music; int m_startLoop, m_endLoop; private: void lookupLoopData(const Path &file, int multiplier); static void musicOutput(void *udata, Uint8 *stream, int length); public: SDLMusicLooper(const Path &file); virtual ~SDLMusicLooper(); void setVolume(int volume); void start(); void stop(); }; #endif fillets-ng-1.0.1/src/gengine/options-script.cpp0000644000175000017500000000422710125025230016375 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "options-script.h" #include "OptionAgent.h" #include "MessagerAgent.h" #include "StringMsg.h" #include "IntMsg.h" #include "SimpleMsg.h" #include "def-script.h" //----------------------------------------------------------------- /** * void sendMsg(listener, msg, [value]) */ int script_options_sendMsg(lua_State *L) throw() { BEGIN_NOEXCEPTION; BaseMsg *message = NULL; const char *listener = luaL_checkstring(L, 1); const char *msg = luaL_checkstring(L, 2); if (lua_isstring(L, 3)) { const char *string_value = luaL_checkstring(L, 3); message = new StringMsg(listener, msg, string_value); } else if (lua_isnumber(L, 3)) { int int_value = luaL_checkint(L, 3); message = new IntMsg(listener, msg, int_value); } else { message = new SimpleMsg(listener, msg); } MessagerAgent::agent()->forwardNewMsg(message); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void setParam(name, value) */ int script_options_setParam(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *name = luaL_checkstring(L, 1); const char *value = lua_tostring(L, 2); if (!value) { value = luaL_checkstring(L, 2); } OptionAgent::agent()->setParam(name, value); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * string getParam(name) * Returns string or nil. */ int script_options_getParam(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *name = luaL_checkstring(L, 1); std::string value = OptionAgent::agent()->getParam(name); if (value.empty()) { lua_pushnil(L); } else { lua_pushlstring(L, value.c_str(), value.size()); } END_NOEXCEPTION; //NOTE: return value return 1; } fillets-ng-1.0.1/src/gengine/def-script.h0000644000175000017500000000126410125025230015103 00000000000000#ifndef HEADER_DEF_SCRIPT_H #define HEADER_DEF_SCRIPT_H class Scripter; #include "Log.h" #include extern "C" { #include "lua.h" #include "lauxlib.h" } //NOTE: no one exception can be passed to "C" lua code #define BEGIN_NOEXCEPTION try { #define END_NOEXCEPTION \ } \ catch (std::exception &e) { \ luaL_error(L, e.what()); \ } \ catch (...) { \ luaL_error(L, "unknown exception"); \ } inline const char *script_getLeaderName() { return "script_leader"; } extern Scripter *script_getLeader(lua_State *L); extern int script_debugStack(lua_State *L); extern int script_file_include(lua_State *L) throw(); extern int script_file_exists(lua_State *L) throw(); #endif fillets-ng-1.0.1/src/gengine/ExInfo.h0000644000175000017500000000102010045764346014244 00000000000000#ifndef HEADER_EXINFO_H #define HEADER_EXINFO_H #include "ExInfo.h" #include /** * Detailed info. */ class ExInfo { private: std::string m_what; public: explicit ExInfo(const std::string &problem) throw(); const char *what() const throw(); std::string info() const throw() { return m_what; } ExInfo &addInfo(const std::string &name, const std::string &value) throw(); ExInfo &addInfo(const std::string &name, long value) throw(); }; #endif fillets-ng-1.0.1/src/gengine/Random.cpp0000644000175000017500000000260311212531126014620 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Random.h" #include #include unsigned char Random::ms_randArray[]; //---------------------------------------------------------- /** * Init random generator. */ void Random::init() { srand( static_cast(time(NULL)) ); for (int i = 0; i < ARRAY_SIZE; ++i) { ms_randArray[i] = randomInt(256); } } //----------------------------------------------------------------- /* * Return number from interval <0,bound). */ int Random::randomInt(int bound) { if (bound == 0) { return 0; } return rand() % bound; } //----------------------------------------------------------------- /* * Return real number from interval <0,bound). */ double Random::randomReal(double bound) { return bound * rand() / (RAND_MAX + 1.0); } //----------------------------------------------------------------- /** * Return a value from interval <0,255>. * @param index index of byte, the byte at a index is alway the same */ unsigned char Random::aByte(unsigned int index) { return ms_randArray[index % ARRAY_SIZE]; } fillets-ng-1.0.1/src/gengine/MouseStroke.cpp0000644000175000017500000000144210104741577015674 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "MouseStroke.h" #include "StringTool.h" //----------------------------------------------------------------- /** * Create new stroke from MouseButtonEvent. */ MouseStroke::MouseStroke(const SDL_MouseButtonEvent &event) : m_loc(event.x, event.y) { m_button = event.button; } //----------------------------------------------------------------- /** * Return text fashion. */ std::string MouseStroke::toString() const { return StringTool::toString(m_button); } fillets-ng-1.0.1/src/gengine/MixException.cpp0000644000175000017500000000120210033064516016012 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "MixException.h" #include "SDL_mixer.h" //----------------------------------------------------------------- /** * Add Mix_GetError to info. * @param problem detail info */ MixException::MixException(const ExInfo &problem) : BaseException(ExInfo(problem).addInfo("Mix", Mix_GetError())) { /* empty */ } fillets-ng-1.0.1/src/gengine/Makefile.am0000644000175000017500000000342611373766717014764 00000000000000 INCLUDES = $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) AM_CPPFLAGS = -DSYSTEM_DATA_DIR=\""@datadir@"\" if WITH_BOOST FSPATH_IMPL = FsPath_boost.cpp else FSPATH_IMPL = FsPath.cpp endif EXTRA_DIST = FsPath.cpp FsPath_boost.cpp noinst_LIBRARIES = libgengine.a libgengine_a_SOURCES = AgentPack.cpp AgentPack.h BaseAgent.cpp BaseAgent.h BaseException.cpp BaseException.h BaseListener.cpp BaseListener.h BaseMsg.cpp BaseMsg.h Dialog.cpp Dialog.h DialogStack.cpp DialogStack.h DummySoundAgent.h ExInfo.cpp ExInfo.h INamed.h ImgException.cpp ImgException.h InputAgent.cpp InputAgent.h IntMsg.cpp IntMsg.h KeyBinder.cpp KeyBinder.h KeyStroke.cpp KeyStroke.h Log.cpp Log.h HelpException.h LogicException.h MessagerAgent.cpp MessagerAgent.h MixException.cpp MixException.h Name.cpp Name.h NameException.h NoCopy.h OptionAgent.cpp OptionAgent.h OptionParams.cpp OptionParams.h Path.cpp Path.h Random.cpp Random.h ResDialogPack.cpp ResDialogPack.h ResImagePack.cpp ResImagePack.h ResourceException.h ResourcePack.h ResCache.h SDLException.cpp SDLException.h SDLSoundAgent.cpp SDLSoundAgent.h SDLMusicLooper.cpp SDLMusicLooper.h ScriptAgent.cpp ScriptAgent.h ScriptException.h ScriptState.cpp ScriptState.h SimpleMsg.h SoundAgent.cpp SoundAgent.h StringMsg.cpp StringMsg.h StringTool.cpp StringTool.h TimerAgent.cpp TimerAgent.h UnknownMsgException.h V2.h VideoAgent.cpp VideoAgent.h PlannedDialog.cpp PlannedDialog.h minmax.h ResSoundPack.cpp ResSoundPack.h Environ.cpp Environ.h InputHandler.cpp InputHandler.h InputProvider.h MouseStroke.cpp MouseStroke.h def-script.cpp def-script.h options-script.cpp options-script.h SysVideo.cpp SysVideo.h Drawable.h MultiDrawer.cpp MultiDrawer.h PathException.h Scripter.cpp Scripter.h FsPath.h $(FSPATH_IMPL) #NOTE: OptionAgent depends on SYSTEM_DATA_DIR OptionAgent.o: Makefile fillets-ng-1.0.1/src/gengine/ResImagePack.cpp0000644000175000017500000000504411214435121015675 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ResImagePack.h" #include "Path.h" #include "ImgException.h" #include "SDLException.h" #include "OptionAgent.h" #include "Log.h" #include "SDL_image.h" // The set cache size allows to contain all fish images and animations // from level 'barrel'. ResCache *ResImagePack::CACHE = new ResCache( 265, new ResImagePack(false)); //----------------------------------------------------------------- ResImagePack::ResImagePack(bool caching_enabled) { m_caching_enabled = false; if (caching_enabled) { m_caching_enabled = OptionAgent::agent()->getAsBool( "cache_images", true); } } //----------------------------------------------------------------- /** * Load unshared image from file * and convert image to diplayformat. * * @return loaded surface * @throws ImgException when image cannot be loaded * @throws SDLException when image cannot be converted */ SDL_Surface * ResImagePack::loadImage(const Path &file) { SDL_Surface *raw_image = IMG_Load(file.getNative().c_str()); if (NULL == raw_image) { throw ImgException(ExInfo("Load") .addInfo("file", file.getNative())); } SDL_Surface *surface = SDL_DisplayFormatAlpha(raw_image); if (NULL == surface) { throw SDLException(ExInfo("DisplayFormat") .addInfo("file", file.getNative())); } SDL_FreeSurface(raw_image); return surface; } //----------------------------------------------------------------- /** * Store image from file. * * @throws ImgException when image cannot be loaded * @throws SDLException when image cannot be converted */ void ResImagePack::addImage(const std::string &name, const Path &file) { SDL_Surface *surface; if (m_caching_enabled) { surface = CACHE->get(file.getPosixName()); if (!surface) { surface = loadImage(file); CACHE->put(file.getPosixName(), surface); } } else { surface = loadImage(file); } addRes(name, surface); } //----------------------------------------------------------------- void ResImagePack::unloadRes(SDL_Surface *res) { if (m_caching_enabled) { CACHE->release(res); } else { SDL_FreeSurface(res); } } fillets-ng-1.0.1/src/gengine/NameException.h0000644000175000017500000000044710033064516015614 00000000000000#ifndef HEADER_NAMEEXCEPTION_H #define HEADER_NAMEEXCEPTION_H #include "BaseException.h" /** * Exception about name fail. */ class NameException : public BaseException { public: NameException(const ExInfo &problem) : BaseException(problem) {} }; #endif fillets-ng-1.0.1/src/gengine/MultiDrawer.h0000644000175000017500000000072410103147555015315 00000000000000#ifndef HEADER_MULTIDRAWER_H #define HEADER_MULTIDRAWER_H #include "Drawable.h" #include /** * Container for pasive drawers. */ class MultiDrawer : public Drawable { private: typedef std::vector t_drawers; t_drawers m_drawers; public: void acceptDrawer(Drawable *drawer); void removeDrawer(const Drawable *drawer); void removeAll(); virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/gengine/VideoAgent.cpp0000644000175000017500000001403311422377547015447 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "VideoAgent.h" #include "Log.h" #include "Path.h" #include "ImgException.h" #include "SDLException.h" #include "LogicException.h" #include "AgentPack.h" #include "SimpleMsg.h" #include "StringMsg.h" #include "UnknownMsgException.h" #include "OptionAgent.h" #include "SysVideo.h" #include "SDL_image.h" #include // atexit() //----------------------------------------------------------------- /** * Init SDL and grafic window. * Register watcher for "fullscren" and "screen_*" options. * @throws SDLException if there is no usuable video mode */ void VideoAgent::own_init() { m_screen = NULL; m_fullscreen = false; if (SDL_Init(SDL_INIT_VIDEO) < 0) { throw SDLException(ExInfo("Init")); } atexit(SDL_Quit); setIcon(Path::dataReadPath("images/icon.png")); registerWatcher("fullscreen"); initVideoMode(); } //----------------------------------------------------------------- /** * Draw all drawer from list. * First will be drawed first. */ void VideoAgent::own_update() { drawOn(m_screen); SDL_Flip(m_screen); } //----------------------------------------------------------------- /** * Shutdown SDL. */ void VideoAgent::own_shutdown() { SDL_Quit(); } //----------------------------------------------------------------- /** * Load and set icon. * @throws ImgException */ void VideoAgent::setIcon(const Path &file) { SDL_Surface *icon = IMG_Load(file.getNative().c_str()); if (NULL == icon) { throw ImgException(ExInfo("Load") .addInfo("file", file.getNative())); } SDL_WM_SetIcon(icon, NULL); SDL_FreeSurface(icon); } //----------------------------------------------------------------- /** * Init video mode along options. * Change window only when necessary. * * @throws SDLException when video mode cannot be made, * the old video mode remain usable */ void VideoAgent::initVideoMode() { OptionAgent *options = OptionAgent::agent(); int screen_width = options->getAsInt("screen_width", 640); int screen_height = options->getAsInt("screen_height", 480); SysVideo::setCaption(options->getParam("caption", "A game")); if (NULL == m_screen || m_screen->w != screen_width || m_screen->h != screen_height) { changeVideoMode(screen_width, screen_height); } } //----------------------------------------------------------------- /** * Init new video mode. * NOTE: m_screen pointer will change */ void VideoAgent::changeVideoMode(int screen_width, int screen_height) { OptionAgent *options = OptionAgent::agent(); int screen_bpp = options->getAsInt("screen_bpp", 32); int videoFlags = getVideoFlags(); m_fullscreen = options->getAsBool("fullscreen", false); if (m_fullscreen) { videoFlags |= SDL_FULLSCREEN; } //TODO: check VideoModeOK and available ListModes SDL_Surface *newScreen = SDL_SetVideoMode(screen_width, screen_height, screen_bpp, videoFlags); if (NULL == newScreen && (videoFlags & SDL_FULLSCREEN)) { LOG_WARNING(ExInfo("unable to use fullscreen resolution, trying windowed") .addInfo("width", screen_width) .addInfo("height", screen_height) .addInfo("bpp", screen_bpp)); videoFlags = videoFlags & ~SDL_FULLSCREEN; newScreen = SDL_SetVideoMode(screen_width, screen_height, screen_bpp, videoFlags); } if (newScreen) { m_screen = newScreen; //NOTE: must be two times to change MouseState SDL_WarpMouse(screen_width / 2, screen_height / 2); SDL_WarpMouse(screen_width / 2, screen_height / 2); } else { throw SDLException(ExInfo("SetVideoMode") .addInfo("width", screen_width) .addInfo("height", screen_height) .addInfo("bpp", screen_bpp)); } } //----------------------------------------------------------------- /** * Obtain video information about best video mode. * @return best video flags */ int VideoAgent::getVideoFlags() { int videoFlags = 0; videoFlags |= SDL_HWPALETTE; videoFlags |= SDL_ANYFORMAT; videoFlags |= SDL_SWSURFACE; return videoFlags; } //----------------------------------------------------------------- /** * Toggle fullscreen. */ void VideoAgent::toggleFullScreen() { int success = SDL_WM_ToggleFullScreen(m_screen); if (success) { m_fullscreen = !m_fullscreen; } else { //NOTE: some platforms need reinit video changeVideoMode(m_screen->w, m_screen->h); } } //----------------------------------------------------------------- /** * Handle incoming message. * Messages: * - fullscreen ... toggle fullscreen * * @throws UnknownMsgException */ void VideoAgent::receiveSimple(const SimpleMsg *msg) { if (msg->equalsName("fullscreen")) { OptionAgent *options = OptionAgent::agent(); bool toggle = !(options->getAsBool("fullscreen")); options->setPersistent("fullscreen", toggle); } else { throw UnknownMsgException(msg); } } //----------------------------------------------------------------- /** * Handle incoming message. * Messages: * - param_changed(fullscreen) ... handle fullscreen * * @throws UnknownMsgException */ void VideoAgent::receiveString(const StringMsg *msg) { if (msg->equalsName("param_changed")) { std::string param = msg->getValue(); if ("fullscreen" == param) { bool fs = OptionAgent::agent()->getAsBool("fullscreen"); if (fs != m_fullscreen) { toggleFullScreen(); } } else { throw UnknownMsgException(msg); } } else { throw UnknownMsgException(msg); } } fillets-ng-1.0.1/src/gengine/IntMsg.cpp0000644000175000017500000000116510033064516014607 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "IntMsg.h" #include "StringTool.h" //----------------------------------------------------------------- std::string IntMsg::toString() const { std::string result = m_listenerName; result.append("->" + m_name); result.append("(" + StringTool::toString(m_value) + ")"); return result; } fillets-ng-1.0.1/src/gengine/SoundAgent.cpp0000644000175000017500000000346711205763516015474 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SoundAgent.h" #include "OptionAgent.h" #include "StringMsg.h" #include "UnknownMsgException.h" //----------------------------------------------------------------- /** * Set sound and music volume. */ void SoundAgent::own_init() { reinit(); registerWatcher("volume_sound"); registerWatcher("volume_music"); } //----------------------------------------------------------------- /** * Reininitalize the sound system. */ void SoundAgent::reinit() { OptionAgent *options = OptionAgent::agent(); options->setDefault("volume_sound", 90); options->setDefault("volume_music", 50); setSoundVolume(options->getAsInt("volume_sound")); setMusicVolume(options->getAsInt("volume_music")); } //----------------------------------------------------------------- /** * Handle incoming message. * Messages: * - param_changed(volume_sound) ... set sound volume * - param_changed(volume_music) ... set music volume * * @throws UnknownMsgException */ void SoundAgent::receiveString(const StringMsg *msg) { if (msg->equalsName("param_changed")) { std::string param = msg->getValue(); if ("volume_sound" == param) { int volume = OptionAgent::agent()->getAsInt("volume_sound"); setSoundVolume(volume); } else if ("volume_music" == param) { int volume = OptionAgent::agent()->getAsInt("volume_music"); setMusicVolume(volume); } } else { throw UnknownMsgException(msg); } } fillets-ng-1.0.1/src/gengine/Environ.h0000644000175000017500000000211110214722462014465 00000000000000#ifndef HEADER_ENVIRON_H #define HEADER_ENVIRON_H class Path; class BaseMsg; #include "NoCopy.h" #include #include /** * Params. */ class Environ : public NoCopy { private: typedef std::map t_values; typedef std::multimap t_watchers; t_values m_values; t_watchers m_watchers; public: virtual ~Environ(); void store(const Path &file); void setParam(const std::string &name, const std::string &value); void setParam(const std::string &name, long value); std::string getParam(const std::string &name, const std::string &implicit="") const; int getAsInt(const std::string &name, int implicit=0) const; bool getAsBool(const std::string &name, bool implicit=false) const; void addWatcher(const std::string &name, BaseMsg *msg); void removeWatchers(const std::string &listenerName); std::string toString() const; std::string getHelpInfo() const; }; #endif fillets-ng-1.0.1/src/gengine/def-script.cpp0000644000175000017500000000734710125025230015446 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "def-script.h" #include "Path.h" #include "Scripter.h" //----------------------------------------------------------------- Scripter * script_getLeader(lua_State *L) { lua_pushstring(L, script_getLeaderName()); lua_rawget(L, LUA_REGISTRYINDEX); if (lua_isnil(L, -1)) { luaL_error(L, ExInfo("no leader") .addInfo("key", script_getLeaderName()).what()); } luaL_checktype(L, -1, LUA_TLIGHTUSERDATA); Scripter *result = static_cast(lua_touserdata(L, -1)); lua_pop(L, 1); return result; } //----------------------------------------------------------------- /** * char *debugStack(error_message) */ int script_debugStack(lua_State *L) { //NOTE: stolen from "lua/ldblib.c" /* size of the first part of the stack */ static const int LEVELS1 = 12; /* size of the second part of the stack */ static const int LEVELS2 = 10; int level = 1; /* skip level 0 (it's this function) */ int firstpart = 1; /* still before eventual `...' */ lua_Debug ar; if (lua_gettop(L) == 0) lua_pushliteral(L, ""); else if (!lua_isstring(L, 1)) return 1; /* no string message */ else lua_pushliteral(L, "\n"); lua_pushliteral(L, "stack traceback:"); while (lua_getstack(L, level++, &ar)) { if (level > LEVELS1 && firstpart) { /* no more than `LEVELS2' more levels? */ if (!lua_getstack(L, level+LEVELS2, &ar)) level--; /* keep going */ else { lua_pushliteral(L, "\n\t..."); /* too many levels */ while (lua_getstack(L, level+LEVELS2, &ar)) /* find last levels */ level++; } firstpart = 0; continue; } lua_pushliteral(L, "\n\t"); lua_getinfo(L, "Snl", &ar); lua_pushfstring(L, "%s:", ar.short_src); if (ar.currentline > 0) lua_pushfstring(L, "%d:", ar.currentline); switch (*ar.namewhat) { case 'g': /* global */ case 'l': /* local */ case 'f': /* field */ case 'm': /* method */ lua_pushfstring(L, " in function `%s'", ar.name); break; default: { if (*ar.what == 'm') /* main? */ lua_pushfstring(L, " in main chunk"); else if (*ar.what == 'C' || *ar.what == 't') lua_pushliteral(L, " ?"); /* C function or tail call */ else lua_pushfstring(L, " in function <%s:%d>", ar.short_src, ar.linedefined); } } lua_concat(L, lua_gettop(L)); } lua_concat(L, lua_gettop(L)); //NOTE: return debug_message return 1; } //----------------------------------------------------------------- /** * void file_include(filename) * * Do file in usedir or systemdir. */ int script_file_include(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *filename = luaL_checkstring(L, 1); script_getLeader(L)->scriptInclude(Path::dataReadPath(filename)); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * bool file_exists(filename) * * Returns true when such file exists in userdir or systemdir. */ int script_file_exists(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *filename = luaL_checkstring(L, 1); bool exists = Path::dataReadPath(filename).exists(); lua_pushboolean(L, exists); END_NOEXCEPTION; //NOTE: return exists return 1; } fillets-ng-1.0.1/src/gengine/ScriptAgent.cpp0000644000175000017500000000236710373623377015653 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ScriptAgent.h" #include "ScriptState.h" #include "StringMsg.h" #include "UnknownMsgException.h" #include "options-script.h" //----------------------------------------------------------------- void ScriptAgent::own_init() { registerFunc("sendMsg", script_options_sendMsg); registerFunc("setParam", script_options_setParam); registerFunc("getParam", script_options_getParam); } //----------------------------------------------------------------- void ScriptAgent::registerFunc(const char *name, lua_CFunction func) { m_script->registerFunc(name, func); } //----------------------------------------------------------------- /** * Messages: * - dostring("input") ... run string * * @throws UnknownMsgException */ void ScriptAgent::receiveString(const StringMsg *msg) { if (msg->equalsName("dostring")) { scriptDo(msg->getValue()); } else { throw UnknownMsgException(msg); } } fillets-ng-1.0.1/src/gengine/BaseListener.cpp0000644000175000017500000000311510155372127015770 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "BaseListener.h" #include "OptionAgent.h" #include "UnknownMsgException.h" #include "SimpleMsg.h" #include "IntMsg.h" #include "StringMsg.h" //----------------------------------------------------------------- /** * Register self as watcher for param. * String msg param_changed(param) will be send when param has changed. */ void BaseListener::registerWatcher(const std::string ¶m) { StringMsg *event = new StringMsg(this, "param_changed", param); OptionAgent::agent()->addWatcher(param, event); } //----------------------------------------------------------------- void BaseListener::removeWatchers() { OptionAgent::agent()->removeWatchers(getName()); } //----------------------------------------------------------------- /** * @throws UnknownMsgException */ void BaseListener::receiveSimple(const SimpleMsg *msg) { throw UnknownMsgException(msg); } //----------------------------------------------------------------- /** * @throws UnknownMsgException */ void BaseListener::receiveInt(const IntMsg *msg) { throw UnknownMsgException(msg); } //----------------------------------------------------------------- /** * @throws UnknownMsgException */ void BaseListener::receiveString(const StringMsg *msg) { throw UnknownMsgException(msg); } fillets-ng-1.0.1/src/gengine/SDLException.h0000644000175000017500000000035710033064516015356 00000000000000#ifndef HEADER_SDLEXCEPTION_H #define HEADER_SDLEXCEPTION_H #include "BaseException.h" /** * Exception about SDL fail. */ class SDLException : public BaseException { public: SDLException(const ExInfo &problem); }; #endif fillets-ng-1.0.1/src/gengine/BaseAgent.cpp0000644000175000017500000000240410105164540015232 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "BaseAgent.h" #include "Log.h" #include "LogicException.h" //----------------------------------------------------------------- BaseAgent::BaseAgent() { m_initialized = false; } //----------------------------------------------------------------- void BaseAgent::init() { LOG_DEBUG(ExInfo("init").addInfo("name", getName())); //NOTE: agent can call oneself in init() m_initialized = true; own_init(); } //----------------------------------------------------------------- /** * @throws LogicException when agent is not initialized. */ void BaseAgent::update() { if (!m_initialized) { throw LogicException(ExInfo("agent is not ready") .addInfo("name", getName())); } own_update(); } //----------------------------------------------------------------- void BaseAgent::shutdown() { LOG_DEBUG(ExInfo("shutdown").addInfo("name", getName())); own_shutdown(); m_initialized = false; } fillets-ng-1.0.1/src/gengine/ScriptState.h0000644000175000017500000000146410125025227015320 00000000000000#ifndef HEADER_SCRIPTSTATE_H #define HEADER_SCRIPTSTATE_H class Path; class Scripter; #include "NoCopy.h" #include extern "C" { #include "lua.h" } /** * Independent script state. */ class ScriptState : public NoCopy { private: lua_State *m_state; int m_errorHandlerIndex; private: void prepareErrorHandler(); void insertErrorHandler(int index); void callStack(int error, int params=0, int returns=0); public: ScriptState(); ~ScriptState(); void doFile(const Path &file); void doString(const std::string &input); bool callCommand(int funcRef, int param); void unref(int funcRef); void registerFunc(const char *name, lua_CFunction func); void registerLeader(Scripter *leader); }; #endif fillets-ng-1.0.1/src/gengine/FsPath.cpp0000644000175000017500000000521410125653740014577 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "FsPath.h" #include "Log.h" #include "PathException.h" #include #include #include #include #include //----------------------------------------------------------------- /** * Get native filename. * @param file posix filename */ std::string FsPath::getNative(const std::string &file) { return file; } //----------------------------------------------------------------- /** * Returns true when file or directory exists. * @param file posix filename */ bool FsPath::exists(const std::string &file) { if (file.empty()) { return true; } struct stat buf; int error = stat(file.c_str(), &buf); return !error; } //----------------------------------------------------------------- /** * Joint two paths. * @param dir posix filename * @param file posix filename * @return "dir/file" */ std::string FsPath::join(const std::string &dir, const std::string &file) { if (dir.empty()) { return file; } return dir + '/' + file; } //----------------------------------------------------------------- /** * Return path without file basename. * @param file posix filename */ inline std::string dirPath(const std::string &file) { std::string dirs = ""; std::string::size_type pos = file.rfind('/'); if (pos == 0) { //NOTE: root dirs = "/"; } else if (pos != std::string::npos) { dirs = file.substr(0, pos); } return dirs; } //----------------------------------------------------------------- /** * Create dir. * @param dir posix filename * @throws NameException when error occurs */ inline void createDir(const std::string &dir) { if (dir.empty()) { return; } #ifdef WIN32 int error = mkdir(dir.c_str()); #else int error = mkdir(dir.c_str(), 0777); #endif if (error) { throw PathException(ExInfo("cannot create dir") .addInfo("stderror", strerror(errno)) .addInfo("dir", dir)); } } //----------------------------------------------------------------- /** * Create all directories in path (like "mkdir -p"). * @param file posix filename */ void FsPath::createPath(const std::string &file) { std::string parent = dirPath(file); if (!FsPath::exists(parent)) { createPath(parent); createDir(parent); } } fillets-ng-1.0.1/src/gengine/AgentPack.h0000644000175000017500000000121210033064516014701 00000000000000#ifndef HEADER_AGENTPACK_H #define HEADER_AGENTPACK_H class BaseAgent; #include "NoCopy.h" #include #include /** * List of agents. */ class AgentPack : public NoCopy { private: typedef std::map t_agents; t_agents m_agents; static AgentPack *ms_singleton; public: AgentPack(); ~AgentPack(); void addAgent(BaseAgent *agent); void removeAgent(const std::string &name); static BaseAgent *getAgent(const std::string &name); void init(const std::string &stopAgent=""); void update(); void shutdown(); }; #endif fillets-ng-1.0.1/src/gengine/MultiDrawer.cpp0000644000175000017500000000264610103147555015655 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "MultiDrawer.h" //----------------------------------------------------------------- /** * Store drawer at the end of list. */ void MultiDrawer::acceptDrawer(Drawable *drawer) { m_drawers.push_back(drawer); } //----------------------------------------------------------------- /** * Remove equal drawer from list. * Drawer will not be deleted. */ void MultiDrawer::removeDrawer(const Drawable *drawer) { t_drawers::iterator end = m_drawers.end(); for (t_drawers::iterator i = m_drawers.begin(); i != end; ++i) { if (*i == drawer) { m_drawers.erase(i); return; } } } //----------------------------------------------------------------- /** * Remove all drawers from list. */ void MultiDrawer::removeAll() { m_drawers.clear(); } //----------------------------------------------------------------- /** * Let every registred drawer to draw. */ void MultiDrawer::drawOn(SDL_Surface *screen) { t_drawers::iterator end = m_drawers.end(); for (t_drawers::iterator i = m_drawers.begin(); i != end; ++i) { (*i)->drawOn(screen); } } fillets-ng-1.0.1/src/gengine/DummySoundAgent.h0000644000175000017500000000113410102330152016117 00000000000000#ifndef HEADER_DUMMYSOUNDAGENT_H #define HEADER_DUMMYSOUNDAGENT_H #include "SoundAgent.h" /** * NO sound and music. */ class DummySoundAgent : public SoundAgent { protected: virtual void setSoundVolume(int ) {} virtual void setMusicVolume(int ) {} public: virtual int playSound(Mix_Chunk *, int /*volume*/, int /*loops*/) { return -1; } virtual void playMusic(const Path &, BaseMsg *finished) { if (finished) { delete finished; } } virtual void stopMusic() {} }; #endif fillets-ng-1.0.1/src/gengine/INamed.h0000644000175000017500000000031210036364004014177 00000000000000#ifndef HEADER_INAMED_H #define HEADER_INAMED_H /** * Interface - named object. */ class INamed { public: virtual ~INamed() {} virtual const char *getName() const = 0; }; #endif fillets-ng-1.0.1/src/gengine/Log.cpp0000644000175000017500000000261010033700234014115 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Log.h" #include "ExInfo.h" #include #include int Log::ms_logLevel = LEVEL_INFO; //int Log::ms_logLevel = LEVEL_DEBUG; //----------------------------------------------------------------- /** * Print log info. * @param level priority level * @param file source file * @param line line number in source file * @param info detail info */ void Log::log(int level, const char *file, int line, const ExInfo &info) throw() { if (level <= ms_logLevel) { const char *levelName; switch (level) { case LEVEL_DEBUG: levelName = "DEBUG"; break; case LEVEL_INFO: levelName = "INFO"; break; case LEVEL_WARNING: levelName = "WARNING"; break; case LEVEL_ERROR: levelName = "ERROR"; break; default: levelName = "UNKNOWN"; break; } fprintf(stderr, "%s:%d: %s %s\n", file, line, levelName, info.what()); } } fillets-ng-1.0.1/src/gengine/ResImagePack.h0000644000175000017500000000122411214434673015351 00000000000000#ifndef HEADER_RESIMAGEPACK_H #define HEADER_RESIMAGEPACK_H class Path; #include "ResourcePack.h" #include "ResCache.h" #include "SDL.h" /** * Image resources and image loading. */ class ResImagePack : public ResourcePack { private: static ResCache *CACHE; bool m_caching_enabled; public: explicit ResImagePack(bool caching_enabled=true); virtual const char *getName() const { return "image_pack"; } static SDL_Surface *loadImage(const Path &file); void addImage(const std::string &name, const Path &file); virtual void unloadRes(SDL_Surface *res); }; #endif fillets-ng-1.0.1/src/gengine/BaseListener.h0000644000175000017500000000120710155372130015427 00000000000000#ifndef HEADER_BASELISTENER_H #define HEADER_BASELISTENER_H class BaseMsg; class SimpleMsg; class IntMsg; class StringMsg; #include "INamed.h" #include /** * Listen messages. * * Listener must register oneself to MessagerAgent to be * able to receive messages. */ class BaseListener : public INamed { protected: void registerWatcher(const std::string ¶m); void removeWatchers(); public: virtual ~BaseListener() {} virtual void receiveSimple(const SimpleMsg *msg); virtual void receiveInt(const IntMsg *msg); virtual void receiveString(const StringMsg *msg); }; #endif fillets-ng-1.0.1/src/gengine/FsPath_boost.cpp0000644000175000017500000000362010075620342016000 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "FsPath.h" #include "Log.h" #include "boost/filesystem/operations.hpp" #include "boost/filesystem/convenience.hpp" #include "boost/filesystem/exception.hpp" #include "boost/version.hpp" //----------------------------------------------------------------- inline boost::filesystem::path boostPath(const std::string &file) { #if BOOST_VERSION < 103100 return boost::filesystem::path(file); #else return boost::filesystem::path(file, boost::filesystem::portable_posix_name); #endif } //----------------------------------------------------------------- /** * Get native filename. * @param file posix filename */ std::string FsPath::getNative(const std::string &file) { return boostPath(file).native_file_string(); } //----------------------------------------------------------------- /** * Returns true when file or directory exists. * @param file posix filename */ bool FsPath::exists(const std::string &file) { return boost::filesystem::exists(boostPath(file)); } //----------------------------------------------------------------- /** * Joint two paths. * @param dir posix filename * @param file posix filename * @return "dir/file" */ std::string FsPath::join(const std::string &dir, const std::string &file) { return (boostPath(dir) / boostPath(file)).string(); } //----------------------------------------------------------------- /** * Create all directories in path (like "mkdir -p"). * @param file posix filename */ void FsPath::createPath(const std::string &file) { boost::filesystem::create_directories(boostPath(file).branch_path()); } fillets-ng-1.0.1/src/gengine/SDLSoundAgent.cpp0000644000175000017500000001334411422403422016016 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SDLSoundAgent.h" #include "Log.h" #include "Path.h" #include "ExInfo.h" #include "SDLException.h" #include "MixException.h" #include "Random.h" #include "BaseMsg.h" #include "OptionAgent.h" BaseMsg *SDLSoundAgent::ms_finished = NULL; //----------------------------------------------------------------- /** * Init sound subsystem. * @throws SDLException when SDL_INIT_AUDIO cannot be initialized * @throws MixException when SDL_mixer cannot be initialized */ void SDLSoundAgent::own_init() { SoundAgent::own_init(); } //----------------------------------------------------------------- void SDLSoundAgent::own_shutdown() { stopMusic(); Mix_CloseAudio(); SDL_QuitSubSystem(SDL_INIT_AUDIO); } //----------------------------------------------------------------- /** * Reinit the sound subsystem. */ void SDLSoundAgent::reinit() { m_music = NULL; m_looper = NULL; m_soundVolume = MIX_MAX_VOLUME; m_musicVolume = MIX_MAX_VOLUME; if(SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { throw SDLException(ExInfo("SDL_InitSubSystem")); } int frequency = OptionAgent::agent()->getAsInt("sound_frequency", 44100); if(Mix_OpenAudio(frequency, MIX_DEFAULT_FORMAT, 2, 1024) < 0) { throw MixException(ExInfo("Mix_OpenAudio")); } Mix_AllocateChannels(16); SoundAgent::reinit(); } //----------------------------------------------------------------- /** * Play this sound. * @param sound chunk to play * @param volume percentage sound volume * @param loops numer of loops. 0=play once, 1=play twice, -1=play infinite * * @return channel number where the sound is played, * return -1 on error or when sound is NULL */ int SDLSoundAgent::playSound(Mix_Chunk *sound, int volume, int loops) { int channel = -1; if (sound) { channel = Mix_PlayChannel(-1, sound, loops); if (-1 == channel) { //NOTE: maybe there are too few open channels LOG_WARNING(ExInfo("cannot play sound") .addInfo("Mix", Mix_GetError())); } else { Mix_Volume(channel, m_soundVolume * volume / 100); } } return channel; } //----------------------------------------------------------------- /** * Set sound volume. * NOTE: all already running sound will get equals volume * @param volume percentage volume, e.g. 30%=30 */ void SDLSoundAgent::setSoundVolume(int volume) { m_soundVolume = MIX_MAX_VOLUME * volume / 100; if (m_soundVolume > MIX_MAX_VOLUME) { m_soundVolume = MIX_MAX_VOLUME; } else if (m_soundVolume < 0) { m_soundVolume = 0; } Mix_Volume(-1, m_soundVolume); } //--------------------------------------------------------------------------- // Music part //--------------------------------------------------------------------------- /** * Play music. * @param file path to music file (i.e. *.ogg) * @param finished send this message when music is finished. * If finished is NULL, play music forever. */ void SDLSoundAgent::playMusic(const Path &file, BaseMsg *finished) { // The same music is not restarted when it is not needed. if (m_playingPath == file.getPosixName() && ms_finished == NULL && finished == NULL) { return; } stopMusic(); m_playingPath = file.getPosixName(); if (finished) { ms_finished = finished; m_music = Mix_LoadMUS(file.getNative().c_str()); if (m_music && (0 == Mix_PlayMusic(m_music, 1))) { Mix_HookMusicFinished(musicFinished); } else { LOG_WARNING(ExInfo("cannot play music") .addInfo("music", file.getNative()) .addInfo("Mix", Mix_GetError())); } } else { m_looper = new SDLMusicLooper(file); m_looper->setVolume(m_musicVolume); m_looper->start(); } } //----------------------------------------------------------------- /** * @param volume percentage volume, e.g. 30%=30 */ void SDLSoundAgent::setMusicVolume(int volume) { m_musicVolume = MIX_MAX_VOLUME * volume / 100; if (m_musicVolume > MIX_MAX_VOLUME) { m_musicVolume = MIX_MAX_VOLUME; } else if (m_musicVolume < 0) { m_musicVolume = 0; } Mix_VolumeMusic(m_musicVolume); if (m_looper) { m_looper->setVolume(m_musicVolume); } } //----------------------------------------------------------------- void SDLSoundAgent::stopMusic() { if (m_looper) { m_looper->stop(); delete m_looper; m_looper = NULL; } if(Mix_PlayingMusic()) { Mix_HookMusicFinished(NULL); Mix_HaltMusic(); } if (m_music) { Mix_FreeMusic(m_music); m_music = NULL; } if (ms_finished) { delete ms_finished; ms_finished = NULL; } m_playingPath = ""; } //----------------------------------------------------------------- /** * Callback called when music is finished. * NOTE: no one exception can be passed to "C" SDL_mixer code */ void SDLSoundAgent::musicFinished() { try { if (ms_finished) { ms_finished->sendClone(); } else { LOG_WARNING(ExInfo("NULL == ms_finished")); } } catch (std::exception &e) { LOG_WARNING(ExInfo("musicFinished error") .addInfo("what", e.what())); } catch (...) { LOG_ERROR(ExInfo("musicFinished error - unknown exception")); } } fillets-ng-1.0.1/src/gengine/OptionAgent.h0000644000175000017500000000375010214722462015306 00000000000000#ifndef HEADER_OPTIONAGENT_H #define HEADER_OPTIONAGENT_H class Environ; class OptionParams; #include "BaseAgent.h" #include "Name.h" #include #include /** * Game options. */ class OptionAgent : public BaseAgent { AGENT(OptionAgent, Name::OPTION_NAME); private: static const char *CONFIG_FILE; Environ *m_environ; private: void prepareVersion(); void prepareDataPaths(); void prepareLang(); void parseDashOpt(const std::string &arg, const OptionParams ¶ms); void parseParamOpt(const std::string &arg, const OptionParams ¶ms); bool splitOpt(const std::string &option, std::string *out_name, std::string *out_value); std::string getHelpInfo(const OptionParams ¶ms) const; std::string getVersionInfo() const; void readSystemConfig(); void readUserConfig(); protected: virtual void own_init(); virtual void own_shutdown(); public: void parseCmdOpt(int argc, char *argv[], const OptionParams ¶ms); void setParam(const std::string &name, const std::string &value); void setParam(const std::string &name, long value); void setPersistent(const std::string &name, const std::string &value); void setPersistent(const std::string &name, long value); void setDefault(const std::string &name, const std::string &value); void setDefault(const std::string &name, int value); std::string getParam(const std::string &name, const std::string &implicit="") const; int getAsInt(const std::string &name, int implicit=0) const; bool getAsBool(const std::string &name, bool implicit=false) const; void addWatcher(const std::string &name, BaseMsg *msg); void removeWatchers(const std::string &listenerName); void receiveString(const StringMsg *msg); }; #endif fillets-ng-1.0.1/src/gengine/MouseStroke.h0000644000175000017500000000113310125653740015333 00000000000000#ifndef HEADER_MOUSESTROKE_H #define HEADER_MOUSESTROKE_H #include "V2.h" #include "SDL.h" #include /** * Contains info about mouse click. */ class MouseStroke { private: Uint8 m_button; V2 m_loc; public: MouseStroke(const SDL_MouseButtonEvent &event); bool isLeft() const { return m_button == SDL_BUTTON_LEFT; } bool isMiddle() const { return m_button == SDL_BUTTON_MIDDLE; } bool isRight() const { return m_button == SDL_BUTTON_RIGHT; } V2 getLoc() const { return m_loc; } std::string toString() const; }; #endif fillets-ng-1.0.1/src/gengine/ResCache.h0000644000175000017500000001001111205550207014515 00000000000000#ifndef HEADER_RESCACHE_H #define HEADER_RESCACHE_H #include "NoCopy.h" #include "ResourcePack.h" #include "Log.h" template class CacheEntry { public: std::string name; T value; int refcount; CacheEntry() { name = ""; value = NULL; refcount = 0; } }; /** * A fixed size cache for any resources. */ template class ResCache : public NoCopy { private: typedef std::vector*> t_entries; t_entries m_entries; ResourcePack *m_unloader; unsigned int m_next_pos; public: /** * Creates a cache with the given capacity. * The given unloader has to have disabled caching * to prevent an infinite loop. */ ResCache(int capacity, ResourcePack *new_unloader) { m_entries.resize(capacity); for (unsigned int i = 0; i < m_entries.size(); i++) { m_entries[i] = new CacheEntry(); } m_next_pos = 0; m_unloader = new_unloader; } ~ResCache() { for (unsigned int i = 0; i < m_entries.size(); i++) { delete m_entries[i]; } delete m_unloader; } /** * Returns a found value or NULL. * The returned item should be released via release(). */ T get(const std::string &name) { CacheEntry *entry = getEntry(name); if (!entry) { return NULL; } entry->refcount++; return entry->value; } /** * Notes a new value. * The caller should release it later via release(). */ void put(const std::string &name, T value) { CacheEntry* entry = findNextUnusedEntry(); if (!entry) { LOG_DEBUG(ExInfo("cannot fit into cache") .addInfo("name", name)); return; } if (entry->value != NULL) { m_unloader->unloadRes(entry->value); } entry->name = name; entry->value = value; entry->refcount = 1; } /** * Releases or takes responsibility for the given value. */ void release(T value) { CacheEntry *found = getByValue(value); if (found) { found->refcount -= 1; if (found->refcount < 0) { LOG_WARNING(ExInfo("extra release of a cache entry")); found->refcount = 0; } } else { m_unloader->unloadRes(value); } } private: /** * Returns the matching CacheEntry or NULL. */ CacheEntry *getEntry(const std::string &name) { for (unsigned int i = 0; i < m_entries.size(); i++) { CacheEntry *entry = m_entries[i]; if (entry->value != NULL && entry->name == name) { return entry; } } return NULL; } /** * Returns the matching CacheEntry or NULL. */ CacheEntry *getByValue(T value) { for (unsigned int i = 0; i < m_entries.size(); i++) { CacheEntry *entry = m_entries[i]; if (entry->value == value) { return entry; } } return NULL; } /** * Returns a next unused CacheEntry or NULL when all entries are full. */ CacheEntry* findNextUnusedEntry() { for (unsigned int attempt = 0; attempt < m_entries.size(); attempt++) { CacheEntry *entry = m_entries[m_next_pos]; m_next_pos = (m_next_pos + 1) % m_entries.size(); if (entry->refcount <= 0) { return entry; } } return NULL; } }; #endif fillets-ng-1.0.1/src/gengine/PlannedDialog.h0000644000175000017500000000113111265147427015560 00000000000000#ifndef HEADER_PLANNEDDIALOG_H #define HEADER_PLANNEDDIALOG_H class Dialog; #include "NoCopy.h" #include /** * Active dialog. */ class PlannedDialog : public NoCopy { private: int m_actor; const Dialog *m_dialog; int m_channel; int m_endtime; int m_minTime; private: bool isPlaying() const; public: PlannedDialog(int actor, const Dialog *dialog, int minTime); void talk(int volume, int loops=0); void killTalk(); bool isTalking() const; bool equalsActor(int other) const; }; #endif fillets-ng-1.0.1/src/gengine/ScriptState.cpp0000644000175000017500000001065410263023752015660 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ScriptState.h" #include "Log.h" #include "Path.h" #include "ScriptException.h" extern "C" { #include "lualib.h" #include "lauxlib.h" } #include "def-script.h" //----------------------------------------------------------------- ScriptState::ScriptState() { m_state = lua_open(); luaopen_base(m_state); luaopen_string(m_state); luaopen_math(m_state); luaopen_table(m_state); prepareErrorHandler(); } //----------------------------------------------------------------- ScriptState::~ScriptState() { lua_close(m_state); } //----------------------------------------------------------------- /** * Prepare error handler at global stack. */ void ScriptState::prepareErrorHandler() { lua_pushliteral(m_state, "_TRACEBACK"); lua_pushcfunction(m_state, script_debugStack); lua_settable(m_state, LUA_GLOBALSINDEX); } //----------------------------------------------------------------- /** * Insert error handler at given local index. */ void ScriptState::insertErrorHandler(int index) { lua_pushliteral(m_state, "_TRACEBACK"); lua_rawget(m_state, LUA_GLOBALSINDEX); lua_insert(m_state, index); } //----------------------------------------------------------------- /** * Process script on stack. * @param error script load status * @param params number of params * @param returns number of values on return * * @throws ScriptException when script is bad */ void ScriptState::callStack(int error, int params, int returns) { if (0 == error) { int base = lua_gettop(m_state) - params; insertErrorHandler(base); error = lua_pcall(m_state, params, returns, base); lua_remove(m_state, base); } if (error) { const char *msg = lua_tostring(m_state, -1); if (NULL == msg) { msg = "(error with no message)"; } ExInfo info = ExInfo("script failure") .addInfo("error", msg); lua_pop(m_state, 1); throw ScriptException(info); } } //----------------------------------------------------------------- /** * Process script file. * @param file script */ void ScriptState::doFile(const Path &file) { int error = luaL_loadfile(m_state, file.getNative().c_str()); callStack(error); } //----------------------------------------------------------------- /** * Process string. * @param input script */ void ScriptState::doString(const std::string &input) { int error = luaL_loadbuffer(m_state, input.c_str(), input.size(), input.c_str()); callStack(error); } //----------------------------------------------------------------- void ScriptState::registerFunc(const char *name, lua_CFunction func) { lua_register(m_state, name, func); } //----------------------------------------------------------------- /** * Call "bool function(param)" function. * @param funcRef function index at registry * @param param integer parametr * @return boolean result from function * @throws ScriptException when function is bad */ bool ScriptState::callCommand(int funcRef, int param) { int numResults = 1; lua_rawgeti(m_state, LUA_REGISTRYINDEX, funcRef); lua_pushnumber(m_state, param); callStack(0, 1, numResults); if (0 == lua_isboolean(m_state, -1)) { const char *type = lua_typename(m_state, lua_type(m_state, -1)); lua_pop(m_state, numResults); throw ScriptException( ExInfo("script command failure - boolean expected") .addInfo("got", type)); } bool result = lua_toboolean(m_state, -1); lua_pop(m_state, numResults); return result; } //----------------------------------------------------------------- /** * Remove function from registry. * @param funcRef function index at registry */ void ScriptState::unref(int funcRef) { luaL_unref(m_state, LUA_REGISTRYINDEX, funcRef); } //----------------------------------------------------------------- /** * Register light userdata for lua script. */ void ScriptState::registerLeader(Scripter *leader) { lua_pushstring(m_state, script_getLeaderName()); lua_pushlightuserdata(m_state, leader); lua_rawset(m_state, LUA_REGISTRYINDEX); } fillets-ng-1.0.1/src/gengine/DialogStack.cpp0000644000175000017500000001227410144766434015611 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "DialogStack.h" #include "Dialog.h" #include "ResDialogPack.h" #include "PlannedDialog.h" #include "StringTool.h" //----------------------------------------------------------------- DialogStack::DialogStack() { m_dialogs = new ResDialogPack(); m_activeDialog = NULL; } //----------------------------------------------------------------- /** * Releases resources and stops all cycling dialogs. */ DialogStack::~DialogStack() { removeAll(); delete m_dialogs; } //----------------------------------------------------------------- /** * Removes finished dialogs from stack. */ void DialogStack::updateStack() { removeFirstNotTalking(); } //----------------------------------------------------------------- /** * Store new dialog. */ void DialogStack::addDialog(const std::string &name, Dialog *dialog) { m_dialogs->addRes(name, dialog); } //----------------------------------------------------------------- /** * Run talk. * Dialog name could contain "name@arg1@arg2..." * to fill %1, %2, ... in subtitles. * * @param actor actor index * @param name dialog name * @param volume dialog volume * @param loops number of loops, 0=play once, 1=play twice, -1=play infinite * @param dialogFlag whether it is blocking dialog */ void DialogStack::actorTalk(int actor, const std::string &name, int volume, int loops, bool dialogFlag) { StringTool::t_args args = StringTool::split(name, '@'); const Dialog *subtitle = m_dialogs->findDialogHard(args[0]); if (subtitle) { subtitle->runSubtitle(args); const Dialog *dialog = m_dialogs->findDialogSpeech(args[0]); if (dialog) { PlannedDialog *talker = new PlannedDialog(actor, dialog, subtitle->getMinTime()); talker->talk(volume, loops); if (loops == -1) { m_cycling.push_back(talker); } else { m_running.push_back(talker); } if (dialogFlag) { m_activeDialog = talker; } } } } //----------------------------------------------------------------- bool DialogStack::isTalking(int actor) const { return isTalkingIn(actor, m_running) || isTalkingIn(actor, m_cycling); } //----------------------------------------------------------------- bool DialogStack::isTalkingIn(int actor, const t_running &fifo) const { t_running::const_iterator end = fifo.end(); for (t_running::const_iterator i = fifo.begin(); i != end; ++i) { if ((*i)->equalsActor(actor) && (*i)->isTalking()) { return true; } } return false; } //----------------------------------------------------------------- /** * Remove first not talking dialog from m_running. */ void DialogStack::removeFirstNotTalking() { t_running::iterator end = m_running.end(); for (t_running::iterator i = m_running.begin(); i != end; ++i) { if (!(*i)->isTalking()) { releaseDialog(*i); m_running.erase(i); return; } } } //----------------------------------------------------------------- /** * Delete all running dialogs made by this actor. */ void DialogStack::killSound(int actor) { killSoundIn(actor, m_running); killSoundIn(actor, m_cycling); } //----------------------------------------------------------------- void DialogStack::killSoundIn(int actor, t_running &fifo) { //NOTE: erase on list invalidates only the erased iterator t_running::iterator run_end = fifo.end(); for (t_running::iterator i = fifo.begin(); i != run_end; /* empty */) { t_running::iterator toKill = i; ++i; if ((*toKill)->equalsActor(actor)) { releaseDialog(*toKill); fifo.erase(toKill); } } } //----------------------------------------------------------------- /** * Kill all running dialogs. */ void DialogStack::killTalks() { killTalksIn(m_running); killTalksIn(m_cycling); } //----------------------------------------------------------------- void DialogStack::killTalksIn(t_running &fifo) { t_running::iterator end = fifo.end(); for (t_running::iterator i = fifo.begin(); i != end; ++i) { releaseDialog(*i); } fifo.clear(); } //----------------------------------------------------------------- void DialogStack::releaseDialog(PlannedDialog *dialog) { if (dialog == m_activeDialog) { m_activeDialog = NULL; } dialog->killTalk(); delete dialog; } //----------------------------------------------------------------- /** * Delete all shared dialogs and kill talks. */ void DialogStack::removeAll() { killTalks(); m_dialogs->removeAll(); } //----------------------------------------------------------------- /** * Returns true when there is active dialog. */ bool DialogStack::isDialog() const { return m_activeDialog && m_activeDialog->isTalking(); } fillets-ng-1.0.1/src/gengine/ResDialogPack.h0000644000175000017500000000131111205343626015520 00000000000000#ifndef HEADER_RESDIALOGPACK_H #define HEADER_RESDIALOGPACK_H class Dialog; #include "ResourcePack.h" #include "Name.h" #include "SDL.h" /** * Multi-language dialogs pack. */ class ResDialogPack : public ResourcePack { private: int matchScore(const std::string &first, const std::string &second) const; const Dialog *findDialog(const std::string &name, const std::string &lang); public: virtual const char *getName() const { return "dialog_pack"; } const Dialog *findDialogHard(const std::string &name); const Dialog *findDialogSpeech(const std::string &name); virtual void unloadRes(Dialog *res); }; #endif fillets-ng-1.0.1/src/gengine/ResourceException.h0000644000175000017500000000050010033064516016511 00000000000000#ifndef HEADER_RESOURCEEXCEPTION_H #define HEADER_RESOURCEEXCEPTION_H #include "BaseException.h" /** * Exception about not found resource. */ class ResourceException : public BaseException { public: ResourceException(const ExInfo &problem) : BaseException(problem) {} }; #endif fillets-ng-1.0.1/src/gengine/VideoAgent.h0000644000175000017500000000163510147222351015101 00000000000000#ifndef HEADER_VIDEOAGENT_H #define HEADER_VIDEOAGENT_H class Path; #include "BaseAgent.h" #include "MultiDrawer.h" #include "Name.h" #include "SDL.h" #include /** * Video agent initializes video mode and * every cycle lets registered drawers to drawOn(screen). */ class VideoAgent : public BaseAgent, public MultiDrawer { AGENT(VideoAgent, Name::VIDEO_NAME); private: SDL_Surface *m_screen; bool m_fullscreen; private: void setIcon(const Path &file); void changeVideoMode(int screen_width, int screen_height); int getVideoFlags(); void toggleFullScreen(); protected: virtual void own_init(); virtual void own_update(); virtual void own_shutdown(); public: virtual void receiveSimple(const SimpleMsg *msg); virtual void receiveString(const StringMsg *msg); void initVideoMode(); }; #endif fillets-ng-1.0.1/src/gengine/KeyStroke.h0000644000175000017500000000152610106354670015000 00000000000000#ifndef HEADER_KEYSTROKE_H #define HEADER_KEYSTROKE_H #include "SDL.h" #include /** * KeyStroke. */ class KeyStroke { private: static const int STROKE_IGNORE = ~(KMOD_CTRL|KMOD_ALT); SDLKey m_sym; int m_mod; Uint16 m_unicode; private: static int modStrip(int mod); public: KeyStroke(const SDL_keysym &keysym); KeyStroke(SDLKey sym, int mod); SDLKey getKey() const { return m_sym; } Uint16 getUnicode() const { return m_unicode; } bool less(const KeyStroke &other) const; bool equals(const KeyStroke &other) const; std::string toString() const; }; /** * KeyStroke comparation. */ struct stroke_less { bool operator()(const KeyStroke &left, const KeyStroke &right) const { return left.less(right); } }; #endif fillets-ng-1.0.1/src/gengine/BaseMsg.cpp0000644000175000017500000000212210033064516014721 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "BaseMsg.h" #include "MessagerAgent.h" //----------------------------------------------------------------- /** * Create msg. * @param listenerName name of destination * @param name msg name */ BaseMsg::BaseMsg(const std::string &listenerName, const std::string &name) : m_listenerName(listenerName), m_name(name) { /* empty */ } //----------------------------------------------------------------- /** * Send copy of message. */ void BaseMsg::sendClone() const { //NOTE: message type must be preserved MessagerAgent::agent()->forwardNewMsg(clone()); } //----------------------------------------------------------------- std::string BaseMsg::toString() const { std::string result = m_listenerName; result.append("->" + m_name); return result; } fillets-ng-1.0.1/src/gengine/UnknownMsgException.h0000644000175000017500000000063310033064516017037 00000000000000#ifndef HEADER_UNKNOWNMSGEXCEPTION_H #define HEADER_UNKNOWNMSGEXCEPTION_H #include "BaseException.h" #include "BaseMsg.h" /** * Exception about unknown msg. */ class UnknownMsgException : public BaseException { public: UnknownMsgException(const BaseMsg *msg) : BaseException(ExInfo("unknown message") .addInfo("msg", msg->toString())) {} }; #endif fillets-ng-1.0.1/src/gengine/HelpException.h0000644000175000017500000000043710105164540015621 00000000000000#ifndef HEADER_HELPEXCEPTION_H #define HEADER_HELPEXCEPTION_H #include "BaseException.h" /** * Only help is need. */ class HelpException : public BaseException { public: HelpException(const ExInfo &problem) : BaseException(problem) {} }; #endif fillets-ng-1.0.1/src/gengine/StringTool.h0000644000175000017500000000124511212540541015153 00000000000000#ifndef HEADER_STRINGTOOL_H #define HEADER_STRINGTOOL_H #include #include /** * String utils. */ class StringTool { public: typedef std::vector t_args; public: static long readInt(const char *text, bool *ok); static std::string toString(long value); static bool startsWith(const std::string &str, const std::string &prefix); static void replace(std::string &buffer, const std::string &pattern, const std::string &newstring); static t_args split(const std::string &str, char separator); static int utf8Length(const std::string &str); }; #endif fillets-ng-1.0.1/src/gengine/Environ.cpp0000644000175000017500000001532110214775256015040 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Environ.h" #include "Log.h" #include "Path.h" #include "BaseMsg.h" #include "NameException.h" #include "StringTool.h" #include //----------------------------------------------------------------- /** * Free all remain messages for watchers. */ Environ::~Environ() { t_watchers::iterator end = m_watchers.end(); for (t_watchers::iterator i = m_watchers.begin(); i != end; ++i) { delete i->second; } } //----------------------------------------------------------------- /** * Save params. * @param file where to store params, this file will be overwritten */ void Environ::store(const Path &file) { FILE *config = fopen(file.getNative().c_str(), "w"); if (config) { fputs("-- this file is automatically generated\n", config); t_values::iterator end = m_values.end(); for (t_values::iterator i = m_values.begin(); i != end; ++i) { fprintf(config, "setParam(\"%s\", \"%s\")\n", i->first.c_str(), i->second.c_str()); } fclose(config); } else { LOG_WARNING(ExInfo("cannot save config") .addInfo("file", file.getNative())); } } //----------------------------------------------------------------- /** * Set param. * Notice watchers. * When watcher is not available, it will be removed. * * @param name param name * @param value param value */ void Environ::setParam(const std::string &name, const std::string &value) { if (m_values[name] != value) { m_values[name] = value; LOG_DEBUG(ExInfo("setParam") .addInfo("param", name) .addInfo("value", value)); t_watchers::iterator it = m_watchers.find(name); if (m_watchers.end() != it) { t_watchers::size_type count = m_watchers.count(name); for (t_watchers::size_type i = 0; i < count; ++i) { t_watchers::iterator cur_it = it++; try { cur_it->second->sendClone(); } catch (NameException &e) { LOG_WARNING(e.info()); delete cur_it->second; m_watchers.erase(cur_it); } } } } } //----------------------------------------------------------------- /** * Store this integer value like string param. * @param name param name * @param value param value */ void Environ::setParam(const std::string &name, long value) { setParam(name, StringTool::toString(value)); } //----------------------------------------------------------------- /** * Return value. * Implicit value is "". * * @param name param name * @param implicit default value = "" * @return value or implicit value */ std::string Environ::getParam(const std::string &name, const std::string &implicit) const { std::string result = implicit; t_values::const_iterator it = m_values.find(name); if (m_values.end() != it) { result = it->second; } return result; } //----------------------------------------------------------------- /** * Returns number value. * Implicit value is zero. * * @param name param name * @param implicit default value = 0 * @return number or implicit */ int Environ::getAsInt(const std::string &name, int implicit) const { std::string value = getParam(name); bool ok; int result = StringTool::readInt(value.c_str(), &ok); if (!ok) { if (value != "") { LOG_WARNING(ExInfo("cannot recognize numeric value") .addInfo("property", name) .addInfo("value", value) .addInfo("default", implicit)); } result = implicit; } return result; } //----------------------------------------------------------------- /** * Returns boolean value. * Recognizes 1/0, true/false, on/off, yes/no. * * @param name param name * @param implicit default value = false * @return stored value or implicit value when value is not recognized */ bool Environ::getAsBool(const std::string &name, bool implicit) const { bool result = false; std::string value = getParam(name); if (value == "1" || value == "true" || value == "on" || value == "yes") { result = true; } else if (value == "0" || value == "false" || value == "off" || value == "no") { result = false; } else { if (value != "") { //TODO: don't print this every time LOG_WARNING(ExInfo("cannot recognize boolean value") .addInfo("property", name) .addInfo("value", value) .addInfo("default", implicit) .addInfo("hint", "use 1/0, true/false, on/off, yes/no")); } result = implicit; } return result; } //----------------------------------------------------------------- /** * Multiple watcher can watch param change. * @param name param name * @param msg message to raise */ void Environ::addWatcher(const std::string &name, BaseMsg *msg) { m_watchers.insert(std::pair(name, msg)); LOG_DEBUG(ExInfo("add watcher") .addInfo("param", name) .addInfo("msg", msg->toString())); } //----------------------------------------------------------------- /** * Removes all registered watchers for given listener. */ void Environ::removeWatchers(const std::string &listenerName) { t_watchers::iterator end = m_watchers.end(); for (t_watchers::iterator i = m_watchers.begin(); i != end; /*empty*/) { t_watchers::iterator cur = i++; if (cur->second->getListenerName() == listenerName) { delete cur->second; m_watchers.erase(cur); } } } //----------------------------------------------------------------- std::string Environ::toString() const { ExInfo info("environ"); t_values::const_iterator end = m_values.end(); for (t_values::const_iterator i = m_values.begin(); i != end; ++i) { info.addInfo(i->first, i->second); } return info.info(); } //----------------------------------------------------------------- std::string Environ::getHelpInfo() const { std::string help; t_values::const_iterator end = m_values.end(); for (t_values::const_iterator i = m_values.begin(); i != end; ++i) { help += i->first + "='" + i->second + "'\n"; } return help; } fillets-ng-1.0.1/src/gengine/MixException.h0000644000175000017500000000036510033064516015470 00000000000000#ifndef HEADER_MIXEXCEPTION_H #define HEADER_MIXEXCEPTION_H #include "BaseException.h" /** * Exception about SDL_mixer fail. */ class MixException : public BaseException { public: MixException(const ExInfo &problem); }; #endif fillets-ng-1.0.1/src/gengine/Path.h0000644000175000017500000000152211133355455013753 00000000000000#ifndef HEADER_PATH_H #define HEADER_PATH_H #include /** * Path to a installed data. */ class Path { private: std::string m_path; private: static Path dataPath(const std::string &file, bool writeable); static std::string localizePath(const std::string &original); static Path constructPath(const std::string &dir, const std::string &file); explicit Path(const std::string &file); public: static Path dataReadPath(const std::string &file); static Path dataWritePath(const std::string &file); static Path dataSystemPath(const std::string &file); static Path dataUserPath(const std::string &file); std::string getPosixName() const { return m_path; } std::string getNative() const; bool exists() const; }; #endif fillets-ng-1.0.1/src/gengine/ResSoundPack.h0000644000175000017500000000072711205343627015424 00000000000000#ifndef HEADER_RESSOUNDPACK_H #define HEADER_RESSOUNDPACK_H class Path; #include "ResourcePack.h" #include "SDL_mixer.h" /** * Sound resources. */ class ResSoundPack : public ResourcePack { public: virtual const char *getName() const { return "sound_pack"; } static Mix_Chunk *loadSound(const Path &file); void addSound(const std::string &name, const Path &file); virtual void unloadRes(Mix_Chunk *res); }; #endif fillets-ng-1.0.1/src/gengine/InputAgent.cpp0000644000175000017500000000626211212502030015453 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "InputAgent.h" #include "KeyBinder.h" #include "InputHandler.h" #include "MessagerAgent.h" #include "SimpleMsg.h" #include "UnknownMsgException.h" #include "Name.h" #include "MouseStroke.h" #include "SDL.h" //----------------------------------------------------------------- /** * Enable SDL_UNICODE. * Enable key repeat. * Set console handler to ScriptAgent. * * NOTE: every SDL_InitSubSystem will disable UNICODE * hence InputAgent init must be after VideoAgent and SoundAgent. * NOTE: KeyConsole() use Path which asks OptionAgent */ void InputAgent::own_init() { m_keyBinder = new KeyBinder(); m_handler = NULL; m_keys = SDL_GetKeyState(NULL); SDL_EnableUNICODE(1); } //----------------------------------------------------------------- void InputAgent::own_update() { SDL_Event event; while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_QUIT: { BaseMsg *msg = new SimpleMsg(Name::APP_NAME, "quit"); MessagerAgent::agent()->forwardNewMsg(msg); break; } case SDL_KEYDOWN: m_keyBinder->keyDown(event.key.keysym); if (m_handler) { m_handler->keyEvent(KeyStroke(event.key.keysym)); } break; case SDL_KEYUP: if (m_handler) { m_handler->keyUp(KeyStroke(event.key.keysym)); } break; case SDL_MOUSEBUTTONDOWN: if (m_handler) { m_handler->mouseEvent(MouseStroke(event.button)); } break; default: break; } } if (m_handler) { Uint8 buttons; V2 mouseLoc = getMouseState(&buttons); m_handler->mouseState(mouseLoc, buttons); } } //----------------------------------------------------------------- /** * Delete console. */ void InputAgent::own_shutdown() { delete m_keyBinder; } //----------------------------------------------------------------- void InputAgent::installHandler(InputHandler *handler) { if (m_handler) { m_handler->takePressed(NULL); m_handler->mouseState(V2(-1, -1), 0); } m_handler = handler; if (m_handler) { m_handler->takePressed(m_keys); Uint8 buttons; V2 mouseLoc = getMouseState(&buttons); m_handler->mouseState(mouseLoc, buttons); } } //----------------------------------------------------------------- /** * Return mouse location. * @param out_buttons place where to store state of buttons * @return (mouseX, mouseY) */ V2 InputAgent::getMouseState(Uint8 *out_buttons) { int x; int y; Uint8 pressed = SDL_GetMouseState(&x, &y); if (out_buttons) { *out_buttons = pressed; } return V2(x, y); } fillets-ng-1.0.1/src/gengine/TimerAgent.cpp0000644000175000017500000000254711423226455015460 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "TimerAgent.h" #include "OptionAgent.h" //----------------------------------------------------------------- void TimerAgent::own_init() { m_timeinterval = OptionAgent::agent()->getAsInt("timeinterval", 100); m_lastTime = SDL_GetTicks(); m_nextTime = m_lastTime; m_deltaTime = 1; m_count = 0; } //----------------------------------------------------------------- /** * Game is faster with pressed Shift. */ int TimerAgent::getTimeInterval() { int result = m_timeinterval; if (SDL_GetModState() & KMOD_SHIFT) { result = m_timeinterval / 4; } return result; } //----------------------------------------------------------------- /** * Sleep fixed number miliseconds. */ void TimerAgent::own_update() { m_count++; Uint32 now = SDL_GetTicks(); if (now < m_nextTime) { SDL_Delay(m_nextTime - now); } now = SDL_GetTicks(); //NOTE: every cycle have fixed time interval m_nextTime = now + getTimeInterval(); m_deltaTime = now - m_lastTime; m_lastTime = now; } fillets-ng-1.0.1/src/gengine/SysVideo.cpp0000644000175000017500000000554210132543114015152 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SysVideo.h" #include "Log.h" #include "SDL.h" #if !defined(HAVE_X11) && !defined(WIN32) void SysVideo::setCaption(const std::string &title) { SDL_WM_SetCaption(title.c_str(), NULL); } #else #include "SDL_syswm.h" static bool sysSetCaption(SDL_SysWMinfo *info, const std::string &title); //----------------------------------------------------------------- /** * Set window title. * @param title UTF-8 string */ void SysVideo::setCaption(const std::string &title) { bool done = false; SDL_SysWMinfo info; SDL_VERSION(&info.version); if (SDL_GetWMInfo(&info) > 0) { done = sysSetCaption(&info, title); } if (!done) { SDL_WM_SetCaption(title.c_str(), NULL); } } //----------------------------------------------------------------- /** * Set window title. * @param info system dependent info * @param title utf-8 string * @return true for success */ #if defined(HAVE_X11) && !defined(DISABLE_X11) && defined(unix) #include bool sysSetCaption(SDL_SysWMinfo *info, const std::string &title) { bool result = false; #ifdef X_HAVE_UTF8_STRING if (info->subsystem == SDL_SYSWM_X11) { info->info.x11.lock_func(); XTextProperty titleprop; char *text_list = const_cast(title.c_str()); int error = Xutf8TextListToTextProperty(info->info.x11.display, &text_list, 1, XUTF8StringStyle, &titleprop); if (!error) { XSetWMName(info->info.x11.display, info->info.x11.wmwindow, &titleprop); XFree(titleprop.value); result = true; } else { LOG_DEBUG(ExInfo("not supported conversion") .addInfo("error", error) .addInfo("title", title)); } info->info.x11.unlock_func(); } #endif return result; } #elif defined(WIN32) #define WIN32_LEAN_AND_MEAN #include bool sysSetCaption(SDL_SysWMinfo *info, const std::string &title) { bool result = false; LPWSTR lpszW = new WCHAR[title.size()]; if (MultiByteToWideChar(CP_UTF8, 0, title.c_str(), -1, lpszW, title.size())) { result = SetWindowTextW(info->window, lpszW); } else { LOG_DEBUG(ExInfo("not supported conversion") .addInfo("error", GetLastError()) .addInfo("title", title)); } delete[] lpszW; return result; } #else bool sysSetCaption(SDL_SysWMinfo * /*info*/, const std::string &/*title*/) { return false; } #endif #endif // HAVE_X11 || WIN32 fillets-ng-1.0.1/src/gengine/InputHandler.cpp0000644000175000017500000000303210125665032016000 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "InputHandler.h" #include "ExInfo.h" //----------------------------------------------------------------- InputHandler::InputHandler() : m_mouseLoc(-1, -1) { m_pressed = NULL; m_buttons = 0; } //----------------------------------------------------------------- void InputHandler::mouseState(const V2 &loc, Uint8 buttons) { m_mouseLoc = loc; m_buttons = buttons; } //----------------------------------------------------------------- bool InputHandler::isPressed(SDLKey key) const { return m_pressed && m_pressed[key]; } //----------------------------------------------------------------- bool InputHandler::isLeftPressed() const { return m_buttons & SDL_BUTTON(1); } //----------------------------------------------------------------- bool InputHandler::isMiddlePressed() const { return m_buttons & SDL_BUTTON(2); } //----------------------------------------------------------------- bool InputHandler::isRightPressed() const { return m_buttons & SDL_BUTTON(3); } //----------------------------------------------------------------- std::string InputHandler::toString() const { return ExInfo("input") .addInfo("mouse", m_mouseLoc.toString()) .addInfo("buttons", m_buttons).info(); } fillets-ng-1.0.1/src/gengine/SDLException.cpp0000644000175000017500000000117410033064516015707 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SDLException.h" #include "SDL.h" //----------------------------------------------------------------- /** * Add SDL_GetError to info. * @param problem detail info */ SDLException::SDLException(const ExInfo &problem) : BaseException(ExInfo(problem).addInfo("SDL", SDL_GetError())) { /* empty */ } fillets-ng-1.0.1/src/gengine/IntMsg.h0000644000175000017500000000142310033064516014251 00000000000000#ifndef HEADER_INTMSG_H #define HEADER_INTMSG_H #include "BaseMsg.h" #include "BaseListener.h" /** * Message with integer value. */ class IntMsg : public BaseMsg { private: int m_value; public: CLONE(IntMsg); IntMsg(BaseListener *listener, const std::string &name, int value) : BaseMsg(listener->getName(), name), m_value(value) {} IntMsg(const std::string &listenerName, const std::string &name, int value) : BaseMsg(listenerName, name), m_value(value) {} virtual void sendActual(BaseListener *listener) const { listener->receiveInt(this); } int getValue() const { return m_value; } virtual std::string toString() const; }; #endif fillets-ng-1.0.1/src/gengine/options-script.h0000644000175000017500000000042710117436766016065 00000000000000#ifndef HEADER_OPTIONS_SCRIPT_H #define HEADER_OPTIONS_SCRIPT_H extern "C" { #include "lua.h" } extern int script_options_sendMsg(lua_State *L) throw(); extern int script_options_setParam(lua_State *L) throw(); extern int script_options_getParam(lua_State *L) throw(); #endif fillets-ng-1.0.1/src/gengine/ResDialogPack.cpp0000644000175000017500000000634510176660006016067 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ResDialogPack.h" #include "Log.h" #include "Dialog.h" #include "OptionAgent.h" #include "minmax.h" //----------------------------------------------------------------- void ResDialogPack::unloadRes(Dialog *res) { delete res; } //----------------------------------------------------------------- /** * Return match score. * One string must excatly be starting substring of the other. */ int ResDialogPack::matchScore(const std::string &first, const std::string &second) const { int score = 0; int minSize = min(first.size(), second.size()); for (int i = 0; i < minSize; ++i) { if (first[i] == second[i]) { score++; } else { return 0; } } return score; } //----------------------------------------------------------------- /** * Return dialog or NULL. * Compare dialog names and lang codes. * The best lang match is selected, at least two characters must equals. */ const Dialog * ResDialogPack::findDialog(const std::string &name, const std::string &lang) { int bestScore = 0; Dialog *bestDialog = NULL; t_range range = getRange(name); t_range::iterator end = range.end(); for (t_range::iterator i = range.begin(); i != end; ++i) { int score = matchScore(lang, (*i)->getLang()); if (bestScore < score) { bestScore = score; bestDialog = *i; } } if (bestScore < 2) { bestDialog = NULL; } return bestDialog; } //----------------------------------------------------------------- /** * Try find dialog for current lang or default lang. * @return dialog or NULL */ const Dialog * ResDialogPack::findDialogHard(const std::string &name) { std::string lang = OptionAgent::agent()->getParam("lang"); const Dialog *dialog = findDialog(name, lang); if (NULL == dialog) { dialog = findDialog(name, Dialog::DEFAULT_LANG); if (NULL == dialog) { LOG_WARNING(ExInfo("cannot find dialog") .addInfo("name", name) .addInfo("lang", lang) .addInfo("pack", toString())); } } return dialog; } //----------------------------------------------------------------- /** * Try find dialog for lang=speech or default lang. * @return dialog or NULL */ const Dialog * ResDialogPack::findDialogSpeech(const std::string &name) { std::string speech = OptionAgent::agent()->getParam("speech", OptionAgent::agent()->getParam("lang")); const Dialog *dialog = findDialog(name, speech); if (NULL == dialog || dialog->isSpeechless()) { dialog = findDialog(name, Dialog::DEFAULT_LANG); if (NULL == dialog) { LOG_WARNING(ExInfo("cannot find speech") .addInfo("name", name) .addInfo("speech", speech) .addInfo("pack", toString())); } } return dialog; } fillets-ng-1.0.1/src/gengine/StringMsg.h0000644000175000017500000000155710033064516014775 00000000000000#ifndef HEADER_STRINGMSG_H #define HEADER_STRINGMSG_H #include "BaseMsg.h" #include "BaseListener.h" #include /** * Message with string value. */ class StringMsg : public BaseMsg { private: std::string m_value; public: CLONE(StringMsg); StringMsg(BaseListener *listener, const std::string &name, const std::string &value) : BaseMsg(listener->getName(), name), m_value(value) {} StringMsg(const std::string &listenerName, const std::string &name, const std::string &value) : BaseMsg(listenerName, name), m_value(value) {} virtual void sendActual(BaseListener *listener) const { listener->receiveString(this); } const std::string &getValue() const { return m_value; } virtual std::string toString() const; }; #endif fillets-ng-1.0.1/src/gengine/Drawable.h0000644000175000017500000000042210105420020014551 00000000000000#ifndef HEADER_DRAWABLE_H #define HEADER_DRAWABLE_H #include "NoCopy.h" #include "SDL.h" /** * Interface - draw able object. */ class Drawable : public NoCopy { public: virtual ~Drawable() {} virtual void drawOn(SDL_Surface *screen) = 0; }; #endif fillets-ng-1.0.1/src/gengine/Scripter.h0000644000175000017500000000063610125025227014646 00000000000000#ifndef HEADER_SCRIPTER_H #define HEADER_SCRIPTER_H class Path; class ScriptState; #include "NoCopy.h" #include /** * Base class using a script. */ class Scripter : public NoCopy { protected: ScriptState *m_script; public: Scripter(); virtual ~Scripter(); void scriptInclude(const Path &filename); void scriptDo(const std::string &input); }; #endif fillets-ng-1.0.1/src/plan/0000777000175000017500000000000011632204503012277 500000000000000fillets-ng-1.0.1/src/plan/SubTitleAgent.h0000644000175000017500000000271410125052225015100 00000000000000#ifndef HEADER_SUBTITLEAGENT_H #define HEADER_SUBTITLEAGENT_H class ResColorPack; class Title; class Font; class Color; #include "BaseAgent.h" #include "Drawable.h" #include "Name.h" #include #include /** * Subtitles manager. */ class SubTitleAgent : public BaseAgent, public Drawable { AGENT(SubTitleAgent, Name::SUBTITLE_NAME); public: static const int TITLE_ROW = 26; static const int TITLE_BASE = 20; static const int TITLE_SPEED = 2; static const int TITLE_BORDER = 20; static const int TITLE_LIMIT_Y = TITLE_BASE + 5 * TITLE_ROW; typedef std::deque t_titles; t_titles m_titles; Font *m_font; ResColorPack *m_colors; int m_limitY; private: std::string splitAndCreate(const std::string &subtitle, const Color *color); void trimRest(std::string &buffer); void newShortSubtitle(const std::string &subtitle, const Color *color); void shiftTitlesUp(int rate); void shiftFinalsUp(int rate); int lowestY(); protected: virtual void own_init(); virtual void own_update(); virtual void own_shutdown(); public: int getLimitY() const { return m_limitY; } void setLimitY(int limitY) { m_limitY = limitY; } void addFont(const std::string &fontname, Color *new_color); void newSubtitle(const std::string &subtitle, const std::string &fontname); void killTalks(); void removeAll(); virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/plan/FishDialog.h0000644000175000017500000000071610110076713014401 00000000000000#ifndef HEADER_FISHDIALOG_H #define HEADER_FISHDIALOG_H #include "Dialog.h" #include /** * Wavy dialog. */ class FishDialog : public Dialog { private: std::string m_fontname; public: FishDialog(const std::string &lang, const std::string &soundfile, const std::string &subtitle, const std::string &fontname); virtual void runSubtitle(const StringTool::t_args &args) const; }; #endif fillets-ng-1.0.1/src/plan/dialog-script.h0000644000175000017500000000132610125025233015124 00000000000000#ifndef HEADER_DIALOG_SCRIPT_H #define HEADER_DIALOG_SCRIPT_H extern "C" { #include "lua.h" } extern int script_game_planAction(lua_State *L) throw(); extern int script_game_isPlanning(lua_State *L) throw(); extern int script_game_killPlan(lua_State *L) throw(); extern int script_dialog_isDialog(lua_State *L) throw(); extern int script_dialog_addFont(lua_State *L) throw(); extern int script_dialog_addDialog(lua_State *L) throw(); extern int script_model_isTalking(lua_State *L) throw(); extern int script_model_talk(lua_State *L) throw(); extern int script_model_killSound(lua_State *L) throw(); extern int script_sound_playMusic(lua_State *L) throw(); extern int script_sound_stopMusic(lua_State *L) throw(); #endif fillets-ng-1.0.1/src/plan/Planner.cpp0000644000175000017500000000537010125025233014320 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Planner.h" #include "ScriptState.h" #include "CommandQueue.h" #include "DialogStack.h" #include "SubTitleAgent.h" #include "ScriptCmd.h" #include "dialog-script.h" #include "options-script.h" //----------------------------------------------------------------- Planner::Planner() { m_plan = new CommandQueue(); m_dialogs = new DialogStack(); registerScriptFuncs(); } //----------------------------------------------------------------- void Planner::registerScriptFuncs() { m_script->registerFunc("game_planAction", script_game_planAction); m_script->registerFunc("game_isPlanning", script_game_isPlanning); m_script->registerFunc("game_killPlan", script_game_killPlan); m_script->registerFunc("dialog_isDialog", script_dialog_isDialog); m_script->registerFunc("dialog_addFont", script_dialog_addFont); m_script->registerFunc("dialog_addDialog", script_dialog_addDialog); m_script->registerFunc("model_isTalking", script_model_isTalking); m_script->registerFunc("model_talk", script_model_talk); m_script->registerFunc("model_killSound", script_model_killSound); m_script->registerFunc("sound_playMusic", script_sound_playMusic); m_script->registerFunc("sound_stopMusic", script_sound_stopMusic); m_script->registerFunc("options_getParam", script_options_getParam); } //----------------------------------------------------------------- Planner::~Planner() { //NOTE: planned ScriptCmd must be removed before script delete m_plan; delete m_dialogs; } //----------------------------------------------------------------- /** * Execute next action. * @return true for finished plan */ bool Planner::satisfyPlan() { m_dialogs->updateStack(); m_plan->executeFirst(); return m_plan->empty(); } //----------------------------------------------------------------- void Planner::killPlan() { m_dialogs->killTalks(); SubTitleAgent::agent()->killTalks(); interruptPlan(); } //----------------------------------------------------------------- void Planner::interruptPlan() { m_plan->removeAll(); } //----------------------------------------------------------------- void Planner::planAction(int funcRef) { m_plan->planCommand(new ScriptCmd(m_script, funcRef)); } //----------------------------------------------------------------- /** * Return true when there is a planned command in queue. */ bool Planner::isPlanning() const { return !m_plan->empty(); } fillets-ng-1.0.1/src/plan/StateManager.h0000644000175000017500000000161210103147557014746 00000000000000#ifndef HEADER_STATEMANAGER_H #define HEADER_STATEMANAGER_H class GameState; #include "NoCopy.h" #include /** * Stack of states. */ class StateManager : public NoCopy { private: typedef std::list t_states; t_states m_states; t_states m_trash; private: void emptyTrash(); void removeState(GameState *state); void insertAfter(GameState *who, GameState *new_state); t_states::iterator findIter(GameState *who); void checkStack(); void pauseBg(t_states::iterator stateIt); void resumeBg(t_states::iterator stateIt); void installHandlers(); public: virtual ~StateManager(); void updateGame(); void changeState(GameState *who, GameState *new_state); void pushState(GameState *who, GameState *new_state); void popState(GameState *who); }; #endif fillets-ng-1.0.1/src/plan/Command.h0000644000175000017500000000054110066370031013742 00000000000000#ifndef HEADER_COMMAND_H #define HEADER_COMMAND_H /** * Command interface. */ class Command { public: virtual ~Command() {} /** * Return true when command has finished his work. * @param count number of calls * @return true for finish */ virtual bool finish(int count) = 0; }; #endif fillets-ng-1.0.1/src/plan/SubTitleAgent.cpp0000644000175000017500000001333410214722463015442 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SubTitleAgent.h" #include "Title.h" #include "Font.h" #include "ResColorPack.h" #include "Path.h" #include "OptionAgent.h" #include "minmax.h" //----------------------------------------------------------------- void SubTitleAgent::own_init() { m_limitY = TITLE_LIMIT_Y; m_colors = new ResColorPack(); m_font = NULL; m_font = new Font(Path::dataReadPath("font/font_subtitle.ttf"), 20); } //----------------------------------------------------------------- /** * Shift all titles up. * Try remove the oldest subtitle. */ void SubTitleAgent::own_update() { if (!m_titles.empty()) { shiftTitlesUp(TITLE_SPEED); if (m_titles.front()->isGone()) { delete m_titles.front(); m_titles.pop_front(); } } } //----------------------------------------------------------------- void SubTitleAgent::own_shutdown() { removeAll(); delete m_colors; if (m_font) { delete m_font; } } //----------------------------------------------------------------- void SubTitleAgent::addFont(const std::string &fontname, Color *new_color) { m_colors->addRes(fontname, new_color); } //----------------------------------------------------------------- /** * Create new subtitle. * Shift all existing subtitles up. */ void SubTitleAgent::newSubtitle(const std::string &original, const std::string &fontname) { const Color *color = m_colors->getRes(fontname); std::string subtitle = original; while (!subtitle.empty()) { subtitle = splitAndCreate(subtitle, color); } } //----------------------------------------------------------------- /** * Split subtitle, create title and return rest. * @return rest or empty string */ std::string SubTitleAgent::splitAndCreate(const std::string &original, const Color *color) { std::string subtitle = original; int screen_width = OptionAgent::agent()->getAsInt("screen_width"); int text_width = m_font->calcTextWidth(subtitle); while (text_width > screen_width - 2 * TITLE_BORDER) { trimRest(subtitle); text_width = m_font->calcTextWidth(subtitle); } std::string rest = ""; if (!subtitle.empty()) { newShortSubtitle(subtitle, color); if (original.size() > subtitle.size()) { rest = original.substr(subtitle.size()); } } return rest; } //----------------------------------------------------------------- /** * Break long string. * String is trimed at ' ' * but not at " . " (single char surrounded with spaces). * * @param buffer buffer to change */ void SubTitleAgent::trimRest(std::string &buffer) { int i; for (i = buffer.size() - 1; i >= 0; --i) { if (buffer[i] == ' ' && !(i - 2 >= 0 && buffer[i - 2] == ' ')) { break; } } if (i <= 0) { LOG_WARNING(ExInfo("unbreakable string") .addInfo("string", buffer)); if (buffer.size() > 4) { buffer.erase(buffer.size() - 4); } else { buffer = ""; } } else { buffer.erase(i); } } //----------------------------------------------------------------- void SubTitleAgent::newShortSubtitle(const std::string &subtitle, const Color *color) { int startY = lowestY(); int finalY = TITLE_BASE + TITLE_ROW; int bonusTime = (TITLE_BASE - startY + m_limitY - TITLE_LIMIT_Y) / TITLE_SPEED; Title *title = new Title(startY, finalY, bonusTime, m_limitY, subtitle, m_font, color); shiftFinalsUp(TITLE_ROW); m_titles.push_back(title); } //----------------------------------------------------------------- /** * Increase Y for all existing titles. */ void SubTitleAgent::shiftTitlesUp(int rate) { t_titles::iterator end = m_titles.end(); for (t_titles::iterator i = m_titles.begin(); i != end; ++i) { (*i)->shiftUp(rate); } } //----------------------------------------------------------------- /** * Increase finalY for all existing titles. */ void SubTitleAgent::shiftFinalsUp(int rate) { t_titles::iterator end = m_titles.end(); for (t_titles::iterator i = m_titles.begin(); i != end; ++i) { (*i)->shiftFinalUp(rate); } } //----------------------------------------------------------------- /** * Get lowest possible Y. * It can be negative. */ int SubTitleAgent::lowestY() { int lowest = TITLE_BASE; if (!m_titles.empty()) { int lastest = m_titles.back()->getY() - TITLE_ROW; lowest = min(lowest, lastest); } return lowest; } //----------------------------------------------------------------- /** * Kill all running subtitles. */ void SubTitleAgent::killTalks() { t_titles::iterator end = m_titles.end(); for (t_titles::iterator i = m_titles.begin(); i != end; ++i) { delete *i; } m_titles.clear(); } //----------------------------------------------------------------- /** * Kill all subtitles and remove fonts. */ void SubTitleAgent::removeAll() { killTalks(); m_colors->removeAll(); } //----------------------------------------------------------------- /** * Draw all subtitles. */ void SubTitleAgent::drawOn(SDL_Surface *screen) { if (OptionAgent::agent()->getAsBool("subtitles", true)) { t_titles::iterator end = m_titles.end(); for (t_titles::iterator i = m_titles.begin(); i != end; ++i) { (*i)->drawOn(screen); } } } fillets-ng-1.0.1/src/plan/StateInput.h0000644000175000017500000000171510125653740014477 00000000000000#ifndef HEADER_STATEINPUT_H #define HEADER_STATEINPUT_H class Keymap; class GameState; #include "InputHandler.h" /** * Handle input for game state. */ class StateInput : public InputHandler { protected: static const int KEY_QUIT = 1; static const int KEY_CONSOLE = 2; static const int KEY_HELP = 3; static const int KEY_MENU = 4; static const int KEY_SUBTITLES = 5; Keymap *m_keymap; GameState *m_state; protected: virtual void quitState(); virtual void enableConsole(); virtual void enableHelp() {}; virtual void enableMenu() {}; virtual void enableSubtitles(); virtual void specStroke(const KeyStroke &/*stroke*/) {} virtual void specKey(int keyIndex); void toggleParam(const std::string ¶m); public: StateInput(GameState *state); ~StateInput(); virtual void keyEvent(const KeyStroke &stroke); }; #endif fillets-ng-1.0.1/src/plan/Title.h0000644000175000017500000000165410126147703013460 00000000000000#ifndef HEADER_TITLE_H #define HEADER_TITLE_H class Font; class Color; #include "Drawable.h" #include /** * Subtitle. */ class Title : public Drawable { private: static const int TIME_PER_CHAR = 2; static const int TIME_MIN = 40; int m_screenW; int m_screenH; int m_x; int m_y; int m_mintime; int m_limitY; int m_finalY; const std::string m_content; Font *m_font; SDL_Surface *m_surface; public: Title(int baseY, int finalY, int bonusTime, int limitY, const std::string &content, Font *font, const Color *color); virtual ~Title(); void shiftUp(int rate); void shiftFinalUp(int rate); virtual void drawOn(SDL_Surface *screen); bool isGone(); int getY() const; std::string getContent() const { return m_content; } }; #endif fillets-ng-1.0.1/src/plan/CommandQueue.h0000644000175000017500000000104710067034775014766 00000000000000#ifndef HEADER_COMMANDQUEUE_H #define HEADER_COMMANDQUEUE_H class Command; #include "NoCopy.h" #include /** * Queue for sequential commands. */ class CommandQueue : public NoCopy { private: typedef std::deque t_commands; t_commands m_commands; int m_count; public: CommandQueue(); virtual ~CommandQueue(); void planCommand(Command *new_command); bool executeFirst(); void removeAll(); bool empty() const { return m_commands.empty(); } }; #endif fillets-ng-1.0.1/src/plan/Planner.h0000644000175000017500000000117210125025233013761 00000000000000#ifndef HEADER_PLANNER_H #define HEADER_PLANNER_H class Path; class CommandQueue; class DialogStack; #include "Scripter.h" #include "SDL.h" #include /** * Action planner. */ class Planner : public Scripter { private: CommandQueue *m_plan; DialogStack *m_dialogs; private: void registerScriptFuncs(); public: Planner(); virtual ~Planner(); bool satisfyPlan(); void killPlan(); virtual void interruptPlan(); void planAction(int funcRef); bool isPlanning() const; DialogStack *dialogs() { return m_dialogs; } }; #endif fillets-ng-1.0.1/src/plan/KeyDesc.cpp0000644000175000017500000000117510066560631014261 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "KeyDesc.h" //----------------------------------------------------------------- /** * Create new key description. * @param index key index should be unique in one GameState * @param desc text description */ KeyDesc::KeyDesc(int index, const std::string &desc) : m_desc(desc) { m_index = index; } fillets-ng-1.0.1/src/plan/GameState.h0000644000175000017500000000351610155252713014250 00000000000000#ifndef HEADER_GAMESTATE_H #define HEADER_GAMESTATE_H class StateManager; class InputHandler; class InputProvider; class MultiDrawer; class Drawable; #include "NoCopy.h" #include "BaseListener.h" /** * Game state. * GameState installs own InputHandler in init phase. * * To change state, * use m_manager->pushState(topState) or * m_manager->changeState(newState) */ class GameState : public BaseListener, public NoCopy { private: bool m_active; bool m_onBg; GameState *m_nextState; InputHandler *m_handler; MultiDrawer *m_drawer; StateManager *m_manager; protected: void takeHandler(InputHandler *new_handler); const InputProvider *getInput(); virtual void own_initState() = 0; virtual void own_updateState() = 0; virtual void own_pauseState() = 0; virtual void own_resumeState() = 0; virtual void own_cleanState() = 0; virtual void own_noteBg() {} virtual void own_noteFg() {} void changeState(GameState *new_state); void registerDrawable(Drawable *drawable); void deregisterDrawable(const Drawable *drawable); public: GameState(); virtual ~GameState(); virtual bool allowBg() const { return false; } bool isRunning() const { return m_active; } bool isOnBg() const { return m_onBg; } void setNextState(GameState *nextState) { m_nextState = nextState; } void initState(StateManager *manager); void updateState(); void pauseState(); void resumeState(); void cleanState(); void quitState(); void pushState(GameState *new_state); void noteBg(); void noteFg(); void installHandlers(); void unHandlers(); void receiveSimple(const SimpleMsg *msg); }; #endif fillets-ng-1.0.1/src/plan/StateInput.cpp0000644000175000017500000000616510214722463015034 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "StateInput.h" #include "Keymap.h" #include "GameState.h" #include "Log.h" #include "KeyStroke.h" #include "KeyConsole.h" #include "OptionAgent.h" //----------------------------------------------------------------- /** * Create state input handler. * @param state pointer to the leader */ StateInput::StateInput(GameState *state) { m_state = state; m_keymap = new Keymap(); KeyDesc key_quit(KEY_QUIT, "quit"); KeyDesc key_console(KEY_CONSOLE, "debug console"); KeyDesc key_help(KEY_HELP, "help screen"); KeyDesc key_menu(KEY_MENU, "game menu"); m_keymap->registerKey(KeyStroke(SDLK_ESCAPE, KMOD_NONE), key_quit); m_keymap->registerKey(KeyStroke(SDLK_BACKQUOTE, KMOD_NONE), key_console); m_keymap->registerKey(KeyStroke(SDLK_F1, KMOD_NONE), key_help); m_keymap->registerKey(KeyStroke(SDLK_F10, KMOD_NONE), key_menu); m_keymap->registerKey(KeyStroke(SDLK_F6, KMOD_NONE), KeyDesc(KEY_SUBTITLES, "enable subtitles")); } //----------------------------------------------------------------- StateInput::~StateInput() { delete m_keymap; } //----------------------------------------------------------------- /** * Inspects keystroke and call: * - common function for quit, console, help, menu, subtitles * - specKey() for defined keystroke but unknown for us * - specStroke() for other keys */ void StateInput::keyEvent(const KeyStroke &stroke) { int index = m_keymap->indexPressed(stroke); switch (index) { case KEY_QUIT: quitState(); break; case KEY_CONSOLE: enableConsole(); break; case KEY_HELP: enableHelp(); break; case KEY_MENU: enableMenu(); break; case KEY_SUBTITLES: enableSubtitles(); break; case -1: specStroke(stroke); break; default: specKey(index); break; } } //----------------------------------------------------------------- void StateInput::specKey(int keyIndex) { LOG_WARNING(ExInfo("unknown key") .addInfo("keyIndex", keyIndex)); } //----------------------------------------------------------------- void StateInput::quitState() { m_state->quitState(); } //----------------------------------------------------------------- void StateInput::enableConsole() { m_state->pushState(new KeyConsole()); } //----------------------------------------------------------------- void StateInput::enableSubtitles() { toggleParam("subtitles"); } //----------------------------------------------------------------- void StateInput::toggleParam(const std::string ¶m) { OptionAgent *option = OptionAgent::agent(); bool enable = option->getAsBool(param); option->setPersistent(param, !enable); } fillets-ng-1.0.1/src/plan/Keymap.h0000644000175000017500000000067610066560631013632 00000000000000#ifndef HEADER_KEYMAP_H #define HEADER_KEYMAP_H #include "KeyStroke.h" #include "KeyDesc.h" #include "SDL.h" #include #include /** * Table of defined keys. */ class Keymap { private: typedef std::map t_keys; t_keys m_keys; public: void registerKey(const KeyStroke &stroke, const KeyDesc &desc); int indexPressed(const KeyStroke &stroke) const; }; #endif fillets-ng-1.0.1/src/plan/ScriptCmd.h0000644000175000017500000000065710066370031014264 00000000000000#ifndef HEADER_SCRIPTCMD_H #define HEADER_SCRIPTCMD_H class ScriptState; #include "NoCopy.h" #include "Command.h" /** * Command which execute script function. */ class ScriptCmd : public Command, public NoCopy { private: int m_funcRef; ScriptState *m_script; public: ScriptCmd(ScriptState *script, int funcRef); virtual ~ScriptCmd(); virtual bool finish(int count); }; #endif fillets-ng-1.0.1/src/plan/FishDialog.cpp0000644000175000017500000000232610110076713014733 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "FishDialog.h" #include "SubTitleAgent.h" //----------------------------------------------------------------- /** * Prepare new wavy dialoge. * @param lang lang * @param soundfile a wav file * @param subtitle subtitle * @param fontname name of selected font */ FishDialog::FishDialog(const std::string &lang, const std::string &soundfile, const std::string &subtitle, const std::string &fontname) : Dialog(lang, soundfile, subtitle), m_fontname(fontname) { /* empty */ } //----------------------------------------------------------------- /** * Subtitles are optional, dialog can have only sound. */ void FishDialog::runSubtitle(const StringTool::t_args &args) const { if (!m_fontname.empty()) { std::string subtitle = getFormatedSubtitle(args); if (!subtitle.empty()) { SubTitleAgent::agent()->newSubtitle(subtitle, m_fontname); } } } fillets-ng-1.0.1/src/plan/ConsoleInput.h0000644000175000017500000000133510105374141015010 00000000000000#ifndef HEADER_CONSOLEINPUT_H #define HEADER_CONSOLEINPUT_H class KeyConsole; #include "StateInput.h" #include /** * Debug console input handler. */ class ConsoleInput : public StateInput { private: static const int KEY_HISTORY = 101; static const int KEY_BACKSPACE = 102; static const int KEY_CLEAR = 103; static const int KEY_ENTER = 104; std::string m_history; protected: virtual void enableConsole(); virtual void enableSubtitles() {} virtual void specStroke(const KeyStroke &stroke); virtual void specKey(int keyIndex); private: KeyConsole *getConsole(); public: ConsoleInput(KeyConsole *console); }; #endif fillets-ng-1.0.1/src/plan/Title.cpp0000644000175000017500000000541610641473557014026 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Title.h" #include "Font.h" #include "Color.h" #include "OptionAgent.h" #include "StringTool.h" //----------------------------------------------------------------- /** * Create new title to draw. * X is centred. * Y is baseY above bottom screen border. * * @param baseY number of pixels from the bottom border * @param finalY final position, it changes when next subtitle is added * @param bonusTime bonus time for subtitle under bottom border * @param limitY max Y distance from bottom border * @param content subtitle content * @param font subtitle font (shared) * @param color subtitle color (shared) */ Title::Title(int baseY, int finalY, int bonusTime, int limitY, const std::string &content, Font *font, const Color *color) : m_content(content) { m_font = font; m_surface = m_font->renderTextOutlined(content, *color); int text_width = m_font->calcTextWidth(content); m_screenW = OptionAgent::agent()->getAsInt("screen_width"); m_screenH = OptionAgent::agent()->getAsInt("screen_height"); m_x = (m_screenW - text_width) / 2; m_y = m_screenH - baseY; m_finalY = m_screenH - finalY; m_limitY = m_screenH - limitY; m_mintime = StringTool::utf8Length(m_content) * TIME_PER_CHAR; if (m_mintime < TIME_MIN) { m_mintime = TIME_MIN; } m_mintime += bonusTime; } //----------------------------------------------------------------- Title::~Title() { SDL_FreeSurface(m_surface); } //----------------------------------------------------------------- /** * Draw model. */ void Title::drawOn(SDL_Surface *screen) { //TODO: wavy text SDL_Rect rect; rect.x = m_x; rect.y = m_y; SDL_BlitSurface(m_surface, NULL, screen, &rect); } //----------------------------------------------------------------- /** * Shift up until title is on limit. * Decrease m_mintime. */ void Title::shiftUp(int rate) { m_mintime--; m_y -= rate; if (m_y < m_finalY) { m_y = m_finalY; } } //----------------------------------------------------------------- void Title::shiftFinalUp(int rate) { m_finalY -= rate; } //----------------------------------------------------------------- /** * Return Y position from the bottom border. */ int Title::getY() const { return m_screenH - m_y; } //----------------------------------------------------------------- /** * Whether title was long enough on screen. */ bool Title::isGone() { return (m_mintime < 0 || m_y < m_limitY); } fillets-ng-1.0.1/src/plan/Makefile.in0000644000175000017500000003417011632204473014273 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/plan DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libplan_a_AR = $(AR) $(ARFLAGS) libplan_a_LIBADD = am_libplan_a_OBJECTS = CommandQueue.$(OBJEXT) ConsoleInput.$(OBJEXT) \ FishDialog.$(OBJEXT) GameState.$(OBJEXT) KeyConsole.$(OBJEXT) \ KeyDesc.$(OBJEXT) Keymap.$(OBJEXT) Planner.$(OBJEXT) \ ScriptCmd.$(OBJEXT) StateInput.$(OBJEXT) \ StateManager.$(OBJEXT) SubTitleAgent.$(OBJEXT) Title.$(OBJEXT) \ dialog-script.$(OBJEXT) libplan_a_OBJECTS = $(am_libplan_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libplan_a_SOURCES) DIST_SOURCES = $(libplan_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libplan.a libplan_a_SOURCES = Command.h CommandQueue.cpp CommandQueue.h ConsoleInput.cpp ConsoleInput.h FishDialog.cpp FishDialog.h GameState.cpp GameState.h KeyConsole.cpp KeyConsole.h KeyDesc.cpp KeyDesc.h Keymap.cpp Keymap.h Planner.cpp Planner.h ScriptCmd.cpp ScriptCmd.h StateInput.cpp StateInput.h StateManager.cpp StateManager.h SubTitleAgent.cpp SubTitleAgent.h Title.cpp Title.h dialog-script.cpp dialog-script.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/plan/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/plan/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libplan.a: $(libplan_a_OBJECTS) $(libplan_a_DEPENDENCIES) -rm -f libplan.a $(libplan_a_AR) libplan.a $(libplan_a_OBJECTS) $(libplan_a_LIBADD) $(RANLIB) libplan.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CommandQueue.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ConsoleInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/FishDialog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GameState.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KeyConsole.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/KeyDesc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Keymap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Planner.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ScriptCmd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StateInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/StateManager.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SubTitleAgent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Title.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dialog-script.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/plan/KeyDesc.h0000644000175000017500000000056010066560631013723 00000000000000#ifndef HEADER_KEYDESC_H #define HEADER_KEYDESC_H #include /** * Description of control key. */ class KeyDesc { private: int m_index; std::string m_desc; public: KeyDesc(int index, const std::string &desc); int getIndex() const { return m_index; } std::string getDesc() const { return m_desc; } }; #endif fillets-ng-1.0.1/src/plan/ConsoleInput.cpp0000644000175000017500000000571111047536172015357 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ConsoleInput.h" #include "Keymap.h" #include "KeyConsole.h" #include "Log.h" #include "KeyDesc.h" #include "KeyStroke.h" #include // isprint() //----------------------------------------------------------------- ConsoleInput::ConsoleInput(KeyConsole *console) : StateInput(console) { KeyDesc key_history(KEY_HISTORY, "input history"); KeyDesc key_backspace(KEY_BACKSPACE, "backspace"); KeyDesc key_clear(KEY_CLEAR, "clear"); KeyDesc key_enter(KEY_ENTER, "enter"); m_keymap->registerKey(KeyStroke(SDLK_UP, KMOD_NONE), key_history); m_keymap->registerKey(KeyStroke(SDLK_BACKSPACE, KMOD_NONE), key_backspace); m_keymap->registerKey(KeyStroke(SDLK_u, KMOD_LCTRL), key_clear); m_keymap->registerKey(KeyStroke(SDLK_u, KMOD_RCTRL), key_clear); m_keymap->registerKey(KeyStroke(SDLK_RETURN, KMOD_NONE), key_enter); } //----------------------------------------------------------------- KeyConsole * ConsoleInput::getConsole() { return dynamic_cast(m_state); } //----------------------------------------------------------------- /** * Toggle console. */ void ConsoleInput::enableConsole() { quitState(); } //----------------------------------------------------------------- void ConsoleInput::specKey(int keyIndex) { //TODO: simulate key repeat in console switch (keyIndex) { case KEY_HISTORY: getConsole()->setInput(m_history); break; case KEY_BACKSPACE: { std::string input = getConsole()->getInput(); if (!input.empty()) { input.erase(input.end() - 1); getConsole()->setInput(input); } } break; case KEY_CLEAR: getConsole()->setInput(""); break; case KEY_ENTER: { std::string input = getConsole()->getInput(); if (!input.empty()) { if (getConsole()->sendCommand()) { m_history = input; getConsole()->setInput(""); } } else { quitState(); } } break; default: StateInput::specKey(keyIndex); break; } } //----------------------------------------------------------------- void ConsoleInput::specStroke(const KeyStroke &stroke) { //TODO: support UTF-8 char c = stroke.getUnicode() & 0x7F; if (isprint(c)) { std::string input = getConsole()->getInput(); input.append(1, c); getConsole()->setInput(input); } } fillets-ng-1.0.1/src/plan/Makefile.am0000644000175000017500000000107210316575532014262 00000000000000 INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libplan.a libplan_a_SOURCES = Command.h CommandQueue.cpp CommandQueue.h ConsoleInput.cpp ConsoleInput.h FishDialog.cpp FishDialog.h GameState.cpp GameState.h KeyConsole.cpp KeyConsole.h KeyDesc.cpp KeyDesc.h Keymap.cpp Keymap.h Planner.cpp Planner.h ScriptCmd.cpp ScriptCmd.h StateInput.cpp StateInput.h StateManager.cpp StateManager.h SubTitleAgent.cpp SubTitleAgent.h Title.cpp Title.h dialog-script.cpp dialog-script.h fillets-ng-1.0.1/src/plan/KeyConsole.h0000644000175000017500000000171610103167730014446 00000000000000#ifndef HEADER_KEYCONSOLE_H #define HEADER_KEYCONSOLE_H class Font; #include "GameState.h" #include "Drawable.h" #include "Color.h" #include #include "SDL.h" /** * Debug console. */ class KeyConsole : public GameState, public Drawable { private: Font *m_font; Color m_color; std::string m_input; protected: virtual void own_initState() {}; virtual void own_updateState() {}; virtual void own_pauseState() {}; virtual void own_resumeState() {}; virtual void own_cleanState() {}; public: KeyConsole(); virtual ~KeyConsole(); virtual const char *getName() const { return "state_console"; }; virtual bool allowBg() const { return true; } void setInput(const std::string &input) { m_input = input; } std::string getInput() const { return m_input; } bool sendCommand(); virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/plan/CommandQueue.cpp0000644000175000017500000000340310067034775015317 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "CommandQueue.h" #include "Command.h" //----------------------------------------------------------------- CommandQueue::CommandQueue() { m_count = 0; } //----------------------------------------------------------------- /** * Remove all commands. */ CommandQueue::~CommandQueue() { removeAll(); } //----------------------------------------------------------------- /** * Add new command at the end of queue. */ void CommandQueue::planCommand(Command *new_command) { m_commands.push_back(new_command); } //----------------------------------------------------------------- /** * Execute first command. * Execute none command when queue is empty. * If the command returns true, remove him from queue. * @return true when a command was executed */ bool CommandQueue::executeFirst() { bool result = false; if (!m_commands.empty()) { Command *command = m_commands.front(); if (command->finish(m_count)) { m_commands.pop_front(); m_count = 0; delete command; } else { m_count++; } result = true; } return result; } //----------------------------------------------------------------- /** * Remove all commands. */ void CommandQueue::removeAll() { t_commands::iterator end = m_commands.end(); for (t_commands::iterator i = m_commands.begin(); i != end; ++i) { delete (*i); } m_commands.clear(); m_count = 0; } fillets-ng-1.0.1/src/plan/StateManager.cpp0000644000175000017500000001405511212777267015317 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "StateManager.h" #include "GameState.h" #include "MessagerAgent.h" #include "SimpleMsg.h" #include "LogicException.h" //----------------------------------------------------------------- StateManager::~StateManager() { emptyTrash(); t_states::iterator end = m_states.end(); for (t_states::iterator i = m_states.begin(); i != end; ++i) { delete (*i); } } //----------------------------------------------------------------- void StateManager::emptyTrash() { t_states::iterator end = m_trash.end(); for (t_states::iterator i = m_trash.begin(); i != end; ++i) { delete (*i); } m_trash.clear(); } //----------------------------------------------------------------- /** * Update current state and states on background * and empty trash. * The states at bottom will be updated as first. */ void StateManager::updateGame() { t_states::iterator end = m_states.end(); for (t_states::iterator i = m_states.begin(); i != end; /* empty */) { //NOTE: state can remove self and thus invalide current iterator GameState *cur = *(i++); if (cur->isRunning()) { cur->updateState(); } } emptyTrash(); } //----------------------------------------------------------------- /** * Throw given state to the trash. * NOTE: given state can be still active, cannot be deleted */ void StateManager::removeState(GameState *state) { state->cleanState(); m_trash.push_back(state); m_states.remove(state); } //----------------------------------------------------------------- /** * Remove given state and set this one. */ void StateManager::changeState(GameState *who, GameState *new_state) { insertAfter(who, new_state); removeState(who); new_state->initState(this); checkStack(); } //----------------------------------------------------------------- /** * Pause given state and activate this one. */ void StateManager::pushState(GameState *who, GameState *new_state) { insertAfter(who, new_state); new_state->initState(this); checkStack(); } //----------------------------------------------------------------- /** * Remove given state and resume paused states below it. */ void StateManager::popState(GameState *who) { removeState(who); if (!m_states.empty()) { checkStack(); } else { MessagerAgent::agent()->forwardNewMsg( new SimpleMsg(Name::APP_NAME, "quit")); } } //----------------------------------------------------------------- /** * Insert new state after given state. * @param who active state or NULL to insert at the beginning * @param new_state state to insert */ void StateManager::insertAfter(GameState *who, GameState *new_state) { if (NULL == who) { m_states.push_front(new_state); } else { t_states::iterator it = findIter(who); m_states.insert(++it, new_state); } } //----------------------------------------------------------------- /** * Find iterator under given state. * @throws LogicException when state is not found */ StateManager::t_states::iterator StateManager::findIter(GameState *who) { t_states::iterator end = m_states.end(); for (t_states::iterator i = m_states.begin(); i != end; ++i) { if (who == (*i)) { return i; } } throw LogicException(ExInfo("game state is not found in stack") .addInfo("state", who ? who->getName() : "(null)")); } //----------------------------------------------------------------- /** * Preserve stack consistency. * - Node at top must be running. * - Only running node with allowBg have running states below. * @throws LogicException stack is empty */ void StateManager::checkStack() { if (m_states.empty()) { throw LogicException(ExInfo("game state stack is empty")); } t_states::iterator topIt = m_states.end(); --topIt; GameState *top = (*topIt); if (top->isOnBg()) { top->noteFg(); } pauseBg(topIt); resumeBg(topIt); installHandlers(); } //----------------------------------------------------------------- /** * Pause all running states below on stack which are not allowed. * The toppers will be paused first but the order should be insignificant * @param stateIt states bellow will be check */ void StateManager::pauseBg(t_states::iterator stateIt) { if (stateIt != m_states.begin()) { t_states::iterator prev = stateIt; --prev; if (!(*stateIt)->isRunning() || !(*stateIt)->allowBg()) { if ((*prev)->isRunning()) { (*prev)->pauseState(); } } pauseBg(prev); } } //----------------------------------------------------------------- /** * Recursively resume the given state and all states below on stack * which are allowed. * The lower ones will be resumed first but the order should be insignificant. * @param stateIt state to run */ void StateManager::resumeBg(t_states::iterator stateIt) { if ((*stateIt)->allowBg() && stateIt != m_states.begin()) { t_states::iterator prev = stateIt; --prev; resumeBg(prev); (*prev)->noteBg(); } if (!(*stateIt)->isRunning()) { (*stateIt)->resumeState(); } } //----------------------------------------------------------------- /** * Let all running states to install input and draw handler. * And all paused states will uninstall their handlers. * The lowers will be called first, the order is significant. */ void StateManager::installHandlers() { t_states::iterator end = m_states.end(); for (t_states::iterator i = m_states.begin(); i != end; ++i) { if ((*i)->isRunning()) { (*i)->unHandlers(); (*i)->installHandlers(); } else { (*i)->unHandlers(); } } } fillets-ng-1.0.1/src/plan/dialog-script.cpp0000644000175000017500000001202010173357241015462 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "dialog-script.h" class Actor; #include "Log.h" #include "Path.h" #include "FishDialog.h" #include "DialogStack.h" #include "SubTitleAgent.h" #include "SoundAgent.h" #include "Planner.h" #include "Color.h" #include "def-script.h" //----------------------------------------------------------------- inline Planner * getPlanner(lua_State *L) { return dynamic_cast(script_getLeader(L)); } //----------------------------------------------------------------- inline DialogStack * getDialogs(lua_State *L) { return getPlanner(L)->dialogs(); } //----------------------------------------------------------------- /** * void game_planAction(func) */ int script_game_planAction(lua_State *L) throw() { BEGIN_NOEXCEPTION; luaL_checktype(L, 1, LUA_TFUNCTION); int funcRef = luaL_ref(L, LUA_REGISTRYINDEX); getPlanner(L)->planAction(funcRef); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * bool game_isPlanning() */ int script_game_isPlanning(lua_State *L) throw() { BEGIN_NOEXCEPTION; bool planning = getPlanner(L)->isPlanning(); lua_pushboolean(L, planning); END_NOEXCEPTION; //NOTE: return planning return 1; } //----------------------------------------------------------------- /** * bool game_killPlan() */ int script_game_killPlan(lua_State *L) throw() { BEGIN_NOEXCEPTION; getPlanner(L)->interruptPlan(); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * bool dialog_isDialog() */ int script_dialog_isDialog(lua_State *L) throw() { BEGIN_NOEXCEPTION; bool isDialog = getDialogs(L)->isDialog(); lua_pushboolean(L, isDialog); END_NOEXCEPTION; //NOTE: return isDialog return 1; } //----------------------------------------------------------------- /** * void dialog_addFont(fontname, red, green, blue) */ int script_dialog_addFont(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *name = luaL_checkstring(L, 1); int red = luaL_checkint(L, 2); int green = luaL_checkint(L, 3); int blue = luaL_checkint(L, 4); SubTitleAgent::agent()->addFont(name, new Color(red, green, blue)); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void dialog_addDialog(name, lang, soundfile, fontname="", subtitle="") */ int script_dialog_addDialog(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *name = luaL_checkstring(L, 1); const char *lang = luaL_checkstring(L, 2); const char *soundfile = luaL_checkstring(L, 3); const char *fontname = luaL_optstring(L, 4, ""); const char *subtitle = luaL_optstring(L, 5, ""); FishDialog *dialog = new FishDialog(lang, soundfile, subtitle, fontname); getDialogs(L)->addDialog(name, dialog); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * bool model_isTalking(model_index) */ int script_model_isTalking(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); bool talking = getDialogs(L)->isTalking(model_index); lua_pushboolean(L, talking); END_NOEXCEPTION; //NOTE: return talking return 1; } //----------------------------------------------------------------- /** * void model_talk(model_index, name, volume, loops=0, dialogFlag=false) */ int script_model_talk(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); const char *name = luaL_checkstring(L, 2); int volume = luaL_optint(L, 3, 75); int loops = luaL_optint(L, 4, 0); bool dialogFlag = lua_toboolean(L, 5); getDialogs(L)->actorTalk(model_index, name, volume, loops, dialogFlag); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void model_killSound(model_index) */ int script_model_killSound(lua_State *L) throw() { BEGIN_NOEXCEPTION; int model_index = luaL_checkint(L, 1); getDialogs(L)->killSound(model_index); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void sound_playMusic(music_name) */ int script_sound_playMusic(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *music_name = luaL_checkstring(L, 1); SoundAgent::agent()->playMusic(Path::dataReadPath(music_name), NULL); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void sound_stopMusic() */ int script_sound_stopMusic(lua_State *L) throw() { BEGIN_NOEXCEPTION; SoundAgent::agent()->stopMusic(); END_NOEXCEPTION; return 0; } fillets-ng-1.0.1/src/plan/GameState.cpp0000644000175000017500000001322210155372131014573 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "GameState.h" #include "StateManager.h" #include "InputHandler.h" #include "MultiDrawer.h" #include "Log.h" #include "LogicException.h" #include "InputAgent.h" #include "VideoAgent.h" #include "MessagerAgent.h" #include "SimpleMsg.h" //----------------------------------------------------------------- GameState::GameState() { m_nextState = NULL; m_handler = NULL; m_active = false; m_onBg = false; m_drawer = new MultiDrawer(); } //----------------------------------------------------------------- GameState::~GameState() { if (m_handler) { delete m_handler; } delete m_drawer; } //----------------------------------------------------------------- /** * Obtain input handler. * @param new_handler new input handler */ void GameState::takeHandler(InputHandler *new_handler) { if (m_handler) { delete m_handler; } m_handler = new_handler; } //----------------------------------------------------------------- /** * Returns wrapped input. */ const InputProvider * GameState::getInput() { return m_handler; } //----------------------------------------------------------------- void GameState::initState(StateManager *manager) { LOG_DEBUG(ExInfo("initState").addInfo("name", getName())); MessagerAgent::agent()->addListener(this); m_manager = manager; m_active = true; m_onBg = false; own_initState(); } //----------------------------------------------------------------- /** * @throws LogicException when state is not active */ void GameState::updateState() { if (!m_active) { throw LogicException(ExInfo("update - state is not active") .addInfo("name", getName())); } own_updateState(); } //----------------------------------------------------------------- /** * @throws LogicException when state is not active */ void GameState::pauseState() { if (!m_active) { throw LogicException(ExInfo("pause - state is not active") .addInfo("name", getName())); } own_pauseState(); m_active = false; m_onBg = false; } //----------------------------------------------------------------- /** * Reactivate state after pause. * @throws LogicException when state is already active */ void GameState::resumeState() { if (m_active) { throw LogicException(ExInfo("resume - state is already active") .addInfo("name", getName())); } m_active = true; own_resumeState(); } //----------------------------------------------------------------- /** * Clean state after run. * @throws LogicException when state is not active */ void GameState::cleanState() { LOG_DEBUG(ExInfo("cleanState").addInfo("name", getName())); if (!m_active) { throw LogicException(ExInfo("clean - state is not active") .addInfo("name", getName())); } own_cleanState(); unHandlers(); m_active = false; m_onBg = false; m_manager = NULL; removeWatchers(); MessagerAgent::agent()->removeListener(getName()); } //----------------------------------------------------------------- void GameState::quitState() { if (m_nextState) { changeState(m_nextState); } else { m_manager->popState(this); } } //----------------------------------------------------------------- void GameState::pushState(GameState *new_state) { m_manager->pushState(this, new_state); } //----------------------------------------------------------------- void GameState::changeState(GameState *new_state) { m_manager->changeState(this, new_state); } //----------------------------------------------------------------- void GameState::noteBg() { LOG_DEBUG(ExInfo("noteBg").addInfo("name", getName())); own_noteBg(); m_onBg = true; } //----------------------------------------------------------------- void GameState::noteFg() { LOG_DEBUG(ExInfo("noteFg").addInfo("name", getName())); m_onBg = false; own_noteFg(); } //----------------------------------------------------------------- /** * Install own video and input handler. */ void GameState::installHandlers() { LOG_DEBUG(ExInfo("installHandlers").addInfo("state", getName())); InputAgent::agent()->installHandler(m_handler); VideoAgent::agent()->acceptDrawer(m_drawer); } //----------------------------------------------------------------- /** * Uninstall own video and input handler. */ void GameState::unHandlers() { InputAgent::agent()->installHandler(NULL); VideoAgent::agent()->removeDrawer(m_drawer); } //----------------------------------------------------------------- /** * Add new drawable to drawers fifo. * NOTE: order is important, * the first inserted drawer will be on background */ void GameState::registerDrawable(Drawable *drawable) { m_drawer->acceptDrawer(drawable); } //----------------------------------------------------------------- void GameState::deregisterDrawable(const Drawable *drawable) { m_drawer->removeDrawer(drawable); } //----------------------------------------------------------------- /** * Handle incoming message. * Messages: * - quit ... quit state */ void GameState::receiveSimple(const SimpleMsg *msg) { if (msg->equalsName("quit")) { quitState(); } else { LOG_WARNING(ExInfo("unknown msg") .addInfo("msg", msg->toString())); } } fillets-ng-1.0.1/src/plan/Keymap.cpp0000644000175000017500000000163410066560631014160 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Keymap.h" #include "Log.h" //----------------------------------------------------------------- void Keymap::registerKey(const KeyStroke &stroke, const KeyDesc &desc) { m_keys.insert(std::pair(stroke, desc)); } //----------------------------------------------------------------- /** * Return index of pressed key. * @return index or -1 */ int Keymap::indexPressed(const KeyStroke &stroke) const { int result = -1; t_keys::const_iterator it = m_keys.find(stroke); if (m_keys.end() != it) { result = it->second.getIndex(); } return result; } fillets-ng-1.0.1/src/plan/KeyConsole.cpp0000644000175000017500000000343610105420021014765 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "KeyConsole.h" #include "Font.h" #include "ConsoleInput.h" #include "Log.h" #include "Name.h" #include "StringMsg.h" #include "MessagerAgent.h" #include "BaseException.h" #include "Path.h" //----------------------------------------------------------------- /** * Console starts as deactivated. */ KeyConsole::KeyConsole() : m_color(0, 200, 0) { m_font = new Font(Path::dataReadPath("font/font_console.ttf"), 16); takeHandler(new ConsoleInput(this)); registerDrawable(this); } //----------------------------------------------------------------- KeyConsole::~KeyConsole() { delete m_font; } //----------------------------------------------------------------- /** * Send console input to scriptAgent. * NOTE: debug script fail is not critical * @return true for success */ bool KeyConsole::sendCommand() { bool result = false; try { StringMsg *msg = new StringMsg(Name::SCRIPT_NAME, "dostring", m_input); MessagerAgent::agent()->forwardNewMsg(msg); result = true; } catch (BaseException &e) { LOG_WARNING(e.info()); } return result; } //----------------------------------------------------------------- /** * Draw console. */ void KeyConsole::drawOn(SDL_Surface *screen) { SDL_Rect rect; rect.x = 10; rect.y = 10; SDL_Surface *surface = m_font->renderText("console] " + m_input, m_color); SDL_BlitSurface(surface, NULL, screen, &rect); SDL_FreeSurface(surface); } fillets-ng-1.0.1/src/plan/ScriptCmd.cpp0000644000175000017500000000221610066370031014610 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "ScriptCmd.h" #include "ScriptState.h" //----------------------------------------------------------------- /** * Obtain script function. * @param script script state where to execute * @param funcRef index of function at registry */ ScriptCmd::ScriptCmd(ScriptState *script, int funcRef) { m_script = script; m_funcRef = funcRef; } //----------------------------------------------------------------- /** * Remove function from registry. */ ScriptCmd::~ScriptCmd() { m_script->unref(m_funcRef); } //----------------------------------------------------------------- /** * Return true when command has finished his work. * @param count number of calls * @return true for finish * @throws ScriptException when error occures */ bool ScriptCmd::finish(int count) { return m_script->callCommand(m_funcRef, count); } fillets-ng-1.0.1/src/widget/0000777000175000017500000000000011632204503012630 500000000000000fillets-ng-1.0.1/src/widget/Slider.h0000644000175000017500000000134010106203272014132 00000000000000#ifndef HEADER_SLIDER_H #define HEADER_SLIDER_H #include "IWidget.h" /** * Slider for option value. */ class Slider : public IWidget { private: static const int PIXELS_PER_VALUE = 2; static const int HEIGHT = 30; std::string m_param; int m_min; int m_max; private: int value2slide(int value); int slide2value(int slide); virtual void own_mouseButton(const MouseStroke &stroke); public: Slider(const std::string ¶m, int minValue=0, int maxValue=100); virtual int getW() const { return (m_max - m_min) * PIXELS_PER_VALUE; } virtual int getH() const { return HEIGHT; } virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/widget/VBox.h0000644000175000017500000000102110125054322013563 00000000000000#ifndef HEADER_VBOX_H #define HEADER_VBOX_H #include "WiBox.h" /** * Vertical box. */ class VBox : public WiBox { private: int m_w; int m_h; bool m_centered; public: VBox(); void enableCentered() { m_centered = true; } void recenter() { setShift(m_shift); } virtual int getW() const { return m_w; } virtual int getH() const { return m_h; } virtual void addWidget(IWidget *new_widget); virtual void setShift(const V2 &shift); }; #endif fillets-ng-1.0.1/src/widget/WiStatusBar.cpp0000644000175000017500000000232110125315646015465 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WiStatusBar.h" #include "Font.h" //----------------------------------------------------------------- WiStatusBar::WiStatusBar(Font *new_font, const SDL_Color &color, int width) : m_color(color) { m_font = new_font; m_w = width; } //----------------------------------------------------------------- WiStatusBar::~WiStatusBar() { delete m_font; } //----------------------------------------------------------------- int WiStatusBar::getH() const { return m_font->getHeight(); } //----------------------------------------------------------------- void WiStatusBar::drawOn(SDL_Surface *screen) { if (!m_label.empty()) { SDL_Rect rect; rect.x = m_shift.getX(); rect.y = m_shift.getY(); SDL_Surface *rendered = m_font->renderTextOutlined(m_label, m_color); SDL_BlitSurface(rendered, NULL, screen, &rect); SDL_FreeSurface(rendered); } } fillets-ng-1.0.1/src/widget/WiPara.cpp0000644000175000017500000000153010125534047014437 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WiPara.h" #include "WiLabel.h" #include "StringTool.h" //----------------------------------------------------------------- WiPara::WiPara(const std::string &text, const Font &font, const SDL_Color &color) { const std::string space = " "; StringTool::t_args lines = StringTool::split(text, '\n'); for (unsigned int i = 0; i < lines.size(); ++i) { std::string line = lines[i]; if (line.empty()) { line = space; } addWidget(new WiLabel(line, font, color)); } } fillets-ng-1.0.1/src/widget/Labels.cpp0000644000175000017500000000453110125315646014464 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Labels.h" #include "Path.h" #include "ResDialogPack.h" #include "Dialog.h" #include "ScriptState.h" #include "def-script.h" //----------------------------------------------------------------- inline Labels * getLabels(lua_State *L) { return dynamic_cast(script_getLeader(L)); } //----------------------------------------------------------------- /** * void label_text(labelName, lang, text) */ int script_label_text(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *labelName = luaL_checkstring(L, 1); const char *lang = luaL_checkstring(L, 2); const char *text = luaL_checkstring(L, 3); getLabels(L)->addLabel(labelName, lang, text); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- Labels::Labels(const Path &source) { m_labels = new ResDialogPack(); m_script->registerFunc("label_text", script_label_text); scriptInclude(source); } //----------------------------------------------------------------- Labels::~Labels() { m_labels->removeAll(); delete m_labels; } //----------------------------------------------------------------- void Labels::addLabel(const std::string &name, const std::string &lang, const std::string &text) { m_labels->addRes(name, new Dialog(lang, "", text)); } //----------------------------------------------------------------- std::string Labels::getLabel(const std::string &name) const { std::string result; const Dialog *dialog = m_labels->findDialogHard(name); if (dialog) { result = dialog->getSubtitle(); } else { result = "???"; } return result; } //----------------------------------------------------------------- std::string Labels::getFormatedLabel(const std::string &name, const StringTool::t_args &args) const { std::string result; const Dialog *dialog = m_labels->findDialogHard(name); if (dialog) { result = dialog->getFormatedSubtitle(args); } else { result = "???"; } return result; } fillets-ng-1.0.1/src/widget/WiPara.h0000644000175000017500000000045510125534047014111 00000000000000#ifndef HEADER_WIPARA_H #define HEADER_WIPARA_H class Font; #include "VBox.h" #include "SDL.h" #include /** * Multi line paragraph. */ class WiPara : public VBox { public: WiPara(const std::string &text, const Font &font, const SDL_Color &color); }; #endif fillets-ng-1.0.1/src/widget/WiLabel.h0000644000175000017500000000047210125052225014235 00000000000000#ifndef HEADER_WILABEL_H #define HEADER_WILABEL_H class Font; #include "WiPicture.h" #include "SDL.h" #include /** * Constant text label. */ class WiLabel : public WiPicture { public: WiLabel(const std::string &text, const Font &font, const SDL_Color &color); }; #endif fillets-ng-1.0.1/src/widget/HBox.h0000644000175000017500000000062510102323760013556 00000000000000#ifndef HEADER_HBOX_H #define HEADER_HBOX_H #include "WiBox.h" /** * Horizontal box. */ class HBox : public WiBox { private: int m_w; int m_h; public: HBox(); virtual int getW() const { return m_w; } virtual int getH() const { return m_h; } virtual void addWidget(IWidget *new_widget); virtual void setShift(const V2 &shift); }; #endif fillets-ng-1.0.1/src/widget/Slider.cpp0000644000175000017500000000437611265714554014522 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Slider.h" #include "OptionAgent.h" #include "MouseStroke.h" #include "SurfaceTool.h" #include "minmax.h" //----------------------------------------------------------------- /** * Create slider for this param and optinaly specify min and max value. */ Slider::Slider(const std::string ¶m, int minValue, int maxValue) : m_param(param) { m_min = minValue; m_max = maxValue; } //----------------------------------------------------------------- /** * Scale value to slider rate. * @return position on slider */ int Slider::value2slide(int value) { int slide = value - m_min; slide = max(slide, m_min); slide = min(slide, m_max); return slide * PIXELS_PER_VALUE; } //----------------------------------------------------------------- /** * Scale slider rate to param value. * @return integer value */ int Slider::slide2value(int slide) { int value = slide + m_min; double fraction = static_cast(value) / PIXELS_PER_VALUE; return static_cast(fraction + 0.5); } //----------------------------------------------------------------- void Slider::drawOn(SDL_Surface *screen) { int value = OptionAgent::agent()->getAsInt(m_param); SDL_Color gray = {0x00, 0x00, 0x00, 129}; Uint32 green = SDL_MapRGB(screen->format, 0x00, 0xff, 0x00); SDL_Rect rect; rect.x = m_shift.getX(); rect.y = m_shift.getY(); rect.w = getW(); rect.h = getH(); SurfaceTool::alphaFill(screen, &rect, gray); rect.x = m_shift.getX(); rect.y = m_shift.getY(); rect.w = value2slide(value); rect.h = getH(); SDL_FillRect(screen, &rect, green); } //----------------------------------------------------------------- void Slider::own_mouseButton(const MouseStroke &stroke) { if (stroke.isLeft()) { //TODO: play click V2 inside = stroke.getLoc().minus(m_shift); int value = slide2value(inside.getX()); OptionAgent::agent()->setPersistent(m_param, value); } } fillets-ng-1.0.1/src/widget/WiContainer.h0000644000175000017500000000111110103750402015125 00000000000000#ifndef HEADER_WICONTAINER_H #define HEADER_WICONTAINER_H #include "IWidget.h" /** * Widget with one subwidget inside. */ class WiContainer : public IWidget { private: IWidget *m_content; int m_border; protected: virtual void own_mouseButton(const MouseStroke &stroke); public: WiContainer(IWidget *new_content, int border=0); virtual ~WiContainer(); virtual int getW() const; virtual int getH() const; virtual void setShift(const V2 &shift); virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/widget/WiLabel.cpp0000644000175000017500000000110110125052225014556 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WiLabel.h" #include "Font.h" //----------------------------------------------------------------- WiLabel::WiLabel(const std::string &text, const Font &font, const SDL_Color &color) : WiPicture(font.renderTextOutlined(text, color)) { } fillets-ng-1.0.1/src/widget/IWidget.cpp0000644000175000017500000000244510125315646014620 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "IWidget.h" #include "MouseStroke.h" //----------------------------------------------------------------- /** * Call own_mouseButton when stroke is inside own body. */ void IWidget::mouseButton(const MouseStroke &stroke) { if (isInside(stroke.getLoc())) { own_mouseButton(stroke); } } //----------------------------------------------------------------- /** * Returns own_getTip when location is inside own body. */ std::string IWidget::getTip(const V2 &loc) { std::string result; if (isInside(loc)) { result = own_getTip(loc); } return result; } //----------------------------------------------------------------- /** * Test whether location is inside this widget. * @param loc world location * @return true when location is inside widget body */ bool IWidget::isInside(const V2 &loc) { V2 inside = loc.minus(m_shift); return (inside.getX() >= 0 && inside.getX() < getW() && inside.getY() >= 0 && inside.getY() < getH()); } fillets-ng-1.0.1/src/widget/WiPicture.h0000644000175000017500000000104310125052225014624 00000000000000#ifndef HEADER_WIPICTURE_H #define HEADER_WIPICTURE_H class Path; #include "IWidget.h" /** * Picture widget. */ class WiPicture : public IWidget { protected: SDL_Surface *m_surface; protected: WiPicture(SDL_Surface *new_surface) { m_surface = new_surface; } public: WiPicture(const Path &picture); virtual ~WiPicture(); virtual int getW() const { return m_surface->w; } virtual int getH() const { return m_surface->h; } virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/widget/Makefile.in0000644000175000017500000003355311632204473014630 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/widget DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libwidget_a_AR = $(AR) $(ARFLAGS) libwidget_a_LIBADD = am_libwidget_a_OBJECTS = HBox.$(OBJEXT) IWidget.$(OBJEXT) \ Slider.$(OBJEXT) VBox.$(OBJEXT) WiBox.$(OBJEXT) \ WiPicture.$(OBJEXT) WiContainer.$(OBJEXT) WiButton.$(OBJEXT) \ WiLabel.$(OBJEXT) Labels.$(OBJEXT) WiStatusBar.$(OBJEXT) \ WiPara.$(OBJEXT) libwidget_a_OBJECTS = $(am_libwidget_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libwidget_a_SOURCES) DIST_SOURCES = $(libwidget_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libwidget.a libwidget_a_SOURCES = HBox.cpp HBox.h IWidget.cpp IWidget.h Slider.cpp Slider.h VBox.cpp VBox.h WiBox.cpp WiBox.h WiPicture.cpp WiPicture.h WiSpace.h WiContainer.cpp WiContainer.h WiButton.cpp WiButton.h WiLabel.cpp WiLabel.h Labels.cpp Labels.h WiStatusBar.cpp WiStatusBar.h WiPara.cpp WiPara.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/widget/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/widget/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libwidget.a: $(libwidget_a_OBJECTS) $(libwidget_a_DEPENDENCIES) -rm -f libwidget.a $(libwidget_a_AR) libwidget.a $(libwidget_a_OBJECTS) $(libwidget_a_LIBADD) $(RANLIB) libwidget.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HBox.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IWidget.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Labels.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Slider.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/VBox.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WiBox.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WiButton.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WiContainer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WiLabel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WiPara.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WiPicture.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WiStatusBar.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/widget/WiButton.cpp0000644000175000017500000000173110103750402015021 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WiButton.h" #include "BaseMsg.h" #include "MouseStroke.h" //----------------------------------------------------------------- /** * Create button which will send given message on mouse press. */ WiButton::WiButton(IWidget *new_content, BaseMsg *new_msg) : WiContainer(new_content) { m_msg = new_msg; } //----------------------------------------------------------------- /** * Release remain message. */ WiButton::~WiButton() { delete m_msg; } //----------------------------------------------------------------- void WiButton::own_mouseButton(const MouseStroke &stroke) { if (stroke.isLeft()) { m_msg->sendClone(); } } fillets-ng-1.0.1/src/widget/IWidget.h0000644000175000017500000000146710125315646014270 00000000000000#ifndef HEADER_IWIDGET_H #define HEADER_IWIDGET_H class MouseStroke; #include "Drawable.h" #include "V2.h" #include "SDL.h" /** * Widget interface. */ class IWidget : public Drawable { protected: V2 m_shift; std::string m_tip; protected: virtual void own_mouseButton(const MouseStroke &/*stroke*/) {} virtual std::string own_getTip(const V2 &/*loc*/) { return m_tip; } public: IWidget() : m_shift(0, 0) {} virtual int getW() const = 0; virtual int getH() const = 0; virtual void setShift(const V2 &shift) { m_shift = shift; } virtual void setTip(const std::string &tip) { m_tip = tip; } void mouseButton(const MouseStroke &stroke); std::string getTip(const V2 &loc); bool isInside(const V2 &loc); }; #endif fillets-ng-1.0.1/src/widget/Labels.h0000644000175000017500000000117010125315646014125 00000000000000#ifndef HEADER_LABELS_H #define HEADER_LABELS_H class Path; class ResDialogPack; #include "Scripter.h" #include "StringTool.h" /** * Loads localized labels. */ class Labels : public Scripter { private: mutable ResDialogPack *m_labels; public: Labels(const Path &source); virtual ~Labels(); void addLabel(const std::string &name, const std::string &lang, const std::string &text); std::string getLabel(const std::string &name) const; std::string getFormatedLabel(const std::string &name, const StringTool::t_args &args) const; }; #endif fillets-ng-1.0.1/src/widget/Makefile.am0000644000175000017500000000100710316575532014611 00000000000000SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libwidget.a libwidget_a_SOURCES = HBox.cpp HBox.h IWidget.cpp IWidget.h Slider.cpp Slider.h VBox.cpp VBox.h WiBox.cpp WiBox.h WiPicture.cpp WiPicture.h WiSpace.h WiContainer.cpp WiContainer.h WiButton.cpp WiButton.h WiLabel.cpp WiLabel.h Labels.cpp Labels.h WiStatusBar.cpp WiStatusBar.h WiPara.cpp WiPara.h fillets-ng-1.0.1/src/widget/HBox.cpp0000644000175000017500000000231010102323760014102 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "HBox.h" #include "minmax.h" //----------------------------------------------------------------- /** * Starts as empty box. */ HBox::HBox() { m_w = 0; m_h = 0; } //----------------------------------------------------------------- /** * Place widget to the most right place. */ void HBox::addWidget(IWidget *new_widget) { m_widgets.push_back(new_widget); new_widget->setShift(m_shift.plus(V2(m_w, 0))); m_w += new_widget->getW(); m_h = max(m_h, new_widget->getH()); } //----------------------------------------------------------------- /** * Update shift for all subwidgets. */ void HBox::setShift(const V2 &shift) { m_shift = shift; int width = 0; t_widgets::iterator end = m_widgets.end(); for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) { (*i)->setShift(m_shift.plus(V2(width, 0))); width += (*i)->getW(); } } fillets-ng-1.0.1/src/widget/VBox.cpp0000644000175000017500000000267610125054321014136 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "VBox.h" #include "minmax.h" //----------------------------------------------------------------- /** * Starts as empty box. */ VBox::VBox() { m_w = 0; m_h = 0; m_centered = false; } //----------------------------------------------------------------- /** * Place widget to the lowest vertical place. */ void VBox::addWidget(IWidget *new_widget) { m_widgets.push_back(new_widget); m_w = max(m_w, new_widget->getW()); int shiftX = 0; if (m_centered) { shiftX = (m_w - new_widget->getW()) / 2; } new_widget->setShift(m_shift.plus(V2(shiftX, m_h))); m_h += new_widget->getH(); } //----------------------------------------------------------------- /** * Update shift for all subwidgets. */ void VBox::setShift(const V2 &shift) { m_shift = shift; int height = 0; t_widgets::iterator end = m_widgets.end(); for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) { int shiftX = 0; if (m_centered) { shiftX = (m_w - (*i)->getW()) / 2; } (*i)->setShift(m_shift.plus(V2(shiftX, height))); height += (*i)->getH(); } } fillets-ng-1.0.1/src/widget/WiBox.cpp0000644000175000017500000000344310302170335014302 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WiBox.h" //----------------------------------------------------------------- /** * Release all subwidgets. */ WiBox::~WiBox() { t_widgets::iterator end = m_widgets.end(); for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) { delete *i; } } //----------------------------------------------------------------- /** * Draw all subwidgets. */ void WiBox::drawOn(SDL_Surface *screen) { t_widgets::iterator end = m_widgets.end(); for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) { (*i)->drawOn(screen); } } //----------------------------------------------------------------- /** * Returns tooltip for active subwidget. */ std::string WiBox::own_getTip(const V2 &loc) { std::string result = m_tip; t_widgets::iterator end = m_widgets.end(); for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) { std::string subtip = (*i)->getTip(loc); if (!subtip.empty()) { if (result.empty()) { return subtip; } else { return result + " - " + subtip; } } } return result; } //----------------------------------------------------------------- /** * Let all subwidgets to react on button press. */ void WiBox::own_mouseButton(const MouseStroke &stroke) { t_widgets::iterator end = m_widgets.end(); for (t_widgets::iterator i = m_widgets.begin(); i != end; ++i) { (*i)->mouseButton(stroke); } } fillets-ng-1.0.1/src/widget/WiContainer.cpp0000644000175000017500000000330310103750402015465 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WiContainer.h" //----------------------------------------------------------------- /** * Create new container around given widget. * @param new_content subwidget inside * @param border border around subwidget */ WiContainer::WiContainer(IWidget *new_content, int border) { m_content = new_content; m_border = border; } //----------------------------------------------------------------- /** * Release subwidget. */ WiContainer::~WiContainer() { delete m_content; } //----------------------------------------------------------------- int WiContainer::getW() const { return 2 * m_border + m_content->getW(); } //----------------------------------------------------------------- int WiContainer::getH() const { return 2 * m_border + m_content->getH(); } //----------------------------------------------------------------- void WiContainer::setShift(const V2 &shift) { m_shift = shift; m_content->setShift(m_shift.plus(V2(m_border, m_border))); } //----------------------------------------------------------------- /** * Let subwidget to draw. */ void WiContainer::drawOn(SDL_Surface *screen) { m_content->drawOn(screen); } //----------------------------------------------------------------- /** * Default action is to propagate mouse press to subwidget. */ void WiContainer::own_mouseButton(const MouseStroke &stroke) { m_content->mouseButton(stroke); } fillets-ng-1.0.1/src/widget/WiStatusBar.h0000644000175000017500000000120610125315646015133 00000000000000#ifndef HEADER_WISTATUSBAR_H #define HEADER_WISTATUSBAR_H class Font; #include "IWidget.h" #include "SDL.h" #include /** * Statusbar with fixed width. */ class WiStatusBar : public IWidget { private: Font *m_font; SDL_Color m_color; int m_w; std::string m_label; public: WiStatusBar(Font *new_font, const SDL_Color &color, int width=0); virtual ~WiStatusBar(); virtual int getW() const { return m_w; } virtual int getH() const; void setLabel(const std::string &label) { m_label = label; } virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/widget/WiPicture.cpp0000644000175000017500000000161410102323760015163 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WiPicture.h" #include "ResImagePack.h" //----------------------------------------------------------------- WiPicture::WiPicture(const Path &picture) { m_surface = ResImagePack::loadImage(picture); } //----------------------------------------------------------------- WiPicture::~WiPicture() { SDL_FreeSurface(m_surface); } //----------------------------------------------------------------- void WiPicture::drawOn(SDL_Surface *screen) { SDL_Rect rect; rect.x = m_shift.getX(); rect.y = m_shift.getY(); SDL_BlitSurface(m_surface, NULL, screen, &rect); } fillets-ng-1.0.1/src/widget/WiSpace.h0000644000175000017500000000067610102323760014257 00000000000000#ifndef HEADER_WISPACE_H #define HEADER_WISPACE_H #include "IWidget.h" /** * Empty place with width and height. */ class WiSpace : public IWidget { private: int m_w; int m_h; public: WiSpace(int width, int height) : m_w(width), m_h(height) {} virtual int getW() const { return m_w; } virtual int getH() const { return m_h; } virtual void drawOn(SDL_Surface * /*screen*/) {} }; #endif fillets-ng-1.0.1/src/widget/WiButton.h0000644000175000017500000000060210125052225014464 00000000000000#ifndef HEADER_WIBUTTON_H #define HEADER_WIBUTTON_H class BaseMsg; #include "WiContainer.h" /** * Button widget. */ class WiButton : public WiContainer { private: BaseMsg *m_msg; protected: virtual void own_mouseButton(const MouseStroke &stroke); public: WiButton(IWidget *new_content, BaseMsg *new_msg); virtual ~WiButton(); }; #endif fillets-ng-1.0.1/src/widget/WiBox.h0000644000175000017500000000111310125315646013750 00000000000000#ifndef HEADER_WIBOX_H #define HEADER_WIBOX_H #include "IWidget.h" #include /** * Box which care about subwidget layout. * NOTE: soubwidgets should have constant size. */ class WiBox : public IWidget { protected: typedef std::vector t_widgets; t_widgets m_widgets; virtual std::string own_getTip(const V2 &loc); virtual void own_mouseButton(const MouseStroke &stroke); public: virtual ~WiBox(); virtual void addWidget(IWidget *new_widget) = 0; virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/option/0000777000175000017500000000000011632204503012655 500000000000000fillets-ng-1.0.1/src/option/MenuHelp.cpp0000644000175000017500000000354511265714606015035 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "MenuHelp.h" #include "Path.h" #include "WiPara.h" #include "Labels.h" #include "Font.h" #include "HelpInput.h" #include "OptionAgent.h" #include "SurfaceTool.h" //----------------------------------------------------------------- MenuHelp::MenuHelp() { Font usedFont(Path::dataReadPath("font/font_menu.ttf"), 14); SDL_Color usedColor = {255, 255, 255, 255}; Labels labels(Path::dataReadPath("script/labels.lua")); m_help = new WiPara(labels.getLabel("help"), usedFont, usedColor); takeHandler(new HelpInput(this)); registerDrawable(this); registerDrawable(m_help); } //----------------------------------------------------------------- MenuHelp::~MenuHelp() { delete m_help; } //----------------------------------------------------------------- /** * Display help centerd on screen. */ void MenuHelp::own_initState() { own_resumeState(); } //----------------------------------------------------------------- /** * Help will be centred on screen. */ void MenuHelp::own_resumeState() { int contentW = m_help->getW(); int contentH = m_help->getH(); OptionAgent *options = OptionAgent::agent(); int screenW = options->getAsInt("screen_width"); int screenH = options->getAsInt("screen_height"); m_help->setShift( V2((screenW - contentW) / 2, (screenH - contentH) / 2)); } //----------------------------------------------------------------- void MenuHelp::drawOn(SDL_Surface *screen) { SDL_Color gray = {0x00, 0x00, 0x00, 129}; SurfaceTool::alphaFill(screen, NULL, gray); } fillets-ng-1.0.1/src/option/SelectLang.cpp0000644000175000017500000000342410302170335015317 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SelectLang.h" #include "HBox.h" #include "RadioBox.h" #include "def-script.h" #include "Path.h" #include "ScriptState.h" //----------------------------------------------------------------- inline SelectLang * getSelect(lua_State *L) { return dynamic_cast(script_getLeader(L)); } //----------------------------------------------------------------- /** * void select_addFlag(value, picture) */ int script_select_addFlag(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *value = luaL_checkstring(L, 1); const char *picture = luaL_checkstring(L, 2); getSelect(L)->addFlag(value, Path::dataReadPath(picture)); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * Execute script which will add flags. */ SelectLang::SelectLang(const std::string &option, const Path &datafile) { m_option = option; m_activeRow = new HBox(); m_script->registerFunc("select_addFlag", script_select_addFlag); scriptInclude(datafile); addWidget(m_activeRow); } //----------------------------------------------------------------- /** * Stack flags in table. */ void SelectLang::addFlag(const std::string &value, const Path &picture) { IWidget *flag = new RadioBox(m_option, value, picture); flag->setTip(value); m_activeRow->addWidget(flag); if (m_activeRow->getW() > MAX_WIDTH) { addWidget(m_activeRow); m_activeRow = new HBox(); } } fillets-ng-1.0.1/src/option/MenuOptions.cpp0000644000175000017500000001675211265714606015604 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "MenuOptions.h" #include "Path.h" #include "HBox.h" #include "VBox.h" #include "WiPicture.h" #include "WiSpace.h" #include "WiButton.h" #include "WiStatusBar.h" #include "Slider.h" #include "SelectLang.h" #include "RadioBox.h" #include "Font.h" #include "Labels.h" #include "SimpleMsg.h" #include "OptionsInput.h" #include "OptionAgent.h" #include "SurfaceTool.h" #include "StringMsg.h" #include "UnknownMsgException.h" //----------------------------------------------------------------- MenuOptions::MenuOptions() { m_container = NULL; m_statusBar = NULL; m_needRefresh = false; registerDrawable(this); prepareMenu(); takeHandler(new OptionsInput(this)); } //----------------------------------------------------------------- MenuOptions::~MenuOptions() { delete m_container; } //----------------------------------------------------------------- /** * Display menu. */ void MenuOptions::own_initState() { registerWatcher("lang"); own_resumeState(); } //----------------------------------------------------------------- /** * Display options menu. * Menu will be centred on screen. */ void MenuOptions::own_resumeState() { int contentW = m_container->getW(); int contentH = m_container->getH(); OptionAgent *options = OptionAgent::agent(); int screenW = options->getAsInt("screen_width"); int screenH = options->getAsInt("screen_height"); m_container->setShift( V2((screenW - contentW) / 2, (screenH - contentH) / 2)); } //----------------------------------------------------------------- /** * Update statusbar. */ void MenuOptions::own_updateState() { if (m_needRefresh) { m_needRefresh = false; prepareMenu(); own_resumeState(); } std::string tooltip = m_container->getTip(getInput()->getMouseLoc()); m_statusBar->setLabel(tooltip); } //----------------------------------------------------------------- void MenuOptions::prepareMenu() { if (m_container) { deregisterDrawable(m_container); delete m_container; m_container = NULL; } Labels labels(Path::dataReadPath("script/labels.lua")); IWidget *soundBox = createSoundPanel(labels); IWidget *musicBox = createMusicPanel(labels); VBox *vbox = new VBox(); vbox->addWidget(soundBox); vbox->addWidget(new WiSpace(0, 10)); vbox->addWidget(musicBox); vbox->addWidget(new WiSpace(0, 10)); vbox->addWidget(createLangPanel(labels)); vbox->addWidget(new WiSpace(0, 5)); vbox->addWidget(createSpeechPanel(labels)); vbox->addWidget(new WiSpace(0, 5)); vbox->addWidget(createSubtitlesPanel(labels)); IWidget *backButton = createBackButton(labels); m_statusBar = createStatusBar(musicBox->getW() - backButton->getW()); HBox *backBox = new HBox(); backBox->addWidget(m_statusBar); backBox->addWidget(backButton); vbox->addWidget(backBox); m_container = vbox; registerDrawable(m_container); } //----------------------------------------------------------------- IWidget * MenuOptions::createSoundPanel(const Labels &labels) { HBox *soundBox = new HBox(); soundBox->addWidget(new WiPicture( Path::dataReadPath("images/menu/volume_sound.png"))); soundBox->addWidget(new WiSpace(10, 0)); soundBox->addWidget(new Slider("volume_sound", 0, 100)); soundBox->setTip(labels.getLabel("menu_sound")); return soundBox; } //----------------------------------------------------------------- IWidget * MenuOptions::createMusicPanel(const Labels &labels) { HBox *musicBox = new HBox(); musicBox->addWidget(new WiPicture( Path::dataReadPath("images/menu/volume_music.png"))); musicBox->addWidget(new WiSpace(10, 0)); musicBox->addWidget(new Slider("volume_music", 0, 100)); musicBox->setTip(labels.getLabel("menu_music")); return musicBox; } //----------------------------------------------------------------- IWidget * MenuOptions::createLangPanel(const Labels &labels) { HBox *langBox = new HBox(); langBox->addWidget(new WiPicture( Path::dataReadPath("images/menu/lang.png"))); langBox->addWidget(new WiSpace(10, 0)); langBox->addWidget(new SelectLang("lang", Path::dataReadPath("script/select_lang.lua"))); langBox->setTip(labels.getLabel("menu_lang")); return langBox; } //----------------------------------------------------------------- /** * Creates menu to select 'speech'. * NOTE: default speech is customized in "script/init.lua" */ IWidget * MenuOptions::createSpeechPanel(const Labels &labels) { HBox *speechBox = new HBox(); speechBox->addWidget(new WiPicture( Path::dataReadPath("images/menu/speech.png"))); speechBox->addWidget(new WiSpace(10, 0)); speechBox->addWidget(new SelectLang("speech", Path::dataReadPath("script/select_speech.lua"))); speechBox->setTip(labels.getLabel("menu_speech")); return speechBox; } //----------------------------------------------------------------- IWidget * MenuOptions::createSubtitlesPanel(const Labels &labels) { HBox *chooseBox = new HBox(); chooseBox->addWidget(new WiPicture( Path::dataReadPath("images/menu/subtitle.png"))); chooseBox->addWidget(new WiSpace(10, 0)); chooseBox->addWidget(new RadioBox("subtitles", "1", Path::dataReadPath("images/menu/subtitles/yes.png"))); chooseBox->addWidget(new RadioBox("subtitles", "0", Path::dataReadPath("images/menu/subtitles/no.png"))); chooseBox->setTip(labels.getLabel("menu_subtitles")); return chooseBox; } //----------------------------------------------------------------- IWidget * MenuOptions::createBackButton(const Labels &labels) { IWidget *button = new WiButton( new WiPicture(Path::dataReadPath("images/menu/back.png")), new SimpleMsg(this, "quit")); button->setTip(labels.getLabel("menu_back")); return button; } //----------------------------------------------------------------- WiStatusBar * MenuOptions::createStatusBar(int width) { SDL_Color color = {0, 255, 0, 255}; Font *new_font = new Font(Path::dataReadPath("font/font_menu.ttf"), 16); return new WiStatusBar(new_font, color, width); } //----------------------------------------------------------------- /** * Start level under pressed button. * Start pedometer when level is solved already. */ void MenuOptions::mouseButton(const MouseStroke &stroke) { m_container->mouseButton(stroke); } //----------------------------------------------------------------- void MenuOptions::drawOn(SDL_Surface *screen) { SDL_Color gray = {0xf0, 0xf0, 0xf0, 129}; SurfaceTool::alphaFill(screen, NULL, gray); } //----------------------------------------------------------------- /** * Handle incoming message. * Messages: * - param_changed(lang) ... refresh menu * * @throws UnknownMsgException */ void MenuOptions::receiveString(const StringMsg *msg) { if (msg->equalsName("param_changed")) { std::string param = msg->getValue(); if ("lang" == param) { m_needRefresh = true; } else { throw UnknownMsgException(msg); } } else { throw UnknownMsgException(msg); } } fillets-ng-1.0.1/src/option/HelpInput.cpp0000644000175000017500000000164010125653740015215 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "HelpInput.h" #include "Keymap.h" #include "KeyDesc.h" #include "GameState.h" //----------------------------------------------------------------- /** * Escape, space or mouse click quit state. */ HelpInput::HelpInput(GameState *state) : StateInput(state) { } //----------------------------------------------------------------- /** * Quits on unhandled keypress. */ void HelpInput::specStroke(const KeyStroke &/*stroke*/) { quitState(); } //----------------------------------------------------------------- void HelpInput::mouseEvent(const MouseStroke &/*buttons*/) { quitState(); } fillets-ng-1.0.1/src/option/HelpInput.h0000644000175000017500000000073210125653740014663 00000000000000#ifndef HEADER_HELPINPUT_H #define HEADER_HELPINPUT_H class GameState; #include "StateInput.h" /** * Handle input for help screen. */ class HelpInput : public StateInput { protected: virtual void enableHelp() { quitState(); } virtual void enableMenu() { quitState(); } virtual void specStroke(const KeyStroke &stroke); public: HelpInput(GameState *state); virtual void mouseEvent(const MouseStroke &buttons); }; #endif fillets-ng-1.0.1/src/option/Makefile.in0000644000175000017500000003246311632204473014654 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/option DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru liboption_a_AR = $(AR) $(ARFLAGS) liboption_a_LIBADD = am_liboption_a_OBJECTS = MenuOptions.$(OBJEXT) OptionsInput.$(OBJEXT) \ SelectLang.$(OBJEXT) RadioBox.$(OBJEXT) MenuHelp.$(OBJEXT) \ HelpInput.$(OBJEXT) liboption_a_OBJECTS = $(am_liboption_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(liboption_a_SOURCES) DIST_SOURCES = $(liboption_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = liboption.a liboption_a_SOURCES = MenuOptions.cpp MenuOptions.h OptionsInput.cpp OptionsInput.h SelectLang.cpp SelectLang.h RadioBox.cpp RadioBox.h MenuHelp.cpp MenuHelp.h HelpInput.cpp HelpInput.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/option/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/option/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) liboption.a: $(liboption_a_OBJECTS) $(liboption_a_DEPENDENCIES) -rm -f liboption.a $(liboption_a_AR) liboption.a $(liboption_a_OBJECTS) $(liboption_a_LIBADD) $(RANLIB) liboption.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/HelpInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MenuHelp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MenuOptions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OptionsInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/RadioBox.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SelectLang.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/option/OptionsInput.cpp0000644000175000017500000000172710103167727015767 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "OptionsInput.h" #include "MenuOptions.h" //----------------------------------------------------------------- OptionsInput::OptionsInput(MenuOptions *menu) : StateInput(menu) { } //----------------------------------------------------------------- MenuOptions * OptionsInput::getMenu() { return dynamic_cast(m_state); } //----------------------------------------------------------------- /** * Toggle menu. */ void OptionsInput::enableMenu() { quitState(); } //----------------------------------------------------------------- void OptionsInput::mouseEvent(const MouseStroke &buttons) { getMenu()->mouseButton(buttons); } fillets-ng-1.0.1/src/option/MenuHelp.h0000644000175000017500000000126610125534046014470 00000000000000#ifndef HEADER_MENUHELP_H #define HEADER_MENUHELP_H class IWidget; #include "GameState.h" #include "Drawable.h" /** * Help screen. */ class MenuHelp : public GameState, public Drawable { private: IWidget *m_help; protected: virtual void own_initState(); virtual void own_updateState() {} virtual void own_pauseState() {} virtual void own_resumeState(); virtual void own_cleanState() {} public: MenuHelp(); virtual ~MenuHelp(); virtual const char *getName() const { return "state_help"; }; virtual bool allowBg() const { return true; } virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/option/Makefile.am0000644000175000017500000000071310316575532014641 00000000000000SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = liboption.a liboption_a_SOURCES = MenuOptions.cpp MenuOptions.h OptionsInput.cpp OptionsInput.h SelectLang.cpp SelectLang.h RadioBox.cpp RadioBox.h MenuHelp.cpp MenuHelp.h HelpInput.cpp HelpInput.h fillets-ng-1.0.1/src/option/MenuOptions.h0000644000175000017500000000262110155252713015230 00000000000000#ifndef HEADER_MENUOPTIONS_H #define HEADER_MENUOPTIONS_H class Picture; class MouseStroke; class IWidget; class WiStatusBar; class Labels; #include "GameState.h" #include "Drawable.h" /** * Options menu which allow to set lang and tune volume. */ class MenuOptions : public GameState, public Drawable { private: IWidget *m_container; WiStatusBar *m_statusBar; bool m_needRefresh; private: void prepareMenu(); IWidget *createSoundPanel(const Labels &labels); IWidget *createMusicPanel(const Labels &labels); IWidget *createLangPanel(const Labels &labels); IWidget *createSpeechPanel(const Labels &labels); IWidget *createSubtitlesPanel(const Labels &labels); IWidget *createBackButton(const Labels &labels); WiStatusBar *createStatusBar(int width); protected: virtual void own_initState(); virtual void own_updateState(); virtual void own_pauseState() {} virtual void own_resumeState(); virtual void own_cleanState() {} public: MenuOptions(); virtual ~MenuOptions(); virtual const char *getName() const { return "state_options"; }; virtual bool allowBg() const { return true; } void mouseButton(const MouseStroke &stroke); virtual void drawOn(SDL_Surface *screen); void receiveString(const StringMsg *msg); }; #endif fillets-ng-1.0.1/src/option/OptionsInput.h0000644000175000017500000000063210103167727015426 00000000000000#ifndef HEADER_OPTIONSINPUT_H #define HEADER_OPTIONSINPUT_H class MenuOptions; #include "StateInput.h" /** * Handle input for options menu. */ class OptionsInput : public StateInput { private: MenuOptions *getMenu(); protected: virtual void enableMenu(); public: OptionsInput(MenuOptions *menu); virtual void mouseEvent(const MouseStroke &buttons); }; #endif fillets-ng-1.0.1/src/option/SelectLang.h0000644000175000017500000000075010214550157014771 00000000000000#ifndef HEADER_SELECTLANG_H #define HEADER_SELECTLANG_H class Path; #include "VBox.h" #include "Scripter.h" /** * Menu with flags to select prefered lang. */ class SelectLang : public VBox, public Scripter { private: static const int MAX_WIDTH = 200; std::string m_option; WiBox *m_activeRow; public: SelectLang(const std::string &option, const Path &datafile); void addFlag(const std::string &value, const Path &picture); }; #endif fillets-ng-1.0.1/src/option/RadioBox.cpp0000644000175000017500000000266310103750376015021 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "RadioBox.h" #include "WiPicture.h" #include "OptionAgent.h" #include "MouseStroke.h" //----------------------------------------------------------------- RadioBox::RadioBox(const std::string ¶m, const std::string &value, const Path &picture) : WiContainer(new WiPicture(picture), BORDER), m_param(param), m_value(value) { } //----------------------------------------------------------------- /** * Draw border for selected button. */ void RadioBox::drawOn(SDL_Surface *screen) { if (OptionAgent::agent()->getParam(m_param) == m_value) { SDL_Rect rect; rect.x = m_shift.getX(); rect.y = m_shift.getY(); rect.w = getW(); rect.h = getH(); Uint32 green = SDL_MapRGB(screen->format, 0x00, 0xff, 0x00); SDL_FillRect(screen, &rect, green); } WiContainer::drawOn(screen); } //----------------------------------------------------------------- /** * Select button and set param=value. */ void RadioBox::own_mouseButton(const MouseStroke &stroke) { if (stroke.isLeft()) { OptionAgent::agent()->setPersistent(m_param, m_value); } } fillets-ng-1.0.1/src/option/RadioBox.h0000644000175000017500000000104110103750376014453 00000000000000#ifndef HEADER_RADIOBOX_H #define HEADER_RADIOBOX_H class Path; #include "WiContainer.h" /** * Radio box with picture background. */ class RadioBox : public WiContainer { private: static const int BORDER = 4; std::string m_param; std::string m_value; protected: virtual void own_mouseButton(const MouseStroke &stroke); public: RadioBox(const std::string ¶m, const std::string &value, const Path &picture); virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/Makefile.in0000644000175000017500000003366111632204472013344 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-exec-recursive install-info-recursive \ install-recursive installcheck-recursive installdirs-recursive \ pdf-recursive ps-recursive uninstall-info-recursive \ uninstall-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SUBDIRS = SDL_gfx gengine effect widget plan option state level menu game all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(mkdir_p) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \ clean clean-generic clean-recursive ctags ctags-recursive \ distclean distclean-generic distclean-recursive distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/menu/0000777000175000017500000000000011632204504012312 500000000000000fillets-ng-1.0.1/src/menu/WorldMap.h0000644000175000017500000000337710301727630014140 00000000000000#ifndef HEADER_WORLDMAP_H #define HEADER_WORLDMAP_H class Path; class Level; class LevelNode; class NodeDrawer; class ResDialogPack; class LevelDesc; class LevelStatus; class LayeredPicture; #include "Drawable.h" #include "GameState.h" #include "DescFinder.h" #include "V2.h" /** * Map with path from one level to another. */ class WorldMap : public GameState, public DescFinder, public Drawable { private: V2 m_lastMouseLoc; LevelNode *m_startNode; LevelNode *m_selected; LevelNode *m_ending; NodeDrawer *m_drawer; ResDialogPack *m_descPack; LevelStatus *m_levelStatus; LayeredPicture *m_bg; Uint32 m_activeMask; Uint32 m_maskIntro; Uint32 m_maskExit; Uint32 m_maskCredits; Uint32 m_maskOptions; private: void prepareBg(); void watchCursor(); Level *createSelected() const; void markSolved(); bool checkEnding() const; void runIntro(); void runCredits(); void runOptions(); protected: virtual void own_initState(); virtual void own_updateState(); virtual void own_pauseState() {} virtual void own_resumeState(); virtual void own_cleanState(); public: WorldMap(); virtual ~WorldMap(); virtual const char *getName() const { return "state_worldmap"; }; void initMap(const Path &mapfile); virtual void drawOn(SDL_Surface *screen); void selectNextLevel(); void runSelected(); void addDesc(const std::string &codename, LevelDesc *desc); virtual std::string findLevelName(const std::string &codename) const; virtual std::string findDesc(const std::string &codename) const; }; #endif fillets-ng-1.0.1/src/menu/SolverDrawer.h0000644000175000017500000000035310125052224015013 00000000000000#ifndef HEADER_SOLVERDRAWER_H #define HEADER_SOLVERDRAWER_H class LevelStatus; #include "VBox.h" /** * Draws the best solver. */ class SolverDrawer : public VBox { public: SolverDrawer(LevelStatus *status); }; #endif fillets-ng-1.0.1/src/menu/WorldInput.cpp0000644000175000017500000000310210301727630015037 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WorldInput.h" #include "WorldMap.h" #include "Keymap.h" #include "KeyStroke.h" #include "MouseStroke.h" //----------------------------------------------------------------- WorldInput::WorldInput(WorldMap *world) : GameInput(world) { //TODO: 'O' ... options, 'I' ... intro, 'E' ... exit, 'C' ... credits KeyDesc key_tab(KEY_TAB, "select next level"); KeyDesc key_enter(KEY_ENTER, "run selected"); m_keymap->registerKey(KeyStroke(SDLK_TAB, KMOD_NONE), key_tab); m_keymap->registerKey(KeyStroke(SDLK_RETURN, KMOD_NONE), key_enter); } //----------------------------------------------------------------- WorldMap * WorldInput::getWorld() { return dynamic_cast(m_state); } //----------------------------------------------------------------- void WorldInput::specKey(int keyIndex) { switch (keyIndex) { case KEY_TAB: getWorld()->selectNextLevel(); break; case KEY_ENTER: getWorld()->runSelected(); break; default: GameInput::specKey(keyIndex); } } //----------------------------------------------------------------- void WorldInput::mouseEvent(const MouseStroke &buttons) { if (buttons.isLeft()) { getWorld()->runSelected(); } } fillets-ng-1.0.1/src/menu/SolverDrawer.cpp0000644000175000017500000000323310152763433015361 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SolverDrawer.h" #include "Log.h" #include "Path.h" #include "Font.h" #include "Labels.h" #include "LevelStatus.h" #include "WiPara.h" #include "BaseException.h" //----------------------------------------------------------------- /** * Prepares to draw info about best solver. * @param status shared level status */ SolverDrawer::SolverDrawer(LevelStatus *status) { try { Font usedFont(Path::dataReadPath("font/font_menu.ttf"), 14); SDL_Color usedColor = {255, 255, 255, 255}; Labels labels(Path::dataReadPath("script/labels.lua")); const char *labelName; switch (status->compareToBest()) { case 1: labelName = "solver_better"; break; case 0: labelName = "solver_equals"; break; default: labelName = "solver_worse"; } StringTool::t_args args; args.push_back(""); args.push_back(StringTool::toString(status->getBestMoves())); args.push_back(status->getBestAuthor()); WiPara *para = new WiPara( labels.getFormatedLabel(labelName, args), usedFont, usedColor); para->enableCentered(); para->recenter(); addWidget(para); } catch (BaseException &e) { LOG_WARNING(e.info()); } } fillets-ng-1.0.1/src/menu/worldmap-script.cpp0000644000175000017500000000556710125123400016065 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "worldmap-script.h" #include "WorldBranch.h" #include "LevelDesc.h" #include "LevelNode.h" #include "def-script.h" //----------------------------------------------------------------- inline WorldBranch * getWorld(lua_State *L) { return dynamic_cast(script_getLeader(L)); } //----------------------------------------------------------------- /** * void worldmap_addDesc(codename, lang, levelname, desc) */ int script_worldmap_addDesc(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *codename = luaL_checkstring(L, 1); const char *lang = luaL_checkstring(L, 2); const char *levelname = luaL_checkstring(L, 3); const char *desc = luaL_checkstring(L, 4); LevelDesc *dialog = new LevelDesc(lang, levelname, desc); getWorld(L)->addDesc(codename, dialog); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void branch_addNode(parent, codename, datafile, x, y, * hidden=false, poster="") */ int script_branch_addNode(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *parent = luaL_checkstring(L, 1); const char *codename = luaL_checkstring(L, 2); const char *datafile = luaL_checkstring(L, 3); int nodeX = luaL_checkint(L, 4); int nodeY = luaL_checkint(L, 5); bool hidden = lua_toboolean(L, 6); const char *poster = luaL_optstring(L, 7, ""); LevelNode *node = new LevelNode(codename, Path::dataReadPath(datafile), V2(nodeX, nodeY), poster); getWorld(L)->addNode(parent, node, hidden); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void branch_setEnding(codename, datafile, poster="") */ int script_branch_setEnding(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *codename = luaL_checkstring(L, 1); const char *datafile = luaL_checkstring(L, 2); const char *poster = luaL_optstring(L, 3, ""); LevelNode *node = new LevelNode(codename, Path::dataReadPath(datafile), V2(-1, -1), poster); getWorld(L)->setEnding(node); END_NOEXCEPTION; return 0; } //----------------------------------------------------------------- /** * void node_bestSolution(codename, moves, author) */ int script_node_bestSolution(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *codename = luaL_checkstring(L, 1); int moves = luaL_checkint(L, 2); const char *author = luaL_checkstring(L, 3); getWorld(L)->bestSolution(codename, moves, author); END_NOEXCEPTION; return 0; } fillets-ng-1.0.1/src/menu/WorldMap.cpp0000644000175000017500000002157211206054270014466 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WorldMap.h" #include "LevelNode.h" #include "NodeDrawer.h" #include "LevelStatus.h" #include "ResImagePack.h" #include "StateManager.h" #include "WorldInput.h" #include "Log.h" #include "Path.h" #include "WorldBranch.h" #include "OptionAgent.h" #include "VideoAgent.h" #include "SoundAgent.h" #include "LogicException.h" #include "ResDialogPack.h" #include "LevelDesc.h" #include "Level.h" #include "Pedometer.h" #include "LayeredPicture.h" #include "MenuOptions.h" #include "DemoMode.h" #include "PosterScroller.h" #include "MovieState.h" #include "Log.h" //----------------------------------------------------------------- WorldMap::WorldMap() : m_lastMouseLoc(-1, -1) { m_selected = NULL; m_startNode = NULL; m_ending = NULL; prepareBg(); m_drawer = new NodeDrawer(); m_descPack = new ResDialogPack(); m_levelStatus = new LevelStatus(); takeHandler(new WorldInput(this)); registerDrawable(m_bg); registerDrawable(this); } //----------------------------------------------------------------- WorldMap::~WorldMap() { if (m_startNode) { delete m_startNode; } if (m_ending) { delete m_ending; } delete m_bg; m_descPack->removeAll(); delete m_descPack; delete m_drawer; delete m_levelStatus; } //----------------------------------------------------------------- /** * Prepare background with buttons. */ void WorldMap::prepareBg() { m_bg = new LayeredPicture( Path::dataReadPath("images/menu/map.png"), V2(0, 0), Path::dataReadPath("images/menu/map_lower.png"), Path::dataReadPath("images/menu/map_mask.png")); m_maskIntro = m_bg->getMaskAt(V2(0, 0)); m_maskExit = m_bg->getMaskAt(V2(m_bg->getW() - 1, 0)); m_maskCredits = m_bg->getMaskAt(V2(0, m_bg->getH() - 1)); m_maskOptions = m_bg->getMaskAt(V2(m_bg->getW() - 1, m_bg->getH() - 1)); m_activeMask = m_bg->getNoMask(); } //----------------------------------------------------------------- /** * Read dots postions and level descriptions. * @throws LogicException when cannot parse data file */ void WorldMap::initMap(const Path &mapfile) { WorldBranch parser(NULL); m_startNode = parser.parseMap(mapfile, &m_ending, m_descPack); if (NULL == m_startNode) { throw LogicException(ExInfo("cannot create world map") .addInfo("file", mapfile.getNative())); } } //----------------------------------------------------------------- /** * Display menu and play menu music. */ void WorldMap::own_initState() { m_levelStatus->setRunning(true); own_resumeState(); } //----------------------------------------------------------------- void WorldMap::own_updateState() { if (m_ending && m_selected == m_ending) { runSelected(); } else { watchCursor(); } } //----------------------------------------------------------------- /** * Display menu and play menu music. */ void WorldMap::own_resumeState() { LevelNode *nextLevel = NULL; if (m_levelStatus->wasRunning()) { if (m_levelStatus->isComplete()) { markSolved(); if (checkEnding()) { nextLevel = m_ending; } } m_levelStatus->setRunning(false); OptionAgent *options = OptionAgent::agent(); options->setParam("caption", findDesc("menu")); options->setParam("screen_width", m_bg->getW()); options->setParam("screen_height", m_bg->getH()); VideoAgent::agent()->initVideoMode(); } m_selected = nextLevel; SoundAgent::agent()->playMusic( Path::dataReadPath("music/menu.ogg"), NULL); } //----------------------------------------------------------------- /** * Stop music. */ void WorldMap::own_cleanState() { SoundAgent::agent()->stopMusic(); } //----------------------------------------------------------------- /** * Mark node or mask under cursor as selected. */ void WorldMap::watchCursor() { V2 mouseLoc = getInput()->getMouseLoc(); if (!m_lastMouseLoc.equals(mouseLoc)) { m_lastMouseLoc = mouseLoc; m_selected = m_startNode->findSelected(mouseLoc); } m_activeMask = m_bg->getMaskAtWorld(mouseLoc); if (m_activeMask == m_maskIntro || m_activeMask == m_maskExit || m_activeMask == m_maskCredits || m_activeMask == m_maskOptions) { m_bg->setActiveMask(m_activeMask); } else { m_bg->setNoActive(); } } //----------------------------------------------------------------- /** * Select next unsolved level. */ void WorldMap::selectNextLevel() { m_selected = m_startNode->findNextOpen(m_selected); } //----------------------------------------------------------------- /** * Start level under pressed button. * Start pedometer when level is solved already. */ void WorldMap::runSelected() { Level *level = createSelected(); if (level) { m_levelStatus->prepareRun(m_selected->getCodename(), m_selected->getPoster(), m_selected->getBestMoves(), m_selected->getBestAuthor()); level->fillStatus(m_levelStatus); if (m_selected->getState() == LevelNode::STATE_SOLVED) { Pedometer *pedometer = new Pedometer(m_levelStatus, level); pushState(pedometer); } else { pushState(level); } } else { if (m_activeMask == m_maskIntro) { runIntro(); } else if (m_activeMask == m_maskExit) { quitState(); } else if (m_activeMask == m_maskCredits) { runCredits(); } else if (m_activeMask == m_maskOptions) { runOptions(); } } } //----------------------------------------------------------------- /** * Return selected level or NULL. */ Level * WorldMap::createSelected() const { Level *result = NULL; if (m_selected) { result = m_selected->createLevel(); result->fillDesc(this); } return result; } //----------------------------------------------------------------- void WorldMap::markSolved() { if (m_selected) { m_selected->setState(LevelNode::STATE_SOLVED); } } //----------------------------------------------------------------- /** * Try run ending node. * Ending node is started when all levels were solved. * @return true when ending is started */ bool WorldMap::checkEnding() const { bool result = false; if (m_ending && m_selected != m_ending) { if (m_selected->isLeaf()) { if (m_startNode->areAllSolved()) { result = true; } } } return result; } //----------------------------------------------------------------- void WorldMap::drawOn(SDL_Surface *screen) { m_drawer->setScreen(screen); m_startNode->drawPath(m_drawer); if (m_selected) { m_drawer->drawSelect(m_selected->getLoc()); m_drawer->drawSelected(findLevelName(m_selected->getCodename())); } } //----------------------------------------------------------------- std::string WorldMap::findLevelName(const std::string &codename) const { std::string result; const LevelDesc *desc = dynamic_cast(m_descPack->findDialogHard(codename)); if (desc) { result = desc->getLevelName(); } else { result = codename; } return result; } //----------------------------------------------------------------- std::string WorldMap::findDesc(const std::string &codename) const { std::string result; const LevelDesc *desc = dynamic_cast(m_descPack->findDialogHard(codename)); if (desc) { result = desc->getDesc(); } else { result = "???"; } return result; } //----------------------------------------------------------------- void WorldMap::runIntro() { #ifdef HAVE_SMPEG Path movieFile = Path::dataReadPath("images/menu/intro.mpg"); if (movieFile.exists()) { pushState(new MovieState(movieFile)); return; } LOG_WARNING(ExInfo("cannot find intro") .addInfo("file", movieFile.getNative())); #endif pushState(new DemoMode(Path::dataReadPath("script/share/demo_intro.lua"))); } //----------------------------------------------------------------- void WorldMap::runCredits() { pushState(new PosterScroller( Path::dataReadPath("images/menu/credits.png"))); } //----------------------------------------------------------------- void WorldMap::runOptions() { MenuOptions *options = new MenuOptions(); pushState(options); } fillets-ng-1.0.1/src/menu/LevelNode.cpp0000644000175000017500000001475110301727630014621 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "LevelNode.h" #include "Level.h" #include "NodeDrawer.h" #include #include //----------------------------------------------------------------- /** * Default state is STATE_FAR. */ LevelNode::LevelNode(const std::string &codename, const Path &datafile, const V2 &loc, const std::string &poster) : m_codename(codename), m_poster(poster), m_datafile(datafile), m_loc(loc) { m_state = STATE_FAR; m_depth = 1; m_bestMoves = -1; } //----------------------------------------------------------------- /** * Free self and all children. */ LevelNode::~LevelNode() { t_children::iterator end = m_children.end(); for (t_children::iterator i = m_children.begin(); i != end; ++i) { delete *i; } } //----------------------------------------------------------------- /** * Set state for this node and open his followers. */ void LevelNode::setState(eState state) { t_children::iterator end = m_children.end(); switch (state) { case STATE_HIDDEN: case STATE_FAR: case STATE_OPEN: break; case STATE_SOLVED: for (t_children::iterator i = m_children.begin(); i != end; ++i) { if ((*i)->getState() < STATE_OPEN) { (*i)->setState(STATE_OPEN); } } break; default: assert(!"unknown level node state"); break; } m_state = state; } //----------------------------------------------------------------- void LevelNode::bestSolution(int moves, const std::string &author) { m_bestMoves = moves; m_bestAuthor = author; } //----------------------------------------------------------------- /** * Returns true when cursor is in radius around node. */ bool LevelNode::isUnder(const V2 &cursor) const { double dx = m_loc.getX() - cursor.getX(); double dy = m_loc.getY() - cursor.getY(); return (sqrt(dx * dx + dy * dy) < DOT_RADIUS); } //----------------------------------------------------------------- /** * Find selected node under cursor. * Only solved and open nodes are traversed. * @return selected node or NULL */ LevelNode * LevelNode::findSelected(const V2 &cursor) { if (m_state >= STATE_OPEN) { if (isUnder(cursor)) { return this; } else { t_children::const_iterator end = m_children.end(); for (t_children::const_iterator i = m_children.begin(); i != end; ++i) { LevelNode *selected = (*i)->findSelected(cursor); if (selected) { return selected; } } } } return NULL; } //----------------------------------------------------------------- /** * Find next OPEN node. * @param current current selected node (could be NULL) * @return next OPEN node or NULL */ LevelNode * LevelNode::findNextOpen(const LevelNode *current) { bool beforeCurrent = true; t_children opened = findOpenNodes(); t_children::const_iterator end = opened.end(); for (t_children::const_iterator i = opened.begin(); i != end; ++i) { if (*i == current) { beforeCurrent = false; } else if (!beforeCurrent) { return *i; } } if (opened.size() > 0) { return opened[0]; } else { return NULL; } } //----------------------------------------------------------------- /** * Find all OPEN child nodes. * @return vector of shared pointers */ LevelNode::t_children LevelNode::findOpenNodes() { t_children opened; if (m_state >= STATE_OPEN) { if (m_state == STATE_OPEN) { opened.push_back(this); } t_children::const_iterator end = m_children.end(); for (t_children::const_iterator i = m_children.begin(); i != end; ++i) { t_children nodes = (*i)->findOpenNodes(); opened.insert(opened.end(), nodes.begin(), nodes.end()); } } return opened; } //----------------------------------------------------------------- /** * Find named node in whole tree. * @return named node or NULL */ LevelNode * LevelNode::findNamed(const std::string &codename) { if (m_codename == codename) { return this; } else { t_children::const_iterator end = m_children.end(); for (t_children::const_iterator i = m_children.begin(); i != end; ++i) { LevelNode *named = (*i)->findNamed(codename); if (named) { return named; } } } return NULL; } //----------------------------------------------------------------- /** * Returns true when all child nodes are solved. */ bool LevelNode::areAllSolved() const { if (m_state != STATE_SOLVED) { return false; } t_children::const_iterator end = m_children.end(); for (t_children::const_iterator i = m_children.begin(); i != end; ++i) { if (!(*i)->areAllSolved()) { return false; } } return true; } //----------------------------------------------------------------- Level * LevelNode::createLevel() const { return new Level(m_codename, m_datafile, m_depth); } //----------------------------------------------------------------- /** * Add child node. * NOTE: cycles in graph are not supported. */ void LevelNode::addChild(LevelNode *new_node) { m_children.push_back(new_node); new_node->setDepth(m_depth + 1); if (m_state == STATE_SOLVED && new_node->getState() < STATE_OPEN) { new_node->setState(STATE_OPEN); } } //----------------------------------------------------------------- /** * Draws self and path to all children. * Children are drawed recursive. */ void LevelNode::drawPath(const NodeDrawer *drawer) const { if (m_state > STATE_HIDDEN) { t_children::const_iterator end = m_children.end(); for (t_children::const_iterator i = m_children.begin(); i != end; ++i) { if ((*i)->getState() > STATE_HIDDEN) { drawer->drawEdge(this, *i); (*i)->drawPath(drawer); } } drawer->drawNode(this); } } fillets-ng-1.0.1/src/menu/LevelDesc.cpp0000644000175000017500000000113210066370031014574 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "LevelDesc.h" //----------------------------------------------------------------- LevelDesc::LevelDesc(const std::string &lang, const std::string &levelname, const std::string &desc) : Dialog(lang, "", desc) { m_levelname = levelname; } fillets-ng-1.0.1/src/menu/Pedometer.cpp0000644000175000017500000001422311206053677014672 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Pedometer.h" #include "LevelStatus.h" #include "Level.h" #include "PedoInput.h" #include "LayeredPicture.h" #include "ResImagePack.h" #include "StateManager.h" #include "NodeDrawer.h" #include "SolverDrawer.h" #include "Level.h" #include "minmax.h" #include "StringMsg.h" #include "UnknownMsgException.h" //----------------------------------------------------------------- Pedometer::Pedometer(LevelStatus *status, Level *new_level) { m_level = new_level; m_status = status; m_solution = m_status->readSolvedMoves(); m_meterPhase = 0; m_bg = NULL; prepareBg(); prepareRack(); m_numbers = ResImagePack::loadImage( Path::dataReadPath("images/menu/numbers.png")); takeHandler(new PedoInput(this)); registerDrawable(m_bg); registerDrawable(m_rack); registerDrawable(this); } //----------------------------------------------------------------- Pedometer::~Pedometer() { if (m_level) { delete m_level; } SDL_FreeSurface(m_numbers); delete m_rack; delete m_bg; } //----------------------------------------------------------------- /** * Draw level name on background. */ void Pedometer::prepareBg() { SDL_Surface *bgSurface = ResImagePack::loadImage( Path::dataReadPath("images/menu/map.png")); NodeDrawer drawer; drawer.setScreen(bgSurface); drawer.drawSelected(m_level->getLevelName()); SolverDrawer solver(m_status); solver.setShift(V2((bgSurface->w - solver.getW()) / 2, bgSurface->h - 150)); solver.drawOn(bgSurface); if (m_bg) { m_bg->changePicture(bgSurface); } else { m_bg = new Picture(bgSurface, V2(0, 0)); } } //----------------------------------------------------------------- void Pedometer::prepareRack() { static const int POS_X = 193; static const int POS_Y = 141; m_rack = new LayeredPicture( Path::dataReadPath("images/menu/pedometer.png"), V2(POS_X, POS_Y), Path::dataReadPath("images/menu/pedometer_lower.png"), Path::dataReadPath("images/menu/pedometer_mask.png")); //TODO: don't use numeric constants for coordinates m_maskRun = m_rack->getMaskAt(V2(86, 100)); m_maskReplay = m_rack->getMaskAt(V2(128, 100)); m_maskCancel = m_rack->getMaskAt(V2(170, 100)); m_activeMask = m_rack->getNoMask(); } //----------------------------------------------------------------- /** * Display menu and play menu music. */ void Pedometer::own_initState() { registerWatcher("lang"); own_resumeState(); } //----------------------------------------------------------------- void Pedometer::own_updateState() { watchCursor(); } //----------------------------------------------------------------- /** * Mark pixel under cursor as ative mask. */ void Pedometer::watchCursor() { V2 mouseLoc = getInput()->getMouseLoc(); m_activeMask = m_rack->getMaskAtWorld(mouseLoc); if (m_activeMask == m_maskRun || m_activeMask == m_maskReplay || m_activeMask == m_maskCancel) { m_rack->setActiveMask(m_activeMask); } else { m_rack->setNoActive(); } } //----------------------------------------------------------------- /** * Start selected button. */ void Pedometer::runSelected() { if (m_activeMask == m_maskRun) { runLevel(); } else if (m_activeMask == m_maskReplay) { runReplay(); } else { quitState(); } } //----------------------------------------------------------------- void Pedometer::runLevel() { Level *levelState = m_level; m_level = NULL; GameState *poster = m_status->createPoster(); if (poster) { poster->setNextState(levelState); changeState(poster); } else { changeState(levelState); } } //----------------------------------------------------------------- void Pedometer::runReplay() { Level *levelState = m_level; m_level = NULL; changeState(levelState); levelState->loadReplay(m_solution); } //----------------------------------------------------------------- void Pedometer::drawOn(SDL_Surface *screen) { drawNumbers(screen, m_solution.size()); } //----------------------------------------------------------------- /** * Draw number of steps. * Draw nice rotating numbers. */ void Pedometer::drawNumbers(SDL_Surface *screen, int value) { static const int CIPHERS = 5; static const int POS_X = 275; static const int POS_Y = 177; static const int SHIFT_SPEED = 8; int numberWidth = m_numbers->w; int numberHeight = m_numbers->h / 10; for (int i = CIPHERS - 1; i >= 0; --i) { int cipher = value % 10; value /= 10; int x = POS_X + numberWidth * i; int shiftY = max(numberHeight * (9 - cipher), numberHeight * 9 - SHIFT_SPEED * m_meterPhase); m_meterPhase++; drawNumber(screen, x, POS_Y, shiftY); } } //----------------------------------------------------------------- void Pedometer::drawNumber(SDL_Surface *screen, int x, int y, int shiftY) { SDL_Rect dest_rect; dest_rect.x = x; dest_rect.y = y; SDL_Rect src_rect; src_rect.x = 0; src_rect.y = shiftY; src_rect.w = m_numbers->w; src_rect.h = m_numbers->h / 10; SDL_BlitSurface(m_numbers, &src_rect, screen, &dest_rect); } //----------------------------------------------------------------- /** * Handle incoming message. * Messages: * - param_changed(lang) ... refresh bg * * @throws UnknownMsgException */ void Pedometer::receiveString(const StringMsg *msg) { if (msg->equalsName("param_changed")) { std::string param = msg->getValue(); if ("lang" == param) { prepareBg(); } else { throw UnknownMsgException(msg); } } else { throw UnknownMsgException(msg); } } fillets-ng-1.0.1/src/menu/NodeDrawer.cpp0000644000175000017500000001075511206053631014774 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "NodeDrawer.h" #include "ResImagePack.h" #include "Font.h" #include "Log.h" #include "V2.h" #include "Path.h" #include "LevelNode.h" #include "TimerAgent.h" #include "minmax.h" #include "SDL_gfxPrimitives.h" //----------------------------------------------------------------- NodeDrawer::NodeDrawer() { m_font = new Font(Path::dataReadPath("font/font_menu.ttf"), 22); m_imagePack = new ResImagePack(); m_imagePack->addImage("solved", Path::dataReadPath("images/menu/n0.png")); m_imagePack->addImage("open", Path::dataReadPath("images/menu/n1.png")); m_imagePack->addImage("open", Path::dataReadPath("images/menu/n2.png")); m_imagePack->addImage("open", Path::dataReadPath("images/menu/n3.png")); m_imagePack->addImage("open", Path::dataReadPath("images/menu/n4.png")); m_imagePack->addImage("far", Path::dataReadPath("images/menu/n_far.png")); } //----------------------------------------------------------------- NodeDrawer::~NodeDrawer() { m_imagePack->removeAll(); delete m_imagePack; delete m_font; } //----------------------------------------------------------------- /** * Draw blinking dot centred on node position. */ void NodeDrawer::drawNode(const LevelNode *node) const { V2 loc = node->getLoc(); drawDot(m_imagePack->getRes("far"), loc); SDL_Surface *dot = NULL; switch (node->getState()) { case LevelNode::STATE_FAR: return; case LevelNode::STATE_OPEN: { int phase = TimerAgent::agent()->getCycles() % 10; if (phase > 4) { phase--; } if (phase > 7) { phase--; } if (phase >= 4) { phase = 7 - phase; } dot = m_imagePack->getRes("open", phase); } break; case LevelNode::STATE_SOLVED: dot = m_imagePack->getRes("solved"); break; default: LOG_WARNING(ExInfo("don't know how to draw node") .addInfo("state", node->getState())); return; } drawDot(dot, loc); } //----------------------------------------------------------------- /** * Draw centred. * @param x x cord. or centre * @param x y cord. or centre */ void NodeDrawer::drawDot(SDL_Surface *dot, const V2 &loc) const { SDL_Rect rect; rect.x = loc.getX() - dot->w / 2; rect.y = loc.getY() - dot->h / 2; SDL_BlitSurface(dot, NULL, m_screen, &rect); } //----------------------------------------------------------------- /** * Highlightes selected node. */ void NodeDrawer::drawSelect(const V2 &loc) const { const SDL_Surface *dot = m_imagePack->getRes("solved"); int radius = max(dot->w, dot->h) / 2 + 1; Uint32 colorRGBA = 0xffc61880; filledCircleColor(m_screen, loc.getX(), loc.getY(), radius, colorRGBA); } //----------------------------------------------------------------- /** * Draws name of selected level. */ void NodeDrawer::drawSelected(const std::string &levelname) const { //TODO: draw deflected text int text_width = m_font->calcTextWidth(levelname); SDL_Rect rect; rect.x = (m_screen->w - text_width) / 2; rect.y = m_screen->h - 50; SDL_Color color = {255, 255, 0, 255}; SDL_Surface *surface = m_font->renderTextOutlined(levelname, color); SDL_BlitSurface(surface, NULL, m_screen, &rect); SDL_FreeSurface(surface); } //----------------------------------------------------------------- void NodeDrawer::drawEdge(const LevelNode *start, const LevelNode *end) const { //TODO: nice curves Sint16 x1 = start->getLoc().getX(); Sint16 y1 = start->getLoc().getY(); Sint16 x2 = end->getLoc().getX(); Sint16 y2 = end->getLoc().getY(); Uint32 colorRGBA = 0xffff00ff; aalineColor(m_screen, x1, y1, x2, y2, colorRGBA); aalineColor(m_screen, x1 - 1, y1 - 1 , x2 - 1, y2 - 1, colorRGBA); aalineColor(m_screen, x1 + 1, y1 + 1 , x2 + 1, y2 + 1, colorRGBA); aalineColor(m_screen, x1 - 1, y1 + 1 , x2 - 1, y2 + 1, colorRGBA); aalineColor(m_screen, x1 + 1, y1 - 1 , x2 + 1, y2 - 1, colorRGBA); } fillets-ng-1.0.1/src/menu/PedoInput.h0000644000175000017500000000070210125270216014304 00000000000000#ifndef HEADER_PEDOINPUT_H #define HEADER_PEDOINPUT_H class Keymap; class Pedometer; #include "GameInput.h" /** * Handle input for pedometer. */ class PedoInput : public GameInput { private: Pedometer *getPedo(); protected: virtual void enableSubtitles() {} virtual void enableHelp() {} public: PedoInput(Pedometer *pedometer); virtual void mouseEvent(const MouseStroke &buttons); }; #endif fillets-ng-1.0.1/src/menu/WorldInput.h0000644000175000017500000000111210301727630014503 00000000000000#ifndef HEADER_WORLDINPUT_H #define HEADER_WORLDINPUT_H class Keymap; class WorldMap; #include "GameInput.h" /** * Handle input for worldmap. */ class WorldInput : public GameInput { private: static const int KEY_TAB = 101; static const int KEY_ENTER = 102; private: WorldMap *getWorld(); protected: virtual void enableSubtitles() {} virtual void enableHelp() {} virtual void specKey(int keyIndex); public: WorldInput(WorldMap *world); virtual void mouseEvent(const MouseStroke &buttons); }; #endif fillets-ng-1.0.1/src/menu/Pedometer.h0000644000175000017500000000263110155372130014325 00000000000000#ifndef HEADER_PEDOMETER_H #define HEADER_PEDOMETER_H class Level; class LevelStatus; class LayeredPicture; class Picture; #include "Drawable.h" #include "GameState.h" #include "SDL.h" #include /** * Pedometer with tree buttons. */ class Pedometer : public GameState, public Drawable { private: Picture *m_bg; LayeredPicture *m_rack; SDL_Surface *m_numbers; LevelStatus *m_status; Level *m_level; Uint32 m_activeMask; Uint32 m_maskRun; Uint32 m_maskReplay; Uint32 m_maskCancel; std::string m_solution; int m_meterPhase; private: void prepareBg(); void prepareRack(); void watchCursor(); void runLevel(); void runReplay(); void drawNumbers(SDL_Surface *screen, int value); void drawNumber(SDL_Surface *screen, int x, int y, int shiftY); protected: virtual void own_initState(); virtual void own_updateState(); virtual void own_pauseState() {} virtual void own_resumeState() {} virtual void own_cleanState() {} public: Pedometer(LevelStatus *status, Level *level); virtual ~Pedometer(); virtual const char *getName() const { return "state_pedometer"; }; void runSelected(); virtual void drawOn(SDL_Surface *screen); void receiveString(const StringMsg *msg); }; #endif fillets-ng-1.0.1/src/menu/NodeDrawer.h0000644000175000017500000000146410301727630014440 00000000000000#ifndef HEADER_NODEDRAWER_H #define HEADER_NODEDRAWER_H class V2; class LevelNode; class ResImagePack; class Font; #include "NoCopy.h" #include "SDL.h" #include /** * Drawer which know how to draw nodes on path. */ class NodeDrawer : public NoCopy { private: ResImagePack *m_imagePack; SDL_Surface *m_screen; Font *m_font; private: void drawDot(SDL_Surface *dot, const V2 &loc) const; public: NodeDrawer(); virtual ~NodeDrawer(); void setScreen(SDL_Surface *screen) { m_screen = screen; } void drawNode(const LevelNode *node) const; void drawEdge(const LevelNode *start, const LevelNode *end) const; void drawSelect(const V2 &loc) const; void drawSelected(const std::string &levelname) const; }; #endif fillets-ng-1.0.1/src/menu/Makefile.in0000644000175000017500000003352411632204473014307 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/menu DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libmenu_a_AR = $(AR) $(ARFLAGS) libmenu_a_LIBADD = am_libmenu_a_OBJECTS = LevelDesc.$(OBJEXT) LevelNode.$(OBJEXT) \ NodeDrawer.$(OBJEXT) PedoInput.$(OBJEXT) Pedometer.$(OBJEXT) \ WorldInput.$(OBJEXT) WorldMap.$(OBJEXT) WorldBranch.$(OBJEXT) \ worldmap-script.$(OBJEXT) SolverDrawer.$(OBJEXT) libmenu_a_OBJECTS = $(am_libmenu_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libmenu_a_SOURCES) DIST_SOURCES = $(libmenu_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan -I@top_srcdir@/src/option -I@top_srcdir@/src/state -I@top_srcdir@/src/level $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libmenu.a libmenu_a_SOURCES = LevelDesc.cpp LevelDesc.h LevelNode.cpp LevelNode.h NodeDrawer.cpp NodeDrawer.h PedoInput.cpp PedoInput.h Pedometer.cpp Pedometer.h WorldInput.cpp WorldInput.h WorldMap.cpp WorldMap.h WorldBranch.cpp WorldBranch.h worldmap-script.cpp worldmap-script.h SolverDrawer.cpp SolverDrawer.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/menu/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/menu/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libmenu.a: $(libmenu_a_OBJECTS) $(libmenu_a_DEPENDENCIES) -rm -f libmenu.a $(libmenu_a_AR) libmenu.a $(libmenu_a_OBJECTS) $(libmenu_a_LIBADD) $(RANLIB) libmenu.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LevelDesc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LevelNode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/NodeDrawer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PedoInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Pedometer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SolverDrawer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WorldBranch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WorldInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WorldMap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/worldmap-script.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/menu/worldmap-script.h0000644000175000017500000000056511210505417015533 00000000000000#ifndef HEADER_WORLDMAP_SCRIPT_H #define HEADER_WORLDMAP_SCRIPT_H extern "C" { #include "lua.h" } /** * Fuctions for worldmap. */ extern int script_worldmap_addDesc(lua_State *L) throw(); extern int script_branch_addNode(lua_State *L) throw(); extern int script_branch_setEnding(lua_State *L) throw(); extern int script_node_bestSolution(lua_State *L) throw(); #endif fillets-ng-1.0.1/src/menu/Makefile.am0000644000175000017500000000121310316575532014271 00000000000000SDL_GFX_CFLAGS = -I@top_srcdir@/src/SDL_gfx INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan -I@top_srcdir@/src/option -I@top_srcdir@/src/state -I@top_srcdir@/src/level $(SDL_GFX_CFLAGS) $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libmenu.a libmenu_a_SOURCES = LevelDesc.cpp LevelDesc.h LevelNode.cpp LevelNode.h NodeDrawer.cpp NodeDrawer.h PedoInput.cpp PedoInput.h Pedometer.cpp Pedometer.h WorldInput.cpp WorldInput.h WorldMap.cpp WorldMap.h WorldBranch.cpp WorldBranch.h worldmap-script.cpp worldmap-script.h SolverDrawer.cpp SolverDrawer.h fillets-ng-1.0.1/src/menu/LevelNode.h0000644000175000017500000000365610301727630014270 00000000000000#ifndef HEADER_LEVELNODE_H #define HEADER_LEVELNODE_H class Level; class NodeDrawer; #include "V2.h" #include "Path.h" #include "NoCopy.h" #include #include /** * Node on the map. */ class LevelNode : public NoCopy { public: enum eState { STATE_HIDDEN, STATE_FAR, STATE_OPEN, STATE_SOLVED }; private: static const int DOT_RADIUS = 13; std::string m_codename; std::string m_poster; Path m_datafile; V2 m_loc; eState m_state; int m_depth; typedef std::vector t_children; t_children m_children; int m_bestMoves; std::string m_bestAuthor; private: bool isUnder(const V2 &cursor) const; t_children findOpenNodes(); public: LevelNode(const std::string &codename, const Path &datafile, const V2 &loc, const std::string &poster=""); virtual ~LevelNode(); void setState(eState state); eState getState() const { return m_state; } void setDepth(int depth) { m_depth = depth; } int getDepth() const { return m_depth; } void bestSolution(int moves, const std::string &author); int getBestMoves() const { return m_bestMoves; } std::string getBestAuthor() const { return m_bestAuthor; } std::string getCodename() const { return m_codename; } V2 getLoc() const { return m_loc; } std::string getPoster() const { return m_poster; } Level *createLevel() const; void addChild(LevelNode *new_node); LevelNode *findSelected(const V2 &cursor); LevelNode *findNextOpen(const LevelNode *current); LevelNode *findNamed(const std::string &codename); bool areAllSolved() const; bool isLeaf() const { return m_children.empty(); } void drawPath(const NodeDrawer *drawer) const; }; #endif fillets-ng-1.0.1/src/menu/LevelDesc.h0000644000175000017500000000074010066370031014245 00000000000000#ifndef HEADER_LEVELDESC_H #define HEADER_LEVELDESC_H #include "Dialog.h" /** * Multi lang. level description. */ class LevelDesc : public Dialog { private: std::string m_levelname; public: LevelDesc(const std::string &lang, const std::string &levelname, const std::string &desc); std::string getLevelName() const { return m_levelname; } std::string getDesc() const { return getSubtitle(); } }; #endif fillets-ng-1.0.1/src/menu/PedoInput.cpp0000644000175000017500000000163410125270216014644 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "PedoInput.h" #include "Pedometer.h" #include "Keymap.h" #include "KeyStroke.h" #include "MouseStroke.h" //----------------------------------------------------------------- PedoInput::PedoInput(Pedometer *pedometer) : GameInput(pedometer) { } //----------------------------------------------------------------- Pedometer * PedoInput::getPedo() { return dynamic_cast(m_state); } //----------------------------------------------------------------- void PedoInput::mouseEvent(const MouseStroke &buttons) { if (buttons.isLeft()) { getPedo()->runSelected(); } } fillets-ng-1.0.1/src/menu/WorldBranch.cpp0000644000175000017500000001314311374164557015161 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WorldBranch.h" #include "def-script.h" #include "Log.h" #include "Path.h" #include "LevelNode.h" #include "LevelStatus.h" #include "ScriptState.h" #include "ResDialogPack.h" #include "LevelDesc.h" #include "LogicException.h" #include "worldmap-script.h" //----------------------------------------------------------------- WorldBranch::WorldBranch(LevelNode *root) { m_root = root; m_ending = NULL; m_outPack = NULL; m_script->registerFunc("worldmap_addDesc", script_worldmap_addDesc); m_script->registerFunc("branch_addNode", script_branch_addNode); m_script->registerFunc("branch_setEnding", script_branch_setEnding); m_script->registerFunc("node_bestSolution", script_node_bestSolution); } //----------------------------------------------------------------- /** * Execute script which will add nodes. * @param datafile worldmap file * @param outEnding pointer to store ending node. It is not changed when * endingNode is set. * @param destPack pack to store node descriptions * @return root node (can be NULL) */ LevelNode * WorldBranch::parseMap(const Path &datafile, LevelNode **outEnding, ResDialogPack *destPack) { m_outPack = destPack; scriptInclude(datafile); m_outPack = NULL; if (m_ending) { if (outEnding) { *outEnding = m_ending; } else { throw LogicException(ExInfo("cannot export ending node") .addInfo("ending", m_ending->getCodename())); } } if (m_root && m_root->getState() < LevelNode::STATE_OPEN) { m_root->setState(LevelNode::STATE_OPEN); } return m_root; } //----------------------------------------------------------------- void WorldBranch::addDesc(const std::string &codename, LevelDesc *desc) { if (m_outPack) { m_outPack->addRes(codename, desc); } else { throw LogicException(ExInfo("cannot export level description") .addInfo("codename", codename)); } } //----------------------------------------------------------------- /** * Add new node to branch. */ void WorldBranch::addNode(const std::string &parent, LevelNode *new_node, bool hidden) { prepareNode(new_node, hidden); insertNode(parent, new_node); } //----------------------------------------------------------------- /** * Take ending node. */ void WorldBranch::setEnding(LevelNode *new_node) { if (m_ending) { delete m_ending; } m_ending = new_node; if (wasSolved(m_ending->getCodename())) { m_ending->setState(LevelNode::STATE_SOLVED); } else { m_ending->setState(LevelNode::STATE_OPEN); } m_ending->setDepth(-1); } //----------------------------------------------------------------- /** * Store best solution author. * @param codename level codename * @param moves number of moves in solution * @param author solution author */ void WorldBranch::bestSolution(const std::string &codename, int moves, const std::string &author) { LevelNode *node = m_root->findNamed(codename); if (node) { node->bestSolution(moves, author); } else { LOG_WARNING(ExInfo("there is no such node") .addInfo("codename", codename) .addInfo("moves", moves) .addInfo("author", author)); } } //----------------------------------------------------------------- /** * Returns true when level will solved in the past. */ bool WorldBranch::wasSolved(const std::string &codename) { Path solved = Path::dataReadPath(LevelStatus::getSolutionFilename(codename)); return solved.exists(); } //----------------------------------------------------------------- /** * Set node state. * @param hidden whether node is start node of hidden branch */ void WorldBranch::prepareNode(LevelNode *node, bool hidden) { if (wasSolved(node->getCodename())) { node->setState(LevelNode::STATE_SOLVED); } else if (hidden) { node->setState(LevelNode::STATE_HIDDEN); } else { node->setState(LevelNode::STATE_FAR); } } //----------------------------------------------------------------- /** * Insert node as parent child. * @throws LogicException when error occurs */ void WorldBranch::insertNode(const std::string &parent, LevelNode *new_node) { try { if (parent == "" && m_root) { throw LogicException(ExInfo("there is a one root node already") .addInfo("root", m_root->getCodename()) .addInfo("new_node", new_node->getCodename())); } if (m_root) { LevelNode *parentNode = m_root->findNamed(parent); if (parentNode) { parentNode->addChild(new_node); } else { throw LogicException(ExInfo("there is no such parent node") .addInfo("parent", parent) .addInfo("new_node", new_node->getCodename())); } } else { if (parent != "") { LOG_WARNING(ExInfo("root node should have empty parent") .addInfo("parent", parent) .addInfo("new_node", new_node->getCodename())); } m_root = new_node; } } catch (...) { delete new_node; throw; } } fillets-ng-1.0.1/src/menu/WorldBranch.h0000644000175000017500000000202210125123400014567 00000000000000#ifndef HEADER_WORLDBRANCH_H #define HEADER_WORLDBRANCH_H class Path; class LevelNode; class LevelDesc; class ResDialogPack; #include "Scripter.h" #include /** * Can read graph of level nodes. */ class WorldBranch : public Scripter { private: LevelNode *m_root; LevelNode *m_ending; ResDialogPack *m_outPack; private: bool wasSolved(const std::string &codename); void prepareNode(LevelNode *node, bool hidden); void insertNode(const std::string &parent, LevelNode *new_node); public: WorldBranch(LevelNode *root); LevelNode* parseMap(const Path &datafile, LevelNode **outEnding, ResDialogPack *des); void addDesc(const std::string &codename, LevelDesc *desc); void addNode(const std::string &parent, LevelNode *new_node, bool hidden); void setEnding(LevelNode *new_node); void bestSolution(const std::string &codename, int moves, const std::string &author); }; #endif fillets-ng-1.0.1/src/Makefile.am0000644000175000017500000000011410106500146013306 00000000000000 SUBDIRS = SDL_gfx gengine effect widget plan option state level menu game fillets-ng-1.0.1/src/effect/0000777000175000017500000000000011632204503012601 500000000000000fillets-ng-1.0.1/src/effect/ResColorPack.h0000644000175000017500000000053011205343627015222 00000000000000#ifndef HEADER_RESCOLORPACK_H #define HEADER_RESCOLORPACK_H #include "ResourcePack.h" #include "Color.h" /** * Pack of color aliases. */ class ResColorPack : public ResourcePack { public: virtual const char *getName() const { return "color_pack"; } virtual void unloadRes(Color *res) { delete res; } }; #endif fillets-ng-1.0.1/src/effect/EffectNone.cpp0000644000175000017500000000124411212533711015236 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "EffectNone.h" const char *EffectNone::NAME = "none"; //----------------------------------------------------------------- /** * Blit without special effect. */ void EffectNone::blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y) { SDL_Rect rect; rect.x = x; rect.y = y; SDL_BlitSurface(surface, NULL, screen, &rect); } fillets-ng-1.0.1/src/effect/EffectDisintegrate.h0000644000175000017500000000125211212534331016424 00000000000000#ifndef HEADER_EFFECTDISINTEGRATE_H #define HEADER_EFFECTDISINTEGRATE_H #include "ViewEffect.h" /** * Draw disintegrating skeleton. */ class EffectDisintegrate : public ViewEffect { private: static const int DISINT_START = 400; static const int DISINT_SPEED = 30; int m_disint; public: EffectDisintegrate(); static const char *NAME; virtual const char* getName() const { return NAME; } virtual void updateEffect(); virtual bool isDisintegrated() const; virtual bool isInvisible() const; virtual void blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y); }; #endif fillets-ng-1.0.1/src/effect/SurfaceTool.cpp0000644000175000017500000000640211266035326015461 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SurfaceTool.h" #include "SDLException.h" //----------------------------------------------------------------- /** * Return new empty surface with the same format. * @param surface surface to ask for pixel format * @param width width or 0 for the same width * @param height height or 0 for the same height * @throws SDLException when function fails */ SDL_Surface * SurfaceTool::createEmpty(SDL_Surface *surface, int width, int height) { if (!width) { width = surface->w; } if (!height) { height = surface->h; } SDL_Surface *result = SDL_CreateRGBSurface(surface->flags, width, height, surface->format->BitsPerPixel, surface->format->Rmask, surface->format->Gmask, surface->format->Bmask, surface->format->Amask); if (NULL == result) { throw SDLException(ExInfo("CreateRGBSurface")); } return result; } //----------------------------------------------------------------- /** * Return new surface with transparent background. */ SDL_Surface * SurfaceTool::createTransparent(int w, int h, const SDL_Color &transparent) { SDL_Surface *surface = SDL_CreateRGBSurface(SDL_SWSURFACE|SDL_SRCCOLORKEY, w, h, 32, 0, 0, 0, 0); if (NULL == surface) { throw SDLException(ExInfo("CreateRGBSurface")); } Uint32 transparentKey = SDL_MapRGB(surface->format, transparent.r, transparent.g, transparent.b); SDL_SetColorKey(surface, SDL_SRCCOLORKEY|SDL_RLEACCEL, transparentKey); SurfaceTool::alphaFill(surface, NULL, transparent); return surface; } //----------------------------------------------------------------- /** * Return new cloned surface. * @return new surface, free it after use * @throws SDLException when function fails */ SDL_Surface * SurfaceTool::createClone(SDL_Surface *surface) { SDL_Surface *clone = SDL_ConvertSurface(surface, surface->format, surface->flags); if (NULL == clone) { throw SDLException(ExInfo("ConvertSurface")); } return clone; } //----------------------------------------------------------------- /** * Fill surface with given color. Alpha value in color is supported. * The final blit rectangle is saved in dstrect. * * @param surface surface to fill * @param dstrect dstrect or NULL (the whole surface will be filled with color). * @param color {red, green, blue, alpha} */ void SurfaceTool::alphaFill(SDL_Surface *surface, SDL_Rect *dstrect, const SDL_Color &color) { int w = surface->w; int h = surface->h; if (dstrect) { w = dstrect->w; h = dstrect->h; } SDL_Surface *canvas = createEmpty(surface, w, h); Uint32 pixel = SDL_MapRGB(canvas->format, color.r, color.g, color.b); SDL_FillRect(canvas, NULL, pixel); SDL_SetAlpha(canvas, SDL_SRCALPHA|SDL_RLEACCEL, color.unused); SDL_BlitSurface(canvas, NULL, surface, dstrect); SDL_FreeSurface(canvas); } fillets-ng-1.0.1/src/effect/TTFException.h0000644000175000017500000000036310067627713015221 00000000000000#ifndef HEADER_TTFEXCEPTION_H #define HEADER_TTFEXCEPTION_H #include "BaseException.h" /** * Exception about SDL_ttf fail. */ class TTFException : public BaseException { public: TTFException(const ExInfo &problem); }; #endif fillets-ng-1.0.1/src/effect/PixelTool.h0000644000175000017500000000142610114610251014603 00000000000000#ifndef HEADER_PIXELTOOL_H #define HEADER_PIXELTOOL_H #include "SDL.h" /** * Pixel rutines. */ class PixelTool { public: static bool colorEquals(const SDL_Color &color1, const SDL_Color &color2); static Uint32 convertColor(SDL_PixelFormat *format, const SDL_Color &color); static SDL_Color getColor(SDL_Surface *surface, int x, int y); static void putColor(SDL_Surface *surface, int x, int y, const SDL_Color &color); static Uint32 getPixel(SDL_Surface *surface, int x, int y); static void putPixel(SDL_Surface *surface, int x, int y, Uint32 pixel); static Uint32 unpackPixel(Uint8 bpp, Uint8 *p); static void packPixel(Uint8 bpp, Uint8 *p, Uint32 pixel); }; #endif fillets-ng-1.0.1/src/effect/SurfaceLock.cpp0000644000175000017500000000171010067627713015436 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "SurfaceLock.h" #include "SDLException.h" //----------------------------------------------------------------- /** * Lock surface when necessary. * @throws SDLException when surface cannot be locked */ SurfaceLock::SurfaceLock(SDL_Surface *surface) { m_surface = surface; if (SDL_MUSTLOCK(m_surface)) { if (SDL_LockSurface(m_surface) < 0) { throw SDLException(ExInfo("LockSurface")); } } } //----------------------------------------------------------------- /** * Unlock surface. */ SurfaceLock::~SurfaceLock() { if (SDL_MUSTLOCK(m_surface)) { SDL_UnlockSurface(m_surface); } } fillets-ng-1.0.1/src/effect/Font.cpp0000644000175000017500000001113311341547133014134 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Font.h" #include "Log.h" #include "Path.h" #include "TTFException.h" #include "SDLException.h" #include "Outline.h" #ifdef HAVE_FRIBIDI #include "fribidi.h" #endif std::string Font::biditize(const std::string &text) { #ifdef HAVE_FRIBIDI FriBidiCharType base = FRIBIDI_TYPE_ON; FriBidiChar *logicalString = new FriBidiChar[text.length() + 1]; FriBidiChar *visualString = new FriBidiChar[text.length() + 1]; int ucsLength = fribidi_charset_to_unicode(FRIBIDI_CHAR_SET_UTF8, const_cast(text.c_str()), text.length(), logicalString); fribidi_boolean ok = fribidi_log2vis(logicalString, ucsLength, &base, visualString, NULL, NULL, NULL); if (!ok) { LOG_WARNING(ExInfo("cannot biditize text") .addInfo("text", text)); return text; } char *buffer = new char[text.length() + 1]; int length = fribidi_unicode_to_charset(FRIBIDI_CHAR_SET_UTF8, visualString, ucsLength, buffer); std::string result = std::string(buffer, length); delete[] buffer; delete[] visualString; delete[] logicalString; return result; #else return text; #endif } //----------------------------------------------------------------- /** * Create new font from file. * Initialized TTF_Init when necessary. * @param file_ttf path to ttf file * @param height font height * @throws TTFException when cannot open font */ Font::Font(const Path &file_ttf, int height) { m_ttfont = TTF_OpenFont(file_ttf.getNative().c_str(), height); if (!m_ttfont) { throw TTFException(ExInfo("OpenFont") .addInfo("file", file_ttf.getNative())); } //NOTE: bg color will be set to be transparent SDL_Color bg = {10, 10, 10, 0}; m_bg = bg; } //----------------------------------------------------------------- Font::~Font() { TTF_CloseFont(m_ttfont); } //----------------------------------------------------------------- /** * Prepare font rendering. * @throws TTFException when cannot init SDL_ttf. */ void Font::init() { if (TTF_Init() < 0) { throw TTFException(ExInfo("Init")); } } //----------------------------------------------------------------- /** * Deinit font subsystem. */ void Font::shutdown() { TTF_Quit(); } //----------------------------------------------------------------- int Font::calcTextWidth(const std::string &text) { int w; TTF_SizeUTF8(m_ttfont, text.c_str(), &w, NULL); return w; } //----------------------------------------------------------------- /** * Render text with this color. * @param text utf-8 encoded text * @param color text color * @return new rendered surface * @throws TTFException when render fails * @throws SDLException when converting fails */ SDL_Surface * Font::renderText(const std::string &text, const SDL_Color &color) const { std::string content = biditize(text); if (text.empty()) { content = " "; LOG_WARNING(ExInfo("empty text to render") .addInfo("r", color.r) .addInfo("g", color.g) .addInfo("b", color.b)); } SDL_Surface *raw_surface = TTF_RenderUTF8_Shaded(m_ttfont, content.c_str(), color, m_bg); if (!raw_surface) { throw TTFException(ExInfo("RenderUTF8") .addInfo("text", text)); } //NOTE: at index 0 is bg color if (SDL_SetColorKey(raw_surface, SDL_SRCCOLORKEY, 0) < 0) { throw SDLException(ExInfo("SetColorKey")); } SDL_Surface *surface = SDL_DisplayFormat(raw_surface); if (!surface) { throw SDLException(ExInfo("DisplayFormat")); } SDL_FreeSurface(raw_surface); return surface; } //----------------------------------------------------------------- /** * Render text with black outline around font. * @param text utf-8 encoded text * @param color text color * @param outlineWidth outline width * @return new rendered surface */ SDL_Surface * Font::renderTextOutlined(const std::string &text, const SDL_Color &color, int outlineWidth) const { static const SDL_Color BLACK = {0, 0, 0, 255}; //NOTE: uses spaces to ensure space for outline SDL_Surface *surface = renderText(" " + text + " ", color); Outline outline(BLACK, outlineWidth); outline.drawOnColorKey(surface); return surface; } fillets-ng-1.0.1/src/effect/PixelTool.cpp0000644000175000017500000001101410114651472015142 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "PixelTool.h" #include "LogicException.h" #include //----------------------------------------------------------------- /** * Compare colors. * NOTE: aplha values are ignored */ bool PixelTool::colorEquals(const SDL_Color &color1, const SDL_Color &color2) { return color1.r == color2.r && color1.g == color2.g && color1.b == color2.b; } //----------------------------------------------------------------- Uint32 PixelTool::convertColor(SDL_PixelFormat *format, const SDL_Color &color) { return SDL_MapRGB(format, color.r, color.g, color.b); } //----------------------------------------------------------------- /** * Get color at x, y. * Surface must be locked. * @return color */ SDL_Color PixelTool::getColor(SDL_Surface *surface, int x, int y) { SDL_Color color; SDL_GetRGBA(getPixel(surface, x, y), surface->format, &color.r, &color.g, &color.b, &color.unused); return color; } //----------------------------------------------------------------- /** * Put color at x, y. * Surface must be locked. * TODO: support alpha values */ void PixelTool::putColor(SDL_Surface *surface, int x, int y, const SDL_Color &color) { Uint32 pixel = SDL_MapRGBA(surface->format, color.r, color.g, color.b, color.unused); putPixel(surface, x, y, pixel); } //----------------------------------------------------------------- /** * Get pixel at x, y. * Surface must be locked. * @return pixel */ Uint32 PixelTool::getPixel(SDL_Surface *surface, int x, int y) { assert((0 <= x && x < surface->w) && (0 <= y && y < surface->h)); int bpp = surface->format->BytesPerPixel; Uint8 *p = static_cast(surface->pixels) + y * surface->pitch + x * bpp; return unpackPixel(bpp, p); } //----------------------------------------------------------------- /** * Put pixel at x, y. * Surface must be locked. */ void PixelTool::putPixel(SDL_Surface *surface, int x, int y, Uint32 pixel) { if ((0 <= x && x < surface->w) && (0 <= y && y < surface->h)) { int bpp = surface->format->BytesPerPixel; Uint8 *p = static_cast(surface->pixels) + y * surface->pitch + x * bpp; packPixel(bpp, p, pixel); } } //----------------------------------------------------------------- /** * Decodes pixel from memory. * @param bpp color depth (8, 16, 24, 32) * @param p pointer to the memory * @return pixel in bpp color depth * @throws LogicException for unknown color depth */ Uint32 PixelTool::unpackPixel(Uint8 bpp, Uint8 *p) { switch(bpp) { case 1: // 8bit return *p; case 2: // 16bit return *reinterpret_cast(p); case 3: // 24bit if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { return p[0] << 16 | p[1] << 8 | p[2]; } else { return p[0] | p[1] << 8 | p[2] << 16; } case 4: // 32 bit return *reinterpret_cast(p); default: throw LogicException(ExInfo("unknown color depth") .addInfo("bpp", bpp)); } } //----------------------------------------------------------------- /** * Encodes pixel to memory. * @param bpp color depth (8, 16, 24, 32) * @param p pointer to the memory * @param pixel prepared pixel in bpp color depth * @throws LogicException for unknown color depth */ void PixelTool::packPixel(Uint8 bpp, Uint8 *p, Uint32 pixel) { assert(p != NULL); switch(bpp) { case 1: *p = pixel; break; case 2: *reinterpret_cast(p) = pixel; break; case 3: if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { p[0] = (pixel >> 16) & 0xff; p[1] = (pixel >> 8) & 0xff; p[2] = pixel & 0xff; } else { p[0] = pixel & 0xff; p[1] = (pixel >> 8) & 0xff; p[2] = (pixel >> 16) & 0xff; } break; case 4: *reinterpret_cast(p) = pixel; break; default: throw LogicException(ExInfo("unknown color depth") .addInfo("bpp", bpp)); } } fillets-ng-1.0.1/src/effect/EffectReverse.cpp0000644000175000017500000000201411212534255015752 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "EffectReverse.h" #include "SurfaceLock.h" #include "PixelTool.h" const char *EffectReverse::NAME = "reverse"; //----------------------------------------------------------------- /** * Reverse left and right. */ void EffectReverse::blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y) { SurfaceLock lock1(screen); SurfaceLock lock2(surface); for (int py = 0; py < surface->h; ++py) { for (int px = 0; px < surface->w; ++px) { SDL_Color pixel = PixelTool::getColor(surface, px, py); if (pixel.unused == 255) { PixelTool::putColor(screen, x + surface->w - 1 - px, y + py, pixel); } } } } fillets-ng-1.0.1/src/effect/EffectZx.h0000644000175000017500000000136111212534363014411 00000000000000#ifndef HEADER_EFFECTZX_H #define HEADER_EFFECTZX_H #include "ViewEffect.h" /** * Blinking like ZX spectrum loading. */ class EffectZx : public ViewEffect { private: enum eCorner { ZX1 = 1, ZX2 = 2, ZX3 = 3, ZX4 = 4 }; static const double STRIPE_STANDARD; static const double STRIPE_NARROW; int m_zx; int m_phase; double m_countHeight; double m_stripeHeight; public: EffectZx(); static const char *NAME; virtual const char* getName() const { return NAME; } virtual void updateEffect(); virtual void blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y); }; #endif fillets-ng-1.0.1/src/effect/EffectReverse.h0000644000175000017500000000061611212534355015426 00000000000000#ifndef HEADER_EFFECTREVERSE_H #define HEADER_EFFECTREVERSE_H #include "ViewEffect.h" /** * Blit with reversed left and right side. */ class EffectReverse : public ViewEffect { public: static const char *NAME; virtual const char* getName() const { return NAME; } virtual void blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y); }; #endif fillets-ng-1.0.1/src/effect/Picture.h0000644000175000017500000000131510155372126014307 00000000000000#ifndef HEADER_PICTURE_H #define HEADER_PICTURE_H class Path; #include "Drawable.h" #include "V2.h" /** * Static picture at fixed screen position. */ class Picture : public Drawable { protected: V2 m_loc; SDL_Surface *m_surface; public: Picture(const Path &file, const V2 &loc); Picture(SDL_Surface *new_surface, const V2 &loc); virtual ~Picture(); int getW() const { return m_surface->w; } int getH() const { return m_surface->h; } virtual void drawOn(SDL_Surface *screen); void setLoc(const V2 &loc) { m_loc = loc; } void changePicture(const Path &file); void changePicture(SDL_Surface *new_surface); }; #endif fillets-ng-1.0.1/src/effect/PixelIterator.cpp0000644000175000017500000000440110115646003016013 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "PixelIterator.h" #include "SurfaceLock.h" #include "PixelTool.h" #include //----------------------------------------------------------------- /** * Creates new pixel iterator and locks the surface. */ PixelIterator::PixelIterator(SDL_Surface *surface) { m_surface = surface; m_lock = new SurfaceLock(m_surface); m_p = static_cast(surface->pixels); m_end = m_p + m_surface->h * m_surface->pitch; m_bpp = surface->format->BytesPerPixel; } //----------------------------------------------------------------- /** * Unlocks surface. */ PixelIterator::~PixelIterator() { delete m_lock; } //----------------------------------------------------------------- void PixelIterator::setPos(const V2 &pos) { int x = pos.getX(); int y = pos.getY(); assert((0 <= x && x < m_surface->w) && (0 <= y && y < m_surface->h)); m_p = static_cast(m_surface->pixels) + y * m_surface->pitch + x * m_bpp; } //----------------------------------------------------------------- bool PixelIterator::isTransparent() const { return getPixel() == m_surface->format->colorkey; } //----------------------------------------------------------------- SDL_Color PixelIterator::getColor() const { SDL_Color color; SDL_GetRGBA(getPixel(), m_surface->format, &color.r, &color.g, &color.b, &color.unused); return color; } //----------------------------------------------------------------- Uint32 PixelIterator::getPixel() const { return PixelTool::unpackPixel(m_bpp, m_p); } //----------------------------------------------------------------- void PixelIterator::putColor(const SDL_Color &color) { Uint32 pixel = SDL_MapRGBA(m_surface->format, color.r, color.g, color.b, color.unused); putPixel(pixel); } //----------------------------------------------------------------- void PixelIterator::putPixel(Uint32 pixel) { PixelTool::packPixel(m_bpp, m_p, pixel); } fillets-ng-1.0.1/src/effect/EffectDisintegrate.cpp0000644000175000017500000000364111212534154016766 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "EffectDisintegrate.h" #include "SurfaceLock.h" #include "PixelTool.h" #include "Random.h" const char *EffectDisintegrate::NAME = "disintegrate"; //----------------------------------------------------------------- /** * Start as not disintegrated. */ EffectDisintegrate::EffectDisintegrate() { m_disint = DISINT_START; } //----------------------------------------------------------------- void EffectDisintegrate::updateEffect() { if (m_disint > 0) { m_disint -= DISINT_SPEED; if (m_disint < 0) { m_disint = 0; } } } //----------------------------------------------------------------- /** * Returns true for object for who the disint effect is finished. */ bool EffectDisintegrate::isDisintegrated() const { return 0 == m_disint; } //----------------------------------------------------------------- bool EffectDisintegrate::isInvisible() const { return isDisintegrated(); } //----------------------------------------------------------------- /** * Disintegration effect. * Draw only some pixels. */ void EffectDisintegrate::blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y) { SurfaceLock lock1(screen); SurfaceLock lock2(surface); for (int py = 0; py < surface->h; ++py) { for (int px = 0; px < surface->w; ++px) { if (Random::aByte(py * surface->w + px) < m_disint) { SDL_Color pixel = PixelTool::getColor(surface, px, py); if (pixel.unused == 255) { PixelTool::putColor(screen, x + px, y + py, pixel); } } } } } fillets-ng-1.0.1/src/effect/Outline.h0000644000175000017500000000144710073033756014323 00000000000000#ifndef HEADER_OUTLINE_H #define HEADER_OUTLINE_H #include "SDL.h" /** * Outline around picture. * Used to outline rendered text. */ class Outline { private: int m_width; SDL_Color m_color; Uint32 m_pixel; private: SDL_Surface *cloneSurface(SDL_Surface *surface); void precomputePixel(SDL_PixelFormat *format); void drawOneLayer(SDL_Surface *surface, Uint32 bgKey); void drawAlongCopy(SDL_Surface *surface, Uint32 bgKey, SDL_Surface *copy); void fillNeighbourhood(SDL_Surface *surface, Uint32 bgKey, int x, int y); public: Outline(const SDL_Color &color, int width); void drawOnColorKey(SDL_Surface *surface); void drawOn(SDL_Surface *surface, Uint32 bgKey); }; #endif fillets-ng-1.0.1/src/effect/LayeredPicture.h0000644000175000017500000000154210103147555015616 00000000000000#ifndef HEADER_LAYEREDPICTURE_H #define HEADER_LAYEREDPICTURE_H #include "Picture.h" #include "SDL.h" /** * Picture with two layers and color mask. */ class LayeredPicture : public Picture { private: static const Uint32 MASK_NO = static_cast(-1); SDL_Surface *m_lowerLayer; SDL_Surface *m_colorMask; Uint32 m_activeColor; public: LayeredPicture(const Path &bg_file, const V2 &loc, const Path &lowerLayer, const Path &colorMask); ~LayeredPicture(); void setNoActive() { m_activeColor = MASK_NO; } void setActiveMask(Uint32 color) { m_activeColor = color; } Uint32 getMaskAtWorld(const V2 &worldLoc); Uint32 getMaskAt(const V2 &loc); Uint32 getNoMask() const { return MASK_NO; } virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/effect/PixelIterator.h0000644000175000017500000000142310115646003015461 00000000000000#ifndef HEADER_PIXELITERATOR_H #define HEADER_PIXELITERATOR_H class SurfaceLock; #include "V2.h" #include "NoCopy.h" #include "SDL.h" /** * Iterator over surface pixels. */ class PixelIterator : public NoCopy { private: SDL_Surface *m_surface; SurfaceLock *m_lock; Uint8 *m_p; Uint8 *m_end; Uint8 m_bpp; public: PixelIterator(SDL_Surface *surface); virtual ~PixelIterator(); void setPos(const V2 &pos); inline bool isValid() const { return m_p < m_end; } inline void inc() { m_p += m_bpp; } bool isTransparent() const; SDL_Color getColor() const; Uint32 getPixel() const; void putColor(const SDL_Color &color); void putPixel(Uint32 pixel); }; #endif fillets-ng-1.0.1/src/effect/SurfaceLock.h0000644000175000017500000000047110067627713015106 00000000000000#ifndef HEADER_SURFACELOCK_H #define HEADER_SURFACELOCK_H #include "NoCopy.h" #include "SDL.h" /** * Lock and unlock surface. */ class SurfaceLock : public NoCopy { private: SDL_Surface *m_surface; public: SurfaceLock(SDL_Surface *surface); virtual ~SurfaceLock(); }; #endif fillets-ng-1.0.1/src/effect/LayeredPicture.cpp0000644000175000017500000000636610103732562016160 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "LayeredPicture.h" #include "Path.h" #include "ResImagePack.h" #include "ResourceException.h" #include "SurfaceLock.h" #include "PixelTool.h" //----------------------------------------------------------------- /** * Create picture with two layers and color mask to select * active areas. * * @throws ResourceException when lowerLayer and colorMask have * different proportions */ LayeredPicture::LayeredPicture(const Path &bg_file, const V2 &loc, const Path &lowerLayer, const Path &colorMask) : Picture(bg_file, loc) { m_lowerLayer = ResImagePack::loadImage(lowerLayer); m_colorMask = ResImagePack::loadImage(colorMask); if (m_lowerLayer->w != m_colorMask->w || m_lowerLayer->h != m_colorMask->h) { SDL_FreeSurface(m_lowerLayer); SDL_FreeSurface(m_colorMask); SDL_FreeSurface(m_surface); throw ResourceException(ExInfo( "lowerLayer and colorMask have different proportions") .addInfo("lowerLayer", lowerLayer.getNative()) .addInfo("colorMask", colorMask.getNative())); } setNoActive(); } //----------------------------------------------------------------- LayeredPicture::~LayeredPicture() { SDL_FreeSurface(m_lowerLayer); SDL_FreeSurface(m_colorMask); } //----------------------------------------------------------------- /** * Return pixel at worldLoc. * Translates world coordinates to local coordinates. */ Uint32 LayeredPicture::getMaskAtWorld(const V2 &worldLoc) { V2 localLoc = worldLoc.minus(m_loc); return getMaskAt(localLoc); } //----------------------------------------------------------------- /** * Return pixel at position from left top image corner. */ Uint32 LayeredPicture::getMaskAt(const V2 &loc) { Uint32 result = MASK_NO; if ((0 <= loc.getX() && loc.getX() < m_colorMask->w) && (0 <= loc.getY() && loc.getY() < m_colorMask->h)) { SurfaceLock lock1(m_colorMask); result = PixelTool::getPixel(m_colorMask, loc.getX(), loc.getY()); } return result; } //----------------------------------------------------------------- void LayeredPicture::drawOn(SDL_Surface *screen) { Picture::drawOn(screen); if (m_activeColor == MASK_NO) { return; } SurfaceLock lock1(screen); SurfaceLock lock2(m_lowerLayer); SurfaceLock lock3(m_colorMask); //TODO: support alpha channels for (int py = 0; py < m_colorMask->h; ++py) { int world_y = m_loc.getY() + py; for (int px = 0; px < m_colorMask->w; ++px) { Uint32 sample = PixelTool::getPixel(m_colorMask, px, py); if (sample == m_activeColor) { SDL_Color lower = PixelTool::getColor(m_lowerLayer, px, py); if (lower.unused == 255) { PixelTool::putColor(screen, m_loc.getX() + px, world_y, lower); } } } } } fillets-ng-1.0.1/src/effect/Makefile.in0000644000175000017500000003455611632204472014604 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/effect DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libeffect_a_AR = $(AR) $(ARFLAGS) libeffect_a_LIBADD = am_libeffect_a_OBJECTS = EffectDisintegrate.$(OBJEXT) \ EffectMirror.$(OBJEXT) EffectNone.$(OBJEXT) \ EffectReverse.$(OBJEXT) EffectZx.$(OBJEXT) Font.$(OBJEXT) \ LayeredPicture.$(OBJEXT) Outline.$(OBJEXT) Picture.$(OBJEXT) \ PixelTool.$(OBJEXT) SurfaceLock.$(OBJEXT) \ TTFException.$(OBJEXT) WavyPicture.$(OBJEXT) \ SurfaceTool.$(OBJEXT) PixelIterator.$(OBJEXT) libeffect_a_OBJECTS = $(am_libeffect_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libeffect_a_SOURCES) DIST_SOURCES = $(libeffect_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ INCLUDES = -I@top_srcdir@/src/gengine $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libeffect.a libeffect_a_SOURCES = Color.h EffectDisintegrate.cpp EffectDisintegrate.h EffectInvisible.h EffectMirror.cpp EffectMirror.h EffectNone.cpp EffectNone.h EffectReverse.cpp EffectReverse.h EffectZx.cpp EffectZx.h Font.cpp Font.h LayeredPicture.cpp LayeredPicture.h Outline.cpp Outline.h Picture.cpp Picture.h PixelTool.cpp PixelTool.h ResColorPack.h SurfaceLock.cpp SurfaceLock.h TTFException.cpp TTFException.h ViewEffect.h WavyPicture.cpp WavyPicture.h SurfaceTool.cpp SurfaceTool.h PixelIterator.cpp PixelIterator.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/effect/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/effect/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libeffect.a: $(libeffect_a_OBJECTS) $(libeffect_a_DEPENDENCIES) -rm -f libeffect.a $(libeffect_a_AR) libeffect.a $(libeffect_a_OBJECTS) $(libeffect_a_LIBADD) $(RANLIB) libeffect.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EffectDisintegrate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EffectMirror.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EffectNone.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EffectReverse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/EffectZx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Font.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LayeredPicture.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Outline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/Picture.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PixelIterator.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PixelTool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SurfaceLock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SurfaceTool.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TTFException.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/WavyPicture.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/effect/SurfaceTool.h0000644000175000017500000000103011124735543015117 00000000000000#ifndef HEADER_SURFACETOOL_H #define HEADER_SURFACETOOL_H #include "SDL.h" /** * Surface rutines. */ class SurfaceTool { public: static SDL_Surface *createEmpty(SDL_Surface *surface, int width=0, int height=0); static SDL_Surface *createTransparent(int w, int h, const SDL_Color &transparent); static SDL_Surface *createClone(SDL_Surface *surface); static void alphaFill(SDL_Surface *surface, SDL_Rect *dstrect, const SDL_Color &color); }; #endif fillets-ng-1.0.1/src/effect/TTFException.cpp0000644000175000017500000000120010067627713015543 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "TTFException.h" #include "SDL_ttf.h" //----------------------------------------------------------------- /** * Add TTF_GetError to info. * @param problem detail info */ TTFException::TTFException(const ExInfo &problem) : BaseException(ExInfo(problem).addInfo("TTF", TTF_GetError())) { /* empty */ } fillets-ng-1.0.1/src/effect/Makefile.am0000644000175000017500000000121210316575531014557 00000000000000 INCLUDES = -I@top_srcdir@/src/gengine $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libeffect.a libeffect_a_SOURCES = Color.h EffectDisintegrate.cpp EffectDisintegrate.h EffectInvisible.h EffectMirror.cpp EffectMirror.h EffectNone.cpp EffectNone.h EffectReverse.cpp EffectReverse.h EffectZx.cpp EffectZx.h Font.cpp Font.h LayeredPicture.cpp LayeredPicture.h Outline.cpp Outline.h Picture.cpp Picture.h PixelTool.cpp PixelTool.h ResColorPack.h SurfaceLock.cpp SurfaceLock.h TTFException.cpp TTFException.h ViewEffect.h WavyPicture.cpp WavyPicture.h SurfaceTool.cpp SurfaceTool.h PixelIterator.cpp PixelIterator.h fillets-ng-1.0.1/src/effect/ViewEffect.h0000644000175000017500000000106411212534315014717 00000000000000#ifndef HEADER_VIEWEFFECT_H #define HEADER_VIEWEFFECT_H #include "SDL.h" /** * Graphic effect before blit. */ class ViewEffect { public: virtual ~ViewEffect() {} /** * Update effect after blit. */ virtual void updateEffect() {} virtual const char* getName() const = 0; virtual bool isDisintegrated() const { return false; } virtual bool isInvisible() const { return false; } virtual void blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y) = 0; }; #endif fillets-ng-1.0.1/src/effect/EffectMirror.h0000644000175000017500000000066611212534340015264 00000000000000#ifndef HEADER_EFFECTMIRROR_H #define HEADER_EFFECTMIRROR_H #include "ViewEffect.h" /** * Mirror reflect left side. */ class EffectMirror : public ViewEffect { private: static const int MIRROR_BORDER = 3; public: static const char *NAME; virtual const char* getName() const { return NAME; } virtual void blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y); }; #endif fillets-ng-1.0.1/src/effect/Font.h0000644000175000017500000000150410316575531013606 00000000000000#ifndef HEADER_FONT_H #define HEADER_FONT_H class Path; #include "NoCopy.h" #include "SDL.h" #include "SDL_ttf.h" #include /** * TrueType UTF-8 font. */ class Font : public NoCopy { private: TTF_Font *m_ttfont; SDL_Color m_bg; private: static std::string biditize(const std::string &text); public: Font(const Path &file_ttf, int height); ~Font(); static void init(); static void shutdown(); int getHeight() { return TTF_FontHeight(m_ttfont); } int calcTextWidth(const std::string &text); SDL_Surface *renderText(const std::string &text, const SDL_Color &color) const; SDL_Surface *renderTextOutlined(const std::string &text, const SDL_Color &color, int outlineWidth=1) const; }; #endif fillets-ng-1.0.1/src/effect/EffectMirror.cpp0000644000175000017500000000277111212534236015622 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "EffectMirror.h" #include "SurfaceLock.h" #include "PixelTool.h" const char *EffectMirror::NAME = "mirror"; //----------------------------------------------------------------- /** * Mirror effect. Draw left side inside. * The pixel in the middle will be used as a mask. * NOTE: mirror object should be drawn as the last. */ void EffectMirror::blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y) { SurfaceLock lock1(screen); SurfaceLock lock2(surface); SDL_Color mask = PixelTool::getColor(surface, surface->w / 2, surface->h / 2); for (int py = 0; py < surface->h; ++py) { for (int px = 0; px < surface->w; ++px) { SDL_Color pixel = PixelTool::getColor(surface, px, py); if (px > MIRROR_BORDER && PixelTool::colorEquals(pixel, mask)) { SDL_Color sample = PixelTool::getColor(screen, x - px + MIRROR_BORDER, y + py); PixelTool::putColor(screen, x + px, y + py, sample); } else { if (pixel.unused == 255) { PixelTool::putColor(screen, x + px, y + py, pixel); } } } } } fillets-ng-1.0.1/src/effect/EffectNone.h0000644000175000017500000000057611212534346014717 00000000000000#ifndef HEADER_EFFECTNONE_H #define HEADER_EFFECTNONE_H #include "ViewEffect.h" /** * Blit without any special effect. */ class EffectNone : public ViewEffect { public: static const char *NAME; virtual const char* getName() const { return NAME; } virtual void blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y); }; #endif fillets-ng-1.0.1/src/effect/EffectZx.cpp0000644000175000017500000000664311212534374014756 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "EffectZx.h" #include "SurfaceLock.h" #include "PixelTool.h" #include "PixelIterator.h" #include "Random.h" const char *EffectZx::NAME = "zx"; const double EffectZx::STRIPE_STANDARD = 38.5; const double EffectZx::STRIPE_NARROW = 3.4; //----------------------------------------------------------------- /** * Read colors from all four corners. */ EffectZx::EffectZx() { m_zx = ZX1; m_phase = 0; m_countHeight = 0; m_stripeHeight = STRIPE_STANDARD; } //----------------------------------------------------------------- /** * Update sprite height as ZX Spectrum does. */ void EffectZx::updateEffect() { m_phase = (m_phase + 1) % 500; if (m_phase == 1) { m_zx = ZX1; m_stripeHeight = STRIPE_STANDARD; } else if (2 <= m_phase && m_phase <= 51) { m_stripeHeight = (m_stripeHeight * 3 * (0.97 + Random::randomReal(0.06)) + STRIPE_STANDARD) / 4.0; } else if (m_phase == 52) { m_zx = ZX3; m_stripeHeight = STRIPE_NARROW; } else { m_stripeHeight = (m_stripeHeight * 3 * (0.95 + Random::randomReal(0.1)) + STRIPE_NARROW) / 4.0; } } //----------------------------------------------------------------- /** * Draw ZX spectrum loading. */ void EffectZx::blit(SDL_Surface *screen, SDL_Surface *surface, int x, int y) { SurfaceLock lock1(screen); SurfaceLock lock2(surface); Uint32 colorZX1 = PixelTool::convertColor(screen->format, PixelTool::getColor(surface, 0, 0)); Uint32 colorZX2 = PixelTool::convertColor(screen->format, PixelTool::getColor(surface, 0, surface->h - 1)); Uint32 colorZX3 = PixelTool::convertColor(screen->format, PixelTool::getColor(surface, surface->w - 1, 0)); Uint32 colorZX4 = PixelTool::convertColor(screen->format, PixelTool::getColor(surface, surface->w - 1, surface->h - 1)); PixelIterator pit(surface); for (int py = 0; py < surface->h; ++py) { m_countHeight++; if (m_countHeight > m_stripeHeight) { m_countHeight -= m_stripeHeight; switch (m_zx) { case ZX1: m_zx = ZX2; break; case ZX2: m_zx = ZX1; break; case ZX3: m_zx = ZX4; break; default: m_zx = ZX3; break; } } Uint32 usedColor; switch (m_zx) { case ZX1: usedColor = colorZX1; break; case ZX2: usedColor = colorZX2; break; case ZX3: usedColor = colorZX3; break; default: usedColor = colorZX4; break; } for (int px = 0; px < surface->w; ++px) { if (!pit.isTransparent()) { PixelTool::putPixel(screen, x + px, y + py, usedColor); } pit.inc(); } } } fillets-ng-1.0.1/src/effect/WavyPicture.h0000644000175000017500000000106111205547612015155 00000000000000#ifndef HEADER_WAVYPICTURE_H #define HEADER_WAVYPICTURE_H #include "Picture.h" /** * Wavy picture at fixed screen position. */ class WavyPicture : public Picture { private: float m_amp; float m_periode; float m_speed; public: WavyPicture(const Path &file, const V2 &loc); void setWamp(float amplitude) { m_amp = amplitude; } void setWperiode(float periode) { m_periode = periode; } void setWspeed(float speed) { m_speed = speed; } virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/effect/Outline.cpp0000644000175000017500000000630410260326123014642 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Outline.h" #include "Log.h" #include "PixelTool.h" #include "SurfaceTool.h" #include "SurfaceLock.h" //----------------------------------------------------------------- Outline::Outline(const SDL_Color &color, int width) : m_color(color) { m_width = width; m_pixel = 0; } //----------------------------------------------------------------- /** * Draw outline, use surface colorkey as bg color. */ void Outline::drawOnColorKey(SDL_Surface *surface) { Uint32 bgKey = surface->format->colorkey; drawOn(surface, bgKey); } //----------------------------------------------------------------- /** * Draw outline on bg color. * @param surface picture with shape to outline * @param bgKey color used for background */ void Outline::drawOn(SDL_Surface *surface, Uint32 bgKey) { SurfaceLock lock1(surface); precomputePixel(surface->format); for (int i = 0; i < m_width; ++i) { drawOneLayer(surface, bgKey); } } //----------------------------------------------------------------- void Outline::precomputePixel(SDL_PixelFormat *format) { m_pixel = SDL_MapRGB(format, m_color.r, m_color.g, m_color.b); } //----------------------------------------------------------------- /** * Draw outline with width=1. */ void Outline::drawOneLayer(SDL_Surface *surface, Uint32 bgKey) { SDL_Surface *copy = SurfaceTool::createClone(surface); drawAlongCopy(surface, bgKey, copy); SDL_FreeSurface(copy); } //----------------------------------------------------------------- /** * Draw outline with width=1. * Cloned surface will be used as a model. It will not be modified. * Destination surface must be locked. */ void Outline::drawAlongCopy(SDL_Surface *surface, Uint32 bgKey, SDL_Surface *copy) { SurfaceLock lock1(copy); for (int py = 0; py < surface->h; ++py) { for (int px = 0; px < surface->w; ++px) { if (PixelTool::getPixel(copy, px, py) != bgKey) { fillNeighbourhood(surface, bgKey, px, py); } } } } //----------------------------------------------------------------- /** * Fill neighboors around this point. * Neighbours with bgKey will be filled. * Surface must be locked. * m_pixel must be precomputed. */ void Outline::fillNeighbourhood(SDL_Surface *surface, Uint32 bgKey, int x, int y) { //TODO: optimize for speed if (x > 0 && PixelTool::getPixel(surface, x - 1, y) == bgKey) { PixelTool::putPixel(surface, x - 1, y, m_pixel); } if (y > 0 && PixelTool::getPixel(surface, x, y - 1) == bgKey) { PixelTool::putPixel(surface, x, y - 1, m_pixel); } if (x + 1 < surface->w && PixelTool::getPixel(surface, x + 1, y) == bgKey) { PixelTool::putPixel(surface, x + 1, y, m_pixel); } if (y + 1 < surface->h && PixelTool::getPixel(surface, x, y + 1) == bgKey) { PixelTool::putPixel(surface, x, y + 1, m_pixel); } } fillets-ng-1.0.1/src/effect/Picture.cpp0000644000175000017500000000310110155372126014635 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "Picture.h" #include "ResImagePack.h" //----------------------------------------------------------------- /** * Load surface. */ Picture::Picture(const Path &file, const V2 &loc) : m_loc(loc) { m_surface = ResImagePack::loadImage(file); } //----------------------------------------------------------------- /** * Use this surface. */ Picture::Picture(SDL_Surface *new_surface, const V2 &loc) : m_loc(loc) { m_surface = new_surface; } //----------------------------------------------------------------- /** * Free surface. */ Picture::~Picture() { SDL_FreeSurface(m_surface); } //----------------------------------------------------------------- void Picture::changePicture(const Path &file) { SDL_FreeSurface(m_surface); m_surface = ResImagePack::loadImage(file); } //----------------------------------------------------------------- void Picture::changePicture(SDL_Surface *new_surface) { SDL_FreeSurface(m_surface); m_surface = new_surface; } //----------------------------------------------------------------- /** * Blit entire surface to [x,y]. */ void Picture::drawOn(SDL_Surface *screen) { SDL_Rect rect; rect.x = m_loc.getX(); rect.y = m_loc.getY(); SDL_BlitSurface(m_surface, NULL, screen, &rect); } fillets-ng-1.0.1/src/effect/Color.h0000644000175000017500000000055410073033756013760 00000000000000#ifndef HEADER_COLOR_H #define HEADER_COLOR_H #include "SDL.h" /** * Constructor for SDL_Color. */ class Color : public SDL_Color { public: Color(Uint8 red, Uint8 green, Uint8 blue, Uint8 alpha=255) { this->r = red; this->g = green; this->b = blue; this->unused = alpha; } }; #endif fillets-ng-1.0.1/src/effect/EffectInvisible.h0000644000175000017500000000070711212534410015730 00000000000000#ifndef HEADER_EFFECTINVISIBLE_H #define HEADER_EFFECTINVISIBLE_H #include "ViewEffect.h" /** * Draw nothing. */ class EffectInvisible : public ViewEffect { public: static const char *NAME; virtual const char* getName() const { return NAME; } virtual bool isInvisible() const { return true; } virtual void blit(SDL_Surface *, SDL_Surface *, int, int) {} }; const char *EffectInvisible::NAME = "invisible"; #endif fillets-ng-1.0.1/src/effect/WavyPicture.cpp0000644000175000017500000000350211361565603015515 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "WavyPicture.h" #include "TimerAgent.h" #include //----------------------------------------------------------------- /** * Load surface. * Default is no waves. */ WavyPicture::WavyPicture(const Path &file, const V2 &loc) : Picture(file, loc) { m_amp = 0; m_periode = m_surface->w; m_speed = 0; } //----------------------------------------------------------------- /** * Blit entire surface to [x,y]. * Do vertical waves with phase shift. */ void WavyPicture::drawOn(SDL_Surface *screen) { if (m_amp == 0) { Picture::drawOn(screen); return; } //NOTE: Wamp = Wamp_in_orig/2.0 //NOTE: Wspeed = 1.0/Wspd_in_orig SDL_Rect dest_rect; SDL_Rect line_rect; line_rect.w = m_surface->w; line_rect.h = 1; SDL_Rect pad; pad.h = 1; float shift = TimerAgent::agent()->getCycles() * m_speed; for (int py = 0; py < m_surface->h; ++py) { //NOTE: C99 has lrintf and sinf Sint16 shiftX = static_cast(0.5 + m_amp * sin(py / m_periode + shift)); line_rect.x = shiftX; line_rect.y = py; dest_rect.x = m_loc.getX(); dest_rect.y = m_loc.getY() + py; SDL_BlitSurface(m_surface, &line_rect, screen, &dest_rect); pad.x = (shiftX < 0) ? 0 : m_surface->w - shiftX; pad.y = py; pad.w = abs(shiftX); dest_rect.x = m_loc.getX() + pad.x; dest_rect.y = m_loc.getY() + py; SDL_BlitSurface(m_surface, &pad, screen, &dest_rect); } } fillets-ng-1.0.1/src/state/0000777000175000017500000000000011632204503012465 500000000000000fillets-ng-1.0.1/src/state/PosterState.cpp0000644000175000017500000000212510117317530015364 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "PosterState.h" #include "Path.h" #include "Picture.h" #include "DemoInput.h" #include "OptionAgent.h" #include "VideoAgent.h" //----------------------------------------------------------------- PosterState::PosterState(const Path &picture) { m_bg = new Picture(picture, V2(0, 0)); takeHandler(new DemoInput(this)); registerDrawable(m_bg); } //----------------------------------------------------------------- PosterState::~PosterState() { delete m_bg; } //----------------------------------------------------------------- void PosterState::own_initState() { OptionAgent *options = OptionAgent::agent(); options->setParam("screen_width", m_bg->getW()); options->setParam("screen_height", m_bg->getH()); VideoAgent::agent()->initVideoMode(); } fillets-ng-1.0.1/src/state/GameInput.h0000644000175000017500000000051210125143266014445 00000000000000#ifndef HEADER_GAMEINPUT_H #define HEADER_GAMEINPUT_H #include "StateInput.h" /** * Input which enables console and menu options. */ class GameInput : public StateInput { protected: GameInput(GameState *state) : StateInput(state) {} virtual void enableHelp(); virtual void enableMenu(); }; #endif fillets-ng-1.0.1/src/state/DemoInput.h0000644000175000017500000000052510125315645014466 00000000000000#ifndef HEADER_DEMOINPUT_H #define HEADER_DEMOINPUT_H class GameState; #include "GameInput.h" /** * Handle input for demo. */ class DemoInput : public GameInput { protected: virtual void enableHelp() {} public: DemoInput(GameState *demo); virtual void mouseEvent(const MouseStroke &buttons); }; #endif fillets-ng-1.0.1/src/state/MovieState.cpp0000644000175000017500000000301511207320274015166 00000000000000/* * Copyright (C) 2009 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #ifdef HAVE_SMPEG #include "MovieState.h" #include "SDL_Movie.h" #include "DemoInput.h" #include "OptionAgent.h" #include "VideoAgent.h" #include "SoundAgent.h" //----------------------------------------------------------------- MovieState::MovieState(const Path &file) : m_file(file) { takeHandler(new DemoInput(this)); } //----------------------------------------------------------------- void MovieState::own_initState() { SoundAgent::agent()->stopMusic(); Mix_CloseAudio(); m_movie = new SDL_Movie(); m_movie->Load(m_file.getNative().c_str()); SMPEG_Info info = m_movie->GetInfo(); OptionAgent *options = OptionAgent::agent(); options->setParam("screen_width", info.width); options->setParam("screen_height", info.height); VideoAgent::agent()->initVideoMode(); m_movie->Play(); registerDrawable(m_movie); } //----------------------------------------------------------------- void MovieState::own_updateState() { if(m_movie->GetStatus() != SMPEG_PLAYING) { quitState(); } } //----------------------------------------------------------------- void MovieState::own_cleanState() { delete m_movie; SoundAgent::agent()->reinit(); } #endif fillets-ng-1.0.1/src/state/GameInput.cpp0000644000175000017500000000135310125143266015004 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "GameInput.h" #include "MenuHelp.h" #include "MenuOptions.h" //----------------------------------------------------------------- /** * Push help screen at top. */ void GameInput::enableHelp() { m_state->pushState(new MenuHelp()); } //----------------------------------------------------------------- /** * Push menu state at top. */ void GameInput::enableMenu() { m_state->pushState(new MenuOptions()); } fillets-ng-1.0.1/src/state/demo-script.h0000644000175000017500000000023210103167730014777 00000000000000#ifndef HEADER_DEMO_SCRIPT_H #define HEADER_DEMO_SCRIPT_H extern "C" { #include "lua.h" } extern int script_demo_display(lua_State *L) throw(); #endif fillets-ng-1.0.1/src/state/DemoMode.h0000644000175000017500000000155110117317530014247 00000000000000#ifndef HEADER_DEMOMODE_H #define HEADER_DEMOMODE_H class Picture; class DemoInput; #include "Path.h" #include "GameState.h" #include "Planner.h" #include "Drawable.h" /** * Graphic demo. */ class DemoMode : public Planner, public GameState, public Drawable { private: int m_oldLimitY; Path m_demoscript; SDL_Surface *m_surfaceBuffer; Picture *m_display; protected: virtual void own_initState(); virtual void own_updateState(); virtual void own_pauseState() {} virtual void own_resumeState() {} virtual void own_cleanState(); public: DemoMode(const Path &demoscript); virtual ~DemoMode(); virtual const char *getName() const { return "state_demo"; }; bool action_display(Picture *picture); virtual void drawOn(SDL_Surface *screen); }; #endif fillets-ng-1.0.1/src/state/MovieState.h0000644000175000017500000000115211206031127014626 00000000000000#ifndef HEADER_MOVIESTATE_H #define HEADER_MOVIESTATE_H #ifdef HAVE_SMPEG class SDL_Movie; #include "Path.h" #include "GameState.h" /** * A MPEG-1 movie. */ class MovieState : public GameState { protected: Path m_file; SDL_Movie *m_movie; protected: virtual void own_initState(); virtual void own_updateState(); virtual void own_pauseState() {} virtual void own_resumeState() {} virtual void own_cleanState(); public: MovieState(const Path &file); virtual const char *getName() const { return "state_movie"; }; }; #endif #endif fillets-ng-1.0.1/src/state/Makefile.in0000644000175000017500000003262411632204473014463 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/state DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libstate_a_AR = $(AR) $(ARFLAGS) libstate_a_LIBADD = am_libstate_a_OBJECTS = DemoInput.$(OBJEXT) DemoMode.$(OBJEXT) \ GameInput.$(OBJEXT) PosterState.$(OBJEXT) \ PosterScroller.$(OBJEXT) MovieState.$(OBJEXT) \ demo-script.$(OBJEXT) libstate_a_OBJECTS = $(am_libstate_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libstate_a_SOURCES) DIST_SOURCES = $(libstate_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan -I@top_srcdir@/src/option $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libstate.a libstate_a_SOURCES = DemoInput.cpp DemoInput.h DemoMode.cpp DemoMode.h GameInput.cpp GameInput.h PosterState.cpp PosterState.h PosterScroller.cpp PosterScroller.h MovieState.cpp MovieState.h SDL_Movie.h demo-script.cpp demo-script.h all: all-am .SUFFIXES: .SUFFIXES: .cpp .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/state/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/state/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libstate.a: $(libstate_a_OBJECTS) $(libstate_a_DEPENDENCIES) -rm -f libstate.a $(libstate_a_AR) libstate.a $(libstate_a_OBJECTS) $(libstate_a_LIBADD) $(RANLIB) libstate.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DemoInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DemoMode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GameInput.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/MovieState.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PosterScroller.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/PosterState.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demo-script.Po@am__quote@ .cpp.o: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/state/PosterScroller.h0000644000175000017500000000100410114156601015526 00000000000000#ifndef HEADER_POSTERSCROLLER_H #define HEADER_POSTERSCROLLER_H class Path; class Picture; #include "PosterState.h" /** * Scroll very height picture. */ class PosterScroller : public PosterState { private: static const int SHIFT_SPEED = 4; int m_shift; int m_screenH; protected: virtual void own_initState(); virtual void own_updateState(); public: PosterScroller(const Path &picture); virtual bool allowBg() const { return true; } }; #endif fillets-ng-1.0.1/src/state/demo-script.cpp0000644000175000017500000000205110125025233015326 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "demo-script.h" #include "Path.h" #include "DemoMode.h" #include "Picture.h" #include "def-script.h" //----------------------------------------------------------------- inline DemoMode * getDemo(lua_State *L) { return dynamic_cast(script_getLeader(L)); } //----------------------------------------------------------------- /** * void demo_display(picture, x, y) */ int script_demo_display(lua_State *L) throw() { BEGIN_NOEXCEPTION; const char *filename = luaL_checkstring(L, 1); int x = luaL_checkint(L, 2); int y = luaL_checkint(L, 3); Picture *picture = new Picture(Path::dataReadPath(filename), V2(x, y)); getDemo(L)->action_display(picture); END_NOEXCEPTION; return 0; } fillets-ng-1.0.1/src/state/Makefile.am0000644000175000017500000000072511205771000014436 00000000000000 INCLUDES = -I@top_srcdir@/src/gengine -I@top_srcdir@/src/effect -I@top_srcdir@/src/widget -I@top_srcdir@/src/plan -I@top_srcdir@/src/option $(SDL_CFLAGS) $(LUA_CFLAGS) $(BOOST_CFLAGS) $(FRIBIDI_CFLAGS) noinst_LIBRARIES = libstate.a libstate_a_SOURCES = DemoInput.cpp DemoInput.h DemoMode.cpp DemoMode.h GameInput.cpp GameInput.h PosterState.cpp PosterState.h PosterScroller.cpp PosterScroller.h MovieState.cpp MovieState.h SDL_Movie.h demo-script.cpp demo-script.h fillets-ng-1.0.1/src/state/DemoInput.cpp0000644000175000017500000000162610125143266015022 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "DemoInput.h" #include "Keymap.h" #include "KeyDesc.h" #include "GameState.h" //----------------------------------------------------------------- /** * Create demo input handler. * Escape, space or mouse click quit state. * @param demo pointer to the leader */ DemoInput::DemoInput(GameState *demo) : GameInput(demo) { KeyDesc key_quit(KEY_QUIT, "quit"); m_keymap->registerKey(KeyStroke(SDLK_SPACE, KMOD_NONE), key_quit); } //----------------------------------------------------------------- void DemoInput::mouseEvent(const MouseStroke &/*buttons*/) { quitState(); } fillets-ng-1.0.1/src/state/PosterState.h0000644000175000017500000000113310117317530015027 00000000000000#ifndef HEADER_POSTERSTATE_H #define HEADER_POSTERSTATE_H class Path; class Picture; #include "GameState.h" /** * Static picture. */ class PosterState : public GameState { protected: Picture *m_bg; protected: virtual void own_initState(); virtual void own_updateState() {} virtual void own_pauseState() {} virtual void own_resumeState() {} virtual void own_cleanState() {} public: PosterState(const Path &picture); virtual ~PosterState(); virtual const char *getName() const { return "state_poster"; }; }; #endif fillets-ng-1.0.1/src/state/PosterScroller.cpp0000644000175000017500000000213210114156577016100 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "PosterScroller.h" #include "Picture.h" #include "OptionAgent.h" #include "minmax.h" //----------------------------------------------------------------- PosterScroller::PosterScroller(const Path &picture) : PosterState(picture) { m_shift = 0; m_screenH = 0; } //----------------------------------------------------------------- void PosterScroller::own_initState() { m_screenH = OptionAgent::agent()->getAsInt("screen_height"); m_shift = -m_screenH + SHIFT_SPEED; } //----------------------------------------------------------------- void PosterScroller::own_updateState() { int maxShift = min(m_shift, m_bg->getH() - m_screenH/3); m_bg->setLoc(V2(0, -maxShift)); m_shift += SHIFT_SPEED; if (m_shift > m_bg->getH()) { quitState(); } } fillets-ng-1.0.1/src/state/DemoMode.cpp0000644000175000017500000000556610173357242014622 00000000000000/* * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net) * * 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 * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ #include "DemoMode.h" #include "Picture.h" #include "StateManager.h" #include "DemoInput.h" #include "ScriptState.h" #include "SubTitleAgent.h" #include "OptionAgent.h" #include "VideoAgent.h" #include "SurfaceTool.h" #include "demo-script.h" //----------------------------------------------------------------- DemoMode::DemoMode(const Path &demoscript) : m_demoscript(demoscript) { m_oldLimitY = 0; m_display = NULL; m_surfaceBuffer = NULL; m_script->registerFunc("demo_display", script_demo_display); takeHandler(new DemoInput(this)); registerDrawable(this); registerDrawable(SubTitleAgent::agent()); } //----------------------------------------------------------------- DemoMode::~DemoMode() { own_cleanState(); } //----------------------------------------------------------------- /** * Run demo. */ void DemoMode::own_initState() { m_oldLimitY = SubTitleAgent::agent()->getLimitY(); m_script->doFile(m_demoscript); } //----------------------------------------------------------------- /** * Execute next demo command. */ void DemoMode::own_updateState() { if (satisfyPlan()) { quitState(); } } //----------------------------------------------------------------- void DemoMode::own_cleanState() { //NOTE: loaded dialogs are released by ~Planner() if (m_surfaceBuffer) { SDL_FreeSurface(m_surfaceBuffer); m_surfaceBuffer = NULL; } if (m_display) { delete m_display; m_display = NULL; } SubTitleAgent::agent()->setLimitY(m_oldLimitY); killPlan(); } //----------------------------------------------------------------- /** * Store picture to draw it. * NOTE: limitY for long subtitles are prepared when display is set * before planning start */ bool DemoMode::action_display(Picture *picture) { if (m_display) { delete m_display; } m_display = picture; if (NULL == m_surfaceBuffer) { OptionAgent *options = OptionAgent::agent(); options->setParam("screen_width", m_display->getW()); options->setParam("screen_height", m_display->getH()); VideoAgent::agent()->initVideoMode(); SubTitleAgent::agent()->setLimitY(2 * m_display->getH()); } return true; } //----------------------------------------------------------------- void DemoMode::drawOn(SDL_Surface *screen) { if (NULL == m_surfaceBuffer) { m_surfaceBuffer = SurfaceTool::createEmpty(screen); } if (m_display) { m_display->drawOn(m_surfaceBuffer); } SDL_BlitSurface(m_surfaceBuffer, NULL, screen, NULL); } fillets-ng-1.0.1/src/state/SDL_Movie.h0000644000175000017500000001214611207320444014340 00000000000000#ifndef HEADER_SDLMOVIE_H #define HEADER_SDLMOVIE_H #ifdef HAVE_SMPEG #include "SDL.h" #include "smpeg/smpeg.h" #include "Drawable.h" #include "Log.h" /** * Thanks to Drew Benton for the initial code: * http://www.gamedev.net/community/forums/topic.asp?topic_id=348340 */ class SDL_Movie : public Drawable { private: // Surface for the movie SDL_Surface *movieSurface; // Holds the movie information SMPEG_Info movieInfo; // Load the movie SMPEG *movie; // The max we can scale by int MaxScaleX; int MaxScaleY; int MaxScale; public: SDL_Movie() { MaxScaleX = MaxScaleY = MaxScale = 1; movieSurface = 0; movie = 0; } // Free our movie virtual ~SDL_Movie() { if (movie) { Stop(); SMPEG_delete( movie ); movie = 0; } if (movieSurface) { SDL_FreeSurface( movieSurface ); movieSurface = 0; } } void ClearScreen() { SDL_FillRect( movieSurface, 0, 0 ); } // Set's the volume on a scale of 0 - 100 void SetVolume( int vol ) { SMPEG_setvolume( movie, vol ); } // Scale the movie by the desired factors void Scale( int w, int h ) { // Prevent a divide by 0 if( w == 0 ) w = 1; if( h == 0 ) h = 1; SMPEG_scaleXY( movie, w, h ); CheckErrors(); } // Scale the movie by the desired factor void ScaleBy( int factor ) { // Prevent a divide by 0 if( factor == 0 ) factor = 1; // Make sure we don't scale larger than the surface size if( factor > MaxScale ) factor = MaxScale; SMPEG_scale( movie, factor ); CheckErrors(); } // Sets the region of the video to be shown void SetDisplayRegion( int x, int y, int w, int h ) { SMPEG_setdisplayregion( movie, x, y, w, h ); CheckErrors(); } // Check for any errors void CheckErrors() { char* error = SMPEG_error( movie ); if( error ) { LOG_WARNING(ExInfo("SMPEG_error") .addInfo("error", error)); } } // Load the movie void Load( const char* fileName, int maxscalex = 1, int maxscaley = 1 ) { MaxScaleX = maxscalex; MaxScaleY = maxscaley; // Limit how much we can scale by MaxScale = (maxscalex > maxscaley ? maxscaley : maxscalex); // Load the movie and store the information about it movie = SMPEG_new( fileName, &movieInfo, true ); CheckErrors(); SDL_Surface *screen = SDL_GetVideoSurface(); // Create a temporary surface to render the movie to SDL_Surface *tempSurface2 = SDL_CreateRGBSurface( SDL_SWSURFACE, movieInfo.width * MaxScaleX, movieInfo.height * MaxScaleY, 32, screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, screen->format->Amask ); // Now make a surface optimized for the main screen movieSurface = SDL_DisplayFormat( tempSurface2 ); // Free the temporary surface SDL_FreeSurface( tempSurface2 ); // Set the surface to draw to SMPEG_setdisplay( movie, movieSurface, 0, 0 ); CheckErrors(); // Set the display region SMPEG_setdisplayregion( movie, 0, 0, movieInfo.width, movieInfo.height ); CheckErrors(); } // Set the looping of hte movie void SetLoop( int val ) { SMPEG_loop( movie, val ); CheckErrors(); } // Play the movie void Play() { SMPEG_play( movie ); CheckErrors(); } // Pause the movie void Pause() { SMPEG_pause( movie ); CheckErrors(); } // Stops the movie, but keeps current position void Stop() { SMPEG_stop( movie ); CheckErrors(); } // Rewind the movie back to 0:00:00 void Rewind() { SMPEG_rewind( movie ); CheckErrors(); } // Seek a number of bytes into the movie void Seek( int bytes ) { SMPEG_seek( movie, bytes ); CheckErrors(); } // Skip a number of seconds void Skip( float seconds ) { SMPEG_skip( movie, seconds ); CheckErrors(); } // Render some frame of the movie void RenderFrame( int frame ) { SMPEG_renderFrame( movie, frame ); CheckErrors(); } // Render the final frame of the movie void RenderFinal() { SMPEG_renderFinal( movie, movieSurface, 0, 0 ); CheckErrors(); } // Draw the movie surface to the screen virtual void drawOn(SDL_Surface *screen) { if (movieSurface) { SDL_BlitSurface(movieSurface, NULL, screen, NULL); } } // Return the current info for the movie SMPEG_Info GetInfo() { SMPEG_getinfo( movie, &movieInfo ); return movieInfo; } // Get the current status of the movie, can be SMPEG_ERROR = -1, SMPEG_STOPPED, SMPEG_PLAYING SMPEGstatus GetStatus() { return SMPEG_status(movie); } }; #endif #endif fillets-ng-1.0.1/src/SDL_gfx/0000777000175000017500000000000011632204502012632 500000000000000fillets-ng-1.0.1/src/SDL_gfx/SDL_gfxPrimitives.h0000644000175000017500000001363610373623377016312 00000000000000/* SDL_gfxPrimitives: graphics primitives for SDL LGPL (c) A. Schiffler */ #ifndef _SDL_gfxPrimitives_h #define _SDL_gfxPrimitives_h #include #ifndef M_PI #define M_PI 3.141592654 #endif #include "SDL.h" /* Set up for C function definitions, even when using C++ */ #ifdef __cplusplus extern "C" { #endif /* ----- Versioning */ #define SDL_GFXPRIMITIVES_MAJOR 2 #define SDL_GFXPRIMITIVES_MINOR 0 #define SDL_GFXPRIMITIVES_MICRO 10 /* ----- Prototypes */ /* Note: all ___Color routines expect the color to be in format 0xRRGGBBAA */ /* Pixel */ extern int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color); extern int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Horizontal line */ extern int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color); extern int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Vertical line */ extern int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color); extern int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Rectangle */ extern int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); extern int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled rectangle (Box) */ extern int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); extern int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Line */ extern int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); extern int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA Line */ extern int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color); extern int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Circle */ extern int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color); extern int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA Circle */ extern int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color); extern int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Circle */ extern int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color); extern int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Ellipse */ extern int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color); extern int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA Ellipse */ extern int aaellipseColor(SDL_Surface * dst, Sint16 xc, Sint16 yc, Sint16 rx, Sint16 ry, Uint32 color); extern int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Ellipse */ extern int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color); extern int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Pie */ extern int filledpieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color); extern int filledpieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Trigon */ extern int trigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color); extern int trigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA-Trigon */ extern int aatrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color); extern int aatrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Trigon */ extern int filledTrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, int color); extern int filledTrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Polygon */ extern int polygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint32 color); extern int polygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* AA-Polygon */ extern int aapolygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint32 color); extern int aapolygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Filled Polygon */ extern int filledPolygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, int color); extern int filledPolygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Bezier */ /* s = number of steps */ extern int bezierColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, int s, Uint32 color); extern int bezierRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /* Ends C function definitions when using C++ */ #ifdef __cplusplus } #endif #endif /* _SDL_gfxPrimitives_h */ fillets-ng-1.0.1/src/SDL_gfx/Makefile.in0000644000175000017500000003045211632204472014625 00000000000000# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = ../.. am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = src/SDL_gfx DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/sdl.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libSDL_gfx_a_AR = $(AR) $(ARFLAGS) libSDL_gfx_a_LIBADD = am_libSDL_gfx_a_OBJECTS = SDL_gfxPrimitives.$(OBJEXT) libSDL_gfx_a_OBJECTS = $(am_libSDL_gfx_a_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libSDL_gfx_a_SOURCES) DIST_SOURCES = $(libSDL_gfx_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BOOST_CFLAGS = @BOOST_CFLAGS@ BOOST_LIBS = @BOOST_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EXEEXT = @EXEEXT@ FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ FRIBIDI_LIBS = @FRIBIDI_LIBS@ HAVE_WINDRES_FALSE = @HAVE_WINDRES_FALSE@ HAVE_WINDRES_TRUE = @HAVE_WINDRES_TRUE@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ LUACONFIG = @LUACONFIG@ LUA_CFLAGS = @LUA_CFLAGS@ LUA_LIBS = @LUA_LIBS@ MAKEINFO = @MAKEINFO@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_CONFIG = @SDL_CONFIG@ SDL_LIBS = @SDL_LIBS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WINDRES = @WINDRES@ WITH_BOOST_FALSE = @WITH_BOOST_FALSE@ WITH_BOOST_TRUE = @WITH_BOOST_TRUE@ X_LIBS = @X_LIBS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target = @target@ target_alias = @target_alias@ target_cpu = @target_cpu@ target_os = @target_os@ target_vendor = @target_vendor@ INCLUDES = $(SDL_CFLAGS) noinst_LIBRARIES = libSDL_gfx.a libSDL_gfx_a_SOURCES = SDL_gfxPrimitives.c SDL_gfxPrimitives.h all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/SDL_gfx/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/SDL_gfx/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libSDL_gfx.a: $(libSDL_gfx_a_OBJECTS) $(libSDL_gfx_a_DEPENDENCIES) -rm -f libSDL_gfx.a $(libSDL_gfx_a_AR) libSDL_gfx.a $(libSDL_gfx_a_OBJECTS) $(libSDL_gfx_a_LIBADD) $(RANLIB) libSDL_gfx.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/SDL_gfxPrimitives.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ @am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` uninstall-info-am: ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \ esac; \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkdir_p) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-info-am .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: fillets-ng-1.0.1/src/SDL_gfx/Makefile.am0000644000175000017500000000017311202073134014601 00000000000000INCLUDES = $(SDL_CFLAGS) noinst_LIBRARIES = libSDL_gfx.a libSDL_gfx_a_SOURCES = SDL_gfxPrimitives.c SDL_gfxPrimitives.h fillets-ng-1.0.1/src/SDL_gfx/SDL_gfxPrimitives.c0000644000175000017500000022110110373623377016271 00000000000000/* SDL_gfxPrimitives - Graphics primitives for SDL surfaces LGPL (c) A. Schiffler */ #include #include #include #include #include "SDL_gfxPrimitives.h" /* -===================- */ /* ----- Defines for pixel clipping tests */ #define clip_xmin(surface) surface->clip_rect.x #define clip_xmax(surface) surface->clip_rect.x+surface->clip_rect.w-1 #define clip_ymin(surface) surface->clip_rect.y #define clip_ymax(surface) surface->clip_rect.y+surface->clip_rect.h-1 /* ----- Pixel - fast, no blending, no locking, clipping */ int fastPixelColorNolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { int bpp; Uint8 *p; /* * Honor clipping setup at pixel level */ if ((x >= clip_xmin(dst)) && (x <= clip_xmax(dst)) && (y >= clip_ymin(dst)) && (y <= clip_ymax(dst))) { /* * Get destination format */ bpp = dst->format->BytesPerPixel; p = (Uint8 *) dst->pixels + y * dst->pitch + x * bpp; switch (bpp) { case 1: *p = color; break; case 2: *(Uint16 *) p = color; break; case 3: if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { p[0] = (color >> 16) & 0xff; p[1] = (color >> 8) & 0xff; p[2] = color & 0xff; } else { p[0] = color & 0xff; p[1] = (color >> 8) & 0xff; p[2] = (color >> 16) & 0xff; } break; case 4: *(Uint32 *) p = color; break; } /* switch */ } return (0); } /* ----- Pixel - fast, no blending, no locking, no clipping */ /* (faster but dangerous, make sure we stay in surface bounds) */ int fastPixelColorNolockNoclip(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { int bpp; Uint8 *p; /* * Get destination format */ bpp = dst->format->BytesPerPixel; p = (Uint8 *) dst->pixels + y * dst->pitch + x * bpp; switch (bpp) { case 1: *p = color; break; case 2: *(Uint16 *) p = color; break; case 3: if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { p[0] = (color >> 16) & 0xff; p[1] = (color >> 8) & 0xff; p[2] = color & 0xff; } else { p[0] = color & 0xff; p[1] = (color >> 8) & 0xff; p[2] = (color >> 16) & 0xff; } break; case 4: *(Uint32 *) p = color; break; } /* switch */ return (0); } /* ----- Pixel - fast, no blending, locking, clipping */ int fastPixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { int result; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } result = fastPixelColorNolock(dst, x, y, color); /* * Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /* ----- Pixel - fast, no blending, locking, RGB input */ int fastPixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 color; /* * Setup color */ color = SDL_MapRGBA(dst->format, r, g, b, a); /* * Draw */ return (fastPixelColor(dst, x, y, color)); } /* ----- Pixel - fast, no blending, no locking RGB input */ int fastPixelRGBANolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 color; /* * Setup color */ color = SDL_MapRGBA(dst->format, r, g, b, a); /* * Draw */ return (fastPixelColorNolock(dst, x, y, color)); } /* PutPixel routine with alpha blending, input color in destination format */ /* New, faster routine - default blending pixel */ int _putPixelAlpha(SDL_Surface * surface, Sint16 x, Sint16 y, Uint32 color, Uint8 alpha) { Uint32 Rmask = surface->format->Rmask, Gmask = surface->format->Gmask, Bmask = surface->format->Bmask, Amask = surface->format->Amask; Uint32 R, G, B, A = 0; if (x >= clip_xmin(surface) && x <= clip_xmax(surface) && y >= clip_ymin(surface) && y <= clip_ymax(surface)) { switch (surface->format->BytesPerPixel) { case 1:{ /* Assuming 8-bpp */ if (alpha == 255) { *((Uint8 *) surface->pixels + y * surface->pitch + x) = color; } else { Uint8 *pixel = (Uint8 *) surface->pixels + y * surface->pitch + x; Uint8 dR = surface->format->palette->colors[*pixel].r; Uint8 dG = surface->format->palette->colors[*pixel].g; Uint8 dB = surface->format->palette->colors[*pixel].b; Uint8 sR = surface->format->palette->colors[color].r; Uint8 sG = surface->format->palette->colors[color].g; Uint8 sB = surface->format->palette->colors[color].b; dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); *pixel = SDL_MapRGB(surface->format, dR, dG, dB); } } break; case 2:{ /* Probably 15-bpp or 16-bpp */ if (alpha == 255) { *((Uint16 *) surface->pixels + y * surface->pitch / 2 + x) = color; } else { Uint16 *pixel = (Uint16 *) surface->pixels + y * surface->pitch / 2 + x; Uint32 dc = *pixel; R = ((dc & Rmask) + (((color & Rmask) - (dc & Rmask)) * alpha >> 8)) & Rmask; G = ((dc & Gmask) + (((color & Gmask) - (dc & Gmask)) * alpha >> 8)) & Gmask; B = ((dc & Bmask) + (((color & Bmask) - (dc & Bmask)) * alpha >> 8)) & Bmask; if (Amask) A = ((dc & Amask) + (((color & Amask) - (dc & Amask)) * alpha >> 8)) & Amask; *pixel = R | G | B | A; } } break; case 3:{ /* Slow 24-bpp mode, usually not used */ Uint8 *pix = (Uint8 *) surface->pixels + y * surface->pitch + x * 3; Uint8 rshift8 = surface->format->Rshift / 8; Uint8 gshift8 = surface->format->Gshift / 8; Uint8 bshift8 = surface->format->Bshift / 8; Uint8 ashift8 = surface->format->Ashift / 8; if (alpha == 255) { *(pix + rshift8) = color >> surface->format->Rshift; *(pix + gshift8) = color >> surface->format->Gshift; *(pix + bshift8) = color >> surface->format->Bshift; *(pix + ashift8) = color >> surface->format->Ashift; } else { Uint8 dR, dG, dB, dA = 0; Uint8 sR, sG, sB, sA = 0; pix = (Uint8 *) surface->pixels + y * surface->pitch + x * 3; dR = *((pix) + rshift8); dG = *((pix) + gshift8); dB = *((pix) + bshift8); dA = *((pix) + ashift8); sR = (color >> surface->format->Rshift) & 0xff; sG = (color >> surface->format->Gshift) & 0xff; sB = (color >> surface->format->Bshift) & 0xff; sA = (color >> surface->format->Ashift) & 0xff; dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); dA = dA + ((sA - dA) * alpha >> 8); *((pix) + rshift8) = dR; *((pix) + gshift8) = dG; *((pix) + bshift8) = dB; *((pix) + ashift8) = dA; } } break; case 4:{ /* Probably 32-bpp */ if (alpha == 255) { *((Uint32 *) surface->pixels + y * surface->pitch / 4 + x) = color; } else { Uint32 *pixel = (Uint32 *) surface->pixels + y * surface->pitch / 4 + x; Uint32 dc = *pixel; R = ((dc & Rmask) + (((color & Rmask) - (dc & Rmask)) * alpha >> 8)) & Rmask; G = ((dc & Gmask) + (((color & Gmask) - (dc & Gmask)) * alpha >> 8)) & Gmask; B = ((dc & Bmask) + (((color & Bmask) - (dc & Bmask)) * alpha >> 8)) & Bmask; if (Amask) A = ((dc & Amask) + (((color & Amask) - (dc & Amask)) * alpha >> 8)) & Amask; *pixel = R | G | B | A; } } break; } } return (0); } /* ----- Pixel - pixel draw with blending enabled if a<255 */ int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { Uint8 alpha; Uint32 mcolor; int result = 0; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Setup color */ alpha = color & 0x000000ff; mcolor = SDL_MapRGBA(dst->format, (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, alpha); /* * Draw */ result = _putPixelAlpha(dst, x, y, mcolor, alpha); /* * Unlock the surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } int pixelColorNolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color) { Uint8 alpha; Uint32 mcolor; int result = 0; /* * Setup color */ alpha = color & 0x000000ff; mcolor = SDL_MapRGBA(dst->format, (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, alpha); /* * Draw */ result = _putPixelAlpha(dst, x, y, mcolor, alpha); return (result); } /* Filled rectangle with alpha blending, color in destination format */ int _filledRectAlpha(SDL_Surface * surface, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color, Uint8 alpha) { Uint32 Rmask = surface->format->Rmask, Gmask = surface->format->Gmask, Bmask = surface->format->Bmask, Amask = surface->format->Amask; Uint32 R, G, B, A = 0; Sint16 x, y; switch (surface->format->BytesPerPixel) { case 1:{ /* Assuming 8-bpp */ Uint8 *row, *pixel; Uint8 dR, dG, dB; Uint8 sR = surface->format->palette->colors[color].r; Uint8 sG = surface->format->palette->colors[color].g; Uint8 sB = surface->format->palette->colors[color].b; for (y = y1; y <= y2; y++) { row = (Uint8 *) surface->pixels + y * surface->pitch; for (x = x1; x <= x2; x++) { pixel = row + x; dR = surface->format->palette->colors[*pixel].r; dG = surface->format->palette->colors[*pixel].g; dB = surface->format->palette->colors[*pixel].b; dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); *pixel = SDL_MapRGB(surface->format, dR, dG, dB); } } } break; case 2:{ /* Probably 15-bpp or 16-bpp */ Uint16 *row, *pixel; Uint32 dR = (color & Rmask), dG = (color & Gmask), dB = (color & Bmask), dA = (color & Amask); for (y = y1; y <= y2; y++) { row = (Uint16 *) surface->pixels + y * surface->pitch / 2; for (x = x1; x <= x2; x++) { pixel = row + x; R = ((*pixel & Rmask) + ((dR - (*pixel & Rmask)) * alpha >> 8)) & Rmask; G = ((*pixel & Gmask) + ((dG - (*pixel & Gmask)) * alpha >> 8)) & Gmask; B = ((*pixel & Bmask) + ((dB - (*pixel & Bmask)) * alpha >> 8)) & Bmask; if (Amask) A = ((*pixel & Amask) + ((dA - (*pixel & Amask)) * alpha >> 8)) & Amask; *pixel = R | G | B | A; } } } break; case 3:{ /* Slow 24-bpp mode, usually not used */ Uint8 *row, *pix; Uint8 dR, dG, dB, dA; Uint8 rshift8 = surface->format->Rshift / 8; Uint8 gshift8 = surface->format->Gshift / 8; Uint8 bshift8 = surface->format->Bshift / 8; Uint8 ashift8 = surface->format->Ashift / 8; Uint8 sR = (color >> surface->format->Rshift) & 0xff; Uint8 sG = (color >> surface->format->Gshift) & 0xff; Uint8 sB = (color >> surface->format->Bshift) & 0xff; Uint8 sA = (color >> surface->format->Ashift) & 0xff; for (y = y1; y <= y2; y++) { row = (Uint8 *) surface->pixels + y * surface->pitch; for (x = x1; x <= x2; x++) { pix = row + x * 3; dR = *((pix) + rshift8); dG = *((pix) + gshift8); dB = *((pix) + bshift8); dA = *((pix) + ashift8); dR = dR + ((sR - dR) * alpha >> 8); dG = dG + ((sG - dG) * alpha >> 8); dB = dB + ((sB - dB) * alpha >> 8); dA = dA + ((sA - dA) * alpha >> 8); *((pix) + rshift8) = dR; *((pix) + gshift8) = dG; *((pix) + bshift8) = dB; *((pix) + ashift8) = dA; } } } break; case 4:{ /* Probably 32-bpp */ Uint32 *row, *pixel; Uint32 dR = (color & Rmask), dG = (color & Gmask), dB = (color & Bmask), dA = (color & Amask); for (y = y1; y <= y2; y++) { row = (Uint32 *) surface->pixels + y * surface->pitch / 4; for (x = x1; x <= x2; x++) { pixel = row + x; R = ((*pixel & Rmask) + ((dR - (*pixel & Rmask)) * alpha >> 8)) & Rmask; G = ((*pixel & Gmask) + ((dG - (*pixel & Gmask)) * alpha >> 8)) & Gmask; B = ((*pixel & Bmask) + ((dB - (*pixel & Bmask)) * alpha >> 8)) & Bmask; if (Amask) A = ((*pixel & Amask) + ((dA - (*pixel & Amask)) * alpha >> 8)) & Amask; *pixel = R | G | B | A; } } } break; } return (0); } /* Draw rectangle with alpha enabled from RGBA color. */ int filledRectAlpha(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { Uint8 alpha; Uint32 mcolor; int result = 0; /* * Lock the surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Setup color */ alpha = color & 0x000000ff; mcolor = SDL_MapRGBA(dst->format, (color & 0xff000000) >> 24, (color & 0x00ff0000) >> 16, (color & 0x0000ff00) >> 8, alpha); /* * Draw */ result = _filledRectAlpha(dst, x1, y1, x2, y2, mcolor, alpha); /* * Unlock the surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } /* Draw horizontal line with alpha enabled from RGBA color */ int HLineAlpha(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) { return (filledRectAlpha(dst, x1, y, x2, y, color)); } /* Draw vertical line with alpha enabled from RGBA color */ int VLineAlpha(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color) { return (filledRectAlpha(dst, x, y1, x, y2, color)); } /* Pixel - using alpha weight on color for AA-drawing */ int pixelColorWeight(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color, Uint32 weight) { Uint32 a; /* * Get alpha */ a = (color & (Uint32) 0x000000ff); /* * Modify Alpha by weight */ a = ((a * weight) >> 8); return (pixelColor(dst, x, y, (color & (Uint32) 0xffffff00) | (Uint32) a)); } /* Pixel - using alpha weight on color for AA-drawing - no locking */ int pixelColorWeightNolock(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color, Uint32 weight) { Uint32 a; /* * Get alpha */ a = (color & (Uint32) 0x000000ff); /* * Modify Alpha by weight */ a = ((a * weight) >> 8); return (pixelColorNolock(dst, x, y, (color & (Uint32) 0xffffff00) | (Uint32) a)); } int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Uint32 color; /* * Check Alpha */ if (a == 255) { /* * No alpha blending required */ /* * Setup color */ color = SDL_MapRGBA(dst->format, r, g, b, a); /* * Draw */ return (fastPixelColor(dst, x, y, color)); } else { /* * Alpha blending required */ /* * Draw */ return (pixelColor(dst, x, y, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } } /* ----- Horizontal line */ /* Just store color including alpha, no blending */ int hlineColorStore(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int dx; int pixx, pixy; Sint16 w; Sint16 xtmp; int result = -1; /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* * Check visibility of hline */ if ((x1right) && (x2>right)) { return(0); } if ((ybottom)) { return (0); } /* * Clip x */ if (x1 < left) { x1 = left; } if (x2 > right) { x2 = right; } /* * Swap x1, x2 if required */ if (x1 > x2) { xtmp = x1; x1 = x2; x2 = xtmp; } /* * Calculate width */ w = x2 - x1; /* * Sanity check on width */ if (w < 0) { return (0); } /* * Lock surface */ SDL_LockSurface(dst); /* * More variable setup */ dx = w; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: memset(pixel, color, dx); break; case 2: pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint16 *) pixel = color; } break; case 3: pixellast = pixel + dx + dx + dx; for (; pixel <= pixellast; pixel += pixx) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } } break; default: /* case 4 */ dx = dx + dx; pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint32 *) pixel = color; } break; } /* * Unlock surface */ SDL_UnlockSurface(dst); /* * Set result code */ result = 0; return (result); } int hlineRGBAStore(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (hlineColorStore(dst, x1, x2, y, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int dx; int pixx, pixy; Sint16 w; Sint16 xtmp; int result = -1; Uint8 *colorptr; /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* * Check visibility of hline */ if ((x1right) && (x2>right)) { return(0); } if ((ybottom)) { return (0); } /* * Clip x */ if (x1 < left) { x1 = left; } if (x2 > right) { x2 = right; } /* * Swap x1, x2 if required */ if (x1 > x2) { xtmp = x1; x1 = x2; x2 = xtmp; } /* * Calculate width */ w = x2 - x1; /* * Sanity check on width */ if (w < 0) { return (0); } /* * Alpha check */ if ((color & 255) == 255) { /* * No alpha-blending required */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Lock surface */ SDL_LockSurface(dst); /* * More variable setup */ dx = w; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: memset(pixel, color, dx); break; case 2: pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint16 *) pixel = color; } break; case 3: pixellast = pixel + dx + dx + dx; for (; pixel <= pixellast; pixel += pixx) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } } break; default: /* case 4 */ dx = dx + dx; pixellast = pixel + dx + dx; for (; pixel <= pixellast; pixel += pixx) { *(Uint32 *) pixel = color; } break; } /* * Unlock surface */ SDL_UnlockSurface(dst); /* * Set result code */ result = 0; } else { /* * Alpha blending blit */ result = HLineAlpha(dst, x1, x1 + w, y, color); } return (result); } int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (hlineColor(dst, x1, x2, y, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Vertical line */ int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int dy; int pixx, pixy; Sint16 h; Sint16 ytmp; int result = -1; Uint8 *colorptr; /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* * Check visibility of vline */ if ((xright)) { return (0); } if ((y1bottom) && (y2>bottom)) { return(0); } /* * Clip y */ if (y1 < top) { y1 = top; } if (y2 > bottom) { y2 = bottom; } /* * Swap y1, y2 if required */ if (y1 > y2) { ytmp = y1; y1 = y2; y2 = ytmp; } /* * Calculate height */ h = y2 - y1; /* * Sanity check on height */ if (h < 0) { return (0); } /* * Alpha check */ if ((color & 255) == 255) { /* * No alpha-blending required */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Lock surface */ SDL_LockSurface(dst); /* * More variable setup */ dy = h; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x + pixy * (int) y1; pixellast = pixel + pixy * dy; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: for (; pixel <= pixellast; pixel += pixy) { *(Uint8 *) pixel = color; } break; case 2: for (; pixel <= pixellast; pixel += pixy) { *(Uint16 *) pixel = color; } break; case 3: for (; pixel <= pixellast; pixel += pixy) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } } break; default: /* case 4 */ for (; pixel <= pixellast; pixel += pixy) { *(Uint32 *) pixel = color; } break; } /* * Unlock surface */ SDL_UnlockSurface(dst); /* * Set result code */ result = 0; } else { /* * Alpha blending blit */ result = VLineAlpha(dst, x, y1, y1 + h, color); } return (result); } int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (vlineColor(dst, x, y1, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Rectangle */ int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { int result; Sint16 w, h, xtmp, ytmp; /* * Swap x1, x2 if required */ if (x1 > x2) { xtmp = x1; x1 = x2; x2 = xtmp; } /* * Swap y1, y2 if required */ if (y1 > y2) { ytmp = y1; y1 = y2; y2 = ytmp; } /* * Calculate width&height */ w = x2 - x1; h = y2 - y1; /* * Sanity check */ if ((w < 0) || (h < 0)) { return (0); } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } else { if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } } /* * Draw rectangle */ result = 0; result |= hlineColor(dst, x1, x2, y1, color); result |= hlineColor(dst, x1, x2, y2, color); y1 += 1; y2 -= 1; if (y1<=y2) { result |= vlineColor(dst, x1, y1, y2, color); result |= vlineColor(dst, x2, y1, y2, color); } return (result); } int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (rectangleColor (dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* --------- Clipping routines for line */ /* Clipping based heavily on code from */ /* http://www.ncsa.uiuc.edu/Vis/Graphics/src/clipCohSuth.c */ #define CLIP_LEFT_EDGE 0x1 #define CLIP_RIGHT_EDGE 0x2 #define CLIP_BOTTOM_EDGE 0x4 #define CLIP_TOP_EDGE 0x8 #define CLIP_INSIDE(a) (!a) #define CLIP_REJECT(a,b) (a&b) #define CLIP_ACCEPT(a,b) (!(a|b)) static int clipEncode(Sint16 x, Sint16 y, Sint16 left, Sint16 top, Sint16 right, Sint16 bottom) { int code = 0; if (x < left) { code |= CLIP_LEFT_EDGE; } else if (x > right) { code |= CLIP_RIGHT_EDGE; } if (y < top) { code |= CLIP_TOP_EDGE; } else if (y > bottom) { code |= CLIP_BOTTOM_EDGE; } return code; } static int clipLine(SDL_Surface * dst, Sint16 * x1, Sint16 * y1, Sint16 * x2, Sint16 * y2) { Sint16 left, right, top, bottom; int code1, code2; int draw = 0; Sint16 swaptmp; float m; /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; while (1) { code1 = clipEncode(*x1, *y1, left, top, right, bottom); code2 = clipEncode(*x2, *y2, left, top, right, bottom); if (CLIP_ACCEPT(code1, code2)) { draw = 1; break; } else if (CLIP_REJECT(code1, code2)) break; else { if (CLIP_INSIDE(code1)) { swaptmp = *x2; *x2 = *x1; *x1 = swaptmp; swaptmp = *y2; *y2 = *y1; *y1 = swaptmp; swaptmp = code2; code2 = code1; code1 = swaptmp; } if (*x2 != *x1) { m = (*y2 - *y1) / (float) (*x2 - *x1); } else { m = 1.0f; } if (code1 & CLIP_LEFT_EDGE) { *y1 += (Sint16) ((left - *x1) * m); *x1 = left; } else if (code1 & CLIP_RIGHT_EDGE) { *y1 += (Sint16) ((right - *x1) * m); *x1 = right; } else if (code1 & CLIP_BOTTOM_EDGE) { if (*x2 != *x1) { *x1 += (Sint16) ((bottom - *y1) / m); } *y1 = bottom; } else if (code1 & CLIP_TOP_EDGE) { if (*x2 != *x1) { *x1 += (Sint16) ((top - *y1) / m); } *y1 = top; } } } return draw; } /* ----- Filled rectangle (Box) */ int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { Sint16 left, right, top, bottom; Uint8 *pixel, *pixellast; int x, dx; int dy; int pixx, pixy; Sint16 w, h, tmp; int result; Uint8 *colorptr; /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* Check visibility */ if ((x1right) && (x2>right)) { return(0); } if ((y1bottom) && (y2>bottom)) { return(0); } /* Clip all points */ if (x1right) { x1=right; } if (x2right) { x2=right; } if (y1bottom) { y1=bottom; } if (y2bottom) { y2=bottom; } /* * Order coordinates */ if (x1 > x2) { tmp = x1; x1 = x2; x2 = tmp; } if (y1 > y2) { tmp = y1; y1 = y2; y2 = tmp; } /* * Test for special cases of straight line or single point */ if (x1 == x2) { if (y1 == y2) { return (pixelColor(dst, x1, y1, color)); } else { return (vlineColor(dst, x1, y1, y2, color)); } } if (y1 == y2) { return (hlineColor(dst, x1, x2, y1, color)); } /* * Calculate width&height */ w = x2 - x1; h = y2 - y1; /* * Alpha check */ if ((color & 255) == 255) { /* * No alpha-blending required */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Lock surface */ SDL_LockSurface(dst); /* * More variable setup */ dx = w; dy = h; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y1; pixellast = pixel + pixx * dx + pixy * dy; dx++; /* * Draw */ switch (dst->format->BytesPerPixel) { case 1: for (; pixel <= pixellast; pixel += pixy) { memset(pixel, (Uint8) color, dx); } break; case 2: pixy -= (pixx * dx); for (; pixel <= pixellast; pixel += pixy) { for (x = 0; x < dx; x++) { *(Uint16 *) pixel = color; pixel += pixx; } } break; case 3: pixy -= (pixx * dx); for (; pixel <= pixellast; pixel += pixy) { for (x = 0; x < dx; x++) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } pixel += pixx; } } break; default: /* case 4 */ pixy -= (pixx * dx); for (; pixel <= pixellast; pixel += pixy) { for (x = 0; x < dx; x++) { *(Uint32 *) pixel = color; pixel += pixx; } } break; } /* * Unlock surface */ SDL_UnlockSurface(dst); result = 0; } else { result = filledRectAlpha(dst, x1, y1, x1 + w, y1 + h, color); } return (result); } int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (boxColor(dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Line */ /* Non-alpha line drawing code adapted from routine */ /* by Pete Shinners, pete@shinners.org */ /* Originally from pygame, http://pygame.seul.org */ #define ABS(a) (((a)<0) ? -(a) : (a)) int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { int pixx, pixy; int x, y; int dx, dy; int ax, ay; int sx, sy; int swaptmp; Uint8 *pixel; Uint8 *colorptr; /* * Clip line and test if we have to draw */ if (!(clipLine(dst, &x1, &y1, &x2, &y2))) { return (0); } /* * Test for special cases of straight lines or single point */ if (x1 == x2) { if (y1 < y2) { return (vlineColor(dst, x1, y1, y2, color)); } else if (y1 > y2) { return (vlineColor(dst, x1, y2, y1, color)); } else { return (pixelColor(dst, x1, y1, color)); } } if (y1 == y2) { if (x1 < x2) { return (hlineColor(dst, x1, x2, y1, color)); } else if (x1 > x2) { return (hlineColor(dst, x2, x1, y1, color)); } } /* * Variable setup */ dx = x2 - x1; dy = y2 - y1; sx = (dx >= 0) ? 1 : -1; sy = (dy >= 0) ? 1 : -1; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Check for alpha blending */ if ((color & 255) == 255) { /* * No alpha blending - use fast pixel routines */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * More variable setup */ dx = sx * dx + 1; dy = sy * dy + 1; pixx = dst->format->BytesPerPixel; pixy = dst->pitch; pixel = ((Uint8 *) dst->pixels) + pixx * (int) x1 + pixy * (int) y1; pixx *= sx; pixy *= sy; if (dx < dy) { swaptmp = dx; dx = dy; dy = swaptmp; swaptmp = pixx; pixx = pixy; pixy = swaptmp; } /* * Draw */ x = 0; y = 0; switch (dst->format->BytesPerPixel) { case 1: for (; x < dx; x++, pixel += pixx) { *pixel = color; y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; case 2: for (; x < dx; x++, pixel += pixx) { *(Uint16 *) pixel = color; y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; case 3: for (; x < dx; x++, pixel += pixx) { if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { pixel[0] = (color >> 16) & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = color & 0xff; } else { pixel[0] = color & 0xff; pixel[1] = (color >> 8) & 0xff; pixel[2] = (color >> 16) & 0xff; } y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; default: /* case 4 */ for (; x < dx; x++, pixel += pixx) { *(Uint32 *) pixel = color; y += dy; if (y >= dx) { y -= dx; pixel += pixy; } } break; } } else { /* * Alpha blending required - use single-pixel blits */ ax = ABS(dx) << 1; ay = ABS(dy) << 1; x = x1; y = y1; if (ax > ay) { int d = ay - (ax >> 1); while (x != x2) { pixelColorNolock (dst, x, y, color); if (d > 0 || (d == 0 && sx == 1)) { y += sy; d -= ax; } x += sx; d += ay; } } else { int d = ax - (ay >> 1); while (y != y2) { pixelColorNolock (dst, x, y, color); if (d > 0 || ((d == 0) && (sy == 1))) { x += sx; d -= ay; } y += sy; d += ax; } } pixelColorNolock (dst, x, y, color); } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (0); } int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (lineColor(dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* AA Line */ #define AAlevels 256 #define AAbits 8 /* This implementation of the Wu antialiasing code is based on Mike Abrash's DDJ article which was reprinted as Chapter 42 of his Graphics Programming Black Book, but has been optimized to work with SDL and utilizes 32-bit fixed-point arithmetic. (A. Schiffler). */ int aalineColorInt(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color, int draw_endpoint) { Sint32 xx0, yy0, xx1, yy1; int result; Uint32 intshift, erracc, erradj; Uint32 erracctmp, wgt, wgtcompmask; int dx, dy, tmp, xdir, y0p1, x0pxdir; /* * Clip line and test if we have to draw */ if (!(clipLine(dst, &x1, &y1, &x2, &y2))) { return (0); } /* * Keep on working with 32bit numbers */ xx0 = x1; yy0 = y1; xx1 = x2; yy1 = y2; /* * Reorder points if required */ if (yy0 > yy1) { tmp = yy0; yy0 = yy1; yy1 = tmp; tmp = xx0; xx0 = xx1; xx1 = tmp; } /* * Calculate distance */ dx = xx1 - xx0; dy = yy1 - yy0; /* * Adjust for negative dx and set xdir */ if (dx >= 0) { xdir = 1; } else { xdir = -1; dx = (-dx); } /* * Check for special cases */ if (dx == 0) { /* * Vertical line */ return (vlineColor(dst, x1, y1, y2, color)); } else if (dy == 0) { /* * Horizontal line */ return (hlineColor(dst, x1, x2, y1, color)); } else if (dx == dy) { /* * Diagonal line */ return (lineColor(dst, x1, y1, x2, y2, color)); } /* * Line is not horizontal, vertical or diagonal */ result = 0; /* * Zero accumulator */ erracc = 0; /* * # of bits by which to shift erracc to get intensity level */ intshift = 32 - AAbits; /* * Mask used to flip all bits in an intensity weighting */ wgtcompmask = AAlevels - 1; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Draw the initial pixel in the foreground color */ result |= pixelColorNolock(dst, x1, y1, color); /* * x-major or y-major? */ if (dy > dx) { /* * y-major. Calculate 16-bit fixed point fractional part of a pixel that * X advances every time Y advances 1 pixel, truncating the result so that * we won't overrun the endpoint along the X axis */ /* * Not-so-portable version: erradj = ((Uint64)dx << 32) / (Uint64)dy; */ erradj = ((dx << 16) / dy) << 16; /* * draw all pixels other than the first and last */ x0pxdir = xx0 + xdir; while (--dy) { erracctmp = erracc; erracc += erradj; if (erracc <= erracctmp) { /* * rollover in error accumulator, x coord advances */ xx0 = x0pxdir; x0pxdir += xdir; } yy0++; /* y-major so always advance Y */ /* * the AAbits most significant bits of erracc give us the intensity * weighting for this pixel, and the complement of the weighting for * the paired pixel. */ wgt = (erracc >> intshift) & 255; result |= pixelColorWeightNolock (dst, xx0, yy0, color, 255 - wgt); result |= pixelColorWeightNolock (dst, x0pxdir, yy0, color, wgt); } } else { /* * x-major line. Calculate 16-bit fixed-point fractional part of a pixel * that Y advances each time X advances 1 pixel, truncating the result so * that we won't overrun the endpoint along the X axis. */ /* * Not-so-portable version: erradj = ((Uint64)dy << 32) / (Uint64)dx; */ erradj = ((dy << 16) / dx) << 16; /* * draw all pixels other than the first and last */ y0p1 = yy0 + 1; while (--dx) { erracctmp = erracc; erracc += erradj; if (erracc <= erracctmp) { /* * Accumulator turned over, advance y */ yy0 = y0p1; y0p1++; } xx0 += xdir; /* x-major so always advance X */ /* * the AAbits most significant bits of erracc give us the intensity * weighting for this pixel, and the complement of the weighting for * the paired pixel. */ wgt = (erracc >> intshift) & 255; result |= pixelColorWeightNolock (dst, xx0, yy0, color, 255 - wgt); result |= pixelColorWeightNolock (dst, xx0, y0p1, color, wgt); } } /* * Do we have to draw the endpoint */ if (draw_endpoint) { /* * Draw final pixel, always exactly intersected by the line and doesn't * need to be weighted. */ result |= pixelColorNolock (dst, x2, y2, color); } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color) { return (aalineColorInt(dst, x1, y1, x2, y2, color, 1)); } int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (aalineColorInt (dst, x1, y1, x2, y2, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a, 1)); } /* ----- Circle */ /* Note: Based on algorithm from sge library, modified by A. Schiffler */ /* with multiple pixel-draw removal and other minor speedup changes. */ int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; Sint16 cx = 0; Sint16 cy = r; Sint16 ocx = (Sint16) 0xffff; Sint16 ocy = (Sint16) 0xffff; Sint16 df = 1 - r; Sint16 d_e = 3; Sint16 d_se = -2 * r + 5; Sint16 xpcx, xmcx, xpcy, xmcy; Sint16 ypcy, ymcy, ypcx, ymcx; Uint8 *colorptr; /* * Sanity check radius */ if (r < 0) { return (-1); } /* * Special case for r=0 - draw a point */ if (r == 0) { return (pixelColor(dst, x, y, color)); } /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* * Test if bounding box of circle is visible */ x1 = x - r; x2 = x + r; y1 = y - r; y2 = y + r; if ((x1right) && (x2>right)) { return(0); } if ((y1bottom) && (y2>bottom)) { return(0); } /* * Draw circle */ result = 0; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Alpha Check */ if ((color & 255) == 255) { /* * No Alpha - direct memory writes */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } /* * Draw */ do { if ((ocy != cy) || (ocx != cx)) { xpcx = x + cx; xmcx = x - cx; if (cy > 0) { ypcy = y + cy; ymcy = y - cy; result |= fastPixelColorNolock(dst, xmcx, ypcy, color); result |= fastPixelColorNolock(dst, xpcx, ypcy, color); result |= fastPixelColorNolock(dst, xmcx, ymcy, color); result |= fastPixelColorNolock(dst, xpcx, ymcy, color); } else { result |= fastPixelColorNolock(dst, xmcx, y, color); result |= fastPixelColorNolock(dst, xpcx, y, color); } ocy = cy; xpcy = x + cy; xmcy = x - cy; if (cx > 0) { ypcx = y + cx; ymcx = y - cx; result |= fastPixelColorNolock(dst, xmcy, ypcx, color); result |= fastPixelColorNolock(dst, xpcy, ypcx, color); result |= fastPixelColorNolock(dst, xmcy, ymcx, color); result |= fastPixelColorNolock(dst, xpcy, ymcx, color); } else { result |= fastPixelColorNolock(dst, xmcy, y, color); result |= fastPixelColorNolock(dst, xpcy, y, color); } ocx = cx; } /* * Update */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); /* * Unlock surface */ SDL_UnlockSurface(dst); } else { /* * Using Alpha - blended pixel blits */ do { /* * Draw */ if ((ocy != cy) || (ocx != cx)) { xpcx = x + cx; xmcx = x - cx; if (cy > 0) { ypcy = y + cy; ymcy = y - cy; result |= pixelColorNolock (dst, xmcx, ypcy, color); result |= pixelColorNolock (dst, xpcx, ypcy, color); result |= pixelColorNolock (dst, xmcx, ymcy, color); result |= pixelColorNolock (dst, xpcx, ymcy, color); } else { result |= pixelColorNolock (dst, xmcx, y, color); result |= pixelColorNolock (dst, xpcx, y, color); } ocy = cy; xpcy = x + cy; xmcy = x - cy; if (cx > 0) { ypcx = y + cx; ymcx = y - cx; result |= pixelColorNolock (dst, xmcy, ypcx, color); result |= pixelColorNolock (dst, xpcy, ypcx, color); result |= pixelColorNolock (dst, xmcy, ymcx, color); result |= pixelColorNolock (dst, xpcy, ymcx, color); } else { result |= pixelColorNolock (dst, xmcy, y, color); result |= pixelColorNolock (dst, xpcy, y, color); } ocx = cx; } /* * Update */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); } /* Alpha check */ /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (circleColor(dst, x, y, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- AA Circle */ /* AA circle is based on AAellipse */ int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color) { return (aaellipseColor(dst, x, y, r, r, color)); } int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (aaellipseColor (dst, x, y, rad, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Filled Circle */ /* Note: Based on algorithm from sge library with multiple-hline draw removal */ /* and other speedup changes. */ int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; Sint16 cx = 0; Sint16 cy = r; Sint16 ocx = (Sint16) 0xffff; Sint16 ocy = (Sint16) 0xffff; Sint16 df = 1 - r; Sint16 d_e = 3; Sint16 d_se = -2 * r + 5; Sint16 xpcx, xmcx, xpcy, xmcy; Sint16 ypcy, ymcy, ypcx, ymcx; /* * Sanity check radius */ if (r < 0) { return (-1); } /* * Special case for r=0 - draw a point */ if (r == 0) { return (pixelColor(dst, x, y, color)); } /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* * Test if bounding box of circle is visible */ x1 = x - r; x2 = x + r; y1 = y - r; y2 = y + r; if ((x1right) && (x2>right)) { return(0); } if ((y1bottom) && (y2>bottom)) { return(0); } /* * Draw */ result = 0; do { xpcx = x + cx; xmcx = x - cx; xpcy = x + cy; xmcy = x - cy; if (ocy != cy) { if (cy > 0) { ypcy = y + cy; ymcy = y - cy; result |= hlineColor(dst, xmcx, xpcx, ypcy, color); result |= hlineColor(dst, xmcx, xpcx, ymcy, color); } else { result |= hlineColor(dst, xmcx, xpcx, y, color); } ocy = cy; } if (ocx != cx) { if (cx != cy) { if (cx > 0) { ypcx = y + cx; ymcx = y - cx; result |= hlineColor(dst, xmcy, xpcy, ymcx, color); result |= hlineColor(dst, xmcy, xpcy, ypcx, color); } else { result |= hlineColor(dst, xmcy, xpcy, y, color); } } ocx = cx; } /* * Update */ if (df < 0) { df += d_e; d_e += 2; d_se += 2; } else { df += d_se; d_e += 2; d_se += 4; cy--; } cx++; } while (cx <= cy); return (result); } int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (filledCircleColor (dst, x, y, rad, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- Ellipse */ /* Note: Based on algorithm from sge library with multiple-hline draw removal */ /* and other speedup changes. */ int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; int ix, iy; int h, i, j, k; int oh, oi, oj, ok; int xmh, xph, ypk, ymk; int xmi, xpi, ymj, ypj; int xmj, xpj, ymi, ypi; int xmk, xpk, ymh, yph; Uint8 *colorptr; /* * Sanity check radii */ if ((rx < 0) || (ry < 0)) { return (-1); } /* * Special case for rx=0 - draw a vline */ if (rx == 0) { return (vlineColor(dst, x, y - ry, y + ry, color)); } /* * Special case for ry=0 - draw a hline */ if (ry == 0) { return (hlineColor(dst, x - rx, x + rx, y, color)); } /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* * Test if bounding box of ellipse is visible */ x1 = x - rx; x2 = x + rx; y1 = y - ry; y2 = y + ry; if ((x1right) && (x2>right)) { return(0); } if ((y1bottom) && (y2>bottom)) { return(0); } /* * Init vars */ oh = oi = oj = ok = 0xFFFF; /* * Draw */ result = 0; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* * Check alpha */ if ((color & 255) == 255) { /* * No Alpha - direct memory writes */ /* * Setup color */ colorptr = (Uint8 *) & color; if (SDL_BYTEORDER == SDL_BIG_ENDIAN) { color = SDL_MapRGBA(dst->format, colorptr[0], colorptr[1], colorptr[2], colorptr[3]); } else { color = SDL_MapRGBA(dst->format, colorptr[3], colorptr[2], colorptr[1], colorptr[0]); } if (rx > ry) { ix = 0; iy = rx * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * ry) / rx; k = (i * ry) / rx; if (((ok != k) && (oj != k)) || ((oj != j) && (ok != j)) || (k != j)) { xph = x + h; xmh = x - h; if (k > 0) { ypk = y + k; ymk = y - k; result |= fastPixelColorNolock(dst, xmh, ypk, color); result |= fastPixelColorNolock(dst, xph, ypk, color); result |= fastPixelColorNolock(dst, xmh, ymk, color); result |= fastPixelColorNolock(dst, xph, ymk, color); } else { result |= fastPixelColorNolock(dst, xmh, y, color); result |= fastPixelColorNolock(dst, xph, y, color); } ok = k; xpi = x + i; xmi = x - i; if (j > 0) { ypj = y + j; ymj = y - j; result |= fastPixelColorNolock(dst, xmi, ypj, color); result |= fastPixelColorNolock(dst, xpi, ypj, color); result |= fastPixelColorNolock(dst, xmi, ymj, color); result |= fastPixelColorNolock(dst, xpi, ymj, color); } else { result |= fastPixelColorNolock(dst, xmi, y, color); result |= fastPixelColorNolock(dst, xpi, y, color); } oj = j; } ix = ix + iy / rx; iy = iy - ix / rx; } while (i > h); } else { ix = 0; iy = ry * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * rx) / ry; k = (i * rx) / ry; if (((oi != i) && (oh != i)) || ((oh != h) && (oi != h) && (i != h))) { xmj = x - j; xpj = x + j; if (i > 0) { ypi = y + i; ymi = y - i; result |= fastPixelColorNolock(dst, xmj, ypi, color); result |= fastPixelColorNolock(dst, xpj, ypi, color); result |= fastPixelColorNolock(dst, xmj, ymi, color); result |= fastPixelColorNolock(dst, xpj, ymi, color); } else { result |= fastPixelColorNolock(dst, xmj, y, color); result |= fastPixelColorNolock(dst, xpj, y, color); } oi = i; xmk = x - k; xpk = x + k; if (h > 0) { yph = y + h; ymh = y - h; result |= fastPixelColorNolock(dst, xmk, yph, color); result |= fastPixelColorNolock(dst, xpk, yph, color); result |= fastPixelColorNolock(dst, xmk, ymh, color); result |= fastPixelColorNolock(dst, xpk, ymh, color); } else { result |= fastPixelColorNolock(dst, xmk, y, color); result |= fastPixelColorNolock(dst, xpk, y, color); } oh = h; } ix = ix + iy / ry; iy = iy - ix / ry; } while (i > h); } } else { if (rx > ry) { ix = 0; iy = rx * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * ry) / rx; k = (i * ry) / rx; if (((ok != k) && (oj != k)) || ((oj != j) && (ok != j)) || (k != j)) { xph = x + h; xmh = x - h; if (k > 0) { ypk = y + k; ymk = y - k; result |= pixelColorNolock (dst, xmh, ypk, color); result |= pixelColorNolock (dst, xph, ypk, color); result |= pixelColorNolock (dst, xmh, ymk, color); result |= pixelColorNolock (dst, xph, ymk, color); } else { result |= pixelColorNolock (dst, xmh, y, color); result |= pixelColorNolock (dst, xph, y, color); } ok = k; xpi = x + i; xmi = x - i; if (j > 0) { ypj = y + j; ymj = y - j; result |= pixelColorNolock (dst, xmi, ypj, color); result |= pixelColorNolock (dst, xpi, ypj, color); result |= pixelColorNolock (dst, xmi, ymj, color); result |= pixelColor(dst, xpi, ymj, color); } else { result |= pixelColorNolock (dst, xmi, y, color); result |= pixelColorNolock (dst, xpi, y, color); } oj = j; } ix = ix + iy / rx; iy = iy - ix / rx; } while (i > h); } else { ix = 0; iy = ry * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * rx) / ry; k = (i * rx) / ry; if (((oi != i) && (oh != i)) || ((oh != h) && (oi != h) && (i != h))) { xmj = x - j; xpj = x + j; if (i > 0) { ypi = y + i; ymi = y - i; result |= pixelColorNolock (dst, xmj, ypi, color); result |= pixelColorNolock (dst, xpj, ypi, color); result |= pixelColorNolock (dst, xmj, ymi, color); result |= pixelColorNolock (dst, xpj, ymi, color); } else { result |= pixelColorNolock (dst, xmj, y, color); result |= pixelColorNolock (dst, xpj, y, color); } oi = i; xmk = x - k; xpk = x + k; if (h > 0) { yph = y + h; ymh = y - h; result |= pixelColorNolock (dst, xmk, yph, color); result |= pixelColorNolock (dst, xpk, yph, color); result |= pixelColorNolock (dst, xmk, ymh, color); result |= pixelColorNolock (dst, xpk, ymh, color); } else { result |= pixelColorNolock (dst, xmk, y, color); result |= pixelColorNolock (dst, xpk, y, color); } oh = h; } ix = ix + iy / ry; iy = iy - ix / ry; } while (i > h); } } /* Alpha check */ /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (ellipseColor(dst, x, y, rx, ry, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- AA Ellipse */ /* Based on code from Anders Lindstroem, based on code from SGE, based on code from TwinLib */ int aaellipseColor(SDL_Surface * dst, Sint16 xc, Sint16 yc, Sint16 rx, Sint16 ry, Uint32 color) { Sint16 left, right, top, bottom; Sint16 x1,y1,x2,y2; int i; int a2, b2, ds, dt, dxt, t, s, d; Sint16 x, y, xs, ys, dyt, xx, yy, xc2, yc2; float cp; Uint8 weight, iweight; int result; /* * Sanity check radii */ if ((rx < 0) || (ry < 0)) { return (-1); } /* * Special case for rx=0 - draw a vline */ if (rx == 0) { return (vlineColor(dst, xc, yc - ry, yc + ry, color)); } /* * Special case for ry=0 - draw a hline */ if (ry == 0) { return (hlineColor(dst, xc - rx, xc + rx, yc, color)); } /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* * Test if bounding box of ellipse is visible */ x1 = xc - rx; x2 = xc + rx; y1 = yc - ry; y2 = yc + ry; if ((x1right) && (x2>right)) { return(0); } if ((y1bottom) && (y2>bottom)) { return(0); } /* Variable setup */ a2 = rx * rx; b2 = ry * ry; ds = 2 * a2; dt = 2 * b2; xc2 = 2 * xc; yc2 = 2 * yc; dxt = (int) (a2 / sqrt(a2 + b2)); t = 0; s = -2 * a2 * ry; d = 0; x = xc; y = yc - ry; /* Draw */ result = 0; /* Lock surface */ if (SDL_MUSTLOCK(dst)) { if (SDL_LockSurface(dst) < 0) { return (-1); } } /* "End points" */ result |= pixelColorNolock(dst, x, y, color); result |= pixelColorNolock(dst, xc2 - x, y, color); result |= pixelColorNolock(dst, x, yc2 - y, color); result |= pixelColorNolock(dst, xc2 - x, yc2 - y, color); for (i = 1; i <= dxt; i++) { x--; d += t - b2; if (d >= 0) ys = y - 1; else if ((d - s - a2) > 0) { if ((2 * d - s - a2) >= 0) ys = y + 1; else { ys = y; y++; d -= s + a2; s += ds; } } else { y++; ys = y + 1; d -= s + a2; s += ds; } t -= dt; /* Calculate alpha */ if (s != 0.0) { cp = (float) abs(d) / (float) abs(s); if (cp > 1.0) { cp = 1.0; } } else { cp = 1.0; } /* Calculate weights */ weight = (Uint8) (cp * 255); iweight = 255 - weight; /* Upper half */ xx = xc2 - x; result |= pixelColorWeightNolock(dst, x, y, color, iweight); result |= pixelColorWeightNolock(dst, xx, y, color, iweight); result |= pixelColorWeightNolock(dst, x, ys, color, weight); result |= pixelColorWeightNolock(dst, xx, ys, color, weight); /* Lower half */ yy = yc2 - y; result |= pixelColorWeightNolock(dst, x, yy, color, iweight); result |= pixelColorWeightNolock(dst, xx, yy, color, iweight); yy = yc2 - ys; result |= pixelColorWeightNolock(dst, x, yy, color, weight); result |= pixelColorWeightNolock(dst, xx, yy, color, weight); } dyt = abs(y - yc); for (i = 1; i <= dyt; i++) { y++; d -= s + a2; if (d <= 0) xs = x + 1; else if ((d + t - b2) < 0) { if ((2 * d + t - b2) <= 0) xs = x - 1; else { xs = x; x--; d += t - b2; t -= dt; } } else { x--; xs = x - 1; d += t - b2; t -= dt; } s += ds; /* Calculate alpha */ if (t != 0.0) { cp = (float) abs(d) / (float) abs(t); if (cp > 1.0) { cp = 1.0; } } else { cp = 1.0; } /* Calculate weight */ weight = (Uint8) (cp * 255); iweight = 255 - weight; /* Left half */ xx = xc2 - x; yy = yc2 - y; result |= pixelColorWeightNolock(dst, x, y, color, iweight); result |= pixelColorWeightNolock(dst, xx, y, color, iweight); result |= pixelColorWeightNolock(dst, x, yy, color, iweight); result |= pixelColorWeightNolock(dst, xx, yy, color, iweight); /* Right half */ xx = 2 * xc - xs; result |= pixelColorWeightNolock(dst, xs, y, color, weight); result |= pixelColorWeightNolock(dst, xx, y, color, weight); result |= pixelColorWeightNolock(dst, xs, yy, color, weight); result |= pixelColorWeightNolock(dst, xx, yy, color, weight); } /* Unlock surface */ if (SDL_MUSTLOCK(dst)) { SDL_UnlockSurface(dst); } return (result); } int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (aaellipseColor (dst, x, y, rx, ry, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ---- Filled Ellipse */ /* Note: */ /* Based on algorithm from sge library with multiple-hline draw removal */ /* and other speedup changes. */ int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color) { Sint16 left, right, top, bottom; int result; Sint16 x1, y1, x2, y2; int ix, iy; int h, i, j, k; int oh, oi, oj, ok; int xmh, xph; int xmi, xpi; int xmj, xpj; int xmk, xpk; /* * Sanity check radii */ if ((rx < 0) || (ry < 0)) { return (-1); } /* * Special case for rx=0 - draw a vline */ if (rx == 0) { return (vlineColor(dst, x, y - ry, y + ry, color)); } /* * Special case for ry=0 - draw a hline */ if (ry == 0) { return (hlineColor(dst, x - rx, x + rx, y, color)); } /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* * Test if bounding box of ellipse is visible */ x1 = x - rx; x2 = x + rx; y1 = y - ry; y2 = y + ry; if ((x1right) && (x2>right)) { return(0); } if ((y1bottom) && (y2>bottom)) { return(0); } /* * Init vars */ oh = oi = oj = ok = 0xFFFF; /* * Draw */ result = 0; if (rx > ry) { ix = 0; iy = rx * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * ry) / rx; k = (i * ry) / rx; if ((ok != k) && (oj != k)) { xph = x + h; xmh = x - h; if (k > 0) { result |= hlineColor(dst, xmh, xph, y + k, color); result |= hlineColor(dst, xmh, xph, y - k, color); } else { result |= hlineColor(dst, xmh, xph, y, color); } ok = k; } if ((oj != j) && (ok != j) && (k != j)) { xmi = x - i; xpi = x + i; if (j > 0) { result |= hlineColor(dst, xmi, xpi, y + j, color); result |= hlineColor(dst, xmi, xpi, y - j, color); } else { result |= hlineColor(dst, xmi, xpi, y, color); } oj = j; } ix = ix + iy / rx; iy = iy - ix / rx; } while (i > h); } else { ix = 0; iy = ry * 64; do { h = (ix + 32) >> 6; i = (iy + 32) >> 6; j = (h * rx) / ry; k = (i * rx) / ry; if ((oi != i) && (oh != i)) { xmj = x - j; xpj = x + j; if (i > 0) { result |= hlineColor(dst, xmj, xpj, y + i, color); result |= hlineColor(dst, xmj, xpj, y - i, color); } else { result |= hlineColor(dst, xmj, xpj, y, color); } oi = i; } if ((oh != h) && (oi != h) && (i != h)) { xmk = x - k; xpk = x + k; if (h > 0) { result |= hlineColor(dst, xmk, xpk, y + h, color); result |= hlineColor(dst, xmk, xpk, y - h, color); } else { result |= hlineColor(dst, xmk, xpk, y, color); } oh = h; } ix = ix + iy / ry; iy = iy - ix / ry; } while (i > h); } return (result); } int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (filledEllipseColor (dst, x, y, rx, ry, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ----- filled pie */ /* Low-speed float pie-calc implementation by drawing polygons. */ int filledpieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color) { Sint16 left, right, top, bottom; Sint16 x1, y1, x2, y2; int result; double angle, start_angle, end_angle; double deltaAngle; double dr; int posX, posY; int numpoints, i; Sint16 *vx, *vy; /* * Sanity check radii */ if (rad < 0) { return (-1); } /* * Fixup angles */ start = start % 360; end = end % 360; /* * Special case for rad=0 - draw a point */ if (rad == 0) { return (pixelColor(dst, x, y, color)); } /* * Get clipping boundary */ left = dst->clip_rect.x; right = dst->clip_rect.x + dst->clip_rect.w - 1; top = dst->clip_rect.y; bottom = dst->clip_rect.y + dst->clip_rect.h - 1; /* * Test if bounding box of pie's circle is visible */ x1 = x - rad; x2 = x + rad; y1 = y - rad; y2 = y + rad; if ((x1right) && (x2>right)) { return(0); } if ((y1bottom) && (y2>bottom)) { return(0); } /* * Variable setup */ dr = (double) rad; deltaAngle = 3.0 / dr; start_angle = (double) start *(2.0 * M_PI / 360.0); end_angle = (double) end *(2.0 * M_PI / 360.0); if (start > end) { end_angle += (2.0 * M_PI); } /* Count points (rather than calculate it) */ numpoints = 1; angle = start_angle; while (angle <= end_angle) { angle += deltaAngle; numpoints++; } /* Check size of array */ if (numpoints == 1) { return (pixelColor(dst, x, y, color)); } else if (numpoints == 2) { posX = x + (int) (dr * cos(start_angle)); posY = y + (int) (dr * sin(start_angle)); return (lineColor(dst, x, y, posX, posY, color)); } /* Allocate vertex array */ vx = vy = (Sint16 *) malloc(2 * sizeof(Uint16) * numpoints); if (vx == NULL) { return (-1); } vy += numpoints; /* Center */ vx[0] = x; vy[0] = y; /* Calculate and store vertices */ i = 1; angle = start_angle; while (angle <= end_angle) { vx[i] = x + (int) (dr * cos(angle)); vy[i] = y + (int) (dr * sin(angle)); angle += deltaAngle; i++; } /* Draw */ result = filledPolygonColor(dst, vx, vy, numpoints, color); /* Free vertex array */ free(vx); return (result); } int filledpieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { return (filledpieColor(dst, x, y, rad, start, end, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* Trigon */ int trigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(polygonColor(dst,vx,vy,3,color)); } int trigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(polygonRGBA(dst,vx,vy,3,r,g,b,a)); } /* AA-Trigon */ int aatrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(aapolygonColor(dst,vx,vy,3,color)); } int aatrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(aapolygonRGBA(dst,vx,vy,3,r,g,b,a)); } /* Filled Trigon */ int filledTrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, int color) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(filledPolygonColor(dst,vx,vy,3,color)); } int filledTrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { Sint16 vx[3]; Sint16 vy[3]; vx[0]=x1; vx[1]=x2; vx[2]=x3; vy[0]=y1; vy[1]=y2; vy[2]=y3; return(filledPolygonRGBA(dst,vx,vy,3,r,g,b,a)); } /* ---- Polygon */ int polygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint32 color) { int result; int i; Sint16 *x1, *y1, *x2, *y2; /* * Sanity check */ if (n < 3) { return (-1); } /* * Pointer setup */ x1 = x2 = vx; y1 = y2 = vy; x2++; y2++; /* * Draw */ result = 0; for (i = 1; i < n; i++) { result |= lineColor(dst, *x1, *y1, *x2, *y2, color); x1 = x2; y1 = y2; x2++; y2++; } result |= lineColor(dst, *x1, *y1, *vx, *vy, color); return (result); } int polygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (polygonColor(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ---- AA-Polygon */ int aapolygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint32 color) { int result; int i; Sint16 *x1, *y1, *x2, *y2; /* * Sanity check */ if (n < 3) { return (-1); } /* * Pointer setup */ x1 = x2 = vx; y1 = y2 = vy; x2++; y2++; /* * Draw */ result = 0; for (i = 1; i < n; i++) { result |= aalineColorInt(dst, *x1, *y1, *x2, *y2, color, 0); x1 = x2; y1 = y2; x2++; y2++; } result |= aalineColorInt(dst, *x1, *y1, *vx, *vy, color, 0); return (result); } int aapolygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (aapolygonColor(dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } /* ---- Filled Polygon */ int gfxPrimitivesCompareInt(const void *a, const void *b); static int *gfxPrimitivesPolyInts = NULL; static int gfxPrimitivesPolyAllocated = 0; int filledPolygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, int color) { int result; int i; int x, y, xa, xb; int miny, maxy; int x1, y1; int x2, y2; int ind1, ind2; int ints; /* * Sanity check */ if (n < 3) { return -1; } /* * Allocate temp array, only grow array */ if (!gfxPrimitivesPolyAllocated) { gfxPrimitivesPolyInts = (int *) malloc(sizeof(int) * n); gfxPrimitivesPolyAllocated = n; } else { if (gfxPrimitivesPolyAllocated < n) { gfxPrimitivesPolyInts = (int *) realloc(gfxPrimitivesPolyInts, sizeof(int) * n); gfxPrimitivesPolyAllocated = n; } } /* * Determine Y maxima */ miny = vy[0]; maxy = vy[0]; for (i = 1; (i < n); i++) { if (vy[i] < miny) { miny = vy[i]; } else if (vy[i] > maxy) { maxy = vy[i]; } } /* * Draw, scanning y */ result = 0; for (y = miny; (y <= maxy); y++) { ints = 0; for (i = 0; (i < n); i++) { if (!i) { ind1 = n - 1; ind2 = 0; } else { ind1 = i - 1; ind2 = i; } y1 = vy[ind1]; y2 = vy[ind2]; if (y1 < y2) { x1 = vx[ind1]; x2 = vx[ind2]; } else if (y1 > y2) { y2 = vy[ind1]; y1 = vy[ind2]; x2 = vx[ind1]; x1 = vx[ind2]; } else { continue; } if ( ((y >= y1) && (y < y2)) || ((y == maxy) && (y > y1) && (y <= y2)) ) { gfxPrimitivesPolyInts[ints++] = ((65536 * (y - y1)) / (y2 - y1)) * (x2 - x1) + (65536 * x1); } } qsort(gfxPrimitivesPolyInts, ints, sizeof(int), gfxPrimitivesCompareInt); for (i = 0; (i < ints); i += 2) { xa = gfxPrimitivesPolyInts[i] + 1; xa = (xa >> 16) + ((xa & 32768) >> 15); xb = gfxPrimitivesPolyInts[i+1] - 1; xb = (xb >> 16) + ((xb & 32768) >> 15); result |= hlineColor(dst, xa, xb, y, color); } } return (result); } int filledPolygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { /* * Draw */ return (filledPolygonColor (dst, vx, vy, n, ((Uint32) r << 24) | ((Uint32) g << 16) | ((Uint32) b << 8) | (Uint32) a)); } int gfxPrimitivesCompareInt(const void *a, const void *b) { return (*(const int *) a) - (*(const int *) b); } /* ---- Bezier curve */ /* Calculate bezier interpolator of data array with ndata values at position 't' */ double evaluateBezier (double *data, int ndata, double t) { double mu, result; int n,k,kn,nn,nkn; double blend,muk,munk; /* Sanity check bounds */ if (t<0.0) { return(data[0]); } if (t>=(double)ndata) { return(data[ndata-1]); } /* Adjust t to the range 0.0 to 1.0 */ mu=t/(double)ndata; /* Calculate interpolate */ n=ndata-1; result=0.0; muk = 1; munk = pow(1-mu,(double)n); for (k=0;k<=n;k++) { nn = n; kn = k; nkn = n - k; blend = muk * munk; muk *= mu; munk /= (1-mu); while (nn >= 1) { blend *= nn; nn--; if (kn > 1) { blend /= (double)kn; kn--; } if (nkn > 1) { blend /= (double)nkn; nkn--; } } result += data[k] * blend; } return(result); } int bezierColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, int s, Uint32 color) { int result; int i; double *x, *y, t, stepsize; Sint16 x1, y1, x2, y2; /* * Sanity check */ if (n < 3) { return (-1); } if (s < 2) { return (-1); } /* * Variable setup */ stepsize=(double)1.0/(double)s; /* Transfer vertices into float arrays */ if ((x=(double *)malloc(sizeof(double)*(n+1)))==NULL) { return(-1); } if ((y=(double *)malloc(sizeof(double)*(n+1)))==NULL) { free(x); return(-1); } for (i=0; i