tenmado-0.10/0000777000175000017500000000000011711666006013675 5ustar00ooharaoohara00000000000000tenmado-0.10/README0000644000175000017500000001402411710766500014551 0ustar00ooharaoohara00000000000000tenmado --- hard-core shoot 'em up game in blue-or-red world by Oohara Yuuma published by Project Geeste $Id: README,v 1.41 2012/01/28 12:42:40 oohara Exp $ * what is tenmado tenmado is a vertically scrolling, late 1990s style (that is, a massive number of enemy shots against a smaller-than-it-looks spaceship) shoot 'em up game. A very accurate collision detection makes it a game of dexterity. If something looks like a triangle, it is a triangle, not a rectangle of similar size. However, surviving is only 20% of the game. The main feature of tenmado is the "color chain bonus". You can get a very big score (about 100 times bigger than a normal enemy-destruction point) by destroying enemies of the same color successively. It is easy or difficult depending on how greedy you are. * how to install tenmado See the file INSTALL for information about how to install tenmado. In short, install libc, libSDL, libSDL_image, then type 1) ./configure 2) make 3) make install If you are installing as root, think about the permission of the high score files. * command line options --dump _stage_ Write high score data to standard output and exit. Usually you save the output in a file and later use that file as the input of --undump. _stage_ must be between 0 and 5. _stage_ 0 means total score. _stage_ 1 -- 5 means each stage score. --full-screen Run the game in the full screen mode. --help Print a help message and exit. --slow Run the game at the half speed. Technically, the length of waiting between each frame is doubled. This slows down everything in the game, including your ship. The idea is to study the enemy formations for a later (normal speed) play. The animation may be rough because this option gives you only about 16 fps. You can't enter the high score lists with this option. --stage _stage_ Start the game at the specified stage. _stage_ must be between 1 and 5. Note that you can play only one stage (the specified one) and you can't enter the high score lists. --undump _stage_ Read high score data from standard input, save them and exit. The input is usually the output of --dump . _stage_ must be between 0 and 5. _stage_ 0 means total score. _stage_ 1 -- 5 means each stage score. Only the superuser may use this option. --undump-default If at least one high score list is empty, read the default high score data, save them and exit. If not, do nothing. The main purpose of this option is to create high score database files at installation time so that you can set their permission. --version Print version information, license information and the disclaimer, then exit. * key control cursor keys move space shoot (auto-repeat) ESC quit p pause/continue A joystick is also available for move and shoot. Note that you must plug the joystick before you invoke tenmado. The game is paused if the mouse cursor leaves the window. This prevents you from being killed while you does not have the focus on the window. * your weapon and your ship The player shot turns black as it flies. A black shot deals 1 damage. (See the hit status at the upper left corner of the window.) A non-black shot deals 2 damage. Keep close to an enemy and let your shots hit it before they turn black to destroy it quickly. If your ship gets hit by an enemy shot, an enemy ship or any other obstacle, your ship is destroyed. If you have no more ship, you lose the game. The black circle at the center is the only weak point of your ship. The rest is safe. * colors of the enemy and the color chain bonus You can get an additional score by destroying enemies of the same color successively. This is called the "color chain bonus". (See the chain status at the upper right corner of the window.) The color of your ship indicates which color of enemy you should destroy to get the color chain bonus. number of chains bonus point 1 1 2 2 3 4 4 8 5 16 6 32 7 64 8 128 9 256 10 512 11+ 1024 There are 4 colors of enemy --- blue, red, purple and green. Blue and red are the basic colors. Purple is special --- you always get the color chain bonus when you destroy a purple enemy no matter which color the enemy you destroyed last is, and you always get the color chain bonus when you destroy an enemy of any color if the enemy you destroyed last is purple. You cannot destroy a green enemy. * stages and the ship bonus There are 5 stages in this game. If you destroy the boss enemy which appears at the end of each stage, you can go to the next stage. If you clear all the stages, each remaining (unused) ship is worth 30,000 points. You get an additional ship for each 200,000 points. * if the game is too slow tenmado can be painfully slow if you don't have a good CPU (Pentium 4 or better is recommended). In this case, use top(1) to see what is consuming CPU time. Usually it is the X Window System. Reducing the color depth of the screen (to 16 or 8 bpp) and restarting the X server will improve the performance a lot. If your X server is a precompiled binary package, downloading its source and recompiling it with customized optimization options may work a little. * license See the file LICENSE for information about the license. In short, the license is GPL exactly version 2 or the Artistic License Version 2.0beta5, whichever you like. * contact information Please send bug reports or comments to Oohara Yuuma . Also check the tenmado webpage: http://www.interq.or.jp/libra/oohara/tenmado/index.html * history The initial version of tenmado was released on July 14, 2002. "tenmado" is a Japanese word meaning "skylight", a window on a roof. I picked this word because I wanted something related to the sky and unique to this project. The stage data, "happy L", was dedicated to Ryuji Akai, who knew L. No, I won't tell you who L is. tenmado-0.10/configure.ac0000644000175000017500000000324211711665633016165 0ustar00ooharaoohara00000000000000dnl configure.ac for tenmado dnl Process this file with autoconf to produce a configure script. dnl autoconf 2.68 or later is required # $Id: configure.ac,v 1.54 2012/01/31 04:18:35 oohara Exp $ AC_INIT([tenmado], [0.10], [oohara@libra.interq.or.jp]) AC_PREREQ([2.68]) AC_REVISION([$Revision: 1.54 $]) AM_INIT_AUTOMAKE([foreign tar-ustar]) AC_CONFIG_SRCDIR([main.c]) AC_CONFIG_HEADERS([config.h]) # Checks for programs. # Makefile.in will use awk AC_PROG_AWK AC_PROG_CC AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB AM_PROG_LEX AC_PROG_YACC # Checks for libraries. AC_CHECK_LIB([m], [sin]) # the libdb3 support is obsolete # don't define HAVE_LIBDB3 or HAVE_LIBDB_3 AC_ARG_WITH([posix], AC_HELP_STRING([--without-posix], [don't use (most of) POSIX features (DANGEROUS)]), , [with_posix=yes]) if test "x$with_posix" = "xno" then AC_DEFINE([NOT_HAVE_POSIX], [1], [Define to 1 if your system does not have POSIX features.]) fi # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([string.h]) AC_CHECK_HEADERS([unistd.h]) AC_CHECK_HEADERS([stddef.h]) AC_CHECK_HEADERS([limits.h]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_UID_T AC_STRUCT_TM AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_FUNCS([atexit]) AC_CHECK_FUNCS([sqrt]) AC_CHECK_FUNCS([strdup]) AC_CHECK_FUNCS([memset]) AC_CHECK_FUNCS([strtol]) AC_CHECK_FUNCS([strerror]) AC_SUBST([LIBS], ["-lSDL_image `sdl-config --libs` $LIBS"]) AC_CONFIG_FILES([Makefile happy-L/Makefile happy-L/default/Makefile happy-L/image/Makefile libbac/Makefile libtenm/Makefile save/Makefile]) AC_OUTPUT tenmado-0.10/aclocal.m40000644000175000017500000010603211711665643015541 0ustar00ooharaoohara00000000000000# generated automatically by aclocal 1.11 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 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. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, [m4_warning([this file was generated for autoconf 2.68. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 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. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.11], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.11])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # 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, 2006, 2008 # 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 9 # 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])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl 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, 2006, 2009 # 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 10 # 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], UPC, [depcc="$UPC" am_compiler_list=], [$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 am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) 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 # 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. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj 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])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # 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 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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, 2006, 2008, 2009 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 16 # 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.62])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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi 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 dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])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) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl 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 AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) _AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl dnl The `parallel-tests' driver may need to know about EXEEXT, so add the dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # 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_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005, 2008 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 if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi 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])]) # Copyright (C) 1998, 1999, 2000, 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 5 # AM_PROG_LEX # ----------- # Autoconf leaves LEX=: if lex or flex can't be found. Change that to a # "missing" invocation, for better error output. AC_DEFUN([AM_PROG_LEX], [AC_PREREQ(2.50)dnl AC_REQUIRE([AM_MISSING_HAS_RUN])dnl AC_REQUIRE([AC_PROG_LEX])dnl if test "$LEX" = :; then LEX=${am_missing_run}flex fi]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2009 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_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .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 # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac 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, 2004, 2005, 2008 # 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 6 # 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 AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # 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, 2006 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 for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 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_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], [m4_foreach_w([_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])]) # 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_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 # 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 5 # 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 # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; esac # 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="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006, 2008 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_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # 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 tenmado-0.10/Makefile.am0000644000175000017500000000333311710770177015733 0ustar00ooharaoohara00000000000000## Makefile.am for tenmado ## process this file with automake --foreign to generate Makefile.in ## automake version 1.11 is required # $Id: Makefile.am,v 1.69 2012/01/28 12:56:31 oohara Exp $ SUBDIRS = happy-L libbac libtenm save bin_PROGRAMS = tenmado tenmado_SOURCES = chain.c \ chain.h \ const.h \ esc-ok.c \ esc-ok.h \ hit-status.c \ hit-status.h \ loop.c \ loop.h \ main.c \ option.c \ option.h \ pause.c \ pause.h \ score.c \ score.h \ ship.c \ ship.h \ stage.c \ stage.h \ util.c \ util.h #CC_WARNINGS = -Wall # the overkill warnings # I don't use -Wtraditional because I use string concatenation # use -Wno-long-long because -pedantic implies -Wlong-long CC_WARNINGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -Winline -pedantic -Wno-long-long # let's hardcode SDL flags here SDL_CFLAGS=`sdl-config --cflags` # sdl-config --libs is added to LIBS in configure # -g -O2 are in CFLAGS by default, don't use @CFLAGS@ here AM_CFLAGS = $(SDL_CFLAGS) $(CC_WARNINGS) AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" \ -DLOCALSTATEDIR=\"$(localstatedir)\" \ -I$(top_srcdir)/happy-L \ -I$(top_srcdir)/libbac \ -I$(top_srcdir)/libtenm # there is no AM_LDADD tenmado_LDADD = $(top_srcdir)/happy-L/libhappy-L.a \ $(top_srcdir)/libbac/libbac.a \ $(top_srcdir)/libtenm/libtenm.a man_MANS = tenmado.6 EXTRA_DIST = Artistic-2 \ GPL-2 \ LICENSE \ icon.png \ icon.xpm \ tenmado.6 \ README-ja-utf8 \ README-ja-sjis BUILT_SOURCES = README-ja-sjis README-ja-sjis: README-ja-utf8 perl -w -n -e 's/\n/\r\n/g; print;' < README-ja-utf8 | \ iconv -f UTF-8 -t SJIS -o README-ja-sjis tenmado-0.10/Makefile.in0000644000175000017500000007506511711665645015763 0ustar00ooharaoohara00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # $Id: Makefile.am,v 1.69 2012/01/28 12:56:31 oohara Exp $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : bin_PROGRAMS = tenmado$(EXEEXT) subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure COPYING ChangeLog INSTALL THANKS TODO \ compile depcomp install-sh missing mkinstalldirs ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man6dir)" PROGRAMS = $(bin_PROGRAMS) am_tenmado_OBJECTS = chain.$(OBJEXT) esc-ok.$(OBJEXT) \ hit-status.$(OBJEXT) loop.$(OBJEXT) main.$(OBJEXT) \ option.$(OBJEXT) pause.$(OBJEXT) score.$(OBJEXT) \ ship.$(OBJEXT) stage.$(OBJEXT) util.$(OBJEXT) tenmado_OBJECTS = $(am_tenmado_OBJECTS) tenmado_DEPENDENCIES = $(top_srcdir)/happy-L/libhappy-L.a \ $(top_srcdir)/libbac/libbac.a $(top_srcdir)/libtenm/libtenm.a DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(tenmado_SOURCES) DIST_SOURCES = $(tenmado_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' man6dir = $(mandir)/man6 NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir dist dist-all distcheck 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)"; }; } am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = happy-L libbac libtenm save tenmado_SOURCES = chain.c \ chain.h \ const.h \ esc-ok.c \ esc-ok.h \ hit-status.c \ hit-status.h \ loop.c \ loop.h \ main.c \ option.c \ option.h \ pause.c \ pause.h \ score.c \ score.h \ ship.c \ ship.h \ stage.c \ stage.h \ util.c \ util.h #CC_WARNINGS = -Wall # the overkill warnings # I don't use -Wtraditional because I use string concatenation # use -Wno-long-long because -pedantic implies -Wlong-long CC_WARNINGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -Winline -pedantic -Wno-long-long # let's hardcode SDL flags here SDL_CFLAGS = `sdl-config --cflags` # sdl-config --libs is added to LIBS in configure # -g -O2 are in CFLAGS by default, don't use @CFLAGS@ here AM_CFLAGS = $(SDL_CFLAGS) $(CC_WARNINGS) AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" \ -DLOCALSTATEDIR=\"$(localstatedir)\" \ -I$(top_srcdir)/happy-L \ -I$(top_srcdir)/libbac \ -I$(top_srcdir)/libtenm # there is no AM_LDADD tenmado_LDADD = $(top_srcdir)/happy-L/libhappy-L.a \ $(top_srcdir)/libbac/libbac.a \ $(top_srcdir)/libtenm/libtenm.a man_MANS = tenmado.6 EXTRA_DIST = Artistic-2 \ GPL-2 \ LICENSE \ icon.png \ icon.xpm \ tenmado.6 \ README-ja-utf8 \ README-ja-sjis BUILT_SOURCES = README-ja-sjis all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj 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) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign 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) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) tenmado$(EXEEXT): $(tenmado_OBJECTS) $(tenmado_DEPENDENCIES) @rm -f tenmado$(EXEEXT) $(LINK) $(tenmado_OBJECTS) $(tenmado_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/esc-ok.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hit-status.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/option.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/score.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ship.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` install-man6: $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man6dir)" || $(MKDIR_P) "$(DESTDIR)$(man6dir)" @list=''; test -n "$(man6dir)" || exit 0; \ { for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.6[a-z]*$$/p'; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^6][0-9a-z]*$$,6,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man6dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man6dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man6dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man6dir)" || exit $$?; }; \ done; } uninstall-man6: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man6dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.6[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^6][0-9a-z]*$$,6,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ test -z "$$files" || { \ echo " ( cd '$(DESTDIR)$(man6dir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(man6dir)" && rm -f $$files; } # 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; \ ($(am__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" $(RECURSIVE_CLEAN_TARGETS): @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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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 || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) config.h.in $(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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @list='$(MANS)'; if test -n "$$list"; then \ list=`for p in $$list; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \ if test -n "$$list" && \ grep 'ab help2man is required to generate this page' $$list >/dev/null; then \ echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \ grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \ echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \ echo " typically \`make maintainer-clean' will remove them" >&2; \ exit 1; \ else :; fi; \ else :; fi $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || 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 $(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-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz $(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.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(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) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__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 \ && cd "$$am__cwd" \ || exit 1 $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @$(am__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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(MANS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man6dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man6 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man6 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all check \ ctags-recursive install install-am install-strip \ tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-compile distclean-generic \ distclean-hdr distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man6 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-man uninstall-man6 README-ja-sjis: README-ja-utf8 perl -w -n -e 's/\n/\r\n/g; print;' < README-ja-utf8 | \ iconv -f UTF-8 -t SJIS -o README-ja-sjis # 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: tenmado-0.10/config.h.in0000644000175000017500000000603411711665724015725 0ustar00ooharaoohara00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT /* Define to 1 if you have the header file. */ #undef HAVE_STDDEF_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if your system does not have POSIX features. */ #undef NOT_HAVE_POSIX /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t tenmado-0.10/configure0000755000175000017500000055667411711665644015636 0ustar00ooharaoohara00000000000000#! /bin/sh # From configure.ac Revision: 1.54 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for tenmado 0.10. # # Report bugs to . # # # 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. as_myself= 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 test \$(( 1 + 1 )) = 2 || 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. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec "$CONFIG_SHELL" $as_opts "$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 and $0: oohara@libra.interq.or.jp about your system, including $0: any error possibly output before this message. Then $0: install a modern shell, or manually run the script $0: 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='tenmado' PACKAGE_TARNAME='tenmado' PACKAGE_VERSION='0.10' PACKAGE_STRING='tenmado 0.10' PACKAGE_BUGREPORT='oohara@libra.interq.or.jp' PACKAGE_URL='' ac_unique_file="main.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS EGREP GREP CPP YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX RANLIB LN_S am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM 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_posix ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS YACC YFLAGS CPP' # 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_TARNAME}' 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 tenmado 0.10 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/tenmado] --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 _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tenmado 0.10:";; esac 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 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-posix don't use (most of) POSIX features (DANGEROUS) Some influential environment variables: CC C compiler command CFLAGS 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 YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CPP C preprocessor 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 . _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 tenmado configure 0.10 generated by GNU Autoconf 2.68 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_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; ${as_lineno_stack:+:} 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" 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_cpp conftest.$ac_ext") 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; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------- ## ## Report this to oohara@libra.interq.or.jp ## ## ---------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=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 eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* 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 $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func 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 tenmado $as_me 0.10, which was generated by GNU Autoconf 2.68. 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 am__api_version='1.11' 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. # 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 ${ac_cv_path_install+:} false; 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 # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; esac # 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` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # 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 test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # 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 ${ac_cv_prog_STRIP+:} false; 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 ${ac_cv_prog_ac_ct_STRIP+:} false; 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="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P 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. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac 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 ${ac_cv_prog_AWK+:} false; 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 \${ac_cv_prog_make_${ac_make}_set+:} false; 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 if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi 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='tenmado' VERSION='0.10' 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"} # 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"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 $as_echo_n "checking how to create a ustar tar archive... " >&6; } # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar plaintar pax cpio none' _am_tools=${am_cv_prog_tar_ustar-$_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 { echo "$as_me:$LINENO: $_am_tar --version" >&5 ($_am_tar --version) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && break done am__tar="$_am_tar --format=ustar -chf - "'"$$tardir"' am__tar_="$_am_tar --format=ustar -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 ustar -w "$$tardir"' am__tar_='pax -L -x ustar -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H ustar -L' am__tar_='find "$tardir" -print | cpio -o -H ustar -L' am__untar='cpio -i -H ustar -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_ustar}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file { echo "$as_me:$LINENO: tardir=conftest.dir && eval $am__tar_ >conftest.tar" >&5 (tardir=conftest.dir && eval $am__tar_ >conftest.tar) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } rm -rf conftest.dir if test -s conftest.tar; then { echo "$as_me:$LINENO: $am__untar &5 ($am__untar &5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } grep GrepMe conftest.dir/file >/dev/null 2>&1 && break fi done rm -rf conftest.dir if ${am_cv_prog_tar_ustar+:} false; then : $as_echo_n "(cached) " >&6 else am_cv_prog_tar_ustar=$_am_tool fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 $as_echo "$am_cv_prog_tar_ustar" >&6; } ac_config_headers="$ac_config_headers config.h" # Checks for programs. # Makefile.in will use awk 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 ${ac_cv_prog_AWK+:} false; 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 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 ${ac_cv_prog_CC+:} false; 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 ${ac_cv_prog_ac_ct_CC+:} false; 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 ${ac_cv_prog_CC+:} false; 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 ${ac_cv_prog_CC+:} false; 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 ${ac_cv_prog_CC+:} false; 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 ${ac_cv_prog_ac_ct_CC+:} false; 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 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 ${ac_cv_objext+:} false; 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 ${ac_cv_c_compiler_gnu+:} false; 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 ${ac_cv_prog_cc_g+:} false; 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 ${ac_cv_prog_cc_c89+:} false; 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 DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .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 # Ignore all kinds of additional output from `make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac 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="$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 ${am_cv_CC_dependencies_compiler_type+:} false; 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 am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac 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 # 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. Also, some Intel # versions had trouble with output in subdirs am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; 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 ;; msvisualcpp | msvcmsys) # This compiler won't grok `-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; 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, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $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 \${ac_cv_prog_make_${ac_make}_set+:} false; 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 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 ${ac_cv_prog_RANLIB+:} false; 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 ${ac_cv_prog_ac_ct_RANLIB+:} false; 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 for ac_prog in flex lex 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 ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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_LEX="$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 LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { yyless (input () != 0); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" 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 "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi if test "$LEX" = :; then LEX=${am_missing_run}flex fi for ac_prog in 'bison -y' byacc 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 ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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_YACC="$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 YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 $as_echo_n "checking for sin in -lm... " >&6; } if ${ac_cv_lib_m_sin+:} false; 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" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi # the libdb3 support is obsolete # don't define HAVE_LIBDB3 or HAVE_LIBDB_3 # Check whether --with-posix was given. if test "${with_posix+set}" = set; then : withval=$with_posix; else with_posix=yes fi if test "x$with_posix" = "xno" then $as_echo "#define NOT_HAVE_POSIX 1" >>confdefs.h fi # Checks for header files. 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : 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 $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRING_H 1 _ACEOF fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done for ac_header in stddef.h do : ac_fn_c_check_header_mongrel "$LINENO" "stddef.h" "ac_cv_header_stddef_h" "$ac_includes_default" if test "x$ac_cv_header_stddef_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDDEF_H 1 _ACEOF fi done for ac_header in limits.h do : ac_fn_c_check_header_mongrel "$LINENO" "limits.h" "ac_cv_header_limits_h" "$ac_includes_default" if test "x$ac_cv_header_limits_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIMITS_H 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { struct tm tm; int *p = &tm.tm_sec; return !p; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_struct_tm=time.h else ac_cv_struct_tm=sys/time.h fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 $as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then $as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # Checks for library functions. for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi for ac_func in atexit do : ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" if test "x$ac_cv_func_atexit" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ATEXIT 1 _ACEOF fi done for ac_func in sqrt do : ac_fn_c_check_func "$LINENO" "sqrt" "ac_cv_func_sqrt" if test "x$ac_cv_func_sqrt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SQRT 1 _ACEOF fi done for ac_func in strdup do : ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRDUP 1 _ACEOF fi done for ac_func in memset do : ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMSET 1 _ACEOF fi done for ac_func in strtol do : ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOL 1 _ACEOF fi done for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR 1 _ACEOF fi done LIBS="-lSDL_image `sdl-config --libs` $LIBS" ac_config_files="$ac_config_files Makefile happy-L/Makefile happy-L/default/Makefile happy-L/image/Makefile libbac/Makefile libtenm/Makefile save/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 if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi 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}' DEFS=-DHAVE_CONFIG_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 -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi 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__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 : "${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. as_myself= 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 tenmado $as_me 0.10, which was generated by GNU Autoconf 2.68. 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 case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" 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 --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ tenmado config.status 0.10 configured by $0, generated by GNU Autoconf 2.68, 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' MKDIR_P='$MKDIR_P' 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;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --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 "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "happy-L/Makefile") CONFIG_FILES="$CONFIG_FILES happy-L/Makefile" ;; "happy-L/default/Makefile") CONFIG_FILES="$CONFIG_FILES happy-L/default/Makefile" ;; "happy-L/image/Makefile") CONFIG_FILES="$CONFIG_FILES happy-L/image/Makefile" ;; "libbac/Makefile") CONFIG_FILES="$CONFIG_FILES libbac/Makefile" ;; "libtenm/Makefile") CONFIG_FILES="$CONFIG_FILES libtenm/Makefile" ;; "save/Makefile") CONFIG_FILES="$CONFIG_FILES save/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_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers 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= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_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 -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # 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 {' >"$ac_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 >>"\$ac_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 >>"\$ac_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 < "$ac_tmp/subs1.awk" > "$ac_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" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :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="$ac_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 >"$ac_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 ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; 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 s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_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' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_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 "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :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"" || { # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf 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. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/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 tenmado-0.10/COPYING0000644000175000017500000004311010447342004014715 0ustar00ooharaoohara00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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. tenmado-0.10/ChangeLog0000644000175000017500000002765711711665606015471 0ustar00ooharaoohara000000000000002012-01-31 Oohara Yuuma * version 0.10 * LICENSE, const.h: fixed copyright string 2012-01-30 Oohara Yuuma * version 0.9 * INSTALL, README, README-ja-utf8, configure.ac: removed the libdb3 support * configure.ac: use AC_DEFINE after AC_ARG_WITH, not in it * configure.ac, Makefile.am, happy-L/Makefile.am, libtenm/Makefile.am: add the return value of sdl-config --libs (which usually contains a -l flag) to LIBS, not AM_LDFLAGS * Makefile.am, happy-L/Makefile.am, libbac/Makefile.am, libtenm/Makefile.am: removed -Wconversion because it is too noisy * Makefile.am, configure.ac: use the tar-ustar option of automake instead of setting AMTAR * configure.ac: fixed comments so that configure doesn't say "process this file with autoconf" * Makefile.am, happy-L/Makefile.am, libbac/Makefile.am, libtenm/Makefile.am: fixed comments so that Makefile doesn't say "process this file with automake" * configure.ac: added AC_CHECK_FUNCS([strerror]) because libbac/bac_load.c wants it * libbac/bac_lexical.l: added added %option no* to fix the -Wunused-function warning * libbac/bac_lexical.h: added yylex_destroy() declaration * libbac/bac_lexical.h, libbac/bac_lexical.l, libbac/bac_parser.y, libbac/bac_string_to_array.c: use %option yylineno instead of counting the line number manually * happy-L/close-system.c: removed the variable time_no_escape in the function close_system_ball_new() because it is unused * happy-L/ending.c: fixed the return value of ending() * happy-L/ending.c: fixed an error message 2009-11-14 Oohara Yuuma * version 0.8 * libtenm/tenm_timer.c: uses an empty loop for maximum accuracy * libbac/bac_truncate.c: fixed the error message when remove() failed 2004-11-25 Oohara Yuuma * version 0.7 * happy birthday, L! * happy-L/normal-enemy.c: added sanity checks after tenm_sqrt() * libtenm/tenm_input.c: really fixed the default value of neutral_range * tenmado.6: command line options use a minus sign, not a hyphen * happy-L/result.c: reset timer at the beginning of the result report * README: fixed typos 2003-11-25 Oohara Yuuma * version 0.6 * happy birthday, L! * happy-L/player-shot.c, libtenm/tenm_table.c: made sure that the action of the object that is added by the player (the player shot) is skipped only once (the frame when that object is added) * happy-L/midnight.c, happy-L/overrun.c, happy-L/disconnection.c, happy-L/fud.c, happy-L/last-boss.c: don't modify my->attr or my->hit_mask in my->hit(), or the player shot may fly through the enemy * Makefile.am, README-ja-sjis: added \r before each \n * Makefile.am, happy-L/Makefile.am, libtenm/Makefile.am: added -Wno-long-long to CC_WARNINGS * happy-L/player.c: int/double consistency in the boundary check * happy-L/player-shot.c: your shot has no longer the same color as an enemy's shot * libtenm/tenm_input.c: set default neutral_range to 8192 * main.c: set neutral_range to 8192 * libbac/bac_array.h, libbac/bac_entry.h, libtenm/tenm_input.c, libtenm/tenm_object.c, libtenm/tenm_object.h, libtenm/tenm_primitive.h, libtenm/tenm_table.c: fixed pointers to a function * happy-L/player-shot.c: fixed typo in an error message * libbac/bac_entry.h: includes config.h * README, happy-L/tutorial.c: fixed typo * happy-L/image.c: removed the unnecessary slash from the path of image files * THANKS: updated the e-mail address of shinichiro.h * happy-L/explosion.c: int/double consistency in the initial value * happy-L/normal-enemy.c: don't decrement the "no escape" timer if it is not positive * happy-L/disconnection.c, happy-L/fud.c: a dead enemy has low priority when we draw the window * happy-L/explosion.c: explosion has low priority when we draw the window * libtenm/tenm_table.c: added sanity check to tenm_table_detect_collision() to handle hit() of an object that deletes the object which collides with it * happy-L/default/score-*.txt: updated 2003-01-16 Oohara Yuuma * version 0.5 * libdb3 is now optional (still recommended and default) * happy-L/disconnection.c, happy-L/fud.c, happy-L/image/*-damaged.png, happy-L/image.c, happy-L/intuition.c, happy-L/last-boss.c, happy-L/midnight.c, happy-L/normal-enemy.c, happy-L/overrun.c, happy-L/solution.c: better enemy damaging graphic * configure.ac, happy-L/high-score.c, INSTALL, libbac/bac_load.c, libbac/bac_load.h, libbac/bac_save.c, libbac/bac_truncate.c: added (deprecated) --without-libdb3 support * configure.ac, happy-L/high-score.c, happy-L/image.c, happy-L/result.h, INSTALL, libbac/bac_dump.h, libbac/bac_entry.h, save/Makefile.am, util.c: added (dangerous) --without-posix support * score.c: reset extend_next whenever a game starts * happy-L/intuition.c, happy-L/laser.c, happy-L/normal-shot.c: an enemy shoots at a random direction if it aims at you and if it and you are at the exacely same point * happy-L/midnight.c: don't call midnight_bit_signal_to_bit() if the bit is already dead * happy-L/last-boss.c: surprise_laser_act() uses laser_new() instead of laser_point_new() * libtenm/tenm_timer.c: added clock accuracy auto-detection * libtenm/tenm_object.c: the object name is now duplicated, no longer (const char *) but (char *) * libbac/bac_array.h: fixed sanity check in bac_array_delete (s/1/i/) * README, option.c, tenmado.6: fixed the description of --dump and --undump * README: documented extend (additonal ship) * README-ja-utf8: new file, Japanese translation * README-ja-sjis: new file, generated from README-ja-utf8 * libbac/README: added more nonsense * happy-L/high-score.c, libtenm/tenm_input.c, libtenm/tenm_math.c, libtenm/tenm_table.c, main.c, util.c, util.h: fixed memory leaks * libbac/bac_lexical.h, libbac/bac_lexical.l, libbac/bac_string_to_array.c: uses yy_scan_string instead of a pipe hack * chain.c, happy-L/ending.c, happy-L/high-score.c, happy-L/result.c, happy-L/stage-clear.c, happy-L/title.c, hit-status.c, libbac/bac_entry.c, libbac/bac_entry_to_string.c, score.c, ship.c: s/snprintf/sprintf/g because snprintf is a GNU extension * libbac/bac_lexical.l: malloc && strncpy instead of strdup because strdup is from SVID * libbac/*.c, libtenm/*.c: more strict sanity checks * libtenm/tenm_graphic.c: fixed error message * libtenm/tenm_object.c: don't delete mass if it is NULL * util.c: fixed comment * libbac/bac_string_to_array.c: added paranoid isprint checks * Makefile.am: uses AC_CONFIG_HEADERS instead of AM_CONFIG_HEADER * configure.ac: added more checks to please autoscan * option.c: split the help message to avoid stupid gcc "509 chars" warning * happy-L/default/score-stage-2.txt: updated * THANKS: added shinichiro.h * TODO: updated 2003-01-04 Oohara Yuuma * version 0.4 * configure.ac: recongizes libdb-3 as well as libdb3 (thanks to shinichiro.h for the bug report) * README, happy-L/result.c, loop.c, option.c, option.h, tenmado.6: added --slow option * README, main.c, option.c, option.h, tenmado.6: added --help and --version options * libtenm/tenm_collision.c: fixed the "circle assumption" in tenm_collided_point_polygon() and tenm_collided_segment_segment2() (the radius should be 0.5, not 1) * libtenm/tenm_graphic.c, libtenm/tenm_graphic.h: implemented the Bresenham algorithm for drawing a circle or a line (warning: these drawing functions contain toxic waste --- they're not pure Bresenham since I need a wide line) * happy-L/intuition.c, happy-L/last-boss.c, happy-L/normal-shot.c, happy-L/solution.c: enemy shots are more distinguishable * happy-L/player.c, happy-L/image/player-blue.png, happy-L/image/player-purple.png, happy-L/image/player-red.png: your weak point is more distinguishable (the sprites are too unrealistic, but this is a shoot-em-up, not a flight simulator) * libtenm/tenm_graphic.c, libtenm/tenm_primitive.c, libtenm/tenm_primitive.h, libtenm/tenm_collision.c, libbac/bac_entry.h, libbac/bac_entry.c, libbac/bac_entry_to_string.c, libbac/bac_save.c, util.c: s/class/klass/ in favor of Python (not for C++ --- the headers don't have the extern "C" line, and I use "new" and "delete" as part of a function name) * INSTALL: fixed the binary permission in the high score file example (the binary has no need to be group-writable) * libbac/bac_lexical.l: fixed the line number in an error message * score.c: code cleanup * libbac/Makefile.am: added -8 to AM_LFLAGS just in case * Makefile.am, happy-L/Makefile.am, libbac/Makefile.am, libtenm/Makefile.am: dropped -Wtraditional from CC_WARNINGS (I use string concatenation) and added -Wconversion * happy-L/disconnection.c, happy-L/ending.c, happy-L/explosion.c, happy-L/fud.c, happy-L/high-score.c, happy-L/intuition.c, happy-L/laser.c, happy-L/last-boss.c, happy-L/message.c, happy-L/midnight.c, happy-L/normal-enemy.c, happy-L/overrun.c, happy-L/result.c, happy-L/solution.c, happy-L/stage-1.c, happy-L/stage-2.c, happy-L/stage-3.c, happy-L/stage-5.c, happy-L/stage-clear.c, happy-L/title.c, libbac/bac_entry.c, libbac/bac_entry_to_string.c, libbac/bac_load.c, libbac/bac_truncate.c, libtenm/tenm_graphic.c, chain.c, hit-status.c, score.c, ship.c: integer/floating point and signed/unsigned consistency (by using explicit cast) * libbac/bac_entry_to_string.c: free unused memory * COPYING: removed because this is same as GPL-2 * const.h: added COPYRIGHT_STRING * LICENSE, happy-L/title.c: updated copyright year * happy-L/default/score-*: updated * TODO: updated 2002-12-21 Oohara Yuuma * version 0.3 * libdb3 is now required * libbac/*, happy-L/high-score.c, happy-L/high-score.h: new files, handling high score files * Makefile.am, configure.ac, happy-L/result.c, happy-L/title.c: added high score file support * option.c, option.h: new files, handling command line options * loop.c, main.c: added command line option support * libtenm/tenm_graphic.c, libtenm/tenm_graphic.h: added fullscreen support * main.c: feeding the random seed * libtenm/tenm_graphic.c, libtenm/tenm_graphic.h, main.c: fixed hardcoding the window name in a libtenm function * README: minor editorial fix * happy-L/title.c: fixed a typo in an error message * happy-L/image/font-medium.png: fixed underscore * INSTALL: added hacking information * README: added command line options, ship bonus description, contact information and some history * happy-L/image/Makefile.am, happy-L/image.c, util.c: install image files in $(datadir)/games/tenmado/image/ instead of $(datadir)/games/tenmado/ * loop.c: "average fps" message is sent to stdout instead of stderr * Makefile.am cleanups - uses some AM_ variables - removed CC_OPTIMIZE because -g -O2 are in CFLAGS and I use AM_CFLAGS - don't use LDFLAGS for .a - use install-data-local instead of install-exec-local for image files - added AMTAR=ustar because GNU tar is not conforming to Posix * TODO: updated 2002-11-26 Oohara Yuuma * version 0.2 * happy birthday, L! (well, it was November 25, but anyway) * configure.ac: no longer uses arguments in AM_INIT_AUTOMAKE * Makefile.am: removed duplicated CPPFLAGS definition * Makefile.in: regenerated with automake 1.7 (the previous version was generated by automake 1.4) * missing: now you can really redistribute it with the Artistic License (the previous version was under GPL only) * INSTALL: added a note about --bindir * icon.xpm: added for the Debian menu system * ship.c: improved a comment * happy-L/rotate-laser.c: fixed draw priority * depcomp: uses the version in automake 1.7 * aclocal.m4: regenerated with aclocal in automake 1.7 * happy-L/player.c: fixed left/right typo in the tutorial 2002-07-14 Oohara Yuuma * version 0.1 * initial release tenmado-0.10/INSTALL0000644000175000017500000000604411710765125014727 0ustar00ooharaoohara00000000000000how to install tenmado $Id: INSTALL,v 1.18 2012/01/28 12:30:13 oohara Exp $ * requirement To compile tenmado, you need: 1) a C library (libc) (GNU C Library is known to work) 2) the Simple DirectMedia Layer library (libSDL) 3) SDL_image (libSDL_image) To hack tenmado, you also need: 1) autoconf 2) automake 3) flex 4) bison * installation commands tenmado follows the standard 3-step installation process, that is: 1) ./configure 2) make 3) make install * ./configure options ** --with --without-posix Don't use _most_ (not all) of the POSIX features, that is: - You must NOT run "make install" --- I don't know where I put necessary files on a non-POSIX system. - Image data are loaded from the directory happy-L/image/ in the current directory. High score data are saved in the directory save/ in the current directory. Default high score data are loaded from the directory happy-L/default/ in the current directory. All install directory options (see below) are ignored. In short, you should invoke tenmado as "./tenmado" from the top directory of the source tree. - Player name handling is disabled. - The superuser check of --undump is disabled. - These features are still required: + stat() (from POSIX.1) + ENOENT (from POSIX.1) + fileno() (from POSIX.1) - libbac/bac_entry.h does s/uid_t/int/g DON'T USE THIS OPTION UNLESS YOU KNOW WHAT YOU ARE DOING. tenmado is designed for a POSIX system. ** install directories --prefix Everything will be installed here by default. --bindir The executable will be installed in this directory. --datadir The image files (happy-L/image/*.png) will be installed in its subdirectory games/tenmado/ . --localstatedir The game will save the high score data in its subdirectory games/tenmado/ . --mandir The manpage will be installed in its subdirectory man6/ . The FHS way will be something like: ./configure --prefix=/usr --bindir=/usr/games \ --localstatedir=/var --mandir=/usr/share/man If you have no root privilege and want to install tenmado under your home directory, try: ./configure --prefix=/home/oohara/temp/tenmado Replace /home/oohara/temp/tenmado as appropriate. Note that these directories must be specified in their absolute path. * the high score files The high score files (the files in games/tenmado/ in localstatedir) must be writable by the tenmado binary. The recommended way to do this is to create a dedicated system group (usually called as "games"), install the high score files as 664 root:games and have the tenmado binary sgid games. "make install" makes the directory for the high score files, but it does NOT create or overwrite the high score files themselves. ("make uninstall" always removes the high score files.) To set their permission, use the --undump-default option of tenmado as follows: 1) make install 2) tenmado --undump-default 3) chown root:games $localstatedir/games/tenmado/* 4) chmod 664 $localstatedir/games/tenmado/* 5) chown root:games $bindir/tenmado 6) chmod 2755 $bindir/tenmado Replace $bindir and $localstatedir as appropriate. tenmado-0.10/THANKS0000644000175000017500000000117710276702755014621 0ustar00ooharaoohara00000000000000tenmado THANKS list $Id: THANKS,v 1.10 2003/07/11 15:26:04 oohara Exp $ * special thanks to - TREASURE, a game software company in Japan, whose arcade game "IKARUGA" influenced the game design of tenmado a lot http://www.treasure-inc.co.jp/ - Yuusuke HASHIMOTO, the original author of xsoldier (yet another free shoot 'em up game, which I learned action game programming in C from) - Junichi Uekawa, who motivated me to make this game (he may be unaware of it, though) - shinichiro.h, who made a win32 port of tenmado tenmado-0.10/TODO0000644000175000017500000000102010276702755014361 0ustar00ooharaoohara00000000000000tenmado TODO list $Id: TODO,v 1.5 2003/01/07 18:28:34 oohara Exp $ * better graphic (I'm not an artist, good image files wanted) * sound/music (explosion sound is a must for a shoot 'em up) * better error handling (check the return value of functions, more error message) * more documentation/comment * split libbac/libtenm * swig interface to libbac/libtenm * add mouse support to libtenm (so that icbm3d can be ported to libtenm) * fix memory leaks (they are in getpwuid(), yylex or SDL --- I don't know how to fix them) tenmado-0.10/compile0000755000175000017500000000576110447342004015252 0ustar00ooharaoohara00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. # Copyright 1999, 2000 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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., 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. # Usage: # compile PROGRAM [ARGS]... # `-o FOO.o' is removed from the args passed to the actual compile. # Usage statement added by Billy Biggs . if [ -z $1 ]; then echo "Wrapper for compilers which do not understand '-c -o'." echo "usage: compile PROGRAM [ARGS]..." echo "'-o FOO.o' is removed from the args passed to the actual compile." exit 1 fi prog=$1 shift ofile= cfile= args= while test $# -gt 0; do case "$1" in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we do something ugly here. ofile=$2 shift case "$ofile" in *.o | *.obj) ;; *) args="$args -o $ofile" ofile= ;; esac ;; *.c) cfile=$1 args="$args $1" ;; *) args="$args $1" ;; esac shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$prog" $args fi # Name of file we expect compiler to create. cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir $lockdir > /dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir $lockdir; exit 1" 1 2 15 # Run the compile. "$prog" $args status=$? if test -f "$cofile"; then mv "$cofile" "$ofile" fi rmdir $lockdir exit $status tenmado-0.10/depcomp0000755000175000017500000003305210447342004015243 0ustar00ooharaoohara00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000, 2003 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., 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. # Originally written by Alexandre Oliva . 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 # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi 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 tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi 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 '/^# [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 tenmado-0.10/install-sh0000755000175000017500000001572210447342004015676 0ustar00ooharaoohara00000000000000#!/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 "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog 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" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : 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 : 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 : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; 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 : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # 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 :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # Now remove or move aside any old file at destination location. We try this # two ways since rm can't unlink itself on some systems and the destination # file might be busy for other reasons. In this case, the final cleanup # might fail but the new file should still install successfully. { if [ -f "$dstdir/$dstfile" ] then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } tenmado-0.10/missing0000755000175000017500000002403210447342004015263 0ustar00ooharaoohara00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 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., 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. 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 case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $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]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the 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' is missing on your system. 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 missing on your system. 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) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. 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) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && 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 you do not seem to have it handy on your system. 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 tenmado-0.10/mkinstalldirs0000755000175000017500000000370410447342004016475 0ustar00ooharaoohara00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac 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 else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here tenmado-0.10/ylwrap0000755000175000017500000001404311240463124015130 0ustar00ooharaoohara00000000000000#! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2009-04-28.21; # UTC # Copyright (C) 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004, 2005, # 2007, 2009 Free Software Foundation, Inc. # # Written by Tom Tromey . # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . case "$1" in '') echo "$0: No files given. Try \`$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input="$1" shift case "$input" in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input="`pwd`/$input" ;; esac pairlist= while test "$#" -ne 0; do if test "$1" = "--"; then shift break fi pairlist="$pairlist $1" shift done # The program to run. prog="$1" shift # Make any relative path in $prog absolute. case "$prog" in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog="`pwd`/$prog" ;; esac # FIXME: add hostname here for parallel makes that run commands on # other machines. But that might take us over the 14-char limit. dirname=ylwrap$$ trap "cd '`pwd`'; rm -rf $dirname > /dev/null 2>&1" 1 2 3 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then set X $pairlist shift first=yes # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot="no" if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot="yes" fi # The directory holding the input. input_dir=`echo "$input" | sed -e 's,\([\\/]\)[^\\/]*$,\1,'` # Quote $INPUT_DIR so we can use it in a regexp. # FIXME: really we should care about more than `.' and `\'. input_rx=`echo "$input_dir" | sed 's,\\\\,\\\\\\\\,g;s,\\.,\\\\.,g'` while test "$#" -ne 0; do from="$1" # Handle y_tab.c and y_tab.h output by DOS if test $y_tab_nodot = "yes"; then if test $from = "y.tab.c"; then from="y_tab.c" else if test $from = "y.tab.h"; then from="y_tab.h" fi fi fi if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend `../'. case "$2" in [\\/]* | ?:[\\/]*) target="$2";; *) target="../$2";; esac # We do not want to overwrite a header file if it hasn't # changed. This avoid useless recompilations. However the # parser itself (the first file) should always be updated, # because it is the destination of the .y.c rule in the # Makefile. Divert the output of all other files to a temporary # file so we can compare them to existing versions. if test $first = no; then realtarget="$target" target="tmp-`echo $target | sed s/.*[\\/]//g`" fi # Edit out `#line' or `#' directives. # # We don't want the resulting debug information to point at # an absolute srcdir; it is better for it to just mention the # .y file with no path. # # We want to use the real output file name, not yy.lex.c for # instance. # # We want the include guards to be adjusted too. FROM=`echo "$from" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` TARGET=`echo "$2" | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'` sed -e "/^#/!b" -e "s,$input_rx,," -e "s,$from,$2," \ -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$? # Check whether header files must be updated. if test $first = no; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$2" is unchanged rm -f "$target" else echo updating "$2" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the first file. This # is a blatant hack to let us support using "yacc -d". If -d # is not specified, we don't want an error when the header # file is "missing". if test $first = yes; then ret=1 fi fi shift shift first=no done else ret=$? fi # Remove the directory. cd .. rm -rf $dirname exit $ret # 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-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: tenmado-0.10/chain.c0000644000175000017500000001004110276702754015121 0ustar00ooharaoohara00000000000000/* $Id: chain.c,v 1.22 2003/01/12 02:04:57 oohara Exp $ */ #include /* strlen */ #include #include "const.h" #include "util.h" #include "score.h" #include "tenm_math.h" #include "chain.h" /* the number of colors are hardcoded, no need for malloc */ static int color_expected = COLOR_PURPLE; static int chain = 0; static int killed[3]; static void add_chain(int color, int delta); static void add_chain2(int delta); void clear_chain(void) { int i; color_expected = COLOR_PURPLE; chain = 0; for (i = 0; i < 3; i++) killed[i] = 0; } int get_color_expected(void) { return color_expected; } /* return 0 on success, 1 on error */ int add_killed(int color) { switch (color) { case COLOR_BLUE: (killed[0])++; break; case COLOR_PURPLE: (killed[1])++; break; case COLOR_RED: (killed[2])++; break; case COLOR_GREEN: fprintf(stderr, "add_killed: color is COLOR_GREEN\n"); return 1; break; default: fprintf(stderr, "add_killed: strange color (%d)\n", color); break; } return 0; } void calculate_chain(void) { switch (color_expected) { case COLOR_BLUE: if (killed[0] > 0) { add_chain(COLOR_BLUE, killed[0]); killed[0] = 0; } if (killed[2] > 0) { add_chain(COLOR_RED, killed[2]); killed[2] = 0; } if (killed[1] > 0) { add_chain(COLOR_PURPLE, killed[1]); killed[1] = 0; } break; case COLOR_PURPLE: if (killed[0] >= killed[2]) { if (killed[0] > 0) { add_chain(COLOR_BLUE, killed[0]); killed[0] = 0; } if (killed[2] > 0) { add_chain(COLOR_RED, killed[2]); killed[2] = 0; } } else { if (killed[2] > 0) { add_chain(COLOR_RED, killed[2]); killed[2] = 0; } if (killed[0] > 0) { add_chain(COLOR_BLUE, killed[0]); killed[0] = 0; } } if (killed[1] > 0) { add_chain(COLOR_PURPLE, killed[1]); killed[1] = 0; } break; case COLOR_RED: if (killed[2] > 0) { add_chain(COLOR_RED, killed[2]); killed[2] = 0; } if (killed[0] > 0) { add_chain(COLOR_BLUE, killed[0]); killed[0] = 0; } if (killed[1] > 0) { add_chain(COLOR_PURPLE, killed[1]); killed[1] = 0; } break; default: fprintf(stderr, "calculate_chain: strange color_expected (%d)\n", color_expected); break; } } static void add_chain(int color, int delta) { /* sanity check */ if (delta <= 0) return; if ((color != COLOR_BLUE) && (color != COLOR_PURPLE) && (color != COLOR_RED)) { fprintf(stderr, "add_chain: strange color (%d)\n", color); return; } if (color == COLOR_PURPLE) { add_chain2(delta); color_expected = COLOR_PURPLE; return; } if (color_expected == COLOR_PURPLE) { add_chain2(delta); color_expected = color; return; } if (color == color_expected) { add_chain2(delta); return; } /* check if there is a purple enemy which can join the old chain and * this chain */ if (killed[1] > 0) { /* assume that the player killed one purple enemy before this chain */ add_chain2(1); (killed[1])--; add_chain2(delta); color_expected = color; return; } /* the old chain is really cut, start a new chain */ chain = 0; if (delta >= 2) add_chain2(delta - 1); color_expected = color; } static void add_chain2(int delta) { int i; /* sanity check */ if (delta <= 0) return; /* add chain bouns */ for (i = 1; i <= delta; i++) if (chain + i - 1 >= 10) add_score(tenm_pow2(10)); else add_score(tenm_pow2(chain + i - 1)); chain += delta; } /* return 0 on success, 1 on error */ int show_chain(void) { char temp[16]; /* sanity check */ if (chain < 0) return 0; sprintf(temp, "chain %3d", chain); if (draw_string(WINDOW_WIDTH - 90, 10, temp, (int) strlen(temp)) != 0) { fprintf(stderr, "show_chain: draw_string failed\n"); return 1; } return 0; } tenmado-0.10/chain.h0000644000175000017500000000043510276702754015134 0ustar00ooharaoohara00000000000000/* $Id: chain.h,v 1.5 2002/05/14 16:27:17 oohara Exp $ */ #ifndef __TENMADO_CHAIN_H__ #define __TENMADO_CHAIN_H__ void clear_chain(void); int get_color_expected(void); int add_killed(int color); void calculate_chain(void); int show_chain(void); #endif /* not __TENMADO_CHAIN_H__ */ tenmado-0.10/const.h0000644000175000017500000000161011711665503015167 0ustar00ooharaoohara00000000000000/* $Id: const.h,v 1.26 2012/01/31 04:17:07 oohara Exp $ */ /* we spell "tenmado" instead of "tenm" here because these constants are * not portable (that is, not intended to be used in other programs) */ #ifndef __TENMADO_CONST_H__ #define __TENMADO_CONST_H__ #define COPYRIGHT_STRING "Copyright (C) 2002, 2012 Oohara Yuuma" #define WINDOW_WIDTH 480 #define WINDOW_HEIGHT 640 /* attribute * these values must be one of 2^n */ #define ATTR_PLAYER 1 #define ATTR_PLAYER_SHOT 2 #define ATTR_ENEMY 4 #define ATTR_ENEMY_SHOT 8 /* "weak" enemy gets hit by it */ #define ATTR_OBSTACLE 16 /* normal enemy shot cannot go through it */ #define ATTR_OPAQUE 32 /* color */ #define COLOR_BLUE 0 #define COLOR_PURPLE 1 #define COLOR_RED 2 #define COLOR_GREEN 3 /* scheduler return value */ #define SCHEDULER_SUCCESS 0 #define SCHEDULER_ERROR 1 #define SCHEDULER_NEXT_STAGE 2 #endif /* __TENMADO_CONST_H__ */ tenmado-0.10/esc-ok.c0000644000175000017500000000032110276702754015220 0ustar00ooharaoohara00000000000000/* $Id: esc-ok.c,v 1.4 2002/07/13 05:02:11 oohara Exp $ */ #include #include "esc-ok.h" static int esc_ok = 1; void set_esc_ok(int n) { esc_ok = n; } int get_esc_ok(void) { return esc_ok; } tenmado-0.10/esc-ok.h0000644000175000017500000000031410276702754015227 0ustar00ooharaoohara00000000000000/* $Id: esc-ok.h,v 1.2 2002/07/13 05:00:03 oohara Exp $ */ #ifndef __TENMADO_ESC_OK_H__ #define __TENMADO_ESC_OK_H__ void set_esc_ok(int n); int get_esc_ok(void); #endif /* not __TENMADO_ESC_OK_H__ */ tenmado-0.10/hit-status.c0000644000175000017500000000130610276702754016150 0ustar00ooharaoohara00000000000000/* $Id: hit-status.c,v 1.10 2003/01/12 02:08:41 oohara Exp $ */ #include /* strlen */ #include #include "const.h" #include "util.h" #include "hit-status.h" static char hit_status[64]; static int time = 0; void clear_hit_status(void) { time = 0; } void set_hit_status(const char *name, int hit_point, int remaining) { sprintf(hit_status, "%4d/%4d %.50s", remaining, hit_point, name); time = 30; } /* return 0 on success, 1 on error */ int show_hit_status(void) { if (time <= 0) return 0; time--; if (draw_string(10, 10, hit_status, (int) strlen(hit_status)) != 0) { fprintf(stderr, "show_hit_status: tenm_draw_string failed\n"); return 1; } return 0; } tenmado-0.10/hit-status.h0000644000175000017500000000045310276702754016157 0ustar00ooharaoohara00000000000000/* $Id: hit-status.h,v 1.3 2002/07/10 07:05:13 oohara Exp $ */ #ifndef __TENMADO_HIT_STATUS_H__ #define __TENMADO_HIT_STATUS_H__ void clear_hit_status(void); void set_hit_status(const char *name, int hit_point, int remaining); int show_hit_status(void); #endif /* not __TENMADO_HIT_STATUS_H__ */ tenmado-0.10/loop.c0000644000175000017500000001060110276702754015012 0ustar00ooharaoohara00000000000000/* $Id: loop.c,v 1.53 2002/12/25 12:30:42 oohara Exp $ */ #include #include "tenm_object.h" #include "pause.h" #include "tenm_table.h" #include "player.h" #include "score.h" #include "ship.h" #include "chain.h" #include "hit-status.h" #include "stage.h" #include "tenm_timer.h" #include "tenm_input.h" #include "scheduler.h" #include "const.h" #include "tenm_graphic.h" #include "result.h" #include "esc-ok.h" #include "option.h" #include "loop.h" /* static int draw_all_mass(tenm_object *my, int n); */ /* returns 1 if the program should quit, 0 if not */ int main_loop(int tutorial) { /* for debugging only */ int t_start = 0; int i; int t = 0; int frame_passed = 0; int quit_needed = 0; const option *op = NULL; tenm_object *player; op = get_option(); if (op == NULL) { fprintf(stderr, "main_loop: get_option failed\n"); /* we should have checked the options */ return 1; } clear_pause(); /* we don't need to pause if it is a tutorial */ if (tutorial == 0) tenm_set_focus_handler((void (*)(int)) pause_by_mouse); else tenm_set_focus_handler((void (*)(int)) NULL); tenm_table_clear_all(); player = player_new(tutorial); clear_score(); set_ship(5); clear_chain(); clear_hit_status(); if (tutorial == 0) { if ((op->stage >= 1) && (op->stage <= 5)) set_stage(op->stage); else set_stage(1); } else { set_stage(7); } tenm_timer_reset(); while (1 == 1) { /* quit the program if a SDL_QUIT event happened * (for example, if a SIGINT signal (sent by Ctrl+c) is received) */ if (tenm_event_handle() != 0) { quit_needed = 1; break; } /* back to the title if ESC is pressed */ if (tenm_get_key_status() & 32) { if (get_esc_ok()) { set_esc_ok(0); break; } } else { set_esc_ok(1); } /* pause if it is a real game and if p is pressed * we must check "tutorial" first to suppress unnecessary * pause message */ if ((tutorial == 0) && (do_pause(tenm_get_key_status() & 64))) { frame_passed++; /* this wait is necessary to save CPU time */ tenm_wait_next_frame(); continue; } for (i = 1; i <= 30; i++) { if (tenm_table_detect_collision(player) != 0) player = NULL; if (tenm_table_move(player, 30) != 0) player = NULL; } /* scheduler() must be called before tenm_table_do_action() * to clear action_needed flag correctly */ if (scheduler(t + t_start) == SCHEDULER_NEXT_STAGE) { clear_chain(); /* t is incremented at the end of the loop */ t = -1; /* "stage 6" means ending, "stage 7" means tutorial */ if (get_stage() > 5) break; /* you can't go to the next stage if you use --stage option */ if ((op->stage >= 1) && (op->stage <= 5)) break; add_stage(1); } if (tenm_table_do_action(player) != 0) player = NULL; calculate_chain(); /* pure white is bad for your eyes */ tenm_clear_window(tenm_map_color(253, 245, 230)); tenm_table_draw(player); show_chain(); show_hit_status(); show_score(); show_ship(); /* for those who want to see the world as it is */ /* note that * (1) the player is not in the table * (2) this is slow */ /* tenm_table_apply_all((int (*)(tenm_object *, int)) draw_all_mass, 0); */ tenm_redraw_window(); tenm_wait_next_frame(); if (op->slow != 0) { /* wait one more frame */ tenm_wait_next_frame(); } if (player == NULL) break; t++; frame_passed++; } if (frame_passed > 0) { printf("average fps: %f\n", tenm_calculate_fps(frame_passed)); fflush(stdout); } tenm_table_clear_all(); if (player != NULL) tenm_object_delete(player); if ((!(tutorial)) && (!(quit_needed))) { /* note that show_result() does not use table */ if (show_result() != 0) quit_needed = 1; } return quit_needed; } #if 0 static int draw_all_mass(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if (my->mass == NULL) return 0; if (my->attr == 0) return 0; if (tenm_draw_mass(my->mass, tenm_map_color(0, 0, 0)) != 0) { fprintf(stderr, "draw_all_mass: tenm_draw_mass failed (%d)\n", my->table_index); } return 0; } #endif /* 0 */ tenmado-0.10/loop.h0000644000175000017500000000026310276702754015022 0ustar00ooharaoohara00000000000000/* $Id: loop.h,v 1.3 2002/07/13 04:50:10 oohara Exp $ */ #ifndef __TENMADO_LOOP_H__ #define __TENMADO_LOOP_H__ int main_loop(int tutorial); #endif /* not __TENMADO_LOOP_H__ */ tenmado-0.10/main.c0000644000175000017500000000574010276702754014775 0ustar00ooharaoohara00000000000000/* $Id: main.c,v 1.226 2003/09/17 01:12:43 oohara Exp $ */ #include /* rand, exit */ #include /* time */ #include #include "const.h" #include "tenm_graphic.h" #include "tenm_input.h" #include "tenm_math.h" #include "tenm_table.h" #include "tenm_timer.h" #include "util.h" #include "image.h" /* pause_by_mouse */ #include "pause.h" #include "loop.h" #include "title.h" #include "option.h" #include "bac_dump.h" /* DATABASE_DIR */ #include "high-score.h" /* note that delay granularity is 10 ms */ #define NUM_WAIT 3 int main(int argc, char *argv[]) { int choice; int temp; int graphic_flag; const option *op = NULL; if (set_option(argc, argv) != 0) { fprintf(stderr, "main: set_option failed\n"); return 1; } op = get_option(); if (op == NULL) { fprintf(stderr, "main: get_option failed\n"); return 1; } if (op->help != 0) { do_help(); return 0; } if (op->version != 0) { do_version(); return 0; } if (op->dump >= 0) { if (dump_high_score(op->dump) != 0) { fprintf(stderr, "main: dump_high_score failed\n"); return 1; } return 0; } if (op->undump >= 0) { if (undump_high_score(op->undump) != 0) { fprintf(stderr, "main: undump_high_score failed\n"); return 1; } return 0; } if (op->undump_default != 0) { if (read_default_score() != 0) { fprintf(stderr, "main: read_default_score() failed\n"); return 1; } return 0; } srand((unsigned int) time(NULL)); if (op->full_screen != 0) graphic_flag = TENM_FULLSCREEN; else graphic_flag = 0; tenm_graphic_init(WINDOW_WIDTH, WINDOW_HEIGHT, graphic_flag, "tenmado"); tenm_clear_window(tenm_map_color(255, 239, 213)); tenm_timer_init(NUM_WAIT); if (tenm_math_init(810, 11) != 0) fprintf(stderr, "main: tenm_math_init failed, continuing (can be slow)\n"); util_init(WINDOW_WIDTH, WINDOW_HEIGHT); image_init(); tenm_table_init(256, -1, 1); tenm_set_key(7, TENM_KEY_UP, TENM_KEY_DOWN, TENM_KEY_RIGHT, TENM_KEY_LEFT, TENM_KEY_SPACE, TENM_KEY_ESCAPE, TENM_KEY_p); temp = tenm_joystick_init(8192); if (temp == TENM_JOYSTICK_INIT_ERROR) { fprintf(stderr, "main: tenm_joystick_init failed\n"); return 1; } else if (temp == TENM_JOYSTICK_INIT_NO_JOYSTICK) { fprintf(stderr, "main: don't worry, just use the keyboard\n"); } else { tenm_joystick_map_axis(TENM_JOYSTICK_UP, TENM_KEY_UP); tenm_joystick_map_axis(TENM_JOYSTICK_DOWN, TENM_KEY_DOWN); tenm_joystick_map_axis(TENM_JOYSTICK_LEFT, TENM_KEY_LEFT); tenm_joystick_map_axis(TENM_JOYSTICK_RIGHT, TENM_KEY_RIGHT); tenm_joystick_map_button(0, TENM_KEY_SPACE); } choice = title(); while (choice != 3) { if ((choice == 0) || (choice == 1)) { if (main_loop(choice) != 0) break; } else { if (show_high_score() != 0) break; } choice = title(); } image_quit(); util_quit(); return 0; } tenmado-0.10/option.c0000644000175000017500000001442210276702754015356 0ustar00ooharaoohara00000000000000/* $Id: option.c,v 1.49 2003/01/11 22:06:26 oohara Exp $ */ /* VERSION */ #include #include /* strcmp */ #include /* strtol, malloc, atexit */ #include /* errno */ #include /* INT_MIN, INT_MAX */ #include /* COPYRIGHT_STRING */ #include "const.h" #include "option.h" static option *option_pointer = NULL; static int convert_to_number(int *value, const char *string, int min, int max); static void option_quit(void); /* return 0 on success, 1 on error */ int set_option(int argc, char *argv[]) { int i; int action; /* sanity check */ if (argc <= 0) { fprintf(stderr, "set_option: argc is non-positive\n"); return 1; } if (argv == NULL) { fprintf(stderr, "set_option: argv is NULL\n"); return 1; } if (option_pointer != NULL) free(option_pointer); option_pointer = (option *) malloc(sizeof(option)); if (option_pointer == NULL) { fprintf(stderr, "set_option: malloc failed\n"); return 1; } if (atexit(option_quit) != 0) { fprintf(stderr, "set_option: cannot register option_quit to exit\n"); option_quit(); return 1; } option_pointer->dump = -1; option_pointer->full_screen = 0; option_pointer->help = 0; option_pointer->slow = 0; option_pointer->stage = 0; option_pointer->undump = -1; option_pointer->undump_default = 0; option_pointer->version = 0; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "--dump") == 0) { if (i + 1 >= argc) { fprintf(stderr, "set_option: missing stage number for --dump " "(arg %d)\n", i); return 1; } if (convert_to_number(&(option_pointer->dump), argv[i + 1], 0, 5) != 0) { fprintf(stderr, "set_option: convert_to_number(dump) (arg %d) " "failed\n", i + 1); return 1; } i++; } else if (strcmp(argv[i], "--full-screen") == 0) { option_pointer->full_screen = 1; } else if (strcmp(argv[i], "--help") == 0) { option_pointer->help = 1; /* ignore the rest */ break; } else if (strcmp(argv[i], "--slow") == 0) { option_pointer->slow = 1; } else if (strcmp(argv[i], "--stage") == 0) { if (i + 1 >= argc) { fprintf(stderr, "set_option: missing stage number for --stage " "(arg %d)\n", i); return 1; } if (convert_to_number(&(option_pointer->stage), argv[i + 1], 1, 5) != 0) { fprintf(stderr, "set_option: convert_to_number(stage) (arg %d) " "failed\n", i + 1); return 1; } i++; } else if (strcmp(argv[i], "--undump") == 0) { if (i + 1 >= argc) { fprintf(stderr, "set_option: missing stage number for --undump " "(arg %d)\n", i); return 1; } if (convert_to_number(&(option_pointer->undump), argv[i + 1], 0, 5) != 0) { fprintf(stderr, "set_option: convert_to_number(undump) (arg %d) " "failed\n", i + 1); return 1; } i++; } else if (strcmp(argv[i], "--undump-default") == 0) { option_pointer->undump_default = 1; } else if (strcmp(argv[i], "--version") == 0) { option_pointer->version = 1; /* ignore the rest */ break; } else { fprintf(stderr, "set_option: unknown option (arg %d)\n", i); return 1; } } if ((option_pointer->help == 0) && (option_pointer->version == 0)) { /* we know there are at most 3 actions, so an overflow shouldn't happen */ action = 0; if (option_pointer->dump != -1) action++; if (option_pointer->undump != -1) action++; if (option_pointer->undump_default != 0) action++; if (action > 1) { fprintf(stderr, "set_option: only one of --dump, --undump or " "--undump-defaultmay be specified\n"); return 1; } } return 0; } void do_help(void) { printf("Usage: tenmado [options]\n" "hard-core shoot 'em up game in blue-or-red world\n" "Options:\n" ); printf(" --dump _stage_ write high score data to stdout\n" " --full-screen run the game in the full screen mode\n" " --help print this message\n" ); printf(" --slow run the game at the half speed\n" " --stage _stage_ start the game at the specified stage\n" " --undump _stage_ read high score data from stdin and save\n" " --undump-default fill the high score lists if they are empty\n" ); printf(" --version print version information\n" "\n" "Report bugs to .\n" ); } void do_version(void) { printf("tenmado %s\n", VERSION); printf("%s\n", COPYRIGHT_STRING); printf("This program is free software; you can redistribute it and/or\n" "modify it under the terms of either the GNU General Public License\n" "version 2 or the Artistic License Version 2.0beta5.\n"); printf("tenmado comes with NO WARRANTY, to the extent permitted by law.\n"); } const option * get_option(void) { return (const option *) option_pointer; } /* convert string (arg 2) to a number and store it to value (arg 1) * return 0 on success, 1 on error */ static int convert_to_number(int *value, const char *string, int min, int max) { long int temp; char *tail; /* sanity check */ if (min > max) { fprintf(stderr, "convert_to_number: min > max\n"); return 1; } /* to detect overflow */ errno = 0; temp = strtol(string, &tail, 10); if (tail[0] != '\0') { fprintf(stderr, "convert_to_number: string is not a number\n"); return 1; } if (errno != 0) { fprintf(stderr, "convert_to_number: number overflowed\n"); return 1; } if ((temp <= INT_MIN) || (temp >= INT_MAX)) { fprintf(stderr, "convert_to_number: too big or small integer\n"); return 1; } if ((((int) temp) < min) || (((int) temp) > max)) { fprintf(stderr, "convert_to_number: integer %d -- %d is expected\n", min, max); return 1; } *value = (int) temp; return 0; } static void option_quit(void) { if (option_pointer != NULL) { free(option_pointer); option_pointer = NULL; } } tenmado-0.10/option.h0000644000175000017500000000126610276702754015365 0ustar00ooharaoohara00000000000000/* $Id: option.h,v 1.17 2003/01/04 03:06:46 oohara Exp $ */ #ifndef __TENMADO_OPTION_H__ #define __TENMADO_OPTION_H__ struct _option { /* 0 -- 5 if set, -1 if unset */ int dump; /* 1 if set, 0 if unset */ int full_screen; /* 1 if set, 0 if unset */ int help; /* 1 if set, 0 is unset */ int slow; /* 1 -- 5 if set, 0 is unset */ int stage; /* 0 -- 5 if set, -1 if unset */ int undump; /* 1 if set, 0 if unset */ int undump_default; /* 1 if set, 0 if unset */ int version; }; typedef struct _option option; int set_option(int argc, char *argv[]); const option *get_option(void); void do_help(void); void do_version(void); #endif /* not __TENMADO_OPTION_H__ */ tenmado-0.10/pause.c0000644000175000017500000000316510276702754015165 0ustar00ooharaoohara00000000000000/* $Id: pause.c,v 1.14 2002/07/10 11:01:37 oohara Exp $ */ #include /* WINDOW_WIDTH */ #include "const.h" /* draw_string() */ #include "util.h" /* tenm_redraw_window() */ #include "tenm_graphic.h" #include "pause.h" static int paused = 0; static int paused_modify_ok = 1; static int show_pause_message(void); void clear_pause(void) { paused = 0; paused_modify_ok = 1; } /* return 1 if the game is paused, 0 if not */ int do_pause(int pause_key_pressed) { if (pause_key_pressed) { if (paused_modify_ok) { paused_modify_ok = 0; if (paused) { paused = 0; } else { paused = 1; if (show_pause_message() != 0) fprintf(stderr, "do_pause: show_pause_message failed\n"); } } } else { paused_modify_ok = 1; } if (paused) return 1; return 0; } /* pause the game if the mouse cursor is out of the window * note that moving the mouse cursor into the window does not * continue the game */ void pause_by_mouse(int gain) { if ((gain != 1) && (!(paused))) { paused = 1; if (show_pause_message() != 0) fprintf(stderr, "pause_by_mouse: show_pause_message failed\n"); } } /* return 0 on success, 1 on error */ static int show_pause_message(void) { int status = 0; if (draw_string(10, WINDOW_HEIGHT - 40, "paused --- press p " "to continue", 30) != 0) { fprintf(stderr, "show_pause_message: draw_string failed\n"); status = 1; } if (tenm_redraw_window() != 0) { fprintf(stderr, "show_pause_message: tenm_redraw_window failed\n"); status = 1; } return status; } tenmado-0.10/pause.h0000644000175000017500000000036610276702754015172 0ustar00ooharaoohara00000000000000/* $Id: pause.h,v 1.7 2002/07/10 06:43:19 oohara Exp $ */ #ifndef __TENMADO_PAUSE_H__ #define __TENMADO_PAUSE_H__ void clear_pause(void); int do_pause(int pause_key_pressed); void pause_by_mouse(int gain); #endif /* not __TENMADO_PAUSE_H__ */ tenmado-0.10/score.c0000644000175000017500000000372710276702755015170 0ustar00ooharaoohara00000000000000/* $Id: score.c,v 1.21 2003/01/12 01:52:50 oohara Exp $ */ #include /* strlen */ #include #include "util.h" #include "tenm_object.h" #include "const.h" #include "stage.h" #include "ship.h" #include "score.h" #define EXTEND_FIRST 200000 #define EXTEND_LATER_EVERY 200000 static int score = 0; static int stage_score[6]; static int extend_next = EXTEND_FIRST; void clear_score(void) { int i; score = 0; for (i = 0; i < 6; i++) stage_score[i] = 0; extend_next = EXTEND_FIRST; } int get_score(void) { return score; } int get_stage_score(int stage) { /* sanity check */ if ((stage <= 0) || (stage > 6)) { fprintf(stderr, "get_stage_score: strange stage (%d)\n", stage); return 0; } return stage_score[stage - 1]; } /* return the actual score added to the total */ int add_score(int delta) { if (score + delta < 0) delta = -score; score += delta; if ((get_stage() >= 1) && (get_stage() <= 6)) stage_score[get_stage() - 1] += delta; while (score >= extend_next) { extend_next += EXTEND_LATER_EVERY; /* you don't get an extra ship if you have already * lost the game, if you have cleared the game or * if you are viewing the tutorial demo */ if ((get_ship() >= 0) && (get_stage() >= 1) && (get_stage() <= 5)) add_ship(1); } return delta; } /* return 0 on success, 1 on error */ int show_score(void) { char temp[32]; sprintf(temp, "score %8d", score); if (draw_string(10, WINDOW_HEIGHT - 10, temp, (int) strlen(temp)) != 0) { fprintf(stderr, "show_score: draw_string failed\n"); return 1; } return 0; } /* return the damege that should be subtracted from * the hit point of the enemy */ int add_damage_score(int hit_point, int damage) { /* sanity check */ if (hit_point <= 0) return 0; if (damage <= 0) return 0; if (hit_point > damage) { add_score(damage); } else { damage = hit_point; add_score(damage - 1); } return damage; } tenmado-0.10/score.h0000644000175000017500000000051010276702755015160 0ustar00ooharaoohara00000000000000/* $Id: score.h,v 1.5 2002/07/10 11:27:15 oohara Exp $ */ #ifndef __TENMADO_SCORE_H__ #define __TENMADO_SCORE_H__ void clear_score(void); int get_score(void); int get_stage_score(int stage); int add_score(int delta); int show_score(void); int add_damage_score(int hit_point, int damage); #endif /* not __TENMADO_SCORE_H__ */ tenmado-0.10/ship.c0000644000175000017500000000137110276702755015011 0ustar00ooharaoohara00000000000000/* $Id: ship.c,v 1.15 2003/01/12 02:09:12 oohara Exp $ */ #include /* strlen */ #include #include "util.h" #include "const.h" #include "ship.h" static int ship = 5; void set_ship(int n) { ship = n; } /* return the new value of ships */ int add_ship(int delta) { ship += delta; if (ship < -1) ship = -1; return ship; } int get_ship(void) { return ship; } /* return 0 on success, 1 on error */ int show_ship(void) { char temp[16]; /* sanity check */ if (ship < 0) return 0; sprintf(temp, "ship %3d", ship); if (draw_string(WINDOW_WIDTH - 80, WINDOW_HEIGHT - 10, temp, (int) strlen(temp)) != 0) { fprintf(stderr, "show_ship: draw_string failed\n"); return 1; } return 0; } tenmado-0.10/ship.h0000644000175000017500000000035610276702755015020 0ustar00ooharaoohara00000000000000/* $Id: ship.h,v 1.3 2002/05/14 16:23:10 oohara Exp $ */ #ifndef __TENMADO_SHIP_H__ #define __TENMADO_SHIP_H__ void set_ship(int n); int add_ship(int delta); int get_ship(void); int show_ship(void); #endif /* not __TENMADO_SHIP_H__ */ tenmado-0.10/stage.c0000644000175000017500000000072610276702755015154 0ustar00ooharaoohara00000000000000/* $Id: stage.c,v 1.1 2002/07/10 11:08:47 oohara Exp $ */ #include #include "stage.h" static int stage = 1; void set_stage(int n) { stage = n; } int get_stage(void) { return stage; } /* return the new value of stage */ int add_stage(int delta) { if (stage + delta <= 0) { fprintf(stderr, "add_stage: trying to let stage negative, assuming " "1 instead\n"); stage = 1; } else { stage += delta; } return stage; } tenmado-0.10/stage.h0000644000175000017500000000034010276702755015151 0ustar00ooharaoohara00000000000000/* $Id: stage.h,v 1.1 2002/07/10 11:10:03 oohara Exp $ */ #ifndef __TENMADO_STAGE_H__ #define __TENMADO_STAGE_H__ void set_stage(int n); int get_stage(void); int add_stage(int delta); #endif /* not __TENMADO_STAGE_H__ */ tenmado-0.10/util.c0000644000175000017500000001440110276702755015021 0ustar00ooharaoohara00000000000000/* $Id: util.c,v 1.39 2003/01/12 00:37:37 oohara Exp $ */ /* NOT_HAVE_POSIX */ #include #include /* malloc */ #include #include "tenm_graphic.h" #include "const.h" #include "tenm_table.h" #include "explosion.h" #include "tenm_primitive.h" #include "tenm_collision.h" #include "tenm_object.h" #include "util.h" #ifdef NOT_HAVE_POSIX #define FONTDIR "./happy-L/image/" #else /* not NOT_HAVE_POSIX */ #define FONTDIR DATADIR "/games/tenmado/image/" #endif static tenm_image *font = NULL; static tenm_primitive *window = NULL; static double window_width = 0.0; static double window_height = 0.0; static char *buffer = NULL; static int buffer_size = 0; static int in_window_point(double x, double y); /* return 0 on success, 1 on error */ int util_init(int width, int height) { font = tenm_load_image(1, FONTDIR "/font-medium.png", 1, 95, tenm_map_color(255, 255, 255)); window= (tenm_primitive *) tenm_polygon_new(4, 0.0, 0.0, 0.0, (double) height, (double) width, 0.0, (double) width, (double) height); if (window == NULL) { tenm_image_delete(font); fprintf(stderr, "util_init: tenm_polygon_new failed\n"); return 1; } window_width = width; window_height = height; return 0; } void util_quit(void) { if (font != NULL) { tenm_image_delete(font); font = NULL; } if (window != NULL) { (window->delete)(window); window = NULL; } window_width = 0.0; window_height = 0.0; if (buffer != NULL) { free(buffer); buffer = NULL; } buffer_size = 0; } int draw_string(int x, int y, const char *string, int length) { /* sanity check */ if (font == NULL) return 0; if (string == NULL) return 0; if (length <= 0) return 0; if (tenm_draw_string(x, y, font, string, length) != 0) { fprintf(stderr, "draw_string: tenm_draw_string failed\n"); return 1; } return 0; } int draw_string_int(int x, int y, const int *string, int length) { int i; char *buffer_temp; /* sanity check */ if (font == NULL) return 0; if (string == NULL) return 0; if (length <= 0) return 0; /* don't substitute buffer directly, or you will be in a trouble * if realloc fails (you don't need data in buffer, but you still * need to free buffer in any case) */ if ((buffer == NULL) || (length + 1 > buffer_size)) { if (buffer == NULL) buffer_temp = (char *) malloc(sizeof(char) * (length + 1)); else buffer_temp = (char *) realloc(buffer, sizeof(char) * (length + 1)); if (buffer_temp == NULL) { fprintf(stderr, "draw_string_int: memory allocation to buffer failed\n"); return 1; } buffer = buffer_temp; buffer_size = length + 1; } /* stupid way to get a pointer to char * (char * and int * are incompatible) */ for (i = 0; i < length; i++) buffer[i] = (char) string[i]; buffer[length] = '\0'; if (tenm_draw_string(x, y, font, buffer, length) != 0) { fprintf(stderr, "draw_string_int: tenm_draw_string failed\n"); return 1; } return 0; } /* return 1 (true) or 0 (false) */ int in_window_object(const tenm_object *p) { int i; if (window == NULL) { fprintf(stderr, "in_window_primitive: window is NULL\n"); return 0; } if (p == NULL) { fprintf(stderr, "in_window_primitive: p is NULL\n"); return 0; } if (p->mass == NULL) { fprintf(stderr, "in_window_primitive: p->mass is NULL\n"); return 0; } for (i = 0; i < p->mass->n; i++) if (in_window_primitive(p->mass->p[i])) return 1; return 0; } /* optimized under the assumption that p is usually in the window * return 1 (true) or 0 (false) */ int in_window_primitive(const tenm_primitive *p) { double temp_x; double temp_y; double temp_r; int i; if (window == NULL) { fprintf(stderr, "in_window_primitive: window is NULL\n"); return 0; } if (p == NULL) { fprintf(stderr, "in_window_primitive: p is NULL\n"); return 0; } switch (p->klass) { case TENM_POINT: return in_window_point(((const tenm_point *) p)->x, ((const tenm_point *) p)->y); break; case TENM_CIRCLE: temp_x = ((const tenm_circle *) p)->center->x; temp_y = ((const tenm_circle *) p)->center->y; temp_r = ((const tenm_circle *) p)->r; if ((temp_x + temp_r >= 0.0) && (temp_x - temp_r < window_width) && (temp_y >= 0.0) && (temp_y < window_height)) return 1; if ((temp_y + temp_r >= 0.0) && (temp_y - temp_r < window_height) && (temp_x >= 0.0) && (temp_x < window_width)) return 1; return tenm_collided_primitive(p, window); break; case TENM_SEGMENT: temp_x = ((const tenm_segment *) p)->a->x; temp_y = ((const tenm_segment *) p)->a->y; if (in_window_point(temp_x, temp_y)) return 1; temp_x = ((const tenm_segment *) p)->b->x; temp_y = ((const tenm_segment *) p)->b->y; if (in_window_point(temp_x, temp_y)) return 1; return tenm_collided_primitive(p, window); break; case TENM_POLYGON: for (i = 0; i < ((const tenm_polygon *) p)->n; i++) { temp_x = ((const tenm_polygon *) p)->v[i]->x; temp_y = ((const tenm_polygon *) p)->v[i]->y; if (in_window_point(temp_x, temp_y)) return 1; } return tenm_collided_primitive(p, window); break; default: fprintf(stderr, "primitive_in_window: strange primitive found (%d)\n", p->klass); return 0; break; } /* should not reach here */ return 0; } /* return 1 (true) or 0 (false) */ static int in_window_point(double x, double y) { /* sanity check */ if (window == NULL) { fprintf(stderr, "point_in_window: window is NULL\n"); return 0; } if ((x < 0) || (x >= window_width)) return 0; if ((y < 0) || (y >= window_height)) return 0; return 1; } int delete_enemy_shot(tenm_object *my, int n) { if (my == NULL) return 0; if (!(my->attr & ATTR_ENEMY_SHOT)) return 0; tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 20, my->count[0], 2.0, 8)); return 1; } tenmado-0.10/util.h0000644000175000017500000000104110276702755015022 0ustar00ooharaoohara00000000000000/* $Id: util.h,v 1.14 2003/01/07 17:31:57 oohara Exp $ */ #ifndef __TENMADO_UTIL_H__ #define __TENMADO_UTIL_H__ #include "tenm_object.h" int util_init(int width, int height); void util_quit(void); int draw_string(int x, int y, const char *string, int length); int draw_string_int(int x, int y, const int *string, int length); int in_window_object(const tenm_object *p); int in_window_primitive(const tenm_primitive *p); /* table manipulation function */ int delete_enemy_shot(tenm_object *my, int n); #endif /* not __TENMADO_UTIL_H__ */ tenmado-0.10/Artistic-20000644000175000017500000002505310276702753015547 0ustar00ooharaoohara00000000000000 The Artistic License Version 2.0beta5, October 2001 Copyright (C) 2000, 2001 Larry Wall, Bradley M. Kuhn. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble This copyright license states the terms under which a given free software Package may be copied, modified and/or redistributed, while the Originator(s) maintain some artistic control over the future development of that Package (at least as much artistic control as can be given under copyright law while still making the Package open source and free software). This license is bound by copyright law, and thus it legally applies only to works which the copyright holder has permitted copying, distribution or modification under the terms of the Artistic License, Version 2.0. You are reminded that You are always permitted to make arrangements wholly outside of a given copyright license directly with the copyright holder(s) of a given Package. If the terms of this license impede your ability to make full use of the Package, You are encouraged to contact the copyright holder(s) and seek a different licensing arrangement. Definitions "Package" refers to the collection of files distributed by the Originator(s), and derivatives of that collection of files created through textual modification. "Standard Version" refers to the Package if it has not been modified, or has been modified only in ways suggested by the Originator(s). "Modified Version" refers to the Package, if it has been changed by You via textual modification of the source code, and such changes were not suggested by the Originator(s). "Originator" refers to the author(s) and/or copyright holder(s) of the Standard Version of the Package. "You" and "Your" refers to any person who would like to copy, distribute, or modify the Package. "Distribution Fee" is any fee that You charge for providing a copy of this Package to another party. It does not refer to licensing fees. "Freely Available" means that: (a) no fee is charged for the right to use the item (though a Distribution Fee may be charged). (b) recipients of the item may redistribute it under the same conditions they received it. (c) If the item is a binary, object code, bytecode, the complete corresponding machine-readable source code is included with the item. Permission for Use and Modification Without Redistribution (1) You are permitted to use the Standard Version and create and use Modified Versions for any purpose without restriction, provided that you do not redistribute the Modified Version to others outside of your company or organization. Permissions for Redistribution of the Standard Version (2) You may make available verbatim copies of the source code of the Standard Version of this Package in any medium without restriction, either gratis or for a Distribution Fee, provided that you duplicate all of the original copyright notices and associated disclaimers. At Your discretion, such verbatim copies may or may not include compiled bytecode, object code or binary versions of the corresponding source code in the same medium. (3) You may apply any bug fixes, portability changes, and other modifications made available from any of the Originator(s). The resulting modified Package will still be considered the Standard Version, and may be copied, modified and redistributed under the terms of the original license of the Standard Version as if it were the Standard Version. Permissions for Redistribution of Modified Versions of the Package as Sour= ce (4) You may modify your copy of the source code of this Package in any way and distribute that Modified Version (either gratis or for a Distribution Fee, and with or without a corresponding binary, bytecode or object code version of the Modified Version) provided that You clearly indicate what changes You made to the Package, and provided that You do at least ONE of the following: (a) make the Modified Version available to the Originator(s) of the Standard Version, under the exact license of the Standard Version, so that the Originator(s) may include your modifications into the Standard Version (at their discretion). (b) modify any installation scripts and procedures so that installation of the Modified Version will never conflict with an installation of the Standard Version, include for each program installed by the Modified Version clear documentation describing how it differs from the Standard Version, and rename your Modified Version so that the name is substantially different from the Standard Version. (c) permit and encourage anyone who receives a copy of the Modified Version to make your modifications Freely Available in some specific way. If Your Modified Version is in turn derived from a Modified Version made by a third party, then You are still required to ensure that Your Modified Version complies with the requirements of this license. Permissions for Redistribution of Non-Source Versions of Package (5) You may distribute binary, object code, bytecode or other non-source versions of the Standard Version of the Package, provided that you include complete instructions on where to get the source code of the Standard Version. Such instructions must be valid at the time of Your distribution. If these instructions, at any time while You are carrying our such distribution, become invalid, you must provide new instructions on demand or cease further distribution. If You cease distribution within thirty days after You become aware that the instructions are invalid, then You do not forfeit any of Your rights under this license. (6) You may distribute binary, object code, bytecode or other non-source versions of a Modified Version provided that You do at least ONE of the following: (a) include a copy of the corresponding source code for the Modified Version under the terms indicated in (4). (b) ensure that the installation of Your non-source Modified Version does not conflict in any way with an installation of the Standard Version, include for each program installed by the Modified Version clear documentation describing how it differs from the Standard Version, and rename your Modified Version so that the name is substantially different from the Standard Version. (c) ensure that the Modified Version includes notification of the changes made from the Standard Version, and offer to provide machine-readable source code (under a license that permits making that source code Freely Available) of the Modified Version via mail order. Permissions for Inclusion of the Package in Aggregate Works =20 (7) You may aggregate this Package (either the Standard Version or Modified Version) with other packages and distribute the resulting aggregation provided that You do not charge a licensing fee for the Package. Distribution Fees are permitted, and licensing fees for other packages in the aggregation are permitted. Your permission to distribute Standard or Modified Versions of the Package is still subject to the other terms set forth in other sections of this license. (8) In addition to the permissions given elsewhere by this license, You are also permitted to link Modified and Standard Versions of this Package with other works and distribute the result without restriction, provided You have produced binary program(s) that do not overtly expose the interfaces of the Package. This includes permission to embed the Package in a larger work of your own without exposing a direct interface to the Package. This also includes permission to build stand-alone binary or bytecode versions of your scripts that require the Package, but do not otherwise give the casual user direct access to the Package itself. Items That are Never Considered Part of a Modified Version Package (9) Works (including, but not limited to, subroutines and scripts) that you have linked or aggregated with the Package that merely extend or make use of the Package, but are not intended to cause the Package to operate differently from the Standard Version, do not, by themselves, cause the Package to be a Modified Version. In addition, such works are not considered parts of the Package itself, and are not bound by the terms of the Package's license. Acceptance of License and Disclaimer of Warranty (10) You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to copy, modify or distribute the Standard or Modified Versions of the Package. These actions are prohibited by copyright law if you do not accept this License. Therefore, by copying, modifying or distributing Standard and Modified Versions of the Package, you indicate your acceptance of the license of the Package. (11) Disclaimer of Warranty: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT UNLESS REQUIRED BY LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER OR CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. tenmado-0.10/GPL-20000644000175000017500000004311010276702754014402 0ustar00ooharaoohara00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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. tenmado-0.10/LICENSE0000644000175000017500000000117511711665520014702 0ustar00ooharaoohara00000000000000$Id: LICENSE,v 1.5 2012/01/31 04:17:20 oohara Exp $ tenmado -- hard-core shoot 'em up game in blue-or-red world Copyright (C) 2002, 2012 Oohara Yuuma This program is free software; you can redistribute it and/or modify it under the terms of either: a) the GNU General Public License version 2 as published by the Free Software Foundation (no other version is allowed), or b) the Artistic License Version 2.0beta5. A copy of the GNU General Public License version 2 is included in the source code as GPL-2. A copy of the Artistic License Version 2.0beta5 is included in the source code as Artistic-2. tenmado-0.10/icon.png0000644000175000017500000000070410276702754015336 0ustar00ooharaoohara00000000000000‰PNG  IHDR00Wù‡bKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ  ‰±óQIDATxœÕ”IÂ0 '|,üŒâiy™8€)cdÇ‹¶Ì¢;32(þæ¦2“O؇$B$ø'¶mô·î+ð€³À*<à(Ђ½ó<@ÔzqF̘MSixÀP`>ÔœmžK¯€z³É£*  ( HÀ»ÝÁÌæ¹ôˆ7`1›<¢Öð€ €¼ÉHmžË™Àr³É³$à ,D€&¬áEYó`ki 5e6yº"Âà§ïÀcó\jÍ"|ù³T®T¢ÂwÝA”Ísá~ˆúå[ù \ø\ þF;ö˜›çR ¼¿8'pÄlƒ°Ó†ãËÆCê(H(M(IÌA8 å-Èü©±¼@e!}2µgzR*¿¿—e±¥ÔBˆ§À°P<2'BñÊ0BtÜ@¤òzQªãN€XIEND®B`‚tenmado-0.10/icon.xpm0000644000175000017500000000235610276702754015363 0ustar00ooharaoohara00000000000000/* XPM */ static char * icon_xpm[] = { "32 32 4 1", " c None", ". c #7F007F", "+ c #FF0000", "@ c #0000FF", " . ", " ..+ ", " .. + ", " .. + ", " .. + ", " .. ++ ", " .. + ", " .. + ", " .. + ", " .. ++ ", " .. + ", " .. + ", " .. + ", " .. ++ ", " .. + ", " .. + ", " .. + ", " .. + ", " .. ++ ", " .. + ", " .. + ", " .. + ", " .. ++ ", "@@ + ", " @@@@@ + ", " @@@@@ + ", " @@@@@ ++ ", " @@@@@@ + ", " @@@@@ + ", " @@@@@ + ", " @@@@@+", " @ "}; tenmado-0.10/tenmado.60000644000175000017500000000612210276702755015417 0ustar00ooharaoohara00000000000000.\" $Id: tenmado.6,v 1.18 2004/08/07 12:58:04 oohara Exp $ .TH TENMADO 6 "Wed, 15 Jan 2003" "Project Geeste" "tenmado manual" .SH NAME tenmado \- hard-core shoot 'em up game in blue-or-red world .SH SYNOPSIS .B tenmado [ .BI "\-\-dump" " stage" ] [ .BI "\-\-full\-screen" ] [ .BI "\-\-help" ] [ .BI "\-\-slow" ] [ .BI "\-\-stage" " stage" ] [ .BI "\-\-undump" " stage" ] [ .BI "\-\-undump\-default" ] [ .BI "\-\-version" ] .SH DESCRIPTION tenmado is a vertically scrolling, late 1990s style (that is, a massive number of enemy shots against a smaller-than-it-looks spaceship) shoot 'em up game. A very accurate collision detection makes it a game of dexterity. If something looks like a triangle, it is a triangle, not a rectangle of similar size. .P However, surviving is only 20% of the game. The main feature of tenmado is the "color chain bonus". You can get a very big score (about 100 times bigger than a normal enemy-destruction point) by destroying enemies of the same color successively. It is easy or difficult depending on how greedy you are. .P In the game, use cursor keys to move, press space key to shoot (auto-repeat). A joystick is also available for move and shoot. Note that you must plug the joystick before you invoke tenmado. For more information, see the tutorial demo by choosing it from the menu in the title. .SH OPTIONS .TP .BI "\-\-dump" " stage" Write high score data to standard output and exit. Usually you save the output in a file and later use that file as the input of .BR "\-\-undump" "." .I stage must be between 0 and 5. .I stage 0 means total score. .I stage 1 -- 5 means each stage score. .TP .BI "\-\-full\-screen" Run the game in the full screen mode. .TP .TP .BI "\-\-help" Print a help message and exit. .TP .BI "\-\-slow" Run the game at the half speed. Technically, the length of waiting between each frame is doubled. This slows down everything in the game, including your ship. The idea is to study the enemy formations for a later (normal speed) play. The animation may be rough because this option gives you only about 16 fps. You can't enter the high score lists with this option. .TP .BI "\-\-stage" " stage" Start the game at the specified stage. .I stage must be between 1 and 5. Note that you can play only one stage (the specified one) and you can't enter the high score lists. .TP .BI "\-\-undump" " stage" Read high score data from standard input, save them and exit. The input is usually the output of .BR "\-\-dump" "." .I stage must be between 0 and 5. .I stage 0 means total score. .I stage 1 -- 5 means each stage score. Only the superuser may use this option. .TP .BI "\-\-undump\-default" If at least one high score list is empty, read the default high score data, save them and exit. If not, do nothing. The main purpose of this option is to create high score database files at installation time so that you can set their permission. .TP .BI "\-\-version" Print version information, license information and the disclaimer, then exit. .SH BUGS Please report any bugs you find to Oohara Yuuma . .SH AUTHOR Oohara Yuuma tenmado-0.10/README-ja-utf80000644000175000017500000002021411710766536016034 0ustar00ooharaoohara00000000000000tenmado --- é’赤世界ã®ç¡¬æ´¾ã‚·ãƒ¥ãƒ¼ãƒ†ã‚£ãƒ³ã‚° by 大原雄馬 published by Project Geeste $Id: README-ja-utf8,v 1.4 2012/01/28 12:43:10 oohara Exp $ * tenmado ã¨ã¯ä½•ã‹ tenmado ã¯ã‚¿ãƒ†ã‚¹ã‚¯ãƒ­ãƒ¼ãƒ«ã®ã€1990 å¹´ä»£å¾ŒåŠæ§˜å¼ã® (ã¤ã¾ã‚Šã€å¤§é‡ã®æ•µå¼¾ãŒ 見ãŸç›®ã‚ˆã‚Šå°ã•ãªå®‡å®™èˆ¹ã«è¥²ã„ã‹ã‹ã‚‹) シューティングゲームã§ã™ã€‚éžå¸¸ã« 正確ãªå½“ãŸã‚Šåˆ¤å®šã«ã‚ˆã‚Šã€æ‰‹å…ˆã®å™¨ç”¨ã•ã‚’è¦æ±‚ã•れるゲームã«ãªã£ã¦ã„ã¾ã™ã€‚ 三角形ã«è¦‹ãˆã‚‹ã‚‚ã®ã¯æœ¬å½“ã«ä¸‰è§’å½¢ã§ã‚りã€ä¼¼ãŸå¤§ãã•ã®é•·æ–¹å½¢ã§ã¯ã‚りã¾ã›ã‚“。 ã—ã‹ã—ã€ç”Ÿã残るã“ã¨ã¯ã“ã®ã‚²ãƒ¼ãƒ ã® 20% ã§ã—ã‹ã‚りã¾ã›ã‚“。tenmado ã®ä¸»ãª 特徴ã¯ã€Œã‚«ãƒ©ãƒ¼ãƒã‚§ãƒ¼ãƒ³ãƒœãƒ¼ãƒŠã‚¹ã€ã§ã™ã€‚åŒã˜è‰²ã®æ•µã‚’ç¶šã‘ã¦ç ´å£Šã™ã‚‹ã“ã¨ã«ã‚ˆã‚Šã€ éžå¸¸ã«å¤§ããªå¾—点 (é€šå¸¸ã®æ•µç ´å£Šç‚¹ã®ç´„ 100 å€ã§ã™) ã‚’å¾—ã‚‹ã“ã¨ãŒã§ãã¾ã™ã€‚ ã“れã¯ã‚ãªãŸãŒã©ã‚Œãã‚‰ã„æ¬²å¼µã‚‹ã‹ã«ã‚ˆã£ã¦ç°¡å˜ã«ã‚‚困難ã«ã‚‚ãªã‚Šã¾ã™ã€‚ * tenmado ã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«æ–¹æ³• tenmado ã®ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«æ–¹æ³•ã«ã¤ã„ã¦ã¯ INSTALL ファイルをã”らんãã ã•ã„。 è¦ç´„ã™ã‚‹ã¨ã€libcã€libSDL ãŠã‚ˆã³ libSDL_image をインストールã—〠1) ./configure 2) make 3) make install ã¨å…¥åŠ›ã—ã¦ãã ã•ã„。ã‚ãªãŸãŒ root ã¨ã—ã¦ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«ã—よã†ã¨ã—ã¦ã„ã‚‹ãªã‚‰ã€ ãƒã‚¤ã‚¹ã‚³ã‚¢ãƒ•ァイルã®ãƒ‘ーミッションã«ã¤ã„ã¦è€ƒæ…®ã—ã¦ãã ã•ã„。 * コマンドラインオプション --dump _stage_ ãƒã‚¤ã‚¹ã‚³ã‚¢ãƒ‡ãƒ¼ã‚¿ã‚’æ¨™æº–å‡ºåŠ›ã«æ›¸ãã ã—ã¦çµ‚了ã—ã¾ã™ã€‚ãµã¤ã†ã€ãã®å‡ºåŠ›ã‚’ ファイルã«ä¿å­˜ã—ã¦ãŠãã€ã‚ã¨ã§ãã®ãƒ•ァイルを --undump ã®å…¥åŠ›ã¨ã—ã¦ä½¿ã„ã¾ã™ã€‚ _stage_ 㯠0 ã‹ã‚‰ 5 ã¾ã§ã®é–“ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。_stage_ ㌠0 ãªã‚‰ ç·å¾—点ã§ã™ã€‚_stage_ ㌠1 ã‹ã‚‰ 5 ã¾ã§ãªã‚‰å„ステージã®å¾—点ã§ã™ã€‚ --full-screen ゲームをフルスクリーンモードã§å®Ÿè¡Œã—ã¾ã™ã€‚ --help ヘルプメッセージを表示ã—ã¦çµ‚了ã—ã¾ã™ã€‚ --slow ゲームをåŠåˆ†ã®é€Ÿåº¦ã§å®Ÿè¡Œã—ã¾ã™ã€‚技術的ã«ã¯ã€å„フレーム間ã®å¾…ã¡æ™‚間㌠2 å€ã« ãªã‚Šã¾ã™ã€‚ã“れã«ã‚ˆã‚Šè‡ªæ©Ÿã‚’å«ã‚€ã€ã‚²ãƒ¼ãƒ ä¸­ã®ã‚らゆるもã®ãŒé…ããªã‚Šã¾ã™ã€‚ ã‚ã¨ã® (通常速度ã®) プレイã®ãŸã‚ã«æ•µé…置を研究ã—よã†ã€ã¨ã„ã†ã‚ã‘ã§ã™ã€‚ ã“ã®ã‚ªãƒ—ションを使ã†ã¨ç´„ 16 fps ã«ã—ã‹ãªã‚‰ãªã„ã®ã§ã€å‹•ããŒãŒãŸãŒãŸã« ãªã‚‹ã‹ã‚‚ã—れã¾ã›ã‚“。ã“ã®ã‚ªãƒ—ションを使ã†ã¨ãƒã‚¤ã‚¹ã‚³ã‚¢ãƒªã‚¹ãƒˆã«è¼‰ã‚Šã¾ã›ã‚“。 --stage _stage_ ゲームを指定ã•れãŸã‚¹ãƒ†ãƒ¼ã‚¸ã‹ã‚‰é–‹å§‹ã—ã¾ã™ã€‚_stage_ 㯠1 ã‹ã‚‰ 5 ã¾ã§ã®é–“ã§ ãªã‘れã°ãªã‚Šã¾ã›ã‚“。ã²ã¨ã¤ã®ã‚¹ãƒ†ãƒ¼ã‚¸ (ã¤ã¾ã‚Šã€æŒ‡å®šã—ãŸã‚¹ãƒ†ãƒ¼ã‚¸) ã—㋠プレイã§ããªã„ã“ã¨ã€ãƒã‚¤ã‚¹ã‚³ã‚¢ãƒªã‚¹ãƒˆã«è¼‰ã‚‰ãªã„ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。 --undump _stage_ ãƒã‚¤ã‚¹ã‚³ã‚¢ãƒ‡ãƒ¼ã‚¿ã‚’標準入力ã‹ã‚‰èª­ã¿ã“ã¿ã€ä¿å­˜ã—ã¦çµ‚了ã—ã¾ã™ã€‚入力ã¯ãµã¤ã† --dump ã®å‡ºåŠ›ã§ã™ã€‚_stage_ 㯠0 ã‹ã‚‰ 5 ã¾ã§ã®é–“ã§ãªã‘れã°ãªã‚Šã¾ã›ã‚“。 _stage_ ㌠0 ãªã‚‰ç·å¾—点ã§ã™ã€‚_stage_ ㌠1 ã‹ã‚‰ 5 ã¾ã§ãªã‚‰å„ステージ㮠得点ã§ã™ã€‚特権ユーザã ã‘ãŒã“ã®ã‚ªãƒ—ションを使ãˆã¾ã™ã€‚ --undump-default ã‚‚ã—ã™ããªãã¨ã‚‚ã²ã¨ã¤ã®ãƒã‚¤ã‚¹ã‚³ã‚¢ãƒªã‚¹ãƒˆãŒç©ºãªã‚‰ã°ã€ãƒ‡ãƒ•ォルトã®ãƒã‚¤ã‚¹ã‚³ã‚¢ データを読ã¿ã“ã¿ã€ä¿å­˜ã—ã¦çµ‚了ã—ã¾ã™ã€‚ãã†ã§ãªã„ãªã‚‰ã€ä½•ã‚‚ã—ã¾ã›ã‚“。ã“㮠オプションã®ä¸»ãªç›®çš„ã¯ã‚¤ãƒ³ã‚¹ãƒˆãƒ¼ãƒ«æ™‚ã«ãƒ‘ーミッションを設定ã§ãるよã†ã«ã€ ãƒã‚¤ã‚¹ã‚³ã‚¢ãƒ‡ãƒ¼ã‚¿ãƒ™ãƒ¼ã‚¹ã‚’作æˆã™ã‚‹ã“ã¨ã§ã™ã€‚ --version ãƒãƒ¼ã‚¸ãƒ§ãƒ³æƒ…å ±ã€ãƒ©ã‚¤ã‚»ãƒ³ã‚¹æƒ…å ±ãŠã‚ˆã³å…責æ¡é …を表示ã—ã¦çµ‚了ã—ã¾ã™ã€‚ * キーæ“作 カーソルキー 移動 スペース å°„æ’ƒ (自動連射) ESC 終了 p ãƒãƒ¼ã‚º / å†é–‹ ジョイスティックã§ç§»å‹•ãŠã‚ˆã³å°„撃を行ã†ã“ã¨ã‚‚ã§ãã¾ã™ã€‚tenmado ã®èµ·å‹•å‰ã« ジョイスティックを接続ã—ã¦ãŠãå¿…è¦ãŒã‚ã‚‹ã“ã¨ã«æ³¨æ„ã—ã¦ãã ã•ã„。 マウスカーソルãŒã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã®å¤–ã«å‡ºã‚‹ã¨ã‚²ãƒ¼ãƒ ãŒãƒãƒ¼ã‚ºçŠ¶æ…‹ã«ãªã‚Šã¾ã™ã€‚ ã“れã«ã‚ˆã‚Šã€ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã«ãƒ•ォーカスãŒã‚ã£ã¦ã„ãªã„ã¨ãã«è‡ªæ©ŸãŒå€’ã•れるã“ã¨ãŒ 防ã’ã¾ã™ã€‚ * è‡ªæ©Ÿã®æ­¦å™¨ãŠã‚ˆã³è‡ªæ©Ÿ 自機ã®å¼¾ã¯é€²ã‚€ã«ã¤ã‚Œã¦é»’ããªã‚Šã¾ã™ã€‚é»’ã„弾㯠1 ダメージを与ãˆã¾ã™ã€‚ (ウィンドウ左上ã®ãƒ’ット情報をã”らんãã ã•ã„。) é»’ããªã„弾㯠2 ダメージを 与ãˆã¾ã™ã€‚敵をã¯ã‚„ã破壊ã—ãŸã„ãªã‚‰ã€ãã®æ•µã«æŽ¥è¿‘ã—ã¦ã€å¼¾ãŒé»’ããªã‚‹å‰ã« 当ã¦ã‚‹ã‚ˆã†ã«ã—ã¦ãã ã•ã„。 è‡ªæ©ŸãŒæ•µå¼¾ã€æ•µæœ¬ä½“ã¾ãŸã¯ä½•らã‹ã®éšœå®³ç‰©ã«æŽ¥è§¦ã™ã‚‹ã¨ã€è‡ªæ©Ÿã¯ç ´å£Šã•れã¾ã™ã€‚ 残り自機ãŒãªã„ãªã‚‰ã‚²ãƒ¼ãƒ ã‚ªãƒ¼ãƒãƒ¼ã§ã™ã€‚自機中央ã®é»’丸部分ã ã‘ãŒå¼±ç‚¹ã§ã™ã€‚ ãれ以外ã®éƒ¨åˆ†ã¯å®‰å…¨ã§ã™ã€‚ * 敵ã®è‰²ãŠã‚ˆã³ã‚«ãƒ©ãƒ¼ãƒã‚§ãƒ¼ãƒ³ãƒœãƒ¼ãƒŠã‚¹ åŒã˜è‰²ã®æ•µã‚’ç¶šã‘ã¦ç ´å£Šã™ã‚‹ã“ã¨ã«ã‚ˆã‚Šãƒœãƒ¼ãƒŠã‚¹å¾—点を得るã“ã¨ãŒã§ãã¾ã™ã€‚ ã“れを「カラーãƒã‚§ãƒ¼ãƒ³ãƒœãƒ¼ãƒŠã‚¹ã€ã¨å‘¼ã³ã¾ã™ã€‚(ウィンドウå³ä¸Šã®ãƒã‚§ãƒ¼ãƒ³ 情報をã”らんãã ã•ã„。) カラーãƒã‚§ãƒ¼ãƒ³ãƒœãƒ¼ãƒŠã‚¹ã‚’å¾—ã‚‹ãŸã‚ã«ã©ã®è‰²ã®æ•µã‚’ 倒ã›ã°ã„ã„ã‹ã¯è‡ªæ©Ÿã®è‰²ãŒç¤ºã—ã¦ã„ã¾ã™ã€‚ ãƒã‚§ãƒ¼ãƒ³æ•° ボーナス得点 1 1 2 2 3 4 4 8 5 16 6 32 7 64 8 128 9 256 10 512 11+ 1024 敵ã®è‰²ã¯ 4 色 --- é’ã€èµ¤ã€ç´«ãã—ã¦ç·‘ã§ã™ã€‚é’ã¨èµ¤ãŒåŸºæœ¬ã®è‰²ã§ã™ã€‚ç´«ã¯ç‰¹åˆ¥ã§ã™ --- ç›´å‰ã«ç ´å£Šã—ãŸæ•µã®è‰²ãŒä½•ã§ã‚れã€ç´«è‰²ã®æ•µã‚’破壊ã—ãŸã¨ãã«ã¯å¸¸ã«ã‚«ãƒ©ãƒ¼ ãƒã‚§ãƒ¼ãƒ³ãƒœãƒ¼ãƒŠã‚¹ãŒã¤ãã¾ã™ã€‚ã¾ãŸç›´å‰ã«ç ´å£Šã—ãŸæ•µã®è‰²ãŒç´«è‰²ãªã‚‰ã°ã€ã©ã®è‰²ã® 敵を破壊ã—ã¦ã‚‚カラーãƒã‚§ãƒ¼ãƒ³ãƒœãƒ¼ãƒŠã‚¹ãŒã¤ãã¾ã™ã€‚ç·‘è‰²ã®æ•µã¯ç ´å£Šã§ãã¾ã›ã‚“。 * ステージãŠã‚ˆã³æ®‹æ©Ÿãƒœãƒ¼ãƒŠã‚¹ ã“ã®ã‚²ãƒ¼ãƒ ã¯å…¨ 5 é¢ã§ã™ã€‚å„ステージ最後ã«ç™»å ´ã™ã‚‹ãƒœã‚¹ã‚’破壊ã™ã‚Œã°ã€æ¬¡ã® ステージã¸é€²ã‚ã¾ã™ã€‚å…¨é¢ã‚¯ãƒªã‚¢ã§ãれã°ã€æ®‹ã£ã¦ã„ã‚‹ (未使用ã®) è‡ªæ©Ÿã¯ å„ 3 万点ã«ãªã‚Šã¾ã™ã€‚20 万点ã”ã¨ã«è‡ªæ©ŸãŒ 1 機増ãˆã¾ã™ã€‚ * ゲームãŒé…ã™ãŽã‚‹å ´åˆ よㄠCPU ãŒãªã„㨠tenmado ã¯è‹¦ç—›ãªã»ã©é…ããªã‚‹ã‹ã‚‚ã—れã¾ã›ã‚“ (Pentium 4 以上を推奨ã—ã¾ã™)。ã“ã®å ´åˆã€top(1) を使ã£ã¦ä½•㌠CPU 時間を消費ã—ã¦ã„る㋠調ã¹ã¦ãã ã•ã„。ãµã¤ã†ã¯ X Window System ã§ã™ã€‚ç”»é¢ã®è‰²æ·±åº¦ã‚’ (16 ã¾ãŸã¯ 8 bpp ã«) 減らã—㦠X サーãƒã‚’å†èµ·å‹•ã™ã‚‹ã¨ãƒ‘フォーマンスãŒå¤§å¹…ã«æ”¹å–„ã•れã¾ã™ã€‚ ã‚‚ã—ã‚ãªãŸã® X サーãƒãŒã‚³ãƒ³ãƒ‘イル済ã®ãƒã‚¤ãƒŠãƒªãƒ‘ッケージãªã‚‰ã°ã€ã‚½ãƒ¼ã‚¹ã‚³ãƒ¼ãƒ‰ã‚’ ダウンロードã—ã€æœ€é©åŒ–オプションを調整ã—ã¦å†ã‚³ãƒ³ãƒ‘イルã™ã‚Œã°ã™ã“ã—㯠よããªã‚‹ã‹ã‚‚ã—れã¾ã›ã‚“。 * ライセンス ライセンスã«ã¤ã„ã¦ã¯ LICENSE ファイルをã”らんãã ã•ã„。è¦ç´„ã™ã‚Œã°ã€ ライセンス㯠GPL exactly version 2 ã¾ãŸã¯ the Artistic License Version 2.0beta5 ã®ã†ã¡ã€ã‚ãªãŸãŒå¥½ããªã»ã†ã§ã™ã€‚ * 連絡先 ãƒã‚°å ±å‘Šã¾ãŸã¯æ„Ÿæƒ³ã¯å¤§åŽŸé›„é¦¬ ã¸ã©ã†ãžã€‚ tenmado ウェブページもã”らんãã ã•ã„: http://www.interq.or.jp/libra/oohara/tenmado/index.html * æ­´å² tenmado ã®æœ€åˆã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã¯ 2002 å¹´ 7 月 14 æ—¥ã«ãƒªãƒªãƒ¼ã‚¹ã•れã¾ã—ãŸã€‚ tenmado ã¯ã€Œå¤©çª“ã€ã€å±‹æ ¹ã«ã¤ã„ã¦ã„る窓をæ„味ã™ã‚‹æ—¥æœ¬èªžã§ã™ã€‚空ã«é–¢ä¿‚㌠ã‚りã€ã‹ã¤ã“ã®ãƒ—ロジェクトã«ä¸€æ„ãªå˜èªžãŒã»ã—ãã¦ã€ã“れをé¸ã³ã¾ã—ãŸã€‚ ステージデータ 「happy Lã€ã¯ L ãŒã ã‚Œã ã‹çŸ¥ã£ã¦ã„る赤井é¾å¸ã•ã‚“ã« æ§ã’られã¾ã—ãŸã€‚ã„ã„ãˆã€L ã¨ã¯ã ã‚Œãªã®ã‹èª¬æ˜Žã™ã‚‹ã¤ã‚‚りã¯ã‚りã¾ã›ã‚“。 tenmado-0.10/README-ja-sjis0000644000175000017500000001402111710767546016117 0ustar00ooharaoohara00000000000000tenmado --- ÂÔ¢ŠE‚Ìd”hƒVƒ…[ƒeƒBƒ“ƒO by ‘匴—Y”n published by Project Geeste $Id: README-ja-utf8,v 1.4 2012/01/28 12:43:10 oohara Exp $ * tenmado ‚Ƃ͉½‚© tenmado ‚̓^ƒeƒXƒNƒ[ƒ‹‚ÌA1990 ”N‘ãŒã”¼—lŽ®‚Ì (‚‚܂èA‘å—ʂ̓G’e‚ª Œ©‚½–Ú‚æ‚謂³‚ȉF’ˆ‘D‚ÉP‚¢‚©‚©‚é) ƒVƒ…[ƒeƒBƒ“ƒOƒQ[ƒ€‚Å‚·B”ñí‚É ³Šm‚È“–‚½‚è”»’è‚É‚æ‚èAŽèæ‚ÌŠí—p‚³‚ð—v‹‚³‚ê‚éƒQ[ƒ€‚ɂȂÁ‚Ä‚¢‚Ü‚·B ŽOŠpŒ`‚ÉŒ©‚¦‚é‚à‚͖̂{“–‚ÉŽOŠpŒ`‚Å‚ ‚èAŽ—‚½‘å‚«‚³‚Ì’·•ûŒ`‚ł͂ ‚è‚Ü‚¹‚ñB ‚µ‚©‚µA¶‚«Žc‚邱‚Ƃ͂±‚̃Q[ƒ€‚Ì 20% ‚Å‚µ‚©‚ ‚è‚Ü‚¹‚ñBtenmado ‚ÌŽå‚È “Á’¥‚ÍuƒJƒ‰[ƒ`ƒF[ƒ“ƒ{[ƒiƒXv‚Å‚·B“¯‚¶F‚Ì“G‚𑱂¯‚Ä”j‰ó‚·‚邱‚Ƃɂæ‚èA ”ñí‚ɑ傫‚È“¾“_ (’Êí‚Ì“G”j‰ó“_‚Ì–ñ 100 ”{‚Å‚·) ‚𓾂邱‚Æ‚ª‚Å‚«‚Ü‚·B ‚±‚ê‚Í‚ ‚È‚½‚ª‚ǂꂭ‚ç‚¢—~’£‚é‚©‚É‚æ‚Á‚ÄŠÈ’P‚ɂ࢓ï‚É‚à‚È‚è‚Ü‚·B * tenmado ‚̃Cƒ“ƒXƒg[ƒ‹•û–@ tenmado ‚̃Cƒ“ƒXƒg[ƒ‹•û–@‚ɂ‚¢‚Ä‚Í INSTALL ƒtƒ@ƒCƒ‹‚ð‚²‚ç‚ñ‚­‚¾‚³‚¢B —v–ñ‚·‚邯AlibcAlibSDL ‚¨‚æ‚Ñ libSDL_image ‚ðƒCƒ“ƒXƒg[ƒ‹‚µA 1) ./configure 2) make 3) make install ‚Æ“ü—Í‚µ‚Ä‚­‚¾‚³‚¢B‚ ‚È‚½‚ª root ‚Æ‚µ‚ăCƒ“ƒXƒg[ƒ‹‚µ‚悤‚Æ‚µ‚Ä‚¢‚é‚È‚çA ƒnƒCƒXƒRƒAƒtƒ@ƒCƒ‹‚̃p[ƒ~ƒbƒVƒ‡ƒ“‚ɂ‚¢‚Äl—¶‚µ‚Ä‚­‚¾‚³‚¢B * ƒRƒ}ƒ“ƒhƒ‰ƒCƒ“ƒIƒvƒVƒ‡ƒ“ --dump _stage_ ƒnƒCƒXƒRƒAƒf[ƒ^‚ð•W€o—͂ɑ‚«‚¾‚µ‚ÄI—¹‚µ‚Ü‚·B‚ӂ‚¤A‚»‚Ìo—Í‚ð ƒtƒ@ƒCƒ‹‚ɕۑ¶‚µ‚Ä‚¨‚«A‚ ‚Ƃł»‚̃tƒ@ƒCƒ‹‚ð --undump ‚Ì“ü—͂Ƃµ‚ÄŽg‚¢‚Ü‚·B _stage_ ‚Í 0 ‚©‚ç 5 ‚܂ł̊ԂłȂ¯‚ê‚΂Ȃè‚Ü‚¹‚ñB_stage_ ‚ª 0 ‚È‚ç ‘“¾“_‚Å‚·B_stage_ ‚ª 1 ‚©‚ç 5 ‚܂łȂçŠeƒXƒe[ƒW‚Ì“¾“_‚Å‚·B --full-screen ƒQ[ƒ€‚ðƒtƒ‹ƒXƒNƒŠ[ƒ“ƒ‚[ƒh‚ÅŽÀs‚µ‚Ü‚·B --help ƒwƒ‹ƒvƒƒbƒZ[ƒW‚ð•\ަ‚µ‚ÄI—¹‚µ‚Ü‚·B --slow ƒQ[ƒ€‚𔼕ª‚Ì‘¬“x‚ÅŽÀs‚µ‚Ü‚·B‹Zp“I‚É‚ÍAŠeƒtƒŒ[ƒ€ŠÔ‚̑҂¿ŽžŠÔ‚ª 2 ”{‚É ‚È‚è‚Ü‚·B‚±‚ê‚É‚æ‚莩‹@‚ðŠÜ‚ÞAƒQ[ƒ€’†‚Ì‚ ‚ç‚ä‚é‚à‚Ì‚ª’x‚­‚È‚è‚Ü‚·B ‚ ‚Æ‚Ì (’Ê푬“x‚Ì) ƒvƒŒƒC‚Ì‚½‚߂ɓG”z’u‚ðŒ¤‹†‚µ‚悤A‚Æ‚¢‚¤‚킯‚Å‚·B ‚±‚̃IƒvƒVƒ‡ƒ“‚ðŽg‚¤‚Æ–ñ 16 fps ‚É‚µ‚©‚È‚ç‚È‚¢‚Ì‚ÅA“®‚«‚ª‚ª‚½‚ª‚½‚É ‚Ȃ邩‚à‚µ‚ê‚Ü‚¹‚ñB‚±‚̃IƒvƒVƒ‡ƒ“‚ðŽg‚¤‚ƃnƒCƒXƒRƒAƒŠƒXƒg‚ÉÚ‚è‚Ü‚¹‚ñB --stage _stage_ ƒQ[ƒ€‚ðŽw’肳‚ꂽƒXƒe[ƒW‚©‚çŠJŽn‚µ‚Ü‚·B_stage_ ‚Í 1 ‚©‚ç 5 ‚܂ł̊ԂŠ‚È‚¯‚ê‚΂Ȃè‚Ü‚¹‚ñB‚ЂƂ‚̃Xƒe[ƒW (‚‚܂èAŽw’肵‚½ƒXƒe[ƒW) ‚µ‚© ƒvƒŒƒC‚Å‚«‚È‚¢‚±‚ÆAƒnƒCƒXƒRƒAƒŠƒXƒg‚ÉÚ‚ç‚È‚¢‚±‚ƂɒˆÓ‚µ‚Ä‚­‚¾‚³‚¢B --undump _stage_ ƒnƒCƒXƒRƒAƒf[ƒ^‚ð•W€“ü—Í‚©‚ç“ǂ݂±‚ÝA•Û‘¶‚µ‚ÄI—¹‚µ‚Ü‚·B“ü—͂͂ӂ‚¤ --dump ‚Ìo—͂ł·B_stage_ ‚Í 0 ‚©‚ç 5 ‚܂ł̊ԂłȂ¯‚ê‚΂Ȃè‚Ü‚¹‚ñB _stage_ ‚ª 0 ‚Ȃ瑓¾“_‚Å‚·B_stage_ ‚ª 1 ‚©‚ç 5 ‚܂łȂçŠeƒXƒe[ƒW‚Ì “¾“_‚Å‚·B“ÁŒ ƒ†[ƒU‚¾‚¯‚ª‚±‚̃IƒvƒVƒ‡ƒ“‚ðŽg‚¦‚Ü‚·B --undump-default ‚à‚µ‚·‚­‚È‚­‚Æ‚à‚ЂƂ‚̃nƒCƒXƒRƒAƒŠƒXƒg‚ª‹ó‚È‚ç‚ÎAƒfƒtƒHƒ‹ƒg‚̃nƒCƒXƒRƒA ƒf[ƒ^‚ð“ǂ݂±‚ÝA•Û‘¶‚µ‚ÄI—¹‚µ‚Ü‚·B‚»‚¤‚łȂ¢‚È‚çA‰½‚à‚µ‚Ü‚¹‚ñB‚±‚Ì ƒIƒvƒVƒ‡ƒ“‚ÌŽå‚È–Ú“I‚̓Cƒ“ƒXƒg[ƒ‹Žž‚Ƀp[ƒ~ƒbƒVƒ‡ƒ“‚ðÝ’è‚Å‚«‚邿‚¤‚ÉA ƒnƒCƒXƒRƒAƒf[ƒ^ƒx[ƒX‚ð쬂·‚邱‚Ƃł·B --version ƒo[ƒWƒ‡ƒ“î•ñAƒ‰ƒCƒZƒ“ƒXî•ñ‚¨‚æ‚Ñ–ÆÓð€‚ð•\ަ‚µ‚ÄI—¹‚µ‚Ü‚·B * ƒL[‘€ì ƒJ[ƒ\ƒ‹ƒL[ ˆÚ“® ƒXƒy[ƒX ŽËŒ‚ (Ž©“®˜AŽË) ESC I—¹ p ƒ|[ƒY / ÄŠJ ƒWƒ‡ƒCƒXƒeƒBƒbƒN‚ňړ®‚¨‚æ‚ÑŽËŒ‚‚ðs‚¤‚±‚Æ‚à‚Å‚«‚Ü‚·Btenmado ‚Ì‹N“®‘O‚É ƒWƒ‡ƒCƒXƒeƒBƒbƒN‚ðÚ‘±‚µ‚Ä‚¨‚­•K—v‚ª‚ ‚邱‚ƂɒˆÓ‚µ‚Ä‚­‚¾‚³‚¢B ƒ}ƒEƒXƒJ[ƒ\ƒ‹‚ªƒEƒBƒ“ƒhƒE‚ÌŠO‚Éo‚邯ƒQ[ƒ€‚ªƒ|[ƒYó‘ԂɂȂè‚Ü‚·B ‚±‚ê‚É‚æ‚èAƒEƒBƒ“ƒhƒE‚ɃtƒH[ƒJƒX‚ª‚ ‚Á‚Ä‚¢‚È‚¢‚Æ‚«‚ÉŽ©‹@‚ª“|‚³‚ê‚邱‚Æ‚ª –h‚°‚Ü‚·B * Ž©‹@‚Ì•Ší‚¨‚æ‚ÑŽ©‹@ Ž©‹@‚Ì’e‚Íi‚ނɂ‚ê‚Ä•‚­‚È‚è‚Ü‚·B•‚¢’e‚Í 1 ƒ_ƒ[ƒW‚ð—^‚¦‚Ü‚·B (ƒEƒBƒ“ƒhƒE¶ã‚̃qƒbƒgî•ñ‚ð‚²‚ç‚ñ‚­‚¾‚³‚¢B) •‚­‚È‚¢’e‚Í 2 ƒ_ƒ[ƒW‚ð —^‚¦‚Ü‚·B“G‚ð‚͂₭”j‰ó‚µ‚½‚¢‚È‚çA‚»‚Ì“G‚ÉÚ‹ß‚µ‚ÄA’e‚ª•‚­‚È‚é‘O‚É “–‚Ă邿‚¤‚É‚µ‚Ä‚­‚¾‚³‚¢B Ž©‹@‚ª“G’eA“G–{‘̂܂½‚͉½‚ç‚©‚ÌáŠQ•¨‚ÉÚG‚·‚邯AŽ©‹@‚Í”j‰ó‚³‚ê‚Ü‚·B Žc‚莩‹@‚ª‚È‚¢‚È‚çƒQ[ƒ€ƒI[ƒo[‚Å‚·BŽ©‹@’†‰›‚Ì•ŠÛ•”•ª‚¾‚¯‚ªŽã“_‚Å‚·B ‚»‚êˆÈŠO‚Ì•”•ª‚͈À‘S‚Å‚·B * “G‚ÌF‚¨‚æ‚уJƒ‰[ƒ`ƒF[ƒ“ƒ{[ƒiƒX “¯‚¶F‚Ì“G‚𑱂¯‚Ä”j‰ó‚·‚邱‚Ƃɂæ‚èƒ{[ƒiƒX“¾“_‚𓾂邱‚Æ‚ª‚Å‚«‚Ü‚·B ‚±‚ê‚ðuƒJƒ‰[ƒ`ƒF[ƒ“ƒ{[ƒiƒXv‚ƌĂт܂·B(ƒEƒBƒ“ƒhƒE‰Eã‚̃`ƒF[ƒ“ î•ñ‚ð‚²‚ç‚ñ‚­‚¾‚³‚¢B) ƒJƒ‰[ƒ`ƒF[ƒ“ƒ{[ƒiƒX‚𓾂邽‚߂ɂǂÌF‚Ì“G‚ð “|‚¹‚΂¢‚¢‚©‚ÍŽ©‹@‚ÌF‚ªŽ¦‚µ‚Ä‚¢‚Ü‚·B ƒ`ƒF[ƒ“” ƒ{[ƒiƒX“¾“_ 1 1 2 2 3 4 4 8 5 16 6 32 7 64 8 128 9 256 10 512 11+ 1024 “G‚ÌF‚Í 4 F --- ÂAÔAއ‚»‚µ‚ė΂ł·B‚ÆÔ‚ªŠî–{‚ÌF‚Å‚·Bއ‚Í“Á•ʂł· --- ’¼‘O‚É”j‰ó‚µ‚½“G‚ÌF‚ª‰½‚Å‚ ‚êAއF‚Ì“G‚ð”j‰ó‚µ‚½‚Æ‚«‚É‚Íí‚ɃJƒ‰[ ƒ`ƒF[ƒ“ƒ{[ƒiƒX‚ª‚‚«‚Ü‚·B‚Ü‚½’¼‘O‚É”j‰ó‚µ‚½“G‚ÌF‚ªŽ‡F‚È‚ç‚ÎA‚Ç‚ÌF‚Ì “G‚ð”j‰ó‚µ‚Ä‚àƒJƒ‰[ƒ`ƒF[ƒ“ƒ{[ƒiƒX‚ª‚‚«‚Ü‚·B—ÎF‚Ì“G‚Í”j‰ó‚Å‚«‚Ü‚¹‚ñB * ƒXƒe[ƒW‚¨‚æ‚ÑŽc‹@ƒ{[ƒiƒX ‚±‚̃Q[ƒ€‚Í‘S 5 –ʂł·BŠeƒXƒe[ƒWÅŒã‚É“oê‚·‚éƒ{ƒX‚ð”j‰ó‚·‚ê‚ÎAŽŸ‚Ì ƒXƒe[ƒW‚Öi‚߂܂·B‘S–ʃNƒŠƒA‚Å‚«‚ê‚ÎAŽc‚Á‚Ä‚¢‚é (–¢Žg—p‚Ì) Ž©‹@‚Í Še 3 –œ“_‚ɂȂè‚Ü‚·B20 –œ“_‚²‚ƂɎ©‹@‚ª 1 ‹@‘‚¦‚Ü‚·B * ƒQ[ƒ€‚ª’x‚·‚¬‚éê‡ ‚æ‚¢ CPU ‚ª‚È‚¢‚Æ tenmado ‚Í‹ê’ɂȂقǒx‚­‚Ȃ邩‚à‚µ‚ê‚Ü‚¹‚ñ (Pentium 4 ˆÈã‚ð„§‚µ‚Ü‚·)B‚±‚Ìê‡Atop(1) ‚ðŽg‚Á‚ĉ½‚ª CPU ŽžŠÔ‚ðÁ”‚Ä‚¢‚é‚© ’²‚ׂĂ­‚¾‚³‚¢B‚ӂ‚¤‚Í X Window System ‚Å‚·B‰æ–Ê‚ÌF[“x‚ð (16 ‚Ü‚½‚Í 8 bpp ‚É) Œ¸‚炵‚Ä X ƒT[ƒo‚ðÄ‹N“®‚·‚邯ƒpƒtƒH[ƒ}ƒ“ƒX‚ª‘啂ɉü‘P‚³‚ê‚Ü‚·B ‚à‚µ‚ ‚È‚½‚Ì X ƒT[ƒo‚ªƒRƒ“ƒpƒCƒ‹Ï‚̃oƒCƒiƒŠƒpƒbƒP[ƒW‚È‚ç‚ÎAƒ\[ƒXƒR[ƒh‚ð ƒ_ƒEƒ“ƒ[ƒh‚µAÅ“K‰»ƒIƒvƒVƒ‡ƒ“‚ð’²®‚µ‚ÄăRƒ“ƒpƒCƒ‹‚·‚ê‚΂·‚±‚µ‚Í ‚æ‚­‚Ȃ邩‚à‚µ‚ê‚Ü‚¹‚ñB * ƒ‰ƒCƒZƒ“ƒX ƒ‰ƒCƒZƒ“ƒX‚ɂ‚¢‚Ä‚Í LICENSE ƒtƒ@ƒCƒ‹‚ð‚²‚ç‚ñ‚­‚¾‚³‚¢B—v–ñ‚·‚ê‚ÎA ƒ‰ƒCƒZƒ“ƒX‚Í GPL exactly version 2 ‚Ü‚½‚Í the Artistic License Version 2.0beta5 ‚Ì‚¤‚¿A‚ ‚È‚½‚ªD‚«‚Ȃق¤‚Å‚·B * ˜A—æ ƒoƒO•ñ‚Ü‚½‚ÍŠ´‘z‚͑匴—Y”n ‚Ö‚Ç‚¤‚¼B tenmado ƒEƒFƒuƒy[ƒW‚à‚²‚ç‚ñ‚­‚¾‚³‚¢: http://www.interq.or.jp/libra/oohara/tenmado/index.html * —ðŽj tenmado ‚Ìʼn‚̃o[ƒWƒ‡ƒ“‚Í 2002 ”N 7 ŒŽ 14 “ú‚ÉƒŠƒŠ[ƒX‚³‚ê‚Ü‚µ‚½B tenmado ‚Íu“V‘‹vA‰®ª‚ɂ‚¢‚Ä‚¢‚é‘‹‚ðˆÓ–¡‚·‚é“ú–{Œê‚Å‚·B‹ó‚ÉŠÖŒW‚ª ‚ ‚èA‚©‚‚±‚̃vƒƒWƒFƒNƒg‚ɈêˆÓ‚È’PŒê‚ª‚Ù‚µ‚­‚ÄA‚±‚ê‚ð‘I‚т܂µ‚½B ƒXƒe[ƒWƒf[ƒ^ uhappy Lv‚Í L ‚ª‚¾‚ꂾ‚©’m‚Á‚Ä‚¢‚éԈ䗴Ži‚³‚ñ‚É •ù‚°‚ç‚ê‚Ü‚µ‚½B‚¢‚¢‚¦AL ‚Ƃ͂¾‚ê‚Ȃ̂©à–¾‚·‚é‚‚à‚è‚Í‚ ‚è‚Ü‚¹‚ñB tenmado-0.10/happy-L/0000777000175000017500000000000011711666006015207 5ustar00ooharaoohara00000000000000tenmado-0.10/happy-L/Makefile.am0000644000175000017500000000452011710770257017243 0ustar00ooharaoohara00000000000000## Makefile.am for tenmado/happy-L ## process this file with automake --foreign to generate Makefile.in ## automake version 1.11 is required # $Id: Makefile.am,v 1.56 2012/01/28 12:57:19 oohara Exp $ SUBDIRS = default image noinst_LIBRARIES = libhappy-L.a libhappy_L_a_SOURCES = balloon.c \ balloon.h \ close-system.c \ close-system.h \ disconnection.c \ disconnection.h \ ending.c \ ending.h \ explosion.c \ explosion.h \ fud.c \ fud.h \ high-score.c \ high-score.h \ image.c \ image.h \ intuition.c \ intuition.h \ laser.c \ laser.h \ last-boss.c \ last-boss.h \ message.c \ message.h \ midnight.c \ midnight.h \ normal-enemy.c \ normal-enemy.h \ normal-shot.c \ normal-shot.h \ overrun.c \ overrun.h \ player-shot.c \ player-shot.h \ player.c \ player.h \ result.c \ result.h \ rotate-laser.c \ rotate-laser.h \ scheduler.c \ scheduler.h \ solution.c \ solution.h \ stage-1.c \ stage-1.h \ stage-2.c \ stage-2.h \ stage-3.c \ stage-3.h \ stage-4.c \ stage-4.h \ stage-5.c \ stage-5.h \ stage-clear.c \ stage-clear.h \ title.c \ title.h \ tutorial.c \ tutorial.h \ wall.c \ wall.h #CC_WARNINGS = -Wall # the overkill warnings # I don't use -Wtraditional because I use string concatenation # use -Wno-long-long because -pedantic implies -Wlong-long CC_WARNINGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -Winline -pedantic -Wno-long-long # let's hardcode SDL flags here SDL_CFLAGS=`sdl-config --cflags` # sdl-config --libs is added to LIBS in configure # -g -O2 are in CFLAGS by default, don't use @CFLAGS@ here AM_CFLAGS = $(SDL_CFLAGS) $(CC_WARNINGS) AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" \ -DLOCALSTATEDIR=\"$(localstatedir)\" \ -I$(top_srcdir) \ -I$(top_srcdir)/libbac \ -I$(top_srcdir)/libtenm # I don't know why libhappy_L_a_LIBADD = $(top_srcdir)/libbac/libbac.a \ # $(top_srcdir)/libtenm/libtenm.a doesn't work # install-exec is the right thing for the high score database # because $(localstatedir) can't be shared install-exec-local: $(mkinstalldirs) $(DESTDIR)$(localstatedir)/games/tenmado/ uninstall-local: -rm -f $(DESTDIR)$(localstatedir)/games/tenmado/* -rmdir $(DESTDIR)$(localstatedir)/games/tenmado/ tenmado-0.10/happy-L/Makefile.in0000644000175000017500000005500511711665645017265 0ustar00ooharaoohara00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # $Id: Makefile.am,v 1.56 2012/01/28 12:57:19 oohara Exp $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : subdir = happy-L DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libhappy_L_a_AR = $(AR) $(ARFLAGS) libhappy_L_a_LIBADD = am_libhappy_L_a_OBJECTS = balloon.$(OBJEXT) close-system.$(OBJEXT) \ disconnection.$(OBJEXT) ending.$(OBJEXT) explosion.$(OBJEXT) \ fud.$(OBJEXT) high-score.$(OBJEXT) image.$(OBJEXT) \ intuition.$(OBJEXT) laser.$(OBJEXT) last-boss.$(OBJEXT) \ message.$(OBJEXT) midnight.$(OBJEXT) normal-enemy.$(OBJEXT) \ normal-shot.$(OBJEXT) overrun.$(OBJEXT) player-shot.$(OBJEXT) \ player.$(OBJEXT) result.$(OBJEXT) rotate-laser.$(OBJEXT) \ scheduler.$(OBJEXT) solution.$(OBJEXT) stage-1.$(OBJEXT) \ stage-2.$(OBJEXT) stage-3.$(OBJEXT) stage-4.$(OBJEXT) \ stage-5.$(OBJEXT) stage-clear.$(OBJEXT) title.$(OBJEXT) \ tutorial.$(OBJEXT) wall.$(OBJEXT) libhappy_L_a_OBJECTS = $(am_libhappy_L_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libhappy_L_a_SOURCES) DIST_SOURCES = $(libhappy_L_a_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ distdir ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = default image noinst_LIBRARIES = libhappy-L.a libhappy_L_a_SOURCES = balloon.c \ balloon.h \ close-system.c \ close-system.h \ disconnection.c \ disconnection.h \ ending.c \ ending.h \ explosion.c \ explosion.h \ fud.c \ fud.h \ high-score.c \ high-score.h \ image.c \ image.h \ intuition.c \ intuition.h \ laser.c \ laser.h \ last-boss.c \ last-boss.h \ message.c \ message.h \ midnight.c \ midnight.h \ normal-enemy.c \ normal-enemy.h \ normal-shot.c \ normal-shot.h \ overrun.c \ overrun.h \ player-shot.c \ player-shot.h \ player.c \ player.h \ result.c \ result.h \ rotate-laser.c \ rotate-laser.h \ scheduler.c \ scheduler.h \ solution.c \ solution.h \ stage-1.c \ stage-1.h \ stage-2.c \ stage-2.h \ stage-3.c \ stage-3.h \ stage-4.c \ stage-4.h \ stage-5.c \ stage-5.h \ stage-clear.c \ stage-clear.h \ title.c \ title.h \ tutorial.c \ tutorial.h \ wall.c \ wall.h #CC_WARNINGS = -Wall # the overkill warnings # I don't use -Wtraditional because I use string concatenation # use -Wno-long-long because -pedantic implies -Wlong-long CC_WARNINGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -Winline -pedantic -Wno-long-long # let's hardcode SDL flags here SDL_CFLAGS = `sdl-config --cflags` # sdl-config --libs is added to LIBS in configure # -g -O2 are in CFLAGS by default, don't use @CFLAGS@ here AM_CFLAGS = $(SDL_CFLAGS) $(CC_WARNINGS) AM_CPPFLAGS = -DDATADIR=\"$(datadir)\" \ -DLOCALSTATEDIR=\"$(localstatedir)\" \ -I$(top_srcdir) \ -I$(top_srcdir)/libbac \ -I$(top_srcdir)/libtenm all: all-recursive .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign happy-L/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign happy-L/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 $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libhappy-L.a: $(libhappy_L_a_OBJECTS) $(libhappy_L_a_DEPENDENCIES) -rm -f libhappy-L.a $(libhappy_L_a_AR) libhappy-L.a $(libhappy_L_a_OBJECTS) $(libhappy_L_a_LIBADD) $(RANLIB) libhappy-L.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/balloon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close-system.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disconnection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ending.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/explosion.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fud.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/high-score.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intuition.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/laser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/last-boss.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/message.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midnight.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/normal-enemy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/normal-shot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/overrun.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player-shot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/player.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/result.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rotate-laser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scheduler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/solution.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage-1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage-2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage-3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage-4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage-5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stage-clear.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/title.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tutorial.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wall.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` # 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; \ ($(am__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" $(RECURSIVE_CLEAN_TARGETS): @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; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || ($(am__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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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 || \ set "$$@" "$$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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile $(LIBRARIES) 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 clean-noinstLIBRARIES mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-exec-local install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-local .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ install-am install-strip tags-recursive .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES ctags ctags-recursive 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-dvi install-dvi-am \ install-exec install-exec-am install-exec-local install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-local # I don't know why libhappy_L_a_LIBADD = $(top_srcdir)/libbac/libbac.a \ # $(top_srcdir)/libtenm/libtenm.a doesn't work # install-exec is the right thing for the high score database # because $(localstatedir) can't be shared install-exec-local: $(mkinstalldirs) $(DESTDIR)$(localstatedir)/games/tenmado/ uninstall-local: -rm -f $(DESTDIR)$(localstatedir)/games/tenmado/* -rmdir $(DESTDIR)$(localstatedir)/games/tenmado/ # 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: tenmado-0.10/happy-L/balloon.c0000644000175000017500000000753010276702754017010 0ustar00ooharaoohara00000000000000/* $Id: balloon.c,v 1.11 2002/06/22 09:44:42 oohara Exp $ */ #include /* malloc */ #include #include "tenm_primitive.h" #include "tenm_object.h" #include "const.h" #include "tenm_table.h" #include "tenm_graphic.h" #include "util.h" #include "balloon.h" static int balloon_move(tenm_object *my, double turn_per_frame); static int balloon_act(tenm_object *my, const tenm_object *player); static int balloon_draw(tenm_object *my, int priority); tenm_object * balloon_new(double x, double radius, double speed_y, double speed_r, int time_swell, int time_swell_initial, int time_wait) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double y = 1.0 - radius; /* sanity check */ if (radius <= 0.0) return NULL; if (time_swell <= 0) return NULL; if (time_wait < 0) return NULL; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "balloon_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, radius); if (p[0] == NULL) { fprintf(stderr, "balloon_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 3); if (count == NULL) { fprintf(stderr, "balloon_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 3); if (count_d == NULL) { fprintf(stderr, "balloon_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] timer * [1] time_swell * [2] time_wait */ /* list of count_d * [0] speed y * [1] current speed r * [2] speed r (for calculating count_d[1]) */ count[0] = time_swell_initial; count[1] = time_swell; count[2] = time_wait; count_d[0] = speed_y; count_d[1] = speed_r; count_d[2] = speed_r * (-1.0); new = tenm_object_new("balloon", ATTR_OBSTACLE | ATTR_OPAQUE, 0, 1, x, y, 3, count, 3, count_d, 1, p, (int (*)(tenm_object *, double)) balloon_move, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) balloon_act, (int (*)(tenm_object *, int)) balloon_draw); if (new == NULL) { fprintf(stderr, "balloon_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int balloon_move(tenm_object *my, double turn_per_frame) { double dy_temp; double dr_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dy_temp = my->count_d[0] / turn_per_frame; dr_temp = my->count_d[1] / turn_per_frame; my->y += dy_temp; tenm_move_mass(my->mass, 0.0, dy_temp); ((tenm_circle *) my->mass->p[0])->r += dr_temp; if (!in_window_object(my)) return 1; return 0; } static int balloon_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; (my->count[0])++; if (my->count[0] >= my->count[1] + my->count[2]) { my->count[0] = 0; my->count_d[1] = my->count_d[2]; my->count_d[2] *= -1.0; } else if (my->count[0] >= my->count[1]) { my->count_d[1] = 0.0; } return 0; } static int balloon_draw(tenm_object *my, int priority) { tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 0) return 0; color = tenm_map_color(59, 156, 71); if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "balloon_draw: tenm_draw_mass failed\n"); return 1; } return 0; } tenmado-0.10/happy-L/balloon.h0000644000175000017500000000056410276702754017015 0ustar00ooharaoohara00000000000000/* $Id: balloon.h,v 1.4 2002/06/21 20:19:59 oohara Exp $ */ #ifndef __TENMADO_BALLOON_H__ #define __TENMADO_BALLOON_H__ #include "tenm_object.h" tenm_object *balloon_new(double x, double radius, double speed_y, double speed_r, int time_swell, int time_swell_initial, int time_wait); #endif /* __TENMADO_BALLOON_H__ */ tenmado-0.10/happy-L/close-system.c0000644000175000017500000002501211711142273017771 0ustar00ooharaoohara00000000000000/* $Id: close-system.c,v 1.101 2012/01/29 04:02:03 oohara Exp $ */ /* the close system * I heard it is a alchemy term (or is it "the close principle"?) */ #include /* malloc */ #include #include "tenm_primitive.h" #include "tenm_object.h" #include "const.h" #include "tenm_table.h" #include "tenm_graphic.h" #include "util.h" #include "laser.h" #include "normal-enemy.h" #include "close-system.h" static double close_system_scroll_total(int t); static double close_system_scroll_speed(int t); static int close_system_wall_move(tenm_object *my, double turn_per_frame); static int close_system_wall_act(tenm_object *my, const tenm_object *player); static int close_system_wall_draw(tenm_object *my, int priority); static double close_system_scroll_total(int t) { double total; if (t < 75) total = 3.0 * ((double) t); else if (t < 2770) total = 225.0 + 0.1 * ((double) (t - 75)); else if (t < 3800) total = 494.5; else if (t < 5075) total = 494.5 + 0.1 * ((double) (t - 3800)); else total = 622.0 + 3.0 * ((double) (t - 5075)); return total; } static double close_system_scroll_speed(int t) { return close_system_scroll_total(t + 1) - close_system_scroll_total(t); } tenm_object * close_system_wall_new(int n) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double x; double y; /* sanity check */ if ((n < 0) || (n > 3)) { fprintf(stderr, "close_system_wall_new: strange n (%d)\n", n); return NULL; } if (n == 0) { x = 324.0; y = -29.0; } else if (n == 1) { x = 36.0; y = -149.0; } else if (n == 2) { x = 156.0; y = -437.0; } else { x = 444.0; y = -317.0; } p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "close_system_wall_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_polygon_new(4, x - 30.0, y - 30.0, x - 30.0, y + 30.0, x + 30.0, y + 30.0, x + 30.0, y - 30.0); if (p[0] == NULL) { fprintf(stderr, "close_system_wall_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 7); if (count == NULL) { fprintf(stderr, "close_system_wall_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "close_system_wall_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] n * [1] total timer * [2] move direction * [3] move timer * [4] shoot theta * [5] shoot timer * [6] shoot cycle */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = n; count[1] = 0; count[2] = (n + 3) % 4; count[3] = 60; switch (n) { case 0: count[4] = 90; break; case 1: count[4] = 315; break; case 2: count[4] = 270; break; case 3: count[4] = 135; break; default: fprintf(stderr, "close_system_wall_new: strange n when setting " "count[4] (%d)\n", n); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; break; } count[5] = 0; count[6] = 7; count_d[0] = 0.0; count_d[1] = 0.0; /* scroll */ count_d[1] += close_system_scroll_speed(0); new = tenm_object_new("close system wall", ATTR_OBSTACLE | ATTR_OPAQUE, 0, 1, x, y, 7, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) close_system_wall_move, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) close_system_wall_act, (int (*)(tenm_object *, int)) close_system_wall_draw); if (new == NULL) { fprintf(stderr, "close_system_wall_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int close_system_wall_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->count[1] >= 5075) && (!in_window_object(my))) return 1; return 0; } static int close_system_wall_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; (my->count[1])++; if ((my->count[1] >= 2800) && (my->count[1] < 3280)) { /* move direction change */ (my->count[3])++; if (my->count[3] >= 60) { my->count[3] = 0; (my->count[2])++; if (my->count[2] > 3) my->count[2] = 0; } switch (my->count[2]) { case 0: my->count_d[0] = -4.8; my->count_d[1] = -2.0; break; case 1: my->count_d[0] = 2.0; my->count_d[1] = -4.8; break; case 2: my->count_d[0] = 4.8; my->count_d[1] = 2.0; break; case 3: my->count_d[0] = -2.0; my->count_d[1] = 4.8; break; default: fprintf(stderr, "close_system_wall_act: strange move direction (%d)\n", my->count[2]); break; } } else { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } /* scroll */ my->count_d[1] += close_system_scroll_speed(my->count[1]); /* shoot cycle change */ if (my->count[1] == 2770) { my->count[6] = 1000; } else if (my->count[1] == 2800) { my->count[5] = 0; my->count[6] = 4; } else if (my->count[1] == 3280) { my->count[6] = 1000; } else if (my->count[1] == 3330) { my->count[5] = 0; my->count[6] = 3; } else if (my->count[1] == 3465) { my->count[5] = 0; my->count[6] = 7; } else if (my->count[1] == 3758) { my->count[5] = 0; my->count[6] = 1000; } else if (my->count[1] == 3800) { my->count[5] = 0; /* 4 is too difficult for me */ my->count[6] = 5; } /* reset shoot direction */ if ((my->count[1] == 2800) || (my->count[1] == 3800)) { switch (my->count[0]) { case 0: my->count[4] = 90; break; case 1: my->count[4] = 315; break; case 2: my->count[4] = 270; break; case 3: my->count[4] = 135; break; default: fprintf(stderr, "close_system_wall_act: strange count[0] (%d)\n", my->count[0]); break; } } else if (my->count[1] == 3330) { switch (my->count[0]) { case 0: my->count[4] = 90; break; case 1: my->count[4] = 180; break; case 2: my->count[4] = 270; break; case 3: my->count[4] = 0; break; default: fprintf(stderr, "close_system_wall_act: strange count[0] (%d)\n", my->count[0]); break; } } /* shoot */ (my->count[5])++; if (my->count[5] >= my->count[6]) { my->count[5] = 0; tenm_table_add(laser_angle_new(my->x, my->y, 7.0, my->count[4], 25.0, COLOR_GREEN, 1000)); if ((my->count[1] < 3330) || (my->count[1] >= 3800)) { if (my->count[0] % 2 == 0) my->count[4] += 10; else my->count[4] -= 10; } else if (my->count[1] < 3465) { my->count[4] += 3; } if (my->count[4] >= 360) my->count[4] -= 360; else if (my->count[4] < 0) my->count[4] += 360; } return 0; } static int close_system_wall_draw(tenm_object *my, int priority) { tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 0) return 0; color = tenm_map_color(59, 156, 71); if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "close_system_wall_draw: tenm_draw_mass failed\n"); return 1; } return 0; } tenm_object * close_system_ball_new(int t, int n, int direction, int time_shoot, int color) { double x; double y; double dx; double dy; if ((direction != CLOSE_SYSTEM_VERTICAL_FORWARD) && (direction != CLOSE_SYSTEM_VERTICAL_BACKWARD) && (direction != CLOSE_SYSTEM_HORIZONTAL_FORWARD) && (direction != CLOSE_SYSTEM_HORIZONTAL_BACKWARD)) { fprintf(stderr, "close_system_ball_new: strange direction (%d)\n", direction); return NULL; } if ((direction == CLOSE_SYSTEM_VERTICAL_FORWARD) || (direction == CLOSE_SYSTEM_VERTICAL_BACKWARD)) { x = (close_system_scroll_total(t) - 377.0) * 5.0 / 12.0 + 10.0; if (n == -2) { x += 50.0; } else if (n == -1) { x += 204.0; } else if (n == 0) { x += 300.0; } else if (n == 1) { x += 396.0; } else if (n == 2) { x += 550.0; } else { fprintf(stderr, "close_system_ball_new: strange n (%d)\n", n); return NULL; } y = -24.0; dx = -1.0; dy = 2.4; if (direction == CLOSE_SYSTEM_VERTICAL_BACKWARD) { x -= 285.0; y += 688.0; dx *= -1.0; dy *= -1.0; } } else { y = close_system_scroll_total(t) - 50.0; if (n == -2) { y -= 573.0; } else if (n == -1) { y -= 389.0; } else if (n == 0) { y -= 293.0; } else if (n == 1) { y -= 197.0; } else if (n == 2) { y -= 13.0; } else { fprintf(stderr, "close_system_ball_new: strange n (%d)\n", n); return NULL; } x = -24.0; dx = 2.4; dy = 1.0; if (direction == CLOSE_SYSTEM_HORIZONTAL_BACKWARD) { x += 528.0; y += 220.0; dx *= -1.0; dy *= -1.0; } } /* scroll */ dy += close_system_scroll_speed(t); return normal_enemy_new(x, y, NORMAL_BALL_LARGE, 0, color, 270, -1, -1, 1, 1, /* move 0 */ 1000, dx, dy, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, time_shoot, 0, 50, 0); } tenmado-0.10/happy-L/close-system.h0000644000175000017500000000111210276702754020004 0ustar00ooharaoohara00000000000000/* $Id: close-system.h,v 1.6 2002/07/05 00:55:34 oohara Exp $ */ #ifndef __TENMADO_CLOSE_SYSTEM_H__ #define __TENMADO_CLOSE_SYSTEM_H__ #include "tenm_object.h" /* close_system_ball_new direction */ #define CLOSE_SYSTEM_VERTICAL_FORWARD 1 #define CLOSE_SYSTEM_VERTICAL_BACKWARD -1 #define CLOSE_SYSTEM_HORIZONTAL_FORWARD 2 #define CLOSE_SYSTEM_HORIZONTAL_BACKWARD -2 tenm_object *close_system_wall_new(int n); tenm_object *close_system_ball_new(int t, int n, int direction, int time_shoot, int color); #endif /* not __TENMADO_CLOSE_SYSTEM_H__ */ tenmado-0.10/happy-L/disconnection.c0000644000175000017500000007720710276702754020231 0ustar00ooharaoohara00000000000000/* $Id: disconnection.c,v 1.152 2003/08/22 05:03:44 oohara Exp $ */ #include /* malloc, rand */ #include /* strcmp */ #include #include "tenm_primitive.h" #include "tenm_object.h" #include "const.h" #include "tenm_table.h" #include "stage-clear.h" #include "score.h" #include "tenm_graphic.h" #include "hit-status.h" #include "explosion.h" #include "chain.h" #include "util.h" #include "normal-shot.h" #include "laser.h" #include "tenm_math.h" #include "image.h" #include "disconnection.h" #define DISCONNECTION_CENTER_X ((double) WINDOW_WIDTH) / 2.0 #define DISCONNECTION_CENTER_Y 130.0 #define DISCONNECTION_CORE_HIT_POINT 750 static int disconnection_act(tenm_object *my, const tenm_object *player); static int disconnection_signal_to_shroud(tenm_object *my, int n); static int disconnection_signal_to_bit(tenm_object *my, int n); static tenm_object *disconnection_core_new(int parent_index); static int disconnection_core_move(tenm_object *my, double turn_per_frame); static int disconnection_core_hit(tenm_object *my, tenm_object *your); static int disconnection_core_signal(tenm_object *my, int n); static int disconnection_core_act(tenm_object *my, const tenm_object *player); static int disconnection_core_draw(tenm_object *my, int priority); static tenm_object *disconnection_shroud_new(int parent_index, int n); static int disconnection_shroud_hit_point(int n); static int disconnection_shroud_move(tenm_object *my, double turn_per_frame); static int disconnection_shroud_hit(tenm_object *my, tenm_object *your); static int disconnection_shroud_explosion(const tenm_object *my); static int disconnection_shroud_signal(tenm_object *my, int n); static int disconnection_shroud_act(tenm_object *my, const tenm_object *player); static int disconnection_shroud_draw(tenm_object *my, int priority); static tenm_object * disconnection_bit_new(int parent_index, int n); static int disconnection_bit_move(tenm_object *my, double turn_per_frame); static int disconnection_bit_act(tenm_object *my, const tenm_object *player); static int disconnection_bit_draw(tenm_object *my, int priority); tenm_object * disconnection_new(void) { int i; tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 7); if (count == NULL) { fprintf(stderr, "disconnection_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] timer * [1] mode * [2 -- 3] bit index * [4 -- 6] shroud index */ count[0] = 0; count[1] = 0; for (i = 2; i <= 6; i++) count[i] = -1; new = tenm_object_new("Disconnection manager", 0, 0, 0, 0.0, 0.0, 7, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) disconnection_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "disconnection_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int disconnection_act(tenm_object *my, const tenm_object *player) { int i; /* sanity check */ if (my == NULL) return 0; if (my->count[1] == 0) { if (my->count[0] == 0) { for (i = 0; i < 2; i++) { my->count[i + 2] = tenm_table_add(disconnection_bit_new(my->table_index, i)); if (my->count[i + 2] < 0) fprintf(stderr, "disconnection_act: cannot create bit (%d) " "(%d, %d)\n", i, my->count[1], my->count[0]); } } else if (my->count[0] == 100) { for (i = 0; i < 3; i++) { my->count[i + 4] = tenm_table_add(disconnection_shroud_new(my->table_index, i)); if (my->count[i + 4] < 0) fprintf(stderr, "disconnection_act: cannot create shroud (%d) " "(%d, %d)\n", i, my->count[1], my->count[0]); } if (tenm_table_add(disconnection_core_new(my->table_index)) < 0) fprintf(stderr, "disconnection_act: cannot create core " "(%d, %d)\n", my->count[1], my->count[0]); my->count[1] = 1; } (my->count[0])++; } return 0; } static int disconnection_signal_to_shroud(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if ((strcmp(my->name, "Disconnection front shroud") != 0) && (strcmp(my->name, "Disconnection side shroud") != 0)) return 0; /* don't modify my->attr or my->hit_mask here, or the player shot * may fly through the enemy */ if (my->mass != NULL) tenm_mass_delete(my->mass); my->mass = NULL; my->count[1] = 0; my->count[4] = 2; return 0; } static int disconnection_signal_to_bit(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "Disconnection bit") != 0) return 0; /* don't modify my->attr or my->hit_mask here, or the player shot * may fly through the enemy */ if (my->mass != NULL) tenm_mass_delete(my->mass); my->mass = NULL; my->count[1] = 0; my->count[2] = 4; my->count_d[0] = 0.0; my->count_d[1] = 0.0; return 0; } static tenm_object * disconnection_core_new(int parent_index) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; int hit_point = DISCONNECTION_CORE_HIT_POINT; double x = DISCONNECTION_CENTER_X; double y = -123.0; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "disconnection_core_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 35.0); if (p[0] == NULL) { fprintf(stderr, "disconnection_core_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "disconnection_core_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "disconnection_core_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] table index of parent (Disconnection manager) * [1] timer * [2] mode * [3] "damaged" flag */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = parent_index; count[1] = 0; count[2] = -1; count[3] = 0; count_d[0] = (DISCONNECTION_CENTER_X - x) / 50.0; count_d[1] = (DISCONNECTION_CENTER_Y - y) / 50.0; new = tenm_object_new("Disconnection", ATTR_ENEMY, ATTR_PLAYER_SHOT, hit_point, x, y, 4, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) disconnection_core_move, (int (*)(tenm_object *, tenm_object *)) disconnection_core_hit, (int (*)(tenm_object *, const tenm_object *)) disconnection_core_act, (int (*)(tenm_object *, int)) disconnection_core_draw); if (new == NULL) { fprintf(stderr, "disconnection_core_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int disconnection_core_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->count[2] != -1) && (my->mass != NULL) && (!in_window_object(my))) { fprintf(stderr, "disconnection_core_move: the object is out of " "the window\n"); return 1; } return 0; } static int disconnection_core_hit(tenm_object *my, tenm_object *your) { /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (your->attr != ATTR_PLAYER_SHOT) return 0; /* immutable time */ if (my->count[2] == -1) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[3] = 1; set_hit_status(my->name, DISCONNECTION_CORE_HIT_POINT, my->hit_point); if (my->hit_point <= 0) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 2000, COLOR_PURPLE, 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 500, COLOR_PURPLE, 6.0, 12)); add_killed(COLOR_PURPLE); add_score(20000); tenm_table_apply_all((int (*)(tenm_object *, int)) delete_enemy_shot, 0); /* don't modify my->attr or my->hit_mask here, or the player shot * may fly through the enemy */ if (my->mass != NULL) tenm_mass_delete(my->mass); my->mass = NULL; my->count[1] = 0; my->count[2] = 1; my->count_d[0] = 0.0; my->count_d[1] = 0.5; tenm_table_apply(my->count[0], (int (*)(tenm_object *, int)) disconnection_core_signal, 0); return 0; } return 0; } static int disconnection_core_signal(tenm_object *my, int n) { int i; /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "Disconnection manager") != 0) return 0; my->count[1] = 1; for (i = 0; i < 2; i++) { if (my->count[i + 2] >= 0) { tenm_table_apply(my->count[i + 2], (int (*)(tenm_object *, int)) disconnection_signal_to_bit, 0); } } for (i = 0; i < 3; i++) { if (my->count[i + 4] >= 0) { tenm_table_apply(my->count[i + 4], (int (*)(tenm_object *, int)) disconnection_signal_to_shroud, 0); } } return 0; } static int disconnection_core_act(tenm_object *my, const tenm_object *player) { double x_temp; double y_temp; double source_x; double source_y; int randomness; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; (my->count[1])++; if (my->count[2] == -1) { if (my->count[1] == 50) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] >= 150) { my->count[1] = 0; my->count[2] = 0; } } else if (my->count[2] == 0) { if (my->count[1] >= 6) { randomness = 100; x_temp = (double) ((rand() % (randomness * 2 + 1)) - randomness); y_temp = (double) ((rand() % (randomness * 2 + 1)) - randomness); tenm_table_add(normal_shot_point_new(my->x, my->y, 9.0, player->x + x_temp, player->y + y_temp, COLOR_PURPLE, 1000)); my->count[1] = 0; } } else if (my->count[2] == 1) { if ((my->count[1] <= 105) && (my->count[1] % 15 == 0)) { source_x = my->x + (double) (rand() % 49 - 24); source_y = my->y + (double) (rand() % 49 - 24); tenm_table_add(explosion_new(source_x, source_y, 0.0, 0.0, 1, 2000, COLOR_PURPLE, 6.0, 12)); tenm_table_add(explosion_new(source_x, source_y, 0.0, 0.0, 2, 500, COLOR_PURPLE, 4.0, 12)); } else if (my->count[1] == 150) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 8000, COLOR_PURPLE, 10.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 2000, COLOR_PURPLE, 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 3, 300, COLOR_PURPLE, 5.0, 12)); } else if (my->count[1] >= 300) { tenm_table_add(stage_clear_new(3)); return 1; } } else { fprintf(stderr, "disconnection_core_act: strange mode (%d)\n", my->count[2]); } return 0; } static int disconnection_core_draw(tenm_object *my, int priority) { int n = 0; /* sanity check */ if (my == NULL) return 0; /* dead enemy has low priority */ if (my->count[2] == 1) { if (priority != -1) return 0; } else { if (priority != 0) return 0; } if ((my->count[2] == 1) && (my->count[1] >= 150)) return 0; if (my->count[3] == 0) n = 0; else n = 1; if (disconnection_core_blit((int) (my->x), (int) (my->y), n) != 0) { fprintf(stderr, "disconnection_core_draw: disconnection_core_blit " "failed\n"); my->count[3] = 0; return 1; } my->count[3] = 0; return 0; /* the below may be useful for debugging */ if (tenm_draw_mass(my->mass, tenm_map_color(78, 59, 156)) != 0) { fprintf(stderr, "disconnection_core_draw: tenm_draw_mass failed\n"); return 1; } return 0; } static tenm_object * disconnection_shroud_new(int parent_index, int n) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; const char *name = NULL; int hit_point = disconnection_shroud_hit_point(n); double x = DISCONNECTION_CENTER_X; double y = DISCONNECTION_CENTER_Y; /* sanity check */ if ((n < 0) || (n > 2)) { fprintf(stderr, "disconnection_shroud_new: strange n (%d)\n", n); return NULL; } if (n == 0) { x = DISCONNECTION_CENTER_X - 103.9230; y = -183.0; } else if (n == 1) { x = DISCONNECTION_CENTER_X; y = -3.0; } else { x = DISCONNECTION_CENTER_X + 103.9230; y = -183.0; } p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "disconnection_shroud_new: malloc(p) failed\n"); return NULL; } if (n == 0) p[0] = (tenm_primitive *) tenm_polygon_new(4, x + 27.0, y - 54.0, x - 33.0, y + 50.0, x - 26.0, y + 54.0, x + 34.0, y - 50.0); else if (n == 1) p[0] = (tenm_primitive *) tenm_polygon_new(4, x + 60.0, y + 4.0, x - 60.0, y + 4.0, x - 60.0, y - 4.0, x + 60.0, y - 4.0); else p[0] = (tenm_primitive *) tenm_polygon_new(4, x - 27.0, y - 54.0, x + 33.0, y + 50.0, x + 26.0, y + 54.0, x - 34.0, y - 50.0); if (p[0] == NULL) { fprintf(stderr, "disconnection_shroud_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 6); if (count == NULL) { fprintf(stderr, "disconnection_shroud_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 4); if (count_d == NULL) { fprintf(stderr, "disconnection_shroud_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } if (n == 1) name = "Disconnection front shroud"; else name = "Disconnection side shroud"; /* list of count * [0] table index of parent (Disconnection manager) * [1] timer * [2] color * [3] n * [4] mode * [5] "damaged" flag */ /* list of count_d * [0] speed x * [1] speed y * [2] center x * [3] center y */ count[0] = parent_index; count[1] = 0; if (n == 0) count[2] = COLOR_BLUE; else if (n == 1) count[2] = COLOR_PURPLE; else count[2] = COLOR_RED; count[3] = n; count[4] = 0; count[5] = 0; count_d[0] = 0.0; if (n == 1) count_d[1] = ((DISCONNECTION_CENTER_Y + 120.0) - y) / 50.0; else count_d[1] = ((DISCONNECTION_CENTER_Y - 60.0) - y) / 50.0; count_d[2] = DISCONNECTION_CENTER_X; count_d[3] = DISCONNECTION_CENTER_Y; new = tenm_object_new(name, ATTR_ENEMY | ATTR_OPAQUE, ATTR_PLAYER_SHOT, hit_point, x, y, 6, count, 4, count_d, 1, p, (int (*)(tenm_object *, double)) disconnection_shroud_move, (int (*)(tenm_object *, tenm_object *)) disconnection_shroud_hit, (int (*)(tenm_object *, const tenm_object *)) disconnection_shroud_act, (int (*)(tenm_object *, int)) disconnection_shroud_draw); if (new == NULL) { fprintf(stderr, "disconnection_shroud_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int disconnection_shroud_hit_point(int n) { if (n == 1) return 750; return 500; } static int disconnection_shroud_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->count[4] != 0) && (my->mass != NULL) && (!in_window_object(my))) { fprintf(stderr, "disconnection_shroud_move: the object is out of " "the window\n"); return 1; } return 0; } static int disconnection_shroud_hit(tenm_object *my, tenm_object *your) { /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (your->attr != ATTR_PLAYER_SHOT) return 0; /* immutable time */ if (my->count[4] == 0) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[5] = 1; set_hit_status(my->name, disconnection_shroud_hit_point(my->count[3]), my->hit_point); if (my->hit_point <= 0) { add_killed(my->count[2]); add_score(10000); disconnection_shroud_explosion(my); tenm_table_apply(my->count[0], (int (*)(tenm_object *, int)) disconnection_shroud_signal, my->count[3]); return 1; } return 0; } static int disconnection_shroud_explosion(const tenm_object *my) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 2000, my->count[2], 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 500, my->count[2], 6.0, 12)); return 0; } static int disconnection_shroud_signal(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "Disconnection manager") != 0) return 0; my->count[n + 4] = -1; return 0; } static int disconnection_shroud_act(tenm_object *my, const tenm_object *player) { /* for rotate move */ double r_x; double r_y; double r_length; double dr_x; double dr_y; double temp; double speed_r; double speed_theta = 0.45; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; if (my->count[4] == 0) { (my->count[1])++; if (my->count[1] == 50) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] >= 100) { my->count[4] = 1; } return 0; } else if (my->count[4] == 2) { speed_theta *= 0.1; (my->count[1])++; if (my->count[1] >= 10) { disconnection_shroud_explosion(my); return 1; } } /* rotate */ r_x = my->x - my->count_d[2]; r_y = my->y - my->count_d[3]; r_length = tenm_sqrt((int) (r_x * r_x + r_y * r_y)); /* ugly hack to prevent radius from increasing */ speed_r = 120.0 - r_length; r_x /= r_length; r_y /= r_length; dr_x = -r_y; dr_y = r_x; temp = r_length / 5.0; my->count_d[0] = speed_r * r_x + speed_theta * dr_x * temp; my->count_d[1] = speed_r * r_y + speed_theta * dr_y * temp; return 0; } static int disconnection_shroud_draw(tenm_object *my, int priority) { tenm_color color; /* sanity check */ if (my == NULL) return 0; /* dead enemy has low priority */ if (my->count[4] == 2) { if (priority != -1) return 0; } else { if (priority != 0) return 0; } switch (my->count[2]) { case COLOR_BLUE: if (my->count[5] == 0) color = tenm_map_color(59, 112, 156); else color = tenm_map_color(119, 137, 157); break; case COLOR_PURPLE: if (my->count[5] == 0) color = tenm_map_color(78, 59, 156); else color = tenm_map_color(130, 100, 157); break; case COLOR_RED: if (my->count[5] == 0) color = tenm_map_color(156, 59, 72); else color = tenm_map_color(186, 100, 74); break; case COLOR_GREEN: color = tenm_map_color(59, 156, 71); break; default: color = tenm_map_color(0, 0, 0); break; } if ((my->mass != NULL) && (tenm_draw_mass(my->mass, color) != 0)) { fprintf(stderr, "disconnection_shroud_draw: tenm_draw_mass failed\n"); my->count[5] = 0; return 1; } my->count[5] = 0; return 0; } static tenm_object * disconnection_bit_new(int parent_index, int n) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double x = DISCONNECTION_CENTER_X; double y = DISCONNECTION_CENTER_Y; /* sanity check */ if ((n < 0) || (n > 1)) { fprintf(stderr, "disconnection_bit_new: strange n (%d)\n", n); return NULL; } if (n == 0) x = DISCONNECTION_CENTER_X - 190.0; else x = DISCONNECTION_CENTER_X + 190.0; y = -24.0; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "disconnection_bit_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 25.0); if (p[0] == NULL) { fprintf(stderr, "disconnection_bit_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 5); if (count == NULL) { fprintf(stderr, "disconnection_bit_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "disconnection_bit_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] table index of parent (Disconnection manager) * [1] mode timer * [2] mode * [3] n * [4] normal shot timer */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = parent_index; count[1] = 0; count[2] = -1; count[3] = n; if (n == 0) count[4] = 0; else count[4] = 20; count_d[0] = 0.0; count_d[1] = ((DISCONNECTION_CENTER_Y + 180.0) - y) / 60.0; new = tenm_object_new("Disconnection bit", ATTR_OBSTACLE, 0, 1, x, y, 5, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) disconnection_bit_move, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) disconnection_bit_act, (int (*)(tenm_object *, int)) disconnection_bit_draw); if (new == NULL) { fprintf(stderr, "disconnection_bit_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int disconnection_bit_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->mass != NULL) && (!in_window_object(my))) { fprintf(stderr, "disconnection_bit_move: the object is out of " "the window\n"); return 1; } return 0; } static int disconnection_bit_act(tenm_object *my, const tenm_object *player) { int i; double x_temp; double y_temp; double target_x; double target_y; int randomness; int theta; /* for rotate move */ double r_x; double r_y; double r_length; double dr_x; double dr_y; double temp; double speed_r; double speed_theta; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; (my->count[1])++; if (my->count[2] == 4) { if (((my->count[3] == 0) && (my->count[1] >= 30)) || (my->count[1] >= 70)) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 2000, COLOR_GREEN, 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 500, COLOR_GREEN, 6.0, 12)); return 1; } return 0; } else if (my->hit_point <= 0) { my->count[1] = 0; my->count[2] = 4; return 0; } else if (my->count[2] == -1) { if (my->count[1] == 60) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] >= 320) { my->count[1] = 0; my->count[2] = 0; } return 0; } if (my->count[2] == 0) { if (my->count[1] == 50) { if (my->count[3] == 0) my->count_d[0] = ((DISCONNECTION_CENTER_X - 100.0) - my->x) / 50.0; else my->count_d[0] = ((DISCONNECTION_CENTER_X + 100.0) - my->x) / 50.0; my->count_d[1] = ((DISCONNECTION_CENTER_Y + 210.0) - my->y) / 50.0; } else if (my->count[1] == 100) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if ((my->count[1] >= 120) && (my->count[1] <= 270) && (my->count[1] % 5 == 0)) { for (i = 0; i < 2; i++) { if (i == 0) { if (my->count[3] == 0) target_x = (double) (WINDOW_WIDTH / 2 - (my->count[1] - 100)); else target_x = (double) (WINDOW_WIDTH / 2 + (my->count[1] - 100)); target_y = (double) WINDOW_HEIGHT; } else { if (my->count[3] == 0) target_x = (double) WINDOW_WIDTH; else target_x = 0.0; target_y = my->y + (double) (my->count[1] - 100); } tenm_table_add(laser_point_new(my->x, my->y, 15.0, target_x, target_y, 20.0, COLOR_GREEN, 1000)); } } else if (my->count[1] == 290) { if (my->count[3] == 0) my->count_d[0] = ((DISCONNECTION_CENTER_X - 190.0) - my->x) / 50.0; else my->count_d[0] = ((DISCONNECTION_CENTER_X + 190.0) - my->x) / 50.0; my->count_d[1] = ((DISCONNECTION_CENTER_Y + 180.0) - my->y) / 50.0; } else if (my->count[1] >= 340) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; my->count[1] = 0; my->count[2] = 1; } } else if (my->count[2] == 1) { if (my->count[1] == 50) { my->count_d[1] = 5.0; } else if (my->count[1] == 100) { my->count_d[1] = 0.0; } else if (my->count[1] == 110) { my->count_d[1] = -5.0; } else if (my->count[1] == 160) { my->count_d[1] = 0.0; my->count[1] = 0; my->count[2] = 2; } if ((my->count[1] >= 55) && (my->count[1] <= 95) && (my->count[1] % 10 == 5)) { if (my->count[3] == 0) theta = my->count[1] - 30; else theta = 180 - (my->count[1] - 30); tenm_table_add(laser_angle_new(my->x, my->y, 3.0, theta, 20.0, COLOR_GREEN, 1000)); } else if ((my->count[1] >= 115) && (my->count[1] <= 155) && (my->count[1] % 10 == 5)) { if (my->count[3] == 0) theta = -(my->count[1] - 140); else theta = -(180 - (my->count[1] - 140)); tenm_table_add(laser_angle_new(my->x, my->y, 8.5, theta, 20.0, COLOR_GREEN, 1000)); } } else if (my->count[2] == 2) { if (my->count[1] == 50) { if (my->count[3] == 0) my->count_d[0] = ((DISCONNECTION_CENTER_X - 150.0) - my->x) / 50.0; else my->count_d[0] = ((DISCONNECTION_CENTER_X + 150.0) - my->x) / 50.0; my->count_d[1] = ((DISCONNECTION_CENTER_Y + 370.0) - my->y) / 50.0; } else if (my->count[1] == 100) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if ((my->count[1] >= 120) && (my->count[1] < 400)) { /* rotate */ r_x = my->x - DISCONNECTION_CENTER_X; r_y = my->y - (DISCONNECTION_CENTER_Y + 370.0); r_length = tenm_sqrt((int) (r_x * r_x + r_y * r_y)); /* ugly hack to prevent radius from increasing */ speed_r = 150.0 - r_length; if (my->count[3] == 0) speed_theta = -0.15; else speed_theta = 0.15; r_x /= r_length; r_y /= r_length; dr_x = -r_y; dr_y = r_x; temp = r_length / 5.0; my->count_d[0] = speed_r * r_x + speed_theta * dr_x * temp; my->count_d[1] = speed_r * r_y + speed_theta * dr_y * temp; } else if (my->count[1] == 400) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 420) { if (my->count[3] == 0) my->count_d[0] = ((DISCONNECTION_CENTER_X - 190.0) - my->x) / 50.0; else my->count_d[0] = ((DISCONNECTION_CENTER_X + 190.0) - my->x) / 50.0; my->count_d[1] = ((DISCONNECTION_CENTER_Y + 180.0) - my->y) / 50.0; } else if (my->count[1] >= 470) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; my->count[1] = 0; my->count[2] = 0; } if ((my->count[1] >= 125) && (my->count[1] <= 385) && (my->count[1] % 15 == 5)) { target_x = DISCONNECTION_CENTER_X; target_y = DISCONNECTION_CENTER_Y + 370.0; tenm_table_add(laser_point_new(my->x, my->y, ((double) (my->count[1])) * 0.03, target_x, target_y, 20.0, COLOR_GREEN, 1000)); } } (my->count[4])++; if (my->count[4] >= 40) { randomness = 50; x_temp = (double) ((rand() % (randomness * 2 + 1)) - randomness); y_temp = (double) ((rand() % (randomness * 2 + 1)) - randomness); tenm_table_add(normal_shot_point_new(my->x, my->y, 4.0, player->x + x_temp, player->y + y_temp, COLOR_GREEN, 1000)); my->count[4] = 0; } return 0; } static int disconnection_bit_draw(tenm_object *my, int priority) { /* sanity check */ if (my == NULL) return 0; /* dead enemy has low priority */ if (my->count[2] == 4) { if (priority != -1) return 0; } else { if (priority != 0) return 0; } if (disconnection_bit_blit((int) (my->x), (int) (my->y), 0) != 0) { fprintf(stderr, "disconnection_bit_draw: disconnection_bit_blit failed\n"); return 1; } return 0; /* the below may be useful for debugging */ if (tenm_draw_mass(my->mass, tenm_map_color(59, 156, 71)) != 0) { fprintf(stderr, "disconnection_bit_draw: tenm_draw_mass failed\n"); return 1; } return 0; } tenmado-0.10/happy-L/disconnection.h0000644000175000017500000000033410276702754020221 0ustar00ooharaoohara00000000000000/* $Id: disconnection.h,v 1.1 2002/06/24 15:01:47 oohara Exp $ */ #ifndef __TENMADO_DISCONNECTION_H__ #define __TENMADO_DISCONNECTION_H__ tenm_object *disconnection_new(void); #endif /* __TENMADO_DISCONNECTION_H__ */ tenmado-0.10/happy-L/ending.c0000644000175000017500000000224411711142477016616 0ustar00ooharaoohara00000000000000/* $Id: ending.c,v 1.9 2012/01/29 04:04:15 oohara Exp $ */ #include /* strlen */ #include #include "tenm_table.h" #include "const.h" #include "message.h" #include "ship.h" #include "score.h" #include "ending.h" int ending(int t) { int status = SCHEDULER_SUCCESS; char temp[32]; /* sanity check */ if (t < 0) { fprintf(stderr, "ending: strange t (%d)\n", t); return SCHEDULER_ERROR; } if (t == 30) { if (tenm_table_add(message_new(190.0, 240.0, 0.0, 0.0, 200, "all cleared", 11)) < 0) { fprintf(stderr, "ending: cannot create message (line 1) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } sprintf(temp, "ship bonus: %8d", get_ship() * 30000); if (tenm_table_add(message_new(145.0, 270.0, 0.0, 0.0, 200, temp, (int) strlen(temp))) < 0) { fprintf(stderr, "ending: cannot create message (line 2) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } add_score(get_ship() * 30000); } if (t == 240) return SCHEDULER_NEXT_STAGE; return status; } tenmado-0.10/happy-L/ending.h0000644000175000017500000000025510276702754016630 0ustar00ooharaoohara00000000000000/* $Id: ending.h,v 1.1 2002/07/10 13:26:30 oohara Exp $ */ #ifndef __TENMADO_ENDING_H__ #define __TENMADO_ENDING_H__ int ending(int t); #endif /* __TENMADO_ENDING_H__ */ tenmado-0.10/happy-L/explosion.c0000644000175000017500000001062010276702754017374 0ustar00ooharaoohara00000000000000/* $Id: explosion.c,v 1.37 2003/08/22 05:18:12 oohara Exp $ */ #include /* malloc, rand */ #include #include "tenm_graphic.h" #include "tenm_math.h" #include "tenm_object.h" #include "const.h" #include "explosion.h" static int explosion_act(tenm_object *my, const tenm_object *player); static int explosion_draw(tenm_object *my, int priority); tenm_object * explosion_new(double x, double y, double dx, double dy, int size_debris, int number_debris, int color, double speed_debris, int life) { int i; int suffix; int theta; double temp_speed; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; /* sanity check */ if (size_debris <= 0) return NULL; if (number_debris <= 0) return NULL; if (speed_debris <= 0.0) return NULL; if (life <= 0) return NULL; count = (int *) malloc(sizeof(int) * 5); if (count == NULL) { fprintf(stderr, "explosion_new: malloc(count) failed\n"); return NULL; } count_d = (double *) malloc(sizeof(double) * (4 + 4 * number_debris)); if (count_d == NULL) { fprintf(stderr, "explosion_new: malloc(count_d) failed\n"); free(count); return NULL; } /* list of count * [0] size of debris * [1] number of debris * [2] color * [3] life * [4] time passed */ count[0] = size_debris; count[1] = number_debris; count[2] = color; count[3] = life; count[4] = 0; /* list of count_d * [0] source x * [1] source y * [2] source dx * [3] source dy * [4--] debris (x, y, dx, dy) (relative to source) */ count_d[0] = x; count_d[1] = y; count_d[2] = dx; count_d[3] = dy; for (i = 0; i < number_debris; i++) { suffix = i * 4 + 4; theta = rand() % 360; temp_speed = (double) (6 + rand() % 95) / 100.0; count_d[suffix + 0] = 0.0; count_d[suffix + 1] = 0.0; count_d[suffix + 2] = speed_debris * temp_speed * tenm_cos(theta); count_d[suffix + 3] = speed_debris * temp_speed * tenm_sin(theta); } new = tenm_object_new("explosion", 0, 0, 0, x, y, 5, count, 4 + 4 * number_debris, count_d, 0, NULL, (int (*)(tenm_object *, double)) NULL, NULL, (int (*)(tenm_object *, const tenm_object *)) explosion_act, (int (*)(tenm_object *, int)) explosion_draw); if (new == NULL) { fprintf(stderr, "explosion_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); return NULL; } return new; } static int explosion_act(tenm_object *my, const tenm_object *player) { int i; int suffix; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; (my->count[4])++; if (my->count[4] >= my->count[3]) { (my->count[1]) /= 2; my->count[4] = 0; } if (my->count[1] <= 0) return 1; /* explosion does not collide with anything, so let't move it here, * not in a separate move function */ my->count_d[0] += my->count_d[2]; my->count_d[1] += my->count_d[3]; for (i = 0; i < my->count[1]; i++) { suffix = i * 4 + 4; my->count_d[suffix + 0] += my->count_d[suffix + 2]; my->count_d[suffix + 1] += my->count_d[suffix + 3]; } return 0; } static int explosion_draw(tenm_object *my, int priority) { int i; int suffix; int status = 0; tenm_color color; int temp; /* sanity check */ if (my == NULL) return 0; if (priority != -1) return 0; if (my->count[0] <= 0) return 0; switch (my->count[2]) { case COLOR_BLUE: color = tenm_map_color(59, 112, 156); break; case COLOR_PURPLE: color = tenm_map_color(78, 59, 156); break; case COLOR_RED: color = tenm_map_color(156, 59, 72); break; case COLOR_GREEN: color = tenm_map_color(59, 156, 71); break; default: color = tenm_map_color(0, 0, 0); break; } temp = my->count[0] / 2; for (i = 0; i < my->count[1]; i++) { suffix = i * 4 + 4; if (tenm_draw_rectangle(((int) (my->count_d[0] + my->count_d[suffix + 0])) - temp, ((int) (my->count_d[1] + my->count_d[suffix + 1])) - temp, my->count[0], my->count[0], color) != 0) status = 1; } return status; } tenmado-0.10/happy-L/explosion.h0000644000175000017500000000056310276702754017406 0ustar00ooharaoohara00000000000000/* $Id: explosion.h,v 1.2 2002/05/11 02:29:00 oohara Exp $ */ #ifndef __TENMADO_EXPLOSION_H__ #define __TENMADO_EXPLOSION_H__ tenm_object *explosion_new(double x, double y, double dx, double dy, int size_debris, int number_debris, int color, double speed_debris, int life); #endif /* not __TENMADO_EXPLOSION_H__ */ tenmado-0.10/happy-L/fud.c0000644000175000017500000004465210276702754016146 0ustar00ooharaoohara00000000000000/* $Id: fud.c,v 1.124 2003/08/22 04:58:05 oohara Exp $ */ #include /* malloc, rand */ #include /* strcmp */ #include #include "tenm_primitive.h" #include "tenm_object.h" #include "const.h" #include "tenm_table.h" #include "stage-clear.h" #include "score.h" #include "tenm_graphic.h" #include "hit-status.h" #include "explosion.h" #include "chain.h" #include "util.h" #include "laser.h" #include "image.h" #include "fud.h" #define WALL_SIZE 50.0 #define FUD_HIT_POINT 150 #define TRINITY_HIT_POINT 150 static int fud_act(tenm_object *my, const tenm_object *player); static int fud_wall_signal(tenm_object *my, int n); static tenm_object *fud_core_new(int parent_index, int n, double x, double y); static int fud_core_move(tenm_object *my, double turn_per_frame); static int fud_core_hit(tenm_object *my, tenm_object *your); static int fud_core_act(tenm_object *my, const tenm_object *player); static int fud_core_draw(tenm_object *my, int priority); static int fud_core_signal(tenm_object *my, int n); static int fud_core_speed_up(tenm_object *my, int n); static tenm_object *fud_wall_new(int n, double x, double y); static int fud_wall_move(tenm_object *my, double turn_per_frame); static int fud_wall_act(tenm_object *my, const tenm_object *player); static int fud_wall_draw(tenm_object *my, int priority); tenm_object * fud_new(void) { int i; tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 17); if (count == NULL) { fprintf(stderr, "fud_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] timer * [1] Fear index * [2] Uncertainty index * [3] Doubt index * [4] Trinity index * [5 -- 16] wall index */ count[0] = -188; for (i = 1; i <= 16; i++) count[i] = -1; new = tenm_object_new("FUD manager", 0, 0, 0, 0.0, 0.0, 17, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) fud_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "fud_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int fud_act(tenm_object *my, const tenm_object *player) { int i; double temp_x; /* sanity check */ if (my == NULL) return 0; if (my->count[0] < 0) { (my->count[0])++; if (my->count[0] == -187) { for (i = 0; i < 3; i++) { temp_x = (double) ((WINDOW_WIDTH + 50 * 2) * i / 3); my->count[5 + i] = tenm_table_add(fud_wall_new(0, temp_x, -49.0)); } return 0; } else if (my->count[0] == -125) { for (i = 0; i < 3; i++) { temp_x = (double) ((WINDOW_WIDTH + 50 * 2) * i / 3); my->count[8 + i] = tenm_table_add(fud_wall_new(1, temp_x, -49.0)); } return 0; } else if (my->count[0] == -94) { for (i = 0; i < 3; i++) { temp_x = (double) ((WINDOW_WIDTH + 25 * 2) * i / 3); my->count[i + 1] = tenm_table_add(fud_core_new(my->table_index, i, temp_x, -24.0)); } return 0; } else if (my->count[0] == -63) { for (i = 0; i < 3; i++) { temp_x = (double) ((WINDOW_WIDTH + 50 * 2) * i / 3); my->count[11 + i] = tenm_table_add(fud_wall_new(2, temp_x, -49.0)); } return 0; } else if (my->count[0] == -1) { for (i = 0; i < 3; i++) { temp_x = (double) ((WINDOW_WIDTH + 50 * 2) * i / 3); my->count[14 + i] = tenm_table_add(fud_wall_new(3, temp_x, -49.0)); } return 0; } return 0; } /* 0: at least one of Fear, Uncertainty and Doubt is alive * 1: Trinity is alive */ if ((my->count[0] != 0) && (my->count[0] != 1)) (my->count[0])++; if (my->count[0] >= 300) { tenm_table_add(stage_clear_new(4)); return 1; } return 0; } static int fud_wall_signal(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "wall") != 0) return 0; /* dirty hack to draw dead walls */ my->attr = 0; my->hit_mask = 0; my->count[0] = n; if (my->count_d[0] > 0.0) my->count_d[0] = 1.0; else my->count_d[0] = -1.0; return 0; } static tenm_object * fud_core_new(int parent_index, int n, double x, double y) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; const char *name = NULL; int hit_point = FUD_HIT_POINT; /* sanity check */ if ((n < 0) || (n > 3)) return NULL; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "fud_core_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 25.0); if (p[0] == NULL) { fprintf(stderr, "fud_core_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 7); if (count == NULL) { fprintf(stderr, "fud_core_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 1); if (count_d == NULL) { fprintf(stderr, "fud_core_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } hit_point = FUD_HIT_POINT; count[3] = -1; count_d[0] = 2.5; if (n == 0) { name = "Fear"; count[0] = COLOR_BLUE; } else if (n == 1) { name = "Uncertainty"; count[0] = COLOR_PURPLE; } else if (n == 2) { name = "Doubt"; count[0] = COLOR_RED; } else if (n == 3) { name = "Trinity"; hit_point = TRINITY_HIT_POINT; count[0] = COLOR_PURPLE; count[3] = 0; count_d[0] = 10.0; } else { fprintf(stderr, "fud_core_new: strange n (%d)\n", n); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } /* list of count * [0] color * [1] table index of parent (FUD manager) * [2] shoot timer * [3] long laser timer (< 0 means it is disabled) * [4] long laser direction * [5] n * [6] "damaged" flag */ /* list of count_d * [0] speed x */ /* count[0] is set above */ count[1] = parent_index; count[2] = 0; /* count[3] is set above */ count[4] = 0; count[5] = n; count[6] = 0; /* count_d[0] is set above */ new = tenm_object_new(name, ATTR_ENEMY, ATTR_PLAYER_SHOT, hit_point, x, y, 7, count, 1, count_d, 1, p, (int (*)(tenm_object *, double)) fud_core_move, (int (*)(tenm_object *, tenm_object *)) fud_core_hit, (int (*)(tenm_object *, const tenm_object *)) fud_core_act, (int (*)(tenm_object *, int)) fud_core_draw); if (new == NULL) { fprintf(stderr, "fud_core_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int fud_core_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = 3.0 / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); /* don't use in_window_object() here because we want to treat * this as a rectangle */ if (my->x < 1.0 - 25.0) { dx_temp = ((double) WINDOW_WIDTH) - 1.0 + 25.0 - my->x; my->x += dx_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, 0.0); } else if (my->x >= ((double) WINDOW_WIDTH) - 1.0 + 25.0) { dx_temp = 1.0 - 25.0 - my->x; my->x += dx_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, 0.0); } if (my->y >= ((double) WINDOW_HEIGHT) - 1.0 + 25.0) { dy_temp = 1.0 - 25.0 - my->y; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, 0.0, dy_temp); my->count_d[0] *= -1.0; } return 0; } static int fud_core_hit(tenm_object *my, tenm_object *your) { int hit_point = FUD_HIT_POINT; int score = 10000; /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (your->attr != ATTR_PLAYER_SHOT) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[6] = 1; if (my->count[3] < 0) { hit_point = FUD_HIT_POINT; score = 10000; } else { hit_point = TRINITY_HIT_POINT; score = 20000; } set_hit_status(my->name, hit_point, my->hit_point); if (my->hit_point <= 0) { tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, 1.5, 2, 200, my->count[0], 4.0, 16)); add_killed(my->count[0]); add_score(score); tenm_table_apply(my->count[1], (int (*)(tenm_object *, int)) fud_core_signal, my->table_index); return 1; } return 0; } static int fud_core_act(tenm_object *my, const tenm_object *player) { double temp_speed; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; if ((my->count_d[0] >= -7.0) && (my->count_d[0] <= 7.0)) (my->count[2])++; else my->count[2] += 2; if (my->count[2] >= 30) { if (my->count_d[0] >= 0.0) temp_speed = 1.5 + my->count_d[0]; else temp_speed = 1.5 - my->count_d[0]; tenm_table_add(laser_point_new(my->x, my->y, temp_speed, player->x, player->y, 20.0, my->count[0], 1000)); my->count[2] = 0; } if (my->count[3] < 0) return 0; (my->count[3])++; if (my->count[4] == 0) { if (my->count[3] >= 75) { my->count[3] = 0; my->count[4] = -1; } } else { if (my->count[3] >= 25) { my->count[3] = 0; if (my->count[4] == -2) my->count[4] = -1; else if (my->count[4] == -1) my->count[4] = 2; else if (my->count[4] == 1) my->count[4] = -2; else if (my->count[4] == 2) my->count[4] = 1; else my->count[4] = -1; } } if ((my->count[4] == 1) || (my->count[4] == -1)) tenm_table_add(laser_new(my->x, my->y, my->count_d[0], 3.0, 0.0, (double) (1000 * my->count[4]), my->count[0], 1)); return 0; } static int fud_core_draw(tenm_object *my, int priority) { int n = 0; tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 0) return 0; n = my->count[5]; if (my->count[6] != 0) n += 4; if (fud_core_blit((int) (my->x), (int) (my->y), n) != 0) { fprintf(stderr, "fud_core_draw: fud_core_blit failed\n"); my->count[6] = 0; return 1; } my->count[6] = 0; return 0; /* the below may be useful for debugging */ switch (my->count[0]) { case COLOR_BLUE: color = tenm_map_color(59, 112, 156); break; case COLOR_PURPLE: color = tenm_map_color(78, 59, 156); break; case COLOR_RED: color = tenm_map_color(156, 59, 72); break; case COLOR_GREEN: color = tenm_map_color(59, 156, 71); break; default: color = tenm_map_color(0, 0, 0); break; } if (tenm_draw_primitive(my->mass->p[0], color) != 0) return 1; return 0; } static int fud_core_signal(tenm_object *my, int n) { int i; int j; int all_destroyed = 1; double temp_x; int temp_index[4]; /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "FUD manager") != 0) return 0; for (i = 0; i < 4; i++) if (my->count[i + 1] == n) my->count[i + 1] = -1; else if (my->count[i + 1] >= 0) tenm_table_apply(my->count[i + 1], (int (*)(tenm_object *, int)) fud_core_speed_up, my->table_index); for (i = 0; i < 4; i++) if (my->count[i + 1] >= 0) all_destroyed = 0; if (all_destroyed) { if (my->count[0] <= 0) { /* Trinity appears */ temp_x = (double) ((WINDOW_WIDTH + 50 * 2) * 1 / 3); my->count[4] = tenm_table_add(fud_core_new(my->table_index, 3, temp_x, -24.0)); my->count[0] = 1; return 0; } else { my->count[0] = 2; /* Trinity is dead --- destroy walls */ tenm_table_apply_all((int (*)(tenm_object *, int)) delete_enemy_shot, 0); for (i = 5; i <= 16; i++) tenm_table_apply(my->count[i], (int (*)(tenm_object *, int)) fud_wall_signal, 150); for (i = 0; i < 4; i++) { temp_index[i] = 5 + rand() % 12; for (j = 0; j < i; j++) if (temp_index[j] == temp_index[i]) { i--; break; } } tenm_table_apply(my->count[temp_index[0]], (int (*)(tenm_object *, int)) fud_wall_signal, 10); tenm_table_apply(my->count[temp_index[1]], (int (*)(tenm_object *, int)) fud_wall_signal, 30); for (i = 2; i <= 3; i++) tenm_table_apply(my->count[temp_index[i]], (int (*)(tenm_object *, int)) fud_wall_signal, 75); } } return 0; } static int fud_core_speed_up(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if ((strcmp(my->name, "Fear") != 0) && (strcmp(my->name, "Uncertainty") != 0) && (strcmp(my->name, "Doubt") != 0)) return 0; my->count_d[0] *= 2.0; return 0; } static tenm_object * fud_wall_new(int n, double x, double y) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; /* sanity check */ if (n < 0) return NULL; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "fud_wall_new: malloc(p) failed\n"); return NULL; } if (n % 2 == 0) p[0] = (tenm_primitive *) tenm_polygon_new(3, x - WALL_SIZE, y - WALL_SIZE, x - WALL_SIZE, y + WALL_SIZE, x + WALL_SIZE, y + WALL_SIZE); else p[0] = (tenm_primitive *) tenm_polygon_new(3, x + WALL_SIZE, y - WALL_SIZE, x + WALL_SIZE, y + WALL_SIZE, x - WALL_SIZE, y + WALL_SIZE); if (p[0] == NULL) { fprintf(stderr, "fud_wall_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 1); if (count == NULL) { fprintf(stderr, "fud_wall_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 1); if (count_d == NULL) { fprintf(stderr, "fud_wall_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] explosion timer */ /* list of count_d * [0] speed x */ count[0] = -1; if (n <= 1) count_d[0] = 4.0; else count_d[0] = -4.0; new = tenm_object_new("wall", ATTR_OBSTACLE, 0, 100, x, y, 1, count, 1, count_d, 1, p, (int (*)(tenm_object *, double)) fud_wall_move, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) fud_wall_act, (int (*)(tenm_object *, int)) fud_wall_draw); if (new == NULL) { fprintf(stderr, "fud_wall_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int fud_wall_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; if (my->count[0] < 0) dy_temp = 3.0 / turn_per_frame; else dy_temp = 1.0 / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); /* don't use in_window_object() here because we want to treat * this as a rectangle */ if (my->x < 0.0 - WALL_SIZE) { dx_temp = ((double) WINDOW_WIDTH) - 1.0 + WALL_SIZE - my->x; my->x += dx_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, 0.0); } else if (my->x >= WALL_SIZE + (double) WINDOW_WIDTH) { dx_temp = 1.0 - WALL_SIZE - my->x; my->x += dx_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, 0.0); } if (my->y >= WALL_SIZE + (double) WINDOW_HEIGHT) { dy_temp = 1.0 - WALL_SIZE - my->y; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, 0.0, dy_temp); /* don't change my->count_d[0] here */ } return 0; } static int fud_wall_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; if (my->count[0] < 0) return 0; (my->count[0])--; if (my->count[0] <= 0) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 5000, COLOR_GREEN, 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 1000, COLOR_GREEN, 5.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 3, 200, COLOR_GREEN, 3.5, 12)); return 1; } return 0; } static int fud_wall_draw(tenm_object *my, int priority) { /* sanity check */ if (my == NULL) return 0; /* dead enemy has low priority */ if (my->count[0] < 0) { if (priority != 0) return 0; } else { if (priority != -1) return 0; } if (my->mass == NULL) return 0; if (my->mass->p[0] == NULL) return 0; if (tenm_draw_primitive(my->mass->p[0], tenm_map_color(59, 156, 71)) != 0) return 1; return 0; } tenmado-0.10/happy-L/fud.h0000644000175000017500000000031010276702754016132 0ustar00ooharaoohara00000000000000/* $Id: fud.h,v 1.1 2002/05/18 04:39:11 oohara Exp $ */ #ifndef __TENMADO_FUD_H__ #define __TENMADO_FUD_H__ #include "tenm_object.h" tenm_object *fud_new(void); #endif /* not __TENMADO_FUD_H__ */ tenmado-0.10/happy-L/high-score.c0000644000175000017500000003702410276702754017413 0ustar00ooharaoohara00000000000000/* $Id: high-score.c,v 1.121 2003/01/13 01:49:19 oohara Exp $ */ /* VERSION, HAVE_LIBDB3, HAVE_LIBDB_3, NOT_HAVE_POSIX */ #include #include /* time, struct tm */ #include /* malloc */ #include /* strlen */ #include #ifndef NOT_HAVE_POSIX /* getuid */ #include /* getuid */ #include /* getpwuid */ #include #endif /* not NOT_HAVE_POSIX */ #include "bac_entry.h" #include "bac_save.h" #include "bac_dump.h" #include "tenm_input.h" #include "bac_array.h" #include "bac_load.h" #include "tenm_graphic.h" #include "util.h" #include "esc-ok.h" #include "tenm_timer.h" #include "const.h" #include "bac_truncate.h" #include "bac_string_to_array.h" #include "high-score.h" #ifdef NOT_HAVE_POSIX #define DATABASE_DIR "./save/" #define DEFAULT_DIR "./happy-L/default/" #else /* not NOT_HAVE_POSIX */ #define DATABASE_DIR LOCALSTATEDIR "/games/tenmado/" #define DEFAULT_DIR DATADIR "/games/tenmado/default/" #endif /* not NOT_HAVE_POSIX */ #define DATABASE_MODE 0644 static char *high_score_file_name(int stage); static char *default_file_name(int stage); int high_score_list_size(int stage) { /* sanity check */ if ((stage < 0) || (stage > 5)) return 1; if (stage == 0) return 100; return 20; } bac_array * make_high_score(int total_score, const int *stage_score) { bac_entry *entry; bac_array *array = NULL; bac_array *temp_array = NULL; int score_sort = 0; int user_name_available = 0; const char *user_name = NULL; int i; uid_t u; #ifndef NOT_HAVE_POSIX struct passwd *pw = NULL; #endif /* not NOT_HAVE_POSIX */ /* sanity check */ if (stage_score == NULL) return NULL; #ifdef NOT_HAVE_POSIX u = 0; user_name_available = 0; user_name = NULL; #else /* not NOT_HAVE_POSIX */ u = getuid(); pw = getpwuid(u); if (pw == NULL) { user_name_available = 0; user_name = NULL; } else { user_name_available = 1; user_name = (const char *) (pw->pw_name); } #endif /* not NOT_HAVE_POSIX */ /* there is no high score list for stage 6 */ for (i = 0; i < 6; i++) { if (i == 0) score_sort = total_score; else score_sort = stage_score[i - 1]; entry = bac_entry_new(0, 0, time(NULL), u, user_name_available, user_name, score_sort, total_score, 6, stage_score); if (entry == NULL) { fprintf(stderr, "make_high_score: bac_entry_new(%d) failed\n", i); if (array != NULL) bac_array_delete(array); return NULL; } temp_array = bac_array_add_entry(array, entry); if (temp_array == NULL) { fprintf(stderr, "make_high_score: bac_array_add_entry(%d) failed\n", i); (entry->delete)(entry); if (array != NULL) bac_array_delete(array); return NULL; } array = temp_array; } return array; } /* return 0 on success, 1 on error * assumes DATABASE_DIR already exists --- if not, it is an error */ int save_high_score(bac_array *array) { int i; char *file = NULL; /* sanity check */ if (array == NULL) return 0; if (array->n < 6) return 0; /* there is no high score list for stage 6 */ for (i = 0; i < 6; i++) { file = high_score_file_name(i); if (file == NULL) { fprintf(stderr, "save_high_score: high_score_file_name(%d) failed\n", i); return 1; } if (bac_save(DATABASE_DIR, file, (array->p)[i], DATABASE_MODE) != 0) { fprintf(stderr, "save_high_score: bac_save(%d) failed\n", i); free(file); return 1; } free(file); } return 0; } /* stage 0 means total score * return 0 on success, 1 on error * assumes there is at least one entry */ int dump_high_score(int stage) { char *file = NULL; file = high_score_file_name(stage); if (file == NULL) { fprintf(stderr, "dump_high_score: high_score_file_name failed\n"); return 1; } if (bac_dump(DATABASE_DIR, file, DATABASE_MODE) != 0) { fprintf(stderr, "dump_high_score: bac_dump failed\n"); free(file); return 1; } free(file); return 0; } /* stage 0 means total score * return 0 on success, 1 on error */ int undump_high_score(int stage) { char *file = NULL; file = high_score_file_name(stage); if (file == NULL) { fprintf(stderr, "undump_high_score: high_score_file_name failed\n"); return 1; } if (bac_undump(DATABASE_DIR, file, DATABASE_MODE) != 0) { fprintf(stderr, "dump_high_score: bac_dump failed\n"); free(file); return 1; } free(file); return 0; } /* return 1 if the program should quit, 0 if not */ int show_high_score(void) { int i; int stage = 0; int delay_stage = 6; int rank = 0; int delay_rank = 6; int quit_needed = 0; bac_array **p = NULL; bac_entry *entry; char string[40]; int timer_cursor = 0; struct tm *broken_time = NULL; int no_entry; /* no need to detect focus loss */ tenm_set_focus_handler((void (*)(int)) NULL); no_entry = 0; p = read_high_score(BAC_LOAD_FLAG_NO_DELETE, &no_entry); if (p == NULL) { if (no_entry != 0) { printf("show_high_score: at least one list is empty\n"); fflush(stdout); /* continue and show a blank list */ } else { /* real error */ fprintf(stderr, "show_high_score: read_high_score failed\n"); return 1; } } while (1 == 1) { if (tenm_event_handle() != 0) { quit_needed = 1; break; } /* return to the title if ESC is pressed */ if (tenm_get_key_status() & 32) { if (get_esc_ok()) { set_esc_ok(0); break; } } else { set_esc_ok(1); } if (tenm_get_key_status() & 2) { if ((delay_rank <= 0) || (tenm_get_key_status() & 16)) { if ((p != NULL) && (rank + 1 + 9 < (p[stage])->n) && (rank + 1 + 9 < high_score_list_size(stage))) rank++; delay_rank = 6; } else { delay_rank--; } } else if (tenm_get_key_status() & 1) { if ((delay_rank <= 0) || (tenm_get_key_status() & 16)) { if (rank - 1 >= 0) rank--; delay_rank = 6; } else { delay_rank--; } } else { delay_rank = 0; } if (tenm_get_key_status() & 4) { if (delay_stage <= 0) { stage++; if (stage > 5) stage -= 6; delay_stage = 6; rank = 0; } else { delay_stage--; } } else if (tenm_get_key_status() & 8) { if (delay_stage <= 0) { stage--; if (stage < 0) stage += 6; delay_stage = 6; rank = 0; } else { delay_stage--; } } else { delay_stage = 0; } tenm_clear_window(tenm_map_color(253, 245, 230)); sprintf(string, "tenmado high score (version %.9s)", VERSION); string[40 - 1] = '\0'; if (draw_string(30, 30, string, (int) strlen(string)) != 0) fprintf(stderr, "show_high_score: draw_string (high score title) " "failed\n"); if (stage == 0) sprintf(string, "total score"); else if (stage == 5) sprintf(string, "final stage"); else if ((stage >= 1) && (stage <= 4)) sprintf(string, "stage %d", stage); else sprintf(string, "stage ?"); string[40 - 1] = '\0'; if (draw_string(180, 60, string, (int) strlen(string)) != 0) fprintf(stderr, "show_high_score: draw_string (stage) failed\n"); if (timer_cursor < 20) { if (draw_string(60, 60, "<", 1) != 0) fprintf(stderr, "show_high_score: draw_string " "(left cursor) failed\n"); if (draw_string(WINDOW_WIDTH - 60, 60, ">", 1) != 0) fprintf(stderr, "show_high_score: draw_string " "(right cursor) failed\n"); if (rank > 0) { if (draw_string(240, 90, "^", 1) != 0) fprintf(stderr, "show_high_score: draw_string " "(up cursor) failed\n"); } if ((p != NULL) && (rank + 10 < (p[stage])->n) && (rank + 10 < high_score_list_size(stage))) { if (draw_string(240, 420, "v", 1) != 0) fprintf(stderr, "show_high_score: draw_string " "(down cursor) failed\n"); } } timer_cursor++; if (timer_cursor >= 40) timer_cursor = 0; if (p != NULL) { for (i = 0; (i < 10) && (i + rank< (p[stage])->n); i++) { entry = (p[stage])->p[i + rank]; sprintf(string, "%3d %8d ", i + rank + 1, ((bac_entry_ver_0 *) entry)->score_sort); #ifndef NOT_HAVE_POSIX if ((((bac_entry_ver_0 *) entry)->user_name_available) && (((bac_entry_ver_0 *) entry)->user_name != NULL)) sprintf(string + strlen(string), "%-12.12s", ((bac_entry_ver_0 *) entry)->user_name); else sprintf(string + strlen(string), "(uid %5d) ", ((bac_entry_ver_0 *) entry)->uid); #endif /* not NOT_HAVE_POSIX */ broken_time = localtime(&(((bac_entry_ver_0 *) entry)->when)); sprintf(string + strlen(string), " %4d/%2d/%2d", broken_time->tm_year + 1900, broken_time->tm_mon + 1, broken_time->tm_mday); string[40 - 1] = '\0'; if (draw_string(30, 120 + 30 * i, string, (int) strlen(string)) != 0) fprintf(stderr, "show_high_score: draw_string (#%d) failed\n", i + rank + 1); } } if (draw_string(110, 570, "press space for fast up/down", 28) != 0) fprintf(stderr, "show_high_score: draw_string (space instruction) " "failed\n"); if (draw_string(160, 600, "press ESC to quit", 17) != 0) fprintf(stderr, "show_high_score: draw_string (ESC instruction) " "failed\n"); tenm_redraw_window(); tenm_wait_next_frame(); } if (p != NULL) { for (i = 0; i < 6; i++) bac_array_delete(p[i]); free(p); } return quit_needed; } /* assumes every high score list has at least one entry * --- if not, read no entry at all and returns NULL */ bac_array ** read_high_score(int flag, int *no_entry) { int i; int j; char *file; bac_array **temp = NULL; temp = (bac_array **) malloc(sizeof(bac_array *) * 6); if (temp == NULL) { fprintf(stderr, "read_high_score: malloc(temp) failed\n"); return NULL; } for (i = 0; i < 6; i++) { file = high_score_file_name(i); if (file == NULL) { fprintf(stderr, "read_high_score: high_score_file_name(%d) " "failed\n", i); for (j = 0; j < i; j++) bac_array_delete(temp[j]); free(temp); return NULL; } temp[i] = bac_load(DATABASE_DIR, file, high_score_list_size(i), flag, DATABASE_MODE, no_entry); if (temp[i] == NULL) { if (*no_entry != 0) { printf("read_high_score: no entry in %s%s\n", DATABASE_DIR, file); fflush(stdout); } else { fprintf(stderr, "read_high_score: bac_load(%d) failed\n", i); } free(file); for (j = 0; j < i; j++) bac_array_delete(temp[j]); free(temp); return NULL; } free(file); } return temp; } /* return 0 on success, 1 on error */ int truncate_high_score(bac_array **array_list) { int stage; int size; char *file = NULL; /* sanity check */ if (array_list == NULL) return 0; for (stage = 0; stage < 6; stage++) { if (array_list[stage] == NULL) continue; size = high_score_list_size(stage); if ((array_list[stage])->n <= size) continue; file = high_score_file_name(stage); if (file == NULL) { fprintf(stderr, "truncate_high_score: high_score_file_name(%d) " "failed\n", stage); return 1; } if (bac_truncate(DATABASE_DIR, file, (array_list[stage])->p[size - 1], DATABASE_MODE) != 0) { fprintf(stderr, "truncate_high_score: bac_truncate(%d) failed\n", stage); free(file); return 1; } free(file); } return 0; } /* return 0 on success, 1 on error */ int read_default_score(void) { int i; char *file_default; char *file_list; int stage; FILE *fp = NULL; bac_array **array_list = NULL; bac_array *array_default = NULL; int no_entry; /* see if there is already an entry */ no_entry = 0; array_list = read_high_score(BAC_LOAD_FLAG_NO_SORT, &no_entry); if (array_list != NULL) { for (i = 0; i < 6; i++) bac_array_delete(array_list[i]); free(array_list); return 0; } if (no_entry == 0) { fprintf(stderr, "read_default_score: read_high_score failed\n"); return 1; } printf("read_default_score: reading default score files\n"); fflush(stdout); for (stage = 0; stage < 6; stage++) { file_default = default_file_name(stage); if (file_default == NULL) { fprintf(stderr, "read_default_score: default_file_name(%d) failed\n", stage); return 1; } file_list = high_score_file_name(stage); if (file_list == NULL) { fprintf(stderr, "read_default_score: high_score_file_name(%d) failed\n", stage); free(file_default); return 1; } fp = fopen(file_default, "r"); if (fp == NULL) { fprintf(stderr, "read_default_score: fopen(%d) failed\n", stage); free(file_list); free(file_default); return 1; } array_default = bac_file_to_array(fp); if (array_default == NULL) { fprintf(stderr, "read_default_score: bac_file_to_array(%d) failed\n", stage); fclose(fp); free(file_list); free(file_default); return 1; } for (i = 0; i < array_default->n; i++) { if (bac_save(DATABASE_DIR, file_list, array_default->p[i], DATABASE_MODE) != 0) { fprintf(stderr, "read_default_score: bac_save(stage %d entry %d) " "failed\n", stage, i); bac_array_delete(array_default); fclose(fp); free(file_list); free(file_default); return 1; } } bac_array_delete(array_default); fclose(fp); free(file_list); free(file_default); } return 0; } /* return value is relative to DATABASE_DIR */ static char * high_score_file_name(int stage) { char *temp; /* sanity check */ if ((stage < 0) || (stage > 5)) return NULL; temp = (char *) malloc(sizeof(char) * 20); if (temp == NULL) { fprintf(stderr, "high_score_file_name: malloc failed\n"); return NULL; } #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) if (stage == 0) sprintf(temp, "score-total.db3"); else sprintf(temp, "score-stage-%d.db3", stage); #else /* not (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ if (stage == 0) sprintf(temp, "score-total.txt"); else sprintf(temp, "score-stage-%d.txt", stage); #endif /* not (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ /* be paranoid */ temp[20 - 1] = '\0'; return temp; } /* return value is absolute */ static char * default_file_name(int stage) { size_t size; char *temp; /* sanity check */ if ((stage < 0) || (stage > 5)) return NULL; size = strlen(DEFAULT_DIR) + 20; temp = (char *) malloc(sizeof(char) * size); if (temp == NULL) { fprintf(stderr, "high_score_file_name: malloc failed\n"); return NULL; } sprintf(temp, DEFAULT_DIR); /* be paranoid */ temp[size - 1] = '\0'; if (stage == 0) sprintf(temp + strlen(temp), "score-total.txt"); else sprintf(temp + strlen(temp), "score-stage-%d.txt", stage); temp[size - 1] = '\0'; return temp; } tenmado-0.10/happy-L/high-score.h0000644000175000017500000000117410276702754017415 0ustar00ooharaoohara00000000000000/* $Id: high-score.h,v 1.18 2002/12/20 12:19:39 oohara Exp $ */ #ifndef __TENMADO_HIGH_SCORE_H__ #define __TENMADO_HIGH_SCORE_H__ #include "bac_array.h" /* constants for flag in read_high_score */ #include "bac_load.h" int high_score_list_size(int stage); bac_array *make_high_score(int total_score, const int *stage_score); int save_high_score(bac_array *array); int dump_high_score(int stage); int undump_high_score(int stage); int show_high_score(void); bac_array **read_high_score(int flag, int *no_entry); int truncate_high_score(bac_array **array_list); int read_default_score(void); #endif /* not __TENMADO_HIGH_SCORE_H__ */ tenmado-0.10/happy-L/image.c0000644000175000017500000005327510276702754016453 0ustar00ooharaoohara00000000000000/* $Id: image.c,v 1.46 2003/07/09 13:38:59 oohara Exp $ */ /* NOT_HAVE_POSIX */ #include #include #include "tenm_graphic.h" #include "image.h" #ifdef NOT_HAVE_POSIX #define IMAGEDIR "./happy-L/image" #else /* not NOT_HAVE_POSIX */ #define IMAGEDIR DATADIR "/games/tenmado/image" #endif /* not NOT_HAVE_POSIX */ static tenm_image *player_image = NULL; static tenm_image *small_ball_image = NULL; static tenm_image *medium_ball_image = NULL; static tenm_image *large_ball_image = NULL; static tenm_image *sting_image = NULL; static tenm_image *horizon_image = NULL; static tenm_image *plenty_image = NULL; static tenm_image *burst_image = NULL; static tenm_image *disconnection_core_image = NULL; static tenm_image *disconnection_bit_image = NULL; static tenm_image *fud_core_image = NULL; static tenm_image *intuition_image = NULL; static tenm_image *last_boss_image = NULL; static tenm_image *last_boss_demo_image = NULL; static tenm_image *midnight_image = NULL; static tenm_image *midnight_bit_image = NULL; static tenm_image *overrun_image = NULL; static tenm_image *overrun_bit_image = NULL; static tenm_image *solution_image = NULL; int image_init(void) { int status = 0; player_image = tenm_load_image(3, IMAGEDIR "/player-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/player-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/player-red.png", 1, 1, tenm_map_color(255, 255, 255)); if (player_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(player_image) failed\n"); status = 1; } small_ball_image = tenm_load_image(3, IMAGEDIR "/small-ball-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/small-ball-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/small-ball-red.png", 1, 1, tenm_map_color(255, 255, 255)); if (small_ball_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(small_ball_image) failed\n"); status = 1; } medium_ball_image = tenm_load_image(3, IMAGEDIR "/medium-ball-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/medium-ball-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/medium-ball-red.png", 1, 1, tenm_map_color(255, 255, 255)); if (medium_ball_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(medium_ball_image) failed\n"); status = 1; } large_ball_image = tenm_load_image(3, IMAGEDIR "/large-ball-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/large-ball-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/large-ball-red.png", 1, 1, tenm_map_color(255, 255, 255)); if (large_ball_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(large_ball_image) failed\n"); status = 1; } sting_image = tenm_load_image(6, IMAGEDIR "/sting-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/sting-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/sting-red.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/sting-blue-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/sting-purple-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/sting-red-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (sting_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(sting_image) failed\n"); status = 1; } horizon_image = tenm_load_image(6, IMAGEDIR "/horizon-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/horizon-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/horizon-red.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/horizon-blue-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/horizon-purple-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/horizon-red-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (horizon_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(horizon_image) failed\n"); status = 1; } plenty_image = tenm_load_image(6, IMAGEDIR "/plenty-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/plenty-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/plenty-red.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/plenty-blue-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/plenty-purple-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/plenty-red-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (plenty_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(plenty_image) failed\n"); status = 1; } burst_image = tenm_load_image(6, IMAGEDIR "/burst-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/burst-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/burst-red.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/burst-blue-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/burst-purple-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/burst-red-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (burst_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(burst_image) failed\n"); status = 1; } disconnection_core_image = tenm_load_image(2, IMAGEDIR "/disconnection-core.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/disconnection-core-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (disconnection_core_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(disconnection_core_image) " "failed\n"); status = 1; } disconnection_bit_image = tenm_load_image(1, IMAGEDIR "/disconnection-bit.png", 1, 1, tenm_map_color(255, 255, 255)); if (disconnection_bit_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(disconnection_bit_image) " "failed\n"); status = 1; } fud_core_image = tenm_load_image(8, IMAGEDIR "/fear.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/uncertainty.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/doubt.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/trinity.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/fear-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/uncertainty-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/doubt-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/trinity-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (fud_core_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(fud_core_image) failed\n"); status = 1; } intuition_image = tenm_load_image(2, IMAGEDIR "/intuition.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/intuition-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (intuition_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(intuition_image) " "failed\n"); status = 1; } last_boss_image = tenm_load_image(2, IMAGEDIR "/last-boss.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/last-boss-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (last_boss_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(last_boss_image) failed\n"); status = 1; } last_boss_demo_image = tenm_load_image(4, IMAGEDIR "/last-boss-demo-0.png",1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/last-boss-demo-1.png",1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/last-boss-demo-2.png",1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/last-boss-demo-3.png",1, 1, tenm_map_color(255, 255, 255)); if (last_boss_demo_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(last_boss_demo_image) " "failed\n"); status = 1; } midnight_image = tenm_load_image(2, IMAGEDIR "/midnight.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/midnight-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (midnight_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(midnight_image) failed\n"); status = 1; } /* this blue-red-purple order is intentional --- see midnight.c */ midnight_bit_image = tenm_load_image(6, IMAGEDIR "/midnight-bit-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/midnight-bit-red.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/midnight-bit-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/midnight-bit-blue-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/midnight-bit-red-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/midnight-bit-purple-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (midnight_bit_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(midnight_bit_image) " "failed\n"); status = 1; } overrun_image = tenm_load_image(2, IMAGEDIR "/overrun.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/overrun-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (overrun_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(overrun_image) failed\n"); status = 1; } overrun_bit_image = tenm_load_image(7, IMAGEDIR "/overrun-bit-blue.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/overrun-bit-purple.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/overrun-bit-red.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/overrun-bit-green.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/overrun-bit-blue-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/overrun-bit-purple-damaged.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/overrun-bit-red-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (overrun_bit_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(overrun_bit_image) " "failed\n"); status = 1; } solution_image = tenm_load_image(2, IMAGEDIR "/solution.png", 1, 1, tenm_map_color(255, 255, 255), IMAGEDIR "/solution-damaged.png", 1, 1, tenm_map_color(255, 255, 255)); if (solution_image == NULL) { fprintf(stderr, "image_init: tenm_load_image(solution_image) failed\n"); status = 1; } /* Don't call image_quit() here even if status is non-zero. * The idea is to load as many image files as possible. */ return status; } void image_quit(void) { /* these NULL checks are mandatory */ if (player_image != NULL) { tenm_image_delete(player_image); player_image = NULL; } if (small_ball_image != NULL) { tenm_image_delete(small_ball_image); small_ball_image = NULL; } if (medium_ball_image != NULL) { tenm_image_delete(medium_ball_image); medium_ball_image = NULL; } if (large_ball_image != NULL) { tenm_image_delete(large_ball_image); large_ball_image = NULL; } if (sting_image != NULL) { tenm_image_delete(sting_image); sting_image = NULL; } if (horizon_image != NULL) { tenm_image_delete(horizon_image); horizon_image = NULL; } if (plenty_image != NULL) { tenm_image_delete(plenty_image); plenty_image = NULL; } if (burst_image != NULL) { tenm_image_delete(burst_image); burst_image = NULL; } if (disconnection_core_image != NULL) { tenm_image_delete(disconnection_core_image); disconnection_core_image = NULL; } if (disconnection_bit_image != NULL) { tenm_image_delete(disconnection_bit_image); disconnection_bit_image = NULL; } if (fud_core_image != NULL) { tenm_image_delete(fud_core_image); fud_core_image = NULL; } if (intuition_image != NULL) { tenm_image_delete(intuition_image); intuition_image = NULL; } if (last_boss_image != NULL) { tenm_image_delete(last_boss_image); last_boss_image = NULL; } if (last_boss_demo_image != NULL) { tenm_image_delete(last_boss_demo_image); last_boss_demo_image = NULL; } if (midnight_image != NULL) { tenm_image_delete(midnight_image); midnight_image = NULL; } if (midnight_bit_image != NULL) { tenm_image_delete(midnight_bit_image); midnight_bit_image = NULL; } if (overrun_image != NULL) { tenm_image_delete(overrun_image); overrun_image = NULL; } if (overrun_bit_image != NULL) { tenm_image_delete(overrun_bit_image); overrun_bit_image = NULL; } if (solution_image != NULL) { tenm_image_delete(solution_image); solution_image = NULL; } } int player_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 3)) return 0; if (player_image == NULL) return 0; return tenm_draw_image(x - 30, y - 30, player_image, n); } int small_ball_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 3)) return 0; if (small_ball_image == NULL) return 0; return tenm_draw_image(x - 15, y - 15, small_ball_image, n); } int medium_ball_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 3)) return 0; if (medium_ball_image == NULL) return 0; return tenm_draw_image(x - 20, y - 20, medium_ball_image, n); } int large_ball_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 3)) return 0; if (large_ball_image == NULL) return 0; return tenm_draw_image(x - 25, y - 25, large_ball_image, n); } int sting_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 6)) return 0; if (sting_image == NULL) return 0; return tenm_draw_image(x - 32, y - 24, sting_image, n); } int horizon_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 6)) return 0; if (horizon_image == NULL) return 0; return tenm_draw_image(x - 25, y - 25, horizon_image, n); } int plenty_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 6)) return 0; if (plenty_image == NULL) return 0; return tenm_draw_image(x - 36, y - 48, plenty_image, n); } int burst_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 6)) return 0; if (burst_image == NULL) return 0; return tenm_draw_image(x - 24, y - 32, burst_image, n); } int disconnection_core_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 2)) return 0; if (disconnection_core_image == NULL) return 0; return tenm_draw_image(x - 35, y - 35, disconnection_core_image, n); } int disconnection_bit_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 3)) return 0; if (disconnection_bit_image == NULL) return 0; return tenm_draw_image(x - 25, y - 25, disconnection_bit_image, n); } int fud_core_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 8)) return 0; if (fud_core_image == NULL) return 0; return tenm_draw_image(x - 25, y - 25, fud_core_image, n); } int intuition_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 2)) return 0; if (intuition_image == NULL) return 0; return tenm_draw_image(x - 50, y - 43, intuition_image, n); } int last_boss_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 2)) return 0; if (last_boss_image == NULL) return 0; return tenm_draw_image(x - 60, y - 60, last_boss_image, n); } int last_boss_demo_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 4)) return 0; if (last_boss_demo_image == NULL) return 0; return tenm_draw_image(x - 60, y - 60, last_boss_demo_image, n); } int midnight_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 2)) return 0; if (midnight_image == NULL) return 0; return tenm_draw_image(x - 64, y - 48, midnight_image, n); } int midnight_bit_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 6)) return 0; if (midnight_bit_image == NULL) return 0; return tenm_draw_image(x - 32, y - 10, midnight_bit_image, n); } int overrun_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 2)) return 0; if (overrun_image == NULL) return 0; return tenm_draw_image(x - 50, y - 50, overrun_image, n); } int overrun_bit_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 7)) return 0; if (overrun_bit_image == NULL) return 0; return tenm_draw_image(x - 25, y - 25, overrun_bit_image, n); } int solution_blit(int x, int y, int n) { /* sanity check */ if ((n < 0) || (n >= 2)) return 0; if (solution_image == NULL) return 0; return tenm_draw_image(x - 48, y - 36, solution_image, n); } tenmado-0.10/happy-L/image.h0000644000175000017500000000173410276702754016451 0ustar00ooharaoohara00000000000000/* $Id: image.h,v 1.8 2002/07/13 16:10:24 oohara Exp $ */ #ifndef __TENMADO_IMAGE_H__ #define __TENMADO_IMAGE_H__ int image_init(void); void image_quit(void); int player_blit(int x, int y, int n); int small_ball_blit(int x, int y, int n); int medium_ball_blit(int x, int y, int n); int large_ball_blit(int x, int y, int n); int sting_blit(int x, int y, int n); int horizon_blit(int x, int y, int n); int plenty_blit(int x, int y, int n); int burst_blit(int x, int y, int n); int disconnection_core_blit(int x, int y, int n); int disconnection_bit_blit(int x, int y, int n); int fud_core_blit(int x, int y, int n); int intuition_blit(int x, int y, int n); int last_boss_blit(int x, int y, int n); int last_boss_demo_blit(int x, int y, int n); int midnight_blit(int x, int y, int n); int midnight_bit_blit(int x, int y, int n); int overrun_blit(int x, int y, int n); int overrun_bit_blit(int x, int y, int n); int solution_blit(int x, int y, int n); #endif /* not __TENMADO_IMAGE_H__*/ tenmado-0.10/happy-L/intuition.c0000644000175000017500000003331110276702754017400 0ustar00ooharaoohara00000000000000/* $Id: intuition.c,v 1.40 2003/01/15 01:47:44 oohara Exp $ */ #include /* malloc, rand */ #include /* strcmp */ #include #include "tenm_primitive.h" #include "tenm_object.h" #include "const.h" #include "tenm_table.h" #include "score.h" #include "tenm_graphic.h" #include "hit-status.h" #include "explosion.h" #include "chain.h" #include "util.h" #include "laser.h" #include "tenm_math.h" #include "image.h" #include "intuition.h" #define INTUITION_HIT_POINT 750 static int intuition_move(tenm_object *my, double turn_per_frame); static int intuition_hit(tenm_object *my, tenm_object *your); static int intuition_signal(tenm_object *my, int n); static int intuition_act(tenm_object *my, const tenm_object *player); static int intuition_draw(tenm_object *my, int priority); static tenm_object *wave_shot_new(double x, double y, double target_x, double target_y); static int wave_shot_move(tenm_object *my, double turn_per_frame); static int wave_shot_hit(tenm_object *my, tenm_object *your); static int wave_shot_act(tenm_object *my, const tenm_object *player); static int wave_shot_draw(tenm_object *my, int priority); tenm_object * intuition_new(int parent_index) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double x = ((double) WINDOW_WIDTH) / 2.0; double y = -42.3; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "intuition_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_polygon_new(3, x, y - 43.3, x + 50.0, y + 43.3, x - 50.0, y + 43.3); if (p[0] == NULL) { fprintf(stderr, "intuition_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "intuition_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "intuition_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] table index of parent * [1] total timer * [2] shoot timer * [3] "damaged" flag */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = parent_index; count[1] = 0; count[2] = 0; count[3] = 0; count_d[0] = 0.0; count_d[1] = 10.0; new = tenm_object_new("Intuition", ATTR_ENEMY, ATTR_PLAYER_SHOT, INTUITION_HIT_POINT, x, y, 4, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) intuition_move, (int (*)(tenm_object *, tenm_object *)) intuition_hit, (int (*)(tenm_object *, const tenm_object *)) intuition_act, (int (*)(tenm_object *, int)) intuition_draw); if (new == NULL) { fprintf(stderr, "intuition_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int intuition_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); if (!in_window_object(my)) { tenm_table_apply(my->count[0], (int (*)(tenm_object *, int)) intuition_signal, 0); return 1; } return 0; } static int intuition_hit(tenm_object *my, tenm_object *your) { /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (!(your->attr & ATTR_PLAYER_SHOT)) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[3] = 1; set_hit_status(my->name, INTUITION_HIT_POINT, my->hit_point); if (my->hit_point <= 0) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 3000, COLOR_PURPLE, 6.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 500, COLOR_PURPLE, 4.0, 12)); tenm_table_apply(my->count[0], (int (*)(tenm_object *, int)) intuition_signal, 0); add_killed(COLOR_PURPLE); add_score(500); return 1; } return 0; } static int intuition_signal(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "stage 2 more 1") != 0) return 0; my->count[3] = 1; return 0; } static int intuition_act(tenm_object *my, const tenm_object *player) { double speed; int theta; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; /* speed change */ (my->count[1])++; if (my->count[1] == 13) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 145) { my->count_d[0] = -10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 155) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 345) { my->count_d[0] = 10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 355) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 405) { my->count_d[0] = 10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 415) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 590) { my->count_d[0] = -10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 600) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 645) { my->count_d[0] = -10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 655) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 830) { my->count_d[0] = 10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 840) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 885) { my->count_d[0] = 10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 895) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1065) { my->count_d[0] = -10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1075) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1310) { my->count_d[0] = 10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1322) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1450) { my->count_d[0] = -10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1462) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1555) { my->count_d[0] = -10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1567) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1690) { my->count_d[0] = 10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1702) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1828) { my->count_d[0] = 10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1840) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1862) { my->count_d[0] = -10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1886) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1926) { my->count_d[0] = 10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1950) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 1986) { my->count_d[0] = -10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 2010) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 2046) { my->count_d[0] = 10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 2070) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 2100) { my->count_d[0] = -10.0; my->count_d[1] = 0.0; } else if (my->count[1] == 2112) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[1] == 2300) { my->count_d[0] = 0.0; my->count_d[1] = -10.0; } /* shoot */ (my->count[2])++; if ((my->count[2] >= 40) && (my->count[2] <= 70) && (my->count[2] % 5 == 0)) { speed = ((double) my->count[2]) / 5.0 - 4.0; theta = my->count[2] * 2 - 20; tenm_table_add(laser_angle_new(my->x, my->y, speed, theta, 30.0, COLOR_PURPLE, 1000)); } else if ((my->count[2] >= 115) && (my->count[2] <= 145) && (my->count[2] % 5 == 0)) { speed = ((double) (my->count[2] - 75)) / 5.0 - 4.0; theta = 350 - my->count[2] * 2; tenm_table_add(laser_angle_new(my->x, my->y, speed, theta, 30.0, COLOR_PURPLE, 1000)); } if (my->count[2] % 15 == 0) tenm_table_add(wave_shot_new(my->x, my->y, player->x, player->y)); if (my->count[2] >= 150) my->count[2] = 0; return 0; } static int intuition_draw(tenm_object *my, int priority) { int n = 0; tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 0) return 0; if (my->count[3] == 0) n = 0; else n = 1; if (intuition_blit((int) (my->x), (int) (my->y), n) != 0) { fprintf(stderr, "intuition_draw: intuition_blit failed\n"); my->count[3] = 0; return 1; } my->count[3] = 0; return 0; /* the below may be useful for debugging */ color = tenm_map_color(78, 59, 156); if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "intuition_draw: tenm_draw_mass failed\n"); return 1; } return 0; } static tenm_object * wave_shot_new(double x, double y, double target_x, double target_y) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double dx; double dy; double temp; int temp_theta; dx = target_x - x; dy = target_y - y; temp = tenm_sqrt((int) (dx * dx + dy * dy)); if (temp <= 0.0) { /* shoot at a random direction */ temp_theta = rand() % 360; dx = tenm_cos(temp_theta); dy = tenm_sin(temp_theta); temp = 1.0; } p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "wave_shot_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 5.0); if (p[0] == NULL) { fprintf(stderr, "wave_shot_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 2); if (count == NULL) { fprintf(stderr, "wave_shot_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "wave_shot_new: malloc(count_d) failed\n"); free(count); (p[0])->delete(p[0]); free(p); return NULL; } /* list of count * [0] color (just for delete_enemy_shot) * [1] ddx timer */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = COLOR_PURPLE; if (target_x >= x) count[1] = 16; else count[1] = 48; count_d[0] = 6.0 * dx / temp; count_d[1] = 6.0 * dy / temp; new = tenm_object_new("wave shot", ATTR_ENEMY_SHOT, ATTR_OPAQUE, 1, x, y, 2, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) wave_shot_move, (int (*)(tenm_object *, tenm_object *)) wave_shot_hit, (int (*)(tenm_object *, const tenm_object *)) wave_shot_act, (int (*)(tenm_object *, int)) wave_shot_draw); if (new == NULL) { fprintf(stderr, "wave_shot_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int wave_shot_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); if (!in_window_object(my)) return 1; return 0; } static int wave_shot_hit(tenm_object *my, tenm_object *your) { /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (your->attr & ATTR_OPAQUE) return 1; return 0; } static int wave_shot_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; (my->count[1])++; if (my->count[1] <= 32) my->count_d[0] += 0.5; else my->count_d[0] -= 0.5; if (my->count[1] >= 64) my->count[1] = 0; return 0; } static int wave_shot_draw(tenm_object *my, int priority) { tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 1) return 0; color = tenm_map_color(127, 0, 255); if (tenm_draw_circle((int) (my->x), (int) (my->y), 5, 2, color) != 0) return 1; /* may be useful for debugging */ /* if (tenm_draw_primitive(my->mass->p[0], color) != 0) return 1; */ return 0; } tenmado-0.10/happy-L/intuition.h0000644000175000017500000000036210276702754017405 0ustar00ooharaoohara00000000000000/* $Id: intuition.h,v 1.1 2002/06/08 05:10:13 oohara Exp $ */ #ifndef __TENMADO_INTUITION_H__ #define __TENMADO_INTUITION_H__ #include "tenm_object.h" tenm_object *intuition_new(int parent_index); #endif /* not __TENMADO_INTUITION_H__ */ tenmado-0.10/happy-L/laser.c0000644000175000017500000001517210276702754016471 0ustar00ooharaoohara00000000000000/* $Id: laser.c,v 1.32 2003/01/15 01:45:07 oohara Exp $ */ #include /* malloc, rand */ #include #include "const.h" #include "tenm_object.h" #include "tenm_math.h" #include "tenm_graphic.h" #include "util.h" #include "tenm_primitive.h" #include "laser.h" #define NEAR_ZERO 0.0001 static int laser_move(tenm_object *my, double turn_per_frame); static int laser_act(tenm_object *my, const tenm_object *player); static int laser_draw(tenm_object *my, int priority); /* speed must be positive --- use laser_new instead if you want a laser * that doesn't move */ tenm_object * laser_angle_new(double x, double y, double speed, int theta, double length, int color, int life) { /* sanity check */ if (speed < NEAR_ZERO) { fprintf(stderr, "laser_angle_new: speed is non-positive (%f)\n", speed); return NULL; } if (length <= NEAR_ZERO) { fprintf(stderr, "laser_angle_new: length is non-positive (%f)\n", length); return NULL; } if (life <= 0) { fprintf(stderr, "laser_angle_new: life is non-positive (%d)\n", life); return NULL; } return laser_new(x, y, speed * tenm_cos(theta), speed * tenm_sin(theta), length * tenm_cos(theta), length * tenm_sin(theta), color, life); } /* speed must be positive --- use laser_new instead if you want a laser * that doesn't move * if (x, y) and (target_x, target_y) are very close, shoot at a random * direction */ tenm_object * laser_point_new(double x, double y, double speed, double target_x, double target_y, double length, int color, int life) { double dx; double dy; double temp; int temp_theta; /* sanity check */ if (speed < NEAR_ZERO) { fprintf(stderr, "laser_point_new: speed is non-positive (%f)\n", speed); return NULL; } if (length <= NEAR_ZERO) { fprintf(stderr, "laser_point_new: length is non-positive (%f)\n", length); return NULL; } if (life <= 0) { fprintf(stderr, "laser_point_new: length is non-positive (%d)\n", life); return NULL; } dx = target_x - x; dy = target_y - y; temp = tenm_sqrt((int) (dx * dx + dy * dy)); if (temp <= NEAR_ZERO) { /* shoot at a random direction */ temp_theta = rand() % 360; dx = tenm_cos(temp_theta); dy = tenm_sin(temp_theta); temp = 1.0; } return laser_new(x, y, speed * dx / temp, speed * dy / temp, length * dx / temp, length * dy / temp, color, life); } /* list of count * [0] color * [1] life */ /* list of count_d * [0] speed x * [1] speed y */ tenm_object * laser_new(double x, double y, double speed_x, double speed_y, double length_x, double length_y, int color, int life) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; /* sanity check */ if (life <= 0) { fprintf(stderr, "laser_new: life is non-positive (%d)\n", life); return NULL; } p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "laser_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_segment_new(x, y, x + length_x, y + length_y); if (p[0] == NULL) { fprintf(stderr, "laser_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 2); if (count == NULL) { fprintf(stderr, "laser_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "laser_new: malloc(count_d) failed\n"); free(count); (p[0])->delete(p[0]); free(p); return NULL; } count[0] = color; count[1] = life; count_d[0] = speed_x; count_d[1] = speed_y; new = tenm_object_new("laser", ATTR_ENEMY_SHOT, 0, 1, x, y, 2, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) laser_move, NULL, (int (*)(tenm_object *, const tenm_object *)) laser_act, (int (*)(tenm_object *, int)) laser_draw); if (new == NULL) { fprintf(stderr, "laser_new: tenm_object_new failed\n"); free(count_d); free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int laser_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) { fprintf(stderr, "laser_move: my is NULL\n"); return 0; } if (turn_per_frame <= 0.5) { fprintf(stderr, "laser_move: strange turn_per_frame (%f)\n", turn_per_frame); return 0; } dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); if (!in_window_object(my)) return 1; return 0; } static int laser_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) { fprintf(stderr, "laser_act: my is NULL\n"); return 0; } /* player == NULL is OK */ (my->count[1])--; if (my->count[1] <= 0) return 1; return 0; } static int laser_draw(tenm_object *my, int priority) { int status = 0; tenm_color color; /* sanity check */ if (my == NULL) { fprintf(stderr, "laser_draw: my is NULL\n"); return 0; } /* return if it is not my turn */ if (priority != 1) return 0; switch (my->count[0]) { case COLOR_BLUE: color = tenm_map_color(0, 63, 255); break; case COLOR_PURPLE: color = tenm_map_color(127, 0, 255); break; case COLOR_RED: color = tenm_map_color(255, 0, 50); break; case COLOR_GREEN: color = tenm_map_color(0, 255, 63); break; default: fprintf(stderr, "laser_draw: strange my->count[0] (%d)\n", my->count[0]); color = tenm_map_color(0, 0, 0); break; } /* width > 1 costs much, but width = 1 looks too bad */ if (tenm_draw_line((int) (((tenm_segment *) my->mass->p[0])->a->x), (int) (((tenm_segment *) my->mass->p[0])->a->y), (int) (((tenm_segment *) my->mass->p[0])->b->x), (int) (((tenm_segment *) my->mass->p[0])->b->y), 3, color) != 0) status = 1; /* if (tenm_draw_primitive(my->mass->p[0], tenm_map_color(0, 0, 0)) != 0) status = 1; */ return status; } tenmado-0.10/happy-L/laser.h0000644000175000017500000000131110276702754016464 0ustar00ooharaoohara00000000000000/* $Id: laser.h,v 1.5 2002/05/19 07:40:30 oohara Exp $ */ #ifndef __TENMADO_LASER_H__ #define __TENMADO_LASER_H__ #include "tenm_object.h" tenm_object *laser_angle_new(double x, double y, double speed, int theta, double length, int color, int life); tenm_object *laser_point_new(double x, double y, double speed, double target_x, double target_y, double length, int color, int life); tenm_object *laser_new(double x, double y, double speed_x, double speed_y, double length_x, double length_y, int color, int life); #endif /* not __TENMADO_LASER_H__ */ tenmado-0.10/happy-L/last-boss.c0000644000175000017500000007755310276702754017305 0ustar00ooharaoohara00000000000000/* $Id: last-boss.c,v 1.311 2003/08/21 20:41:33 oohara Exp $ */ #include /* malloc, rand */ #include #include "tenm_primitive.h" #include "tenm_object.h" #include "tenm_graphic.h" #include "const.h" #include "score.h" #include "tenm_table.h" #include "explosion.h" #include "chain.h" #include "hit-status.h" #include "laser.h" #include "normal-shot.h" #include "util.h" #include "stage-clear.h" #include "tenm_math.h" #include "rotate-laser.h" #include "image.h" #include "last-boss.h" #define MODE_0_HIT_POINT 1000 #define MODE_1_HIT_POINT 500 #define MODE_2_HIT_POINT 1000 #define MODE_3_HIT_POINT 750 #define TIME_DEMO 150 #define NEAR_ZERO 0.0001 static int last_boss_move(tenm_object *my, double turn_per_frame); static int last_boss_hit(tenm_object *my, tenm_object *your); static int last_boss_act(tenm_object *my, const tenm_object *player); static int last_boss_act_0(tenm_object *my, const tenm_object *player); static int last_boss_act_1(tenm_object *my, const tenm_object *player); static int last_boss_act_2(tenm_object *my, const tenm_object *player); static int last_boss_act_3(tenm_object *my, const tenm_object *player); static int last_boss_act_4(tenm_object *my, const tenm_object *player); static int last_boss_draw(tenm_object *my, int priority); static tenm_object *reminder_new(int x, int y, int shrink_speed, int color, int life); static int reminder_act(tenm_object *my, const tenm_object *player); static int reminder_draw(tenm_object *my, int priority); static tenm_object *surprise_laser_new(int x, int y); static int surprise_laser_act(tenm_object *my, const tenm_object *player); static tenm_object *spread_shot_new(int x, int y, int life); static int spread_shot_act(tenm_object *my, const tenm_object *player); static tenm_object *rotate_shot_new(double x, double y, double speed_r, int theta, double speed_theta, int color, int life); static int rotate_shot_move(tenm_object *my, double turn_per_frame); static int rotate_shot_act(tenm_object *my, const tenm_object *player); static int rotate_shot_draw(tenm_object *my, int priority); static tenm_object *clock_shot_new(double x, double y, int theta, int clockwise); static int clock_shot_move(tenm_object *my, double turn_per_frame); static int clock_shot_act(tenm_object *my, const tenm_object *player); static int clock_shot_draw(tenm_object *my, int priority); tenm_object *last_boss_demo_new(double x, double y, int n); static int last_boss_demo_act(tenm_object *my, const tenm_object *player); static int last_boss_demo_draw(tenm_object *my, int priority); tenm_object * last_boss_new(void) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double x = (double) (WINDOW_WIDTH / 2); double y = -59.0; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "last_boss_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 60.0); if (p[0] == NULL) { fprintf(stderr, "last_boss_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 6); if (count == NULL) { fprintf(stderr, "last_boss_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 3); if (count_d == NULL) { fprintf(stderr, "last_boss_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] mode * [1] shoot timer * [2] immutable timer * [3] rotate laser timer (for mode 1) * [4] demo timer * [5] "damaged" flag */ count[0] = 0; count[1] = 48; count[2] = 3; count[3] = 0; count[4] = TIME_DEMO; count[5] = 0; /* list of count_d * [0] speed x * [1] speed y * [2] speed r (for mode 1) */ count_d[0] = 0.0; count_d[1] = (100.0 - y) / ((double) (TIME_DEMO - 50)); count_d[2] = 0.0; new = tenm_object_new("L", ATTR_ENEMY, ATTR_PLAYER_SHOT, MODE_0_HIT_POINT, x, y, 6, count, 3, count_d, 1, p, (int (*)(tenm_object *, double)) last_boss_move, (int (*)(tenm_object *, tenm_object *)) last_boss_hit, (int (*)(tenm_object *, const tenm_object *)) last_boss_act, (int (*)(tenm_object *, int)) last_boss_draw); if (new == NULL) { fprintf(stderr, "last_boss_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int last_boss_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; if ((my->count[4] <= 0) && (my->count[2] > 0)) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->mass != NULL) && (!in_window_object(my))) { fprintf(stderr, "last_boss_move: the object is out of the window\n"); return 1; } return 0; } static int last_boss_hit(tenm_object *my, tenm_object *your) { int score = 10000; int hit_point = MODE_0_HIT_POINT; double time_move; /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (!(your->attr & ATTR_PLAYER_SHOT)) return 0; /* immutable time */ if (my->count[2] > 0) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[5] = 1; if (my->count[0] == 0) { hit_point = MODE_0_HIT_POINT; score = 10000; } else if (my->count[0] == 1) { hit_point = MODE_1_HIT_POINT; score = 15000; } else if (my->count[0] == 2) { hit_point = MODE_2_HIT_POINT; score = 25000; } else if (my->count[0] == 3) { hit_point = MODE_3_HIT_POINT; score = 50000; } set_hit_status(my->name, hit_point, my->hit_point); if (my->hit_point <= 0) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 2000, COLOR_PURPLE, 15.0, 16)); add_killed(COLOR_PURPLE); add_score(score); tenm_table_apply_all((int (*)(tenm_object *, int)) delete_enemy_shot, 0); time_move = ((double) (TIME_DEMO - 50)); if (my->count[0] == 0) { my->hit_point = MODE_1_HIT_POINT; my->count[0] = 1; my->count[1] = 48; my->count[2] = 3; my->count[4] = TIME_DEMO; my->count[5] = 0; my->count_d[0] = (((double) (WINDOW_WIDTH / 2)) - my->x) / time_move; my->count_d[1] = (((double) (WINDOW_HEIGHT / 2))- 50.0- my->y)/time_move; return 0; } else if (my->count[0] == 1) { my->hit_point = MODE_2_HIT_POINT; my->count[0] = 2; my->count[1] = 48; my->count[2] = 3; my->count[4] = TIME_DEMO; my->count[5] = 0; my->count_d[0] = (((double) (WINDOW_WIDTH / 2)) - my->x) / time_move; my->count_d[1] = (100.0 - my->y) / time_move; return 0; } else if (my->count[0] == 2) { my->hit_point = MODE_3_HIT_POINT; my->count[0] = 3; my->count[1] = 64; my->count[2] = 4; my->count[4] = TIME_DEMO; my->count[5] = 0; my->count_d[0] = (((double) (WINDOW_WIDTH / 2)) - my->x) / time_move; my->count_d[1] = (100.0 - my->y) / time_move; return 0; } /* the boss is dead */ /* don't modify my->attr or my->hit_mask here, or the player shot * may fly through the enemy */ if (my->mass != NULL) tenm_mass_delete(my->mass); my->mass = NULL; my->count[0] = 4; my->count[1] = 0; my->count[5] = 0; my->count_d[0] = 0.0; my->count_d[1] = 0.5; return 0; } return 0; } static int last_boss_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; if (my->count[4] > 0) { (my->count[4])--; if ((my->count[4] == TIME_DEMO - 1) && (my->count[0] != 4)) tenm_table_add(last_boss_demo_new(100.0, 400.0, my->count[0])); if (my->count[4] == 50) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } if (my->count[4] > 0) return 0; if (my->count[0] == 0) { my->count_d[0] = 3.0; my->count_d[1] = 0.0; } else if (my->count[0] == 1) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[0] == 2) { my->count_d[0] = 3.0; my->count_d[1] = 0.0; } else if (my->count[0] == 3) { my->count_d[0] = (400.0 - my->x) / 24.0; my->count_d[1] = 0.0; } return 0; } if (my->count[0] == 0) return last_boss_act_0(my, player); else if (my->count[0] == 1) return last_boss_act_1(my, player); else if (my->count[0] == 2) return last_boss_act_2(my, player); else if (my->count[0] == 3) return last_boss_act_3(my, player); else if (my->count[0] == 4) return last_boss_act_4(my, player); else fprintf(stderr, "last_boss_act: strange mode (%d)\n", my->count[0]); return 0; } static int last_boss_act_0(tenm_object *my, const tenm_object *player) { if ((my->x <= 140.0) && (my->count_d[0] < 3.0)) my->count_d[0] += 0.1; if ((my->x >= ((double) WINDOW_WIDTH) - 140.0) && (my->count_d[0] > -3.0)) my->count_d[0] -= 0.1; (my->count[1])++; if ((my->count[2] <= 0) && (my->count[1] % 4 == 0)) tenm_table_add(normal_shot_point_new(my->x + (double)(rand() % 61) - 30.0, my->y + (double)(rand() % 61) - 30.0, 6.5 + (double)(rand() % 5), player->x+ (double)(rand()%201)-100.0, player->y+ (double)(rand()%201)-100.0, COLOR_PURPLE, 1000)); if (my->count[1] >= 48) { tenm_table_add(surprise_laser_new(60, 60)); tenm_table_add(surprise_laser_new(WINDOW_WIDTH - 60, 60)); my->count[1] = 0; if (my->count[2] > 0) (my->count[2])--; } return 0; } static int last_boss_act_1(tenm_object *my, const tenm_object *player) { double r_x; double r_y; double r_length; double dr_x; double dr_y; double temp; int i; int clockwise; r_x = my->x - ((double) (WINDOW_WIDTH / 2)); r_y = my->y - ((double) (WINDOW_HEIGHT / 2)); r_length = tenm_sqrt((int) (r_x * r_x + r_y * r_y)); r_x /= r_length; r_y /= r_length; if (my->count[2] <= 0) { /* make sure we have a positive radius */ if (r_length <= 50.0) my->count_d[2] = 0.0; if ((r_length <= 70.0) && (my->count_d[2] < 3.0)) my->count_d[2] += 0.02; if ((r_length >= 85.0) && (my->count_d[2] > -3.0)) my->count_d[2] -= 0.02; } dr_x = -r_y; dr_y = r_x; temp = r_length / 5.0; my->count_d[0] = my->count_d[2] * r_x + 0.3 * dr_x * temp; my->count_d[1] = my->count_d[2] * r_y + 0.3 * dr_y * temp; tenm_table_add(rotate_laser_new(my->x, my->y, my->count_d[0], my->count_d[1], my->count[3] * 3 + 270, 3.0, 325.0, COLOR_PURPLE, 1)); if ((my->count[1] >= 0) && (my->count[1] < 15)) { tenm_table_add(rotate_laser_new(my->x, my->y, my->count_d[0], my->count_d[1], my->count[3] * 4 + 270, 4.0, 800.0, COLOR_PURPLE, 1)); } if ((my->count[3] % 45 == 0) && (my->count[2] <= 0)) { if (my->count[3] % 90 == 0) clockwise = 1; else clockwise = 0; for (i = 0; i < 6; i++) tenm_table_add(clock_shot_new(my->x, my->y, i * 60, clockwise)); } (my->count[3])++; if (my->count[3] >= 360) { my->count[3] = 0; } (my->count[1])++; /* a prime number provides aperiodicity */ if (my->count[1] >= 29) { my->count[1] = 0; if (my->count[2] > 0) (my->count[2])--; } return 0; } static int last_boss_act_2(tenm_object *my, const tenm_object *player) { if ((my->x <= 140.0) && (my->count_d[0] < 3.0)) my->count_d[0] += 0.1; if ((my->x >= ((double) WINDOW_WIDTH) - 140.0) && (my->count_d[0] > -3.0)) my->count_d[0] -= 0.1; (my->count[1])++; if ((my->count[2] <= 0) && (my->count[1] % 12 == 0)) tenm_table_add(laser_point_new(my->x + (double)(rand() % 61) - 30.0, my->y + (double)(rand() % 61) - 30.0, 12.0, player->x, player->y, 50.0, COLOR_PURPLE, 1000)); if ((my->count[1] == 5) || (my->count[1] == 10) || (my->count[1] == 15) || (my->count[1] == 20)) tenm_table_add(spread_shot_new(rand() % WINDOW_WIDTH, rand() % WINDOW_HEIGHT, 60 + my->count[1] * 2)); if (my->count[1] >= 60) { my->count[1] = 0; if (my->count[2] > 0) (my->count[2])--; } return 0; } static int last_boss_act_3(tenm_object *my, const tenm_object *player) { int i; int j; double x_temp; double y_temp; double speed_theta; int theta; int clockwise; (my->count[1])++; if (my->count[2] <= 0) { if (my->count[1] % 2 == 0) { theta = rand() % 120 + 30; x_temp = ((double) (rand() % WINDOW_WIDTH)) - tenm_cos(theta) * 28.0; y_temp = 0.0 - tenm_sin(theta) * 28.0; tenm_table_add(laser_angle_new(x_temp, y_temp, 25.0, theta, 30.0, COLOR_GREEN, 1000)); } } if (my->count[1] == 24) my->count_d[0] = 0.0; if (my->count[1] >= 32) { theta = rand() % 360; clockwise = 1 - (rand() % 2) * 2; speed_theta = 0.45 * (double) clockwise; for (i = 1; i <= 8; i++) for (j = 1; j <= 2; j++) { tenm_table_add(rotate_shot_new(my->x, my->y, 5.0, theta * clockwise, speed_theta, COLOR_PURPLE, 150)); theta -= i * 5; } if ((my->x <= 200.0) || (my->x >= 280.0)) my->count_d[0] = (240.0 - my->x) / 24.0; else if (rand() % 2 == 0) my->count_d[0] = (400.0 - my->x) / 24.0; else my->count_d[0] = (80.0 - my->x) / 24.0; my->count[1] = 0; if (my->count[2] > 0) (my->count[2])--; } return 0; } /* the boss is dead */ static int last_boss_act_4(tenm_object *my, const tenm_object *player) { double x; double y; (my->count[1])++; if (my->count[1] < 160) { if(my->count[1] % 4 == 0) { x = my->x + (double) (rand() % 91 - 45); y = my->y + (double) (rand() % 91 - 45); tenm_table_add(explosion_new(x, y, 0.0, -0.5, 1, 500, COLOR_PURPLE, 12.0, 12)); } if(my->count[1] % 9 == 0) { x = my->x + (double) (rand() % 91 - 45); y = my->y + (double) (rand() % 91 - 45); tenm_table_add(explosion_new(x, y, 0.0, -0.5, 2, 300, COLOR_PURPLE, 7.0, 12)); } } else if (my->count[1] == 160) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 15000, COLOR_PURPLE, 16.0, 15)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 3000, COLOR_PURPLE, 12.0, 15)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 3, 600, COLOR_PURPLE, 9.0, 15)); return 0; } else if (my->count[1] == 300) { tenm_table_add(stage_clear_new(5)); return 1; } return 0; } static int last_boss_draw(tenm_object *my, int priority) { int n = 0; int status = 0; /* sanity check */ if (my == NULL) return 0; /* dead boss has lower priority */ if (my->count[0] == 4) { if (priority != -1) return 0; } else { if (priority != 0) return 0; } if ((my->count[0] == 4) && (my->count[1] >= 160)) return 0; if (my->count[5] == 0) n = 0; else n = 1; if (last_boss_blit((int) my->x, (int) my->y, n) != 0) status = 1; /* if (tenm_draw_primitive(my->mass->p[0], tenm_map_color(0, 0, 0)) != 0) status = 1; */ my->count[5] = 0; return status; } static tenm_object * reminder_new(int x, int y, int shrink_speed, int color, int life) { tenm_object *new = NULL; int *count = NULL; /* sanity check */ if (shrink_speed <= 0) return NULL; if (life <= 0) return NULL; count = (int *) malloc(sizeof(int) * 3); if (count == NULL) { fprintf(stderr, "reminder_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] color * [1] life * [2] shrink speed */ count[0] = color; count[1] = life; count[2] = shrink_speed; /* ATTR_ENEMY_SHOT is only to clear it when the player is killed */ new = tenm_object_new("reminder", ATTR_ENEMY_SHOT, 0, 0, (double) x, (double) y, 3, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) reminder_act, (int (*)(tenm_object *, int)) reminder_draw); if (new == NULL) { fprintf(stderr, "reminder_new: tenm_object_new failed\n"); if (count != NULL) free(count); return NULL; } return new; } static int reminder_act(tenm_object *my, const tenm_object *player) { (my->count[1])--; if (my->count[1] <= 0) return 1; return 0; } static int reminder_draw(tenm_object *my, int priority) { int status = 0; tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 0) return 0; switch (my->count[0]) { case COLOR_BLUE: color = tenm_map_color(0, 63, 255); break; case COLOR_PURPLE: color = tenm_map_color(127, 0, 255); break; case COLOR_RED: color = tenm_map_color(255, 0, 50); break; case COLOR_GREEN: color = tenm_map_color(0, 255, 63); break; default: color = tenm_map_color(0, 0, 0); break; } if (tenm_draw_circle((int) (my->x), (int) (my->y), my->count[1] * my->count[2], 1, color) != 0) status = 1; return status; } static tenm_object * surprise_laser_new(int x, int y) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 2); if (count == NULL) { fprintf(stderr, "last_boss_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] color (just for delete_enemy_shot) * [1] life */ count[0] = COLOR_GREEN; count[1] = 47; /* ATTR_ENEMY_SHOT is only to clear it when the player is killed */ new = tenm_object_new("surprise laser manager", ATTR_ENEMY_SHOT, 0, 0, (double) x, (double) y, 2, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) surprise_laser_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "surprise_laser_new: tenm_object_new failed\n"); if (count != NULL) free(count); return NULL; } return new; } static int surprise_laser_act(tenm_object *my, const tenm_object *player) { double dx; double dy; double temp; double delta_x; (my->count[1])--; if (my->count[1] == 25) { tenm_table_add(reminder_new((int) (my->x), (int) (my->y), 3, COLOR_GREEN, 24)); return 0; } if (my->count[1] <= 0) { /* order does matter here */ dx = player->x - my->x; dy = (player->y - 60.0) - my->y; temp = tenm_sqrt((int) (dx * dx + dy * dy)); if (temp <= NEAR_ZERO) { dx = 0.0; dy = 1.0; temp = 1.0; } tenm_table_add(laser_new(my->x, my->y, 0.0, 0.0, 800.0 * dx / temp, 800.0 * dy / temp, COLOR_GREEN, 10)); if (my->x < ((double) WINDOW_WIDTH) / 2.0) delta_x = -60.0; else delta_x = 60.0; /* order does matter here */ dx = (player->x + delta_x) - my->x; dy = player->y - my->y; temp = tenm_sqrt((int) (dx * dx + dy * dy)); if (temp <= NEAR_ZERO) { if (my->x < ((double) WINDOW_WIDTH) / 2.0) dx = 1.0; else dx = -1.0; dy = 0.0; temp = 1.0; } tenm_table_add(laser_new(my->x, my->y, 0.0, 0.0, 800.0 * dx / temp, 800.0 * dy / temp, COLOR_GREEN, 10)); return 1; } return 0; } /* codename "Akai's star dust" */ static tenm_object * spread_shot_new(int x, int y, int life) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 3); if (count == NULL) { fprintf(stderr, "spread_shot_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] color (just for delete_enemy_shot) * [1] life * [2] reminder flag */ count[0] = COLOR_PURPLE; count[1] = life; count[2] = 0; /* ATTR_ENEMY_SHOT is only to clear it when the player is killed */ new = tenm_object_new("spread shot manager", ATTR_ENEMY_SHOT, 0, 0, (double) x, (double) y, 3, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) spread_shot_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "spread_shot_new: tenm_object_new failed\n"); if (count != NULL) free(count); return NULL; } return new; } static int spread_shot_act(tenm_object *my, const tenm_object *player) { int i; int temp; (my->count[1])--; if (my->count[2] == 0) { tenm_table_add(reminder_new((int) (my->x), (int) (my->y), 3, COLOR_PURPLE, 24)); /* this is equal to the initial life, so strictly positive */ my->count[2] = my->count[1] + 1; return 0; } if (my->count[1] <= 0) { if (my->count[2] % 24 < 12) temp = 0; else temp = 30; for (i = 0; i < 6; i++) tenm_table_add(normal_shot_angle_new(my->x, my->y, 4.5, temp + i * 60, COLOR_PURPLE, 1000)); for (i = 0; i < 6; i++) tenm_table_add(normal_shot_angle_new(my->x, my->y, 6.5, temp+30 + i * 60, COLOR_PURPLE, 1000)); return 1; } return 0; } static tenm_object * rotate_shot_new(double x, double y, double speed_r, int theta, double speed_theta, int color, int life) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; /* sanity check */ if (life <= 0) return NULL; if (speed_r <= 0.0) return NULL; /* negative speed_theta is OK --- it means counterclockwise */ if ((speed_theta > -0.01) && (speed_theta < 0.01)) return NULL; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "rotate_shot_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 5.0); if (p[0] == NULL) { fprintf(stderr, "rotate_shot_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 2); if (count == NULL) { fprintf(stderr, "rotate_shot_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 6); if (count_d == NULL) { fprintf(stderr, "rotate_shot_new: malloc(count_d) failed\n"); free(count); (p[0])->delete(p[0]); free(p); return NULL; } /* list of count * [0] color * [1] life */ /* list of count_d * [0] speed x * [1] speed y * [2] center x * [3] center y * [4] speed r * [5] speed theta */ count[0] = color; count[1] = life; count_d[0] = speed_r * tenm_cos(theta) + speed_theta * tenm_cos(theta + 90); count_d[1] = speed_r * tenm_sin(theta) + speed_theta * tenm_sin(theta + 90); count_d[2] = x + 5.0 * tenm_cos(theta); count_d[3] = y + 5.0 * tenm_sin(theta); count_d[4] = speed_r; count_d[5] = speed_theta; new = tenm_object_new("rotate shot", ATTR_ENEMY_SHOT, 0, 1, count_d[2], count_d[3], 2, count, 6, count_d, 1, p, (int (*)(tenm_object *, double)) rotate_shot_move, NULL, (int (*)(tenm_object *, const tenm_object *)) rotate_shot_act, (int (*)(tenm_object *, int)) rotate_shot_draw); if (new == NULL) { fprintf(stderr, "rotate_shot_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int rotate_shot_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); /* don't delete it even if it is out of the window * --- you need to set my->count[1] carefully */ return 0; } static int rotate_shot_act(tenm_object *my, const tenm_object *player) { double r_x; double r_y; double r_length; double dr_x; double dr_y; double temp; (my->count[1])--; if (my->count[1] <= 0) return 1; r_x = my->x - my->count_d[2]; r_y = my->y - my->count_d[3]; r_length = tenm_sqrt((int) (r_x * r_x + r_y * r_y)); r_x /= r_length; r_y /= r_length; dr_x = -r_y; dr_y = r_x; temp = r_length / 5.0; my->count_d[0] = my->count_d[4] * r_x + my->count_d[5] * dr_x * temp; my->count_d[1] = my->count_d[4] * r_y + my->count_d[5] * dr_y * temp; return 0; } static int rotate_shot_draw(tenm_object *my, int priority) { tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 1) return 0; switch (my->count[0]) { case COLOR_BLUE: color = tenm_map_color(0, 63, 255); break; case COLOR_PURPLE: color = tenm_map_color(127, 0, 255); break; case COLOR_RED: color = tenm_map_color(255, 0, 50); break; case COLOR_GREEN: color = tenm_map_color(0, 255, 63); break; default: color = tenm_map_color(0, 0, 0); break; } return tenm_draw_circle((int) (my->x), (int) (my->y), 5, 2, color); /* may be useful for debugging */ /* return tenm_draw_primitive(my->mass->p[0], color); */ } static tenm_object * clock_shot_new(double x, double y, int theta, int clockwise) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; /* sanity check */ p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "clock_shot_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 5.0); if (p[0] == NULL) { fprintf(stderr, "clock_shot_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "clock_shot_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "clock_shot_new: malloc(count_d) failed\n"); free(count); (p[0])->delete(p[0]); free(p); return NULL; } /* list of count * [0] color (just for delete_enemy_shot) * [1] theta * [2] speed down/up timer * [3] clockwise flag */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = COLOR_PURPLE; count[1] = theta; count[2] = 0; count[3] = clockwise; count_d[0] = 7.0 * tenm_cos(theta); count_d[1] = 7.0 * tenm_sin(theta); new = tenm_object_new("clock shot", ATTR_ENEMY_SHOT, 0, 1, x, y, 4, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) clock_shot_move, NULL, (int (*)(tenm_object *, const tenm_object *)) clock_shot_act, (int (*)(tenm_object *, int)) clock_shot_draw); if (new == NULL) { fprintf(stderr, "clock_shot_new: clock_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int clock_shot_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); if ((!in_window_object(my)) && (my->count[2] >= 61)) return 1; return 0; } static int clock_shot_act(tenm_object *my, const tenm_object *player) { (my->count[2])++; if ((my->count[2] < 50) && (my->count[2] % 5 == 0)) { my->count_d[0] -= 0.7 * tenm_cos(my->count[1]); my->count_d[1] -= 0.7 * tenm_sin(my->count[1]); } else if (my->count[2] == 50) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; if (my->count[3] != 0) my->count[1] += 150; else my->count[1] -= 150; } else if ((my->count[2] > 51) && (my->count[2] % 5 == 0)) { my->count_d[0] += 0.7 * tenm_cos(my->count[1]); my->count_d[1] += 0.7 * tenm_sin(my->count[1]); } return 0; } static int clock_shot_draw(tenm_object *my, int priority) { /* sanity check */ if (my == NULL) return 0; if (priority != 1) return 0; return tenm_draw_circle((int) (my->x), (int) (my->y), 5, 2, tenm_map_color(127, 0, 255)); /* may be useful for debugging */ /* return tenm_draw_primitive(my->mass->p[0], tenm_map_color(127, 0, 255)); */ } tenm_object * last_boss_demo_new(double x, double y, int n) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 2); if (count == NULL) { fprintf(stderr, "last_boss_demo_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] timer * [1] mode */ count[0] = TIME_DEMO - 10; count[1] = n; new = tenm_object_new("L demo", 0, 0, 0, x, y, 2, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) last_boss_demo_act, (int (*)(tenm_object *, int)) last_boss_demo_draw); if (new == NULL) { fprintf(stderr, "last_boss_demo_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int last_boss_demo_act(tenm_object *my, const tenm_object *player) { (my->count[0])--; if (my->count[0] <= 0) return 1; return 0; } static int last_boss_demo_draw(tenm_object *my, int priority) { /* sanity check */ if (my == NULL) return 0; if (priority != 1) return 0; if (my->count[0] > TIME_DEMO - 20) return 0; return last_boss_demo_blit((int) my->x, (int) my->y, my->count[1]); } tenmado-0.10/happy-L/last-boss.h0000644000175000017500000000034610276702754017274 0ustar00ooharaoohara00000000000000/* $Id: last-boss.h,v 1.1 2002/05/19 10:45:00 oohara Exp $ */ #ifndef __TENMADO_LAST_BOSS_H__ #define __TENMADO_LAST_BOSS_H__ #include "tenm_object.h" tenm_object *last_boss_new(void); #endif /* not __TENMADO_LAST_BOSS_H__ */ tenmado-0.10/happy-L/message.c0000644000175000017500000000566310276702754017013 0ustar00ooharaoohara00000000000000/* $Id: message.c,v 1.10 2003/01/03 22:22:44 oohara Exp $ */ #include /* malloc */ #include #include "util.h" #include "tenm_object.h" #include "const.h" #include "message.h" static int message_move(tenm_object *my, double turn_per_frame); static int message_act(tenm_object *my, const tenm_object *player); static int message_draw(tenm_object *my, int priority); tenm_object * message_new(double x, double y, double dx, double dy, int life, const char *string, int length) { int i; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; /* sanity check */ if (life <= 0) return NULL; if (string == NULL) return NULL; if (length <= 0) return NULL; count = (int *) malloc(sizeof(int) * (length + 3)); if (count == NULL) { fprintf(stderr, "message_new: malloc(count) failed\n"); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "message_new: malloc(count_d) failed\n"); free(count); return NULL; } /* list of count * [0] life * [1] length * [2 --] string */ count[0] = life; count[1] = length; for (i = 0; i < length; i++) count[i + 2] = (int) string[i]; count[length + 2] = '\0'; /* list of count_d * [0] speed x * [1] speed y */ count_d[0] = dx; count_d[1] = dy; new = tenm_object_new("message", 0, 0, 0, x, y, length + 2, count, 2, count_d, 0, NULL, (int (*)(tenm_object *, double)) message_move, NULL, (int (*)(tenm_object *, const tenm_object *)) message_act, (int (*)(tenm_object *, int)) message_draw); if (new == NULL) { fprintf(stderr, "message_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); return NULL; } return new; } static int message_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->x >= WINDOW_WIDTH) return 1; if (my->x + my->count[1] * 9 < 0) return 1; if (my->y >= WINDOW_HEIGHT) return 1; if (my->y + 18 < 0) return 1; return 0; } static int message_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; (my->count[0])--; if (my->count[0] <= 0) return 1; return 0; } static int message_draw(tenm_object *my, int priority) { /* sanity check */ if (my == NULL) return 0; if (priority != 1) return 0; return draw_string_int((int) (my->x), (int) (my->y), (const int *) (my->count + 2), my->count[1]); } tenmado-0.10/happy-L/message.h0000644000175000017500000000050310276702754017004 0ustar00ooharaoohara00000000000000/* $Id: message.h,v 1.3 2002/05/19 08:11:50 oohara Exp $ */ #ifndef __TENMADO_MESSAGE_H__ #define __TENMADO_MESSAGE_H__ #include "tenm_object.h" tenm_object *message_new(double x, double y, double dx, double dy, int life, const char *string, int length); #endif /* not __TENMADO_MESSAGE_H__ */ tenmado-0.10/happy-L/midnight.c0000644000175000017500000005403110276702754017163 0ustar00ooharaoohara00000000000000/* $Id: midnight.c,v 1.72 2003/08/21 20:38:22 oohara Exp $ */ #include /* malloc, rand */ #include /* strcmp */ #include #include "tenm_primitive.h" #include "tenm_object.h" #include "const.h" #include "tenm_table.h" #include "stage-clear.h" #include "score.h" #include "tenm_graphic.h" #include "hit-status.h" #include "explosion.h" #include "chain.h" #include "util.h" #include "laser.h" #include "normal-shot.h" #include "image.h" #include "midnight.h" #define MIDNIGHT_HIT_POINT 400 static int midnight_move(tenm_object *my, double turn_per_frame); static int midnight_hit(tenm_object *my, tenm_object *your); static int midnight_signal(tenm_object *my, int n); static int midnight_act(tenm_object *my, const tenm_object *player); static int midnight_draw(tenm_object *my, int priority); static tenm_object *midnight_bit_new(int parent_index, int n, double x, double y); static int midnight_bit_move(tenm_object *my, double turn_per_frame); static int midnight_bit_hit(tenm_object *my, tenm_object *your); static int midnight_bit_signal_to_parent(tenm_object *my, int n); static int midnight_bit_signal_to_bit(tenm_object *my, int n); static int midnight_bit_explosion(const tenm_object *my); static int midnight_bit_act(tenm_object *my, const tenm_object *player); static int midnight_bit_draw(tenm_object *my, int priority); tenm_object * midnight_new(void) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double x = (double) (WINDOW_WIDTH / 2); double y = -47.0; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 2); if (p == NULL) { fprintf(stderr, "midnight_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_polygon_new(3, x - 64.0, y - 48.0, x + 32.0, y - 48.0, x - 32.0, y + 48.0); if (p[0] == NULL) { fprintf(stderr, "midnight_new: cannot set p[0]\n"); free(p); return NULL; } p[1] = (tenm_primitive *) tenm_polygon_new(3, x + 64.0, y - 48.0, x - 32.0, y - 48.0, x + 32.0, y + 48.0); if (p[1] == NULL) { fprintf(stderr, "midnight_new: cannot set p[0]\n"); (p[0])->delete(p[0]); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 7); if (count == NULL) { fprintf(stderr, "midnight_new: malloc(count) failed\n"); (p[1])->delete(p[1]); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "midnight_new: malloc(count_d) failed\n"); (p[1])->delete(p[1]); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] timer * [1] mode * [2] left bit index * [3] right bit index * [4] center bit index * [5] number of bit killed * [6] "damaged" flag */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = 0; count[1] = 0; count[2] = -1; count[3] = -1; count[4] = -1; count[5] = 0; count[6] = 0; count_d[0] = 0.0; count_d[1] = 3.0; new = tenm_object_new("Midnight", ATTR_ENEMY, ATTR_PLAYER_SHOT, MIDNIGHT_HIT_POINT, x, y, 7, count, 2, count_d, 2, p, (int (*)(tenm_object *, double)) midnight_move, (int (*)(tenm_object *, tenm_object *)) midnight_hit, (int (*)(tenm_object *, const tenm_object *)) midnight_act, (int (*)(tenm_object *, int)) midnight_draw); if (new == NULL) { fprintf(stderr, "midnight_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[1])->delete(p[1]); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int midnight_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->mass != NULL) && (!in_window_object(my))) { fprintf(stderr, "midnight_move: the object is out of the window\n"); return 1; } return 0; } static int midnight_hit(tenm_object *my, tenm_object *your) { int i; /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (!(your->attr & ATTR_PLAYER_SHOT)) return 0; /* immutable time */ if (my->count[1] != 1) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[6] = 1; set_hit_status(my->name, MIDNIGHT_HIT_POINT, my->hit_point); if (my->hit_point <= 0) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 2000, COLOR_PURPLE, 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 500, COLOR_PURPLE, 6.0, 12)); add_killed(COLOR_PURPLE); add_score(20000); tenm_table_apply_all((int (*)(tenm_object *, int)) delete_enemy_shot, 0); for (i = 2; i <= 4; i++) { if (my->count[i] >= 0) tenm_table_apply(my->count[i], (int (*)(tenm_object *, int))midnight_signal, 0); } /* don't modify my->attr or my->hit_mask here, or the player shot * may fly through the enemy */ if (my->mass != NULL) tenm_mass_delete(my->mass); my->mass = NULL; my->count[0] = 0; my->count[1] = 2; my->count[6] = 0; my->count_d[0] = 0.0; my->count_d[1] = 0.5; return 0; } return 0; } static int midnight_signal(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if ((strcmp(my->name, "Midnight side bit") != 0) && (strcmp(my->name, "Midnight center bit") != 0)) return 0; my->count[0] = 0; my->count[1] = 2; my->count_d[0] = 0.0; if ((my->count[3] == 0)|| (my->count[3] == 1)) { if (my->count_d[1] >= 0.0) my->count_d[1] = 1.0; else my->count_d[1] = -1.0; } else { my->count_d[1] = 0.0; } return 0; } static int midnight_act(tenm_object *my, const tenm_object *player) { int i; int j; double source_x; double source_y; if (my->count[1] == 0) { if (my->count[0] == 60) my->count_d[1] = 0.0; else if (my->count[0] == 110) { for (i = 0; i < 3; i++) my->count[i + 2] = tenm_table_add(midnight_bit_new(my->table_index, i, my->x, my->y - 20.0)); } else if (my->count[0] >= 250) { my->count[0] = 0; my->count[1] = 1; my->count_d[0] = 3.0; } } else if (my->count[1] == 1) { if ((my->x <= 140.0) && (my->count_d[0] < 3.0)) my->count_d[0] += 0.1; if ((my->x >= ((double) WINDOW_WIDTH) - 140.0) && (my->count_d[0] > -3.0)) my->count_d[0] -= 0.1; if (my->count[5] <= 2) { if (my->count[0] <= 200) { if (my->count[0] % 40 == 0) { for (i = 0; i < 2; i++) tenm_table_add(laser_angle_new(my->x - 32.0 + (double) (i * 64), my->y, 10.0, 90, 45.0, COLOR_PURPLE, 1000)); } else if (my->count[0] % 40 == 20) { for (i = 0; i < 2; i++) for (j = -(my->count[5] + 1); j <= my->count[5] + 1; j++) { source_x = my->x - 32.0 + (double) (i * 64); tenm_table_add(normal_shot_angle_new(source_x, my->y, 5.5, 90 + j * 15, COLOR_PURPLE, 1000)); } } } else if ((my->count[0] > 220) && (my->count[0] <= 245)) { tenm_table_add(laser_new(my->x, my->y, my->count_d[0], my->count_d[1], 0.0, (double) (3 * (my->count[0] - 220)), COLOR_PURPLE, 1)); } else if ((my->count[0] >= 246) && (my->count[0] <= 280)) { tenm_table_add(laser_new(my->x, my->y, my->count_d[0], my->count_d[1], 0.0, 700.0, COLOR_PURPLE, 1)); } if (my->count[0] >= 280) my->count[0] = 0; } else { if (my->count[0] < 0) { tenm_table_add(laser_new(my->x, my->y, my->count_d[0], my->count_d[1], 0.0, (double) (3 * my->count[0] + 25), COLOR_PURPLE, 1)); } else { tenm_table_add(laser_new(my->x, my->y, my->count_d[0], my->count_d[1], 0.0, 700.0, COLOR_PURPLE, 1)); if (my->count[0] % 20 == 0) { if (my->count[0] % 40 == 0) source_x = my->x - 32.0; else source_x = my->x + 32.0; for (j = -3; j <= 3; j++) { tenm_table_add(normal_shot_point_new(source_x, my->y, 5.5, player->x + ((double) j * 60), player->y, COLOR_PURPLE, 1000)); } } if (my->count[0] >= 40) my->count[0] = 0; } } } else if (my->count[1] == 2) { if ((my->count[0] <= 105) && (my->count[0] % 15 == 0)) { source_x = my->x + (double) (rand() % 81 - 40); source_y = my->y - (double) (rand() % 37 + 6); tenm_table_add(explosion_new(source_x, source_y, 0.0, 0.0, 1, 2000, COLOR_PURPLE, 6.0, 12)); tenm_table_add(explosion_new(source_x, source_y, 0.0, 0.0, 2, 500, COLOR_PURPLE, 4.0, 12)); } else if (my->count[0] == 150) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 8000, COLOR_PURPLE, 10.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 2000, COLOR_PURPLE, 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 3, 300, COLOR_PURPLE, 5.0, 12)); } else if (my->count[0] >= 300) { tenm_table_add(stage_clear_new(1)); return 1; } } (my->count[0])++; return 0; } static int midnight_draw(tenm_object *my, int priority) { int n = 0; tenm_color color; /* sanity check */ if (my == NULL) return 0; if (my->count[1] == 2) { /* dead enemy has low priority */ if (priority != -1) return 0; } else { if (priority != 0) return 0; } if ((my->count[1] == 2) && (my->count[0] >= 150)) return 0; if (my->count[6] == 0) n = 0; else n = 1; if (midnight_blit((int) (my->x), (int) (my->y), n) != 0) { fprintf(stderr, "midnight_draw: midnight_blit failed\n"); my->count[6] = 0; return 1; } my->count[6] = 0; return 0; /* the below may be useful for debugging */ color = tenm_map_color(78, 59, 156); if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "midnight_draw: tenm_draw_mass failed\n"); return 1; } return 0; } static tenm_object * midnight_bit_new(int parent_index, int n, double x, double y) { const char *name = NULL; tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double target_x; double target_y; /* sanity check */ if ((n < 0) || (n > 2)) return NULL; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "midnight_bit_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_polygon_new(4, x + 32.0, y - 10.0, x - 32.0, y - 10.0, x - 32.0, y + 10.0, x + 32.0, y + 10.0); if (p[0] == NULL) { fprintf(stderr, "midnight_bit_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 6); if (count == NULL) { fprintf(stderr, "midnight_bit_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "midnight_bit_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } if (n == 0) { target_x = 50.0; target_y = y; } else if (n == 1) { target_x = ((double) WINDOW_WIDTH) - 50.0; target_y = y; } else if (n == 2) { target_x = x; target_y = 40; } else { fprintf(stderr, "midnight_bit_new: strange n (%d)\n", n); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } /* list of count * [0] timer * [1] mode * [2] Midnight index * [3] left/right/center * [4] number of bit killed * [5] "damaged" flag */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = 0; count[1] = 0; count[2] = parent_index; count[3] = n; count[4] = 0; count[5] = 0; count_d[0] = (target_x - x) / 30.0; count_d[1] = (target_y - y) / 30.0; if ((n == 0) || (n == 1)) { name = "Midnight side bit"; } else if (n == 2) { name = "Midnight center bit"; } else { fprintf(stderr, "midnight_bit_new: strange n (%d)\n", n); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } new = tenm_object_new(name, ATTR_ENEMY, ATTR_PLAYER_SHOT, 150, x, y, 6, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) midnight_bit_move, (int (*)(tenm_object *, tenm_object *)) midnight_bit_hit, (int (*)(tenm_object *, const tenm_object *)) midnight_bit_act, (int (*)(tenm_object *, int)) midnight_bit_draw); if (new == NULL) { fprintf(stderr, "midnight_bit_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int midnight_bit_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->mass != NULL) && (!in_window_object(my))) { fprintf(stderr, "midnight_bit_move: the object is out of the window\n"); return 1; } return 0; } static int midnight_bit_hit(tenm_object *my, tenm_object *your) { int color; /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (!(your->attr & ATTR_PLAYER_SHOT)) return 0; /* immutable time */ if (my->count[1] != 1) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[5] = 1; set_hit_status(my->name, 150, my->hit_point); if (my->hit_point <= 0) { if (my->count[3] == 0) { color = COLOR_BLUE; } else if (my->count[3] == 1) { color = COLOR_RED; } else if (my->count[3] == 2) { color = COLOR_PURPLE; } else { fprintf(stderr, "midnight_bit_hit: strange count[3] (%d)\n", my->count[3]); color = COLOR_GREEN; } midnight_bit_explosion(my); add_killed(color); add_score(10000); tenm_table_apply(my->count[2], (int (*)(tenm_object *,int))midnight_bit_signal_to_parent, my->count[3]); return 1; } return 0; } static int midnight_bit_signal_to_parent(tenm_object *my, int n) { int i; /* sanity check */ if (my == NULL) return 0; if ((n < 0) || (n > 2)) return 0; if (strcmp(my->name, "Midnight") != 0) return 0; for (i = 2; i <= 4; i++) { if (i == n + 2) my->count[i] = -1; else if (my->count[i] >= 0) tenm_table_apply(my->count[i], (int (*)(tenm_object *, int))midnight_bit_signal_to_bit, 0); } (my->count[5])++; if (my->count[5] >= 3) { my->count[0] = -24; } return 0; } static int midnight_bit_signal_to_bit(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if ((strcmp(my->name, "Midnight side bit") != 0) && (strcmp(my->name, "Midnight center bit") != 0)) return 0; (my->count[4])++; return 0; } static int midnight_bit_explosion(const tenm_object *my) { int color; if (my->count[3] == 0) { color = COLOR_BLUE; } else if (my->count[3] == 1) { color = COLOR_RED; } else if (my->count[3] == 2) { color = COLOR_PURPLE; } else { fprintf(stderr, "midnight_bit_hit: strange count[3] (%d)\n", my->count[3]); color = COLOR_GREEN; } tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 2000, color, 6.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 400, color, 4.0, 12)); return 0; } static int midnight_bit_act(tenm_object *my, const tenm_object *player) { int theta; double length; double source_x; int color; double speed; if (my->count[1] == 0) { if (my->count[0] == 30) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } if (my->count[0] >= 80) { my->count[0] = 0; my->count[1] = 1; if ((my->count[3] == 0) || (my->count[3] == 1)) my->count_d[1] = 5.5 + 0.3 * ((double) (rand() % 8)); } } else if (my->count[1] == 1) { if ((my->count[3] == 0) || (my->count[3] == 1)) { if (my->y <= 0.0) my->count_d[1] = 5.5 + 0.3 * ((double) (rand() % 8)); else if (my->y >= (double) WINDOW_HEIGHT) my->count_d[1] = -(5.5 + 0.3 * ((double) (rand() % 8))); if ((my->count[0] >= 20) || ((my->count[4] >= 2) && (my->count[0] % 10 == 0))) { if (my->count[3] == 0) { theta = 0; color = COLOR_BLUE; if (my->count[4] >= 1) { length = 60.0; source_x = my->x - 30; speed = 9.0; } else { length = 30.0; source_x = my->x; speed = 7.0; } } else { theta = 180; color = COLOR_RED; if (my->count[4] >= 1) { length = 60.0; source_x = my->x + 30; speed = 11.0; } else { length = 30.0; source_x = my->x; speed = 7.0; } } if (my->count[4] >= 2) speed = 11.0; tenm_table_add(laser_angle_new(source_x, my->y, speed, theta, length, color, 1000)); } if (my->count[0] >= 20) my->count[0] = 0; } else if (my->count[3] == 2) { if ((my->count[0] == 16) || ((my->count[4] >= 2) && (my->count[0] % 8 == 0))) { if (my->count[0] == 8) source_x = my->x - 15.0; else if (my->count[0] == 16) source_x = my->x; else source_x = my->x + 15.0; if (my->count[0] >= 2) speed = 9.0; else speed = 7.0; tenm_table_add(normal_shot_point_new(source_x, my->y, speed, player->x, player->y, COLOR_PURPLE, 1000)); } if (my->count[0] >= 24) my->count[0] = 0; } } else if (my->count[1] == 2) { /* don't modify my->attr or my->hit_mask here, or the player shot * may fly through the enemy */ if (my->mass != NULL) tenm_mass_delete(my->mass); my->mass = NULL; if (my->y <= 0.0) my->count_d[1] = 1.0; else if (my->y >= (double) WINDOW_HEIGHT) my->count_d[1] = -1.0; if (my->count[0] >= 10) { midnight_bit_explosion(my); return 1; } } (my->count[0])++; return 0; } static int midnight_bit_draw(tenm_object *my, int priority) { int n = 0; tenm_color color; /* sanity check */ if (my == NULL) return 0; if (my->count[1] == 2) { /* dead enemy has low priority */ if (priority != -1) return 0; } else { if (priority != 0) return 0; } n = my->count[3]; if (my->count[5] != 0) n += 3; if (midnight_bit_blit((int) (my->x), (int) (my->y), n) != 0) { fprintf(stderr, "midnight_bit_draw: tenm_draw_mass failed\n"); my->count[5] = 0; return 1; } my->count[5] = 0; return 0; /* the below may be useful for debugging */ if (my->count[3] == 0) { /* blue */ color = tenm_map_color(59, 112, 156); } else if (my->count[3] == 1) { /* red */ color = tenm_map_color(156, 59, 72); } else if (my->count[3] == 2) { /* purple */ color = tenm_map_color(78, 59, 156); } else { /* should not reach here */ color = tenm_map_color(0, 0, 0); } if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "midnight_bit_draw: tenm_draw_mass failed\n"); return 1; } return 0; } tenmado-0.10/happy-L/midnight.h0000644000175000017500000000034110276702754017163 0ustar00ooharaoohara00000000000000/* $Id: midnight.h,v 1.2 2002/06/04 19:07:27 oohara Exp $ */ #ifndef __TENMADO_MIDNIGHT_H__ #define __TENMADO_MIDNIGHT_H__ #include "tenm_object.h" tenm_object *midnight_new(void); #endif /* not __TENMADO_MIDNIGHT_H__ */ tenmado-0.10/happy-L/normal-enemy.c0000644000175000017500000007206010276702754017765 0ustar00ooharaoohara00000000000000/* $Id: normal-enemy.c,v 1.99 2004/02/15 14:39:46 oohara Exp $ */ #include /* malloc, rand */ #include /* for normal_enemy_new */ #include #include "tenm_object.h" #include "tenm_primitive.h" #include "const.h" #include "tenm_graphic.h" #include "tenm_table.h" #include "explosion.h" #include "chain.h" #include "hit-status.h" #include "score.h" #include "normal-shot.h" #include "util.h" #include "tenm_math.h" #include "laser.h" #include "image.h" #include "normal-enemy.h" #define COUNT_MODE_BEGIN 16 #define COUNT_D_MODE_BEGIN 10 #define NEAR_ZERO 0.0001 static int normal_enemy_hit_point(int what); static int normal_enemy_move(tenm_object *my, double turn_per_frame); static int normal_enemy_hit(tenm_object *my, tenm_object *your); static int normal_enemy_explode(const tenm_object *my); static void normal_enemy_do_signal(const tenm_object *my); static int normal_enemy_signal(tenm_object *my, int n); static int normal_enemy_act(tenm_object *my, const tenm_object *player); static int normal_enemy_draw(tenm_object *my, int priority); /* ... is one or more of * (int t_move, double dx, double dy, double ddx, double ddy, * double center_x, double center_y, double speed_r, double speed_theta, * int next_mode_move) * followed by one or more of * (int t_shoot, int time_shoot, int time_shoot_initial, * int randomness, int next_mode_shoot) * if speed_theta is very large, you may want to use smaller speed_r * to cope with the dr error */ tenm_object * normal_enemy_new(double x, double y, int what, int type, int color, int time_no_escape, int signal_index, int signal_suffix, int number_mode_move, int number_mode_shoot, ...) { va_list ap; tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; const char *name = NULL; int n_p = 1; int i; int j; int n; int n_d; int attr = ATTR_ENEMY; int hit_mask = ATTR_PLAYER_SHOT; int suffix; int suffix_d; int hit_point = -1; /* for rotate move */ double r_x; double r_y; double r_length; double dr_x; double dr_y; double temp; double r_x_temp; double r_y_temp; double r_length_temp; /* sanity check */ if (time_no_escape < 0) return NULL; if (number_mode_move <= 0) return NULL; if (number_mode_shoot <= 0) return NULL; switch (what) { case NORMAL_BALL_SMALL: name = "small ball"; break; case NORMAL_BALL_MEDIUM: name = "medium ball"; break; case NORMAL_BALL_LARGE: name = "large ball"; break; case NORMAL_STING: name = "sting"; break; case NORMAL_HORIZON: name = "horizon"; break; case NORMAL_PLENTY: name = "plenty"; break; case NORMAL_BURST: name = "burst"; break; default: fprintf(stderr, "normal_enemy_new: strange what when setting name " "(%d)\n", what); return NULL; break; } hit_point = normal_enemy_hit_point(what); if (hit_point < 0) { fprintf(stderr, "normal_enemy_new: normal_enemy_hit_point failed\n"); return NULL; } switch (what) { case NORMAL_BALL_SMALL: n_p = 1; break; case NORMAL_BALL_MEDIUM: n_p = 1; break; case NORMAL_BALL_LARGE: n_p = 1; break; case NORMAL_STING: n_p = 1; break; case NORMAL_HORIZON: n_p = 1; break; case NORMAL_PLENTY: n_p = 1; break; case NORMAL_BURST: n_p = 1; break; default: fprintf(stderr, "normal_enemy_new: strange what when setting n_p " "(%d)\n", what); return NULL; break; } p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * n_p); if (p == NULL) { fprintf(stderr, "normal_enemy_new: malloc(p) failed\n"); return NULL; } switch (what) { case NORMAL_BALL_SMALL: p[0] = (tenm_primitive *) tenm_circle_new(x, y, 15.0); break; case NORMAL_BALL_MEDIUM: p[0] = (tenm_primitive *) tenm_circle_new(x, y, 20.0); break; case NORMAL_BALL_LARGE: p[0] = (tenm_primitive *) tenm_circle_new(x, y, 25.0); break; case NORMAL_STING: p[0] = (tenm_primitive *) tenm_polygon_new(4, x - 32.0, y - 24.0, x - 32.0, y + 24.0, x + 32.0, y + 24.0, x + 32.0, y - 24.0); break; case NORMAL_HORIZON: p[0] = (tenm_primitive *) tenm_polygon_new(4, x - 25.0, y - 25.0, x - 25.0, y + 25.0, x + 25.0, y + 25.0, x + 25.0, y - 25.0); break; case NORMAL_PLENTY: p[0] = (tenm_primitive *) tenm_polygon_new(4, x - 36.0, y - 48.0, x - 36.0, y + 48.0, x + 36.0, y + 48.0, x + 36.0, y - 48.0); break; case NORMAL_BURST: p[0] = (tenm_primitive *) tenm_polygon_new(4, x - 24.0, y - 32.0, x - 24.0, y + 32.0, x + 24.0, y + 32.0, x + 24.0, y - 32.0); break; default: fprintf(stderr, "normal_enemy_new: strange what when setting p " "(%d)\n", what); return NULL; break; } for (i = 0; i < n_p; i++) if (p[i] == NULL) { fprintf(stderr, "normal_enemy_new: cannot set p[%d]\n", i); /* we need to check from 0 to n_p to delete everything */ for (j = 0; j < n_p; j++) if (p[j] != NULL) (p[j])->delete(p[j]); free(p); return NULL; } n = COUNT_MODE_BEGIN + 2 * number_mode_move + 5 * number_mode_shoot; count = (int *) malloc(sizeof(int) * n); if (count == NULL) { fprintf(stderr, "normal_enemy_new: malloc(count) failed\n"); for (j = 0; j < n_p; j++) if (p[j] != NULL) (p[j])->delete(p[j]); free(p); return NULL; } n_d = COUNT_D_MODE_BEGIN + 8 * number_mode_move + 0 * number_mode_shoot; count_d = (double *) malloc(sizeof(double) * n_d); if (count_d == NULL) { fprintf(stderr, "normal_enemy_new: malloc(count_d) failed\n"); free(count); for (j = 0; j < n_p; j++) if (p[j] != NULL) (p[j])->delete(p[j]); free(p); return NULL; } /* list of count * [0] color * [1] shoot timer (shoot if [1] >= [2]) * [2] shoot interval (fixed in each mode) * [3] no escape time * [4] move mode timer * [5] current mode_move * [6] total number of mode_move * [7] shoot mode timer * [8] current mode_shoot * [9] total number of mode_shoot * [10] shoot randomness * [11] what * [12] type * [13] "deleted" signal index (-1 if disabled) * [14] "deleted" signal suffix * [15] "damaged" flag * [16 --] mode data ((t_move, next_mode_move), (t_shoot, time_shoot, * time_shoot_initial, randomness, next_mode_shoot)) */ /* list of count_d * [0] dx * [1] dy * [2] ddx * [3] ddy * [4] center x * [5] center y * [6] center dx * [7] center dy * [8] speed_r * [9] speed_theta (0.0 means no rotate move) * [10 --] mode data ((dx, dy, ddx, ddy, * center_x, center_y, speed_r, speed_theta), ()) */ va_start(ap, number_mode_shoot); for (i = 0; i < number_mode_move; i++) { suffix = COUNT_MODE_BEGIN + 2 * i; suffix_d = COUNT_D_MODE_BEGIN + 8 * i; /* t_move */ count[suffix + 0] = va_arg(ap, int); if (count[suffix + 0] <= 0) { fprintf(stderr, "normal_enemy_new: strange t_move (%d) in mode %d\n", count[suffix + 0], i); free(count_d); free(count); for (j = 0; j < n_p; j++) if (p[j] != NULL) (p[j])->delete(p[j]); free(p); va_end(ap); return NULL; } /* dx */ count_d[suffix_d + 0] = va_arg(ap, double); /* dy */ count_d[suffix_d + 1] = va_arg(ap, double); /* ddx */ count_d[suffix_d + 2] = va_arg(ap, double); /* ddy */ count_d[suffix_d + 3] = va_arg(ap, double); /* center_x */ count_d[suffix_d + 4] = va_arg(ap, double); /* center_y */ count_d[suffix_d + 5] = va_arg(ap, double); /* speed_r */ count_d[suffix_d + 6] = va_arg(ap, double); /* speed_theta * negative speed_theta is OK --- it means counterclockwise */ count_d[suffix_d + 7] = va_arg(ap, double); /* next_mode_move */ count[suffix + 1] = va_arg(ap, int); } for (i = 0; i < number_mode_shoot; i++) { suffix = COUNT_MODE_BEGIN + 2 * number_mode_move + 5 * i; /* there is no double data for shoot mode */ /* t_shoot */ count[suffix + 0] = va_arg(ap, int); if (count[suffix + 0] <= 0) { fprintf(stderr, "normal_enemy_new: strange t_shoot (%d) in mode %d\n", count[suffix + 0], i); free(count_d); free(count); for (j = 0; j < n_p; j++) if (p[j] != NULL) (p[j])->delete(p[j]); free(p); va_end(ap); return NULL; } /* time_shoot */ count[suffix + 1] = va_arg(ap, int); if (count[suffix + 1] <= 0) { fprintf(stderr, "normal_enemy_new: strange time_shoot (%d) in mode %d\n", count[suffix + 1], i); free(count_d); free(count); for (j = 0; j < n_p; j++) if (p[j] != NULL) (p[j])->delete(p[j]); free(p); va_end(ap); return NULL; } /* time_shoot_initial * negative time_shoot_initial is OK --- it means additional wait * before the first shoot */ count[suffix + 2] = va_arg(ap, int); /* randomness */ count[suffix + 3] = va_arg(ap, int); if (count[suffix + 3] < 0) { fprintf(stderr, "normal_enemy_new: strange randomness (%d) in mode %d\n", count[suffix + 3], i); free(count_d); free(count); for (j = 0; j < n_p; j++) if (p[j] != NULL) (p[j])->delete(p[j]); free(p); va_end(ap); return NULL; } /* next_mode_shoot */ count[suffix + 4] = va_arg(ap, int); } va_end(ap); count[0] = color; count[1] = count[COUNT_MODE_BEGIN + 2 * number_mode_move + 2]; count[2] = count[COUNT_MODE_BEGIN + 2 * number_mode_move + 1]; count[3] = time_no_escape; count[4] = count[COUNT_MODE_BEGIN + 0]; count[5] = 0; count[6] = number_mode_move; count[7] = count[COUNT_MODE_BEGIN + 2 * number_mode_move + 0]; count[8] = 0; count[9] = number_mode_shoot; count[10] = count[COUNT_MODE_BEGIN + 2 * number_mode_move + 3]; count[11] = what; count[12] = type; count[13] = signal_index; count[14] = signal_suffix; count[15] = 0; /* count_d[0] and count_d[1] are set below */ count_d[2] = count_d[COUNT_D_MODE_BEGIN + 2]; count_d[3] = count_d[COUNT_D_MODE_BEGIN + 3]; count_d[4] = count_d[COUNT_D_MODE_BEGIN + 4]; count_d[5] = count_d[COUNT_D_MODE_BEGIN + 5]; count_d[6] = count_d[COUNT_D_MODE_BEGIN + 0]; count_d[7] = count_d[COUNT_D_MODE_BEGIN + 1]; count_d[8] = count_d[COUNT_D_MODE_BEGIN + 6]; count_d[9] = count_d[COUNT_D_MODE_BEGIN + 7]; if ((count_d[9] >= -0.01) && (count_d[9] <= 0.01)) { /* no rotate */ count_d[0] = count_d[6]; count_d[1] = count_d[7]; } else { r_x = x - count_d[4]; r_y = y - count_d[5]; r_length = tenm_sqrt((int) (r_x * r_x + r_y * r_y)); if (r_length < NEAR_ZERO) r_length = 1.0; r_x /= r_length; r_y /= r_length; dr_x = -r_y; dr_y = r_x; temp = r_length / 5.0; /* dr should not modify the radius */ r_x_temp = x + count_d[9] * dr_x * temp - count_d[4]; r_y_temp = y + count_d[9] * dr_y * temp - count_d[5]; r_length_temp = tenm_sqrt((int) (r_x_temp * r_x_temp + r_y_temp * r_y_temp)); if (r_length_temp < NEAR_ZERO) r_length_temp = 1.0; count_d[8] -= r_length_temp - r_length; count_d[0] = count_d[6] + count_d[8] * r_x + count_d[9] * dr_x * temp; count_d[1] = count_d[7] + count_d[8] * r_y + count_d[9] * dr_y * temp; } attr = ATTR_ENEMY; if (type & ENEMY_TYPE_OBSTACLE) attr |= ATTR_OBSTACLE; hit_mask = ATTR_PLAYER_SHOT; if (type & ENEMY_TYPE_WEAK) hit_mask |= ATTR_OBSTACLE; new = tenm_object_new(name, attr, hit_mask, hit_point, x, y, n, count, n_d, count_d, n_p, p, (int (*)(tenm_object *, double)) normal_enemy_move, (int (*)(tenm_object *, tenm_object *)) normal_enemy_hit, (int (*)(tenm_object *, const tenm_object *)) normal_enemy_act, (int (*)(tenm_object *, int)) normal_enemy_draw); if (new == NULL) { fprintf(stderr, "normal_enemy_new: tenm_object_new failed\n"); free(count_d); free(count); for (j = 0; j < n_p; j++) if (p[j] != NULL) (p[j])->delete(p[j]); free(p); return NULL; } return new; } /* return positive value on success, negative value on error */ static int normal_enemy_hit_point(int what) { switch (what) { case NORMAL_BALL_SMALL: return 1; break; case NORMAL_BALL_MEDIUM: return 1; break; case NORMAL_BALL_LARGE: return 1; break; case NORMAL_STING: return 10; break; case NORMAL_HORIZON: return 30; break; case NORMAL_PLENTY: return 100; break; case NORMAL_BURST: return 10; break; default: fprintf(stderr, "normal_enemy_hit_point: strange what (%d)\n", what); return -1; break; } /* should not reach here */ fprintf(stderr, "normal_enemy_hit_point: switch(what) fell off\n"); return -1; } static int normal_enemy_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->count[3] <= 0) && (!in_window_object(my))) { normal_enemy_do_signal(my); return 1; } return 0; } static int normal_enemy_hit(tenm_object *my, tenm_object *your) { int score = 0; int hit_point; /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (your->attr & ATTR_OBSTACLE) { normal_enemy_explode(my); normal_enemy_do_signal(my); return 1; } if (my->count[0] == COLOR_GREEN) return 0; /* if the enemy has no time_no_escape, we don't need to check * in_window_object() again because it is done in the last move */ if ((my->count[3] > 0) && (!in_window_object(my))) return 0; if (!(your->attr & ATTR_PLAYER_SHOT)) return 0; hit_point = normal_enemy_hit_point(my->count[11]); if (hit_point < 0) { fprintf(stderr, "normal_enemy_hit: normal_enemy_hit_point failed\n"); return 0; } switch (my->count[11]) { case NORMAL_BALL_SMALL: score = 2; break; case NORMAL_BALL_MEDIUM: score = 2; break; case NORMAL_BALL_LARGE: score = 3; break; case NORMAL_STING: score = 5; break; case NORMAL_HORIZON: score = 7; break; case NORMAL_PLENTY: score = 15; break; case NORMAL_BURST: score = 5; break; default: fprintf(stderr, "normal_enemy_explode: strange what when setting score " "(%d)\n", my->count[11]); score = 0; break; } my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[15] = 1; set_hit_status(my->name, hit_point, my->hit_point); if (my->hit_point <= 0) { normal_enemy_explode(my); add_killed(my->count[0]); add_score(score); normal_enemy_do_signal(my); return 1; } return 0; } static int normal_enemy_explode(const tenm_object *my) { /* sanity check */ if (my == NULL) return 0; switch (my->count[11]) { case NORMAL_BALL_SMALL: tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 15, my->count[0], 2.0, 8)); break; case NORMAL_BALL_MEDIUM: tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 2, 20, my->count[0], 3.0, 8)); break; case NORMAL_BALL_LARGE: tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 2, 30, my->count[0], 4.0, 8)); break; case NORMAL_STING: tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 1, 200, my->count[0], 5.0, 8)); tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 2, 50, my->count[0], 2.0, 8)); break; case NORMAL_HORIZON: tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 1, 200, my->count[0], 5.0, 8)); tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 2, 50, my->count[0], 2.0, 8)); break; case NORMAL_PLENTY: tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 1, 500, my->count[0], 6.0, 10)); tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 2, 150, my->count[0], 4.0, 10)); break; case NORMAL_BURST: tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 1, 200, my->count[0], 5.0, 8)); tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1]/ 2.0, 2, 50, my->count[0], 2.0, 8)); break; default: fprintf(stderr, "normal_enemy_explode: strange what when setting p " "(%d)\n", my->count[11]); return 1; break; } return 0; } static void normal_enemy_do_signal(const tenm_object *my) { /* sanity check */ if (my == NULL) return; if (my->count[13] < 0) return; if (my->count[14] < 0) return; tenm_table_apply(my->count[13], (int (*)(tenm_object *, int)) normal_enemy_signal, my->count[14]); } static int normal_enemy_signal(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if ((n < 0) || (n >= my->n)) return 0; (my->count[n])++; return 0; } static int normal_enemy_act(tenm_object *my, const tenm_object *player) { int i; double x_temp; double y_temp; int suffix; int suffix_d; int next_mode; /* for rotate move */ double r_x; double r_y; double r_length; double dr_x; double dr_y; double temp; double r_x_temp; double r_y_temp; double r_length_temp; /* for horizon */ double length_y; /* for plenty */ double dy; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; /* no escape time count down */ if (my->count[3] > 0) (my->count[3])--; /* speed change */ my->count_d[6] += my->count_d[2]; my->count_d[7] += my->count_d[3]; /* rotate center move */ my->count_d[4] += my->count_d[6]; my->count_d[5] += my->count_d[7]; /* rotate move */ if ((my->count_d[9] >= -0.01) && (my->count_d[9] <= 0.01)) { /* no rotate */ my->count_d[0] = my->count_d[6]; my->count_d[1] = my->count_d[7]; } else { r_x = my->x - my->count_d[4]; r_y = my->y - my->count_d[5]; r_length = tenm_sqrt((int) (r_x * r_x + r_y * r_y)); if (r_length < NEAR_ZERO) r_length = 1.0; r_x /= r_length; r_y /= r_length; dr_x = -r_y; dr_y = r_x; /* note that my->count_d[8] is already adjusted so that * dr does not change the radius */ temp = r_length / 5.0; my->count_d[0] = my->count_d[6] + my->count_d[8] * r_x + my->count_d[9] * dr_x * temp; my->count_d[1] = my->count_d[7] + my->count_d[8] * r_y + my->count_d[9] * dr_y * temp; } /* shoot */ (my->count[1])++; if (my->count[1] >= my->count[2]) { my->count[1] = 0; if (my->count[10] <= 0) { x_temp = 0.0; y_temp = 0.0; } else { x_temp = (double) ((rand() % (my->count[10] * 2 + 1)) - my->count[10]); y_temp = (double) ((rand() % (my->count[10] * 2 + 1)) - my->count[10]); } switch (my->count[11]) { case NORMAL_BALL_SMALL: /* no shoot */ break; case NORMAL_BALL_MEDIUM: /* fall off */ case NORMAL_BALL_LARGE: tenm_table_add(normal_shot_point_new(my->x, my->y, 4.0, player->x + x_temp, player->y + y_temp, my->count[0], 1000)); break; case NORMAL_STING: tenm_table_add(normal_shot_point_new(my->x - 24.0, my->y, 5.5, player->x + x_temp, player->y + y_temp, my->count[0], 1000)); tenm_table_add(normal_shot_point_new(my->x + 24.0, my->y, 5.5, player->x + x_temp, player->y + y_temp, my->count[0], 1000)); break; case NORMAL_HORIZON: if (my->count[8] % 2 == 0) length_y = 700.0; else length_y = -700.0; tenm_table_add(laser_new(my->x, my->y, my->count_d[0], my->count_d[1], 0.0, length_y, my->count[0], 1)); break; case NORMAL_PLENTY: tenm_table_add(laser_point_new(my->x, my->y, 7.0, player->x + x_temp, player->y + y_temp, 30.0, my->count[0], 1000)); for (i = 0; i < 2; i++) tenm_table_add(laser_angle_new(my->x - 31.0 + (double) (i * 62), my->y, 7.0, 90, 30.0, my->count[0], 1000)); if (player->y >= my->y) dy = 5.0; else dy = -5.0; for (i = 0; i < 2; i++) /* yes, a new enemy */ tenm_table_add(normal_enemy_new(my->x - 22.0 + (double) (i * 44), my->y, NORMAL_BALL_SMALL, 0, my->count[0], 0, -1, -1, 2, 1, /* move 0 */ 13, -5.0 + (double) (i * 10), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1000, 0.0, dy, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 1000, 0, 0, 0)); break; case NORMAL_BURST: tenm_table_add(laser_angle_new(my->x - 15.0, my->y, 10.0, 90, 30.0, my->count[0], 1000)); tenm_table_add(laser_angle_new(my->x + 15.0, my->y, 10.0, 90, 30.0, my->count[0], 1000)); break; default: fprintf(stderr, "normal_enemy_act: strange what when shooting " "(%d)\n", my->count[11]); return 0; break; } } else if ((my->count[11] == NORMAL_HORIZON) && (my->count[1] > -25)) { if (my->count[8] % 2 == 0) length_y = (double) (100 + 3 * my->count[1]); else length_y = (double) (-(100 + 3 * my->count[1])); tenm_table_add(laser_new(my->x, my->y, my->count_d[0], my->count_d[1], 0.0, length_y, my->count[0], 1)); } /* move mode change */ (my->count[4])--; if (my->count[4] <= 0) { next_mode = my->count[COUNT_MODE_BEGIN + 2 * my->count[5] + 1]; if ((next_mode < 0) || (next_mode >= my->count[6])) { /* strange mode, die */ normal_enemy_do_signal(my); return 1; } suffix = COUNT_MODE_BEGIN + 2 * next_mode; suffix_d = COUNT_D_MODE_BEGIN + 8 * next_mode; my->count[4] = my->count[suffix + 0]; my->count[5] = next_mode; /* my->count_d[0] and my->count_d[0] are set below * to handle rotation correctly */ my->count_d[2] = my->count_d[suffix_d + 2]; my->count_d[3] = my->count_d[suffix_d + 3]; my->count_d[4] = my->count_d[suffix_d + 4]; my->count_d[5] = my->count_d[suffix_d + 5]; my->count_d[6] = my->count_d[suffix_d + 0]; my->count_d[7] = my->count_d[suffix_d + 1]; my->count_d[8] = my->count_d[suffix_d + 6]; my->count_d[9] = my->count_d[suffix_d + 7]; if ((my->count_d[9] >= -0.01) && (my->count_d[9] <= 0.01)) { /* no rotate */ my->count_d[0] = my->count_d[6]; my->count_d[1] = my->count_d[7]; } else { r_x = my->x - my->count_d[4]; r_y = my->y - my->count_d[5]; r_length = tenm_sqrt((int) (r_x * r_x + r_y * r_y)); if (r_length < NEAR_ZERO) r_length = 1.0; r_x /= r_length; r_y /= r_length; dr_x = -r_y; dr_y = r_x; temp = r_length / 5.0; /* dr should not modify the radius */ r_x_temp = my->x + my->count_d[9] * dr_x * temp - my->count_d[4]; r_y_temp = my->y + my->count_d[9] * dr_y * temp - my->count_d[5]; r_length_temp = tenm_sqrt((int) (r_x_temp * r_x_temp + r_y_temp * r_y_temp)); if (r_length_temp < NEAR_ZERO) r_length_temp = 1.0; my->count_d[8] -= r_length_temp - r_length; my->count_d[0] = my->count_d[6] + my->count_d[8] * r_x + my->count_d[9] * dr_x * temp; my->count_d[1] = my->count_d[7] + my->count_d[8] * r_y + my->count_d[9] * dr_y * temp; } } /* shoot mode change */ (my->count[7])--; if (my->count[7] <= 0) { next_mode = my->count[COUNT_MODE_BEGIN + 2 * my->count[6] + 5 * my->count[8] + 4]; if ((next_mode < 0) || (next_mode >= my->count[9])) { normal_enemy_do_signal(my); return 1; } suffix = COUNT_MODE_BEGIN + 2 * my->count[6] + 5 * next_mode; my->count[1] = my->count[suffix + 2]; my->count[2] = my->count[suffix + 1]; my->count[7] = my->count[suffix + 0]; my->count[8] = next_mode; my->count[10] = my->count[suffix + 3]; } return 0; } static int normal_enemy_draw(tenm_object *my, int priority) { int n = 0; int hit_point; int status = 0; tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 0) return 0; switch (my->count[0]) { case COLOR_BLUE: n = 0; break; case COLOR_PURPLE: n = 1; break; case COLOR_RED: n = 2; break; default: fprintf(stderr, "normal_enemy_draw: strange color when doing blit " "(%d)\n", my->count[0]); status = 1; n = 0; break; } /* we have to check the hit point because we have no "damaged" image file * for an enemy whose hit point is 1 */ hit_point = normal_enemy_hit_point(my->count[11]); if (hit_point < 0) { fprintf(stderr, "normal_enemy_hit: normal_enemy_hit_point failed\n"); status = 1; } if ((hit_point > 1) && (my->count[15] != 0)) n += 3; switch (my->count[11]) { case NORMAL_BALL_SMALL: status = small_ball_blit((int) (my->x), (int) (my->y), n); break; case NORMAL_BALL_MEDIUM: status = medium_ball_blit((int) (my->x), (int) (my->y), n); break; case NORMAL_BALL_LARGE: status = large_ball_blit((int) (my->x), (int) (my->y), n); break; case NORMAL_STING: status = sting_blit((int) (my->x), (int) (my->y), n); break; case NORMAL_HORIZON: status = horizon_blit((int) (my->x), (int) (my->y), n); break; case NORMAL_PLENTY: status = plenty_blit((int) (my->x), (int) (my->y), n); break; case NORMAL_BURST: status = burst_blit((int) (my->x), (int) (my->y), n); break; default: fprintf(stderr, "normal_enemy_draw: strange what when doing blit " "(%d)\n", my->count[11]); status = 1; break; } my->count[15] = 0; return status; /* the below may be useful for debugging */ switch (my->count[0]) { case COLOR_BLUE: color = tenm_map_color(59, 112, 156); break; case COLOR_PURPLE: color = tenm_map_color(78, 59, 156); break; case COLOR_RED: color = tenm_map_color(156, 59, 72); break; case COLOR_GREEN: color = tenm_map_color(59, 156, 71); break; default: color = tenm_map_color(0, 0, 0); break; } if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "normal_enemy_draw: tenm_draw_mass failed\n"); return 1; } return 0; } tenmado-0.10/happy-L/normal-enemy.h0000644000175000017500000000156410276702754017773 0ustar00ooharaoohara00000000000000/* $Id: normal-enemy.h,v 1.17 2002/06/16 15:44:11 oohara Exp $ */ #ifndef __TENMADO_NORMAL_ENEMY_H__ #define __TENMADO_NORMAL_ENEMY_H__ /* what */ #define NORMAL_BALL_SMALL 1 #define NORMAL_BALL_MEDIUM 2 #define NORMAL_BALL_LARGE 3 #define NORMAL_STING 4 /* time_shoot of "horizon" should be 1 */ #define NORMAL_HORIZON 5 #define NORMAL_PLENTY 6 #define NORMAL_BURST 7 /* type * these values must be one of 2^n */ /* gets hit by ATTR_OBSTACLE */ #define ENEMY_TYPE_WEAK 1 /* counts as ATTR_OBSTACLE as well as ATTR_ENEMY */ #define ENEMY_TYPE_OBSTACLE 2 tenm_object *normal_enemy_new(double x, double y, int what, int type, int color, int time_no_escape, int signal_index, int signal_suffix, int number_mode_move, int number_mode_shoot, ...); #endif /* not __TENMADO_NORMAL_ENEMY_H__ */ tenmado-0.10/happy-L/normal-shot.c0000644000175000017500000001514110276702754017622 0ustar00ooharaoohara00000000000000/* $Id: normal-shot.c,v 1.26 2003/01/15 01:48:39 oohara Exp $ */ #include /* malloc, rand */ #include #include "const.h" #include "tenm_object.h" #include "tenm_math.h" #include "tenm_graphic.h" #include "util.h" #include "tenm_primitive.h" #include "normal-shot.h" #define NEAR_ZERO 0.0001 static int normal_shot_move(tenm_object *my, double turn_per_frame); static int normal_shot_hit(tenm_object *my, tenm_object *your); static int normal_shot_act(tenm_object *my, const tenm_object *player); static int normal_shot_draw(tenm_object *my, int priority); /* speed must be positive --- use normal_shot_new() instead if you want * a shot that doesn't move */ tenm_object * normal_shot_angle_new(double x, double y, double speed, int theta, int color, int life) { /* sanity check */ if (speed < NEAR_ZERO) { fprintf(stderr, "normal_shot_angle_new: speed is non-positive (%f)\n", speed); return NULL; } if (life <= 0) { fprintf(stderr, "normal_shot_angle_new: life is non-positive (%d)\n", life); return NULL; } return normal_shot_new(x, y, speed * tenm_cos(theta), speed * tenm_sin(theta), color, life); } /* speed must be positive --- use normal_shot_new() instead if you want * a shot that doesn't move * if (x, y) and (target_x, target_y) are very close, shoot at a random * direction */ tenm_object * normal_shot_point_new(double x, double y, double speed, double target_x, double target_y, int color, int life) { double dx; double dy; double temp; int temp_theta; /* sanity check */ if (speed < NEAR_ZERO) { fprintf(stderr, "normal_shot_point_new: speed is non-positive (%f)", speed); return NULL; } if (life <= 0) { fprintf(stderr, "normal_shot_point_new: life is non-positive (%d)", life); return NULL; } dx = target_x - x; dy = target_y - y; temp = tenm_sqrt((int) (dx * dx + dy * dy)); if (temp <= NEAR_ZERO) { /* shoot at a random direction */ temp_theta = rand() % 360; dx = tenm_cos(temp_theta); dy = tenm_sin(temp_theta); temp = 1.0; } return normal_shot_new(x, y, speed * dx / temp, speed * dy / temp, color, life); } /* list of count * [0] color * [1] life */ /* list of count_d * [0] speed x * [1] speed y */ tenm_object * normal_shot_new(double x, double y, double speed_x, double speed_y, int color, int life) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; /* sanity check */ if (life <= 0) { fprintf(stderr, "normal_shot_new: life is non-positive (%d)\n", life); return NULL; } p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "normal_shot_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 5.0); if (p[0] == NULL) { fprintf(stderr, "normal_shot_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 2); if (count == NULL) { fprintf(stderr, "normal_shot_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "normal_shot_new: malloc(count_d) failed\n"); free(count); (p[0])->delete(p[0]); free(p); return NULL; } count[0] = color; count[1] = life; count_d[0] = speed_x; count_d[1] = speed_y; new = tenm_object_new("normal shot", ATTR_ENEMY_SHOT, ATTR_OPAQUE, 1, x, y, 2, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) normal_shot_move, (int (*)(tenm_object *, tenm_object *)) normal_shot_hit, (int (*)(tenm_object *, const tenm_object *)) normal_shot_act, (int (*)(tenm_object *, int)) normal_shot_draw); if (new == NULL) { fprintf(stderr, "normal_shot_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int normal_shot_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) { fprintf(stderr, "normal_shot_move: my is NULL\n"); return 0; } if (turn_per_frame <= 0.5) { fprintf(stderr, "normal_shot_move: strange turn_per_frame (%f)\n", turn_per_frame); return 0; } dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); if (!in_window_object(my)) return 1; return 0; } static int normal_shot_hit(tenm_object *my, tenm_object *your) { /* sanity check */ if (my == NULL) { fprintf(stderr, "normal_shot_hit: my is NULL\n"); return 0; } if (your == NULL) { fprintf(stderr, "normal_shot_hit: your is NULL\n"); return 0; } if (your->attr & ATTR_OPAQUE) return 1; return 0; } static int normal_shot_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) { fprintf(stderr, "normal_shot_act: my is NULL\n"); return 0; } /* player == NULL is OK */ (my->count[1])--; if (my->count[1] <= 0) return 1; return 0; } static int normal_shot_draw(tenm_object *my, int priority) { int status = 0; tenm_color color; /* sanity check */ if (my == NULL) { fprintf(stderr, "normal_shot_draw: my is NULL\n"); return 0; } /* return if it is not my turn */ if (priority != 1) return 0; switch (my->count[0]) { case COLOR_BLUE: color = tenm_map_color(0, 63, 255); break; case COLOR_PURPLE: color = tenm_map_color(127, 0, 255); break; case COLOR_RED: color = tenm_map_color(255, 0, 50); break; case COLOR_GREEN: color = tenm_map_color(0, 255, 63); break; default: fprintf(stderr, "normal_shot_draw: strange my->count[0] (%d)\n", my->count[0]); color = tenm_map_color(0, 0, 0); break; } if (tenm_draw_circle((int) (my->x), (int) (my->y), 5, 2, color) != 0) status = 1; /* may be useful for debugging */ /* if (tenm_draw_primitive(my->mass->p[0], color) != 0) status = 1; */ return status; } tenmado-0.10/happy-L/normal-shot.h0000644000175000017500000000125510276702754017630 0ustar00ooharaoohara00000000000000/* $Id: normal-shot.h,v 1.4 2002/06/12 09:14:25 oohara Exp $ */ #ifndef __TENMADO_NORMAL_SHOT_H__ #define __TENMADO_NORMAL_SHOT_H__ #include "tenm_object.h" tenm_object *normal_shot_angle_new(double x, double y, double speed, int theta, int color, int life); tenm_object *normal_shot_point_new(double x, double y, double speed, double target_x, double target_y, int color, int life); tenm_object *normal_shot_new(double x, double y, double speed_x, double speed_y, int color, int life); #endif /* not __TENMADO_NORMAL_SHOT_H__ */ tenmado-0.10/happy-L/overrun.c0000644000175000017500000004162510276702754017065 0ustar00ooharaoohara00000000000000/* $Id: overrun.c,v 1.69 2003/08/21 20:39:25 oohara Exp $ */ #include /* malloc, rand */ #include /* strcmp */ #include #include "tenm_primitive.h" #include "tenm_object.h" #include "const.h" #include "tenm_table.h" #include "stage-clear.h" #include "score.h" #include "tenm_graphic.h" #include "hit-status.h" #include "explosion.h" #include "chain.h" #include "util.h" #include "normal-shot.h" #include "tenm_math.h" #include "laser.h" #include "image.h" #include "overrun.h" #define OVERRUN_HIT_POINT 500 #define OVERRUN_BIT_HIT_POINT 250 static int overrun_move(tenm_object *my, double turn_per_frame); static int overrun_hit(tenm_object *my, tenm_object *your); static int overrun_signal(tenm_object *my, int n); static int overrun_act(tenm_object *my, const tenm_object *player); static int overrun_draw(tenm_object *my, int priority); static tenm_object *overrun_bit_new(double x, double y, int n, int parent_index); static int overrun_bit_move(tenm_object *my, double turn_per_frame); static int overrun_bit_hit(tenm_object *my, tenm_object *your); static int overrun_bit_explosion(const tenm_object *my); static int overrun_bit_signal_to_overrun(tenm_object *my, int n); static int overrun_bit_signal_to_bit(tenm_object *my, int n); static int overrun_bit_act(tenm_object *my, const tenm_object *player); static int overrun_bit_draw(tenm_object *my, int priority); tenm_object * overrun_new(void) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double x = (double) (WINDOW_WIDTH / 2); double y = -49.0; int i; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 2); if (p == NULL) { fprintf(stderr, "overrun_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_polygon_new(4, x - 50.0, y - 50.0, x + 50.0, y - 50.0, x + 50.0, y + 50.0, x - 50.0, y + 50.0); if (p[0] == NULL) { fprintf(stderr, "overrun_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 9); if (count == NULL) { fprintf(stderr, "overrun_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "overrun_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] timer * [1] mode * [2 -- 7] bit index * [8] "damaged" flag */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = 0; count[1] = 0; for (i = 2; i <= 7; i++) count[i] = -1; count[8] = 0; count_d[0] = 0.0; count_d[1] = (((double) (WINDOW_HEIGHT / 2)) - y) / 60.0; new = tenm_object_new("Overrun", ATTR_ENEMY, ATTR_PLAYER_SHOT, OVERRUN_HIT_POINT, x, y, 9, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) overrun_move, (int (*)(tenm_object *, tenm_object *)) overrun_hit, (int (*)(tenm_object *, const tenm_object *)) overrun_act, (int (*)(tenm_object *, int)) overrun_draw); if (new == NULL) { fprintf(stderr, "overrun_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int overrun_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->mass != NULL) && (!in_window_object(my))) { fprintf(stderr, "overrun_move: the object is out of the window\n"); return 1; } return 0; } static int overrun_hit(tenm_object *my, tenm_object *your) { int i; int n; /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (!(your->attr & ATTR_PLAYER_SHOT)) return 0; /* immutable time */ if (my->count[1] != 1) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[8] = 1; set_hit_status(my->name, OVERRUN_HIT_POINT, my->hit_point); if (my->hit_point <= 0) { tenm_table_apply_all((int (*)(tenm_object *, int)) delete_enemy_shot, 0); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 2000, COLOR_PURPLE, 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 500, COLOR_PURPLE, 6.0, 12)); add_killed(COLOR_PURPLE); add_score(20000); for (i = 0; i < 6; i++) { if (i == 0) n = 30; else if ((i == 1) || (i == 2)) n = 70; else n = 10; if (my->count[i + 2] >= 0) tenm_table_apply(my->count[i + 2], (int (*)(tenm_object *, int)) overrun_signal, n); } /* don't modify my->attr or my->hit_mask here, or the player shot * may fly through the enemy */ if (my->mass != NULL) tenm_mass_delete(my->mass); my->mass = NULL; my->count[1] = 2; my->count_d[0] *= 0.2; my->count_d[1] *= 0.2; } return 0; } static int overrun_signal(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "Overrun bit") != 0) return 0; /* don't modify my->attr or my->hit_mask here, or the player shot * may fly through the enemy */ if (my->mass != NULL) tenm_mass_delete(my->mass); my->mass = NULL; my->count[0] = n; my->count[1] = 1; my->count_d[0] *= 0.2; my->count_d[1] *= 0.2; return 0; } static int overrun_act(tenm_object *my, const tenm_object *player) { int i; double temp_x; double temp_y; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; (my->count[0])++; if (my->count[1] == 0) { if (my->count[0] == 60) { my->count_d[0] = 0.0; my->count_d[1] = 0.0; } else if (my->count[0] == 150) { my->count_d[0] = 6.0 * tenm_cos(45); my->count_d[1] = 6.0 * tenm_sin(45); for (i = 0; i < 6; i++) my->count[i + 2] = tenm_table_add(overrun_bit_new(my->x, my->y, i, my->table_index)); my->count[1] = 1; } } else if (my->count[1] == 1) { /* speed change */ temp_x = my->x + my->count_d[0]; temp_y = my->y + my->count_d[1]; if ((temp_x < 0.0) || (temp_x >= ((double) WINDOW_WIDTH))) my->count_d[0] *= -1.0; if ((temp_y < 0.0) || (temp_y >= ((double) WINDOW_HEIGHT))) my->count_d[1] *= -1.0; /* shoot */ if (my->count[0] % 6 == 0) { tenm_table_add(normal_shot_new(my->x, my->y, 0.0, 0.0, COLOR_PURPLE, 300)); } if (my->count[0] >= 24) { tenm_table_add(laser_point_new(my->x, my->y, 4.5, player->x, player->y, 40.0, COLOR_PURPLE, 1000)); my->count[0] = 0; } } else if (my->count[1] == 2) { /* speed change */ temp_x = my->x + my->count_d[0]; temp_y = my->y + my->count_d[1]; if ((temp_x < 0.0) || (temp_x >= ((double) WINDOW_WIDTH))) my->count_d[0] *= -1.0; if ((temp_y < 0.0) || (temp_y >= ((double) WINDOW_HEIGHT))) my->count_d[1] *= -1.0; if (my->count[0] == 150) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 8000, COLOR_PURPLE, 10.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 2000, COLOR_PURPLE, 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 3, 300, COLOR_PURPLE, 5.0, 12)); } else if (my->count[0] >= 300) { tenm_table_add(stage_clear_new(2)); return 1; } } return 0; } static int overrun_draw(tenm_object *my, int priority) { int n = 0; tenm_color color; /* sanity check */ if (my == NULL) return 0; if (my->count[1] == 2) { /* dead enemy has low priority */ if (priority != -1) return 0; } else { if (priority != 0) return 0; } if ((my->count[1] == 2) && (my->count[0] >= 150)) return 0; if (my->count[8] == 0) n = 0; else n = 1; if (overrun_blit((int) (my->x), (int) (my->y), n) != 0) { fprintf(stderr, "overrun_draw: overrun_blit failed\n"); my->count[8] = 0; return 1; } my->count[8] = 0; return 0; /* the below may be useful for debugging */ color = tenm_map_color(78, 59, 156); if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "overrun_draw: tenm_draw_mass failed\n"); return 1; } return 0; } static tenm_object * overrun_bit_new(double x, double y, int n, int parent_index) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; int attr; int hit_mask; int theta; double speed; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 2); if (p == NULL) { fprintf(stderr, "overrun_bit_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_polygon_new(4, x - 25.0, y - 25.0, x + 25.0, y - 25.0, x + 25.0, y + 25.0, x - 25.0, y + 25.0); if (p[0] == NULL) { fprintf(stderr, "overrun_bit_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 7); if (count == NULL) { fprintf(stderr, "overrun_bit_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "overrun_bit_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } if (n <= 2) { attr = ATTR_OBSTACLE; hit_mask = 0; } else { attr = ATTR_ENEMY | ATTR_OPAQUE; hit_mask = ATTR_PLAYER_SHOT; } if (n == 0) theta = 30; else if (n == 1) theta = 50; else if (n == 2) theta = 110; else if (n == 3) theta = 140; else if (n == 4) theta = 120; else theta = 20; if (n >= 3) speed = 9.5; else speed = 7.5; /* list of count * [0] timer * [1] mode * [2] color * [3] Overrun index * [4] n * [5] number of corresponding bit killed * [6] "damaged" flag */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = (n % 3) * 13; count[1] = 0; if (n <= 2) count[2] = COLOR_GREEN; else if (n == 3) count[2] = COLOR_BLUE; else if (n == 4) count[2] = COLOR_PURPLE; else count[2] = COLOR_RED; count[3] = parent_index; count[4] = n; count[5] = 0; count[6] = 0; count_d[0] = speed * tenm_cos(theta); count_d[1] = speed * tenm_sin(theta); new = tenm_object_new("Overrun bit", attr, hit_mask, OVERRUN_BIT_HIT_POINT, x, y, 7, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) overrun_bit_move, (int (*)(tenm_object *, tenm_object *)) overrun_bit_hit, (int (*)(tenm_object *, const tenm_object *)) overrun_bit_act, (int (*)(tenm_object *, int)) overrun_bit_draw); if (new == NULL) { fprintf(stderr, "overrun_bit_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int overrun_bit_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; if (my->mass != NULL) tenm_move_mass(my->mass, dx_temp, dy_temp); if ((my->mass != NULL) && (!in_window_object(my))) { fprintf(stderr, "overrun_bit_move: the object is out of the window\n"); return 1; } return 0; } static int overrun_bit_hit(tenm_object *my, tenm_object *your) { /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (!(your->attr & ATTR_PLAYER_SHOT)) return 0; /* you can't destroy a green enemy */ if (my->count[4] <= 2) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); my->count[6] = 1; set_hit_status(my->name, OVERRUN_BIT_HIT_POINT, my->hit_point); if (my->hit_point <= 0) { tenm_table_apply(my->count[3], (int (*)(tenm_object *, int)) overrun_bit_signal_to_overrun, my->count[4]); overrun_bit_explosion(my); add_killed(my->count[2]); add_score(10000); return 1; } return 0; } static int overrun_bit_explosion(const tenm_object *my) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 2000, my->count[2], 8.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 500, my->count[2], 6.0, 12)); return 0; } static int overrun_bit_signal_to_overrun(tenm_object *my, int n) { int i; /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "Overrun") != 0) return 0; for (i = 0; i < 6; i++) { if (i == n) my->count[i + 2] = -1; else if ((n >= 3) && (i == n - 3)) tenm_table_apply(my->count[i + 2], (int (*)(tenm_object *, int)) overrun_bit_signal_to_bit, 0); } return 0; } static int overrun_bit_signal_to_bit(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "Overrun bit") != 0) return 0; (my->count[5])++; return 0; } static int overrun_bit_act(tenm_object *my, const tenm_object *player) { double temp_x; double temp_y; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; /* speed change */ temp_x = my->x + my->count_d[0]; temp_y = my->y + my->count_d[1]; if ((temp_x < 0.0) || (temp_x >= ((double) WINDOW_WIDTH))) my->count_d[0] *= -1.0; if ((temp_y < 0.0) || (temp_y >= ((double) WINDOW_HEIGHT))) my->count_d[1] *= -1.0; /* shoot */ if (my->count[1] == 0) { (my->count[0])++; if (my->count[0] >= 39) { my->count[0] = 0; if (my->count[5] >= 1) tenm_table_add(laser_point_new(my->x, my->y, 5.5, player->x, player->y, 20.0, my->count[2], 1000)); } } else if (my->count[1] == 1) { (my->count[0])--; if (my->count[0] <= 0) { overrun_bit_explosion(my); return 1; } } else fprintf(stderr, "overrun_bit_act: strange mode (%d)\n", my->count[1]); return 0; } static int overrun_bit_draw(tenm_object *my, int priority) { tenm_color color; int n; /* sanity check */ if (my == NULL) return 0; if (my->count[1] == 2) { /* dead enemy has low priority */ if (priority != -1) return 0; } else { if (priority != 0) return 0; } switch (my->count[2]) { case COLOR_BLUE: n = 0; break; case COLOR_PURPLE: n = 1; break; case COLOR_RED: n = 2; break; case COLOR_GREEN: n = 3; break; default: fprintf(stderr, "overrun_bit_draw: strange my->count[2] (%d)\n", my->count[2]); n = 0; break; } if ((my->count[2] != COLOR_GREEN) && (my->count[6] != 0)) n += 4; if (overrun_bit_blit((int) (my->x), (int) (my->y), n) != 0) { fprintf(stderr, "overrun_bit_draw: overrun_bit_blit failed\n"); my->count[6] = 0; return 1; } my->count[6] = 0; return 0; /* the below may be useful for debugging */ switch (my->count[2]) { case COLOR_BLUE: color = tenm_map_color(59, 112, 156); break; case COLOR_PURPLE: color = tenm_map_color(78, 59, 156); break; case COLOR_RED: color = tenm_map_color(156, 59, 72); break; case COLOR_GREEN: color = tenm_map_color(59, 156, 71); break; default: color = tenm_map_color(0, 0, 0); break; } if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "overrun_bit_draw: tenm_draw_mass failed\n"); return 1; } return 0; } tenmado-0.10/happy-L/overrun.h0000644000175000017500000000033410276702754017062 0ustar00ooharaoohara00000000000000/* $Id: overrun.h,v 1.2 2002/06/12 13:53:51 oohara Exp $ */ #ifndef __TENMADO_OVERRUN_H__ #define __TENMADO_OVERRUN_H__ #include "tenm_object.h" tenm_object *overrun_new(void); #endif /* not __TENMADO_OVERRUN_H__ */ tenmado-0.10/happy-L/player-shot.c0000644000175000017500000001057410276702754017633 0ustar00ooharaoohara00000000000000/* $Id: player-shot.c,v 1.82 2003/04/11 08:48:44 oohara Exp $ */ #include /* malloc */ #include #include "const.h" #include "tenm_graphic.h" #include "tenm_object.h" #include "tenm_primitive.h" #include "chain.h" #include "util.h" #include "player-shot.h" static int player_shot_move(tenm_object *my, double turn_per_frame); static int player_shot_hit(tenm_object *my, tenm_object *your); static int player_shot_draw(tenm_object *my, int priority); static int player_shot_act(tenm_object *my, const tenm_object *player); tenm_object * player_shot_new(double x, double y) { tenm_primitive **p; tenm_object *new; int *count = NULL; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "player_shot_new: malloc(p) failed\n"); return NULL; } /* p[0] = (tenm_primitive *) tenm_circle_new(x, y, 6.0); */ p[0] = (tenm_primitive *) tenm_polygon_new(3, x, y - 46.0, x - 6.0, y + 7.0, x + 6.0, y + 7.0); if (p[0] == NULL) { fprintf(stderr, "player_shot_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 2); if (count == NULL) { fprintf(stderr, "player_shot_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } /* list of count * [0] delete flag * 0: not yet hit anything * 1: already hit, should be drawn only once more * 2: should be deleted in the first move of the next frame * [1] damage decrease timer */ count[0] = 0; count[1] = 4; new =tenm_object_new("player_shot", ATTR_PLAYER_SHOT, ATTR_ENEMY | ATTR_OBSTACLE | ATTR_OPAQUE, 2, x, y, 2, count, 0, NULL, 1, p, (int (*)(tenm_object *, double)) player_shot_move, (int (*)(tenm_object *, tenm_object *)) player_shot_hit, (int (*)(tenm_object *, const tenm_object *)) player_shot_act, (int (*)(tenm_object *, int)) player_shot_draw); if (new == NULL) { fprintf(stderr, "player_shot_new: tenm_object_new failed\n"); free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int player_shot_move(tenm_object *my, double turn_per_frame) { double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; /* evil hack for a nicer look * this is an abuse of a move function, but I have no better idea */ if (my->count[0] == 2) { return 1; } else if (my->count[0] == 1) { my->attr = 0; my->hit_mask = 0; return 0; } dy_temp = -52.0 / turn_per_frame; my->y += dy_temp; tenm_move_mass(my->mass, 0.0, dy_temp); if (!(in_window_object(my))) return 1; /* another evil hack */ if ((my->hit_point != 1) && (my->count[1] <= 0)) my->hit_point = 1; return 0; } static int player_shot_hit(tenm_object *my, tenm_object *your) { /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; my->count[0] = 1; return 0; } static int player_shot_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; if (my->count[0] == 2) { /* should not reach here */ return 1; } if (my->y + 6.0 < 0.0) return 1; if (my->count[1] > 0) (my->count[1])--; if (my->count[0] == 1) my->count[0] = 2; return 0; } static int player_shot_draw(tenm_object *my, int priority) { tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 0) return 0; /* (1 - 0.6) * 255 + 0.6 * normal_shot_color */ switch (get_color_expected()) { case COLOR_BLUE: color = tenm_map_color(102, 140, 255); break; case COLOR_PURPLE: color = tenm_map_color(178, 102, 255); break; case COLOR_RED: color = tenm_map_color(255, 102, 132); break; case COLOR_GREEN: color = tenm_map_color(102, 255, 140); break; default: color = tenm_map_color(102, 102, 102); break; } if (my->hit_point < 2) color = tenm_map_color(102, 102, 102); if (tenm_draw_primitive(my->mass->p[0], color) != 0) return 1; return 0; } tenmado-0.10/happy-L/player-shot.h0000644000175000017500000000037610276702754017637 0ustar00ooharaoohara00000000000000/* $Id: player-shot.h,v 1.4 2002/05/08 10:52:17 oohara Exp $ */ #ifndef __TENMADO_PLAYER_SHOT_H__ #define __TENMADO_PLAYER_SHOT_H__ #include "tenm_object.h" tenm_object *player_shot_new(double x, double y); #endif /* not __TENMADO_PLAYER_SHOT_H__ */ tenmado-0.10/happy-L/player.c0000644000175000017500000003230310276702754016652 0ustar00ooharaoohara00000000000000/* $Id: player.c,v 1.155 2003/01/25 11:29:40 oohara Exp $ */ #include /* malloc */ #include #include "const.h" #include "tenm_graphic.h" #include "tenm_input.h" #include "tenm_object.h" #include "tenm_primitive.h" #include "player-shot.h" #include "tenm_table.h" #include "explosion.h" #include "ship.h" #include "chain.h" #include "util.h" #include "image.h" #include "player.h" #define TIME_RESTART 40 #define TIME_IMMUTABLE 50 static int player_draw(tenm_object *my, int priority); static int player_move(tenm_object *my, double turn_per_frame); static int player_hit(tenm_object *my, tenm_object *your); static int player_act(tenm_object *my, const tenm_object *player); static int player_key_status_tutorial(int t); tenm_object * player_new(int tutorial) { double x; double y; tenm_primitive **p = NULL; int *count = NULL; double *count_d = NULL; tenm_object *player = NULL; /* sanity check */ if ((tutorial < 0) || (tutorial > 1)) { fprintf(stderr, "player_new: strange tutorial (%d)\n", tutorial); return NULL; } if (tutorial == 0) { x = ((double) WINDOW_WIDTH) / 2.0; y = ((double) WINDOW_HEIGHT) * 0.9; } else { x = 80.0; y = ((double) WINDOW_HEIGHT) * 0.9; } p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "player_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 5.0); if (p[0] == NULL) { fprintf(stderr, "player_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "player_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "player_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* This is 6 ("second shot"), not -1 ("first shot") because * the space key is used to choose a menu in the title. * If this is -1, you shoot one shot as soon as the game begins, * which is a little ugly */ count[0] = 6; count[1] = 50; count[2] = tutorial; count[3] = 0; count_d[0] = 0.0; count_d[1] = 0.0; /* list of count * [0] shoot wait * < 0 means next is first shot (no need to wait) * >= 0 means wait for next (second or later) shot * [1] immutable time * [2] real/fake (for tutorial) * [3] timer (for tutorial) */ /* * list of cound_d * [0] speed x * [1] speed y */ player = tenm_object_new("player", ATTR_PLAYER, 0, 1, x, y, 4, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) player_move, (int (*)(tenm_object *, tenm_object *)) player_hit, (int (*)(tenm_object *, const tenm_object *)) player_act, (int (*)(tenm_object *, int)) player_draw); if (player == NULL) { fprintf(stderr, "player_new: tenm_object_new failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); if (count_d != NULL) free(count_d); return NULL; } return player; } static int player_draw(tenm_object *my, int priority) { int status = 0; int n; int key_status; /* sanity check */ if ((priority < 0) || (priority >= 2)) return 0; /* we don't check my == NULL here because this can be called * even if the game is over */ /* no need to draw the player if the game is over */ if (get_ship() < 0) { if (priority == 1) draw_string(200, 300, "game over", 9); return 0; } /* sanity check again */ if (my == NULL) return 0; if (priority != 0) return 0; switch (get_color_expected()) { case COLOR_BLUE: n = 0; break; case COLOR_PURPLE: n = 1; break; case COLOR_RED: n = 2; break; default: n = -1; break; } /* show key status if it is a tutorial */ if (my->count[2] != 0) { /* my->count[3] is already incremented in act */ key_status = player_key_status_tutorial(my->count[3] - 1); if (key_status & 1) { if (draw_string(WINDOW_WIDTH - 130, WINDOW_HEIGHT - 95, "UP", 2) != 0) status = 1; } else { if (draw_string(WINDOW_WIDTH - 130, WINDOW_HEIGHT - 95, "up", 2) != 0) status = 1; } if (key_status & 2) { if (draw_string(WINDOW_WIDTH - 140, WINDOW_HEIGHT - 65, "DOWN", 4) != 0) status = 1; } else { if (draw_string(WINDOW_WIDTH - 140, WINDOW_HEIGHT - 65, "down", 4) != 0) status = 1; } if (key_status & 4) { if (draw_string(WINDOW_WIDTH - 110, WINDOW_HEIGHT - 80, "RIGHT", 5) != 0) status = 1; } else { if (draw_string(WINDOW_WIDTH - 110, WINDOW_HEIGHT - 80, "right", 5) != 0) status = 1; } if (key_status & 8) { if (draw_string(WINDOW_WIDTH - 170, WINDOW_HEIGHT - 80, "LEFT", 4) != 0) status = 1; } else { if (draw_string(WINDOW_WIDTH - 170, WINDOW_HEIGHT - 80, "left", 4) != 0) status = 1; } if (key_status & 16) { if (draw_string(WINDOW_WIDTH - 50, WINDOW_HEIGHT - 80, "SPACE", 5) != 0) status = 1; } else { if (draw_string(WINDOW_WIDTH - 50, WINDOW_HEIGHT - 80, "space", 5) != 0) status = 1; } } if ((my->count[1] <= TIME_IMMUTABLE) && (n >= 0)) if (player_blit((int) my->x, (int) my->y, n) != 0) status = 1; if (my->count[1] <= 0) { if (tenm_draw_circle((int) (my->x), (int) (my->y), 5, 2, tenm_map_color(23, 39, 39)) != 0) status = 1; /* may be useful for debugging */ /* if (tenm_draw_primitive(my->mass->p[0], tenm_map_color(0, 0, 0)) != 0) status = 1; */ } return status; } static int player_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; /* boundary check */ if (my->x + dx_temp < 0.0) dx_temp = -(my->x); else if (my->x + dx_temp > (double) WINDOW_WIDTH) dx_temp = ((double) WINDOW_WIDTH) - my->x; if (my->y + dy_temp < 0.0) dy_temp = -(my->y); else if (my->y + dy_temp > (double) WINDOW_HEIGHT) dy_temp = ((double) WINDOW_HEIGHT) - my->y; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); return 0; } static int player_hit(tenm_object *my, tenm_object *your) { /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1] / 2.0, 1, 500, get_color_expected(), 5.0, 10)); tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1] / 2.0, 2, 150, get_color_expected(), 3.0, 10)); tenm_table_add(explosion_new(my->x, my->y, my->count_d[0] / 2.0, my->count_d[1] / 2.0, 3, 40, get_color_expected(), 1.0, 10)); my->hit_mask = 0; my->hit_point = 0; my->count[0] = -1; my->count[1] = TIME_RESTART + TIME_IMMUTABLE; my->count_d[0] = 0.0; my->count_d[1] = 0.0; return 0; } /* list of keys * 1 TENM_KEY_UP * 2 TENM_KEY_DOWN * 4 TENM_KEY_RIGHT * 8 TENM_KEY_LEFT * 16 TENM_KEY_SPACE (shoot) * 32 TENM_KEY_ESCAPE (quit) * 64 TENM_KEY_p (pause) */ /* note that "player" (arg 2) is NULL */ static int player_act(tenm_object *my, const tenm_object *player) { double dx_temp; double dy_temp; int key_status; double speed; double speed_diagonal; /* sanity check */ if (my == NULL) return 0; if (my->count[2] == 0) { key_status = tenm_get_key_status(); } else { key_status = player_key_status_tutorial(my->count[3]); (my->count[3])++; } if ((get_ship() < 0) || (my->count[1] > 0)) (my->count[1])--; if (get_ship() < 0) { if (my->count[1] <= TIME_IMMUTABLE * (-2)) return 1; return 0; } if (my->count[1] == TIME_IMMUTABLE) { /* player restarts */ add_ship(-1); if (get_ship() < 0) return 0; my->hit_point = 1; if (my->count[2] == 0) { dx_temp = ((double) WINDOW_WIDTH) / 2.0 - my->x; dy_temp = ((double) WINDOW_HEIGHT) * 0.9 - my->y; } else { dx_temp = 80.0 - my->x; dy_temp = ((double) WINDOW_HEIGHT) * 0.9 - my->y; } my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); clear_chain(); tenm_table_apply_all((int (*)(tenm_object *, int)) delete_enemy_shot, 0); } if (my->count[1] <= 0) my->hit_mask = ATTR_ENEMY | ATTR_ENEMY_SHOT | ATTR_OBSTACLE | ATTR_OPAQUE; if (my->hit_point == 0) return 0; /* note that 8.0 * sqrt(2.0) / 2.0 = 5.656... */ speed = 8.0; speed_diagonal = 5.656; /* first, refuse to move for a stupid player */ if ((key_status & 1) && (key_status & 2)) { my->count_d[1] = 0.0; my->count_d[0] = 0.0; } else if ((key_status & 4) && (key_status & 8)) { my->count_d[1] = 0.0; my->count_d[0] = 0.0; } else if (key_status & 1) { if (key_status & 4) { my->count_d[1] = -speed_diagonal; my->count_d[0] = speed_diagonal; } else if (key_status & 8) { my->count_d[1] = -speed_diagonal; my->count_d[0] = -speed_diagonal; } else { my->count_d[1] = -speed; my->count_d[0] = 0.0; } } else if (key_status & 2) { if (key_status & 4) { my->count_d[1] = speed_diagonal; my->count_d[0] = speed_diagonal; } else if (key_status & 8) { my->count_d[1] = speed_diagonal; my->count_d[0] = -speed_diagonal; } else { my->count_d[1] = speed; my->count_d[0] = 0.0; } } else { if (key_status & 4) { my->count_d[1] = 0.0; my->count_d[0] = speed; } else if (key_status & 8) { my->count_d[1] = 0.0; my->count_d[0] = -speed; } else { my->count_d[1] = 0.0; my->count_d[0] = 0.0; } } if (key_status & 16) { /* the second shot is intentionally delayed so that * you can shoot only one shot easily */ if (my->count[0] <= 0) tenm_table_add(player_shot_new(my->x, my->y)); if (my->count[0] < 0) my->count[0] = 6; else if (my->count[0] > 0) (my->count[0])--; } else my->count[0] = -1; return 0; } /* virtual key input for the tutorial */ static int player_key_status_tutorial(int t) { if ((t >= 170) && (t < 190)) return 1; else if ((t >= 190) && (t < 210)) return 4; else if ((t >= 210) && (t < 230)) return 2; else if ((t >= 230) && (t < 240)) return 8; else if ((t >= 240) && (t < 250)) return 1; else if ((t >= 260) && (t < 270)) return 1 + 8; else if ((t >= 270) && (t < 280)) return 2 + 4; else if ((t >= 290) && (t < 300)) return 1 + 4; else if ((t >= 300) && (t < 320)) return 2 + 8; else if ((t >= 360) && (t < 365)) return 16; else if ((t >= 370) && (t < 375)) return 16; else if ((t >= 380) && (t < 385)) return 16; else if ((t >= 420) && (t < 690)) return 16; else if ((t >= 840) && (t < 845)) return 16; else if ((t >= 860) && (t < 865)) return 16; else if ((t >= 880) && (t < 885)) return 16; else if ((t >= 1020) && (t < 1040)) return 1; else if ((t >= 1140) && (t < 1145)) return 16; else if ((t >= 1160) && (t < 1165)) return 16; else if ((t >= 1180) && (t < 1185)) return 16; else if ((t >= 2050) && (t < 2055)) return 16; else if ((t >= 2060) && (t < 2065)) return 16; else if ((t >= 2070) && (t < 2075)) return 16; else if ((t >= 2080) && (t < 2085)) return 16; else if ((t >= 2330) && (t < 2335)) return 8; else if ((t >= 2340) && (t < 2345)) return 16; else if ((t >= 2380) && (t < 2390)) return 4; else if ((t >= 2395) && (t < 2400)) return 16; else if ((t >= 2650) && (t < 2655)) return 16; else if ((t >= 2660) && (t < 2670)) return 8; else if ((t >= 2675) && (t < 2680)) return 16; else if ((t >= 2685) && (t < 2695)) return 4; else if ((t >= 2700) && (t < 2705)) return 16; else if ((t >= 2710) && (t < 2720)) return 8; else if ((t >= 2725) && (t < 2730)) return 16; else if ((t >= 2735) && (t < 2745)) return 4; else if ((t >= 2750) && (t < 2755)) return 16; else if ((t >= 2760) && (t < 2770)) return 8; else if ((t >= 2775) && (t < 2780)) return 16; else if ((t >= 2785) && (t < 2795)) return 4; else if ((t >= 2800) && (t < 2805)) return 16; else if ((t >= 2810) && (t < 2820)) return 8; else if ((t >= 2825) && (t < 2830)) return 16; else if ((t >= 2835) && (t < 2840)) return 4; else if ((t >= 2880) && (t < 2970)) return 16; else if ((t >= 2970) && (t < 2975)) return 8 + 16; else if ((t >= 2975) && (t < 3005)) return 16; return 0; } tenmado-0.10/happy-L/player.h0000644000175000017500000000034010276702754016653 0ustar00ooharaoohara00000000000000/* $Id: player.h,v 1.14 2002/07/10 07:42:28 oohara Exp $ */ #ifndef __TENMADO_PLAYER_H__ #define __TENMADO_PLAYER_H__ #include "tenm_object.h" tenm_object *player_new(int tutorial); #endif /* not __TENMADO_PLAYER_H__ */ tenmado-0.10/happy-L/result.c0000644000175000017500000001450310276702754016676 0ustar00ooharaoohara00000000000000/* $Id: result.c,v 1.44 2004/09/04 17:28:36 oohara Exp $ */ /* VERSION, NOT_HAVE_POSIX */ #include #include /* strlen */ #include /* free */ #include #include "stage.h" #include "score.h" #include "tenm_graphic.h" #include "util.h" #include "tenm_input.h" #include "tenm_timer.h" #include "esc-ok.h" #include "high-score.h" #include "bac_array.h" /* bac_compare_entry */ #include "bac_entry.h" #include "option.h" #include "result.h" static int show_rank(bac_array *array_player, bac_array **array_list, int stage, int y); /* return 1 if the program should quit, 0 if not */ int show_result(void) { int i; int y; char temp[32]; int stage_score[6]; bac_array *array_player = NULL; bac_array **array_list = NULL; int no_entry; const option *op = NULL; /* no need to detect focus loss */ tenm_set_focus_handler((void (*)(int)) NULL); op = get_option(); if (op == NULL) { fprintf(stderr, "show_result: get_option failed\n"); /* we should have checked the options */ return 1; } /* no need for high score list stuff if --slow or --stage is specified */ if ((op->slow == 0) && ((op->stage < 1) || (op->stage > 5))) { for (i = 1; i <= 6; i++) stage_score[i - 1] = get_stage_score(i); array_player = make_high_score(get_score(), stage_score); if (array_player == NULL) { fprintf(stderr, "show_result: make_high_score failed\n"); } no_entry = 0; array_list = read_high_score(0, &no_entry); if (array_list == NULL) { if (no_entry != 0) { printf("show_result: at least one high score file is empty\n"); fflush(stdout); } else { fprintf(stderr, "show_result: read_high_score failed\n"); } } } tenm_timer_reset(); tenm_clear_window(tenm_map_color(253, 245, 230)); if (draw_string(100, 90, "tenmado result", 14) != 0) fprintf(stderr, "show_result: draw_string (line 1) failed\n"); sprintf(temp, "version %.20s", VERSION); if (draw_string(100, 120, temp, (int) strlen(temp)) != 0) fprintf(stderr, "show_result: draw_string (line 2) failed\n"); #ifndef NOT_HAVE_POSIX if (array_player != NULL) { if (((bac_entry_ver_0 *) (array_player->p[0]))->user_name_available) sprintf(temp, "player: %-12.12s", ((bac_entry_ver_0 *) array_player->p[0])->user_name); else sprintf(temp, "player: (uid %5d)", ((bac_entry_ver_0 *) array_player->p[0])->uid); if (draw_string(100, 180, temp, (int) strlen(temp)) != 0) fprintf(stderr, "show_result: draw_string (line 3) failed\n"); } #endif /* not NOT_HAVE_POSIX */ sprintf(temp, "total score: %8d", get_score()); if (draw_string(100, 210, temp, (int) strlen(temp)) != 0) fprintf(stderr, "show_result: draw_string (line 4) failed\n"); if ((array_player != NULL) && (array_list != NULL)) { if (show_rank(array_player, array_list, 0, 210) != 0) fprintf(stderr, "show_result: show_rank (line 4) failed\n"); } for (i = 1; i <= 4; i++) { y = 240 + i * 30; sprintf(temp, "stage %1d: %8d", i, get_stage_score(i)); if (draw_string(100, y, temp, (int) strlen(temp)) != 0) fprintf(stderr, "show_result: draw_string (line %d) failed\n", i + 4); if ((array_player != NULL) && (array_list != NULL)) { if (show_rank(array_player, array_list, i, y) != 0) fprintf(stderr, "show_result: show_rank (line %d) failed\n", i + 4); } } sprintf(temp, "final stage: %8d", get_stage_score(5)); if (draw_string(100, 390, temp, (int) strlen(temp)) != 0) fprintf(stderr, "show_result: draw_string (line 9) failed\n"); if ((array_player != NULL) && (array_list != NULL)) { if (show_rank(array_player, array_list, 5, 390) != 0) fprintf(stderr, "show_result: show_rank (line 9) failed\n"); } if (get_stage() == 6) { /* the player cleared the entire game */ sprintf(temp, "ship bonus: %8d", get_stage_score(6)); if (draw_string(100, 420, temp, (int) strlen(temp)) != 0) fprintf(stderr, "show_result: draw_string (line 10) failed\n"); /* there is no score list for stage 6 */ } if (draw_string(160, 600, "press ESC to quit", 17) != 0) fprintf(stderr, "show_result: draw_string (ESC instruction) failed\n"); tenm_redraw_window(); if (array_player != NULL) { if (save_high_score(array_player) != 0) fprintf(stderr, "show_result: save_high_score failed\n"); if (array_list != NULL) { if (truncate_high_score(array_list) != 0) fprintf(stderr, "show_result: truncate_high_score failed\n"); } } while (1 == 1) { /* quit the program if a SDL_QUIT event happened * (for example, if a SIGINT signal (sent by Ctrl+c) is received) */ if (tenm_event_handle() != 0) { if (array_list != NULL) { for (i = 0; i < 6; i++) bac_array_delete(array_list[i]); free(array_list); } if (array_player != NULL) bac_array_delete(array_player); return 1; } /* back to the title if ESC is pressed */ if (tenm_get_key_status() & 32) { if (get_esc_ok()) { set_esc_ok(0); break; } } else { set_esc_ok(1); } /* this wait is necessary to save CPU time */ tenm_wait_next_frame(); } if (array_list != NULL) { for (i = 0; i < 6; i++) bac_array_delete(array_list[i]); free(array_list); } if (array_player != NULL) bac_array_delete(array_player); return 0; } /* return 0 on success, 1 on error */ static int show_rank(bac_array *array_player, bac_array **array_list, int stage, int y) { int i; int status = 0; char temp[8]; /* sanity check */ if (array_player == NULL) return 0; if (array_player->n < 6) return 0; if (array_list == NULL) return 0; for (i = 0; i < high_score_list_size(stage); i++) { if ((i >= (array_list[stage])->n) || (bac_compare_entry(&(array_player->p[stage]), &((array_list[stage])->p[i])) < 0)) { sprintf(temp, "(#%3d)", i + 1); temp[8 - 1] = '\0'; if (draw_string(300, y, temp, (int) strlen(temp)) != 0) { fprintf(stderr, "show_rank: draw_string (stage %d) failed\n", stage); status = 1; } break; } } return status; } tenmado-0.10/happy-L/result.h0000644000175000017500000000026510276702754016703 0ustar00ooharaoohara00000000000000/* $Id: result.h,v 1.1 2002/07/10 11:47:10 oohara Exp $ */ #ifndef __TENMADO_RESULT_H__ #define __TENMADO_RESULT_H__ int show_result(void); #endif /* not __TENMADO_RESULT_H__ */ tenmado-0.10/happy-L/rotate-laser.c0000644000175000017500000001254410276702754017765 0ustar00ooharaoohara00000000000000/* $Id: rotate-laser.c,v 1.7 2002/08/04 16:07:24 oohara Exp $ */ #include /* malloc */ #include #include "const.h" #include "tenm_primitive.h" #include "tenm_object.h" #include "tenm_math.h" #include "tenm_graphic.h" #include "util.h" #include "rotate-laser.h" static int rotate_laser_move(tenm_object *my, double turn_per_frame); static int rotate_laser_act(tenm_object *my, const tenm_object *player); static int rotate_laser_draw(tenm_object *my, int priority); tenm_object * rotate_laser_new(double x, double y, double speed_x, double speed_y, int theta, double speed_theta, double length, int color, int life) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; int temp; /* sanity check */ /* negative speed_theta is OK --- it means counterclockwise */ if ((speed_theta > 0.1) && (speed_theta < 0.1)) return NULL; if (length <= 0.0) return NULL; if (life <= 0) return NULL; if (speed_theta > 0.0) temp = 1; else temp = -1; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "rotate_laser_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_polygon_new(3, x, y, x + length * tenm_cos(theta), y + length * tenm_sin(theta), x +length * tenm_cos(theta+temp), y +length * tenm_sin(theta+temp)); if (p[0] == NULL) { fprintf(stderr, "rotate_laser_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 3); if (count == NULL) { fprintf(stderr, "rotate_laser_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 5); if (count_d == NULL) { fprintf(stderr, "rotate_laser_new: malloc(count_d) failed\n"); free(count); (p[0])->delete(p[0]); free(p); return NULL; } /* list of count * [0] color * [1] life * [2] theta */ /* list of count_d * [0] speed x * [1] speed y * [2] length * [3] speed theta * [4] rotate timer */ count[0] = color; count[1] = life; count[2] = theta; count_d[0] = speed_x; count_d[1] = speed_y; count_d[2] = length; count_d[3] = speed_theta; count_d[4] = 0.0; new = tenm_object_new("rotate laser", ATTR_ENEMY_SHOT, 0, 1, x, y, 3, count, 5, count_d, 1, p, (int (*)(tenm_object *, double)) rotate_laser_move, NULL, (int (*)(tenm_object *, const tenm_object *)) rotate_laser_act, (int (*)(tenm_object *, int)) rotate_laser_draw); if (new == NULL) { fprintf(stderr, "rotate_laser_new: tenm_object_new failed\n"); free(count_d); free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int rotate_laser_move(tenm_object *my, double turn_per_frame) { double x_temp; double y_temp; double dx_temp; double dy_temp; int dtheta_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); my->count_d[4] += my->count_d[3] / turn_per_frame; if ((my->count_d[4] >= 1.0) || (my->count_d[4] <= -1.0)) { /* we need to rotate the laser */ for (; my->count_d[4] >= 1.0; my->count_d[4] -= 1.0) (my->count[2])++; for (; my->count_d[4] <= -1.0; my->count_d[4] += 1.0) (my->count[2])--; x_temp = ((tenm_polygon *) my->mass->p[0])->v[0]->x; y_temp = ((tenm_polygon *) my->mass->p[0])->v[0]->y; if (my->count_d[3] >= 0.0) dtheta_temp = 1; else dtheta_temp = -1; ((tenm_polygon *) my->mass->p[0])->v[1]->x = x_temp + my->count_d[2] * tenm_cos(my->count[2]); ((tenm_polygon *) my->mass->p[0])->v[1]->y = y_temp + my->count_d[2] * tenm_sin(my->count[2]); ((tenm_polygon *) my->mass->p[0])->v[2]->x = x_temp + my->count_d[2] * tenm_cos(my->count[2] + dtheta_temp); ((tenm_polygon *) my->mass->p[0])->v[2]->y = y_temp + my->count_d[2] * tenm_sin(my->count[2] + dtheta_temp); } if (!in_window_object(my)) return 1; return 0; } static int rotate_laser_act(tenm_object *my, const tenm_object *player) { (my->count[1])--; if (my->count[1] <= 0) return 1; return 0; } static int rotate_laser_draw(tenm_object *my, int priority) { int status = 0; tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 1) return 0; switch (my->count[0]) { case COLOR_BLUE: color = tenm_map_color(0, 63, 255); break; case COLOR_PURPLE: color = tenm_map_color(127, 0, 255); break; case COLOR_RED: color = tenm_map_color(255, 0, 50); break; case COLOR_GREEN: color = tenm_map_color(0, 255, 63); break; default: color = tenm_map_color(0, 0, 0); break; } if (tenm_draw_primitive(my->mass->p[0], color) != 0) status = 1; return status; } tenmado-0.10/happy-L/rotate-laser.h0000644000175000017500000000070010276702754017761 0ustar00ooharaoohara00000000000000/* $Id: rotate-laser.h,v 1.2 2002/05/23 23:48:33 oohara Exp $ */ #ifndef __TENMADO_ROTATE_LASER_H__ #define __TENMADO_ROTATE_LASER_H__ #include "tenm_object.h" tenm_object *rotate_laser_new(double x, double y, double speed_x, double speed_y, int theta, double speed_theta, double length, int color, int life); #endif /* not __TENMADO_ROTATE_LASER_H__ */ tenmado-0.10/happy-L/scheduler.c0000644000175000017500000000206510276702754017336 0ustar00ooharaoohara00000000000000/* $Id: scheduler.c,v 1.72 2002/07/11 14:36:28 oohara Exp $ */ #include #include "const.h" #include "stage.h" #include "stage-1.h" #include "stage-2.h" #include "stage-3.h" #include "stage-4.h" #include "stage-5.h" #include "ending.h" #include "tutorial.h" #include "scheduler.h" static int stage_cleared = 0; int scheduler(int t) { int stage = get_stage(); /* sanity check */ if (stage < 0) return SCHEDULER_SUCCESS; if (t < 0) return SCHEDULER_SUCCESS; if (stage_cleared != 0) { set_stage_cleared(0); return SCHEDULER_NEXT_STAGE; } if (stage == 1) return scheduler_1(t); else if (stage == 2) return scheduler_2(t); else if (stage == 3) return scheduler_3(t); else if (stage == 4) return scheduler_4(t); else if (stage == 5) return scheduler_5(t); else if (stage == 6) return ending(t); else if (stage == 7) return tutorial(t); fprintf(stderr, "scheduler: strange stage (%d) (t = %d)\n", stage, t); return SCHEDULER_ERROR; } void set_stage_cleared(int n) { stage_cleared = n; } tenmado-0.10/happy-L/scheduler.h0000644000175000017500000000034010276702754017335 0ustar00ooharaoohara00000000000000/* $Id: scheduler.h,v 1.4 2002/07/10 13:11:51 oohara Exp $ */ #ifndef __TENMADO_SCHEDULER_H__ #define __TENMADO_SCHEDULER_H__ int scheduler(int t); void set_stage_cleared(int n); #endif /* not __TENMADO_SCHEDULER_H__ */ tenmado-0.10/happy-L/solution.c0000644000175000017500000002435610276702754017243 0ustar00ooharaoohara00000000000000/* $Id: solution.c,v 1.38 2003/01/12 17:03:16 oohara Exp $ */ #include /* malloc */ #include /* strcmp */ #include #include "tenm_primitive.h" #include "tenm_object.h" #include "const.h" #include "tenm_table.h" #include "score.h" #include "tenm_graphic.h" #include "hit-status.h" #include "explosion.h" #include "chain.h" #include "util.h" #include "laser.h" #include "tenm_math.h" #include "image.h" #include "solution.h" #define SOLUTION_HIT_POINT 350 static int solution_move(tenm_object *my, double turn_per_frame); static int solution_hit(tenm_object *my, tenm_object *your); static int solution_signal(tenm_object *my, int n); static int solution_act(tenm_object *my, const tenm_object *player); static int solution_draw(tenm_object *my, int priority); static tenm_object *solution_shot_new(double x, double y, int t, double dddx); static int solution_shot_move(tenm_object *my, double turn_per_frame); static int solution_shot_act(tenm_object *my, const tenm_object *player); static int solution_shot_draw(tenm_object *my, int priority); tenm_object * solution_new(int parent_index) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; double x = ((double) WINDOW_WIDTH) + 47.0; double y = 100.0; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "solution_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_polygon_new(4, x - 48.0, y - 36.0, x - 48.0, y + 36.0, x + 48.0, y + 36.0, x + 48.0, y - 36.0); if (p[0] == NULL) { fprintf(stderr, "solution_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "solution_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 2); if (count_d == NULL) { fprintf(stderr, "solution_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); if (count != NULL) free(count); return NULL; } /* list of count * [0] table index of parent * [1] total timer * [2] shoot timer * [3] "damaged" flag */ /* list of count_d * [0] speed x * [1] speed y */ count[0] = parent_index; count[1] = -20; count[2] = 0; count[3] = 0; count_d[0] = (((double) WINDOW_WIDTH) / 2.0 - x) / 20.0; count_d[1] = 0.0; new = tenm_object_new("Solution", ATTR_ENEMY, ATTR_PLAYER_SHOT, SOLUTION_HIT_POINT, x, y, 4, count, 2, count_d, 1, p, (int (*)(tenm_object *, double)) solution_move, (int (*)(tenm_object *, tenm_object *)) solution_hit, (int (*)(tenm_object *, const tenm_object *)) solution_act, (int (*)(tenm_object *, int)) solution_draw); if (new == NULL) { fprintf(stderr, "solution_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int solution_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); if (!in_window_object(my)) { tenm_table_apply(my->count[0], (int (*)(tenm_object *, int)) solution_signal, 0); return 1; } return 0; } static int solution_hit(tenm_object *my, tenm_object *your) { /* sanity check */ if (my == NULL) return 0; if (your == NULL) return 0; if (!(your->attr & ATTR_PLAYER_SHOT)) return 0; my->hit_point -= add_damage_score(my->hit_point, your->hit_point); set_hit_status(my->name, SOLUTION_HIT_POINT, my->hit_point); my->count[3] = 1; if (my->hit_point <= 0) { tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 1, 3000, COLOR_PURPLE, 6.0, 12)); tenm_table_add(explosion_new(my->x, my->y, 0.0, 0.0, 2, 500, COLOR_PURPLE, 4.0, 12)); tenm_table_apply(my->count[0], (int (*)(tenm_object *, int)) solution_signal, 0); add_killed(COLOR_PURPLE); add_score(500); return 1; } return 0; } static int solution_signal(tenm_object *my, int n) { /* sanity check */ if (my == NULL) return 0; if (strcmp(my->name, "stage 5 more 2") != 0) return 0; my->count[3] = 1; return 0; } static int solution_act(tenm_object *my, const tenm_object *player) { double dddx; /* sanity check */ if (my == NULL) return 0; if (player == NULL) return 0; /* speed change */ if (my->count[1] == -1) { my->count_d[0] = 0.0; my->count_d[1] = 1.0; } else if (my->count[1] > 500) { my->count_d[0] = -((((double) WINDOW_WIDTH) / 2.0 + 47.0) / 20.0); my->count_d[1] = 0.0; } else if (my->count[1] >= 0) { if (my->count[1] % 20 == 5) { my->count_d[0] = 1.5; my->count_d[1] = 0.0; } else if (my->count[1] % 20 == 15) { my->count_d[0] = -1.5; my->count_d[1] = 0.0; } } /* shoot */ if ((my->count[1] >= 0) && (my->count[1] <= 500)) { if (my->count[1] % 40 == 0) { tenm_table_add(laser_point_new(my->x - 36.0, my->y, 7.0, player->x, player->y, 30.0, COLOR_PURPLE, 1000)); } else if (my->count[1] % 40 == 20) { tenm_table_add(laser_point_new(my->x + 36.0, my->y, 7.0, player->x, player->y, 30.0, COLOR_PURPLE, 1000)); } if (my->count[1] % 5 != 4) { dddx = my->count[1] * 0.0001; if (dddx > 0.015) dddx = 0.015; tenm_table_add(solution_shot_new(my->x, my->y, my->count[2], dddx)); } (my->count[2])++; if (my->count[2] >= 24) my->count[2] = 0; } (my->count[1])++; return 0; } static int solution_draw(tenm_object *my, int priority) { int n = 0; tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 0) return 0; if (my->count[3] == 0) n = 0; else n = 1; if (solution_blit((int) (my->x), (int) (my->y), n) != 0) { fprintf(stderr, "solution_draw: solution_blit failed\n"); my->count[3] = 0; return 1; } my->count[3] = 0; return 0; /* the below may be useful for debugging */ color = tenm_map_color(78, 59, 156); if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "solution_draw: tenm_draw_mass failed\n"); return 1; } return 0; } static tenm_object * solution_shot_new(double x, double y, int t, double dddx) { tenm_primitive **p = NULL; tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "solution_shot_new: malloc(p) failed\n"); return NULL; return NULL; } p[0] = (tenm_primitive *) tenm_circle_new(x, y, 5.0); if (p[0] == NULL) { fprintf(stderr, "solution_shot_new: cannot set p[0]\n"); free(p); return NULL; } count = (int *) malloc(sizeof(int) * 1); if (count == NULL) { fprintf(stderr, "solution_shot_new: malloc(count) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 3); if (count_d == NULL) { fprintf(stderr, "solution_shot_new: malloc(count_d) failed\n"); free(count); (p[0])->delete(p[0]); free(p); return NULL; } /* list of count * [0] color (just for delete_enemy_shot) */ /* list of count_d * [0] speed x * [1] speed y * [2] ddx */ count[0] = COLOR_PURPLE; count_d[0] = 0.0; count_d[1] = 3.0; if (t <= 11) count_d[2] = ((double) (t - 6)) * dddx; else count_d[2] = ((double) (18 - t)) * dddx; new = tenm_object_new("solution shot", ATTR_ENEMY_SHOT, 0, 1, x, y, 1, count, 3, count_d, 1, p, (int (*)(tenm_object *, double)) solution_shot_move, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) solution_shot_act, (int (*)(tenm_object *, int)) solution_shot_draw); if (new == NULL) { fprintf(stderr, "solution_shot_new: tenm_object_new failed\n"); if (count_d != NULL) free(count_d); if (count != NULL) free(count); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int solution_shot_move(tenm_object *my, double turn_per_frame) { double dx_temp; double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dx_temp = my->count_d[0] / turn_per_frame; dy_temp = my->count_d[1] / turn_per_frame; my->x += dx_temp; my->y += dy_temp; tenm_move_mass(my->mass, dx_temp, dy_temp); if (!in_window_object(my)) return 1; return 0; } static int solution_shot_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; if ((my->count_d[0] > -3.0) && (my->count_d[0] < 3.0)) my->count_d[0] += my->count_d[2]; my->count_d[1] += 0.1; return 0; } static int solution_shot_draw(tenm_object *my, int priority) { tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 1) return 0; color = tenm_map_color(127, 0, 255); if (tenm_draw_circle((int) (my->x), (int) (my->y), 5, 2, color) != 0) return 1; /* may be useful for debugging */ /* if (tenm_draw_primitive(my->mass->p[0], color) != 0) return 1; */ return 0; } tenmado-0.10/happy-L/solution.h0000644000175000017500000000032310276702754017234 0ustar00ooharaoohara00000000000000/* $Id: solution.h,v 1.1 2002/07/09 02:34:44 oohara Exp $ */ #ifndef __TENMADO_SOLUTION_H__ #define __TENMADO_SOLUTION_H__ tenm_object *solution_new(int parent_index); #endif /* not __TENMADO_SOLUTION_H__ */ tenmado-0.10/happy-L/stage-1.c0000644000175000017500000012573610276702754016634 0ustar00ooharaoohara00000000000000/* $Id: stage-1.c,v 1.108 2003/01/03 22:36:10 oohara Exp $ */ #include /* malloc */ #include #include "tenm_table.h" #include "const.h" #include "message.h" #include "normal-enemy.h" #include "tenm_object.h" #include "midnight.h" #include "stage-1.h" static tenm_object *stage_1_more_1_new(void); static int stage_1_more_1_act(tenm_object *my, const tenm_object *player); static tenm_object *stage_1_more_2_new(void); static int stage_1_more_2_act(tenm_object *my, const tenm_object *player); static tenm_object *stage_1_more_3_new(int n); static int stage_1_more_3_act(tenm_object *my, const tenm_object *player); static tenm_object *stage_1_more_4_new(int n); static int stage_1_more_4_act(tenm_object *my, const tenm_object *player); static tenm_object *stage_1_more_5_new(void); static int stage_1_more_5_act(tenm_object *my, const tenm_object *player); int scheduler_1(int t) { int i = 0; int j; int color; int status = SCHEDULER_SUCCESS; double x; double dx; /* sanity check */ if (t < 0) { fprintf(stderr, "scheduler_1: strange t (%d)\n", t); return SCHEDULER_ERROR; } if (t == 30) { if (tenm_table_add(message_new(210.0, 240.0, 0.0, 0.0, 100, "stage 1", 7)) < 0) { fprintf(stderr, "scheduler_1: cannot create message \"stage 1\"" "(t = %d)\n", t); status = SCHEDULER_ERROR; } if (tenm_table_add(message_new(70.0, 270.0, 0.0, 0.0, 100, "the four-letter word that begins with L", 39)) < 0) { fprintf(stderr, "scheduler_1: cannot create message (stage 1 title) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 180) { if (tenm_table_add(stage_1_more_1_new()) < 0) { fprintf(stderr, "scheduler_1: cannot create stage_1_more_1 " "(t = %d)\n", t); return SCHEDULER_ERROR; } else return SCHEDULER_SUCCESS; } /* wait enough time to avoid getting a signal of more 1 */ if (t == 750) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 240.0, -5.0, 0.0, 1000, "It's life, love, libc or lisp,", 30)) < 0) { fprintf(stderr, "scheduler_1: cannot create message (stage 1 demo " "line 1) " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 780) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 270.0, -5.0, 0.0, 1000, "depending your point of view.", 29)) < 0) { fprintf(stderr, "scheduler_1: cannot create message (stage 1 demo " "line 2) " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 970) { for (i = 0; i < 4; i++) { if (i == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(0.0 - 31.0, 20.0 + (double) (60 * i), NORMAL_STING, 0, color, 0, -1, -1, 2, 1, /* move 0 */ 30, 8.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1000, -8.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 40, 30, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 1040) { for (i = 0; i < 4; i++) { if (i == 0) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) + 31.0, 20.0 + (double) (60 * i), NORMAL_STING, 0, color, 0, -1, -1, 2, 1, /* move 0 */ 30, -8.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1000, 8.0, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 40, 30, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 1110) { if (tenm_table_add(normal_enemy_new((double) (WINDOW_WIDTH / 2), 0.0 - 23.0, NORMAL_STING, 0, COLOR_PURPLE, 0, -1, -1, 3, 2, /* move 0 */ 20, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 100, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, -8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 110, 10, -30, 0, 1, /* shoot 1 */ 1000, 1000, 0, 0, 1)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if ((t >= 1150) && (t <= 1190) && (t % 10 == 0)) { for (i = 0; i < 2; i++) { if (i == 0) { color = COLOR_RED; x = 120.0; } else { color = COLOR_BLUE; x = ((double) WINDOW_WIDTH) - 120.0; } if (tenm_table_add(normal_enemy_new(x, 0.0 - 23.0, NORMAL_STING, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 25, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 1310) { if (tenm_table_add(stage_1_more_2_new()) < 0) { fprintf(stderr, "scheduler_1: cannot create stage_1_more_2 " "(t = %d)\n", t); return SCHEDULER_ERROR; } else return SCHEDULER_SUCCESS; } if (t == 1600) { for (i = 0; i < 2; i++) if (tenm_table_add(stage_1_more_3_new(i)) < 0) { fprintf(stderr, "scheduler_1: cannot create stage_1_more_3(%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } return status; } if ((t == 1995) || (t == 2043)) { for (i = 0; i < 6; i++) { if (t == 2043) { color = COLOR_PURPLE; } else if (i % 2 == 0) { color = COLOR_BLUE; } else { color = COLOR_RED; } x = 90.0 + ((double) (i * 60)); if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 3, 1, /* move 0 */ 60 - (t - 1995), 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 210, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t >= 2112) && (t <= 2160) && (t % 24 == 0)) { for (i = 0; i < 2; i++) { if (t % 48 == i * 24) color = COLOR_BLUE; else color = COLOR_RED; if (i == 0) { x = -24.0; dx = 2.5; } else { x = ((double) WINDOW_WIDTH) + 24.0; dx = -2.5; } for (j = 0; j < 3; j++) if (tenm_table_add(normal_enemy_new(x, 120.0 + ((double) (j * 60)) - 24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 2380) { if (tenm_table_add(normal_enemy_new((double) (WINDOW_WIDTH / 2), 0.0 - 24.0, NORMAL_HORIZON, 0, COLOR_PURPLE, 0, -1, -1, 5, 2, /* move 0 */ 20, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 100, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 88, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 100, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 1000, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* shoot 0 */ 150, 1, -50, 0, 1, /* shoot 1 */ 1000, 1, -88, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 2390) { for (i = 0; i < 2; i++) if (tenm_table_add(stage_1_more_4_new(i)) < 0) { fprintf(stderr, "scheduler_1: cannot create stage_1_more_4(%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } return status; } if (t == 2890) { for (i = 0; i < 6; i++) { if (i < 3) { x = -31.0; dx = 8.0; } else { x = ((double) WINDOW_WIDTH) + 31.0; dx = -8.0; } if (tenm_table_add(normal_enemy_new(x, 100.0 + 50.0 * ((double) (i % 3)), NORMAL_STING, 0, COLOR_PURPLE, 0, -1, -1, 3, 1, /* move 0 */ 10, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 20, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, dx / (2.0- 0.5 * ((double) (i % 3))), 0.0, 0.0, 0.4, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 20, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 2980) { for (i = 0; i < 8; i++) { if (i < 4) { x = -31.0; dx = 8.0; } else { x = ((double) WINDOW_WIDTH) + 31.0; dx = -8.0; } if (tenm_table_add(normal_enemy_new(x, 100.0 + 50.0 * ((double) (i % 4)), NORMAL_STING, 0, COLOR_RED, 0, -1, -1, 3, 1, /* move 0 */ 10, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 20, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, dx / (2.0- 0.4 * ((double) (i % 4))), 0.0, 0.0, 0.4, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 20, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 3070) { for (i = 0; i < 8; i++) { if (i < 4) { x = -31.0; dx = 8.0; } else { x = ((double) WINDOW_WIDTH) + 31.0; dx = -8.0; } if (tenm_table_add(normal_enemy_new(x, 150.0 + 50.0 * ((double) (i % 4)), NORMAL_STING, 0, COLOR_PURPLE, 0, -1, -1, 3, 1, /* move 0 */ 10, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 20, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, dx / (2.0- 0.4 * ((double) (i % 4))), 0.0, 0.0, 0.4, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 20, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 3160) { for (i = 0; i < 12; i++) { if (i < 6) { x = -31.0; dx = 8.0; } else { x = ((double) WINDOW_WIDTH) + 31.0; dx = -8.0; } if (tenm_table_add(normal_enemy_new(x, 50.0 + 50.0 * ((double) (i % 6)), NORMAL_STING, 0, COLOR_BLUE, 0, -1, -1, 3, 1, /* move 0 */ 10, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 20, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, dx / (2.0-0.3 * ((double) (i % 6))), 0.0, 0.0, 0.4, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 20, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_1: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 3280) { if (tenm_table_add(stage_1_more_5_new()) < 0) { fprintf(stderr, "scheduler_1: cannot create stage_1_more_5 " "(t = %d)\n", t); return SCHEDULER_ERROR; } else return SCHEDULER_SUCCESS; } /* the boss is created by more 5 */ return SCHEDULER_SUCCESS; } static tenm_object * stage_1_more_1_new(void) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "stage_1_more_1_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; new = tenm_object_new("stage 1 more 1", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_1_more_1_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_1_more_1_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_1_more_1_act(tenm_object *my, const tenm_object *player) { int i; int color; double x; double dx; /* sanity check */ if (my == NULL) return 0; /* max about 130 frames each */ if (my->count[2] <= 1) { if ((my->count[1] <= 48) && (my->count[1] % 12 == 0)) { if (my->count[2] == 0) { dx = -5.0; if (my->count[1] == 48) { x = 60.0; color = COLOR_PURPLE; } else { x = 120.0; color = COLOR_BLUE; } } else { dx = 5.0; if (my->count[1] == 48) { x = ((double) WINDOW_WIDTH) - 60.0; color = COLOR_PURPLE; } else { x = ((double) WINDOW_WIDTH) - 120.0; color = COLOR_RED; } } if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, my->table_index, 3, 3, 1, /* move 0 */ 60 - my->count[1], 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 40, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) fprintf(stderr, "stage_1_more_1_act: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } if (my->count[1] > 48) { if (my->count[3] >= 5) { my->count[1] = 0; (my->count[2])++; my->count[3] = 0; } } else (my->count[1])++; } /* max about 268 frame */ else if (my->count[2] == 2) { if ((my->count[1] >= 20) && (my->count[1] <= 20 + 36) && ((my->count[1] - 20) % 12 == 0)) { for (i = 0; i < 6; i++) { if (my->count[1] <= 20 + 12) { if (i == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; } else { if (i == 5) color = COLOR_PURPLE; else color = COLOR_RED; } if (i < 3) dx = -5.0; else dx = 5.0; if (tenm_table_add(normal_enemy_new(90.0 + ((double) (i * 60)), -24.0, NORMAL_BALL_LARGE, 0, color, 0, my->table_index, 3, 3, 1, /* move 0 */ 68 - my->count[1], 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 150, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) fprintf(stderr, "stage_1_more_1_act: cannot create normal_enemy " "(%d, %d) (%d)\n", my->count[2], my->count[1], i); } } if (my->count[1] > 20 + 36) { if (my->count[3] >= 24) { my->count[1] = 0; my->count[2] = 3; my->count[3] = 0; } } else (my->count[1])++; } /* the rest */ else if (my->count[2] == 3) { if ((my->count[1] >= 20) && ((my->count[1] - 20) % 8 == 0) && (my->count[0] + 64 - ((my->count[1] - 20) % 64) < 525)) { if ((my->count[1] - 20) % 16 == 0) { x = 0.0 - 14.0; dx = 4.949; if ((my->count[1] - 20) % 64 == 48) color = COLOR_PURPLE; else color = COLOR_BLUE; } else { x = ((double) WINDOW_WIDTH) + 14.0; dx = -4.949; if ((my->count[1] - 20) % 64 == 56) color = COLOR_PURPLE; else color = COLOR_RED; } if (tenm_table_add(normal_enemy_new(x, 20.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, dx, 4.949, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) fprintf(stderr, "stage_1_more_1_act: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } (my->count[1])++; } else fprintf(stderr, "stage_1_more_1_act: strange mode (%d)\n", my->count[2]); (my->count[0])++; /* wait enough time to collect all signals */ if (my->count[0] >= 600) return 1; return 0; } static tenm_object * stage_1_more_2_new(void) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "stage_1_more_2_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; new = tenm_object_new("stage 1 more 2", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_1_more_2_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_1_more_2_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_1_more_2_act(tenm_object *my, const tenm_object *player) { int i; int color; double x; double ddx; /* sanity check */ if (my == NULL) return 0; /* max about 230 frame */ if (my->count[2] == 0) { if ((my->count[1] <= 20) && (my->count[1] % 10 == 0)) { for (i = 0; i < 2; i++) { if (my->count[1] == 10) color = COLOR_PURPLE; else if (i == 0) color = COLOR_RED; else color = COLOR_BLUE; if (i == 0) x = (double) (my->count[1] * 6 + 50); else x = (double) (WINDOW_WIDTH - (my->count[1] * 6 + 50)); if (tenm_table_add(normal_enemy_new(x, 0.0 - 23.0, NORMAL_STING, 0, color, 0, my->table_index, 3, 3, 2, /* move 0 */ 40 - my->count[1], 0.0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 150, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, -8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 180, 10, my->count[1] - 50, 0, 1, /* shoot 1 */ 1000, 1000, 0, 0, 1)) < 0) fprintf(stderr, "stage_1_more_2_act: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } } if (my->count[1] > 20) { if (my->count[3] >= 6) { my->count[1] = 0; my->count[2] = 1; my->count[3] = 0; } } else (my->count[1])++; } /* the rest */ else if (my->count[2] == 1) { if ((my->count[0] <= 200) && (my->count[1] % 10 == 0)) { if (my->count[1] % 20 == 10) { x = 35.0; ddx = 0.25; } else { x = ((double) WINDOW_WIDTH) - 35.0; ddx = -0.25; } if (tenm_table_add(normal_enemy_new(x, 0.0 - 23.0, NORMAL_STING, 0, COLOR_PURPLE, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, 8.0, ddx, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 10, -15, 0, 1)) < 0) fprintf(stderr, "stage_1_more_2_act: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } (my->count[1])++; } else fprintf(stderr, "stage_1_more_2_act: strange mode (%d)\n", my->count[2]); (my->count[0])++; if (my->count[0] >= 240) return 1; return 0; } static tenm_object * stage_1_more_3_new(int n) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "stage_1_more_3_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] number of additional enemy * [1] timer * [2] killed * [3] left/right */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = n; new = tenm_object_new("stage 1 more 3", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_1_more_3_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_1_more_3_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } /* max about 390 frame */ static int stage_1_more_3_act(tenm_object *my, const tenm_object *player) { int color; double x; double clockwise; /* sanity check */ if (my == NULL) return 0; if (my->count[1] == 45) my->count[0] = my->count[2]; if ((my->count[1] <= 90) && (my->count[1] % 10 == 0)) { if (my->count[3] == 0) { color = COLOR_BLUE; x = 80.0; clockwise = -1.0; } else { color = COLOR_RED; x = ((double) (WINDOW_WIDTH)) - 80.0; clockwise = 1.0; } if (tenm_table_add(normal_enemy_new(x, 0.0 - 19.0, NORMAL_BALL_MEDIUM, 0, color, 0, my->table_index, 2, 3, 1, /* move 0 */ 73, 0.0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 104, 0.0, 0.0, 0.0, 0.0, 240.0, 420.0 - 19.0, 0.0, 0.15 * clockwise, 2, /* move 2 */ 1000, 0.0, -6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 70, 0, 0, 0)) < 0) fprintf(stderr, "stage_1_more_3_act: cannot create normal_enemy " "(%d)\n", my->count[1]); } else if ((my->count[0] > 0) && (my->count[1] % 10 == 0)) { if (my->count[3] == 0) { x = ((double) (WINDOW_WIDTH)) - 80.0; clockwise = 1.0; } else { x = 80.0; clockwise = -1.0; } if (tenm_table_add(normal_enemy_new(x, 0.0 - 19.0, NORMAL_BALL_MEDIUM, 0, COLOR_PURPLE, 0, my->table_index, 2, 3, 1, /* move 0 */ 73, 0.0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 104, 0.0, 0.0, 0.0, 0.0, 240.0, 420.0 - 19.0, 0.0, 0.15 * clockwise, 2, /* move 2 */ 1000, 0.0, -6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 35, 0, 0, 0)) < 0) fprintf(stderr, "stage_1_more_3_act: cannot create normal_enemy " "(%d)\n", my->count[1]); (my->count[0])--; } (my->count[1])++; return 0; } static tenm_object * stage_1_more_4_new(int n) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 6); if (count == NULL) { fprintf(stderr, "stage_1_more_4_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed * [4] left/right */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; count[4] = n; count[5] = 400; new = tenm_object_new("stage 1 more 4", 0, 0, 0, 0.0, 0.0, 6, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_1_more_4_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_1_more_4_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } /* max about 480 frame */ static int stage_1_more_4_act(tenm_object *my, const tenm_object *player) { int i; int color; double x; double speed_theta; double center_x; /* sanity check */ if (my == NULL) return 0; if ((my->count[1] == 6) || (my->count[1] == 18)) { for (i = 0; i < 2; i++) { if (i == 0) color = COLOR_RED; else color = COLOR_BLUE; speed_theta = 0.33; if (my->count[4] != 0) speed_theta *= -1.0; if (my->count[4] == 0) center_x = 90.0; else center_x = ((double) WINDOW_WIDTH) - 90.0; if (i == 0) x = center_x - 51.9615; else x = center_x + 51.9615; if (tenm_table_add(normal_enemy_new(x, 0.0 - 24.0, NORMAL_BALL_LARGE, 0, color, 0, my->table_index, 3, 3, 1, /* move 0 */ 40 - my->count[1], 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ my->count[5], 0.0, 0.0, 0.0, 0.0, center_x, 140.0 - 24.0, 0.0, speed_theta, 2, /* move 2 */ 1000, 0.0, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 60, my->count[1], 0, 0)) < 0) fprintf(stderr, "stage_1_more_4_act: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } } else if ((my->count[1] >= 0) && (my->count[1] <= 24) && (my->count[1] % 12 == 0)) { if (my->count[1] == 0) color = COLOR_BLUE; else if (my->count[1] == 12) color = COLOR_PURPLE; else color = COLOR_RED; if (my->count[1] == 12) { speed_theta = 0; } else { speed_theta = 0.33; if (my->count[4] != 0) speed_theta *= -1.0; } if (my->count[4] == 0) center_x = 90.0; else center_x = ((double) WINDOW_WIDTH) - 90.0; x = center_x; if (tenm_table_add(normal_enemy_new(x, 0.0 - 24.0, NORMAL_BALL_LARGE, 0, color, 0, my->table_index, 3, 3, 1, /* move 0 */ 40 - my->count[1], 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ my->count[5], 0.0, 0.0, 0.0, 0.0, center_x, 140.0 - 24.0, 0.0, speed_theta, 2, /* move 2 */ 1000, 0.0, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 60, my->count[1], 0, 0)) < 0) fprintf(stderr, "stage_1_more_4_act: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } if (my->count[1] > 24) { if ((my->count[2] == 0) && (my->count[3] >= 7) && (400 - 30 - my->count[0] >= 150) && (my->count[0] + 40 <= 500 - 5)) { my->count[1] = -30; my->count[2] = 1; my->count[3] = 0; my->count[5] = 400 - 30 - my->count[0]; } } else (my->count[1])++; (my->count[0])++; if (my->count[0] >= 500) return 1; return 0; } /* you will _miss_ points if you destroy the enemies too fast */ static tenm_object * stage_1_more_5_new(void) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "stage_1_more_5_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; new = tenm_object_new("stage 1 more 5", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_1_more_5_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_1_more_5_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_1_more_5_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; /* max about 560 frame */ if (my->count[2] == 0) { if (my->count[1] == 0) { if (tenm_table_add(normal_enemy_new(100.0, -47.0, NORMAL_PLENTY, 0, COLOR_BLUE, 0, my->table_index, 3, 3, 1, /* move 0 */ 150, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 120, 2.1213, -2.1213, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 30, 0, 0, 0)) < 0) { fprintf(stderr, "stage_1_more_5_act: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } } else if (my->count[1] == 120) { if (tenm_table_add(normal_enemy_new((double) (WINDOW_WIDTH/ 2), -23.0, NORMAL_STING, 0, COLOR_PURPLE, 0, my->table_index, 3, 3, 1, /* move 0 */ 50, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 100, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, 3.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 35, 0, 0, 0)) < 0) { fprintf(stderr, "stage_1_more_5_act: cannot create normal_enemy " "(sting) (%d, %d)\n", my->count[2], my->count[1]); } if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) - 100.0, -47.0, NORMAL_PLENTY, 0, COLOR_RED, 0, my->table_index, 3, 3, 1, /* move 0 */ 150, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 120, -2.1213, -2.1213, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 30, 0, 0, 0)) < 0) { fprintf(stderr, "stage_1_more_5_act: cannot create normal_enemy " "(plenty) (%d, %d)\n", my->count[2], my->count[1]); } } if (my->count[1] > 120) { if (my->count[3] >= 3) { my->count[1] = 0; my->count[2] = 1; my->count[3] = 0; } } else (my->count[1])++; } else if (my->count[2] == 1) { if (my->count[1] == 50) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 270.0, -5.0, 0.0, 1000, "boss: Midnight", 14)) < 0) { fprintf(stderr, "stage_1_more_5_act: cannot create message " "(%d, %d)\n", my->count[2], my->count[1]); } } else if (my->count[1] == 200) { if (tenm_table_add(midnight_new()) < 0) { fprintf(stderr, "stage_1_more_5_act: cannot create midnight " "(%d, %d)\n", my->count[2], my->count[1]); } } if (my->count[1] <= 200) (my->count[1])++; } else fprintf(stderr, "stage_1_more_5_act: strange mode (%d)\n", my->count[2]); (my->count[0])++; if (my->count[0] >= 1200) return 1; return 0; } tenmado-0.10/happy-L/stage-1.h0000644000175000017500000000027210276702754016624 0ustar00ooharaoohara00000000000000/* $Id: stage-1.h,v 1.1 2002/06/01 02:29:58 oohara Exp $ */ #ifndef __TENMADO_STAGE_1_H__ #define __TENMADO_STAGE_1_H__ int scheduler_1(int t); #endif /* not __TENMADO_STAGE_1_H__ */ tenmado-0.10/happy-L/stage-2.c0000644000175000017500000015641410276702754016632 0ustar00ooharaoohara00000000000000/* $Id: stage-2.c,v 1.71 2003/01/03 22:37:14 oohara Exp $ */ #include /* malloc */ #include #include "tenm_table.h" #include "const.h" #include "message.h" #include "normal-enemy.h" #include "tenm_object.h" #include "wall.h" #include "intuition.h" #include "overrun.h" #include "stage-2.h" #define SCROLL_SPEED_SLOW 3.0 #define SCROLL_SPEED_FAST 7.5 static tenm_object *stage_2_more_1_new(void); static int stage_2_more_1_act(tenm_object *my, const tenm_object *player); int scheduler_2(int t) { int i; int status = SCHEDULER_SUCCESS; int color; double x; double y; double dx; int t_start; double speed_theta; double center_x; /* sanity check */ if (t < 0) { fprintf(stderr, "scheduler_2: strange t (%d)\n", t); return SCHEDULER_ERROR; } if (t == 30) { if (tenm_table_add(message_new(210.0, 240.0, 0.0, 0.0, 100, "stage 2", 7)) < 0) { fprintf(stderr, "scheduler_2: cannot create message \"stage 2\"" "(t = %d)\n", t); status = SCHEDULER_ERROR; } if (tenm_table_add(message_new(180.0, 270.0, 0.0, 0.0, 100, "if only I had L", 15)) < 0) { fprintf(stderr, "scheduler_2: cannot create message (stage 2 title) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if ((t >= 180) && (t <= 1820) && (t % 40 == 20)) { for (i = 0; i < 2; i++) { if (i == 0) x = 0.0; else x = ((double) WINDOW_WIDTH); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_SLOW)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if (t == 200) { for (i = 1; i <= 6; i++) { if (i == 3) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(60.0 + (double) (60 * i), -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 6, 1, /* move 0 */ 35, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12 * i, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } if (tenm_table_add(normal_enemy_new(60.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_BLUE, 0, -1, -1, 5, 1, /* move 0 */ 35, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (0) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 220) { for (i = 0; i <= 5; i++) { if (i == 3) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(60.0 + (double) (60 * i), -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 6, 1, /* move 0 */ 15, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12 * (6 - i), 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } if (tenm_table_add(normal_enemy_new(420.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_RED, 0, -1, -1, 5, 1, /* move 0 */ 15, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (6) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if ((t >= 340) && (t <= 440) && (t % 10 == 0)) { y = 31.0 + ((double) (t - 340)) * SCROLL_SPEED_SLOW; if (tenm_table_add(normal_enemy_new(-14.0, y, NORMAL_BALL_SMALL, 0, COLOR_BLUE, 0, -1, -1, 1, 1, /* move 0 */ 1000, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 520) { for (i = 0; i <= 5; i++) { if (i == 3) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(60.0 + (double) (60 * i), -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 6, 1, /* move 0 */ 35, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12 * (6 - i), 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } if (tenm_table_add(normal_enemy_new(420.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_RED, 0, -1, -1, 5, 1, /* move 0 */ 35, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (6) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 540) { for (i = 1; i <= 6; i++) { if (i == 3) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(60.0 + (double) (60 * i), -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 6, 1, /* move 0 */ 15, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12 * i, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } if (tenm_table_add(normal_enemy_new(60.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_BLUE, 0, -1, -1, 5, 1, /* move 0 */ 15, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (0) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if ((t >= 660) && (t <= 760) && (t % 10 == 0)) { x = ((double) WINDOW_WIDTH) + 14.0; y = 31.0 + ((double) (t - 660)) * SCROLL_SPEED_SLOW; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_SMALL, 0, COLOR_RED, 0, -1, -1, 1, 1, /* move 0 */ 1000, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 840) { for (i = 1; i <= 6; i++) { if (i == 3) color = COLOR_PURPLE; else if (i % 2 == 0) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(60.0 + (double) (60 * i), -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 6, 1, /* move 0 */ 35, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12 * i, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } if (tenm_table_add(normal_enemy_new(60.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_BLUE, 0, -1, -1, 5, 1, /* move 0 */ 35, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (0) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 860) { for (i = 0; i <= 5; i++) { if (i == 3) color = COLOR_PURPLE; else if (i % 2 == 0) color = COLOR_RED; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(60.0 + (double) (60 * i), -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 6, 1, /* move 0 */ 15, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12 * (6 - i), 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } if (tenm_table_add(normal_enemy_new(420.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_RED, 0, -1, -1, 5, 1, /* move 0 */ 15, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 12, 0.0, 5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 72, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 12, 0.0, -5.0 + SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 72, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (6) " "(t = %d)\n", t); /* this line breaks the show-paren-mode of emacs21 if it has * 18 or more non-white characters */ status = SCHEDULER_ERROR; } return status; } if ((t >= 1060) && (t <= 1160) && (t % 10 == 0)) { for (i = 0; i < 2; i++) { y = 31.0 + ((double) (t - 1060)) * SCROLL_SPEED_SLOW; if (i == 0) { x = -14.0; dx = 5.0; } else { x = ((double) WINDOW_WIDTH) + 14.0; dx = -5.0; } if (t % 30 == 10) { color = COLOR_BLUE; } else if (t % 30 == 20) { if (i == 0) color = COLOR_PURPLE; else color = COLOR_RED; } else { if (i == 0) color = COLOR_RED; else color = COLOR_PURPLE; } if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, dx, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } return status; } if ((t == 1300) || (t == 1580)) { for (i = 0; i < 4; i++) { x = 60.0 + (double) (90 * i); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_SLOW)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t == 1330) || (t == 1350) || (t == 1610) || (t == 1630)) { if (t <= 1350) t_start = 1330; else t_start = 1610; for (i = 0; i < 4; i++) { if (i == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(60.0 + (double) (90 * i), -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 5, 1, /* move 0 */ 35 - (t - t_start), 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 9, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 11, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 9, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 11, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 40, -10, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((((t >= 1360) && (t <= 1400)) || ((t >= 1640) && (t <= 1680))) && (t % 10 == 0)) { if ((t == 1400) || (t == 1680)) color = COLOR_PURPLE; else color = COLOR_RED; x = (330.0 + ((double) WINDOW_WIDTH)) / 2.0; if (tenm_table_add(normal_enemy_new(x, -23.0, NORMAL_STING, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 25, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if ((t == 1460) || (t == 1700)) { for (i = 0; i < 4; i++) { x = ((double) WINDOW_WIDTH) - 60.0 - (double) (90 * i); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_SLOW)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t == 1490) || (t == 1510) || (t == 1730) || (t == 1750)) { if (t <= 1510) t_start = 1490; else t_start = 1730; for (i = 0; i < 4; i++) { if (i == 0) color = COLOR_PURPLE; else color = COLOR_RED; x = ((double) WINDOW_WIDTH) - 60.0 - (double) (90 * i); if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 5, 1, /* move 0 */ 35 - (t - t_start), 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 9, -5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 11, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 9, 5.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 11, 0.0, SCROLL_SPEED_SLOW, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 40, -10, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((((t >= 1520) && (t <= 1560)) || ((t >= 1760) && (t <= 1800))) && (t % 10 == 0)) { if ((t == 1560) || (t == 1800)) color = COLOR_PURPLE; else color = COLOR_BLUE; x = (((double) WINDOW_WIDTH) - 330.0 + 0.0) / 2.0; if (tenm_table_add(normal_enemy_new(x, -23.0, NORMAL_STING, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 25, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 2000) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 240.0, -5.0, 0.0, 1000, "It's a guide to eternity,", 25)) < 0) { fprintf(stderr, "scheduler_2: cannot create message (stage 2 demo " "line 1) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 2030) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 270.0, -5.0, 0.0, 1000, "an escape from the chain of logic.", 34)) < 0) { fprintf(stderr, "scheduler_2: cannot create message (stage 2 demo " "line 2) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 2219) { if (tenm_table_add(stage_2_more_1_new()) < 0) { fprintf(stderr, "scheduler_2: cannot create stage_2_more_1 " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if ((t >= 2304) && (t <= 4320) && (t % 16 == 0)) { for (i = 0; i < 2; i++) { if (i == 0) x = 0.0; else x = ((double) WINDOW_WIDTH); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_FAST)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t >= 2400) && (t <= 2544) && (t % 24 == 0)) { x = ((double) WINDOW_WIDTH) - 188.0; if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_FAST)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 2400) && (t <= 2538) && (t % 6 == 0)) { if (t == 2538) color = COLOR_PURPLE; else color = COLOR_BLUE; if (t % 24 == 0) x = ((double) WINDOW_WIDTH) - 141.0; else if ((t % 24 == 6) || (t % 24 == 18)) x = ((double) WINDOW_WIDTH) - 94.0; else x = ((double) WINDOW_WIDTH) - 47.0; if (tenm_table_add(normal_enemy_new(x, -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 2640) && (t <= 2784) && (t % 24 == 0)) { x = 188.0; if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_FAST)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 2640) && (t <= 2778) && (t % 6 == 0)) { if (t == 2778) color = COLOR_PURPLE; else color = COLOR_RED; if (t % 24 == 0) x = 141.0; else if ((t % 24 == 6) || (t % 24 == 18)) x = 94.0; else x = 47.0; if (tenm_table_add(normal_enemy_new(x, -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 2880) && (t <= 3024) && (t % 24 == 0)) { x = ((double) WINDOW_WIDTH) - 188.0; if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_FAST)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 2880) && (t <= 3024) && (t % 12 == 0)) { if (t == 2880) color = COLOR_PURPLE; else if (t == 2892) color = COLOR_RED; else color = COLOR_BLUE; for (i = 0; i < 2; i++) { if (i == 0) x = ((double) WINDOW_WIDTH) - 141.0; else x = ((double) WINDOW_WIDTH) - 47.0; if (tenm_table_add(normal_enemy_new(x, -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } } if ((t >= 3120) && (t <= 3264) && (t % 24 == 0)) { x = 188.0; if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_FAST)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 3120) && (t <= 3264) && (t % 12 == 0)) { if (t == 3120) color = COLOR_PURPLE; else if (t == 3132) color = COLOR_BLUE; else color = COLOR_RED; for (i = 0; i < 2; i++) { if (i == 0) x = 141.0; else x = 47.0; if (tenm_table_add(normal_enemy_new(x, -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } } if ((t >= 3360) && (t <= 3392) && (t % 8 == 0)) { for (i = 0; i < 2; i++) { if (t == 3392) color = COLOR_PURPLE; else if (i == 0) color = COLOR_BLUE; else color = COLOR_RED; if (i == 0) x = 87.0; else x = ((double) WINDOW_WIDTH) - 87.0; if (tenm_table_add(normal_enemy_new(x, -14.0, NORMAL_STING, 0, color, 0, -1, -1, 3, 1, /* move 0 */ 40 - (t - 3360), 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 50, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 30, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } } if ((((t >= 3552) && (t <= 3648)) || ((t >= 3792) && (t <= 3888))) && (t % 8 == 0)) { if (t <= 3648) x = 240.0; else x = ((double) WINDOW_WIDTH) - 240.0; if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_FAST)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t == 3552) || (t == 3648) || (t == 3792) || (t == 3888)) { for (i = 0; i < 2; i++) { if (t <= 3648) { if (i == 0) x = 90.0; else x = 150.0; } else { if (i == 0) x = ((double) WINDOW_WIDTH) - 90.0; else x = ((double) WINDOW_WIDTH) - 150.0; } if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_FAST)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall (%d)" "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t == 3561) || (t == 3577) || (t == 3590) || (t == 3606) || (t == 3619) || (t == 3635) || (t == 3801) || (t == 3817) || (t == 3830) || (t == 3846) || (t == 3859) || (t == 3875)) { if (t <= 3635) { color = COLOR_RED; x = 120.0; center_x = 120.0; } else { color = COLOR_BLUE; x = ((double) WINDOW_WIDTH) - 120.0; center_x = ((double) WINDOW_WIDTH) - 120.0; } if (t <= 3577) t_start = 3561; else if (t <= 3610) t_start = 3590; else if (t <= 3635) t_start = 3619; else if (t <= 3817) t_start = 3801; else if (t <= 3846) t_start = 3830; else t_start = 3859; if ((t == 3590) || (t == 3606) || (t == 3830) || (t == 3846)) speed_theta = -0.5; else speed_theta = 0.5; if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 2, 1, /* move 0 */ 24 - (t - t_start), 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, center_x, 96.0, 0.0, speed_theta, 1, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t == 3569) || (t == 3598) || (t == 3627) || (t == 3809) || (t == 3838) || (t == 3867)) { color = COLOR_PURPLE; if (t <= 3627) x = 120.0; else x = ((double) WINDOW_WIDTH) - 120.0; if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t == 3565) || (t == 3573) || (t == 3594) || (t == 3602) || (t == 3623) || (t == 3631) || (t == 3805) || (t == 3813) || (t == 3834) || (t == 3842) || (t == 3863) || (t == 3871)) { color = COLOR_RED; if (t <= 3577) t_start = 3561; else if (t <= 3610) t_start = 3590; else if (t <= 3631) t_start = 3619; else if (t <= 3813) t_start = 3801; else if (t <= 3842) t_start = 3830; else t_start = 3859; if ((t == 3594) || (t == 3602) || (t == 3834) || (t == 3842)) speed_theta = -0.5; else speed_theta = 0.5; for (i = 0; i < 2; i++) { if (t <= 3631) { color = COLOR_RED; center_x = 120.0; if (i == 0) x = 120.0 - 51.9615; else x = 120.0 + 51.9615; } else { color = COLOR_BLUE; center_x = ((double) WINDOW_WIDTH) - 120.0; if (i == 0) x = ((double) WINDOW_WIDTH) - (120.0 - 51.9615); else x = ((double) WINDOW_WIDTH) - (120.0 + 51.9615); } if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 2, 1, /* move 0 */ 24 - (t - t_start), 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, center_x, 96.0, 0.0, speed_theta, 1, /* shoot 0 */ 1000, 50, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d)" "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t == 4048) || (t == 4112) || (t == 4176) || (t == 4240) || (t == 4304)) { for (i = 1; i <= 3; i++) { if ((t == 4048) || (t == 4176) || (t == 4304)) x = ((double) (i * 85)); else x = ((double) (WINDOW_WIDTH - i * 85)); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED_FAST)) < 0) { fprintf(stderr, "scheduler_2: cannot create wall (%d)" "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t == 4060) || (t == 4068) || (t == 4076) || (t == 4124) || (t == 4132) || (t == 4140)) { if ((t == 4060) || (t == 4124)) i = 0; else if ((t == 4068) || (t == 4132)) i = 1; else i = 2; for (; i < 3; i++) { if (t <= 4076) { color = COLOR_RED; x = ((double) (180 - i * 60)); } else { color = COLOR_BLUE; x = ((double) (WINDOW_WIDTH - (180 - i * 60))); } if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 25, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if (t == 4092) { color = COLOR_PURPLE; x = ((double) WINDOW_WIDTH) / 2.0; if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 25, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 4264) { if (tenm_table_add(normal_enemy_new(-24.0, -24.0, NORMAL_HORIZON, 0, COLOR_PURPLE, 0, -1, -1, 1, 2, /* move 0 */ 1000, 3.0, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 100, 1, -30, 0, 1, /* shoot 1 */ 1000, 1, -1000, 0, 1)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (0)" "(t = %d)\n", t); status = SCHEDULER_ERROR; } if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) + 24.0, -24.0, NORMAL_HORIZON, 0, COLOR_PURPLE, 0, -1, -1, 1, 2, /* move 0 */ 1000, -2.5, SCROLL_SPEED_FAST, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 10, 1, -1000, 0, 1, /* shoot 1 */ 1000, 1, -50, 0, 1)) < 0) { fprintf(stderr, "scheduler_2: cannot create normal_enemy (1)" "(t = %d)\n", t); status = SCHEDULER_ERROR; } } return status; } static tenm_object * stage_2_more_1_new(void) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "stage_2_more_1_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; new = tenm_object_new("stage 2 more 1", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_2_more_1_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_2_more_1_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_2_more_1_act(tenm_object *my, const tenm_object *player) { int i; double x; double dx; double dy; double ddx; /* sanity check */ if (my == NULL) return 0; (my->count[1])++; /* max about 2313 frame */ if (my->count[2] == 0) { if (my->count[1] == 1) { if (tenm_table_add(intuition_new(my->table_index)) < 0) fprintf(stderr, "stage_2_more_1_act: cannot create intuition " "(%d, %d)\n", my->count[2], my->count[1]); } else if (my->count[3] == 1) { if (my->count[1] <= 2250) { my->count[1]= 0; my->count[2] = 1; } else { my->count[1]= 70; my->count[2] = 2; } } } /* max about 262 frame */ else if (my->count[2] == 1) { if ((my->count[1] <= 126) && (my->count[1] % 5 == 1)) { dy = 5.0 + ((double) (my->count[1] % 20)) / 10.0; for (i = 0; i < 2; i++) { if (i == 0) { x = 80.0; dx = -4.0; ddx = 0.14; } else { x = ((double) WINDOW_WIDTH) - 80.0; dx = 4.0; ddx = -0.14; } if (tenm_table_add(normal_enemy_new(x, -19.0, NORMAL_BALL_MEDIUM, ENEMY_TYPE_WEAK, COLOR_PURPLE, 0, -1, -1, 1, 1, /* move 0 */ 1000, dx, dy, ddx, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 25, 0, 50, 0)) < 0) fprintf(stderr, "stage_2_more_1_act: cannot create normal_enemy " "(%d) " "(%d, %d)\n", i, my->count[2], my->count[1]); } } if ((my->count[0] >= 2100) && (my->count[1] >= 126)) { my->count[1] = 0; my->count[2] = 2; } } else if (my->count[2] == 2) { if (my->count[1] == 150) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 270.0, -5.0, 0.0, 1000, "boss: Overrun", 14)) < 0) { fprintf(stderr, "stage_1_more_5_act: cannot create message " "(%d, %d)\n", my->count[2], my->count[1]); } } else if (my->count[1] == 300) { if (tenm_table_add(overrun_new()) < 0) { fprintf(stderr, "stage_1_more_5_act: cannot create overrun " "(%d, %d)\n", my->count[2], my->count[1]); } } } else { fprintf(stderr, "stage_2_more_1_act: strange (%d) ", my->count[2]); } (my->count[0])++; if (my->count[0] >= 3000) return 1; return 0; } tenmado-0.10/happy-L/stage-2.h0000644000175000017500000000027210276702754016625 0ustar00ooharaoohara00000000000000/* $Id: stage-2.h,v 1.2 2002/06/07 04:24:46 oohara Exp $ */ #ifndef __TENMADO_STAGE_2_H__ #define __TENMADO_STAGE_2_H__ int scheduler_2(int t); #endif /* not __TENMADO_STAGE_2_H__ */ tenmado-0.10/happy-L/stage-3.c0000644000175000017500000016271510276702754016634 0ustar00ooharaoohara00000000000000/* $Id: stage-3.c,v 1.169 2003/01/03 22:40:05 oohara Exp $ */ #include /* malloc */ #include #include "tenm_table.h" #include "const.h" #include "message.h" #include "normal-enemy.h" #include "tenm_object.h" #include "tenm_math.h" #include "wall.h" #include "balloon.h" #include "disconnection.h" #include "stage-3.h" #define SCROLL_SPEED 3.0 static tenm_object *stage_3_more_1_new(void); static int stage_3_more_1_act(tenm_object *my, const tenm_object *player); static tenm_object *stage_3_more_2_new(int n); static int stage_3_more_2_act(tenm_object *my, const tenm_object *player); static tenm_object *stage_3_more_3_new(void); static int stage_3_more_3_act(tenm_object *my, const tenm_object *player); static tenm_object *stage_3_more_4_new(void); static int stage_3_more_4_act(tenm_object *my, const tenm_object *player); static tenm_object *stage_3_more_5_new(void); static int stage_3_more_5_act(tenm_object *my, const tenm_object *player); int scheduler_3(int t) { int status = SCHEDULER_SUCCESS; int i; int color; double x; double dx; double y; double dy; /* sanity check */ if (t < 0) { fprintf(stderr, "scheduler_3: strange t (%d)\n", t); return SCHEDULER_ERROR; } if (t == 30) { if (tenm_table_add(message_new(210.0, 240.0, 0.0, 0.0, 100, "stage 3", 7)) < 0) { fprintf(stderr, "scheduler_3: cannot create message \"stage 3\"" "(t = %d)\n", t); status = SCHEDULER_ERROR; } if (tenm_table_add(message_new(180.0, 270.0, 0.0, 0.0, 100, "L is binding me", 15)) < 0) { fprintf(stderr, "scheduler_3: cannot create message (stage 3 title) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if ((t == 180) || (t == 600)) { if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) / 2.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_PURPLE, 0, -1, -1, 3, 1, /* move 0 */ 55, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 100, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 1000, 970, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if ((t == 230) || (t == 263) || (t == 650) || (t == 683)) { for (i = 0; i < 4; i++) { if (i < 2) { x = -24.0; dx = 4.0; } else { x = ((double) WINDOW_WIDTH) + 24.0; dx = -4.0; } if (i % 2 == 0) { y = -24.0 + 5.0 * 55.0 - 3.0 * 66.0; dy = 3.0; } else { y = -24.0 + 5.0 * 55.0 + 3.0 * 66.0; dy = -3.0; } if ((t == 263) || (t == 683)) { dx *= 2.0; dy *= 2.0; } if ((i == 0) || (i == 3)) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, dx, dy, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 995, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%i) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t == 300) || (t == 649)) { if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) / 2.0 - 64.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_PURPLE, 0, -1, -1, 3, 1, /* move 0 */ 55, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 100, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 1000, 975, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if ((t == 340) || (t == 372) || (t == 381) || (t == 397) || (t == 690) || (t == 722) || (t == 731) || (t == 747)) { if ((t == 372) || (t == 397) || (t == 722) || (t == 747)) { x = -24.0; dx = 4.0; } else { x = ((double) WINDOW_WIDTH) + 24.0; dx = -4.0; } if ((t == 381) || (t == 397) || (t == 731) || (t == 747)) dx *= 2.0; for (i = 0; i < 2; i++) { if ((t == 340) || (t == 381) || (t == 690) || (t == 731)) { if (i % 2 == 0) { y = -24.0 + 5.0 * 55.0 - 3.0 * 82.0; dy = 3.0; } else { y = -24.0 + 5.0 * 55.0 + 3.0 * 82.0; dy = -3.0; } } else { if (i % 2 == 0) { y = -24.0 + 5.0 * 55.0 - 3.0 * 50.0; dy = 3.0; } else { y = -24.0 + 5.0 * 55.0 + 3.0 * 50.0; dy = -3.0; } } if ((t == 381) || (t == 397) || (t == 731) || (t == 747)) dy *= 2.0; if ((t == 340) || (t == 381) || (t == 690) || (t == 731)) { if (i == 0) color = COLOR_BLUE; else color = COLOR_RED; } else { if (i == 0) color = COLOR_RED; else color = COLOR_BLUE; } if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, dx, dy, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 995, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%i) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t == 450) || (t == 700)) { if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) / 2.0 + 64.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_PURPLE, 0, -1, -1, 3, 1, /* move 0 */ 55, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 100, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 1000, 975, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if ((t == 490) || (t == 522) || (t == 531) || (t == 549) || (t == 740) || (t == 772) || (t == 781) || (t == 797)) { if ((t == 490) || (t == 531) || (t == 740) || (t == 781)) { x = -24.0; dx = 4.0; } else { x = ((double) WINDOW_WIDTH) + 24.0; dx = -4.0; } if ((t == 531) || (t == 549) || (t == 781) || (t == 797)) dx *= 2.0; for (i = 0; i < 2; i++) { if ((t == 490) || (t == 531) || (t == 740) || (t == 781)) { if (i % 2 == 0) { y = -24.0 + 5.0 * 55.0 - 3.0 * 82.0; dy = 3.0; } else { y = -24.0 + 5.0 * 55.0 + 3.0 * 82.0; dy = -3.0; } } else { if (i % 2 == 0) { y = -24.0 + 5.0 * 55.0 - 3.0 * 50.0; dy = 3.0; } else { y = -24.0 + 5.0 * 55.0 + 3.0 * 50.0; dy = -3.0; } } if ((t == 531) || (t == 549) || (t == 781) || (t == 797)) dy *= 2.0; if ((t == 490) || (t == 531) || (t == 740) || (t == 781)) { if (i == 0) color = COLOR_RED; else color = COLOR_BLUE; } else { if (i == 0) color = COLOR_BLUE; else color = COLOR_RED; } if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, dx, dy, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 995, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%i) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t >= 854) && (t <= 930)) { if ((t >= 854) && (t <= 924) && (t % 7 == 0)) { if (t % 21 == 14) color = COLOR_BLUE; else if (t % 21 == 0) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) / 2.0 - 10.0, -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, 6.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 870) && (t <= 930) && (t % 6 == 0)) { if (t % 18 == 6) color = COLOR_BLUE; else if (t % 18 == 12) color = COLOR_RED; else color = COLOR_PURPLE; if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) / 2.0 + 10.0, -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, 7.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } return status; } if (t == 1050) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 240.0, -5.0, 0.0, 1000, "It's a good approximation of insanity,", 38)) < 0) { fprintf(stderr, "scheduler_3: cannot create message (stage 2 demo " "line 1) " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 1080) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 270.0, -5.0, 0.0, 1000, "a sufficient condition of convergence.", 38)) < 0) { fprintf(stderr, "scheduler_3: cannot create message (stage 2 demo " "line 1) " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 1260) { if (tenm_table_add(stage_3_more_1_new()) < 0) { fprintf(stderr, "scheduler_3: cannot create stage_3_more_1 " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 1700) { for (i = 0; i < 3; i++) { if (tenm_table_add(stage_3_more_2_new(i)) < 0) { fprintf(stderr, "scheduler_3: cannot create stage_3_more_2(%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 1740) { if (tenm_table_add(stage_3_more_3_new()) < 0) { fprintf(stderr, "scheduler_3: cannot create stage_3_more_3 " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 2100) { if (tenm_table_add(stage_3_more_4_new()) < 0) { fprintf(stderr, "scheduler_3: cannot create stage_3_more_4 " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 2460) { for (i = 0; i < 8; i++) { if (i != 1) { x = 30.0 + ((double) i * 60); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED)) < 0) { fprintf(stderr, "scheduler_3: cannot create wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } } if (t == 2495) { for (i = 0; i <= 8; i++) { if (i % 3 == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new((double) (60 * i), -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, -2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t >= 2518) && (t <= 2758) && (t % 30 == 28)) { y = -14.0 + ((double) (t - 2495)) * SCROLL_SPEED; if (((t - 2518) / 30) % 3 == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) + 14.0, y, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, -2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 2520) { for (i = 0; i < 8; i++) { if (i != 6) { x = 30.0 + ((double) i * 60); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED)) < 0) { fprintf(stderr, "scheduler_3: cannot create wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } } if (t == 2555) { for (i = 0; i <= 8; i++) { if (i % 3 == 2) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new((double) (60 * i), -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t >= 2578) && (t <= 2818) && (t % 30 == 28)) { y = -14.0 + ((double) (t - 2555)) * SCROLL_SPEED; if (((t - 2578) / 30) % 3 == 0) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(-14.0 , y, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 2580) { for (i = 0; i < 8; i++) { if (i != 1) { x = 30.0 + ((double) i * 60); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED)) < 0) { fprintf(stderr, "scheduler_3: cannot create wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } } if (t == 2615) { for (i = 0; i <= 8; i++) { if (i % 3 == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new((double) (60 * i), -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, -2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t >= 2638) && (t <= 2878) && (t % 30 == 28)) { y = -14.0 + ((double) (t - 2615)) * SCROLL_SPEED; if (((t - 2638) / 30) % 3 == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) + 14.0 , y, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, -2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 2635) { for (i = 1; i <= 8; i++) { if (i % 3 == 2) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new((double) (60 * i - 40), -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, -2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t >= 2638) && (t <= 2878) && (t % 30 == 28)) { y = -14.0 + ((double) (t - 2635)) * SCROLL_SPEED; if (((t - 2638) / 30) % 3 == 2) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) + 14.0 , y, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, -2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 2655) { for (i = 2; i <= 9; i++) { if (i % 3 == 1) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new((double) (60 * i - 80), -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, -2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t >= 2668) && (t <= 2908) && (t % 30 == 28)) { y = -14.0 + ((double) (t - 2655)) * SCROLL_SPEED; if (((t - 2668) / 30) % 3 == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) + 14.0 , y, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, -2.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 2680) { for (i = 0; i < 8; i++) { if (i != 6) { x = 30.0 + ((double) i * 60); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED)) < 0) { fprintf(stderr, "scheduler_3: cannot create wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } } if (t == 2750) { if (tenm_table_add(balloon_new(390.0, 60.0, SCROLL_SPEED, 2.0, 45, 0, 20)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 2815) { if (tenm_table_add(balloon_new(90.0, 60.0, SCROLL_SPEED, 2.0, 45, 0, 20)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t == 2930 + 15 - 47) || (t == 2930 + 15 + 48)) { if (t == 2930 + 15 - 47) y = 2.0 - 14.0; else y = 1.0 - 14.0; if (tenm_table_add(normal_enemy_new(240.0, y, NORMAL_BALL_LARGE, ENEMY_TYPE_WEAK, COLOR_PURPLE, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 80, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if ((t == 2930 + 15 - 41) || (t == 2930 + 15 + 42)) { if (t == 2930 + 15 - 41) y = 0.8416 - 14.0; else y = 2.1584 - 14.0; for (i = 0; i < 2; i++) { if (i == 0) { color = COLOR_BLUE; x = 240.0 - 71.5; } else { color = COLOR_RED; x = 240.0 + 71.5; } if (tenm_table_add(normal_enemy_new(x, 0.8416 -14.0, NORMAL_BALL_LARGE, ENEMY_TYPE_WEAK, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 80, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t == 2930 + 15 - 29) || (t == 2930 + 15 + 30)) { if (t == 2930 + 15 - 29) y = 2.0 - 14.0; else y = 1.0 - 14.0; if (tenm_table_add(normal_enemy_new(240.0, y, NORMAL_BALL_LARGE, ENEMY_TYPE_WEAK, COLOR_PURPLE, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 80, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if ((t == 2930 + 15 - 23) || (t == 2930 + 15 + 24)) { if (t == 2930 + 15 - 23) y = 0.8416 - 14.0; else y = 2.1584 - 14.0; for (i = 0; i < 2; i++) { if (i == 0) { color = COLOR_BLUE; x = 240.0 - 123.8416; } else { color = COLOR_RED; x = 240.0 + 123.8416; } if (tenm_table_add(normal_enemy_new(x, 0.8416 -14.0, NORMAL_BALL_LARGE, ENEMY_TYPE_WEAK, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 80, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t == 2930 + 15 - 14) || (t == 2930 + 15 + 15)) { if (t == 2930 + 15 - 14) y = 2.5 - 14.0; else y = 0.5 - 14.0; for (i = 0; i < 2; i++) { if (i == 0) { color = COLOR_RED; x = 240.0 - 77.0762; } else { color = COLOR_BLUE; x = 240.0 + 77.0762; } if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_LARGE, ENEMY_TYPE_WEAK, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 80, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 2930 + 15) { for (i = 0; i < 2; i++) { if (i == 0) { color = COLOR_BLUE; x = 240.0 - 143.0; } else { color = COLOR_RED; x = 240.0 + 143.0; } if (tenm_table_add(normal_enemy_new(x, 0.0 - 14.0, NORMAL_BALL_LARGE, ENEMY_TYPE_WEAK, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 80, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 2930) { if (tenm_table_add(balloon_new(240.0, 60.0, SCROLL_SPEED, -1.0, 120, 935, 1000)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 3100) { if (tenm_table_add(balloon_new(90.0, 60.0, SCROLL_SPEED, -2.0, 25, 1015, 1000)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 3160) && (t <= 3360) && (t % 20 == 0)) { y = -59.0 + ((double) (t - 3100)) * SCROLL_SPEED; if (t % 60 == 20) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(-24.0, y + 81.2650, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, 90.0, y, 0.0, -0.15, 0, /* shoot 0 */ 1000, 60, t % 60, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 3140) { if (tenm_table_add(balloon_new(((double) WINDOW_WIDTH) - 90.0, 110.0, SCROLL_SPEED, 0.0, 1, 10, 1000)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 3220) && (t <= 3420) && (t % 20 == 0)) { x = ((double) WINDOW_WIDTH) + 24.0; y = -109.0 + ((double) (t - 3140)) * SCROLL_SPEED; if (t % 60 == 20) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(x, y + 81.2650, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, ((double) WINDOW_WIDTH) - 90.0, y, 0.0, 0.15, 0, /* shoot 0 */ 1000, 60, t % 60, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 3300) { if (tenm_table_add(balloon_new(90.0, 110.0, SCROLL_SPEED, 0.0, 1, 10, 1000)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 3380) && (t <= 3580) && (t % 20 == 0)) { y = -109.0 + ((double) (t - 3300)) * SCROLL_SPEED; if (t % 60 == 0) color = COLOR_PURPLE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(-24.0, y - 81.2650, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, 90.0, y, 0.0, 0.15, 0, /* shoot 0 */ 1000, 60, t % 60, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 3360) { if (tenm_table_add(balloon_new(((double) WINDOW_WIDTH) - 90.0, 110.0, SCROLL_SPEED, 0.0, 1, 10, 1000)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 3440) && (t <= 3640) && (t % 20 == 0)) { x = ((double) WINDOW_WIDTH) + 24.0; y = -109.0 + ((double) (t - 3360)) * SCROLL_SPEED; if (t % 60 == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(x, y - 81.2650, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, SCROLL_SPEED, 0.0, 0.0, ((double) WINDOW_WIDTH) - 90.0, y, 0.0, -0.15, 0, /* shoot 0 */ 1000, 60, t % 60, 0, 0)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 3560) { if (tenm_table_add(balloon_new(60.0, 60.0, SCROLL_SPEED, 2.0, 30, 0, 20)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 3579) { if (tenm_table_add(balloon_new(60.0 + 360.0, 98.0, SCROLL_SPEED, 2.0, 30, 19, 20)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 3610) { if (tenm_table_add(balloon_new(60.0 + 151.0572, 60.0, SCROLL_SPEED, 2.0, 30, 0, 20)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 3672) { if (tenm_table_add(balloon_new(60.0 + 93.1743, 84.0, SCROLL_SPEED, 2.0, 30, 12, 20)) < 0) { fprintf(stderr, "scheduler_3: cannot create balloon " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 3740) { for (i = 0; i < 8; i++) { if (i != 2) { x = 30.0 + ((double) i * 60); if (tenm_table_add(wall_new(x, 60.0, 60.0, SCROLL_SPEED)) < 0) { fprintf(stderr, "scheduler_3: cannot create wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } return status; } if ((t >= 3912) && (t <= 4296) && (t % 24 == 0)) { for (i = 0; i < 2; i++) { if (i == 0) { x = -24.0; dx = 2.5; if (t <= 3960) color = COLOR_BLUE; else if (t == 3984) color = COLOR_PURPLE; else if (t <= 4056) color = COLOR_RED; else if (t == 4080) color = COLOR_PURPLE; else if (t % 72 == 0) color = COLOR_BLUE; else if (t % 72 == 24) color = COLOR_RED; else color = COLOR_PURPLE; } else { x = ((double) WINDOW_WIDTH) + 24.0; dx = -2.5; if (t <= 3960) color = COLOR_RED; else if (t == 3984) color = COLOR_PURPLE; else if (t <= 4056) color = COLOR_BLUE; else if (t == 4080) color = COLOR_PURPLE; else if (t % 72 == 0) color = COLOR_RED; else if (t % 72 == 24) color = COLOR_BLUE; else color = COLOR_PURPLE; } if (tenm_table_add(normal_enemy_new(x, 250.0, NORMAL_BALL_LARGE, ENEMY_TYPE_WEAK |ENEMY_TYPE_OBSTACLE, color, 0, -1, -1, 1, 3, /* move 0 */ 1000, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 24, 12, 0, 100, 1, /* shoot 1 */ 24, 12, 0, 50, 2, /* shoot 2 */ 1000, 12, 0, 0, 2)) < 0) { fprintf(stderr, "scheduler_3: cannot create normal_enemy (%i) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if (t == 4400) { if (tenm_table_add(stage_3_more_5_new()) < 0) { fprintf(stderr, "scheduler_3: cannot create stage_3_more_5 " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 4700) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 270.0, -5.0, 0.0, 1000, "boss: Disconnection", 19)) < 0) { fprintf(stderr, "scheduler_3: cannot create message " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 4860) { if (tenm_table_add(disconnection_new()) < 0) { fprintf(stderr, "scheduler_3: cannot create disconnection " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } return status; } static tenm_object * stage_3_more_1_new(void) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "stage_3_more_1_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; new = tenm_object_new("stage 3 more 1", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_3_more_1_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_3_more_1_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_3_more_1_act(tenm_object *my, const tenm_object *player) { int color; int theta; double x; double dx; double ddx; /* sanity check */ if (my == NULL) return 0; if (my->count[2] <= 3) { if ((my->count[1] >= 0) && (my->count[1] <= 45) && (my->count[1] % 9 == 0)) { if (my->count[1] == 45) color = COLOR_PURPLE; else if (my->count[2] % 2 == 0) color = COLOR_RED; else color = COLOR_BLUE; if (my->count[2] % 2 == 0) x = (double) ((70 - my->count[1]) * 2); else x = (double) (WINDOW_WIDTH - ((70 - my->count[1]) * 2)); if (my->count[2] == 0) theta = -60; else if (my->count[2] == 1) theta = -120; else if (my->count[2] == 2) theta = -30; else theta = -150; if (tenm_table_add(normal_enemy_new(x, -31.0, NORMAL_BURST, 0, color, 0, my->table_index, 3, 2, 1, /* move 0 */ 25, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 7, 8.0 * tenm_cos(theta), 8.0 * tenm_sin(theta), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 29, 22, 0, 0)) < 0) fprintf(stderr, "stage_3_more_1_act: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } if (my->count[1] > 45) { if (my->count[3] >= 6) { if (((my->count[2] <= 3) && (my->count[0] + 45 + 186 <= 430)) || (my->count[0] + 89 <= 430)) { my->count[1] = 0; (my->count[2])++; my->count[3] = 0; } } } else { (my->count[1])++; } } else if (my->count[2] == 4) { if ((my->count[0] + 89 <= 430) && (my->count[1] % 5 == 0)) { if (my->count[1] % 10 == 0) { dx = 6.0; ddx = -0.4; } else { dx = -6.0; ddx = 0.4; } if (tenm_table_add(normal_enemy_new(((double) WINDOW_WIDTH) / 2.0, -31.0, NORMAL_BURST, 0, COLOR_PURPLE, 0, -1, -1, 2, 1, /* move 0 */ 30, dx, 8.0, ddx, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 30, -dx, 8.0, -ddx, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 33, (my->count[1] + 25) % 33, 0, 0)) < 0) fprintf(stderr, "stage_3_more_1_act: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } (my->count[1])++; } (my->count[0])++; if (my->count[0] >= 435) return 1; return 0; } static tenm_object * stage_3_more_2_new(int n) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "stage_3_more_2_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] left/center/right * [3] killed */ count[0] = 0; count[1] = 0; count[2] = n; count[3] = 0; new = tenm_object_new("stage 3 more 2", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_3_more_2_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_3_more_2_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_3_more_2_act(tenm_object *my, const tenm_object *player) { double x; /* sanity check */ if (my == NULL) return 0; if ((my->count[1] == 20) && (my->count[0] < 300)) { if (my->count[2] == 0) x = 120.0; else if (my->count[2] == 1) x = ((double) WINDOW_WIDTH) / 2.0; else x = ((double) WINDOW_WIDTH) - 120.0; if (tenm_table_add(normal_enemy_new(x, -23.0, NORMAL_STING, 0, COLOR_PURPLE, 0, my->table_index, 3, 3, 1, /* move 0 */ 10, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 300 - my->count[0], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, 0.0, -8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 15, 0, 50, 0)) < 0) fprintf(stderr, "stage_3_more_2_act: cannot create normal_enemy (%d) " "(%d)\n", my->count[2], my->count[1]); } if (my->count[1] > 20) { if (my->count[3] >= 1) { if (my->count[0] + 20 <= 300) { my->count[1] = 0; my->count[3] = 0; } } } else { (my->count[1])++; } (my->count[0])++; if (my->count[0] >= 350) return 1; return 0; } static tenm_object * stage_3_more_3_new(void) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "stage_3_more_3_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; new = tenm_object_new("stage 3 more 3", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_3_more_3_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_3_more_3_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_3_more_3_act(tenm_object *my, const tenm_object *player) { double x; double dx; double y; int color; int time_shoot; /* sanity check */ if (my == NULL) return 0; if ((my->count[1] <= 20) && (my->count[1] % 10 == 0)) { y = 120.0 + ((double) my->count[2]) * 50.0; time_shoot = 30 - my->count[2] * 4; if (time_shoot < 10) time_shoot = 10; if (my->count[2] % 2 == 0) { color = COLOR_BLUE; x = -31.0; dx = 8.0; } else { color = COLOR_RED; x = ((double) WINDOW_WIDTH) + 31.0; dx = -8.0; } if (tenm_table_add(normal_enemy_new(x, y, NORMAL_STING, 0, color, 0, my->table_index, 3, 1, 1, /* move 0 */ 1000, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, time_shoot, 0, 0, 0)) < 0) fprintf(stderr, "stage_3_more_3_act: cannot create normal_enemy (%d) " "(%d)\n", my->count[2], my->count[1]); } if (my->count[1] > 20) { if (my->count[3] >= 3) { if ((my->count[0] + 68 <= 310) && (my->count[2] < 5)) { my->count[1] = 0; (my->count[2])++; my->count[3] = 0; } } } else { (my->count[1])++; } (my->count[0])++; if (my->count[0] >= 330) return 1; return 0; } static tenm_object * stage_3_more_4_new(void) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 5); if (count == NULL) { fprintf(stderr, "stage_3_more_4_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed * [4] row */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; count[4] = 0; new = tenm_object_new("stage 3 more 4", 0, 0, 0, 0.0, 0.0, 5, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_3_more_4_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_3_more_4_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_3_more_4_act(tenm_object *my, const tenm_object *player) { int i; double x; int color; int time_shoot_initial; int t_move; /* sanity check */ if (my == NULL) return 0; /* max about 384 frame */ if (my->count[2] == 0) { if ((my->count[1] <= 40) && (my->count[1] % 10 == 0)) { for (i = 0; i < 7; i++) { x = ((double) (i + 1) * 50); time_shoot_initial = ((i + my->count[1] / 10) * 8) % 64 - (50 - my->count[1]); if (i == 3) color = COLOR_PURPLE; else if ((i == 0) || (i == 2) || (i == 5)) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(x, -19.0, NORMAL_BALL_MEDIUM, 0, color, 0, my->table_index, 3, 5, 1, /* move 0 */ 50 - my->count[1], 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 16, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 10, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 16, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 10, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 64, time_shoot_initial, 0, 0)) < 0) fprintf(stderr, "stage_3_more_4_act: cannot create normal_enemy " "(%d) " "(%d, %d)\n", i, my->count[2], my->count[1]); } } if (my->count[1] > 40) { if (my->count[3] >= 35) { my->count[1] = 0; (my->count[2])++; my->count[3] = 0; my->count[4] = (my->count[0] - (50 + 16 - 26)) / 26; } } else { (my->count[1])++; } } else if (my->count[2] == 1) { if ((my->count[4] <= 7) && (my->count[1] >= 20) && (my->count[1] <= 30) && (my->count[1] % 5 == 0)) { for (i = 0; i < 6; i++) { x = ((double) (i + 1) * 50); t_move = 20 + my->count[4] * 5 - (my->count[1] - 20); if (my->count[1] == 25) { if (i == 0) color = COLOR_PURPLE; else color = COLOR_RED; } else { if (i == 5) color = COLOR_PURPLE; else color = COLOR_BLUE; } if (tenm_table_add(normal_enemy_new(x, -19.0, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 5, 1, /* move 0 */ t_move, 0.0, 10.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 26, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 10, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 26, -5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 10, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) fprintf(stderr, "stage_3_more_4_act: cannot create normal_enemy " "(%d) " "(%d, %d)\n", i, my->count[2], my->count[1]); } } if (my->count[1] <= 40) (my->count[1])++; } (my->count[0])++; if (my->count[0] >= 420) return 1; return 0; } static tenm_object * stage_3_more_5_new(void) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 4); if (count == NULL) { fprintf(stderr, "stage_3_more_5_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] time since the last enemy appeared * [2] number of enemies appeared * [3] killed */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; new = tenm_object_new("stage 3 more 5", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_3_more_5_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_3_more_5_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_3_more_5_act(tenm_object *my, const tenm_object *player) { int theta; double x; /* sanity check */ if (my == NULL) return 0; (my->count[1])++; if ((my->count[0] <= 200) && (my->count[2] - my->count[3] <= 4)) { if (my->count[1] >= 5) { if (my->count[2] % 2 == 0) { x = 0.0; theta = (my->count[2] % 8) * 5 + 20; } else { x = (double) WINDOW_WIDTH; theta = 180 - ((my->count[2] % 8) * 5 + 20); } if (tenm_table_add(normal_enemy_new(x, -31.0, NORMAL_BURST, 0, COLOR_PURPLE, 0, my->table_index, 3, 1, 1, /* move 0 */ 1000, 8.0 * tenm_cos(theta), 8.0 * tenm_sin(theta), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 15, 0, 0, 0)) < 0) fprintf(stderr, "stage_3_more_5_act: cannot create normal_enemy (%d) " "(%d)\n", my->count[2], my->count[1]); my->count[1] = 0; (my->count[2])++; } } (my->count[0])++; if (my->count[0] >= 450) return 1; return 0; } tenmado-0.10/happy-L/stage-3.h0000644000175000017500000000027210276702754016626 0ustar00ooharaoohara00000000000000/* $Id: stage-3.h,v 1.2 2002/06/07 04:25:03 oohara Exp $ */ #ifndef __TENMADO_STAGE_3_H__ #define __TENMADO_STAGE_3_H__ int scheduler_3(int t); #endif /* not __TENMADO_STAGE_3_H__ */ tenmado-0.10/happy-L/stage-4.c0000644000175000017500000015132610276702754016631 0ustar00ooharaoohara00000000000000/* $Id: stage-4.c,v 1.113 2002/07/07 15:53:57 oohara Exp $ */ #include /* malloc */ #include #include "tenm_table.h" #include "const.h" #include "message.h" #include "normal-enemy.h" #include "tenm_object.h" #include "close-system.h" #include "fud.h" #include "stage-4.h" int scheduler_4(int t) { int i; int n; int status = SCHEDULER_SUCCESS; int t_start; int time_shoot; int time_shoot_initial; int color; double x; double y; double dx; double mirror; int direction; /* sanity check */ if (t < 0) { fprintf(stderr, "scheduler_4: strange t (%d)\n", t); return SCHEDULER_ERROR; } if (t == 30) { if (tenm_table_add(message_new(210.0, 240.0, 0.0, 0.0, 100, "stage 4", 7)) < 0) { fprintf(stderr, "scheduler_4: cannot create message \"stage 4\"" "(t = %d)\n", t); status = SCHEDULER_ERROR; } if (tenm_table_add(message_new(200.0, 270.0, 0.0, 0.0, 100, "another L", 9)) < 0) { fprintf(stderr, "scheduler_4: cannot create message (stage 4 title) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } /* x or X: move * . or |: not move * 11 frame per character * * x.xX..xXx.xXx.xX * x.xX.xxXx.xX.xx| */ if (t < 1588) { if (t < 532) { t_start = 180; mirror = 1.0; } else if (t < 884) { t_start = 532; mirror = -1.0; } else if (t < 1236) { t_start = 884; mirror = 1.0; } else { t_start = 1236; mirror = -1.0; } time_shoot = 33; time_shoot_initial = 0; /* B1 */ if (t == t_start + 0) { x = ((double) WINDOW_WIDTH) / 2.0 - 86.0 * mirror; y = -18.0; if (mirror > 0.0) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 15, 1, /* move 0 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 58, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 58, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9, /* move 9 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* move 10 */ 8, 0.0, -21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 11, /* move 11 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 12, /* move 12 */ 8, 21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 13, /* move 13 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14, /* move 14 */ 1000, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } /* R2 */ if (t == t_start + 22) { x = ((double) WINDOW_WIDTH) / 2.0 - 86.0 * mirror; y = -18.0; if (mirror > 0.0) color = COLOR_RED; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 11, 1, /* move 0 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 47, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 0.0, 21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 69, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 8, 0.0, -10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9, /* move 9 */ 47, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* move 10 */ 1000, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } /* B3 */ if (t == t_start + 33) { x = ((double) WINDOW_WIDTH) / 2.0 - 86.0 * mirror; y = -18.0; if (mirror > 0.0) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 9, 1, /* move 0 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 47, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 0.0, 21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 113, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 1000, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } /* R4 */ if (t == t_start + 66) { if (mirror > 0.0) x = ((double) WINDOW_WIDTH) + 18.0; else x = -18.0; y = 240.0; if (mirror > 0.0) color = COLOR_RED; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 15, 1, /* move 0 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 0.0, -21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 0.0, 21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 8, 21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9, /* move 9 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* move 10 */ 8, 0.0, -21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 11, /* move 11 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 12, /* move 12 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 13, /* move 13 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14, /* move 14 */ 1000, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } /* B5 */ if (t == t_start + 77) { if (mirror > 0.0) x = ((double) WINDOW_WIDTH) + 18.0; else x = -18.0; y = 240.0; if (mirror > 0.0) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 15, 1, /* move 0 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 0.0, -21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 47, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 8, 0.0, 21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9, /* move 9 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* move 10 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 11, /* move 11 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 12, /* move 12 */ 8, 0.0, -10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 13, /* move 13 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14, /* move 14 */ 1000, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 14, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } /* R6 */ if (t == t_start + 88) { if (mirror > 0.0) x = ((double) WINDOW_WIDTH) + 18.0; else x = -18.0; y = 240.0; if (mirror > 0.0) color = COLOR_RED; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 11, 1, /* move 0 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 0.0, -21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 58, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9, /* move 9 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* move 10 */ 1000, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == t_start + 176) { /* B7 */ x = ((double) WINDOW_WIDTH) / 2.0; y = -18.0; if (mirror > 0.0) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 9, 1, /* move 0 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 0.0, 21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 47, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 1000, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (0) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } /* B8 */ if (mirror > 0.0) x = -18.0; else x = ((double) WINDOW_WIDTH) + 18.0; y = 154.0; if (mirror > 0.0) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 11, 1, /* move 0 */ 8, 21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 8, 0.0, -10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9, /* move 9 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* move 10 */ 1000, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (1) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } /* B9 */ if (mirror > 0.0) x = ((double) WINDOW_WIDTH) + 18.0; else x = -18.0; y = 154.0; if (mirror > 0.0) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 11, 1, /* move 0 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 0.0, -10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9, /* move 9 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* move 10 */ 1000, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (2) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == t_start + 198) { /* R10 */ x = ((double) WINDOW_WIDTH) / 2.0; y = -18.0; if (mirror > 0.0) color = COLOR_RED; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 9, 1, /* move 0 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 0.0, 21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 58, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 1000, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (0) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } /* R11 */ if (mirror > 0) x = -18.0; else x = ((double) WINDOW_WIDTH) + 18.0; y = 154.0; if (mirror > 0.0) color = COLOR_RED; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 9, 1, /* move 0 */ 8, 21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 0.0, -10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 47, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 1000, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (1) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } /* R12 */ if (mirror > 0.0) x = ((double) WINDOW_WIDTH) + 18.0; else x = -18.0; y = 154.0; if (mirror > 0.0) color = COLOR_RED; else color = COLOR_BLUE; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 11, 1, /* move 0 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 8, 0.0, -10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 9, /* move 9 */ 47, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* move 10 */ 1000, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 10, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (2) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == t_start + 209) { /* P13 */ x = ((double) WINDOW_WIDTH) / 2.0; y = -18.0; color = COLOR_PURPLE; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 9, 1, /* move 0 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, -10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 0.0, 21.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 10.75 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 1000, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (0) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } /* P14 */ if (mirror > 0.0) x = -18.0; else x = ((double) WINDOW_WIDTH) + 18.0; y = 154.0; color = COLOR_PURPLE; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 9, 1, /* move 0 */ 8, 21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, 21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 14, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 0.0, -10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 1000, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (1) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } /* P15 */ if (mirror > 0.0) x = ((double) WINDOW_WIDTH) + 18.0; else x = -18.0; y = 154.0; color = COLOR_PURPLE; if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 9, 1, /* move 0 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 8, 0.0, -10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 36, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 8, -21.5 * mirror, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 3, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 6, /* move 6 */ 8, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 7, /* move 7 */ 25, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* move 8 */ 1000, 0.0, 10.75, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 8, /* shoot 0 */ 1000, time_shoot, time_shoot_initial, 0, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (2) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } } if (t == 1600) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 240.0, -5.0, 0.0, 1000, "It's a system of closing.", 25)) < 0) { fprintf(stderr, "scheduler_4: cannot create message (stage 4 demo " "line 1) " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } t_start = 1750; if (t == t_start) { for (i = 0; i < 4; i++) { if (tenm_table_add(close_system_wall_new(i)) < 0) { fprintf(stderr, "scheduler_4: cannot create close_system_wall (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t >= t_start + 100) && (t <= t_start + 450) && (t % 50 == 0)) { for (i = 0; i < 2; i ++) { if (i == 0) { direction = CLOSE_SYSTEM_HORIZONTAL_FORWARD; time_shoot = 1000; if (t % 200 == 0) color = COLOR_PURPLE; else color = COLOR_BLUE; } else { direction = CLOSE_SYSTEM_HORIZONTAL_BACKWARD; time_shoot = 1000; if (t % 200 == 0) color = COLOR_PURPLE; else color = COLOR_RED; } if (tenm_table_add(close_system_ball_new(t - t_start, 2, direction, time_shoot, color))< 0) { fprintf(stderr, "scheduler_4: cannot create close_system_ball " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } return status; } if ((t >= t_start + 460) && (t <= t_start + 1010) && (t % 50 == 10)) { if (t <= t_start + 710) color = COLOR_BLUE; else if (t <= t_start + 760) color = COLOR_PURPLE; else color = COLOR_RED; time_shoot = 40; for (i = 0; i < 4; i ++) { if (i < 2) { direction = CLOSE_SYSTEM_HORIZONTAL_FORWARD; } else { direction = CLOSE_SYSTEM_HORIZONTAL_BACKWARD; } if (i % 2 == 0) n = -1; else n = 1; if (tenm_table_add(close_system_ball_new(t - t_start, n, direction, time_shoot, color))< 0) { fprintf(stderr, "scheduler_4: cannot create close_system_ball " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } return status; } if ((t >= t_start + 1020) && (t <= t_start + 1570) && (t % 50 == 20)) { direction = CLOSE_SYSTEM_VERTICAL_FORWARD; for (i = 0; i < 4; i ++) { if (i == 0) { n = -2; } else if (i == 1) { n = -1; } else if (i == 2) { n = 1; } else { n = 2; } if ((i == 1) || (i == 2)) { time_shoot = 1000; if (t <= t_start + 1270) color = COLOR_RED; else if (t <= t_start + 1320) color = COLOR_PURPLE; else color = COLOR_BLUE; } else { time_shoot = 40; if (t % 100 == 70) color = COLOR_BLUE; else color = COLOR_RED; } if (tenm_table_add(close_system_ball_new(t - t_start, n, direction, time_shoot, color))< 0) { fprintf(stderr, "scheduler_4: cannot create close_system_ball " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } return status; } if ((t >= t_start + 1620) && (t <= t_start + 2470) && (t % 50 == 20)) { time_shoot = 40; direction = CLOSE_SYSTEM_VERTICAL_BACKWARD; for (i = 0; i < 2; i ++) { if (i == 0) { n = -2; } else { n = 2; } if (t % 100 == 20) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(close_system_ball_new(t - t_start, n, direction, time_shoot, color))< 0) { fprintf(stderr, "scheduler_4: cannot create close_system_ball " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } } if ((t >= t_start + 1620) && (t <= t_start + 2470) && (t % 25 == 20)) { time_shoot = 1000; direction = CLOSE_SYSTEM_VERTICAL_FORWARD; n = 0; if (t % 100 == 70) color = COLOR_BLUE; else if (t % 100 == 20) color = COLOR_RED; else color = COLOR_PURPLE; if (tenm_table_add(close_system_ball_new(t - t_start, n, direction, time_shoot, color))< 0) { fprintf(stderr, "scheduler_4: cannot create close_system_ball " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((((t >= t_start + 1720) && (t <= t_start + 1770)) || ((t >= t_start + 1870) && (t <= t_start + 1920)) || ((t >= t_start + 2020) && (t <= t_start + 2070)) || ((t >= t_start + 2170) && (t <= t_start + 2220))) && (t % 25 == 20)) { time_shoot = 1000; if ((t >= t_start + 1720) && (t <= t_start + 1920)) direction = CLOSE_SYSTEM_VERTICAL_FORWARD; else direction = CLOSE_SYSTEM_VERTICAL_BACKWARD; if (((t >= t_start + 1720) && (t <= t_start + 1770)) || ((t >= t_start + 2170) && (t <= t_start + 2220))) n = 1; else n = -1; if (((t >= t_start + 1720) && (t <= t_start + 1770)) || ((t >= t_start + 2020) && (t <= t_start + 2070))) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(close_system_ball_new(t - t_start, n, direction, time_shoot, color))< 0) { fprintf(stderr, "scheduler_4: cannot create close_system_ball " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if ((t >= t_start + 3458) && (t < t_start + 3758) && (t % 6 == 0)) { for (i = 0; i < 2; i++) { if (i == 0) { x = -19.0; dx = 12.0; } else { x = ((double) WINDOW_WIDTH) + 19.0; dx = -12.0; } if (tenm_table_add(normal_enemy_new(x, 261.5, NORMAL_BALL_MEDIUM, ENEMY_TYPE_WEAK |ENEMY_TYPE_OBSTACLE, COLOR_PURPLE, 0, -1, -1, 2, 1, /* move 0 */ 22, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1000, 0.0, 12.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 20, 0, 50, 0)) < 0) { fprintf(stderr, "scheduler_4: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t >= t_start + 3800) && (t <= t_start + 4775) && (t % 25 == 0)) { for (i = 0; i < 3; i++) { if (i == 0) { time_shoot = 1000; direction = CLOSE_SYSTEM_VERTICAL_FORWARD; n = 0; if (t % 100 == 50) color = COLOR_RED; else if (t % 100 == 0) color = COLOR_BLUE; else color = COLOR_PURPLE; } else { if (t % 75 == 50) time_shoot = 1000; else time_shoot = 40; if (t <= t_start + 4275) direction = CLOSE_SYSTEM_VERTICAL_BACKWARD; else if (i == 1) direction = CLOSE_SYSTEM_HORIZONTAL_FORWARD; else direction = CLOSE_SYSTEM_HORIZONTAL_BACKWARD; if (i == 1) n = -2; else n = 2; if (t % 50 == 0) color = COLOR_RED; else color = COLOR_BLUE; } if (tenm_table_add(close_system_ball_new(t - t_start, n, direction, time_shoot, color))< 0) { fprintf(stderr, "scheduler_4: cannot create close_system_ball " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } } if ((((t >= t_start + 3900) && (t <= t_start + 3950)) || ((t >= t_start + 4050) && (t <= t_start + 4100)) || ((t >= t_start + 4200) && (t <= t_start + 4250)) || ((t >= t_start + 4350) && (t <= t_start + 4400))) && (t % 25 == 0)) { time_shoot = 1000; if ((t >= t_start + 3900) && (t <= t_start + 4100)) direction = CLOSE_SYSTEM_VERTICAL_FORWARD; else direction = CLOSE_SYSTEM_VERTICAL_BACKWARD; if (((t >= t_start + 3900) && (t <= t_start + 3950)) || ((t >= t_start + 4350) && (t <= t_start + 4400))) n = 1; else n = -1; if (((t >= t_start + 3900) && (t <= t_start + 3950)) || ((t >= t_start + 4200) && (t <= t_start + 4250))) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(close_system_ball_new(t - t_start, n, direction, time_shoot, color))< 0) { fprintf(stderr, "scheduler_4: cannot create close_system_ball " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 7000) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 270.0, -5.0, 0.0, 1000, "boss: FUD", 9)) < 0) { fprintf(stderr, "scheduler_4: cannot create message " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 7130) { if (tenm_table_add(fud_new()) < 0) { fprintf(stderr, "scheduler_4: cannot create fud " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } return status; } tenmado-0.10/happy-L/stage-4.h0000644000175000017500000000027210276702754016627 0ustar00ooharaoohara00000000000000/* $Id: stage-4.h,v 1.2 2002/06/07 04:25:16 oohara Exp $ */ #ifndef __TENMADO_STAGE_4_H__ #define __TENMADO_STAGE_4_H__ int scheduler_4(int t); #endif /* not __TENMADO_STAGE_4_H__ */ tenmado-0.10/happy-L/stage-5.c0000644000175000017500000006133710276702754016634 0ustar00ooharaoohara00000000000000/* $Id: stage-5.c,v 1.119 2003/01/03 22:42:36 oohara Exp $ */ #include /* malloc, rand */ #include #include "tenm_table.h" #include "const.h" #include "message.h" #include "normal-enemy.h" #include "tenm_object.h" #include "solution.h" #include "last-boss.h" #include "stage-5.h" static tenm_object *stage_5_more_1_new(int n); static int stage_5_more_1_act(tenm_object *my, const tenm_object *player); static tenm_object *stage_5_more_2_new(void); static int stage_5_more_2_act(tenm_object *my, const tenm_object *player); int scheduler_5(int t) { int status = SCHEDULER_SUCCESS; int i; int color; double temp; double x; double dx; double ddx; double y; double dy; /* sanity check */ if (t < 0) { fprintf(stderr, "scheduler_5: strange t (%d)\n", t); return SCHEDULER_ERROR; } if (t == 30) { if (tenm_table_add(message_new(190.0, 240.0, 0.0, 0.0, 100, "final stage", 11)) < 0) { fprintf(stderr, "scheduler_5: cannot create message \"final stage\"" "(t = %d)\n", t); status = SCHEDULER_ERROR; } if (tenm_table_add(message_new(200.0, 270.0, 0.0, 0.0, 100, "L is lost", 9)) < 0) { fprintf(stderr, "scheduler_5: cannot create message (stage 5 title) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } return status; } if (t == 180) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 90.0, -5.0, 0.0, 1000, "It's a desire for an AI...", 27)) < 0) { fprintf(stderr, "scheduler_5: cannot create message (stage 5 demo " "line 1) " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 230) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 120.0, -5.0, 0.0, 1000, "it's the world as a library...", 30)) < 0) { fprintf(stderr, "scheduler_5: cannot create message (stage 5 demo " "line 2) " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 280) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 150.0, -5.0, 0.0, 1000, "it's a tangible piece of empathy...", 35)) < 0) { fprintf(stderr, "scheduler_5: cannot create message (stage 5 demo " "line 3) " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 330) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 180.0, -5.0, 0.0, 1000, "and a vow to live, however hard it is.", 38)) < 0) { fprintf(stderr, "scheduler_5: cannot create message (stage 5 demo " "line 4) " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if ((t >= 490) && (t <= 840) && (t % 5 == 0)) { for (i = 0; i < 2; i++) { if (i == 0) color = COLOR_BLUE; else color = COLOR_RED; if (t <= 530) { temp = ((double) (530 - t)) / 10.0; temp *= temp; if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 - (145.0 - 8.0 * temp); else x = ((double) WINDOW_WIDTH) / 2.0 + (145.0 - 8.0 * temp); } else if (t <= 540) { if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 - 145.0; else x = ((double) WINDOW_WIDTH) / 2.0 + 145.0; } else if (t <= 590) { temp = ((double) (t - 540)) / 10.0; temp *= temp; if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 - (145.0 - 8.0 * temp); else x = ((double) WINDOW_WIDTH) / 2.0 + (145.0 - 8.0 * temp); } else if (t <= 630) { temp = ((double) (630 - t)) / 10.0; temp *= temp; if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 + (167.0 - 8.0 * temp); else x = ((double) WINDOW_WIDTH) / 2.0 - (167.0 - 8.0 * temp); } else if (t <= 640) { if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 + 167.0; else x = ((double) WINDOW_WIDTH) / 2.0 - 167.0; } else if (t <= 690) { temp = ((double) (t - 640)) / 10.0; temp *= temp; if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 + (167.0 - 8.0 * temp); else x = ((double) WINDOW_WIDTH) / 2.0 - (167.0 - 8.0 * temp); } else if (t <= 730) { temp = ((double) (730 - t)) / 10.0; temp *= temp; if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 - (145.0 - 8.0 * temp); else x = ((double) WINDOW_WIDTH) / 2.0 + (145.0 - 8.0 * temp); } else if (t <= 740) { if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 - 145.0; else x = ((double) WINDOW_WIDTH) / 2.0 + 145.0; } else if (t <= 790) { temp = ((double) (t - 740)) / 10.0; temp *= temp; if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 - (145.0 - 8.0 * temp); else x = ((double) WINDOW_WIDTH) / 2.0 + (145.0 - 8.0 * temp); } else if (t <= 830) { temp = ((double) (830 - t)) / 10.0; temp *= temp; if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 + (167.0 - 8.0 * temp); else x = ((double) WINDOW_WIDTH) / 2.0 - (167.0 - 8.0 * temp); } else { if (i == 0) x = ((double) WINDOW_WIDTH) / 2.0 + 167.0; else x = ((double) WINDOW_WIDTH) / 2.0 - 167.0; } if (t <= 630) ddx = 0.0; else if (t <= 730) ddx = 0.3; else ddx = 0.8; if (tenm_table_add(normal_enemy_new(x, -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 3, 1, /* move 0 */ 5, ddx * (-5.0), 15.0, ddx, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 10, 0.0, 15.0, -ddx, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 10, 0.0, 15.0, ddx, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_5: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t >= 890) && (t <= 940) && (t % 5 == 0)) { if (t % 10 == 0) { x = ((double) WINDOW_WIDTH) / 2.0 - ((double) ((t - 850) * 3)); dx = 3.0; } else { x = ((double) WINDOW_WIDTH) / 2.0 + ((double) ((t - 850) * 3)); dx = -3.0; } dy = ((double) (t - 850)) * 0.15; if (tenm_table_add(normal_enemy_new(x, -23.0, NORMAL_STING, 0, COLOR_PURPLE, 0, -1, -1, 1, 1, /* move 0 */ 1000, dx, dy, 0.0, -0.15, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 12, 0, 100, 0)) < 0) { fprintf(stderr, "scheduler_5: cannot create normal_enemy " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 1090) { for (i = 0; i < 24; i++) { if (i < 4) dy = (80.0 - (-23.0)) / 30.0; else if (i < 8) dy = (160.0 - (-23.0)) / 30.0; else if (i < 12) dy = (240.0 - (-23.0)) / 30.0; else if (i < 16) dy = (400.0 - (-23.0)) / 30.0; else if (i < 20) dy = (480.0 - (-23.0)) / 30.0; else dy = (560.0 - (-23.0)) / 30.0; switch (i % 4) { case 0: x = ((double) WINDOW_WIDTH) / 2.0 - 180.0; break; case 1: x = ((double) WINDOW_WIDTH) / 2.0 - 120.0; break; case 2: x = ((double) WINDOW_WIDTH) / 2.0 + 120.0; break; case 3: x = ((double) WINDOW_WIDTH) / 2.0 + 180.0; break; default: fprintf(stderr, "scheduler_5: strange remainder (%d) " "(t = %d)\n", i % 4, t); x = ((double) WINDOW_WIDTH) / 2.0; break; } if (i % 4 < 2) { dx = 15.0; ddx = -0.3; } else { dx = -15.0; ddx = 0.3; } if (tenm_table_add(normal_enemy_new(x, -23.0, NORMAL_STING, 0, COLOR_PURPLE, 0, -1, -1, 3, 1, /* move 0 */ 30, 0.0, dy, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 30, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 1 */ 1000, dx, 4.0, ddx, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 1000, 950, 100, 0)) < 0) { fprintf(stderr, "scheduler_5: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } return status; } if ((t >= 1300) && (t <= 1880) && (t % 5 == 0)) { for (i = 0; i < 3; i++) { y = (double) ((t - 1300) * 2 + ((t * 13) % 197) - i * 200); if (t % 10 == 0) { x = -14.0; dx = 10.0; } else { x = ((double) WINDOW_WIDTH) + 14.0; dx = -10.0; } if (i == 0) color = COLOR_RED; else if (i == 1) color = COLOR_PURPLE; else color = COLOR_BLUE; if ((y > 0.0) && (y < (double) WINDOW_HEIGHT)) { if (tenm_table_add(normal_enemy_new(x, y, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, dx, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_5: cannot create normal_enemy (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } return status; } if (t == 1890) { for (i = 0; i < 6; i++) { if (tenm_table_add(stage_5_more_1_new(i)) < 0) { fprintf(stderr, "scheduler_5: cannot create stage_5_more_1 (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } return status; } if ((t == 2240) || (t == 2340) || (t == 2440)) { if (t == 2240) color = COLOR_PURPLE; else if (t == 2340) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(-35.0, 0.0, NORMAL_PLENTY, 0, color, 0, -1, -1, 3, 1, /* move 0 */ 100, 8.0, 3.5, -0.08, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 50, 0.0, 3.5, -0.16, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 1000, -8.0, 3.5, 0.16, -0.1, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 1000, 12, 0, 0, 0)) < 0) { fprintf(stderr, "scheduler_5: cannot create normal_enemy " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } if (t == 2750) { if (tenm_table_add(stage_5_more_2_new()) < 0) { fprintf(stderr, "scheduler_5: cannot create stage_5_more_2 " "(t = %d)\n", t); return SCHEDULER_ERROR; } return SCHEDULER_SUCCESS; } /* the boss is created by more 2 */ return SCHEDULER_SUCCESS; } static tenm_object * stage_5_more_1_new(int n) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 5); if (count == NULL) { fprintf(stderr, "stage_5_more_1_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed * [4] n */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; count[4] = n; new = tenm_object_new("stage 5 more 1", 0, 0, 0, 0.0, 0.0, 4, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_5_more_1_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_5_more_1_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_5_more_1_act(tenm_object *my, const tenm_object *player) { int i; int color; double x; double ddx; double dy; /* sanity check */ if (my == NULL) return 0; if (my->count[2] == 0) { if (my->count[1] == 0) { x = (double) (40 + my->count[4] * 80); switch (my->count[4] % 3) { case 0: color = COLOR_BLUE; break; case 1: color = COLOR_PURPLE; break; case 2: color = COLOR_RED; break; default: fprintf(stderr, "stage_5_more_1_act: strange n (%d) " "(%d, %d)\n", my->count[4], my->count[2], my->count[1]); color = COLOR_PURPLE; break; } if (my->count[4] % 2 == 0) { dy = (80.0 - (-23.0)) / 30.0; if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_HORIZON, 0, color, 0, my->table_index, 3, 6, 3, /* move 0 */ 30, 0.0, dy, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 65, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 40, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 90, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 25, 0.0, -11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 1000, 4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* shoot 0 */ 95, 1, -35, 0, 1, /* shoot 1 */ 115, 1, -45, 0, 2, /* shoot 2 */ 1000, 1, -45, 0, 2)) < 0) { fprintf(stderr, "stage_5_more_1_act: cannot create normal_enemy " "(%d) " "(%d, %d)\n", my->count[4], my->count[2], my->count[1]); } } else { dy = (560.0 - (-23.0)) / 30.0; if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_HORIZON, 0, color, 0, my->table_index, 3, 6, 4, /* move 0 */ 30, 0.0, dy, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 65, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 40, 0.0, -11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 90, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4, /* move 4 */ 25, 0.0, 11.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* move 5 */ 1000, -4.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 5, /* shoot 0 */ 2, 1, -1000, 0, 1, /* shoot 1 */ 93, 1, -33, 0, 2, /* shoot 2 */ 115, 1, -45, 0, 3, /* shoot 3 */ 1000, 1, -45, 0, 3)) < 0) { fprintf(stderr, "stage_5_more_1_act: cannot create normal_enemy " "(%d) " "(%d, %d)\n", my->count[4], my->count[2], my->count[1]); } } } if (my->count[1] > 0) { if ((my->count[3] >= 1) && (my->count[0] < 280)) { my->count[1] = 0; my->count[2] = 1; } } else { (my->count[1])++; } } else if (my->count[2] == 1) { if ((my->count[1] <= 9) && (my->count[1] % 3 == 0)) { for (i = 0; i < 2; i++) { x = (double) (40 + my->count[4] * 80); if (i == 0) { x -= 5.0; ddx = -0.2; } else { x += 5.0; ddx = 0.2; } switch (my->count[4] % 3) { case 0: color = COLOR_BLUE; break; case 1: color = COLOR_PURPLE; break; case 2: color = COLOR_RED; break; default: fprintf(stderr, "stage_5_more_1_act: strange n (%d) " "(%d, %d)\n", my->count[4], my->count[2], my->count[1]); color = COLOR_PURPLE; break; } if (tenm_table_add(normal_enemy_new(x, -19.0, NORMAL_BALL_MEDIUM, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, 8.0, ddx, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "stage_5_more_1_act: cannot create normal_enemy " "(%d) " "(%d, %d)\n", i, my->count[2], my->count[1]); } } } (my->count[1])++; } else { fprintf(stderr, "stage_5_more_1_act: strange mode (%d)\n", my->count[2]); } (my->count[0])++; if (my->count[0] >= 400) return 1; return 0; } static tenm_object * stage_5_more_2_new(void) { tenm_object *new = NULL; int *count = NULL; double *count_d = NULL; count = (int *) malloc(sizeof(int) * 5); if (count == NULL) { fprintf(stderr, "stage_5_more_2_new: malloc(count) failed\n"); return NULL; } count_d = (double *) malloc(sizeof(double) * 1); if (count_d == NULL) { fprintf(stderr, "stage_5_more_2_new: malloc(count_d) failed\n"); if (count != NULL) free(count); return NULL; } /* list of count * [0] total timer * [1] mode timer * [2] mode * [3] killed */ /* list of count_d * [0] mode 1 x */ count[0] = 0; count[1] = 0; count[2] = 0; count[3] = 0; count_d[0] = ((double) WINDOW_WIDTH) / 2.0; new = tenm_object_new("stage 5 more 2", 0, 0, 0, 0.0, 0.0, 4, count, 1, count_d, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_5_more_2_act, (int (*)(tenm_object *, int)) NULL); if (new == NULL) { fprintf(stderr, "stage_5_more_2_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_5_more_2_act(tenm_object *my, const tenm_object *player) { int color; /* sanity check */ if (my == NULL) return 0; if (my->count[2] == 0) { if (my->count[1] == 0) { if (tenm_table_add(solution_new(my->table_index)) < 0) { fprintf(stderr, "stage_5_more_2: cannot create solution " "(%d, %d)\n", my->count[2], my->count[1]); } } (my->count[1])++; if (my->count[3] >= 1) { my->count[1] = 0; if (my->count[0] <= 480) my->count[2] = 1; else my->count[2] = 2; } } else if (my->count[2] == 1) { if ((my->count[1] >= 120) && (my->count[0] <= 700) && (my->count[1] % 5 == 0)) { /* bounded random walk */ if (my->count_d[0] < 70.0) my->count_d[0] += 30.0; else if (my->count_d[0] > ((double) WINDOW_WIDTH) - 70.0) my->count_d[0] -= 30.0; else if (rand() % 2 == 0) my->count_d[0] += 30.0; else my->count_d[0] -= 30.0; if (my->count[1] % 15 == 10) color = COLOR_PURPLE; else if (my->count[1] % 30 < 15) color = COLOR_BLUE; else color = COLOR_RED; if (tenm_table_add(normal_enemy_new(my->count_d[0], -14.0, NORMAL_BALL_SMALL, 0, color, 0, -1, -1, 1, 1, /* move 0 */ 1000, 0.0, 15.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, /* shoot 0 */ 1000, 1000, 0, 0, 0)) < 0) { fprintf(stderr, "stage_5_more_2: cannot create normal_enemy " "(%d, %d)\n", my->count[2], my->count[1]); } } (my->count[1])++; if (my->count[0] >= 700) { my->count[1] = 0; my->count[2] = 2; } } else if (my->count[2] == 2) { if (my->count[1] == 120) { if (tenm_table_add(message_new(((double) WINDOW_WIDTH) - 1.0, 270.0, -5.0, 0.0, 1000, "boss: L", 9)) < 0) { fprintf(stderr, "stage_5_more_2: cannot create message " "(%d, %d)\n", my->count[2], my->count[1]); } } else if (my->count[1] == 250) { if (tenm_table_add(last_boss_new()) < 0) { fprintf(stderr, "stage_5_more_2: cannot create L " "(%d, %d)\n", my->count[2], my->count[1]); } } (my->count[1])++; } else { fprintf(stderr, "stage_5_more_2: strange mode (%d)\n" , my->count[2]); } (my->count[0])++; if (my->count[0] >= 1000) return 1; return 0; } tenmado-0.10/happy-L/stage-5.h0000644000175000017500000000027210276702754016630 0ustar00ooharaoohara00000000000000/* $Id: stage-5.h,v 1.1 2002/06/07 04:24:10 oohara Exp $ */ #ifndef __TENMADO_STAGE_5_H__ #define __TENMADO_STAGE_5_H__ int scheduler_5(int t); #endif /* not __TENMADO_STAGE_5_H__ */ tenmado-0.10/happy-L/stage-clear.c0000644000175000017500000000503310276702754017545 0ustar00ooharaoohara00000000000000/* $Id: stage-clear.c,v 1.10 2003/01/12 02:00:11 oohara Exp $ */ #include /* malloc */ #include /* strlen */ #include #include "tenm_object.h" #include "scheduler.h" #include "util.h" #include "ship.h" #include "score.h" #include "stage-clear.h" static int stage_clear_act(tenm_object *my, const tenm_object *player); static int stage_clear_draw(tenm_object *my, int priority); tenm_object * stage_clear_new(int stage) { tenm_object *new = NULL; int *count = NULL; count = (int *) malloc(sizeof(int) * 2); if (count == NULL) { fprintf(stderr, "stage_clear_new: malloc(count) failed\n"); return NULL; } /* list of count * [0] timer * [1] stage */ count[0] = 0; count[1] = stage; new = tenm_object_new("stage clear message", 0, 0, 0, 0.0, 0.0, 2, count, 0, NULL, 0, NULL, (int (*)(tenm_object *, double)) NULL, (int (*)(tenm_object *, tenm_object *)) NULL, (int (*)(tenm_object *, const tenm_object *)) stage_clear_act, (int (*)(tenm_object *, int)) stage_clear_draw); if (new == NULL) { fprintf(stderr, "stage_clear_new: tenm_object_new failed\n"); free(count); return NULL; } return new; } static int stage_clear_act(tenm_object *my, const tenm_object *player) { /* sanity check */ if (my == NULL) return 0; (my->count[0])++; if (my->count[0] >= 200) { /* you cannot clear the stage if you have no ship */ if (get_ship() >= 0) set_stage_cleared(1); return 1; } return 0; } static int stage_clear_draw(tenm_object *my, int priority) { int status = 0; char temp[32]; int x; /* sanity check */ if (my == NULL) return 0; if (priority != 1) return 0; /* you cannot clear the stage if you have no ship */ if (get_ship() >= 0) { if ((my->count[1] >= 1) && (my->count[1] <= 4)) { sprintf(temp, "stage %d cleared", my->count[1]); x = 180; } else { sprintf(temp, "final stage cleared"); x = 160; } if (draw_string(x, 240, temp, (int) strlen(temp)) != 0) { fprintf(stderr, "stage_clear_draw: draw_string (line 1) failed\n"); status = 1; } } sprintf(temp, "stage score: %8d", get_stage_score(my->count[1])); if (draw_string(150, 270, temp, (int) strlen(temp)) != 0) { fprintf(stderr, "stage_clear_draw: draw_string (line 2) failed\n"); status = 1; } return status; } tenmado-0.10/happy-L/stage-clear.h0000644000175000017500000000036510276702754017555 0ustar00ooharaoohara00000000000000/* $Id: stage-clear.h,v 1.1 2002/05/18 05:03:10 oohara Exp $ */ #ifndef __TENMADO_STAGE_CLEAR_H__ #define __TENMADO_STAGE_CLEAR_H__ #include "tenm_object.h" tenm_object *stage_clear_new(int stage); #endif /* not __TENMADO_STAGE_CLEAR_H__ */ tenmado-0.10/happy-L/title.c0000644000175000017500000000702111277410700016463 0ustar00ooharaoohara00000000000000/* $Id: title.c,v 1.21 2009/11/14 02:11:12 oohara Exp $ */ /* VERSION */ #include #include /* strlen */ #include #include "tenm_input.h" #include "tenm_graphic.h" #include "util.h" #include "esc-ok.h" #include "tenm_timer.h" /* COPYRIGHT_STRING */ #include "const.h" #include "title.h" /* return * 0 if a real game is requested * 1 if a tutorial demo is requested * 2 if a high score list is requested * 3 if the program should quit */ int title(void) { int i; int choice = 0; int delay = 6; int a_x; int a_y; int b_x; int b_y; tenm_color color; const char *string = NULL; char temp[32]; /* we don't need to pause in the title */ tenm_set_focus_handler((void (*)(int)) NULL); while (1 == 1) { if (tenm_event_handle() != 0) { choice = 3; break; } /* quit if ESC is pressed */ if (tenm_get_key_status() & 32) { if (get_esc_ok()) { /* this is completely useless, but let's be pedantic */ set_esc_ok(0); choice = 3; break; } } else { set_esc_ok(1); } /* proceed if space if pressed */ if (tenm_get_key_status() & 16) break; /* move the cursor */ if (tenm_get_key_status() & 1) { if (delay <= 0) { choice--; if (choice < 0) choice += 4; delay = 6; } else { delay--; } } else if (tenm_get_key_status() & 2) { if (delay <= 0) { choice++; if (choice >= 4) choice -= 4; delay = 6; } else { delay--; } } else { delay = 0; } tenm_clear_window(tenm_map_color(253, 245, 230)); for (i = 0; i < 3; i++) { if (i == 0) { a_x = 480; a_y = 560; b_x = 0; b_y = 436; color = tenm_map_color(0, 63, 255); } else if (i == 1) { a_x = 0; a_y = 436; b_x = 356; b_y = 80; color = tenm_map_color(127, 0, 255); } else { a_x = 356; a_y = 80; b_x = 480; b_y = 560; color = tenm_map_color(255, 0, 50); } if (tenm_draw_line(a_x, a_y, b_x, b_y, 1, color) != 0) { fprintf(stderr, "title: tenm_draw_line failed (%d)", i); } } if (draw_string(80, 90, "tenmado", 7) != 0) fprintf(stderr, "title: draw_string (title) failed\n"); /* don't use "string" here --- what we need is a buffer, * not a pointer */ sprintf(temp, "version %.20s", VERSION); if (draw_string(80, 120, temp, (int) strlen(temp)) != 0) fprintf(stderr, "title: draw_string (version) failed\n"); for (i = 0; i < 4; i++) { if (i == 0) { string = "start a game"; } else if (i == 1) { string = "tutorial"; } else if (i == 2) { string = "high score"; } else { string = "quit"; } if (draw_string(180, 300 + 30 * i, string, (int) strlen(string)) != 0) fprintf(stderr, "title: draw_string (menu %d) failed\n", i + 1); } if (draw_string(160, 300 + 30 * choice, ">", 1) != 0) fprintf(stderr, "title: draw_string (cursor) failed\n"); if (draw_string(60, 600, COPYRIGHT_STRING, (int) strlen(COPYRIGHT_STRING)) != 0) fprintf(stderr, "title: draw_string (copyright) failed\n"); tenm_redraw_window(); tenm_wait_next_frame(); } return choice; } tenmado-0.10/happy-L/title.h0000644000175000017500000000025310276702754016503 0ustar00ooharaoohara00000000000000/* $Id: title.h,v 1.1 2002/07/12 15:33:37 oohara Exp $ */ #ifndef __TENMADO_TITLE_H__ #define __TENMADO_TITLE_H__ int title(void); #endif /* not __TENMADO_TITLE_H__ */ tenmado-0.10/happy-L/tutorial.c0000644000175000017500000002633110276702754017225 0ustar00ooharaoohara00000000000000/* $Id: tutorial.c,v 1.47 2003/02/23 14:27:22 oohara Exp $ */ #include #include "tenm_table.h" #include "const.h" #include "message.h" #include "normal-enemy.h" #include "tenm_object.h" #include "laser.h" #include "wall.h" #include "tutorial.h" int tutorial(int t) { int i; int status = SCHEDULER_SUCCESS; int line_number; int life; const char *string = NULL; int length = 0; double x; int color; /* sanity check */ if (t < 0) { fprintf(stderr, "tutorial: strange t (%d)\n", t); return SCHEDULER_ERROR; } if (t >= 3260) return SCHEDULER_NEXT_STAGE; if (t == 0) { if (tenm_table_add(message_new(160.0, ((double) WINDOW_HEIGHT) - 40.0, 0.0, 0.0, 4000, "press ESC to quit", 17)) < 0) { fprintf(stderr, "tutorial: cannot create message (quit instruction) " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 30) line_number = 1; else if (t == 170) line_number = 1; else if (t == 360) line_number = 1; else if (t == 550) line_number = 2; else if (t == 740) line_number = 3; else if (t == 1020) line_number = 3; else if (t == 1310) line_number = 4; else if (t == 1540) line_number = 3; else if (t == 1770) line_number = 6; else if (t == 2160) line_number = 4; else if (t == 2470) line_number = 5; else if (t == 2880) line_number = 1; else if (t == 3070) line_number = 2; else line_number = 0; for (i = 1; i <= line_number; i++) { if (t == 30) { life = 100; string = "tenmado tutorial"; length = 16; } else if (t == 170) { life = 160; string = "Use cursor keys to move."; length = 24; } else if (t == 360) { life = 160; string = "Press space to shoot (auto-repeat)."; length = 35; } else if (t == 550) { life = 140; if (i == 1) { string = "The player shot turns black"; length = 27; } else { string = "as it flies."; length = 12; } } else if (t == 740) { life = 260; if (i == 1) { string = "A black shot deals 1 damage."; length = 28; } else if (i == 2) { string = "(See the hit status at the upper"; length = 32; } else { string = "left corner of the window.)"; length = 27; } } else if (t == 1020) { life = 260; if (i == 1) { string = "A non-black shot deals 2 damage."; length = 32; } else if (i == 2) { string = "Keep close to an enemy"; length = 22; } else { string = "to destroy it quickly."; length = 22; } } else if (t == 1310) { life = 200; if (i == 1) { string = "If your ship gets hit by"; length = 24; } else if (i == 2) { string = "an enemy shot, an enemy ship or"; length = 31; } else if (i == 3) { string = "any other obstacle,"; length = 19; } else { string = "your ship is destroyed."; length = 23; } } else if (t == 1540) { life = 200; if (i == 1) { string = "The black circle at the center is"; length = 33; } else if (i == 2) { string = "the only weak point of your ship."; length = 33; } else { string = "The rest is safe."; length = 17; } } else if (t == 1770) { life = 360; if (i == 1) { string = "You can get an additional score by"; length = 34; } else if (i == 2) { string = "destroying enemies of the same"; length = 30; } else if (i == 3) { string = "color successively. This is"; length = 29; } else if (i == 4) { string = "called the \"color chain bonus\"."; length = 31; } else if (i == 5) { string = "(See the chain status at the upper"; length = 34; } else { string = "right corner of the window.)"; length = 28; } } else if (t == 2160) { life = 280; if (i == 1) { string = "The color of your ship indicates"; length = 32; } else if (i == 2) { string = "which color of enemy you should"; length = 31; } else if (i == 3) { string = "destroy to get the color chain"; length = 30; } else { string = "bonus."; length = 6; } } else if (t == 2470) { life = 380; if (i == 1) { string = "Purple is special --- you always"; length = 32; } else if (i == 2) { string = "get the color chain bonus if you"; length = 32; } else if (i == 3) { string = "destroy a purple enemy or if the"; length = 32; } else if (i == 4) { string = "enemy you destroyed last is"; length = 27; } else { string = "purple."; length = 7; } } else if (t == 2880) { life = 160; string = "You cannot destroy a green enemy."; length = 33; } else if (t == 3070) { life = 160; if (i == 1) { string = "There are 5 stages in this game."; length = 32; } else { /* well, you won't see many rand() in this game, * but anyway */ string = "Good luck!"; length = 10; } } else { fprintf(stderr, "tutorial: string not found (line %d) " "(t = %d)\n", i, t); life = 1; string = NULL; length = 0; } if (tenm_table_add(message_new(160.0, 60.0 + ((double) (i * 30)), 0.0, 0.0, life, string, length)) < 0) { fprintf(stderr, "tutorial: cannot create message (line %d)" "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } if (t == 710) { if (tenm_table_add(normal_enemy_new(104.0, -23.0, NORMAL_STING, 0, COLOR_BLUE, 0, -1, -1, 4, 1, /* move 0 */ 20, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1030, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* move 2 */ 30, 0.0, 8.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* move 3 */ 3000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 3, /* shoot 0 */ 3000, 3000, 2350, 0, 0)) < 0) { fprintf(stderr, "tutorial: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if ((t >= 1540) && (t < 1740) && (t % 5 == 0)) { for (i = 0; i < 2; i++) { if (t % 10 == 0) { if (i == 0) x = 68.0; else x = 92.0; } else { if (i == 0) x = 73.0; else x = 87.0; } if (tenm_table_add(laser_angle_new(x, -29.0, 25.0, 90, 30.0, COLOR_GREEN, 1000)) < 0) { fprintf(stderr, "tutorial: cannot create laser_angle (%d) " "(t = %d)\n", i, t); status = SCHEDULER_ERROR; } } } if ((t >= 1770) && (t <= 1800) && (t % 15 == 0)) { if (tenm_table_add(normal_enemy_new(80.0, -24.0, NORMAL_BALL_LARGE, 0, COLOR_BLUE, 0, -1, -1, 2, 1, /* move 0 */ 1820 - t, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 3000, 3000, 0, 0, 0)) < 0) { fprintf(stderr, "tutorial: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } if (t == 2160) { for (i = 0; i < 2; i++) { if (i == 0) { x = 50.0; color = COLOR_BLUE; } else { x = 110.0; color = COLOR_RED; } if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 2, 1, /* move 0 */ 50, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 3000, 3000, 0, 0, 0)) < 0) { fprintf(stderr, "tutorial: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } } if ((t >= 2460) && (t <= 2505) && (t % 15 == 0)) { for (i = 0; i < 2; i++) { if (i == 0) { x = 50.0; if (t % 30 == 0) color = COLOR_BLUE; else color = COLOR_RED; } else { x = 110.0; color = COLOR_PURPLE; } if (tenm_table_add(normal_enemy_new(x, -24.0, NORMAL_BALL_LARGE, 0, color, 0, -1, -1, 2, 1, /* move 0 */ 2525 - t, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1, /* move 1 */ 1000, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2, /* shoot 0 */ 3000, 3000, 0, 0, 0)) < 0) { fprintf(stderr, "tutorial: cannot create normal_enemy " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } } if (t == 2880) { if (tenm_table_add(wall_new(80.0, 60.0, 60.0, 5.0)) < 0) { fprintf(stderr, "tutorial: cannot create wall " "(t = %d)\n", t); status = SCHEDULER_ERROR; } } return status; } tenmado-0.10/happy-L/tutorial.h0000644000175000017500000000026710276702754017232 0ustar00ooharaoohara00000000000000/* $Id: tutorial.h,v 1.1 2002/07/11 14:06:10 oohara Exp $ */ #ifndef __TENMADO_TUTORIAL_H__ #define __TENMADO_TUTORIAL_H__ int tutorial(int t); #endif /* __TENMADO_TUTORIAL_H__ */ tenmado-0.10/happy-L/wall.c0000644000175000017500000000544210276702754016321 0ustar00ooharaoohara00000000000000/* $Id: wall.c,v 1.4 2002/06/07 09:38:59 oohara Exp $ */ #include /* malloc */ #include #include "const.h" #include "tenm_object.h" #include "tenm_graphic.h" #include "util.h" #include "tenm_primitive.h" #include "wall.h" static int wall_move(tenm_object *my, double turn_per_frame); static int wall_draw(tenm_object *my, int priority); tenm_object * wall_new(double x, double width, double height, double speed) { tenm_primitive **p = NULL; tenm_object *new = NULL; double *count_d = NULL; double w; double h; double y; /* sanity check */ if (width <= 0.0) return NULL; if (height <= 0.0) return NULL; if (speed <= 0.0) return NULL; w = width / 2.0; h = height / 2.0; y = 1.0 - h; p = (tenm_primitive **) malloc(sizeof(tenm_primitive *) * 1); if (p == NULL) { fprintf(stderr, "wall_new: malloc(p) failed\n"); return NULL; } p[0] = (tenm_primitive *) tenm_polygon_new(4, x - w, y - h, x - w, y + h, x + w, y + h, x + w, y - h); if (p[0] == NULL) { fprintf(stderr, "wall_new: cannot set p[0]\n"); free(p); return NULL; } count_d = (double *) malloc(sizeof(double) * 1); if (count_d == NULL) { fprintf(stderr, "wall_new: malloc(count_d) failed\n"); (p[0])->delete(p[0]); free(p); return NULL; } /* list of count_d * [0] speed */ count_d[0] = speed; new = tenm_object_new("wall", ATTR_OBSTACLE | ATTR_OPAQUE, 0, 1, x, y, 0, NULL, 1, count_d, 1, p, (int (*)(tenm_object *, double)) wall_move, NULL, (int (*)(tenm_object *, const tenm_object *)) NULL, (int (*)(tenm_object *, int)) wall_draw); if (new == NULL) { fprintf(stderr, "wall_new: tenm_object_new failed\n"); free(count_d); (p[0])->delete(p[0]); free(p); return NULL; } return new; } static int wall_move(tenm_object *my, double turn_per_frame) { double dy_temp; /* sanity check */ if (my == NULL) return 0; if (turn_per_frame <= 0.5) return 0; dy_temp = my->count_d[0] / turn_per_frame; my->y += dy_temp; tenm_move_mass(my->mass, 0.0, dy_temp); if (!in_window_object(my)) return 1; return 0; } static int wall_draw(tenm_object *my, int priority) { tenm_color color; /* sanity check */ if (my == NULL) return 0; if (priority != 0) return 0; color = tenm_map_color(59, 156, 71); if (tenm_draw_mass(my->mass, color) != 0) { fprintf(stderr, "wall_draw: tenm_draw_mass failed\n"); return 1; } return 0; } tenmado-0.10/happy-L/wall.h0000644000175000017500000000034210276702754016320 0ustar00ooharaoohara00000000000000/* $Id: wall.h,v 1.3 2002/06/07 09:31:06 oohara Exp $ */ #ifndef __TENMADO_WALL_H__ #define __TENMADO_WALL_H__ tenm_object *wall_new(double x, double width, double height, double speed); #endif /* not __TENMADO_WALL_H__ */ tenmado-0.10/happy-L/default/0000777000175000017500000000000011711666006016633 5ustar00ooharaoohara00000000000000tenmado-0.10/happy-L/default/Makefile.am0000644000175000017500000000117110276702754020671 0ustar00ooharaoohara00000000000000# Makefile.am for tenmado/happy-L/default # $Id: Makefile.am,v 1.3 2002/12/18 16:55:02 oohara Exp $ # process this file with automake --foreign to generate Makefile.in EXTRA_DIST = score-stage-1.txt \ score-stage-2.txt \ score-stage-3.txt \ score-stage-4.txt \ score-stage-5.txt \ score-total.txt install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/games/tenmado/default/ $(INSTALL_DATA) *.txt \ $(DESTDIR)$(datadir)/games/tenmado/default/ uninstall-local: -rm -f $(DESTDIR)$(datadir)/games/tenmado/default/*.txt -rmdir $(DESTDIR)$(datadir)/games/tenmado/default/ -rmdir $(DESTDIR)$(datadir)/games/tenmado/ tenmado-0.10/happy-L/default/Makefile.in0000644000175000017500000002240511711665645020707 0ustar00ooharaoohara00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # Makefile.am for tenmado/happy-L/default # $Id: Makefile.am,v 1.3 2002/12/18 16:55:02 oohara Exp $ # process this file with automake --foreign to generate Makefile.in VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : subdir = happy-L/default DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = score-stage-1.txt \ score-stage-2.txt \ score-stage-3.txt \ score-stage-4.txt \ score-stage-5.txt \ score-total.txt all: all-am .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign happy-L/default/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign happy-L/default/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 $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-local install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/games/tenmado/default/ $(INSTALL_DATA) *.txt \ $(DESTDIR)$(datadir)/games/tenmado/default/ uninstall-local: -rm -f $(DESTDIR)$(datadir)/games/tenmado/default/*.txt -rmdir $(DESTDIR)$(datadir)/games/tenmado/default/ -rmdir $(DESTDIR)$(datadir)/games/tenmado/ # 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: tenmado-0.10/happy-L/default/score-stage-1.txt0000644000175000017500000000117110276702754021750 0ustar00ooharaoohara00000000000000Comment $Id: score-stage-1.txt,v 1.7 2003/11/24 02:24:25 oohara Exp $ Comment field name and field values are separated by TAB Comment (therefore, TAB are not allowed in a comment) Comment comment-only entry is not allowed Comment each entry is _terminated_ by exactly one empty line Comment (you must add a newline even if there is only one entry) Entry-Version 0 Stage-Data-Version 0 When 1043344600 Uid 1024 User-Name developer Score-Sort 311607 Score-Total 311607 Number-Stage 6 Score-Stage 1 311607 Score-Stage 2 0 Score-Stage 3 0 Score-Stage 4 0 Score-Stage 5 0 Score-Stage 6 0 Comment don't forget the terminating empty line tenmado-0.10/happy-L/default/score-stage-2.txt0000644000175000017500000000120310276702754021745 0ustar00ooharaoohara00000000000000Comment $Id: score-stage-2.txt,v 1.6 2003/01/15 23:24:16 oohara Exp $ Comment field name and field values are separated by TAB Comment (therefore, TAB are not allowed in a comment) Comment comment-only entry is not allowed Comment each entry is _terminated_ by exactly one empty line Comment (you must add a newline even if there is only one entry) Entry-Version 0 Stage-Data-Version 0 When 1041987704 Uid 1024 User-Name developer Score-Sort 400845 Score-Total 899542 Number-Stage 6 Score-Stage 1 291218 Score-Stage 2 400845 Score-Stage 3 207479 Score-Stage 4 0 Score-Stage 5 0 Score-Stage 6 0 Comment don't forget the terminating empty line tenmado-0.10/happy-L/default/score-stage-3.txt0000644000175000017500000000117110276702754021752 0ustar00ooharaoohara00000000000000Comment $Id: score-stage-3.txt,v 1.5 2003/11/24 02:24:40 oohara Exp $ Comment field name and field values are separated by TAB Comment (therefore, TAB are not allowed in a comment) Comment comment-only entry is not allowed Comment each entry is _terminated_ by exactly one empty line Comment (you must add a newline even if there is only one entry) Entry-Version 0 Stage-Data-Version 0 When 1057337216 Uid 1024 User-Name developer Score-Sort 305828 Score-Total 305828 Number-Stage 6 Score-Stage 1 0 Score-Stage 2 0 Score-Stage 3 305828 Score-Stage 4 0 Score-Stage 5 0 Score-Stage 6 0 Comment don't forget the terminating empty line tenmado-0.10/happy-L/default/score-stage-4.txt0000644000175000017500000000117110276702754021753 0ustar00ooharaoohara00000000000000Comment $Id: score-stage-4.txt,v 1.5 2003/11/24 02:24:50 oohara Exp $ Comment field name and field values are separated by TAB Comment (therefore, TAB are not allowed in a comment) Comment comment-only entry is not allowed Comment each entry is _terminated_ by exactly one empty line Comment (you must add a newline even if there is only one entry) Entry-Version 0 Stage-Data-Version 0 When 1046745266 Uid 1024 User-Name developer Score-Sort 365347 Score-Total 365347 Number-Stage 6 Score-Stage 1 0 Score-Stage 2 0 Score-Stage 3 0 Score-Stage 4 365347 Score-Stage 5 0 Score-Stage 6 0 Comment don't forget the terminating empty line tenmado-0.10/happy-L/default/score-stage-5.txt0000644000175000017500000000117110276702754021754 0ustar00ooharaoohara00000000000000Comment $Id: score-stage-5.txt,v 1.4 2003/01/04 00:04:37 oohara Exp $ Comment field name and field values are separated by TAB Comment (therefore, TAB are not allowed in a comment) Comment comment-only entry is not allowed Comment each entry is _terminated_ by exactly one empty line Comment (you must add a newline even if there is only one entry) Entry-Version 0 Stage-Data-Version 0 When 1041519197 Uid 1024 User-Name developer Score-Sort 386798 Score-Total 386798 Number-Stage 6 Score-Stage 1 0 Score-Stage 2 0 Score-Stage 3 0 Score-Stage 4 0 Score-Stage 5 386798 Score-Stage 6 0 Comment don't forget the terminating empty line tenmado-0.10/happy-L/default/score-total.txt0000644000175000017500000000121510276702754021631 0ustar00ooharaoohara00000000000000Comment $Id: score-total.txt,v 1.6 2003/11/24 02:24:11 oohara Exp $ Comment field name and field values are separated by TAB Comment (therefore, TAB are not allowed in a comment) Comment comment-only entry is not allowed Comment each entry is _terminated_ by exactly one empty line Comment (you must add a newline even if there is only one entry) Entry-Version 0 Stage-Data-Version 0 When 1045019122 Uid 1024 User-Name developer Score-Sort 1490768 Score-Total 1490768 Number-Stage 6 Score-Stage 1 307501 Score-Stage 2 357084 Score-Stage 3 197237 Score-Stage 4 311923 Score-Stage 5 317023 Score-Stage 6 0 Comment don't forget the terminating empty line tenmado-0.10/happy-L/image/0000777000175000017500000000000011711666006016271 5ustar00ooharaoohara00000000000000tenmado-0.10/happy-L/image/Makefile.am0000644000175000017500000000441410276702754020332 0ustar00ooharaoohara00000000000000# Makefile.am for tenmado/happy-L/image # $Id: Makefile.am,v 1.7 2003/01/15 22:08:22 oohara Exp $ # process this file with automake --foreign to generate Makefile.in EXTRA_DIST = burst-blue.png \ burst-blue-damaged.png \ burst-purple.png \ burst-purple-damaged.png \ burst-red.png \ burst-red-damaged.png \ disconnection-bit.png \ disconnection-core.png \ disconnection-core-damaged.png \ doubt.png \ doubt-damaged.png \ fear.png \ fear-damaged.png \ font-medium.png \ horizon-blue.png \ horizon-blue-damaged.png \ horizon-purple.png \ horizon-purple-damaged.png \ horizon-red.png \ horizon-red-damaged.png \ intuition.png \ intuition-damaged.png \ large-ball-blue.png \ large-ball-purple.png \ large-ball-red.png \ last-boss-demo-0.png \ last-boss-demo-1.png \ last-boss-demo-2.png \ last-boss-demo-3.png \ last-boss.png \ last-boss-damaged.png \ medium-ball-blue.png \ medium-ball-purple.png \ medium-ball-red.png \ midnight-bit-blue.png \ midnight-bit-blue-damaged.png \ midnight-bit-purple.png \ midnight-bit-purple-damaged.png \ midnight-bit-red.png \ midnight-bit-red-damaged.png \ midnight.png \ midnight-damaged.png \ overrun-bit-blue.png \ overrun-bit-blue-damaged.png \ overrun-bit-green.png \ overrun-bit-purple.png \ overrun-bit-purple-damaged.png \ overrun-bit-red.png \ overrun-bit-red-damaged.png \ overrun.png \ overrun-damaged.png \ player-blue.png \ player-purple.png \ player-red.png \ plenty-blue.png \ plenty-blue-damaged.png \ plenty-purple.png \ plenty-purple-damaged.png \ plenty-red.png \ plenty-red-damaged.png \ small-ball-blue.png \ small-ball-purple.png \ small-ball-red.png \ solution.png \ solution-damaged.png \ sting-blue.png \ sting-blue-damaged.png \ sting-purple.png \ sting-purple-damaged.png \ sting-red.png \ sting-red-damaged.png \ trinity.png \ trinity-damaged.png \ uncertainty.png \ uncertainty-damaged.png install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/games/tenmado/image/ $(INSTALL_DATA) *.png \ $(DESTDIR)$(datadir)/games/tenmado/image/ uninstall-local: -rm -f $(DESTDIR)$(datadir)/games/tenmado/image/*.png -rmdir $(DESTDIR)$(datadir)/games/tenmado/image/ -rmdir $(DESTDIR)$(datadir)/games/tenmado/ tenmado-0.10/happy-L/image/Makefile.in0000644000175000017500000002562211711665645020351 0ustar00ooharaoohara00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # Makefile.am for tenmado/happy-L/image # $Id: Makefile.am,v 1.7 2003/01/15 22:08:22 oohara Exp $ # process this file with automake --foreign to generate Makefile.in VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : subdir = happy-L/image DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = burst-blue.png \ burst-blue-damaged.png \ burst-purple.png \ burst-purple-damaged.png \ burst-red.png \ burst-red-damaged.png \ disconnection-bit.png \ disconnection-core.png \ disconnection-core-damaged.png \ doubt.png \ doubt-damaged.png \ fear.png \ fear-damaged.png \ font-medium.png \ horizon-blue.png \ horizon-blue-damaged.png \ horizon-purple.png \ horizon-purple-damaged.png \ horizon-red.png \ horizon-red-damaged.png \ intuition.png \ intuition-damaged.png \ large-ball-blue.png \ large-ball-purple.png \ large-ball-red.png \ last-boss-demo-0.png \ last-boss-demo-1.png \ last-boss-demo-2.png \ last-boss-demo-3.png \ last-boss.png \ last-boss-damaged.png \ medium-ball-blue.png \ medium-ball-purple.png \ medium-ball-red.png \ midnight-bit-blue.png \ midnight-bit-blue-damaged.png \ midnight-bit-purple.png \ midnight-bit-purple-damaged.png \ midnight-bit-red.png \ midnight-bit-red-damaged.png \ midnight.png \ midnight-damaged.png \ overrun-bit-blue.png \ overrun-bit-blue-damaged.png \ overrun-bit-green.png \ overrun-bit-purple.png \ overrun-bit-purple-damaged.png \ overrun-bit-red.png \ overrun-bit-red-damaged.png \ overrun.png \ overrun-damaged.png \ player-blue.png \ player-purple.png \ player-red.png \ plenty-blue.png \ plenty-blue-damaged.png \ plenty-purple.png \ plenty-purple-damaged.png \ plenty-red.png \ plenty-red-damaged.png \ small-ball-blue.png \ small-ball-purple.png \ small-ball-red.png \ solution.png \ solution-damaged.png \ sting-blue.png \ sting-blue-damaged.png \ sting-purple.png \ sting-purple-damaged.png \ sting-red.png \ sting-red-damaged.png \ trinity.png \ trinity-damaged.png \ uncertainty.png \ uncertainty-damaged.png all: all-am .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign happy-L/image/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign happy-L/image/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 $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-data-local install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-local install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am uninstall uninstall-am uninstall-local install-data-local: $(mkinstalldirs) $(DESTDIR)$(datadir)/games/tenmado/image/ $(INSTALL_DATA) *.png \ $(DESTDIR)$(datadir)/games/tenmado/image/ uninstall-local: -rm -f $(DESTDIR)$(datadir)/games/tenmado/image/*.png -rmdir $(DESTDIR)$(datadir)/games/tenmado/image/ -rmdir $(DESTDIR)$(datadir)/games/tenmado/ # 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: tenmado-0.10/happy-L/image/burst-blue.png0000644000175000017500000000065610276702754021074 0ustar00ooharaoohara00000000000000‰PNG  IHDR0@ÓBcbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ ö[ _;IDATxœí–KÂ0 ›ˆQnĸ‡eQThœæù׆…g¢‰§öCIz<_Ó?‘G Ô„"„!„!D!BBˆB„"„!„!D!BB¡rÉåⳕÃ.9¥ùZækÉ)ý…ÐýVª¬B¿YZ5RˆFÇ&ýâ½~äê$Æ&¥P¿ –0i„8AQ‡I¼†ÿöº0‰…DùP„I&$}iE˜BºXHWqµüqD}å Ï)þr–ý$ç7 yÝu˜û€'\ðN§ËG´aOÈ븩‡Z¾+äxMíÜþÁ7:”NïÛBîÑá—hFá!ÔBÇE‡Ò¬µù~tt(t¡¢C©Š~…Ή¥ËGèÌèP~«çiDt(ë|ò4(:”E#ŠeÔ½‘Ùʶq4IEND®B`‚tenmado-0.10/happy-L/image/burst-blue-damaged.png0000644000175000017500000000066410276702754022453 0ustar00ooharaoohara00000000000000‰PNG  IHDR0@ÓBcbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ  y!ùeAIDATxœí–K‚03‰oì<„wu¥’y“LÓ+ùtQ]r<Ã?Ï(q!† 1\ˆáB b¸Ã….Äp!† 1\ˆáB b¸Ã…c„RŠ)ÙjÀ."2å<å,"!t›rqaÁ*tÍYÂûÅHk¶:™„RŠ—e:sLý‹çtpÜS¿P¥KLB¿é –˜z„0¤;¦æ5[é }15 5õÑS›P=¤#¦!M:HkLÚ©út¦˜´BÆï”~¹J¨5DêKQÆDfXÒA41¡!¿8MÖ„ìé 4¦M¡Qé õ˜ÖŒM©Ä´.4<ý+B{¤ƒlÅT í—²Óâ~ïtŒi!t@:HqèWè˜t"¦·Ð‘é ¿1ÅpF:È'¦NJ™5âYé sL/ßA»‹oV_IEND®B`‚tenmado-0.10/happy-L/image/burst-purple.png0000644000175000017500000000067310276702754021453 0ustar00ooharaoohara00000000000000‰PNG  IHDR0@ÓBcbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ (`ì HIDATxœí–9Â0 E .nÄ8#·¤c†¥`åäK–cSèU0‰¥ùC<§ðOPoB¸Â….„p!„ !\áBB¸Â….„p!„ !\QG(FбN©½Ñ0N1„p=_n·»µš]hÚÇ䃫Ð8E¢áUë=ªnB<:ö0•/^šÇïÌš ­$ƦB¡õ1XÂT"$ Jq˜ÔkäO_&µ*aÒ iº L ¡²XhWIoµüpTs• ßSòå"!ãŸoÐ  Õ:ëë€;ª¼À?H& „ªqTׄìÑÉôC#_ªxLVUÎ_¨ÎÊìóBÕ£#o‘Ú":™Æ › mN¶×ìûÖÑáðݘ 5ˆ'iújN²-/¡–Ñáüv§Ð#:œÏþPèÎSƒzE‡óܨ0&lIEND®B`‚tenmado-0.10/happy-L/image/burst-purple-damaged.png0000644000175000017500000000065310276702754023031 0ustar00ooharaoohara00000000000000‰PNG  IHDR0@ÓBcbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ  ~L=|8IDATxœí–K‚0 Eie¡®Ä}¸WxšÂËÊ w¤Gš^’çiÓûõéîDn-PBˆB„"„!„!D!BBˆB„"„!„!D!|„ú!÷ƒO)‡*)§Ç4>¦1åt ¡ç4,X…Ö™[ÕRˆFÇ&ýâ½~ä:HŒ%LJ¡ã6X¤âE&ñþÛëÂ$åC&™ô¥aéb!]Å}ÔòÇõ•+d<§øËYBö“œß`,äu×aÖO¸à œN!—+ލà‘×%p lù®ã5YT¹þƒot(½¯ ¹G‡¿EEèŒèPö†P Ju¯Í÷³£C¡ÓØ]J±é_èšèPбü„®Œe½{îZD‡²Ì'w¢C™5r«èPæA}!(1ö§IEND®B`‚tenmado-0.10/happy-L/image/burst-red.png0000644000175000017500000000067310276702754020716 0ustar00ooharaoohara00000000000000‰PNG  IHDR0@ÓBcbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ ùKVHIDATxœí–An„0 E‰…“¹QOÐCö°]0j‡üÀwâ@fá·B±ßâI~¾¾—OBf ”„#„!Ä!F1BˆBŒb„#„!Ä!F1BˆBŒ1B¢«è:f”D’¤9kÎIÒGéóY×¼9ûÑÒ–$'’¥²ÅçÖœá@NTZnܽïÙaÏx"\$Ð ôÎÖë\÷ÿZ'k’':Ke‹/”œ›28U+©ù‰Ð<ƒô ­Q÷­ÿGj•ÀÙ?¢5êèk3-ã@×ñ—§RïäçâúZÿû,-Í·§w„!%J F}’üMiiº–ÞV^æ,æ¬@Ko«ÿQRZm–ŎʯÐj·êõ¿;˜ ‰þwG»U_,UA@‡ík:„ФÃöµXªB‚(½_ýþ)Ù°Yìç»C³Óâð 1-„ÙiõM:dzƒ²$}‹„… ÈöúÝ©Ù,DšB¤]´fdÌ€£ã£é–[£ã£ðîš$&™6 ‚…°àLÆ´F îOla3}PˆÂLÈá°3˜6 A¨àË?Û¾0mD‘¤z}Þt[‰^Ÿ–*7Ö6×1mD¥ò”`ât‹–Ãb©Jˆ ›˜–¡PðåÔ6PÄÍvxLûPˆ¸Ù€,ÈÌNË.Í~¦}(”ÝÎáÉ ‡'“óç¥ÁfP€ Ȧ&U¾vö*µÇ˜¶×6]"Û…TAV ÎÏ.HTË/>DÜl 3PìÛ]ö=O2õ}D!zoûM&"/ž­Ë]óîgüMÛé°J¡ö;ÐFR]Ëågß_¤Øië¢ÍÕ˪è#aÚn;íuá®”9aìaÅÝ)ƒa´ð ¼ºñtj¶E’º’ó¡íÓð-]7î>ÐP™ì˜aìÖ–k¡ÓˆZ$IͳÐ|¢#ÝT/«š$ˆd¬ÍU õ?œ@4‡+v—ý†þ¶®ûUB„6ä­;¤ÚOÄ©E¢5êê šé|7¨`g~Ù¿ÏTbÖ"1;-=¯ß›š£ßŸ)øò•òå%¹kc:XŒMËO»UÿÖÔÔ=Øãð MŒÑ'A$ f QAÞìÜÕruLLj~þƒ¨ŽÝ`IIEND®B`‚tenmado-0.10/happy-L/image/disconnection-core.png0000644000175000017500000000276610276702754022601 0ustar00ooharaoohara00000000000000‰PNG  IHDRFFþLuÓbKGDÿÿÿ ½§“ pHYs  d_‘tIMEÒ KJ¬ÙƒIDATxœÝ›LeÇß–—öøuGÆQ(…t $›¸Ud ¢œ4$SŒÛbäXœ3t‹a3‰ºXBB&ÆÉQÓ1™u)Ù¤a ZÔÖXY¬¬Åñ«íøÑÚúÇ‘RZZŽ»þº~þºëÝÑ盇÷é{Ïû}6› x•rZ¥œy0:§0Lý7¯Ÿ3..˜—Í@8+,2Š…q'žŒNHB“S9‚´m‚´xïÀðŠ$ZÿÝÕ¿Ó½‘Äã(†ìÊØþjùS\F=ª’~ùy¼¯wdàÎ8õPÂ<~~ñÎ}¹|*„¼¤–ÆþA郕+•¯ß™Ù9É'>xžÜãd$I%£×®ÈÆUsä¾’ |çÈñÌœ‚Ô­>¸5Ir™¶µIJnÀŪڜݙ ÄÙ‚$±HÙþÙ€Ùd!yXì°ŠSÂC%iï'*©¦B¤}h UÑ‹í%DîÜ\’Agl®ëûcHãÀ(±'‹[]ŸÆ"žoÛD’\¦m®ëóEY#„Ìêú|ÏCË“$í„á|õu ÿß\áòÐsÍ… I¨»ÜJÒ¨õgNÜ žü8!³¡å°»©†[IçÞë †ñãŽ=YÜóŸoxicI¯oDpW¡ëGb‘òß¿§|Uë§Ä"¥ë$¹LÛyy0cû+0Jt^äòP§è,©çºâ±ÞäǨ¨Òs]á$iÝXêlßPú=*ªz%íhe¶ýt]–†ÔôJÎЀÚQÒZ–ZûîŒ&(ÊóRìïWkYR*Ñ1E8JÅ#ûñª¤®Ùìô"] +³Ó‹]²×ßÎvIc÷gè›"œ±û3øhÔzùð$}S„#žÔ¨õ\rÙ$ÝS„#—MryÃf³U½ÑíÏv‚ï@1¤õë2ÐÍ.-Ì›°Zl(•Œ2ÃtHv¤’Q¸0o„³0o†’Þ‘I@Ò;£¢Y¡”¥¨hT)§C)K*å4´Ù@(e)6.Z,ÖPÊ’Åb…ó“·× ƒ`4:)Â&ãŠÿ#|‹Ùd#´¾è Œ‹ôõzž?á 8Ðl²„RÅ3›,0ë9ÞoŽÄk,ÜMÆ•Pʒɸ‹JÓÅ"úµ#ÝQTšiñ¡”%AZ<ìÎØî-{I`æñÞ!ŠÁÐHT †¼lÐß:üU ãñ_Þ|E E“1º7‰P Áý«S¡cUÙ ÞhHTy÷t.~°*i_.Ÿ³-"8×ω!Óny[›°–¿³·¥±?@!QÅÑé¶nðxÉU:& BæQùک㵊S¦³¿‡D•Ú ާë$å¤&¶Ó¬ô¡âdCt¶rh' '~K—÷\;ìRçkN~"ç÷Ù„$ô`áº,Ú óR\ýQnÚ.Jo}ÿ_¢"OQizeMŽëçnmQe×–—}y""ÃÛ»lxÉ­$ƒÎøÑÉ‚³-Áp>¾ô’;û¤'‹¡\¦m:+±Zƒ«sÉd2j/x0NnbÕN>9s;xrÅpN7¼àÁ2 ˆØu5j}Ýû·‚a\ED†×Z´é¾ ¢¦ê€×@wõÍ¢}ÖÊš«Õ¨ß+a^ A=`«´†/Zõg£B˜Ç?Võ¬çÁã™m$mƒ’Þ_ÏÙ!dïtt¥„üf±HÙÓ­ðE1ä 8/—í"¾É ª[²º:dwRykòŽbȸa‹4ÞÙ8gÐïÝÿýžúÏß´[5ºDE³žÞ›ðÌ~ÞþüM÷SÁ;’‘JF‡ªÇtºÙ%ãҲ냉D„ÇÆEðRb3²IlºòÌÿ8 W>2½IEND®B`‚tenmado-0.10/happy-L/image/disconnection-core-damaged.png0000644000175000017500000000273210276702754024152 0ustar00ooharaoohara00000000000000‰PNG  IHDRFFþLuÓbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÓ  í2ÅÑgIDATxœÝ›[L[uÇÿíù—Ó–RºÂ GE„7–…Mä²È\†˜8•©/d‰Æh|ñiO¾1ÑdáÅlóEæ0]°ÊE¶QwÌ*ƒ®H=ÚË [[(½ÑúpH)½q8§·s>Om9‡þ¾ùæÿëÿüÿß?/ƒ´b!–­Äʃÿ>´»\ŽÕ5·Ï·îßnˆ ¢‚Â"T*—ìQH÷>¶§\U¢T•¦·^Z$9lΛWõ‹F«gÕGãv±­¬)o<^//+f^ SI÷ÿ"ôçðEæ¥4Xeýs5µ‡TLþ }IÃ&Œw—66BL¾>!¯9¸¯ëfz·Ó‘4«3Mü‚ÛÍè}%E²æX]CÕnoÜ$Â`¹4IoÀÐC,A;{›Tj%õ[v! 3\ûîf0°A«6ú@ÒqºkQS¼žª¤¯>ºâxàfPSä{‹Þúð$•+w–äq{/÷kM³–tƈª:婾vq‘0õe;H" –Ëý¿e¢­ÑAø§úÚR­T’v×÷Ÿ_sØ\¨>ò2é+ïtÈÒd$•ä°9/~<œ?þDƒ ü3t%›j$•ôͧ#ù0~’QU§|í½Î„J,)çý Éz Œÿ3˜MË™/‰)æU>fˆÿ½Š•D,ÚAH‚f«0Fhuò2iLŒ•¤YÏâ|‡9ºÑ™IÛÆ’v`Ÿ¸Ÿõª˜‚5×¶÷‰¼ÝæÒ¼~‰]‘Ìë—¢%m¹4|ab'rTS4˜*ò|µå’yÁÎF‹HÌ öÈëMIãC¸Û¹Î–FÛ¹>>„?ÿ""’ìK+쵈ľ´B¾€‡ÍIm쵈„0Ú6§¼¬ƒ•í‘릤[×õl·ˆäÖu=Ö¢†€5§×»îÏu=i ¼ÀY‰‡ð¸á`Vg‚^Ÿ‰ÄëñCý”‘3ôSFˆŠ ¸ä**€ÖÅ.¹d]\á0à’K…R …B\r) Aïš/Ýû€¹„ÇPXÈ‹H`ÀÌþfDæ€ P(@,}±XT,Êô~^6QTÈ`0À©Ž „`uýãÓ£÷r]IÚ8ðL5 úƒœrÉ„X«gßrd2°V TªJ¹ä’RU ªš²tÅKr‹«ä ‘H"ä†Q"‰’Úº¸1œÚº)I\$,)—f3s’ Ä”ÌlN…Žõùá‹Ñœ–Ä”on_æ¯=¤’‹òsÿœ ÂDÞ¶&¬-'_œÌQILé:Óy½% kQ]¹ÃF£„½ ½í±¢ãtãOçµY/‰)/m~»MR]CUÉϲ«õ‰%hL 16Êá°»úÏ ²å9 ¾sÝ1y¢ØçY¹BZßXÍ–M[ ¦ŠÏG%ÜŒ\š¼ó»!+UÑçp«º³·)þóÄ«½M 3fŸ7áªèƒ  õ€I/Ûûõ'Ãù¹,¡¨½þ~W²ødªˆ!a° ž×†òlå’ÏãuŸmOœÜ!ê°»¾¼‘?^)*d=o¿"2 ¨Äu6ç·Ÿ]͇q… ¯¾{|ÇsTCÕ9ïÉú[ûTt*"ôûàcݯ3™h†Š YñýÔYÄÀôHÖø>sûŸtMÞÅtÿÑj2°E›ôœó¸½œXø{éß9ënƒ.BQÁšò'ìScªÏSP!=’¢™Õ™L÷ÌË–Gk.¯ßˆrÂ/@…Ra©RVõtCW©ù "à ¥±"3m¶*C«QÌ#Q)cx>•f2[êêû¾|õFø^ /=7§`s¹RW­_–NëýÆ®æ7‘?zÙ‹äoXU-—Íþªúâ`+f!&"¹láá}2­fJZ6ƒ±íüµïP\œ( *œ¿—vå²µ÷Àœqb2C©X}¥&Ühh­‚xzìôVS‚œ(fë–ž:ùüˆ´ˆAÏ£û‡ãúâÂ1 ®½qž/Jý¿VÓ¡“‰Ž“™Åº²3Ç'Üœ¨•Ð| GpžAæ…Í`ìíøœ\%èÅl#snŽi¹löw—o $3’¯xwùfF®š^ÏÆ´:|ø+N´@ÉÑÔÍ`ìn5±*ŠîVý*Z?Þ¶³*ZcL 3™¶[Ø ÅÏv f2+u…à4âB¨(œæOJ]!B’ä5Û"¯Ÿ /…·¥áĘ·¯Ÿm™qà Zë¸UL¬u á!ÜI, „‡@GÛ{®EËÑö„sÑš–ŠÂa—kÑöx!ñ×MŽreu @x<ÈŸ.f[#ÐOñÝØLˆ !RBù,‚ ”ªUÎV¶MÆ¡(ʇ~Áµ™è÷P»ªìuõ¶MơݻŠ™\‹–X‘ •ºB4]Úÿ­›m™Rõ¬@(’˸SÛˆä2@m_qö`KÛ>Öß¹$Q)!@¢RJ³UÞ?8ÛJM“PMÍÀfÿ—¥ÓPy˜m+°²¶šj6dYyé¹9ñjùņH.£[˜c­wëáÖJ¶¾®»]+–Ë—ô€X.Ó,+ýö¢…-õ"=í‚I-g/uÖ?N²S^ù }Õ¸¥ DÛíÞæÝ„Û“4'¾8ucÝÕ 7ChDÓÁÉ)+Eùe5'‚Û§¡[ºÄ §~çDÇŒ/N-¿~.¸qV‹"¡yœOL`¸€¾ª‚%17Õ‹ô“8HWÜ=®ök·¿´þ¸ÕC/º^zh³ÖV£Õj,­Dm”šìV(bô^î\ ¸÷óÄ=w;|ö½çÜ{Îï ‘H¤áÂ}Ãv¿óñg,è™ þúÃ$ ˆÅ¢e ©º[aPW)W¯Ã´ú úGÒÒò8ú–Îé±ÑH(œêrC©q»YmªÌ¾–oÄá|õtÜö.õ®PTÓ`ܺKYfÊŽ–ß9bïh›™tg,ÄUiÖí=¤0–-I ·Z¾>zšÉŠP‚®Ý}@߸=C­×OÆÿdQˆ¬hEí©Ödwk…(òÓ½žA[ŽœhÔ5ë›O Eâ”´¨` ûÒ±ì>¸d%h]Ë-‘Tö­Þ;—suEMõ‘s jåt<%#~œAönµL}ίL}ŸÆ­öÜŒiù#ÃÛE˜<ÿZ€áÇírCIô}Ó{õŒ"¦9qŠ ”ï?Fÿf´p«eb ‡«¨h&z¢’ÑrÛû¸*ªÓò8ú½_¸ŠÆûeÀãèW›*!À;dçCT4Þ!;£…[_ð!*Üú¢Ì¼.œôOq-3…Ö'ü‰Šæ‡å Ÿŀ Ð=hã[ZîAÓ¢Rš ò-­ÐLΈH$ÕÝU~@„2ŒkÀð•Ÿõqê%(ŠÄ(âÚd‚@l¥Á;ô™k“y,_SÃÉ·™¦H¨oÜaïhãÚdúÆ}Uò--T]Õ¦J±BIüãZ†Ó˜õªÒ~×> ¨Jèí+áÂßµâÚ‡¡áR¦ÕC¦Õcºb>,ÅŠº¨Élö}#Ž­§¹¶N\£Ë…̆LYf’J²UòË T¥‰–0c¥‘ऻëÂa®¾B Zá®T¥¡/c›}©J£«Ýìêͼh»´Õ Q'_Hr<¼÷óíó<;oÚijjf·$(»YÏœ òæe²Æ+÷4&Ð Qdßí‹ùYV,_S^uô||ù4qI— Þ_=žëÌ L¶ñÌÍøÂiR-šœŽ³øñÄ&»055ƒH$sS[ݰˆHåp%8éí|ø«ûuV„VÖm)57±ßjÑàV‹óeçR¾›bEq›yñ3•´µhþ»ûÍx_Wêë3Lg(ªª×ÕmNë`1=­(Gÿ¸­kúçèì”/Lβ;AD –H ”òâÒ¢šú´Ž£ü\W£ÖÁ~ïIEND®B`‚tenmado-0.10/happy-L/image/fear.png0000644000175000017500000000212410276702754017715 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ 1Pœ…áIDATxœÍ™}hgÀßKß^sÍ-IcM#1¡¶_­®lÇ6E\'XÑ)E(ÈVp-2˜ÿ EÜØlcŽÁd›¥8tFÐþ!*º´R«ÖjCâÙ´©µWc>.—Üþ¸pù¬KÒ\î~%oÈñã¹ç½{žçEX–ùCú¨{O½öñî©—ÞÿL ŽDåeêJ9¡Æ «-hZBè«U\ÉKËêôœû÷Ã;ÅrüK™LVGhv½»ÊT«+¾Ö}r²·øúCwî—Ncý CGËÊF}Mq´ûº/Þz>ûº`¡d´JÅ—[ß{{Qõ¼´Ì6ûwW‚4S' …_lZÛÞÜP Ö_.y¦g‹(”ŒN£<óÙ–¹~Í®f˜¯z®õŽ äÄÑR¿øäÎ æ¤åÑû~¼¤#‚:q`hùárôÿµºþè:NÉ´Ô/>½§-m1]KÐ|š‹Ì öX†¥UÉôX†¡ A¤“X2ýŽgR‹V¿ãDZ´*Ñr #R‹V€ŽÀWA:VP«(2oaé•¡€4-nc30 QX&¶I @ Q«¾ëöŠm’ÂÃLTj;1ÌDá–æ†în‹m’BçÆH¨q©E‹PãÐT«Óà˜ëùŒØ2qŒZu¼ Ô*Ò©m´Jà2ÒGíúþ¼Ø>qÎ}¾C_­‚}µÊ°Pýòµø«R`ÜP3Þ¾Þ'';½,¶øéÓÍܸ0Þ5êkêM±F~…¡U*øf¢ÙŸ¤üŸüð·XïG …Þ^£Â¹¯‰f¿F…ظôƈK­u˼È$6[.X•Øi›iYW{kòJ–±[Ç·½þ]2'\ŽöéH[Ì¢f˜cgûJSV¬1_ïmËŸféúCôþŸ/ 3\ŽþvpkæàtN-Aó,3Ÿ’É2|æéjo±¬{sÝrãœ@.‡+“”ÿ̵Á+CŽ¢mZ]w`Ã;ÉÏ‚µ8Ì6{ex>ïÍ*¶³uå›ÏTòÖâ }Tß½'7¹s¯ÏŒZõË mMKó:XÌO‹Çêô\èvx_Lûƒ!šaAâ"@ä(ÔàX±`ý C^Lj<ÿñz¨kˆF;YIEND®B`‚tenmado-0.10/happy-L/image/fear-damaged.png0000644000175000017500000000205210276702754021275 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ /eºø·IDATxœÍ™ïOqÇ¿'ß„s’(a J&mØÊ²S[kýZͲ¶õ¤µµÖÖÿQ[km=ª'=jÓÊÕÔZRs“œmÊê&G hÂDà¸Czð½?3@àîõŽq{í}ß»û|>_,Nƒò …#ž`ÐZ[ ¯‡767 –Kp(S+•š&µ^£5¶èÌmm-²‚ócei¹iÿÄüB`m}kk«Ä¿444tÚþƒ]–vcõµ¼Áå©§Óó³ôSça3ïíí²™ÚZ«£E‡V‡>MF6c eCªU×Nöµ·ìÚ‘–ƒr½žIr\Uœr/Ù³vV¨õäõÈZd£ŠBÙèȦ;Wþõkq-–ã^|øèòùkä„èÜc¼qæ4aIZq&ùhèu’ekê„ãø½kWòÿk=¯uNÙtî1Þ¼p.ï`¾VM×Ó¿(\g9×ÕA¹|+«õU€Ø ã \Ù÷fF‹­ŽÍ̪ŠúkÆffwëtÂó,£5íücQœë§úÑg^ËA¹¨_>±¢BP¿|Â¥äµ}´¸Q -7í_ú7*ÄÒï ›ö[Úà ¥ÂòZjQ Q!ÔâÙž#0ŽDãq±er…#prÞ)¨“óNˆa˜tÃ0èòÑRKËå£!€ÔÒRà8dXVji1, ãL2 *ik0XXJÈ¥RÕmlvŽBˆË ”ÉÄ6ÉÔ7“žÀ²Ø&9˜ ­K¥¤v'r©ì±vO|Û$‡óÖ£PKRKKKÐÒn$TÊ•õˆØ2¤> ¯Ê]í¨çó¸¦QÛ¾¾\Ÿû7¼¼ ~JV!«UÈ*d² Y…¬BV!«UÈ*d² Y…¬BV!«UÈ*d² Y…¬âÕX‡ 9¹^IEND®B`‚tenmado-0.10/happy-L/image/horizon-purple-damaged.png0000644000175000017500000000032710276702754023360 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ :§ùaÌdIDATxœíÎÁ „PAõ"ˆi‰q˜¥{Û „þà­ê:Ì£çó¸¦QÛ¾¾\Ÿû7¼¼ ~JV!«UÈ*d² Y…¬BV!«UÈ*d² Y…¬BV!«UÈ*d² Y…¬âèéãV¬IEND®B`‚tenmado-0.10/happy-L/image/horizon-red.png0000644000175000017500000000032710276702754021243 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ *ö‘ÃdIDATxœíα „@AÀÁƒ„H I¼÷>¤> ¯Ê]í¨çë8§Që¾½\÷3¼¼ ~JV!«UÈ*d² Y…¬BV!«UÈ*d² Y…¬BV!«UÈ*d² Y…¬âþ‰î±`»IEND®B`‚tenmado-0.10/happy-L/image/horizon-red-damaged.png0000644000175000017500000000032710276702754022623 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ :²2dIDATxœíα …PQŒÄÚìÂ"mKŒ~ò;æÙ9é²—™¯ó˜F­Ûþrý=÷ðò2üù)Y…¬BV!«UÈ*d² Y…¬BV!«UÈ*d² Y…¬BV!«UÈ*d²Š?–˜Óù…tÕIEND®B`‚tenmado-0.10/happy-L/image/intuition.png0000644000175000017500000000235710276702754021032 0ustar00ooharaoohara00000000000000‰PNG  IHDRdW}nwbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ  Ñe r|IDATxœÍš±vÓ0†e9vÚ°ó ¼ÁÆÈ‹À s׌iÒH—vèv“‰“,p  .­«Hö•ôë^ýS)¶üUr¾{¥âááAe–UÓ*¥Þ¼}-=3E†°>¾Ÿ+¥¾}ÿ =3ZzfófÛî·í~1o¤Çb&/X›õnqöÈhqÖlÖ;ÙñÉ ÖÅùí¶Ýw?oÛýÅù­ìxŒdk³ÞKo1ÏkreëëçKâ?J%XW˻Ό¬šöjyÇ?kruzrðs²€Õé‚ëÓ|4BÖf½;§'79¼éåaý †u¨ ®ä °¼Ì@\#$a­šÖª ¨ß‡GÖ—OK†ÿŒ¬a]pEV#d`õ» ¾ìFÈÀêw|#Ø€µjÚÈ¥´˜7"ozXZO¤`ä†åê.øF¤Á 8#ø'+¬0]p…_#ø`Qº ¾aîFðÁJ´j8#¬UÓ^_Þ§¸òõå=›F0ÁJú÷g›\°R;d¼åÃ+´ ÌêŠÖéÉ P\Ù¶{†Å˜½k†¾sZXÌíÔ·K‹í½û”Ôß$ a‰4’Þ4,TwÁ7I»©` PHwë$°°ÝߤëFàa¥è.ø&Q7+‡C *Í0À°øuÁ•†%¾û Kj‡Êø4‡Âb)ý½‚ ¶» ËB—Eüu°Ý ,xwa6«f³ r)`7 û*­§e¡‹Bõ´„\5<,ìf„ÖÅôhÒý\×X¨M ,쳪8¹ ƒŒ……-uiÒ™M´Æ¼éãߪQ°bΤYs|ly©W Å . VÌ™´ÃL*mÕ…zZ¢&WdÁ ® Gÿßë‡9ÎC#ÂaaO¥wºàúå¨*nذ°GÒûºàŠõu˜‘ÂÂêÂ()eû¢ NðàC`ÁuaR‘†rÔ`ð†×z XV+1aá « Ãïuëï j„,l;Më"`eÁÕ¿Ué Û]¨j¿iÕ¥ž–(ð}XØMfQ$5ÂkûÚvZÅH9ÐQ½Š « ®2TÕK#H°à›Ìe 1Ø>*Q#H°°»»¾ºà¼NÑE~ÀqXp]@‰e¡ f‡…]€(R]PŽªh9 ¬ ä2Ôä¢hÄÈÐÁºò£~8uV€Oeõ7Õ',¸. ,‡®îapÞþ^‡è‚+ñâö”·Ã‚o2£Ò £l_ÛaåSÒtT×ã[`aϤ‹ÞáÕåá6XB]ãøÕ Á„…=“†*éA-yë)¸°°›ÌÀ2Ð㦸U¸}ý¼k ¼=À:Áò ¬ ¸=QÁ[ñ +ÿ2`µÐÇò « éÊ@b€ŽÚ×­l2§+éAT½ík­Ð›Ì©Ë@zPß0OÛ×® Rïõà uÞlÖ»òïÏwÀi5{Ug2­ºL&ú÷¯?Ký¸Ýü[¦‹‰“^IEND®B`‚tenmado-0.10/happy-L/image/intuition-damaged.png0000644000175000017500000000242310276702754022404 0ustar00ooharaoohara00000000000000‰PNG  IHDRdW}nwbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ /á Öä IDATxœÕš½nÛ0…ù#ÙY»têV ïÐG ú Ò°d‚d‹“I¨‹ ðawJ‘Ê,‘y™3¶A]}¦èÃsÉ_^^Xbª«cìÛ÷¯Ô…t%¨ Pèìøòìø’º …’ƒu5»Û®÷ÛõþjvG]KWiÁÚ¬våù¼y]žÏ7«m=¥«¼˜o×ûæõv½//æ´õt”¬ÍjWtÊ"­É•¬ß¿‹ºòM*¥ëþæ±®–ý÷ëjyó¿¥RUœ\;|YIÀjì‚îÓtl=¬ÍjWœŽÌâô:…•ž–¡?HÁFÃêÛR°ݬœ¹ „UW ¥]ÐÙT¢„å-Цd°†í‚N´6‚V;]°aA«.ØŠ0 €UW C» SYÌIVzXÅi™È ¶Š K—.ØŠ$ˆ !ÄO#¢Âr³ :Å·ñ`™¤ ¶ŠœFăhI޹ÒG‚UW‹‡Û§#?Ü>E³‘`ýý£M®°®fw» S]-ã¬ô1`9o“º‹kvRí‚NÛõ~vüa Ë<5öW„Ü9,¬Èñ@èË„åŸ.Ø*tI0ô¢¡`¡Ò[M#BÁ"< îÒA`aÓ[…K#ð°B¤ ¶ ”Fàa¥p(…) +¾]Ð)„Ã"± :Á‹A .Ø žF aÅÙú[ [ 6]‚ ÁýÇÁ¦Xðtaz”OrÈPÀ4 »”f¹d‚3Á³\BD•€…mFÁóiÖ¼ÎA°PM ,ì3™µá&¤H_XØm <›Ðɧj¥÷·^°|Τ)5™*õƒ¹æ!ÿSp^°|Τõ%3Á¥be‰š\žFwXp»0™dÚT3ÎAž6ÂöTú«]ЈKŒGe~e;²=Â>RDË.脚\>‡éaaíB¦ßÅ%½p· 23*åQm„5,¸]°Ø žÌA¹ÙkXX»0¼®+¾Oj#ì`aSc!¸Ã“ó¨ö¹³,lº 3»iÕ5¹˜ýíXÀÂ6™ûÛ@sm„UûÚ¶ÓësÃ@juS¦°°vA· 4*Gµ²F°àMæm ©9ªiûÚ¶»kktÊsØJoxƒã°ðvalh<l#Æa› þ6ZT1 n ·æBM.1Rz:vA'ää»Ù!XX»åÒÓ.è„ú Fm„Ü. –¾¸„=ÝÃ6B{ 캞O2ˆ]Ð `ÜÞ4pãjXð&³ó6Ðø0:оVÃÂN«ëz_@ª»},ì™4!x u½w%˜GÕ‚SÀ"K½´J]XØ3i¨m ¹€6¢ î¶ÉŒÜ uõÛ×°ð©1…€ÿ' °>Ÿ]ÐØŽí؈XŸÑ.èÜ-´±¼ÂÂÚ…pÛ@Sá(öo—Ïyh~ù kðkÝã/Þ=ž'kûë?$Ãb¢ìÂê¡â¤tV™(ËífX‹'ò>Ÿ ÊS"µ¸qÂí¦Y§×Œ\ÏqÉÙ< œ^3x;ÍZÙ=SÏ“ Ç@@GbeÌŽ7HGb€Y[Ç—j{2Á{¾ Ê^0Ñ‘˜ø5 Ý<Бò])4ψ‰¦Uk5¾«0òÓ·jcÒÁ&ðÓ·(ÈDÕöðLd¢(|Çæ?AðM¾cÑ=W<Æ“¿ß©¡ 'Ç2P±¼f¤­,WXƒ“ÇȨ×)©ÁÉoªÖiÕüÆ›¤ìÉo«Y(¤D˜€"LÈAÖ(q&p5ÈÙ`U¢Màl°"Òb¨¯5–ŽÉü¡Š´ô8©1Á €öÆ1q¤ÅÐç¢JÁÔö¹ Ó“ÏXo‹ê&>#ÍjµƒvuM]Í$WÂÌLÕ“CmUÚ¥&eLÀmgX„I?=Ú©–iê[;¿ úba3ìvŒt7)oúê²e•R³×[3ã]îæ:%M_¨Â"jŽeàÜD¿Ë^ðŒ$Ídûdš›èŽËSÒ•ü=PÒå"².ù~*¸ÎåÍväÿôvNžæŠ´g¦ Í.ÂV”„ùNÎV?\ã.tó ~ýTÄÆÐÇos>ƓܡjæýmÎû^t6¶4IEND®B`‚tenmado-0.10/happy-L/image/large-ball-purple.png0000644000175000017500000000171310276702754022312 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ  &šòã®XIDATxœÍÙOH"Qð_¯L AÝ]¬a [QÜ¢h!ëÐ?"<téìÉC§Û!èÒ%èÐ:uðÚ©KP‰èß¡ìE!‰$ì`JJEMHZ¹´‡çŽ“c6NãŒßÓÌgø ã¼7¿_Åëë+Ÿh˜>?…‚·—ÔÝu,Aß§žŸþ@µ²R«SLšRo±ÖÚ[MfB+àúE±¢azw#äÛ£ÂîyžB4êœ=dï¥(_Và,¾¶âßß¡ø_:'Ý}äȘÃÖb‡uO,{Ž·½‚Aìô»šÇÝíuFͧX›ëAÏâa*™Å„£RW¹';‡­YK ÞÕ€ˆ v\£¶‰©®÷Žæg=?¥çg¶Ž|‘™p:œõÓsÕÊ*^¬ç§ôì¯ ÿI¬¤&G›iö÷W†¸ŸÙ’Æþ“ØüÌw<—µ´pPêß.'G¾ÈÒÂAÎàÖæz°t÷xxW›ëAöH–uOx%'eâY<¼‰'˜Ý,kÙs,î󩨤’éeÏ1³›aÎâb=ÇgÛ{8‹ãí kmÅ/Ÿ'† ¦?3‹˜ý*¦³v7Br{²Á¾=Jf +ƒ¢ašÿšN‚\E¢aŸJ4Ïð‰BÔ5ŠóÓ oåÆd‚M Þ¢KêNnË—ÔºŽ% Ÿ AØ&¸Ž%}Ÿ’$_~¿“+\Nže dyϨZY)±§€ V§’RƒSؤ®Q ƒéƒ7IÑSØ“5zÉ@Àà ¤Y¬µÒ€€Ÿ ,ÖZdo5IÞ&°·š™Ðºò1龨̈́€³‡,üÇ è²”‰‰Á 0Úî>²LßÛ¿â¢afòsÈnb32,[‹±ßÕ,¯©£‹`J˜Ù©zÜÝ®Rç)5IcÂf;˪3jÜ“r™~Nü`Tß,l‡­®Q›ô¦îþ¦œRjîzkbª«ÃY/¥é›ÝÀ-¢æYNÏ 8ÚŠž‘„™ˆ&ýôÜw\œ’®à煮’.žpÁ÷SÑp&¶ ÿï„· p 4W„=3Eh®0á¶¢Ìwb¶¢ØawW‘þë§6î¸>v›3ùøÂR×(>ßæüw#^¨l¿ý×IEND®B`‚tenmado-0.10/happy-L/image/large-ball-red.png0000644000175000017500000000171310276702754021555 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ 4«W{õXIDATxœÍÙMH"að§wÓÔÌ\ éÃbÛHÚ ‰ êà¥c‡=Ä.]Ú[í©ºÕ%è;vñPKDaHBØd™네«A{™™³qgüŸfÞÑáÇ8ÎûÎóTЇ/ÑX*N>ýK€¢R©Òi5Fƒ¯¯¶Y­-Z³IÀù+Šb‘D$äõ…·ý/Â<¿¢·àxÃêråã˺ œž¬z.¶vøŸ:'–Þîæaw­½IV"vw°¼r¾±)ÄNÃ@_ûèˆÆPó.VpÍ»·°”I¦D1QÁÔªÎñ¶!—@–~ñ̳."ˆF÷ cbìµ£ùYOé´oj–ØÝ/‘‰Š¹«Ã93©P*y±žÒé?¿~ßJj¢R×fæÊ÷£¾©YiLpsðMÍrÇsYþùÅRÿv9!v÷ýó‹9ƒ/XÁ5oéîñ9ó¬×¼ì†•ˆÝí-,INÊfoa)»£wÖÁòŠ¸Ï§¢’I¦–WèÝ,ë6p*Ös\pÎ76o§Ôv–u²ê‘ÏÄf ‰È{æ`s±µC X!¯On ƒ ¼í—Ä ’ˆð_ÓI‡«k’ˆ èѱÜ&0 «RGŽÑ}0$7&Ê÷ÁЇ/åö°L_¢D4&/^š ¡Tœ”d“ˆz¿“+\•<Ë@Éòš ¢2ÏRZ‚0Ré´Rj¨6aUj¤1¤Á[&Ð H‡×K&Ðáõ¨Úf•üLPm³"ck‹ àmck ÒšMz ^>&õG½ÖlB€÷8ÊÄDcX]Î21ÑZ³ÉÒÛ]¦ºöÏTÑ0;ù4»e7±YV­½©a O^“¹ë+]Âd¦êöÑL­’ËDèm†¥1ÔtŽÿËôåçwvAõÅÂÆ6äjtJo²ô~Ë)¥æ®·cæ®)M5M6n5Ï2Ð93Y×f—Ƥÿ„;g&¹ãyX ¥²nº¨k&ø:å-œ‚(pÁ÷SÑp:o¶ ÿï„· ¨h®{fŠÐ\¡ÃmE ˜ïÄlE±C7î®®ù¯ŸJظãúØmÎÌc’>„U©ßßæü€MVžŽäøIEND®B`‚tenmado-0.10/happy-L/image/last-boss-demo-0.png0000644000175000017500000000510410276702754021767 0ustar00ooharaoohara00000000000000‰PNG  IHDRZÙ—ýbKGDÿÿÿ ½§“ pHYs  d_‘tIMEÒ %…ð7Æ ÑIDATxœíœÝ²Û „ÝNß»yóô¢­‡áG¬„Àïwq&DZ`XƒMòãûý^„ŸO „!$ 4,BHhX„0а!a aBÂ@Ã"„„†E  ‹!$ 4,BHhX„0а!a aBÂÞ°>ŸÏ²\óø|>Ñ+’)A„í#þÒˆÙJöÛøõ´€gøüçi!ÿø«$ý‹g\S‘»ˆMÍ]ϼ–,cújv …—Ö•\l÷KnKÝôÕ:c¤!cl°PUöyc>‹9£K¤ÑðZg¹õ„æÃJ;Ê,&õƒ–†» µ5Æ> rCÅA=™6ƒ‡– "q»eÚ¶6sß¹¿ÙùÆäwBz°ú¹•±äp1‹¥âbÆÇt3–„°BqZ%÷RÕ/HÕ¤Y‚zòl¢ÖMµã¶ŽÈÖÓêdø›j»ª€é…èJ²I-ëþ…cPIZ²^^-‡Õz$', ¯±·lΜ[EgK­ê©{±PžuV SJZ ¦µ<,“4ްDó.n–S9Á°‚º• ÃC sAòø/?gYºž{i†nͽfx ~_é¶Þ çžÁ!†eËèÚg¦`Pî;ÚS=­²ß-sެЖ‡^…a C,›¨ˆmXæK>i´x”g­îÞ:XFp”ZF>\5kx¡1…ö´…íÆïJK?•؆U¥{Q³Ñ½´,I88•îÍ`·Ÿ¤gänªÍ{@7Fyú©¿ò%ÑWù&¸•fPÒš ƒe!ÙÁ4Õ6G<‚ë‘KG"È)«]î‹õ:°î¸rðõèaD5¬V×Ì®bמF†‡6——GhSN-¥ÕÂ6ÃÜÐ5,Y¼P <£J!Ò˜‚ÙJÜ–¨†uÓºMáÞ4óª ¹´Ù´²cæþ›ŽLCûƒÂäö4TÉÞõYR– WØ û»f[­RFZf4,[¤§NÂ<ÆT¹G²\:\Hà®M‹ÊG RÁ¦ÄQÀz~|¿ß§£mÍÎ3Ô¦zƒ¶m¾û3 ‹†ð?à·AoYAe§Ì®BôùÈy¸+ ÈÆÂuj&àRy—™-T÷`v6ýëK3úå^ ËB÷ñMkl vJws´ðçb.ÁgdÄ=(»šÜ¢@òPÚÓšµÉÍ`¨êç«=•°ЍŒ>Í[Žíò³a5’¸•=­µPýò”ËÅ=Ö“hïÆ`onùNVPÕ˜.=ùºg5rÕ©[F†Ç·É¢U•Ѓܡaé躀|Ùx–‡Jëi†Y7e™@6ÓR›×˜—E¶Ž´š¨L/_z–Oo ²“XØy,oáÓnðOlÔ6$¸Ïšwf"–m=Evô ÉH gXv›g9¹X fY¡UUHúôHëßÖTh%å²:/æqÕ\¤ Ëú\Õ°ªCÅQªlÜîÍ’šYH¹ÃU{\ChXj~™l6ªYÌ2ŠÝéŒod¤hÙ.w»j;CÃRã2aq즩UeaL¯daû Å3¬­ê{,O?D;ßò·=×>áÞ ´Â‚ªF!¶'ò\\[–œRh=>J÷…3, ÝGõN+?ëËE–$`)­é˜A¡ï̬B5Ù¤iNwYgÈE,<í˜' :iç5_Ík{ó”AžFö N.ºíS–6&r<“!§ÉÅ)˜ þ¼Œón¤wX<¾JL6ÃBeÁS¥ØTÉ"gO‘8 SAÃr€}Ž5а!aàøBÂð Ú·^3GßâÙ‚ûʰ%Áý”Ê¥jçµÏ†p[Ã?lÏk‰À>ö%éfŽMÔ–ì¬m1çÖ'¡›ò¥§%uxú5å:7Ñg»ûh²#ƒoý»g…ô ÔÖ©Öέþ®$¡Féßô”\•08A« r o1,|ÌŒd‚à›kFtŸB÷š,˜>Hún)ónÚòŒ uê©DuFÓ:…éFà¤i \ú“õÝêçÖ r)]Ðói,Ž6'õ èEv-%^ ·2­m–]“r/Nv=Ä(˘Ý#HvÙÒφn×wZ·ÊBÃrCžÚ¬'µ52º¥˜•€}kê5ÉÊzE{'|†5 |ŒM—2­è#ÐÝ5\hͤä©ånµˆgXSÝ;W*/WUHšV²eɸ7:4¬'A¦òøt9YÌû_¯‚Êø.a³Pøúñ®]7‹ÜÈuìJ"}žÞWq&ªíKÂþ n|·’QVÒú:\L¶ã̰ɰ/¬õ+wƒJ´ªˆ 4¬Yà›IµõTemÂ.Ç®+ §TUÆ+Æo%“]É Ã–¦æk"÷*À¶ès×Sý\&+Ï GÊôøbS»,´êO¾\ a‘Ãq=BþBÃ"„„û°!a aBÂ@Ã"„„†E  ‹†?@½J §IEND®B`‚tenmado-0.10/happy-L/image/last-boss-demo-1.png0000644000175000017500000000255410276702754021776 0ustar00ooharaoohara00000000000000‰PNG  IHDR2ý~ÊbKGDÿÿÿ ½§“ pHYs  d_‘tIMEÒ &ʶÌÅùIDATxœíÙrÝ DåTþûêÏ•‡[¥È,CÏ0€€>.Ybi¶ œü\×uBÈ ü-€BPhX„i aB¦†E™!dhX„i aB¦†E™ùÅyž­£²¨Œ.GéPdâÅßѶæ(‹I6ÞPE=õE¨Bb8ưÌéÏ=_xªäó|îÐn–O»â§q‘ÁBÅáÜÊ 9ŽŒCñ¯ÊÜÁ•]QmLXÍ;¯œ» æegôo_Þ¹F–„ø}¡hà*øó•UHy½Y\-ÞׂHUýΰHˆ0Íñ]Ú€K6í”L߆ªrrÕå^“û@Ã’Ðöª·õBƒ~CªÀ¶ú‘—ŠÅE™ÑÅ‘ŸÊIÖ+xCß-¡"‘ù‹a†U,QìGE©xîÄÿ4‡‡ÕŒX^ãÌ«ÃÌÅ .¾NÚŒÞD{;ø~­6|ü«ûÙ•ù¦°s >ÒîÍÇ›îª r9k­ž+*©âæ=ùÂ%aá½—¼oÿü™Œb›;hõ$Ã$W[Bô PrueK­˜X¹– û̈“)?ÿ›¯qø í$%ƒ!wÀ…¤Š ÍöŠ[UòÚEÃVа&£µaÍ‚jx³Ò–†E™†]¾Îø‚í£Yµ³EÜVH¸éþŸšý”8Jÿî»äÂDZ>]ÚwK¶¬5 +ÙºÅÏ ¸‘ŒdmÙ*vÌEHð®\5ºˆiZŸxûVÊàöy;v1,Õ;J,,‹ž±ê_‰²0ñ\ÈšÅce%.5`‹®ªŸØµ‹Ú|«n/g|¬.ÙÄò:¨=ð™»ïr<êˆM6"É [[KæÈýà0ínldXHKWºÕóך.õ4äÀwŒ ¯ø(H¹ö¥˜²ÁÍÁ”‹Qj¼ ?ÚÖ›’ì²$ÌÝŒxíËxMÔ‹3ÿä Yt<ËÿÌ¥/ÔOŸµ‰\´XäóÑá×¾ɶ3ë'ÇV{XH”xö#*{›-º 59’Öƒd¬[ÇÖh¸šÛלWœ©gMÃÒ"¼“;¿îúähp+³*_7sŒ hhߨw@ñõo¬Î½n"hX…¡Ø¹÷tÏÁ¯E· .’bŒ£ôІö½‹“söá…Ú–• «Ïû°5ˆ<ÜqâëbúÏq›±ÉDÞS«Z%Eƒ+†iqÙ?Í9sh§!#›H0ñä,À+qC˜E¸7Vx.pMñkôkÓ_ÑŸ)› |N6$Ï ÔŸÁ©ÿ”.?5¯ùo;ßà2wÂLS/¤ŒhÀe ú“§X\Rž‘e—„¹÷ òò1¼…(æG²<¼M˜aj£Š%7ÁýÔ,>—BeÊ*ª\‚(±l?u¯få^æÙЏïh£àblÃUõÔ0Ø’v ÍTV«•Ô°°Éˆªâ›3Òæž \™Ý›YÙ°^…—aêŽ9Ikò6hX„iXö+!!d=hX„i aB¦†E™!dhX„i aB¦á±qÄsH»IEND®B`‚tenmado-0.10/happy-L/image/last-boss-demo-2.png0000644000175000017500000000206010276702754021767 0ustar00ooharaoohara00000000000000‰PNG  IHDR(_3;7bKGDÿÿÿ ½§“ pHYs  d_‘tIMEÒ &"o¼y®½IDATxœíÛŽ0 E;Uÿþüô¡*bHâl;v­‡ê\œíKbÒôëóùüXŸO ÂÀ€e``À20°`X° ,X, –ËÀÀ€e``À2<0°ö}O4»Í~inHöUõ|U0%vx±àõU·g†£÷^aíûþòc7ƒpÊû_2£ï¼ù‡â²û¿nöç*ëa\.©Šè^¾jÙˆ~ÄÙìÀÂØ% ûl9#ÙÙú.º'³µªÕ/)úoÀ7°§¸²üb#Ž›êër¹ýÖp!Úºº"1ªZ-Eâ-£²Åcõ<šðÜݨç«ëËG¢N)eŒ¡@¿èú®:Ø)¸È¹ÂRKL>ÌùlÍ ¦<ÁÊnÙÆÆHRÎè¤|cÈë¢ÕHÕÏUãú-_Š£îrCð8#NÔwY¶œùxض-ðU÷Û˜euIëµâeÛ6}Iùö@wúç“c•¼ËÆk9ÂöWH­ñ.é~Ö÷Öð²›bqZ‡DùÖUW°Â3Nã «ûüe0ûrÆ+~¾„)ÿ ‡¡Ø”ÑÚEK©ÛYg<Ó³lÕѼ½™”ï妧è¤sÖ÷ûTr~%œÄ¥|U±ÿ[/9ДLË׉™Þ9gË·¥/o¾^ý÷Óí—€ÌÕÚàÀÆ—sDŸM®3jÛ_sÛ¾ì·Ü†1”Ÿe^=¯ÊW'¹Ò/#ú-§÷—ú¦+,WnâÔë ÚN é8åZ%€RMÉë6²üVë\U×3¥ýfë?ÅÛÎÕTîû•P¯ ^årewm¼3«lÑãíÒg«ŒÜ5.«ý!…5c'pÓ]¸nÑ·ý[÷ÿ½Ï†®Ç••‡q‰fªO…ÏÈ¶ÙøCœ¬š‚×—¸ô•cc(ˆO ÆŠ÷˜¾«ßK)[?–ZòÀÒÒWÅš§k£wWi¦ôÃas¤ø$Ëû'£ž®%ƒ^ªÆÕnìŠT7W<б¢Öwõ»QóR? VT Áw›Eî¦'4¬9e¯Òž ˆÜdEvýe%aÇ'ÓH<§VF+æ†ÍukÞæçççj zÊ[£ÏÓ¯çÅ_VôÈaç•QUËj1ͳ^JP¡ÕCZ¸ÂBYY[eœEOÍÄo[nù½6žmYÚ…0‘¸Ú1s€¯º‹‘ ‰Tµê)?t§ýu‘Óõ ²è“Ë‹>Uð´è•x®¡|á kN5CŽ>·_« î§ESÝB½fuðD¬]©•ªVN‚¼‚÷$í\½> ÖФ¶Ñõy¯Ñú‚j´;êAbd[¯ª–ñ²Jªüô)®^âebey±5X9äŽØ·ª¶¨ÈWmr[°!y»ÑöRBd¸ÂBYÙ8Dl:Ž!¦úP~Ý¿2£’j¨×´%ËȼDJÔÂY aA$íy¥æ¶ Â(ÖWظ mi£Ýª|÷,r W/ñrpçÍ ²úiþÕ¼%´i6ì|·Tþ¢SużÓ$#øßÆ"LÚ^L|MQFN÷’î‹ÊÑϱˆË‘[ið‡5ˆ?W;f ç¸'²£GÀ©~ºæêþ ¦›6YÔ›,²¦×§€¯…Éža¡T“§9)sºÐT©F‘ÚU•ã„ßj3, G9mÁ.àÕéj;ŸUµÉ×òçÍÿÍ×¥€†…‰QØh¨xÁñF6@Ã"„¤á ‡î¶Yk´ψâÈ/ßÐ8ß{†¥=?2!_ÁïÚ˜ïâE¸È.O¸6ç¥Ç–Ù3NO.bX¶×¹ó¤óøÄ%a÷³†\׿ï>¨J.ÑMáY¸$¬Ñªµô $6,aD 6Tõžmý`:̺š…aS&ôÀH~íW! ¼ëîD#@=øS—è™&|žÍ=Á°FÓѶÞ?’ѽ8õ¬iÂnN¯Ê‚ùµe Pùcë_ª6ôÒJÛ’^z„Añ Ö/ímÇÀ6%Sm³£Z€ ]ƶ*+¸Ê0­>âMí#Â×ET½¥m áY›lCï}ªO¤7,™ï/ÔUrLkÜg!¶~‡º§à,<ܰd‚ºQ;Ц+ÃÅQ)æŠDç—‹{v.åâz³u?«2ÐÚZr–ù¥¶Óuhÿ õì2´ÅζVBÜÐF©Í=9‘ÉmX6ïØìY£5ÅTnŽÓ» ß½ÝÚ¹D[ßVêºÈsž«²•׋ 2‰ ËÜ?B{Õb¯5»•¬º®Í¿Ù%£§áî4 0¨rÌ–€«.ÂÕ¯ Œ2x)rj® Pýø ò{&æüÝ6—«Ë[ ¶=6—ûkµ=ؾ,¹ÿ›‡Æ­x‚a©^’A¸¨U‚ç\éL*37m›a©dD´Ù­ ž<³%]/[Tro ð3…3²{K»ù‹Ã5 …šŸÈ¯UR6²™2äW©é9¯›_Sû ’JÛ>eäÍ·ö6òó2UßÂ㋉³’=vc»‹$/›±; }«¦?^‘m{–r¡)¨ºýž‰æ!†Ç#§)ªEGÕJÃï‚а!ixÂøB¾!$ 4,BHhX„4а!i aBÒ@Ã"„¤†EIÃÃy“¢09ÜIEND®B`‚tenmado-0.10/happy-L/image/last-boss.png0000644000175000017500000000516310276702754020715 0ustar00ooharaoohara00000000000000‰PNG  IHDRxx¶¡…bKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ Ë+£z IDATxœímPSWÇÏM.!’@ÄA!¼KŒB­ˆ.¥¬TF]ËÎj­«[?Ø·í8îv§³ÓÙ~ìNg§Óî:LkWœŽÝZÊÖµ®¶X•² P1JcJ%ÂK†ÈË B²ÂBy½/¹ÉÍù}‚ÎyøÏÓsÏyÎó N§D†™ŒŒMZÌØ„Å>=ñøæ°Y3v0û8€°8ñ€›ÀZÁcñq‚äød!ouJ’(m5Ç£ûð¥Û€yš›Úoßê3ôZ' ³öx‚£¡ñvÁêYqn¦’œŠÊ2R,$B£GOMM÷Üé»ßcî×ÚflTÍÂႬ<î:™PödNb"ŸªiAƒÐ_×_éºa™ ÷?xR VðLòþƒU ÌS‡Uh}ŸA!×wßÄsa›Ó ,6Øø4¯hsvvŽ8l“†Iè†//µ~?2ÕÈŠWTVç …«H™|¡k?¬ïlžs:Yä6ÄQ\Á>ö‡ƒ$K¢Ð&ÓXãù®~Íc²¤‘,i\uMH”BÖ€¤ ]wò\û·¶èuäå ˆ£l÷•7ö‘3)Bs®Mùã4ñq"­üöm#>Q¡5jí‰÷þ-K |ð’±ãï>+]ŸGdBBëzûÏÑ3=AÄ€è€/5‡e’Ü,Ü#àºáËKõ1 ±Õ¸#q }KÞýíWƒø¦Œjv½”Q²y#Ž_Ä#tÝÉsm—fpLÆ ¶íæàXŠ„¼ñKÞ=¬M”ú`ˆn†µà–¼;T¿Í£c0.û"Ôx‚Gëzûµ¨$OºU DÛ t[úƒ_‡ëѵö/ï´ÏÍpØÆ4Øœ™?¾_äú:Xn½:•½†€Ṳõê@BåÑz«nP“@Ø*f’!µþù£WþX`–w¨8Nq,/3àÊ;T›·äûÿ©­¼Ýý×wLÚ“£qüþ½¢ÂMþ|L.%ŠxêÑ‚Õói0a¥M§…ID‘–xvõR¼êÓ®FrûÁÈG$f¿þÖ½ìoð…ÖëMÌìÇr7yi!ì½ÀàéÚkC:©ñ.AóÒ}ÒûŽ(´^†Ë<<õ¬Èëë>‹À~}¶æ{„ЬxÅþCå^ßò¹]X²æ»†ðA1xÄqàµg|¾ë§Pw[‹¢é5V1ÊDÛÊ‹|½ Æÿ±#§à–^0$¥`µg¼Ù] €Ð&ÓØ©:á%ÿ°ØàÕ·‹ý7¨ pN(¥¤åNÁzxþÙ¶›° pP oÜR–8A6¥ ¶W¬‘î_õÏ—¬Ðfóø™Z9¼cë_ŽÛì«M…Áær…« ·&|qÂ@À0¦qø¸8H•A¨#UJõ¿ÏèñÅ8~y$Û£æ¹BËNÊ/\Sv§åB¬§Ú”ï冤2À×ÜWÞ¡ŠåóòêÓöz[ž|»Í[ò»»´±é×å{¹8TD°«”êóŸëcç9‚€š—C‹ËîàÏ Í/\oÚ9Z²7.Þ²93ßÈÅ­2 âÑ.Ìæñóõ?1û8&]‚Ö|*ø•œWˆ í‚ÁMiƒl)r„È;TßÿkˆIû|,6xþWx^!Mh€òv÷é¿ýÈŒýë¤ìèï¶úïnd í¢­EÑ|ѽ®ÍbƒŠ=þÎJðA¾ÐZ{º¶% D¦f[+²§zHP"´ º·õj_´,HÒ%èö9^›k’…B»8ûù…ÖË£‘Ü ‘›dݾ3õÐË{)…r¡]¨”ê›mƒ‘–§*^‡>½-ƒÈcHð„IhÍMíWþsw¤—Koº‚8ÖäÚª~±Á#³–ÚIÃ)´ »Ý®ThïÞíׄ»5W–4næÔ¢¼…¦laƒ¡0/_ºÞ£°XŒñÔÝÛe±g“Óì²¢ä»K]Ý”hN¡ÝÑ÷úûF‡ú§ŒÛ”…èh‰É MÌMÏJÌÊIuo“I#‘"´;F£©»KÓ×k2 OOŒÏZ§œm¬ÙÇlçËé`¹â;‚8–a;и¹8®#!¬BEkù9¹¢Ò´4ï)4ò?Š,è"%|PIEND®B`‚tenmado-0.10/happy-L/image/last-boss-damaged.png0000644000175000017500000000511510276702754022272 0ustar00ooharaoohara00000000000000‰PNG  IHDRxx¶¡…bKGDÿÿÿ ½§“ pHYs  d_‘tIMEÓ .»:}² ÚIDATxœí[P×ÇÏJ´º !X–Œ¹ÇF±6ill·>v¦Ó§Nfâ™v:vÓ¦ñCc2¾KmÀÅp‚$.2¶„V ¡«YÝ¢¢€A×Õ®VZíï $ùœÿ|>úöœï|²µµŠŒp÷¹×¾Àº"a|#ŠGÃñØØŒÀ\`¨D9•|*¬ˆy"‰P,Kkä(_HóßpH·Ûè'ÇÌs—=ôÁÍ ^ž£q+"i¬V)жj:Oô’baž 4zt_ÇÌæ³Û……cªf2Õ¨Zø]¯tŠ%2ÒG&_è¡ë<™ÚÜr‡-ˆ¿¨ã^~û$K¢Ð>·kêÞŒkiƒ¬i¤öp…®¿KZSKÖ€¤ }÷ÆGscáÒuäƒ ÞÚ‹^¸òrF#EèñÏF-3ëùS„hºD=çúò'_¡íÓÍ¿Ü+•ЂhþÍŸö+5Íù ’—ÐÛÒø­¹03]ù9Pè¹ÔZ¯:LxâBÜšº ~ï+&íÉQâo¼sLÛœ.àËàÑO N…ZNªUÌä©Á™^èt=týƒÅ©¢K+ZštHšs™”ð{pw5»4gî¿'ÕycJþë®úVØH#7¤ ÁŸü:y’Ü£í–'(d# Èì–'JÍ‹ßHîÑïýæ}fšPZ…¿ó»Ÿ|=‰G›æ¤R5Ro3‘™ææ=%úÖµ±(ήÎĹuÍöîï3 myízt™ŸmSÁÞóò]æ"Õõj&$‚\¤bççm¡]N›~ÔI“=ŒÅ®^[­Bv„öº¼ìñ6x]Þ焹9þÌņÏä3rKœrm -‘¨…(­1ÈÛ^' @?9f[ôÐj“ÑOŽužè…AÙš: ~8<Í.ÐÔc/ë @^Ç.ÐÂËÐëvšìM-^·FBav¦šH( gN:0v‹ƒZfNBy½ª^í£Û†#¯—™6ƒjÂ1Ti5(ŒÑm Ñ«ëàÂôÒF˜O·% Çí A¥VYW_éh]XÇ‹¥úSápbPÑXGoÍ®rá¸ba lh”_uR¦ :¬kìªA@*›äÔÕeIy.[ì}XªáÀ(lê<X‹Óm ÃË9{²Ä¦RßÃöSÍ¥Xr±´Pµ(á²ÕìÀØ5šZ8‚(<Ö«‹ít[ÂpŽõ*a÷:0öáZB¸íÒÍ=Òm Ã9Ú¥ƒ(_èr¬äß(‚%ÜŠÊB@WŸve1L·=Œ¥¡éÿ™J~¯Ý!tÛÃX5[ !ô©ógƒn#Ýö0–SçÛABhÅ!õªý öœ… 8œ˜âÐ ØÉ~©¿‘]¦© ±@ƒ¡#Ñ56_‰ dÛOÝÛBŸôXG鳇±œÜ®¦¾-4_( <à ߼ŠÙ¤øN´Ý/ÀW¿Ý3=ÌnzI÷Àn1¼]¡•šÆ[Ø×ìù!Y ®ÔœÞùuWh¡HrêÒa‹§Ã*¢éîmæ÷\ì,”rØ<²hï«ÚûësBwžèu.…Ö06¹4_äj¸¯ëþ§Až(ìÀØšçù¢lï{%I9¶Û.æöƒÅTÁüáÀ¾“ìo ’ ãKö+‘8õÍIG’¼ûá§;»RA¦„ÞJÒ}2ùŽ´ÌŽ³á^ÐÕ%}=eØÑ[÷Ø|\Qµðû.õ'}+å´¶µajx‚}PÌÄÏ|ëdÊwÓêž~4s­ÿ“-]ýжîã©ÞMwªÒÖ}|tè}vK/R¼­{0Í24Sð¹]w®O±—\ÒƒpÁÅ·uéÔf8'”ÖÔV+×Ùzxéië­ÌØ8«†7 n)›?Y6¥Íêä»ç\ßW÷ÙéI@«ðžsIêŸ$Û¦d¿çó'Ø;¶{AE൷N¦jS±ls9Ä™¶KðÅ?˱ýi*¾ñ=U–*ƒ\GZÏYˆÅ8z.köÕ·3iŸá‚㯠0’F–гÉ0üÿ2cÿZ ž:}wÓœ Sè³Óô£ÎÒum„ :ûÒ•–t¡v‹iø_÷K±@¤´!8ðݳYöTÏ J„N`·<1N˜K% ‘)aûImÒæš¤@¡Ð þóÉ¿gÇ]ÅÜ ±Rlë©}õõ7)…r¡XÏ/~m+¶Þדè¦D t ½ç2æZ^u¯<ó­†Cy'ÂóÅ@Z‡Ö4TÕªÛÛ&“FŠEè½xÝNëâ‚Ó¶ê[[b|+ålƸ ÎÙŠsë;â'8q.Ü„•qžˆ¡T.R¨ê›ŽV×(èþ#öó?/YÔ·1+ššIEND®B`‚tenmado-0.10/happy-L/image/medium-ball-blue.png0000644000175000017500000000133610276702754022121 0ustar00ooharaoohara00000000000000‰PNG  IHDR((œ/:bKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ *1um3kIDATxœ½Ø±OâPðŸ/¢RµjŽÁ:Ø °€$F#ÁÅ„ÁÄxarvp¹ÄÍÁ?ÁÑ™©‰!a`”@HLÂb*á¬\{ñnx¤bÁ£íµï;5oè'}mß{¿ßT¿ß}©4…RC¨ñ"ß–^^eù÷ ækKã¦}Œ+äõYλMM„[¢t—Ê>4Û?M¼{y>ºËž†·×]´y¸#ÉÉL™ËU'z£‰EüçÇ;«4eNê ®ØSÞM¨8 Î™ËØþÉÁ–8žÊ›{ÐÑÄ"þ«³°.øú6{ÿøl‰Šsظ¹ˆj‘Ý*Ü?>_ßfÿÇSyËUÕŽ§òãát¡nÕ{.WMêZ¸#É ®hŸŠ“àŠIþ'3åÿùst¦§¼'3å¸%J¶Nòp¸\µ%Jø.ÿDFÅÁ€ìC“$Œ9Ti zV Óí)•¦€J ¤ê˜FÔ¬£ÔP «PãEÄ·%Â*ðm ½¼Ê„Uè¾)Ÿ`Hª8Ú݉Œ ˆš3j· hméËc‘}êÊ¢1î ÇAËU`Ü4ò1.Â*ø yõÁ­R äõ  ëq/Ï“TgÓAÖƒ ºËSUÀix›˜ªrÖ]t,â'£…6qY5X¹Îwœ3v«Âx•¦.cûv«?¾ï©eÜÇZ}r°et ©G¡ÍáîÓ&qu> lØ¡ØošÒM»;Ý\DõØFÕÑ¢ÍL™jt†õ–©8_æF¿&c…9Îh+ÂÐÿj²¡Fm¾t{ŠžuØ‚æ‹&Ãí¦î›¢Ž¯,:M´›þ¦¤ »PܳIEND®B`‚tenmado-0.10/happy-L/image/medium-ball-purple.png0000644000175000017500000000134010276702754022474 0ustar00ooharaoohara00000000000000‰PNG  IHDR((œ/:bKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ ,Á ùGmIDATxœ½Ø¿kâ`ð§/ÕôØÖ^„Ú¡•Ö œuè—–àR .ÝÚ¥ÃA·þ nn]tvŠ‹'Aê ±b—*ÎZ5ô"ôox%µÑž‰—¼ß)¼C>äMò¾ïó, ‡CP¾,TŠB½Ún5Ä—gi ý eZß N«Ëm÷øhÆK«¼ÛÂLXhŠÜÝCŽ{ìüú=óv¶Í¥»ËžíÓ[Öùá^GJÆK™?Ó›L0Äœ_¬Ú(Íp6]KÄ ÒëÛ*µl¾¸>:9ÝÓßFóó=èd‚!æêƯ Ž„¹ûÜ“.*Îa`;aƒÈhîsO‘0÷/ø6š×]•íÛh~:œM×ôz¯S“IñÙtM ÷:R"V0NÅIÄ ½ŽôNÆKÿó稌ôú–Œ—Þa¡):Éãɤx¡)Ž`îƒ99î‘$Œ9Ä—5«¿Žéw|Y@•¢@R]4! eªT¯¶ «P¯¶Q«!V ÕÑ˳DX€~w€ð †¤Š£ÜȨ0}ÔhÐúƧÇ"ãÔ•5 r8guWÀá´"—ÛNX—ÛŽ<>µGp½TðøhÄxiÛæIÕüe‘ñÒì.1Uæ°gûÄT™C@oYƒ!†Œê?ÞÁeÕhå:¿< –ÍF«Â#xÕF]\­þøù].ãÞ×ê“Ó=­®IõïŒp6‰«ÿa`ÛÕýí«¢tSîNá«ÆÖªNmó”©ZgXm™ŠóYa®õkÒV˜ãL¶"4ý¯s¶"äÈÍ—~w fÖ¡ù¢Èx»©ßÈã+k–9ÚMA )_±PzIEND®B`‚tenmado-0.10/happy-L/image/medium-ball-red.png0000644000175000017500000000131310276702754021737 0ustar00ooharaoohara00000000000000‰PNG  IHDR((œ/:bKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ Ö$#‘XIDATxœÅØ?kêPð·‡kKSlÕhÓ¡…6.Ú,·Pp2µù®§vh?A;è”Á)êb*tiBýÞ½ƒw8’Zõ^“\sî³ÌæÄçÝšN§à,z³¥+J_UMM³ƒ_–Š¢"‘ÃDY–æ8:™pxµ­µ°Ùí½‹¯•ÊÏ÷÷µ—Û‹ÅNyþ<“ z‡­á¨!ImY^ë-'.Ù,u°ïî”ÊuQü=¨8ÛÁàe.wvsí®å Þ>èrâ‚puç®<<¾U«QqŽS)þùiaù­À[µZyxü\Ë6®Úv-_X wJåM}¯+Ó–åN©¼[ÃQ]ýSqê¢h G_à†$ýËã0ãqC’>a³Ûóu“çÓ–e³Û›Á/Å"s^+’0æÞl99ý7˜‰aèÍÒ…¤ŠE銂úªJX€¾ª"SÓ«`j²Â*L á0$ÕÙâQ­\õ[DE"äÕÝp…†° !†AQ–%¬@”eÍq„U 9ÑÉÄ^,FRý¶³C'Nyž˜jsÎ3bªÍ!ÆŒz’NãZ5;¹.²Ùí`ÐoC³wáê`ÿ2—ó[ýq{k׸ϳúìæÚ톻ROÒéù÷å!quwœJù¡~O$ªÛâÓ‰~rb»U—K›—šêv‡ÖTœ?s·¿&wÅgyáê~õ8аc_&†áäÞÀðe!ó㦉aØë»á°‡qÓo1 FûÈ3aIEND®B`‚tenmado-0.10/happy-L/image/midnight-bit-blue.png0000644000175000017500000000027210276702754022306 0ustar00ooharaoohara00000000000000‰PNG  IHDR@²¬hbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ 5’%€GIDATxœíѱ À@ÁFpwr#—lìÂ"<ä&$¹Rd¥·J7|)û\ºá‹h y€æšh y€æZøû³þÒIEND®B`‚tenmado-0.10/happy-L/image/midnight-bit-blue-damaged.png0000644000175000017500000000027010276702754023664 0ustar00ooharaoohara00000000000000‰PNG  IHDR@²¬hbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ ™}zEIDATxœíÑA ÀPA´°%¬`MÅ›!<Œ{ Ëc®Yé­Ò _Ê>—nøâšh y€æšh y€þÀ–H¸=ÍIEND®B`‚tenmado-0.10/happy-L/image/midnight-bit-purple.png0000644000175000017500000000027210276702754022666 0ustar00ooharaoohara00000000000000‰PNG  IHDR@²¬hbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ Tü2GIDATxœíѱ À@ÁJÜÇ\Ñ%ÅÊÎ!,ÂCn‚@ò+EVZ¯t×rö¥¾x€æšh y€æšh …?ðÊÐ’Š–OIIEND®B`‚tenmado-0.10/happy-L/image/midnight-bit-purple-damaged.png0000644000175000017500000000027110276702754024245 0ustar00ooharaoohara00000000000000‰PNG  IHDR@²¬hbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ 7¤?é4FIDATxœíÑÑ á"Ù$íÑ–‘Þ¢‡ósßÇå9VЬ´^é†/åìK7|ñÍ4Ð<@óÍ4Ð<@ à[ˆíÍX¯IEND®B`‚tenmado-0.10/happy-L/image/midnight-bit-red.png0000644000175000017500000000027110276702754022130 0ustar00ooharaoohara00000000000000‰PNG  IHDR@²¬hbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ ɶŒ­FIDATxœíѱ À@ÁNr7tIíìÂ"<ä&$¯1Sd¥öF7|)wºá‹h y€æšh y€æZø0–vÇ”ÌIEND®B`‚tenmado-0.10/happy-L/image/midnight-bit-red-damaged.png0000644000175000017500000000027010276702754023507 0ustar00ooharaoohara00000000000000‰PNG  IHDR@²¬hbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ :ÚŽ•‰EIDATxœíÑÁ ÀPnÌf KZ‹›‹!šŸôMФyÍ‘"+µuºáK¹gÓ _<@óÍ4Ð<@óÍ4ÐÂx.‹ÚÓ'ËÈIEND®B`‚tenmado-0.10/happy-L/image/midnight.png0000644000175000017500000000327010276702754020606 0ustar00ooharaoohara00000000000000‰PNG  IHDR€`ZíbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ "®&EIDATxœÕœ»r7†ÿ¯â&¹ ±1'd+dA>€åƬMwfk'“™Ö»3ÔWw¸¥ž§“'a%Ê«TüÐpÔS‘ð¼Œï‹ N!èH>¨‹ïš¤‡0… "•eØe|× O!h€H~ØÕFvÝР€Éd ¶=–‡"»>ï*O!‚È=`md×ð°_2w¦^2'—*Y¦˜®ÛŪ˜9gÅ}r©µêmšYÃíÙry![¬ 2zû¾¦™µÑ- DZ)Ø–9µñ=))n¹[Vöm&|B`‹DŠðAëÊ>Q@ "ÅóŸöS–¶7Ô¥€¢­™n¾¯ý”¥#Ät("W>ˆHÀ€ø”™îáób9›¶R¤Ãu !®„B>pH¬uÏrꃡQ¬8üõº xþRmGvRˆÔ+_:ù„ËUšä "uøÀ-±ï´ÐÖ:!¨h’»F´1Ùp¨_täBo'R˜à³=V9o©È…?p4  Á ,‰\‡rĆkG¡ºÎr®6:Ê®$B!t(øÀ™?p7  ¡D‰À>Àðèn:BˆÒºò?¶< H‡B¨Q"ðÁù˜Ny… G½pÒ<#Õ¯ÓÂ:Už\&°Ô4€¯ J>ðä| €RÑ\‹~xòÝ“§ßk÷â›|s—Þ¨”î¶è§_w¯ÞÜi÷â›|§Iÿ…^ìW‹U±ÙÍ—¾üA€H†B³"?ïËχãúÉ‚Vê!$B¡·ï·§ÏÓ"ODB¤@¡Ív^ìê à €6…fE~8ÖÄ».ˆÂ2èRèÕ›»Ú\£.ˆD P¤Ðf;oi] DaüA°^h¤%šàcKDÁ™ÊpT’£oßo;:T@¤`€|ÑÜåʧñÊ‚(˜?ˆ1²ƒÀ>¶$Aów¸šV>M’ѳˆc’(Ä(Ô¾òiü­Ý\f¥³&Œ=E¾ð±u8Þs‡Häds<¹ô‚OEÜ ŠÜ“ÆÀM¡ÍvyÊ ¢È=)ÁA6kýz0|΢øÅ.|z}¼-;wM¨øœÓ"爯ÅrFX„±X ŠÏ‰ÑÔÒpPèÝ/;Ú’ƒˆd³Mc9…ác‹D$9yh‹æhásödR‘ääÉÊùOÈác‹ DTÉ>2¨(Ä[$ ¢:$3€„B|ð9k…DT#ž²¢8¾O¯¿Öùpëp¼ ÂÃJ")T–¹Qu¦S1f/Vd+Jb(´XÎRáÿ‹«"ØBN_j¦|l=ìW+"Ú[*Ä„…†0|l¬ˆhKrè¯õøNPv­¼VD´Û~z|ÈLyJwy­ˆÜ/;ŠaøŒPEøØrß{“—²Ü,t¤.|lM‹Üq@žvd1À‘Bêð±õ°_u‚ˆœ?àã4øØêGI2×åæö¥Å¬ÈSø&´Š:AÄqøÊe@{_]jlUÔ"þ€Ï€–r÷[5ˆéJã÷+Ô‚˜275ˆ©øCÚß[]‚ˆ‰?`5à’Ba5¶*ª€ˆ¯Û¼_ñb‚ôáckZä¶|Ågr\|l®ÙðñÜœ(tEð±U^³aí9û·L­··×[å5Öï ËùžàÃýýñÓ5†¿Œ¾ã²õFF¯IEND®B`‚tenmado-0.10/happy-L/image/midnight-damaged.png0000644000175000017500000000331510276702754022166 0ustar00ooharaoohara00000000000000‰PNG  IHDR€`ZíbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ (0,Õ€ZIDATxœÕœËnÛF†Ž(Ú B‚âE´êd¯dX^&Àýñ#å)ú }œ"›l‚.ŠEÑ›» @S‡œË¹Œþ•b8š¡ÿ3çœaöÓ—Ÿ¿}ýœúëÏ¿ÿýç?Ö!˜4ÈMq9äûþr22«»%ß•Š"7&ã…\ÆdE‘³±Ú,Ìj³`L–3_ ‡ò"sܬ6 SNÇóåŒuƒÜ rÃ= ¡&\NFóë+@€B87qÃ@ÅSb—ÉŠ Æ¡ŠË!7|Ð4@†B²A–ÅȘL€–P) ^¤¢ μ³VMsôo¥ ¢!æSéØ1 !a“å…ÄÄjþ 6‚Bª ’ycZ* Ô@$Ø ¤‘|*ÕüAÓÛý­Ø$ˆÄà`}HšÖ‚·J’Wn“$|¬îìàÄv™l¨ºO' œDù±Gþ(/Š ^‚§ñ}²Ä)= Ãmñݲé!M!è€H>h‹ïä) É/»ÖÈn[pq9ó@>°Dvû¾«… W¹T,‘ÝnÀvwÃ<™vÉT.UvAl1Ý~µóë«r2âœUÜ•Ë|8È Y¯íÎj ·÷Ëwl“é'ˆŒÉ†:Ï}¶;«Õ- DZ[°÷Tëu*R< Ò‚:3û®@®ˆDŠðAgfŸªÔ R¬ÿtWYº®P—B ¢G3Eø ¯ÊÒbº‹‘« ôå“©_¹Ô->Ï—³r:îø…Ô)„¸Ê¥.|àÐkÒ—S_buøÀá¯×oÀ½ÞY­0©w¾ôò.·«Øä "uøÀ­×Í)Ñ–lšë{ Řl˜@Ó‘ ½Ý Hà6xT.NõÊ…?p4  Á­r™Èq(Gl¸N4 ¡DGåˆ g¡z@”|à̸…`Q"ð0<¦›…Тtà`î\Oô1  ¡D‰À‡`zåa@Rƒ8éÀž‘ê7iὪ*—IÁ¬h5ÍYe²¼ÈÓ<ù_ Õ4g×d6ž¾ûA{oòÝ»ô6@¥u·CŸ^>îžîµgñ&÷ü§’ÿ H‰B»›ùõÕún™Èºôå @2*'£ýó¶ú¼{ºW¯Ü!(S1  =~þP.§ã@$d@ ZoG‹]DüA˜ЦP9µÆ».ˆÂv  Ð¥Ðîé¾u¯QD¢(Rh½YtŒ®¢0þ ØÝ6ø4¥¢àÊpT6G?è-t¨€HÁù¦¹ÓÌÇú›² æb €ì"pOS’ Šù;œ¶ÌÇ&I½ÿ1ü<]”bêÎ|¬ÿën)“)Ä䄱U$Eà Ÿ¦öÏ[ٜ÷»/ø‰D‘Ϥ±pSh½Y<ÄÕA¹AùLJPÈfí_'‰_>Å'»ðQhï™ùt¨¹wM¨ø=1Êé˜#¾æËY$|¾íúŠDñ{b4½4z|ùHû…ä "yئ1€œB„ðiŠD${ò4Ð6ÍÑÂçà›IAD²'OÖÎGغKŸ¦¨@DµÙGgÑ„˜àÓ ˆ¨j‚dPˆ>£P€ˆª&HÙQO¡ýÓ–d&ý=ocÂ…°Ø@j@Ü´ª67ªÉô*Æì˜ýç#QC¡ùrV·¹Éh~}µÝç ä$ñ¡†` ‰Á§©‡ým@FD{J…Ø€°Ð†OSíY9úc=¾7¨f­¼2"ÚÇ~z|d¦}JwyeDî€Ű|V¨"|šrö&?«Ër²Ð‘BºðiªœŽ3"òmG)¤Ÿ¦ö·½ "ç¸V€Ã:M>Mõ‚ˆã]\‡›»S‹r2JáMhGêGñ•ˀôت¨DüŸí*î=¶*²ˆé]%ŒïWh]1mn2²ˆ©ùCÚß[‚ˆ‰?`5à”Ba=¶*:ß»’x_ñÒ\éç©r:þôòö˜Â×|&gÀYÀ§©ú˜ Àm@M¡3‚OSÕ1Öwµ±¿ejµYœ|šªŽÙø¾ÅKÙëë+ß·øöË÷ßûãÃ_FÿT4Æø‹Ü'@IEND®B`‚tenmado-0.10/happy-L/image/overrun-bit-blue.png0000644000175000017500000000033110276702754022177 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ  'œŠfIDATxœíб @A‰Ba!cÇ’ …Κ¯(î&øü¸íÇð?ÓºÌ_7¼˜Îëþºá…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[ÅOo=DJ3q&EöIEND®B`‚tenmado-0.10/happy-L/image/overrun-bit-blue-damaged.png0000644000175000017500000000032710276702754023564 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ ÊÍæ‚dIDATxœíб @A‰0±5 `M¢³€æ+Š» >?nû1üÏ´.ó× /¦óº¿nxáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVñÓ[}J†… !~IEND®B`‚tenmado-0.10/happy-L/image/overrun-bit-green.png0000644000175000017500000000033010276702754022347 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ :*1\§–eIDATxœíС €@À@H¨ Ë’L‰B²À›S z4]ÏëXþgûøºab»Ÿû놉n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰n‰ŸÞzI½J EÕPdIEND®B`‚tenmado-0.10/happy-L/image/overrun-bit-purple.png0000644000175000017500000000033010276702754022556 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ ü ’eIDATxœíб @A‰Ž}L`HKÒé, ùŠân‚Ïûv ÿ3-ëüuËé:ï¯^¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸UüôÖðäJ±há0IEND®B`‚tenmado-0.10/happy-L/image/overrun-bit-purple-damaged.png0000644000175000017500000000033010276702754024136 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ #•ÈnŠeIDATxœíÐÁ @@QJ)Ó ±¥”›\þ‰Ã{üþ¸oÇð?Ó²Î_7¼˜®óþºá…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[…[ÅOo=ñ…Jd ?DŒIEND®B`‚tenmado-0.10/happy-L/image/overrun-bit-red.png0000644000175000017500000000033010276702754022021 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ W2ÌçeIDATxœíб @A‰ŽÌ`CKÒé, ùŠân‚ÏǶÿ3ÍëòuËé>¯¯^¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸U¸UüôÖ¢pJs¨6IEND®B`‚tenmado-0.10/happy-L/image/overrun-bit-red-damaged.png0000644000175000017500000000032710276702754023407 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ  Á?0dIDATxœíб @A:f3…%­E§±€æ+Š» >?û6üÏ4/ë× /¦û:¿nxáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVáVñÓ[ÐmJR\(÷ÛIEND®B`‚tenmado-0.10/happy-L/image/overrun.png0000644000175000017500000000056610276702754020510 0ustar00ooharaoohara00000000000000‰PNG  IHDRddÿ€bKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ #áSŒIDATxœíÒ± @A‰Ž}L`HKÒé¬à+‘ÜMðÅûv ¼3-ëüuÃoL×yÝðÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ X…•М'ÅžIEND®B`‚tenmado-0.10/happy-L/image/overrun-damaged.png0000644000175000017500000000056610276702754022070 0ustar00ooharaoohara00000000000000‰PNG  IHDRddÿ€bKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ  'åÚ¿IDATxœíÒÁ @@QJ)Ó ±¥”›ü“Ô{üÃ÷íxgZÖùë†ß˜®óþºá7œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ8+pVà¬ÀY³gÎ œ<7J–,ŒOTIEND®B`‚tenmado-0.10/happy-L/image/player-blue.png0000644000175000017500000000157410276702754021231 0ustar00ooharaoohara00000000000000‰PNG  IHDR<<µžN%bKGDÿÿÿ ½§“ pHYs  ­#½utIMEÓ 9ÀT IDATxœÕ™¿ŽÓ@‡ÇQÐ !!J$*(yDÁ£ðÜ;¸¢Fœ®÷Pœ¸âŠ‹% ¤ÓIÄu§DTN¤8RÈg)Ö9{½;»þmÁTÇ3ûiòe½+BòétNDÏž<òQü¢Dôc8¦ÿúâúŽˆÞ¼~᣸¿N§ž*Qè£h:§Ù"ÍÒlxx–B—Øð-….°á©Óie€ <´ºûÑ]ñ؇ÖxèŠÇ>´öÑéTó`è²ÐÅZƒ¡•õC+ †k ï´Â`¸ÖHèºÐÅu´ÖHh»X­‘Ðw±Zc;Ýè.Vkt“ÐÅ·P­aÐFkZÃŽ[×wêo@6X ÔNç«u®¿gµÎQZc ™¾¢´Æ@3—aÔjê4ËW”ÖhŽÐ2PZ ¿ýüå鿦@úòÝÓÍMÑ:ŠûТH' £¸ßrÒVÐÉ`xy3´Íº¼&ë¬r¸COf‹(N °ž2¢8™ÌwWæ ΙÇ'çι-Ó¡£¸?ΖγÑ8[:Ëí †É`ä6ŸŒD” Fnr[CK•f:˜uÿOp“;°}»õáó×ÛÑDŽ—«Í&g= +ÑítŽz]9~õüéÇ÷ï¬Òí:Åý{b"Úæ;«teâíhb+·tEå‚ßA »Ò/l+7º®r¾sl³2ÝJn.t}YÝl[A×Óù+7 Z¹*; Ý”Î_¹ÍÐÊU¹Ð2*ZïçbÉm€žÌ§gWõë-…Ö9=»2Êm€>>9W>®[ ­)2ΖF¹uК FK¡õEŒr7Bk6í…–¡Ôz?»Nn5´~ƒÚXJ³r«¡õVA„æ”jÂP@÷Ê¡9¥šä®B÷Ê(¡eh´Þó(ä>€æì•B3 Öå>€æ<ýBó VÀþA3}@¡ù+rÐÌcVhF­e”åÉæØÚªì½Ü!ÙldáBÛ–•¨ÞË·åcŸ>~¯·Ž\Ú‚z]Ö+«åŸÍ(ýffN¢%š ¤IEND®B`‚tenmado-0.10/happy-L/image/player-purple.png0000644000175000017500000000156610276702754021612 0ustar00ooharaoohara00000000000000‰PNG  IHDR<<µžN%bKGDÿÿÿ ½§“ pHYs  ­#½utIMEÓöutƒIDATxœÕ™»nÔ@†O¼ á*$XÑ#QðTˆ‚–7à(ÈDi\Q°)hÒ@‘š–)XK€ÒE (R´«TÞq´­vצvãØã™33ÿüÕÈñ9þd}:žÙ¬EA"Ò!µÝ Ñ|=DS"úu: ÿ:9¼ ¢gχh ú÷i¨3E!šŠt(Ò‘HGÒlx‚@K¡Ë l‚@K¡Ë l‚@¯„d6Z ½\Ñ]ñ8„ÖxèŠÇ!´ÆCW<¡5º,ôò ^k0´Ò`¸Ö`h¥Áp­ÁÐJƒáZ#¡ëB/¯ƒµFBkÜÅj„Ö¸‹Õ ­q«5 ºIèå_‘ZàÖµ†·’Ë{÷oêo@aoÚh-Pk ´H‡ÓéBÏtº@ifúŠÒÍèifúŠÒÍZ¥5úç·Ë@77ýéÃ@77źw£–E“¨uâ®çC½ ’ÞqÒ·­úþµw”ô|ž»æü£z&Fo^v~ðû¯¶ï¸Õº¿é­çZÏrGèNÜÍcç§Q6;Ëíí¦r=ÇIßMnk§=U®ÇAnkèí·_ÎÏ„\OƳùŒõ-¬d}£uëö†\?yÚÞ~÷ÒªÜNNÜ]Ñbž[•+ ÏÏ„­ÜЕó¼p—EQäùU­­Ü\èLŒvã¤|%_8¾feùnœd¢ñ\\ º>Vg3/èz9r³ •SÙYè¦rþä6C+§²Ð2­e˜r 31Úß;©_÷ZÓdïÄ(·zgë@ù¹öZÓ$Œrë 5 O¡õMŒr7Bk6þBË(µ–ÑË­†®Oår B&·ZoDhN«& ´q¯ šÓªIî*´q¯ŒZF£µŒRîkÐz•e€B3Öå¾Íùú…æ7¬€]A3}@¡ù +rÿƒfû°B˵–)ËOe¸ÐVmWrGd³‘… mÛV¢¶l¾(ûô™NæŽ\ÚÝØdýËj2ž]öÿüf=MÓIEND®B`‚tenmado-0.10/happy-L/image/player-red.png0000644000175000017500000000160710276702754021051 0ustar00ooharaoohara00000000000000‰PNG  IHDR<<µžN%bKGDÿÿÿ ½§“ pHYs  ­#½utIMEÓ%ÿ*[ IDATxœÕ˜=oÓP†OãF)Ñ”‰?Á€XáÀ #Œˆ )Ê,õÀ C‡Ú*‘*u«Ñ¡JÔÉv†JqJ”Äf8!8öõýò{ÞÉŠî9÷ÑÕãc;Y–‘ƒŒÃˆˆnÜÞuÑ|ÓES"ŠNûôßAŸøDtçÁ}Í]A‡§}G‰¨á¢é8Œ’0JÂˆÍ†Ç tô÷˜#7çíš…Î_`ãz%´#³ñÐ,4_;Ò]ðØ…Öxè‚Ç.´ÆCz!ˆ°16vG]Ÿ .ª…ýùû¯{Gx픂İAbØ 1l6H $† ÉaƒÄ°AbØ 1l6H üsМ±ÚËȉàìsÐRpöõ¡'cçÅ:ïk¯êœ1-E¯D×u^ê•è•Í2[um‰¬•¹~{PRK1/—^¯„–bsBÉÍFœ±AI%ÄÏl¬kýÈ|©lÅ8ÿ¬óÉ´yâ)Á-²÷Z h³+‚³­”üH h§+œ±AK%¢foX ¨Û•}ô‚ÄŠu•º’ œîìÊAô‚œJwåŠ(öÜ}ö®DF/È%1 WWr)ĺË]9ÕñHòˆ ]IŽ^œb@|Wz%•@©ï=îÊõè)%ì»rƒPV¬[ue^¬–"WôÂû½g7÷?U)þ‹9ïŸ‡â¼Ø79'cG³l^™Ìz¥ÄŽs?kWh‚ùŬó1×ÎûÑ,P”Ö´óþ1»¤zê5zIµ.DÚÇ“iî"x_ˆ4¬óßã|üÉ%±7šÆ:ó3W»ÑŒ,D2×§Âi±„B$se*œ»Xˆ4’§B¬X®B¤zÆÚøl†ÅÚyÄ ÙÌðˆ»t!Òˆœ ¯Åî,DÁ©°«Rˆd`* Jî»"7ÛU,D2/³ù_¬B¤±Ÿ ²ÍB¤±ž ò{œk¯'3Í÷ýgN픂İAbØ 1l6H $† ÉaƒÄ°AbØ 1l6ÞVìͬ¯‹YžhJIEND®B`‚tenmado-0.10/happy-L/image/plenty-blue-damaged.png0000644000175000017500000000130110276702754022614 0ustar00ooharaoohara00000000000000‰PNG  IHDRH`1p£KbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ .^×lzNIDATxœí˜Û’£ @&ûÅó#óºß¹idpSn´¹=Õç1ŽÊ©1§ âóë÷ô‘½Ð £‹QƒÅ¨ÁbÔ`1j°5XŒ,F £‹QƒÅ¨ÁbÔ`1jȇ1BˆÞ˨‰âa H)~}‹óÞ÷^UBPJƒš¦ ÂG”5#"º®kËd«€ía •²ÎÑÒPZ©·/¼ý‘€T³µËðOæ¡Òzèð)ÅãÃ,‹Z;æOIi4œdïX,0fW¤Fk)#%? ŒÓ!„•4{ãb¾]ÙG/JªØÔ©+J b;»r½ø¹y·lÝ•¥õ %·oÑ•ÄèE) ÔêJ-¥@±©¸+—:žH±@FW²£¥¦X ½+Ê@ý¬otÝó®”G/J+±À¾+7(­7j}ƒWWÐ9PªVô¢Ü´™sÿ®Jóÿ˜÷þõ(¢s?äQ´è,âöD‡x‡^+±óÜ#:ç–F,P_lY|Êû‡÷Þ"†¢Œ> ½÷ÏùÚ+ÕKoÐWªm!òNŸ­Eì%x_ˆ<ï¿ç9ºý”H‘X‹šnYþ<çn?4 ‘MùT¸,–QˆlJ¦Â±ÂBä‘=RÅj" çœKÏf\lœ-îÍ [Ü­ ‘GâT8»³yD§Â»X—Bd¦‚Øwå?±¾…Èæ0›ðïØ(…Èc?`ÌBä± ð=Ͻ×S™u*ô^F+XŒ,F £‹QƒÅ¨ÁbÔ`1j°5XŒ,F £‹QƒÅ¨ñ^ã±ë¦¥NBIEND®B`‚tenmado-0.10/happy-L/image/plenty-purple.png0000644000175000017500000000131410276702754021620 0ustar00ooharaoohara00000000000000‰PNG  IHDRH`1p£KbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ ïGWÚYIDATxœíšm’£ @Øšì…ö{Æ=æL" ¸?zkÊ)A±Sý~šy}­Vúß¿þtïk½€Z6H $† ÉaƒÄ°AbØ 1l6H $† Éaƒ}Ü$c}ëe”„óþã&çýí§4Æ;ëC˜[¯êŒõƒäJñ®ëlRŠ+ÅÇq²Æ7][&K%@,_ÖZHÉ­õ¸ô¤âRò§J<½‰±^k1 ||8ï¯~d¾TžÅ8ÿ¼ŸwwÍo˜Òb#{¯Å€kv…ó^ÿ8”|K ¸NWë•Ã4{ãb@Û®¬£%U¬kÔ• %`‡pfW6¢e·P»+G”€L1 FW£åPª+¥”€bÝá®ìêx"eÄ€Œ®dG/JI1 ½+Rq­Ë/¨õ½Û]9½(µÄ€uWNPêŠu‹®Xë¥ä¥¢ßï9»éOªRý aþ>õor(ãÍ8-·Xã­9C¯–Øvî­ñ“ •&P^Ìû9åú#„ÙŒ“³Á€a~Ü÷]R}ë]ô’jYˆ¼?îÎ^í"x]ˆ<¼Ÿ¿>môñS"‡ÄjÜh:œ³Ín4 ‘Íñ©°[,£Ù™ ;Ä"ì©*Vªy€Þä|z6ãb×yÄ Ù,ðˆ»v!òHœ ¯ÅÎ,DÑ©ð,Ö¤ÙÀTPZ¬»òŸXÛBdó2›ÿÄ®Sˆ<ÖSA\³y,§‚øú´­×SÈæûþ3§õjAbØ 1l6H $† ÉaƒÄ°AbØ 1l6H o+ö©“°}ˆŒLIEND®B`‚tenmado-0.10/happy-L/image/plenty-purple-damaged.png0000644000175000017500000000127710276702754023210 0ustar00ooharaoohara00000000000000‰PNG  IHDRH`1p£KbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ )À³ùÙLIDATxœí˜[’›0‘4Ù=gN’{䜻è™Q.b($ô@ÌÖô§m@]Æ=XìÏï¿ÓO„^@/H $† ÉaƒÄ°AbØ 1l6H $† ÉaƒÄ°ÁçÅ8½Œ–pÎæ\°_ŸÊhç¬ >Œ^UŒ3B*1MÄ—¤R ³XkÜе²UŠÀöm9HaÃ¥R€o?(xûãLÎ @˜ÅøÇß™‡Jë[‡pÁæOå]ЋyæO— N²w,yfW8gr–\$J~&yNWgR€¬Ù›‹ŒíÊ>zIrŦA])PŠ\‹ÜÙ•“è¥-»dï®Ô(­g¨¹|®dF/I•X¤UWZ)EˆMÕ]¹ÔñLÚˆE ºR½$-Å"ù])äÜ~ëÉ;÷¼+õÑKÒK,²ïÊ Jë…z_àÕk€h½$7mæ°ÛwUºcÁ‡×­èŒû!·¢ÑÎj»}%J"ŽÇyî­qÎùN,Ò^Ì»óü|°Ú:ë èàƒþ¾öHõÒ{è#Õ¶e‡ëoó¸‡à}!Êð>,_:¹ý”I•X?šÎzgõ°?š™…(¦~*\+(D15Sá‚Xe!Ê(ž ¹b­ QFÔóÖåg3-öœ-î˜Í[ܽ QFæT8»³e$§Â»ØB³Nû®ü'6¶Åfs{N!ÊØOxf!ÊØNX¾ôèõ4f £—Ñ Ã‰aƒÄ°AbØ 1l6H $† ÉaƒÄ°AbØ 1lüůüpöIIEND®B`‚tenmado-0.10/happy-L/image/plenty-red.png0000644000175000017500000000132510276702754021065 0ustar00ooharaoohara00000000000000‰PNG  IHDRH`1p£KbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ 0ÿãœübIDATxœí˜ír£ @åC`§Ù7ÚWØ7ÜÇlÁýͤ1#xEñfîù™RáLã¹VöïÏßæáµ°$† ÉaƒÄ°AbØ 1l6H $† ÉaƒÄ°AbØàêòÁø[é1!ÔåC2!Ôï‹ï{oÝBíSm‚q.T+´nšFÆ„ÖBë¡ë|o«ž È£RD>þX#”òÖâÒZ ¥žn(ù´ˆq.mënÝèýǃðR)ò,‰÷ßè½»ÞÎyãñ¶•F/dïµXäœ]aB´¿ byÙ’Xä<]aœK£yÛæ,N‹Mëªve½$¹bM¥®”"+ĦìÊBô’¬‹ìÝ•-J Ø÷öå»’½$›Ä¦KêJ)¥éTE®²±+«:žI± +àè%))ÉïŠÐJSü‘òb‘å®l^’½Ä¦«Ïºr€Ò´õÞÜ»â­J•Š^’£Þv0vÐFßìþC¸½uoòUô}?týÏO¬ï-âx,çÞ÷6¸a§ )/6zŸóü1†0t½·Á€Cp×ÛªGª»ÞI© ûuw½1aÏõä°‚Y‰Z©IEND®B`‚tenmado-0.10/happy-L/image/plenty-red-damaged.png0000644000175000017500000000130610276702754022444 0ustar00ooharaoohara00000000000000‰PNG  IHDRH`1p£KbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ ,°Ù VSIDATxœí˜[Ž£0qû&{¸½År–ŒíýèìA„Mcu}"\ T«¿~7Ÿ\½€£1nˆ7DŒ"Æ ㆈqCĸ!bÜ1nˆ7DŒ"Æ ã˜¯‡R¥§@›¯‡Q ÍãWôCô>¥xõªv¡€µ`]Ó4u`]úè‡K×Fdª„˜éÇÚµ`môž—XÖÎ(3;I)ЮcBß§N\…·JÈ\ Áç/źîžh ­[ÉÞ{1äž]Q uÛ*Ðë§­‰!÷éŠR SÆ–œœC®íÊ2zYJÅš‹ºBPB6ˆ½®tbWV¢—e³rtWö(!D±Éå+w¥0zYv‰!µºRK © ÖìîʦŽRG !t…½,5Åò®€uÚµÕ€ÔCÖ»²?zYŽC–]9A 9V¬™t%zÖÖŠ^–³v;”:éBÿ9üK)þÜŠqôr+F?„¡Ÿ‰~`õÜG?¤qÿp»¿%û«B¹aÄðÚ‘ åÆ1]iÿV‡£<7û•öð@/V›bU4îÒ«âbµÙÑ¥zWÿ|ÐÌl¹.Õ»;úEdP e(Hj½Ã!ÓÌ–ëZoDZÒ˜­ àô„´¤1Èæ®Ýr:'DžÎ™»äéœÐýŒ­KCT^5â g¶oöCã.¹œÿár.'ñsnæ.?ç&aÞÃÜæ=$ôžÛ-l]ñ —ȶ. €l,ô««»ÜÑ«9—X¹¹¤@øÝ’IÝøî#ÚeÑtïB—û£ý°ÓÑÄ5oÄ®.”‡ºÞfAÏxÕšš¯-Žžúj·84ÊÆLsžý¢1SFÙNîêl'?*Êc'FzÐIEND®B`‚tenmado-0.10/happy-L/image/small-ball-purple.png0000644000175000017500000000110410276702754022322 0ustar00ooharaoohara00000000000000‰PNG  IHDR´R9õbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ  !$¼,âÑIDATxœµÖ?kÂ@ð§*AÐÒ@ÑA»ˆ‚P,Å¡ÐÒ±àØÅ©àè:¹8 Ž¥‚CQŠ (N:(BÀEAp1Á,v¸[“Ô\Ÿ) É/ÇËýy¶Û-ö§Óœô{3a´˜OÅÕ§Àqbu{9Þï …=ѸOãÛ£_éõJª”µ·¡¸Üh|Ì9m©»ÀíCÐî°¢Õq©ÐÕFw~ÉF7ç:t1ß~DÕIßs±½ôËóG«.àÒ\&ù§ç+å–(WÅ|ÛŒ  UŠùö.ݨŽ«ÃNÞ_‡êø›^¯¤R¡kÞ¥)ºë•$Ó•òÀø|иÜTÊ™®½1(…:$æ„áiÄå¦Óœ~oÆÖ`±~oF„Ñ‚¹{l·£™OEæ.€ùT$t?cëÒW͸ˆãä—ýм €¸½Ü¸n/Gx¿‹¹ €÷»H(ìaî…=$÷qN[@4î#Rw¶. €Û‡àŸ®íRP¦ík&aåf²zÀËK&qsž¾×/‹®»>SŽöïÕø˜‹]&y3îEäT}¨mŒŒW«Y ùÙ⩯~‹C£nÌtçÙ3uÔí¤òÐ`;ù~QÊýNi&IEND®B`‚tenmado-0.10/happy-L/image/small-ball-red.png0000644000175000017500000000105610276702754021573 0ustar00ooharaoohara00000000000000‰PNG  IHDR´R9õbKGDÿÿÿ ½§“ pHYs  ÒÝ~ütIMEÒ ¤@Bx»IDATxœµÖ-ŽÂ@àÇ$”„_ƒ¢+È’"pM6!( ’#T–=È¡’ @a‚Ô!hH6Á…)? +¦†]Já©¶I¿N&3ç;¸žÅp´Ôõ•a¬Mó°Ùà"‘(ÏÇ!!ŠÉBÞå]ß¿ôa»›jÚ¬ÛÝ[–ËËX,#ËÙZ ‡<Ñó^¢ªîèÅ$EIWÊ7èq«=ët<¢ÎdªÕ\£~•þn~ý ¸4©Ré£ùyº%§«q«ýŒ àg0·Ú—ô¼×l.2ëtæ½þ™>lwU}Þ¥™¨êa»³é©¦y_7³·¬©¦Ùô¬ÛeåÒP,†#†C¦Ù[Öb8"K]gë ~ÿR×ÉÊ0˜»þ`pedmšÌ]kÓ$ôÆÖµo_ä \$ò ‰òü+Ü(Ï“¸ 0wÄ$D‘¹ !Š$YÈb1¶.€d!Odd™­KA [«Ý5pw—‚6Í…C’¢°r%E¡¼½eÒ•r¦Z}Þ}/OGûy7æõT©ôŒû&IÎCÝkYð2^·²@ó·âx™ßÛ‡ÆYÌn®³;Š™3Î:yzè±Nþ€?Ê—>¡´4IEND®B`‚tenmado-0.10/happy-L/image/solution.png0000644000175000017500000000153510276702754020661 0ustar00ooharaoohara00000000000000‰PNG  IHDR`H†g4bKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ "[ö¿êIDATxœíšAvÛ0 D P”ì+õ½`¯Ú¤ +Ž,B€S/0+¿Äþ’¾æ‘múýëOŠ\‡ÿ÷ ¼{BH A !$„ ‚@BH A !$„ ‚@BH A !$„ ‚@BH A !$„ ‚@BH A 6Aœ‰3M:•÷äÛmÛr»ÓG¬üm[æño÷båÞMLKá”gúøûi;5 Ÿ˜>?¦ðs¦”ÉÄ74h]óãŤ=ùÏïÀ× "¦uÛ¹yÂHqä¯[&~¾VP)/ït)N|÷€z¾ZÐ+q)ì{“k¾#üX+_õ¾uË\ép¼É5Ÿ«KI©tèù*AErá8Rˆ|ñ?ÏÇ‚–Âu}q)ÑŸ¿fýÁˆõ×óñ;ÖëñØ¥DM¾ÃTÐhІq¦ÜœÑKÔæ¯'®ê£çApM8X"È\”Âò[‚öµ9Jw‰4üœ©ûp¦F}”ü– å•w—HËï½Êöµù—‚êÅU÷1ù}7ŽžJþ¥ Ó5w\ƒo¿¦Á«Á¿d]ƒÔ«ÕvL|ëÉèëùò?Ú³£ÓÂ×Ê·>y”bk\ƒ/ êXæ›®¡ƒ¯ÿˆiô„|APG}ÚÇpáëo@߬wÅ-Æ~Âcxñ•ìÞùÕ>€qx;–h„¯y2Ù$ùgAƒK{X¢A>üøà&IÍ4XŸG§8Îo—¨{ôlð_YgG1¹ð—=¶ÿ[Pßì(C:Q/þÕª]óhÚÁÿä¸Ç,nÖyîaK(ÇoëŽüý2ë³ãu³Î—_—Èeôù» ë“Ìi´sçÿØ÷t_‚&|Û{ì¼;ÿ$§í}‘ÏÉcvó,Ñ þq®œñ]þ“ÏiN}y”hÿ‰õ=OüÅkv“3•uJ=SJÌÄ™–eÖävþÔD¥”¶ÛÜDÑĤ¥Û½ü¡†’©F_IEND®B`‚tenmado-0.10/happy-L/image/solution-damaged.png0000644000175000017500000000150310276702754022234 0ustar00ooharaoohara00000000000000‰PNG  IHDR`H†g4bKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ 9:ûf¥QÐIDATxœíš]Zƒ0DÉݨ[qnU}€R’̽Éò0ób?¥8Œ! uŸ_ Sÿï¸{(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(„‚@(D'Èyç¼›t(÷äë¥5®¤z‹–ŸÖ8¿>’–¯ØÚy¢ß^ü|ÿèí|ܲ8_Ñ ÃöbR‰þñâ|© ç]\w®ö#Å™×p¾TPo[šß¼DPΗ Šé¢·½ÈW¾!ü\-_´]L…N^ä+ßy—)IVO_*¨ðK»‘¢Ì·4ÂÇ‚ÿM&%ªñ»þ`Šõ—óñ1UÇc“µøõ?iøÕ«(áAÏÉU}÷c%jóÇçµúÈù@œ–ò'¥p ü– XŸý zK$á”HòÑò[‚„gÞ]")¿÷Û׿W]'WÝûä÷]aý!¿*HuÎç ãë/€jðjð«‚´sëll¯ákF^È/ÿ¡}w¬½Eµ±Š¯ýä¡m\ƒ_¤ÚA{&|ù[T£'äuÔ§½¾üôÝõjü‚ 00¯‘œC7_øÆŽú4ø…uÕð– áK&#kE~.hpjK4ÈÇ}ÆI®ü7AƒõÙÒ8Äq~»DÝ£gƒo¿Ü(‘ ¿1YcËø/A}wÇò>JjůÍÚ­žÊfü— Ã5æâbåv eø´îÌßOð>û>Þëlù×™ŒžEþ.HûI &íÌùöœnÿaøáȹóæü3Ðjy¿È÷‹Åݱ˜£D3øç{åŒgùd¾ƒ-[‰&ñ_‚LGÏŒ§~gÉæÔsyÞ×ÍG·Œ?÷ QË„áóœõ‘ÜÄ/¤-ë#ýÙÆSX§ÖlIEND®B`‚tenmado-0.10/happy-L/image/sting-blue.png0000644000175000017500000000076610276702754021063 0ustar00ooharaoohara00000000000000‰PNG  IHDR@0.)ëHbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ ŠZ©ƒIDATxœí—YRÃ0D5›¤râ qBÁ5I™xC0àE–¥L¨Òû¶5ÝjuY†§çóŸAmG)´)´)´)´)´)´)´)´)´)´)´)V©¬TV²ŽàLëBeŒ1µ·—kÛï9eIÀ Õcàì¬Ê1+qˆPY¡/éS<³]®í4Š” áiAýœ¬¥šl-/|;ôkó*+^’%Ÿ`!D8HŸâ˜„ð5Åq:š€ª'}Ý1 NÑìøÁ3<О™›®‹Ž"Ò€zሟ]ŠPš¶kû!âõ˜ý ì뚽†×ì a\_w¨¨ÝÕ« ’ô5œÊJÛÍÞÖD˜þó¹ÉçG·ÓÞHÀ ;Îr Ûd¼¾u}Óv+-X¹–ÝÇÄ„+WÀùƒ1öU]ý­6ûwwîk8KÍþ!T¥¯áÌ6û;ž†ó·Ùl¦¯áL››¿QÉíçî5åTsYäcMIEND®B`‚tenmado-0.10/happy-L/image/sting-blue-damaged.png0000644000175000017500000000074710276702754022442 0ustar00ooharaoohara00000000000000‰PNG  IHDR@0.)ëHbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ 'â·{tIDATxœí—ÑVƒ0D³³³!ýb¿ÆÿR-PÐZµ@B·ž“ûÊa3“É‚<½<‡ÿ ¼l¥ð¦ð¦ð¦ð¦ð¦ð¦ð¦ð¦ð¦ð¦ð¦X$šE³]—àNséh"BÐßúã8žvYh¡¤&‹“ú‚ˆ$‹¤î²VÝqéhø’~ITúÖOU£¨™€*ÒŒúÏÅDMµæ¢Õfy>ô ˆHG3VK¾Â ¤ é—˜*×Çik¤.úšˆj4»<˜’Ø´Q Áqè‹£(4 Š¨,Øø+ {úa ^/ٿ̾泥ٷ½SÐ×|Êš}Cª(ëk>S³oúPd%P¥¯ùt´cf³×5’hwS?A Ñ€õ´Wd™v>6sLWÀÕfÏ>^¸–ÝSU`á x=©¯îê'°Øìß Ü¹¯ùÌ5û‡P—¾æsµÙßZûšÏßf3ºÿ ¼l¥ð¦ð¦ð¦ð¦ð¦ð¦ð¦ð¦ð¦ð¦ð¦X$D Qw±W€½AÁ¡7€ö´Ç¡¢zën¡A¡7QÞeVÝã² Äß·áÓñ< _5'V<‹!N§!¦•¥æÐjg©‰EíVï:È¢ªUÛ|…ƒ )Ñï§‹àøYá:mÝÀ£¯“ë˜]¾€ÔÛ.´aÆùt)^EáøÑ×é¯ [Ì.y,Õ׌åfç=SàkF”"³36À‚B_Ó…Þ²®SÒªøšŽE.C¢Ùë™Ækó´ôסãD¶Wb©Éî×fPèmÕìÙþ–=1fÆÂ_Àé Œ¾º§!^2ûqOö59³uñ5I³²zúšÎ³¥{_Ó¹7«¯Q¯Éíåî‚<í µ \IEND®B`‚tenmado-0.10/happy-L/image/sting-red.png0000644000175000017500000000077710276702754020710 0ustar00ooharaoohara00000000000000‰PNG  IHDR@0.)ëHbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ ,ެ¯ŒIDATxœí—]rƒ0 „cýØŽ 'êzÈ^³R(íƒ3MÚbŒA팿gv-ï ÌËÓóá?ÚÖR hS hS hS hS hS hS hS hS hS hS hS ÌÂ",²i‹­ DÛ6ÀL¶m âF61€ÎÙ&¸7¶ èܽ¨l9À"'Î…¼CæþtúÇ‚KN˜9L«Ì%›–*DÞ³¿®Í= Ë‘¼/Öw} ÀAJ¿¦þµÀuZ;tζÍ"õ`Ûf}²ó'`È{àU3$ïqèºìQd¶fò.ãà§J£ Ýyìûœ×3ÞIÌk:k’½lyM'/Ù ¤s^^Ó‰É^ô¡Hš@‘¼¦Ãr{NLöãã4ˆd7õ`â )+àYä=:[HÕ2â ø~~ºnæ±»fÖ²=AghfœÖwÉ«¶úˆÁ¹dÿœÀÎyMç^²¿±J^Ó™LöU«b^Óùl:ü™¼¦s›l*¸–íIü¹ºó'¸P.®,?ÝIEND®B`‚tenmado-0.10/happy-L/image/sting-red-damaged.png0000644000175000017500000000077610276702754022267 0ustar00ooharaoohara00000000000000‰PNG  IHDR@0.)ëHbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ ¹†"Ø‹IDATxœí—Qrƒ0 D³’lŒÈÉz^²kH?È´iIˆ1µ3~ `iY/¼½¾ìþ3dÝÀRŠkŠkŠkŠkŠkŠkŠkŠkŠkŠkŠkŠ€I$¨]µÄZ@,º‡0„E÷ ^©Ð*ÈU¢ Âp‚¨’«Ö¨%y—ˆƒ‚1>Å•'qÝáýré3VÌé‰ãú~÷`p­$.gÑ\ ±Â×¶yû«n†-×ú´õ[È;ˆt¶ÓRÈUÒ4³ºAšfy²Óˆ«Yô~äÊsw<$[‘(€Ä‘¯ü3ißûó)¥“„{"óÏ’dÏs !¯ñ¤%{†$.-¯ñ\“=çCå@–¼ÆÃ!ÐÙE&û¹ æZ7ëþZT˜kŸ8À>ÏùågûöÔµ‡‰Ë ˜˶„¼ËÄx ]ójÝýx*Ù¿Ø8¯ñˆø<>OÉÛÛä_„åϹpèá†y¼ãâOO¿Å[åå?ªIC ]aµU6¶’fŠ(àýKòbEX>à wö:? ]Ž'ÿâ“@Õ]´ËcÍË÷YÖÅIt}õl7Àd~†%Öé¢û›ZLÿ†u¯,ú·®²oåÅr÷Ô ·W™ _bmo„–öÏ/Šw `€¾L32ÖÑÝg+µ8Ü\»ÌñâÂXB½õ£ÎüX©äˬ×°w›ã}¿È»Ã29ãÖê4Ù·¢ijÜ÷¡éëìÝNûRI…oˆkÖë?=â¾Û$tzÄÍzýÙãrÖâ\P…Ï)³ƒ½ÛŹ lðk{#”û;þMm®]no„2G$Ö}4¾´°¯:)ÝÒÂþ}4.^J¬•åÿý>©PâùeeùP¼L³.N¢Š¿ãjæßºº8‰ Ó¬õÕ3|)‘ Âò²9W»&Âò °¾0n”€AÜa0[20(Âòš®Hb¯c–GçÇ*Í3Ÿïü˜CáÐn†¼pèÝ0¸òn˜GtÇÅ?~¢ºÝqqÄǸòøX¥’¯¸òRÉW…e`1„´ºRÜyZ])"ŒzÜ y„QªÉþIª_5i@5tn†¼ºYm•¸ò¬¶JÔØJâfÈkl%‘™"¨Z#n‰Uk4Sg#%`¸ºÚßæ²Í«U°Àd6Ì.yÝSCU²v7CÑ2O®Ž%å™qίLVÆÊç þ@§ñ Ñ`ù7‰ët½MR‰ë´#Pzždínëð>©‹Gîv7‰“_Xᣫòßñ::ˆ†®ÔgŠ,,fö·ƒº“äö·ƒXÌ(‡EÖáÎÙßþŸt(—-îœ)‡2ë6–Öü׳ó“ømLþ©É¬`à‚ž§˜Â@ ˜¸Óê2” +rJùãS'aDÃ7”-ª$ ,­é¤‡Œ’1¶„,Ð}R¤Í »OŠè1õL›Aö˜zFøé•6ƒ ?½¢·—wÚ ²·—wTÈÐfòËÀFŒÍ´ dc3jíh¡Í kíhALWmÓÕ†º-´dÝ–NÔgci3Èúl,²98Ú 2›ƒC,ÇôXªAÕ© Ãr §{€6¦˜„Aàç)[TI,Ç {ì´=û44”o>^ßUœÂYýŽÞÑ Êå诌0‹·êé…1“YcÔ¤O&³azaL9,²¶}vÉKƒ0»äUT¿,lÜSCž§î$ðÌ8‰Q*¹Þš_™ä]VIÀ»¬¥CTeàâªÏ>ø£éyíÙ{W}¥ç5XF“aymN‡÷ŒwY—׿4GºÿÕ\©· ¤qsE©á¶¢Ô5ÜÆ]©¯®Ûœàmw@ã¿xxIEND®B`‚tenmado-0.10/happy-L/image/uncertainty.png0000644000175000017500000000212210276702754021343 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ­#½utIMEÒ 5¥ªÃ”ßIDATxœÍ™}HaÀßÛ^·][¹¹1«±#‡Ö¨jQYQ”%…ôñ‡EŸ‘PPEeQþQ‰f+DF_T³XYË¡- ev8k©ËéÜé¶þ¸q»}XÛÜíî÷×öŽ?ž{Þ»çy^$ ‚äÁîv«ó»ýwoÏàO§çÏÐáóBþ ©H©’ÌÖÊæäËçéUjMv ×G’Ò²Zð†ûmÝ~ Á¿ðùüO…èÌTÏ8«t²_ãk¾‰êÏ>¶ü`ȉdñÒYUçÖ„0!­Qq¸¢aÌ;Ψ‰ͺR[6M"ø¿ÖÙÊf¦ãDgñÒY§.”D-Fk1šO“›g÷Õd´kÿ•Y%vÿ2íô½Öêúꪭ±LÏf^ P[cÁtrêyÖzú }Øícʼn8rrù9¤e2Ú-f[¡"±˜Ô­ iµ¾ÿÁn¨(°–Õ‚·µö±*’¶Ö>«×©!ÀöÙÉ…P‘Ø>;õEj$ Vl¼—xýÄ4|>¯Ö¸â÷Ѐ—m™p‡6ÖÙ¸UtëlÇC¸“X$<?´ôr-ZZz!‚®E –½£ã\‹–wtŽ @*­"sðxO® ¹'üéml¦Ž…P „Y>Û& 5˜ÔöÉɶI… Uðù¹¶ Ÿ®+Í¿Zý†m“*öçC¥Jµh)U¨/RËrPG÷Û2!4˜4TÊ•âAÎÔ6r¥í+îpØþ€mŸ×ïoUk²!@­Éž­• ²0© %‡š¡f¿ãKÕþ'l[êš ä¸0Ô,ÈÅt9éù¥†B)¦F˜áш«ßspçC¶Þ"^»»E‘+!¿†›}E®dåº<óËnV´ ÅåbI7.˜›:2ì´¾¬`_¥¾gì¶·¼~ÄCdÌI,ܬ/ZŒ£Eø&ÎkÎLYQ¸PuúbIìø4þHwÔCÝõˆé˜‰%‚Kw6ÇN'Õ"a4Ïbó‰Nœá3žJC dboб8DW\ýž»·ZŸ7u¦EhõzÝÎ=‹èÏ‚µHLF{cm*ïM© Ý´­ðßg*Ik‘à÷Ëæ®w¯z¯Ï4˜tÉJmqI^R‹ÉiQX-øÛ=Ý¿¼¾± úEŠ ,Åtòe«´I#Rü¤£§×˜’²IEND®B`‚tenmado-0.10/happy-L/image/uncertainty-damaged.png0000644000175000017500000000210610276702754022725 0ustar00ooharaoohara00000000000000‰PNG  IHDR22‘]æbKGDÿÿÿ ½§“ pHYs  ’ù¥tIMEÓ ;¿n…ÓIDATxœÍ™[HYÇÏŒ'“h.C:Ú¨!5²Þêêbu©U°]­PzÁ ‚,»,Û§ö­e/ì²ôaßÚ§–eaúàC¥„Z©ì¶[­¡I³æÒ&ÓŽ[SIŒ13“Ä}8ÃäZ7‰If~OÉ„~ü眙ï|Ûßßùã§^'M¯û·ÞlÞï†w"Q.€²Š*µ‚<¢¬®×Ö£ ͵T-YÀøX^Zn›ïÙc˦w;çøÇuí©áÎÆv}ñµ¼ÎÍ¿ŸXW—×r:¶ž†“ƒ†f]q´Þz¶f'MÁípÁBÉh´Uç&êŒÕ‡Ò2›ìóS‹,-Š‚á±Þ®Öµ~»ùðý»" %s¤Fýù ú5»ÇF§ïóZf“ÝiñŠÂiñ ·’×zõrCܨ„–Ûæ[³ÓâF…X³Ón›¯±]ëZ Q!Ö4¯µbrH!*ÄŠÉqæRôÓÝàžØ2)øé\œ·J'*Äâ¼â8&‰…Àq º,RKËeÙ€¤––\!ƒL„“ZZL„ƒL˜Ç Ù*–Ç`fe(`Œ‹wcsx9„€² ±MRÀ0 ÖÔ‘kŽM±MRhhÑÁ(“ÚJŒr1Ø5Ð:;ù§Ø&)t~ IJ%µ´HJÛõ*âÝ›€Ø2<5õ$_o©µÊP0"¶Z«¨h¾ÜwçÛûbûð _îH‹ª%«ëÈÝñSª¨©Éoö½ÎÍÉŸgŶ×Ï¡v!¿!34ëtm±Z~…¡ÑV -ÌDk$èÝý~Z¬÷#!‡_ÿ0ª¡Tèkb³¯¡T÷~´úÜ#ŠV[·Qp™¤G÷ž.ÿ¾Zf§žÏÚFÆû“¯¤7GÆû_¿ôEöز9)*‰4'µȱѩ[så)+Ztc×Îf¶O³·t™0ûëO3¥ÎLQI|ùÍŬåñA ð’γÌù”L–æ³ÀÈx<¾_еÙÖm<À är¸ô‡þ˜yþâ/WQ„>ék:s±;ùYP Âl²/Î[óÞTª½CŸ©ä­…ðÓë3—}Å“{}VSO¶ž0vœjÊë`1?-·Í÷ϲç_¯?Œpl4y ÃdTiG Ôñc^Ljÿ—¢áÇ”)IEND®B`‚tenmado-0.10/libbac/0000777000175000017500000000000011711666006015111 5ustar00ooharaoohara00000000000000tenmado-0.10/libbac/README0000644000175000017500000000107210276702754015773 0ustar00ooharaoohara00000000000000libbac --- high score file library $Id: README,v 1.7 2003/01/15 22:44:05 oohara Exp $ Files in this directory are for handling a high score file. You need Berkeley DB version 3 (libdb3) to build these files. You need aotuconf, automake, flex and bison in addition to hack these files. The parser assumes that NEWLINE (\n) and TAB (\t) are not printable. It checks them by isprint(), so it may fail to work under some locale. BAC are the initials one of my acquaintance (aka shumagorath II) uses when he enters his name in an arcade game. I don't know his real name. tenmado-0.10/libbac/Makefile.am0000644000175000017500000000235411710770426017146 0ustar00ooharaoohara00000000000000## Makefile.am for libbac ## process this file with automake --foreign to generate Makefile.in ## automake 1.11 or later is required # $Id: Makefile.am,v 1.28 2012/01/28 12:59:02 oohara Exp $ noinst_LIBRARIES = libbac.a # automake doesn't know that bison generates .h from .y, # so we must add .h to SOURCES and BUILT_SOURCES libbac_a_SOURCES= bac_array.c \ bac_array.h \ bac_dump.c \ bac_dump.h \ bac_entry.c \ bac_entry.h \ bac_entry_to_string.c \ bac_entry_to_string.h \ bac_lexical.h \ bac_lexical.l \ bac_load.c \ bac_load.h \ bac_parser.h \ bac_parser.y \ bac_parser_public.h \ bac_save.c \ bac_save.h \ bac_string_to_array.c \ bac_string_to_array.h \ bac_truncate.c \ bac_truncate.h BUILT_SOURCES = bac_parser.h AM_YFLAGS = -d # -olex.yy.c is a workaround for automake braindamage AM_LFLAGS = -Pbac_ -olex.yy.c -Cfe -8 #CC_WARNINGS = -Wall # the overkill warnings # I don't use -Wtraditional because I use string concatenation CC_WARNINGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -Winline -pedantic # -g -O2 are in CFLAGS by default, don't use @CFLAGS@ here AM_CFLAGS = $(CC_WARNINGS) tenmado-0.10/libbac/Makefile.in0000644000175000017500000003561111711665645017170 0ustar00ooharaoohara00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # $Id: Makefile.am,v 1.28 2012/01/28 12:59:02 oohara Exp $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : subdir = libbac DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ bac_lexical.c bac_parser.c bac_parser.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libbac_a_AR = $(AR) $(ARFLAGS) libbac_a_LIBADD = am_libbac_a_OBJECTS = bac_array.$(OBJEXT) bac_dump.$(OBJEXT) \ bac_entry.$(OBJEXT) bac_entry_to_string.$(OBJEXT) \ bac_lexical.$(OBJEXT) bac_load.$(OBJEXT) bac_parser.$(OBJEXT) \ bac_save.$(OBJEXT) bac_string_to_array.$(OBJEXT) \ bac_truncate.$(OBJEXT) libbac_a_OBJECTS = $(am_libbac_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) YLWRAP = $(top_srcdir)/ylwrap YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) SOURCES = $(libbac_a_SOURCES) DIST_SOURCES = $(libbac_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libbac.a # automake doesn't know that bison generates .h from .y, # so we must add .h to SOURCES and BUILT_SOURCES libbac_a_SOURCES = bac_array.c \ bac_array.h \ bac_dump.c \ bac_dump.h \ bac_entry.c \ bac_entry.h \ bac_entry_to_string.c \ bac_entry_to_string.h \ bac_lexical.h \ bac_lexical.l \ bac_load.c \ bac_load.h \ bac_parser.h \ bac_parser.y \ bac_parser_public.h \ bac_save.c \ bac_save.h \ bac_string_to_array.c \ bac_string_to_array.h \ bac_truncate.c \ bac_truncate.h BUILT_SOURCES = bac_parser.h AM_YFLAGS = -d # -olex.yy.c is a workaround for automake braindamage AM_LFLAGS = -Pbac_ -olex.yy.c -Cfe -8 #CC_WARNINGS = -Wall # the overkill warnings # I don't use -Wtraditional because I use string concatenation CC_WARNINGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -Winline -pedantic # -g -O2 are in CFLAGS by default, don't use @CFLAGS@ here AM_CFLAGS = $(CC_WARNINGS) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .l .o .obj .y $(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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libbac/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libbac/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 $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) bac_parser.h: bac_parser.c @if test ! -f $@; then \ rm -f bac_parser.c; \ $(MAKE) $(AM_MAKEFLAGS) bac_parser.c; \ else :; fi libbac.a: $(libbac_a_OBJECTS) $(libbac_a_DEPENDENCIES) -rm -f libbac.a $(libbac_a_AR) libbac.a $(libbac_a_OBJECTS) $(libbac_a_LIBADD) $(RANLIB) libbac.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_array.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_dump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_entry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_entry_to_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_lexical.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_load.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_save.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_string_to_array.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bac_truncate.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` .l.c: $(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LIBRARIES) installdirs: install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f bac_lexical.c -rm -f bac_parser.c -rm -f bac_parser.h -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) 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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: all check install install-am install-strip .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-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am 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 # 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: tenmado-0.10/libbac/bac_lexical.c0000644000175000017500000020754711711141713017507 0ustar00ooharaoohara00000000000000#line 2 "bac_lexical.c" #line 4 "bac_lexical.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 33 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ #if __STDC__ #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE bac_restart(bac_in ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int bac_leng; extern FILE *bac_in, *bac_out; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break * existing scanners that call yyless() from OUTSIDE bac_lex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-bac_lineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int yyl;\ for ( yyl = n; yyl < bac_leng; ++yyl )\ if ( bac_text[yyl] == '\n' )\ --bac_lineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up bac_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up bac_text again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef unsigned int yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via bac_restart()), so that the user can continue scanning by * just pointing bac_in at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when bac_text is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int bac_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow bac_wrap()'s to do buffer switches * instead of setting up a fresh bac_in. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void bac_restart (FILE *input_file ); void bac__switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE bac__create_buffer (FILE *file,int size ); void bac__delete_buffer (YY_BUFFER_STATE b ); void bac__flush_buffer (YY_BUFFER_STATE b ); void bac_push_buffer_state (YY_BUFFER_STATE new_buffer ); void bac_pop_buffer_state (void ); static void bac_ensure_buffer_stack (void ); static void bac__load_buffer_state (void ); static void bac__init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER bac__flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE bac__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE bac__scan_string (yyconst char *yy_str ); YY_BUFFER_STATE bac__scan_bytes (yyconst char *bytes,int len ); void *bac_alloc (yy_size_t ); void *bac_realloc (void *,yy_size_t ); void bac_free (void * ); #define yy_new_buffer bac__create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ bac_ensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ bac__create_buffer(bac_in,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ bac_ensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ bac__create_buffer(bac_in,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define bac_wrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *bac_in = (FILE *) 0, *bac_out = (FILE *) 0; typedef int yy_state_type; extern int bac_lineno; int bac_lineno = 1; extern char *bac_text; #define yytext_ptr bac_text static yyconst flex_int16_t yy_nxt[][34] = { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 7, 8, 9, 10, 8, 8, 8, 8, 11, 8, 12, 13, 14, 8, 15, 8, 16, 8, 8, 11, 8, 12, 8, 8, 8, 8, 8, 13, 8, 8, 14, 8, 15, 8 }, { 7, 8, 9, 10, 8, 8, 8, 8, 11, 8, 12, 13, 14, 8, 15, 8, 16, 8, 8, 11, 8, 12, 8, 8, 8, 8, 8, 13, 8, 8, 14, 8, 15, 8 }, { 7, 8, 17, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 }, { 7, 8, 17, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 }, { 7, 8, 20, 21, 8, 22, 22, 23, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 }, { 7, 8, 20, 21, 8, 22, 22, 23, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 }, { -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7, -7 }, { 7, 24, -8, -8, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9 }, { 7, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10, -10 }, { 7, 24, -11, -11, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 24, 24, 24, 24, 24 }, { 7, 24, -12, -12, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 26, 24, 24, 24, 24, 24, 24 }, { 7, 24, -13, -13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 27, 24 }, { 7, 24, -14, -14, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 28, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 29, 24, 24 }, { 7, 24, -15, -15, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 30, 24, 24, 24, 24, 24, 31, 24, 24, 24 }, { 7, 24, -16, -16, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 32, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, -17 }, { 7, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, -18 }, { 7, 24, -19, -19, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33 }, { 7, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, -20 }, { 7, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, -21 }, { 7, 24, -22, -22, 24, 24, 24, 34, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -23, -23, 24, 24, 24, 34, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -24, -24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -25, -25, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 35, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -26, -26, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 36, 24, 24 }, { 7, 24, -27, -27, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 37, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -28, -28, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 38, 24, 24, 24, 24, 24 }, { 7, 24, -29, -29, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 39, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -30, -30, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 40, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -31, -31, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 41, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -32, -32, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 42, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -33, -33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33 }, { 7, 24, -34, -34, 24, 24, 24, 34, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -35, -35, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 43, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -36, -36, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 44, 24, 24, 24, 24 }, { 7, 24, -37, -37, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 45, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -38, -38, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 46, 24, 24, 24, 24 }, { 7, 24, -39, -39, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 47, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -40, -40, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -41, -41, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 48, 24, 24, 24, 24 }, { 7, 24, -42, -42, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 49, 24, 24, 24, 24, 24, 24 }, { 7, 24, -43, -43, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 50, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -44, -44, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 51 }, { 7, 24, -45, -45, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 52, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -46, -46, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 53, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -47, -47, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 54, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -48, -48, 24, 24, 55, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -49, -49, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -50, -50, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 56, 24, 24, 24, 24, 24, 24 }, { 7, 24, -51, -51, 24, 24, 57, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -52, -52, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 58, 24, 24, 24, 24 }, { 7, 24, -53, -53, 24, 24, 59, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -54, -54, 24, 24, 60, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -55, -55, 24, 24, 24, 24, 24, 24, 24, 61, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 61, 24, 24, 24, 24, 24, 24 }, { 7, 24, -56, -56, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 62, 24, 24 }, { 7, 24, -57, -57, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 63, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -58, -58, 24, 24, 64, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -59, -59, 24, 24, 24, 24, 24, 24, 24, 24, 65, 66, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 65, 66, 24, 24 }, { 7, 24, -60, -60, 24, 24, 24, 24, 24, 67, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 67, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -61, -61, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 68, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -62, -62, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -63, -63, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 69, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -64, -64, 24, 24, 24, 24, 24, 24, 24, 24, 70, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 70, 24, 24, 24 }, { 7, 24, -65, -65, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 71, 24, 24, 72, 24, 24 }, { 7, 24, -66, -66, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 73, 24, 24, 24, 24, 24 }, { 7, 24, -67, -67, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 74, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -68, -68, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 75, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -69, -69, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 76, 24, 24, 24, 24 }, { 7, 24, -70, -70, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 77, 24, 24 }, { 7, 24, -71, -71, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 78, 24, 24, 24, 24 }, { 7, 24, -72, -72, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 79, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -73, -73, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 80, 24, 24 }, { 7, 24, -74, -74, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 81, 24, 24 }, { 7, 24, -75, -75, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 82, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -76, -76, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 83, 24, 24, 24 }, { 7, 24, -77, -77, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 84, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -78, -78, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 85, 24, 24 }, { 7, 24, -79, -79, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 86, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -80, -80, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 87, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -81, -81, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 88, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -82, -82, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -83, -83, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 89, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -84, -84, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 90, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -85, -85, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -86, -86, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 91, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -87, -87, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 92, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -88, -88, 24, 24, 93, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -89, -89, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 94, 24, 24, 24, 24, 24 }, { 7, 24, -90, -90, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 95, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -91, -91, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -92, -92, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -93, -93, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 96, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -94, -94, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 97, 24, 24, 24, 24, 24, 24 }, { 7, 24, -95, -95, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -96, -96, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 98, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -97, -97, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -98, -98, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 99, 24, 24, 24, 24 }, { 7, 24, -99, -99, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 100, 24, 24, 24 }, { 7, 24, -100, -100, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 101, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, { 7, 24, -101, -101, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 102, 24, 24, 24, 24, 24 }, { 7, 24, -102, -102, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 103, 24, 24, 24, 24, 24, 24 }, { 7, 24, -103, -103, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 }, } ; static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up bac_text. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ bac_leng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 20 #define YY_END_OF_BUFFER 21 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[104] = { 0, 0, 0, 0, 0, 0, 0, 21, 19, 18, 17, 19, 19, 19, 19, 19, 19, 14, 16, 12, 13, 15, 19, 11, 19, 19, 19, 19, 19, 19, 19, 19, 19, 12, 11, 19, 19, 19, 19, 19, 5, 19, 19, 19, 19, 19, 19, 19, 19, 4, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 2, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 6, 19, 19, 7, 19, 19, 19, 19, 19, 10, 8, 19, 19, 9, 19, 1, 19, 19, 19, 19, 19, 3 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 6, 4, 4, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 9, 10, 4, 4, 4, 4, 4, 4, 4, 4, 11, 4, 4, 4, 4, 12, 13, 14, 15, 16, 4, 4, 4, 4, 4, 4, 4, 4, 4, 17, 18, 19, 20, 21, 4, 22, 23, 24, 4, 4, 25, 26, 27, 28, 4, 4, 29, 30, 31, 32, 15, 16, 4, 33, 4, 4, 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; /* Table of booleans, true if rule could match eol. */ static yyconst flex_int32_t yy_rule_can_match_eol[21] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, }; extern int bac__flex_debug; int bac__flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *bac_text; #line 1 "bac_lexical.l" /* hi emacs, this is a part of -*- C -*- source */ /* $Id: bac_lexical.l,v 1.20 2012/01/29 03:56:41 oohara Exp $ */ /* process this file with flex -Pbac_ */ /* definitions */ #define YY_NO_INPUT 1 #line 26 "bac_lexical.l" /* FILE */ #include /* strtol, malloc */ #include /* strlen, strncpy */ #include /* errno */ #include /* this is generated by bison -d */ #include "bac_parser.h" #include "bac_lexical.h" static char *silly_tail = NULL; /* rules */ /* this comment must be before %% */ #line 1257 "bac_lexical.c" #define INITIAL 0 #define value_string 1 #define value_long_int 2 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int bac_wrap (void ); #else extern int bac_wrap (void ); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO (void) fwrite( bac_text, bac_leng, 1, bac_out ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( bac_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( bac_in ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, bac_in))==0 && ferror(bac_in)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(bac_in); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int bac_lex (void); #define YY_DECL int bac_lex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after bac_text and bac_leng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 46 "bac_lexical.l" #line 1412 "bac_lexical.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! bac_in ) bac_in = stdin; if ( ! bac_out ) bac_out = stdout; if ( ! YY_CURRENT_BUFFER ) { bac_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = bac__create_buffer(bac_in,YY_BUF_SIZE ); } bac__load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of bac_text. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: while ( (yy_current_state = yy_nxt[yy_current_state][ yy_ec[YY_SC_TO_UI(*yy_cp)] ]) > 0 ) ++yy_cp; yy_current_state = -yy_current_state; yy_find_action: yy_act = yy_accept[yy_current_state]; YY_DO_BEFORE_ACTION; if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) { int yyl; for ( yyl = 0; yyl < bac_leng; ++yyl ) if ( bac_text[yyl] == '\n' ) bac_lineno++; ; } do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 1: YY_RULE_SETUP #line 47 "bac_lexical.l" { BEGIN(value_long_int); bac_lval.val_int = BEGIN_ENTRY_VERSION; return BEGIN_ENTRY_VERSION;} YY_BREAK case 2: YY_RULE_SETUP #line 52 "bac_lexical.l" { BEGIN(value_string); bac_lval.val_int = BEGIN_COMMENT; return BEGIN_COMMENT;} YY_BREAK case 3: YY_RULE_SETUP #line 57 "bac_lexical.l" { BEGIN(value_long_int); bac_lval.val_int = BEGIN_STAGE_DATA_VERSION; return BEGIN_STAGE_DATA_VERSION;} YY_BREAK case 4: YY_RULE_SETUP #line 62 "bac_lexical.l" { BEGIN(value_long_int); bac_lval.val_int = BEGIN_WHEN; return BEGIN_WHEN;} YY_BREAK case 5: YY_RULE_SETUP #line 67 "bac_lexical.l" { BEGIN(value_long_int); bac_lval.val_int = BEGIN_UID; return BEGIN_UID;} YY_BREAK case 6: YY_RULE_SETUP #line 72 "bac_lexical.l" { BEGIN(value_string); bac_lval.val_int = BEGIN_USER_NAME; return BEGIN_USER_NAME;} YY_BREAK case 7: YY_RULE_SETUP #line 77 "bac_lexical.l" { BEGIN(value_long_int); bac_lval.val_int = BEGIN_SCORE_SORT; return BEGIN_SCORE_SORT;} YY_BREAK case 8: YY_RULE_SETUP #line 82 "bac_lexical.l" { BEGIN(value_long_int); bac_lval.val_int = BEGIN_SCORE_TOTAL; return BEGIN_SCORE_TOTAL;} YY_BREAK case 9: YY_RULE_SETUP #line 87 "bac_lexical.l" { BEGIN(value_long_int); bac_lval.val_int = BEGIN_NUMBER_STAGE; return BEGIN_NUMBER_STAGE;} YY_BREAK case 10: YY_RULE_SETUP #line 92 "bac_lexical.l" { BEGIN(value_long_int); bac_lval.val_int = BEGIN_SCORE_STAGE; return BEGIN_SCORE_STAGE;} YY_BREAK case 11: YY_RULE_SETUP #line 97 "bac_lexical.l" { /* you can write 7 as 007 for example, but it is always decimal, * not octal */ /* to detect overflow */ errno = 0; bac_lval.val_long_int = strtol(bac_text, &silly_tail, 10); if (silly_tail[0] != '\0') { fprintf(stderr, "bac_lexical.l: strange integer\n"); return LEXICAL_ERROR; } if (errno != 0) { fprintf(stderr, "bac_lexical.l: integer overflow\n"); return LEXICAL_ERROR; } return LONG_INT;} YY_BREAK case 12: YY_RULE_SETUP #line 115 "bac_lexical.l" { /* note that [:print:] does not match \t or \n */ /* +1 is for the trailing \0 */ bac_lval.val_string = (char *) malloc(sizeof (char) * (strlen(bac_text) + 1)); if (bac_lval.val_string == NULL) { fprintf(stderr, "bac_lexical.l: malloc(string) failed\n"); return LEXICAL_ERROR; } strncpy(bac_lval.val_string, bac_text, strlen(bac_text)); bac_lval.val_string[strlen(bac_text)] = '\0'; return STRING;} YY_BREAK case 13: #line 129 "bac_lexical.l" case 14: YY_RULE_SETUP #line 129 "bac_lexical.l" { bac_lval.val_int = '\t'; return TAB;} YY_BREAK case 15: /* rule 15 can match eol */ #line 134 "bac_lexical.l" case 16: /* rule 16 can match eol */ YY_RULE_SETUP #line 134 "bac_lexical.l" { BEGIN(INITIAL); bac_lval.val_int = '\n'; return NEWLINE;} YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP #line 139 "bac_lexical.l" { /* empty line*/ return END_OF_ENTRY;} YY_BREAK case 18: YY_RULE_SETUP #line 143 "bac_lexical.l" { /* no field name */ return LEXICAL_ERROR;} YY_BREAK case 19: YY_RULE_SETUP #line 147 "bac_lexical.l" { /* catch-all */ return LEXICAL_ERROR;} YY_BREAK case 20: YY_RULE_SETUP #line 151 "bac_lexical.l" ECHO; YY_BREAK #line 1643 "bac_lexical.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(value_string): case YY_STATE_EOF(value_long_int): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed bac_in at a new source and called * bac_lex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = bac_in; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( bac_wrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * bac_text, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of bac_lex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ bac_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; bac_restart(bac_in ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { yy_current_state = yy_nxt[yy_current_state][(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1)]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; yy_current_state = yy_nxt[yy_current_state][1]; yy_is_jam = (yy_current_state <= 0); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ bac_restart(bac_in ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( bac_wrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve bac_text */ (yy_hold_char) = *++(yy_c_buf_p); if ( c == '\n' ) bac_lineno++; ; return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void bac_restart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ bac_ensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = bac__create_buffer(bac_in,YY_BUF_SIZE ); } bac__init_buffer(YY_CURRENT_BUFFER,input_file ); bac__load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void bac__switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * bac_pop_buffer_state(); * bac_push_buffer_state(new_buffer); */ bac_ensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; bac__load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (bac_wrap()) processing, but the only time this flag * is looked at is after bac_wrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void bac__load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; bac_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE bac__create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) bac_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in bac__create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) bac_alloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in bac__create_buffer()" ); b->yy_is_our_buffer = 1; bac__init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with bac__create_buffer() * */ void bac__delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) bac_free((void *) b->yy_ch_buf ); bac_free((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a bac_restart() or at EOF. */ static void bac__init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; bac__flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then bac__init_buffer was _probably_ * called from bac_restart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void bac__flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) bac__load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void bac_push_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; bac_ensure_buffer_stack(); /* This block is copied from bac__switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from bac__switch_to_buffer. */ bac__load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void bac_pop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; bac__delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { bac__load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void bac_ensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)bac_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)bac_realloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE bac__scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) bac_alloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in bac__scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; bac__switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to bac_lex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * bac__scan_bytes() instead. */ YY_BUFFER_STATE bac__scan_string (yyconst char * yystr ) { return bac__scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to bac_lex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE bac__scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) bac_alloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in bac__scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = bac__scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in bac__scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up bac_text. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ bac_text[bac_leng] = (yy_hold_char); \ (yy_c_buf_p) = bac_text + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ bac_leng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current token. * */ static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from bac_lex_destroy(), so don't allocate here. */ /* We do not touch bac_lineno unless the option is enabled. */ bac_lineno = 1; (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT bac_in = stdin; bac_out = stdout; #else bac_in = (FILE *) 0; bac_out = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * bac_lex_init() */ return 0; } /* bac_lex_destroy is for both reentrant and non-reentrant scanners. */ int bac_lex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ bac__delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; bac_pop_buffer_state(); } /* Destroy the stack itself. */ bac_free((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * bac_lex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *bac_alloc (yy_size_t size ) { return (void *) malloc( size ); } void *bac_realloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void bac_free (void * ptr ) { free( (char *) ptr ); /* see bac_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 151 "bac_lexical.l" /* user code */ void bac_read_from_file(FILE *file) { /* bac_restart */ bac_restart(file); } /* the return value is void because bac_restart() returns void * --- you can't check if it succeeded */ void bac_read_from_string(const char *string) { /* bac__scan_string */ bac__scan_string(string); } void bac_close_string(void) { /* bac__delete_buffer */ bac__delete_buffer(YY_CURRENT_BUFFER); } tenmado-0.10/libbac/bac_parser.c0000644000175000017500000015067411711141713017360 0ustar00ooharaoohara00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Using locations. */ #define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse bac_parse #define yylex bac_lex #define yyerror bac_error #define yylval bac_lval #define yychar bac_char #define yydebug bac_debug #define yynerrs bac_nerrs /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NEWLINE = 258, TAB = 259, LONG_INT = 260, STRING = 261, BEGIN_ENTRY_VERSION = 262, BEGIN_COMMENT = 263, BEGIN_STAGE_DATA_VERSION = 264, BEGIN_WHEN = 265, BEGIN_TOTAL_SCORE = 266, BEGIN_UID = 267, BEGIN_USER_NAME = 268, BEGIN_SCORE_SORT = 269, BEGIN_SCORE_TOTAL = 270, BEGIN_NUMBER_STAGE = 271, BEGIN_SCORE_STAGE = 272, END_OF_ENTRY = 273, LEXICAL_ERROR = 274 }; #endif /* Tokens. */ #define NEWLINE 258 #define TAB 259 #define LONG_INT 260 #define STRING 261 #define BEGIN_ENTRY_VERSION 262 #define BEGIN_COMMENT 263 #define BEGIN_STAGE_DATA_VERSION 264 #define BEGIN_WHEN 265 #define BEGIN_TOTAL_SCORE 266 #define BEGIN_UID 267 #define BEGIN_USER_NAME 268 #define BEGIN_SCORE_SORT 269 #define BEGIN_SCORE_TOTAL 270 #define BEGIN_NUMBER_STAGE 271 #define BEGIN_SCORE_STAGE 272 #define END_OF_ENTRY 273 #define LEXICAL_ERROR 274 /* Copy the first part of user declarations. */ #line 5 "bac_parser.y" #include /* malloc */ #include /* time_t */ #include /* uid_t */ #include /* INT_MIN, INT_MAX */ #include #include "bac_array.h" #include "bac_entry.h" #include "bac_parser_public.h" #include "bac_lexical.h" /* this is generated by bison -d */ #include "bac_parser.h" static bac_array *p = NULL; static bac_array *p_temp = NULL; static int entry_version_available = 0; static int entry_version = 0; static int stage_data_version_available = 0; static int stage_data_version = 0; static int when_available = 0; static time_t when = 0; static int uid_available = 0; static uid_t uid = 0; static int user_name_available = 0; static char *user_name = NULL; static int score_sort_available = 0; static int score_sort = 0; static int score_total_available = 0; static int score_total = 0; /* there is no number_stage_available --- you should check * if score_stage is not NULL instead */ static int number_stage = 0; static int *score_stage = NULL; static int silly_i; static void bac_error(const char *s); static void bac_parser_clear_entry(void); static int bac_parser_check_entry(void); /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 56 "bac_parser.y" { int val_int; long int val_long_int; char *val_string; } /* Line 187 of yacc.c. */ #line 196 "bac_parser.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 216 of yacc.c. */ #line 209 "bac_parser.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int i) #else static int YYID (i) int i; #endif { return i; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss; YYSTYPE yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack, Stack, yysize); \ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 2 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 57 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 20 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 15 /* YYNRULES -- Number of rules. */ #define YYNRULES 26 /* YYNRULES -- Number of states. */ #define YYNSTATES 60 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 274 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 4, 7, 10, 12, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 21, 0, -1, -1, 21, 22, -1, 23, 18, -1, 24, -1, 23, 24, -1, 25, -1, 26, -1, 27, -1, 28, -1, 29, -1, 30, -1, 31, -1, 32, -1, 33, -1, 34, -1, 7, 4, 5, 3, -1, 8, 4, 6, 3, -1, 9, 4, 5, 3, -1, 10, 4, 5, 3, -1, 12, 4, 5, 3, -1, 13, 4, 6, 3, -1, 14, 4, 5, 3, -1, 15, 4, 5, 3, -1, 16, 4, 5, 3, -1, 17, 4, 5, 4, 5, 3, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 104, 104, 107, 113, 137, 138, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 153, 165, 171, 183, 190, 197, 209, 221, 233, 262 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "NEWLINE", "TAB", "LONG_INT", "STRING", "BEGIN_ENTRY_VERSION", "BEGIN_COMMENT", "BEGIN_STAGE_DATA_VERSION", "BEGIN_WHEN", "BEGIN_TOTAL_SCORE", "BEGIN_UID", "BEGIN_USER_NAME", "BEGIN_SCORE_SORT", "BEGIN_SCORE_TOTAL", "BEGIN_NUMBER_STAGE", "BEGIN_SCORE_STAGE", "END_OF_ENTRY", "LEXICAL_ERROR", "$accept", "input", "entry", "fields", "field", "entry_version_field", "comment_field", "stage_data_version_field", "when_field", "uid_field", "user_name_field", "score_sort_field", "score_total_field", "number_stage_field", "score_stage_field", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 20, 21, 21, 22, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 0, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 26 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 1, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -11 static const yytype_int8 yypact[] = { -11, 0, -11, -3, -2, -1, 1, 2, 7, 18, 26, 27, 28, -11, 11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11, 29, 30, 32, 33, 34, 35, 37, 38, 39, 40, -11, -11, 43, 44, 45, 46, 47, 48, 49, 50, 51, 31, -11, -11, -11, -11, -11, -11, -11, -11, -11, 52, 53, -11 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -11, -11, -11, -11, -10, -11, -11, -11, -11, -11, -11, -11, -11, -11, -11 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 static const yytype_uint8 yytable[] = { 2, 26, 27, 28, 37, 29, 30, 3, 4, 5, 6, 31, 7, 8, 9, 10, 11, 12, 3, 4, 5, 6, 32, 7, 8, 9, 10, 11, 12, 36, 33, 34, 35, 0, 38, 57, 39, 40, 41, 42, 0, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 0, 59, 58 }; static const yytype_int8 yycheck[] = { 0, 4, 4, 4, 14, 4, 4, 7, 8, 9, 10, 4, 12, 13, 14, 15, 16, 17, 7, 8, 9, 10, 4, 12, 13, 14, 15, 16, 17, 18, 4, 4, 4, -1, 5, 4, 6, 5, 5, 5, -1, 6, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, -1, 3, 5 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 21, 0, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 18, 24, 5, 6, 5, 5, 5, 6, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 5, 3 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) yytype_int16 *bottom; yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T yysyntax_error (char *yyresult, int yystate, int yychar) { int yyn = yypact[yystate]; if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) return 0; else { int yytype = YYTRANSLATE (yychar); YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; int yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *yyfmt; char const *yyf; static char const yyunexpected[] = "syntax error, unexpected %s"; static char const yyexpecting[] = ", expecting %s"; static char const yyor[] = " or %s"; char yyformat[sizeof yyunexpected + sizeof yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof yyor - 1))]; char const *yyprefix = yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yycount = 1; yyarg[0] = yytname[yytype]; yyfmt = yystpcpy (yyformat, yyunexpected); for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; yyformat[sizeof yyunexpected - 1] = '\0'; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; yyfmt = yystpcpy (yyfmt, yyprefix); yyprefix = yyor; } yyf = YY_(yyformat); yysize1 = yysize + yystrlen (yyf); yysize_overflow |= (yysize1 < yysize); yysize = yysize1; if (yysize_overflow) return YYSIZE_MAXIMUM; if (yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *yyp = yyresult; int yyi = 0; while ((*yyp = *yyf) != '\0') { if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyf += 2; } else { yyp++; yyf++; } } } return yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The look-ahead symbol. */ int yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif /* Three stacks and their tools: `yyss': related to states, `yyvs': related to semantic values, `yyls': related to locations. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss = yyssa; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yyn == 0 || yyn == YYTABLE_NINF) goto yyerrlab; yyn = -yyn; goto yyreduce; } if (yyn == YYFINAL) YYACCEPT; /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: #line 104 "bac_parser.y" { bac_parser_clear_entry(); } break; case 3: #line 108 "bac_parser.y" { bac_parser_clear_entry(); } break; case 4: #line 114 "bac_parser.y" { if (bac_parser_check_entry() != 0) { bac_error("bac_parser_check_entry failed"); YYABORT; } p_temp = bac_array_add_entry(p, bac_entry_new(0, stage_data_version, when, uid, user_name_available, user_name, score_sort, score_total, number_stage, score_stage)); if (p_temp == NULL) { bac_error("bac_array_add_entry failed"); YYABORT; } p = p_temp; } break; case 17: #line 154 "bac_parser.y" { if (((yyvsp[(3) - (4)].val_long_int) <= INT_MIN) || ((yyvsp[(3) - (4)].val_long_int) >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } entry_version = (int) (yyvsp[(3) - (4)].val_long_int); entry_version_available = 1; } break; case 18: #line 166 "bac_parser.y" { /* ignore */; } break; case 19: #line 172 "bac_parser.y" { if (((yyvsp[(3) - (4)].val_long_int) <= INT_MIN) || ((yyvsp[(3) - (4)].val_long_int) >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } stage_data_version = (int) (yyvsp[(3) - (4)].val_long_int); stage_data_version_available = 1; } break; case 20: #line 184 "bac_parser.y" { when = (time_t) (yyvsp[(3) - (4)].val_long_int); when_available = 1; } break; case 21: #line 191 "bac_parser.y" { uid = (uid_t) (yyvsp[(3) - (4)].val_long_int); uid_available = 1; } break; case 22: #line 198 "bac_parser.y" { if (user_name != NULL) { free(user_name); user_name = NULL; } user_name = (yyvsp[(3) - (4)].val_string); user_name_available = 1; } break; case 23: #line 210 "bac_parser.y" { if (((yyvsp[(3) - (4)].val_long_int) <= INT_MIN) || ((yyvsp[(3) - (4)].val_long_int) >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } score_sort = (int) (yyvsp[(3) - (4)].val_long_int); score_sort_available = 1; } break; case 24: #line 222 "bac_parser.y" { if (((yyvsp[(3) - (4)].val_long_int) <= INT_MIN) || ((yyvsp[(3) - (4)].val_long_int) >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } score_total = (int) (yyvsp[(3) - (4)].val_long_int); score_total_available = 1; } break; case 25: #line 234 "bac_parser.y" { if (((yyvsp[(3) - (4)].val_long_int) <= INT_MIN) || ((yyvsp[(3) - (4)].val_long_int) >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } if (((int) (yyvsp[(3) - (4)].val_long_int)) < 1) { bac_error("strange stage number"); YYABORT; } if (score_stage != NULL) { free(score_stage); score_stage = NULL; } score_stage = (int *) malloc(sizeof(int) * (yyvsp[(3) - (4)].val_long_int)); if (score_stage == NULL) { bac_error("malloc(score_stage) failed"); YYABORT; } for (silly_i = 0; silly_i < ((int) (yyvsp[(3) - (4)].val_long_int)); silly_i++) score_stage[silly_i] = 0; number_stage = (yyvsp[(3) - (4)].val_long_int); } break; case 26: #line 263 "bac_parser.y" { if (((yyvsp[(3) - (6)].val_long_int) <= INT_MIN) || ((yyvsp[(3) - (6)].val_long_int) >= INT_MAX) || ((yyvsp[(5) - (6)].val_long_int) <= INT_MIN) || ((yyvsp[(5) - (6)].val_long_int) >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } if (score_stage == NULL) { bac_error("total stage number not set " "before stage score"); YYABORT; } if ((((int) (yyvsp[(3) - (6)].val_long_int)) < 1) || (((int) (yyvsp[(3) - (6)].val_long_int)) > number_stage)) { bac_error("strange stage number"); YYABORT; } score_stage[((int) (yyvsp[(3) - (6)].val_long_int)) - 1] = (int) (yyvsp[(5) - (6)].val_long_int); } break; /* Line 1267 of yacc.c. */ #line 1623 "bac_parser.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else { YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T yyalloc = 2 * yysize; if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) yyalloc = YYSTACK_ALLOC_MAXIMUM; if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yyalloc); if (yymsg) yymsg_alloc = yyalloc; else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; } } if (0 < yysize && yysize <= yymsg_alloc) { (void) yysyntax_error (yymsg, yystate, yychar); yyerror (yymsg); } else { yyerror (YY_("syntax error")); if (yysize != 0) goto yyexhaustedlab; } } #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (yyn != YYPACT_NINF) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } #line 286 "bac_parser.y" /* additional C code */ /* this is the yyerror for bison */ static void bac_error(const char *s) { fprintf (stderr, "bac_parse: %s (line %d)\n", s, bac_lineno); } static void bac_parser_clear_entry(void) { entry_version_available = 0; entry_version = 0; stage_data_version_available = 0; stage_data_version = 0; when_available = 0; when = 0; uid_available = 0; uid = 0; user_name_available = 0; if (user_name != NULL) free(user_name); user_name = NULL; score_sort_available = 0; score_sort = 0; score_total_available = 0; score_total = 0; number_stage = 0; if (score_stage != NULL) free(score_stage); score_stage = NULL; } static int bac_parser_check_entry(void) { if (!entry_version_available) { fprintf(stderr, "bac_parser_check_entry: Entry-Version missing\n"); return 1; } if (entry_version != 0) { fprintf(stderr, "bac_parser_check_entry: unsupported Entry-Version\n"); return 1; } if (!stage_data_version_available) { fprintf(stderr, "bac_parser_check_entry: Stage-Data-Version missing\n"); return 1; } if (!when_available) { fprintf(stderr, "bac_parser_check_entry: When missing\n"); return 1; } if (!uid_available) { fprintf(stderr, "bac_parser_check_entry: Uid missing\n"); return 1; } /* missing user_name is OK */ if (!score_sort_available) { fprintf(stderr, "bac_parser_check_entry: Score-Sort missing\n"); return 1; } if (!score_total_available) { fprintf(stderr, "bac_parser_check_entry: Score-Total missing\n"); return 1; } return 0; } bac_array * bac_parser_get_array(void) { return p; } void bac_parser_delete_array(void) { /* don't delete p or p_temp here */ p = NULL; p_temp = NULL; } tenmado-0.10/libbac/bac_parser.h0000644000175000017500000000604011711141713017350 0ustar00ooharaoohara00000000000000/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 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, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NEWLINE = 258, TAB = 259, LONG_INT = 260, STRING = 261, BEGIN_ENTRY_VERSION = 262, BEGIN_COMMENT = 263, BEGIN_STAGE_DATA_VERSION = 264, BEGIN_WHEN = 265, BEGIN_TOTAL_SCORE = 266, BEGIN_UID = 267, BEGIN_USER_NAME = 268, BEGIN_SCORE_SORT = 269, BEGIN_SCORE_TOTAL = 270, BEGIN_NUMBER_STAGE = 271, BEGIN_SCORE_STAGE = 272, END_OF_ENTRY = 273, LEXICAL_ERROR = 274 }; #endif /* Tokens. */ #define NEWLINE 258 #define TAB 259 #define LONG_INT 260 #define STRING 261 #define BEGIN_ENTRY_VERSION 262 #define BEGIN_COMMENT 263 #define BEGIN_STAGE_DATA_VERSION 264 #define BEGIN_WHEN 265 #define BEGIN_TOTAL_SCORE 266 #define BEGIN_UID 267 #define BEGIN_USER_NAME 268 #define BEGIN_SCORE_SORT 269 #define BEGIN_SCORE_TOTAL 270 #define BEGIN_NUMBER_STAGE 271 #define BEGIN_SCORE_STAGE 272 #define END_OF_ENTRY 273 #define LEXICAL_ERROR 274 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE #line 56 "bac_parser.y" { int val_int; long int val_long_int; char *val_string; } /* Line 1489 of yacc.c. */ #line 93 "bac_parser.h" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif extern YYSTYPE bac_lval; tenmado-0.10/libbac/bac_array.c0000644000175000017500000000640610276702754017210 0ustar00ooharaoohara00000000000000/* $Id: bac_array.c,v 1.24 2003/02/11 11:38:36 oohara Exp $ */ #include /* malloc */ #include #include "bac_array.h" void bac_array_delete(bac_array *p) { int i; /* sanity check */ if (p == NULL) { fprintf(stderr, "bac_array_delete: p is NULL\n"); return; } if (p->n <= 0) { fprintf(stderr, "bac_array_delete: p->n is non-positive (%d)\n", p->n); return; } if (p->p == NULL) { fprintf(stderr, "bac_array_delete: p->p is NULL\n"); return; } for (i = 0; i < p->n; i++) if (p->p[i] != NULL) (*(p->p[i]->delete))(p->p[i]); free(p->p); free(p); } /* return the pointer to the new bac_array if successful, * NULL on error (in this case, p is left untouched) * if p is NULL, create a new bac_array which consists of * one entry (arg 2) * if successful, you must free p (return value) and must NOT * free entry (arg 2) */ bac_array * bac_array_add_entry(bac_array *p, bac_entry *entry) { bac_array *temp = NULL; bac_entry **p_temp = NULL; /* sanity check*/ /* p == NULL is OK*/ if (entry == NULL) { fprintf(stderr, "bac_array_add_entry: entry is NULL\n"); return NULL; } if (p != NULL) { p_temp = (bac_entry **) realloc(p->p, sizeof(bac_entry *) * (p->n + 1)); if (p_temp == NULL) { fprintf(stderr, "bac_array_add_entry: realloc failed\n"); return NULL; } p->p = p_temp; p->p[p->n] = entry; (p->n)++; return p; } /* if we reached here, new array is needed */ temp = (bac_array *) malloc(sizeof(bac_array)); if (temp == NULL) { fprintf(stderr, "bac_array_add_entry: malloc(temp) failed\n"); return NULL; } temp->p = (bac_entry **) malloc(sizeof(bac_entry *)); if (temp->p == NULL) { fprintf(stderr, "bac_array_add_entry: malloc(temp->p) failed\n"); free(temp); return NULL; } temp->p[0] = entry; temp->n = 1; return temp; } /* add the entries in array (arg 2) to p (arg 1) * return the pointer to the new bac_array if successful, * NULL on error (in this case, p is left untouched) * if p is NULL, simply return array (arg 2) * if p is not NULL and if successful, you must free p (return value) * and must NOT free array (arg 2) */ bac_array * bac_array_add_array(bac_array *p, bac_array *array) { bac_entry **p_temp = NULL; int i; /* sanity check*/ /* p == NULL is OK*/ if (array == NULL) { fprintf(stderr, "bac_array_add_array: array is NULL\n"); return NULL; } if (array->n <= 0) { fprintf(stderr, "bac_array_add_array: array->n is non-positive (%d)\n", array->n); return NULL; } if (array->p == NULL) { fprintf(stderr, "bac_array_add_array: array->p is NULL\n"); return NULL; } /* don't use bac_array_add_entry here --- we don't need partial success */ if (p != NULL) { p_temp = (bac_entry **) realloc(p->p, sizeof(bac_entry *) * (p->n + array->n)); if (p_temp == NULL) { fprintf(stderr, "bac_array_add_array: realloc failed\n"); return NULL; } p->p = p_temp; for (i = 0; i < array->n; i++) p->p[p->n + i] = array->p[i]; p->n += array->n; /* make sure array (arg 2) rests in peace */ free(array->p); free(array); return p; } return array; } tenmado-0.10/libbac/bac_array.h0000644000175000017500000000070010276702754017204 0ustar00ooharaoohara00000000000000/* $Id: bac_array.h,v 1.7 2002/12/07 03:21:34 oohara Exp $ */ #ifndef __BAC_ARRAY_H__ #define __BAC_ARRAY_H__ #include "bac_entry.h" struct _bac_array { /* number of entries */ int n; bac_entry **p; }; typedef struct _bac_array bac_array; void bac_array_delete(bac_array *p); bac_array *bac_array_add_entry(bac_array *p, bac_entry *entry); bac_array *bac_array_add_array(bac_array *p, bac_array *array); #endif /* not __BAC_ARRAY_H__ */ tenmado-0.10/libbac/bac_dump.c0000644000175000017500000000526110276702754017035 0ustar00ooharaoohara00000000000000/* $Id: bac_dump.c,v 1.14 2003/01/14 03:50:15 oohara Exp $ */ /* NOT_HAVE_POSIX */ #include #include /* free */ #include #ifndef NOT_HAVE_POSIX /* seteuid */ #include /* seteuid */ #include #endif /* not NOT_HAVE_POSIX */ #include "bac_array.h" #include "bac_load.h" #include "bac_entry_to_string.h" #include "bac_string_to_array.h" #include "bac_save.h" #include "bac_dump.h" /* return 0 on success, 1 on error */ int bac_dump(const char *dir, const char *file, int mode) { int i; bac_array *array = NULL; char *string = NULL; int no_entry; /* sanity check */ if (dir == NULL) { fprintf(stderr, "bac_dump: dir is NULL\n"); return 1; } if (file == NULL) { fprintf(stderr, "bac_dump: file is NULL\n"); return 1; } no_entry = 0; array = bac_load(dir, file, 1, BAC_LOAD_FLAG_NO_SORT, mode, &no_entry); if ((array == NULL) || (array->p == NULL)) { if (no_entry != 0) { /* don't use stdout here */ fprintf(stderr, "bac_dump: there is no entry\n"); return 0; } else { fprintf(stderr, "bac_dump: bac_load failed\n"); return 1; } /* should not reach here */ return 1; } for (i = 0; i < array->n; i++) { string = bac_entry_to_string(array->p[i]); if (string == NULL) { fprintf(stderr, "bac_dump: bac_entry_to_string failed\n"); bac_array_delete(array); return 1; } printf("%s", string); fflush(stdout); free(string); string = NULL; } bac_array_delete(array); return 0; } /* return 0 on success, 1 on error * only the superuser may undump * assumes dir (arg 1) already exists --- if not, it is an error */ int bac_undump(const char *dir, const char *file, int mode) { int i; bac_array *array = NULL; /* sanity check */ if (dir == NULL) { fprintf(stderr, "bac_undump: dir is NULL\n"); return 1; } if (file == NULL) { fprintf(stderr, "bac_undump: file is NULL\n"); return 1; } #ifndef NOT_HAVE_POSIX /* permission check * seteuid may be unnecessary, but in case (there is fakeroot) */ if ((geteuid() != 0) || (seteuid(0) != 0)) { fprintf(stderr, "bac_umdump: only the superuser may undump\n"); return 1; } #endif /* not NOT_HAVE_POSIX */ array = bac_file_to_array(stdin); if ((array == NULL) || (array->p == NULL)) { fprintf(stderr, "bac_umdump: bac_parse failed\n"); return 1; } for (i = 0; i < array->n; i++) { if (bac_save(dir, file, array->p[i], mode) != 0) { fprintf(stderr, "bac_umdump: bac_save failed\n"); bac_array_delete(array); return 1; } } bac_array_delete(array); return 0; } tenmado-0.10/libbac/bac_dump.h0000644000175000017500000000040610276702754017036 0ustar00ooharaoohara00000000000000/* $Id: bac_dump.h,v 1.4 2002/12/18 15:50:53 oohara Exp $ */ #ifndef __BAC_DUMP_H__ #define __BAC_DUMP_H__ int bac_dump(const char *dir, const char *file, int mode); int bac_undump(const char *dir, const char *file, int mode); #endif /* not __BAC_DUMP_H__ */ tenmado-0.10/libbac/bac_entry.c0000644000175000017500000001551510276702754017234 0ustar00ooharaoohara00000000000000/* $Id: bac_entry.c,v 1.44 2003/01/14 03:53:22 oohara Exp $ */ #include /* malloc */ #include /* strdup, strlen */ #include /* isprint */ #include /* CHAR_BIT */ #include #include "bac_entry.h" static void bac_entry_delete(bac_entry *p); static char *bac_entry_escape(const char *p); static int bac_compare_entry_ver_0(const void *a, const void *b); /* user_name and score_stage are duplicated --- you must free them */ bac_entry * bac_entry_new(int score_entry_version, int stage_data_version, time_t when, uid_t uid, int user_name_available, const char *user_name, int score_sort, int score_total, int number_stage, const int *score_stage) { int i; bac_entry_ver_0 *temp = NULL; /* sanity check */ if (score_entry_version != 0) { fprintf(stderr, "bac_entry_new: not supported score_entry_version " "(%d)\n", score_entry_version); return NULL; } if ((user_name_available != 0) && (user_name == NULL)) { fprintf(stderr, "bac_entry_new: user_name is NULL\n"); return NULL; } if (number_stage <= 0) { fprintf(stderr, "bac_entry_new: non-positive number_stage (%d)\n", number_stage); return NULL; } if (score_stage == NULL) { fprintf(stderr, "bac_entry_new: score_stage is NULL\n"); return NULL; } temp = (bac_entry_ver_0 *) malloc(sizeof(bac_entry_ver_0)); if (temp == NULL) { fprintf(stderr, "bac_entry_new: malloc(temp) failed\n"); return NULL; } temp->score_stage = (int *) malloc(sizeof(int) * number_stage); if (temp->score_stage == NULL) { fprintf(stderr, "bac_entry_new: malloc(temp->score_stage) failed\n"); free(temp); return NULL; } ((bac_entry *) temp)->klass = score_entry_version; ((bac_entry *) temp)->delete = (void (*)(void *)) bac_entry_delete; temp->stage_data_version = stage_data_version; temp->when = when; temp->uid = uid; temp->user_name_available = user_name_available; if (user_name_available != 0) { temp->user_name = bac_entry_escape(user_name); if (temp->user_name == NULL) { fprintf(stderr, "bac_entry_new: bac_entry_escape failed\n"); free(temp->score_stage); free(temp); return NULL; } } temp->score_sort = score_sort; temp->score_total = score_total; temp->number_stage = number_stage; for (i = 0; i < number_stage; i++) temp->score_stage[i] = score_stage[i]; return ((bac_entry *) temp); } static void bac_entry_delete(bac_entry *p) { /* sanity check */ if (p == NULL) { fprintf(stderr, "bac_entry_delete: p is NULL\n"); return; } if (p->klass != 0) { fprintf(stderr, "bac_entry_new: not supported score_entry_version " "(%d)\n", p->klass); return; } if ((((bac_entry_ver_0 *) p)->user_name_available != 0) &&(((bac_entry_ver_0 *) p)->user_name != NULL)) free(((bac_entry_ver_0 *) p)->user_name); free(((bac_entry_ver_0 *) p)->score_stage); free(p); } static char * bac_entry_escape(const char *p) { int i; int length; int length_allocated = 0; int length_used; char *temp = NULL; char *temp2 = NULL; /* sanity check */ if (p == NULL) { fprintf(stderr, "bac_entry_escape: p is NULL\n"); return NULL; } length = strlen(p); length_used = 0; /* +1 is for the trailing \0 */ temp = (char *) malloc(sizeof(char) * (length + 1)); if (temp == NULL) { fprintf(stderr, "bac_entry_escape: malloc failed\n"); return NULL; } length_allocated = length + 1; for (i = 0; i < length; i++) { /* usually, \t and \n are non-printable, but there may be * some problematic locale */ if ((isprint(p[i])) && (p[i] != '\t') && (p[i] != '\n')) { temp[length_used] = p[i]; length_used++; } else { fprintf(stderr, "bac_entry_escape: unprintable char found " "(\\x%x), escaping\n", p[i]); /* who said char is 8 bit? */ temp2 = (char *) realloc(temp, sizeof(char) * (length_allocated + strlen("\\") + CHAR_BIT * sizeof(char))); if (temp2 == NULL) { fprintf(stderr, "bac_entry_escape: realloc failed\n"); free(temp); return NULL; } temp = temp2; length_allocated += strlen("\\") + CHAR_BIT * sizeof(char); sprintf(temp + length_used, "\\x%x", p[i]); /* we allocated enough memory for the trailing \0, * so we can just use strlen here */ length_used = strlen(temp); } } temp[length_allocated - 1] = '\0'; return temp; } /* for qsort() * return a positive value if a (arg 1) should be after b (arg 2) * a negative value if a (arg 1) should be before b (arg 2) * 0 if a (arg 1) and b (arg 2) are the same */ /* this void * should be bac_entry ** */ int bac_compare_entry(const void *a, const void *b) { const bac_entry *a_temp = *((const bac_entry * const *) a); const bac_entry *b_temp = *((const bac_entry * const *) b); /* this is a nonsense because we assume klass == 0 */ if (a_temp->klass > b_temp->klass) return -1; else if (a_temp->klass < b_temp->klass) return 1; return bac_compare_entry_ver_0(a, b); } /* this void * should be bac_entry ** (no ver_0 here) */ static int bac_compare_entry_ver_0(const void *a, const void *b) { int i; const bac_entry_ver_0 *a_temp = ((const bac_entry_ver_0 *) *((const bac_entry * const *) a)); const bac_entry_ver_0 *b_temp = ((const bac_entry_ver_0 *) *((const bac_entry * const *) b)); if (a_temp->stage_data_version > b_temp->stage_data_version) return -1; else if (a_temp->stage_data_version < b_temp->stage_data_version) return 1; else if (a_temp->score_sort > b_temp->score_sort) return -1; else if (a_temp->score_sort < b_temp->score_sort) return 1; /* older entry comes first */ else if (difftime(a_temp->when, b_temp->when) < 0) return -1; else if (difftime(a_temp->when, b_temp->when) > 0) return 1; else if (a_temp->score_total > b_temp->score_total) return -1; else if (a_temp->score_total < b_temp->score_total) return 1; for (i = 1; (i <= a_temp->number_stage) && (i <= b_temp->number_stage); i++) { if (a_temp->score_stage[i - 1] > b_temp->score_stage[i - 1]) return -1; else if (a_temp->score_stage[i - 1] < b_temp->score_stage[i - 1]) return 1; } if ((a_temp->user_name_available) && (b_temp->user_name_available) && (a_temp->user_name != NULL) && (b_temp->user_name != NULL)) { if (strcmp(a_temp->user_name, b_temp->user_name) != 0) return strcmp(a_temp->user_name, b_temp->user_name); } /* so that non-root users are favored */ if (a_temp->uid > b_temp->uid) return -1; else if (a_temp->uid < b_temp->uid) return 1; return 0; } tenmado-0.10/libbac/bac_entry.h0000644000175000017500000000223210276702754017231 0ustar00ooharaoohara00000000000000/* $Id: bac_entry.h,v 1.15 2003/04/22 02:19:49 oohara Exp $ */ #ifndef __BAC_ENTRY_H__ #define __BAC_ENTRY_H__ /* NOT_HAVE_POSIX */ #include /* time_t */ #include #ifdef NOT_HAVE_POSIX #define uid_t int #else /* not NOT_HAVE_POSIX */ /* uid_t */ #include #endif /* not NOT_HAVE_POSIX */ struct _bac_entry { int klass; void (*delete)(void *); }; typedef struct _bac_entry bac_entry; /* "parent" must be first to to use inheritance in C (not C++) */ struct _bac_entry_ver_0 { bac_entry parent; int stage_data_version; time_t when; uid_t uid; int user_name_available; char *user_name; int score_sort; int score_total; int number_stage; int *score_stage; }; typedef struct _bac_entry_ver_0 bac_entry_ver_0; bac_entry *bac_entry_new(int score_entry_version, int stage_data_version, time_t when, uid_t uid, int user_name_available, const char *user_name, int score_sort, int score_total, int number_stage, const int *score_stage); int bac_compare_entry(const void *a, const void *b); #endif /* not __BAC_ENTRY_H__ */ tenmado-0.10/libbac/bac_entry_to_string.c0000644000175000017500000001226310276702754021321 0ustar00ooharaoohara00000000000000/* $Id: bac_entry_to_string.c,v 1.24 2003/01/14 03:56:36 oohara Exp $ */ #include /* malloc */ #include /* strdup, strlen */ #include /* time_t */ #include /* uid_t */ #include /* CHAR_BIT */ #include /* isprint */ #include #include "bac_entry_to_string.h" char * bac_entry_to_string(bac_entry *entry) { int i; char *temp = NULL; char *temp2 = NULL; int length = 0; int length_used = 0; /* sanity check */ if (entry == NULL) { fprintf(stderr, "bac_entry_to_string: entry is NULL\n"); return NULL; } if (entry->klass != 0) { fprintf(stderr, "bac_entry_to_string: not supported score_entry_version " "(%d)\n", entry->klass); return NULL; } if ((((bac_entry_ver_0 *) entry)->user_name_available != 0) && (((bac_entry_ver_0 *) entry)->user_name == NULL)) { fprintf(stderr, "bac_entry_to_string: entry->user_name is NULL\n"); return NULL; } if (((bac_entry_ver_0 *) entry)->number_stage <= 0) { fprintf(stderr, "bac_entry_to_string: entry->number_stage is " "non-positive\n"); return NULL; } if (((bac_entry_ver_0 *) entry)->score_stage == NULL) { fprintf(stderr, "bac_entry_to_string: entry->score_stage is NULL\n"); return NULL; } if (isprint('\n')) { fprintf(stderr, "bac_entry_to_string: \\n is printable\n"); return NULL; } if (isprint('\t')) { fprintf(stderr, "bac_entry_to_string: \\t is printable\n"); return NULL; } /* entry_version */ length += strlen("Entry-Version") + strlen("\t") + strlen("\n"); length += CHAR_BIT * sizeof(int); /* stage_data_version */ length += strlen("Stage-Data-Version") + strlen("\t") + strlen("\n"); length += CHAR_BIT * sizeof(int); /* when */ length += strlen("When") + strlen("\t") + strlen("\n"); length += CHAR_BIT * sizeof(time_t); /* uid */ length += strlen("Uid") + strlen("\t") + strlen("\n"); length += CHAR_BIT * sizeof(uid_t); /* there is no field for user_name_available */ if (((bac_entry_ver_0 *) entry)->user_name_available != 0) { /* user_name */ length += strlen("User-Name") + strlen("\t") + strlen("\n"); length += strlen(((bac_entry_ver_0 *) entry)->user_name); } /* score_sort */ length += strlen("Score-Sort") + strlen("\t") + strlen("\n"); length += CHAR_BIT * sizeof(int); /* score_total */ length += strlen("Score-Total") + strlen("\t") + strlen("\n"); length += CHAR_BIT * sizeof(int); /* number_stage */ length += strlen("Number-Stage") + strlen("\t") + strlen("\n"); length += CHAR_BIT * sizeof(int); /* score_stage */ length += (strlen("Score-Stage") + strlen("\t") * 2 + strlen("\n")) * ((bac_entry_ver_0 *) entry)->number_stage; length += CHAR_BIT * sizeof(int) * 2 * ((bac_entry_ver_0 *) entry)->number_stage; /* terminating \n */ length += strlen("\n"); /* trailing \0 */ length += 1; temp = (char *) malloc(sizeof(char) * length); if (temp == NULL) { fprintf(stderr, "bac_entry_to_string: malloc failed\n"); return NULL; } sprintf(temp, "Entry-Version\t%d\n" "Stage-Data-Version\t%d\n" "When\t%d\n" "Uid\t%d\n", 0, ((bac_entry_ver_0 *) entry)->stage_data_version, (int) (((bac_entry_ver_0 *) entry)->when), (int) (((bac_entry_ver_0 *) entry)->uid)); /* be paranoid */ temp[length - 1] = '\0'; length_used = strlen(temp); if (length_used >= length) { fprintf(stderr, "bac_entry_to_string: temp is too short\n"); free(temp); return NULL; } if (((bac_entry_ver_0 *) entry)->user_name_available != 0) { sprintf(temp + length_used, "User-Name\t%s\n", ((bac_entry_ver_0 *) entry)->user_name); temp[length - 1] = '\0'; length_used = strlen(temp); if (length_used >= length) { fprintf(stderr, "bac_entry_to_string: temp is too short\n"); free(temp); return NULL; } } sprintf(temp + length_used, "Score-Sort\t%d\n" "Score-Total\t%d\n" "Number-Stage\t%d\n", ((bac_entry_ver_0 *) entry)->score_sort, ((bac_entry_ver_0 *) entry)->score_total, ((bac_entry_ver_0 *) entry)->number_stage); temp[length - 1] = '\0'; for (i = 1; i <= ((bac_entry_ver_0 *) entry)->number_stage; i++) { length_used = strlen(temp); if (length_used >= length) { fprintf(stderr, "bac_entry_to_string: temp is too short\n"); free(temp); return NULL; } sprintf(temp + length_used, "Score-Stage\t%d\t%d\n", i, ((bac_entry_ver_0 *) entry)->score_stage[i - 1]); temp[length - 1] = '\0'; } length_used = strlen(temp); if (length_used + 1 >= length) { fprintf(stderr, "bac_entry_to_string: temp is too short\n"); free(temp); return NULL; } temp[length_used] = '\n'; temp[length_used + 1] = '\0'; /* free unused memory */ /* +2 (not +1) is for the trailing \0 */ temp2 = (char *) realloc(temp, sizeof(char) * ((size_t) (length_used + 2))); if (temp2 == NULL) { fprintf(stderr, "bac_entry_to_string: realloc failed\n"); free(temp); return NULL; } temp = temp2; return temp; } tenmado-0.10/libbac/bac_entry_to_string.h0000644000175000017500000000037710276702754021331 0ustar00ooharaoohara00000000000000/* $Id: bac_entry_to_string.h,v 1.2 2002/11/30 15:46:53 oohara Exp $ */ #ifndef __BAC_ENTRY_TO_STRING_H__ #define __BAC_ENTRY_TO_STRING_H__ #include "bac_entry.h" char *bac_entry_to_string(bac_entry *entry); #endif /* not __BAC_ENTRY_TO_STRING_H__ */ tenmado-0.10/libbac/bac_lexical.h0000644000175000017500000000064011711142043017472 0ustar00ooharaoohara00000000000000/* $Id: bac_lexical.h,v 1.6 2012/01/29 03:59:31 oohara Exp $ */ #ifndef __BAC_LEXICAL_H__ #define __BAC_LEXICAL_H__ /* FILE */ #include /* yylineno */ extern int bac_lineno; /* yylex */ int bac_lex(void); /* yylex_destroy */ int bac_lex_destroy(void); void bac_read_from_file(FILE *file); void bac_read_from_string(const char *string); void bac_close_string(void); #endif /* not __BAC_LEXICAL_H__ */ tenmado-0.10/libbac/bac_lexical.l0000644000175000017500000000677411711141571017521 0ustar00ooharaoohara00000000000000/* hi emacs, this is a part of -*- C -*- source */ /* $Id: bac_lexical.l,v 1.20 2012/01/29 03:56:41 oohara Exp $ */ /* process this file with flex -Pbac_ */ /* definitions */ %option yylineno %option noyywrap %option noinput %option nounput %option noyyget_leng %option noyyget_text %option noyyget_lineno %option noyyset_lineno %option noyyget_in %option noyyset_in %option noyyget_out %option noyyset_out %option noyyget_debug %option noyyset_debug %x value_string %x value_long_int %{ /* FILE */ #include /* strtol, malloc */ #include /* strlen, strncpy */ #include /* errno */ #include /* this is generated by bison -d */ #include "bac_parser.h" #include "bac_lexical.h" static char *silly_tail = NULL; %} /* rules */ /* this comment must be before %% */ %% [eE]ntry-[vV]ersion { BEGIN(value_long_int); bac_lval.val_int = BEGIN_ENTRY_VERSION; return BEGIN_ENTRY_VERSION;} [cC]omment { BEGIN(value_string); bac_lval.val_int = BEGIN_COMMENT; return BEGIN_COMMENT;} [sS]tage-[dD]ata-[vV]ersion { BEGIN(value_long_int); bac_lval.val_int = BEGIN_STAGE_DATA_VERSION; return BEGIN_STAGE_DATA_VERSION;} [wW]hen { BEGIN(value_long_int); bac_lval.val_int = BEGIN_WHEN; return BEGIN_WHEN;} [uU]id { BEGIN(value_long_int); bac_lval.val_int = BEGIN_UID; return BEGIN_UID;} [uU]ser-[nN]ame { BEGIN(value_string); bac_lval.val_int = BEGIN_USER_NAME; return BEGIN_USER_NAME;} [sS]core-[sS]ort { BEGIN(value_long_int); bac_lval.val_int = BEGIN_SCORE_SORT; return BEGIN_SCORE_SORT;} [sS]core-[tT]otal { BEGIN(value_long_int); bac_lval.val_int = BEGIN_SCORE_TOTAL; return BEGIN_SCORE_TOTAL;} [nN]umber-[sS]tage { BEGIN(value_long_int); bac_lval.val_int = BEGIN_NUMBER_STAGE; return BEGIN_NUMBER_STAGE;} [sS]core-[sS]tage { BEGIN(value_long_int); bac_lval.val_int = BEGIN_SCORE_STAGE; return BEGIN_SCORE_STAGE;} [+\-]?[0-9]+ { /* you can write 7 as 007 for example, but it is always decimal, * not octal */ /* to detect overflow */ errno = 0; bac_lval.val_long_int = strtol(yytext, &silly_tail, 10); if (silly_tail[0] != '\0') { fprintf(stderr, "bac_lexical.l: strange integer\n"); return LEXICAL_ERROR; } if (errno != 0) { fprintf(stderr, "bac_lexical.l: integer overflow\n"); return LEXICAL_ERROR; } return LONG_INT;} [[:print:]]+ { /* note that [:print:] does not match \t or \n */ /* +1 is for the trailing \0 */ bac_lval.val_string = (char *) malloc(sizeof (char) * (strlen(yytext) + 1)); if (bac_lval.val_string == NULL) { fprintf(stderr, "bac_lexical.l: malloc(string) failed\n"); return LEXICAL_ERROR; } strncpy(bac_lval.val_string, yytext, strlen(yytext)); bac_lval.val_string[strlen(yytext)] = '\0'; return STRING;} \t | \t { bac_lval.val_int = '\t'; return TAB;} \n | \n { BEGIN(INITIAL); bac_lval.val_int = '\n'; return NEWLINE;} \n { /* empty line*/ return END_OF_ENTRY;} \t { /* no field name */ return LEXICAL_ERROR;} <*>[^\n\t]+ { /* catch-all */ return LEXICAL_ERROR;} %% /* user code */ void bac_read_from_file(FILE *file) { /* yyrestart */ bac_restart(file); } /* the return value is void because yyrestart() returns void * --- you can't check if it succeeded */ void bac_read_from_string(const char *string) { /* yy_scan_string */ bac__scan_string(string); } void bac_close_string(void) { /* yy_delete_buffer */ bac__delete_buffer(YY_CURRENT_BUFFER); } tenmado-0.10/libbac/bac_load.c0000644000175000017500000002437610276702754017017 0ustar00ooharaoohara00000000000000/* $Id: bac_load.c,v 1.89 2003/01/15 23:34:44 oohara Exp $ */ /* HAVE_LIBDB3, HAVE_LIBDB_3 */ #include #include /* qsort, malloc */ #include /* memset, strerror */ #include /* errno * ENOENT (from POSIX.1) */ #include /* stat (from POSIX.1) */ #include #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) /* libdb3 */ #include #endif /* (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ #include "bac_array.h" #include "bac_entry.h" #include "bac_string_to_array.h" #include "bac_load.h" #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) static bac_array *bac_load_add_new_entry(bac_array *array, const char *string, int n, int flag, DBC *cursorp); #endif /* (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ /* return a new bac_array which consists of loaded entries * no_entry (arg 6) is set to 1 if bac_load() returns NULL because * there is no entry, 0 if not * if an error happens, load the entries that are loaded * before the error * assumes all data in the database are null-terminated * note that the returned array may have more than n entries in it */ bac_array * bac_load(const char *dir, const char *file, int n, int flag, int mode, int *no_entry) { bac_array *p = NULL; #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) DB *dbp = NULL; DB_ENV *dbenvp = NULL; DBC *cursorp = NULL; DBT key; DBT data; u_int32_t dbflag = 0; int status; bac_array *p_temp = NULL; *no_entry = 0; /* sanity check */ if (dir == NULL) { fprintf(stderr, "bac_load: dir is NULL\n"); return NULL; } if (file == NULL) { fprintf(stderr, "bac_load: file is NULL\n"); return NULL; } if (n <= 0) { fprintf(stderr, "bac_load: n is non-positive\n"); return NULL; } /* this must be before db_create */ status = db_env_create(&dbenvp, 0); if (status != 0) { fprintf(stderr, "bac_load: db_env_create failed (%s)\n", db_strerror(status)); return NULL; } /* this must be before DB->open */ /* this directory must be present on the system before * this program is called (DB_CREATE creates only files in that * directory, not the directory itself) */ /* DB_INIT_CDB and DB_INIT_MPOOL means Concurrent Data Store */ status = dbenvp->open(dbenvp, dir, DB_INIT_CDB | DB_INIT_MPOOL | DB_CREATE, mode); if (status != 0) { fprintf(stderr, "bac_load: DBENV->open(%s) failed (%s)\n", dir, db_strerror(status)); dbenvp->close(dbenvp, 0); return NULL; } status = db_create(&dbp, dbenvp, 0); if (status != 0) { fprintf(stderr, "bac_load: db_create failed (%s)\n", db_strerror(status)); dbenvp->close(dbenvp, 0); return NULL; } status = dbp->open(dbp, file, NULL, DB_RECNO, DB_CREATE, mode); if (status != 0) { fprintf(stderr, "bac_load: DB->open(%s) failed (%s)\n", file, db_strerror(status)); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return NULL; } if (flag & BAC_LOAD_FLAG_NO_DELETE) dbflag = 0; else dbflag = DB_WRITECURSOR; status = dbp->cursor(dbp, NULL, &cursorp, dbflag); if (status != 0) { fprintf(stderr, "bac_load: DB->cursor failed (%s)\n", db_strerror(status)); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return NULL; } /* for compatibility with later version of libdb */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); status = cursorp->c_get(cursorp, &key, &data, DB_FIRST); if (status == DB_NOTFOUND) { /* there is no element in the database */ /* be quiet, there may be --dump option * the calling function should produce an appropriate error message */ *no_entry = 1; cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); /* there is no special return value here --- after all, * you have no array */ return NULL; } else if (status != 0) { fprintf(stderr, "bac_load: DBcursor->c_get(DB_FIRST) failed (%s)\n", db_strerror(status)); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return NULL; } if (((char *) (data.data))[(data.size / sizeof(char)) - 1] != '\0' ) { fprintf(stderr, "bac_load: data.data is not null-terminated\n"); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return NULL; } p_temp = bac_load_add_new_entry(p, (char *) (data.data), n, flag, cursorp); if (p_temp == NULL) { fprintf(stderr, "bac_load: bac_load_add_new_entry failed\n"); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return NULL; } p = p_temp; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); while(1 == 1) { status = cursorp->c_get(cursorp, &key, &data, DB_NEXT); if (status == DB_NOTFOUND) { /* no more entry in the database */ break; } else if (status != 0) { fprintf(stderr, "bac_load: DBcursor->c_get(DB_NEXT) failed (%s)\n", db_strerror(status)); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return p; } else { if (((char *) (data.data))[(data.size / sizeof(char)) - 1] != '\0' ) { fprintf(stderr, "bac_load: data.data is not null-terminated\n"); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return p; } p_temp = bac_load_add_new_entry(p, (char *) (data.data), n, flag, cursorp); if (p_temp == NULL) { fprintf(stderr, "bac_load: bac_load_add_new_entry failed\n"); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return p; } p = p_temp; memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); } } cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); #else /* not (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ FILE *fp = NULL; size_t length; char *file_abs = NULL; struct stat buf; *no_entry = 0; /* sanity check */ if (dir == NULL) { fprintf(stderr, "bac_load: dir is NULL\n"); return NULL; } if (file == NULL) { fprintf(stderr, "bac_load: file is NULL\n"); return NULL; } if (n <= 0) { fprintf(stderr, "bac_load: n is non-positive\n"); return NULL; } /* +1 is for the trailing \0 */ length = strlen(dir) + strlen(file) + 1; file_abs = (char *) malloc(sizeof(char) * length); if (file_abs == NULL) { fprintf(stderr, "bac_load: malloc(file_abs) failed\n"); return NULL; } strncpy(file_abs, dir, length); file_abs[length - 1] = '\0'; strncpy(file_abs + strlen(file_abs), file, length - strlen(file_abs)); file_abs[length - 1] = '\0'; /* see if the file exists */ errno = 0; if (stat(file_abs, &buf) != 0) { if (errno == ENOENT) { /* there is no element in the database --- in fact, no database */ /* be quiet, there may be --dump option * the calling function should produce an appropriate error message */ *no_entry = 1; free(file_abs); /* there is no special return value here --- after all, * you have no array */ return NULL; } else { /* real error */ fprintf(stderr, "bac_load: stat failed"); if (errno != 0) fprintf(stderr, " (%s)", strerror(errno)); fprintf(stderr, "\n"); free(file_abs); return NULL; } } errno = 0; fp = fopen(file_abs, "r"); if (fp == NULL) { fprintf(stderr, "bac_load: fopen failed"); if (errno != 0) fprintf(stderr, " (%s)", strerror(errno)); fprintf(stderr, "\n"); free(file_abs); return NULL; } p = bac_file_to_array(fp); fclose(fp); free(file_abs); if ((p != NULL) &&(!((flag & BAC_LOAD_FLAG_NO_SORT) == BAC_LOAD_FLAG_NO_SORT))) qsort((void *) p->p, (size_t) (p->n), sizeof(bac_entry *), (int (*)(const void *, const void *)) bac_compare_entry); #endif /* not (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ return p; } #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) /* assumes array (arg 1) is sorted as long as it is not NULL */ static bac_array * bac_load_add_new_entry(bac_array *array, const char *string, int n, int flag, DBC *cursorp) { bac_array *array_new = NULL; bac_array *array_temp = NULL; int in_nth; int status; array_new = bac_string_to_array(string); if (array_new == NULL) { fprintf(stderr, "bac_load_add_new_entry: bac_string_to_array failed\n"); return NULL; } /* simple !(flag & BAC_LOAD_FLAG_NO_SORT) is wrong */ if (!((flag & BAC_LOAD_FLAG_NO_SORT) == BAC_LOAD_FLAG_NO_SORT)) qsort((void *) array_new->p, (size_t) (array_new->n), sizeof(bac_entry *), (int (*)(const void *, const void *)) bac_compare_entry); if ((array != NULL) && (array_new != NULL) && (array->n >= n) && (bac_compare_entry((void *) (&(array->p[array->n - 1])), (void *) (&(array_new->p[0]))) <= 0)) { /* no entry in array_new is above nth */ /* false */ in_nth = 0; } else { /* true */ in_nth = 1; } if ((!(flag & BAC_LOAD_FLAG_NO_DELETE)) && (!in_nth)) { status = cursorp->c_del(cursorp, 0); if (status != 0) { fprintf(stderr, "bac_load_add_new_entry: " "DBcursor->c_del failed (%s)\n", db_strerror(status)); /* we may quit now because we return NULL regardless of flag */ if (array_new != NULL) bac_array_delete(array_new); return NULL; } } if ((flag & BAC_LOAD_FLAG_LOAD_ALL) || (in_nth)) { array_temp = bac_array_add_array(array, array_new); if (array_temp == NULL) { fprintf(stderr, "bac_load: bac_array_add_array failed\n"); if (array_new != NULL) bac_array_delete(array_new); return NULL; } array = array_temp; if (!((flag & BAC_LOAD_FLAG_NO_SORT) == BAC_LOAD_FLAG_NO_SORT)) qsort((void *) array->p, (size_t) (array->n), sizeof(bac_entry *), (int (*)(const void *, const void *)) bac_compare_entry); } return array; } #endif /* (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ tenmado-0.10/libbac/bac_load.h0000644000175000017500000000202410276702754017006 0ustar00ooharaoohara00000000000000/* $Id: bac_load.h,v 1.17 2003/01/11 21:41:56 oohara Exp $ */ #ifndef __BAC_LOAD_H__ #define __BAC_LOAD_H__ #include "bac_array.h" /* for flag in bac_load */ /* don't remove an entry from the database even if it is below nth * (it does not get into the returned array unless BAC_LOAD_FLAG_LOAD_ALL is * also specified) * ignored if Berkeley DB is unavailable (no entry is removed from * the database anyway) */ #define BAC_LOAD_FLAG_NO_DELETE 1 /* load all entries in the database * they may still be removed from the database after read * --- use BAC_LOAD_FLAG_NO_DELETE too if you don't like this * ignored if Berkeley DB is unavailable (all entries are loaded anyway) */ #define BAC_LOAD_FLAG_LOAD_ALL 2 /* don't sort entries * implies BAC_LOAD_FLAG_NO_DELETE and BAC_LOAD_FLAG_LOAD_ALL */ #define BAC_LOAD_FLAG_NO_SORT (4 | BAC_LOAD_FLAG_NO_DELETE | BAC_LOAD_FLAG_LOAD_ALL) bac_array *bac_load(const char *dir, const char *file, int n, int flag, int mode, int *no_entry); #endif /* not __BAC_LOAD_H__ */ tenmado-0.10/libbac/bac_parser.y0000644000175000017500000002265711711141401017377 0ustar00ooharaoohara00000000000000/* $Id: bac_parser.y,v 1.39 2012/01/29 03:54:41 oohara Exp $ */ /* process this file with bison -d */ /* C declarations */ %{ #include /* malloc */ #include /* time_t */ #include /* uid_t */ #include /* INT_MIN, INT_MAX */ #include #include "bac_array.h" #include "bac_entry.h" #include "bac_parser_public.h" #include "bac_lexical.h" /* this is generated by bison -d */ #include "bac_parser.h" static bac_array *p = NULL; static bac_array *p_temp = NULL; static int entry_version_available = 0; static int entry_version = 0; static int stage_data_version_available = 0; static int stage_data_version = 0; static int when_available = 0; static time_t when = 0; static int uid_available = 0; static uid_t uid = 0; static int user_name_available = 0; static char *user_name = NULL; static int score_sort_available = 0; static int score_sort = 0; static int score_total_available = 0; static int score_total = 0; /* there is no number_stage_available --- you should check * if score_stage is not NULL instead */ static int number_stage = 0; static int *score_stage = NULL; static int silly_i; static void bac_error(const char *s); static void bac_parser_clear_entry(void); static int bac_parser_check_entry(void); %} /* bison declatations */ %name-prefix="bac_" %union{ int val_int; long int val_long_int; char *val_string; } %token NEWLINE %token TAB %token LONG_INT %token STRING %token BEGIN_ENTRY_VERSION %token BEGIN_COMMENT %token BEGIN_STAGE_DATA_VERSION %token BEGIN_WHEN %token BEGIN_TOTAL_SCORE %token BEGIN_UID %token BEGIN_USER_NAME %token BEGIN_SCORE_SORT %token BEGIN_SCORE_TOTAL %token BEGIN_NUMBER_STAGE %token BEGIN_SCORE_STAGE %token END_OF_ENTRY %token LEXICAL_ERROR %type input %type entry /* note the plural */ %type fields %type field %type entry_version_field %type comment_field %type stage_data_version_field %type when_field %type uid_field %type user_name_field %type score_sort_field %type score_total_field %type number_stage_field %type score_stage_field %% /* grammar rules */ input: /* empty */ { bac_parser_clear_entry(); } | input entry { bac_parser_clear_entry(); } ; entry: fields END_OF_ENTRY { if (bac_parser_check_entry() != 0) { bac_error("bac_parser_check_entry failed"); YYABORT; } p_temp = bac_array_add_entry(p, bac_entry_new(0, stage_data_version, when, uid, user_name_available, user_name, score_sort, score_total, number_stage, score_stage)); if (p_temp == NULL) { bac_error("bac_array_add_entry failed"); YYABORT; } p = p_temp; } ; fields: field | fields field ; field: entry_version_field | comment_field | stage_data_version_field | when_field | uid_field | user_name_field | score_sort_field | score_total_field | number_stage_field | score_stage_field ; entry_version_field: BEGIN_ENTRY_VERSION TAB LONG_INT NEWLINE { if (($3 <= INT_MIN) || ($3 >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } entry_version = (int) $3; entry_version_available = 1; } ; comment_field: BEGIN_COMMENT TAB STRING NEWLINE { /* ignore */; } ; stage_data_version_field: BEGIN_STAGE_DATA_VERSION TAB LONG_INT NEWLINE { if (($3 <= INT_MIN) || ($3 >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } stage_data_version = (int) $3; stage_data_version_available = 1; } ; when_field: BEGIN_WHEN TAB LONG_INT NEWLINE { when = (time_t) $3; when_available = 1; } ; uid_field: BEGIN_UID TAB LONG_INT NEWLINE { uid = (uid_t) $3; uid_available = 1; } ; user_name_field: BEGIN_USER_NAME TAB STRING NEWLINE { if (user_name != NULL) { free(user_name); user_name = NULL; } user_name = $3; user_name_available = 1; } ; score_sort_field: BEGIN_SCORE_SORT TAB LONG_INT NEWLINE { if (($3 <= INT_MIN) || ($3 >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } score_sort = (int) $3; score_sort_available = 1; } ; score_total_field: BEGIN_SCORE_TOTAL TAB LONG_INT NEWLINE { if (($3 <= INT_MIN) || ($3 >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } score_total = (int) $3; score_total_available = 1; } ; number_stage_field: BEGIN_NUMBER_STAGE TAB LONG_INT NEWLINE { if (($3 <= INT_MIN) || ($3 >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } if (((int) $3) < 1) { bac_error("strange stage number"); YYABORT; } if (score_stage != NULL) { free(score_stage); score_stage = NULL; } score_stage = (int *) malloc(sizeof(int) * $3); if (score_stage == NULL) { bac_error("malloc(score_stage) failed"); YYABORT; } for (silly_i = 0; silly_i < ((int) $3); silly_i++) score_stage[silly_i] = 0; number_stage = $3; } ; score_stage_field: BEGIN_SCORE_STAGE TAB LONG_INT TAB LONG_INT NEWLINE { if (($3 <= INT_MIN) || ($3 >= INT_MAX) || ($5 <= INT_MIN) || ($5 >= INT_MAX)) { bac_error("too big or small integer"); YYABORT; } if (score_stage == NULL) { bac_error("total stage number not set " "before stage score"); YYABORT; } if ((((int) $3) < 1) || (((int) $3) > number_stage)) { bac_error("strange stage number"); YYABORT; } score_stage[((int) $3) - 1] = (int) $5; } ; %% /* additional C code */ /* this is the yyerror for bison */ static void bac_error(const char *s) { fprintf (stderr, "bac_parse: %s (line %d)\n", s, bac_lineno); } static void bac_parser_clear_entry(void) { entry_version_available = 0; entry_version = 0; stage_data_version_available = 0; stage_data_version = 0; when_available = 0; when = 0; uid_available = 0; uid = 0; user_name_available = 0; if (user_name != NULL) free(user_name); user_name = NULL; score_sort_available = 0; score_sort = 0; score_total_available = 0; score_total = 0; number_stage = 0; if (score_stage != NULL) free(score_stage); score_stage = NULL; } static int bac_parser_check_entry(void) { if (!entry_version_available) { fprintf(stderr, "bac_parser_check_entry: Entry-Version missing\n"); return 1; } if (entry_version != 0) { fprintf(stderr, "bac_parser_check_entry: unsupported Entry-Version\n"); return 1; } if (!stage_data_version_available) { fprintf(stderr, "bac_parser_check_entry: Stage-Data-Version missing\n"); return 1; } if (!when_available) { fprintf(stderr, "bac_parser_check_entry: When missing\n"); return 1; } if (!uid_available) { fprintf(stderr, "bac_parser_check_entry: Uid missing\n"); return 1; } /* missing user_name is OK */ if (!score_sort_available) { fprintf(stderr, "bac_parser_check_entry: Score-Sort missing\n"); return 1; } if (!score_total_available) { fprintf(stderr, "bac_parser_check_entry: Score-Total missing\n"); return 1; } return 0; } bac_array * bac_parser_get_array(void) { return p; } void bac_parser_delete_array(void) { /* don't delete p or p_temp here */ p = NULL; p_temp = NULL; } tenmado-0.10/libbac/bac_parser_public.h0000644000175000017500000000047110276702754020725 0ustar00ooharaoohara00000000000000/* $Id: bac_parser_public.h,v 1.5 2002/12/08 11:32:36 oohara Exp $ */ #ifndef __BAC_PARSER_PUBLIC_H__ #define __BAC_PARSER_PUBLIC_H__ #include "bac_array.h" /* yyparse */ int bac_parse(void); bac_array *bac_parser_get_array(void); void bac_parser_delete_array(void); #endif /* not __BAC_PARSER_PUBLIC_H__ */ tenmado-0.10/libbac/bac_save.c0000644000175000017500000001177710276702754017037 0ustar00ooharaoohara00000000000000/* $Id: bac_save.c,v 1.25 2003/01/14 04:36:57 oohara Exp $ */ /* HAVE_LIBDB3, HAVE_LIBDB_3 */ #include /* FILE */ #include /* memset, strlen, strerror */ #include /* malloc, free */ #include /* errno */ #include #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) /* libdb3 */ #include #endif /* (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ #include "bac_entry.h" #include "bac_entry_to_string.h" #include "bac_save.h" /* return 0 on success, 1 on error * assumes dir (arg 1) already exists --- if not, it is an error */ int bac_save(const char *dir, const char *file, bac_entry *p, int mode) { #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) DB *dbp = NULL; DB_ENV *dbenvp = NULL; DBT key; DBT data; int status; /* sanity check */ if (dir == NULL) { fprintf(stderr, "bac_save: dir is NULL\n"); return 1; } if (file == NULL) { fprintf(stderr, "bac_save: file is NULL\n"); return 1; } if (p == NULL) { fprintf(stderr, "bac_save: p is NULL\n"); return 0; } if (p->klass != 0) { fprintf(stderr, "bac_save: not supported score_entry_version (%d)\n", p->klass); return 0; } /* this must be before db_create */ status = db_env_create(&dbenvp, 0); if (status != 0) { fprintf(stderr, "bac_save: db_env_create failed (%s)\n", db_strerror(status)); return 1; } /* this must be before DB->open */ /* this directory must be present on the system before * this program is called (DB_CREATE creates only files in that * directory, not the directory itself) */ /* DB_INIT_CDB and DB_INIT_MPOOL means Concurrent Data Store */ status = dbenvp->open(dbenvp, dir, DB_INIT_CDB | DB_INIT_MPOOL | DB_CREATE, mode); if (status != 0) { fprintf(stderr, "bac_save: DBENV->open(%s) failed (%s)\n", dir, db_strerror(status)); dbenvp->close(dbenvp, 0); return 1; } status = db_create(&dbp, dbenvp, 0); if (status != 0) { fprintf(stderr, "bac_save: db_create failed (%s)\n", db_strerror(status)); dbenvp->close(dbenvp, 0); return 1; } status = dbp->open(dbp, file, NULL, DB_RECNO, DB_CREATE, mode); if (status != 0) { fprintf(stderr, "bac_save: DB->open(%s) failed (%s)\n", file, db_strerror(status)); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } /* for compatibility with later version of libdb */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); /* we don't set key because this is a Recno database */ data.data = bac_entry_to_string(p); if (data.data == NULL) { fprintf(stderr, "bac_save: bac_entry_to_string failed\n"); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } /* I want to save the trailing \0 too */ data.size = sizeof(char) * (strlen(data.data) + 1); status = dbp->put(dbp, NULL, &key, &data, DB_APPEND); if (status != 0) { fprintf(stderr, "bac_save: DB->put failed (%s)\n", db_strerror(status)); free(data.data); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } free(data.data); status = dbp->close(dbp, 0); if (status != 0) { dbenvp->close(dbenvp, 0); fprintf(stderr, "bac_save: DB->close failed (%s)\n", db_strerror(status)); return 1; } status = dbenvp->close(dbenvp, 0); if (status != 0) { fprintf(stderr, "bac_save: DBENV->close failed (%s)\n", db_strerror(status)); return 1; } #else /* not (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ FILE *fp = NULL; size_t length; char *file_abs = NULL; char *data = NULL; /* sanity check */ if (dir == NULL) { fprintf(stderr, "bac_save: dir is NULL\n"); return 1; } if (file == NULL) { fprintf(stderr, "bac_save: file is NULL\n"); return 1; } if (p == NULL) { fprintf(stderr, "bac_save: p is NULL\n"); return 0; } if (p->klass != 0) { fprintf(stderr, "bac_save: not supported score_entry_version (%d)\n", p->klass); return 0; } /* +1 is for the trailing \0 */ length = strlen(dir) + strlen(file) + 1; file_abs = (char *) malloc(sizeof(char) * length); if (file_abs == NULL) { fprintf(stderr, "bac_save: malloc(file_abs) failed\n"); return 1; } strncpy(file_abs, dir, length); file_abs[length - 1] = '\0'; strncpy(file_abs + strlen(file_abs), file, length - strlen(file_abs)); file_abs[length - 1] = '\0'; data = bac_entry_to_string(p); if (data == NULL) { fprintf(stderr, "bac_save: bac_entry_to_string failed\n"); free(file_abs); return 1; } errno = 0; fp = fopen(file_abs, "a"); if (fp == NULL) { fprintf(stderr, "bac_save: fopen failed"); if (errno != 0) fprintf(stderr, " (%s)", strerror(errno)); fprintf(stderr, "\n"); free(data); free(file_abs); return 1; } fputs(data, fp); fclose(fp); free(data); free(file_abs); #endif /* not (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ return 0; } tenmado-0.10/libbac/bac_save.h0000644000175000017500000000035710276702754017034 0ustar00ooharaoohara00000000000000/* $Id: bac_save.h,v 1.6 2002/12/18 15:46:48 oohara Exp $ */ #ifndef __BAC_SAVE_H__ #define __BAC_SAVE_H__ #include "bac_entry.h" int bac_save(const char *dir, const char *file, bac_entry *p, int mode); #endif /* not __BAC_SAVE_H__ */ tenmado-0.10/libbac/bac_string_to_array.c0000644000175000017500000000314211711141633021256 0ustar00ooharaoohara00000000000000/* $Id: bac_string_to_array.c,v 1.19 2012/01/29 03:57:15 oohara Exp $ */ /* FILE */ #include /* isprint */ #include #include "bac_array.h" #include "bac_lexical.h" #include "bac_parser_public.h" #include "bac_string_to_array.h" bac_array * bac_string_to_array(const char *string) { /* sanity check */ if (string == NULL) { fprintf(stderr, "bac_string_to_array: string is NULL\n"); return NULL; } if (isprint('\n')) { fprintf(stderr, "bac_string_to_array: \\n is printable\n"); return NULL; } if (isprint('\t')) { fprintf(stderr, "bac_string_to_array: \\t is printable\n"); return NULL; } bac_parser_delete_array(); bac_lineno = 1; bac_read_from_string(string); if (bac_parse() != 0) { fprintf(stderr, "bac_string_to_array: bac_parse failed\n"); /* delete the buffer */ bac_close_string(); return NULL; } /* delete the buffer */ bac_close_string(); return bac_parser_get_array(); } bac_array * bac_file_to_array(FILE *file) { /* sanity check */ if (file == NULL) { fprintf(stderr, "file is NULL\n"); return NULL; } if (isprint('\n')) { fprintf(stderr, "bac_file_to_array: \\n is printable\n"); return NULL; } if (isprint('\t')) { fprintf(stderr, "bac_file_to_array: \\t is printable\n"); return NULL; } bac_parser_delete_array(); bac_lineno = 1; bac_read_from_file(file); if (bac_parse() != 0) { fprintf(stderr, "bac_file_to_array: bac_parse failed\n"); return NULL; } /* don't close the file here --- it is not my job */ return bac_parser_get_array(); } tenmado-0.10/libbac/bac_string_to_array.h0000644000175000017500000000046010276702754021277 0ustar00ooharaoohara00000000000000/* $Id: bac_string_to_array.h,v 1.4 2002/12/09 17:43:45 oohara Exp $ */ #ifndef __BAC_STRING_TO_ARRAY_H__ #define __BAC_STRING_TO_ARRAY_H__ #include "bac_array.h" bac_array *bac_string_to_array(const char *string); bac_array *bac_file_to_array(FILE *file); #endif /* not __BAC_STRING_TO_ARRAY_H__ */ tenmado-0.10/libbac/bac_truncate.c0000644000175000017500000002001511277411231017674 0ustar00ooharaoohara00000000000000/* $Id: bac_truncate.c,v 1.36 2009/11/14 02:14:49 oohara Exp $ */ /* HAVE_LIBDB3, HAVE_LIBDB_3 */ #include /* remove */ #include /* qsort, malloc */ #include /* memset, strncpy, strerror */ #include /* errno */ #include #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) /* libdb3 */ #include #endif /* (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ #include "bac_array.h" #include "bac_entry.h" #include "bac_string_to_array.h" #if !(defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) #include "bac_load.h" #include "bac_save.h" #endif /* !(defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ #include "bac_truncate.h" #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) static int bac_truncate_one_step(bac_entry *entry, const char *string, DBC *cursorp); #endif /* (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ /* delete all entries that are (strictly) below entry (arg 3) * in the database * return 0 on success, 1 on error * assumes there is at least one entry --- if not, it is an error */ int bac_truncate(const char *dir, const char *file, bac_entry *entry, int mode) { #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) DB *dbp = NULL; DB_ENV *dbenvp = NULL; DBC *cursorp = NULL; DBT key; DBT data; int status; /* sanity check */ if (dir == NULL) { fprintf(stderr, "bac_truncate: dir is NULL\n"); return 1; } if (file == NULL) { fprintf(stderr, "bac_truncate: file is NULL\n"); return 1; } if (entry == NULL) { fprintf(stderr, "bac_truncate: entry is NULL\n"); return 1; } /* this must be before db_create */ status = db_env_create(&dbenvp, 0); if (status != 0) { fprintf(stderr, "bac_truncate: db_env_create failed (%s)\n", db_strerror(status)); return 1; } /* this must be before DB->open */ /* this directory must be present on the system before * this program is called (DB_CREATE creates only files in that * directory, not the directory itself) */ /* DB_INIT_CDB and DB_INIT_MPOOL means Concurrent Data Store */ status = dbenvp->open(dbenvp, dir, DB_INIT_CDB | DB_INIT_MPOOL | DB_CREATE, mode); if (status != 0) { fprintf(stderr, "bac_truncate: DBENV->open failed (%s)\n", db_strerror(status)); dbenvp->close(dbenvp, 0); return 1; } status = db_create(&dbp, dbenvp, 0); if (status != 0) { fprintf(stderr, "bac_truncate: db_create failed (%s)\n", db_strerror(status)); dbenvp->close(dbenvp, 0); return 1; } status = dbp->open(dbp, file, NULL, DB_RECNO, DB_CREATE, mode); if (status != 0) { fprintf(stderr, "bac_truncate: DB->open failed (%s)\n", db_strerror(status)); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } status = dbp->cursor(dbp, NULL, &cursorp, DB_WRITECURSOR); if (status != 0) { fprintf(stderr, "bac_truncate: DB->cursor failed (%s)\n", db_strerror(status)); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } /* for compatibility with later version of libdb */ memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); status = cursorp->c_get(cursorp, &key, &data, DB_FIRST); if (status == DB_NOTFOUND) { /* there is no element in the database, so nothing to do */ cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 0; } else if (status != 0) { fprintf(stderr, "bac_truncate: DBcursor->c_get(DB_FIRST) failed (%s)\n", db_strerror(status)); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } if (((char *) (data.data))[(data.size / sizeof(char)) - 1] != '\0' ) { fprintf(stderr, "bac_truncate: data.data is not null-terminated\n"); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } if (bac_truncate_one_step(entry, (char *) (data.data), cursorp) != 0) { fprintf(stderr, "bac_truncate: bac_truncate_one_step failed\n"); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); while(1 == 1) { status = cursorp->c_get(cursorp, &key, &data, DB_NEXT); if (status == DB_NOTFOUND) { /* no more entry in the database */ break; } else if (status != 0) { fprintf(stderr, "bac_truncate: DBcursor->c_get(DB_NEXT) failed (%s)\n", db_strerror(status)); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } else { if (((char *) (data.data))[(data.size / sizeof(char)) - 1] != '\0' ) { fprintf(stderr, "bac_truncate: data.data is not null-terminated\n"); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } if (bac_truncate_one_step(entry, (char *) (data.data), cursorp) != 0) { fprintf(stderr, "bac_truncate: bac_truncate_one_step failed\n"); cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); return 1; } memset(&key, 0, sizeof(key)); memset(&data, 0, sizeof(data)); } } cursorp->c_close(cursorp); dbp->close(dbp, 0); dbenvp->close(dbenvp, 0); #else /* not (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ int i; int no_entry; bac_array *p = NULL; size_t length; char *file_abs = NULL; /* sanity check */ if (dir == NULL) { fprintf(stderr, "bac_truncate: dir is NULL\n"); return 1; } if (file == NULL) { fprintf(stderr, "bac_truncate: file is NULL\n"); return 1; } if (entry == NULL) { fprintf(stderr, "bac_truncate: entry is NULL\n"); return 1; } /* +1 is for the trailing \0 */ length = strlen(dir) + strlen(file) + 1; file_abs = (char *) malloc(sizeof(char) * length); if (file_abs == NULL) { fprintf(stderr, "bac_truncate: malloc(file_abs) failed\n"); return 1; } strncpy(file_abs, dir, length); file_abs[length - 1] = '\0'; strncpy(file_abs + strlen(file_abs), file, length - strlen(file_abs)); file_abs[length - 1] = '\0'; p = bac_load(dir, file, 1, 0, mode, &no_entry); if (p == NULL) { free(file_abs); return 0; } errno = 0; if (remove(file_abs) != 0) { fprintf(stderr, "bac_truncate: remove failed"); if (errno != 0) fprintf(stderr, " (%s)", strerror(errno)); fprintf(stderr, "\n"); bac_array_delete(p); free(file_abs); return 1; } for (i = 0; (i < p->n) && (bac_compare_entry((void *) (&(p->p[i])), (void *) (&entry)) <= 0); i++) { if (bac_save(dir, file, p->p[i], mode) != 0) { fprintf(stderr, "bac_truncate: bac_save(%d) failed\n", i); bac_array_delete(p); free(file_abs); return 1; } } bac_array_delete(p); free(file_abs); #endif /* not (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ return 0; } #if (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) /* return 0 on success, 1 on error */ static int bac_truncate_one_step(bac_entry *entry, const char *string, DBC *cursorp) { bac_array *temp; int compare_result; temp = bac_string_to_array(string); if (temp == NULL) { fprintf(stderr, "bac_truncate_one_step: bac_string_to_array failed\n"); return 1; } qsort((void *) temp->p, (size_t) (temp->n), sizeof(bac_entry *), (int (*)(const void *, const void *)) bac_compare_entry); compare_result = bac_compare_entry((void *) (&(temp->p[0])), (void *) (&entry)); if (compare_result > 0) { if (cursorp->c_del(cursorp, 0) != 0) { fprintf(stderr, "bac_truncate: DBcursor->c_del failed\n"); if (temp != NULL) bac_array_delete(temp); return 1; } } if (temp != NULL) bac_array_delete(temp); return 0; } #endif /* (defined(HAVE_LIBDB3) || defined(HAVE_LIBDB_3)) */ tenmado-0.10/libbac/bac_truncate.h0000644000175000017500000000043010276702754017713 0ustar00ooharaoohara00000000000000/* $Id: bac_truncate.h,v 1.3 2002/12/18 15:55:24 oohara Exp $ */ #ifndef __BAC_TRUNCATE_H__ #define __BAC_TRUNCATE_H__ #include "bac_entry.h" int bac_truncate(const char *dir, const char *file, bac_entry *entry, int mode); #endif /* not __BAC_TRUNCATE_H__ */ tenmado-0.10/libtenm/0000777000175000017500000000000011711666006015327 5ustar00ooharaoohara00000000000000tenmado-0.10/libtenm/Makefile.am0000644000175000017500000000221511710770442017356 0ustar00ooharaoohara00000000000000## Makefile.am for libtenm ## process this file with automake --foreign to generate Makefile.in ## automake version 1.11 is required # $Id: Makefile.am,v 1.22 2012/01/28 12:59:14 oohara Exp $ noinst_LIBRARIES = libtenm.a libtenm_a_SOURCES = tenm_collision.c \ tenm_collision.h \ tenm_graphic.c \ tenm_graphic.h \ tenm_input.c \ tenm_input.h \ tenm_math.c \ tenm_math.h \ tenm_object.c \ tenm_object.h \ tenm_primitive.c \ tenm_primitive.h \ tenm_sdl_init.c \ tenm_sdl_init.h \ tenm_table.c \ tenm_table.h \ tenm_timer.c \ tenm_timer.h #CC_WARNINGS = -Wall # the overkill warnings # I don't use -Wtraditional because I use string concatenation # use -Wno-long-long because -pedantic implies -Wlong-long CC_WARNINGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -Winline -pedantic -Wno-long-long # let's hardcode SDL flags here SDL_CFLAGS=`sdl-config --cflags` # sdl-config --libs is added to LIBS in configure # -g -O2 are in CFLAGS by default, don't use @CFLAGS@ here AM_CFLAGS = $(SDL_CFLAGS) $(CC_WARNINGS) tenmado-0.10/libtenm/Makefile.in0000644000175000017500000003374211711665645017411 0ustar00ooharaoohara00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # $Id: Makefile.am,v 1.22 2012/01/28 12:59:14 oohara Exp $ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : subdir = libtenm DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru libtenm_a_AR = $(AR) $(ARFLAGS) libtenm_a_LIBADD = am_libtenm_a_OBJECTS = tenm_collision.$(OBJEXT) tenm_graphic.$(OBJEXT) \ tenm_input.$(OBJEXT) tenm_math.$(OBJEXT) tenm_object.$(OBJEXT) \ tenm_primitive.$(OBJEXT) tenm_sdl_init.$(OBJEXT) \ tenm_table.$(OBJEXT) tenm_timer.$(OBJEXT) libtenm_a_OBJECTS = $(am_libtenm_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(libtenm_a_SOURCES) DIST_SOURCES = $(libtenm_a_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libtenm.a libtenm_a_SOURCES = tenm_collision.c \ tenm_collision.h \ tenm_graphic.c \ tenm_graphic.h \ tenm_input.c \ tenm_input.h \ tenm_math.c \ tenm_math.h \ tenm_object.c \ tenm_object.h \ tenm_primitive.c \ tenm_primitive.h \ tenm_sdl_init.c \ tenm_sdl_init.h \ tenm_table.c \ tenm_table.h \ tenm_timer.c \ tenm_timer.h #CC_WARNINGS = -Wall # the overkill warnings # I don't use -Wtraditional because I use string concatenation # use -Wno-long-long because -pedantic implies -Wlong-long CC_WARNINGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes \ -Wmissing-declarations -Wnested-externs -Winline -pedantic -Wno-long-long # let's hardcode SDL flags here SDL_CFLAGS = `sdl-config --cflags` # sdl-config --libs is added to LIBS in configure # -g -O2 are in CFLAGS by default, don't use @CFLAGS@ here AM_CFLAGS = $(SDL_CFLAGS) $(CC_WARNINGS) 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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libtenm/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign libtenm/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 $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libtenm.a: $(libtenm_a_OBJECTS) $(libtenm_a_DEPENDENCIES) -rm -f libtenm.a $(libtenm_a_AR) libtenm.a $(libtenm_a_OBJECTS) $(libtenm_a_LIBADD) $(RANLIB) libtenm.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tenm_collision.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tenm_graphic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tenm_input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tenm_math.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tenm_object.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tenm_primitive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tenm_sdl_init.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tenm_table.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tenm_timer.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @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) '$<'` 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) 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; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__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)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: 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: .MAKE: install-am install-strip .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-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am 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 # 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: tenmado-0.10/libtenm/tenm_collision.c0000644000175000017500000005103510276702754020517 0ustar00ooharaoohara00000000000000/* $Id: tenm_collision.c,v 1.83 2003/01/14 01:03:14 oohara Exp $ */ #include /* malloc */ #include /* for tenm_polygon_new */ #include #include "tenm_collision.h" #define NEAR_ZERO 0.0001 static double tenm_same_side_temp(double p_x, double p_y, double a_x, double a_y, double b_x, double b_y); static double tenm_same_side_vertical_temp(double p_x, double p_y, double a_x, double a_y, double b_x, double b_y, double on_line_x, double on_line_y); static int tenm_collided_point_point(const tenm_point *p, const tenm_point *q); static int tenm_collided_point_circle(const tenm_point *p, const tenm_circle *q); static int tenm_collided_point_segment(const tenm_point *p, const tenm_segment *q); static int tenm_collided_point_polygon(const tenm_point *p, const tenm_polygon *q); static int tenm_collided_circle_circle(const tenm_circle *p, const tenm_circle *q); static int tenm_collided_circle_segment(const tenm_circle *p, const tenm_segment *q); static int tenm_collided_circle_segment2(double p_x, double p_y, double p_r, double q_a_x, double q_a_y, double q_b_x, double q_b_y); static int tenm_collided_circle_polygon(const tenm_circle *p, const tenm_polygon *q); static int tenm_collided_segment_segment(const tenm_segment *p, const tenm_segment *q); static int tenm_collided_segment_segment2(double p_a_x, double p_a_y, double p_b_x, double p_b_y, double q_a_x, double q_a_y, double q_b_x, double q_b_y); static int tenm_collided_segment_polygon(const tenm_segment *p, const tenm_polygon *q); static int tenm_collided_polygon_polygon(const tenm_polygon *p, const tenm_polygon *q); int tenm_same_point(double a_x, double a_y, double b_x, double b_y) { /* assume that a point (really a pixel) is a circle whose diameter is 1 */ return tenm_point_nearer(a_x, a_y, b_x, b_y, 1.0); } /* checks if the distance between point A(a_x, a_y) and point B(b_x, b_y) is * equal to or smaller than n * return 1 (true) or 0 (false) */ int tenm_point_nearer(double a_x, double a_y, double b_x, double b_y, double n) { /* distance^2 = temp = temp1 + temp2 */ double temp = 0; double temp1 = 0; double temp2 = 0; /* distance can't be negative*/ if (n < -NEAR_ZERO) { fprintf(stderr, "tenm_point_nearer: n is negative (%f)\n", n); return 0; } if ((n > -NEAR_ZERO) && (n < NEAR_ZERO)) return tenm_same_point(a_x, a_y, b_x, b_y); temp1 = a_x - b_x; temp1 = temp1 * temp1; temp2 = a_y - b_y; temp2 = temp2 * temp2; temp = temp1 + temp2; if (n * n >= temp) return 1; return 0; } /* checks if the distance between the point P and the line is equal to * or smaller than n * return 1 (true) or 0 (false) */ int tenm_line_nearer(double p_x, double p_y, double a_x, double a_y, double b_x, double b_y, double n) { /* distance^2 = temp/over */ double temp = 0; double over = 0; /* over = over1 + over2 */ double over1 = 0; double over2 = 0; /* distance can't be nagative */ if (n < -NEAR_ZERO) { fprintf(stderr, "tenm_line_nearer: n is negative (%f)\n", n); return 0; } /* check if line is really a point */ if(tenm_same_point(a_x, a_y, b_x, b_y)) { return tenm_point_nearer(p_x, p_y, a_x, a_y, n); } temp = (a_x - p_x) * (b_y - a_y) - (a_y - p_y) * (b_x - a_x); temp = temp * temp; over1= b_x - a_x; over1 = over1 * over1; over2 = b_y - a_y; over2 = over2 * over2; over = over1 + over2; if (over * n * n >= temp) return 1; return 0; } /* checks if the two points P(p_x, p_y) and Q(q_x, q_y) are on the same * side of the line which passes A(a_x, a_y) and B(b_x, b_y) * "on the line" counts as either side * return 1 (true) or 0 (false) */ int tenm_same_side(double p_x, double p_y, double q_x, double q_y, double a_x, double a_y, double b_x, double b_y) { double temp_p; double temp_q; /* check if we really have a line */ if (tenm_same_point(a_x, a_y, b_x, b_y)) { fprintf(stderr, "tenm_same_side: not a line\n"); return 0; } temp_p = tenm_same_side_temp(p_x, p_y, a_x, a_y, b_x, b_y); temp_q = tenm_same_side_temp(q_x, q_y, a_x, a_y, b_x, b_y); if ((temp_p >= 0) && (temp_q >= 0)) return 1; if ((temp_p <= 0) && (temp_q <= 0)) return 1; return 0; } /* local-only function used in tenm_same_side */ static double tenm_same_side_temp(double p_x, double p_y, double a_x, double a_y, double b_x, double b_y) { return (b_y - a_y) * p_x - (b_x - a_x) * p_y -((b_y - a_y) * a_x - (b_x - a_x) * a_y); } /* checks if the two points P(p_x, p_y) and Q(q_x, q_y) are on the same * side of the line L * such that: * 1) L passes the point (on_line_x, on_line_y) * 2) L is vertical to the line which passes (a_x, a_y) and (b_x, b_y) * "on the line" counts as either side * return 1 (true) or 0 (false) */ int tenm_same_side_vertical(double p_x, double p_y, double q_x, double q_y, double a_x, double a_y, double b_x, double b_y, double on_line_x, double on_line_y) { double temp_p; double temp_q; /* check if we really have a line */ if (tenm_same_point(a_x, a_y, b_x, b_y)) { fprintf(stderr, "tenm_same_side_vertical: not a line\n"); return 0; } temp_p = tenm_same_side_vertical_temp(p_x, p_y, a_x, a_y, b_x, b_y, on_line_x, on_line_y); temp_q = tenm_same_side_vertical_temp(q_x, q_y, a_x, a_y, b_x, b_y, on_line_x, on_line_y); if ((temp_p >= 0) && (temp_q >= 0)) return 1; if ((temp_p <= 0) && (temp_q <= 0)) return 1; return 0; } /* local-only function used in tenm_same_side_vertical */ static double tenm_same_side_vertical_temp(double p_x, double p_y, double a_x, double a_y, double b_x, double b_y, double on_line_x, double on_line_y) { return (b_x - a_x) * p_x + (b_y - a_y) * p_y -((b_x - a_x) * on_line_x + (b_y - a_y) * on_line_y); } /* optimized under the assumption that p and q are usually not collided */ int tenm_collided_primitive(const tenm_primitive *p, const tenm_primitive *q) { const tenm_primitive *p_temp; const tenm_primitive *q_temp; if (p == NULL) { fprintf(stderr, "tenm_collided_primitive: p is NULL\n"); return 0; } if (q == NULL) { fprintf(stderr, "tenm_collided_primitive: q is NULL\n"); return 0; } switch (p->klass + q->klass) { case TENM_POINT + TENM_POINT: return tenm_collided_point_point((const tenm_point *) p, (const tenm_point *) q); break; case TENM_POINT + TENM_CIRCLE: if (p->klass == TENM_POINT) { p_temp = p; q_temp = q; } else if (q->klass == TENM_POINT) { p_temp = q; q_temp = p; } else { fprintf(stderr, "tenm_collided_primitive: strange pointer found in " "TENM_POINT + TENM_CIRCLE\n"); return 0; } return tenm_collided_point_circle((const tenm_point *) p_temp, (const tenm_circle *) q_temp); break; case TENM_POINT + TENM_SEGMENT: if (p->klass == TENM_POINT) { p_temp = p; q_temp = q; } else if (q->klass == TENM_POINT) { p_temp = q; q_temp = p; } else { fprintf(stderr, "tenm_collided_primitive: strange pointer found in " "TENM_POINT + TENM_SEGMENT\n"); return 0; } return tenm_collided_point_segment((const tenm_point *) p_temp, (const tenm_segment *) q_temp); break; case TENM_POINT + TENM_POLYGON: if (p->klass == TENM_POINT) { p_temp = p; q_temp = q; } else if (q->klass == TENM_POINT) { p_temp = q; q_temp = p; } else { fprintf(stderr, "tenm_collided_primitive: strange pointer found in " "TENM_POINT + TENM_POLYGON\n"); return 0; } return tenm_collided_point_polygon((const tenm_point *) p_temp, (const tenm_polygon *) q_temp); break; case TENM_CIRCLE + TENM_CIRCLE: return tenm_collided_circle_circle((const tenm_circle *) p, (const tenm_circle *) q); break; case TENM_CIRCLE + TENM_SEGMENT: if (p->klass == TENM_CIRCLE) { p_temp = p; q_temp = q; } else if (q->klass == TENM_CIRCLE) { p_temp = q; q_temp = p; } else { fprintf(stderr, "tenm_collided_primitive: strange pointer found in " "TENM_CIRCLE + TENM_SEGMENT\n"); return 0; } return tenm_collided_circle_segment((const tenm_circle *) p_temp, (const tenm_segment *) q_temp); break; case TENM_CIRCLE + TENM_POLYGON: if (p->klass == TENM_CIRCLE) { p_temp = p; q_temp = q; } else if (q->klass == TENM_CIRCLE) { p_temp = q; q_temp = p; } else { fprintf(stderr, "tenm_collided_primitive: strange pointer found in " "TENM_CIRCLE + TENM_POLYGON\n"); return 0; } return tenm_collided_circle_polygon((const tenm_circle *) p_temp, (const tenm_polygon *) q_temp); break; case TENM_SEGMENT + TENM_SEGMENT: return tenm_collided_segment_segment((const tenm_segment *) p, (const tenm_segment *) q); break; case TENM_SEGMENT + TENM_POLYGON: if (p->klass == TENM_SEGMENT) { p_temp = p; q_temp = q; } else if (q->klass == TENM_SEGMENT) { p_temp = q; q_temp = p; } else { fprintf(stderr, "tenm_collided_primitive: strange pointer found in " "TENM_SEGMENT + TENM_POLYGON\n"); return 0; } return tenm_collided_segment_polygon((const tenm_segment *) p_temp, (const tenm_polygon *) q_temp); break; case TENM_POLYGON + TENM_POLYGON: return tenm_collided_polygon_polygon((const tenm_polygon *) p, (const tenm_polygon *) q); break; default: fprintf(stderr, "tenm_collided_primitive: strange combination of " "primitives (%d and %d)\n", p->klass, q->klass); return 0; break; } return 0; } static int tenm_collided_point_point(const tenm_point *p, const tenm_point *q) { return tenm_same_point(p->x, p->y, q->x, q->y); } static int tenm_collided_point_circle(const tenm_point *p, const tenm_circle *q) { return tenm_point_nearer(p->x, p->y, q->center->x, q->center->y, q->r); } static int tenm_collided_point_segment(const tenm_point *p, const tenm_segment *q) { /* assume that a point (really a pixel) is a circle whose diameter is 1 */ return tenm_collided_circle_segment2(p->x, p->y, 0.5, q->a->x, q->a->y, q->b->x, q->b->y); } static int tenm_collided_point_polygon(const tenm_point *p, const tenm_polygon *q) { /* I know that the best algorithm is O(n * log(n)), but it is hard * to implement */ int i; int j; int k; int l; if (q->n <= 0) { fprintf(stderr, "tenm_collided_point_polygon: strange point number in q " "(%d)\n", q->n); return 0; } if (q->n == 1) return tenm_same_point(p->x, p->y, q->v[0]->x, q->v[0]->y); if (q->n == 2) return tenm_collided_circle_segment2(p->x, p->y, 0.5, q->v[0]->x, q->v[0]->y, q->v[1]->x, q->v[1]->y); for (i = 0; i < q->n; i++) for (j = i + 1; j < q->n; j++) { for (k = 0; k < q->n; k++) { if (tenm_same_point(q->v[k]->x, q->v[k]->y, q->v[i]->x, q->v[i]->y)) continue; if (tenm_same_point(q->v[k]->x, q->v[k]->y, q->v[j]->x, q->v[j]->y)) continue; if (q->n >= 4) { for (l = 0;(l < q->n)&&((tenm_same_point(q->v[l]->x, q->v[l]->y, q->v[i]->x, q->v[i]->y)) ||(tenm_same_point(q->v[l]->x, q->v[l]->y, q->v[j]->x, q->v[j]->y)) ||(tenm_same_point(q->v[l]->x, q->v[l]->y, q->v[k]->x, q->v[k]->y))); l++) ; if ((l < q->n) && (! tenm_same_side(q->v[k]->x, q->v[k]->y, q->v[l]->x, q->v[l]->y, q->v[i]->x, q->v[i]->y, q->v[j]->x, q->v[j]->y))) break; } if (! tenm_same_side(p->x, p->y, q->v[k]->x, q->v[k]->y, q->v[i]->x, q->v[i]->y, q->v[j]->x, q->v[j]->y)) return 0; } } return 1; } static int tenm_collided_circle_circle(const tenm_circle *p, const tenm_circle *q) { return tenm_point_nearer(p->center->x, p->center->y, q->center->x, q->center->y, p->r + q->r); } static int tenm_collided_circle_segment(const tenm_circle *p, const tenm_segment *q) { return tenm_collided_circle_segment2(p->center->x, p->center->y, p->r, q->a->x, q->a->y, q->b->x, q->b->y); } static int tenm_collided_circle_segment2(double p_x, double p_y, double p_r, double q_a_x, double q_a_y, double q_b_x, double q_b_y) { if (tenm_point_nearer(p_x, p_y, q_a_x, q_a_y, p_r)) return 1; if (tenm_point_nearer(p_x, p_y, q_b_x, q_b_y, p_r)) return 1; if (! tenm_line_nearer(p_x, p_y, q_a_x, q_a_y, q_b_x, q_b_y, p_r)) return 0; if (tenm_same_side_vertical(q_a_x, q_a_y, q_b_x, q_b_y, q_a_x, q_a_y, q_b_x, q_b_y, p_x, p_y)) return 0; return 1; } static int tenm_collided_circle_polygon(const tenm_circle *p, const tenm_polygon *q) { int i; int j; int temp; /* first, assume a sufficiently large rectangle */ temp = 1; for (i = 0; i < q->n; i++) if (p->center->x + p->r >= q->v[i]->x) { temp = 0; break; } if (temp == 1) return 0; temp = 1; for (i = 0; i < q->n; i++) if (p->center->x - p->r <= q->v[i]->x) { temp = 0; break; } if (temp == 1) return 0; temp = 1; for (i = 0; i < q->n; i++) if (p->center->y + p->r >= q->v[i]->y) { temp = 0; break; } if (temp == 1) return 0; temp = 1; for (i = 0; i < q->n; i++) if (p->center->y - p->r <= q->v[i]->y) { temp = 0; break; } if (temp == 1) return 0; /* now, the expensive check */ for (i = 0; i < q->n; i++) for (j = i + 1; j < q->n; j++) if (tenm_collided_circle_segment2(p->center->x, p->center->y, p->r, q->v[i]->x, q->v[i]->y, q->v[j]->x, q->v[j]->y)) return 1; return tenm_collided_point_polygon(p->center, q); } static int tenm_collided_segment_segment(const tenm_segment *p, const tenm_segment *q) { return tenm_collided_segment_segment2(p->a->x, p->a->y, p->b->x, p->b->y, q->a->x, q->a->y, q->b->x, q->b->y); } static int tenm_collided_segment_segment2(double p_a_x, double p_a_y, double p_b_x, double p_b_y, double q_a_x, double q_a_y, double q_b_x, double q_b_y) { /* we need this point-on-segment checks first because tenm_same_side * counts "on the line" as either side */ if (tenm_collided_circle_segment2(p_a_x, p_a_y, 0.5, q_a_x, q_a_y, q_b_x, q_b_y)) return 1; if (tenm_collided_circle_segment2(p_b_x, p_b_y, 0.5, q_a_x, q_a_y, q_b_x, q_b_y)) return 1; if (tenm_collided_circle_segment2(q_a_x, q_a_y, 0.5, p_a_x, p_a_y, p_b_x, p_b_y)) return 1; if (tenm_collided_circle_segment2(q_b_x, q_b_y, 0.5, p_a_x, p_a_y, p_b_x, p_b_y)) return 1; if (tenm_same_side(p_a_x, p_a_y, p_b_x, p_b_y, q_a_x, q_a_y, q_b_x, q_b_y)) return 0; if (tenm_same_side(q_a_x, q_a_y, q_b_x, q_b_y, p_a_x, p_a_y, p_b_x, p_b_y)) return 0; return 1; } static int tenm_collided_segment_polygon(const tenm_segment *p, const tenm_polygon *q) { int i; int j; int temp; /* first, assume a sufficiently large rectangle */ temp = 1; for (i = 0; i < q->n; i++) { if (p->a->x >= q->v[i]->x) { temp = 0; break; } if (p->b->x >= q->v[i]->x) { temp = 0; break; } } if (temp == 1) return 0; temp = 1; for (i = 0; i < q->n; i++) { if (p->a->x <= q->v[i]->x) { temp = 0; break; } if (p->b->x <= q->v[i]->x) { temp = 0; break; } } if (temp == 1) return 0; temp = 1; for (i = 0; i < q->n; i++) { if (p->a->y >= q->v[i]->y) { temp = 0; break; } if (p->b->y >= q->v[i]->y) { temp = 0; break; } } if (temp == 1) return 0; temp = 1; for (i = 0; i < q->n; i++) { if (p->a->y <= q->v[i]->y) { temp = 0; break; } if (p->b->y <= q->v[i]->y) { temp = 0; break; } } if (temp == 1) return 0; /* now, the expensive check */ for (i = 0; i < q->n; i++) for (j = i + 1; j < q->n; j++) if (tenm_collided_segment_segment2(p->a->x, p->a->y, p->b->x, p->b->y, q->v[i]->x, q->v[i]->y, q->v[j]->x, q->v[j]->y)) return 1; if (tenm_collided_point_polygon(p->a, q)) return 1; if (tenm_collided_point_polygon(p->b, q)) return 1; return 0; } static int tenm_collided_polygon_polygon(const tenm_polygon *p, const tenm_polygon *q) { int i; int j; int k; int l; int temp; /* first, assume a sufficiently large rectangle */ temp = 1; for (i = 0; i < p->n; i++) for (j = 0; j < q->n; j++) if (p->v[i]->x >= q->v[j]->x) { temp = 0; break; } if (temp == 1) return 0; temp = 1; for (i = 0; i < p->n; i++) for (j = 0; j < q->n; j++) if (p->v[i]->x <= q->v[j]->x) { temp = 0; break; } if (temp == 1) return 0; temp = 1; for (i = 0; i < p->n; i++) for (j = 0; j < q->n; j++) if (p->v[i]->y >= q->v[j]->y) { temp = 0; break; } if (temp == 1) return 0; temp = 1; for (i = 0; i < p->n; i++) for (j = 0; j < q->n; j++) if (p->v[i]->y <= q->v[j]->y) { temp = 0; break; } if (temp == 1) return 0; /* now, the expensive check */ for (i = 0; i < p->n; i++) for (j = i + 1; j < p->n; j++) for (k = 0; k < q->n; k++) for (l = k + 1; l < q->n; l++) if (tenm_collided_segment_segment2(p->v[i]->x, p->v[i]->y, p->v[j]->x, p->v[j]->y, q->v[k]->x, q->v[k]->y, q->v[l]->x, q->v[l]->y)) return 1; for (i = 0; i < p->n; i++) if (tenm_collided_point_polygon(p->v[i], q)) return 1; for (i = 0; i < q->n; i++) if (tenm_collided_point_polygon(q->v[i], p)) return 1; return 0; } tenmado-0.10/libtenm/tenm_collision.h0000644000175000017500000000201310276702754020514 0ustar00ooharaoohara00000000000000/* $Id: tenm_collision.h,v 1.21 2002/05/08 10:24:03 oohara Exp $ */ #ifndef __TENM_COLLISION_H__ #define __TENM_COLLISION_H__ #include "tenm_primitive.h" /* don't use tenm_* here to avoid creating new primitives */ int tenm_same_point(double a_x, double a_y, double b_x, double b_y); int tenm_point_nearer(double a_x, double a_y, double b_x, double b_y, double n); int tenm_line_nearer(double p_x, double p_y, double a_x, double a_y, double b_x, double b_y, double n); int tenm_same_side(double p_x, double p_y, double q_x, double q_y, double a_x, double a_y, double b_x, double b_y); int tenm_same_side_vertical(double p_x, double p_y, double q_x, double q_y, double a_x, double a_y, double b_x, double b_y, double on_line_x, double on_line_y); int tenm_collided_primitive(const tenm_primitive *p, const tenm_primitive *q); #endif /* not __TENM_COLLISION_H__ */ tenmado-0.10/libtenm/tenm_graphic.c0000644000175000017500000006644010276702754020147 0ustar00ooharaoohara00000000000000/* $Id: tenm_graphic.c,v 1.128 2003/01/14 03:02:55 oohara Exp $ */ #include /* malloc */ #include #include /* for tenm_load_image */ #include /* isprint */ #include #include #include #include "tenm_math.h" #include "tenm_primitive.h" #include "tenm_object.h" #include "tenm_sdl_init.h" #include "tenm_graphic.h" /* number of printable characters */ #define TENM_FONT_NUMBER_CHAR 95 static SDL_Surface *dpy = NULL; static int tenm_font_index(int c); static int tenm_draw_line2(int a_x, int a_y, int b_x, int b_y, int width, tenm_color color, int xy_reversed); /* return 0 on success, 1 on error */ int tenm_graphic_init(int width, int height, int flag, const char *name) { Uint32 sdl_flag; /* sanity check */ if (name == NULL) { fprintf(stderr, "tenm_graphic_init: name is NULL\n"); return 1; } if (SDL_WasInit(SDL_INIT_VIDEO) != 0) { fprintf(stderr, "tenm_graphic_init: warning: video is already " "initialized\n"); return 0; } if (tenm_sdl_init(SDL_INIT_VIDEO) != 0) { fprintf(stderr, "tenm_graphic_init: cannot initialize SDL video\n"); return 1; } if (dpy != NULL) { fprintf(stderr, "tenm_graphic_init: " "dpy is already set\n"); /* this is a fatal error --- if we are here, video is not * initialized before tenm_graphic_init() is called, so * the situation is weird enough */ /* dpy should not be freed here --- it is the job of SDL_Quit() */ SDL_QuitSubSystem(SDL_INIT_VIDEO); return 1; } if (flag & TENM_FULLSCREEN) sdl_flag = SDL_FULLSCREEN; else sdl_flag = 0; dpy = SDL_SetVideoMode(width, height, 0, sdl_flag); if (dpy == NULL) { fprintf(stderr, "tenm_graphic_init: " "SDL_SetVideoMode failed (%s)\n", SDL_GetError()); SDL_QuitSubSystem(SDL_INIT_VIDEO); return 1; } SDL_WM_SetCaption(name, name); /* ignore the return value of SDL_ShowCursor() because the cursor * may be out of the window when it is called */ SDL_ShowCursor(SDL_DISABLE); return 0; } /* draw a line between A(a_x, a_y) and B(b_x, b_y) * return 0 on success, 1 on error */ int tenm_draw_line(int a_x, int a_y, int b_x, int b_y, int width, tenm_color color) { int dx; int dy; int dx_abs; int dy_abs; /* sanity check */ if (width <= 0) { fprintf(stderr, "tenm_draw_line: width is non-positive (%d)\n", width); return 1; } dx = b_x - a_x; dy = b_y - a_y; if (dx >= 0) dx_abs = dx; else dx_abs = -dx; if (dy >= 0) dy_abs = dy; else dy_abs = -dy; if ((dx == 0) && (dy == 0)) return tenm_draw_point(a_x, a_y, color); if (dx_abs >= dy_abs) { if (dx >= 0) return tenm_draw_line2(a_x, a_y, b_x, b_y, width, color, 0); else return tenm_draw_line2(b_x, b_y, a_x, a_y, width, color, 0); } else { if (dy >= 0) return tenm_draw_line2(a_y, a_x, b_y, b_x, width, color, 1); else return tenm_draw_line2(b_y, b_x, a_y, a_x, width, color, 1); } /* should not reach here */ fprintf(stderr, "tenm_draw_line: should not reach here\n"); return 1; } /* draw a circle whose center is (center_x, center_y) * with a line whose width is width (arg 4) * note that the center of the circle is always blank, * even if width == radius * return 0 on success, 1 on error */ int tenm_draw_circle(int center_x, int center_y, int radius, int width, tenm_color color) { int i; int x_outer; int x_inner; int y; int error_tilde_outer; int error_tilde_inner; int status = 0; /* sanity check */ if (radius <= 0) { fprintf(stderr, "tenm_draw_circle: radius is non-positive (%d)\n", radius); return 1; } if ((width <= 0) || (width > radius)) { fprintf(stderr, "tenm_draw_circle: width is out of range (%d)\n", width); return 1; } /* the Bresenham algorithm with the "wide line" hack */ x_outer = radius; x_inner = radius - width + 1; y = 0; /* the next point is either (x, y + 1) or (x - 1, y + 1) */ /* ((x)^2 + (y + 1)^2 - radius^2) + ((x - 1)^2 + (y + 1)^2 - radius^2) */ error_tilde_outer = 3 - 2 * radius; error_tilde_inner = 3 - 2 * (radius - width + 1); while (x_outer >= y) { for (i = x_outer; (i >= x_inner) && (i >= 0); i--) { if (tenm_draw_point(center_x + i, center_y + y, color) != 0) status = 1; if (tenm_draw_point(center_x + i, center_y - y, color) != 0) status = 1; if (tenm_draw_point(center_x - i, center_y + y, color) != 0) status = 1; if (tenm_draw_point(center_x - i, center_y - y, color) != 0) status = 1; if (tenm_draw_point(center_x + y, center_y + i, color) != 0) status = 1; if (tenm_draw_point(center_x + y, center_y - i, color) != 0) status = 1; if (tenm_draw_point(center_x - y, center_y + i, color) != 0) status = 1; if (tenm_draw_point(center_x - y, center_y - i, color) != 0) status = 1; } if (error_tilde_outer >= 0) { /* the next point is (x - 1, y + 1) */ /* error_tilde(next) - error_tilde * = (((x - 1)^2 + (y + 2)^2 - radius^2) * + ((x - 2)^2 + (y + 2)^2 - radius^2)) * - (((x)^2 + (y + 1)^2 - radius^2) * + ((x - 1)^2 + (y + 1)^2 - radius^2)) */ error_tilde_outer += (-4) * x_outer + 4 * y + 10; x_outer--; } else { /* the next point is (x, y + 1) */ /* error_tilde(next) - error_tilde * = (((x)^2 + (y + 2)^2 - radius^2) * + ((x - 1)^2 + (y + 2)^2 - radius^2)) * - (((x)^2 + (y + 1)^2 - radius^2) * + ((x - 1)^2 + (y + 1)^2 - radius^2)) */ error_tilde_outer += 4 * y + 6; } if (x_inner >= y) { if (error_tilde_inner >= 0) { error_tilde_inner += (-4) * x_inner + 4 * y + 10; x_inner--; } else { error_tilde_inner += 4 * y + 6; } } y++; } return status; } /* you must _NOT_ lock dpy before calling this function * return 0 on success, 1 on error */ int tenm_draw_point(int x, int y, tenm_color color) { return tenm_draw_rectangle(x, y, 1, 1, color); } /* you must _NOT_ lock dpy before calling this function * return 0 on success, 1 on error */ int tenm_draw_rectangle(int x, int y, int w, int h, tenm_color color) { SDL_Rect rec; /* sanity check */ if ((x + (w - 1) < 0) || (x - (w - 1) >= dpy->w)) return 0; if ((y + (h - 1) < 0) || (y - (h - 1) >= dpy->h)) return 0; rec.x = x; rec.y = y; rec.w = w; rec.h = h; if (SDL_FillRect(dpy, &rec, color) != 0) { fprintf(stderr, "tenm_draw_rectangle: SDL_FillRect failed " "(%s) (x = %d, y = %d, w = %d, h = %d)\n", SDL_GetError(), x, y, w, h); return 1; } return 0; } tenm_color tenm_map_color(int red, int green, int blue) { /* I can't fix gcc "different width" warnings here */ return SDL_MapRGB(dpy->format, red, green, blue); } /* return 0 on success, 1 on error */ int tenm_clear_window(tenm_color color) { if (SDL_FillRect(dpy, NULL, color) != 0) { fprintf(stderr, "tenm_clear_window: SDL_FillRect failed (%s)\n", SDL_GetError()); return 1; } return 0; } /* return 0 on success, 1 on error */ int tenm_redraw_window(void) { if (SDL_Flip(dpy) != 0) { fprintf(stderr, "tenm_redraw_window: SDL_Flip failed (%s)\n", SDL_GetError()); return 1; } return 0; } /* return 0 on success, 1 on error */ int tenm_draw_primitive(tenm_primitive *p, tenm_color color) { int i; int j; int status = 0; if (p == NULL) { fprintf(stderr, "tenm_draw_primitive: p is NULL\n"); return 0; } switch (p->klass) { case TENM_POINT: if (tenm_draw_point((int) ((tenm_point *) p)->x, (int) ((tenm_point *) p)->y, color) != 0) return 1; else return 0; break; case TENM_CIRCLE: if (tenm_draw_circle((int) ((tenm_circle *) p)->center->x, (int) ((tenm_circle *) p)->center->y, (int) ((tenm_circle *) p)->r, 1, color) != 0) return 1; else return 0; break; case TENM_SEGMENT: if (tenm_draw_line((int) ((tenm_segment *) p)->a->x, (int) ((tenm_segment *) p)->a->y, (int) ((tenm_segment *) p)->b->x, (int) ((tenm_segment *) p)->b->y, 1, color) != 0) return 1; else return 0; break; case TENM_POLYGON: for (i = 0; i < ((tenm_polygon *) p)->n; i++) for (j = i + 1; j < ((tenm_polygon *) p)->n; j++) if (tenm_draw_line((int) ((tenm_polygon *) p)->v[i]->x, (int) ((tenm_polygon *) p)->v[i]->y, (int) ((tenm_polygon *) p)->v[j]->x, (int) ((tenm_polygon *) p)->v[j]->y, 1, color) != 0) status = 1; return status; break; default: fprintf(stderr, "tenm_draw_primitive: strange primitive (%d)\n", p->klass); return 1; break; } /* should not reach here */ fprintf(stderr, "tenm_draw_primitive: should not reach here\n"); return 1; } /* return 0 on success, 1 on error */ int tenm_draw_mass(tenm_mass *p, tenm_color color) { int i; int status = 0; /* sanity check */ if (p == NULL) { fprintf(stderr, "tenm_draw_mass: p is NULL\n"); return 1; } if (p->n <= 0) { fprintf(stderr, "tenm_draw_mass: p->n is non-negative\n"); return 1; } if (p->p == NULL) { fprintf(stderr, "tenm_draw_mass: p->p is NULL\n"); return 1; } for (i = 0; i < p->n; i++) { if (tenm_draw_primitive(p->p[i], color)) { fprintf(stderr, "tenm_draw_mass: tenm_draw_primitive failed (%d)\n", i); status = 1; } } return status; } /* load image files and split them * ... is one or more of * (const char *file_name, int row, int column, tenm_color transparent_color) * return NULL on error */ tenm_image * tenm_load_image(int number_file, ...) { int i; int j; int k; int l; const char *file_name; int row; int column; tenm_color transparent_color; int width; int height; int suffix; va_list ap; tenm_image *temp; SDL_Surface **temp_surface; SDL_Surface *master; SDL_Rect temp_rect_src; SDL_Rect temp_rect_dest; /* sanity check */ if (number_file <= 0) { fprintf(stderr, "tenm_load_image: strange number_file (%d)\n", number_file); return NULL; } temp = (tenm_image *) malloc(sizeof(tenm_image)); if (temp == NULL) { fprintf(stderr, "tenm_load_image: malloc failed\n"); return NULL; } temp->n = 0; temp->image = NULL; va_start(ap, number_file); for (i = 0; i < number_file; i++) { /* you can't use char in va_arg */ file_name = (const char *) va_arg(ap, const int *); row = va_arg(ap, int); column = va_arg(ap, int); transparent_color = va_arg(ap, tenm_color); /* sanity check */ if (file_name == NULL) { fprintf(stderr, "tenm_load_image: file_name is NULL (i = %d)\n", i); if (temp->image != NULL) { for (l = 0; l < temp->n; l++) SDL_FreeSurface(temp->image[l]); free(temp->image); } free(temp); va_end(ap); return NULL; } if (row <= 0) { fprintf(stderr, "tenm_load_image: row is non-positive (%d) " "(i = %d)\n", row, i); if (temp->image != NULL) { for (l = 0; l < temp->n; l++) SDL_FreeSurface(temp->image[l]); free(temp->image); } free(temp); va_end(ap); return NULL; } if (column <= 0) { fprintf(stderr, "tenm_load_image: column is non-positive (%d) " "(i = %d)\n", column, i); if (temp->image != NULL) { for (l = 0; l < temp->n; l++) SDL_FreeSurface(temp->image[l]); free(temp->image); } free(temp); va_end(ap); return NULL; } master = IMG_Load(file_name); if (master == NULL) { fprintf(stderr, "tenm_load_image: IMG_Load(%s) failed (%s) (%i)\n", file_name, IMG_GetError(), i); if (temp->image != NULL) { for (l = 0; l < temp->n; l++) SDL_FreeSurface(temp->image[l]); free(temp->image); } free(temp); va_end(ap); return NULL; } width = master->w / column; if (master->w % column != 0) fprintf(stderr, "tenm_load_image: warning: width (%d) of image (%s) " "cannot be divided by %d\n", master->w, file_name, column); height = master->h / row; if (master->h % row != 0) fprintf(stderr, "tenm_load_image: warning: height (%d) of image (%s) " "cannot be divided by %d\n", master->h, file_name, row); /* don't substitute tenm->image directly, or you will be in a trouble * if realloc fails */ if (temp->image == NULL) temp_surface = (SDL_Surface **) malloc(sizeof(SDL_Surface *) * row * column); else temp_surface = (SDL_Surface **) realloc(temp->image, sizeof(SDL_Surface *) * (row * column + temp->n)); if (temp_surface == NULL) { fprintf(stderr, "tenm_load_image: memory allocation to image " "(%d) failed\n", i); SDL_FreeSurface(master); if (temp->image != NULL) { for (l = 0; l < temp->n; l++) SDL_FreeSurface(temp->image[l]); free(temp->image); } free(temp); return NULL; } temp->image = temp_surface; for (j = 0; j < row; j++) for (k = 0; k < column; k++) { suffix = temp->n + j * column + k; /* plain malloc is not enough */ temp->image[suffix] = SDL_CreateRGBSurface(0, width, height, dpy->format->BitsPerPixel, dpy->format->Rmask, dpy->format->Gmask, dpy->format->Bmask, dpy->format->Amask); if (temp->image[suffix] == NULL) { fprintf(stderr, "tenm_load_image: SDL_CreateRGBSurface(%d) " "failed (%s)\n", suffix, SDL_GetError()); SDL_FreeSurface(master); for (l = 0; l < suffix; l++) SDL_FreeSurface(temp->image[l]); free(temp->image); free(temp); return NULL; } if (dpy->format->BitsPerPixel == 8) SDL_SetPalette(temp->image[suffix], SDL_LOGPAL|SDL_PHYSPAL, dpy->format->palette->colors, 0, dpy->format->palette->ncolors); temp_rect_src.x = width * k; temp_rect_src.y = row * j; temp_rect_src.w = width; temp_rect_src.h = height; temp_rect_dest.x = 0; temp_rect_dest.y = 0; temp_rect_dest.w = width; temp_rect_dest.h = height; if (SDL_BlitSurface(master, &temp_rect_src, temp->image[suffix], &temp_rect_dest) != 0) { fprintf(stderr, "tenm_load_image: SDL_BlitSurface failed (%s)\n", SDL_GetError()); SDL_FreeSurface(master); /* we need to free temp->image[suffix] too */ for (l = 0; l <= suffix; l++) SDL_FreeSurface(temp->image[l]); free(temp->image); free(temp); return NULL; } if (SDL_SetColorKey(temp->image[suffix], SDL_SRCCOLORKEY, transparent_color) != 0) { fprintf(stderr, "tenm_load_image: SDL_SetColorKey failed (%s)\n", SDL_GetError()); SDL_FreeSurface(master); /* we need to free temp->image[suffix] too */ for (l = 0; l <= suffix; l++) SDL_FreeSurface(temp->image[l]); free(temp->image); free(temp); return NULL; } } temp->n += row * column; SDL_FreeSurface(master); } va_end(ap); return temp; } void tenm_image_delete(tenm_image *p) { int i; /* sanity check */ if (p == NULL) { fprintf(stderr, "tenm_image_delete: p is NULL\n"); return; } if (p->n <= 0) { fprintf(stderr, "tenm_image_delete: p->n is non-positive (%d)\n", p->n); return; } if (p->image == NULL) { fprintf(stderr, "tenm_image_delete: p->image is NULL\n"); return; } for (i = 0; i < p->n; i++) SDL_FreeSurface(p->image[i]); free(p->image); free(p); } /* return 0 on success, 1 on error */ int tenm_draw_image(int x, int y, tenm_image *image, int number) { SDL_Rect temp; /* sanity check */ if (image == NULL) { fprintf(stderr, "tenm_draw_image: image is NULL\n"); return 1; } if (image->n <= 0) { fprintf(stderr, "tenm_draw_image: image->n is non-positive\n"); return 1; } if (image->image == NULL) { fprintf(stderr, "tenm_draw_image: image->image is NULL\n"); return 1; } if ((number < 0) || (number >= image->n)) { fprintf(stderr, "tenm_draw_image: number (%d) is out of range " "(0 -- %d)\n", number, image->n - 1); return 1; } temp.x = x; temp.y = y; temp.w = image->image[number]->w; temp.h = image->image[number]->h; if (SDL_BlitSurface(image->image[number], NULL, dpy, &temp) != 0) { fprintf(stderr, "tenm_draw_image: SDL_BlitSurface failed (%s)\n", SDL_GetError()); return 1; } return 0; } /* return 0 on success, 1 on error */ int tenm_draw_string(int x, int y, tenm_image *font, const char *string, int length) { int i; int suffix; int temp_x; int status = 0; /* sanity check */ if (font == NULL) { fprintf(stderr, "tenm_draw_string: font is NULL\n"); return 1; } if (font->n < TENM_FONT_NUMBER_CHAR) { fprintf(stderr, "tenm_draw_string: not enough images in font " "(%d) (%d required)\n", font->n, TENM_FONT_NUMBER_CHAR); return 1; } if (font->image == NULL) { fprintf(stderr, "tenm_draw_string: font->image is NULL\n"); return 1; } if (string == NULL) { fprintf(stderr, "tenm_draw_string: string is NULL\n"); return 1; } if (length <= 0) { fprintf(stderr, "tenm_draw_string: length is non-positive (%d)\n", length); return 1; } temp_x = x; for (i = 0; (i < length) && (string[i] != '\0'); i++) { if (!isprint(string[i])) { fprintf(stderr, "tenm_draw_string: char %d unprintable (\\x%x)\n", i, string[i]); status = 1; continue; } suffix = tenm_font_index(string[i]); if ((suffix < 0) || (suffix >= font->n)) { fprintf(stderr, "tenm_draw_string: tenm_font_index(%d) returned " "strange number (%d)\n", i, suffix); status = 1; continue; } if (tenm_draw_image(temp_x, y - font->image[suffix]->h / 2, font, suffix) != 0) { fprintf(stderr, "tenm_draw_string: tenm_draw_image(%d) failed\n", i); status = 1; continue; } temp_x += font->image[suffix]->w; } return status; } /* order of characters (ASCII order) * !"#$%&'()*+,-./0123456789:;<=>? * @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_ * `abcdefghijklmnoprqstuvwxyz{|}~ */ /* return a non-negative index for the character c * return -1 on error */ static int tenm_font_index(int c) { /* sanity check */ if (!isprint(c)) { fprintf(stderr, "tenm_font_index: unprintable char (\\x%x)\n", c); return -1; } /* don't assume ASCII */ switch (c) { case ' ': return 0; break; case '!': return 1; break; case '"': return 2; break; case '#': return 3; break; case '$': return 4; break; case '%': return 5; break; case '&': return 6; break; case '\'': return 7; break; case '(': return 8; break; case ')': return 9; break; case '*': return 10; break; case '+': return 11; break; case ',': return 12; break; case '-': return 13; break; case '.': return 14; break; case '/': return 15; break; case '0': return 16; break; case '1': return 17; break; case '2': return 18; break; case '3': return 19; break; case '4': return 20; break; case '5': return 21; break; case '6': return 22; break; case '7': return 23; break; case '8': return 24; break; case '9': return 25; break; case ':': return 26; break; case ';': return 27; break; case '<': return 28; break; case '=': return 29; break; case '>': return 30; break; case '?': return 31; break; case '@': return 32; break; case 'A': return 33; break; case 'B': return 34; break; case 'C': return 35; break; case 'D': return 36; break; case 'E': return 37; break; case 'F': return 38; break; case 'G': return 39; break; case 'H': return 40; break; case 'I': return 41; break; case 'J': return 42; break; case 'K': return 43; break; case 'L': return 44; break; case 'M': return 45; break; case 'N': return 46; break; case 'O': return 47; break; case 'P': return 48; break; case 'Q': return 49; break; case 'R': return 50; break; case 'S': return 51; break; case 'T': return 52; break; case 'U': return 53; break; case 'V': return 54; break; case 'W': return 55; break; case 'X': return 56; break; case 'Y': return 57; break; case 'Z': return 58; break; case '[': return 59; break; case '\\': return 60; break; case ']': return 61; break; case '^': return 62; break; case '_': return 63; break; case '`': return 64; break; case 'a': return 65; break; case 'b': return 66; break; case 'c': return 67; break; case 'd': return 68; break; case 'e': return 69; break; case 'f': return 70; break; case 'g': return 71; break; case 'h': return 72; break; case 'i': return 73; break; case 'j': return 74; break; case 'k': return 75; break; case 'l': return 76; break; case 'm': return 77; break; case 'n': return 78; break; case 'o': return 79; break; case 'p': return 80; break; case 'q': return 81; break; case 'r': return 82; break; case 's': return 83; break; case 't': return 84; break; case 'u': return 85; break; case 'v': return 86; break; case 'w': return 87; break; case 'x': return 88; break; case 'y': return 89; break; case 'z': return 90; break; case '{': return 91; break; case '|': return 92; break; case '}': return 93; break; case '~': return 94; break; default: fprintf(stderr, "tenm_font_index: unknown char (\\x%x)\n", c); return -1; break; } /* should not reach here */ fprintf(stderr, "tenm_font_index: should not reach here\n"); return -1; } /* draw a line between A(a_x, a_y) and B(b_x, b_y) * assumes b_x > a_x and abs(b_x - a_x) >= abs(b_y - a_x) * return 0 on success, 1 on error */ static int tenm_draw_line2(int a_x, int a_y, int b_x, int b_y, int width, tenm_color color, int xy_reversed) { int x; int y; int x2; int y2; int dx; int dy_abs; /* 2 * abs(b_x - a_x) * (y - y_real_line) */ int error_tilde; int error_tilde2; int y_changed; int x2_changed; int status = 0; int range; /* sanity check */ if (b_x <= a_x) { fprintf(stderr, "tenm_draw_line2: not (b_x <= a_x)\n"); return 1; } if ((b_x - a_x < a_y - b_y) || (b_x - a_x < b_y - a_y)) { fprintf(stderr, "tenm_draw_line2: not " "((b_x - a_x < a_y - b_y) || (b_x - a_x < b_y - a_y))\n"); return 1; } if (width <= 0) { fprintf(stderr, "tenm_draw_line2: width is non-positive (%d)\n", width); return 1; } dx = b_x - a_x; if (a_y >= b_y) dy_abs = a_y - b_y; else dy_abs = b_y - a_y; /* to minimize error */ if (dy_abs == 0) range = width; else range = (int) (((double) (dx * width)) / tenm_sqrt(dx * dx + dy_abs * dy_abs)); if (range <= 0) range = 1; /* the Bresenham algorithm with the "wide line" hack */ x = a_x; y = a_y; /* the next point is: * either (x + 1, y) or (x + 1, y + 1) if b_y >= a_y * either (x + 1, y) or (x + 1, y - 1) otherwise */ error_tilde = 0; y_changed = 0; while (x <= b_x) { /* Bresenham again */ x2 = 0; y2 = 0; /* not very accurate, but who cares? */ error_tilde2 = 0; x2_changed = 0; while (y2 < range) { if (xy_reversed) { if (tenm_draw_point(y + y2, x + x2, color) != 0) status = 1; if (tenm_draw_point(y - y2, x - x2, color) != 0) status = 1; } else { if (tenm_draw_point(x + x2, y + y2, color) != 0) status = 1; if (tenm_draw_point(x - x2, y - y2, color) != 0) status = 1; } if ((y_changed) && (x2_changed)) { if (xy_reversed) { if (b_y >= a_y) { if (tenm_draw_point(y + y2 - 1, x + x2, color) != 0) status = 1; if (tenm_draw_point(y - y2, x- x2 - 1, color) != 0) status = 1; } else { if (tenm_draw_point(y + y2, x + x2 - 1, color) != 0) status = 1; if (tenm_draw_point(y - y2 + 1, x - x2, color) != 0) status = 1; } } else { if (b_y >= a_y) { if (tenm_draw_point(x + x2, y + y2 - 1, color) != 0) status = 1; if (tenm_draw_point(x - x2 - 1, y - y2, color) != 0) status = 1; } else { if (tenm_draw_point(x + x2 - 1, y + y2, color) != 0) status = 1; if (tenm_draw_point(x - x2, y - y2 + 1, color) != 0) status = 1; } } } y2++; error_tilde2 += 2 * dy_abs; if (error_tilde2 >= dx) { error_tilde2 -= 2 * dx; if (b_y >= a_y) x2--; else x2++; x2_changed = 1; } else { x2_changed = 0; } } x++; error_tilde += 2 * dy_abs; if (error_tilde >= dx) { error_tilde -= 2 * dx; if (b_y >= a_y) y++; else y--; y_changed = 1; } else { y_changed = 0; } } return status; } tenmado-0.10/libtenm/tenm_graphic.h0000644000175000017500000000252610276702754020147 0ustar00ooharaoohara00000000000000/* $Id: tenm_graphic.h,v 1.37 2003/01/03 23:15:26 oohara Exp $ */ #ifndef __TENM_GRAPHIC_H__ #define __TENM_GRAPHIC_H__ #include #include "tenm_primitive.h" #include "tenm_object.h" struct _tenm_image { /* number of images */ int n; SDL_Surface **image; }; typedef struct _tenm_image tenm_image; typedef Uint32 tenm_color; /* for flag in tenm_graphic_init */ #define TENM_FULLSCREEN 1 int tenm_graphic_init(int width, int height, int flag, const char *name); int tenm_draw_line(int a_x, int a_y, int b_x, int b_y, int width, tenm_color color); int tenm_draw_circle(int center_x, int center_y, int radius, int width, tenm_color color); int tenm_draw_point(int x, int y, tenm_color color); int tenm_draw_rectangle(int x, int y, int w, int h, tenm_color color); tenm_color tenm_map_color(int red, int green, int blue); int tenm_clear_window(tenm_color color); int tenm_redraw_window(void); int tenm_draw_primitive(tenm_primitive *p, tenm_color color); int tenm_draw_mass(tenm_mass *p, tenm_color color); tenm_image *tenm_load_image(int number_file, ...); void tenm_image_delete(tenm_image *p); int tenm_draw_image(int x, int y, tenm_image *image, int number); int tenm_draw_string(int x, int y, tenm_image *font, const char *string, int length); #endif /* not __TENM_GRAPHIC_H__ */ tenmado-0.10/libtenm/tenm_input.c0000644000175000017500000003202210276702754017656 0ustar00ooharaoohara00000000000000/* $Id: tenm_input.c,v 1.91 2004/02/15 14:40:48 oohara Exp $ */ #include /* atexit, malloc */ #include /* for tenm_polygon_new */ #include /* errno */ #include /* strerror */ #include #include /* tenm_redraw_window() */ #include "tenm_graphic.h" /* tenm_pow2() */ #include "tenm_math.h" #include "tenm_sdl_init.h" #include "tenm_input.h" static int number_key_mask = 0; static tenm_key *key_mask = NULL; static void (*focus_handler)(int) = NULL; static SDL_Joystick *js = NULL; static int *joystick_axis_set = NULL; static tenm_key *joystick_axis_mask = NULL; static int *joystick_button_set = NULL; static tenm_key *joystick_button_mask = NULL; static int neutral_range = 8192; static int key_status; static int tenm_add_key_status(tenm_key key, int delta); static void tenm_key_quit(void); static void tenm_joystick_quit(void); /* there is no init() for keyboard because it is initialized * along with video and there is tenm_graphic_init() */ /* ... is 0 -- TENM_NUMBER_KEY_MAX (16) of (tenm_key key) * return 0 on success, 1 on error */ int tenm_set_key(int number_key, ...) { int i; va_list ap; tenm_key *temp_key_mask = NULL; /* sanity check */ if (number_key <= -1) { fprintf(stderr, "tenm_set_key: number_key is negative\n"); return 1; } if (number_key > TENM_NUMBER_KEY_MAX) { fprintf(stderr, "tenm_set_key: warning: registering only the first " "%d keys and ignoring the rest\n", TENM_NUMBER_KEY_MAX); number_key = TENM_NUMBER_KEY_MAX; } /* initialize SDL if necessary */ if (tenm_sdl_init(SDL_INIT_VIDEO) != 0) { fprintf(stderr, "tenm_set_key: cannot initialize SDL video \n"); return 1; } errno = 0; if (atexit(tenm_key_quit) != 0) { fprintf(stderr, "tenm_set_key: cannot register tenm_key_quit " "to exit"); if (errno != 0) fprintf(stderr, " (%s)", strerror(errno)); fprintf(stderr, "\n"); tenm_key_quit(); return 1; } /* don't substitute key_mask directly, or you will be in a trouble * if realloc fails */ if (key_mask == NULL) temp_key_mask = (tenm_key *) malloc(sizeof(tenm_key) * number_key); else temp_key_mask = (tenm_key *) realloc(key_mask, sizeof(tenm_key) * number_key); if (temp_key_mask == NULL) { fprintf(stderr, "tenm_event_init: memory allocation to key_mask failed\n"); tenm_key_quit(); return 1; } key_mask = temp_key_mask; number_key_mask = number_key; va_start(ap, number_key); for (i = 0; i < number_key; i++) key_mask[i] = va_arg(ap, tenm_key); va_end(ap); return 0; } void tenm_set_focus_handler(void (*handler)(int)) { focus_handler = (void (*)(int)) handler; } /* range is the maximum of the absolute value of event.jaxis.axis * that is considered to be neutral * return TENM_JOYSTICK_INIT_SUCCESS, TENM_JOYSTICK_INIT_NO_JOYSTICK * or TENM_JOYSTICK_INIT_ERROR */ int tenm_joystick_init(int range) { int i; /* sanity check */ if (range <= 0) { fprintf(stderr, "tenm_joystick_init: strange range (%d)\n", range); return TENM_JOYSTICK_INIT_ERROR; } if (SDL_WasInit(SDL_INIT_JOYSTICK) != 0) { fprintf(stderr, "tenm_joystick_init: warning: joystick is already " "initialized\n"); return TENM_JOYSTICK_INIT_SUCCESS; } if (tenm_sdl_init(SDL_INIT_JOYSTICK) != 0) { fprintf(stderr, "tenm_joystick_init: cannot initialize SDL joystick " "(%s)\n", SDL_GetError()); return TENM_JOYSTICK_INIT_ERROR; } errno = 0; if (atexit(tenm_joystick_quit) != 0) { fprintf(stderr, "tenm_joystick_init: cannot register tenm_joystick_quit " "to exit"); if (errno != 0) fprintf(stderr, " (%s)", strerror(errno)); fprintf(stderr, "\n"); tenm_joystick_quit(); return TENM_JOYSTICK_INIT_ERROR; } if (SDL_NumJoysticks() <= 0) { fprintf(stderr, "tenm_joystick_init: no joystick found\n"); /* this is not a fatal error --- you should fall back to a keyboard */ return TENM_JOYSTICK_INIT_NO_JOYSTICK; } if (js != NULL) { fprintf(stderr, "tenm_joystick_init: js is already set\n"); /* this is a fatal error --- if we are here, joystick is not * initialized before tenm_joystick_init() is called, so * the situation is weird enough */ tenm_joystick_quit(); return TENM_JOYSTICK_INIT_ERROR; } js = SDL_JoystickOpen(0); if (js == NULL) { fprintf(stderr, "tenm_joystick_init: cannot open joystick 1 (%s)\n", SDL_GetError()); tenm_joystick_quit(); return TENM_JOYSTICK_INIT_ERROR; } if (SDL_JoystickEventState(SDL_ENABLE) != SDL_ENABLE) { fprintf(stderr, "tenm_set_key: cannot enable SDL joystick event " "processing (%s)\n", SDL_GetError()); tenm_joystick_quit(); return TENM_JOYSTICK_INIT_ERROR; } if (joystick_axis_set != NULL) { fprintf(stderr, "tenm_joystick_init: warning: joystick_axis_set is " "not NULL, freeing\n"); free(joystick_axis_set); joystick_axis_set = NULL; } joystick_axis_set = (int *) malloc(sizeof(int) * 4); if (joystick_axis_set == NULL) { fprintf(stderr, "tenm_joystick_init: malloc(joystick_axis_set) failed\n"); tenm_joystick_quit(); return TENM_JOYSTICK_INIT_ERROR; } for (i = 0; i < 4; i++) joystick_axis_set[i] = 0; if (joystick_axis_mask != NULL) { fprintf(stderr, "tenm_joystick_init: warning: joystick_axis_mask is " "not NULL, freeing\n"); free(joystick_axis_mask); joystick_axis_mask = NULL; } joystick_axis_mask = (tenm_key *) malloc(sizeof(tenm_key) * 4); if (joystick_axis_mask == NULL) { fprintf(stderr, "tenm_joystick_init: malloc(joystick_axis_mask) failed\n"); tenm_joystick_quit(); return TENM_JOYSTICK_INIT_ERROR; } if (joystick_button_set != NULL) { fprintf(stderr, "tenm_joystick_init: warning: joystick_button_set is " "not NULL, freeing\n"); free(joystick_button_set); joystick_button_set = NULL; } joystick_button_set = (int *) malloc(sizeof(int) * (TENM_NUMBER_KEY_MAX -4)); if (joystick_button_set == NULL) { fprintf(stderr, "tenm_joystick_init: malloc(joystick_button_set) " "failed\n"); tenm_joystick_quit(); return TENM_JOYSTICK_INIT_ERROR; } for (i = 0; i < TENM_NUMBER_KEY_MAX - 4; i++) joystick_button_set[i] = 0; if (joystick_button_mask != NULL) { fprintf(stderr, "tenm_joystick_init: warning: joystick_button_mask is " "not NULL, freeing\n"); free(joystick_button_mask); joystick_button_mask = NULL; } joystick_button_mask = (tenm_key *) malloc(sizeof(tenm_key) * (TENM_NUMBER_KEY_MAX - 4)); if (joystick_button_mask == NULL) { fprintf(stderr, "tenm_joystick_init: malloc(joystick_button_mask) " "failed\n"); tenm_joystick_quit(); return TENM_JOYSTICK_INIT_ERROR; } neutral_range = range; return TENM_JOYSTICK_INIT_SUCCESS; } /* translate a direction of a joystick axis into a key * return 0 on success, 1 on error */ int tenm_joystick_map_axis(int direction, tenm_key key) { /* sanity check */ if ((direction < 0) || (direction >= 4)) { fprintf(stderr, "tenm_joystick_map_axis: strange direction (%d)\n", direction); return 1; } if ((joystick_axis_set == NULL) || (joystick_axis_mask == NULL)) { fprintf(stderr, "tenm_joystick_map_axis: joystick is not initialized\n"); return 1; } joystick_axis_set[direction] = 1; joystick_axis_mask[direction] = key; return 0; } /* translate a button of a joystick axis into a key * return 0 on success, 1 on error */ int tenm_joystick_map_button(int button_index, tenm_key key) { /* sanity check */ if ((button_index < 0) || (button_index >= 12)) { fprintf(stderr, "tenm_joystick_map_button: strange button_index (%d)\n", button_index); return 1; } if ((joystick_button_set == NULL) || (joystick_button_mask == NULL)) { fprintf(stderr, "tenm_joystick_map_button: joystick is not initialized\n"); return 1; } joystick_button_set[button_index] = 1; joystick_button_mask[button_index] = key; return 0; } int tenm_get_key_status(void) { return key_status; } /* return 1 if the program should quit, 0 if not */ int tenm_event_handle(void) { SDL_Event event; while (SDL_PollEvent(&event) > 0) { if (event.type == SDL_QUIT) return 1; if (event.type == SDL_VIDEOEXPOSE) { tenm_redraw_window(); } else if (event.type == SDL_ACTIVEEVENT) { if (event.active.gain == 1) { /* the mouse cursor entered the window */ if (focus_handler != NULL) (*focus_handler)(1); } else { /* the mouse cursor left the window */ if (focus_handler != NULL) (*focus_handler)(0); } } else if (event.type == SDL_KEYDOWN) { tenm_add_key_status(event.key.keysym.sym, 1); } else if (event.type == SDL_KEYUP) { tenm_add_key_status(event.key.keysym.sym, -1); } else if (event.type == SDL_JOYAXISMOTION) { if ((joystick_axis_set == NULL) || (joystick_axis_mask == NULL)) { fprintf(stderr, "tenm_event_handle: SDL_JOYAXISMOTION event happened " "while joystick is not initialized, ignoring\n"); continue; } if (event.jaxis.axis == 0) { /* left/right (mutually exclusive) */ if (joystick_axis_set[TENM_JOYSTICK_LEFT]) { if (event.jaxis.value < -neutral_range) tenm_add_key_status(joystick_axis_mask[TENM_JOYSTICK_LEFT], 1); else tenm_add_key_status(joystick_axis_mask[TENM_JOYSTICK_LEFT], -1); } if (joystick_axis_set[TENM_JOYSTICK_RIGHT]) { if (event.jaxis.value > neutral_range) tenm_add_key_status(joystick_axis_mask[TENM_JOYSTICK_RIGHT], 1); else tenm_add_key_status(joystick_axis_mask[TENM_JOYSTICK_RIGHT], -1); } } else if (event.jaxis.axis == 1) { /* up/down (mutually exclusive) */ if (joystick_axis_set[TENM_JOYSTICK_UP]) { if (event.jaxis.value < -neutral_range) tenm_add_key_status(joystick_axis_mask[TENM_JOYSTICK_UP], 1); else tenm_add_key_status(joystick_axis_mask[TENM_JOYSTICK_UP], -1); } if (joystick_axis_set[TENM_JOYSTICK_DOWN]) { if (event.jaxis.value > neutral_range) tenm_add_key_status(joystick_axis_mask[TENM_JOYSTICK_DOWN], 1); else tenm_add_key_status(joystick_axis_mask[TENM_JOYSTICK_DOWN], -1); } } } else if (event.type == SDL_JOYBUTTONDOWN) { if ((joystick_button_set == NULL) || (joystick_button_mask == NULL)) { fprintf(stderr, "tenm_event_handle: SDL_JOYBUTTONDOWN event happened " "while joystick is not initialized, ignoring\n"); continue; } /* event.jbutton.button is always nonnegative because it is unsigned */ if ((event.jbutton.button < TENM_NUMBER_KEY_MAX - 4) && (joystick_button_set[event.jbutton.button])) tenm_add_key_status(joystick_button_mask[event.jbutton.button], 1); } else if (event.type == SDL_JOYBUTTONUP) { if ((joystick_button_set == NULL) || (joystick_button_mask == NULL)) { fprintf(stderr, "tenm_event_handle: SDL_JOYBUTTONUP event happened " "while joystick is not initialized, ignoring\n"); continue; } /* event.jbutton.button is always nonnegative because it is unsigned */ if ((event.jbutton.button < TENM_NUMBER_KEY_MAX - 4) && (joystick_button_set[event.jbutton.button])) tenm_add_key_status(joystick_button_mask[event.jbutton.button], -1); } } return 0; } /* positive delta means the key is pressed * negative delta means the key is released */ static int tenm_add_key_status(tenm_key key, int delta) { int i; int value = 0; for (i = 0; i < number_key_mask; i++) if (key == key_mask[i]) value = tenm_pow2(i); if (value == 0) { /* unknown key */ return 0; } if (delta > 0) key_status |= value; else if (delta < 0) key_status &= ~value; else return 1; return 0; } static void tenm_key_quit(void) { number_key_mask = 0; if (key_mask != NULL) { free(key_mask); key_mask = NULL; } } static void tenm_joystick_quit(void) { if (js != NULL) { SDL_JoystickClose(js); js = NULL; } if (joystick_axis_set != NULL) { free(joystick_axis_set); joystick_axis_set = NULL; } if (joystick_axis_mask != NULL) { free(joystick_axis_mask); joystick_axis_mask = NULL; } if (joystick_button_set != NULL) { free(joystick_button_set); joystick_button_set = NULL; } if (joystick_button_mask != NULL) { free(joystick_button_mask); joystick_button_mask = NULL; } neutral_range = 8192; if (SDL_WasInit(SDL_INIT_JOYSTICK) != 0) SDL_QuitSubSystem(SDL_INIT_JOYSTICK); } tenmado-0.10/libtenm/tenm_input.h0000644000175000017500000001235410276702754017671 0ustar00ooharaoohara00000000000000/* $Id: tenm_input.h,v 1.28 2002/07/13 07:50:20 oohara Exp $ */ #ifndef __TENM_INPUT_H__ #define __TENM_INPUT_H__ #include typedef SDLKey tenm_key; /* we assume int is at least 32 bit long, so 16 is a safe value */ #define TENM_NUMBER_KEY_MAX 16 /* renaming key flags just for its own sake --- well, it will save you * when you try to port this to non-SDL system */ #define TENM_KEY_BACKSPACE SDLK_BACKSPACE #define TENM_KEY_TAB SDLK_TAB #define TENM_KEY_CLEAR SDLK_CLEAR #define TENM_KEY_RETURN SDLK_RETURN #define TENM_KEY_PAUSE SDLK_PAUSE #define TENM_KEY_ESCAPE SDLK_ESCAPE #define TENM_KEY_SPACE SDLK_SPACE #define TENM_KEY_EXCLAIM SDLK_EXCLAIM #define TENM_KEY_QUOTEDBL SDLK_QUOTEDBL #define TENM_KEY_HASH SDLK_HASH #define TENM_KEY_DOLLAR SDLK_DOLLAR #define TENM_KEY_AMPERSAND SDLK_AMPERSAND #define TENM_KEY_QUOTE SDLK_QUOTE #define TENM_KEY_LEFTPAREN SDLK_LEFTPAREN #define TENM_KEY_RIGHTPAREN SDLK_RIGHTPAREN #define TENM_KEY_ASTERISK SDLK_ASTERISK #define TENM_KEY_PLUS SDLK_PLUS #define TENM_KEY_COMMA SDLK_COMMA #define TENM_KEY_MINUS SDLK_MINUS #define TENM_KEY_PERIOD SDLK_PERIOD #define TENM_KEY_SLASH SDLK_SLASH #define TENM_KEY_0 SDLK_0 #define TENM_KEY_1 SDLK_1 #define TENM_KEY_2 SDLK_2 #define TENM_KEY_3 SDLK_3 #define TENM_KEY_4 SDLK_4 #define TENM_KEY_5 SDLK_5 #define TENM_KEY_6 SDLK_6 #define TENM_KEY_7 SDLK_7 #define TENM_KEY_8 SDLK_8 #define TENM_KEY_9 SDLK_9 #define TENM_KEY_COLON SDLK_COLON #define TENM_KEY_SEMICOLON SDLK_SEMICOLON #define TENM_KEY_LESS SDLK_LESS #define TENM_KEY_EQUALS SDLK_EQUALS #define TENM_KEY_GREATER SDLK_GREATER #define TENM_KEY_QUESTION SDLK_QUESTION #define TENM_KEY_AT SDLK_AT #define TENM_KEY_LEFTBRACKET SDLK_LEFTBRACKET #define TENM_KEY_BACKSLASH SDLK_BACKSLASH #define TENM_KEY_RIGHTBRACKET SDLK_RIGHTBRACKET #define TENM_KEY_CARET SDLK_CARET #define TENM_KEY_UNDERSCORE SDLK_UNDERSCORE #define TENM_KEY_BACKQUOTE SDLK_BACKQUOTE #define TENM_KEY_a SDLK_a #define TENM_KEY_b SDLK_b #define TENM_KEY_c SDLK_c #define TENM_KEY_d SDLK_d #define TENM_KEY_e SDLK_e #define TENM_KEY_f SDLK_f #define TENM_KEY_g SDLK_g #define TENM_KEY_h SDLK_h #define TENM_KEY_i SDLK_i #define TENM_KEY_j SDLK_j #define TENM_KEY_k SDLK_k #define TENM_KEY_l SDLK_l #define TENM_KEY_m SDLK_m #define TENM_KEY_n SDLK_n #define TENM_KEY_o SDLK_o #define TENM_KEY_p SDLK_p #define TENM_KEY_q SDLK_q #define TENM_KEY_r SDLK_r #define TENM_KEY_s SDLK_s #define TENM_KEY_t SDLK_t #define TENM_KEY_u SDLK_u #define TENM_KEY_v SDLK_v #define TENM_KEY_w SDLK_w #define TENM_KEY_x SDLK_x #define TENM_KEY_y SDLK_y #define TENM_KEY_z SDLK_z #define TENM_KEY_DELETE SDLK_DELETE #define TENM_KEY_KP0 SDLK_KP0 #define TENM_KEY_KP1 SDLK_KP1 #define TENM_KEY_KP2 SDLK_KP2 #define TENM_KEY_KP3 SDLK_KP3 #define TENM_KEY_KP4 SDLK_KP4 #define TENM_KEY_KP5 SDLK_KP5 #define TENM_KEY_KP6 SDLK_KP6 #define TENM_KEY_KP7 SDLK_KP7 #define TENM_KEY_KP8 SDLK_KP8 #define TENM_KEY_KP9 SDLK_KP9 #define TENM_KEY_KP_PERIOD SDLK_KP_PERIOD #define TENM_KEY_KP_DIVIDE SDLK_KP_DIVIDE #define TENM_KEY_KP_MULTIPLY SDLK_KP_MULTIPLY #define TENM_KEY_KP_MINUS SDLK_KP_MINUS #define TENM_KEY_KP_PLUS SDLK_KP_PLUS #define TENM_KEY_KP_ENTER SDLK_KP_ENTER #define TENM_KEY_KP_EQUALS SDLK_KP_EQUALS #define TENM_KEY_UP SDLK_UP #define TENM_KEY_DOWN SDLK_DOWN #define TENM_KEY_RIGHT SDLK_RIGHT #define TENM_KEY_LEFT SDLK_LEFT #define TENM_KEY_INSERT SDLK_INSERT #define TENM_KEY_HOME SDLK_HOME #define TENM_KEY_END SDLK_END #define TENM_KEY_PAGEUP SDLK_PAGEUP #define TENM_KEY_PAGEDOWN SDLK_PAGEDOWN #define TENM_KEY_F1 SDLK_F1 #define TENM_KEY_F2 SDLK_F2 #define TENM_KEY_F3 SDLK_F3 #define TENM_KEY_F4 SDLK_F4 #define TENM_KEY_F5 SDLK_F5 #define TENM_KEY_F6 SDLK_F6 #define TENM_KEY_F7 SDLK_F7 #define TENM_KEY_F8 SDLK_F8 #define TENM_KEY_F9 SDLK_F9 #define TENM_KEY_F10 SDLK_F10 #define TENM_KEY_F11 SDLK_F11 #define TENM_KEY_F12 SDLK_F12 #define TENM_KEY_F13 SDLK_F13 #define TENM_KEY_F14 SDLK_F14 #define TENM_KEY_F15 SDLK_F15 #define TENM_KEY_NUMLOCK SDLK_NUMLOCK #define TENM_KEY_CAPSLOCK SDLK_CAPSLOCK #define TENM_KEY_SCROLLOCK SDLK_SCROLLOCK #define TENM_KEY_RSHIFT SDLK_RSHIFT #define TENM_KEY_LSHIFT SDLK_LSHIFT #define TENM_KEY_RCTRL SDLK_RCTRL #define TENM_KEY_LCTRL SDLK_LCTRL #define TENM_KEY_RALT SDLK_RALT #define TENM_KEY_LALT SDLK_LALT #define TENM_KEY_RMETA SDLK_RMETA #define TENM_KEY_LMETA SDLK_LMETA #define TENM_KEY_LSUPER SDLK_LSUPER #define TENM_KEY_RSUPER SDLK_RSUPER #define TENM_KEY_MODE SDLK_MODE #define TENM_KEY_HELP SDLK_HELP #define TENM_KEY_PRINT SDLK_PRINT #define TENM_KEY_SYSREQ SDLK_SYSREQ #define TENM_KEY_BREAK SDLK_BREAK #define TENM_KEY_MENU SDLK_MENU #define TENM_KEY_POWER SDLK_POWER #define TENM_KEY_EURO SDLK_EURO /* for the return value of tenm_joystick_init() */ #define TENM_JOYSTICK_INIT_SUCCESS 0 #define TENM_JOYSTICK_INIT_NO_JOYSTICK 1 #define TENM_JOYSTICK_INIT_ERROR 2 /* for direction (arg 1) of tenm_joystick_map_axis() */ #define TENM_JOYSTICK_UP 0 #define TENM_JOYSTICK_DOWN 1 #define TENM_JOYSTICK_RIGHT 2 #define TENM_JOYSTICK_LEFT 3 int tenm_set_key(int number_key, ...); void tenm_set_focus_handler(void (*handler)(int)); int tenm_joystick_init(int range); int tenm_joystick_map_axis(int direction, tenm_key key); int tenm_joystick_map_button(int button_index, tenm_key key); int tenm_get_key_status(void); int tenm_event_handle(void); #endif /* not __TENM_INPUT_H__ */ tenmado-0.10/libtenm/tenm_math.c0000644000175000017500000001075210276702754017456 0ustar00ooharaoohara00000000000000/* $Id: tenm_math.c,v 1.24 2003/01/14 03:03:58 oohara Exp $ */ #include /* malloc, atexit */ #include #include /* errno */ #include /* strerror */ #include #include "tenm_math.h" /* L said, "Easy, it's 3.1415926... [2.38M digits followed]" */ static double pi = 3.1415; static double *sin_table = NULL; static double *cos_table = NULL; static double *sqrt_table = NULL; static int sqrt_table_size = 0; static int *pow2_table = NULL; static int pow2_table_size = 0; static void tenm_math_quit(void); /* return 0 on success, 1 on error */ int tenm_math_init(int sqrt_size, int pow2_size) { int i; int temp = 1; pi = acos(-1.0); /* sanity check */ if (sqrt_size <= 0) { fprintf(stderr, "tenm_math_init: sqrt_size is non-positive\n"); return 1; } if (pow2_size <= 0) { fprintf(stderr, "tenm_math_init: pow2_size is non-positive\n"); return 1; } if (sin_table != NULL) { fprintf(stderr, "tenm_math_init: warning: sin_table is not NULL," "freeing\n"); free(sin_table); sin_table = NULL; } sin_table = (double *) malloc(sizeof(double) * 360); if (sin_table == NULL) { fprintf(stderr, "tenm_math_init: malloc(sin_table) failed\n"); tenm_math_quit(); return 1; } sin_table[0] = 0.0; sin_table[90] = 1.0; sin_table[180] = 0.0; sin_table[270] = -1.0; if (cos_table != NULL) { fprintf(stderr, "tenm_math_init: warning: cos_table is not NULL," "freeing\n"); free(cos_table); cos_table = NULL; } cos_table = (double *) malloc(sizeof(double) * 360); if (cos_table == NULL) { fprintf(stderr, "tenm_math_init: malloc(cos_table) failed\n"); tenm_math_quit(); return 1; } cos_table[0] = 1.0; cos_table[90] = 0.0; cos_table[180] = -1.0; cos_table[270] = 0.0; if (sqrt_table != NULL) { fprintf(stderr, "tenm_math_init: warning: sqrt_table is not NULL," "freeing\n"); free(sqrt_table); sqrt_table = NULL; } sqrt_table = (double *) malloc(sizeof(double) * sqrt_size); if (sqrt_table == NULL) { fprintf(stderr, "tenm_math_init: malloc(sqrt_table) failed\n"); tenm_math_quit(); return 1; } if (pow2_table != NULL) { fprintf(stderr, "tenm_math_init: warning: pow2_table is not NULL," "freeing\n"); free(pow2_table); pow2_table = NULL; } pow2_table = (int *) malloc(sizeof(int) * pow2_size); if (pow2_table == NULL) { fprintf(stderr, "tenm_math_init: malloc(pow2_table) failed\n"); tenm_math_quit(); return 1; } errno = 0; if (atexit(tenm_math_quit) != 0) { fprintf(stderr, "tenm_math_init: cannot register tenm_math_quit " " to exit"); if (errno != 0) fprintf(stderr, " (%s)", strerror(errno)); fprintf(stderr, "\n"); tenm_math_quit(); return 1; } for (i = 0; i < 360; i++) sin_table[i] = sin(2.0 * pi * ((double) i) / 360.0); for (i = 0; i < 360; i++) cos_table[i] = cos(2.0 * pi * ((double) i) / 360.0); sqrt_table_size = sqrt_size; for (i = 0; i < sqrt_size; i++) sqrt_table[i] = sqrt((double) i); temp = 1; pow2_table_size = pow2_size; for (i = 0; i < pow2_size; i++) { pow2_table[i] = temp; temp *= 2; } return 0; } double tenm_sin(int theta) { if (sin_table == NULL) return sin(2.0 * pi * ((double) theta) / 360.0); while (theta < 0) theta += 360; while (theta >= 360) theta -= 360; return sin_table[theta]; } double tenm_cos(int theta) { if (cos_table == NULL) return cos(2.0 * pi * ((double) theta) / 360.0); while (theta < 0) theta += 360; while (theta >= 360) theta -= 360; return cos_table[theta]; } double tenm_sqrt(int n) { if (n < 0) return 0.0; if (sqrt_table == NULL) return sqrt((double) n); if (n >= sqrt_table_size) return sqrt((double) n); return sqrt_table[n]; } /* return 0 if n is negative */ int tenm_pow2(int n) { int temp = 1; if (n < 0) return 0; if ((pow2_table == NULL) || (n >= pow2_table_size)) { for (; n > 0; n--) temp *= 2; return temp; } return pow2_table[n]; } static void tenm_math_quit(void) { pi = 3.1415; if (sin_table != NULL) { free(sin_table); sin_table = NULL; } if (cos_table != NULL) { free(cos_table); cos_table = NULL; } if (sqrt_table != NULL) { free(sqrt_table); sqrt_table = NULL; } sqrt_table_size = 0; if (pow2_table != NULL) { free(pow2_table); pow2_table = NULL; } pow2_table_size = 0; } tenmado-0.10/libtenm/tenm_math.h0000644000175000017500000000045210276702754017457 0ustar00ooharaoohara00000000000000/* $Id: tenm_math.h,v 1.6 2002/05/10 11:01:25 oohara Exp $ */ #ifndef __TENM_MATH_H__ #define __TENM_MATH_H__ int tenm_math_init(int sqrt_size, int pow2_size); double tenm_sin(int theta); double tenm_cos(int theta); double tenm_sqrt(int n); int tenm_pow2(int n); #endif /* not __TENM_MATH_H__ */ tenmado-0.10/libtenm/tenm_object.c0000644000175000017500000001227210276702754017772 0ustar00ooharaoohara00000000000000/* $Id: tenm_object.c,v 1.43 2003/02/11 11:39:35 oohara Exp $ */ #include /* malloc */ #include /* strlen, strncpy */ #include #include "tenm_collision.h" #include "tenm_object.h" tenm_mass * tenm_mass_new(int number_primitive, tenm_primitive **p) { tenm_mass *temp; /* sanity check */ if (number_primitive <= 0) { fprintf(stderr, "tenm_mass_new: number_primitive is non-positive (%d)\n", number_primitive); return NULL; } temp = (tenm_mass *) malloc(sizeof(tenm_mass)); if (temp == NULL) { fprintf(stderr, "tenm_mass_new: malloc failed\n"); return NULL; } temp->n = number_primitive; temp->p = p; return temp; } void tenm_mass_delete(tenm_mass *p) { int i; if (p == NULL) { fprintf(stderr, "tenm_mass_delete: p is NULL\n"); return; } if (p->n <= 0) { fprintf(stderr, "tenm_mass_delete: p->n is non-positive (%d)\n", p->n); return; } if (p->p == NULL) { fprintf(stderr, "tenm_mass_delete: p->p is NULL\n"); return; } for (i = 0; i < p->n; i++) if (p->p[i] != NULL) (*(p->p[i]->delete))(p->p[i]); free(p->p); free(p); } /* name (arg 1) is duplicated * count (arg 8), count_d (arg 10), p (arg 12) and the callback functions * (arg 13 -- 16) are passed directly --- you must NOT free them manually * (tenm_object_delete() does not free the callback functions) */ tenm_object * tenm_object_new(const char *name, int attr, int hit_mask, int hit_point, double x, double y, int number_count, int *count, int number_count_d, double *count_d, int number_primitive, tenm_primitive **p, int (*move)(tenm_object *, double), int (*hit)(tenm_object *, tenm_object *), int (*act)(tenm_object *, const tenm_object *), int (*draw)(tenm_object *, int)) { tenm_object *temp; temp = (tenm_object *) malloc(sizeof(tenm_object)); if (temp == NULL) { fprintf(stderr, "tenm_object_new: malloc(temp) failed\n"); return NULL; } if (name != NULL) { /* +1 is for the trailing \0 */ temp->name = (char *) malloc(sizeof(char) * (strlen(name) + 1)); if (temp->name == NULL) { fprintf(stderr, "tenm_object_new: malloc(temp->name) failed\n"); free(temp); return NULL; } strncpy(temp->name, name, strlen(name)); temp->name[strlen(name)] = '\0'; } temp->mass = NULL; if (number_primitive >= 1) { if (p == NULL) { fprintf(stderr, "tenm_object_new: p is NULL\n"); if (name != NULL) free(temp->name); free(temp); return NULL; } temp->mass = tenm_mass_new(number_primitive, p); if (temp->mass == NULL) { fprintf(stderr, "tenm_object_new: tenm_mass_new failed\n"); if (name != NULL) free(temp->name); free(temp); return NULL; } } temp->table_index = -1; /* temp->name is set above */ temp->attr = attr; temp->hit_mask = hit_mask; temp->hit_point = hit_point; temp->x = x; temp->y = y; temp->n = number_count; temp->count = count; temp->n_d = number_count_d; temp->count_d = count_d; temp->move = (int (*)(void *, double)) move; temp->hit = (int (*)(void *, void *)) hit; temp->act = (int (*)(void *, const void *)) act; temp->draw = (int (*)(void *, int)) draw; return temp; } void tenm_object_delete(tenm_object *p) { if (p == NULL) { fprintf(stderr, "tenm_object_delete: p is NULL\n"); return; } if (p->name != NULL) free(p->name); if (p->mass != NULL) tenm_mass_delete(p->mass); if (p->count_d != NULL) free(p->count_d); if (p->count != NULL) free(p->count); free(p); } /* return 1 (true) or 0 (false) */ int tenm_collided_mass(tenm_mass *p, tenm_mass *q) { int i; int j; /* sanity check */ if (p == NULL) { fprintf(stderr, "tenm_collided_mass: p is NULL\n"); return 0; } if (p->n <= 0) { fprintf(stderr, "tenm_collided_mass: p->n is non-positive\n"); return 0; } if (p->p == NULL) { fprintf(stderr, "tenm_collided_mass: p->p is NULL\n"); return 0; } if (q == NULL) { fprintf(stderr, "tenm_collided_mass: q is NULL\n"); return 0; } if (q->n <= 0) { fprintf(stderr, "tenm_collided_mass: q->n is non-positive\n"); return 0; } if (q->p == NULL) { fprintf(stderr, "tenm_collided_mass: q->p is NULL\n"); return 0; } for (i = 0; i < p->n; i++) for (j = 0; j < q->n; j++) if (tenm_collided_primitive(p->p[i], q->p[j])) return 1; return 0; } /* return 0 on success, 1 on error */ int tenm_move_mass(tenm_mass *p, double dx, double dy) { int i; int status = 0; /* sanity check */ if (p == NULL) { fprintf(stderr, "tenm_move_mass: p is NULL\n"); return 1; } if (p->n <= 0) { fprintf(stderr, "tenm_move_mass: p->n is non-positive\n"); return 1; } if (p->p == NULL) { fprintf(stderr, "tenm_move_mass: p->p is NULL\n"); return 1; } for (i = 0; i < p->n; i++) { if (tenm_move_primitive(p->p[i], dx, dy) != 0) { fprintf(stderr, "tenm_move_mass: tenm_move_primitive(%d) failed\n", i); status = 1; } } return status; } tenmado-0.10/libtenm/tenm_object.h0000644000175000017500000000337310276702754020001 0ustar00ooharaoohara00000000000000/* $Id: tenm_object.h,v 1.44 2003/02/11 11:19:37 oohara Exp $ */ #ifndef __TENM_OBJECT_H__ #define __TENM_OBJECT_H__ #include "tenm_primitive.h" struct _tenm_mass { /* number of primitives */ int n; tenm_primitive **p; }; typedef struct _tenm_mass tenm_mass; struct _tenm_object { int table_index; char *name; int attr; int hit_mask; int hit_point; double x; double y; /* number of count */ int n; int *count; /* number of count_d */ int n_d; double *count_d; tenm_mass *mass; /* pointer for these functions must be void because tenm_object is not * yet defined */ int (*move)(void *, double); int (*hit)(void *, void *); /* action other than move (such as shoot) */ int (*act)(void *, const void *); int (*draw)(void *, int); /* there is no need to put *tenm_image in this struct */ }; typedef struct _tenm_object tenm_object; tenm_mass *tenm_mass_new(int number_primitive, tenm_primitive **p); void tenm_mass_delete(tenm_mass *p); tenm_object *tenm_object_new(const char *name, int attr, int hit_mask, int hit_point, double x, double y, int number_count, int *count, int number_count_d, double *count_d, int number_primitive, tenm_primitive **p, int (*move)(tenm_object *, double), int (*hit)(tenm_object *, tenm_object *), int (*act)(tenm_object *, const tenm_object *), int (*draw)(tenm_object *, int)); void tenm_object_delete(tenm_object *p); int tenm_collided_mass(tenm_mass *p, tenm_mass *q); int tenm_move_mass(tenm_mass *p, double dx, double dy); #endif /* not __TENM_OBJECT_H__ */ tenmado-0.10/libtenm/tenm_primitive.c0000644000175000017500000001567110276702754020542 0ustar00ooharaoohara00000000000000/* $Id: tenm_primitive.c,v 1.8 2003/01/14 02:58:24 oohara Exp $ */ #include /* malloc */ #include /* for tenm_polygon_new */ #include #include "tenm_primitive.h" #define NEAR_ZERO 0.0001 tenm_point * tenm_point_new(double x, double y) { tenm_point *temp; temp = (tenm_point *) malloc(sizeof(tenm_point)); if (temp == NULL) { fprintf(stderr, "tenm_point_new: malloc failed\n"); return NULL; } ((tenm_primitive *) temp)->klass = TENM_POINT; ((tenm_primitive *) temp)->delete = (void (*)(void *)) tenm_point_delete; temp->x = x; temp->y = y; return temp; } void tenm_point_delete(tenm_point *p) { /* sanity check */ if (p == NULL) { fprintf(stderr, "tenm_point_delete: p is NULL\n"); return; } free(p); } tenm_circle * tenm_circle_new(double center_x, double center_y, double radius) { tenm_circle *temp; /* sanity check */ if (radius < NEAR_ZERO) { fprintf(stderr, "tenm_circle_new: radius is non-positive (%f)\n", radius); return NULL; } temp = (tenm_circle *) malloc(sizeof(tenm_circle)); if (temp == NULL) { fprintf(stderr, "tenm_circle_new: malloc failed\n"); return NULL; } ((tenm_primitive *) temp)->klass = TENM_CIRCLE; ((tenm_primitive *) temp)->delete = (void (*)(void *)) tenm_circle_delete; temp->center = tenm_point_new(center_x, center_y); if (temp->center == NULL) { fprintf(stderr, "tenm_circle_new: tenm_point_new failed\n"); free(temp); return NULL; } temp->r = radius; return temp; } void tenm_circle_delete(tenm_circle *p) { /* sanity check */ if (p == NULL) { fprintf(stderr, "tenm_circle_delete: p is NULL"); return; } if (p->center == NULL) { fprintf(stderr, "tenm_circle_delete: p->center is NULL"); return; } tenm_point_delete(p->center); free(p); } tenm_segment * tenm_segment_new(double a_x, double a_y, double b_x, double b_y) { tenm_segment *temp; temp = (tenm_segment *) malloc(sizeof(tenm_segment)); if (temp == NULL) { fprintf(stderr, "tenm_segment_new: malloc failed\n"); return NULL; } ((tenm_primitive *) temp)->klass = TENM_SEGMENT; ((tenm_primitive *) temp)->delete = (void (*)(void *)) tenm_segment_delete; temp->a = tenm_point_new(a_x, a_y); if (temp->a == NULL) { fprintf(stderr, "tenm_segment_new: tenm_point_new(a) failed\n"); free(temp); return NULL; } temp->b = tenm_point_new(b_x, b_y); if (temp->b == NULL) { fprintf(stderr, "tenm_segment_new: tenm_point_new(b) failed\n"); tenm_point_delete(temp->a); free(temp); return NULL; } return temp; } void tenm_segment_delete(tenm_segment *p) { if (p == NULL) { fprintf(stderr, "tenm_segment_delete: p is NULL\n"); return; } if (p->a == NULL) { fprintf(stderr, "tenm_segment_delete: p->a is NULL\n"); return; } if (p->b == NULL) { fprintf(stderr, "tenm_segment_delete: p->b is NULL\n"); return; } tenm_point_delete(p->b); tenm_point_delete(p->a); free(p); } /* ... is 3 or more of (double x, double y) */ tenm_polygon * tenm_polygon_new(int number_vertex, ...) { va_list ap; int i; int j; double x; double y; tenm_polygon *temp; /* sanity check */ if (number_vertex < 3) { fprintf(stderr, "tenm_polygon_new: strange number_vertex (%d)\n", number_vertex); return NULL; } temp = (tenm_polygon *) malloc(sizeof(tenm_polygon)); if (temp == NULL) { fprintf(stderr, "tenm_polygon_new: malloc failed\n"); return NULL; } temp->v = (tenm_point **) malloc(sizeof(tenm_point *) * number_vertex); if (temp->v == NULL) { fprintf(stderr, "tenm_polygon_new: malloc(v) failed\n"); free(temp); return NULL; } ((tenm_primitive *) temp)->klass = TENM_POLYGON; ((tenm_primitive *) temp)->delete = (void (*)(void *)) tenm_polygon_delete; va_start(ap, number_vertex); for (i = 0; i < number_vertex; i++) { x = va_arg(ap, double); y = va_arg(ap, double); temp->v[i] = tenm_point_new(x, y); if (temp->v[i] == NULL) { fprintf(stderr, "tenm_polygon_new: tenm_point_new(%d) failed\n", i); for (j = 0; j < i; j++) tenm_point_delete(temp->v[j]); free(temp); va_end(ap); return NULL; } } temp->n = number_vertex; va_end(ap); return temp; } void tenm_polygon_delete(tenm_polygon *p) { int j; if (p == NULL) { fprintf(stderr, "tenm_polygon_delete: p is NULL\n"); return; } if (p->n < 3) { fprintf(stderr, "tenm_polygon_delete: strange p->n (%d)\n", p->n); return; } if (p->v == NULL) { fprintf(stderr, "tenm_polygon_delete: p->v is NULL\n"); return; } for (j = 0; j < p->n; j++) { if (p->v[j] == NULL) { fprintf(stderr, "tenm_polygon_delete: p->v[%d] is NULL\n", j); return; } tenm_point_delete(p->v[j]); } free(p->v); free(p); } int tenm_move_primitive(tenm_primitive *p, double dx, double dy) { int i; if (p == NULL) { fprintf(stderr, "tenm_move_primitive: p is NULL\n"); return 1; } switch (p->klass) { case TENM_POINT: ((tenm_point *) p)->x += dx; ((tenm_point *) p)->y += dy; return 0; break; case TENM_CIRCLE: if (((tenm_circle *) p)->center == NULL) { fprintf(stderr, "tenm_move_primitive: " "((tenm_circle *) p)->center is NULL\n"); return 1; } ((tenm_circle *) p)->center->x += dx; ((tenm_circle *) p)->center->y += dy; return 0; break; case TENM_SEGMENT: if (((tenm_segment *) p)->a == NULL) { fprintf(stderr, "tenm_move_primitive: " "((tenm_segment *) p)->a is NULL\n"); return 1; } if (((tenm_segment *) p)->b == NULL) { fprintf(stderr, "tenm_move_primitive: " "((tenm_segment *) p)->b is NULL\n"); return 1; } ((tenm_segment *) p)->a->x += dx; ((tenm_segment *) p)->a->y += dy; ((tenm_segment *) p)->b->x += dx; ((tenm_segment *) p)->b->y += dy; return 0; break; case TENM_POLYGON: if (((tenm_polygon *) p)->v == NULL) { fprintf(stderr, "tenm_move_primitive: " "((tenm_polygon *) p)->v is NULL\n"); return 1; } if (((tenm_polygon *) p)->n < 3) { fprintf(stderr, "tenm_move_primitive: " "strange ((tenm_polygon *) p)->n (%d)\n", ((tenm_polygon *) p)->n); return 1; } for (i = 0; i < ((tenm_polygon *) p)->n; i++) { if (((tenm_polygon *) p)->v[i] == NULL) { fprintf(stderr, "tenm_move_primitive: " "((tenm_polygon *) p)->v[%d] is NULL\n", i); return 1; } ((tenm_polygon *) p)->v[i]->x += dx; ((tenm_polygon *) p)->v[i]->y += dy; } return 0; break; default: fprintf(stderr, "tenm_move_primitive: strange primitive found (%d)\n", p->klass); return 1; break; } /* should not reach here */ fprintf(stderr, "tenm_move_primitive: should not reach here\n"); return 1; } tenmado-0.10/libtenm/tenm_primitive.h0000644000175000017500000000314410276702754020537 0ustar00ooharaoohara00000000000000/* $Id: tenm_primitive.h,v 1.6 2003/02/11 11:14:23 oohara Exp $ */ #ifndef __TENM_PRIMITIVE_H__ #define __TENM_PRIMITIVE_H__ struct _tenm_primitive { int klass; void (*delete)(void *); }; typedef struct _tenm_primitive tenm_primitive; /* "parent" must be first to to use inheritance in C (not C++) */ struct _tenm_point { tenm_primitive parent; double x; double y; }; typedef struct _tenm_point tenm_point; struct _tenm_circle { tenm_primitive parent; tenm_point *center; /* radius */ double r; }; typedef struct _tenm_circle tenm_circle; struct _tenm_segment { tenm_primitive parent; /* each end of the segment */ tenm_point *a; tenm_point *b; }; typedef struct _tenm_segment tenm_segment; struct _tenm_polygon { tenm_primitive parent; /* number of vertexes */ int n; /* coordinates of vertexes */ tenm_point **v; }; typedef struct _tenm_polygon tenm_polygon; /* these values must be one of 3^n so that we can add any two of them * and get a unique number */ #define TENM_POINT 1 #define TENM_CIRCLE 3 #define TENM_SEGMENT 9 #define TENM_POLYGON 27 tenm_point *tenm_point_new(double x, double y); void tenm_point_delete(tenm_point *p); tenm_circle *tenm_circle_new(double center_x, double center_y, double radius); void tenm_circle_delete(tenm_circle *p); tenm_segment *tenm_segment_new(double a_x, double a_y, double b_x, double b_y); void tenm_segment_delete(tenm_segment *p); tenm_polygon *tenm_polygon_new(int number_vertex, ...); void tenm_polygon_delete(tenm_polygon *p); int tenm_move_primitive(tenm_primitive *p, double dx, double dy); #endif /* not __TENM_PRIMITIVE_H__ */ tenmado-0.10/libtenm/tenm_sdl_init.c0000644000175000017500000000216710276702754020333 0ustar00ooharaoohara00000000000000/* $Id: tenm_sdl_init.c,v 1.2 2003/01/14 03:04:59 oohara Exp $ */ #include /* atexit */ #include /* errno */ #include /* strerror */ #include #include #include "tenm_sdl_init.h" /* return 0 on success, 1 on error */ int tenm_sdl_init(Uint32 flags) { if (SDL_WasInit(flags) != flags) { if (SDL_WasInit(SDL_INIT_EVERYTHING) != 0) { if (SDL_InitSubSystem(flags) != 0) { { fprintf(stderr, "tenm_sdl_init: cannot initialize subsystem of SDL " "(%s)\n", SDL_GetError()); return 1; } } } else { if (SDL_Init(flags) != 0) { fprintf(stderr, "tenm_sdl_init: cannot initialize SDL " "(%s)\n", SDL_GetError()); return 1; } errno = 0; if (atexit(SDL_Quit) != 0) { fprintf(stderr, "tenm_sdl_init: " "cannot register SDL_Quit to exit"); if (errno != 0) fprintf(stderr, " (%s)", strerror(errno)); fprintf(stderr, "\n"); SDL_Quit(); return 1; } } } return 0; } tenmado-0.10/libtenm/tenm_sdl_init.h0000644000175000017500000000041510276702754020332 0ustar00ooharaoohara00000000000000/* $Id: tenm_sdl_init.h,v 1.1 2002/07/09 23:28:31 oohara Exp $ */ #ifndef __TENM_SDL_INIT_H__ #define __TENM_SDL_INIT_H__ #include /* we use Uint32 here this is for internal use only */ int tenm_sdl_init(Uint32 flags); #endif /* not __TENM_SDL_INIT_H__ */ tenmado-0.10/libtenm/tenm_table.c0000644000175000017500000002504510276702754017615 0ustar00ooharaoohara00000000000000/* $Id: tenm_table.c,v 1.56 2003/08/31 12:37:58 oohara Exp $ */ #include /* malloc, atexit */ #include /* errno */ #include /* strerror */ #include #include "tenm_object.h" #include "tenm_table.h" static int table_size = 0; static int table_draw_min_priority = 0; static int table_draw_max_priority = -1; static tenm_object **object_table = NULL; static int *action_needed = NULL; static void tenm_table_quit(void); /* return 0 on success, 1 on error */ int tenm_table_init(int size, int draw_min_priority, int draw_max_priority) { int i; /* sanity check */ if (draw_min_priority > draw_max_priority) { fprintf(stderr, "tenm_table_init: draw_min_priority > " "draw_max_priority\n"); /* this is a fatal error */ return 1; } if (object_table != NULL) { fprintf(stderr, "tenm_table_init: warning: object_table is not NULL," "freeing\n"); tenm_table_clear_all(); free(object_table); object_table = NULL; } object_table = (tenm_object **) malloc(sizeof(tenm_object *) * size); if (object_table == NULL) { fprintf(stderr, "tenm_table_init: malloc(object_table) failed\n"); tenm_table_quit(); return 1; } if (action_needed != NULL) { fprintf(stderr, "tenm_table_init: warning: action_needed is not NULL," "freeing\n"); free(action_needed); action_needed = NULL; } action_needed = (int *) malloc(sizeof(int) * size); if (action_needed == NULL) { fprintf(stderr, "tenm_table_init: malloc(action_needed) failed\n"); tenm_table_quit(); return 1; } errno = 0; if (atexit(tenm_table_quit) != 0) { fprintf(stderr, "tenm_table_init: cannot register tenm_table_quit " "to exit"); if (errno != 0) fprintf(stderr, " (%s)", strerror(errno)); fprintf(stderr, "\n"); tenm_table_quit(); return 1; } table_size = size; for (i = 0; i < size; i++) { object_table[i] = NULL; action_needed[i] = 1; } table_draw_min_priority = draw_min_priority; table_draw_max_priority = draw_max_priority; return 0; } /* return the index of the table on success, -1 on error */ int tenm_table_add(tenm_object *object) { int i; /* sanity check */ if (object == NULL) { fprintf(stderr, "tenm_table_add: object is NULL\n"); return -1; } if ((object_table == NULL) || (action_needed == NULL)) { fprintf(stderr, "tenm_table_add: table is not initialized\n"); return -1; } for (i = 0; i < table_size; i++) if (object_table[i] == NULL) { object->table_index = i; object_table[i] = object; action_needed[i] = 0; return i; } fprintf(stderr, "tenm_table_add: no more space\n"); return -1; } void tenm_table_delete(int i) { if (object_table == NULL) return; if (object_table[i] == NULL) return; if (action_needed == NULL) return; tenm_object_delete(object_table[i]); object_table[i] = NULL; action_needed[i] = 1; } void tenm_table_clear_all(void) { int i; if (object_table == NULL) return; for (i = 0; i < table_size; i++) if (object_table[i] != NULL) tenm_table_delete(i); } /* return 1 if player is deleted, 0 if not */ int tenm_table_move(tenm_object *player, int turn_per_frame) { int i; double tpf = (double) turn_per_frame; /* sanity check */ if ((object_table == NULL) || (action_needed == NULL)) { fprintf(stderr, "tenm_table_move: table is not initialized\n"); return 0; } if (turn_per_frame < 1) { fprintf(stderr, "tenm_table_move: strange turn_per_frame (%d)\n", turn_per_frame); return 0; } for (i = 0; i < table_size; i++) { if (object_table[i] == NULL) continue; if (object_table[i]->move == NULL) continue; if ((*(object_table[i]->move))(object_table[i], tpf)) tenm_table_delete(i); } if (player == NULL) return 0; if (player->move == NULL) return 0; if ((*(player->move))(player, tpf)) { tenm_object_delete(player); /* note that this "player" is a local variable */ player = NULL; return 1; } return 0; } /* return 1 if player is deleted, 0 if not */ int tenm_table_detect_collision(tenm_object *player) { int i; int j; int i_need_delete = 0; int j_need_delete = 0; int status = 0; /* sanity check */ if ((object_table == NULL) || (action_needed == NULL)) { fprintf(stderr, "tenm_table_detect_collision: table is not initialized\n"); return 0; } /* collision between objects */ for (i = 0; i < table_size; i++) for (j = i + 1; j < table_size; j++) { if (object_table[i] == NULL) continue; if (object_table[j] == NULL) continue; /* no need to detect collision if there is nothing to do when * they collide */ if ((!(object_table[i]->hit_mask & object_table[j]->attr)) && (!(object_table[j]->hit_mask & object_table[i]->attr))) continue; if ((object_table[i]->hit == NULL) && (object_table[j]->hit == NULL)) continue; if (object_table[i]->mass == NULL) continue; if (object_table[j]->mass == NULL) continue; if (! tenm_collided_mass(object_table[i]->mass, object_table[j]->mass)) continue; i_need_delete = 0; j_need_delete = 0; if ((object_table[i] != NULL) && (object_table[j] != NULL) && (object_table[i]->hit_mask & object_table[j]->attr)) if ((object_table[i]->hit != NULL) && ((*(object_table[i]->hit))(object_table[i], object_table[j]) != 0)) i_need_delete = 1; /* we have to check if the objects are not NULL because * hit() of object_table[i] may delete object_table[j] * via tenm_table_apply() */ if ((object_table[i] != NULL) && (object_table[j] != NULL) && (object_table[j]->hit_mask & object_table[i]->attr)) if ((object_table[j]->hit != NULL) && ((*(object_table[j]->hit))(object_table[j], object_table[i]) != 0)) j_need_delete = 1; if (i_need_delete) tenm_table_delete(i); if (j_need_delete) tenm_table_delete(j); } /* collison between player and object */ for (i = 0; i < table_size; i++) { if (object_table[i] == NULL) continue; if (player == NULL) continue; /* no need to detect collision if there is nothing to do when * they collide */ if ((!(object_table[i]->hit_mask & player->attr)) && (!(player->hit_mask & object_table[i]->attr))) continue; if ((object_table[i]->hit == NULL) && (player->hit == NULL)) continue; if (object_table[i]->mass == NULL) continue; if (player->mass == NULL) continue; if (! tenm_collided_mass(object_table[i]->mass, player->mass)) continue; i_need_delete = 0; j_need_delete = 0; if ((object_table[i] != NULL) && (player != NULL) && (object_table[i]->hit_mask & player->attr)) if ((object_table[i]->hit != NULL) && ((*(object_table[i]->hit))(object_table[i], player) != 0)) i_need_delete = 1; if ((object_table[i] != NULL) && (player != NULL) && (player->hit_mask & object_table[i]->attr)) if ((player->hit != NULL) && ((*(player->hit))(player, object_table[i]) != 0)) j_need_delete = 1; if (i_need_delete) tenm_table_delete(i); if (j_need_delete) { tenm_object_delete(player); /* note that this "player" is a local variable */ player = NULL; status = 1; } } return status; } /* return 1 if player is deleted, 0 if not */ int tenm_table_do_action(tenm_object *player) { int i; /* sanity check */ if ((object_table == NULL) || (action_needed == NULL)) { fprintf(stderr, "tenm_table_do_action: table is not initialized\n"); return 0; } for (i = 0; i < table_size; i++) { if (object_table[i] == NULL) continue; if (object_table[i]->act == NULL) continue; if (action_needed[i] == 0) continue; if ((*(object_table[i]->act))(object_table[i], player) != 0) tenm_table_delete(i); } if (player == NULL) return 0; if (player->act == NULL) return 0; if ((*(player->act))(player, NULL) != 0) { tenm_object_delete(player); /* note that this "player" is a local variable */ player = NULL; return 1; } for (i = 0; i < table_size; i++) action_needed[i] = 1; return 0; } /* return 0 on success, 1 on error */ int tenm_table_draw(tenm_object *player) { int i; int j; int status = 0; /* sanity check */ if ((object_table == NULL) || (action_needed == NULL)) { fprintf(stderr, "tenm_table_draw: table is not initialized\n"); return 0; } for (i = table_draw_min_priority; i <= table_draw_max_priority; i++) { if ((player != NULL) && (player->draw != NULL)) { if ((*(player->draw))(player, i) != 0) status = 1; } for (j = 0; j < table_size; j++) { if (object_table[j] == NULL) continue; if (object_table[j]->draw == NULL) continue; if ((*(object_table[j]->draw))(object_table[j], i) != 0) status = 1; } } return status; } void tenm_table_apply(int i, int (*func)(tenm_object *, int), int n) { /* sanity check */ if ((object_table == NULL) || (action_needed == NULL)) { fprintf(stderr, "tenm_table_apply: table is not initialized\n"); return; } if (func == NULL) { fprintf(stderr, "tenm_table_apply: func is NULL\n"); return; } if ((i < 0) || (i >= table_size)) { fprintf(stderr, "tenm_table_apply: i (%d) is out of range (0 -- %d)\n", i, table_size - 1); return; } if (object_table[i] == NULL) return; if ((*func)(object_table[i], n) != 0) tenm_table_delete(i); } void tenm_table_apply_all(int (*func)(tenm_object *, int), int n) { int i; /* sanity check */ if ((object_table == NULL) || (action_needed == NULL)) { fprintf(stderr, "tenm_table_apply_all: table is not initialized\n"); return; } if (func == NULL) { fprintf(stderr, "tenm_table_apply_all: func is NULL\n"); return; } for (i = 0; i < table_size; i++) tenm_table_apply(i, (int (*)(tenm_object *, int)) func, n); } static void tenm_table_quit(void) { table_size = 0; table_draw_min_priority = 0; table_draw_max_priority = -1; if (object_table != NULL) { tenm_table_clear_all(); free(object_table); object_table = NULL; } if (action_needed != NULL) { free(action_needed); action_needed = NULL; } } tenmado-0.10/libtenm/tenm_table.h0000644000175000017500000000127510276702754017621 0ustar00ooharaoohara00000000000000/* $Id: tenm_table.h,v 1.16 2002/05/30 21:45:58 oohara Exp $ */ #ifndef __TENM_TABLE_H__ #define __TENM_TABLE_H__ #include "tenm_object.h" int tenm_table_init(int size, int draw_min_priority, int draw_max_priority); int tenm_table_add(tenm_object *object); void tenm_table_delete(int i); void tenm_table_clear_all(void); int tenm_table_move(tenm_object *player, int turn_per_frame); int tenm_table_detect_collision(tenm_object *player); int tenm_table_do_action(tenm_object *player); int tenm_table_draw(tenm_object *player); void tenm_table_apply(int i, int (*func)(tenm_object *, int), int n); void tenm_table_apply_all(int (*func)(tenm_object *, int), int n); #endif /* not __TENM_TABLE_H__ */ tenmado-0.10/libtenm/tenm_timer.c0000644000175000017500000000527711277407156017653 0ustar00ooharaoohara00000000000000/* $Id: tenm_timer.c,v 1.65 2009/11/10 18:09:57 oohara Exp $ */ #include /* exit */ #include #include #include "tenm_sdl_init.h" #include "tenm_timer.h" /* The problem of SDL timer is that its granularity is 10 ms, that is, * if the machine doesn't have a good hardware clock, whenever SDL_Delay() * returns, (SDL_GetTicks() % 10) is always same. In this case, * a simple SDL_Delay(delay - (now - past)) is not enough. */ static Uint32 tick = 0; static Uint32 tick_master = 0; static int number_wait = 0; static int clock_granularity = 0; /* return 0 on success, 1 on error */ int tenm_timer_init(int num_wait) { int i; int t; Uint32 tick_begin; /* sanity check */ if (num_wait <= 0) { fprintf(stderr, "tenm_timer_init: strange num_wait (%d)\n", num_wait); return 1; } if (tenm_sdl_init(SDL_INIT_TIMER) != 0) { fprintf(stderr, "tenm_timer_init: cannot initialize SDL timer\n"); return 1; } number_wait = num_wait; /* jump to another 10 ms */ SDL_Delay(10); /* clock accuracy tests */ tick_begin = SDL_GetTicks(); for (i = 0; i < 10; i++) SDL_Delay(1); t = SDL_GetTicks() - tick_begin; if (t > 0) t = t / 10 + 1; if (t < 1) t = 1; clock_granularity = t; tenm_timer_reset(); return 0; } void tenm_timer_reset(void) { tick_master = SDL_GetTicks(); tick = tick_master; } /* return 0 on success, 1 on error */ int tenm_wait_next_frame(void) { Uint32 tick_now; tick_now = SDL_GetTicks(); if (tick_now < tick) { fprintf(stderr, "tenm_wait_next_frame: SDL_GetTicks ticks backward!\n"); return 1; } /* yes, this is stupid, but it offers maximum accuracy */ if (clock_granularity> 0) { while (tick_now + clock_granularity < tick + number_wait * 10) { SDL_Delay(1); tick_now = SDL_GetTicks(); } } while (tick_now < tick + number_wait * 10) tick_now = SDL_GetTicks(); tick = SDL_GetTicks(); return 0; } /* return average number of frames per second since tenm_timer_init() or * tenm_timer_reset() is called * return -1.0 on error */ double tenm_calculate_fps(int frame_passed) { Uint32 time_passed; /* sanity check */ if (frame_passed < 0) { fprintf(stderr, "tenm_calculate_fps: " "negative frame_passed\n"); return -1.0; } time_passed = SDL_GetTicks(); if (time_passed < tick_master) { fprintf(stderr, "tenm_calculate_fps: " "SDL_GetTicks ticks backward!\n"); return -1.0; } if (time_passed == tick_master) { fprintf(stderr, "tenm_calculate_fps: " "no time passed\n"); return -1.0; } time_passed -= tick_master; return 1000.0 * ((double) frame_passed) / ((double) time_passed); } tenmado-0.10/libtenm/tenm_timer.h0000644000175000017500000000044310276702754017646 0ustar00ooharaoohara00000000000000/* $Id: tenm_timer.h,v 1.8 2002/05/27 11:17:46 oohara Exp $ */ #ifndef __TENM_TIMER_H__ #define __TENM_TIMER_H__ int tenm_timer_init(int num_wait); void tenm_timer_reset(void); int tenm_wait_next_frame(void); double tenm_calculate_fps(int frame_passed); #endif /* not __TENM_TIMER_H__ */ tenmado-0.10/save/0000777000175000017500000000000011711666006014633 5ustar00ooharaoohara00000000000000tenmado-0.10/save/Makefile.am0000644000175000017500000000037010276702755016672 0ustar00ooharaoohara00000000000000# Makefile.am for tenmado/save # $Id: Makefile.am,v 1.1 2003/01/12 00:41:19 oohara Exp $ # process this file with automake --foreign to generate Makefile.in # this file is here to keep high score files in this directory # getting into the tarball tenmado-0.10/save/Makefile.in0000644000175000017500000002143211711665645016706 0ustar00ooharaoohara00000000000000# Makefile.in generated by automake 1.11 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ # Makefile.am for tenmado/save # $Id: Makefile.am,v 1.1 2003/01/12 00:41:19 oohara Exp $ # process this file with automake --foreign to generate Makefile.in VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd 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 = : subdir = save DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ 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@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ YACC = @YACC@ YFLAGS = @YFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ 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_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ 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@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ all: all-am .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 ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign save/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign save/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 $(am__aclocal_m4_deps): tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$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 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) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_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 mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am # this file is here to keep high score files in this directory # getting into the tarball # 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: