heroes-0.21/0000777004117000411500000000000007451377064006501 5heroes-0.21/src/0000777004117000411500000000000007451377055007270 5heroes-0.21/src/config.h.in0000644004117000411500000002772107451373705011236 /* src/config.h.in. Generated from configure.ac by autoheader. */ /* Relative path from BINDIR to PREFIX. */ #undef BACKWARD_RELATIVE_BINDIR /* Set to 1234 if the system is little-endian, 4321 if big-endian */ #undef BYTEORDER /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define if you want debugging code. */ #undef DEBUG /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS /* Define on systems for which file names may have a so-called `drive letter' prefix, define this to compute the length of that prefix, including the colon. */ #undef FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX /* Define if the backslash character may also serve as a file name component separator. */ #undef FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR #if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX # define FILESYSTEM_PREFIX_LEN(Filename) \ ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) #else # define FILESYSTEM_PREFIX_LEN(Filename) 0 #endif /* Relative path from PREFIX to LOCALEDIR. */ #undef FORWARD_RELATIVE_LOCALEDIR /* Relative path from PREFIX to PKGDATADIR. */ #undef FORWARD_RELATIVE_PKGDATADIR /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARGZ_H /* Define to 1 if you have the `chsize' function. */ #undef HAVE_CHSIZE /* Define to 1 if you have the `dcgettext' function. */ #undef HAVE_DCGETTEXT /* Define to 1 if you have the declaration of `calloc', and to 0 if you don't. */ #undef HAVE_DECL_CALLOC /* Define to 1 if you have the declaration of `free', and to 0 if you don't. */ #undef HAVE_DECL_FREE /* Define to 1 if you have the declaration of `malloc', and to 0 if you don't. */ #undef HAVE_DECL_MALLOC /* Define to 1 if you have the declaration of `memrchr', and to 0 if you don't. */ #undef HAVE_DECL_MEMRCHR /* Define to 1 if you have the declaration of `realloc', and to 0 if you don't. */ #undef HAVE_DECL_REALLOC /* Define to 1 if you have the declaration of `stpcpy', and to 0 if you don't. */ #undef HAVE_DECL_STPCPY /* Define to 1 if you have the declaration of `strcasecmp', and to 0 if you don't. */ #undef HAVE_DECL_STRCASECMP /* Define to 1 if you have the declaration of `strerror', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the declaration of `strnlen', and to 0 if you don't. */ #undef HAVE_DECL_STRNLEN /* Define to 1 if you have the header file. */ #undef HAVE_DIRECT_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DMALLOC_H /* Define if the malloc check has been performed. */ #undef HAVE_DONE_WORKING_MALLOC_CHECK /* Define if the realloc check has been performed. */ #undef HAVE_DONE_WORKING_REALLOC_CHECK /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the `fcntl' function. */ #undef HAVE_FCNTL /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `feof_unlocked' function. */ #undef HAVE_FEOF_UNLOCKED /* Define to 1 if you have the `fgets_unlocked' function. */ #undef HAVE_FGETS_UNLOCKED /* Define to 1 if you have the `flock' function. */ #undef HAVE_FLOCK /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getegid' function. */ #undef HAVE_GETEGID /* Define to 1 if you have the `geteuid' function. */ #undef HAVE_GETEUID /* Define to 1 if you have the `getgid' function. */ #undef HAVE_GETGID /* Define to 1 if you have the `getopt_long' function. */ #undef HAVE_GETOPT_LONG /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define if the GNU gettext() function is already present or preinstalled. */ #undef HAVE_GETTEXT /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `getuid' function. */ #undef HAVE_GETUID /* Define if you have the iconv() function. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_IO_H /* Define if you have and nl_langinfo(CODESET). */ #undef HAVE_LANGINFO_CODESET /* Define if your file defines LC_MESSAGES. */ #undef HAVE_LC_MESSAGES /* Define if you have the SDL_mixer library installed. */ #undef HAVE_LIBSDL_MIXER /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `memcpy' function. */ #undef HAVE_MEMCPY /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mempcpy' function. */ #undef HAVE_MEMPCPY /* Define to 1 if you have the `memrchr' function. */ #undef HAVE_MEMRCHR /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_MPATROL_H /* Define to 1 if you have the `mtrace' function. */ #undef HAVE_MTRACE /* Define to 1 if you have the `munmap' function. */ #undef HAVE_MUNMAP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NL_TYPES_H /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define if you have readdir and friends. */ #undef HAVE_READDIR /* Define to 1 if you have the `SDL_EnableKeyRepeat' function. */ #undef HAVE_SDL_ENABLEKEYREPEAT /* Define to 1 if you have the `SDL_JoystickOpen' function. */ #undef HAVE_SDL_JOYSTICKOPEN /* Define to 1 if you have the `setegid' function. */ #undef HAVE_SETEGID /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the `setgid' function. */ #undef HAVE_SETGID /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `setregid' function. */ #undef HAVE_SETREGID /* Define to 1 if you have the `sleep' function. */ #undef HAVE_SLEEP /* Define to 1 if the system has the type `ssize_t'. */ #undef HAVE_SSIZE_T /* Define to 1 if you have the header file. */ #undef HAVE_STDBOOL_H /* 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 `stpcpy' function. */ #undef HAVE_STPCPY /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* 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 `strerror_r' function. */ #undef HAVE_STRERROR_R /* 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 `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_LOCKING_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* 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_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the `tsearch' function. */ #undef HAVE_TSEARCH /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H /* Define to 1 if you have the `_locking' function. */ #undef HAVE__LOCKING /* Define to 1 if you have the `_mkdir' function. */ #undef HAVE__MKDIR /* Define to 1 if you have the `__argz_count' function. */ #undef HAVE___ARGZ_COUNT /* Define to 1 if you have the `__argz_next' function. */ #undef HAVE___ARGZ_NEXT /* Define to 1 if you have the `__argz_stringify' function. */ #undef HAVE___ARGZ_STRINGIFY /* The canonical host */ #undef HOST /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST #if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR # define ISSLASH(C) ((C) == '/' || (C) == '\\') #else # define ISSLASH(C) ((C) == '/') #endif /* Define if mkdir takes only one argument. */ #undef MKDIR_TAKES_ONE_ARG /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* 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 version of this package. */ #undef PACKAGE_VERSION /* Installation prefix path. */ #undef PREFIX /* Define if compiler has function prototypes */ #undef PROTOTYPES /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if the `S_IS*' macros in do not work properly. */ #undef STAT_MACROS_BROKEN /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define if you want tracing code. */ #undef USE_HEROES_DEBUG /* Version number of package */ #undef VERSION /* whether byteorder is bigendian */ #undef WORDS_BIGENDIAN #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if doesn't define. */ #undef gid_t /* Define as `__inline' if that's what the C compiler calls it, or to nothing if it is not supported. */ #undef inline /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `long' if does not define. */ #undef off_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t heroes-0.21/src/etc/0000777004117000411500000000000007451377055010043 5heroes-0.21/src/etc/Makefile.inc0000644004117000411500000000161107401253126012151 ## -*- Makefile -*- ## Copyright 2000, 2001 Alexandre Duret-Lutz ## ## This file is part of Heroes. ## ## Heroes is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License version 2 as published by ## the Free Software Foundation. ## ## Heroes 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 heroesrcdir = $(pkgdatadir)/etc heroesrc_DATA = etc/heroesrc EXTRA_DIST += $(heroesrc_DATA) heroes-0.21/src/etc/heroesrc0000644004117000411500000000311307451357624011512 ## ## This is a system-wide heroes configuration file ## (read before any user's configuration) ## ## Try to get sound-track filenames from these places. ## Keep hqmod last so they override the standard modules. soundconf: $(data-dir)/mod/sound.conf soundconf: $(data-dir)/hqmod/sound.conf ## Uncomment the following lines if you want to share a global score ## file, or global game saves. The path must exists, Heroes is not ## smart enough to create missing directories. You will probably also ## want to create the file yourself in order to set the file's ## permissions and/or ownership, and maybe given some ## additional permissions to the heroes binary. ## The `ifdef/endif' construct here means the global files will ## only be used if the binary is either SUID or SGID. #ifdef suid-or-sgid #setrsc: score-file $(sys-dir)/scores #setrsc: saved-games-file $(sys-dir)/savedgames #endif ## $(sys-dir) defaults to /var/games/heroes, is this what you want? #setrsc: sys-dir /another/path/heroes ## By default, if Heroes has a sgid-bit or suid-bit, it will drop ## all privileges once the score and saved games are open. This ## happens before the user configuration is read, and therefore before ## the display and sound are initialized. ## ## Sometime you do not want these privileges to be dropped because ## your setup requires them. For instance your display driver might ## require read/write access to /dev/mem, or a similar requirement may ## exist for the sound library). ## ## The commands below allow Heroes to keep the s-bit privileges for ## its whole life. #keepsuid: yes #keepsgid: yes heroes-0.21/src/lvl/0000777004117000411500000000000007451377055010065 5heroes-0.21/src/lvl/access.h0000644004117000411500000000507007430322237011402 /*------------------------------------------------------------------. | Copyright 2001, 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__ACCESS__H #define HEROES__ACCESS__H /* All the following macros assume that p is a pointer to unsigned char. */ /* Read little-endian a_u16 and a_u32 values. */ #define GET_U16(p) ((p)[0] | (p)[1] << 8) #define GET_U32(p) (GET_U16(p) | (p)[2] << 16 | (p)[3] << 24) #define READ_U32(p, res) \ do { \ res = GET_U32 (p); \ p += 4; \ } while (0) #define READ_U16(p, res) \ do { \ res = GET_U16 (p); \ p += 2; \ } while (0) /* Likewise with a_u8, for completness. */ #define GET_U8(p) (*(p)) #define READ_U8(p, res) res = *p++ /* Write little-endian a_u16 and a_u32 values. */ #define SET_U16(p, val) \ do { \ (p)[0] = val; \ (p)[1] = val >> 8; \ } while (0) #define SET_U32(p, val) \ do { \ (p)[0] = val; \ (p)[1] = val >> 8; \ (p)[2] = val >> 16; \ (p)[3] = val >> 24; \ } while (0) #define WRITE_U32(p, val) \ do { \ SET_U32 (p, val); \ p += 4; \ } while (0) #define WRITE_U16(p, val) \ do { \ SET_U16 (p, val); \ p += 2; \ } while (0) /* Likewise with a_u8, for completness. */ #define SET_U8(p, val) (*(p) = val) #define WRITE_U8(p, val) *p++ = val #endif /* HEROES__ACCESS__H */ heroes-0.21/src/lvl/de_body.c0000644004117000411500000002317707450421123011545 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl_priv.h" #include "format.h" /* Simple helper function to transform masked direction into directions. */ static a_dir dir_mask_to_dir (a_dir_mask dm) { switch (dm) { case DM_UP: return D_UP; case DM_RIGHT: return D_RIGHT; case DM_DOWN: return D_DOWN; case DM_LEFT: return D_LEFT; default: /* FIXME: This is not smart. */ assert (1); return 0; } } /* Each tunnel has two input/output squares, indiced 0 and 1. tunnel_square_io[][] is used to build the map of square links as it helps to locate the square used to exit from a tunnel, given the direction of the output tunnel (first index), and the square input number (second index). For instance, if tile A is a tunnel oriented up, linked to tile B which is a tunnel oriented right, we need to: link A's square number `tunnel_square_io[w_up][0]' to B's square number `tunnel_square_io[w_right][1]' and link A's square number `tunnel_square_io[w_up][1]' to B's square number `tunnel_square_io[w_right][0]' */ int tunnel_square_io[4][2] = { {0, 1}, {1, 3}, {3, 2}, {2, 0} }; /* Reverse the walls. square_walls_in indicates directions which a square cannot be *entered* with, but the game uses square_walls_out, which indicates directions for which *exiting* a square is not allowed. So we have to set square_walls_out by `reversing' the content of square_walls_in. */ static void reverse_walls (a_level *lvl, const a_dir_mask8 *square_walls_in) { a_square_index idx; memset (lvl->square_walls_out, 0, lvl->square_count); for (idx = 0; idx < lvl->square_count; ++idx) { a_square_index *dest; a_dir_mask8 *swo = lvl->square_walls_out + idx; bool is_tunnel = (lvl->square_type[idx] == T_TUNNEL); a_dir tunnel_dir = lvl->square_direction[idx]; /* For each output direction of the square, we check whether that direction is marked as a inside-wall in the destination tile (meaning that it's not allowed to enter the destination wall by this edge). If so, we mark the direction as invalid for the current square. This does not apply if the current square is a tunnel and the direction considered is the entrance of the tunnel. */ if (!is_tunnel || tunnel_dir != D_UP) { dest = &lvl->square_move[D_UP][idx]; if ((*dest == INVALID_INDEX) || (square_walls_in[*dest] & DM_UP)) { *swo |= DM_UP; *dest = INVALID_INDEX; } } if (!is_tunnel || tunnel_dir != D_RIGHT) { dest = &lvl->square_move[D_RIGHT][idx]; if ((*dest == INVALID_INDEX) || (square_walls_in[*dest] & DM_RIGHT)) { *swo |= DM_RIGHT; *dest = INVALID_INDEX; } } if (!is_tunnel || tunnel_dir != D_DOWN) { dest = &lvl->square_move[D_DOWN][idx]; if ((*dest == INVALID_INDEX) || (square_walls_in[*dest] & DM_DOWN)) { *swo |= DM_DOWN; *dest = INVALID_INDEX; } } if (!is_tunnel || tunnel_dir != D_LEFT) { dest = &lvl->square_move[D_LEFT][idx]; if ((*dest == INVALID_INDEX) || (square_walls_in[*dest] & DM_LEFT)) { *swo |= DM_LEFT; *dest = INVALID_INDEX; } } } } /* Load the level body, and initialize most of the LVL data. */ void decode_level_body (const a_u8 *data, a_level *lvl) { const a_u8 *base_data = data; a_tile_index ti; /* Current tile index. */ a_square_index si; /* Current square index. */ a_tile_index tcount; /* Total tile count to read. */ a_dir_mask8 *square_walls_in; /* Walls forbiding to *enter* a tile. */ tcount = lvl->tile_count; square_walls_in = xmalloc (lvl->square_count); /* Initialize the default direction for all squares. Although for square where it matters, the direction is initialized below, we need a default direction for tools like 'heroeslvl' who attempt to dump the entire 'square_direction' array. */ memset (lvl->square_direction, D_UP, lvl->square_count * sizeof *lvl->square_direction); /* Read each tile. */ for (ti = 0; ti < tcount; ++ti, data += LVL_RECORD_SIZE) { a_tile_type tt; /* Tile type. */ si = TILE_INDEX_TO_SQR_INDEX (lvl, ti); /* Store tile type. */ tt = GET_TILE_TYPE (data); lvl->private->tile[ti].type = tt; lvl->square_type[SQR0 (lvl, si)] = tt; lvl->square_type[SQR1 (lvl, si)] = tt; lvl->square_type[SQR2 (lvl, si)] = tt; lvl->square_type[SQR3 (lvl, si)] = tt; /* Store inside walls. This will be used latter to initialize outside walls (only the latter are useful in the game). */ square_walls_in[SQR0 (lvl, si)] = GET_TILE_WALLS (data)[0]; square_walls_in[SQR1 (lvl, si)] = GET_TILE_WALLS (data)[1]; square_walls_in[SQR2 (lvl, si)] = GET_TILE_WALLS (data)[2]; square_walls_in[SQR3 (lvl, si)] = GET_TILE_WALLS (data)[3]; /* Store sprite. */ lvl->private->tile[ti].sprite_offset = GET_TILE_SPRITE (data); lvl->private->tile[ti].sprite_overlay_offset = GET_TILE_OVERLAY (data); switch (tt) { case T_TUNNEL: { a_tile_index dti; /* Destination tile index. */ a_square_index dsi; /* Destination square index. */ a_dir td; /* Tunnel direction. */ a_dir dtd; /* Tunnel direction for destination tile. */ dti = GET_TUNNEL_OUTPUT (data); dsi = TILE_INDEX_TO_SQR_INDEX (lvl, dti); td = GET_TUNNEL_DIR (data); /* In order to link theses squares (inputs of the tunnel) to the output squares, we need to know the direction used for the output. This direction is encoded in the output tile's record unless it's not a T_TUNNEL, in this latter case we'll just assume the output direction is the reverse of the input direction. */ if (GET_TILE_TYPE (base_data + dti * LVL_RECORD_SIZE) == T_TUNNEL) dtd = GET_TUNNEL_DIR (base_data + dti * LVL_RECORD_SIZE); else dtd = REVERSE_DIR (td); /* Adjust some output link of the relevant squares on this tile, so that leaving the square in the tunnel direction will lead to the tunnel destination square instead of the neighbor square. See also the description of tunnel_square_io. */ lvl->square_move[td][SQRX (lvl, si, tunnel_square_io[td][0])] = SQRX (lvl, dsi, tunnel_square_io[dtd][1]); lvl->square_move[td][SQRX (lvl, si, tunnel_square_io[td][1])] = SQRX (lvl, dsi, tunnel_square_io[dtd][0]); /* Adjust directions to indicate the output. */ lvl->square_direction[SQRX (lvl, si, tunnel_square_io[td][0])] = td; lvl->square_direction[SQRX (lvl, si, tunnel_square_io[td][1])] = td; /* If tunnel_square_io[td][0] and tunnel_square_io[td][1] are tunnel departures squares, that means tunnel_square_io[REVERSE_DIR (td)][0] and tunnel_square_io[REVERSE_DIR (td)][1] are not tunnels. */ lvl->square_type[SQRX (lvl, si, tunnel_square_io[REVERSE_DIR (td)][0])] = T_NONE; lvl->square_type[SQRX (lvl, si, tunnel_square_io[REVERSE_DIR (td)][1])] = T_NONE; } break; case T_ANIM: lvl->private->tile[ti].frame_count = GET_ANIM_FRAME_COUNT (data); lvl->private->tile[ti].frame_delay = GET_ANIM_FRAME_DELAY (data); lvl->private->tile[ti].anim = A_LOOP; break; case T_SPEED: { int x; for (x = 0; x < 4; ++x) { a_dir_mask dm = GET_SPEED_DIR (data)[x]; if (dm) lvl->square_direction[SQRX (lvl, si, x)] = dir_mask_to_dir (dm); else lvl->square_type[SQRX (lvl, si, x)] = T_NONE; } } goto decode_small_anim; case T_STOP: case T_BOOM: case T_ICE: case T_DUST: { int x; /* The type of each square is already set, but we don't want it on the squares where effects are not enabled. */ for (x = 0; x < 4; ++x) if (! GET_EFFECT_SET (data)[x]) lvl->square_type [SQRX (lvl, si, x)] = T_NONE; } /* Fall through. */ decode_small_anim: case T_OUTWAY: case T_NONE: lvl->private->tile[ti].frame_count = GET_SANIM_FRAME_COUNT (data); lvl->private->tile[ti].frame_delay = GET_SANIM_FRAME_DELAY (data); if (lvl->private->tile[ti].frame_count) lvl->private->tile[ti].anim = A_PINGPONG; else lvl->private->tile[ti].anim = A_NONE; break; default: assert (0); } } /* Initialize lvl->square_walls_out from square_walls_in. */ reverse_walls (lvl, square_walls_in); /* Mark all inaccessible squares as T_OUTWAY. */ for (si = 0; si < lvl->square_count; ++si) if (square_walls_in[si] == DM_ALL) lvl->square_type[si] = T_OUTWAY; free (square_walls_in); } heroes-0.21/src/lvl/de_head.c0000644004117000411500000000650507423073551011515 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl_priv.h" #include "access.h" #include "xstrduplwr.h" void decode_level_header (const a_u8 *data, a_level *lvl) { /* Structure of the header: Offset Size Repeat What -------------------------------------------------------------------- 0 4 width of the level in tiles 4 4 height of the level in tiles 8 4 horizontal wrapping AND-mask 12 4 vertical wrapping AND-mask 16 4 4 starting tile index for each player 32 1 4 starting direction (upper 4 bits) and starting square (bottom 4 bits) for each player 36 9 tile sprite map basename (zero-terminated) 45 9 sound track alias (zero-terminated) 54 1 10 unused bytes. == 64 bytes. */ int player; a_u32 starting_tile_index[4]; READ_U32 (data, lvl->tile_width); READ_U32 (data, lvl->tile_height); READ_U32 (data, lvl->tile_width_wrap); READ_U32 (data, lvl->tile_height_wrap); for (player = 0; player < 4; ++player) READ_U32 (data, starting_tile_index[player]); for (player = 0; player < 4; ++player) { a_u8 starting_dir; a_square_coord y, x; READ_U8 (data, starting_dir); /* Compute the square starting position for each player. */ y = (starting_tile_index[player] / lvl->tile_width) * 2; x = (starting_tile_index[player] % lvl->tile_width) * 2; /* The bottom bits of starting_dir holds the starting square index in the tile. */ if (starting_dir & 1) ++x; if (starting_dir & 2) ++y; lvl->private->start_pos[player].y = y; lvl->private->start_pos[player].x = x; /* The upper bits of starting_dir actually holds the direction. */ lvl->private->start_dir[player] = starting_dir >> 4; } lvl->private->tile_sprite_map_basename = xstrduplwr ((const char *) data); data += 9; lvl->private->sound_track_alias = xstrdup ((const char *) data); } heroes-0.21/src/lvl/en_body.c0000644004117000411500000001400507450421507011553 /*------------------------------------------------------------------. | Copyright 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl_priv.h" #include "format.h" /* Reverse the walls: Check all neighbour squares if it's allowed to enter the current square from there. */ static void en_reverse_walls (const a_level *lvl, a_dir_mask8 *square_walls_in) { a_square_index idx; for (idx = 0; idx < lvl->square_count; ++idx) { a_square_coord this_x = SQR_INDEX_TO_COORD_X (lvl, idx); a_square_coord this_y = SQR_INDEX_TO_COORD_Y (lvl, idx); { a_square_coord dest_y = SQR_COORD_UP (lvl, this_y); if (SQR_COORD_Y_VALID (lvl, dest_y)) { a_square_index dest = SQR_COORDS_TO_INDEX (lvl, dest_y, this_x); if ((lvl->square_walls_out[dest] & DM_DOWN) || ((lvl->square_type[dest] == T_TUNNEL) && (lvl->square_direction[dest] == D_DOWN))) square_walls_in[idx] |= DM_DOWN; } } { a_square_coord dest_x = SQR_COORD_RIGHT (lvl, this_x); if (SQR_COORD_X_VALID (lvl, dest_x)) { a_square_index dest = SQR_COORDS_TO_INDEX (lvl, this_y, dest_x); if ((lvl->square_walls_out[dest] & DM_LEFT) || ((lvl->square_type[dest] == T_TUNNEL) && (lvl->square_direction[dest] == D_LEFT))) square_walls_in[idx] |= DM_LEFT; } } { a_square_coord dest_y = SQR_COORD_DOWN (lvl, this_y); if (SQR_COORD_Y_VALID (lvl, dest_y)) { a_square_index dest = SQR_COORDS_TO_INDEX (lvl, dest_y, this_x); if ((lvl->square_walls_out[dest] & DM_UP) || ((lvl->square_type[dest] == T_TUNNEL) && (lvl->square_direction[dest] == D_UP))) square_walls_in[idx] |= DM_UP; } } { a_square_coord dest_x = SQR_COORD_LEFT (lvl, this_x); if (SQR_COORD_X_VALID (lvl, dest_x)) { a_square_index dest = SQR_COORDS_TO_INDEX (lvl, this_y, dest_x); if ((lvl->square_walls_out[dest] & DM_RIGHT) || ((lvl->square_type[dest] == T_TUNNEL) && (lvl->square_direction[dest] == D_RIGHT))) square_walls_in[idx] |= DM_RIGHT; } } } } /* Encode the level body into the preallocated buffer data */ void encode_level_body (a_u8 *data, const a_level *lvl) { a_tile_index ti; /* Current tile index. */ a_square_index si; /* Current square index. */ a_tile_index tcount; /* Total tile count to write. */ a_dir_mask8 *square_walls_in; /* Walls forbiding to *enter* a tile. */ tcount = lvl->tile_count; XCALLOC_ARRAY (square_walls_in, lvl->square_count); /* T_OUTWAY squares cannot be entered from any direction */ for (si = 0; si < lvl->square_count; ++si) if (lvl->square_type[si] == T_OUTWAY) square_walls_in[si] = DM_ALL; en_reverse_walls (lvl, square_walls_in); /* Write each tile to buffer. */ for (ti = 0; ti < tcount; ++ti, data += LVL_RECORD_SIZE) { a_tile_type tt; /* Tile type. */ si = TILE_INDEX_TO_SQR_INDEX (lvl, ti); /* Store tile type. */ tt = lvl->private->tile[ti].type; SET_TILE_TYPE (data, tt); /* Store inside walls. */ SET_TILE_WALLS (data, 0, square_walls_in[SQR0 (lvl, si)]); SET_TILE_WALLS (data, 1, square_walls_in[SQR1 (lvl, si)]); SET_TILE_WALLS (data, 2, square_walls_in[SQR2 (lvl, si)]); SET_TILE_WALLS (data, 3, square_walls_in[SQR3 (lvl, si)]); /* Store sprites. */ SET_TILE_SPRITE (data, lvl->private->tile[ti].sprite_offset); SET_TILE_OVERLAY (data, lvl->private->tile[ti].sprite_overlay_offset); switch (tt) { case T_TUNNEL: { int s; a_dir td; a_square_index tsi; a_tile_index dti; /* find a square that's part of the tunnel */ s = 0; while (lvl->square_type[SQRX (lvl, si, s)] != T_TUNNEL) ++s; tsi = SQRX (lvl, si, s); td = lvl->square_direction[tsi]; dti = SQR_INDEX_TO_TILE_INDEX (lvl, lvl->square_move[td][tsi]); SET_TUNNEL_OUTPUT (data, dti); SET_TUNNEL_DIR (data, DIR_TO_DIRMASK (td)); } break; case T_ANIM: SET_ANIM_FRAME_COUNT (data, lvl->private->tile[ti].frame_count); SET_ANIM_FRAME_DELAY (data, lvl->private->tile[ti].frame_delay - 1); break; case T_SPEED: { int x; for (x = 0; x < 4; ++x) if (lvl->square_type[SQRX (lvl, si, x)] != T_NONE) SPEED_DIR (data)[x] |= DIR_TO_DIRMASK (lvl->square_direction[SQRX (lvl, si, x)]); } goto decode_small_anim; case T_STOP: case T_BOOM: case T_ICE: case T_DUST: { int x; /* Set EFFECT_SET=non_zero for all squares that have some special effect enabled */ for (x = 0; x < 4; ++x) if (lvl->square_type [SQRX (lvl, si, x)] == T_NONE) SET_EFFECT_SET (data, x, 0); else SET_EFFECT_SET (data, x, 1); } /* Fall through. */ decode_small_anim: case T_OUTWAY: case T_NONE: SET_SANIM_FRAME_COUNT_DELAY (data, (lvl->private->tile[ti].frame_count << 4) | (lvl->private->tile[ti].frame_delay - 1)); break; default: assert (0); } } free (square_walls_in); } heroes-0.21/src/lvl/en_head.c0000644004117000411500000000622407450421507011523 /*------------------------------------------------------------------. | Copyright 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl_priv.h" #include "access.h" void encode_level_header (a_u8 *data, const a_level *lvl) { /* Structure of the header: Offset Size Repeat What -------------------------------------------------------------------- 0 4 width of the level in tiles 4 4 height of the level in tiles 8 4 horizontal wrapping AND-mask 12 4 vertical wrapping AND-mask 16 4 4 starting tile index for each player 32 1 4 starting direction (upper 4 bits) and starting square (bottom 4 bits) for each player 36 9 tile sprite map basename (zero-terminated) 45 9 sound track alias (zero-terminated) 54 1 10 unused bytes. == 64 bytes. */ int player; WRITE_U32 (data, lvl->tile_width); WRITE_U32 (data, lvl->tile_height); WRITE_U32 (data, lvl->tile_width_wrap); WRITE_U32 (data, lvl->tile_height_wrap); for (player = 0; player < 4; ++player) { a_u32 starting_square_index = SQR_COORDS_TO_INDEX (lvl, lvl->private->start_pos[player].y, lvl->private->start_pos[player].x); WRITE_U32 (data, SQR_INDEX_TO_TILE_INDEX (lvl, starting_square_index)); } for (player = 0; player < 4; ++player) { a_u8 starting_dir; starting_dir = lvl->private->start_dir[player] << 4; if (lvl->private->start_pos[player].x & 1) starting_dir |= 1; if (lvl->private->start_pos[player].y & 1) starting_dir |= 2; WRITE_U8 (data, starting_dir); } strncpy (data, lvl->private->tile_sprite_map_basename, 8); data[8] = 0; data += 9; strncpy (data, lvl->private->sound_track_alias, 8); data[8] = 0; data += 9; /* Clear unused bytes so we don't save garbage. */ memset (data, 0, 10); } heroes-0.21/src/lvl/format.h0000644004117000411500000001255407423073551011442 /*------------------------------------------------------------------. | Copyright 2001, 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__FORMAT__H #define HEROES__FORMAT__H #include "access.h" /* The body is a succession of tile_width*tile_height records. One for each tile. Structure of a record: Offset Size Repeat What -------------------------------------------------------------------- 0 4 sprite offset of the tile in the tile sprite map 4 1 4 walls for each sub square: if D_UP is set, you cannot *enter* the square from the *bottom* edge. Note this is not the expected content of square_walls_out. Actually if these bytes set the bit D_LEFT for the square (Y,X), then the same bit should be set in square_walls_out for the square (Y,X+1) (i.e. the square on the right). 8 2 sprite offset of the overlay in the tile sprite map, unless nul 10 5 parameters (see interpretation below) 15 1 tile type == 16 bytes. */ #define GET_TILE_WALLS(p) ((const a_u8 *) ((p) + 4)) #define SET_TILE_WALLS(p, idx, val) SET_U8 ((p) + 4 + (idx), (val)) #define GET_TILE_SPRITE(p) ((a_u32) (GET_U32 ((p) + 0))) #define SET_TILE_SPRITE(p, val) SET_U32 ((p) + 0, (val)) #define GET_TILE_OVERLAY(p) ((a_u16) (GET_U16 ((p) + 8))) #define SET_TILE_OVERLAY(p, val) SET_U16 ((p) + 8, (val)) #define GET_TILE_TYPE(p) ((a_tile_type) (GET_U8 ((p) + 15))) #define SET_TILE_TYPE(p, val) SET_U8 ((p) + 15, (val)) /* Parameters are used differently for each type of tile. Tunnels: Offset Size What ------------------------ 0 4 output tile index 4 1 direction (4 lower bits), delay (4 upper bits) delay was never used with tunnels. The original purpose was to delay the player underground (for the time given by delay, computed by the level editor from the length of the tunnel). Its has been abandoned because handling of vehicles "out of the map" would complexify the game internals. == 5 bytes. */ #define GET_TUNNEL_OUTPUT(p) ((a_tile_index) (GET_U32 ((p) + 10))) #define SET_TUNNEL_OUTPUT(p, val) SET_U32 ((p) + 10, (val)) #define GET_TUNNEL_DIR(p) (dir_mask_to_dir ((a_dir_mask) \ ((GET_U8 ((p) + 14)) & 15))) #define SET_TUNNEL_DIR(p, val) SET_U8((p) + 14, (val)) /* Animations: Offset Size What ------------------------ 0 1 frame count 1 1 delay between each frame (in 70th of sec.) 0 is 1/70s, 1 is 2/70s, etc. 2 3 unused == 5 bytes. */ #define GET_ANIM_FRAME_COUNT(p) (GET_U8 ((p) + 10)) #define SET_ANIM_FRAME_COUNT(p, val) SET_U8 ((p) + 10, (val)) #define GET_ANIM_FRAME_DELAY(p) (GET_U8 ((p) + 11) + 1) #define SET_ANIM_FRAME_DELAY(p, val) SET_U8 ((p) + 11, (val)) /* Stops, Booms, Ices, Dusts, Outway: Offset Size Repeat What --------------------------------- 0 1 4 For each square, zero means no effect, non-zero means effect (stop, boom, ice, dust). 4 1 1 animation: frame count (upper 4 bits), and delay (lower 4 bits, where 0 means 1 and 1 is 16). == 5 bytes. */ #define GET_EFFECT_SET(p) ((const a_u8*) ((p) + 10)) #define SET_EFFECT_SET(p, idx, val) SET_U8 ((p) + 10 + (idx), (val)) #define GET_SANIM_FRAME_COUNT(p) ((GET_U8 ((p) + 14)) >> 4) #define GET_SANIM_FRAME_DELAY(p) (((GET_U8 ((p) + 14)) & 15) + 1) #define SET_SANIM_FRAME_COUNT_DELAY(p, val) SET_U8 ((p) + 14, (val)) /* Speeds: Offset Size Repeat What --------------------------------- 0 1 4 For each square, the direction*s* of the effect. 4 1 1 animation: frame count (upper 4 bits), and delay (lower 4 bits, where 0 means 1 and 1 is 16). == 5 bytes. */ #define GET_SPEED_DIR(p) ((const a_dir_mask8 *) ((p) + 10)) #define SPEED_DIR(p) ((a_u8 *)((p) + 10)) #endif /* HEROES__FORMAT__H */ heroes-0.21/src/lvl/free.c0000644004117000411500000000341207352614755011067 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl_priv.h" void lvl_free (a_level *lvl) { XFREE0 (lvl->private->tile); XFREE0 (lvl->private->sound_track_alias); XFREE0 (lvl->private->tile_sprite_map_basename); XFREE0 (lvl->private); XFREE0 (lvl->square_type); XFREE0 (lvl->square_walls_out); XFREE0 (lvl->square_direction); XFREE0 (lvl->square_move[D_UP]); XFREE0 (lvl->square_move[D_RIGHT]); XFREE0 (lvl->square_move[D_DOWN]); XFREE0 (lvl->square_move[D_LEFT]); } heroes-0.21/src/lvl/in_body.c0000644004117000411500000000674207352614755011602 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl_priv.h" void initialize_level_body (a_level *lvl) { a_square_coord y, x; a_square_index idx; /* Allocate various buffer. */ XCALLOC_ARRAY (lvl->private->tile, lvl->tile_count); XCALLOC_ARRAY (lvl->square_type, lvl->square_count); XCALLOC_ARRAY (lvl->square_walls_out, lvl->square_count); XMALLOC_ARRAY (lvl->square_direction, lvl->square_count); XMALLOC_ARRAY (lvl->square_move[D_UP], lvl->square_count); XMALLOC_ARRAY (lvl->square_move[D_RIGHT], lvl->square_count); XMALLOC_ARRAY (lvl->square_move[D_DOWN], lvl->square_count); XMALLOC_ARRAY (lvl->square_move[D_LEFT], lvl->square_count); /* Assume any square is connected to its neighbors. */ for (y = 0, idx = 0; y < lvl->square_height; ++y) for (x = 0; x < lvl->square_width; ++x, ++idx) { lvl->square_move[D_UP][idx] = SQR_COORDS_TO_INDEX (lvl, SQR_COORD_UP (lvl, y), x); lvl->square_move[D_RIGHT][idx] = SQR_COORDS_TO_INDEX (lvl, y, SQR_COORD_RIGHT (lvl, x)); lvl->square_move[D_DOWN][idx] = SQR_COORDS_TO_INDEX (lvl, SQR_COORD_DOWN (lvl, y), x); lvl->square_move[D_LEFT][idx] = SQR_COORDS_TO_INDEX (lvl, y, SQR_COORD_LEFT (lvl, x)); } /* Prevent anybody to run out of the map by marking outgoing directions as invalid. Of course this makes sense only for non wrapped levels. */ if (lvl->square_width_wrap == DONT_WRAP) for (y = 0; y < lvl->square_height; ++y) { lvl->square_move[D_LEFT][SQR_COORDS_TO_INDEX (lvl, y, 0)] = INVALID_INDEX; lvl->square_move[D_RIGHT][SQR_COORDS_TO_INDEX (lvl, y, lvl->square_width - 1)] = INVALID_INDEX; } if (lvl->square_height_wrap == DONT_WRAP) for (x = 0; x < lvl->square_width; ++x) { lvl->square_move[D_UP][SQR_COORDS_TO_INDEX (lvl, 0, x)] = INVALID_INDEX; lvl->square_move[D_DOWN][SQR_COORDS_TO_INDEX (lvl, lvl->square_height - 1, x)] = INVALID_INDEX; } } void initialize_empty_level_body (a_level *lvl) { lvl->private->tile = 0; lvl->square_type = 0; lvl->square_walls_out = 0; lvl->square_direction = 0; lvl->square_move[D_UP] = 0; lvl->square_move[D_RIGHT] = 0; lvl->square_move[D_DOWN] = 0; lvl->square_move[D_LEFT] = 0; } heroes-0.21/src/lvl/load.c0000644004117000411500000000772707352614755011102 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl_priv.h" static void lvl_init_lvl_basic_fields (a_level *out) { out->square_height = out->tile_height * 2; out->square_width = out->tile_width * 2; if (out->tile_height_wrap == DONT_WRAP) out->square_height_wrap = DONT_WRAP; else out->square_height_wrap = (out->tile_height_wrap << 1) | 1; if (out->tile_width_wrap == DONT_WRAP) out->square_width_wrap = DONT_WRAP; else out->square_width_wrap = (out->tile_width_wrap << 1) | 1; out->tile_count = out->tile_height * out->tile_width; out->square_count = out->square_height * out->square_width; } static int lvl_load_header_mem (a_u8 *data, a_level *out) { decode_level_header (data, out); lvl_init_lvl_basic_fields (out); return 0; } static int lvl_load_header_file (int fd, a_level *out) { a_u8 *data = xmalloc (LVL_HEADER_SIZE); if (read (fd, data, LVL_HEADER_SIZE) != LVL_HEADER_SIZE) { free (data); return -1; } lvl_load_header_mem (data, out); free (data); return 0; } static int lvl_load_body_mem (a_u8 *data, a_level *out) { initialize_level_body (out); decode_level_body (data, out); return 0; } static int lvl_load_body_file (int fd, a_level *out) { size_t length = out->tile_count * LVL_RECORD_SIZE; a_u8 *data = xmalloc (length); ssize_t rlength = read (fd, data, length); if (rlength < 0 || (size_t) rlength != length) { free (data); return -1; } lvl_load_body_mem (data, out); free (data); return 0; } int lvl_load_file (const char *filename, a_level *out, bool load_body) { int fd; int err; #ifdef HAVE_MMAP bool use_mmap = false; #endif a_u8 *data; struct stat st; memset (out, 0, sizeof *out); fd = open (filename, O_RDONLY | O_BINARY); if (fd == -1) return -1; #ifdef HAVE_MMAP /* We need the size of the file in order to mmap() it. */ if (fstat (fd, &st) != 0) { close (fd); return -1; } #endif XMALLOC_VAR (out->private); #ifdef HAVE_MMAP /* Try to mmap the file. If it fail for any reason, we'll fall back to the standard file reading method. */ data = mmap (0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); if (data != (void*) -1) { /* Success. */ use_mmap = true; close (fd); } if (!use_mmap) { #endif err = lvl_load_header_file (fd, out); if (!err && load_body) err = lvl_load_body_file (fd, out); else initialize_empty_level_body (out); close (fd); #ifdef HAVE_MMAP } else { err = lvl_load_header_mem (data, out); if (!err && load_body) err = lvl_load_body_mem (data + LVL_HEADER_SIZE, out); else initialize_empty_level_body (out); munmap (data, st.st_size); } #endif return err; } heroes-0.21/src/lvl/lvl.h0000644004117000411500000002653207430322237010744 /*------------------------------------------------------------------. | Copyright 2001, 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__LVL__H #define HEROES__LVL__H /* Tiles are units of 24x20 pixels, squares are units of 12x10 pixels. There is 4 squares per tiles. Functions can use squares or tiles, depending on the resolution with which entities are stored. For instance the bonuses are stored in a tile-sized array, while the vehicules are stored in an squares-sized array. Those types are defined for better readability. The a_*_coord types are used to designate a coordinate (either X, or Y), while the a_*_index are used for square numbers (indices in one dimensional arrays: index = y_coord * width + x_coord). */ typedef unsigned int a_square_coord; typedef unsigned int a_square_index; typedef unsigned int a_tile_coord; typedef unsigned int a_tile_index; #define INVALID_INDEX (~0u) typedef struct a_square_corrd_pair a_square_corrd_pair; struct a_square_corrd_pair { a_square_coord y, x; }; typedef struct a_tile_coord_pair a_tile_coord_pair; struct a_tile_coord_pair { a_tile_coord y, x; }; /* Direction constants. */ typedef enum a_dir a_dir; enum a_dir { D_UP = 0, D_RIGHT = 1, D_DOWN = 2, D_LEFT = 3 }; typedef a_u8 a_dir8; /* Hold the same values, on 8bits. */ #define REVERSE_DIR(d) ((d) ^ 2) /* Two direction on one byte (used for trails). Don't change the encoding, this the resulting value is used to lookup sprites to draw the trail. */ typedef a_u8 a_dir8_pair; #define DIR8_TAIL(X) ((X) >> 2) #define DIR8_HEAD(X) ((X) & 0x3) #define DIR8_PAIR(H, T) (((T) << 2) | (H)) /* Number of directions, unless Heroes goes 3D this is unlikely to change :) */ #define DIR_MAX 4 /* Similar constants, but OR-able, to indicate multiple directions. */ typedef enum a_dir_mask a_dir_mask; enum a_dir_mask { DM_UP = 1, DM_RIGHT = 2, DM_DOWN = 4, DM_LEFT = 8 }; typedef a_u8 a_dir_mask8; /* Hold the same values, on 8bits. */ #define DM_ALL (DM_UP | DM_RIGHT | DM_DOWN | DM_LEFT) #define DIR_TO_DIRMASK(dir) (1 << (dir)) /* Tile type constants. */ typedef enum a_tile_type a_tile_type; enum a_tile_type { T_NONE = 0, T_STOP = 1, T_SPEED = 2, T_TUNNEL = 3, T_BOOM = 4, T_ANIM = 5, T_ICE = 6, T_DUST = 7, T_OUTWAY = 8, T_MAXTYPE /* Keep this upper bound last in the enum. */}; typedef a_u8 a_tile_type8; /* Hold the same values, on 8bits. */ typedef struct a_level a_level; /* An Heroes level. */ typedef struct a_level_bits a_level_bits; /* Hiden details about levels. */ /* The pointers in the a_level structure should point to constant data. But from the level loading code the data need to be mutable. So we allow const to be removed by defining LVL_MUTABLE. */ #ifndef LVL_MUTABLE # define LVL_MUTABLE const #endif struct a_level { /*-------------. | Dimensions. | `-------------*/ /* We store the dimensions in those two units, so that they are directly available. */ a_tile_coord tile_height; a_tile_coord tile_width; a_square_coord square_height; a_square_coord square_width; /* Some levels are wrapped: when the vehicle reach the right edge of the level, they continue as if they were entering the level from the left edge, and vice-versa. Of course this can also be set for the top and bottom. The _wrap members should be ANDed with a coordinate to wrap it. For instance a wrapped level with a width of 32 will have `tile_width_wrap' set to 31. That way an y coordinate of 35 will be mapped to 3 (== 35 & 31). Non-wrapped level set this value to `~0u' (== DONT_WRAP) so that ANDing is no-op. */ a_tile_coord tile_height_wrap; a_tile_coord tile_width_wrap; a_square_coord square_height_wrap; a_square_coord square_width_wrap; /* Most maps are allocated as one-dimensional arrays. So we define to more constants used for the size of the arrays. */ a_tile_index tile_count; /* == tile_width * tile_height */ a_square_index square_count; /* == square_width * square_height */ /*----------------------------------------------------------------. | The following arrays are initialized only if the level body has | | been loaded. See the load_body argument of lvl_load_file. | `----------------------------------------------------------------*/ /* Type of each square. */ LVL_MUTABLE a_tile_type8 *square_type; /* Set of blocked directions for each square. If the entry is set to DM_UP|DM_LEFT, it means a vehicle cannot *leave* the square by the top or left edges. */ LVL_MUTABLE a_dir_mask8 *square_walls_out; /* Directions for squares for which it matters (i.e., T_SPEED, and T_TUNNEL). */ LVL_MUTABLE a_dir8 *square_direction; /* square_move[D_UP][SQR] is the square that a vehicle shoud go into when it leave SQR by the top edge. */ LVL_MUTABLE a_square_index *square_move[DIR_MAX]; /*-------------------------------------------------------------. | Opaque structure to hide the remaining data. Use one of the | | following functions to access anything relevant in there. | `-------------------------------------------------------------*/ LVL_MUTABLE a_level_bits *private; }; #ifndef DONT_WRAP # define DONT_WRAP (~0u) /* Used for non wrapping directions. */ #endif /* Load a level from FILENAME to OUT. Return 0 on success, !0 otherwise. If LOAD_BODY is true, parse the body, and compute the various constant square_* maps declared in a_level. If LOAD_BODY is false, only the header of the level will be loaded. */ int lvl_load_file (const char *filename, a_level *out, bool load_body); int lvl_save_file (const char *filename, const a_level *out); /* Free any data associated to LVL. */ void lvl_free (a_level *lvl); /* These two functions return a pointer to a string allocated for LVL, and freed by lvl_free(). You should not free them yourself, and you should not use these results after a call to lvl_free(). */ const char *lvl_sound_track (const a_level *lvl); const char *lvl_tile_sprite_map_basename (const a_level *lvl); /* Initialize COORD, and DIR, with the starting position for PLAYER. */ void lvl_start_position (const a_level *lvl, unsigned int player, a_square_corrd_pair *coord, a_dir *dir); /*--------------------------------------------------------------------. | NOTE: The following function will fail if the body of the level | | has not been loaded (see the load_body argument of lvl_load_file). | `--------------------------------------------------------------------*/ /* Return the type of tile TILE on level LVL. */ a_tile_type lvl_tile_type (const a_level *lvl, a_tile_index tile); /* Return the output direction of a tunnel on tile TILE. This function should only be called on tiles of type T_TUNNEL. */ a_dir lvl_tunnel_output_dir (const a_level *lvl, a_tile_index tile); /* Return the offset (to the first pixel) of the sprite used to draw TILE. */ unsigned int lvl_tile_sprite_offset (const a_level *lvl, a_tile_index tile); /* Return the offset (to the first pixel) of the overlay sprite to draw on TILE. */ unsigned int lvl_tile_sprite_overlay_offset (const a_level *lvl, a_tile_index tile); /* Kind of animation. */ typedef enum an_anim_kind an_anim_kind; enum an_anim_kind { A_NONE, A_LOOP, A_PINGPONG }; /* Return information about a possible animation on tile TILE. FRAME_COUNT is the number of frames to display, and DELAY a number of 1/70sec to wait between each frame. Actually, FRAME_COUNT is the number of sprites to display: FRAME_COUNT sprites starting at the sprite index for the current tile should be displayed. There is no animation if FRAME_COUNT is set to 0. */ void lvl_animation_info (const a_level *lvl, a_tile_index tile, unsigned int *frame_count, unsigned int *delay, an_anim_kind *kind); /*----------------. | Useful macros. | `----------------*/ /* Moving to neighbor squares. */ #define SQR_COORD_LEFT(lvl_ptr, sqr_x_coord) \ (((sqr_x_coord) - 1) & (lvl_ptr)->square_width_wrap) #define SQR_COORD_RIGHT(lvl_ptr, sqr_x_coord) \ (((sqr_x_coord) + 1) & (lvl_ptr)->square_width_wrap) #define SQR_COORD_UP(lvl_ptr, sqr_y_coord) \ (((sqr_y_coord) - 1) & (lvl_ptr)->square_height_wrap) #define SQR_COORD_DOWN(lvl_ptr, sqr_y_coord) \ (((sqr_y_coord) + 1) & (lvl_ptr)->square_height_wrap) /* Checking square coordinates. */ #define SQR_COORD_X_VALID(lvl_ptr, sqr_coord_x) \ (((sqr_coord_x) < (lvl_ptr)->square_width)) #define SQR_COORD_Y_VALID(lvl_ptr, sqr_coord_y) \ (((sqr_coord_y) < (lvl_ptr)->square_height)) #define SQR_COORD_VALID(lvl_ptr, sqr_coord_y, sqr_coord_x) \ (SQR_COORD_Y_VALID (lvl_ptr, sqr_coord_y) \ && SQR_COORD_X_VALID (lvl_ptr, sqr_coord_x)) /* Index to coordinate conversions. */ #define SQR_INDEX_TO_COORD_X(lvl_ptr, sqr_index) \ ((sqr_index) % (lvl_ptr)->square_width) #define SQR_INDEX_TO_COORD_Y(lvl_ptr, sqr_index) \ ((sqr_index) / (lvl_ptr)->square_width) #define SQR_COORDS_TO_INDEX(lvl_ptr, sqr_y, sqr_x) \ ((lvl_ptr)->square_width * (sqr_y) + (sqr_x)) #define TILE_INDEX_TO_COORD_X(lvl_ptr, tile_index) \ ((tile_index) % (lvl_ptr)->tile_width) #define TILE_INDEX_TO_COORD_Y(lvl_ptr, tile_index) \ ((tile_index) / (lvl_ptr)->tile_width) #define TILE_COORDS_TO_INDEX(lvl_ptr, tile_y, tile_x) \ ((lvl_ptr)->tile_width * (tile_y) + (tile_x)) /* Tile indexes to square indexes conversions. */ #define TILE_INDEX_TO_SQR_INDEX(lvl_ptr, tile_index) \ (TILE_INDEX_TO_COORD_Y ((lvl_ptr), (tile_index)) * 2 \ * (lvl_ptr)->square_width \ + TILE_INDEX_TO_COORD_X ((lvl_ptr), (tile_index)) * 2) #define SQR_INDEX_TO_TILE_INDEX(lvl_ptr, sqr_index) \ ((SQR_INDEX_TO_COORD_Y ((lvl_ptr), (sqr_index)) / 2) \ * (lvl_ptr)->tile_width \ + (SQR_INDEX_TO_COORD_X ((lvl_ptr), (sqr_index)) / 2)) /* Given the index of the top left square of a tile, compute the index for each square in the tile. */ #define SQR0(lvl_ptr, sqr0) (sqr0) #define SQR1(lvl_ptr, sqr0) ((sqr0) + 1) #define SQR2(lvl_ptr, sqr0) ((sqr0) + (lvl_ptr)->square_width) #define SQR3(lvl_ptr, sqr0) ((sqr0) + (lvl_ptr)->square_width + 1) #define SQRX(lvl_ptr, sqr0, x) \ ((sqr0) + (((x) & 2) ? (lvl_ptr)->square_width : 0) + ((x) & 1)) #endif /* HEROES__LVL__H */ heroes-0.21/src/lvl/lvl_priv.h0000644004117000411500000000654307422620372012006 /*------------------------------------------------------------------. | Copyright 2001, 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__LVL_PRIV__H #define HEROES__LVL_PRIV__H /*-------------------------------------------------------------------. | NOTE: This is a private header, for use in the level loading code | | only. Clients of the `lvl' module should only rely on the `lvl.h' | | interface. | `-------------------------------------------------------------------*/ /* We don't want to see constant attribute from here. */ #define LVL_MUTABLE #include "lvl.h" typedef struct a_tile_data a_tile_data; struct a_tile_data { a_tile_type type; /* Animation data. */ unsigned int frame_count; unsigned int frame_delay; an_anim_kind anim; /* Tunnel data. */ /* a_dir tunnel_direction; FIXME: Useless ? */ /* Sprite data. */ unsigned int sprite_offset; unsigned int sprite_overlay_offset; }; /* Number of players handled by level format. */ #define LVL_PLAYER_COUNT 4 /* Size in bytes of the level header on disk. */ #define LVL_HEADER_SIZE 64 /* The body of the level is made of tile_count records of LVL_RECORD_SIZE bytes. */ #define LVL_RECORD_SIZE 16 /* The following is declared, but not defined in lvl.h. */ struct a_level_bits { /* Starting position for each player. */ a_square_corrd_pair start_pos[LVL_PLAYER_COUNT]; /* Starting direction for each player. */ a_dir start_dir[LVL_PLAYER_COUNT]; /* Alias for the soundtrack, to be resolved to a true filename by someone else. */ char *sound_track_alias; /* Basename for the tile sprite map, to be expanded as a real filename by someone else. */ char *tile_sprite_map_basename; /* Information for each tile (present only if the body is loaded). */ a_tile_data *tile; }; void decode_level_header (const a_u8 *data, a_level *lvl); void decode_level_body (const a_u8 *data, a_level *lvl); void initialize_level_body (a_level *out); void initialize_empty_level_body (a_level *lvl); void encode_level_header (a_u8 *data, const a_level *lvl); void encode_level_body (a_u8 *data, const a_level *lvl); #endif /* HEROES__LVL_PRIV__H */ heroes-0.21/src/lvl/privacc.c0000644004117000411500000000470307430322237011565 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl_priv.h" const char * lvl_sound_track (const a_level *lvl) { return lvl->private->sound_track_alias; } const char * lvl_tile_sprite_map_basename (const a_level *lvl) { return lvl->private->tile_sprite_map_basename; } void lvl_start_position (const a_level *lvl, unsigned int player, a_square_corrd_pair *coord, a_dir *dir) { if (coord) *coord = lvl->private->start_pos[player]; if (dir) *dir = lvl->private->start_dir[player]; } a_tile_type lvl_tile_type (const a_level *lvl, a_tile_index tile) { return lvl->private->tile[tile].type; } unsigned int lvl_tile_sprite_offset (const a_level *lvl, a_tile_index tile) { return lvl->private->tile[tile].sprite_offset; } unsigned int lvl_tile_sprite_overlay_offset (const a_level *lvl, a_tile_index tile) { return lvl->private->tile[tile].sprite_overlay_offset; } void lvl_animation_info (const a_level *lvl, a_tile_index tile, unsigned int *frame_count, unsigned int *delay, an_anim_kind *kind) { *kind = lvl->private->tile[tile].anim; *frame_count = lvl->private->tile[tile].frame_count; *delay = lvl->private->tile[tile].frame_delay; } heroes-0.21/src/lvl/save.c0000644004117000411500000000435307423064460011100 /*------------------------------------------------------------------. | Copyright 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl_priv.h" static int lvl_save_header_file (int fd, const a_level *out) { a_u8 *data = xmalloc (LVL_HEADER_SIZE); encode_level_header (data, out); if (write (fd, data, LVL_HEADER_SIZE) != LVL_HEADER_SIZE) { free (data); return -1; } free (data); return 0; } static int lvl_save_body_file (int fd, const a_level *out) { ssize_t length = out->tile_count * LVL_RECORD_SIZE; a_u8 *data = xmalloc (length); memset (data, 0, length); encode_level_body (data, out); if (write (fd, data, length) != length) { free (data); return -1; } free (data); return 0; } int lvl_save_file (const char *filename, const a_level *out) { int fd; int err; fd = open (filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRWUGO); if (fd == -1) return -1; err = lvl_save_header_file (fd, out); if (!err) err = lvl_save_body_file (fd, out); close (fd); return err; } heroes-0.21/src/lvl/Makefile.inc0000644004117000411500000000202107423073551012175 ## Copyright 2001 Alexandre Duret-Lutz ## ## This file is part of Heroes. ## ## Heroes is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License version 2 as published by ## the Free Software Foundation. ## ## Heroes 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 ## noinst_LIBRARIES= lvl/libhlvl.a lvl_libhlvl_a_SOURCES= \ lvl/access.h \ lvl/de_body.c \ lvl/de_head.c \ lvl/en_body.c \ lvl/en_head.c \ lvl/format.h \ lvl/free.c \ lvl/in_body.c \ lvl/load.c \ lvl/lvl.h \ lvl/lvl_priv.h \ lvl/privacc.c \ lvl/save.c EXTRA_DIST += \ lvl/README heroes-0.21/src/lvl/README0000644004117000411500000000257107424074773010667 This directory holds the code in charge of loading the level files and converting them to an internal, easier-to-use, representation. Levels files are made of a 64 byte header, containing level-wide informations such as dimensions or sound track to play, followed by a succession of 16 byte records, one record per tile. See the files de_head.c and de_body.c for precise details about the format of the header or the records. Level files used to be loaded directly by `load_level()' and stored into a variable of type a_level_header and an array of type a_tile_info[]. a_level_header and a_tile_info being (packed) C structs expressing the level file format. The game was then dealing directly with these data. This had some drawbacks (portability issue, impossibility to change the level format in the future, ...), hence the creation of this library. Today, this library is used for loading levels in Heroes (before playing), and by the `heroeslvl' utility. The level editor included in Heroes is still using the old level loading/saving scheme, because libhlvl is not yet able to load tilesets (moreover the level editor still uses the old level representation, not the one offered by libhlvl). Changing the level editor and libhlvl to work together is one of the not trivial tasks to do (it will probably involve a lot of cleaning in hedlite.c, one of the ugliest files among this game). heroes-0.21/src/media/0000777004117000411500000000000007451377055010347 5heroes-0.21/src/media/allegro/0000777004117000411500000000000007451377046011774 5heroes-0.21/src/media/allegro/joystick.c0000644004117000411500000000710407405721142013702 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include "joystick.h" #include "debugmsg.h" #include "errors.h" int joystick_x[2] = { 0, 0 }; /* coord. X */ int joystick_y[2] = { 0, 0 }; /* Y */ char joystick_b[2] = { 0, 0 }; /* buttons (on 2bits) */ char joystick_detected = 0; extern void heroes_init_allegro(void); char joyinit (void) { dmsg (D_JOYSTICK, "initialize joystick"); heroes_init_allegro(); if (install_joystick(JOY_TYPE_AUTODETECT) != 0) { num_joysticks = 0; } if (num_joysticks <= 0) { wmsg (_("No joystick found (run with `-J' to suppress this message).")); return joystick_detected = 0; } dmsg (D_JOYSTICK, "%d joystick(s) found", num_joysticks); return ((joystick_detected = 1)); } void get_joystick_state (void) { poll_joystick (); if (num_joysticks >= 1) { joystick_b[0] = (joystick_b[0] & ~1) | (joy[0].button[0].b ? 1 : 0); joystick_b[0] = (joystick_b[0] & ~2) | (joy[0].button[1].b ? 2 : 0); if (num_joysticks == 1 && joy[0].num_buttons >= 4) { joystick_b[1] = (joystick_b[1] & ~1) | (joy[0].button[2].b ? 1 : 0); joystick_b[1] = (joystick_b[1] & ~2) | (joy[0].button[3].b ? 2 : 0); } if (joy[0].stick[0].axis[0].d1) joystick_x[0] = -10000; else if (joy[0].stick[0].axis[0].d2) joystick_x[0] = +10000; else joystick_x[0] = 0; if (joy[0].stick[0].axis[1].d1) joystick_y[0] = -10000; else if (joy[0].stick[0].axis[1].d2) joystick_y[0] = +10000; else joystick_y[0] = 0; } if (num_joysticks >= 2) { joystick_b[1] = (joystick_b[1] & ~1) | (joy[1].button[0].b ? 1 : 0); joystick_b[1] = (joystick_b[1] & ~2) | (joy[1].button[1].b ? 2 : 0); if (joy[1].stick[0].axis[0].d1) joystick_x[1] = -10000; else if (joy[1].stick[0].axis[0].d2) joystick_x[1] = +10000; else joystick_x[1] = 0; if (joy[1].stick[0].axis[1].d1) joystick_y[1] = -10000; else if (joy[1].stick[0].axis[1].d2) joystick_y[1] = +10000; else joystick_y[1] = 0; } if (num_joysticks >= 1) dmsg (D_JOYSTICK, "joystick #1 state: x=%d y=%d b=%d", joystick_x[0], joystick_y[0], joystick_b[0]); if (num_joysticks >= 2) dmsg (D_JOYSTICK, "joystick #2 state: x=%d y=%d b=%d", joystick_x[1], joystick_y[1], joystick_b[1]); } heroes-0.21/src/media/allegro/keyb.c0000644004117000411500000000504607405213010012766 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include #include "keyb_low.h" #include "errors.h" int mouse_pos_x = 0; int mouse_pos_y = 0; char mouse_button_left = 0; char mouse_button_right = 0; char mouse_button_middle = 0; int init_mouse (void) { install_mouse (); return 0; } void mouse_show (void) { show_mouse (screen); } void mouse_hide (void) { show_mouse (0); } void update_mouse_state (void) { poll_mouse (); mouse_pos_x = mouse_x; mouse_pos_y = mouse_y; mouse_button_left = mouse_b & 1; mouse_button_right = mouse_b & 2; mouse_button_middle = mouse_b & 4; } void process_input_events (void) { int i; poll_keyboard (); /* KEY_MAX is from Allegro, HKEY_MAX is from Heroes. */ for (i = 0; i < KEY_MAX; ++i) keyboard_map[i] = key[i]; keyboard_modifiers = key_shifts; /* Apparently we have to clear the keybuf here, otherwise the next call to get_key() will still see the event polled here. (At least that's what I can see under X.) */ clear_keybuf (); } a_keycode get_key (void) { return readkey () >> 8; } int key_ready (void) { return keypressed (); } const char * keys_pref_group (void) { return "allegro"; } int keycode_to_ascii (a_keycode a) { return scancode_to_ascii (a); } heroes-0.21/src/media/allegro/keyvalues.c0000644004117000411500000000600707352614755014070 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include "keyvalues.h" const a_keycode key_modifiers[HK_MOD__MAX] = { /* HK_MOD_None */ 0, /* HK_MOD_Shift */ KB_SHIFT_FLAG, /* HK_MOD_Ctrl */ KB_CTRL_FLAG, /* HK_MOD_Alt */ KB_ALT_FLAG, /* HK_MOD_Meta */ KB_LWIN_FLAG | KB_RWIN_FLAG }; const a_keycode key_codes[HK__MAX] = { /* HK_0 */ KEY_0, /* HK_1 */ KEY_1, /* HK_2 */ KEY_2, /* HK_3 */ KEY_3, /* HK_4 */ KEY_4, /* HK_5 */ KEY_5, /* HK_6 */ KEY_6, /* HK_7 */ KEY_7, /* HK_8 */ KEY_8, /* HK_9 */ KEY_9, /* HK_BackSpace */ KEY_BACKSPACE, /* HK_CtrlL */ KEY_LCONTROL, /* HK_CtrlR */ KEY_RCONTROL, /* HK_D */ KEY_D, /* HK_d */ KEY_D, /* HK_E */ KEY_E, /* HK_Delete */ KEY_DEL, /* HK_Down */ KEY_DOWN, /* HK_End */ KEY_END, /* HK_Enter */ KEY_ENTER, /* HK_Escape */ KEY_ESC, /* HK_F */ KEY_F, /* HK_f */ KEY_F, /* HK_F1 */ KEY_F1, /* HK_F2 */ KEY_F2, /* HK_F3 */ KEY_F3, /* HK_F4 */ KEY_F4, /* HK_F5 */ KEY_F5, /* HK_F6 */ KEY_F6, /* HK_F7 */ KEY_F7, /* HK_F8 */ KEY_F8, /* HK_F9 */ KEY_F9, /* HK_F10 */ KEY_F10, /* HK_F11 */ KEY_F11, /* HK_F12 */ KEY_F12, /* HK_Home */ KEY_HOME, /* HK_i */ KEY_I, /* HK_I */ KEY_I, /* HK_Left */ KEY_LEFT, /* HK_NIL */ 0, /* HK_o */ KEY_O, /* HK_O */ KEY_O, /* HK_p */ KEY_P, /* HK_P */ KEY_P, /* HK_PageDown */ KEY_PGDN, /* HK_PageUp */ KEY_PGUP, /* HK_Pause */ KEY_PAUSE, /* HK_PrintScreen */ KEY_PRTSCR, /* HK_Right */ KEY_RIGHT, /* HK_S */ KEY_S, /* HK_s */ KEY_S, /* HK_ShiftL */ KEY_LSHIFT, /* HK_ShiftR */ KEY_RSHIFT, /* HK_Space */ KEY_SPACE, /* HK_SysRq */ KEY_PRTSCR, /* HK_t */ KEY_T, /* HK_T */ KEY_T, /* HK_Up */ KEY_UP }; heroes-0.21/src/media/allegro/video.c0000644004117000411500000000716607405224034013157 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include "video_low.h" #include "debugmsg.h" #include "errors.h" #include "argv.h" static int scr_w, scr_h; /* rendering buffer width and height */ static int scr_stretch; BITMAP *screen_rv; /* Rendering buffer. */ void set_display_params (const char *str) { (void) str; } void set_full_screen_mode (void) { } static void init_allegro (void) { dmsg (D_SYSTEM, "initialize allegro"); allegro_init (); install_keyboard (); install_mouse (); } void heroes_init_allegro (void); void heroes_init_allegro (void) { static bool done = false; if (done) return; done = true; init_allegro (); } void init_video_low (int stretch_, int *pitch) { int gfxret; heroes_init_allegro (); scr_stretch = stretch_; scr_w = 320 * scr_stretch; scr_h = 200 * scr_stretch; dmsg (D_VIDEO, "setup video mode"); set_color_depth (8); gfxret = set_gfx_mode (GFX_AUTODETECT, scr_w, scr_h, 0, 0); if (gfxret < 0) emsg ("failed to setup video mode\n%s", allegro_error); *pitch = VIRTUAL_W; dmsg (D_VIDEO, "video mode is %dx%d", SCREEN_W, SCREEN_H); screen_rv = create_bitmap (SCREEN_W, SCREEN_H); } void uninit_video_low (void) { dmsg (D_VIDEO, "setup text mode"); set_gfx_mode (GFX_TEXT, 0, 0, 0, 0); destroy_bitmap (screen_rv); } void set_pal_entry (unsigned char c, unsigned char r, unsigned char g, unsigned char b) { RGB p = { r, g, b, 0 }; dmsg (D_VIDEO, "set color %d=(%d,%d,%d)", c, r, g, b); set_color (c, &p); } void set_pal (const unsigned char *ptr, int p, int n) { PALETTE pal; int i; for (i = 0; i < 256; ++i) { pal[i].r = *ptr++; pal[i].g = *ptr++; pal[i].b = *ptr++; } dmsg (D_VIDEO, "set %d colors (%d - %d)", n/3, p/3, p/3 + n/3 - 1); set_palette_range (pal, p/3, p/3 + n/3 - 1, 0); } void vsynchro_low (const a_pixel *s, a_copy_function f) { acquire_screen (); bmp_select (screen_rv); f (s, screen_rv->line[0], 320); vsync (); blit (screen_rv, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); release_screen (); } void vsynchro2_low (const a_pixel *s1, const a_pixel *s2, a_copy_function f) { acquire_screen (); bmp_select (screen_rv); f (s1, screen_rv->line[0], 160); f (s2, screen_rv->line[0] + 160 * scr_stretch, 160); vsync (); blit (screen_rv, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H); release_screen (); } heroes-0.21/src/media/dummy/0000777004117000411500000000000007451377047011503 5heroes-0.21/src/media/dummy/joystick.c0000644004117000411500000000333107352614755013422 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "joystick.h" #include "debugmsg.h" #include "errors.h" int joystick_x[2] = { 0, 0 }; /* coord. X */ int joystick_y[2] = { 0, 0 }; /* Y */ char joystick_b[2] = { 0, 0 }; /* buttons (on 2bits) */ char joystick_detected = 0; char joyinit (void) { return joystick_detected = 0; } void get_joystick_state (void) { } heroes-0.21/src/media/dummy/strack.c0000644004117000411500000000366407352614755013063 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "strack.h" #include "debugmsg.h" #include "argv.h" #include "errors.h" void adjust_volume (void) { } void halve_volume (void) { } int init_sound_engine (void) { nosound = 1; nosfx = 1; return 0; } void uninit_sound_engine (void) { } void load_soundtrack (char *ptr) { (void) ptr; } void unload_soundtrack (void) { } void play_soundtrack (void) { } void decode_sound_options (char *option_string, const char *argv0) { (void) option_string; (void) argv0; } void print_drivers_list (void) { wmsg (_("Heroes has been compiled without sound support.")); } heroes-0.21/src/media/dummy/sfx.c0000644004117000411500000000310107352614755012356 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "sfx.h" void * load_sfx_low (char *file) { (void) file; return 0; } void free_sfx_low (void *sfx) { (void) sfx; } void play_sfx_low (void* sfx) { (void) sfx; } heroes-0.21/src/media/dummy/keyb.c0000644004117000411500000000350607404747657012527 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "keyb_low.h" int mouse_pos_x = 0; int mouse_pos_y = 0; char mouse_button_left = 0; char mouse_button_right = 0; char mouse_button_middle = 0; int init_mouse (void) { return 0; } void mouse_show (void) { } void mouse_hide (void) { } void update_mouse_state (void) { } void process_input_events (void) { } a_keycode get_key (void) { return 0; } int key_ready (void) { return 0; } const char * keys_pref_group (void) { return "none"; } int keycode_to_ascii (a_keycode a) { return a; } heroes-0.21/src/media/dummy/keysdef.c0000644004117000411500000000262007352614755013215 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "keysdef.h" const struct keynames_s keynames[] = { { 0, 0 } }; heroes-0.21/src/media/dummy/keyvalues.c0000644004117000411500000000417707352614755013604 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "keyvalues.h" const a_keycode key_modifiers[HK_MOD__MAX] = { HK_MOD_None_, HK_MOD_Shift_, HK_MOD_Ctrl_, HK_MOD_Alt_, HK_MOD_Meta_ }; const a_keycode key_codes[HK__MAX] = { HK_0_, HK_1_, HK_2_, HK_3_, HK_4_, HK_5_, HK_6_, HK_7_, HK_8_, HK_9_, HK_BackSpace_, HK_CtrlL_, HK_CtrlR_, HK_D_, HK_d_, HK_E_, HK_Delete_, HK_Down_, HK_End_, HK_Enter_, HK_Escape_, HK_F_, HK_f_, HK_F1_, HK_F2_, HK_F3_, HK_F4_, HK_F5_, HK_F6_, HK_F7_, HK_F8_, HK_F9_, HK_F10_, HK_F11_, HK_F12_, HK_Home_, HK_i_, HK_I_, HK_Left_, HK_NIL_, HK_o_, HK_O_, HK_p_, HK_P_, HK_PageDown_, HK_PageUp_, HK_Pause_, HK_PrintScreen_, HK_Right_, HK_S_, HK_s_, HK_ShiftL_, HK_ShiftR_, HK_Space_, HK_SysRq_, HK_t_, HK_T_, HK_Up_ }; heroes-0.21/src/media/dummy/video.c0000644004117000411500000000410107352614755012665 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "video_low.h" /* This is a dummy driver. The functions do absolutely nothing. */ void set_display_params (const char *str) { (void) str; } void set_full_screen_mode (void) { } void init_video_low (int stretch, int *pitch) { (void) stretch; (void) pitch; } void uninit_video_low (void) { } void set_pal_entry (unsigned char c, unsigned char r, unsigned char g, unsigned char b) { (void) c; (void) r; (void) g; (void) b; } void set_pal (const unsigned char *ptr, int p, int n) { (void) ptr; (void) p; (void) n; } void vsynchro_low (const a_pixel *s, a_copy_function f) { (void) s; (void) f; } void vsynchro2_low (const a_pixel *s1, const a_pixel *s2, a_copy_function f) { (void) s1; (void) s2; (void) f; } heroes-0.21/src/media/ggi/0000777004117000411500000000000007451377047011116 5heroes-0.21/src/media/ggi/keyb.c0000644004117000411500000000531007404747657012135 #include "system.h" #include #include #include #include #include "keyb_low.h" int mouse_pos_x = 0; int mouse_pos_y = 0; char mouse_button_left = 0; char mouse_button_right = 0; char mouse_button_middle = 0; extern ggi_visual_t visu; static int enable_mouse = 0; int init_mouse (void) { return 0; } void mouse_show (void) { enable_mouse = 1; } void mouse_hide (void) { enable_mouse = 0; } void process_input_events (void) { struct timeval t = { 0, 0 }; unsigned int mask = emKeyPress | emKeyRelease | emKeyRepeat; if (ggiEventPoll (visu, mask, &t) != emZero) { int nbr; ggi_event ev; nbr = ggiEventsQueued (visu, mask); for (; nbr; --nbr) { ggiEventRead (visu, &ev, mask); switch (ev.any.type) { /* keboard events */ case evKeyPress: assert (ev.key.label <= HKEY_MAX); keyboard_map[ev.key.label] = 1; keyboard_modifiers = ev.key.modifiers; break; case evKeyRelease: assert (ev.key.label <= HKEY_MAX); keyboard_map[ev.key.label] = 0; keyboard_modifiers = ev.key.modifiers; break; case evKeyRepeat: /* NOP */ break; default: printf ("unexpected event %d\n", ev.any.type); } } } } void update_mouse_state (void) { struct timeval t = { 0, 0 }; unsigned int mask = emPointer; /* if (!enable_mouse) return; */ if (ggiEventPoll (visu, mask, &t) != emZero) { int nbr; ggi_event ev; nbr = ggiEventsQueued (visu, mask); for (; nbr; --nbr) { ggiEventRead (visu, &ev, mask); switch (ev.any.type) { /* mouse events */ case evPtrAbsolute: mouse_pos_x = ev.pmove.x; mouse_pos_y = ev.pmove.y; break; case evPtrRelative: mouse_pos_x += ev.pmove.x; mouse_pos_y += ev.pmove.y; break; case evPtrButtonPress: if (ev.pbutton.button == GII_PBUTTON_LEFT) mouse_button_left = 1; else if (ev.pbutton.button == GII_PBUTTON_RIGHT) mouse_button_right = 1; else if (ev.pbutton.button == GII_PBUTTON_MIDDLE) mouse_button_middle = 1; break; case evPtrButtonRelease: if (ev.pbutton.button == GII_PBUTTON_LEFT) mouse_button_left = 0; else if (ev.pbutton.button == GII_PBUTTON_RIGHT) mouse_button_right = 0; else if (ev.pbutton.button == GII_PBUTTON_MIDDLE) mouse_button_middle = 0; break; default: printf ("unexpected event %d\n", ev.any.type); } } } } a_keycode get_key (void) { ggi_event ev; /* Block until we get a key. */ ggiEventRead(visu, &ev, emKeyPress | emKeyRepeat); keyboard_modifiers = ev.key.modifiers; return ev.key.sym; } int key_ready (void) { return ggiKbhit (visu); } const char * keys_pref_group (void) { return "ggi"; } int keycode_to_ascii (a_keycode a) { return a; } heroes-0.21/src/media/ggi/keyvalues.c0000644004117000411500000000614007352614755013207 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include "keyvalues.h" const a_keycode key_modifiers[HK_MOD__MAX] = { /* HK_MOD_None */ 0, /* HK_MOD_Shift */ GII_MOD_SHIFT, /* HK_MOD_Ctrl */ GII_MOD_CTRL, /* HK_MOD_Alt */ GII_MOD_ALT, /* HK_MOD_Meta */ GII_MOD_META }; const a_keycode key_codes[HK__MAX] = { /* HK_0 */ GIIUC_0, /* HK_1 */ GIIUC_1, /* HK_2 */ GIIUC_2, /* HK_3 */ GIIUC_3, /* HK_4 */ GIIUC_4, /* HK_5 */ GIIUC_5, /* HK_6 */ GIIUC_6, /* HK_7 */ GIIUC_7, /* HK_8 */ GIIUC_8, /* HK_9 */ GIIUC_9, /* HK_BackSpace */ GIIUC_BackSpace, /* HK_CtrlL */ GIIK_CtrlL, /* HK_CtrlR */ GIIK_CtrlR, /* HK_D */ GIIUC_D, /* HK_d */ GIIUC_d, /* HK_E */ GIIUC_E, /* HK_Delete */ GIIK_Delete, /* HK_Down */ GIIK_Down, /* HK_End */ GIIK_End, /* HK_Enter */ GIIUC_Return, /* HK_Escape */ GIIUC_Escape, /* HK_F */ GIIUC_F, /* HK_f */ GIIUC_f, /* HK_F1 */ GIIK_F1, /* HK_F2 */ GIIK_F2, /* HK_F3 */ GIIK_F3, /* HK_F4 */ GIIK_F4, /* HK_F5 */ GIIK_F5, /* HK_F6 */ GIIK_F6, /* HK_F7 */ GIIK_F7, /* HK_F8 */ GIIK_F8, /* HK_F9 */ GIIK_F9, /* HK_F10 */ GIIK_F10, /* HK_F11 */ GIIK_F11, /* HK_F12 */ GIIK_F12, /* HK_Home */ GIIK_Home, /* HK_i */ GIIUC_i, /* HK_I */ GIIUC_I, /* HK_Left */ GIIK_Left, /* HK_NIL */ GIIK_NIL, /* HK_o */ GIIUC_o, /* HK_O */ GIIUC_O, /* HK_p */ GIIUC_p, /* HK_P */ GIIUC_P, /* HK_PageDown */ GIIK_PageDown, /* HK_PageUp */ GIIK_PageUp, /* HK_Pause */ GIIK_Pause, /* HK_PrintScreen */ GIIK_PrintScreen, /* HK_Right */ GIIK_Right, /* HK_S */ GIIUC_S, /* HK_s */ GIIUC_s, /* HK_ShiftL */ GIIK_ShiftL, /* HK_ShiftR */ GIIK_ShiftR, /* HK_Space */ GIIUC_Space, /* HK_SysRq */ GIIK_SysRq, /* HK_t */ GIIUC_t, /* HK_T */ GIIUC_T, /* HK_Up */ GIIK_Up }; heroes-0.21/src/media/ggi/video.c0000644004117000411500000002431107450420473012274 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include "video_low.h" #include "debugmsg.h" #include "errors.h" /* LibGGI driver for Heroes. Heroes is a 320x200x8bit game so we try to use such a video mode. That's not always possible, so we negotiate the closest video mode available. When the opened video mode is not 8bit depth, another intermediate visual (`render_visu') is opened in memory to hold the 8bit rendered screens; then this visual is CrossBlited to the main visual by LibGGI. Hence, there are two different drawing mode: either direct drawing to the real visual (`visu') if it has a 8bit depth, or drawing to the intermediate visual (`render_visu'). Testing for render_visu == NULL, is enough to know in which mode we are. We use double buffering for `visu' whenever possible. */ ggi_visual_t visu = 0; /* The real display, which receive events. */ static ggi_visual_t render_visu = NULL; /* A 8bit memory-display on which the game is drawn, if visu is not 8bit.*/ static int scr_w, scr_h; /* rendering buffer width and height */ static int scr_pitch; static int scr_stretch; static ggi_mode vid_mode; static char *display_params = NULL; static int full_screen = 0; /* Direct buffer for each frame. We might have db[0] == db[1] if double buffering is not available.*/ static const ggi_directbuffer *db[2] = { NULL, NULL }; static int current_frame = 0; /* used as index to `db' for double buffering */ static bool ggi_initialized = false; /* GGI fails to allocate a 8bit mode for some special X configuration. (Probably when the server supports 8bits depth although it's not the _default_ depth.) A workaround is to not ask GGI for a 8bit mode; this is activated if DONT_REQUEST_8BIT_MODE is TRUE. */ static bool dont_request_8bit_mode = false; void set_display_params (const char* str) { /* Turn on the dont_request_8bit_mode workaround if the user typed `-G not8'. Other GGIs argument may be supplied after a colon as in `-G not8:mumble' */ if (strncmp(str, "not8", 4) == 0 && (str[4] == ':' || str[4] == 0)) { dont_request_8bit_mode = true; if (str[4] == 0) return; str += 5; } XFREE0 (display_params); display_params = xstrdup (str); } void set_full_screen_mode (void) { full_screen = 1; } static bool setup_320x200x8_display (void) { if (dont_request_8bit_mode) { dmsg (D_VIDEO, "skipped 320x200x8/2 mode negociation"); return false; } dmsg (D_VIDEO, "negotiate 320x200x8/2 mode"); vid_mode.frames = 2; vid_mode.visible.x = scr_w; vid_mode.visible.y = scr_h; vid_mode.virt.x = vid_mode.virt.y = GGI_AUTO; vid_mode.dpp.x = vid_mode.dpp.y = GGI_AUTO; vid_mode.graphtype = GT_8BIT; if (ggiCheckMode (visu, &vid_mode) == 0) return ggiSetMode (visu, &vid_mode) == 0; return false; } static bool setup_320x200xB_display (void) { dmsg (D_VIDEO, "negotiate any 320x200xB/2 mode"); vid_mode.frames = 2; vid_mode.visible.x = scr_w; vid_mode.visible.y = scr_h; vid_mode.virt.x = vid_mode.virt.y = GGI_AUTO; vid_mode.dpp.x = vid_mode.dpp.y = GGI_AUTO; vid_mode.graphtype = GGI_AUTO; if (ggiCheckMode (visu, &vid_mode) == 0) return ggiSetMode (visu, &vid_mode) == 0; return false; } static bool setup_WWWxHHHxB_display (void) { dmsg (D_VIDEO, "negotiate any (2-frame) mode"); vid_mode.frames = 2; vid_mode.visible.x = scr_w; vid_mode.visible.y = scr_h; vid_mode.virt.x = vid_mode.virt.y = GGI_AUTO; vid_mode.dpp.x = vid_mode.dpp.y = GGI_AUTO; vid_mode.graphtype = GT_8BIT; if (ggiCheckMode (visu, &vid_mode) == 0) return ggiSetMode (visu, &vid_mode) == 0; return false; } static void get_directbuffers (ggi_visual_t v) { int numbuf; int i; dmsg (D_VIDEO, "ask for direct-buffers"); numbuf = ggiDBGetNumBuffers (v); dmsg (D_VIDEO, "%d direct buffers available", numbuf); for (i = 0; i < numbuf; ++i) { const ggi_directbuffer *d = ggiDBGetBuffer (v, i); if (d == NULL) continue; dmsg (D_VIDEO, "DB#%d: type=%x frame=%d", i, d->type, d->frame); if (!(d->type & GGI_DB_SIMPLE_PLB)) continue; if (db[d->frame] == NULL) db[d->frame] = d; } if (db[0] != NULL && db[1] == NULL) { dmsg (D_VIDEO, "got only the first direct buffer"); db[1] = db[0]; } else if (db[0] == NULL && db[1] != NULL) { dmsg (D_VIDEO, "got only the second direct buffer ???"); db[0] = db[1]; } else if (db[0] == NULL && db[1] == NULL) /* FIXME: ask to send a bug report with a trace */ emsg (_("failed to get any direct buffer for this visual")); } void init_video_low (int stretch, int *pitch) { scr_stretch = stretch; dmsg (D_VIDEO | D_SYSTEM, "initialize GGI"); if (ggiInit ()) { dmsg (D_VIDEO, "failed"); exit (EXIT_FAILURE); } ggi_initialized = true; dmsg (D_VIDEO, "open main visual (%s)", display_params ? display_params : "null"); visu = ggiOpen (display_params); if (!visu) /* TRANS: a `visual' is associated by LibGGI to a display. You can actually call it a `display', this makes no big difference. */ emsg (_("failed to open visual.")); scr_w = 320 * stretch; scr_h = 200 * stretch; if (!(setup_320x200x8_display () || setup_320x200xB_display () || setup_WWWxHHHxB_display ())) emsg (_("cannot setup a correct display.")); /* get info about the mode that was selected */ ggiGetMode (visu, &vid_mode); dmsg (D_VIDEO, "video mode is %dx%dx%d/%d", vid_mode.visible.x, vid_mode.visible.y, GT_DEPTH (vid_mode.graphtype), vid_mode.frames); if (vid_mode.virt.x < 320 || vid_mode.virt.y < 200) emsg (_("negotiated video mode is too small (width=%d, height=%d)"), vid_mode.virt.x, vid_mode.virt.y); if (GT_DEPTH (vid_mode.graphtype) == 8) { /* no intermediate buffer required */ render_visu = NULL; scr_pitch = vid_mode.virt.x; } else { /* open an intermediate rendefing buffer */ dmsg (D_VIDEO, "open display-memory visual"); render_visu = ggiOpen ("display-memory", NULL); if (render_visu == NULL) /* TRANS: `display-memory' is the name of a LibGGI driver and make no sense to translate. */ emsg (_("Failed to open an internal `display-memory' visual.")); if (ggiSetGraphMode (render_visu, scr_w, scr_h, scr_w, scr_h, GT_8BIT)) emsg (_("Failed to set 320x200x8 mode on display-memory")); scr_pitch = scr_w; } *pitch = scr_pitch; get_directbuffers (render_visu != NULL ? render_visu : visu); dmsg (D_VIDEO, "set display flags"); ggiAddFlags (visu, GGIFLAG_ASYNC); if (GT_SCHEME (vid_mode.graphtype) == GT_PALETTE) ggiSetColorfulPalette (visu); if (render_visu != NULL) ggiSetColorfulPalette (render_visu); } void uninit_video_low (void) { dmsg (D_MISC, "uninitialize video"); XFREE0 (display_params); if (render_visu != NULL) { dmsg (D_VIDEO, "close memory visual"); ggiClose (render_visu); render_visu = NULL; } if (visu != NULL) { dmsg (D_VIDEO, "close real visual"); ggiClose (visu); visu = NULL; } if (ggi_initialized) { dmsg (D_VIDEO, "exit GGI"); ggiExit (); ggi_initialized = false; } } void set_pal_entry (unsigned char c, unsigned char r, unsigned char g, unsigned char b) { ggi_color cmap[256]; cmap[c].r = r * 1024; cmap[c].g = g * 1024; cmap[c].b = b * 1024; dmsg (D_VIDEO, "set color %d=(%d,%d,%d)",c,r,g,b); if (GT_SCHEME (vid_mode.graphtype) == GT_PALETTE) ggiSetPalette (visu, c, 1, cmap); if (render_visu != NULL) ggiSetPalette (render_visu, c, 1, cmap); } void set_pal (const unsigned char *ptr, int p, int n) { signed i; ggi_color cmap[256]; for (i = 0; i < 256; ++i) { cmap[i].r = *ptr++ * 1024; cmap[i].g = *ptr++ * 1024; cmap[i].b = *ptr++ * 1024; } dmsg (D_VIDEO, "set %d colors", n/3); if (GT_SCHEME (vid_mode.graphtype) == GT_PALETTE) ggiSetPalette (visu, p / 3, n / 3, cmap); if (render_visu != NULL) ggiSetPalette (render_visu, p / 3, n / 3, cmap); } void vsynchro2_low (const a_pixel *s1, const a_pixel *s2, a_copy_function f) { a_pixel *dest; current_frame ^= 1; if (ggiResourceAcquire (db[current_frame]->resource, GGI_ACTYPE_WRITE)) wmsg (_("failed to acquire direct-buffer")); dest = db[current_frame]->write; if (render_visu == NULL) /* center */ dest += (vid_mode.visible.x - scr_w)/2 + scr_pitch * (vid_mode.visible.y - scr_h)/2; if (s2 == NULL) { f (s1, dest, 320); } else { f (s1, dest, 160); f (s2, dest + 160 * scr_stretch, 160); } if (ggiResourceRelease (db[current_frame]->resource)) wmsg (_("failed to release direct-buffer")); if (render_visu != NULL) { ggiSetWriteFrame(visu, current_frame); ggiCrossBlit (render_visu, 0, 0, scr_w, scr_h, visu, (vid_mode.visible.x - scr_w)/2, (vid_mode.visible.y - scr_h)/2); } ggiSetDisplayFrame (visu, current_frame); ggiFlush (visu); } void vsynchro_low (const a_pixel *s, a_copy_function f) { vsynchro2_low (s, NULL, f); } heroes-0.21/src/media/gii/0000777004117000411500000000000007451377047011120 5heroes-0.21/src/media/gii/joystick.c0000644004117000411500000000743207352614755013045 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "joystick.h" #include "debugmsg.h" #include "errors.h" #include int joystick_x[2] = { 0, 0 }; /* coord. X */ int joystick_y[2] = { 0, 0 }; /* Y */ char joystick_b[2] = { 0, 0 }; /* buttons (on 2bits) */ char joystick_detected = 0; gii_input_t joystick; static void _get_joystick_state (void) { struct timeval t = { 0, 0 }; if (giiEventPoll (joystick, emValAbsolute | emKeyPress | emKeyRelease, &t) != emZero) { int nbr; gii_event ev; nbr = giiEventsQueued (joystick, emValAbsolute | emKeyPress | emKeyRelease); for (; nbr; --nbr) { giiEventRead (joystick, &ev, emValAbsolute | emKeyPress | emKeyRelease); if (ev.any.type == evKeyPress) { dmsg (D_JOYSTICK, "joystick button #%d pressed\n", ev.key.button); switch (ev.key.button) { case 1: joystick_b[0] |= 1; break; case 2: joystick_b[0] |= 2; break; case 3: joystick_b[1] |= 1; break; case 4: joystick_b[1] |= 2; break; } } else if (ev.any.type == evKeyRelease) { dmsg (D_JOYSTICK, "joystick button #%d released\n", ev.key.button); switch (ev.key.button) { case 1: joystick_b[0] &= ~1; break; case 2: joystick_b[0] &= ~2; break; case 3: joystick_b[1] &= ~1; break; case 4: joystick_b[1] &= ~2; break; } } else if (ev.any.type == evValAbsolute) { unsigned int i; for (i = ev.val.first; i < ev.val.first + ev.val.count; ++i) dmsg (D_JOYSTICK, "joystick valuator #%u = %d", i, ev.val.value[i - ev.val.first]); if (0 == ev.val.first) joystick_x[0] = ev.val.value[0]; if (1 >= ev.val.first && 1 <= ev.val.first + ev.val.count) joystick_y[0] = ev.val.value[1 - ev.val.first]; if (2 >= ev.val.first && 2 <= ev.val.first + ev.val.count) joystick_x[1] = ev.val.value[2 - ev.val.first]; if (3 >= ev.val.first && 3 <= ev.val.first + ev.val.count) joystick_y[1] = ev.val.value[3 - ev.val.first]; } else { wmsg (_("unexpected event %d\n"), ev.any.type); } } } } char joyinit (void) { dmsg (D_JOYSTICK, "initialize joystick"); giiInit (); joystick = giiOpen ("linux-joy",NULL); if (!joystick) { wmsg (_("No joystick found (run with `-J' to suppress this message).")); joystick_detected = 0; } else joystick_detected = 1; return (joystick_detected); } /* Update the state of the joysticks */ void get_joystick_state (void) { if (joystick_detected) _get_joystick_state (); } heroes-0.21/src/media/joystick.h0000644004117000411500000000361207352614755012276 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__JOYSTICK__H #define HEROES__JOYSTICK__H extern int joystick_x[2]; extern int joystick_y[2]; extern char joystick_b[2]; extern char joystick_detected; char joyinit (void); void get_joystick_state (void); #define is_joystick_up(j) (joystick_y[j]<-8000) #define is_joystick_down(j) (joystick_y[j]>8000) #define is_joystick_left(j) (joystick_x[j]<-8000) #define is_joystick_right(j) (joystick_x[j]>8000) #define is_joystick_button_a(j) (joystick_b[j]&1) #define is_joystick_button_b(j) (joystick_b[j]&2) #endif /* HEROES__JOYSTICK__H */ heroes-0.21/src/media/keyb.c0000644004117000411500000000436307352614755011370 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "keyb_low.h" #include "argv.h" #include "errors.h" unsigned int keyboard_modifiers; unsigned char keyboard_map[HKEY_MAX + 1]; void init_keyboard_map (void) { int i; for (i = HKEY_MAX; i >= 0; i--) keyboard_map[i] = 0; keyboard_modifiers = 0; } void uninit_keyboard_map (void) { } int mouse_coord_x (void) { update_mouse_state (); return mouse_pos_x / stretch; } int mouse_coord_y (void) { update_mouse_state (); return mouse_pos_y / stretch; } char mouse1 (void) { update_mouse_state (); return mouse_button_left; } char mouse2 (void) { update_mouse_state (); return mouse_button_right; } char mouse3 (void) { update_mouse_state (); return mouse_button_middle; } /* FIXME: this should be renamed */ char mouse12 (void) { update_mouse_state (); return mouse_button_left || mouse_button_right || mouse_button_middle; } heroes-0.21/src/media/keyb.h0000644004117000411500000000400007404747657011367 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__KEYB__H #define HEROES__KEYB__H #define HKEY_MAX 0xffff #define HKEYCODE_MAX U16_MAX extern unsigned char keyboard_map[HKEY_MAX + 1]; extern unsigned int keyboard_modifiers; void init_keyboard_map (void); void uninit_keyboard_map (void); int mouse_coord_x (void); int mouse_coord_y (void); char mouse1 (void); char mouse2 (void); char mouse3 (void); char mouse12 (void); void process_input_events (void); a_keycode get_key (void); int keycode_to_ascii (a_keycode k); int key_ready (void); int init_mouse (void); void mouse_show (void); void mouse_hide (void); const char *keys_pref_group (void); #endif /* HEROES__KEYB__H */ heroes-0.21/src/media/keyb_low.h0000644004117000411500000000323107352614755012247 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__KEYB_LOW__H # define HEROES__KEYB_LOW__H # include "keyb.h" void update_mouse_state (void); extern int mouse_pos_x; extern int mouse_pos_y; extern char mouse_button_left; extern char mouse_button_right; extern char mouse_button_middle; #endif /* HEROES__KEYB_LOW__H */ heroes-0.21/src/media/keysdef.h0000644004117000411500000000303507352614755012070 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__KEYSDEF__H #define HEROES__KEYSDEF__H struct keynames_s { const char* name; a_keycode code; }; extern const struct keynames_s keynames[]; #endif /* HEROES__KEYSDEF__H */ heroes-0.21/src/media/keyvalues.h0000644004117000411500000001130107352614755012441 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__KEYVALUES__H #define HEROES__KEYVALUES__H #include "keyb.h" /* Define keys hard coded into heroes code */ /* modifiers */ enum { HK_MOD_None_, #define HK_MOD_None (key_modifiers[HK_MOD_None_]) HK_MOD_Shift_, #define HK_MOD_Shift (key_modifiers[HK_MOD_Shift_]) HK_MOD_Ctrl_, #define HK_MOD_Ctrl (key_modifiers[HK_MOD_Ctrl_]) HK_MOD_Alt_, #define HK_MOD_Alt (key_modifiers[HK_MOD_Alt_]) HK_MOD_Meta_, #define HK_MOD_Meta (key_modifiers[HK_MOD_Meta_]) /* Not a key. Must come last. */ HK_MOD__MAX }; extern const a_keycode key_modifiers[HK_MOD__MAX]; /* keys */ enum { HK_0_, #define HK_0 (key_codes[HK_0_]) HK_1_, #define HK_1 (key_codes[HK_1_]) HK_2_, #define HK_2 (key_codes[HK_2_]) HK_3_, #define HK_3 (key_codes[HK_3_]) HK_4_, #define HK_4 (key_codes[HK_4_]) HK_5_, #define HK_5 (key_codes[HK_5_]) HK_6_, #define HK_6 (key_codes[HK_6_]) HK_7_, #define HK_7 (key_codes[HK_7_]) HK_8_, #define HK_8 (key_codes[HK_8_]) HK_9_, #define HK_9 (key_codes[HK_9_]) HK_BackSpace_, #define HK_BackSpace (key_codes[HK_BackSpace_]) HK_CtrlL_, #define HK_CtrlL (key_codes[HK_CtrlL_]) HK_CtrlR_, #define HK_CtrlR (key_codes[HK_CtrlR_]) HK_D_, #define HK_D (key_codes[HK_D_]) HK_d_, #define HK_d (key_codes[HK_d_]) HK_E_, #define HK_E (key_codes[HK_E_]) HK_Delete_, #define HK_Delete (key_codes[HK_Delete_]) HK_Down_, #define HK_Down (key_codes[HK_Down_]) HK_End_, #define HK_End (key_codes[HK_End_]) HK_Enter_, #define HK_Enter (key_codes[HK_Enter_]) HK_Escape_, #define HK_Escape (key_codes[HK_Escape_]) HK_F_, #define HK_F (key_codes[HK_F_]) HK_f_, #define HK_f (key_codes[HK_f_]) HK_F1_, #define HK_F1 (key_codes[HK_F1_]) HK_F2_, #define HK_F2 (key_codes[HK_F2_]) HK_F3_, #define HK_F3 (key_codes[HK_F3_]) HK_F4_, #define HK_F4 (key_codes[HK_F4_]) HK_F5_, #define HK_F5 (key_codes[HK_F5_]) HK_F6_, #define HK_F6 (key_codes[HK_F6_]) HK_F7_, #define HK_F7 (key_codes[HK_F7_]) HK_F8_, #define HK_F8 (key_codes[HK_F8_]) HK_F9_, #define HK_F9 (key_codes[HK_F9_]) HK_F10_, #define HK_F10 (key_codes[HK_F10_]) HK_F11_, #define HK_F11 (key_codes[HK_F11_]) HK_F12_, #define HK_F12 (key_codes[HK_F12_]) HK_Home_, #define HK_Home (key_codes[HK_Home_]) HK_i_, #define HK_i (key_codes[HK_i_]) HK_I_, #define HK_I (key_codes[HK_I_]) HK_Left_, #define HK_Left (key_codes[HK_Left_]) HK_NIL_, #define HK_NIL (key_codes[HK_NIL_]) HK_o_, #define HK_o (key_codes[HK_o_]) HK_O_, #define HK_O (key_codes[HK_O_]) HK_p_, #define HK_p (key_codes[HK_p_]) HK_P_, #define HK_P (key_codes[HK_P_]) HK_PageDown_, #define HK_PageDown (key_codes[HK_PageDown_]) HK_PageUp_, #define HK_PageUp (key_codes[HK_PageUp_]) HK_Pause_, #define HK_Pause (key_codes[HK_Pause_]) HK_PrintScreen_, #define HK_PrintScreen (key_codes[HK_PrintScreen_]) HK_Right_, #define HK_Right (key_codes[HK_Right_]) HK_S_, #define HK_S (key_codes[HK_S_]) HK_s_, #define HK_s (key_codes[HK_s_]) HK_ShiftL_, #define HK_ShiftL (key_codes[HK_ShiftL_]) HK_ShiftR_, #define HK_ShiftR (key_codes[HK_ShiftR_]) HK_Space_, #define HK_Space (key_codes[HK_Space_]) HK_SysRq_, #define HK_SysRq (key_codes[HK_SysRq_]) HK_t_, #define HK_t (key_codes[HK_t_]) HK_T_, #define HK_T (key_codes[HK_T_]) HK_Up_, #define HK_Up (key_codes[HK_Up_]) /* Not a key. Must come last. */ HK__MAX }; extern const a_keycode key_codes[HK__MAX]; #endif /* HEROES__KEYVALUES__H */ heroes-0.21/src/media/video.c0000644004117000411500000001406607352614755011545 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "video_low.h" #include "fastmem.h" #include "argv.h" int scr_pitch; /* rendering buffer pitch */ /* slow stretching routines */ static void stretch_twofold (const a_pixel *s, a_pixel *d, unsigned width) { int rows_left, columns_left; for (rows_left = 200; rows_left; --rows_left) { for (columns_left = width / 2; columns_left; --columns_left) { a_pixel t1, t2; t1 = s[0]; t2 = s[1]; d[0] = t1; d[640 + 2] = t2; d[1] = t1; d[640 + 3] = t2; d[640 + 0] = t1; d[2] = t2; d[640 + 1] = t1; d[3] = t2; s += 2; d += 4; } d += 2 * (scr_pitch - width); s += xbuf - width; } } static void stretch_twofold_even (const a_pixel *s, a_pixel *d, unsigned width) { int rows_left, columns_left; for (rows_left = 200; rows_left; --rows_left) { for (columns_left = width; columns_left; --columns_left) { d[1] = d[0] = *s; ++s; d += 2; } d += 2 * (scr_pitch - width); s += xbuf - width; } } static void stretch_threefold (const a_pixel* s, a_pixel *d, unsigned width) { int rows_left, columns_left; for (rows_left = 200; rows_left; --rows_left) { for (columns_left = width / 2; columns_left; --columns_left) { a_pixel t1, t2; t1 = s[0]; t2 = s[1]; d[0] = t1; d[960 + 3] = t2; d[2*960 + 1] = t1; d[4] = t2; d[960 + 2] = t1; d[2*960 + 5] = t2; d[960 + 0] = t1; d[2*960 + 3] = t2; d[1] = t1; d[960 + 4] = t2; d[2*960 + 2] = t1; d[5] = t2; d[2*960 + 0] = t1; d[3] = t2; d[960 + 1] = t1; d[2*960 + 4] = t2; d[2] = t1; d[960 + 5] = t2; s += 2; d += 6; } d += 3 * (scr_pitch - width); s += xbuf - width; } } static void stretch_threefold_even (const a_pixel *s, a_pixel *d, unsigned width) { int rows_left, columns_left; for (rows_left = 200 / 2; rows_left; --rows_left) { for (columns_left = width; columns_left; --columns_left) { a_pixel t1, t2; t1 = s[0]; t2 = s[xbuf]; d[0] = t1; d[0+960*4] = t2; d[1] = t1; d[2] = t1; d[1+960*4] = t2; d[0+960*2] = t1; d[1+960*2] = t1; d[2+960*4] = t2; d[2+960*2] = t1; ++s; d += 3; } d += 3 * (2 * scr_pitch - width); s += 2 * xbuf - width; } } static void stretch_fourfold (const a_pixel *s, a_pixel *d, unsigned width) { int rows_left, columns_left; for (rows_left = 200; rows_left; --rows_left) { a_u32 *d2 = (unsigned int *)d; for (columns_left = width; columns_left; --columns_left) { a_pixel c = *s; a_u32 i = (c << 24) | (c << 16) | (c << 8) | c; d2[0] = i; d2[320] = i; d2[320*2] = i; d2[320*3] = i; ++s; ++d2; } d += 4 * scr_pitch; s += xbuf - width; } } static void stretch_fourfold_even (const a_pixel* s, a_pixel *d, unsigned width) { int rows_left, columns_left; for (rows_left = 200; rows_left; --rows_left) { a_u32 *d2 = (unsigned int *)d; for (columns_left = width; columns_left; --columns_left) { a_pixel c = *s; a_u32 i = (c << 24) | (c << 16) | (c << 8) | c; d2[0] = i; d2[320*2] = i; ++s; ++d2; } d += 4 * scr_pitch; s += xbuf - width; } } static void copy_screen_even (const a_pixel *s, a_pixel *d, unsigned width) { int i; for (i = 200; i; --i, s += xbuf * 2, d += 2 * scr_pitch) fastmem4 (s, d, width / 4); } static void copy_screen (const a_pixel *s, a_pixel *d, unsigned width) { int i; for (i = 200; i; --i, s += xbuf, d += scr_pitch) fastmem4 (s, d, width / 4); } /* Copy the rendered display (s) to the visual (screen_rv). This may require stretching, if the user asked for. */ static void copy_display (const a_pixel *s, a_pixel *d, unsigned width) { /* the result of stretching routines is written directly to the video memory */ if (stretch == 2) { if (even_lines) stretch_twofold_even (s, d, width); else stretch_twofold (s, d, width); } else if (stretch == 3) { if (even_lines) stretch_threefold_even (s, d, width); else stretch_threefold (s, d, width); } else if (stretch == 4) { if (even_lines) stretch_fourfold_even (s, d, width); else stretch_fourfold (s, d, width); } else { /* stretch == 1 */ if (even_lines) copy_screen_even (s, d, width); else copy_screen (s, d, width); } } void init_video (void) { init_video_low (stretch, &scr_pitch); } void uninit_video (void) { uninit_video_low (); } void vsynchro (const a_pixel *s) { vsynchro_low (s, copy_display); } void vsynchro2 (const a_pixel *s1, const a_pixel *s2) { vsynchro2_low (s1, s2, copy_display); } heroes-0.21/src/media/video.h0000644004117000411500000000445707352614755011555 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__VIDEO__H #define HEROES__VIDEO__H /* the three macro below configure the rendering buffers used in the game */ #define xbuf 512 /* large width to suppress any clipping need, power of two of easier multiplications */ #define ybuf 300 /* height */ #define sbuf (50*xbuf) /* keep sbuf empty line on top of the buffers (to avoid clipping) */ typedef a_u8 a_pixel; void set_display_params (const char *str); void set_full_screen_mode (void); void init_video (void); void uninit_video (void); void set_pal_entry (unsigned char c, unsigned char r, unsigned char g, unsigned char b); void set_pal (const unsigned char *ptr, int p, int n); /* dump the supplied buffer (assumed xbuf-wide) to the screen */ void vsynchro (const a_pixel *s); /* likewise, but construct the screen from two buffers (used in two player mode). */ void vsynchro2 (const a_pixel *s1, const a_pixel *s2); #endif /* HEROES__VIDEO__H */ heroes-0.21/src/media/video_low.h0000644004117000411500000000355107352614755012430 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__VIDEO_LOW__H # define HEROES__VIDEO_LOW__H # include "video.h" /* Low-level video functions, only called from the media/video.c. */ typedef void (*a_copy_function)(const a_pixel *source, a_pixel *a_dest, unsigned width); /* Return true on success. */ void init_video_low (int stretch, int *pitch); void uninit_video_low (void); void vsynchro_low (const a_pixel *s, a_copy_function f); void vsynchro2_low (const a_pixel *s1, const a_pixel *s2, a_copy_function f); #endif /* HEROES__VIDEO_LOW__H */ heroes-0.21/src/media/strack.c0000644004117000411500000000524107352614755011721 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "strack.h" #include "prefs.h" #include "argv.h" #include "musicfiles.h" #include "debugmsg.h" #include "errors.h" char *soundtrack_author = 0; char *soundtrack_title = 0; a_sprite *soundtrack_author_sprite = 0; a_sprite *soundtrack_title_sprite = 0; unsigned last_rank = 0; static void load_and_setup_sound_track (a_sound_track* st) { if (st) { load_soundtrack (st->filename); soundtrack_title = st->title; soundtrack_author = st->author; last_rank = st->rank; } else { soundtrack_title = 0; soundtrack_author = 0; } FREE_SPRITE0 (soundtrack_title_sprite); FREE_SPRITE0 (soundtrack_author_sprite); } void load_soundtrack_from_alias (const char* alias) { if (!nosound) { a_sound_track *st = get_sound_track_from_alias (alias); dmsg (D_SOUND_TRACK, "loading sound track from alias %s", alias); load_and_setup_sound_track (st); } } void load_next_soundtrack (void) { if (!nosound) { a_sound_track *st = get_sound_track_from_rank (last_rank + 1); dmsg (D_SOUND_TRACK, "loading next sound track"); load_and_setup_sound_track (st); } } void load_prev_soundtrack (void) { if (!nosound) { a_sound_track *st = get_sound_track_from_rank (last_rank - 1); dmsg (D_SOUND_TRACK, "loading previous sound track"); load_and_setup_sound_track (st); } } heroes-0.21/src/media/strack.h0000644004117000411500000000403107352614755011722 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SOUNDTRACK__H #define HEROES__SOUNDTRACK__H #include "sprite.h" extern char *soundtrack_author; extern char *soundtrack_title; extern a_sprite *soundtrack_author_sprite; extern a_sprite *soundtrack_title_sprite; void adjust_volume (void); void halve_volume (void); int init_sound_engine (void); void uninit_sound_engine (void); void unload_soundtrack (void); void play_soundtrack (void); void print_drivers_list (void); void decode_sound_options (char *option_string, const char *argv0); void load_soundtrack (char *filename); void load_soundtrack_from_alias (const char *alias); void load_next_soundtrack (void); void load_prev_soundtrack (void); #endif /* HEROES__SOUNDTRACK__H */ heroes-0.21/src/media/sfx.c0000644004117000411500000001432207352614755011232 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "sfx.h" #include "errors.h" #include "prefs.h" #include "misc.h" #include "argv.h" #include "rsc_files.h" #include "debugmsg.h" #define max_events 151 typedef char* a_filename; static a_filename *sfx_names; static char *sfx_loaded; static int *play_handles; static int event_handle[max_events]; static int max_sfx = 0; static void **sfx_handles; static void remove_comments (char *str) { int i; for (i = 0; (str[i] != ';') && (str[i] != 0) && (str[i] != 13) && (str[i] != 10); i++); i--; for (; str[i] == ' '; i--); str[i + 1] = 0; } static char * forward_spaces (char *tmp) { while (*tmp == ' ') tmp++; return (tmp); } char read_sfx_conf (void) { FILE *fconf; char tmp[256]; char *tmpptr = (char *) tmp; char *tmpptr2; char c; int nbr; char *sfxdir; if (nosfx) return 0; sfxdir = get_rsc_file ("sfx-dir"); if (sfxdir == 0) { nosfx = 1; free (sfxdir); return 0; } { char* conf = get_rsc_file ("sfx-conf-txt"); if (conf == 0) { nosfx = 1; return 0; } dmsg (D_SOUND_EFFECT|D_FILE, "reading sound effects config: %s", conf); if ((*conf == 0) || (fconf = fopen (conf, "rt")) == NULL) { if (*conf != 0) dperror ("fopen"); wmsg (_("Cannot open %s, disabling sound-effects\n" "(run with -X to supress this message)."), conf); nosfx = 1; free (conf); return 0; } free (conf); } while (fgets (tmpptr, 256, fconf) != NULL) { c = toupper (tmp[0]); remove_comments (tmpptr); if (c == 'M') { if (sfx_names != NULL) return (-1); tmpptr = forward_spaces (tmpptr + 1); max_sfx = atol (tmpptr); XCALLOC_ARRAY (sfx_names, max_sfx); XCALLOC_ARRAY (sfx_loaded, max_sfx); XCALLOC_ARRAY (sfx_handles, max_sfx); XCALLOC_ARRAY (play_handles, max_sfx); } else if (c == 'F') { tmpptr = forward_spaces (tmpptr + 1); tmpptr2 = strchr (tmpptr, ' '); *tmpptr2++ = 0; nbr = atol (tmpptr); tmpptr2 = forward_spaces (tmpptr2); if (nbr < max_sfx) sfx_names[nbr] = strcat_alloc (sfxdir, tmpptr2); } else if (c == 'E') { tmpptr = forward_spaces (tmpptr + 1); tmpptr2 = strchr (tmpptr, ' '); *tmpptr2++ = 0; nbr = atol (tmpptr); tmpptr2 = forward_spaces (tmpptr2); if (nbr < max_events) event_handle[nbr] = atol (tmpptr2); } tmpptr = tmp; } fclose (fconf); free (sfxdir); return 0; } void close_sfx_handle (void) { int i; if (nosfx) return; free (play_handles); free (sfx_handles); free (sfx_loaded); for (i = 0; i < max_sfx; ++i) XFREE (sfx_names[i]); free (sfx_names); } #define mark_sfx(n) { \ assert (event_handle[( n )] < max_sfx); \ sfx_loaded[event_handle[( n )]] = 1; \ } static void std_sfx_set (void) { int i; mark_sfx (1); for (i = 20; i < 36; i++) mark_sfx (i); for (i = 37; i < 70; i++) mark_sfx (i); for (i = 85; i < 90; i++) mark_sfx (i); for (i = 120; i < 130; i++) mark_sfx (i); for (i = 140; i < 150; i++) mark_sfx (i); } void free_all_sfx (void) { int i; if (nosfx) return; dmsg (D_SOUND_EFFECT, "freeing all sound effects"); for (i = 1; i < max_sfx; i++) if (sfx_loaded[i]) { free_sfx_low (sfx_handles[i]); sfx_loaded[i] = 0; } } void load_sfx_mode (signed char mode) { int i; if (nosfx) return; dmsg (D_SOUND_EFFECT,"switching to sound effect mode %d", mode); free_all_sfx (); /* tagging sfx to load */ switch (mode) { /* menus */ case -1: for (i = 1; i < 20; i++) mark_sfx (i); for (i = 70; i < 80; i++) mark_sfx (i); for (i = 110; i < 120; i++) mark_sfx (i); for (i = 130; i < 140; i++) mark_sfx (i); break; /*quest */ case 0: std_sfx_set (); break; /*death */ case 1: std_sfx_set (); break; /*kilem */ case 2: for (i = 90; i < 100; i++) mark_sfx (i); std_sfx_set (); break; /*tca$h */ case 3: mark_sfx (36); mark_sfx (80); mark_sfx (81); std_sfx_set (); break; /*color */ case 4: for (i = 100; i < 106; i++) mark_sfx (i); std_sfx_set (); break; default: assert (0 /* unknown sfx-mode */ ); break; } /* loading tagged sfx */ for (i = 1; i < max_sfx; i++) if (sfx_loaded[i]) { dmsg (D_FILE|D_SOUND_EFFECT,"loading sound effect: %s", sfx_names[i]); if (!(sfx_handles[i] = load_sfx_low (sfx_names[i]))) { emsg (_("Unable to load sample %s"), sfx_names[i]); } } } void event_sfx (int event) { if (nosfx) return; dmsg (D_SOUND_EFFECT, "sound effect event %d", event); assert (event < max_events); assert (event_handle[event] < max_sfx); if (event_handle[event] != 0) { assert (sfx_loaded[event_handle[event]]); if (opt.sfx) play_sfx_low (sfx_handles[event_handle[event]]); } } heroes-0.21/src/media/sfx.h0000644004117000411500000000326307352614755011241 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SOUNDEFFECT__H #define HEROES__SOUNDEFFECT__H char read_sfx_conf (void); void close_sfx_handle (void); void load_sfx_mode (signed char mode); void free_all_sfx (void); void event_sfx (int event); void *load_sfx_low (char *file); void free_sfx_low (void *sfx); void play_sfx_low (void *sfx); #endif /* HEROES__SOUNDEFFECT__H */ heroes-0.21/src/media/mikmod/0000777004117000411500000000000007451377050011622 5heroes-0.21/src/media/mikmod/strack.c0000644004117000411500000001614307404237315013173 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include #include #include "strack.h" #include "prefs.h" #include "argv.h" #include "musicfiles.h" #include "debugmsg.h" #include "errors.h" #include "cast.h" static char sound_initialized = 0; static char sound_track_loaded = 0; static char sound_track_playing = 0; static MODULE *module = 0; static pthread_t polling_thread; static pthread_mutex_t playing; /* this mutex is used to tell the polling thread that it must continue polling ... */ static int nth_driver = 0; static char *driver_options = 0; void adjust_volume (void) { if (opt.music) md_musicvolume = (13 - opt.music_volume) * 128 / 13; else md_musicvolume = 0; dmsg (D_SOUND_TRACK, "set volume to %d/128", md_musicvolume); /* This doesn't want to work. I'm changing the volume of each sample as a work around, see event_sfX() in sfx.c. if (opt.sfx) md_sndfxvolume = (13 - opt.sfx_volume) * 128 / 13; else md_sndfxvolume = 0; */ } void halve_volume (void) { md_musicvolume /= 2; md_sndfxvolume /= 2; dmsg (D_SOUND_TRACK|D_SOUND_EFFECT,"halve volume"); } int init_sound_engine (void) { if (nosound) { nosfx = 1; return 0; } dmsg (D_SYSTEM | D_SOUND_TRACK, "initialize libMikMod"); /* register all the drivers */ MikMod_RegisterAllDrivers (); dmsg (D_SOUND_TRACK, "libMikMod driver registered"); /* register the all module loader (the user can use something else than .xm) */ MikMod_RegisterAllLoaders (); dmsg (D_SOUND_TRACK, "libMikMod loader registered"); /* initialize the library */ md_device = nth_driver; md_mode |= DMODE_SOFT_MUSIC | DMODE_SOFT_SNDFX; if (mono) md_mode &= ~DMODE_STEREO; if (bits8) md_mode &= ~DMODE_16BITS; if (hqmix) md_mode |= DMODE_HQMIXER; dmsg (D_SOUND_TRACK, "Opening audio device #%d, with %dbits, %s%s", nth_driver, (md_mode & DMODE_16BITS)?16:8, (md_mode & DMODE_STEREO)?"stereo":"mono", (md_mode & DMODE_HQMIXER)?"":", high quality mixer"); if (driver_options) dmsg (D_SOUND_TRACK, "MikMod user options: %s", driver_options); if (MikMod_Init (driver_options ? driver_options : const_cast_string (""))) { wmsg (_("Could not initialize sound, reason: %s\n" "Disabling sound output (use -S to suppress this message)."), MikMod_strerror (MikMod_errno)); nosfx = nosound = 1; MikMod_Exit (); return 0; } dmsg (D_SOUND_TRACK,"initialize MikMod thread"); if (MikMod_InitThreads () != 1) { wmsg (_("Could not initialize sound, reason: " "LibMikMod is not thread safe.\n" "Disabling sound output (use -S to suppress this message).")); nosfx = nosound = 1; MikMod_Exit (); return 0; } sound_initialized = 1; pthread_mutex_init (&playing, 0); adjust_volume (); return 0; } void uninit_sound_engine (void) { if (sound_initialized) { unload_soundtrack (); MikMod_Exit (); dmsg (D_SOUND_TRACK, "libMikMod exited"); sound_initialized = 0; } } void load_soundtrack (char *ptr) { if (nosound) return; dmsg (D_FILE|D_SOUND_TRACK,"loading sound track: %s", ptr); module = Player_Load (ptr, 16, 0); if (!module) { wmsg (_("Could not load %s, reason: %s"), ptr, MikMod_strerror (MikMod_errno)); } else { sound_track_loaded = 1; } } void unload_soundtrack (void) { if (nosound) return; if (sound_track_playing) { dmsg (D_SOUND_TRACK, "joining playing thread"); pthread_mutex_unlock (&playing); pthread_join (polling_thread, 0); Player_Stop (); sound_track_playing = 0; } if (sound_track_loaded) { dmsg (D_SOUND_TRACK, "unloading sound track"); Player_Free (module); module = 0; soundtrack_title = 0; soundtrack_author = 0; FREE_SPRITE0 (soundtrack_title_sprite); FREE_SPRITE0 (soundtrack_author_sprite); sound_track_loaded = 0; } } static void * update_thread (void *arg ATTRIBUTE_UNUSED) { while (pthread_mutex_trylock (&playing) == EBUSY) { MikMod_Update (); usleep (10000); } pthread_mutex_unlock (&playing); return 0; } void play_soundtrack (void) { if (nosound) return; if (!sound_track_loaded) return; dmsg (D_SOUND_TRACK, "launching sound track playing thread"); pthread_mutex_lock (&playing); MikMod_SetNumVoices (-1, 6); /* MikMod_EnableOutput (); */ Player_Start (module); pthread_create (&polling_thread, 0, update_thread, 0); sound_track_playing = 1; } void print_drivers_list (void) { char* info; long engineversion = MikMod_GetVersion(); MikMod_RegisterAllDrivers (); printf (_("LibMikMod version %ld.%ld.%ld\n"), (engineversion >> 16) & 255,(engineversion >> 8) & 255, engineversion & 255); info = MikMod_InfoDriver(); printf(_("\nAvailable drivers:\n%s\n"), info); free (info); } /* This function is adapted from from Mikmod 3.1.6 */ static void get_int (char *arg, int *value, int min, int max, const char* argv0) { char *end = NULL; int t = min - 1; if (arg) t = strtol (arg, &end, 10); if (end && (!*end) && (t >= min) && (t <= max)) *value = t; else wmsg (_("Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information."), arg?arg:"(not given)", min, max, argv0); } void decode_sound_options (char* option_string, const char* argv0) { /* This is adapted from Mikmod 3.1.6 */ if (strlen (option_string) > 2) { char* opts = strchr (option_string, ','); if (opts) { *opts=0; /* numeric driver specification ? */ if (opts - option_string <= 2) get_int (optarg, &nth_driver, 0, 99, argv0); else nth_driver = MikMod_DriverFromAlias(option_string); if (driver_options) free (driver_options); driver_options = xstrdup (opts+1); } else nth_driver = MikMod_DriverFromAlias (option_string); } else get_int(option_string, &nth_driver, 0, 99, argv0); } heroes-0.21/src/media/mikmod/sfx.c0000644004117000411500000000350707352614755012515 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include "sfx.h" #include "prefs.h" void * load_sfx_low (char *file) { struct SAMPLE *tmp; tmp = Sample_Load (file); if (tmp) tmp->panning = (PAN_RIGHT + PAN_LEFT) / 2; return tmp; } void free_sfx_low (void *sfx) { Sample_Free (sfx); } void play_sfx_low (void *sfx) { struct SAMPLE *tmp = sfx; /* set the sample volume */ tmp->volume = (13 - opt.sfx_volume) * 64 / 13; Sample_Play (tmp, 0, 0); } heroes-0.21/src/media/sdl/0000777004117000411500000000000007451377050011124 5heroes-0.21/src/media/sdl/joystick.c0000644004117000411500000000703207352614755013053 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "joystick.h" #include "debugmsg.h" #include "errors.h" #include int joystick_x[2] = { 0, 0 }; /* coord. X */ int joystick_y[2] = { 0, 0 }; /* Y */ char joystick_b[2] = { 0, 0 }; /* buttons (on 2bits) */ char joystick_detected = 0; SDL_Joystick* joystick[2] = { 0, 0 }; int joystick0_butnbr = 0; /* The number of button of the FIRST joystick */ extern void init_SDL (void); char joyinit (void) { int nbr; init_SDL (); dmsg (D_JOYSTICK, "initialize joystick"); nbr = SDL_NumJoysticks (); if (nbr <= 0) { wmsg (_("No joystick found (run with `-J' to suppress this message).")); return joystick_detected = 0; } dmsg (D_JOYSTICK, "%d joystick found", nbr); joystick[0] = SDL_JoystickOpen (0); if (nbr >= 2) joystick[1] = SDL_JoystickOpen(1); SDL_JoystickEventState (SDL_IGNORE); joystick0_butnbr = SDL_JoystickNumButtons (joystick[0]); return joystick_detected = (joystick[0] != 0); } void get_joystick_state (void) { SDL_JoystickUpdate(); if (joystick[0]) { joystick_b[0] = (joystick_b[0] & ~1) | (SDL_JoystickGetButton (joystick[0], 0) & 1); joystick_b[0] = (joystick_b[0] & ~2) | ((SDL_JoystickGetButton (joystick[0], 1) & 1) << 1); joystick_x[0] = SDL_JoystickGetAxis(joystick[0], 0); joystick_y[0] = SDL_JoystickGetAxis(joystick[0], 1); if (!joystick[1] && joystick0_butnbr >= 4) { joystick_b[1] = (joystick_b[1] & ~1) | (SDL_JoystickGetButton (joystick[0], 2) & 1); joystick_b[1] = (joystick_b[1] & ~2) | ((SDL_JoystickGetButton (joystick[0], 3) & 1) << 1); } } if (joystick[1]) { joystick_b[1] = (joystick_b[1] & ~1) | (SDL_JoystickGetButton (joystick[1], 0) & 1); joystick_b[1] = (joystick_b[1] & ~2) | ((SDL_JoystickGetButton (joystick[1], 1) & 1) << 1); joystick_x[1] = SDL_JoystickGetAxis(joystick[1], 0); joystick_y[1] = SDL_JoystickGetAxis(joystick[1], 1); } if (joystick[0]) dmsg (D_JOYSTICK, "joystick #1 state: x=%d y=%d b=%d", joystick_x[0], joystick_y[0], joystick_b[0]); if (joystick[1]) dmsg (D_JOYSTICK, "joystick #2 state: x=%d y=%d b=%d", joystick_x[1], joystick_y[1], joystick_b[1]); } heroes-0.21/src/media/sdl/keyb.c0000644004117000411500000001162507404747660012151 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include #include "keyb_low.h" #include "errors.h" static int enable_mouse = 0; int mouse_pos_x = 0; int mouse_pos_y = 0; char mouse_button_left = 0; char mouse_button_right = 0; char mouse_button_middle = 0; /* These macros are defined in SDL 1.1.x but not in 1.0.x */ #ifndef SDL_BUTTON_LEFT #define SDL_BUTTON_LEFT 1 #endif #ifndef SDL_BUTTON_MIDDLE #define SDL_BUTTON_MIDDLE 2 #endif #ifndef SDL_BUTTON_RIGHT #define SDL_BUTTON_RIGHT 3 #endif int init_mouse (void) { return 0; } void mouse_show (void) { enable_mouse = 1; SDL_EventState (SDL_MOUSEMOTION, SDL_ENABLE); SDL_EventState (SDL_MOUSEBUTTONUP, SDL_ENABLE); SDL_EventState (SDL_MOUSEBUTTONDOWN, SDL_ENABLE); SDL_ShowCursor (1); } void mouse_hide (void) { SDL_ShowCursor (0); SDL_EventState (SDL_MOUSEMOTION, SDL_IGNORE); SDL_EventState (SDL_MOUSEBUTTONUP, SDL_IGNORE); SDL_EventState (SDL_MOUSEBUTTONDOWN, SDL_IGNORE); enable_mouse = 0; } static int handle_mouse_events (const SDL_Event *ev) { if (ev->type == SDL_MOUSEMOTION) { mouse_pos_x = ev->motion.x; mouse_pos_y = ev->motion.y; return 1; } else if (ev->type == SDL_MOUSEBUTTONUP) { if (ev->button.button == SDL_BUTTON_LEFT) mouse_button_left = 0; else if (ev->button.button == SDL_BUTTON_RIGHT) mouse_button_right = 0; else if (ev->button.button == SDL_BUTTON_MIDDLE) mouse_button_middle = 0; return 1; } else if (ev->type == SDL_MOUSEBUTTONDOWN) { if (ev->button.button == SDL_BUTTON_LEFT) mouse_button_left = 1; else if (ev->button.button == SDL_BUTTON_RIGHT) mouse_button_right = 1; else if (ev->button.button == SDL_BUTTON_MIDDLE) mouse_button_middle = 1; return 1; } return 0; } void update_mouse_state (void) { SDL_Event ev; SDL_PumpEvents (); while (SDL_PeepEvents (&ev, 1, SDL_GETEVENT, SDL_MOUSEMOTIONMASK| SDL_MOUSEBUTTONDOWNMASK| SDL_MOUSEBUTTONUPMASK)) { handle_mouse_events (&ev); } } void process_input_events (void) { SDL_Event ev; while (SDL_PollEvent (&ev)) { if (ev.type == SDL_KEYDOWN) { assert (ev.key.keysym.sym <= HKEY_MAX); keyboard_map[ev.key.keysym.sym] = 1; } else if (ev.type == SDL_KEYUP) { assert (ev.key.keysym.sym <= HKEY_MAX); keyboard_map[ev.key.keysym.sym] = 0; } else if (handle_mouse_events (&ev)) { /* Nothing to do, handle_mouse_events already did everything. */ } else if (ev.type == SDL_QUIT) { exit_heroes (0); } else { /* printf ("unexpected event %d\n", ev.type); */ } } keyboard_modifiers = SDL_GetModState (); } a_keycode get_key (void) { SDL_Event e; int first_time = 1; do { if (!first_time) { SDL_Delay (10); } else { first_time = 0; } SDL_PumpEvents (); /* remove all events until we get a KEYDOWN event */ while (SDL_PeepEvents (&e, 1, SDL_GETEVENT, ~SDL_KEYDOWNMASK)) { /* we might need to handle mouse and quit events */ if (enable_mouse) handle_mouse_events (&e); if (e.type == SDL_QUIT) exit_heroes (0); } } while (!SDL_PeepEvents (&e, 1, SDL_GETEVENT, SDL_KEYDOWNMASK)); keyboard_modifiers = SDL_GetModState (); return e.key.keysym.sym; } int key_ready (void) { SDL_PumpEvents (); return SDL_PeepEvents (0, 1, SDL_GETEVENT, SDL_KEYDOWNMASK|SDL_QUITMASK); /* return true if there is a pending SDL_QUIT event: the next call to get_key will process it */ } const char * keys_pref_group (void) { return "sdl"; } int keycode_to_ascii (a_keycode a) { return a; } heroes-0.21/src/media/sdl/keyvalues.c0000644004117000411500000000600507352614755013223 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include "keyvalues.h" const a_keycode key_modifiers[HK_MOD__MAX] = { /* HK_MOD_None */ 0, /* HK_MOD_Shift */ KMOD_SHIFT, /* HK_MOD_Ctrl */ KMOD_CTRL, /* HK_MOD_Alt */ KMOD_ALT, /* HK_MOD_Meta */ KMOD_META }; const a_keycode key_codes[HK__MAX] = { /* HK_0 */ SDLK_0, /* HK_1 */ SDLK_1, /* HK_2 */ SDLK_2, /* HK_3 */ SDLK_3, /* HK_4 */ SDLK_4, /* HK_5 */ SDLK_5, /* HK_6 */ SDLK_6, /* HK_7 */ SDLK_7, /* HK_8 */ SDLK_8, /* HK_9 */ SDLK_9, /* HK_BackSpace */ SDLK_BACKSPACE, /* HK_CtrlL */ SDLK_LCTRL, /* HK_CtrlR */ SDLK_RCTRL, /* HK_D */ 'D', /* HK_d */ 'd', /* HK_E */ 'E', /* HK_Delete */ SDLK_DELETE, /* HK_Down */ SDLK_DOWN, /* HK_End */ SDLK_END, /* HK_Enter */ SDLK_RETURN, /* HK_Escape */ SDLK_ESCAPE, /* HK_F */ 'F', /* HK_f */ 'f', /* HK_F1 */ SDLK_F1, /* HK_F2 */ SDLK_F2, /* HK_F3 */ SDLK_F3, /* HK_F4 */ SDLK_F4, /* HK_F5 */ SDLK_F5, /* HK_F6 */ SDLK_F6, /* HK_F7 */ SDLK_F7, /* HK_F8 */ SDLK_F8, /* HK_F9 */ SDLK_F9, /* HK_F10 */ SDLK_F10, /* HK_F11 */ SDLK_F11, /* HK_F12 */ SDLK_F12, /* HK_Home */ SDLK_HOME, /* HK_i */ 'i', /* HK_I */ 'I', /* HK_Left */ SDLK_LEFT, /* HK_NIL */ SDLK_UNKNOWN, /* HK_o */ 'o', /* HK_O */ 'O', /* HK_p */ 'p', /* HK_P */ 'P', /* HK_PageDown */ SDLK_PAGEDOWN, /* HK_PageUp */ SDLK_PAGEUP, /* HK_Pause */ SDLK_PAUSE, /* HK_PrintScreen */ SDLK_PRINT, /* HK_Right */ SDLK_RIGHT, /* HK_S */ 'S', /* HK_s */ 's', /* HK_ShiftL */ SDLK_LSHIFT, /* HK_ShiftR */ SDLK_RSHIFT, /* HK_Space */ SDLK_SPACE, /* HK_SysRq */ SDLK_SYSREQ, /* HK_t */ 't', /* HK_T */ 'T', /* HK_Up */ SDLK_UP }; heroes-0.21/src/media/sdl/video.c0000644004117000411500000001352607421626444012322 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001, 2002 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include "video_low.h" #include "debugmsg.h" #include "errors.h" #include "misc.h" #include "argv.h" #include "cast.h" static a_pixel *screen_rv = 0; /* A pointer to the screen buffer associated to the render visual. */ static int scr_w, scr_h; /* rendering buffer width and height */ static int scr_stretch; /* screen_rv may be a direct pointer to the hardware video buffer, or it may be a pointer to system (mallocated) memory, this depends on the display driver (if the videomode were available or needed to be emulated etc.). If screen_rv points directly to hardware video it might requires locking. */ static SDL_Surface *visu = 0; static int visu_options = SDL_HWPALETTE | SDL_DOUBLEBUF; static bool SDL_initialized = false; #define SDL_VIDEODRIVER "SDL_VIDEODRIVER" static char *sdl_videodriver = 0; void set_display_params (const char *str) { sdl_videodriver = strcat_alloc (SDL_VIDEODRIVER "=", str); dmsg (D_SYSTEM | D_VIDEO, "put `%s' in environment", sdl_videodriver); putenv (sdl_videodriver); } void set_full_screen_mode (void) { visu_options |= SDL_FULLSCREEN; } /* Fullscreen mode is toggeled by pressing Alt+Enter. Thanks to Sam Lantinga */ static int Handle_AltEnter (const SDL_Event *event) { if (event->type == SDL_KEYDOWN && event->key.keysym.sym == SDLK_RETURN && event->key.keysym.mod & KMOD_ALT) { SDL_WM_ToggleFullScreen (SDL_GetVideoSurface ()); return 0; } return 1; } /* init the SDL library, this can be called from joystick.c or from init_video() */ void init_SDL (void); void init_SDL (void) { if (SDL_initialized) return; dmsg (D_SYSTEM | D_VIDEO | D_JOYSTICK | D_SOUND_TRACK | D_SOUND_EFFECT, "initialize SDL"); SDL_Init (SDL_INIT_VIDEO #ifdef HAVE_LIBSDL_MIXER | ((nosfx && nosound) ? 0 : SDL_INIT_AUDIO) #endif #ifdef HAVE_SDL_JOYSTICKOPEN | (joyoff ? 0 : SDL_INIT_JOYSTICK) #endif #ifdef DEBUG | SDL_INIT_NOPARACHUTE #endif ); SDL_SetEventFilter(Handle_AltEnter); SDL_initialized = true; } void init_video_low (int stretch_, int *pitch) { scr_stretch = stretch_; scr_w = 320 * scr_stretch; scr_h = 200 * scr_stretch; init_SDL (); dmsg (D_VIDEO, "set video mode"); visu = SDL_SetVideoMode (scr_w, scr_h, 8, visu_options); /* FIXME: the Linux/m68k binary is crashing in the vicinity */ if (!visu) emsg (_("Failed to open visual: %s"), SDL_GetError()); if (SDL_MUSTLOCK (visu)) dmsg (D_VIDEO, "visual require locking"); else screen_rv = visu->pixels; *pitch = visu->pitch; dmsg (D_VIDEO, "set misc. video parameters"); SDL_ShowCursor (0); SDL_WM_SetCaption ("Heroes " VERSION,"Heroes"); /* setup event processing rules. FIXME: this does not really belong to display.c it should rather go to keyb.c */ SDL_EventState ((Uint8) SDL_ALLEVENTS, SDL_IGNORE); SDL_EventState (SDL_KEYDOWN, SDL_ENABLE); SDL_EventState (SDL_KEYUP, SDL_ENABLE); SDL_EventState (SDL_QUIT, SDL_ENABLE); #ifdef HAVE_SDL_ENABLEKEYREPEAT SDL_EnableKeyRepeat (SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); #endif } void uninit_video_low (void) { dmsg (D_MISC, "free screen buffer"); if (SDL_initialized) { SDL_Quit (); SDL_initialized = false; } if (sdl_videodriver) { putenv (const_cast_string (SDL_VIDEODRIVER)); XFREE0 (sdl_videodriver); } } void set_pal_entry (unsigned char c, unsigned char r, unsigned char g, unsigned char b) { SDL_Color col; col.r = r * 4; col.g = g * 4; col.b = b * 4; dmsg (D_VIDEO, "set color %d=(%d,%d,%d)", c, r, g, b); SDL_SetColors (visu, &col, c, 1); } void set_pal (const unsigned char *ptr, int p, int n) { signed i; SDL_Color cmap[256]; for (i = 0; i < 256; ++i) { cmap[i].r = *ptr++ * 4; cmap[i].g = *ptr++ * 4; cmap[i].b = *ptr++ * 4; } dmsg (D_VIDEO, "set %d colors", n/3); SDL_SetColors (visu, cmap, p/3, n/3); } void vsynchro_low (const a_pixel *s, a_copy_function f) { if (SDL_MUSTLOCK (visu)) SDL_LockSurface (visu); screen_rv = visu->pixels; f (s, screen_rv, 320); if (SDL_MUSTLOCK (visu)) SDL_UnlockSurface (visu); SDL_Flip (visu); /* can change visu->pixels */ } void vsynchro2_low (const a_pixel *s1, const a_pixel *s2, a_copy_function f) { if (SDL_MUSTLOCK (visu)) SDL_LockSurface (visu); screen_rv = visu->pixels; f (s1, screen_rv, 160); f (s2, screen_rv + 160 * scr_stretch, 160); if (SDL_MUSTLOCK (visu)) SDL_UnlockSurface (visu); SDL_Flip (visu); /* can change visu->pixels */ } heroes-0.21/src/media/sdl_mixer/0000777004117000411500000000000007451377050012330 5heroes-0.21/src/media/sdl_mixer/strack.c0000644004117000411500000001272007352614755013707 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include #include "strack.h" #include "prefs.h" #include "argv.h" #include "musicfiles.h" #include "debugmsg.h" #include "errors.h" static char sound_initialized = 0; static char sound_track_loaded = 0; static char sound_track_playing = 0; static Mix_Music *module = NULL; static int audio_rate = 0; static Uint16 audio_format; static int audio_channels; static int audio_buffers = 0; void adjust_volume (void) { if (opt.music) { Mix_VolumeMusic ((13 - opt.music_volume) * MIX_MAX_VOLUME / 13); dmsg (D_SOUND_TRACK, "set volume to %d/%d", (13 - opt.music_volume) * MIX_MAX_VOLUME / 13, MIX_MAX_VOLUME); } else { Mix_VolumeMusic (0); dmsg (D_SOUND_TRACK, "set volume to 0/%d", MIX_MAX_VOLUME); } } void halve_volume (void) { if (opt.music) { Mix_VolumeMusic ((13 - opt.music_volume) * MIX_MAX_VOLUME / 13 / 2); dmsg (D_SOUND_TRACK, "set volume to %d/%d", (13 - opt.music_volume) * MIX_MAX_VOLUME / 13 / 2, MIX_MAX_VOLUME); } else { Mix_VolumeMusic (0); dmsg (D_SOUND_TRACK, "set volume to 0/%d", MIX_MAX_VOLUME); } } extern void init_SDL (void); int init_sound_engine (void) { if (nosound) { nosfx = 1; return 0; } if (!audio_rate) audio_rate = (hqmix ? 44100 : 22050); audio_format = (bits8 ? AUDIO_S8 : AUDIO_S16); audio_channels = (mono ? 1 : 2); if (!audio_buffers) /* Use small values for audio buffer to reduce the duration between the moment where a sample is mixed and the moment where it is heard. */ audio_buffers = (hqmix ? 2048 : 1024); init_SDL (); /* Open the audio device */ dmsg (D_SOUND_TRACK, "opening audio at %d Hz %d bit %s, %d bytes audio buffer", audio_rate, (audio_format&0xFF), (audio_channels > 1) ? "stereo" : "mono", audio_buffers); if (Mix_OpenAudio (audio_rate, audio_format, audio_channels, audio_buffers) < 0) { wmsg (_("Couldn't open audio: %s\n" "Disabling sound output (use -S to suppress this message)."), SDL_GetError()); nosfx = nosound = 1; } else { Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); dmsg (D_SOUND_TRACK, "opened audio at %d Hz %d bit %s, %d bytes audio buffer", audio_rate, (audio_format&0xFF), (audio_channels > 1) ? "stereo" : "mono", audio_buffers); sound_initialized = 1; } adjust_volume (); return 0; } void uninit_sound_engine (void) { if (sound_initialized) { unload_soundtrack (); Mix_CloseAudio (); dmsg (D_SOUND_TRACK, "closed audio"); } } void load_soundtrack (char *ptr) { if (nosound) return; dmsg (D_SOUND_TRACK|D_FILE,"loading sound-track: %s", ptr); module = Mix_LoadMUS(ptr); if (!module) { wmsg (_("Could not load %s, reason: %s"), ptr, SDL_GetError ()); } else sound_track_loaded = 1; } void unload_soundtrack (void) { if (nosound) return; if (sound_track_playing) { dmsg (D_SOUND_TRACK, "halt sound track playing"); Mix_HaltMusic (); sound_track_playing = 0; } if (sound_track_loaded) { dmsg (D_SOUND_TRACK, "unload sound track"); Mix_FreeMusic (module); module = NULL; sound_track_loaded = 0; } } void play_soundtrack (void) { if (nosound) return; if (sound_track_loaded) { dmsg (D_SOUND_TRACK, "start playing sound track"); Mix_PlayMusic (module, -1); sound_track_playing = 1; } } void print_drivers_list (void) { wmsg (_("Heroes has been compiled with SDL_mixer," " there is no driver list available.")); } void decode_sound_options (char *arg, const char *argv0) { if (arg) { char *buf = xstrdup (arg); optarg = strtok (buf, " \t:=,;"); while (optarg) { if (!strcasecmp (optarg, "freq")) { optarg = strtok (0, " \t:=,;"); if (optarg) audio_rate = atol (optarg); else wmsg (_("%s: missing parameter for 'freq'"), argv0); } else if (!strcasecmp (optarg, "buffers")) { optarg = strtok (0, " \t:=,;"); if (optarg) audio_buffers = atol (optarg); else wmsg (_("%s: missing parameter for `buffers'"), argv0); } else wmsg (_("%s: recognized sound options " "are freq=nnn and buffers=nnn"), argv0); optarg = strtok (0, " \t:=,;"); } free (buf); } } heroes-0.21/src/media/sdl_mixer/sfx.c0000644004117000411500000000337507352614755013226 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include #include "sfx.h" #include "prefs.h" void * load_sfx_low (char *file) { return Mix_LoadWAV (file); } void free_sfx_low (void *sfx) { Mix_FreeChunk (sfx); } void play_sfx_low (void *sfx) { Mix_Chunk *tmp = sfx; /* set the sample volume */ tmp->volume = (13 - opt.sfx_volume) * MIX_MAX_VOLUME / 13; Mix_PlayChannel (-1, tmp, 0); } heroes-0.21/src/media/Makefile.inc0000644004117000411500000001430607405224034012462 ## -*- Makefile -*- ## Copyright 2001 Alexandre Duret-Lutz ## ## This file is part of Heroes. ## ## Heroes is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License version 2 as published by ## the Free Software Foundation. ## ## Heroes 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 ## ## These libraries are tagged as `EXTRA' because we don't want to build ## all of them everytime. Only a subset of them (determined at ## configure time) will be built. Practically, the requested libraries ## are simply listed in heroes_DEPENDENCIES. EXTRA_DIST += \ media/README EXTRA_LIBRARIES += \ media/libhmcommon.a \ media/libhggivkm.a \ media/libhgiij.a \ media/libhmiks.a \ media/libhsdlvkm.a \ media/libhsdlj.a \ media/libhsdls.a \ media/libhallvkm.a \ media/libhallj.a \ media/libhdumvkm.a \ media/libhdumj.a \ media/libhdums.a media_libhmcommon_a_SOURCES = \ media/joystick.h \ media/keyb.c \ media/keyb.h \ media/keyb_low.h \ media/keysdef.h \ media/keyvalues.h \ media/video.c \ media/video.h \ media/video_low.h \ media/strack.c \ media/strack.h \ media/sfx.c \ media/sfx.h media_libhggivkm_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(GGI_CFLAGS) media_libhggivkm_a_SOURCES = \ media/ggi/keyb.c \ media/ggi/keyvalues.c \ media/ggi/video.c nodist_media_libhggivkm_a_SOURCES = \ media/ggi/keysdef.c media_libhgiij_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(GGI_CFLAGS) $(GII_CFLAGS) media_libhgiij_a_SOURCES = \ media/gii/joystick.c media_libhmiks_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(LIBMIKMOD_CFLAGS) media_libhmiks_a_SOURCES = \ media/mikmod/strack.c \ media/mikmod/sfx.c media_libhsdlvkm_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(SDL_CFLAGS) media_libhsdlvkm_a_SOURCES = \ media/sdl/keyb.c \ media/sdl/keyvalues.c \ media/sdl/video.c nodist_media_libhsdlvkm_a_SOURCES = \ media/sdl/keysdef.c media_libhsdlj_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(SDL_CFLAGS) media_libhsdlj_a_SOURCES = \ media/sdl/joystick.c media_libhsdls_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(SDL_CFLAGS) $(SDL_MIXER_CFLAGS) media_libhsdls_a_SOURCES = \ media/sdl_mixer/strack.c \ media/sdl_mixer/sfx.c # Don't use $(MORE_WARNINGS_CFLAGS) with Allegro. There are too many # warnings in the Allegro header files! media_libhallvkm_a_CFLAGS = \ $(WARNINGS_CFLAGS) $(ALLEGRO_CFLAGS) media_libhallvkm_a_SOURCES = \ media/allegro/keyb.c \ media/allegro/keyvalues.c \ media/allegro/video.c nodist_media_libhallvkm_a_SOURCES = \ media/allegro/keysdef.c # Don't use $(MORE_WARNINGS_CFLAGS) with Allegro. There are too many # warnings in the Allegro header files! media_libhallj_a_CFLAGS = \ $(WARNINGS_CFLAGS) $(ALLEGRO_CFLAGS) media_libhallj_a_SOURCES = \ media/allegro/joystick.c media_libhdumvkm_a_SOURCES = \ media/dummy/keyb.c \ media/dummy/keysdef.c \ media/dummy/keyvalues.c \ media/dummy/video.c media_libhdumj_a_SOURCES = \ media/dummy/joystick.c media_libhdums_a_SOURCES = \ media/dummy/strack.c \ media/dummy/sfx.c DISTCLEANFILES += \ media/allegro/keysdef.c \ media/ggi/keysdef.c \ media/sdl/keysdef.c media/ggi/keysdef.c: media/ggi/.dirstamp if test "x$(GGI_KEYBOARD_H)" = x; then \ ## If $(GGI_KEYBOARD_H) is empty we are not building Heroes for SDL. ## This file is probably built as a dependency of or rule like TAGS. touch $@ ; \ else \ ## There is one reason the put the input file first. There needs ## to be somthing after in case $(GGI_KEYBOARD_H) is empty, otherwise ## shells might complain about a syntax error. Yep, that's tricky. < $(GGI_KEYBOARD_H) $(AWK) ' \ BEGIN { print "/* Do not edit!\n" \ " This file was generated by src/Makefile\n" \ " from @GGI_KEYBOARD_H@ */\n" \ "#include \"system.h\"\n" \ "#include \n" \ "#include \"keysdef.h\"\n" \ "const struct keynames_s keynames[] = {" } \ $$2 ~ /(GIIK_|GIIUC_)/ { \ print "\t{ \""toupper(substr($$2,index($$2,"_")+1))"\",", $$2,"}," } \ END { print "\t{ 0, 0 }};\n" }' > $@ ; \ fi media/sdl/keysdef.c: media/sdl/.dirstamp if test "x$(SDL_KEYSYM_H)" = x; then \ ## If $(SDL_KEYSYM_H) is empty we are not building Heroes for SDL. ## This file is probably built as a dependency of or rule like TAGS. touch $@ ; \ else \ ## There is one reason the put the input file first. There needs ## to be somthing after in case $(SDL_KEYSYM_H) is empty, otherwise ## shells might complain about a syntax error. Yep, that's tricky. < $(SDL_KEYSYM_H) $(AWK) ' \ BEGIN { print "/* Do not edit!\n" \ " This file was generated by src/Makefile\n" \ " from @SDL_KEYSYM_H@ */\n" \ "#include \"system.h\"\n" \ "#include \n" \ "#include \"keysdef.h\"\n" \ "const struct keynames_s keynames[] = {" } \ $$1 ~ /SDLK_/ { \ print "\t{ \""toupper(substr($$1,index($$1,"_")+1))"\",", $$1,"}," } \ END { print "\t{ 0, 0 }};\n" }' > $@ ; \ fi media/allegro/keysdef.c: media/allegro/.dirstamp if test "x$(ALLEGRO_H)" = x; then \ ## If $(ALLEGRO_H) is empty we are not building Heroes for Allegro ## This file is probably built as a dependency of or rule like TAGS. touch $@ ; \ else \ ## There is one reason the put the input file first. There needs ## to be somthing after in case $(ALLOGRO_H) is empty, otherwise ## shells might complain about a syntax error. Yep, that's tricky. < $(ALLEGRO_H) $(AWK) ' \ BEGIN { print "/* Do not edit!\n" \ " This file was generated by src/Makefile\n" \ " from @ALLEGRO_H@ */\n" \ "#include \"system.h\"\n" \ "#include \n" \ "#include \"keysdef.h\"\n" \ "const struct keynames_s keynames[] = {" } \ $$2 ~ /KEY_/ { \ print "\t{ \""toupper(substr($$2,index($$2,"_")+1))"\",", $$2,"}," } \ END { print "\t{ 0, 0 }};\n" }' > $@ ; \ fi heroes-0.21/src/media/README0000644004117000411500000000415307351554632011143 This directory hold some code to interface with the various supported third party libraries related to media (GGI, SDL, MikMod, etc.) Media have been separated into 3 groups: - VKM : Video/Keyboard/Mouse interface - J : Joystick interface - S : Sound interface Each supported library can belong to one or more of these groups. Each library is represented by a directory which contains the interfaces implementation for the supported groups of media. Each driver is built as a static library named libhXXXY.a where XXX are the three first letters of the library interfaced with (e.g. 'mik' for MikMod), and Y is the name of the media group ('vkm', 'j', or 's'). For instance libhsdlj.a is Heroes' interface to the SDL joystick functions. Which driver will be built is decided by ./configure after probing for available libraries. See m4/h-media.m4. The setup is comparable to Autoconf's `LIBOBJ' idiom, except we are selecting libraries to be built instead of object files. One extra directory, 'dummy/', contains a fake driver for each group of media. Since Heroes obviously needs a driver for each of these groups, the 'dummy' drivers will be used in case no other one is available. Code common to all drivers in a group is placed directly is the media/ direvtory (i.e. not any subdirectory) and built as a single library for all groups: libhmcommon.a. This setup (building all interfaces as many static libraries) offers some advantages over the previous one (conditional compilation in the relevant part of the game). First, it makes adding support for new libraries is easier and cleaner. But it also has a quite nice property: because every dependence over third party library is isolated in static libraries, you don't need to recompile the whole game after a reconfiguration; typically: % ./configure --with-sdl % make # build everything if it's the first time % ./configure --with-ggi % make # build only a couple of media libraries (the GGI interfaces) and relink heroes. This can be quite useful when building several configurations of Heroes. heroes-0.21/src/sys/0000777004117000411500000000000007451377055010106 5heroes-0.21/src/sys/allegro/0000777004117000411500000000000007451377050011526 5heroes-0.21/src/sys/allegro/main.c0000644004117000411500000000266407352614755012550 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "main.h" #include int main (int argc, char *argv[]) { return heroes_main (argc, argv); } END_OF_MAIN () heroes-0.21/src/sys/std/0000777004117000411500000000000007451377050010673 5heroes-0.21/src/sys/std/main.c0000644004117000411500000000261707352614755011713 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "main.h" int main (int argc, char *argv[]) { return heroes_main (argc, argv); } heroes-0.21/src/sys/Makefile.inc0000644004117000411500000000322007404747625012231 ## -*- Makefile -*- ## Copyright 2001 Alexandre Duret-Lutz ## ## This file is part of Heroes. ## ## Heroes is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License version 2 as published by ## the Free Software Foundation. ## ## Heroes 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 ## ## These libraries are tagged as `EXTRA' because we don't want to build ## all of them everytime. Only a subset of them (determined at ## configure time) will be built. Practically, the requested libraries ## are simply listed in heroes_DEPENDENCIES. EXTRA_LIBRARIES += \ sys/libhstdm.a \ sys/libhsdlm.a \ sys/libhallm.a EXTRA_DIST += \ sys/README \ sys/main.h sys_libhstdm_a_SOURCES = \ sys/std/main.c ## Use sys/std/main.c too. Only the CFLAGS differs (they will ## usually include something like -Dmain=SDL_main). sys_libhsdlm_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(SDL_CFLAGS) sys_libhsdlm_a_SOURCES = \ sys/std/main.c # Don't use $(MORE_WARNINGS_CFLAGS) with Allegro. There are too many # warnings in the Allegro header files! sys_libhallm_a_CFLAGS = \ $(WARNINGS_CFLAGS) $(ALLEGRO_CFLAGS) sys_libhallm_a_SOURCES = \ sys/allegro/main.c heroes-0.21/src/sys/README0000644004117000411500000000075107351554632010702 This directory is much like ../media in the sense that it contains drivers for various third party libraries, but is system-oriented rather than media-oriented (e.g. if support for different kind of thread libraries was needed, this would belong to this directory). Make sure you read the comments in ../media/README, because this directory is organized similary. The ony group of system-facility handled here for now is - M : main (some libraries need special `main()' arrangements) heroes-0.21/src/sys/main.h0000644004117000411500000000265407352614755011127 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__MAIN__H #define HEROES__MAIN__H int heroes_main (int argc, char *argv[]); #endif /* HEROES__MAIN__H */ heroes-0.21/src/Makefile.am0000644004117000411500000001141007421651500011220 # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 # # The following definitions are not generated automatically by # Automake because these variable are created by generic m4 macros. # When automake is changed to use autoconf --trace, it will # declare them automatically. GGI_CFLAGS = @GGI_CFLAGS@ GII_CFLAGS = @GII_CFLAGS@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_MIXER_CFLAGS = @SDL_MIXER_CFLAGS@ ALLEGRO_CFLAGS = @ALLEGRO_CFLAGS@ # --- AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = heroes heroeslvl INCLUDES = -I$(top_srcdir)/lib -I../lib -I../intl -I$(srcdir)/lvl -I$(srcdir)/media -I$(srcdir)/sys -I.. -I. EXTRA_DIST = rsc_files.gperf debughash.gperf AM_CFLAGS = $(MORE_WARNINGS_CFLAGS) heroeslvl_LDADD = lvl/libhlvl.a ../lib/libheroes.a $(INTLLIBS) heroeslvl_SOURCES = heroeslvl.c heroes_LDADD = lvl/libhlvl.a media/libhmcommon.a ../lib/libheroes.a \ $(INTLLIBS) $(LIBALT_LOCAL_XLDADD) $(LIBALT_XLDADD) heroes_LDFLAGS = $(LIBALT_XLDFLAGS) ## Depend upon Makefile because the value of LIBALT_LOCAL_LDADD might ## change from one instantiation to the other (in which case heroes ## needs to be re-linked). heroes_DEPENDENCIES = lvl/libhlvl.a media/libhmcommon.a ../lib/libheroes.a \ $(LIBALT_LOCAL_XLDADD) Makefile heroes_SOURCES = \ argv.c \ argv.h \ bonus.c \ bonus.h \ bytesex.h \ camera.c \ camera.h \ const.c \ const.h \ debugchn.def \ debugchn.h \ debugchn.tpl \ debughash.c \ debughash.h \ debugmsg.c \ debugmsg.h \ endscroll.c \ endscroll.h \ errors.c \ errors.h \ explosions.c \ explosions.h \ extras.c \ extras.h \ fader.c \ fader.h \ fastmem.h \ font.h \ fontdata.c \ fontdata.h \ gameid.c \ gameid.h \ generic_list.h \ hedlite.c \ hedlite.h \ helptext.c \ helptext.h \ hendian.c \ hendian.h \ heroes.c \ heroes.h \ intro.c \ intro.h \ items.c \ items.h \ levellst.c \ levellst.h \ locales.c \ locales.h \ menus.c \ menus.h \ misc.c \ misc.h \ musicfiles.c \ musicfiles.h \ parafmt.c \ parafmt.h \ pcx.c \ pcx.h \ pendulum.c \ pendulum.h \ people.c \ people.def \ people.h \ people.tpl \ persona.c \ persona.h \ pixelize.c \ pixelize.h \ prefs.c \ prefs.def \ prefs.h \ prefs.tpl \ readmake.c \ readmake.h \ relocate.c \ relocate.h \ render.c \ render.h \ renderdata.c \ renderdata.h \ rsc_files.c \ rsc_files.h \ rsc_files_hash.c \ rsc_files_hash.h \ savegame.c \ savegame.h \ scores.c \ scores.h \ scrtools.c \ scrtools.h \ sprglauto.c \ sprglauto.h \ sprglenz.c \ sprglenz.h \ sprite.c \ sprite.h \ spropaque.c \ spropaque.h \ sprprog.c \ sprprog.h \ sprprogwav.c \ sprprogwav.h \ sprrle.c \ sprrle.h \ sprshade.c \ sprshade.h \ sprtext.c \ sprtext.h \ sprunish.c \ sprunish.h \ sprzcol.c \ sprzcol.h \ structs.h \ system.h \ timer.c \ timer.h \ userconf.c \ userconf.h \ userdir.c \ userdir.h \ vars.h \ vars.c \ visuals.c \ visuals.h BUILT_SOURCES = \ debugchn.h \ debughash.gperf \ prefs.c \ prefs.h \ rsc_files_hash.c if HAVE_GPERF rsc_files_hash.c: rsc_files.gperf gperf -t -L ANSI-C -G -N in_rsc_set -W rsc_set \ -k 1,3,7,$$ $(srcdir)/rsc_files.gperf | \ sed -e 's/{""}/{"",0,0,0,false}/g' > rsc_files_hash.c debughash.c: debughash.gperf gperf -t -L ANSI-C -G -N in_channel_set -W channel_set \ -k 1,3,$$ $(srcdir)/debughash.gperf | \ sed -e 's/{""}/{"",0,0}/g' > debughash.c endif debughash.gperf: debugchn.def debugchn.tpl $(AUTOGEN) -o 'gperf=debughash.gperf' debugchn.def debugchn.h: debugchn.def debugchn.tpl $(AUTOGEN) -o h debugchn.def prefs.h: prefs.def prefs.tpl $(AUTOGEN) -o h prefs.def prefs.c: prefs.def prefs.tpl $(AUTOGEN) -o c prefs.def people.c: people.def people.tpl $(AUTOGEN) -o c people.def MAINTAINERCLEANFILES = \ debugchn.h \ debughash.c \ debughash.gperf \ people.c \ prefs.c \ prefs.h \ rsc_files_hash.c DISTCLEANFILES = EXTRA_LIBRARIES = CLEANFILES = $(EXTRA_LIBRARIES) EXTRA_PROGRAMS = parafmt-check parafmt_check_SOURCES = parafmt.c parafmt_check_CFLAGS = $(MORE_WARNINGS_CFLAGS) -DTEST parafmt_check_LDADD = ../lib/libheroes.a EXTRA_DIST += etc/Makefile.inc include etc/Makefile.inc EXTRA_DIST += lvl/Makefile.inc include lvl/Makefile.inc EXTRA_DIST += media/Makefile.inc include media/Makefile.inc EXTRA_DIST += sys/Makefile.inc include sys/Makefile.inc heroes-0.21/src/Makefile.in0000644004117000411500000027765507451373567011303 # Makefile.in generated by automake 1.6 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 # SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ ALLEGRO_H = @ALLEGRO_H@ AMTAR = @AMTAR@ AUTOGEN = @AUTOGEN@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ DATADIRNAME = @DATADIRNAME@ DEPDIR = @DEPDIR@ GENCAT = @GENCAT@ GGI_KEYBOARD_H = @GGI_KEYBOARD_H@ GLIBC21 = @GLIBC21@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GPERF = @GPERF@ HELP2MAN = @HELP2MAN@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LIBALT_LOCAL_XLDADD = @LIBALT_LOCAL_XLDADD@ LIBALT_XLDADD = @LIBALT_XLDADD@ LIBALT_XLDFLAGS = @LIBALT_XLDFLAGS@ LIBICONV = @LIBICONV@ LN_S = @LN_S@ MKINSTALLDIRS = @MKINSTALLDIRS@ MORE_WARNINGS_CFLAGS = @MORE_WARNINGS_CFLAGS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL_KEYSYM_H = @SDL_KEYSYM_H@ STRIP = @STRIP@ U = @U@ UNZIP = @UNZIP@ UP = @UP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ ZIP = @ZIP@ am__include = @am__include@ am__quote = @am__quote@ htmldir = @htmldir@ install_sh = @install_sh@ # The following definitions are not generated automatically by # Automake because these variable are created by generic m4 macros. # When automake is changed to use autoconf --trace, it will # declare them automatically. GGI_CFLAGS = @GGI_CFLAGS@ GII_CFLAGS = @GII_CFLAGS@ LIBMIKMOD_CFLAGS = @LIBMIKMOD_CFLAGS@ SDL_CFLAGS = @SDL_CFLAGS@ SDL_MIXER_CFLAGS = @SDL_MIXER_CFLAGS@ ALLEGRO_CFLAGS = @ALLEGRO_CFLAGS@ # --- AUTOMAKE_OPTIONS = subdir-objects bin_PROGRAMS = heroes heroeslvl INCLUDES = -I$(top_srcdir)/lib -I../lib -I../intl -I$(srcdir)/lvl -I$(srcdir)/media -I$(srcdir)/sys -I.. -I. EXTRA_DIST = rsc_files.gperf debughash.gperf etc/Makefile.inc $(heroesrc_DATA) lvl/Makefile.inc \ lvl/README\ media/Makefile.inc \ media/README\ sys/Makefile.inc \ sys/README \ sys/main.h AM_CFLAGS = $(MORE_WARNINGS_CFLAGS) heroeslvl_LDADD = lvl/libhlvl.a ../lib/libheroes.a $(INTLLIBS) heroeslvl_SOURCES = heroeslvl.c heroes_LDADD = lvl/libhlvl.a media/libhmcommon.a ../lib/libheroes.a \ $(INTLLIBS) $(LIBALT_LOCAL_XLDADD) $(LIBALT_XLDADD) heroes_LDFLAGS = $(LIBALT_XLDFLAGS) heroes_DEPENDENCIES = lvl/libhlvl.a media/libhmcommon.a ../lib/libheroes.a \ $(LIBALT_LOCAL_XLDADD) Makefile heroes_SOURCES = \ argv.c \ argv.h \ bonus.c \ bonus.h \ bytesex.h \ camera.c \ camera.h \ const.c \ const.h \ debugchn.def \ debugchn.h \ debugchn.tpl \ debughash.c \ debughash.h \ debugmsg.c \ debugmsg.h \ endscroll.c \ endscroll.h \ errors.c \ errors.h \ explosions.c \ explosions.h \ extras.c \ extras.h \ fader.c \ fader.h \ fastmem.h \ font.h \ fontdata.c \ fontdata.h \ gameid.c \ gameid.h \ generic_list.h \ hedlite.c \ hedlite.h \ helptext.c \ helptext.h \ hendian.c \ hendian.h \ heroes.c \ heroes.h \ intro.c \ intro.h \ items.c \ items.h \ levellst.c \ levellst.h \ locales.c \ locales.h \ menus.c \ menus.h \ misc.c \ misc.h \ musicfiles.c \ musicfiles.h \ parafmt.c \ parafmt.h \ pcx.c \ pcx.h \ pendulum.c \ pendulum.h \ people.c \ people.def \ people.h \ people.tpl \ persona.c \ persona.h \ pixelize.c \ pixelize.h \ prefs.c \ prefs.def \ prefs.h \ prefs.tpl \ readmake.c \ readmake.h \ relocate.c \ relocate.h \ render.c \ render.h \ renderdata.c \ renderdata.h \ rsc_files.c \ rsc_files.h \ rsc_files_hash.c \ rsc_files_hash.h \ savegame.c \ savegame.h \ scores.c \ scores.h \ scrtools.c \ scrtools.h \ sprglauto.c \ sprglauto.h \ sprglenz.c \ sprglenz.h \ sprite.c \ sprite.h \ spropaque.c \ spropaque.h \ sprprog.c \ sprprog.h \ sprprogwav.c \ sprprogwav.h \ sprrle.c \ sprrle.h \ sprshade.c \ sprshade.h \ sprtext.c \ sprtext.h \ sprunish.c \ sprunish.h \ sprzcol.c \ sprzcol.h \ structs.h \ system.h \ timer.c \ timer.h \ userconf.c \ userconf.h \ userdir.c \ userdir.h \ vars.h \ vars.c \ visuals.c \ visuals.h BUILT_SOURCES = \ debugchn.h \ debughash.gperf \ prefs.c \ prefs.h \ rsc_files_hash.c MAINTAINERCLEANFILES = \ debugchn.h \ debughash.c \ debughash.gperf \ people.c \ prefs.c \ prefs.h \ rsc_files_hash.c DISTCLEANFILES = \ media/allegro/keysdef.c \ media/ggi/keysdef.c \ media/sdl/keysdef.c EXTRA_LIBRARIES = \ media/libhmcommon.a \ media/libhggivkm.a \ media/libhgiij.a \ media/libhmiks.a \ media/libhsdlvkm.a \ media/libhsdlj.a \ media/libhsdls.a \ media/libhallvkm.a \ media/libhallj.a \ media/libhdumvkm.a \ media/libhdumj.a \ media/libhdums.a\ \ sys/libhstdm.a \ sys/libhsdlm.a \ sys/libhallm.a CLEANFILES = $(EXTRA_LIBRARIES) EXTRA_PROGRAMS = parafmt-check parafmt_check_SOURCES = parafmt.c parafmt_check_CFLAGS = $(MORE_WARNINGS_CFLAGS) -DTEST parafmt_check_LDADD = ../lib/libheroes.a heroesrcdir = $(pkgdatadir)/etc heroesrc_DATA = etc/heroesrc noinst_LIBRARIES = lvl/libhlvl.a lvl_libhlvl_a_SOURCES = \ lvl/access.h \ lvl/de_body.c \ lvl/de_head.c \ lvl/en_body.c \ lvl/en_head.c \ lvl/format.h \ lvl/free.c \ lvl/in_body.c \ lvl/load.c \ lvl/lvl.h \ lvl/lvl_priv.h \ lvl/privacc.c \ lvl/save.c media_libhmcommon_a_SOURCES = \ media/joystick.h \ media/keyb.c \ media/keyb.h \ media/keyb_low.h \ media/keysdef.h \ media/keyvalues.h \ media/video.c \ media/video.h \ media/video_low.h \ media/strack.c \ media/strack.h \ media/sfx.c \ media/sfx.h media_libhggivkm_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(GGI_CFLAGS) media_libhggivkm_a_SOURCES = \ media/ggi/keyb.c \ media/ggi/keyvalues.c \ media/ggi/video.c nodist_media_libhggivkm_a_SOURCES = \ media/ggi/keysdef.c media_libhgiij_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(GGI_CFLAGS) $(GII_CFLAGS) media_libhgiij_a_SOURCES = \ media/gii/joystick.c media_libhmiks_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(LIBMIKMOD_CFLAGS) media_libhmiks_a_SOURCES = \ media/mikmod/strack.c \ media/mikmod/sfx.c media_libhsdlvkm_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(SDL_CFLAGS) media_libhsdlvkm_a_SOURCES = \ media/sdl/keyb.c \ media/sdl/keyvalues.c \ media/sdl/video.c nodist_media_libhsdlvkm_a_SOURCES = \ media/sdl/keysdef.c media_libhsdlj_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(SDL_CFLAGS) media_libhsdlj_a_SOURCES = \ media/sdl/joystick.c media_libhsdls_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(SDL_CFLAGS) $(SDL_MIXER_CFLAGS) media_libhsdls_a_SOURCES = \ media/sdl_mixer/strack.c \ media/sdl_mixer/sfx.c # Don't use $(MORE_WARNINGS_CFLAGS) with Allegro. There are too many # warnings in the Allegro header files! media_libhallvkm_a_CFLAGS = \ $(WARNINGS_CFLAGS) $(ALLEGRO_CFLAGS) media_libhallvkm_a_SOURCES = \ media/allegro/keyb.c \ media/allegro/keyvalues.c \ media/allegro/video.c nodist_media_libhallvkm_a_SOURCES = \ media/allegro/keysdef.c # Don't use $(MORE_WARNINGS_CFLAGS) with Allegro. There are too many # warnings in the Allegro header files! media_libhallj_a_CFLAGS = \ $(WARNINGS_CFLAGS) $(ALLEGRO_CFLAGS) media_libhallj_a_SOURCES = \ media/allegro/joystick.c media_libhdumvkm_a_SOURCES = \ media/dummy/keyb.c \ media/dummy/keysdef.c \ media/dummy/keyvalues.c \ media/dummy/video.c media_libhdumj_a_SOURCES = \ media/dummy/joystick.c media_libhdums_a_SOURCES = \ media/dummy/strack.c \ media/dummy/sfx.c sys_libhstdm_a_SOURCES = \ sys/std/main.c sys_libhsdlm_a_CFLAGS = \ $(MORE_WARNINGS_CFLAGS) $(SDL_CFLAGS) sys_libhsdlm_a_SOURCES = \ sys/std/main.c # Don't use $(MORE_WARNINGS_CFLAGS) with Allegro. There are too many # warnings in the Allegro header files! sys_libhallm_a_CFLAGS = \ $(WARNINGS_CFLAGS) $(ALLEGRO_CFLAGS) sys_libhallm_a_SOURCES = \ sys/allegro/main.c subdir = src mkinstalldirs = $(SHELL) $(top_srcdir)/tools/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) lvl_libhlvl_a_AR = $(AR) cru lvl_libhlvl_a_LIBADD = am_lvl_libhlvl_a_OBJECTS = lvl/de_body.$(OBJEXT) lvl/de_head.$(OBJEXT) \ lvl/en_body.$(OBJEXT) lvl/en_head.$(OBJEXT) lvl/free.$(OBJEXT) \ lvl/in_body.$(OBJEXT) lvl/load.$(OBJEXT) lvl/privacc.$(OBJEXT) \ lvl/save.$(OBJEXT) lvl_libhlvl_a_OBJECTS = $(am_lvl_libhlvl_a_OBJECTS) media_libhallj_a_AR = $(AR) cru media_libhallj_a_LIBADD = am_media_libhallj_a_OBJECTS = \ media/allegro/media_libhallj_a-joystick.$(OBJEXT) media_libhallj_a_OBJECTS = $(am_media_libhallj_a_OBJECTS) media_libhallvkm_a_AR = $(AR) cru media_libhallvkm_a_LIBADD = am_media_libhallvkm_a_OBJECTS = \ media/allegro/media_libhallvkm_a-keyb.$(OBJEXT) \ media/allegro/media_libhallvkm_a-keyvalues.$(OBJEXT) \ media/allegro/media_libhallvkm_a-video.$(OBJEXT) nodist_media_libhallvkm_a_OBJECTS = \ media/allegro/media_libhallvkm_a-keysdef.$(OBJEXT) media_libhallvkm_a_OBJECTS = $(am_media_libhallvkm_a_OBJECTS) \ $(nodist_media_libhallvkm_a_OBJECTS) media_libhdumj_a_AR = $(AR) cru media_libhdumj_a_LIBADD = am_media_libhdumj_a_OBJECTS = media/dummy/joystick.$(OBJEXT) media_libhdumj_a_OBJECTS = $(am_media_libhdumj_a_OBJECTS) media_libhdums_a_AR = $(AR) cru media_libhdums_a_LIBADD = am_media_libhdums_a_OBJECTS = media/dummy/strack.$(OBJEXT) \ media/dummy/sfx.$(OBJEXT) media_libhdums_a_OBJECTS = $(am_media_libhdums_a_OBJECTS) media_libhdumvkm_a_AR = $(AR) cru media_libhdumvkm_a_LIBADD = am_media_libhdumvkm_a_OBJECTS = media/dummy/keyb.$(OBJEXT) \ media/dummy/keysdef.$(OBJEXT) media/dummy/keyvalues.$(OBJEXT) \ media/dummy/video.$(OBJEXT) media_libhdumvkm_a_OBJECTS = $(am_media_libhdumvkm_a_OBJECTS) media_libhggivkm_a_AR = $(AR) cru media_libhggivkm_a_LIBADD = am_media_libhggivkm_a_OBJECTS = \ media/ggi/media_libhggivkm_a-keyb.$(OBJEXT) \ media/ggi/media_libhggivkm_a-keyvalues.$(OBJEXT) \ media/ggi/media_libhggivkm_a-video.$(OBJEXT) nodist_media_libhggivkm_a_OBJECTS = \ media/ggi/media_libhggivkm_a-keysdef.$(OBJEXT) media_libhggivkm_a_OBJECTS = $(am_media_libhggivkm_a_OBJECTS) \ $(nodist_media_libhggivkm_a_OBJECTS) media_libhgiij_a_AR = $(AR) cru media_libhgiij_a_LIBADD = am_media_libhgiij_a_OBJECTS = \ media/gii/media_libhgiij_a-joystick.$(OBJEXT) media_libhgiij_a_OBJECTS = $(am_media_libhgiij_a_OBJECTS) media_libhmcommon_a_AR = $(AR) cru media_libhmcommon_a_LIBADD = am_media_libhmcommon_a_OBJECTS = media/keyb.$(OBJEXT) \ media/video.$(OBJEXT) media/strack.$(OBJEXT) \ media/sfx.$(OBJEXT) media_libhmcommon_a_OBJECTS = $(am_media_libhmcommon_a_OBJECTS) media_libhmiks_a_AR = $(AR) cru media_libhmiks_a_LIBADD = am_media_libhmiks_a_OBJECTS = \ media/mikmod/media_libhmiks_a-strack.$(OBJEXT) \ media/mikmod/media_libhmiks_a-sfx.$(OBJEXT) media_libhmiks_a_OBJECTS = $(am_media_libhmiks_a_OBJECTS) media_libhsdlj_a_AR = $(AR) cru media_libhsdlj_a_LIBADD = am_media_libhsdlj_a_OBJECTS = \ media/sdl/media_libhsdlj_a-joystick.$(OBJEXT) media_libhsdlj_a_OBJECTS = $(am_media_libhsdlj_a_OBJECTS) media_libhsdls_a_AR = $(AR) cru media_libhsdls_a_LIBADD = am_media_libhsdls_a_OBJECTS = \ media/sdl_mixer/media_libhsdls_a-strack.$(OBJEXT) \ media/sdl_mixer/media_libhsdls_a-sfx.$(OBJEXT) media_libhsdls_a_OBJECTS = $(am_media_libhsdls_a_OBJECTS) media_libhsdlvkm_a_AR = $(AR) cru media_libhsdlvkm_a_LIBADD = am_media_libhsdlvkm_a_OBJECTS = \ media/sdl/media_libhsdlvkm_a-keyb.$(OBJEXT) \ media/sdl/media_libhsdlvkm_a-keyvalues.$(OBJEXT) \ media/sdl/media_libhsdlvkm_a-video.$(OBJEXT) nodist_media_libhsdlvkm_a_OBJECTS = \ media/sdl/media_libhsdlvkm_a-keysdef.$(OBJEXT) media_libhsdlvkm_a_OBJECTS = $(am_media_libhsdlvkm_a_OBJECTS) \ $(nodist_media_libhsdlvkm_a_OBJECTS) sys_libhallm_a_AR = $(AR) cru sys_libhallm_a_LIBADD = am_sys_libhallm_a_OBJECTS = sys/allegro/sys_libhallm_a-main.$(OBJEXT) sys_libhallm_a_OBJECTS = $(am_sys_libhallm_a_OBJECTS) sys_libhsdlm_a_AR = $(AR) cru sys_libhsdlm_a_LIBADD = am_sys_libhsdlm_a_OBJECTS = sys/std/sys_libhsdlm_a-main.$(OBJEXT) sys_libhsdlm_a_OBJECTS = $(am_sys_libhsdlm_a_OBJECTS) sys_libhstdm_a_AR = $(AR) cru sys_libhstdm_a_LIBADD = am_sys_libhstdm_a_OBJECTS = sys/std/main.$(OBJEXT) sys_libhstdm_a_OBJECTS = $(am_sys_libhstdm_a_OBJECTS) EXTRA_PROGRAMS = parafmt-check$(EXEEXT) bin_PROGRAMS = heroes$(EXEEXT) heroeslvl$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am_heroes_OBJECTS = argv.$(OBJEXT) bonus.$(OBJEXT) camera.$(OBJEXT) \ const.$(OBJEXT) debughash.$(OBJEXT) debugmsg.$(OBJEXT) \ endscroll.$(OBJEXT) errors.$(OBJEXT) explosions.$(OBJEXT) \ extras.$(OBJEXT) fader.$(OBJEXT) fontdata.$(OBJEXT) \ gameid.$(OBJEXT) hedlite.$(OBJEXT) helptext.$(OBJEXT) \ hendian.$(OBJEXT) heroes.$(OBJEXT) intro.$(OBJEXT) \ items.$(OBJEXT) levellst.$(OBJEXT) locales.$(OBJEXT) \ menus.$(OBJEXT) misc.$(OBJEXT) musicfiles.$(OBJEXT) \ parafmt.$(OBJEXT) pcx.$(OBJEXT) pendulum.$(OBJEXT) \ people.$(OBJEXT) persona.$(OBJEXT) pixelize.$(OBJEXT) \ prefs.$(OBJEXT) readmake.$(OBJEXT) relocate.$(OBJEXT) \ render.$(OBJEXT) renderdata.$(OBJEXT) rsc_files.$(OBJEXT) \ rsc_files_hash.$(OBJEXT) savegame.$(OBJEXT) scores.$(OBJEXT) \ scrtools.$(OBJEXT) sprglauto.$(OBJEXT) sprglenz.$(OBJEXT) \ sprite.$(OBJEXT) spropaque.$(OBJEXT) sprprog.$(OBJEXT) \ sprprogwav.$(OBJEXT) sprrle.$(OBJEXT) sprshade.$(OBJEXT) \ sprtext.$(OBJEXT) sprunish.$(OBJEXT) sprzcol.$(OBJEXT) \ timer.$(OBJEXT) userconf.$(OBJEXT) userdir.$(OBJEXT) \ vars.$(OBJEXT) visuals.$(OBJEXT) heroes_OBJECTS = $(am_heroes_OBJECTS) am_heroeslvl_OBJECTS = heroeslvl.$(OBJEXT) heroeslvl_OBJECTS = $(am_heroeslvl_OBJECTS) heroeslvl_DEPENDENCIES = lvl/libhlvl.a ../lib/libheroes.a heroeslvl_LDFLAGS = am_parafmt_check_OBJECTS = parafmt_check-parafmt.$(OBJEXT) parafmt_check_OBJECTS = $(am_parafmt_check_OBJECTS) parafmt_check_DEPENDENCIES = ../lib/libheroes.a parafmt_check_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/tools/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/argv.Po ./$(DEPDIR)/bonus.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/camera.Po ./$(DEPDIR)/const.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/debughash.Po ./$(DEPDIR)/debugmsg.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/endscroll.Po ./$(DEPDIR)/errors.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/explosions.Po ./$(DEPDIR)/extras.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fader.Po ./$(DEPDIR)/fontdata.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/gameid.Po ./$(DEPDIR)/hedlite.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/helptext.Po ./$(DEPDIR)/hendian.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/heroes.Po ./$(DEPDIR)/heroeslvl.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/intro.Po ./$(DEPDIR)/items.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/levellst.Po ./$(DEPDIR)/locales.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/menus.Po ./$(DEPDIR)/misc.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/musicfiles.Po ./$(DEPDIR)/parafmt.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/parafmt_check-parafmt.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/pcx.Po ./$(DEPDIR)/pendulum.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/people.Po ./$(DEPDIR)/persona.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/pixelize.Po ./$(DEPDIR)/prefs.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/readmake.Po ./$(DEPDIR)/relocate.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/render.Po ./$(DEPDIR)/renderdata.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/rsc_files.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/rsc_files_hash.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/savegame.Po ./$(DEPDIR)/scores.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/scrtools.Po ./$(DEPDIR)/sprglauto.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/sprglenz.Po ./$(DEPDIR)/sprite.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/spropaque.Po ./$(DEPDIR)/sprprog.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/sprprogwav.Po ./$(DEPDIR)/sprrle.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/sprshade.Po ./$(DEPDIR)/sprtext.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/sprunish.Po ./$(DEPDIR)/sprzcol.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/timer.Po ./$(DEPDIR)/userconf.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/userdir.Po ./$(DEPDIR)/vars.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/visuals.Po lvl/$(DEPDIR)/de_body.Po \ @AMDEP_TRUE@ lvl/$(DEPDIR)/de_head.Po lvl/$(DEPDIR)/en_body.Po \ @AMDEP_TRUE@ lvl/$(DEPDIR)/en_head.Po lvl/$(DEPDIR)/free.Po \ @AMDEP_TRUE@ lvl/$(DEPDIR)/in_body.Po lvl/$(DEPDIR)/load.Po \ @AMDEP_TRUE@ lvl/$(DEPDIR)/privacc.Po lvl/$(DEPDIR)/save.Po \ @AMDEP_TRUE@ media/$(DEPDIR)/keyb.Po media/$(DEPDIR)/sfx.Po \ @AMDEP_TRUE@ media/$(DEPDIR)/strack.Po media/$(DEPDIR)/video.Po \ @AMDEP_TRUE@ media/allegro/$(DEPDIR)/media_libhallj_a-joystick.Po \ @AMDEP_TRUE@ media/allegro/$(DEPDIR)/media_libhallvkm_a-keyb.Po \ @AMDEP_TRUE@ media/allegro/$(DEPDIR)/media_libhallvkm_a-keysdef.Po \ @AMDEP_TRUE@ media/allegro/$(DEPDIR)/media_libhallvkm_a-keyvalues.Po \ @AMDEP_TRUE@ media/allegro/$(DEPDIR)/media_libhallvkm_a-video.Po \ @AMDEP_TRUE@ media/dummy/$(DEPDIR)/joystick.Po \ @AMDEP_TRUE@ media/dummy/$(DEPDIR)/keyb.Po \ @AMDEP_TRUE@ media/dummy/$(DEPDIR)/keysdef.Po \ @AMDEP_TRUE@ media/dummy/$(DEPDIR)/keyvalues.Po \ @AMDEP_TRUE@ media/dummy/$(DEPDIR)/sfx.Po \ @AMDEP_TRUE@ media/dummy/$(DEPDIR)/strack.Po \ @AMDEP_TRUE@ media/dummy/$(DEPDIR)/video.Po \ @AMDEP_TRUE@ media/ggi/$(DEPDIR)/media_libhggivkm_a-keyb.Po \ @AMDEP_TRUE@ media/ggi/$(DEPDIR)/media_libhggivkm_a-keysdef.Po \ @AMDEP_TRUE@ media/ggi/$(DEPDIR)/media_libhggivkm_a-keyvalues.Po \ @AMDEP_TRUE@ media/ggi/$(DEPDIR)/media_libhggivkm_a-video.Po \ @AMDEP_TRUE@ media/gii/$(DEPDIR)/media_libhgiij_a-joystick.Po \ @AMDEP_TRUE@ media/mikmod/$(DEPDIR)/media_libhmiks_a-sfx.Po \ @AMDEP_TRUE@ media/mikmod/$(DEPDIR)/media_libhmiks_a-strack.Po \ @AMDEP_TRUE@ media/sdl/$(DEPDIR)/media_libhsdlj_a-joystick.Po \ @AMDEP_TRUE@ media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyb.Po \ @AMDEP_TRUE@ media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keysdef.Po \ @AMDEP_TRUE@ media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyvalues.Po \ @AMDEP_TRUE@ media/sdl/$(DEPDIR)/media_libhsdlvkm_a-video.Po \ @AMDEP_TRUE@ media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-sfx.Po \ @AMDEP_TRUE@ media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-strack.Po \ @AMDEP_TRUE@ sys/allegro/$(DEPDIR)/sys_libhallm_a-main.Po \ @AMDEP_TRUE@ sys/std/$(DEPDIR)/main.Po \ @AMDEP_TRUE@ sys/std/$(DEPDIR)/sys_libhsdlm_a-main.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(lvl_libhlvl_a_SOURCES) $(media_libhallj_a_SOURCES) \ $(media_libhallvkm_a_SOURCES) $(media_libhdumj_a_SOURCES) \ $(media_libhdums_a_SOURCES) $(media_libhdumvkm_a_SOURCES) \ $(media_libhggivkm_a_SOURCES) $(media_libhgiij_a_SOURCES) \ $(media_libhmcommon_a_SOURCES) $(media_libhmiks_a_SOURCES) \ $(media_libhsdlj_a_SOURCES) $(media_libhsdls_a_SOURCES) \ $(media_libhsdlvkm_a_SOURCES) $(sys_libhallm_a_SOURCES) \ $(sys_libhsdlm_a_SOURCES) $(sys_libhstdm_a_SOURCES) \ $(heroes_SOURCES) $(heroeslvl_SOURCES) $(parafmt_check_SOURCES) DATA = $(heroesrc_DATA) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(lvl_libhlvl_a_SOURCES) $(media_libhallj_a_SOURCES) $(media_libhallvkm_a_SOURCES) $(nodist_media_libhallvkm_a_SOURCES) $(media_libhdumj_a_SOURCES) $(media_libhdums_a_SOURCES) $(media_libhdumvkm_a_SOURCES) $(media_libhggivkm_a_SOURCES) $(nodist_media_libhggivkm_a_SOURCES) $(media_libhgiij_a_SOURCES) $(media_libhmcommon_a_SOURCES) $(media_libhmiks_a_SOURCES) $(media_libhsdlj_a_SOURCES) $(media_libhsdls_a_SOURCES) $(media_libhsdlvkm_a_SOURCES) $(nodist_media_libhsdlvkm_a_SOURCES) $(sys_libhallm_a_SOURCES) $(sys_libhsdlm_a_SOURCES) $(sys_libhstdm_a_SOURCES) $(heroes_SOURCES) $(heroeslvl_SOURCES) $(parafmt_check_SOURCES) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: Makefile.am $(srcdir)/etc/Makefile.inc $(srcdir)/lvl/Makefile.inc $(srcdir)/media/Makefile.inc $(srcdir)/sys/Makefile.inc $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) lvl/.dirstamp: @$(mkinstalldirs) lvl @: > lvl/.dirstamp lvl/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) lvl/$(DEPDIR) @: > lvl/$(DEPDIR)/.dirstamp lvl/de_body.$(OBJEXT): lvl/de_body.c lvl/.dirstamp \ lvl/$(DEPDIR)/.dirstamp lvl/de_head.$(OBJEXT): lvl/de_head.c lvl/.dirstamp \ lvl/$(DEPDIR)/.dirstamp lvl/en_body.$(OBJEXT): lvl/en_body.c lvl/.dirstamp \ lvl/$(DEPDIR)/.dirstamp lvl/en_head.$(OBJEXT): lvl/en_head.c lvl/.dirstamp \ lvl/$(DEPDIR)/.dirstamp lvl/free.$(OBJEXT): lvl/free.c lvl/.dirstamp lvl/$(DEPDIR)/.dirstamp lvl/in_body.$(OBJEXT): lvl/in_body.c lvl/.dirstamp \ lvl/$(DEPDIR)/.dirstamp lvl/load.$(OBJEXT): lvl/load.c lvl/.dirstamp lvl/$(DEPDIR)/.dirstamp lvl/privacc.$(OBJEXT): lvl/privacc.c lvl/.dirstamp \ lvl/$(DEPDIR)/.dirstamp lvl/save.$(OBJEXT): lvl/save.c lvl/.dirstamp lvl/$(DEPDIR)/.dirstamp lvl/libhlvl.a: $(lvl_libhlvl_a_OBJECTS) $(lvl_libhlvl_a_DEPENDENCIES) lvl/.dirstamp -rm -f lvl/libhlvl.a $(lvl_libhlvl_a_AR) lvl/libhlvl.a $(lvl_libhlvl_a_OBJECTS) $(lvl_libhlvl_a_LIBADD) $(RANLIB) lvl/libhlvl.a media/allegro/.dirstamp: @$(mkinstalldirs) media/allegro @: > media/allegro/.dirstamp media/allegro/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) media/allegro/$(DEPDIR) @: > media/allegro/$(DEPDIR)/.dirstamp media/allegro/media_libhallj_a-joystick.$(OBJEXT): \ media/allegro/joystick.c media/allegro/.dirstamp \ media/allegro/$(DEPDIR)/.dirstamp media/.dirstamp: @$(mkinstalldirs) media @: > media/.dirstamp media/libhallj.a: $(media_libhallj_a_OBJECTS) $(media_libhallj_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhallj.a $(media_libhallj_a_AR) media/libhallj.a $(media_libhallj_a_OBJECTS) $(media_libhallj_a_LIBADD) $(RANLIB) media/libhallj.a media/allegro/media_libhallvkm_a-keyb.$(OBJEXT): media/allegro/keyb.c \ media/allegro/.dirstamp media/allegro/$(DEPDIR)/.dirstamp media/allegro/media_libhallvkm_a-keyvalues.$(OBJEXT): \ media/allegro/keyvalues.c media/allegro/.dirstamp \ media/allegro/$(DEPDIR)/.dirstamp media/allegro/media_libhallvkm_a-video.$(OBJEXT): media/allegro/video.c \ media/allegro/.dirstamp media/allegro/$(DEPDIR)/.dirstamp media/allegro/media_libhallvkm_a-keysdef.$(OBJEXT): \ media/allegro/keysdef.c media/allegro/.dirstamp \ media/allegro/$(DEPDIR)/.dirstamp media/libhallvkm.a: $(media_libhallvkm_a_OBJECTS) $(media_libhallvkm_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhallvkm.a $(media_libhallvkm_a_AR) media/libhallvkm.a $(media_libhallvkm_a_OBJECTS) $(media_libhallvkm_a_LIBADD) $(RANLIB) media/libhallvkm.a media/dummy/.dirstamp: @$(mkinstalldirs) media/dummy @: > media/dummy/.dirstamp media/dummy/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) media/dummy/$(DEPDIR) @: > media/dummy/$(DEPDIR)/.dirstamp media/dummy/joystick.$(OBJEXT): media/dummy/joystick.c \ media/dummy/.dirstamp media/dummy/$(DEPDIR)/.dirstamp media/libhdumj.a: $(media_libhdumj_a_OBJECTS) $(media_libhdumj_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhdumj.a $(media_libhdumj_a_AR) media/libhdumj.a $(media_libhdumj_a_OBJECTS) $(media_libhdumj_a_LIBADD) $(RANLIB) media/libhdumj.a media/dummy/strack.$(OBJEXT): media/dummy/strack.c media/dummy/.dirstamp \ media/dummy/$(DEPDIR)/.dirstamp media/dummy/sfx.$(OBJEXT): media/dummy/sfx.c media/dummy/.dirstamp \ media/dummy/$(DEPDIR)/.dirstamp media/libhdums.a: $(media_libhdums_a_OBJECTS) $(media_libhdums_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhdums.a $(media_libhdums_a_AR) media/libhdums.a $(media_libhdums_a_OBJECTS) $(media_libhdums_a_LIBADD) $(RANLIB) media/libhdums.a media/dummy/keyb.$(OBJEXT): media/dummy/keyb.c media/dummy/.dirstamp \ media/dummy/$(DEPDIR)/.dirstamp media/dummy/keysdef.$(OBJEXT): media/dummy/keysdef.c \ media/dummy/.dirstamp media/dummy/$(DEPDIR)/.dirstamp media/dummy/keyvalues.$(OBJEXT): media/dummy/keyvalues.c \ media/dummy/.dirstamp media/dummy/$(DEPDIR)/.dirstamp media/dummy/video.$(OBJEXT): media/dummy/video.c media/dummy/.dirstamp \ media/dummy/$(DEPDIR)/.dirstamp media/libhdumvkm.a: $(media_libhdumvkm_a_OBJECTS) $(media_libhdumvkm_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhdumvkm.a $(media_libhdumvkm_a_AR) media/libhdumvkm.a $(media_libhdumvkm_a_OBJECTS) $(media_libhdumvkm_a_LIBADD) $(RANLIB) media/libhdumvkm.a media/ggi/.dirstamp: @$(mkinstalldirs) media/ggi @: > media/ggi/.dirstamp media/ggi/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) media/ggi/$(DEPDIR) @: > media/ggi/$(DEPDIR)/.dirstamp media/ggi/media_libhggivkm_a-keyb.$(OBJEXT): media/ggi/keyb.c \ media/ggi/.dirstamp media/ggi/$(DEPDIR)/.dirstamp media/ggi/media_libhggivkm_a-keyvalues.$(OBJEXT): media/ggi/keyvalues.c \ media/ggi/.dirstamp media/ggi/$(DEPDIR)/.dirstamp media/ggi/media_libhggivkm_a-video.$(OBJEXT): media/ggi/video.c \ media/ggi/.dirstamp media/ggi/$(DEPDIR)/.dirstamp media/ggi/media_libhggivkm_a-keysdef.$(OBJEXT): media/ggi/keysdef.c \ media/ggi/.dirstamp media/ggi/$(DEPDIR)/.dirstamp media/libhggivkm.a: $(media_libhggivkm_a_OBJECTS) $(media_libhggivkm_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhggivkm.a $(media_libhggivkm_a_AR) media/libhggivkm.a $(media_libhggivkm_a_OBJECTS) $(media_libhggivkm_a_LIBADD) $(RANLIB) media/libhggivkm.a media/gii/.dirstamp: @$(mkinstalldirs) media/gii @: > media/gii/.dirstamp media/gii/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) media/gii/$(DEPDIR) @: > media/gii/$(DEPDIR)/.dirstamp media/gii/media_libhgiij_a-joystick.$(OBJEXT): media/gii/joystick.c \ media/gii/.dirstamp media/gii/$(DEPDIR)/.dirstamp media/libhgiij.a: $(media_libhgiij_a_OBJECTS) $(media_libhgiij_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhgiij.a $(media_libhgiij_a_AR) media/libhgiij.a $(media_libhgiij_a_OBJECTS) $(media_libhgiij_a_LIBADD) $(RANLIB) media/libhgiij.a media/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) media/$(DEPDIR) @: > media/$(DEPDIR)/.dirstamp media/keyb.$(OBJEXT): media/keyb.c media/.dirstamp \ media/$(DEPDIR)/.dirstamp media/video.$(OBJEXT): media/video.c media/.dirstamp \ media/$(DEPDIR)/.dirstamp media/strack.$(OBJEXT): media/strack.c media/.dirstamp \ media/$(DEPDIR)/.dirstamp media/sfx.$(OBJEXT): media/sfx.c media/.dirstamp \ media/$(DEPDIR)/.dirstamp media/libhmcommon.a: $(media_libhmcommon_a_OBJECTS) $(media_libhmcommon_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhmcommon.a $(media_libhmcommon_a_AR) media/libhmcommon.a $(media_libhmcommon_a_OBJECTS) $(media_libhmcommon_a_LIBADD) $(RANLIB) media/libhmcommon.a media/mikmod/.dirstamp: @$(mkinstalldirs) media/mikmod @: > media/mikmod/.dirstamp media/mikmod/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) media/mikmod/$(DEPDIR) @: > media/mikmod/$(DEPDIR)/.dirstamp media/mikmod/media_libhmiks_a-strack.$(OBJEXT): media/mikmod/strack.c \ media/mikmod/.dirstamp media/mikmod/$(DEPDIR)/.dirstamp media/mikmod/media_libhmiks_a-sfx.$(OBJEXT): media/mikmod/sfx.c \ media/mikmod/.dirstamp media/mikmod/$(DEPDIR)/.dirstamp media/libhmiks.a: $(media_libhmiks_a_OBJECTS) $(media_libhmiks_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhmiks.a $(media_libhmiks_a_AR) media/libhmiks.a $(media_libhmiks_a_OBJECTS) $(media_libhmiks_a_LIBADD) $(RANLIB) media/libhmiks.a media/sdl/.dirstamp: @$(mkinstalldirs) media/sdl @: > media/sdl/.dirstamp media/sdl/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) media/sdl/$(DEPDIR) @: > media/sdl/$(DEPDIR)/.dirstamp media/sdl/media_libhsdlj_a-joystick.$(OBJEXT): media/sdl/joystick.c \ media/sdl/.dirstamp media/sdl/$(DEPDIR)/.dirstamp media/libhsdlj.a: $(media_libhsdlj_a_OBJECTS) $(media_libhsdlj_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhsdlj.a $(media_libhsdlj_a_AR) media/libhsdlj.a $(media_libhsdlj_a_OBJECTS) $(media_libhsdlj_a_LIBADD) $(RANLIB) media/libhsdlj.a media/sdl_mixer/.dirstamp: @$(mkinstalldirs) media/sdl_mixer @: > media/sdl_mixer/.dirstamp media/sdl_mixer/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) media/sdl_mixer/$(DEPDIR) @: > media/sdl_mixer/$(DEPDIR)/.dirstamp media/sdl_mixer/media_libhsdls_a-strack.$(OBJEXT): \ media/sdl_mixer/strack.c media/sdl_mixer/.dirstamp \ media/sdl_mixer/$(DEPDIR)/.dirstamp media/sdl_mixer/media_libhsdls_a-sfx.$(OBJEXT): media/sdl_mixer/sfx.c \ media/sdl_mixer/.dirstamp media/sdl_mixer/$(DEPDIR)/.dirstamp media/libhsdls.a: $(media_libhsdls_a_OBJECTS) $(media_libhsdls_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhsdls.a $(media_libhsdls_a_AR) media/libhsdls.a $(media_libhsdls_a_OBJECTS) $(media_libhsdls_a_LIBADD) $(RANLIB) media/libhsdls.a media/sdl/media_libhsdlvkm_a-keyb.$(OBJEXT): media/sdl/keyb.c \ media/sdl/.dirstamp media/sdl/$(DEPDIR)/.dirstamp media/sdl/media_libhsdlvkm_a-keyvalues.$(OBJEXT): media/sdl/keyvalues.c \ media/sdl/.dirstamp media/sdl/$(DEPDIR)/.dirstamp media/sdl/media_libhsdlvkm_a-video.$(OBJEXT): media/sdl/video.c \ media/sdl/.dirstamp media/sdl/$(DEPDIR)/.dirstamp media/sdl/media_libhsdlvkm_a-keysdef.$(OBJEXT): media/sdl/keysdef.c \ media/sdl/.dirstamp media/sdl/$(DEPDIR)/.dirstamp media/libhsdlvkm.a: $(media_libhsdlvkm_a_OBJECTS) $(media_libhsdlvkm_a_DEPENDENCIES) media/.dirstamp -rm -f media/libhsdlvkm.a $(media_libhsdlvkm_a_AR) media/libhsdlvkm.a $(media_libhsdlvkm_a_OBJECTS) $(media_libhsdlvkm_a_LIBADD) $(RANLIB) media/libhsdlvkm.a sys/allegro/.dirstamp: @$(mkinstalldirs) sys/allegro @: > sys/allegro/.dirstamp sys/allegro/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) sys/allegro/$(DEPDIR) @: > sys/allegro/$(DEPDIR)/.dirstamp sys/allegro/sys_libhallm_a-main.$(OBJEXT): sys/allegro/main.c \ sys/allegro/.dirstamp sys/allegro/$(DEPDIR)/.dirstamp sys/.dirstamp: @$(mkinstalldirs) sys @: > sys/.dirstamp sys/libhallm.a: $(sys_libhallm_a_OBJECTS) $(sys_libhallm_a_DEPENDENCIES) sys/.dirstamp -rm -f sys/libhallm.a $(sys_libhallm_a_AR) sys/libhallm.a $(sys_libhallm_a_OBJECTS) $(sys_libhallm_a_LIBADD) $(RANLIB) sys/libhallm.a sys/std/.dirstamp: @$(mkinstalldirs) sys/std @: > sys/std/.dirstamp sys/std/$(DEPDIR)/.dirstamp: @$(mkinstalldirs) sys/std/$(DEPDIR) @: > sys/std/$(DEPDIR)/.dirstamp sys/std/sys_libhsdlm_a-main.$(OBJEXT): sys/std/main.c sys/std/.dirstamp \ sys/std/$(DEPDIR)/.dirstamp sys/libhsdlm.a: $(sys_libhsdlm_a_OBJECTS) $(sys_libhsdlm_a_DEPENDENCIES) sys/.dirstamp -rm -f sys/libhsdlm.a $(sys_libhsdlm_a_AR) sys/libhsdlm.a $(sys_libhsdlm_a_OBJECTS) $(sys_libhsdlm_a_LIBADD) $(RANLIB) sys/libhsdlm.a sys/std/main.$(OBJEXT): sys/std/main.c sys/std/.dirstamp \ sys/std/$(DEPDIR)/.dirstamp sys/libhstdm.a: $(sys_libhstdm_a_OBJECTS) $(sys_libhstdm_a_DEPENDENCIES) sys/.dirstamp -rm -f sys/libhstdm.a $(sys_libhstdm_a_AR) sys/libhstdm.a $(sys_libhstdm_a_OBJECTS) $(sys_libhstdm_a_LIBADD) $(RANLIB) sys/libhstdm.a binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \ f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ f=`echo "$$f" | sed -e 's,^.*/,,'`; \ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ rm -f $(DESTDIR)$(bindir)/$$f; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) heroes$(EXEEXT): $(heroes_OBJECTS) $(heroes_DEPENDENCIES) @rm -f heroes$(EXEEXT) $(LINK) $(heroes_LDFLAGS) $(heroes_OBJECTS) $(heroes_LDADD) $(LIBS) heroeslvl$(EXEEXT): $(heroeslvl_OBJECTS) $(heroeslvl_DEPENDENCIES) @rm -f heroeslvl$(EXEEXT) $(LINK) $(heroeslvl_LDFLAGS) $(heroeslvl_OBJECTS) $(heroeslvl_LDADD) $(LIBS) parafmt_check-parafmt.$(OBJEXT): parafmt.c parafmt-check$(EXEEXT): $(parafmt_check_OBJECTS) $(parafmt_check_DEPENDENCIES) @rm -f parafmt-check$(EXEEXT) $(LINK) $(parafmt_check_LDFLAGS) $(parafmt_check_OBJECTS) $(parafmt_check_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core -rm -f lvl/de_body.$(OBJEXT) -rm -f lvl/de_head.$(OBJEXT) -rm -f lvl/en_body.$(OBJEXT) -rm -f lvl/en_head.$(OBJEXT) -rm -f lvl/free.$(OBJEXT) -rm -f lvl/in_body.$(OBJEXT) -rm -f lvl/load.$(OBJEXT) -rm -f lvl/privacc.$(OBJEXT) -rm -f lvl/save.$(OBJEXT) -rm -f media/allegro/media_libhallj_a-joystick.$(OBJEXT) -rm -f media/allegro/media_libhallvkm_a-keyb.$(OBJEXT) -rm -f media/allegro/media_libhallvkm_a-keysdef.$(OBJEXT) -rm -f media/allegro/media_libhallvkm_a-keyvalues.$(OBJEXT) -rm -f media/allegro/media_libhallvkm_a-video.$(OBJEXT) -rm -f media/dummy/joystick.$(OBJEXT) -rm -f media/dummy/keyb.$(OBJEXT) -rm -f media/dummy/keysdef.$(OBJEXT) -rm -f media/dummy/keyvalues.$(OBJEXT) -rm -f media/dummy/sfx.$(OBJEXT) -rm -f media/dummy/strack.$(OBJEXT) -rm -f media/dummy/video.$(OBJEXT) -rm -f media/ggi/media_libhggivkm_a-keyb.$(OBJEXT) -rm -f media/ggi/media_libhggivkm_a-keysdef.$(OBJEXT) -rm -f media/ggi/media_libhggivkm_a-keyvalues.$(OBJEXT) -rm -f media/ggi/media_libhggivkm_a-video.$(OBJEXT) -rm -f media/gii/media_libhgiij_a-joystick.$(OBJEXT) -rm -f media/keyb.$(OBJEXT) -rm -f media/mikmod/media_libhmiks_a-sfx.$(OBJEXT) -rm -f media/mikmod/media_libhmiks_a-strack.$(OBJEXT) -rm -f media/sdl/media_libhsdlj_a-joystick.$(OBJEXT) -rm -f media/sdl/media_libhsdlvkm_a-keyb.$(OBJEXT) -rm -f media/sdl/media_libhsdlvkm_a-keysdef.$(OBJEXT) -rm -f media/sdl/media_libhsdlvkm_a-keyvalues.$(OBJEXT) -rm -f media/sdl/media_libhsdlvkm_a-video.$(OBJEXT) -rm -f media/sdl_mixer/media_libhsdls_a-sfx.$(OBJEXT) -rm -f media/sdl_mixer/media_libhsdls_a-strack.$(OBJEXT) -rm -f media/sfx.$(OBJEXT) -rm -f media/strack.$(OBJEXT) -rm -f media/video.$(OBJEXT) -rm -f sys/allegro/sys_libhallm_a-main.$(OBJEXT) -rm -f sys/std/main.$(OBJEXT) -rm -f sys/std/sys_libhsdlm_a-main.$(OBJEXT) distclean-compile: -rm -f *.tab.c -rm -f lvl/$(DEPDIR)/.dirstamp -rm -f lvl/.dirstamp -rm -f media/$(DEPDIR)/.dirstamp -rm -f media/.dirstamp -rm -f media/allegro/$(DEPDIR)/.dirstamp -rm -f media/allegro/.dirstamp -rm -f media/dummy/$(DEPDIR)/.dirstamp -rm -f media/dummy/.dirstamp -rm -f media/ggi/$(DEPDIR)/.dirstamp -rm -f media/ggi/.dirstamp -rm -f media/gii/$(DEPDIR)/.dirstamp -rm -f media/gii/.dirstamp -rm -f media/mikmod/$(DEPDIR)/.dirstamp -rm -f media/mikmod/.dirstamp -rm -f media/sdl/$(DEPDIR)/.dirstamp -rm -f media/sdl/.dirstamp -rm -f media/sdl_mixer/$(DEPDIR)/.dirstamp -rm -f media/sdl_mixer/.dirstamp -rm -f sys/.dirstamp -rm -f sys/allegro/$(DEPDIR)/.dirstamp -rm -f sys/allegro/.dirstamp -rm -f sys/std/$(DEPDIR)/.dirstamp -rm -f sys/std/.dirstamp @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/argv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bonus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/camera.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debughash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugmsg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endscroll.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/explosions.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/extras.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fader.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fontdata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gameid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hedlite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helptext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hendian.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/heroes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/heroeslvl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intro.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/items.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/levellst.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locales.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/musicfiles.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parafmt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parafmt_check-parafmt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pendulum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/people.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/persona.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pixelize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prefs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readmake.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/relocate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renderdata.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsc_files.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsc_files_hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/savegame.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scores.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scrtools.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprglauto.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprglenz.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spropaque.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprprog.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprprogwav.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprrle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprshade.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprtext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprunish.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sprzcol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userconf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/visuals.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lvl/$(DEPDIR)/de_body.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lvl/$(DEPDIR)/de_head.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lvl/$(DEPDIR)/en_body.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lvl/$(DEPDIR)/en_head.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lvl/$(DEPDIR)/free.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lvl/$(DEPDIR)/in_body.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lvl/$(DEPDIR)/load.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lvl/$(DEPDIR)/privacc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@lvl/$(DEPDIR)/save.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/$(DEPDIR)/keyb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/$(DEPDIR)/sfx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/$(DEPDIR)/strack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/$(DEPDIR)/video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/allegro/$(DEPDIR)/media_libhallj_a-joystick.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/allegro/$(DEPDIR)/media_libhallvkm_a-keyb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/allegro/$(DEPDIR)/media_libhallvkm_a-keysdef.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/allegro/$(DEPDIR)/media_libhallvkm_a-keyvalues.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/allegro/$(DEPDIR)/media_libhallvkm_a-video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/dummy/$(DEPDIR)/joystick.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/dummy/$(DEPDIR)/keyb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/dummy/$(DEPDIR)/keysdef.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/dummy/$(DEPDIR)/keyvalues.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/dummy/$(DEPDIR)/sfx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/dummy/$(DEPDIR)/strack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/dummy/$(DEPDIR)/video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/ggi/$(DEPDIR)/media_libhggivkm_a-keyb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/ggi/$(DEPDIR)/media_libhggivkm_a-keysdef.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/ggi/$(DEPDIR)/media_libhggivkm_a-keyvalues.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/ggi/$(DEPDIR)/media_libhggivkm_a-video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/gii/$(DEPDIR)/media_libhgiij_a-joystick.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/mikmod/$(DEPDIR)/media_libhmiks_a-sfx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/mikmod/$(DEPDIR)/media_libhmiks_a-strack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/sdl/$(DEPDIR)/media_libhsdlj_a-joystick.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keysdef.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyvalues.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/sdl/$(DEPDIR)/media_libhsdlvkm_a-video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-sfx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-strack.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sys/allegro/$(DEPDIR)/sys_libhallm_a-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sys/std/$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@sys/std/$(DEPDIR)/sys_libhsdlm_a-main.Po@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) lvl/$(DEPDIR) media/$(DEPDIR) media/allegro/$(DEPDIR) media/dummy/$(DEPDIR) media/ggi/$(DEPDIR) media/gii/$(DEPDIR) media/mikmod/$(DEPDIR) media/sdl/$(DEPDIR) media/sdl_mixer/$(DEPDIR) sys/allegro/$(DEPDIR) sys/std/$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c -o $@ `cygpath -w $<` lvl/de_body.o: lvl/de_body.c @AMDEP_TRUE@ source='lvl/de_body.c' object='lvl/de_body.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/de_body.Po' tmpdepfile='lvl/$(DEPDIR)/de_body.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/de_body.o `test -f lvl/de_body.c || echo '$(srcdir)/'`lvl/de_body.c lvl/de_body.obj: lvl/de_body.c @AMDEP_TRUE@ source='lvl/de_body.c' object='lvl/de_body.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/de_body.Po' tmpdepfile='lvl/$(DEPDIR)/de_body.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/de_body.obj `cygpath -w lvl/de_body.c` lvl/de_head.o: lvl/de_head.c @AMDEP_TRUE@ source='lvl/de_head.c' object='lvl/de_head.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/de_head.Po' tmpdepfile='lvl/$(DEPDIR)/de_head.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/de_head.o `test -f lvl/de_head.c || echo '$(srcdir)/'`lvl/de_head.c lvl/de_head.obj: lvl/de_head.c @AMDEP_TRUE@ source='lvl/de_head.c' object='lvl/de_head.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/de_head.Po' tmpdepfile='lvl/$(DEPDIR)/de_head.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/de_head.obj `cygpath -w lvl/de_head.c` lvl/en_body.o: lvl/en_body.c @AMDEP_TRUE@ source='lvl/en_body.c' object='lvl/en_body.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/en_body.Po' tmpdepfile='lvl/$(DEPDIR)/en_body.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/en_body.o `test -f lvl/en_body.c || echo '$(srcdir)/'`lvl/en_body.c lvl/en_body.obj: lvl/en_body.c @AMDEP_TRUE@ source='lvl/en_body.c' object='lvl/en_body.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/en_body.Po' tmpdepfile='lvl/$(DEPDIR)/en_body.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/en_body.obj `cygpath -w lvl/en_body.c` lvl/en_head.o: lvl/en_head.c @AMDEP_TRUE@ source='lvl/en_head.c' object='lvl/en_head.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/en_head.Po' tmpdepfile='lvl/$(DEPDIR)/en_head.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/en_head.o `test -f lvl/en_head.c || echo '$(srcdir)/'`lvl/en_head.c lvl/en_head.obj: lvl/en_head.c @AMDEP_TRUE@ source='lvl/en_head.c' object='lvl/en_head.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/en_head.Po' tmpdepfile='lvl/$(DEPDIR)/en_head.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/en_head.obj `cygpath -w lvl/en_head.c` lvl/free.o: lvl/free.c @AMDEP_TRUE@ source='lvl/free.c' object='lvl/free.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/free.Po' tmpdepfile='lvl/$(DEPDIR)/free.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/free.o `test -f lvl/free.c || echo '$(srcdir)/'`lvl/free.c lvl/free.obj: lvl/free.c @AMDEP_TRUE@ source='lvl/free.c' object='lvl/free.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/free.Po' tmpdepfile='lvl/$(DEPDIR)/free.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/free.obj `cygpath -w lvl/free.c` lvl/in_body.o: lvl/in_body.c @AMDEP_TRUE@ source='lvl/in_body.c' object='lvl/in_body.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/in_body.Po' tmpdepfile='lvl/$(DEPDIR)/in_body.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/in_body.o `test -f lvl/in_body.c || echo '$(srcdir)/'`lvl/in_body.c lvl/in_body.obj: lvl/in_body.c @AMDEP_TRUE@ source='lvl/in_body.c' object='lvl/in_body.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/in_body.Po' tmpdepfile='lvl/$(DEPDIR)/in_body.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/in_body.obj `cygpath -w lvl/in_body.c` lvl/load.o: lvl/load.c @AMDEP_TRUE@ source='lvl/load.c' object='lvl/load.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/load.Po' tmpdepfile='lvl/$(DEPDIR)/load.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/load.o `test -f lvl/load.c || echo '$(srcdir)/'`lvl/load.c lvl/load.obj: lvl/load.c @AMDEP_TRUE@ source='lvl/load.c' object='lvl/load.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/load.Po' tmpdepfile='lvl/$(DEPDIR)/load.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/load.obj `cygpath -w lvl/load.c` lvl/privacc.o: lvl/privacc.c @AMDEP_TRUE@ source='lvl/privacc.c' object='lvl/privacc.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/privacc.Po' tmpdepfile='lvl/$(DEPDIR)/privacc.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/privacc.o `test -f lvl/privacc.c || echo '$(srcdir)/'`lvl/privacc.c lvl/privacc.obj: lvl/privacc.c @AMDEP_TRUE@ source='lvl/privacc.c' object='lvl/privacc.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/privacc.Po' tmpdepfile='lvl/$(DEPDIR)/privacc.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/privacc.obj `cygpath -w lvl/privacc.c` lvl/save.o: lvl/save.c @AMDEP_TRUE@ source='lvl/save.c' object='lvl/save.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/save.Po' tmpdepfile='lvl/$(DEPDIR)/save.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/save.o `test -f lvl/save.c || echo '$(srcdir)/'`lvl/save.c lvl/save.obj: lvl/save.c @AMDEP_TRUE@ source='lvl/save.c' object='lvl/save.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='lvl/$(DEPDIR)/save.Po' tmpdepfile='lvl/$(DEPDIR)/save.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o lvl/save.obj `cygpath -w lvl/save.c` media/allegro/media_libhallj_a-joystick.o: media/allegro/joystick.c @AMDEP_TRUE@ source='media/allegro/joystick.c' object='media/allegro/media_libhallj_a-joystick.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallj_a-joystick.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallj_a-joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallj_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallj_a-joystick.o `test -f media/allegro/joystick.c || echo '$(srcdir)/'`media/allegro/joystick.c media/allegro/media_libhallj_a-joystick.obj: media/allegro/joystick.c @AMDEP_TRUE@ source='media/allegro/joystick.c' object='media/allegro/media_libhallj_a-joystick.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallj_a-joystick.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallj_a-joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallj_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallj_a-joystick.obj `cygpath -w media/allegro/joystick.c` media/allegro/media_libhallvkm_a-keyb.o: media/allegro/keyb.c @AMDEP_TRUE@ source='media/allegro/keyb.c' object='media/allegro/media_libhallvkm_a-keyb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keyb.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallvkm_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallvkm_a-keyb.o `test -f media/allegro/keyb.c || echo '$(srcdir)/'`media/allegro/keyb.c media/allegro/media_libhallvkm_a-keyb.obj: media/allegro/keyb.c @AMDEP_TRUE@ source='media/allegro/keyb.c' object='media/allegro/media_libhallvkm_a-keyb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keyb.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallvkm_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallvkm_a-keyb.obj `cygpath -w media/allegro/keyb.c` media/allegro/media_libhallvkm_a-keyvalues.o: media/allegro/keyvalues.c @AMDEP_TRUE@ source='media/allegro/keyvalues.c' object='media/allegro/media_libhallvkm_a-keyvalues.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keyvalues.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keyvalues.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallvkm_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallvkm_a-keyvalues.o `test -f media/allegro/keyvalues.c || echo '$(srcdir)/'`media/allegro/keyvalues.c media/allegro/media_libhallvkm_a-keyvalues.obj: media/allegro/keyvalues.c @AMDEP_TRUE@ source='media/allegro/keyvalues.c' object='media/allegro/media_libhallvkm_a-keyvalues.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keyvalues.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keyvalues.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallvkm_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallvkm_a-keyvalues.obj `cygpath -w media/allegro/keyvalues.c` media/allegro/media_libhallvkm_a-video.o: media/allegro/video.c @AMDEP_TRUE@ source='media/allegro/video.c' object='media/allegro/media_libhallvkm_a-video.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-video.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallvkm_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallvkm_a-video.o `test -f media/allegro/video.c || echo '$(srcdir)/'`media/allegro/video.c media/allegro/media_libhallvkm_a-video.obj: media/allegro/video.c @AMDEP_TRUE@ source='media/allegro/video.c' object='media/allegro/media_libhallvkm_a-video.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-video.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallvkm_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallvkm_a-video.obj `cygpath -w media/allegro/video.c` media/allegro/media_libhallvkm_a-keysdef.o: media/allegro/keysdef.c @AMDEP_TRUE@ source='media/allegro/keysdef.c' object='media/allegro/media_libhallvkm_a-keysdef.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keysdef.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keysdef.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallvkm_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallvkm_a-keysdef.o `test -f media/allegro/keysdef.c || echo '$(srcdir)/'`media/allegro/keysdef.c media/allegro/media_libhallvkm_a-keysdef.obj: media/allegro/keysdef.c @AMDEP_TRUE@ source='media/allegro/keysdef.c' object='media/allegro/media_libhallvkm_a-keysdef.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keysdef.Po' tmpdepfile='media/allegro/$(DEPDIR)/media_libhallvkm_a-keysdef.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhallvkm_a_CFLAGS) $(CFLAGS) -c -o media/allegro/media_libhallvkm_a-keysdef.obj `cygpath -w media/allegro/keysdef.c` media/dummy/joystick.o: media/dummy/joystick.c @AMDEP_TRUE@ source='media/dummy/joystick.c' object='media/dummy/joystick.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/joystick.Po' tmpdepfile='media/dummy/$(DEPDIR)/joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/joystick.o `test -f media/dummy/joystick.c || echo '$(srcdir)/'`media/dummy/joystick.c media/dummy/joystick.obj: media/dummy/joystick.c @AMDEP_TRUE@ source='media/dummy/joystick.c' object='media/dummy/joystick.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/joystick.Po' tmpdepfile='media/dummy/$(DEPDIR)/joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/joystick.obj `cygpath -w media/dummy/joystick.c` media/dummy/strack.o: media/dummy/strack.c @AMDEP_TRUE@ source='media/dummy/strack.c' object='media/dummy/strack.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/strack.Po' tmpdepfile='media/dummy/$(DEPDIR)/strack.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/strack.o `test -f media/dummy/strack.c || echo '$(srcdir)/'`media/dummy/strack.c media/dummy/strack.obj: media/dummy/strack.c @AMDEP_TRUE@ source='media/dummy/strack.c' object='media/dummy/strack.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/strack.Po' tmpdepfile='media/dummy/$(DEPDIR)/strack.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/strack.obj `cygpath -w media/dummy/strack.c` media/dummy/sfx.o: media/dummy/sfx.c @AMDEP_TRUE@ source='media/dummy/sfx.c' object='media/dummy/sfx.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/sfx.Po' tmpdepfile='media/dummy/$(DEPDIR)/sfx.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/sfx.o `test -f media/dummy/sfx.c || echo '$(srcdir)/'`media/dummy/sfx.c media/dummy/sfx.obj: media/dummy/sfx.c @AMDEP_TRUE@ source='media/dummy/sfx.c' object='media/dummy/sfx.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/sfx.Po' tmpdepfile='media/dummy/$(DEPDIR)/sfx.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/sfx.obj `cygpath -w media/dummy/sfx.c` media/dummy/keyb.o: media/dummy/keyb.c @AMDEP_TRUE@ source='media/dummy/keyb.c' object='media/dummy/keyb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/keyb.Po' tmpdepfile='media/dummy/$(DEPDIR)/keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/keyb.o `test -f media/dummy/keyb.c || echo '$(srcdir)/'`media/dummy/keyb.c media/dummy/keyb.obj: media/dummy/keyb.c @AMDEP_TRUE@ source='media/dummy/keyb.c' object='media/dummy/keyb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/keyb.Po' tmpdepfile='media/dummy/$(DEPDIR)/keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/keyb.obj `cygpath -w media/dummy/keyb.c` media/dummy/keysdef.o: media/dummy/keysdef.c @AMDEP_TRUE@ source='media/dummy/keysdef.c' object='media/dummy/keysdef.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/keysdef.Po' tmpdepfile='media/dummy/$(DEPDIR)/keysdef.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/keysdef.o `test -f media/dummy/keysdef.c || echo '$(srcdir)/'`media/dummy/keysdef.c media/dummy/keysdef.obj: media/dummy/keysdef.c @AMDEP_TRUE@ source='media/dummy/keysdef.c' object='media/dummy/keysdef.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/keysdef.Po' tmpdepfile='media/dummy/$(DEPDIR)/keysdef.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/keysdef.obj `cygpath -w media/dummy/keysdef.c` media/dummy/keyvalues.o: media/dummy/keyvalues.c @AMDEP_TRUE@ source='media/dummy/keyvalues.c' object='media/dummy/keyvalues.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/keyvalues.Po' tmpdepfile='media/dummy/$(DEPDIR)/keyvalues.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/keyvalues.o `test -f media/dummy/keyvalues.c || echo '$(srcdir)/'`media/dummy/keyvalues.c media/dummy/keyvalues.obj: media/dummy/keyvalues.c @AMDEP_TRUE@ source='media/dummy/keyvalues.c' object='media/dummy/keyvalues.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/keyvalues.Po' tmpdepfile='media/dummy/$(DEPDIR)/keyvalues.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/keyvalues.obj `cygpath -w media/dummy/keyvalues.c` media/dummy/video.o: media/dummy/video.c @AMDEP_TRUE@ source='media/dummy/video.c' object='media/dummy/video.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/video.Po' tmpdepfile='media/dummy/$(DEPDIR)/video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/video.o `test -f media/dummy/video.c || echo '$(srcdir)/'`media/dummy/video.c media/dummy/video.obj: media/dummy/video.c @AMDEP_TRUE@ source='media/dummy/video.c' object='media/dummy/video.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/dummy/$(DEPDIR)/video.Po' tmpdepfile='media/dummy/$(DEPDIR)/video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/dummy/video.obj `cygpath -w media/dummy/video.c` media/ggi/media_libhggivkm_a-keyb.o: media/ggi/keyb.c @AMDEP_TRUE@ source='media/ggi/keyb.c' object='media/ggi/media_libhggivkm_a-keyb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keyb.Po' tmpdepfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhggivkm_a_CFLAGS) $(CFLAGS) -c -o media/ggi/media_libhggivkm_a-keyb.o `test -f media/ggi/keyb.c || echo '$(srcdir)/'`media/ggi/keyb.c media/ggi/media_libhggivkm_a-keyb.obj: media/ggi/keyb.c @AMDEP_TRUE@ source='media/ggi/keyb.c' object='media/ggi/media_libhggivkm_a-keyb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keyb.Po' tmpdepfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhggivkm_a_CFLAGS) $(CFLAGS) -c -o media/ggi/media_libhggivkm_a-keyb.obj `cygpath -w media/ggi/keyb.c` media/ggi/media_libhggivkm_a-keyvalues.o: media/ggi/keyvalues.c @AMDEP_TRUE@ source='media/ggi/keyvalues.c' object='media/ggi/media_libhggivkm_a-keyvalues.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keyvalues.Po' tmpdepfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keyvalues.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhggivkm_a_CFLAGS) $(CFLAGS) -c -o media/ggi/media_libhggivkm_a-keyvalues.o `test -f media/ggi/keyvalues.c || echo '$(srcdir)/'`media/ggi/keyvalues.c media/ggi/media_libhggivkm_a-keyvalues.obj: media/ggi/keyvalues.c @AMDEP_TRUE@ source='media/ggi/keyvalues.c' object='media/ggi/media_libhggivkm_a-keyvalues.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keyvalues.Po' tmpdepfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keyvalues.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhggivkm_a_CFLAGS) $(CFLAGS) -c -o media/ggi/media_libhggivkm_a-keyvalues.obj `cygpath -w media/ggi/keyvalues.c` media/ggi/media_libhggivkm_a-video.o: media/ggi/video.c @AMDEP_TRUE@ source='media/ggi/video.c' object='media/ggi/media_libhggivkm_a-video.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-video.Po' tmpdepfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhggivkm_a_CFLAGS) $(CFLAGS) -c -o media/ggi/media_libhggivkm_a-video.o `test -f media/ggi/video.c || echo '$(srcdir)/'`media/ggi/video.c media/ggi/media_libhggivkm_a-video.obj: media/ggi/video.c @AMDEP_TRUE@ source='media/ggi/video.c' object='media/ggi/media_libhggivkm_a-video.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-video.Po' tmpdepfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhggivkm_a_CFLAGS) $(CFLAGS) -c -o media/ggi/media_libhggivkm_a-video.obj `cygpath -w media/ggi/video.c` media/ggi/media_libhggivkm_a-keysdef.o: media/ggi/keysdef.c @AMDEP_TRUE@ source='media/ggi/keysdef.c' object='media/ggi/media_libhggivkm_a-keysdef.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keysdef.Po' tmpdepfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keysdef.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhggivkm_a_CFLAGS) $(CFLAGS) -c -o media/ggi/media_libhggivkm_a-keysdef.o `test -f media/ggi/keysdef.c || echo '$(srcdir)/'`media/ggi/keysdef.c media/ggi/media_libhggivkm_a-keysdef.obj: media/ggi/keysdef.c @AMDEP_TRUE@ source='media/ggi/keysdef.c' object='media/ggi/media_libhggivkm_a-keysdef.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keysdef.Po' tmpdepfile='media/ggi/$(DEPDIR)/media_libhggivkm_a-keysdef.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhggivkm_a_CFLAGS) $(CFLAGS) -c -o media/ggi/media_libhggivkm_a-keysdef.obj `cygpath -w media/ggi/keysdef.c` media/gii/media_libhgiij_a-joystick.o: media/gii/joystick.c @AMDEP_TRUE@ source='media/gii/joystick.c' object='media/gii/media_libhgiij_a-joystick.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/gii/$(DEPDIR)/media_libhgiij_a-joystick.Po' tmpdepfile='media/gii/$(DEPDIR)/media_libhgiij_a-joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhgiij_a_CFLAGS) $(CFLAGS) -c -o media/gii/media_libhgiij_a-joystick.o `test -f media/gii/joystick.c || echo '$(srcdir)/'`media/gii/joystick.c media/gii/media_libhgiij_a-joystick.obj: media/gii/joystick.c @AMDEP_TRUE@ source='media/gii/joystick.c' object='media/gii/media_libhgiij_a-joystick.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/gii/$(DEPDIR)/media_libhgiij_a-joystick.Po' tmpdepfile='media/gii/$(DEPDIR)/media_libhgiij_a-joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhgiij_a_CFLAGS) $(CFLAGS) -c -o media/gii/media_libhgiij_a-joystick.obj `cygpath -w media/gii/joystick.c` media/keyb.o: media/keyb.c @AMDEP_TRUE@ source='media/keyb.c' object='media/keyb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/$(DEPDIR)/keyb.Po' tmpdepfile='media/$(DEPDIR)/keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/keyb.o `test -f media/keyb.c || echo '$(srcdir)/'`media/keyb.c media/keyb.obj: media/keyb.c @AMDEP_TRUE@ source='media/keyb.c' object='media/keyb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/$(DEPDIR)/keyb.Po' tmpdepfile='media/$(DEPDIR)/keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/keyb.obj `cygpath -w media/keyb.c` media/video.o: media/video.c @AMDEP_TRUE@ source='media/video.c' object='media/video.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/$(DEPDIR)/video.Po' tmpdepfile='media/$(DEPDIR)/video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/video.o `test -f media/video.c || echo '$(srcdir)/'`media/video.c media/video.obj: media/video.c @AMDEP_TRUE@ source='media/video.c' object='media/video.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/$(DEPDIR)/video.Po' tmpdepfile='media/$(DEPDIR)/video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/video.obj `cygpath -w media/video.c` media/strack.o: media/strack.c @AMDEP_TRUE@ source='media/strack.c' object='media/strack.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/$(DEPDIR)/strack.Po' tmpdepfile='media/$(DEPDIR)/strack.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/strack.o `test -f media/strack.c || echo '$(srcdir)/'`media/strack.c media/strack.obj: media/strack.c @AMDEP_TRUE@ source='media/strack.c' object='media/strack.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/$(DEPDIR)/strack.Po' tmpdepfile='media/$(DEPDIR)/strack.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/strack.obj `cygpath -w media/strack.c` media/sfx.o: media/sfx.c @AMDEP_TRUE@ source='media/sfx.c' object='media/sfx.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/$(DEPDIR)/sfx.Po' tmpdepfile='media/$(DEPDIR)/sfx.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/sfx.o `test -f media/sfx.c || echo '$(srcdir)/'`media/sfx.c media/sfx.obj: media/sfx.c @AMDEP_TRUE@ source='media/sfx.c' object='media/sfx.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/$(DEPDIR)/sfx.Po' tmpdepfile='media/$(DEPDIR)/sfx.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o media/sfx.obj `cygpath -w media/sfx.c` media/mikmod/media_libhmiks_a-strack.o: media/mikmod/strack.c @AMDEP_TRUE@ source='media/mikmod/strack.c' object='media/mikmod/media_libhmiks_a-strack.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/mikmod/$(DEPDIR)/media_libhmiks_a-strack.Po' tmpdepfile='media/mikmod/$(DEPDIR)/media_libhmiks_a-strack.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhmiks_a_CFLAGS) $(CFLAGS) -c -o media/mikmod/media_libhmiks_a-strack.o `test -f media/mikmod/strack.c || echo '$(srcdir)/'`media/mikmod/strack.c media/mikmod/media_libhmiks_a-strack.obj: media/mikmod/strack.c @AMDEP_TRUE@ source='media/mikmod/strack.c' object='media/mikmod/media_libhmiks_a-strack.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/mikmod/$(DEPDIR)/media_libhmiks_a-strack.Po' tmpdepfile='media/mikmod/$(DEPDIR)/media_libhmiks_a-strack.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhmiks_a_CFLAGS) $(CFLAGS) -c -o media/mikmod/media_libhmiks_a-strack.obj `cygpath -w media/mikmod/strack.c` media/mikmod/media_libhmiks_a-sfx.o: media/mikmod/sfx.c @AMDEP_TRUE@ source='media/mikmod/sfx.c' object='media/mikmod/media_libhmiks_a-sfx.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/mikmod/$(DEPDIR)/media_libhmiks_a-sfx.Po' tmpdepfile='media/mikmod/$(DEPDIR)/media_libhmiks_a-sfx.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhmiks_a_CFLAGS) $(CFLAGS) -c -o media/mikmod/media_libhmiks_a-sfx.o `test -f media/mikmod/sfx.c || echo '$(srcdir)/'`media/mikmod/sfx.c media/mikmod/media_libhmiks_a-sfx.obj: media/mikmod/sfx.c @AMDEP_TRUE@ source='media/mikmod/sfx.c' object='media/mikmod/media_libhmiks_a-sfx.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/mikmod/$(DEPDIR)/media_libhmiks_a-sfx.Po' tmpdepfile='media/mikmod/$(DEPDIR)/media_libhmiks_a-sfx.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhmiks_a_CFLAGS) $(CFLAGS) -c -o media/mikmod/media_libhmiks_a-sfx.obj `cygpath -w media/mikmod/sfx.c` media/sdl/media_libhsdlj_a-joystick.o: media/sdl/joystick.c @AMDEP_TRUE@ source='media/sdl/joystick.c' object='media/sdl/media_libhsdlj_a-joystick.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlj_a-joystick.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlj_a-joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlj_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlj_a-joystick.o `test -f media/sdl/joystick.c || echo '$(srcdir)/'`media/sdl/joystick.c media/sdl/media_libhsdlj_a-joystick.obj: media/sdl/joystick.c @AMDEP_TRUE@ source='media/sdl/joystick.c' object='media/sdl/media_libhsdlj_a-joystick.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlj_a-joystick.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlj_a-joystick.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlj_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlj_a-joystick.obj `cygpath -w media/sdl/joystick.c` media/sdl_mixer/media_libhsdls_a-strack.o: media/sdl_mixer/strack.c @AMDEP_TRUE@ source='media/sdl_mixer/strack.c' object='media/sdl_mixer/media_libhsdls_a-strack.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-strack.Po' tmpdepfile='media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-strack.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdls_a_CFLAGS) $(CFLAGS) -c -o media/sdl_mixer/media_libhsdls_a-strack.o `test -f media/sdl_mixer/strack.c || echo '$(srcdir)/'`media/sdl_mixer/strack.c media/sdl_mixer/media_libhsdls_a-strack.obj: media/sdl_mixer/strack.c @AMDEP_TRUE@ source='media/sdl_mixer/strack.c' object='media/sdl_mixer/media_libhsdls_a-strack.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-strack.Po' tmpdepfile='media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-strack.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdls_a_CFLAGS) $(CFLAGS) -c -o media/sdl_mixer/media_libhsdls_a-strack.obj `cygpath -w media/sdl_mixer/strack.c` media/sdl_mixer/media_libhsdls_a-sfx.o: media/sdl_mixer/sfx.c @AMDEP_TRUE@ source='media/sdl_mixer/sfx.c' object='media/sdl_mixer/media_libhsdls_a-sfx.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-sfx.Po' tmpdepfile='media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-sfx.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdls_a_CFLAGS) $(CFLAGS) -c -o media/sdl_mixer/media_libhsdls_a-sfx.o `test -f media/sdl_mixer/sfx.c || echo '$(srcdir)/'`media/sdl_mixer/sfx.c media/sdl_mixer/media_libhsdls_a-sfx.obj: media/sdl_mixer/sfx.c @AMDEP_TRUE@ source='media/sdl_mixer/sfx.c' object='media/sdl_mixer/media_libhsdls_a-sfx.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-sfx.Po' tmpdepfile='media/sdl_mixer/$(DEPDIR)/media_libhsdls_a-sfx.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdls_a_CFLAGS) $(CFLAGS) -c -o media/sdl_mixer/media_libhsdls_a-sfx.obj `cygpath -w media/sdl_mixer/sfx.c` media/sdl/media_libhsdlvkm_a-keyb.o: media/sdl/keyb.c @AMDEP_TRUE@ source='media/sdl/keyb.c' object='media/sdl/media_libhsdlvkm_a-keyb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyb.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlvkm_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlvkm_a-keyb.o `test -f media/sdl/keyb.c || echo '$(srcdir)/'`media/sdl/keyb.c media/sdl/media_libhsdlvkm_a-keyb.obj: media/sdl/keyb.c @AMDEP_TRUE@ source='media/sdl/keyb.c' object='media/sdl/media_libhsdlvkm_a-keyb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyb.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyb.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlvkm_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlvkm_a-keyb.obj `cygpath -w media/sdl/keyb.c` media/sdl/media_libhsdlvkm_a-keyvalues.o: media/sdl/keyvalues.c @AMDEP_TRUE@ source='media/sdl/keyvalues.c' object='media/sdl/media_libhsdlvkm_a-keyvalues.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyvalues.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyvalues.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlvkm_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlvkm_a-keyvalues.o `test -f media/sdl/keyvalues.c || echo '$(srcdir)/'`media/sdl/keyvalues.c media/sdl/media_libhsdlvkm_a-keyvalues.obj: media/sdl/keyvalues.c @AMDEP_TRUE@ source='media/sdl/keyvalues.c' object='media/sdl/media_libhsdlvkm_a-keyvalues.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyvalues.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keyvalues.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlvkm_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlvkm_a-keyvalues.obj `cygpath -w media/sdl/keyvalues.c` media/sdl/media_libhsdlvkm_a-video.o: media/sdl/video.c @AMDEP_TRUE@ source='media/sdl/video.c' object='media/sdl/media_libhsdlvkm_a-video.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-video.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlvkm_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlvkm_a-video.o `test -f media/sdl/video.c || echo '$(srcdir)/'`media/sdl/video.c media/sdl/media_libhsdlvkm_a-video.obj: media/sdl/video.c @AMDEP_TRUE@ source='media/sdl/video.c' object='media/sdl/media_libhsdlvkm_a-video.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-video.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-video.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlvkm_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlvkm_a-video.obj `cygpath -w media/sdl/video.c` media/sdl/media_libhsdlvkm_a-keysdef.o: media/sdl/keysdef.c @AMDEP_TRUE@ source='media/sdl/keysdef.c' object='media/sdl/media_libhsdlvkm_a-keysdef.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keysdef.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keysdef.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlvkm_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlvkm_a-keysdef.o `test -f media/sdl/keysdef.c || echo '$(srcdir)/'`media/sdl/keysdef.c media/sdl/media_libhsdlvkm_a-keysdef.obj: media/sdl/keysdef.c @AMDEP_TRUE@ source='media/sdl/keysdef.c' object='media/sdl/media_libhsdlvkm_a-keysdef.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keysdef.Po' tmpdepfile='media/sdl/$(DEPDIR)/media_libhsdlvkm_a-keysdef.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(media_libhsdlvkm_a_CFLAGS) $(CFLAGS) -c -o media/sdl/media_libhsdlvkm_a-keysdef.obj `cygpath -w media/sdl/keysdef.c` sys/allegro/sys_libhallm_a-main.o: sys/allegro/main.c @AMDEP_TRUE@ source='sys/allegro/main.c' object='sys/allegro/sys_libhallm_a-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='sys/allegro/$(DEPDIR)/sys_libhallm_a-main.Po' tmpdepfile='sys/allegro/$(DEPDIR)/sys_libhallm_a-main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sys_libhallm_a_CFLAGS) $(CFLAGS) -c -o sys/allegro/sys_libhallm_a-main.o `test -f sys/allegro/main.c || echo '$(srcdir)/'`sys/allegro/main.c sys/allegro/sys_libhallm_a-main.obj: sys/allegro/main.c @AMDEP_TRUE@ source='sys/allegro/main.c' object='sys/allegro/sys_libhallm_a-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='sys/allegro/$(DEPDIR)/sys_libhallm_a-main.Po' tmpdepfile='sys/allegro/$(DEPDIR)/sys_libhallm_a-main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sys_libhallm_a_CFLAGS) $(CFLAGS) -c -o sys/allegro/sys_libhallm_a-main.obj `cygpath -w sys/allegro/main.c` sys/std/sys_libhsdlm_a-main.o: sys/std/main.c @AMDEP_TRUE@ source='sys/std/main.c' object='sys/std/sys_libhsdlm_a-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='sys/std/$(DEPDIR)/sys_libhsdlm_a-main.Po' tmpdepfile='sys/std/$(DEPDIR)/sys_libhsdlm_a-main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sys_libhsdlm_a_CFLAGS) $(CFLAGS) -c -o sys/std/sys_libhsdlm_a-main.o `test -f sys/std/main.c || echo '$(srcdir)/'`sys/std/main.c sys/std/sys_libhsdlm_a-main.obj: sys/std/main.c @AMDEP_TRUE@ source='sys/std/main.c' object='sys/std/sys_libhsdlm_a-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='sys/std/$(DEPDIR)/sys_libhsdlm_a-main.Po' tmpdepfile='sys/std/$(DEPDIR)/sys_libhsdlm_a-main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(sys_libhsdlm_a_CFLAGS) $(CFLAGS) -c -o sys/std/sys_libhsdlm_a-main.obj `cygpath -w sys/std/main.c` sys/std/main.o: sys/std/main.c @AMDEP_TRUE@ source='sys/std/main.c' object='sys/std/main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='sys/std/$(DEPDIR)/main.Po' tmpdepfile='sys/std/$(DEPDIR)/main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sys/std/main.o `test -f sys/std/main.c || echo '$(srcdir)/'`sys/std/main.c sys/std/main.obj: sys/std/main.c @AMDEP_TRUE@ source='sys/std/main.c' object='sys/std/main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='sys/std/$(DEPDIR)/main.Po' tmpdepfile='sys/std/$(DEPDIR)/main.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sys/std/main.obj `cygpath -w sys/std/main.c` parafmt_check-parafmt.o: parafmt.c @AMDEP_TRUE@ source='parafmt.c' object='parafmt_check-parafmt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/parafmt_check-parafmt.Po' tmpdepfile='$(DEPDIR)/parafmt_check-parafmt.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parafmt_check_CFLAGS) $(CFLAGS) -c -o parafmt_check-parafmt.o `test -f parafmt.c || echo '$(srcdir)/'`parafmt.c parafmt_check-parafmt.obj: parafmt.c @AMDEP_TRUE@ source='parafmt.c' object='parafmt_check-parafmt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/parafmt_check-parafmt.Po' tmpdepfile='$(DEPDIR)/parafmt_check-parafmt.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(parafmt_check_CFLAGS) $(CFLAGS) -c -o parafmt_check-parafmt.obj `cygpath -w parafmt.c` CCDEPMODE = @CCDEPMODE@ uninstall-info-am: heroesrcDATA_INSTALL = $(INSTALL_DATA) install-heroesrcDATA: $(heroesrc_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(heroesrcdir) @list='$(heroesrc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(heroesrcDATA_INSTALL) $$d$$p $(DESTDIR)$(heroesrcdir)/$$f"; \ $(heroesrcDATA_INSTALL) $$d$$p $(DESTDIR)$(heroesrcdir)/$$f; \ done uninstall-heroesrcDATA: @$(NORMAL_UNINSTALL) @list='$(heroesrc_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(heroesrcdir)/$$f"; \ rm -f $(DESTDIR)$(heroesrcdir)/$$f; \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ 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; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/etc $(distdir)/lvl $(distdir)/media $(distdir)/sys @for file in $(DISTFILES); do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir)$$dir \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(heroesrcdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) 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)$(MAINTAINERCLEANFILES)" || rm -f $(BUILT_SOURCES) $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-noinstLIBRARIES \ mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-heroesrcDATA install-exec-am: install-binPROGRAMS install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic uninstall-am: uninstall-binPROGRAMS uninstall-heroesrcDATA \ uninstall-info-am .PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-noinstLIBRARIES distclean distclean-compile \ distclean-depend distclean-generic distclean-tags distdir dvi \ dvi-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-exec install-exec-am \ install-heroesrcDATA install-info install-info-am install-man \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic tags uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-heroesrcDATA \ uninstall-info-am @HAVE_GPERF_TRUE@rsc_files_hash.c: rsc_files.gperf @HAVE_GPERF_TRUE@ gperf -t -L ANSI-C -G -N in_rsc_set -W rsc_set \ @HAVE_GPERF_TRUE@ -k 1,3,7,$$ $(srcdir)/rsc_files.gperf | \ @HAVE_GPERF_TRUE@ sed -e 's/{""}/{"",0,0,0,false}/g' > rsc_files_hash.c @HAVE_GPERF_TRUE@debughash.c: debughash.gperf @HAVE_GPERF_TRUE@ gperf -t -L ANSI-C -G -N in_channel_set -W channel_set \ @HAVE_GPERF_TRUE@ -k 1,3,$$ $(srcdir)/debughash.gperf | \ @HAVE_GPERF_TRUE@ sed -e 's/{""}/{"",0,0}/g' > debughash.c debughash.gperf: debugchn.def debugchn.tpl $(AUTOGEN) -o 'gperf=debughash.gperf' debugchn.def debugchn.h: debugchn.def debugchn.tpl $(AUTOGEN) -o h debugchn.def prefs.h: prefs.def prefs.tpl $(AUTOGEN) -o h prefs.def prefs.c: prefs.def prefs.tpl $(AUTOGEN) -o c prefs.def people.c: people.def people.tpl $(AUTOGEN) -o c people.def media/ggi/keysdef.c: media/ggi/.dirstamp if test "x$(GGI_KEYBOARD_H)" = x; then \ touch $@ ; \ else \ < $(GGI_KEYBOARD_H) $(AWK) ' \ BEGIN { print "/* Do not edit!\n" \ " This file was generated by src/Makefile\n" \ " from @GGI_KEYBOARD_H@ */\n" \ "#include \"system.h\"\n" \ "#include \n" \ "#include \"keysdef.h\"\n" \ "const struct keynames_s keynames[] = {" } \ $$2 ~ /(GIIK_|GIIUC_)/ { \ print "\t{ \""toupper(substr($$2,index($$2,"_")+1))"\",", $$2,"}," } \ END { print "\t{ 0, 0 }};\n" }' > $@ ; \ fi media/sdl/keysdef.c: media/sdl/.dirstamp if test "x$(SDL_KEYSYM_H)" = x; then \ touch $@ ; \ else \ < $(SDL_KEYSYM_H) $(AWK) ' \ BEGIN { print "/* Do not edit!\n" \ " This file was generated by src/Makefile\n" \ " from @SDL_KEYSYM_H@ */\n" \ "#include \"system.h\"\n" \ "#include \n" \ "#include \"keysdef.h\"\n" \ "const struct keynames_s keynames[] = {" } \ $$1 ~ /SDLK_/ { \ print "\t{ \""toupper(substr($$1,index($$1,"_")+1))"\",", $$1,"}," } \ END { print "\t{ 0, 0 }};\n" }' > $@ ; \ fi media/allegro/keysdef.c: media/allegro/.dirstamp if test "x$(ALLEGRO_H)" = x; then \ touch $@ ; \ else \ < $(ALLEGRO_H) $(AWK) ' \ BEGIN { print "/* Do not edit!\n" \ " This file was generated by src/Makefile\n" \ " from @ALLEGRO_H@ */\n" \ "#include \"system.h\"\n" \ "#include \n" \ "#include \"keysdef.h\"\n" \ "const struct keynames_s keynames[] = {" } \ $$2 ~ /KEY_/ { \ print "\t{ \""toupper(substr($$2,index($$2,"_")+1))"\",", $$2,"}," } \ END { print "\t{ 0, 0 }};\n" }' > $@ ; \ fi # 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: heroes-0.21/src/argv.c0000644004117000411500000002714307417110563010305 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "const.h" #include "argv.h" #include "strack.h" #include "video.h" #include "misc.h" #include "debugmsg.h" #include "errors.h" #include "rsc_files_hash.h" #include "debughash.h" #include "musicfiles.h" #include "vars.h" int cpuon = 1; bool nosfx = false; bool joyoff = false; int devparm = 0; bool loadulevel = false; bool directmenu = false; int reinitsco = 0; int reinitopt = 0; int reinitsav = 0; int x10sav = 0; int doublefx = 1; bool swapside = true; char* level_name; bool mono = false; bool bits8 = false; bool hqmix = false; int stretch = 1; bool nosound = false; bool even_lines = false; bool showprefs = false; bool showlevels = false; a_check check_what = check_nothing; static void version (void) { puts ("Heroes " VERSION "\n"); printf (_("Copyright (C) %d " "Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux and Philippe Meisburger.\n"), 2002); puts (_("This is free software; see the source for copying conditions. " "There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS" " FOR A PARTICULAR PURPOSE.")); } /* Return true if the game can exit on return, or false if some action has been postponed. */ static bool list (char *word) { if (!word) { puts (_("Use `-lWORD' or `--list=WORD' where WORD can be:")); printf (" debug %s\n", _("display all debugging channels")); printf (" levels %s\n", _("list all level files")); printf (" preferences %s\n", _("print the preferences settings")); printf (" resources %s\n", _("print the resources list")); printf (" sound-drivers %s\n", _("print the sound driver list")); printf (" sound-tracks %s\n", _("print the sound track list")); return true; } if (!strcasecmp (word,"resources") || !strcasecmp (word,"rsc")) { print_rsc_files (); } else if (!strcasecmp (word,"levels") || !strcasecmp (word,"lvl")) { showlevels = true; return false; } else if (!strcasecmp (word,"sound-drivers") || !strcasecmp (word,"sd")) { print_drivers_list (); } else if (!strcasecmp (word,"debug") || !strcasecmp (word,"channels")) { print_debug_channels (); } else if (!strcasecmp (word,"sound-tracks") || !strcasecmp (word,"st")) { print_sound_track_list (); } else if (!strcasecmp (word,"preferences") || !strcasecmp (word,"prefs")) { showprefs = true; return false; } else if (!strcasecmp (word,"sound-tracks-stat") || /* undocumented */ !strcasecmp (word,"sts")) { print_sound_track_list_stat (); } else if (!strcasecmp (word,"variables") || /* undocumented yet */ !strcasecmp (word,"vars")) { var_print_all (); } else { /* Unknown WORD, print usage. */ list (0); } return true; } static bool check (char *word) { if (!word) { puts ("Use `--check=WORD' where WORD can be:"); puts ("intro run the intro"); puts ("demo run a demo"); return true; } if (!strcasecmp (word, "intro")) check_what = check_intro; else if (!strcasecmp (word, "demo")) check_what = check_demo; else /* Unknown WORD, print usage. */ return check (0); return false; } static void ATTRIBUTE_NORETURN print_help (int status) { if (status) { fprintf (stderr, _("Try '%s --help' for more information.\n"), program_name); exit (status); } printf (_("Usage: %s [OPTIONS]...\n\n"), program_name); puts (_("\ Heroes is a game similar to the \"Tron\" and \"Nibbles\" games of yore\n\ but includes many graphical improvements and new game features.\n")); puts (_("\ Mandatory arguments to long options are mandatory for short options too.\n")); puts (_("\ General options:\n\ -v, --version display version number\n\ -h, --help display this help\n\ -q, --quiet don't print warning messages\n\ -Q, --really-quiet don't even print error messages\n\ -v, --verbose=CHANNELS enable or disable debugging channels\n\ (see --list=debug for available channels)\n\ -l, --list=WORD show some internal information; WORD can be\n\ 'debug', 'resources', 'sound-drivers' or\n\ 'sound-tracks'\n")); puts (_("\ Sound options:\n\ -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:autodetect)\n\ (see --list=sound-drivers for available Ns)\n\ -S, --no-sound disable sound\n\ -X, --no-sfx disable sound-effects\n\ -m, --mono non-stereo output\n\ -8, --8bits 8bits sound output\n\ -i, --high-quality high quality mixer\n")); puts (_("\ Display options:\n\ -G, --gfx-options=OPTIONS pass OPTIONS to the display driver\n\ -F, --full-screen full screen mode\n\ -2, --double stretch the display twofold\n\ -3, --triple stretch the display threefold\n\ -4, --quadruple stretch the display fourfold\n\ -e, --even-lines display only even-lines\n")); /* TRANS: rotozoom is a graphical effect used in the demo of yore where the screen rotate and zoom (actually it doesn't zoom in Heroes); waves is another effect where the screen is agitated like some jelly (this was also called the `mushroom effect' in game like Death Rally). */ puts (_("\ Miscellaneous options:\n\ --cpu-off disable computer opponents\n\ --default-scores restore default scores file\n\ --default-options restore default options file\n\ --default-saves restore default saves file\n\ -s, --swap-sides swap sides in two player mode\n\ --no-double-fx disable combination of rotozoom and waves\n\ -g, --go skip the introduction\n\ -J, --no-joystick disable joystick handling\n")); puts (_("\ These options can be set in your file ~/.heroes/heroesrc (which is read\n\ before parsing other command line options) using a line like the following:\n\ \n\ Options: -gs -d3,buffer=11,count=4\n")); puts (_("\ Visit http://heroes.sourceforge.net/ for news, documentation, and updates.")); puts (_("Report bugs to .")); exit (status); } const struct option long_options[] = { {"8bits", no_argument, NULL, '8'}, {"check", required_argument, NULL, 1000}, {"cpu-off", no_argument, &cpuon, 0}, {"default-options", no_argument, &reinitopt, 1}, {"default-saves", no_argument, &reinitsav, 1}, {"default-scores", no_argument, &reinitsco, 1}, {"devparm", no_argument, &devparm, 1}, {"double", no_argument, NULL, '2'}, {"driver", required_argument, NULL, 'd'}, {"drivers-info", no_argument, NULL, 'n'}, {"even-lines", no_argument, NULL, 'e'}, {"full-screen", no_argument, NULL, 'F'}, {"gfx-options", required_argument, NULL, 'G'}, {"go", no_argument, NULL, 'g'}, {"help", no_argument, NULL, 'h'}, {"high-quality", no_argument, NULL, 'i'}, {"list", optional_argument, NULL, 'l'}, {"load", required_argument, NULL, 'L'}, {"mono", no_argument, NULL, 'm'}, {"no-double-fx", no_argument, &doublefx, 0}, {"no-joystick", no_argument, NULL, 'J'}, {"no-sfx", no_argument, NULL, 'X'}, {"no-sound", no_argument, NULL, 'S'}, {"quadruple", no_argument, NULL, '4'}, {"quiet", no_argument, NULL, 'q'}, {"really-quiet", no_argument, NULL, 'Q'}, {"swap-sides", no_argument, NULL, 's'}, {"triple", no_argument, NULL, '3'}, {"verbose", required_argument, NULL, 'v'}, {"version", no_argument, NULL, 'v'}, {"x10-saves", no_argument, &x10sav, 1}, {NULL, 0, NULL, 0} }; int parse_argv (int argc, char **argv, const char *from_file, int from_line) { int c; if (from_file) { /* Build a fake argv[0], so that the error message from getopt looks nice */ char* pname; XMALLOC_ARRAY (pname, (strlen (from_file) + strlen (program_name) + strlen (": :999999") + 1)); sprintf (pname, "%s: %s:%d", program_name, from_file, from_line); argv[0] = pname; } /* Reset optind so that getopt is reinitialized. */ optind = 0; for (;;) { int option_index = 0; c = getopt_long (argc, argv, "2348d:eFgG:hiJl::L:mnqQsSv::X", long_options, &option_index); /* Detect the end of the options. */ if (c == -1) break; switch (c) { case 'v': if (!optarg) { version (); return -1; } else { dmsg_parse_string (optarg); break; } case 'h': print_help (0); case 's': swapside = false; break; case 'm': mono = true; break; case '8': bits8 = true; break; case 'a': hqmix = true; break; case 'X': nosfx = true; break; case 'l': if (list (optarg)) return -1; break; case 'L': level_name = xstrdup (optarg); level_name = strappend (level_name, ".lvl"); loadulevel = true; break; case 'g': directmenu = true; break; case 'n': wmsg (_("-n is an obsolete option, " "you should use --list=sound-drivers")); print_drivers_list (); return -1; case 'd': decode_sound_options (optarg, from_file ? from_file : argv[0]); break; case 'G': set_display_params (optarg); break; case 'F': set_full_screen_mode (); break; case 'J': joyoff = true; break; case '2': stretch = 2; break; case '3': stretch = 3; break; case '4': stretch = 4; break; case 'e': even_lines = true; break; case 'i': hqmix = true; break; case 'S': nosound = true; break; case '?': /* getopt_long already printed an error message. */ print_help (1); case 0: break; case 'Q': disable_emsg = true; /* no break: 'Q' imply 'q' */ case 'q': disable_wmsg = true; break; case 1000: /* --check */ if (check (optarg)) return -1; break; default: abort (); } } if (from_file) free (argv[0]); return 0; } heroes-0.21/src/argv.h0000644004117000411500000000427407376026352010320 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__ARGV__H #define HEROES__ARGV__H /* If the option are beeing read from a file, set from_file to the filename so the error message can show it. Otherwise set from_file to 0.*/ int parse_argv (int argc, char **argv, const char *from_file, int from_line); extern int cpuon; extern bool nosfx; extern bool joyoff; extern int devparm; extern bool loadulevel; extern bool directmenu; extern int reinitsco; extern int reinitopt; extern int reinitsav; extern int x10sav; extern int doublefx; extern bool swapside; extern char* level_name; extern bool mono; extern bool bits8; extern bool hqmix; extern int stretch; extern bool nosound; extern bool even_lines; extern bool showprefs; extern bool showlevels; enum a_check { check_nothing, check_intro, check_demo }; typedef enum a_check a_check; extern a_check check_what; #endif /* HEROES__ARGV__H */ heroes-0.21/src/bonus.c0000644004117000411500000002556407352614752010510 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "bonus.h" #include "renderdata.h" #include "const.h" #include "heroes.h" #include "sfx.h" #include "argv.h" #include "debugmsg.h" #include "sprrle.h" #include "sprtext.h" /* density of bonuses in different modes */ /* L+ L- S+ S- R# C ZZ !! -1 T+ T- EL [] X XL ~~ $$ */ const int bonus_density[5][17] = { {40, 10, 12, 8, 8, 40, 6, 8, 10, 16, 16, 0, 8, 7, 4, 7, 0}, /* quest */ { 0, 0, 10, 7, 7, 20, 12, 8, 10, 10, 11, 0, 6, 7, 2, 7, 0}, /* deathm */ {25, 10, 12, 8, 8, 40, 6, 8, 10, 16, 16, 0, 8, 7, 4, 7, 0}, /* killem */ {25, 10, 12, 8, 8, 20, 6, 8, 10, 16, 16, 0, 8, 7, 4, 7, 25}, /* tcash */ {25, 10, 12, 8, 8, 30, 6, 8, 10, 16, 16, 0, 8, 7, 4, 7, 0} /* color */ }; /* interest of each bonus, for the CPU controled vehicles */ int bonus_points[2][17] = { {20, -15, 15, -10, 5, 18, 19, -10, 0, 0, -5, 50, 5, 0, 8, 0, 25}, /* orchid */ {-15, 10, 0, 10, 5, -5, 0, 8, 8, -5, 5, -20, -5, 9, -10, 9, -25} /* peach */ }; static int bonus_proba[17]; /* FIXME: What's the english for "fonction de r\'epartition"? */ static int bonus_proba_sum = 0; static a_pcx_image bonus_a_img, bonus_b_img; #define N_BONUSES 16 #define N_BONUS_FRAMES 13 a_sprite *bonus_rle[2][N_BONUSES][N_BONUS_FRAMES]; unsigned char *tile_bonus; unsigned char *tile_bonus_cpu; int *bonus_time; int *bonus_list; static int bonus_total_nbr, bonus_real_nbr; static int next_bonus_to_update; a_timer bonus_anim_htimer; int bonus_anim_offset; static a_sprite *txt_bonus[4] = { 0, 0, 0, 0 }; int txt_bonus_tempo[4]; void init_bonuses (void) { int bonus; int frame; bonus_anim_htimer = new_htimer (T_GLOBAL, HZ (35)); pcx_load_from_rsc ("purple-bonus-img", &bonus_a_img); pcx_load_from_rsc ("brown-bonus-img", &bonus_b_img); pcx_load_from_rsc ("bonus-font", &bonus_font_img); for (bonus = 0; bonus < N_BONUSES; ++bonus) for (frame = 0; frame < N_BONUS_FRAMES; ++frame) bonus_rle[0][bonus][frame] = compile_sprrle (IMGPOS (bonus_a_img, bonus * 20, frame * 24), 0, 20, 24, bonus_a_img.width, xbuf); for (bonus = 0; bonus < N_BONUSES; ++bonus) for (frame = 0; frame < N_BONUS_FRAMES; ++frame) bonus_rle[1][bonus][frame] = compile_sprrle (IMGPOS (bonus_b_img, bonus * 20, frame * 24), 0, 20, 24, bonus_b_img.width, xbuf); img_free (&bonus_b_img); img_free (&bonus_a_img); } void uninit_bonuses (void) { int bonus; int frame; img_free (&bonus_font_img); free_htimer (bonus_anim_htimer); for (bonus = 0; bonus < N_BONUSES; ++bonus) for (frame = 0; frame < N_BONUS_FRAMES; ++frame) { free_sprite (bonus_rle[0][bonus][frame]); free_sprite (bonus_rle[1][bonus][frame]); } } static unsigned char random_bonus (void) { int t; unsigned char b; b = 0; t = (rand () % bonus_proba_sum) + 1; while (t > bonus_proba[b]) b++; return (b); } void add_bonus (int pos_in_list, unsigned char what) { int pos; do pos = rand () % lvl.tile_count; while (tile_bonus[pos] != 0); tile_bonus[pos] = what; bonus_list[pos_in_list] = pos; bonus_time[pos_in_list] = event_time + (rand () % 511) - 256; dmsg (D_BONUS, "Add bonus: type=%u, pos=%u, pos_in_list=%u", what, pos, pos_in_list); --what; /* update foreground data for rendering */ if (what == 16) fg_data[pos].big_dollar = 1; else { if (what & 128) fg_data[pos].bonus = bonus_rle[1][what & 127]; else fg_data[pos].bonus = bonus_rle[0][what]; } } void add_random_bonus (int pos_in_list) { unsigned char what; what = random_bonus (); if (what != 16) /* yellow `$$' bonuses do not exist */ if (!(rand () & 3)) what |= 128; add_bonus (pos_in_list, what + 1); } void rem_bonus (int pos) { int i = bonus_real_nbr; dmsg (D_BONUS, "Remove bonus: pos = %d", pos); /* find the bonus position in the list of bonuses */ do i--; while (bonus_list[i] != pos); /* remove the bonus */ tile_bonus[pos] = 0; /* don't draw it anymore */ fg_data[pos].bonus = 0; fg_data[pos].big_dollar = 0; /* add a new bonus, at the same position in the list */ add_random_bonus (i); } static void reset_bonus_mode (int mode) { int i; bonus_proba_sum = 0; for (i = 0; i < 17; i++) bonus_proba_sum = bonus_proba[i] = bonus_density[mode][i] + bonus_proba_sum; } static void mark_unreachable_places (void) { a_tile_index i; for (i = 0; i < lvl.tile_count; ++i) { a_square_index s = TILE_INDEX_TO_SQR_INDEX (&lvl, i); /* if the place can't be reached, or is a corridor, don't put a bonus */ if ((lvl_tile_type (&lvl, i) == T_OUTWAY) || (lvl.square_walls_out[SQR0 (&lvl, s)] & (DM_DOWN | DM_RIGHT)) || (lvl.square_walls_out[SQR1 (&lvl, s)] & (DM_DOWN | DM_LEFT)) || (lvl.square_walls_out[SQR2 (&lvl, s)] & (DM_UP | DM_RIGHT)) || (lvl.square_walls_out[SQR3 (&lvl, s)] & (DM_UP | DM_LEFT))) tile_bonus[i] = 0xff; } } int init_bonuses_level (void) { uninit_bonuses_level (); /* just in case */ dmsg (D_BONUS, "Initialize bonuses for level."); reset_bonus_mode (game_mode); XCALLOC_ARRAY (tile_bonus, lvl.tile_count); XCALLOC_ARRAY (tile_bonus_cpu, lvl.tile_count); bonus_total_nbr = (lvl.tile_count / 90) + 3; bonus_real_nbr = bonus_total_nbr - 2; next_bonus_to_update = 0; dmsg (D_BONUS, "bonus_total_nbr=%d, bonus_real_nbr=%d", bonus_total_nbr, bonus_real_nbr); XMALLOC_ARRAY (bonus_time, bonus_total_nbr); XMALLOC_ARRAY (bonus_list, bonus_total_nbr); mark_unreachable_places (); txt_bonus_tempo[0] = 0; txt_bonus_tempo[1] = 0; txt_bonus_tempo[2] = 0; txt_bonus_tempo[3] = 0; return 0; } void uninit_bonuses_level (void) { dmsg (D_BONUS, "Uninitialize bonuses for level."); XFREE0 (tile_bonus); XFREE0 (tile_bonus_cpu); XFREE0 (bonus_time); XFREE0 (bonus_list); } void spread_bonuses (void) { int i; dmsg (D_BONUS, "Spread bonuses over level."); for (i = bonus_real_nbr - 1; i >= 0; i--) add_random_bonus (i); } void set_txt_bonus (int pl, const char *txt, int tempo) { FREE_SPRITE0 (txt_bonus[pl]); txt_bonus[pl] = compile_bonus_text (txt, T_FLUSHED_LEFT | T_WAVING, 0, 0); txt_bonus_tempo[pl] = tempo; } void show_txt_bonus (int pl, a_pixel *dest) { if (txt_bonus_tempo[pl] > 0) DRAW_SPRITE (txt_bonus[pl], dest); } void add_end_level_bonuses (void) { if (bonus_real_nbr != bonus_total_nbr) { int i; dmsg (D_BONUS, "Add end-level bonuses."); add_bonus (bonus_real_nbr++, 12); add_bonus (bonus_real_nbr++, 12 + 128); for (i = 11; i < 17; i++) bonus_proba[i] += 16; bonus_proba_sum += 16; } } void apply_bonus (int pl, char bonus) { static char txt_tmp[20]; dmsg (D_BONUS, "Player %u got bonus %u.", pl, bonus); if (bonus == 5) { bonus = random_bonus () + 1; if (bonus == 5) bonus++; } if (player[pl].cpu == 2) event_sfx (19 + bonus); switch (bonus) { case 1: grow_trail (pl, 5); sprintf (txt_tmp, _("SIZE IS %d"), (trail_size[pl] + 1) / 5 - 1); set_txt_bonus (pl, txt_tmp, 150); break; case 2: shrink_trail (pl, 5); sprintf (txt_tmp, _("SIZE IS %d"), (trail_size[pl] + 1) / 5 - 1); set_txt_bonus (pl, txt_tmp, 150); break; case 3: player[pl].speedup = 500; set_txt_bonus (pl, _("SPEEDED UP"), 150); break; case 4: player[pl].speedup = -500; set_txt_bonus (pl, _("SPEEDED DOWN"), 150); break; case 6: { int i; i = rand () & 255; player[pl].score += i; sprintf (txt_tmp, _("GET %dPTS"), i); set_txt_bonus (pl, txt_tmp, 150); } break; case 7: set_txt_bonus (pl, _("FIRE TRAIL!"), 150); player[pl].fire_trail += 2000; break; case 8: player[pl].notify_delay = 1; break; case 9: player[pl].inversed_controls = 500; break; case 10: if (player[pl].turbo_level > 1024 - 512) player[pl].turbo_level = 1024; else player[pl].turbo_level += 512; set_txt_bonus (pl, _("GET TURBO+"), 150); break; case 11: if (player[pl].turbo_level > 256) player[pl].turbo_level -= 256; else player[pl].turbo_level = 0; set_txt_bonus (pl, _("GET TURBO-"), 150); break; case 12: if (trail_size[pl] >= 55) level_is_finished = (char) (pl + 1); break; case 13: player[pl].invincible = 350; set_txt_bonus (pl, _("INVINCIBLE!"), 150); break; case 14: if (player[pl].waves == 0 || doublefx != 0) { player[pl].rotozoom += 1024; if (player[pl].rotozoom == 0) player[pl].rotozoom_direction = rand () & 1; } break; case 15: if (player[pl].lifes < 100) { player[pl].lifes++; set_txt_bonus (pl, _("EXTRA-LIFE!"), 150); } break; case 16: if (player[pl].rotozoom == 0 || doublefx != 0) player[pl].waves += 1024; break; case 17: player[pl].cash += 10; player[pl].score += 50; break; default: assert (0 /* unknown bonus! */ ); break; } } void update_player_bonus_vars (int pl) { if (txt_bonus_tempo[pl] > 0) txt_bonus_tempo[pl]--; } /* only one bonus is updated at each frame (there is no hurry) */ void update_bonuses (void) { if (bonus_time[next_bonus_to_update] + 25 * 70 <= event_time) { int bonus_pos = bonus_list[next_bonus_to_update]; dmsg (D_BONUS, "Expired bonus: pos=%u, pos_in_list=%u", bonus_pos, next_bonus_to_update); /* erase the bonus */ tile_bonus[bonus_pos] = 0; /* don't draw it anymore */ fg_data[bonus_pos].bonus = 0; fg_data[bonus_pos].big_dollar = 0; /* add a new bonus, at the same position in the list */ add_random_bonus (next_bonus_to_update); } next_bonus_to_update++; if (next_bonus_to_update >= bonus_real_nbr) next_bonus_to_update = 0; } heroes-0.21/src/bonus.h0000644004117000411500000000466007352614752010507 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__BONUS__H #define HEROES__BONUS__H #include "pcx.h" #include "timer.h" extern int bonus_points[2][17]; /* interest of bonuses, for CPU controled vehicles */ extern a_timer bonus_anim_htimer; extern int bonus_anim_offset; extern unsigned char *tile_bonus; extern unsigned char *tile_bonus_cpu; extern int *bonus_time; extern int *bonus_list; extern int txt_bonus_tempo[4]; extern void add_bonus (int pos_in_list, unsigned char what); extern void add_random_bonus (int pos_in_list); extern void rem_bonus (int pos); /* globaly initialize bonuses */ extern void init_bonuses (void); extern void uninit_bonuses (void); /* reset and allocate bonus data for a given level */ extern int init_bonuses_level (void); extern void uninit_bonuses_level (void); extern void spread_bonuses (void); extern void set_txt_bonus (int pl, const char *txt, int tempo); extern void show_txt_bonus (int pl, a_pixel *dest); extern void add_end_level_bonuses (void); extern void apply_bonus (int pl, char bonus); extern void update_player_bonus_vars (int pl); extern void update_bonuses (void); #endif heroes-0.21/src/bytesex.h0000644004117000411500000000537007352614752011043 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__BYTESEX__H #define HEROES__BYTESEX__H #ifdef WORDS_BIGENDIAN /* the files are stored in little endian, conversion routines needs only to exist when the host works in BIGENDIAN */ #ifdef linux #include #define BSWAP16(x) __arch__swab16(x) #define BSWAP32(x) __arch__swab32(x) #else /* ! linux */ static __inline__ unsigned short int BSWAP16(unsigned short int x) { return (x<<8) | (x>>8); } static __inline__ unsigned long int BSWAP32(unsigned long int x) { return (x<<24) | ((x<<8) & 0x00ff0000) | ((x>>8) & 0x0000ff00) | (x>>24); } #endif /* ! linux */ /* unaligned access: these only work if p is (unsigned char *) */ #define GETWORD(p) ((p)[0] << 24 | (p)[1] << 16 | (p)[2] << 8 | (p)[3]) #define SETWORD(p, x) ((p)[0] = (x) >> 24, (p)[1] = (x) >> 16, \ (p)[2] = (x) >> 8, (p)[3] = (x)) #define GETHALFWORD(p) ((p)[0] << 8 | (p)[1]) #define SETHALFWORD(p, x) ((p)[0] = (x) >> 8, (p)[1] = (x)) #else /* ! BIGENDIAN */ #define BSWAP16(x) (x) #define BSWAP32(x) (x) /* unaligned access: these only work if p is (unsigned char *) */ #define GETWORD(p) ((p)[0] | (p)[1] << 8 | (p)[2] << 16 | (p)[3] << 24) #define SETWORD(p, x) ((p)[0] = (x), (p)[1] = (x) >> 8, \ (p)[2] = (x) >> 16, (p)[3] = (x) >> 24) #define GETHALFWORD(p) ((p)[0] | (p)[1] << 8) #define SETHALFWORD(p, x) ((p)[0] = (x), (p)[1] = (x) >> 8) #endif /* ! BIGENDIAN */ #endif /* HEROES__BYTESEX__H */ heroes-0.21/src/camera.c0000644004117000411500000001616607406456551010611 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "camera.h" #include "const.h" #include "prefs.h" static int camera_x[2], camera_y[2]; /* Position of the cameras. */ static int inert_x[2], inert_y[2]; /* Old positions of the cameras, used for intertia. */ unsigned int corner_x[2]; unsigned int corner_y[2]; a_pixel *(corner[2]); unsigned int corner_dx[2]; unsigned int corner_dy[2]; unsigned int nbr_tiles_cols = 15; /* # of tiles columns to display */ unsigned int nbr_tiles_rows = 11; /* ... rows ... */ void compute_corner (int p, int n) { a_s32 x, y; a_s32 camera_width; a_s32 camera_height; a_s32 camera_center_x; a_s32 camera_center_y; a_s32 tw = (a_s32)(lvl.tile_width << 16); a_s32 th = (a_s32)(lvl.tile_height << 16); if (opt.inertia) { /* when the framerate is too low, don't do inerta */ if (n > 16) n = 16; /* inert_x[p] is the actual position of the camera, camera_x[p] is the target position of the camera. The plan is to move the camera from inert_x to camera_x, but only one 16th of the distance per frame. When the level is NOT wrapped, this is easy to do: */ if (lvl.tile_width_wrap == DONT_WRAP) inert_x[p] = camera_x[p] = inert_x[p] + n * (camera_x[p] - inert_x[p]) / 16; else { /* When the level is wrapped, this is harder, because there is two way to go from inert_x[p] to camera_x[p]. */ a_s32 d1, d2, d3; d1 = camera_x[p] - inert_x[p]; d3 = abs (d1); d2 = tw - d3; if (d3 <= d2) inert_x[p] = camera_x[p] = inert_x[p] + n * d1 / 16; else if (d1 <= 0) inert_x[p] = camera_x[p] = inert_x[p] + n * d2 / 16 - tw; else inert_x[p] = camera_x[p] = inert_x[p] - n * d2 / 16 + tw; } /* Likewise for the Y-axis. */ if (lvl.tile_height_wrap == DONT_WRAP) inert_y[p] = camera_y[p] = inert_y[p] + n * (camera_y[p] - inert_y[p]) / 16; else { a_s32 d1, d2, d3; d1 = camera_y[p] - inert_y[p]; d3 = abs (d1); d2 = th - d3; if (d3 <= d2) inert_y[p] = camera_y[p] = inert_y[p] + n * d1 / 16; else if (d1 <= 0) inert_y[p] = camera_y[p] = inert_y[p] + n * d2 / 16 - th; else inert_y[p] = camera_y[p] = inert_y[p] - n * d2 / 16 + th; } } /* The vehicle take one square and we want to center the camera on this square. Hence advance by half a square on both directions. */ camera_x[p] += (1 << 14); camera_y[p] += (1 << 14); /* Now the top left corner can be computed from the camera position by moving half of the screen size. Note that in two players mode, the screen is split vertically, hence we only account for half of the width. */ if (two_players && !in_menu) camera_width = (320 << 16) / 24 / 2; else camera_width = (320 << 16) / 24; camera_height = (200 << 16) / 20; camera_center_x = camera_width / 2; camera_center_y = camera_height / 2; x = camera_x[p] - camera_center_x; y = camera_y[p] - camera_center_y; /* If the level is not wrapped, make sure the camera doesn't show something off the edge of the level. */ if (lvl.tile_width_wrap == DONT_WRAP) { if (x < 0) { x = 0; } else if (x + camera_width > tw) { x = tw - camera_width; } } if (lvl.tile_height_wrap == DONT_WRAP) { if (y < 0) { y = 0; } else if (y + camera_height > th) { y = th - camera_height; } } /* Compute the top left tile to start drawing with. */ corner_dx[p] = (x >> 16) & lvl.tile_width_wrap; corner_dy[p] = (y >> 16) & lvl.tile_height_wrap; /* Compute the offset of the top left pixel of the screen in this tile. */ corner_x[p] = ((x & 0xffff) * 24) >> 16; corner_y[p] = ((y & 0xffff) * 20) >> 16; /* corner[p] is now a pointer to the pixel in the render_buffer which will be draw on the top left of the screen. */ corner[p] = render_buffer[p] + sbuf + corner_y[p] * xbuf + corner_x[p]; } void position_camera (void) { int p; if (player[col2plr[0]].spec == t_tunnel && opt.inertia) { p = lvl.square_move[player[col2plr[0]].way][player[col2plr[0]].pos]; camera_x[0] = square_coord[p].x << 15; camera_y[0] = square_coord[p].y << 15; } else { camera_x[0] = player[col2plr[0]].x2 << 15; camera_y[0] = player[col2plr[0]].y2 << 15; } if (player[col2plr[0]].way == w_left) camera_x[0] -= player[col2plr[0]].d.e >> 1; if (player[col2plr[0]].way == w_up) camera_y[0] -= player[col2plr[0]].d.e >> 1; if (player[col2plr[0]].way == w_right) camera_x[0] += player[col2plr[0]].d.e >> 1; if (player[col2plr[0]].way == w_down) camera_y[0] += player[col2plr[0]].d.e >> 1; if (two_players) { if (player[col2plr[1]].spec == t_tunnel) { p = lvl.square_move[player[col2plr[1]].way][player[col2plr[1]].pos]; camera_x[1] = square_coord[p].x << 15; camera_y[1] = square_coord[p].y << 15; } else { camera_x[1] = player[col2plr[1]].x2 << 15; camera_y[1] = player[col2plr[1]].y2 << 15; } if (player[col2plr[1]].way == w_left) camera_x[1] -= player[col2plr[1]].d.e >> 1; if (player[col2plr[1]].way == w_up) camera_y[1] -= player[col2plr[1]].d.e >> 1; if (player[col2plr[1]].way == w_right) camera_x[1] += player[col2plr[1]].d.e >> 1; if (player[col2plr[1]].way == w_down) camera_y[1] += player[col2plr[1]].d.e >> 1; } } void init_camera (void) { inert_x[0] = camera_x[0] = player[col2plr[0]].x2 << 15; inert_y[0] = camera_y[0] = player[col2plr[0]].y2 << 15; inert_x[1] = camera_x[1] = player[col2plr[1]].x2 << 15; inert_y[1] = camera_y[1] = player[col2plr[1]].y2 << 15; } void lisajou_camera (int pos) { camera_x[0] = 65536 * 24 * cos (pos / 111.0); camera_y[0] = 65536 * 24 * sin (pos / 175.0); camera_x[0] &= (lvl.tile_width_wrap << 16) | (0xffff); camera_y[0] &= (lvl.tile_height_wrap << 16) | (0xffff); inert_x[0] = camera_x[0]; inert_y[0] = camera_y[0]; } heroes-0.21/src/camera.h0000644004117000411500000000452307352614752010607 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__CAMERA__H #define HEROES__CAMERA__H #include "video.h" extern unsigned int corner_x[2]; /* in pixels */ extern unsigned int corner_y[2]; /* idem */ extern a_pixel *(corner[2]); /* topleft of the camera vision */ extern unsigned int corner_dx[2]; /* coordinate of the first tile */ extern unsigned int corner_dy[2]; /* idem */ extern unsigned int nbr_tiles_cols; /* # of tiles columns to display */ extern unsigned int nbr_tiles_rows; /* ... rows ... */ /* Update the position of camera for buffer P as if N frames had elapsed. This also update the corner* varibles, hence the name. */ void compute_corner (int p, int n); /* Compute the (target) position of all cameras according to the positions of players. */ void position_camera (void); /* Set initial camera position, on level startup. */ void init_camera (void); /* This handle the moving background of menu. The camera follow some stupid lisajou curve. Pos is the position on this curve. */ void lisajou_camera (int pos); #endif /* HEROES__CAMERA__H */ heroes-0.21/src/const.c0000644004117000411500000001101607376026352010472 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ /* Heroes constants */ #include "system.h" #include "keyb.h" #include "keyvalues.h" #include "joystick.h" #include "pcx.h" #include "sfx.h" #include "structs.h" #include "prefs.h" #include "video.h" #include "const.h" #include "timer.h" #include "heroes.h" #include "argv.h" /* available round numbers */ int rounds_nbr_values[16] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 50, 100 }; char in_menu = 1; char in_demo = 0; /* int error; */ char in_jokebox; char kbjoy[6] = { 0, 0, 0, 0, 0, 0 }; char kbjoyold[6] = { 0, 0, 0, 0, 0, 0 }; a_pixel *(render_buffer[2]); /* xbuf * ybuf */ a_pixel glenz[8][256]; /* glenz lines */ a_pcx_image main_font_img, vehicles_img; a_pcx_image bonus_font_img; a_pcx_image tile_set_img, font_deck_img; signed char minisinus[32]; bool two_players = false; a_player player[4]; int trail_pos[4][maxq]; a_dir8_pair trail_way[4][maxq]; int trail_offset[4]; char trail_size[4]; /* trail size, minus one */ /* mapping color <-> player */ int col2plr[4]; int plr2col[4]; a_level lvl; unsigned char *square_occupied; a_dir8_pair *square_way; a_tile_index *square_tile; a_square_corrd_pair *square_coord; signed char *square_object; a_lemming **square_lemmings_list; a_lemming **square_dead_lemmings_list; a_lemming lemmings_support[lemmings_total]; int objects_nbr; int game_mode = 0; a_gameid game_id; int lemmings_anim_offset; int lemmings_move_offset; char demo_ready = 0; char key_or_joy_ready (void) { int i; int ct = read_htimer (demo_trigger_htimer); if ((in_jokebox == 0)) { if (ct >= 30 || check_what == check_demo) demo_ready = 1; else demo_ready = 0; if (ct >= 60) { if (in_menu) event_sfx (118 + (rand () & 1)); reset_htimer (demo_trigger_htimer); } } if (key_ready ()) { reset_htimer (demo_trigger_htimer); return (1); } if ((joystick_detected & 1) && (opt.ctrl_one == 1 || opt.ctrl_two == 1)) { for (i = 0; i < 6; i++) kbjoyold[i] = kbjoy[i]; get_joystick_state (); kbjoy[0] = is_joystick_up (0); kbjoy[1] = is_joystick_right (0); kbjoy[2] = is_joystick_down (0); kbjoy[3] = is_joystick_left (0); kbjoy[4] = is_joystick_button_a (0); kbjoy[5] = is_joystick_button_b (0); if ((kbjoy[0] && !kbjoyold[0]) || (kbjoy[1] && !kbjoyold[1]) || (kbjoy[2] && !kbjoyold[2]) || (kbjoy[3] && !kbjoyold[3]) || (kbjoy[4] && !kbjoyold[4]) || (kbjoy[5] && !kbjoyold[5])) { reset_htimer (demo_trigger_htimer); return (1); } } return (0); } a_keycode get_key_or_joy (void) { if (key_ready ()) return (get_key ()); if (kbjoy[0] && !kbjoyold[0]) return (HK_Up); if (kbjoy[1] && !kbjoyold[1]) return (HK_Right); if (kbjoy[2] && !kbjoyold[2]) return (HK_Down); if (kbjoy[3] && !kbjoyold[3]) return (HK_Left); if (kbjoy[4] && !kbjoyold[4]) return (HK_Enter); if (kbjoy[5] && !kbjoyold[5]) return (HK_Escape); printf ("get_key_or_joy(): no event."); return (0); } void draw_glenz_box (a_pixel *dest, int c, int xt, int yt) { a_pixel *glenzligne = glenz[c]; int xt2; for (; yt != 0; yt--) { for (xt2 = xt; xt2 != 0; --xt2, ++dest) *dest = glenzligne[*dest]; dest += xbuf - xt; } } heroes-0.21/src/const.h0000644004117000411500000000566407372556676010530 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__CONST__H #define HEROES__CONST__H /* this file carries too many unrelated stuffs */ #include "pcx.h" #include "structs.h" #include "gameid.h" #include "lvl.h" extern int rounds_nbr_values[16]; extern a_pixel *(render_buffer[2]); /* xbuf * ybuf */ char key_or_joy_ready (void); a_keycode get_key_or_joy (void); extern char kbjoy[6]; extern char kbjoyold[6]; extern char in_jokebox; extern char in_menu; extern char in_demo; extern char demo_ready; extern a_pixel glenz[8][256]; void draw_glenz_box (a_pixel *dest, int c, int xt, int yt); extern a_pcx_image main_font_img, vehicles_img; extern a_pcx_image bonus_font_img; extern a_pcx_image tile_set_img, font_deck_img; extern signed char minisinus[32]; extern bool two_players; #define maxq 128 extern a_player player[4]; extern int trail_pos[4][maxq]; extern a_dir8_pair trail_way[4][maxq]; extern int trail_offset[4]; extern char trail_size[4]; /* size of trails, minus one */ extern int col2plr[4]; extern int plr2col[4]; extern a_level lvl; extern unsigned char *square_occupied; extern a_dir8_pair *square_way; extern a_tile_index *square_tile; extern a_square_corrd_pair *square_coord; extern signed char *square_object; #define lemmings_per_players 50 #define lemmings_total (lemmings_per_players*4) extern a_lemming **square_lemmings_list; extern a_lemming **square_dead_lemmings_list; extern a_lemming lemmings_support[lemmings_total]; extern int objects_nbr; extern int game_mode; extern a_gameid game_id; extern int lemmings_anim_offset; extern int lemmings_move_offset; #endif /* HEROES__CONST__H */ heroes-0.21/src/debugchn.def0000644004117000411500000000563607311432106011435 autogen definitions debugchn; /*------------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes 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. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /* ** channel attributes: ** ------------------- ** name: name of the channel ** descr: short description for --list=debug output (beware, this is ** iternationalized) ** doc: long description for the manual (this default to the value ** for `descr', capitalized, and with an final point added). */ channel = { name = section; descr = "different parts of the game"; doc = "The different parts of the game (introduction, \n" "demonstration, menus, ...)."; }; channel = { name = system; descr = "system related messages"; doc = "Handling of environment variables, creation of \n" "directories, initialization of libraries."; }; channel = { name = resource; descr = "filename resources handling"; }; channel = { name = file; descr = "files and directories handling"; }; channel = { name = level; descr = "levels handling"; }; channel = { name = sound_track; descr = "sound track events"; }; channel = { name = sound_effect; descr = "sound effects events"; }; channel = { name = video; descr = "communication with the display driver"; doc = "Events related to the display interface."; }; channel = { name = joystick; descr = "joystick initialization and events"; }; channel = { name = timer; descr = "timer handling"; }; channel = { name = misc; descr = "miscellaneous events"; }; channel = { name = fader; descr = "palette fade events"; }; channel = { name = bonus; descr = "bonus"; doc = "Bonus handling."; }; heroes-0.21/src/debugchn.h0000444004117000411500000000345007451357130011124 /* -*- buffer-read-only: t -*- vi: set ro: ** ** DO NOT EDIT THIS FILE (debugchn.h) ** ** It has been AutoGen-ed Saturday March 30, 2002 at 04:48:40 PM CET ** From the definitions debugchn.def ** and the template file debugchn */ /* ** Heroes is free software. ** ** You may 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. ** ** Heroes 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 Heroes. See the file "COPYING". If not, ** write to: The Free Software Foundation, Inc., ** 59 Temple Place - Suite 330, ** Boston, MA 02111-1307, USA. */ typedef enum debug_lvl { D_SECTION = 1 /* different parts of the game */, D_SYSTEM = 2 /* system related messages */, D_RESOURCE = 4 /* filename resources handling */, D_FILE = 8 /* files and directories handling */, D_LEVEL = 16 /* levels handling */, D_SOUND_TRACK = 32 /* sound track events */, D_SOUND_EFFECT = 64 /* sound effects events */, D_VIDEO = 128 /* communication with the display driver */, D_JOYSTICK = 256 /* joystick initialization and events */, D_TIMER = 512 /* timer handling */, D_MISC = 1024 /* miscellaneous events */, D_FADER = 2048 /* palette fade events */, D_BONUS = 4096 /* bonus */ } debug_lvl; heroes-0.21/src/debugchn.tpl0000644004117000411500000000664007375467160011514 [~ autogen5 template h gperf=debughash.gperf # Copyright 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes 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. # # Heroes 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 ~] [~ CASE (suffix) ~] [~ == h ~][~ (dne "** " "/*\t\t\t\t") ~] */ /* [~ (gpl "Heroes" "** ") ~] */ [~ (begin (define *chn_counter* 1) (define (chn_counter) (let ((counter *chn_counter*)) (set! *chn_counter* (* counter 2)) counter))) ~] typedef enum debug_lvl { [~ FOR channel ',' ~] D_[~ (sprintf "%-16s = %6d /* %s */" (string-upcase! (get "name")) (chn_counter) (get "descr")) ~][~ ENDFOR channel ~] } debug_lvl; [~ == gperf ~]%{ [~ (dne "** " "/*\t\t\t\t") ~] */ /* [~ (gpl "Heroes" "** ") ~] */ #include "system.h" #include "debughash.h" #include "errors.h" #include "fstrcmp.h" /* prototype in_channel_set as static */ static struct debug_channel_s * in_channel_set (register const char *str, register unsigned int len); %} struct debug_channel_s { const char *name; const char *doc; enum debug_lvl number; }; %% [~ (define (print-line name descr enum) (sprintf "%-17s N_(\"%-40s %s" (string-append name ",") (string-append descr "\"),") (string-upcase! enum))) ~][~ (print-line "all" "all messages" "-1") ~] [~ FOR channel '' ~][~ (print-line (get "name") (get "descr") (string-append "D_" (get "name"))) ~] [~ ENDFOR ~]%% static const struct debug_channel_s * get_channel_approx (const char *name) { int i; const struct debug_channel_s *res = 0; double best_weight = 0.7; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (channel_set[i].name[0]) { double weight = fstrcmp (name, channel_set[i].name); if (weight > best_weight) { best_weight = weight; res = &(channel_set[i]); } } } return res; } enum debug_lvl get_channel_number (const char *name) { const struct debug_channel_s *res = in_channel_set (name, strlen (name)); if (!res) { /* try to find a channel which name is close to the given name */ res = get_channel_approx (name); if (res) wmsg (_("%s: no such channel, assuming you meant '%s'."), name, res->name); else emsg (_("%s: no such channel (--list=debug will list " "all known channels)"), name); } return res->number; } void print_debug_channels (void) { int i; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (channel_set[i].name[0]) { printf ("%-16s %s\n", channel_set[i].name, _(channel_set[i].doc)); } } } [~ == texi ~][~ (import-head "DEBUGCHN") ~] @table @samp[~ FOR channel '' ~] @item [~ (string-upcase! (get "name")) ~] [~ ? doc (get "doc") (string-append (string-capitalize (get "descr")) ".") ~] [~ ENDFOR ~] @item ALL All of the above. @end table [~ (import-tail "DEBUGCHN") ~][~ ESAC ~] heroes-0.21/src/debughash.c0000644004117000411500000001377507451357152011313 /* ANSI-C code produced by gperf version 2.7.2 */ /* Command-line: gperf -t -L ANSI-C -G -N in_channel_set -W channel_set -k '1,3,$' ./debughash.gperf */ /* -*- buffer-read-only: t -*- vi: set ro: ** ** DO NOT EDIT THIS FILE (src/debughash.gperf) ** ** It has been AutoGen-ed Saturday March 30, 2002 at 04:43:41 PM CET ** From the definitions src/debugchn.def ** and the template file debugchn */ /* ** Heroes is free software. ** ** You may 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. ** ** Heroes 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 Heroes. See the file "COPYING". If not, ** write to: The Free Software Foundation, Inc., ** 59 Temple Place - Suite 330, ** Boston, MA 02111-1307, USA. */ #include "system.h" #include "debughash.h" #include "errors.h" #include "fstrcmp.h" /* prototype in_channel_set as static */ static struct debug_channel_s * in_channel_set (register const char *str, register unsigned int len); struct debug_channel_s { const char *name; const char *doc; enum debug_lvl number; }; #define TOTAL_KEYWORDS 14 #define MIN_WORD_LENGTH 3 #define MAX_WORD_LENGTH 12 #define MIN_HASH_VALUE 3 #define MAX_HASH_VALUE 25 /* maximum key range = 23, duplicates = 0 */ #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static unsigned int hash (register const char *str, register unsigned int len) { static unsigned char asso_values[] = { 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 0, 5, 5, 15, 0, 0, 26, 26, 26, 5, 0, 0, 0, 0, 5, 26, 26, 0, 0, 10, 0, 0, 26, 26, 0, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26 }; return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]]; } static struct debug_channel_s channel_set[] = { {"",0,0}, {"",0,0}, {"",0,0}, {"all", N_("all messages"), -1}, {"file", N_("files and directories handling"), D_FILE}, {"level", N_("levels handling"), D_LEVEL}, {"system", N_("system related messages"), D_SYSTEM}, {"",0,0}, {"resource", N_("filename resources handling"), D_RESOURCE}, {"misc", N_("miscellaneous events"), D_MISC}, {"bonus", N_("bonus"), D_BONUS}, {"sound_track", N_("sound track events"), D_SOUND_TRACK}, {"section", N_("different parts of the game"), D_SECTION}, {"joystick", N_("joystick initialization and events"), D_JOYSTICK}, {"",0,0}, {"timer", N_("timer handling"), D_TIMER}, {"",0,0}, {"",0,0}, {"",0,0}, {"",0,0}, {"fader", N_("palette fade events"), D_FADER}, {"",0,0}, {"sound_effect", N_("sound effects events"), D_SOUND_EFFECT}, {"",0,0}, {"",0,0}, {"video", N_("communication with the display driver"), D_VIDEO} }; #ifdef __GNUC__ __inline #endif struct debug_channel_s * in_channel_set (register const char *str, register unsigned int len) { if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash (str, len); if (key <= MAX_HASH_VALUE && key >= 0) { register const char *s = channel_set[key].name; if (*str == *s && !strcmp (str + 1, s + 1)) return &channel_set[key]; } } return 0; } static const struct debug_channel_s * get_channel_approx (const char *name) { int i; const struct debug_channel_s *res = 0; double best_weight = 0.7; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (channel_set[i].name[0]) { double weight = fstrcmp (name, channel_set[i].name); if (weight > best_weight) { best_weight = weight; res = &(channel_set[i]); } } } return res; } enum debug_lvl get_channel_number (const char *name) { const struct debug_channel_s *res = in_channel_set (name, strlen (name)); if (!res) { /* try to find a channel which name is close to the given name */ res = get_channel_approx (name); if (res) wmsg (_("%s: no such channel, assuming you meant '%s'."), name, res->name); else emsg (_("%s: no such channel (--list=debug will list " "all known channels)"), name); } return res->number; } void print_debug_channels (void) { int i; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (channel_set[i].name[0]) { printf ("%-16s %s\n", channel_set[i].name, _(channel_set[i].doc)); } } } heroes-0.21/src/debughash.h0000644004117000411500000000304607352614752011310 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__DEBUGHASH__H #define HEROES__DEBUGHASH__H #include "debugmsg.h" enum debug_lvl get_channel_number (const char *name); void print_debug_channels (void); #endif /* HEROES__DEBUGHASH__H */ heroes-0.21/src/debugmsg.c0000644004117000411500000000660007352614752011145 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "debugmsg.h" #include "debughash.h" #include "errors.h" #include "misc.h" #include "basename.h" enum debug_lvl debug_level = 0; const char* program_name = 0; #ifndef dmsg #if defined VA_START void dmsg (enum debug_lvl dlvl, const char* msg, ...) #else void dmsg (dlvl, msg, va_alist) enum debug_lvl dlvl; const char* msg; va_dcl; #endif { if (dlvl & debug_level) { #ifdef VA_START va_list args; #endif fprintf (stdout, "%s: ", program_name); #ifdef VA_START VA_START (args, msg); # if HAVE_VPRINTF vfprintf (stdout, msg, args); # else _doprnt (msg, args, stdout); # endif /* HAVE_VPRINTF */ va_end (args); #else fprintf (stdout, msg, va_alist); #endif /* VA_START */ putc ('\n', stdout); fflush (stdout); } } void dperror (const char* s) { if (debug_level) { fprintf (stderr, "%s: ", program_name); fflush (stderr); perror (s); } } #endif /* !dmsg */ void dmsg_parse_string (const char* option) { char* buf; if (option) { #ifndef USE_HEROES_DEBUG wmsg ("\ Ignoring debug channel specifications: debug messages are not\n\ compiled in. Install Heroes with 'configure --enable-heroes-debug' if\n\ you want that feature."); #else if (option[0] == '-' || (option[0] >= '0' && option[0] <= '9')) { /* the option is a number */ debug_level = atol (option); } else { /* the option is a string */ buf = xstrdup (option); strlwr (buf); option = strtok (buf, " \t:,|&"); while (option) { int neg = 0; int val; if (option[0] == '-' || option[0] == '!') { neg = 1; ++option; } /* lookup the channel number associated to the given name */ val = get_channel_number (option); if (neg) debug_level &= ~val; else debug_level |= val; option = strtok (0, " \t:,|&"); } free (buf); } dmsg (D_MISC, "set debug level to %x", debug_level); #endif /* HEROES_DEBUG */ } } void dmsg_init (const char* prgname) { program_name = base_name (prgname); dmsg_parse_string (getenv ("HEROES_DEBUG")); } heroes-0.21/src/debugmsg.h0000644004117000411500000000361307352614752011153 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /* Debugging messages facility */ #ifndef HEROES__DEBUGMSG__H #define HEROES__DEBUGMSG__H #include "debugchn.h" extern enum debug_lvl debug_level; extern const char* program_name; #ifndef USE_HEROES_DEBUG # define dmsg while (0) while # define dperror while (0) while #else # ifdef VA_START void dmsg (enum debug_lvl dlvl, const char* msg, ...) ATTRIBUTE_PRINTF (2, 3); # else void dmsg (void); # endif void dperror (const char* s); #endif void dmsg_parse_string (const char* option); void dmsg_init (const char* prgname); #endif /* HEROES__DEBUGMSG__H */ heroes-0.21/src/endscroll.c0000644004117000411500000000700007352614752011330 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "pcx.h" #include "video.h" #include "const.h" #include "keyb.h" #include "fastmem.h" #include "endscroll.h" #include "sprtext.h" #include "scrtools.h" #include "timer.h" #include "heroes.h" #include "fader.h" #include "camera.h" #define XBUF 128 #define YBUF 324 static a_pixel *scroll_buffer; a_pcx_image dummy_background_img; /* This is an approximation of sin, using a Lagrange polynomial. Just to try. */ #define LPI (1<<14) #define LS(x) ( (x) * (LPI-(x)) >> 20 ) static signed long int ls (signed long int x) { x &= (LPI << 1) - 1; return (((x & LPI) ? (-LS (x & (LPI - 1))) : LS (x)) * 7 >> 3); } static void copy_background (void) { int i; a_pixel *dest = scroll_buffer; const a_pixel *src = dummy_background_img.buffer; for (i = 108; i != 0; i--) { fastmem4 (src, dest, 128 / 4); fastmem4 (src, dest + 108 * XBUF, 128 / 4); fastmem4 (src, dest + 216 * XBUF, 128 / 4); dest += XBUF; src += 128; } } static void draw_background (int x, int y) { int i; a_pixel *dest = corner[0]; const a_pixel *src = scroll_buffer + x + y * XBUF; for (i = 200; i != 0; i--) { fastmem4 (src, dest, 320 / 4); dest += xbuf; src += XBUF; } } void dummy_moving_background_render (void) { static int frame = 0; draw_background ((XBUF / 2) - 160 + ls (2 * frame / 3), (YBUF / 2) - 100 + ls (frame)); frame += read_htimer (background_htimer) << 8; } void dummy_moving_background_init (void) { XMALLOC_ARRAY (scroll_buffer, XBUF * YBUF); pcx_load_from_rsc ("end-scroller-bg-img", &dummy_background_img); copy_background (); img_free (&dummy_background_img); /* only free the buffer, not the palette */ } void dummy_moving_background_uninit (void) { free (scroll_buffer); } void end_scroll (void) { a_sprite *theend; theend = compile_menu_text (_("THE END"), T_CENTERED | T_WAVING, 95, 159); corner[0] = render_buffer[0] + 10 * xbuf; std_white_fadein (&dummy_background_img.palette); do { dummy_moving_background_render (); DRAW_SPRITE (theend, corner[0]); flush_display (corner[0]); } while (!key_or_joy_ready ()); get_key (); free_sprite (theend); } heroes-0.21/src/endscroll.h0000644004117000411500000000322707352614752011344 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__ENDSCROLL__H #define HEROES__ENDSCROLL__H extern a_pcx_image dummy_background_img; extern void end_scroll (void); extern void dummy_moving_background_init (void); extern void dummy_moving_background_uninit (void); extern void dummy_moving_background_render (void); #endif /* HEROES__ENDSCROLL__H */ heroes-0.21/src/errors.c0000644004117000411500000000525107352614752010665 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "errors.h" #include "video.h" #include "strack.h" extern const char* program_name; /* defined in debugmsg.c */ int disable_wmsg = 0; #if defined VA_START void wmsg (const char* msg, ...) #else void wmsg (msg, va_alist) const char* msg; va_dcl; #endif { #ifdef VA_START va_list args; #endif if (disable_wmsg) return; fprintf (stderr, "%s: ", program_name); #ifdef VA_START VA_START (args, msg); # if HAVE_VPRINTF vfprintf (stderr, msg, args); # else _doprnt (msg, args, stderr); # endif /* HAVE_VPRINTF */ va_end (args); #else fprintf (stderr, msg, va_alist); #endif /* VA_START */ putc ('\n', stderr); fflush (stderr); } int disable_emsg = 0; #if defined VA_START void emsg (const char* msg, ...) #else void emsg (msg, va_alist) const char* msg; va_dcl; #endif { #ifdef VA_START va_list args; #endif if (!disable_emsg) { fprintf (stderr, "%s: ", program_name); #ifdef VA_START VA_START (args, msg); # if HAVE_VPRINTF vfprintf (stderr, msg, args); # else _doprnt (msg, args, stderr); # endif /* HAVE_VPRINTF */ va_end (args); #else fprintf (stderr, msg, va_alist); #endif /* VA_START */ putc ('\n', stderr); fflush (stderr); } exit_heroes (33); } void exit_heroes (int code) { uninit_sound_engine (); uninit_video (); exit (code); } heroes-0.21/src/errors.h0000644004117000411500000000351707352614752010675 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__ERRORS__H #define HEROES__ERRORS__H /* warning messages */ extern int disable_wmsg; #ifdef VA_START void wmsg (const char* msg, ...) ATTRIBUTE_PRINTF (1, 2); #else void wmsg (void); #endif /* error messages */ extern int disable_emsg; #ifdef VA_START void emsg (const char* msg, ...) ATTRIBUTE_PRINTF (1, 2) ATTRIBUTE_NORETURN; #else void emsg (void); #endif /* exit heroes, closing libraries */ void exit_heroes (int code) ATTRIBUTE_NORETURN; #endif /* HEROES__ERRORS__H */ heroes-0.21/src/explosions.c0000644004117000411500000002717207362527733011565 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "explosions.h" #include "sprzcol.h" #include "const.h" #include "timer.h" #include "debugmsg.h" a_sprite *explosions[NBR_EXPLOSION_KINDS][NBR_EXPLOSION_FRAMES]; void init_explosions (void) { int i; for (i = 0; i < 6; ++i) explosions[0][i] = compile_sprzcol (IMGPOS (vehicles_img, 65, (5 - i)*33), 0, 32, 32, vehicles_img.width, xbuf); for (; i < NBR_EXPLOSION_FRAMES; ++i) explosions[0][i] = compile_sprzcol (IMGPOS (vehicles_img, 32, (NBR_EXPLOSION_FRAMES - i - 1) * 33), 0, 32, 32, vehicles_img.width, xbuf); for (i = 0; i < 6; ++i) explosions[1][i] = compile_sprzcol (IMGPOS (vehicles_img, 131, (5 - i)*33), 0, 32, 32, vehicles_img.width, xbuf); for (; i < NBR_EXPLOSION_FRAMES; ++i) explosions[1][i] = compile_sprzcol (IMGPOS (vehicles_img, 98, (NBR_EXPLOSION_FRAMES - i - 1) * 33), 0, 32, 32, vehicles_img.width, xbuf); } void uninit_explosions (void) { int i, j; for (i = 0; i < NBR_EXPLOSION_KINDS; ++i) for (j = 0; j < NBR_EXPLOSION_FRAMES; ++j) FREE_SPRITE0 (explosions[i][j]); } an_explosion *square_explo_state; a_u8 *square_explo_type; typedef struct an_explosion_info an_explosion_info; struct an_explosion_info { long orig_time; /* Date (in 70th of secs) when the explosion was triggered. */ a_square_index idx; bool neighb_done; /* True if the explosion has propagated to neighbors. */ }; static an_explosion_info *explo_list; static unsigned int explo_list_max; static unsigned int explo_list_first_unused; static a_timer explo_timer; static long explo_time; /* Updated from explo_timer on each call to update_explosion. */ void allocate_explosions (void) { XSALLOC_ARRAY (square_explo_state, lvl.square_count, EXPLOSION_UNTRIGGERED); XMALLOC_ARRAY (square_explo_type, lvl.square_count); explo_list_max = 64; explo_list_first_unused = 0; XMALLOC_ARRAY (explo_list, explo_list_max); explo_timer = new_htimer (T_GLOBAL, HZ (70)); explo_time = 0; } void release_explosions (void) { free_htimer (explo_timer); XFREE0 (square_explo_state); XFREE0 (square_explo_type); XFREE0 (explo_list); } static void trigger_explosion_at_time (a_square_index idx, long orig_time); /* Usually, this will return values between EXPLOSION_TRIGGERED and 0. I.e., positive values that fit in the 'an_explosion' type. But this function can also be used on very old explosions for which it returns a negative value. Hence the 'int' return type. */ static int compute_explosion_state (long orig_time) { /* Elapsed time in "frames". */ int ef = (explo_time - orig_time) / EXPLOSION_SLICES_PER_FRAMES; assert (ef >= 0); return EXPLOSION_TRIGGERED - ef; } /* Trigger neighbor squares if needed. NOTE: This function should be called only after EXPLOSION_DELAY has elapsed. See the call in trigger_explosion_at_time() for example. */ static void propagate_to_neighbors_maybe (a_square_index idx, long orig_time) { /* Propagation to neighbors occurs EXPLOSION_DELAY 70th of seconds after the explosion has been triggered. This is a precise instant in the life of an explosion, but since we may miss this instant (because of a low frame rate) we also need to be able to propagate explosions retro-actively at a subsequent time, counterbalancing the lag to have neighbors explosions behaving as if they were activated at the right time. This is simply achieved by calling trigger_explosion_at_time() with an ORIG_TIME based on the ORIG_TIME of the current explosion (i.e. no computations are based on the current time). See the computation of NEIGH_ORIG_TIME. One may wonder why we care so much about counterbalancing the lag. After all, the user won't notice if a neighboring square explodes one or two frames later. Older versions of Heroes behaved this way. There are two problems with this scheme: - It is non deterministic. The propagation of the explosions depends on the frame rate achieved by the game. From the same original state, different games with different frame rate with have different evolutions. This will be a problem the day (the century?) Heroes become a networked game. - The frame rate can fall very very low. Then funny effects can occur if we don't counterbalance. For instance if the frame rate is so low that an explosion has the opportunity to activate its neighbor only less than EXPLOSION_DELAY/70 seconds before it vanish, then it will be in a triggerable state when this neighbor start to propagate to its own neighbors. So our square will be activated by the neighbor it had activated and vice-versa: these two squares will explode alternatively and infinitely (or until the frame rate change). */ long neigh_orig_time = orig_time + ((EXPLOSION_TRIGGERED - EXPLOSION_TRIGGER_NEIGHBORS) * EXPLOSION_SLICES_PER_FRAMES); /* Iterate on neighbor squares. */ a_dir d; for (d = 0; d < 4; ++d) { a_square_index ngb = lvl.square_move[d][idx]; if (ngb != INVALID_INDEX && EXPLOSION_SQUARE_TRIGGERABLE_P (ngb)) trigger_explosion_at_time (ngb, neigh_orig_time); } } static void trigger_explosion_at_time (a_square_index idx, long orig_time) { int state; bool propagated; /* We don't trigger explosions in the future. */ assert (explo_time >= orig_time); state = compute_explosion_state (orig_time); /* Maybe we need to propagate this explosion. Note that STATE may happen to be negative, meaning the explosion vanished; we still try propagate. */ if (state <= EXPLOSION_TRIGGER_NEIGHBORS) { propagate_to_neighbors_maybe (idx, orig_time); propagated = true; } else { propagated = false; } /* Insert the explosion into the list of active explosions only if it's active... */ if (state >= 0) { if (explo_list_max <= explo_list_first_unused) { explo_list_max += 64; XREALLOC_ARRAY (explo_list, explo_list_max); } explo_list[explo_list_first_unused].orig_time = orig_time; explo_list[explo_list_first_unused].idx = idx; explo_list[explo_list_first_unused].neighb_done = propagated; ++explo_list_first_unused; /* Update level rendering information. */ square_explo_state[idx] = state; square_explo_type[idx] = rand () % NBR_EXPLOSION_KINDS; } } /* Trigger an explosion but set the ORIG_TIME so that the explosion is at frame FRAME_START now. */ void trigger_explosion (a_square_index idx, an_explosion frame_start) { assert (frame_start <= EXPLOSION_TRIGGERED); trigger_explosion_at_time (idx, (explo_time - ((EXPLOSION_TRIGGERED - frame_start) * EXPLOSION_SLICES_PER_FRAMES))); } void trigger_possible_explosion (a_square_index idx) { if (EXPLOSION_SQUARE_TRIGGERABLE_P (idx)) trigger_explosion (idx, EXPLOSION_TRIGGERED); } void update_explosions (void) { unsigned int i; /* Imagine that the array of explosions is as follow, where A is an active explosion, and V a vanished explosion. 0A 1A 2V 3V 4V 5A 6A 7A 8A 9V 10V 11V... Since the V's are vanished, we want to remove them from the array. One idea is to shift the A's one by one as we process the array, overwriting the V's. So, for instance, after processing the A at position 5, we would copy it at position 2. Similarly the A at position 6 would be copied at position 3, etc. However we can do better. Granted, the explosions are not sorted over the ORIG_TIME: that why A's and V's can be mixed. This is unfortunate because if we add all the V at the beginning, and the A's at the end and we could shift all the latter over the former in one shot (of memmove). However, they are usually _almost_ sorted. Indeed: if we were only calling trigger_explosion (index, EXPLOSION_TRIGGERED) to append new explosions, they would be naturally kept in a chronological order. The trouble comes from calls like trigger_explosion (index, EXPLOSION_IMMEDIATE) that creates an *older* explosion in order to have it exploding immediately (this is used when a player die, or with fire trails). This, combined with how the explosions are propagated means that the array is not sorted, but you can split this array in slices in which explosions are sorted. The good thing is that these slices are easy to shift as explained above. Therefore, instead of shifting activated explosions one by one, we will shift them slice per slice. The two variables below are used for this purpose. SHIFT_SRC is the first explosion of the last sequence of activated explosion. SHIFT_DEST is the for explosion of the last sequence of vanished explosions. When we are processing 8A in the example above we have SHIFT_DEST=2 and SHIFT_SRC=5. When we encounter 9V, we can shift all the A starting at SHIFT_SRC toward position SHIFT_SRC in a single shot. */ int shift_src; int shift_dest; explo_time = read_htimer (explo_timer); if (explo_list_first_unused) dmsg (D_MISC, "explosions: %d/%d", explo_list_first_unused, explo_list_max); shift_src = -1; shift_dest = 0; for (i = 0; i < explo_list_first_unused; ++i) { a_square_index idx = explo_list[i].idx; int state = compute_explosion_state (explo_list[i].orig_time); /* Propagate to neighbors. */ if (! explo_list[i].neighb_done && state <= EXPLOSION_TRIGGER_NEIGHBORS) { propagate_to_neighbors_maybe (idx, explo_list[i].orig_time); explo_list[i].neighb_done = true; } if (state >= 0) { /* Update rendering info. */ square_explo_state[idx] = state; /* Mark position of for explosition in a sequence of activated explosions. */ if (shift_src < 0) shift_src = i; } else { square_explo_state[idx] = EXPLOSION_UNTRIGGERED; #define SHIFT_ACTIVATED_EXPLOSIONS \ /* Shift activated explosions over vanished ones. */ \ if (shift_src > shift_dest) { \ int activated_qty = i - shift_src; \ memmove (explo_list + shift_dest, \ explo_list + shift_src, \ activated_qty * sizeof (*explo_list)); \ shift_dest += activated_qty; \ shift_src = -1; \ } else { \ shift_dest = i; \ } SHIFT_ACTIVATED_EXPLOSIONS; } } SHIFT_ACTIVATED_EXPLOSIONS; explo_list_first_unused = shift_dest; } heroes-0.21/src/explosions.h0000644004117000411500000000560407362527733011566 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__EXPLOSIONS__H #define HEROES__EXPLOSIONS__H #include "sprite.h" #include "lvl/lvl.h" #define NBR_EXPLOSION_FRAMES 15 #define NBR_EXPLOSION_KINDS 2 /* These are the sprites used to display each frame of each kind of explosion. */ extern a_sprite *explosions[NBR_EXPLOSION_KINDS][NBR_EXPLOSION_FRAMES]; #define EXPLOSION_SLICES_PER_FRAMES 8 #define EXPLOSION_DELAY 8 #define EXPLOSION_IMMEDIATE (NBR_EXPLOSION_FRAMES - 1) #define EXPLOSION_TRIGGERED (EXPLOSION_IMMEDIATE + EXPLOSION_DELAY) #define EXPLOSION_TRIGGER_NEIGHBORS (EXPLOSION_TRIGGERED - 3) #define EXPLOSION_UNTRIGGERED (EXPLOSION_TRIGGERED + 1) /* * 0 <= n < NBR_EXPLOSION_FRAMES: frame number to display. * NBR_EXPLOSION_FRAMES <= n <= EXPLOSION_TRIGGERED: about to explode. * n == EXPLOSION_UNTRIGGERED: idle. */ typedef a_u8 an_explosion; extern an_explosion *square_explo_state; #define EXPLOSION_SQUARE_TRIGGERED_P(idx) \ (square_explo_state[idx] <= EXPLOSION_TRIGGERED) #define EXPLOSION_SQUARE_TRIGGERABLE_P(idx) \ (lvl.square_type[idx] == T_BOOM \ && square_explo_state[idx] == EXPLOSION_UNTRIGGERED) extern a_u8 *square_explo_type; /* in [0 .. NBR_EXPLOSION_KINDS-1] */ void allocate_explosions (void); void release_explosions (void); /* FRAME_START is expected to be EXPLOSION_IMMEDIATE or EXPLOSION_TRIGGERED. */ void trigger_explosion (a_square_index idx, an_explosion frame_start); void trigger_possible_explosion (a_square_index idx); void update_explosions (void); void init_explosions (void); void uninit_explosions (void); #endif /* HEROES__EXPLOSIONS__H */ heroes-0.21/src/extras.c0000644004117000411500000001466207352614752010665 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /* * Create the list of extra levels. */ #include "system.h" #include "extras.h" #include "generic_list.h" #include "hedlite.h" #include "misc.h" #include "rsc_files.h" #include "debugmsg.h" #include "levellst.h" typedef struct { a_filename filename; char is_in_user_dir; /* Is this extra level a user level? (user levels come from the ~/.heroes/level/ directory) */ } an_extradir_info; static void free_extradir_info (an_extradir_info* ei); NEW_LIST (an_extradir, an_extradir_info*, STD_EQUAL, free_extradir_info); /* a_level_list is used for building a temporaly list of all extra levels seen in directories. The list will then be converted to an array, by copying the pointed struct, therefore the destructor should free only the struct, not the elements pointer by the struct's members. */ NEW_LIST (a_level, an_extra_level*, STD_EQUAL, free); an_extradir_list edir; unsigned int extra_nbr = 0; /* the total number of extra levels */ unsigned int extra_user_nbr = 0; /* The number of user levels from */ an_extra_level *extra_list = 0; /* The list of extra-levels, the user's extra-levels are at the beginning */ char *extra_selected_list = 0; /* For each level: 1 if selected, 0 if not */ static void free_extradir_info (an_extradir_info* ei) { free (ei->filename); free (ei); } /* compare two extra-levels for sorting, we want to sort user's levels first, and then alphabetically */ static int cmp_extralevels (const an_extra_level* l, const an_extra_level* r) { int d = r->is_in_user_dir - l->is_in_user_dir; if (d != 0) return d; return strcasecmp (l->level_name, r->level_name); } /* Browse a directory, adds the levels found to ll. Update extra_nbr and extra_user_nbr. */ static void browse_extra_directory (an_extradir_info* edi, a_level_list* ll) { DIR* dir; struct dirent* de; int n = 0; dmsg (D_FILE, "browsing directory %s ...", edi->filename); dir = opendir (edi->filename); if (!dir) { /* Always output an error message when handling a user directory. If not, we are probably reading a default extra directory, maybe system wide configured or hard coded in the source; it's best to assume this is not an error (this allow the addition of extra levels as packages or such). */ if (edi->is_in_user_dir) perror (edi->filename); dperror ("scandir"); return; } while ((de = readdir (dir))) if (select_file_lvl (de)) { /* add the file to the list */ char* fn; NEW (an_extra_level, tmp); XMALLOC_ARRAY (fn, (strlen (edi->filename) + 1 + strlen (de->d_name) + 1)); tmp->level_name = xstrdup (de->d_name); sprintf (fn, "%s/%s", edi->filename, tmp->level_name); tmp->full_name = fn; tmp->is_in_user_dir = edi->is_in_user_dir; strupr (tmp->level_name); if ((fn = strchr (tmp->level_name, '.'))) *fn = 0; a_level_push (ll, tmp); ++n; } closedir (dir); dmsg (D_FILE, "... %d files", n); extra_nbr +=n; if (edi->is_in_user_dir) extra_user_nbr += n; } void browse_extra_directories (void) { an_extradir_list ed = edir; a_level_list ll = 0; a_level_list ll_cur; unsigned int i; /* build the list of the files found in each directory */ while (ed) { browse_extra_directory (ed->car, &ll); ed = ed->cdr; } /* return if no extra level was found */ if (!extra_nbr) { XFREE0 (extra_list); XFREE0 (extra_selected_list); return; } /* convert the list to an array (BTW, this array is called extra_list :)) */ XREALLOC_ARRAY (extra_list, extra_nbr); for (i = 0, ll_cur = ll; ll_cur; ll_cur = ll_cur->cdr, ++i) extra_list[i] = *(ll_cur->car); assert (i == extra_nbr); /* ll is now useless */ a_level_clear (&ll); /* sort the files list */ qsort (extra_list, extra_nbr, sizeof(*extra_list), (int (*)(const void*,const void*))cmp_extralevels); /* allocate the selection array */ XREALLOC_ARRAY (extra_selected_list, extra_nbr); memset (extra_selected_list, 0, extra_nbr); } void add_extra_directory (a_filename fn) { NEW (an_extradir_info, tmp); tmp->filename = xstrdup (fn); tmp->is_in_user_dir = 0; an_extradir_push (&edir, tmp); } static void add_extra_in_user_directory (a_filename fn) { NEW (an_extradir_info, tmp); tmp->filename = xstrdup (fn); tmp->is_in_user_dir = 1; an_extradir_push (&edir, tmp); } void add_default_extra_directories (void) { char* t; dmsg (D_SECTION, "setup default extra directory"); t = get_rsc_file ("extra-levels-dir"); if (t) { add_extra_directory (t); free (t); } if (!create_levels_output_dir ()) add_extra_in_user_directory (levels_output_dir); } void free_extra_list (void) { unsigned int i; if (extra_nbr == 0) return; dmsg (D_MISC, "freeing extra list"); for (i = 0; i < extra_nbr; ++i) { free (extra_list[i].full_name); free (extra_list[i].level_name); } extra_nbr = 0; extra_user_nbr = 0; XFREE0 (extra_list); XFREE0 (extra_selected_list); } void free_extra_directories (void) { dmsg (D_MISC, "free extra directories"); an_extradir_clear (&edir); free_levels_output_dir (); } heroes-0.21/src/extras.h0000644004117000411500000000356707352614752010674 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__EXTRAS__H #define HEROES__EXTRAS__H typedef char* a_filename; typedef struct { char* level_name; a_filename full_name; char is_in_user_dir; } an_extra_level; extern an_extra_level *extra_list; extern char *extra_selected_list; extern unsigned int extra_nbr; extern unsigned int extra_user_nbr; void browse_extra_directories (void); void add_extra_directory (a_filename fn); void add_default_extra_directories (void); void free_extra_list (void); void free_extra_directories (void); #endif /* HEROES__EXTRAS__H */ heroes-0.21/src/fader.c0000644004117000411500000001372607352614752010440 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "fader.h" #include "debugmsg.h" #include "scrtools.h" #include "timer.h" /* * Either we fade in to a palette (F_IN), * or we fade out from a palette (F_OUT), * or we fade from one palette to another (F_PAL), * or we do nothing (F_NONE).. */ enum fader_kind {F_NONE, F_IN, F_OUT, F_PAL}; /* * The color to fade to (F_OUT) or from (F_IN). */ enum fader_color {F_BLACK = 0, F_WHITE}; struct fader_s { const a_palette* from; /* palette to fade from (if needed) */ const a_palette* to; /* palette to fade to (if needed) */ enum fader_kind kind; enum fader_color color; a_timer timer; /* timer used by the fade */ int duration; /* Number of steps to use for fading (step are incremented using the timer speed) */ int last_step; /* last step where palette was set */ a_fader_status* status_ptr; /* status variable to update */ long delay; /* step to wait */ }; static struct fader_s fader; void init_fader (void) { dmsg (D_FADER, "initialize fader"); fader.from = 0; fader.to = 0; fader.kind = F_NONE; fader.color = F_BLACK; fader.timer = new_htimer (T_LOCAL, HZ (70)); fader.duration = 0; fader.last_step = -1; fader.status_ptr = 0; fader.delay = 0; } void uninit_fader (void) { dmsg (D_FADER, "uninitialize fader"); free_htimer (fader.timer); fader.timer = 0; } static void set_fader (const a_palette* from, const a_palette* to, enum fader_kind kind, enum fader_color color, int duration) { fader.from = from; fader.to = to; fader.kind = kind; fader.color = color; fader.duration = duration; fader.last_step = -1; fader.status_ptr = 0; } void std_white_fadein (const a_palette* to) { dmsg (D_FADER, "set standard white fade-in"); set_fader (0, to, F_IN, F_WHITE, 64); } void std_black_fadein (const a_palette* to) { dmsg (D_FADER, "set standard black fade-in"); set_fader (0, to, F_IN, F_BLACK, 64); } void std_black_fadeout (const a_palette* from) { dmsg (D_FADER, "set standard black fade-out"); set_fader (from, 0, F_OUT, F_BLACK, 64); } void std_palette_fade (const a_palette* from, const a_palette* to) { dmsg (D_FADER, "set standard palette fade"); set_fader (from, to, F_PAL, 0, 64); } void run_fader (void) { int last_step = fader.last_step; a_palette f_pal; if (fader.kind == F_NONE || last_step >= fader.duration) return; if (last_step < 0) { /* first run of this fader */ dmsg (D_FADER, "fader: first step"); reset_htimer (fader.timer); fader.last_step = 0; if (fader.status_ptr) *fader.status_ptr = F_STARTED; } /* Handle a delay, set by fader_delay (). */ if (fader.delay > 0) { fader.delay -= read_htimer (fader.timer); if (fader.delay > 0) return; /* fader.delay now can be negative if we waited too much */ if (fader.delay < 0) { fader.last_step -= fader.delay; fader.delay = 0; } } else /* fader.delay == 0 */ { fader.last_step += read_htimer (fader.timer); } if (fader.last_step > fader.duration) fader.last_step = fader.duration; dmsg (D_FADER, "fader: last_step=%d", fader.last_step); /* avoid setting palette when possible */ if (last_step == fader.last_step) return; switch (fader.kind) { unsigned i; const unsigned char* in; const unsigned char* out; case F_IN: out = fader.to->global; if (fader.color == F_BLACK) for (i = 0; i < 768; ++i) f_pal.global[i] = (out[i] * fader.last_step) / fader.duration; else for (i = 0; i < 768; ++i) f_pal.global[i] = ((63 * (fader.duration - fader.last_step)) + (out[i] * fader.last_step)) / fader.duration; break; case F_OUT: in = fader.from->global; if (fader.color == F_BLACK) for (i = 0; i < 768; ++i) f_pal.global[i] = (in[i] * (fader.duration - fader.last_step)) / fader.duration; else for (i = 0; i < 768; ++i) f_pal.global[i] = ((in[i] * (fader.duration - fader.last_step)) + (63 * fader.last_step)) / fader.duration; break; case F_PAL: in = fader.from->global; out = fader.to->global; for (i = 0; i < 768; ++i) f_pal.global[i] = ((in[i] * (fader.duration - fader.last_step)) + (out[i] * fader.last_step)) / fader.duration; break; case F_NONE: return; } if (fader.last_step == fader.duration) { /* fader finished its work */ cancel_fader (); } set_pal_with_luminance (&f_pal); } void cancel_fader (void) { fader.kind = F_NONE; if (fader.status_ptr) *fader.status_ptr = F_FINISHED; } void fader_status_flagback (a_fader_status* ptr) { fader.status_ptr = ptr; if (ptr) *ptr = F_UNKNOWN; } void fader_delay (long s) { fader.delay = s; } heroes-0.21/src/fader.h0000644004117000411500000000670107352614752010440 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__FADER__H #define HEROES__FADER__H #include "pcx.h" /* * The fader is F_STARTED after the first call to run_fader () is * done. It is F_FINISHED when the fading it was configured for is * finished (or canceled). It is F_UNKNOWN between the call to * status_flagback and the next call to run_fader () which is either a * first or a last step. */ typedef enum {F_UNKNOWN, F_STARTED, F_FINISHED} a_fader_status; /* Configure a standard fade-in, from white to the given palette, using 64 steps at 70Hz */ void std_white_fadein (const a_palette* to); /* Configure a standard fade-in, from black to the given palette, using 64 steps at 70Hz */ void std_black_fadein (const a_palette* to); /* Configure a standard fade-out, from the given palette to black, using 64 steps at 70Hz */ void std_black_fadeout (const a_palette* from); /* Configure a standard fade between two palettes, using 64 steps at 70Hz */ void std_palette_fade (const a_palette* from, const a_palette* to); /* update the display palette (if needed). * NOTE: 1) usualy, there is no need to call this directly, since it is * done by vsynch (). * 2) fader use a htimer, therefore update_htimer () must be * called periodically or the fader will never be updated. * This is done by vsynch () too. */ void run_fader (void); /* * cancel running fader */ void cancel_fader (void); /* * Supply a pointer to a variable that will reflect the * status of the fader. If ptr==0, nothing is done. * * NOTE: This pointer is always reset when the fader is configured. * WARNING: If this points to a local variable, you must not * exit the local scope before the status is F_FINISHED; or * if you really need to exit, do recall this function with ptr==0. * FIXME: This is better called before the first run_fader () call * after configuration. Otherwise the status may be "unknown". */ void fader_status_flagback (a_fader_status* ptr); /* * Delay the fader for s steps. */ void fader_delay (long s); void init_fader (void); void uninit_fader (void); #endif /* HEROES__FADER__H */ heroes-0.21/src/fastmem.h0000644004117000411500000000376407352614752011021 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__FASTMEM__H #define HEROES__FASTMEM__H /* In the good old days when Heroes was still a DOS game these three * macros used the be inline assembly instructions. * * Today, since gcc can optimize memcpy as an inline copy loop, they are * just synonyms for memcpy. * * Still, it's a good idea to keep using these macros (and not memcpy) * since they may be helpful to achieve some optimization with other * compilers. */ #define fastmem1(src,dest,size) memcpy((dest),(src),(size)) #define fastmem2(src,dest,size) memcpy((dest),(src),(size)<<1) #define fastmem4(src,dest,size) memcpy((dest),(src),(size)<<2) #endif /* HEROES__FASTMEM__H */ heroes-0.21/src/font.h0000644004117000411500000000376707352614752010336 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #define font_pos 30 /* position du premier caractère (n° pixel) */ #define font_first_ascii 32 /* number du premier caractère (ASCII) */ #define font_transp_color 0 /* couleur transparante */ #define font_height 6 /* hauteur de chaque caractère */ static char font_width[62] = /* largeur de chaque caractère */ { 2, 1, 3, 3, 0, 0, 0, 0, 0, 0, 3, 3, 2, 3, 2, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 2, 0, 3, 0, /* ! " ° $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > */ 3, 0, 3, 3, 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 4, 2 }; /* ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] */ heroes-0.21/src/fontdata.c0000644004117000411500000001551107406451666011154 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "const.h" #include "debugmsg.h" #include "fontdata.h" #include "errors.h" a_fontdata *edit_font = 0; a_fontdata *menu_font = 0; a_fontdata *help_font = 0; a_fontdata *deck_font = 0; a_fontdata *bonus_font = 0; static a_pcx_image help_font_img; static a_pcx_image big_font_img; static void initialize_menu_font (void) { a_pixel *upl; /* upper left pixel of the character */ int ch; /* current character */ pcx_load_from_rsc ("big-font", &big_font_img); XCALLOC_VAR (menu_font); menu_font->height = 10; menu_font->line_skip = 2; menu_font->line_size = big_font_img.width; for (ch = ' '; ch <= 255; ++ch) { unsigned int width, act_width; unsigned int height; upl = big_font_img.buffer + ((int) (ch - ' ') % 16) * 22 + ((int) (ch - ' ') / 16) * big_font_img.width * menu_font->height; /* detect the width of a character */ for (act_width = width = 0; width < 22; ++width) for (height = 0; height < menu_font->height; ++height) { if (upl[width + height * big_font_img.width] != 0) { act_width = width + 1; break; } } menu_font->upper_left[ch] = upl; menu_font->width[ch] = act_width; } menu_font->width[' '] = 5; menu_font->min_space_width = 3; } static void initialize_deck_font (void) { a_pixel *upl; /* upper left pixel of the character */ int ch; /* current character */ XCALLOC_VAR (deck_font); deck_font->height = 5; deck_font->line_skip = 1; deck_font->line_size = font_deck_img.width; for (ch = ' '; ch <= '^'; ++ch) { unsigned int width, act_width; unsigned int height; upl = font_deck_img.buffer + 2 * font_deck_img.width + ((int) (ch - ' ') % 32) * 8 + ((int) (ch - ' ') / 32) * font_deck_img.width * 8; /* detect the width of a character */ for (act_width = width = 0; width < 8; ++width) for (height = 0; height < deck_font->height; ++height) { if (upl[width + height * font_deck_img.width] != 0) { act_width = width + 2; break; } } deck_font->upper_left[ch] = upl; deck_font->width[ch] = act_width; } deck_font->width[' '] = 4; deck_font->min_space_width = 2; /* Lower case letters are not supported, but since this font is used to draw user-supplied string, it's better to convert lower case characters to upper. */ for (ch = 'a'; ch <= 'z'; ++ch) if (deck_font->width[ch] == 0) { deck_font->upper_left[ch] = deck_font->upper_left[TOUPPER(ch)]; deck_font->width[ch] = deck_font->width[TOUPPER(ch)]; } } static void initialize_bonus_font (void) { a_pixel *upl; /* upper left pixel of the character */ int ch; /* current character */ XCALLOC_VAR (bonus_font); bonus_font->height = 12; bonus_font->line_skip = 2; bonus_font->line_size = bonus_font_img.width; for (ch = ' '; ch <= 'd'; ++ch) { unsigned int width, act_width; unsigned int height; upl = bonus_font_img.buffer + ((int) (ch - ' ') % 26) * 12 + ((int) (ch - ' ') / 26) * bonus_font_img.width * bonus_font->height; /* detect the width of a character */ for (act_width = width = 0; width < 12; ++width) for (height = 0; height < bonus_font->height; ++height) { if (upl[width + height * bonus_font_img.width] != 0) { act_width = width + 1; break; } } bonus_font->upper_left[ch] = upl; bonus_font->width[ch] = act_width; } bonus_font->width[' '] = 5; bonus_font->min_space_width = 2; } static void initialize_help_font (void) { a_pixel *upl; /* upper left pixel of the character */ int ch; /* current character */ pcx_load_from_rsc ("help-font", &help_font_img); XCALLOC_VAR (help_font); help_font->height = 9; help_font->line_skip = 1; help_font->line_size = help_font_img.width; for (ch = ' '; ch <= 255; ++ch) { unsigned int width, act_width; unsigned int height; upl = help_font_img.buffer + ((int) (ch - ' ') % 32) * 8 + ((int) (ch - ' ') / 32) * help_font_img.width * help_font->height; /* detect the width of a character */ for (act_width = width = 0; width < 8; ++width) for (height = 0; height < help_font->height; ++height) { if (upl[width + height * help_font_img.width] != 0) { act_width = width + 1; break; } } help_font->upper_left[ch] = upl; help_font->width[ch] = act_width; } help_font->width[' '] = 4; help_font->min_space_width = 2; } void init_fonts (void) { dmsg (D_MISC, "initializing font data"); initialize_menu_font (); edit_font = 0; initialize_help_font (); initialize_deck_font (); initialize_bonus_font (); } void uninit_fonts (void) { dmsg (D_MISC, "uninitializing font data"); XFREE0 (menu_font); XFREE0 (edit_font); XFREE0 (help_font); XFREE0 (deck_font); XFREE0 (bonus_font); img_free (&help_font_img); img_free (&big_font_img); } unsigned int compute_text_width (const a_fontdata *font, const char *text, unsigned int *nspaces) { unsigned int width = 0; unsigned int ns = 0; for (; *text; ++text) { if (*text == '%') { ++text; if (*text != '%') continue; } if (!nspaces || *text != ' ') width += font->width[UCHAR (*text)]; else ++ns; } if (nspaces) *nspaces = ns; return width; } #if DEBUG void check_message_is_drawable (const a_fontdata *font, const char *text) { const char *text_orig = text; for (; *text; ++text) { if (font->width[UCHAR (*text)] == 0) { wmsg (_("character '%c' is not drawable (in message '%s')"), *text, text_orig); break; } } } #endif heroes-0.21/src/fontdata.h0000644004117000411500000000516207352614752011157 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__FONTDATA__H #define HEROES__FONTDATA__H #include "video.h" typedef struct { unsigned int width[256]; /* width of each character */ unsigned int height; /* height common to each character */ a_pixel* upper_left[256]; /* upper left pixel of each character. DO NOT use this pointer if the corresponding width is null. */ unsigned int line_size; /* size of a line in the font buffer */ unsigned int line_skip; /* number of pixel to skip verticaly between lines, height is added. */ unsigned int min_space_width; /* minimum width allowed for space */ } a_fontdata; extern a_fontdata *edit_font; extern a_fontdata *menu_font; extern a_fontdata *help_font; extern a_fontdata *deck_font; extern a_fontdata *bonus_font; void init_fonts (void); void uninit_fonts (void); /* Compute the width needed by `text' using font `font'. If nspaces is non null spaces are not accounted in the returned width but *NSPACES is set to the number of space encountered. */ unsigned int compute_text_width (const a_fontdata *font, const char *text, unsigned int *nspaces); #if DEBUG void check_message_is_drawable (const a_fontdata *font, const char *text); #else # define check_message_is_drawable(x, y) ((void *) 0) #endif #endif /* HEROES__FONTDATA__H */ heroes-0.21/src/gameid.c0000644004117000411500000000470307352614752010600 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "gameid.h" void create_gameid (gameid_ptr gid) { int i; for (i = 0; i < GAMEID_SIZE; ++i) gid[i] = (a_u32) rand (); } void empty_gameid (gameid_ptr gid) { int i; for (i = 0; i < GAMEID_SIZE; ++i) gid[i] = 0; } bool equal_gameid (const gameid_ptr gid1, const gameid_ptr gid2) { int i; for (i = 0; i < GAMEID_SIZE; ++i) if (gid1[i] != gid2[i]) return false; return true; } void copy_gameid (gameid_ptr gid1, const gameid_ptr gid2) { int i; for (i = 0; i < GAMEID_SIZE; ++i) gid1[i] = gid2[i]; } char * gameid_to_text (const gameid_ptr gid) { int i; char *result; XMALLOC_ARRAY (result, GAMEID_SIZE * 8 + 1); for (i = 0; i < GAMEID_SIZE; ++i) sprintf (result + i * 8, "%08X", gid[i]); return result; } bool text_to_gameid (const char *src, gameid_ptr gid) { int i; int j; for (i = 0; i < GAMEID_SIZE; ++i) { gid[i] = 0; for (j = 8; j != 0; --j) { int c = toupper (*src++); gid[i] <<= 4; if (c >= '0' && c <= '9') gid[i] += c - '0'; else if (c >= 'A' && c <= 'F') gid[i] += c - 'A' + 10; else return true; } } return false; } heroes-0.21/src/gameid.h0000644004117000411500000000611607352614752010605 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES_GAMEID_H #define HEROES_GAMEID_H /* * Game IDs are used to identify a game in the scores and * saved-games files. This is needed, because when a player continue a * saved game which alrady have a high-score, this high-score should * be updated on the next save, rather than creating a new score. * * Older versions of Heroes (up to 0.9) used to associate a 8 bit * value (called `magic' for the sake of a better name) to each game. * The list of used magics was scanned whenever a new magic was needed, * and the first unused value was selected. * * This approach has one drawback: you need to know all the values * used to select a new one which doesn't clash. If you consider the * case where there is a global score file for all user, but local * savedgames files in each user HOME dir, it cannot work: you * would need the scan the savedgames file of each user. * * The present implementation represents Game IDs as 128bits values. * Those values are initialized randomly, and actually they are not * checked against already used values. Even if this latter check * was done this would ont be bulletproof (the case described in the * above paragraph can still cause clashes), so I consider it's not * worth the pain since the width of the value make conflicts extremly * unlikely anyway. Other ideas are welcome! */ #define GAMEID_SIZE 4 typedef a_u32 a_gameid[GAMEID_SIZE]; typedef a_u32 *gameid_ptr; void create_gameid (gameid_ptr gid); void empty_gameid (gameid_ptr gid); bool equal_gameid (const gameid_ptr gid1, const gameid_ptr gid2); void copy_gameid (gameid_ptr gid1, const gameid_ptr gid2); char *gameid_to_text (const gameid_ptr gid); /* Return true on error. */ bool text_to_gameid (const char *src, gameid_ptr gid); #endif /* HEROES_GAMEID_H */ heroes-0.21/src/generic_list.h0000644004117000411500000001150207352614752012021 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /* * This is a generic list. Since `void*' is evil, all that file is * written as a macro that will instanciate the list structures and * functions for a given type. * * Three macros are defined: * * NEW_LIST_SPEC(PREFIX,TYPE) * generate the declarations, * * NEW_LIST_BODY(PREFIX,TYPE,EQUAL_P,DESTRUCTOR) * generate the corresponding definitions * * NEW_LIST(PREFIX,TYPE,EQUAL_P,DESTRUCTOR) * is a shorthand that generates both. * * PREFIX is prepended to each function and structure created. * TYPE is the plain type of the data hold by the cells. * EQUAL_P is a binary function used to compare to cells. * DESTRUCTOR is a fonction call before a cell is freed. * * Additionally, NULL_DESTRUCTOR can be used as a DESTRUCTOR argument * when none are needed; and STD_EQUAL is the standard equal * comparison function (==), meant to be used as a EQUAL_P argument. */ #define NULL_DESTRUCTOR(x) ; #define STD_EQUAL(a, b) ((a) == (b)) /* Indenting rules of most editors require to put a semicolon after * the call to these macros, as in * NEW_LIST_SPEC(foo,int); * ^^^ * Therefore macros should arrange so that this trailing semicolon is * legal (out of functions, a single semicolon left alone is * considered as an empty declaration which is not legal). */ #define NEW_LIST_SPEC(PREFIX,TYPE) \ \ struct PREFIX##_list { \ TYPE car; \ struct PREFIX##_list* cdr; \ }; \ \ typedef struct PREFIX##_list* PREFIX##_list; \ \ PREFIX##_list PREFIX##_cons (TYPE value, PREFIX##_list tail); \ void PREFIX##_delete (PREFIX##_list* list); \ PREFIX##_list PREFIX##_member (PREFIX##_list list, TYPE value); \ void PREFIX##_push (PREFIX##_list* list, TYPE value); \ TYPE PREFIX##_pop (PREFIX##_list* list); \ void PREFIX##_clear (PREFIX##_list* list) #define NEW_LIST_BODY(PREFIX,TYPE,EQUAL_P,DESTRUCTOR) \ \ PREFIX##_list \ PREFIX##_cons (TYPE value, PREFIX##_list tail) \ { \ PREFIX##_list result = malloc (sizeof (*result)); \ result->car = value; \ result->cdr = tail; \ return result; \ } \ \ void \ PREFIX##_delete (PREFIX##_list* list) \ { \ PREFIX##_list result = *list; \ *list = (*list)->cdr; \ free (result); \ } \ \ PREFIX##_list \ PREFIX##_member (PREFIX##_list list, TYPE value) \ { \ while (list) { \ if (EQUAL_P (list->car, value)) \ return list; \ list = list->cdr; \ } \ return 0; \ } \ \ void \ PREFIX##_push (PREFIX##_list* list, TYPE value) \ { \ *list = PREFIX##_cons (value, *list); \ } \ \ TYPE \ PREFIX##_pop (PREFIX##_list* list) \ { \ TYPE result = (*list)->car; \ PREFIX##_delete (list); \ return result; \ } \ \ void \ PREFIX##_clear (PREFIX##_list* list) \ { \ PREFIX##_list next; \ \ while (*list) { \ next = (*list)->cdr; \ DESTRUCTOR ((*list)->car); \ free (*list); \ *list = next; \ } \ } \ \ extern void dummy_function_declaration_to_eat_ending_semicolon (void) #define NEW_LIST(PREFIX,TYPE,EQUAL_P,DESTRUCTOR) \ NEW_LIST_SPEC(PREFIX,TYPE); \ NEW_LIST_BODY(PREFIX,TYPE,EQUAL_P,DESTRUCTOR) heroes-0.21/src/hedlite.c0000644004117000411500000013447107430322370010763 /*------------------------------------------------------------------------. | Copyright 1996, 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /* * Warning: this file is really ugly. It is among the first files * I written when I was learning C... I hope to correct things as time * goes. */ #include "system.h" #include "video.h" #include "pcx.h" #include "errors.h" #include "fastmem.h" #include "keyb.h" #include "keyvalues.h" #include "font.h" #include "structs.h" #include "misc.h" #include "hedlite.h" #include "bytesex.h" #include "hendian.h" #include "userdir.h" #include "rsc_files.h" #include "debugmsg.h" #include "const.h" #include "dirname.h" static a_pcx_image heditrsc; static a_pcx_image tile_set_img; unsigned short int xdalles = 0; unsigned short int ydalles = 0; unsigned short int xdallesdec = 0; unsigned short int xplan = 0; unsigned short int yplan = 0; unsigned int tempd = DONT_WRAP; unsigned int xplandec = 0; unsigned int yplandec = 0; unsigned int sprhide = 0; unsigned int draw_collide_tests = 0; static a_level_header hplaninfo = { 0, 0, -1, -1, {0, 0, 0, 0}, {0, 0, 0, 0}, "", "", "" }; static char *tile_set_name; static char *dallepie; static char levelnomshort[13]; static char pcxnom[13]; static char nombre[5]; static FILE *ftmp; static int square_offset[4] = { 0, 12, xbuf * 10, xbuf * 10 + 12 }; static int square_offset_320[4] = { 0, 12, 3200, 3212 }; static int cote = 0; static a_pixel *hedit_buffer; static a_tile *level_map; static a_tile_info *ddef; /* tiles definitions */ static unsigned char *outwaymap; static unsigned char *hdradar; static unsigned char *hdcolli; /* A few callback functions */ static void tunnel_mod (int, int, int); static void anim_mod (int, int, int); static void fn0 (int, int, int); static void speed_mod (int, int, int); static void stop_mod (int, int, int); void (*fnptr[type_nbr]) (int, int, int) = { &fn0, &stop_mod, &speed_mod, &tunnel_mod, &stop_mod, &anim_mod, &stop_mod, &stop_mod, &fn0 }; static const char *type_name[] = { "NONE", "STOP", "SPEED", "TUNNEL", "BOOM", "ANIM", "ICE", "DUST", "OUTWAY" }; static char spd_test[9][12] = { {2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8}, {2, 2, 2, 4, 4, 4, 4, 4, 4, 8, 8, 8}, {2, 2, 2, 2, 4, 4, 4, 4, 8, 8, 8, 8}, {2, 2, 2, 2, 2, 4, 4, 8, 8, 8, 8, 8}, {2, 2, 2, 2, 2, 2, 8, 8, 8, 8, 8, 8}, {2, 2, 2, 2, 2, 1, 1, 8, 8, 8, 8, 8}, {2, 2, 2, 2, 1, 1, 1, 1, 8, 8, 8, 8}, {2, 2, 2, 1, 1, 1, 1, 1, 1, 8, 8, 8}, {2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8} }; static char dir_test[9][12] = { {1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3}, {1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3}, {1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3}, {1, 1, 1, 1, 1, 2, 2, 3, 3, 3, 3, 3}, {1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 3}, {1, 1, 1, 1, 1, 0, 0, 3, 3, 3, 3, 3}, {1, 1, 1, 1, 0, 0, 0, 0, 3, 3, 3, 3}, {1, 1, 1, 0, 0, 0, 0, 0, 0, 3, 3, 3}, {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3} }; static void rectangle_copy (int xs, int ys, int xd, int yd, int xc, int yc, a_pcx_image *source) { int src_width = source->width; a_pixel *src = source->buffer + src_width * ys + xs; a_pixel *dest = hedit_buffer + xc + yc * xbuf; int j; for (j = yd; j > 0; j--) { memcpy (dest, src, xd); src += src_width; dest += xbuf; } } static void copy_tile (int src_, a_pixel *dest) { int i = tile_set_img.width; int j; a_pixel *src = tile_set_img.buffer + src_; for (j = 20; j > 0; j--) { fastmem4 (src, dest, 24 >> 2); src += i; dest += xbuf; } } static void copy_tile_pcx (int src_, a_pixel *dest) { int i = tile_set_img.width; int j; a_pixel *src = tile_set_img.buffer + src_; for (j = 20; j > 0; j--) { fastmem4 (src, dest, 24 >> 2); src += i; dest += hplaninfo.xt * 24; } } static void copy_tile_transp (int src_, a_pixel *dest) { int i = tile_set_img.width; int j, k; a_pixel *src = tile_set_img.buffer + src_; for (j = 20; j > 0; j--) { for (k = 24; k > 0; k--) { if (*src != 0) *dest = *src; src++; dest++; } src += i - 24; dest += xbuf - 24; } } static void copy_tile_transp_pcx (int src_, a_pixel *dest) { int i = tile_set_img.width; int j, k; a_pixel *src = tile_set_img.buffer + src_; for (j = 20; j > 0; j--) { for (k = 24; k > 0; k--) { if (*src != 0) *dest = *src; src++; dest++; } src += i - 24; dest += hplaninfo.xt * 24 - 24; } } static void copy_square_transp (a_pixel *src, a_pixel *dest) { int j, k; for (j = 10; j > 0; j--) { for (k = 12; k > 0; k--) { if (*src != 0) *dest = *src; src++; dest++; } src += 320 - 12; dest += xbuf - 12; } } static void copy_square_transp_pcx (a_pixel *src, a_pixel *dest) { int j, k; for (j = 10; j > 0; j--) { for (k = 12; k > 0; k--) { if (*src != 0) *dest = *src; src++; dest++; } src += 320 - 12; dest += hplaninfo.xt * 24 - 12; } } static void frame (int x, int y, int xd, int yd, a_pixel col) { int i; a_pixel *dest = hedit_buffer + y * xbuf + x; for (i = xd; i > 0; i--) { dest[yd * xbuf] = col; *dest++ = col; }; for (i = yd; i >= 0; i--) { dest[-xd] = col; *dest = col; dest += xbuf; }; } static void frame_dashed (int x, int y, int xd, int yd, a_pixel col1, a_pixel col2) { int i; a_pixel *dest = hedit_buffer + y * xbuf + x; for (i = (xd >> 1); i > 0; i--) { dest[(yd - 1) * xbuf] = col1; *dest++ = col2; dest[(yd - 1) * xbuf] = col2; *dest++ = col1; }; xd--; dest--; for (i = (yd >> 1); i > 0; i--) { dest[-xd] = col2; *dest = col1; dest += xbuf; dest[-xd] = col1; *dest = col2; dest += xbuf; }; } static void draw_text (const char *texte, int posx, int posy, a_pixel coul, char cent) { int i, j; int k1, k2, d = -1; a_pixel *dest = hedit_buffer + posx + posy * xbuf; a_pixel *src; const char *tmp = texte; for (; *tmp != 0; tmp++) { i = *tmp - font_first_ascii; d += font_width[i] + 1; } if (cent == 0) d = 0; if (cent == 1) d = -(d >> 1); if (cent == 2) d = -d; dest += d; for (; *texte != 0; texte++) { i = *texte - font_first_ascii; src = heditrsc.buffer + font_pos + ((int) (i) << 2); for (j = font_width[i]; j > 0; j--) { for (k1 = 320 * (font_height - 1), k2 = xbuf * (font_height - 1); k1 >= 0; k1 -= 320, k2 -= xbuf) if (src[k1] != font_transp_color) dest[k2] = coul; dest++; src++; } dest++; } } static void transpa (a_pixel *source, a_pixel *dest, int xt, int yt, char coul) { int x, y; for (y = yt; y > 0; y--) { for (x = xt; x > 0; x--) if (*source != coul) *dest++ = *source++; else { dest++; source++; } source += 320 - xt; dest += xbuf - xt; }; } static void transpac (a_pixel *source, a_pixel *dest, int xt, int yt, char coul) { int x, y; for (y = yt; y > 0; y--) { for (x = xt; x > 0; x--) if (*source != coul) *dest++ = *source++; else { dest++; source++; } source += 320 - xt; dest += hplaninfo.xt * 24 - xt; }; } static void draw_check_point (int x, int y, a_pixel c) { a_pixel *dest = hedit_buffer + x + y * xbuf; if (c) c = 8; *dest = 0; dest[0] = 0; dest[1] = 0; dest[2] = 0; dest[3] = 0; dest += xbuf; dest[0] = 0; dest[1] = c; dest[2] = c; dest[3] = 0; dest += xbuf; dest[0] = 0; dest[1] = c; dest[2] = c; dest[3] = 0; dest += xbuf; dest[0] = 0; dest[1] = 0; dest[2] = 0; dest[3] = 0; } static void draw_left_panel (int t) { switch (level_map[t].type) { case t_speed: transpa (IMGPOS (heditrsc, 20, 30 + level_map[t].info.param[0] * 12 + 1), hedit_buffer + 294 + 88 * xbuf, 10, 9, 71); transpa (IMGPOS (heditrsc, 20, 30 + level_map[t].info.param[1] * 12 + 1), hedit_buffer + 306 + 88 * xbuf, 10, 9, 71); transpa (IMGPOS (heditrsc, 20, 30 + level_map[t].info.param[2] * 12 + 1), hedit_buffer + 294 + 99 * xbuf, 10, 9, 71); transpa (IMGPOS (heditrsc, 20, 30 + level_map[t].info.param[3] * 12 + 1), hedit_buffer + 306 + 99 * xbuf, 10, 9, 71); rectangle_copy (0, 112, 30, 27, 290, 112, &heditrsc); if ((level_map[t].info.param[4] >> 4) > 0) { rectangle_copy (60, 168, 30, 32, 290, 168, &heditrsc); sprintf (nombre, "%u", level_map[t].info.param[4] & 0xf); draw_text (nombre, 311, 193, 8, 1); } else rectangle_copy (0, 168, 30, 32, 290, 168, &heditrsc); break; case t_dust: case t_ice: case t_boom: case t_stop: draw_check_point (297, 91, level_map[t].info.param[0]); draw_check_point (297 + 12, 91, level_map[t].info.param[1]); draw_check_point (297, 91 + 10, level_map[t].info.param[2]); draw_check_point (297 + 12, 91 + 10, level_map[t].info.param[3]); rectangle_copy (0, 112, 30, 27, 290, 112, &heditrsc); case t_outway: if ((level_map[t].info.param[4] >> 4) > 0) { rectangle_copy (60, 168, 30, 32, 290, 168, &heditrsc); sprintf (nombre, "%u", level_map[t].info.param[4] & 0xf); draw_text (nombre, 311, 193, 8, 1); } else rectangle_copy (0, 168, 30, 32, 290, 168, &heditrsc); break; case t_tunnel: transpa (IMGPOS (heditrsc, 20, 30 + level_map[t].info.tunnel.direction * 12 + 1), hedit_buffer + 294 + 88 * xbuf, 10, 9, 71); transpa (IMGPOS (heditrsc, 20, 30 + level_map[t].info.tunnel.direction * 12 + 1), hedit_buffer + 306 + 88 * xbuf, 10, 9, 71); transpa (IMGPOS (heditrsc, 20, 30 + level_map[t].info.tunnel.direction * 12 + 1), hedit_buffer + 294 + 99 * xbuf, 10, 9, 71); transpa (IMGPOS (heditrsc, 20, 30 + level_map[t].info.tunnel.direction * 12 + 1), hedit_buffer + 306 + 99 * xbuf, 10, 9, 71); rectangle_copy (120, 112, 30, 27, 290, 112, &heditrsc); sprintf (nombre, "%u", level_map[t].info.tunnel.output / hplaninfo.xt); draw_text (nombre, 307, 133, 8, 0); sprintf (nombre, "%u", level_map[t].info.tunnel.output % hplaninfo.xt); draw_text (nombre, 302, 133, 8, 2); break; case t_anim: rectangle_copy (150 + 60, 112, 30, 27, 290, 112, &heditrsc); sprintf (nombre, "%u", level_map[t].info.anim.speed); draw_text (nombre, 311, 133, 8, 1); rectangle_copy (0, 168, 30, 32, 290, 168, &heditrsc); break; default: rectangle_copy (0, 112, 30, 27, 290, 112, &heditrsc); rectangle_copy (0, 168, 30, 32, 290, 168, &heditrsc); break; } } static void fn0 (int a ATTRIBUTE_UNUSED, int b ATTRIBUTE_UNUSED, int c ATTRIBUTE_UNUSED) { } static void speed_mod (int i, int x, int y) { int l = 0; unsigned char m; if (y < 112) { if (y > 98) { l = 2; y = y - 99; } else y = y - 88; if (x >= 305) { l++; x = x - 305; } else x = x - 293; if (x > 11 || y > 8 || x < 0 || y < 0) return; m = spd_test[y][x] & 0xf; if (cote) ddef[i].info.param[l] ^= m; else level_map[i].info.param[l] ^= m; } else { m = 1 << ((y - 112) / 7); for (l = 3; l >= 0; l--) { if (cote) ddef[i].info.param[l] ^= m; else level_map[i].info.param[l] ^= m; } } } static void stop_mod (int i, int x, int y) { int l = 0; if (y < 112) { if (y > 98) l = 2; if (x >= 305) l++; if (cote) ddef[i].info.param[l] ^= 1; else level_map[i].info.param[l] ^= 1; } else { if (y >= 112 && y < 119) { if (cote) ddef[i].info.tunnel.output = 0x1010101; else level_map[i].info.tunnel.output = 0x1010101; } else if (y >= 119 && y < 126) { if (cote) ddef[i].info.tunnel.output = 0; else level_map[i].info.tunnel.output = 0; } } } static void tunnel_mod (int i, int x ATTRIBUTE_UNUSED, int y) { if (y > 126 && y < 133 && tempd != DONT_WRAP) level_map[i].info.tunnel.output = tempd; } static void anim_mod (int i, int x, int y) { unsigned char m; if (y >= 112 && x < 305) { m = ((y - 112) / 7); { if (m >= 2) level_map[i].info.anim.speed += ((m == 2) ? +1 : -1); } } } static void anim_mod_bcl (int i, int x, int y) { unsigned char m; if (y >= 172 && x < 305) { m = ((y - 172) / 7); { if (m >= 2 && (level_map[i].info.param[4] >> 4) > 0) level_map[i].info.param[4] = (level_map[i].info.param[4] & 0xf0) | ((level_map[i].info.param[4] + ((m == 2) ? +1 : -1)) & 0xf); } } } static void update_middle_panel (void) { rectangle_copy (xdalles, 0, 144, 200, 145, 0, &tile_set_img); frame (145 + xdallesdec, ydalles, 23, 19, 15); rectangle_copy (0, 64, 30, 6, 290, 64, &heditrsc); sprintf (nombre, "%u", (xdalles + xdallesdec) / 24); draw_text (nombre, 302, 64, 15, 2); sprintf (nombre, "%u", ydalles / 20); draw_text (nombre, 307, 64, 15, 0); vsynchro (hedit_buffer); } static void draw_level_map (int xloc, int yloc, char c) { int j; unsigned int i, k, m; int l, n; a_pixel *dest = hedit_buffer; int xx, yy = 7; for (k = yloc, l = 10; l > 0; l--, k = ((k + 1) & hplaninfo.ywrap)) { m = k * hplaninfo.xt; xx = 12; for (i = xloc, j = 6 + c; j > 0; j--, i = ((i + 1) & hplaninfo.xwrap)) { copy_tile (level_map[i + m].number, dest); if (sprhide == 0) { for (n = 0; n < 4; n++) if (i + m == hplaninfo.start[n]) copy_square_transp (heditrsc.buffer + (16 + (n << 4)) * 320 + 256 + (hplaninfo.start_way[n] & 0xf0), dest + square_offset[hplaninfo.start_way[n] & 0xf]); if (level_map[i + m].sprite != 0) copy_tile_transp (level_map[i + m].sprite, dest); } if (draw_collide_tests) { if (level_map[i + m].type == t_outway) transpa (heditrsc.buffer + 10 * 320 + 222, dest, 24, 20, 0); else for (n = 0; n < 4; n++) if (level_map[i + m].collision[n] == 0xf) copy_square_transp (heditrsc.buffer + 10 * 320 + 222 + square_offset_320[n], dest + square_offset[n]); else copy_square_transp (heditrsc.buffer + 10 * 320 + 30 + level_map[i + m].collision[n] * 12, dest + square_offset[n]); } if (i + m == tempd) frame_dashed (xx - 12, yy - 7, 24, 20, 8, 15); dest += 24; xx += 24; } dest += 20 * xbuf - 24 * (6 + c); yy += 20; } vsynchro (hedit_buffer); } static unsigned int curdallep (void) { unsigned int i = ((xplan + xplandec / 24) & hplaninfo.xwrap) + ((yplan + yplandec / 20) & hplaninfo.ywrap) * hplaninfo.xt; return i; } static int curdallepg (int c) { int x = c % hplaninfo.xt; if (x > 0) return (c - 1); else if (hplaninfo.xwrap != DONT_WRAP) return (c + hplaninfo.xt - 1); return -1; } static int curdalleph (int c) { int y = c / hplaninfo.xt; if (y > 0) return (c - hplaninfo.xt); else if (hplaninfo.ywrap != DONT_WRAP) return (c + hplaninfo.xt * (hplaninfo.yt - 1)); return -1; } static int curdallepd (int c) { unsigned int x = c % hplaninfo.xt; if (x + 1 < hplaninfo.xt) return (c + 1); else if (hplaninfo.xwrap != DONT_WRAP) return (c - hplaninfo.xt + 1); return -1; } static int curdallepb (int c) { unsigned int y = c / hplaninfo.xt; if (y + 1 < hplaninfo.yt) return (c + hplaninfo.xt); else if (hplaninfo.ywrap != DONT_WRAP) return (c % hplaninfo.xt); return -1; } static int curdalled (void) { int i = (xdalles + xdallesdec) / 24 + (ydalles / 20) * (tile_set_img.width / 24); return i; } static void update_left_panel (void) { draw_level_map (xplan, yplan, 0); { copy_tile (level_map [((xplan + xplandec / 24) & hplaninfo.xwrap) + ((yplan + yplandec / 20) & hplaninfo.ywrap) * hplaninfo.xt].number, hedit_buffer + 293 + 88 * xbuf); draw_left_panel (curdallep ()); rectangle_copy (0, 71, 30, 13, 290, 71, &heditrsc); if (level_map[curdallep ()].sprite != 0) draw_text ("[S]", 309, 71, 8, 0); draw_text (type_name[level_map[curdallep ()].type], 304, 78, 8, 1); } frame (xplandec, yplandec, 23, 19, 8); rectangle_copy (0, 57, 30, 6, 290, 57, &heditrsc); sprintf (nombre, "%u", ((xplan + xplandec / 24) & hplaninfo.xwrap)); draw_text (nombre, 302, 57, 8, 2); sprintf (nombre, "%u", ((yplan + yplandec / 20) & hplaninfo.ywrap)); draw_text (nombre, 307, 57, 8, 0); vsynchro (hedit_buffer); } static void departfix (void) { unsigned int d = curdallep (), i; signed int x, y; static unsigned char c = 0; unsigned char l = 0, m, flag; copy_tile (level_map [((xplan + xplandec / 24) & hplaninfo.xwrap) + ((yplan + yplandec / 20) & hplaninfo.ywrap) * hplaninfo.xt].number, hedit_buffer + 293 + 88 * xbuf); while (mouse12 () != 0); do { transpa (heditrsc.buffer + 31 + 20 * 320, hedit_buffer + 294 + 88 * xbuf, 10, 9, 71); for (i = 0; i < 4; i++) if (hplaninfo.start[i] == d && (hplaninfo.start_way[i] & 0xf) == 0) transpa (IMGPOS (heditrsc, 29 + i * 9, 31 + (hplaninfo.start_way[i] >> 4) * 12), hedit_buffer + 294 + 88 * xbuf, 10, 9, 71); transpa (IMGPOS (heditrsc, 20, 31), hedit_buffer + 306 + 88 * xbuf, 10, 9, 71); for (i = 0; i < 4; i++) if (hplaninfo.start[i] == d && (hplaninfo.start_way[i] & 0xf) == 1) transpa (IMGPOS (heditrsc, 29 + i * 9, 31 + (hplaninfo.start_way[i] >> 4) * 12), hedit_buffer + 306 + 88 * xbuf, 10, 9, 71); transpa (IMGPOS (heditrsc, 20, 31), hedit_buffer + 294 + 99 * xbuf, 10, 9, 71); for (i = 0; i < 4; i++) if (hplaninfo.start[i] == d && (hplaninfo.start_way[i] & 0xf) == 2) transpa (IMGPOS (heditrsc, 29 + i * 9, 31 + (hplaninfo.start_way[i] >> 4) * 12), hedit_buffer + 294 + 99 * xbuf, 10, 9, 71); transpa (IMGPOS (heditrsc, 20, 31), hedit_buffer + 306 + 99 * xbuf, 10, 9, 71); for (i = 0; i < 4; i++) if (hplaninfo.start[i] == d && (hplaninfo.start_way[i] & 0xf) == 3) transpa (IMGPOS (heditrsc, 29 + i * 9, 31 + (hplaninfo.start_way[i] >> 4) * 12), hedit_buffer + 306 + 99 * xbuf, 10, 9, 71); rectangle_copy (90, 112, 30, 27, 290, 112, &heditrsc); rectangle_copy (96 + c * 5, 139, 4, 4, 296 + c * 5, 112, &heditrsc); vsynchro (hedit_buffer); while (mouse12 () == 0 && key_ready () == 0); if (mouse1 ()) { x = mouse_coord_x (); y = mouse_coord_y (); if (y < 112) { l = 0; if (y > 98) { l = 2; y = y - 99; } else y = y - 88; if (x >= 305) { l++; x = x - 305; } else x = x - 293; if (!(x > 11 || y > 8 || x < 0 || y < 0)) { flag = 0; m = dir_test[y][x] & 0x3; for (i = 0; i < 4; i++) if (hplaninfo.start[i] == d && (hplaninfo.start_way[i] & 0xf) == l && i != c) flag = 1; if (flag == 0) { hplaninfo.start[c] = d; hplaninfo.start_way[c] = (m << 4) + l; draw_level_map (xplan, yplan, 0); } while (mouse12 () != 0); } } else { if (y < 116 && x >= 296 && x <= 316) c = (x - 296) / 5; while (mouse12 () != 0); } } } while (mouse_coord_x () > 290 && (!key_ready ()) && mouse2 () == 0); update_left_panel (); } static void write_rle (a_pixel *src, int t, FILE * fpcx) { a_pixel old, new; int i; int nbr = 1; old = *src++; for (i = 1; i < t; i++) { new = *src++; if (nbr == 63 || (nbr > 1 && (new != old))) { putc (nbr | 192, fpcx); putc (old, fpcx); old = new; nbr = 1; } else if (old == new && nbr < 63) nbr++; else { if (old < 192) putc (old, fpcx); else { putc (193, fpcx); putc (old, fpcx); } old = new; } } if (nbr == 1) { if (old < 192) putc (old, fpcx); else { putc (193, fpcx); putc (old, fpcx); } } else { putc (nbr | 192, fpcx); putc (old, fpcx); } } static void save_level_as_pcx (void) { FILE *fpcx; a_pcx_header headpcx; unsigned int i1, i3, n; unsigned int j3; a_pixel *tempc; a_pixel *dest; int sdec[4]; XMALLOC_ARRAY (tempc, hplaninfo.xt * 20 * 24); sdec[0] = 0; sdec[1] = 12; sdec[2] = hplaninfo.xt * 24 * 10; sdec[3] = hplaninfo.xt * 24 * 10 + 12; headpcx.signature = 10; headpcx.version = 5; headpcx.rle = 1; headpcx.bits_per_pixels = 8; headpcx.x = headpcx.y = BSWAP16 (0); headpcx.palette_kind = BSWAP16 (1); headpcx.width = BSWAP16 ((hplaninfo.xt * 24) - 1); headpcx.height = BSWAP16 ((hplaninfo.yt * 20) - 1); headpcx.bytes_per_lines = headpcx.widthdpi = BSWAP16 (hplaninfo.xt * 24); headpcx.heightdpi = BSWAP16 (hplaninfo.yt * 20); headpcx.nbrplanes = 1; if ((fpcx = fopen (pcxnom, "wb")) == NULL) return; fwrite ((char *) &headpcx, 1, sizeof (a_pcx_header), fpcx); for (i3 = 0; i3 < hplaninfo.yt; i3++) { j3 = hplaninfo.xt * i3; dest = tempc; for (i1 = 0; i1 < hplaninfo.xt; i1++) { copy_tile_pcx (level_map[i1 + j3].number, dest); if (sprhide == 0) { for (n = 0; n < 4; n++) if (i1 + j3 == hplaninfo.start[n]) copy_square_transp_pcx (heditrsc.buffer + (16 + (n << 4)) * 320 + 256 + (hplaninfo.start_way[n] & 0xf0), dest + sdec[hplaninfo.start_way[n] & 0xf]); if (level_map[i1 + j3].sprite != 0) copy_tile_transp_pcx (level_map[i1 + j3].sprite, dest); } if (draw_collide_tests) { if (level_map[i1 + j3].type == t_outway) transpac (heditrsc.buffer + 10 * 320 + 222, dest, 24, 20, 0); else for (n = 0; n < 4; n++) if (level_map[i1 + j3].collision[n] == 0xf) copy_square_transp_pcx (heditrsc.buffer + 10 * 320 + 222 + square_offset_320[n], dest + square_offset[n]); else copy_square_transp_pcx (heditrsc.buffer + 10 * 320 + 30 + level_map[i1 + j3].collision[n] * 12, dest + square_offset[n]); } dest += 24; } write_rle (tempc, hplaninfo.xt * 20 * 24, fpcx); } free (tempc); putc (0xC, fpcx); for (i1 = 0; i1 < 768; i1++) putc (tile_set_img.palette.global[i1] << 2, fpcx); fclose (fpcx); } static void display_level_map_fullscreen (void) { a_keycode t; int x, y, xm = 128, ym = 100; memset (hedit_buffer, 0, xbuf * 200); if (xplan > (hplaninfo.xt - 13) && hplaninfo.xwrap == DONT_WRAP) xplan = hplaninfo.xt - 13; draw_level_map (xplan, yplan, 7); while (mouse12 () != 0); do { draw_level_map (xplan, yplan, 7); t = 0; while (key_ready () == 0 && (xm - mouse_coord_x ()) <= 1 && (mouse_coord_x () - xm) <= 1 && (ym - mouse_coord_y ()) <= 1 && (mouse_coord_y () - ym) <= 1 && mouse12 () == 0); if (key_ready ()) t = get_key (); x = mouse_coord_x (); y = mouse_coord_y (); if (t == HK_Right || (x - xm) > 1) { if (xplan < (hplaninfo.xt - 13) || hplaninfo.xwrap != DONT_WRAP) xplan = ((xplan + 1) & hplaninfo.xwrap); xm = x; } if (t == HK_Left || (xm - x) > 1) { if (xplan > 0 || hplaninfo.xwrap != DONT_WRAP) xplan = ((xplan - 1) & hplaninfo.xwrap); xm = x; } if (t == HK_Down || (y - ym) > 1) { if (yplan < (hplaninfo.yt - 10) || hplaninfo.ywrap != DONT_WRAP) yplan = ((yplan + 1) & hplaninfo.ywrap); ym = y; } if (t == HK_Up || (ym - y) > 1) { if (yplan > 0 || hplaninfo.ywrap != DONT_WRAP) yplan = ((yplan - 1) & hplaninfo.ywrap); ym = y; } } while (t != HK_Enter && t != HK_Space && t != HK_Escape && mouse12 () == 0); memset (hedit_buffer, 0, xbuf * 200); rectangle_copy (0, 0, 30, 200, 290, 0, &heditrsc); draw_text (levelnomshort, 305, 29, 8, 1); sprintf (nombre, "%u", hplaninfo.xt); draw_text (nombre, 302, 43, 8, 2); sprintf (nombre, "%u", hplaninfo.yt); draw_text (nombre, 307, 43, 8, 0); update_middle_panel (); update_left_panel (); } static void outwayinit (void) { XMALLOC_ARRAY (outwaymap, hplaninfo.xt * hplaninfo.yt * 4); XMALLOC_ARRAY (hdradar, hplaninfo.xt * hplaninfo.yt * 4); XMALLOC_ARRAY (hdcolli, hplaninfo.xt * hplaninfo.yt * 4); } static void outwayflag (void) { char flag, flag2; int d, tmp, tmp2; unsigned int i, j, k, l; memset (outwaymap, 0, hplaninfo.xt * hplaninfo.yt * 4); memset (hdradar, 0, hplaninfo.xt * hplaninfo.yt * 4); memset (hdcolli, 0, hplaninfo.xt * hplaninfo.yt * 4); j = 0; l = 0; for (k = 0; k < hplaninfo.yt; k++) { for (i = 0; i < hplaninfo.xt; i++) { hdradar[j] = level_map[i + l].collision[0]; hdradar[j + 1] = level_map[i + l].collision[1]; hdradar[j + hplaninfo.xt * 2] = level_map[i + l].collision[2]; hdradar[j + hplaninfo.xt * 2 + 1] = level_map[i + l].collision[3]; j += 2; } j += hplaninfo.xt * 2; l += hplaninfo.xt; } if (hplaninfo.ywrap != DONT_WRAP) { for (i = 0; i < hplaninfo.xt * 2; i++) { if (hdradar[(hplaninfo.ywrap * 2 + 1) * hplaninfo.xt * 2 + i] & c_down) hdcolli[i] |= d_up; if (hdradar[i] & c_up) hdcolli[(hplaninfo.ywrap * 2 + 1) * hplaninfo.xt * 2 + i] |= d_down; } } else for (i = 0; i < hplaninfo.xt * 2; i++) { hdcolli[i] |= d_up; hdcolli[(hplaninfo.yt * 2 - 1) * hplaninfo.xt * 2 + i] |= d_down; }; if (hplaninfo.xwrap != DONT_WRAP) { for (i = 0; i < hplaninfo.yt * 2; i++) { if (hdradar[i * hplaninfo.xt * 2 + hplaninfo.xwrap * 2 + 1] & c_right) hdcolli[i * hplaninfo.xt * 2] |= d_left; if (hdradar[i * hplaninfo.xt * 2] & c_left) hdcolli[hplaninfo.xwrap * 2 + 1 + i * hplaninfo.xt * 2] |= d_right; } } else for (i = 0; i < hplaninfo.yt * 2; i++) { hdcolli[i * hplaninfo.xt * 2] |= d_left; hdcolli[hplaninfo.xt * 2 - 1 + i * hplaninfo.xt * 2] |= d_right; }; j = 0; for (k = hplaninfo.yt * 2 - 1; k != 0; k--) { for (i = 0; i < hplaninfo.xt * 2; i++) { if (hdradar[j + i] & c_down) hdcolli[j + i + hplaninfo.xt * 2] |= d_up; if (hdradar[j + i + hplaninfo.xt * 2] & c_up) hdcolli[j + i] |= d_down; } j += hplaninfo.xt * 2; } j = 0; for (k = hplaninfo.yt * 2; k != 0; k--) { for (i = 0; i < hplaninfo.xt * 2 - 1; i++) { if (hdradar[j + i] & c_right) hdcolli[j + i + 1] |= d_left; if (hdradar[j + i + 1] & c_left) hdcolli[j + i] |= d_right; } j += hplaninfo.xt * 2; } for (k = 0; k < 4; k++) { l = hplaninfo.start_way[k] & 15; i = (hplaninfo.start[k] % hplaninfo.xt) * 2; j = (hplaninfo.start[k] / hplaninfo.xt) * 2; if (l == 1) i++; else if (l == 2) j++; else if (l == 3) { i++; j++; } outwaymap[i + j * hplaninfo.xt * 2] = 1; } k = 0; l = 0; for (j = 0; j < hplaninfo.yt; j++) { for (i = 0; i < hplaninfo.xt; i++, l++) if (level_map[l].type == t_tunnel) { outwaymap[i * 2 + k] = 1; outwaymap[i * 2 + k + 1] = 1; outwaymap[i * 2 + k + hplaninfo.xt * 2] = 1; outwaymap[i * 2 + k + hplaninfo.xt * 2 + 1] = 1; } k += hplaninfo.xt << 2; } do { flag = 0; for (k = 0, j = 0; k < 2 * hplaninfo.yt; k++, j += 2 * hplaninfo.xt) for (i = 0; i < 2 * hplaninfo.xt; i++) { d = j + i; if (outwaymap[d] == 1) { flag2 = 0; if (!(hdcolli[d] & d_up)) { tmp = (k - 1) & ((hplaninfo.ywrap << 1) + 1); tmp2 = i + tmp * hplaninfo.xt * 2; if (!outwaymap[tmp2]) { outwaymap[tmp2] = 1; flag2 = 1; } } if (!(hdcolli[d] & d_down)) { tmp = (k + 1) & ((hplaninfo.ywrap << 1) + 1); tmp2 = i + tmp * hplaninfo.xt * 2; if (!outwaymap[tmp2]) { outwaymap[tmp2] = 1; flag2 = 1; } } if (!(hdcolli[d] & d_right)) { tmp = (i + 1) & ((hplaninfo.xwrap << 1) + 1); tmp2 = tmp + k * hplaninfo.xt * 2; if (!outwaymap[tmp2]) { outwaymap[tmp2] = 1; flag2 = 1; } } if (!(hdcolli[d] & d_left)) { tmp = (i - 1) & ((hplaninfo.xwrap << 1) + 1); tmp2 = tmp + k * hplaninfo.xt * 2; if (!outwaymap[tmp2]) { outwaymap[tmp2] = 1; flag2 = 1; } } if (flag2 == 0) outwaymap[d] = 2; else flag = 1; } } } while (flag); k = 0; l = 0; for (j = 0; j < hplaninfo.yt; j++) { for (i = 0; i < hplaninfo.xt; i++, l++) { if (!(outwaymap[i * 2 + k])) level_map[l].collision[0] = 15; if (!(outwaymap[i * 2 + k + 1])) level_map[l].collision[1] = 15; if (!(outwaymap[(i + hplaninfo.xt) * 2 + k])) level_map[l].collision[2] = 15; if (!(outwaymap[(i + hplaninfo.xt) * 2 + k + 1])) level_map[l].collision[3] = 15; if (!(outwaymap[i * 2 + k] || outwaymap[i * 2 + 1 + k] || outwaymap[i * 2 + hplaninfo.xt * 2 + k] || outwaymap[i * 2 + hplaninfo.xt * 2 + 1 + k])) { if (level_map[l].type != t_anim) level_map[l].type = t_outway; level_map[l].collision[0] = 15; level_map[l].collision[1] = 15; level_map[l].collision[2] = 15; level_map[l].collision[3] = 15; } } k += hplaninfo.xt << 2; } } static void outwayclose (void) { free (outwaymap); free (hdradar); free (hdcolli); } static void display_level_map_animated (void) { unsigned int i, m; int k, l, j, n; unsigned int tmp; a_pixel *dest; int xx, yy, t = 0; do { dest = hedit_buffer; yy = 7; vsynchro (hedit_buffer); for (k = yplan, l = 10; l > 0; l--, k = ((k + 1) & hplaninfo.ywrap)) { m = k * hplaninfo.xt; xx = 12; for (i = xplan, j = 6; j > 0; j--, i = ((i + 1) & hplaninfo.xwrap)) { if (level_map[i + m].type == t_anim || ((level_map[i + m].type == t_speed || level_map[i + m].type == t_boom || level_map[i + m].type == t_stop || level_map[i + m].type == t_ice || level_map[i + m].type == t_outway || level_map[i + m].type == t_dust) && (level_map[i + m].info.param[4] & 0xf0) != 0)) { if (level_map[i + m].type == t_anim) copy_tile (level_map[i + m].number + 24 * ((t / (level_map[i + m].info.anim.speed + 1)) % (level_map[i + m].info.anim.frame_nbr + 1)), dest); else { tmp = ((t / ((level_map[i + m].info.param[4] & 15) + 1)) % ((level_map[i + m].info.param[4] >> 4) * 2)); if (tmp > ((unsigned int) level_map[i + m]. info.param[4] >> 4))tmp = ((level_map[i + m].info.param[4] >> 4) * 2) - tmp; copy_tile (level_map[i + m].number + 24 * tmp, dest); } if (sprhide == 0) { for (n = 0; n < 4; n++) if (i + m == hplaninfo.start[n]) copy_square_transp (heditrsc.buffer + (16 + (n << 4)) * 320 + 256 + (hplaninfo.start_way[n] & 0xf0), dest + square_offset[hplaninfo.start_way[n] & 0xf]); if (level_map[i + m].sprite != 0) copy_tile_transp (level_map[i + m].sprite, dest); } if (draw_collide_tests) for (n = 0; n < 4; n++) copy_square_transp (heditrsc.buffer + 10 * 320 + 30 + level_map[i + m].collision[n] * 12, dest + square_offset[n]); if (i + m == tempd) frame_dashed (xx - 12, yy - 7, 24, 20, 8, 15); } dest += 24; xx += 24; } dest += 20 * xbuf - 24 * 6; yy += 20; } t++; } while (mouse12 () == 0 && key_ready () == 0); update_left_panel (); update_middle_panel (); } static void gestclav (a_keycode i, a_keycode mod) { char t; int j, k; if (i == HK_Home) { if (mod & HK_MOD_Ctrl) { xdalles = 0; update_middle_panel (); } } else if (i == HK_End) { if (mod & HK_MOD_Ctrl) { xdalles = (tile_set_img.width / 24) * 24 - 144; update_middle_panel (); } } else if (i == HK_PageDown) { if (mod & HK_MOD_Ctrl) { if (ydalles < 180) { ydalles += 20; update_middle_panel (); } else if (xdallesdec < 120) { xdallesdec += 24; update_middle_panel (); } } } else if (i == HK_PageUp) { if (mod & HK_MOD_Ctrl) { if (ydalles > 0) { ydalles -= 20; update_middle_panel (); } else if (xdallesdec > 0) { xdallesdec -= 24; update_middle_panel (); } } } else if (i == HK_Right) { if (mod & HK_MOD_Ctrl) { if (xdalles + 168U < tile_set_img.width) { xdalles += 24; update_middle_panel (); } else if (xdallesdec < 120) { xdallesdec += 24; update_middle_panel (); } } else if (mod & HK_MOD_Shift) { if (xplandec < 120) xplandec += 24; else if (xplan < (hplaninfo.xt - 6) || hplaninfo.xwrap != DONT_WRAP) { xplan = ((xplan + 1) & hplaninfo.xwrap); } update_left_panel (); } else { if (xplan < (hplaninfo.xt - 6) || hplaninfo.xwrap != DONT_WRAP) { xplan = ((xplan + 1) & hplaninfo.xwrap); update_left_panel (); } else gestclav (HK_Right, HK_MOD_Shift); } } else if (i == HK_Left) { if (mod & HK_MOD_Ctrl) { if (xdalles > 0) { xdalles -= 24; update_middle_panel (); } else if (xdallesdec > 0) { xdallesdec -= 24; update_middle_panel (); } } else if (mod & HK_MOD_Shift) { if (xplandec > 0) xplandec -= 24; else if (xplan > 0 || hplaninfo.xwrap != DONT_WRAP) { xplan = ((xplan - 1) & hplaninfo.xwrap); } update_left_panel (); } else { if (xplan > 0 || hplaninfo.xwrap != DONT_WRAP) { xplan = ((xplan - 1) & hplaninfo.xwrap); update_left_panel (); } else gestclav (HK_Left, HK_MOD_Shift); } } else if (i == HK_Down) { if (mod & HK_MOD_Ctrl) { gestclav (HK_PageDown, HK_MOD_Ctrl); } else if (mod & HK_MOD_Shift) { if (yplandec < 180) yplandec += 20; else if (yplan < (hplaninfo.yt - 10) || hplaninfo.ywrap != DONT_WRAP) { yplan = ((yplan + 1) & hplaninfo.ywrap); } update_left_panel (); } else { if (yplan < (hplaninfo.yt - 10) || hplaninfo.ywrap != DONT_WRAP) { yplan = ((yplan + 1) & hplaninfo.ywrap); update_left_panel (); } else gestclav (HK_Down, HK_MOD_Shift); } } else if (i == HK_Up) { if (mod & HK_MOD_Ctrl) { gestclav (HK_PageUp, HK_MOD_Ctrl); } else if (mod & HK_MOD_Shift) { if (yplandec > 0) yplandec -= 20; else if (yplan > 0 || hplaninfo.ywrap != DONT_WRAP) { yplan = ((yplan - 1) & hplaninfo.ywrap); } update_left_panel (); } else { if (yplan > 0 || hplaninfo.ywrap != DONT_WRAP) { yplan = ((yplan - 1) & hplaninfo.ywrap); update_left_panel (); } else gestclav (HK_Up, HK_MOD_Shift); } } else if (i == HK_Enter) { if (mod & HK_MOD_Ctrl) { display_level_map_animated (); } else { display_level_map_fullscreen (); } } else if (i == HK_Space) { j = curdallep (); level_map[j].number = xdalles + xdallesdec + ydalles * (tile_set_img.width); level_map[j].type = ddef[curdalled ()].type; level_map[j].info = ddef[curdalled ()].info; gestclav (HK_i, HK_MOD_None); gestclav (HK_O, HK_MOD_None); update_left_panel (); } else if (i == HK_I || i ==HK_i) { for (j = hplaninfo.xt * hplaninfo.yt - 1; j >= 0; j--) { level_map[j].collision[0] = 0; level_map[j].collision[1] = 0; level_map[j].collision[2] = 0; level_map[j].collision[3] = 0; } for (j = hplaninfo.xt * hplaninfo.yt - 1; j >= 0; j--) { k = (((level_map[j].number % tile_set_img.width) / 24) + (level_map[j].number / (tile_set_img.width * 20)) * (tile_set_img.width / 24)); level_map[j].type = ddef[k].type; if (level_map[j].type != t_tunnel) { if (level_map[j].type == t_anim || i == 0x1749) level_map[j].info = ddef[k].info; else { level_map[j].info.param[0] = ddef[k].info.param[0]; level_map[j].info.param[1] = ddef[k].info.param[1]; level_map[j].info.param[2] = ddef[k].info.param[2]; level_map[j].info.param[3] = ddef[k].info.param[3]; } } else level_map[j].info.tunnel.direction = ddef[k].info.tunnel.direction; level_map[j].collision[0] &= (c_left | c_up); level_map[j].collision[1] &= (c_right | c_up); level_map[j].collision[2] &= (c_left | c_down); level_map[j].collision[3] &= (c_right | c_down); level_map[j].collision[0] |= ddef[k].collision[0]; level_map[j].collision[1] |= ddef[k].collision[1]; level_map[j].collision[2] |= ddef[k].collision[2]; level_map[j].collision[3] |= ddef[k].collision[3]; if (curdallepg (j) >= 0) { if (ddef[k].collision[0] & c_left) level_map[curdallepg (j)].collision[1] |= c_right; if (ddef[k].collision[2] & c_left) level_map[curdallepg (j)].collision[3] |= c_right; } if (curdalleph (j) >= 0) { if (ddef[k].collision[0] & c_up) level_map[curdalleph (j)].collision[2] |= c_down; if (ddef[k].collision[1] & c_up) level_map[curdalleph (j)].collision[3] |= c_down; } if (curdallepd (j) >= 0) { if (ddef[k].collision[1] & c_right) level_map[curdallepd (j)].collision[0] |= c_left; if (ddef[k].collision[3] & c_right) level_map[curdallepd (j)].collision[2] |= c_left; } if (curdallepb (j) >= 0) { if (ddef[k].collision[2] & c_down) level_map[curdallepb (j)].collision[0] |= c_up; if (ddef[k].collision[3] & c_down) level_map[curdallepb (j)].collision[1] |= c_up; } } update_left_panel(); } else if (i == HK_f || i == HK_F) { if (mod & HK_MOD_Ctrl) { for (j = hplaninfo.xt * hplaninfo.yt - 1; j >= 0; j--) { level_map[j].number = xdalles + xdallesdec + ydalles * (tile_set_img.width); level_map[j].type = ddef[curdalled ()].type; level_map[j].info = ddef[curdalled ()].info; } update_left_panel (); } else if (mod & (HK_MOD_Alt | HK_MOD_Meta)) { for (j = hplaninfo.xt * hplaninfo.yt - 1; j >= 0; j--) level_map[j].number = (((j % hplaninfo.xt) + (j / hplaninfo.xt)) & 1) * 20 * tile_set_img.width; update_left_panel (); } } else if (i == HK_F3) { sprhide ^= 1; update_left_panel (); } else if (i == HK_F6) { draw_collide_tests ^= 1; update_left_panel (); } else if (i == HK_s || i == HK_S) { if (level_map[curdallep ()].sprite == 0) level_map[curdallep ()].sprite = (short int) (xdalles + xdallesdec + ydalles * (tile_set_img.width)); else level_map[curdallep ()].sprite = 0; update_left_panel (); } else if (i == HK_d || i == HK_D) { t = level_map[curdallep ()].type; if (t != t_boom && t != t_anim && t != t_outway) departfix (); } else if (i == HK_t || i == HK_T) { if (tempd == curdallep ()) tempd = DONT_WRAP; else tempd = curdallep (); update_left_panel (); } else if (i == HK_o || i == HK_O) { outwayflag (); update_left_panel(); } else if (i == HK_p || i == HK_P) { save_level_as_pcx (); update_left_panel (); } else if (i == HK_0) { i = 0; goto handle_numbers; } else if (i == HK_1) { i = 1; goto handle_numbers; } else if (i == HK_2) { i = 2; goto handle_numbers; } else if (i == HK_3) { i = 3; goto handle_numbers; } else if (i == HK_4) { i = 4; goto handle_numbers; } else if (i == HK_5) { i = 5; goto handle_numbers; } else if (i == HK_6) { i = 6; goto handle_numbers; } else if (i == HK_7) { i = 7; goto handle_numbers; } else if (i == HK_8) { i = 8; handle_numbers: level_map[curdallep ()].type = i; level_map[curdallep ()].info.tunnel.output = 0; level_map[curdallep ()].info.param[4] = 0; update_left_panel (); } else { /* Unknown key. */ } } static void gestsrs1 (void) { int x = mouse_coord_x (), y = mouse_coord_y (), i, x2, y2; i = curdallep (); if (x >= 290) { if (y < 19) gestclav (HK_Enter, HK_MOD_None); if (y >= 144 && y <= 166) { if (x > 305) gestclav (HK_Right, HK_MOD_Ctrl); else gestclav (HK_Left, HK_MOD_Ctrl); } if (y >= 86 && y <= 137) { (*fnptr[level_map[i].type]) (i, x, y); update_left_panel (); } if (y >= 168) { if ((level_map[i].type == t_speed || level_map[i].type == t_ice || level_map[i].type == t_stop || level_map[i].type == t_dust || level_map[i].type == t_outway || level_map[i].type == t_boom)) { anim_mod_bcl (i, x, y); update_left_panel (); } } } if (x < 144) { xplandec = (x / 24) * 24; yplandec = (y / 20) * 20; update_left_panel (); do { x2 = mouse_coord_x (); y2 = mouse_coord_y (); if (x - x2 > 3) { x = x2; gestclav (HK_Right, HK_MOD_None); } else if (x2 - x > 3) { x = x2; gestclav (HK_Left, HK_MOD_None); } if (y - y2 > 3) { y = y2; gestclav (HK_Down, HK_MOD_None); } else if (y2 - y > 3) { y = y2; gestclav (HK_Up, HK_MOD_None); } } while (mouse12 () != 0); } if (x > 144 && x < 289) { xdallesdec = ((x - 145) / 24) * 24; ydalles = (y / 20) * 20; update_middle_panel (); do { x2 = mouse_coord_x (); y2 = mouse_coord_y (); if (x - x2 > 3) { x = x2; gestclav (HK_Right, HK_MOD_Ctrl); } else if (x2 - x > 3) { x = x2; gestclav (HK_Left, HK_MOD_Ctrl); } if (y - y2 > 3) { y = y2; gestclav (HK_PageDown, HK_MOD_Ctrl); } else if (y2 - y > 3) { y = y2; gestclav (HK_PageUp, HK_MOD_Ctrl); } } while (mouse12 () != 0); } } static void gestsrs2 (void) { int x = mouse_coord_x (), y = mouse_coord_y (); if (x >= 290) { if (y >= 144 && y <= 166) { if (x > 305) gestclav (HK_End, HK_MOD_Ctrl); else gestclav (HK_Home, HK_MOD_Ctrl); } } if (x < 144) { xplandec = (x / 24) * 24; yplandec = (y / 20) * 20; gestclav (HK_Space, HK_MOD_None); } } static void gestsrs3 (void) { int x = mouse_coord_x (), y = mouse_coord_y (); int a, b; if (x < 144) { a = xplandec; b = yplandec; xplandec = (x / 24) * 24; yplandec = (y / 20) * 20; gestclav (HK_t, HK_MOD_None); xplandec = a; yplandec = b; update_left_panel (); } } char* levels_output_dir = 0; int create_levels_output_dir (void) { int error; if (!levels_output_dir) { levels_output_dir = get_non_null_rsc_file ("hedlite-output-dir"); strip_trailing_slashes (levels_output_dir); } error = exists_dir (levels_output_dir); if (error < 0) return 1; if (error == 0) if (mkdir (levels_output_dir, 0755)) { dperror (levels_output_dir); wmsg (_("Cannot create directory `%s'."), levels_output_dir); return 1; } return 0; } void free_levels_output_dir (void) { dmsg (D_MISC, "free levels output dir"); XFREE0 (levels_output_dir); } int hmain (const char* lname, const char* tset_name, a_u32 xsize, a_u32 ysize, a_u32 xwrap, a_u32 ywrap) { char* lvl_name; if (create_levels_output_dir ()) return 1; tile_set_name = get_non_null_rsc_file ("tiles-sets-dir"); dallepie = get_non_null_rsc_file ("tiles-sets-dir"); xdalles = 0; ydalles = 0; xdallesdec = 0; xplan = 0; yplan = 0; tempd = DONT_WRAP; xplandec = 0; yplandec = 0; sprhide = 0; draw_collide_tests = 0; strcpy (levelnomshort, lname); strlwr (levelnomshort); if (tset_name) { strcat (strcpy (hplaninfo.tile_set_name, "level"), tset_name); strcat (strcpy (hplaninfo.soundtrack_name, "heroes"), tset_name); } hplaninfo.xt = xsize; hplaninfo.yt = ysize; hplaninfo.xwrap = xwrap; hplaninfo.ywrap = ywrap; strcat (strcpy (pcxnom, levelnomshort), ".pcx"); XMALLOC_ARRAY (lvl_name, (strlen (levels_output_dir) + 1 + strlen (levelnomshort) + 4 + 1)); sprintf (lvl_name, "%s/%s.lvl", levels_output_dir, levelnomshort); /* initialize level_map */ if (!((ftmp = fopen (lvl_name, "rb")) == NULL)) { if (fread (&hplaninfo, sizeof (a_level_header), 1, ftmp) != 1) emsg (_("%s: invalid level file"), lvl_name); /* convert hplaninfo to local endianess */ bswap_level_header (&hplaninfo); XMALLOC_ARRAY (level_map, hplaninfo.xt * hplaninfo.yt); if (fread (level_map, sizeof (a_tile), hplaninfo.xt * hplaninfo.yt, ftmp) != (hplaninfo.xt * hplaninfo.yt)) emsg (_("%s: invalid level file"), lvl_name); fclose (ftmp); /* convert level_map to local endianess */ bswap_level_tiles (&hplaninfo, level_map); } else { XCALLOC_ARRAY (level_map, hplaninfo.xt * hplaninfo.yt); hplaninfo.start[0] = 0; hplaninfo.start[1] = 0; hplaninfo.start[2] = 0; hplaninfo.start[3] = 0; hplaninfo.start_way[0] = 0x00; hplaninfo.start_way[1] = 0x11; hplaninfo.start_way[2] = 0x32; hplaninfo.start_way[3] = 0x23; } strlwr (hplaninfo.tile_set_name); tile_set_name = strappend (strappend (tile_set_name, hplaninfo.tile_set_name), ".pcx"); dallepie = strappend (strappend (dallepie, hplaninfo.tile_set_name), ".pie"); pcx_load_from_rsc ("editor-img", &heditrsc); pcx_load (tile_set_name, &tile_set_img); /* read the tileset definition */ XCALLOC_ARRAY (ddef, (tile_set_img.width / 24) * 10); if (!((ftmp = fopen (dallepie, "rb")) == NULL)) fread (ddef, sizeof (a_tile_info), (tile_set_img.width / 24) * 10, ftmp); fclose (ftmp); outwayinit (); XCALLOC_ARRAY (hedit_buffer, xbuf * 200); set_pal (tile_set_img.palette.global, 0, 256 * 3); rectangle_copy (0, 0, 30, 200, 290, 0, &heditrsc); strupr (levelnomshort); draw_text (levelnomshort, 305, 29, 8, 1); sprintf (nombre, "%u", hplaninfo.xt); draw_text (nombre, 302, 43, 8, 2); sprintf (nombre, "%u", hplaninfo.yt); draw_text (nombre, 307, 43, 8, 0); update_middle_panel (); update_left_panel (); while (key_ready ()) get_key (); mouse_show (); { a_keycode k = 0; do { while (key_ready () == 0 && mouse12 () == 0); if (key_ready ()) { k = get_key (); gestclav (k, keyboard_modifiers); } else { if (mouse1 ()) { gestsrs1 (); } else if (mouse2 ()) { gestsrs2 (); } else if (mouse3 ()) { gestsrs3 (); } while (mouse12 () != 0); } } while (k != HK_Escape); } mouse_hide (); outwayclose (); free (hedit_buffer); { if (!((ftmp = fopen (lvl_name, "wb")) == NULL)) { /* convert hplaninfo to disk endianess */ bswap_level_header (&hplaninfo); fwrite (&hplaninfo, sizeof (a_level_header), 1, ftmp); /* convert level_map to file endianess */ bswap_level_tiles (&hplaninfo, level_map); fwrite (level_map, sizeof (a_tile), hplaninfo.xt * hplaninfo.yt, ftmp); fclose (ftmp); } free (ddef); free (level_map); img_free (&heditrsc); img_free (&tile_set_img); } free (dallepie); free (tile_set_name); free (lvl_name); return 0; } heroes-0.21/src/hedlite.h0000644004117000411500000000325007352614752010771 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__HEDLITE__H #define HEROES__HEDLITE__H extern char* levels_output_dir; int create_levels_output_dir (void); int hmain (const char* lname, const char* tset_name, a_u32 xsize, a_u32 ysize, a_u32 xwrap, a_u32 ywrap); void free_levels_output_dir (void); #endif /* HEROES__HEDLITE__H */ heroes-0.21/src/helptext.c0000644004117000411500000001672207352614752011213 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "helptext.h" #include "misc.h" const char *const help_text1 = N_("\ \n\ %{img C 444 0 40 320}\n\ \n\ \n\ \n\ \n\ %{center}%pUse the arrow keys to scroll up and down.\n\ \n\ %{head 1}CONTROL & BOARD\n\ \n\ %{img BC 357 55 80 205}\n\ %{textat cL -9 -81}%yPAUSE\n\ %{textat cR -9 97}%yQUIT GAME\n\ %{textat cR 26 -62}%yCONTROL\n\ %{textat cL 30 74}%ySTOP\n\ %{textat cL 52 68}%yTURBO\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ %{img BCG 486 0 140 320}\n\ %{textat cR -7 -82}%ySCORE\n\ %{textat cR 1 8}%yCOMMENTARY\n\ %{textat cL 16 29}%yHEROES\n\ %{textat cL 33 29}%yWALLS\n\ %{textat cL 55 29}%yBONUS\n\ %{textat cL 29 -102}%yLIFES\n\ %{textat cL 51 -109}%yTURBO ENERGY\n\ %{textat cL 72 -104}%yTIME\n\ %{textat cR 96 40}%yPLAYER COLOR\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ "); const char *const help_text2 = N_("\ \n\ \n\ \n\ %{head 2}BONUS\n\ \n\ %{img L 60 0 20 22}Affects the player that gets the item\n\ %{img L 60 22 20 22}Affects all players except the one who gets the bonus\n\ \n\ %{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1\n\ %{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1\n\ %{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up\n\ %{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down\n\ %{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus\n\ %{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points\n\ %{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail\n\ %{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n\ %{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls\n\ %{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power +\n\ %{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power -\n\ %{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level\n\ %{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability\n\ %{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom\n\ %{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life\n\ %{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions\n\ \n\ "); const char *const help_text3 = N_("\ %{head 3}GAME MODES\n\ \n\ %{>>}%yQUEST\n\ \n\ %{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers \ you. Your aim is to collect a given number (10) of Trail+1 bonuses and \ then to get the End-of-Level bonus that will send you to next level.\n\ %{>>>}%{img L 20 176 20 22}End-of-Level\n\ %{img R 0 0 20 22}%{flushright}Trail+1\n\ %{>>>}Trail+1 has the effect of growing your trail. There are two way to \ get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus \ first appears when someone's trail reach 10 units.\n\ \n\ %{>>}%yDEATH MATCH\n\ \n\ %{>>>}The %yDEATH MATCH%w mode allows you to face the other players in \ a fight to death. The aim of the game is to be the last player still \ alive. For this, feel free to use any stratagems you want. Nothing is \ forbidden.\n\ \n\ %{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL\n\ \n\ %{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to \ overwhelm all the people of your competitors. It was said \"There can \ be only one\", make sure it is yours!\n\ \n\ %{img LG 131 70 20 100}\n\ %{img LG 151 70 20 80}They are among us, find them !\n\ \n\ %{>>}%yCOLOR\n\ \n\ %{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of \ time to get a maximum of gems of your color. Beware, if you go over \ your competitor's gems, it's your competitor's gem account that you \ will increase. Be also sure not to get crossed gems because you'll \ lose collected gems. Grey ones gives gems to all players except the one \ that goes over it. The Clocks give you extra time.\n\ \n\ %{>>}%yTIME CA$H\n\ \n\ %{>>>}In %yTIME CA$H%w mode the winner is the player who collected \ the largest amount of money.\n\ \n\ "); const char *const help_text4 = N_("\ %{head 4}GAME OPTIONS\n\ \n\ %{img L 293 165 20 134}\n\ %{>>}%gCOLOR SELECT\n\ \n\ %{>>>}This option allows you to choose the color of your vehicle between \ %pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w.\n\ \n\ %{img L 335 165 20 32}\n\ %{>>}%gGAME SPEED\n\ \n\ %{>>>}The %gGAME SPEED%w option allows you to select the initial speed of \ the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES.\n\ \n\ %{img L 314 264 20 32}\n\ %{>>}%gROUNDS\n\ \n\ %{>>>}The %gROUNDS%w option allows you to select the number of rounds in \ the tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. \ These values range from 1 to 100 rounds.\n\ \n\ %{img L 293 0 20 33}%{img L 293 132 20 33}\n\ %{>>}%gRADAR & INFORMATION\n\ \n\ %{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better \ visibility.\n\ \n\ %{img L 314 231 20 32}\n\ %{>>}%gLIGHTING\n\ \n\ %{>>>}The %gLIGHTING%w option is here to tune the luminosity of your screen.\n\ \n\ %{img L 314 0 20 32}\n\ %{>>}%gINERTIA\n\ \n\ %{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia.\n\ \n\ %{img L 293 99 20 32}\n\ %{>>}%gAUTOPILOT\n\ \n\ %{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, \ rest in peace... Note that %gAUTOPILOT%w does not work against fire trails.\n\ \n\ "); const char *const help_text5 = N_("\ %{head 1}CONTACT\n\ \n\ %{center}home page:\n\ %{img BCVr 183 124 30 41}\n\ %{center}http://heroes.sourceforge.net/\n\ \n\ %{center}send bug reports to:\n\ %{img BCVr 183 124 30 41}\n\ %{center}heroes-bugs@lists.sourceforge.net\n\ \n\ "); const char *const help_text6 = N_("\ %{img C 175 0 10 119}\n\ %{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's \ environmental and ecological issues and did our best to use only \ recycled bytes in this program.\n\ %{img C 175 0 10 119}\n\ \n\ \n\ %{img CG 145 150 40 120}\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ %{img C 220 3 60 130}\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, \ Alexandre Liverneaux and Philippe Meisburger.\n\ \n\ "); a_read_data * compile_helptext (void) { a_read_data *p = 0; char *s = 0; s = xstrdup (_(help_text1)); s = strappend (s, _(help_text2)); s = strappend (s, _(help_text3)); s = strappend (s, _(help_text4)); s = strappend (s, _(help_text5)); s = strappend (s, _(help_text6)); p = compile_reader_data (p, s); free (s); return p; } heroes-0.21/src/helptext.h0000644004117000411500000000276107352614752011216 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__HELPTEXT__H #define HEROES__HELPTEXT__H #include "readmake.h" a_read_data *compile_helptext (void); #endif /* HEROES__HELPTEXT__H */ heroes-0.21/src/hendian.c0000644004117000411500000000442607352614752010762 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "structs.h" #include "hendian.h" #include "bytesex.h" void bswap_level_header (a_level_header* level_info) { level_info->xt = BSWAP32 (level_info->xt); level_info->yt = BSWAP32 (level_info->yt); level_info->xwrap = BSWAP32 (level_info->xwrap); level_info->ywrap = BSWAP32 (level_info->ywrap); level_info->start[0] = BSWAP32 (level_info->start[0]); level_info->start[1] = BSWAP32 (level_info->start[1]); level_info->start[2] = BSWAP32 (level_info->start[2]); level_info->start[3] = BSWAP32 (level_info->start[3]); } void bswap_level_tiles (const a_level_header* level_info, a_tile* level_map) { int i; for (i = level_info->xt * level_info->yt - 1; i >= 0; i--) { level_map[i].number = BSWAP32 (level_map[i].number); level_map[i].sprite = BSWAP16 (level_map[i].sprite); if (level_map[i].type == t_tunnel) level_map[i].info.tunnel.output = BSWAP32 (level_map[i].info.tunnel.output); } } heroes-0.21/src/hendian.h0000644004117000411500000000306507352614752010765 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__HENDIAN__H #define HEROES__HENDIAN__H void bswap_level_header (a_level_header* level_info); void bswap_level_tiles (const a_level_header* level_info, a_tile* level_map); #endif /* HEROES__HENDIAN__H */ heroes-0.21/src/heroes.c0000644004117000411500000026661307430322660010640 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "video.h" #include "pcx.h" #include "keyb.h" #include "keyvalues.h" #include "joystick.h" #include "errors.h" #include "fastmem.h" #include "sfx.h" #include "prefs.h" #include "scores.h" #include "savegame.h" #include "intro.h" #include "menus.h" #include "extras.h" #include "visuals.h" #include "render.h" #include "renderdata.h" #include "pixelize.h" #include "misc.h" #include "argv.h" #include "debugmsg.h" #include "strack.h" #include "endscroll.h" #include "heroes.h" #include "userdir.h" #include "userconf.h" #include "musicfiles.h" #include "bytesex.h" #include "structs.h" #include "hendian.h" #include "rsc_files.h" #include "rsc_files_hash.h" #include "fader.h" #include "const.h" #include "scrtools.h" #include "fontdata.h" #include "bonus.h" #include "sprtext.h" #include "explosions.h" #include "items.h" #include "sprprogwav.h" #include "gameid.h" #include "persona.h" #include "relocate.h" #include "vars.h" #include "camera.h" #include "levellst.h" #include "locales.h" #include "main.h" #include "pendulum.h" char tile_set_name[128]; char glenz_name[128]; int *level_full_list; size_t level_full_list_size = 0; int rounds = 1; unsigned int current_quest_level; int level_is_finished; /* AI won't be enabled on the first moves */ #define ia_skip_firsts_moves 2 char ia_max_depth; char ia_cur_depth; char ia_is_invincible; char ia_player; a_square_coord ia_target_x, ia_targer_y; a_square_coord ia_wrap_x, ia_wrap_y; char ia_wrap_left, ia_wrap_right; #define DEMO_DURATION 90 char enable_blit; char mouse_found = 1; /***********************/ char txt_tmp[20]; a_timer blink_htimer; a_timer clock_htimer; a_timer tiles_anim_htimer; a_timer corner_htimer; a_timer event_htimer; long event_time; /* updated from event_htimer on each frame */ a_timer update_htimer; a_timer waving_htimer; a_timer background_htimer; a_timer sound_track_htimer; a_timer demo_trigger_htimer; static unsigned char play_game (char); static void init_buffers (void) { XMALLOC_ARRAY (render_buffer[0], xbuf * ybuf); XMALLOC_ARRAY (render_buffer[1], xbuf * ybuf); } static void clean_buffers (void) { memset (render_buffer[0], 0, xbuf * ybuf); memset (render_buffer[1], 0, xbuf * ybuf); } static void close_buffers (void) { free (render_buffer[0]); free (render_buffer[1]); } static void add_color (char oui) { int d; unsigned char b; do { d = rand () % lvl.square_count; } while (square_object[d] != -1); if (oui && (rand () % 40 == 0)) b = 16; else b = rand () % 5; if ((rand () & 3) == 0) b |= 8; square_object[d] = b; } static void add_cash (char oui) { int d; unsigned char b = 0; do { d = rand () % lvl.square_count; } while (square_object[d] != -1); if (oui && (rand () % 40 == 0)) b = 15; square_object[d] = b; } static void erase_player (int i) { dmsg (D_MISC, "erase player %d", i); if (!in_menu) square_occupied[player[i].x2 + player[i].y2 * lvl.square_width] = 0xff; if (player[i].way == w_left) square_occupied[player[i].y2 * lvl.square_width + ((player[i].x2 - 1) & lvl.square_width_wrap)] = 0xff; if (player[i].way == w_right) square_occupied[player[i].y2 * lvl.square_width + ((player[i].x2 + 1) & lvl.square_width_wrap)] = 0xff; if (player[i].way == w_up) square_occupied[player[i].x2 + ((player[i].y2 - 1) & lvl.square_height_wrap) * lvl.square_width] = 0xff; if (player[i].way == w_down) square_occupied[player[i].x2 + ((player[i].y2 + 1) & lvl.square_height_wrap) * lvl.square_width] = 0xff; } static void reinit_player (unsigned p) { int tries, m; unsigned start_pos; /* 0..3: one of the 4 starting positions. */ a_square_corrd_pair start_coord; a_dir start_dir; a_square_index start_idx, next_idx; dmsg (D_MISC, "initialize player %d", p); tries = 4; start_pos = p - 1; do { --tries; start_pos = (start_pos + 1) & 3; lvl_start_position (&lvl, start_pos, &start_coord, &start_dir); start_idx = SQR_COORDS_TO_INDEX (&lvl, start_coord.y, start_coord.x); next_idx = lvl.square_move[start_dir][start_idx]; } while (tries && (next_idx == INVALID_INDEX || square_occupied[next_idx] != 0xff)); player[p].way = start_dir; player[p].x2 = start_coord.x; player[p].y2 = start_coord.y; player[p].pos = start_idx; /* ensure that the start position is usable, otherwise try another position (randomly) */ for (;;) { /* Make sure the selected square is usable (nobody already present, and not out of the way). */ if (lvl.square_type[start_idx] != T_OUTWAY && square_occupied[start_idx] == 0xff) { a_square_index si; bool dir_unusable[4] = { false, false, false, false }; /* Check directions which are not usable. */ if ((si = lvl.square_move[D_UP][start_idx]) == INVALID_INDEX || square_occupied[si] != 0xff) dir_unusable[D_UP] = true; if ((si = lvl.square_move[D_RIGHT][start_idx]) == INVALID_INDEX || square_occupied[si] != 0xff) dir_unusable[D_RIGHT] = true; if ((si = lvl.square_move[D_DOWN][start_idx]) == INVALID_INDEX || square_occupied[si] != 0xff) dir_unusable[D_DOWN] = true; if ((si = lvl.square_move[D_LEFT][start_idx]) == INVALID_INDEX || square_occupied[si] != 0xff) dir_unusable[D_LEFT] = true; /* is at least one direction ok? */ if (!(dir_unusable[D_UP] & dir_unusable[D_RIGHT] & dir_unusable[D_DOWN] & dir_unusable[D_LEFT])) { /* then rotate until we find that direction */ while (dir_unusable[player[p].way]) player[p].way = (player[p].way + 1) & 3; break; } } /* else, get a new position randomly on the map */ player[p].y2 = rand () % lvl.square_height; player[p].x2 = rand () % lvl.square_width; start_idx = SQR_COORDS_TO_INDEX (&lvl, player[p].y2, player[p].x2); } player[p].x = player[p].x2 >> 1; player[p].y = player[p].y2 >> 1; /**************/ player[p].ia_max_depth = (rand () & 1) + 5; if (game_mode >= M_KILLEM && game_mode != M_DEATHM) player[p].behaviour = 2; else player[p].behaviour = rand () & 1; if (two_players) player[p].target = col2plr[rand () & 1]; else player[p].target = col2plr[0]; player[p].target |= (ia_skip_firsts_moves * 16); player[p].d.e = 0; player[p].turbo = 1; player[p].turbo_level_delta = player[p].turbo_level = 1024; player[p].vitp = player[p].v = 4369 * 3 / 2 + (opt.speed * 2 * 1092); player[p].spec = 0; player[p].delay = 0; player[p].inversed_controls = 0; player[p].speedup = 0; player[p].rotozoom = 0; player[p].waves = 0; player[p].waves_begin = 0; player[p].fire_trail = 0; player[p].tunnel_inverse = 0; player[p].next_way = player[p].old_old_way = player[p].old_way = player[p].way; if (!in_menu) square_occupied[player[p].x2 + player[p].y2 * lvl.square_width] = p; if (player[p].way == D_LEFT) square_occupied[player[p].y2 * lvl.square_width + SQR_COORD_LEFT (&lvl, player[p].x2)] = (char) (p + 4); if (player[p].way == D_RIGHT) square_occupied[player[p].y2 * lvl.square_width + SQR_COORD_RIGHT (&lvl, player[p].x2)] = (char) (p + 4); if (player[p].way == D_UP) square_occupied[player[p].x2 + SQR_COORD_UP (&lvl, player[p].y2) * lvl.square_width] = (char) (p + 4); if (player[p].way == D_DOWN) square_occupied[player[p].x2 + SQR_COORD_DOWN (&lvl, player[p].y2) * lvl.square_width] = (char) (p + 4); start_dir = player[p].way; square_way[start_idx] = DIR8_PAIR (start_dir, start_dir); trail_offset[p] = 0; for (m = trail_size[p]; m >= 0; m--) { trail_pos[p][m] = start_idx; trail_way[p][m] = DIR8_PAIR (start_dir, start_dir); } } static void find_lemming_direction (a_lemming *lem) { a_dir d; a_dir_mask avail_dirm; /* The lemming advances one square. The tail takes the place of the head. */ square_lemmings_list[lem->pos_tail] = NULL; lem->pos_tail = lem->pos_head; square_lemmings_list[lem->pos_tail] = lem; /* We need to compute the new square for the head (i.e. the direction of the lemming). */ /* Mask AVAIL_DIRM with all the directions impossible to use by the lemming. */ avail_dirm = DM_ALL; for (d = 0; d < DIR_MAX; ++d) { a_square_index dest = lvl.square_move[d][lem->pos_tail]; if (/* Lemmings can't cross walls, */ dest == INVALID_INDEX /* they should not go to a square occupied by a player, */ || square_occupied[dest] != 0xff /* neither should they go to a quare occupied by another lemming. */ || square_lemmings_list[dest]) avail_dirm &= ~DIR_TO_DIRMASK(d); } /* Also, we don't want to allow lemmings to enter tunnels. This constraint might be relaxed in the future, but actually this requires several things that I (adl) don't plan to work on at the moment: - handling two directions for each lemming: for the head and the tail, because the direction at the output of a tunnel might not be the same as the entrance - drawing the lemmings in two parts (since they need to be cropped under the tunnel entrance) - handling dead lemmings (blood pudles) on two non-adjacent squares (e.g. the entrance and the output of the tunnel, in case the lemming has been squished in a tunnel). This latter point is not only a rendering issue: the way dead lemmings are stored needs to be changed too (at the time this comment is written, they are assigned to *the* nearest square, and linked to the other dead lemmings of this square). So, for now, let's just prevent them from turning toward a tunnel entrance. */ if (lvl.square_type[lem->pos_tail] == T_TUNNEL) avail_dirm &= ~DIR_TO_DIRMASK (lvl.square_direction[lem->pos_tail]); /* Is the current direction available? (We'd better avoid changing the direction on each square unless we decide lemmings are bees.) */ if (avail_dirm & DIR_TO_DIRMASK(lem->dir)) { /* The current direction is free. Go on. */ lem->pos_head = lvl.square_move[lem->dir][lem->pos_tail]; } else { /* Current direction unavalaible. Let's find another one. */ a_dir_mask i; int n = 0; /* Count the number of direction available. */ for (i = 1; i < DM_ALL; i <<= 1) if (avail_dirm & i) ++n; if (n) { /* Chose one of the free directions. */ n = 1 + rand () % n; for (d = 0; n != 0; ++d, avail_dirm >>= 1) if (avail_dirm & 1) --n; lem->dir = d - 1; lem->pos_head = lvl.square_move[lem->dir][lem->pos_tail]; } else { /* This place is reached when there is no free way for the lemming to use. We used to set lem->dir = 5; to indicate this condition to the renderer (when then the lemmings cannot move it should be not be rendered as `walking'). But it turns out that checking whether ptr->pos_tail == lem->pos_head is sufficient to detect this condition. */ } } assert (lem->pos_head != INVALID_INDEX); if (lem->pos_head != lem->pos_tail) { /* We assert this only here, because it may happens that a lemmings is blocked under a player trail. */ assert (square_occupied[lem->pos_head] == 0xff); /* If the lemming is moving, mark the destination square as occupied so that no other lemming dares to move there too. */ assert (square_lemmings_list[lem->pos_head] == 0); square_lemmings_list[lem->pos_head] = lem; } } static char load_level (char *filename, char cont) { unsigned int i, j, k, k2, l; a_lemming *ptir; int err; dmsg (D_FILE|D_LEVEL, "loading level: %s", filename); if (!in_menu) { if (two_players) { player[col2plr[0]].cpu = 2; player[col2plr[1]].cpu = 2; player[col2plr[2]].cpu = 0; player[col2plr[3]].cpu = 0; } else { player[col2plr[0]].cpu = 2; player[col2plr[1]].cpu = 0; player[col2plr[2]].cpu = 0; player[col2plr[3]].cpu = 0; } } if (in_demo) { player[col2plr[0]].cpu = 0; player[col2plr[1]].cpu = 0; } clean_buffers (); err = lvl_load_file (filename, &lvl, true); if (err) { dmsg (D_LEVEL|D_FILE, "cannot open %s", filename); dperror ("lvl_load_file"); return err; } dmsg (D_LEVEL, "size=(%u,%u) wrap=(%x,%x) tile=%s soundtrack=%s", lvl.tile_width, lvl.tile_height, lvl.tile_width_wrap, lvl.tile_height_wrap, lvl_tile_sprite_map_basename (&lvl), lvl_sound_track (&lvl)); { const char *bn = lvl_tile_sprite_map_basename (&lvl); int fd; char* tmp = get_non_null_rsc_file ("tiles-sets-dir"); stpcpy (stpcpy (stpcpy (tile_set_name, tmp), bn), ".pcx"); stpcpy (stpcpy (stpcpy (glenz_name, tmp), bn), ".glz"); free (tmp); pcx_load (tile_set_name, &tile_set_img); dmsg (D_LEVEL|D_FILE, "loading %s", glenz_name); fd = open (glenz_name, O_RDONLY | O_BINARY); if (fd == -1) { dperror ("open"); return errno; } if (read (fd, glenz, 256 * 8) != 256 * 8) { dperror ("read"); return errno; } close (fd); } init_render_data (); if (in_menu) { load_soundtrack_from_alias ("MENU"); } else { load_soundtrack_from_alias (lvl_sound_track (&lvl)); } dmsg (D_LEVEL, "initialize variables and maps associated to the level"); XSALLOC_ARRAY (square_occupied, lvl.square_count, 0xff); allocate_explosions (); XMALLOC_ARRAY (square_way, lvl.square_count); if (init_bonuses_level ()) return 15; XMALLOC_ARRAY (square_tile, lvl.square_count); k = 0; for (i = 0, l = 0; i < lvl.tile_height; i++, l += lvl.square_width * 2) { for (j = 0, k2 = l; j < lvl.tile_width; j++, k2 += 2, k++) { square_tile[k2] = k; square_tile[k2 + 1] = k; square_tile[lvl.square_width + k2] = k; square_tile[lvl.square_width + k2 + 1] = k; } } XCALLOC_ARRAY (square_coord, lvl.square_count); if (game_mode == M_KILLEM) { XCALLOC_ARRAY (square_lemmings_list, lvl.square_count); XCALLOC_ARRAY (square_dead_lemmings_list, lvl.square_count); memset (lemmings_support, 0, lemmings_total * sizeof (a_lemming)); } if (game_mode >= M_TCASH) { XMALLOC_ARRAY (square_object, lvl.square_count); } /* Init square_coord, map offsets to coordinates. */ for (j = 0; j < lvl.square_height; j++) for (i = 0; i < lvl.square_width; i++) { square_coord[SQR_COORDS_TO_INDEX (&lvl, j, i)].y = j; square_coord[SQR_COORDS_TO_INDEX (&lvl, j, i)].x = i; } /* init of players */ if (!in_menu) for (i = 0; i < 4; ++i) { /* trail_offset[i]=0; */ if (game_mode == M_DEATHM) { trail_size[i] = 32; player[i].lifes = 9; } else trail_size[i] = 5; reinit_player ((char) i); if (cont == 0) { player[i].lifes = 9; player[i].score = 0; player[i].wins = 0; } else { /* reinitialize dead computers: give them an empty score and decrase their total of wins */ if (player[i].cpu < 2 && player[i].lifes == 0) { player[i].lifes = 9; player[i].score = 0; if (player[i].wins > 0) --player[i].wins; } } player[i].autopilot = 1; player[i].score_delta = player[i].score << 2; player[i].invincible = 0; player[i].time = 3000; player[i].cash = 0; player[i].martians_nbr = 0; } /* reinit player once again to avoid the case where some vehicles could have been put in front of others */ erase_player (0); reinit_player (0); erase_player (1); reinit_player (1); erase_player (2); reinit_player (2); erase_player (3); reinit_player (3); if (!opt.autopilot_one) player[col2plr[0]].autopilot = 0; if (two_players && !opt.autopilot_two) player[col2plr[1]].autopilot = 0; /*** init of lemmings ***/ if (game_mode == M_KILLEM) { ptir = lemmings_support; l = lvl.square_count; for (i = 0; i < 4; i++) { for (j = lemmings_per_players; j != 0; j--) { /* Drop the lemming randomly on an accessible unoccupied square. The lemmings might still not be able to move, but it's unimportant: it should just stay still until it can move. */ do { k = rand () % l; assert (k < lvl.square_count); } while (lvl.square_type[k] == T_OUTWAY || square_occupied[k] != 0xff || square_lemmings_list[k] != NULL); ptir->pos_head = k; find_lemming_direction (ptir); ptir->min = 0; ptir->next_dead = NULL; ptir->couleur = i; ptir->dead = 0; ptir++; } player[i].lemmings_nbr = lemmings_per_players; } assert (ptir == lemmings_support + 4 * lemmings_per_players); lemmings_move_offset = 0; } if (game_mode >= M_TCASH) { for (i = 0; i < lvl.square_count; ++i) if (lvl.square_type[i] == T_OUTWAY) square_object[i] = -2; /* -2 = you can't drive here */ else square_object[i] = -1; if (game_mode == M_COLOR) { objects_nbr = lvl.square_count / 14 + 1; for (i = objects_nbr; i != 0; i--) add_color (1); } if (game_mode == M_TCASH) { objects_nbr = lvl.square_count / 13 + 1; for (i = objects_nbr; i != 0; i--) add_cash (1); } } level_is_finished = 0; if (!in_menu) spread_bonuses (); return (0); } static void unload_level (void) { dmsg (D_LEVEL, "unloading level"); uninit_render_data (); uninit_bonuses_level (); img_free (&tile_set_img); free (square_occupied); release_explosions (); free (square_way); free (square_tile); free (square_coord); if (game_mode == M_KILLEM && !in_menu) { free (square_lemmings_list); free (square_dead_lemmings_list); } if (game_mode >= M_TCASH && !in_menu) free (square_object); lvl_free (&lvl); unload_soundtrack (); } static void load_level_from_number (int nbr, char cont) { char e; dmsg (D_SECTION, "load level #%d", nbr); e = load_level (level_list[nbr].name, cont); if (e != 0) emsg (_("Cannot load level %s (error %d)"), level_list[nbr].name, e); } static void compute_level_full_list (void) { int i; unsigned int j; dmsg (D_SECTION, "compute level full list"); level_full_list_size = level_list_size + extra_nbr; XMALLOC_ARRAY (level_full_list, level_full_list_size); if (extra_nbr == 0) { extrasel = 0; opt.extras = 0; } if (extrasel) { i = extra_nbr - 1; while ((i >= 0) && extra_selected_list[i] == 0) i--; if (i < 0) opt.extras = 0; } i = 0; if (opt.extras != 2) for (; i < (int) level_list_size; i++) level_full_list[i] = i; if (opt.extras != 0) for (j = 0; j < extra_nbr; j++) if (extra_selected_list[j] || (extrasel == 0)) level_full_list[i++] = (j | 0x10000); level_full_list_size = i; } static void free_level_full_list (void) { free (level_full_list); } static int random_level (void) { unsigned int i, j, k; assert (level_full_list_size > 0); i = rand () % level_full_list_size; level_full_list_size--; k = level_full_list[i]; for (j = i; j < level_full_list_size; j++) level_full_list[j] = level_full_list[j + 1]; return (k); } static void load_random_wrapped_level (bool wrapped, char cont) { int t; dmsg (D_SECTION, "load random wrapped level"); do { t = rand () % level_list_size; } while (wrapped && !level_list[t].wrapped); load_level_from_number (t, cont); } static void load_random_level (char cont) { int t; char *tmp; char e; t = random_level (); dmsg (D_SECTION, "load random level"); if (t & 0x10000) { tmp = extra_list[t & 0xffff].full_name; } else { tmp = level_list[t].name; } e = load_level (tmp, cont); if (e != 0) emsg (_("Cannot load level %s (error %d)"), tmp, e); } static void play_menu (void) { char cont; FILE *ftmp; int gamemodeh; static int l = 1, u = 0; char flagload = 0; a_keycode t; int i; a_timer flip_timer; long flip_pos; if (l == 5) l = 1; for (i = 3; i >= 0; i--) { col2plr[i] = opt.player_color[i]; plr2col[opt.player_color[i]] = i; } std_white_fadein (&tile_set_img.palette); do { do { draw_play_menu (l); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); if (t == HK_Up || HK_Down) event_sfx (1); if (t == HK_Up) { if (l > 0) l--; else l = 7; } if (t == HK_Down) { if (l < 7) l++; else l = 0; } if (t == HK_Escape) { if (l != 7) { l = 7; event_sfx (1); } else t = HK_Enter; } } else t = 0; } while (t != HK_Enter); if (l == 0) { event_sfx (5); two_players ^= 1; } if (l == 7) { event_sfx (8); return; } if (l == 6) { load_save_records (); std_white_fadein (&tile_set_img.palette); do { background_menu (); draw_saved_games_info (0, u, false); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); if (t == HK_Up) { if (u > 0) u--; else u = 9; } if (t == HK_Down) { if (u < 9) u++; else u = 0; } } else t = 0; if (t == HK_Enter && saverec[u].used == 0) { event_sfx (18); t = 0; } } while (t != HK_Enter && t != HK_Escape); if (t == HK_Escape) { event_sfx (8); } if (t == HK_Enter) flagload = 1; } } while (l == 0 || (l == 6 && flagload == 0)); event_sfx (9); flip_timer = new_htimer (T_GLOBAL, HZ (280)); do { if (flagload == 0) draw_play_menu (l); else { background_menu (); draw_saved_games_info (0, u, false); } flip_pos = -read_htimer (flip_timer); if (flip_pos < -256) flip_pos = -256; flip_buffer (flip_pos); flush_display (render_buffer[1]); } while (flip_pos > -256); flush_display (render_buffer[1]); /* erase the one-line flipped screen */ memset (render_buffer[1] + 100 * xbuf, 0, 320); flush_display (render_buffer[1]); free_htimer (flip_timer); if (flagload == 0) { if (l == 1 ) game_mode = M_QUEST; else if (l == 2) game_mode = M_DEATHM; else if (l == 3) game_mode = M_KILLEM; else if (l == 4) game_mode = M_TCASH; else if (l == 5) game_mode = M_COLOR; gamemodeh = game_mode; cont = 0; current_quest_level = 0; create_gameid (game_id); } else { gamemodeh = game_mode = M_QUEST; current_quest_level = saverec[u].level; copy_gameid (game_id, saverec[u].gid); for (t = 0; t < 4; t++) { player[col2plr[t]].lifes = saverec[u].lifes[t]; player[col2plr[t]].score = saverec[u].points[t]; } cont = 1; } unload_level (); /* also stop the music */ if (opt.sfx) load_sfx_mode (game_mode); if (game_mode > M_QUEST) { compute_level_full_list (); rounds = rounds_nbr_values[opt.gamerounds]; } else rounds = 1; while (((current_quest_level < level_list_size) || ((game_mode > M_QUEST) && (current_quest_level < level_full_list_size))) && (rounds > 0) && (play_game (cont) == 0)) { cont = 1; if (game_mode > M_QUEST) { rounds--; if (level_full_list_size == 0) rounds = 0; } } if (game_mode > M_QUEST) free_level_full_list (); /* END OF THE GAME */ if ((game_mode == M_QUEST) && (current_quest_level >= level_list_size)) { if (level_is_finished != 15) { /* End scroller */ char* tmp; char* tmp2; dmsg (D_SECTION, "-- end scroller --"); tmp = get_non_null_rsc_file ("tiles-sets-dir"); tmp2 = strcat_alloc (tmp, "level02.glz"); free (tmp); ftmp = fopen (tmp2, "rb"); free (tmp2); fread (glenz, 256, 8, ftmp); fclose (ftmp); load_soundtrack_from_alias ("ENDSCROLL"); play_soundtrack (); end_scroll (); unload_soundtrack (); } } /* ************ */ dmsg (D_SECTION, "-- (back to) menu (from game) --"); game_mode = M_QUEST; /* free_all_sfx(); */ load_random_wrapped_level (true, cont); load_sfx_mode (-1); play_soundtrack (); reset_htimer (sound_track_htimer); /* The logic is quite convolued here because we instert the score in a file which might be shared by several process. First we load the scores (to get up-to-date informations) and then if the current score deserve an insertion we ask for the player's name, and finally lock the file for insertion. Note that if the scores file is updated while the player enter his names, the current scores might not deserve an insertion in the file anymore. The only consequence is that the player has entered his name for nothing. */ load_scores (); for (t = 0; t < 4; t++) if (player[t].cpu == 2) { if (insert_scores (gamemodeh, 0, game_id, player[t].score)) { char player_name[PLAYER_NAME_SIZE + 1]; enter_your_name (plr2col[t] + 1, player_name); load_scores_and_keep_locked (); insert_scores (gamemodeh, player_name, game_id, player[t].score); write_scores_locked (); } } } /* These variables are used to handle the moving radar and score at the begging of a level. */ int radar_target_pos; int radar_current_pos; static void output_screen (char n) { a_pixel *src; int i; int loginf[4]; /* values for counters */ position_camera (); if (game_mode == M_DEATHM) for (i = 0; i < 4; i++) loginf[i] = player[col2plr[i]].lifes; else if (game_mode == M_KILLEM) for (i = 0; i < 4; i++) loginf[i] = player[col2plr[i]].lemmings_nbr; else if (game_mode >= M_TCASH) for (i = 0; i < 4; i++) loginf[i] = player[col2plr[i]].cash; if (two_players == false) { compute_corner (0, n); draw_level (0); if (player[col2plr[0]].waves) { wave_buffer (); corner[0] = render_buffer[0]; } if (player[col2plr[0]].rotozoom) { rotozoom_buffer (); corner[0] = render_buffer[1] + xbuf; } if (opt.radar_map) draw_radar_map (player[col2plr[0]].x2, player[col2plr[0]].y2, radar_current_pos); if (opt.display_infos) draw_score (col2plr[0], 0, 5, 5, -radar_current_pos); if (game_mode != M_QUEST) { if (radar_current_pos <= 70) draw_logo_info (col2plr[0], loginf[0], corner[0] + (183 + ((radar_current_pos >= 30) ? ((radar_current_pos - 30) >> 1) : 0)) * xbuf + 24); if (radar_current_pos <= 60) draw_logo_info (col2plr[1], loginf[1], corner[0] + (183 + ((radar_current_pos >= 20) ? ((radar_current_pos - 20) >> 1) : 0)) * xbuf + 98); if (radar_current_pos <= 50) draw_logo_info (col2plr[2], loginf[2], corner[0] + (183 + ((radar_current_pos >= 10) ? ((radar_current_pos - 10) >> 1) : 0)) * xbuf + 172); if (radar_current_pos <= 40) draw_logo_info (col2plr[3], loginf[3], corner[0] + (183 + (radar_current_pos >> 1)) * xbuf + 246); } if (player[col2plr[0]].spec != 0xde) show_txt_bonus (col2plr[0], corner[0] + 40 + 5 * xbuf); } else { compute_corner (0, n); compute_corner (1, n); draw_level (0); draw_level (1); if (level_is_finished == 0) { if (player[col2plr[0]].waves) { wave_half_buffer (0); corner[0] = render_buffer[0]; } if (player[col2plr[0]].rotozoom) { rotozoom_half_buffer (0); corner[0] = render_buffer[0] + xbuf - 180 + xbuf; } if (player[col2plr[1]].waves) { wave_half_buffer (1); corner[1] = render_buffer[1]; } if (player[col2plr[1]].rotozoom) { rotozoom_half_buffer (1); corner[1] = render_buffer[1] + xbuf - 180 + xbuf; } } if (game_mode != M_QUEST) { if (radar_current_pos <= 60) draw_logo_info (col2plr[0], loginf[0], corner[swapside] + (5 - ((radar_current_pos >= 30) ? ((radar_current_pos - 30) >> 1) : 0)) * xbuf + 44); if (radar_current_pos <= 50) draw_logo_info (col2plr[1], loginf[1], corner[swapside] + (5 - ((radar_current_pos >= 20) ? ((radar_current_pos - 20) >> 1) : 0)) * xbuf + 104); if (radar_current_pos <= 40) draw_logo_info (col2plr[2], loginf[2], corner[1 - swapside] + (5 - ((radar_current_pos >= 10) ? ( (radar_current_pos - 10) >> 1) : 0)) * xbuf + 6); if (radar_current_pos <= 30) draw_logo_info (col2plr[3], loginf[3], corner[1 - swapside] + (5 - (radar_current_pos >> 1)) * xbuf + 66); } if (player[col2plr[0]].spec != 0xde) show_txt_bonus (col2plr[0], corner[0] + 1 + 185 * xbuf); if (player[col2plr[1]].spec != 0xde) show_txt_bonus (col2plr[1], corner[1] + 2 + 185 * xbuf); src = corner[swapside] + 158; for (i = 200; i != 0; i--) { *src = glenz[0][(int) *src]; ++src; *src = glenz[0][(int) glenz[0][(int) *src]]; src += xbuf - 1; } src = corner[1 - swapside]; for (i = 200; i != 0; i--) { *src = glenz[0][(int) glenz[0][(int) *src]]; ++src; *src = glenz[0][(int) *src]; src += xbuf - 1; } if (opt.display_infos) { if (swapside) { draw_score (col2plr[0], 0, 5, 122, radar_current_pos); draw_score (col2plr[1], 1, 5, 5, -radar_current_pos); } else { draw_score (col2plr[0], 0, 5, 5, -radar_current_pos); draw_score (col2plr[1], 1, 5, 122, radar_current_pos); } } } } void grow_trail (int pl, int size) { int i, k; k = ((trail_offset[pl] + trail_size[pl] - 1) & (maxq - 1)); while (size != 0 && trail_size[pl] + 5 < maxq) { i = ((trail_offset[pl] + trail_size[pl]) & (maxq - 1)); trail_pos[pl][i] = trail_pos[pl][k]; trail_way[pl][i] = trail_way[pl][k]; trail_size[pl]++; --size; } if (trail_size[pl] >= 55 && game_mode == M_QUEST) { if (player[pl].cpu == 2) event_sfx (89); add_end_level_bonuses (); } } /* Shrink the trail for player PL by SIZE squares. */ void shrink_trail (int pl, int size) { int i; while (size != 0 && trail_size[pl] > 5) { --size; --trail_size[pl]; i = ((trail_offset[pl] + trail_size[pl]) & (maxq - 1)); square_occupied[trail_pos[pl][i]] = 0xff; i = ((trail_offset[pl] + trail_size[pl] - 1) & (maxq - 1)); /* Setup the new trail tail, but make sure we don't redraw anything if the trail has been erased before (this happens when the player dies: the square is erased (it explodes) and then shrinked). */ if (square_occupied[trail_pos[pl][i]] != 0xff) square_occupied[trail_pos[pl][i]] = (unsigned char) (pl + 12); } } static void erase_trail (int c) { a_square_index i; for (i = 0; i < lvl.square_count; ++i) if ((square_occupied[i] & 3) == c && square_occupied[i] < 16) { square_occupied[i] = 0xff; trigger_explosion (i, EXPLOSION_IMMEDIATE); } } /****************/ /* Adjust speed of AI-player C. */ static void ai_throttle (int c) { /* DEAD_END[C] is TRUE if player C stopped (or tried to) because some opponent prevents it to move. */ static bool dead_end[4] = {false, false, false, false}; unsigned free_directions = 4; bool seen_opponent = false; bool seen_opponent_head = false; /* Check squares neighboring next position. */ a_square_index next_pos = lvl.square_move[player[c].way][player[c].pos]; a_dir i; for (i = 0; i < 4; i++) { a_square_index idx = lvl.square_move[i][next_pos]; if (idx == INVALID_INDEX || i == REVERSE_DIR (player[c].way)) { --free_directions; } else { a_u8 o = square_occupied[idx]; if (o != 0xff) { if ((o & 3) != c) { seen_opponent = true; if (o < 8) seen_opponent_head = true; } --free_directions; } else if (square_explo_state[idx] < EXPLOSION_IMMEDIATE + 2 && ! player[c].invincible) { --free_directions; } } } if (! seen_opponent || free_directions > 1) { /* If no opponent is wandering around, or there is at least two free direction, there is no need to worry. */ player[c].turbo = 1; dead_end[c] = false; return; } if (free_directions) { /* There are some opponent in the vicinity, but there is at least one free direction. Speed up if we are near an opponent head (maybe he is trying to overtake us). Don't accelerate otherwise, because we would not have the time to stop if he cuts us up. */ if (seen_opponent_head) player[c].turbo = 2; else player[c].turbo = 1; dead_end[c] = false; return; } if (! dead_end[c]) { /* This is a cul de sac and we haven't yet stopped. Better do it now. */ int chance = 3; assert (seen_opponent && free_directions == 0); if (player[c].rotozoom) --chance; if (player[c].waves) --chance; if (rand() % 4 <= chance) player[c].turbo = 0; /* Remember we already tried to stop, so we don't give another chance to this AI vehicle if it failed to stop. */ dead_end[c] = true; } } static unsigned int ia_eval_dist (int pos) { a_square_coord curx, cury, distx, disty; curx = square_coord[pos].x; cury = square_coord[pos].y; if (ia_wrap_left) { if (curx <= ia_wrap_x) distx = curx + lvl.square_width - ia_target_x; else if (curx <= ia_target_x) distx = ia_target_x - curx; else distx = curx - ia_target_x; } else { if (curx >= ia_wrap_x) distx = ia_target_x + lvl.square_width - curx; else if (curx <= ia_target_x) distx = ia_target_x - curx; else distx = curx - ia_target_x; } if (ia_wrap_right) { if (cury <= ia_wrap_y) disty = cury + lvl.square_height - ia_targer_y; else if (cury <= ia_targer_y) disty = ia_targer_y - cury; else disty = cury - ia_targer_y; } else { if (cury >= ia_wrap_y) disty = ia_targer_y + lvl.square_height - cury; else if (cury <= ia_targer_y) disty = ia_targer_y - cury; else disty = cury - ia_targer_y; } return (distx + disty); } /* used by ia_goto_target */ #define ia_eval_dir_target_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ tmp = ia_eval_dir_target (idx); \ if (tmp < mindist) mindist = tmp; \ } #define ia_eval_dir_bonus_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ tmp = ia_eval_dir_bonus (idx); \ if (tmp > mindist) mindist = tmp; \ } #define ia_eval_dir_lemming_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ tmp = ia_eval_dir_lemming (idx); \ if (tmp > mindist) mindist = tmp; \ } #define ia_eval_dir_cash_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ tmp = ia_eval_dir_cash (idx); \ if (tmp > mindist) mindist = tmp; \ } #define ia_eval_dir_color_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ tmp = ia_eval_dir_color(idx); \ if (tmp > mindist) mindist = tmp; \ } /* -> maluses in the position evaluation function neighb wall ..... : 2pts, neighb enemy .... : 5pts, self (old) ...... : 2pts, self (new) (128). : 1pts, 4pts count as one square in the distance function */ static int ia_eval_neighb_pos (a_dir dir, a_square_index pos) { a_square_index idx; unsigned char c; idx = lvl.square_move[dir][pos]; if (idx != INVALID_INDEX) { c = square_occupied[idx]; if (c < 128) { if ((c & 3) == ia_player) return 2; else return 5; } else if (c == 128) return 1; else return 0; } return 2; } static unsigned int ia_eval_dir_target (a_square_index pos) { a_u32 mindist; a_square_index idx; unsigned int tmp; ia_cur_depth--; if (ia_cur_depth != 0) { square_occupied[pos] = 128; mindist = U32_MAX; ia_eval_dir_target_inline (D_UP); ia_eval_dir_target_inline (D_RIGHT); ia_eval_dir_target_inline (D_DOWN); ia_eval_dir_target_inline (D_LEFT); square_occupied[pos] = 0xff; ia_cur_depth++; return mindist; } else { ia_cur_depth++; tmp = ia_eval_neighb_pos (D_UP, pos) + ia_eval_neighb_pos (D_RIGHT, pos) + ia_eval_neighb_pos (D_DOWN, pos) + ia_eval_neighb_pos (D_LEFT, pos); return ((ia_eval_dist (pos) << 16) + (tmp << 14) + ia_max_depth - ia_cur_depth); } } static int ia_eval_dir_lemming (a_square_index pos) { int mindist; a_square_index idx; int tmp, tmp2; a_lemming *tmppti; ia_cur_depth--; if (ia_cur_depth != 0) { square_occupied[pos] = 128; mindist = 0; tmppti = square_lemmings_list[pos]; if (tmppti >= lemmings_support && tmppti < (lemmings_support + lemmings_total)) { if (tmppti->couleur == ia_player) tmp2 = -100; else tmp2 = 20; } else tmp2 = 0; ia_eval_dir_lemming_inline (D_UP); ia_eval_dir_lemming_inline (D_RIGHT); ia_eval_dir_lemming_inline (D_DOWN); ia_eval_dir_lemming_inline (D_LEFT); mindist += tmp2; /* *(5+ia_cur_depth); */ square_occupied[pos] = 0xff; ia_cur_depth++; return mindist; } else { ia_cur_depth++; tmp = ia_eval_neighb_pos (D_UP, pos) + ia_eval_neighb_pos (D_RIGHT, pos) + ia_eval_neighb_pos (D_DOWN, pos) + ia_eval_neighb_pos (D_LEFT, pos); return -(tmp << 2); } } static int ia_eval_dir_color (a_square_index pos) { signed int mindist; a_square_index idx; int d, tmp, tmp2; ia_cur_depth--; if (ia_cur_depth != 0) { square_occupied[pos] = 128; mindist = 0; d = (signed int) square_object[pos]; tmp2 = 0; if (d >= 0) { if (d <= 4) { if (d == ia_player) tmp2 = 100; else tmp2 = -200; } else if (d <= 12) { if (d == ia_player + 8) tmp2 = -200; else tmp2 = 100; } else if (d == 16) tmp2 = 100; else if (d == 24) tmp2 = -40; } ia_eval_dir_color_inline (D_UP); ia_eval_dir_color_inline (D_RIGHT); ia_eval_dir_color_inline (D_DOWN); ia_eval_dir_color_inline (D_LEFT); mindist += tmp2; /* *(5+ia_cur_depth); */ square_occupied[pos] = 0xff; ia_cur_depth++; return mindist; } else { ia_cur_depth++; tmp = ia_eval_neighb_pos (D_UP, pos) + ia_eval_neighb_pos (D_RIGHT, pos) + ia_eval_neighb_pos (D_DOWN, pos) + ia_eval_neighb_pos (D_LEFT, pos); return -(tmp << 2); } } static int ia_eval_dir_cash (a_square_index pos) { signed int mindist; a_square_index idx; int d, tmp, tmp2; ia_cur_depth--; if (ia_cur_depth != 0) { square_occupied[pos] = 128; mindist = 0; d = (signed int) square_object[pos]; if (d >= 0) tmp2 = 500; else tmp2 = -20; ia_eval_dir_cash_inline (D_UP); ia_eval_dir_cash_inline (D_RIGHT); ia_eval_dir_cash_inline (D_DOWN); ia_eval_dir_cash_inline (D_LEFT); mindist += tmp2; /* *(5+ia_cur_depth); */ square_occupied[pos] = 0xff; ia_cur_depth++; return mindist; } else { ia_cur_depth++; tmp = ia_eval_neighb_pos (D_UP, pos) + ia_eval_neighb_pos (D_RIGHT, pos) + ia_eval_neighb_pos (D_DOWN, pos) + ia_eval_neighb_pos (D_LEFT, pos); return -(tmp << 2); } } static int ia_eval_dir_bonus (a_square_index pos) { ia_cur_depth--; if (ia_cur_depth != 0) { int tmp2 = 0; int mindist = 0; int d = square_tile[pos]; a_square_index idx; int tmp; square_occupied[pos] = 128; if (tile_bonus_cpu[d] == 0) { tmp = tile_bonus[d]; if ((tmp != 0) && (tmp != 0xff)) { tile_bonus_cpu[d] = 1; if (tmp < 128) tmp2 = bonus_points[0][tmp - 1]; else tmp2 = bonus_points[1][tmp - 129]; } } ia_eval_dir_bonus_inline (D_UP); ia_eval_dir_bonus_inline (D_RIGHT); ia_eval_dir_bonus_inline (D_DOWN); ia_eval_dir_bonus_inline (D_LEFT); mindist += tmp2 * (5 + ia_cur_depth) /* /ia_max_depth */ ; if (tmp2) tile_bonus_cpu[square_tile[pos]] = 0; square_occupied[pos] = 0xff; ia_cur_depth++; return mindist; } else { int tmp; ia_cur_depth++; tmp = ia_eval_neighb_pos (D_UP, pos) + ia_eval_neighb_pos (D_RIGHT, pos) + ia_eval_neighb_pos (D_DOWN, pos) + ia_eval_neighb_pos (D_LEFT, pos); return -(tmp << 3); } } /* give the *way* to follow to get a given position */ #define ia_goto_target_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ ia_cur_depth=ia_max_depth; \ tmp[dir] = ia_eval_dir_target (idx); \ if (tmp[dir] < mindist) { \ mindist = tmp[dir]; \ mindir = dir; \ } \ } #define ia_goto_bonus_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ ia_cur_depth = ia_max_depth; \ tmp[dir] = ia_eval_dir_bonus(idx); \ if (tmp[dir] > mindist) { \ mindist = tmp[dir]; \ mindir = dir; \ } \ } #define ia_goto_lemming_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ ia_cur_depth = ia_max_depth; \ tmp[dir] = ia_eval_dir_lemming(idx); \ if (tmp[dir] > mindist) { \ mindist = tmp[dir]; \ mindir = dir; \ } \ } #define ia_goto_color_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ ia_cur_depth = ia_max_depth; \ tmp[dir] = ia_eval_dir_color (idx); \ if (tmp[dir] > mindist) { \ mindist = tmp[dir]; \ mindir = dir; \ } \ } #define ia_goto_cash_inline(dir) \ idx = lvl.square_move[dir][pos]; \ if (idx != INVALID_INDEX) \ if ((square_occupied[idx] == 0xff) && \ ((square_explo_state[idx] >= EXPLOSION_IMMEDIATE + 2) \ || ia_is_invincible)) { \ ia_cur_depth = ia_max_depth; \ tmp[dir] = ia_eval_dir_cash(idx); \ if (tmp[dir] > mindist) { \ mindist = tmp[dir]; \ mindir = dir; \ } \ } static char ia_goto_target (int c, int targetx_, int targety_) { a_square_index idx, pos; a_u32 tmp[4] = { U32_MAX, U32_MAX, U32_MAX, U32_MAX }; a_u32 mindist = U32_MAX; a_dir mindir = 0; ia_player = c; ia_max_depth = player[c].ia_max_depth; ia_target_x = targetx_; ia_targer_y = targety_; ia_wrap_x = ia_target_x + lvl.tile_width; if (ia_wrap_x >= lvl.square_width) { ia_wrap_x -= lvl.square_width; ia_wrap_left = 1; } else ia_wrap_left = 0; ia_wrap_y = ia_targer_y + lvl.tile_height; if (ia_wrap_y >= lvl.square_height) { ia_wrap_y -= lvl.square_height; ia_wrap_right = 1; } else ia_wrap_right = 0; ia_is_invincible = (player[c].invincible != 0); pos = player[c].pos; ia_goto_target_inline (D_UP); ia_goto_target_inline (D_RIGHT); ia_goto_target_inline (D_DOWN); ia_goto_target_inline (D_LEFT); if (tmp[player[c].way] == tmp[mindir]) return player[c].way; else return mindir; } static char ia_goto_nearest_bonus (int c) { a_square_index idx, pos; int tmp[4] = { 0, 0, 0, 0 }; int mindist = 0; a_dir mindir = 0; ia_player = c; ia_max_depth = player[c].ia_max_depth; ia_is_invincible = (player[c].invincible != 0); pos = player[c].pos; ia_goto_bonus_inline (D_UP); ia_goto_bonus_inline (D_RIGHT); ia_goto_bonus_inline (D_DOWN); ia_goto_bonus_inline (D_LEFT); if (tmp[player[c].way] == tmp[mindir]) return player[c].way; else return mindir; } static char ia_goto_nearest_lemming (int c) { a_square_index idx, pos; int tmp[4] = { 0, 0, 0, 0 }; int mindist = 0; a_dir mindir = 0; ia_player = c; ia_max_depth = player[c].ia_max_depth; ia_is_invincible = (player[c].invincible != 0); pos = player[c].pos; ia_goto_lemming_inline (D_UP); ia_goto_lemming_inline (D_RIGHT); ia_goto_lemming_inline (D_DOWN); ia_goto_lemming_inline (D_LEFT); if (tmp[player[c].way] == tmp[mindir]) return player[c].way; else return mindir; } static char ia_goto_nearest_color (int c) { a_square_index idx, pos; int tmp[4] = { 0, 0, 0, 0 }; int mindist = 0; a_dir mindir = 0; ia_player = c; ia_max_depth = player[c].ia_max_depth; ia_is_invincible = (player[c].invincible != 0); pos = player[c].pos; ia_goto_color_inline (D_UP); ia_goto_color_inline (D_RIGHT); ia_goto_color_inline (D_DOWN); ia_goto_color_inline (D_LEFT); if (tmp[player[c].way] == tmp[mindir]) return player[c].way; else return mindir; } static char ia_goto_nearest_cash (int c) { a_square_index idx, pos; int tmp[4] = { 0, 0, 0, 0 }; int mindist = 0; a_dir mindir = 0; ia_player = c; ia_max_depth = player[c].ia_max_depth; ia_is_invincible = (player[c].invincible != 0); pos = player[c].pos; ia_goto_cash_inline (D_UP); ia_goto_cash_inline (D_RIGHT); ia_goto_cash_inline (D_DOWN); ia_goto_cash_inline (D_LEFT); if (tmp[player[c].way] == tmp[mindir]) return player[c].way; else return mindir; } /****************/ /* search for a free direction */ static void find_free_way (int c) { int d = 0, n = 0, o[4] = { 0xff, 0xff, 0xff, 0xff }, e; int i, m; a_dir f; m = player[c].x2 + player[c].y2 * lvl.square_width; e = 1; for (i = 0; i < 4; i++) { a_square_index idx = lvl.square_move[i][m]; if (idx != INVALID_INDEX) o[i] = square_occupied[idx]; /* Forbid turn back. This is usually not needed because the square behind the vehicle is already occupied, but in some tunnel configurations this may not be the case. */ o[REVERSE_DIR (player[c].way)] = c; if (o[i] != 0xff || idx == INVALID_INDEX) d |= e; e += e; } f = player[c].next_way; /* Since the auto pilot is deactivated in case a player runs into a fire trail, it's possible for a human player to do a one-eighty turn and crash into his own tail. That can be quite annoying in case you want to go back one square left or right of your current lane and you're too fast pressing the buttons. Explicitly ignore the new direction in this case. */ if (f == REVERSE_DIR (player[c].way)) player[c].next_way = player[c].way; /* If the way is free the autopilot has nothing to do. */ if (!(d & (1 << f))) return; /* If we reach this place, NEXT_WAY cannot be taken because there is a wall or someone else. Therefore we will want to find some other direction automatically. */ if (player[c].cpu & 2) { /* The autopilot for human players does not work against fire trails, that would be too easy :). If NEXT_WAY would lead to a fired square, return immediately, unless the player is invincible, in which case the autopilot still apply. */ a_square_index idx = lvl.square_move[f][m]; if (idx != INVALID_INDEX && square_explo_state[idx] <= EXPLOSION_IMMEDIATE && !player[c].invincible) return; } e = o[player[c].next_way]; /* when a trail force someone to turn, the owner of this trail is credited */ if ((e & 3) != c && (!level_is_finished) && e != 0xff && (player[e & 3].spec != 0xde)) player[e & 3].score += 5; if (!(d & (1 << player[c].old_old_way))) { player[c].next_way = player[c].old_old_way; return; } if (!(d & (1 << player[c].old_way))) { player[c].next_way = player[c].old_way; return; } if (player[c].spec != t_ice) for (i = 1; i != 16; i += i) if (!(d & i)) n++; e = d; if (n != 0) { n = (char) (1 + rand () % n); for (i = 0; n != 0; i++, d >>= 1) if (!(d & 1)) n--; player[c].next_way = (char) (i - 1); /* if (w2d[i-1]&e) fatal_error("find_free_way() return nonsense !"); */ assert (((1 << (i - 1)) & e) == 0); } else player[c].spec = 0xff; } /* * * * * * * * * * * * * * * * * * * * *\ * Handling of players moves, collisions, * * bonus effects, lemmings dies, etc. * \* * * * * * * * * * * * * * * * * * * **/ /* FIXME: there are many things here that should be moved in a separate function (e.g. `update_game') in order to be run only once per update, and not four times. */ static void update_player (int c) { a_square_index idx; a_tile_index d; int l, i; a_square_index d2; int t; a_lemming *tmppti; if ((player[c].score_delta >> 2) < player[c].score) { player[c].score_delta++; /* 1 life every 10.000 points */ if (player[c].score_delta % (10000 << 2) == 0) apply_bonus (c, 15); } /* if ((player[c].score_delta>>2)>player[c].score) player[c].score_delta--; */ if (player[c].turbo_level_delta < player[c].turbo_level) { player[c].turbo_level_delta += 8; if (player[c].turbo_level_delta > player[c].turbo_level) player[c].turbo_level_delta = player[c].turbo_level; } else if (player[c].turbo_level_delta > player[c].turbo_level) { player[c].turbo_level_delta -= 8; if (player[c].turbo_level_delta < player[c].turbo_level) player[c].turbo_level_delta = player[c].turbo_level; } if (player[c].invincible > 0) player[c].invincible--; if (game_mode >= M_TCASH) { if (player[c].time > 0) { player[c].time--; /* stop the game if the player is alone */ /* if ((!level_is_finished) && */ /* (player[(c+1)&3].spec==0xde) && */ /* (player[(c+2)&3].spec==0xde) && */ /* (player[(c+3)&3].spec==0xde)) { level_is_finished=c+1; return; } */ } else if (!level_is_finished) { player[c].spec = 0xde; erase_trail (c); /* stop the game if all human players are dead or if there is no more colors or dollars */ if ((!(((player[0].cpu & 2) && (player[0].time)) || ((player[1].cpu & 2) && (player[1].time)) || ((player[2].cpu & 2) && (player[2].time)) || ((player[3].cpu & 2) && (player[3].time)))) || (objects_nbr == 0)) { /* KLUGE: mark all players whose time is 0 as dead. This is needed because many players can reach 0 simultaneously but this block is only run for the first player when this is discovered. */ for (i = 0; i < 4; ++i) if (player[i].time == 0) { player[i].spec = 0xde; erase_trail (i); } /* find out the richest player and set level_is_finished accordingly */ level_is_finished = 0; for (i = 1; i < 4; i++) if (player[i].cash > player[level_is_finished].cash) level_is_finished = i; level_is_finished++; } } } update_player_bonus_vars (c); d = (player[c].x2 >> 1) + (player[c].y2 >> 1) * lvl.tile_width; if (player[c].rotozoom != 0) player[c].rotozoom--; if (player[c].waves != 0) { player[c].waves--; if (player[c].waves > 128 && player[c].waves_begin < 128) player[c].waves_begin++; if (player[c].waves < 128 && player[c].waves_begin > 0) player[c].waves_begin--; } if (player[c].fire_trail) --player[c].fire_trail; if (player[c].spec == 0xde) return; if (player[c].inversed_controls > 0) { player[c].inversed_controls--; sprintf (txt_tmp, _("INVERTED %d"), player[c].inversed_controls / 20 + 1); set_txt_bonus (c, txt_tmp, 2); } if (player[c].delay == 0) { /* Adjust speed of AI-controled vehicles. */ if (cpuon && ((player[c].cpu & 2) == 0)) ai_throttle (c); if (player[c].turbo != 1 && player[c].turbo_level > 0 && player[c].speedup == 0) { player[c].vitt = (player[c].v + player[c].vi) * player[c].turbo; player[c].turbo_level -= 2; } else if (player[c].speedup > 0) { player[c].vitt = (player[c].v + player[c].vi) << 1; player[c].speedup--; } else if (player[c].speedup < 0) { player[c].vitt = (player[c].v + player[c].vi) >> 1; player[c].speedup++; } else player[c].vitt = (player[c].v + player[c].vi); if (player[c].vitp < player[c].vitt) if (player[c].vitp + 512 < player[c].vitt) player[c].vitp += 512; else player[c].vitp = player[c].vitt; else if (player[c].vitp > player[c].vitt) { if (player[c].vitp + 512 > player[c].vitt) player[c].vitp -= 512; else player[c].vitp = player[c].vitt; } player[c].d.e += player[c].vitp; } else { player[c].delay--; sprintf (txt_tmp, _("STOPPED %d"), player[c].delay / 20 + 1); set_txt_bonus (c, txt_tmp, 2); } if (player[c].d.h.h != 0 || player[c].delay == 1) { /**** handling of trails ****/ if (player[c].delay == 0) { int a; l = player[c].x2 + player[c].y2 * lvl.square_width; square_occupied[l] = (char) (c + 8); trail_offset[c] = (char) ((trail_offset[c] - 1) & (maxq - 1)); trail_pos[c][trail_offset[c]] = l; trail_way[c][trail_offset[c]] = square_way[l] = DIR8_PAIR (player[c].way, player[c].old_way); a = (trail_offset[c] + trail_size[c]) & (maxq - 1); if (trail_pos[c][a] != trail_pos[c][(trail_offset[c] + trail_size[c] - 1) & (maxq - 1)]) { if (square_occupied[trail_pos[c][a]] == c + 12) square_occupied[trail_pos[c][a]] = 0xff; a = (trail_offset[c] + trail_size[c] - 1) & (maxq - 1); if (square_occupied[trail_pos[c][a]] == c + 8) square_occupied[trail_pos[c][a]] = (char) (c + 12); } else square_occupied[trail_pos[c][a]] = (char) (c + 12); /* If the player has fire_trail on, trigger explosions on the head and the tail of the trail. */ if (player[c].fire_trail) { trigger_explosion (trail_pos[c][a], EXPLOSION_IMMEDIATE); trigger_explosion (trail_pos[c][trail_offset[c]], EXPLOSION_IMMEDIATE); } } d2 = player[c].y2 * lvl.square_width + player[c].x2; if (player[c].delay == 0) d2 = lvl.square_move[player[c].way][d2]; player[c].pos = d2; player[c].x2 = square_coord[d2].x; player[c].y2 = square_coord[d2].y; player[c].d.h.h = 0; if (player[c].spec == t_tunnel) { player[c].way = player[c].tunnel_way; player[c].old_way = player[c].way; player[c].spec = 0; } if (cpuon) { if (player[c].target < 16) { if ((player[c].cpu & 2) == 0) { if (player[c].behaviour == 1) player[c].next_way = ia_goto_nearest_bonus (c); else if (player[c].behaviour == 2) { if (game_mode == M_KILLEM) player[c].next_way = ia_goto_nearest_lemming (c); if (game_mode == M_TCASH) player[c].next_way = ia_goto_nearest_cash (c); if (game_mode == M_COLOR) player[c].next_way = ia_goto_nearest_color (c); } else player[c].next_way = ia_goto_target (c, player[player[c].target].x2, player[player[c].target].y2); } } else player[c].target -= 16; } square_occupied[d2] = c; if ((square_explo_state[d2] <= EXPLOSION_IMMEDIATE) && player[c].invincible == 0) player[c].spec = 0xff; d = (player[c].x2 >> 1) + (player[c].y2 >> 1) * lvl.tile_width; if (lvl.square_type[player[c].pos] == T_ICE) player[c].spec = t_ice; if ((lvl.square_type[player[c].pos] == T_STOP && player[c].delay == 0) || player[c].notify_delay) { player[c].notify_delay = 0; player[c].delay = 100; player[c].d.e = 0; return; } if (game_mode == M_KILLEM) { tmppti = square_lemmings_list[d2]; if (tmppti) { assert (tmppti >= lemmings_support && tmppti < lemmings_support + lemmings_total); if ((tmppti->pos_tail == d2 && lemmings_move_offset < 38000) || (tmppti->pos_head == d2 && lemmings_move_offset > 28000)) { if (!level_is_finished) { player[c].score += 10; player[tmppti->couleur].lemmings_nbr--; } tmppti->dead = (rand () & 15) + 1; if (rand () & 63) { tmppti->couleur = 0; if (player[c].cpu == 2) event_sfx (90 + ((tmppti->dead - 1) >> 1)); } else { tmppti->couleur = 1; if (!level_is_finished) player[c].score += 140; player[c].martians_nbr++; if (player[c].cpu == 2) event_sfx (98); } /* We will assign the dead lemming to the nearest square. */ if (lemmings_move_offset < 32536) { /* If it's the tail square, the offset can be kept as-is. */ tmppti->min = lemmings_move_offset; i = tmppti->pos_tail; } else { /* If it's the head square, the offset and the direction needs to be inverted. */ tmppti->min = 65536 - lemmings_move_offset; assert (tmppti->min < 65536); i = tmppti->pos_head; tmppti->dir = REVERSE_DIR (tmppti->dir); } square_lemmings_list[tmppti->pos_tail] = NULL; square_lemmings_list[tmppti->pos_head] = NULL; tmppti->next_dead = square_dead_lemmings_list[i]; square_dead_lemmings_list[i] = tmppti; } } for (i = 0; i < 4; i++) if (player[(i + 1) & 3].lemmings_nbr == 0 && player[(i + 2) & 3].lemmings_nbr == 0 && player[(i + 3) & 3].lemmings_nbr == 0) level_is_finished = i + 1; } if (game_mode == M_COLOR) { t = square_object[d2]; if ((signed char) t >= 0) { if ((!level_is_finished)) { player[c].score += 2; if (player[c].cpu == 2) { if (t == c) event_sfx (100); else if (t <= 4) event_sfx (101); else if (t == 8 + c) event_sfx (102); else if (t <= 12) event_sfx (103); else if (t == 16) event_sfx (104); else if (t == 24) event_sfx (105); } if ((t < 4) && (player[t].spec != 0xde)) player[t].cash++; else if (t == 4) { if (player[(c + 1) & 3].spec != 0xde) player[(c + 1) & 3].cash++; if (player[(c + 2) & 3].spec != 0xde) player[(c + 2) & 3].cash++; if (player[(c + 3) & 3].spec != 0xde) player[(c + 3) & 3].cash++; } else if (t < 12) { if (player[t & 3].cash > 0) player[t & 3].cash--; } else if (t == 12) { if ((player[(c + 1) & 3].cash > 0) && (player[(c + 1) & 3].spec != 0xde)) player[(c + 1) & 3].cash--; if ((player[(c + 2) & 3].cash > 0) && (player[(c + 2) & 3].spec != 0xde)) player[(c + 2) & 3].cash--; if ((player[(c + 3) & 3].cash > 0) && (player[(c + 3) & 3].spec != 0xde)) player[(c + 3) & 3].cash--; } else if (t == 16) player[c].time += 1000; else if (t == 24) { if (player[c].time > 333) player[c].time -= 333; else player[c].time = 1; } } square_object[d2] = -1; /* add_color(0); */ objects_nbr--; } } if (game_mode == M_TCASH) { t = square_object[d2]; if ((signed char) t >= 0) { if (!level_is_finished) { player[c].score += 2; if (t == 0) { player[c].cash++; if (player[c].cpu == 2) event_sfx (80); } if (t == 15) { player[c].time += 1000; if (player[c].cpu == 2) event_sfx (81); } } square_object[d2] = -1; /* add_cash(0); */ objects_nbr--; } } if (game_mode == M_DEATHM) { for (i = 0; i < 4; i++) if (player[(i + 1) & 3].lifes == 0 && player[(i + 2) & 3].lifes == 0 && player[(i + 3) & 3].lifes == 0) level_is_finished = i + 1; } { int bonus = tile_bonus[d]; if (bonus && bonus != 0xff) { rem_bonus (d); if (!level_is_finished) { player[c].score += 10; if (bonus & 128) { if (player[c].cpu == 2) event_sfx (39 + (bonus & 127)); for (i = 0; i < 4; i++) if ((c != i) && (player[i].spec != 0xde)) apply_bonus (i, (bonus & 127)); } else apply_bonus (c, bonus); } if (player[c].notify_delay) { player[c].notify_delay = 0; player[c].delay = 100; player[c].d.e = 0; return; } } } player[c].old_old_way = player[c].old_way; player[c].old_way = player[c].way; if (player[c].autopilot) find_free_way (c); /* here t_tunnel*4 become t_tunnel*8 !!! */ if ((!player[c].autopilot) && (player[c].next_way == (player[c].old_way ^ 2))) player[c].next_way = player[c].old_way; if (player[c].spec != t_ice) player[c].way = player[c].next_way; else { player[c].next_way = player[c].way; player[c].spec = 0; } idx = lvl.square_move[player[c].way][d2]; if (idx == INVALID_INDEX) player[c].spec = 0xff; else if (square_occupied[idx] != 0xff) player[c].spec = 0xff; if (player[c].spec == 0xff) { erase_trail (c); if (! level_is_finished) { if (! player[c].invincible && game_mode != M_DEATHM) shrink_trail (c, 5); if (player[c].lifes == 1) { player[c].lifes = 0; player[c].spec = 0xde; if (!(((player[0].cpu & 2) && (player[0].lifes)) || ((player[1].cpu & 2) && (player[1].lifes)) || ((player[2].cpu & 2) && (player[2].lifes)) || ((player[3].cpu & 2) && (player[3].lifes)))) { level_is_finished = 15; } if (player[c].cpu == 2) event_sfx (62); return; } } reinit_player (c); if (player[c].lifes != 0 && player[c].invincible == 0 && (!level_is_finished)) player[c].lifes--; if (!level_is_finished) { if (player[c].lifes > 1) { if (player[c].cpu == 2) event_sfx (60); } else { if (player[c].cpu == 2) event_sfx (61); } /* TRANS: %d, the number of remaining lives, is always positive. */ sprintf (txt_tmp, ngettext("LAST LIFE", "%d LIVES LEFT", player[c].lifes), player[c].lifes); } if (!level_is_finished) set_txt_bonus (c, txt_tmp, 150); player[c].invincible = 350; return; } /******************/ if (lvl.square_type[player[c].pos] == T_TUNNEL && lvl.square_direction[player[c].pos] == player[c].next_way) { a_dir dir; a_square_index dest; player[c].spec = t_tunnel; if ((player[c].cpu == 2) && (!level_is_finished)) event_sfx (69); dest = lvl.square_move[player[c].next_way][player[c].pos]; if (lvl.square_type[dest] == T_TUNNEL) dir = lvl.square_direction[dest] ^ 2; else dir = lvl.square_direction[player[c].pos] ^ 2; player[c].tunnel_way = dir; player[c].next_way = player[c].tunnel_way; if (player[c].tunnel_inverse) player[c].next_way ^= 2; } /*****************/ /* if (player[c].spec!=t_tunnel*8) */ { if (lvl.square_type[player[c].pos] == T_SPEED) { a_dir dir = lvl.square_direction[player[c].pos]; if (player[c].way == dir) player[c].vi = player[c].v; else if ((player[c].way ^ 2) == dir) player[c].vi = -(player[c].v >> 1); else player[c].vi = 0; } else player[c].vi = 0; if (lvl.square_type[player[c].pos] == T_DUST) player[c].vi = -(player[c].v >> 1); trigger_possible_explosion (d2); } player[c].delay = 0; assert (lvl.square_move[player[c].way][d2] != INVALID_INDEX); square_occupied[lvl.square_move[player[c].way][d2]] = (char) (c + 4); } } /* lemming moves */ static void update_lemmings (void) { int j; a_lemming *lem; lem = lemmings_support; lemmings_move_offset &= 0xffff; for (j = lemmings_total; j != 0; j--, lem++) if (lem->dead == 0) { find_lemming_direction (lem); } } static int update_all (char plr) { int n = 0; long frames = read_htimer (update_htimer); update_explosions (); for (; frames; --frames) { if (plr) { update_player (0); update_player (1); update_player (2); update_player (3); update_bonuses (); if (radar_current_pos < radar_target_pos) radar_current_pos++; else if (radar_current_pos > radar_target_pos) radar_current_pos--; } if (game_mode == M_KILLEM) { lemmings_move_offset += 1024; if (lemmings_move_offset >= 65536) update_lemmings (); } n++; } return (n); } void play_demo (void) { int n, i; char notbyebye = 1; a_timer demo_htimer = new_htimer (T_GLOBAL, HZ (1)); a_fader_status fade_stat = F_UNKNOWN; dmsg (D_SECTION, "-- play demo --"); in_menu = 0; tutor = 0; load_random_wrapped_level (false, 0); play_soundtrack (); set_pal_with_luminance (&tile_set_img.palette); radar_current_pos = 81; radar_target_pos = 0; /* .... game .... */ if (two_players) { nbr_tiles_cols = 8; } init_camera (); init_keyboard_map (); n = 1; update_htimers (); reset_htimer_with_offset (event_htimer, 4); reset_htimer (clock_htimer); reset_htimer (bonus_anim_htimer); reset_htimer (tiles_anim_htimer); reset_htimer (blink_htimer); reset_htimer (update_htimer); output_screen ((char) n); /* update corner[] */ /* corner[0]=render_buffer[0]; */ /* corner[1]=render_buffer[1]; */ if (two_players == false) { int flip_pos; a_pendulum *p = pendulum_create (); n = 0; while (pendulum_update (p, &flip_pos) < 3000) { flip_buffer (flip_pos); flush_display (render_buffer[1]); output_screen ((char) n); n = update_all (0); } pendulum_destroy (p); } if (two_players) { int buffer_pos = 39; do { flush_display2_moving (buffer_pos); output_screen ((char) n); n = update_all (0); for (i = n; i > 0; i--) if (buffer_pos > 0) buffer_pos--; } while (buffer_pos != 0); } /* * * * * * * * * * *\ * MAIN LOOP in demos * \* * * * * * * * * * */ dmsg (D_SECTION, "demo main loop"); do { event_time = read_htimer (event_htimer); update_text_waving_step (); if (enable_blit) { long duration = read_htimer (demo_htimer); if (duration >= (DEMO_DURATION - 1) && fade_stat == F_UNKNOWN) { dmsg (D_MISC, "end of demo time reached"); /* startup a black fade-out */ std_black_fadeout (&tile_set_img.palette); fader_status_flagback (&fade_stat); } if (two_players == false) { flush_display (corner[0]); } else { flush_display2 (corner[0], corner[1]); } } enable_blit = 1; output_screen ((char) n); process_input_events (); if (level_is_finished == 0) n = update_all (1); if (devparm && keyboard_map[HK_F12]) level_is_finished = 1; if (opt.ctrl_one ^ opt.ctrl_two) if (is_joystick_button_b (1) && enable_blit) notbyebye = 0; if (keyboard_map[HK_Escape] && enable_blit) notbyebye = 0; if (!(notbyebye && level_is_finished == 0) && fade_stat == F_UNKNOWN) { /* startup a black fade-out */ std_black_fadeout (&tile_set_img.palette); fader_status_flagback (&fade_stat); } } while (fade_stat != F_FINISHED); free_htimer (demo_htimer); uninit_keyboard_map (); unload_level (); nbr_tiles_cols = 15; in_menu = 1; reset_htimer (background_htimer); } static void load_demo (void) { char olddeuxplr; char gamemodeh; int i; dmsg (D_SECTION, "-- load demo --"); for (i = 3; i >= 0; i--) col2plr[i] = opt.player_color[i]; for (i = 3; i >= 0; i--) plr2col[opt.player_color[i]] = i; gamemodeh = (rand () & 3) + 2; olddeuxplr = two_players; two_players = rand () & 1; if (gamemodeh == 2) game_mode = M_DEATHM; else if (gamemodeh == 3) game_mode = M_KILLEM; else if (gamemodeh == 4) game_mode = M_TCASH; else if (gamemodeh == 5) game_mode = M_COLOR; current_quest_level = 0; unload_level (); /* stop also the music */ in_demo = 1; if (opt.sfx) load_sfx_mode (game_mode); rounds = 1; play_demo (); game_mode = M_QUEST; in_demo = 0; two_players = olddeuxplr; load_random_wrapped_level (true, 0); load_sfx_mode (-1); play_soundtrack (); reset_htimer (sound_track_htimer); reset_htimer (demo_trigger_htimer); } static void main_menu (void) { static char l = 0; a_keycode t; char flag = 0; dmsg (D_SECTION, "-- menu --"); load_random_wrapped_level (true, 0); load_sfx_mode (-1); play_soundtrack (); reset_htimer (sound_track_htimer); reset_htimer (background_htimer); reset_htimer (demo_trigger_htimer); reset_htimer_with_offset (event_htimer, 4); event_time = read_htimer (event_htimer); do { std_white_fadein (&tile_set_img.palette); do { background_menu (); draw_main_menu (l); flush_display (corner[0]); if (key_or_joy_ready () || demo_ready) { if (demo_ready == 0) t = get_key_or_joy (); else t = 0; if (t == HK_Up || t == HK_Down || t == HK_Escape) event_sfx (1); if (t == HK_Up) { if (l > 0) l--; else l = 6; } if (t == HK_Down) { if (l < 6) l++; else l = 0; } if (t == HK_Escape) { if (l != 6) l = 6; else t = HK_Enter; } if (devparm && (t == HK_s || t == HK_S)) end_scroll (); if (t == HK_d || t == HK_D || demo_ready) { a_timer pixelize_timer; long pixelize_pos; event_sfx (130); reset_htimer (corner_htimer); for (;;) { background_menu (); draw_main_menu (l); if (corner_buffer ()) break; flush_display (corner[0]); } load_demo (); if (check_what == check_demo) exit_heroes (0); dmsg (D_SECTION, "-- (back to) menu (from demo) --"); demo_ready = 0; event_sfx (131); std_white_fadein (&tile_set_img.palette); pixelize_timer = new_htimer (T_GLOBAL, HZ (7)); { a_pixel *pixbuf; XMALLOC_ARRAY (pixbuf, xbuf * 200); do { background_menu (); draw_main_menu (l); pixelize_pos = read_htimer (pixelize_timer); if (pixelize_pos > 6) pixelize_pos = 6; pixelize[6 - pixelize_pos] (pixbuf, corner[0]); flush_display (pixbuf); } while (pixelize_pos < 6); free (pixbuf); } free_htimer (pixelize_timer); } } else t = 0; } while (t != HK_Enter); event_sfx (10 + l); if (l == 0) play_menu (); if (l == 1) { option_menu (); save_preferences (); } if (l == 2) help_menu (); if (l == 3) jukebox_menu (); if (l == 4) scores_menu (); if (l == 5) { if (mouse_found) editor_first_menu (); } if (l == 6) flag = quit_menu (); } while (flag == 0); /* pixelize and fade-out, before exit */ { a_timer pixelize_timer; long pixelize_pos; a_fader_status fade_stat; a_pixel *pixbuf; XMALLOC_ARRAY (pixbuf, 200 * xbuf); pixelize_timer = new_htimer (T_GLOBAL, HZ (7)); std_black_fadeout (&tile_set_img.palette); fader_status_flagback (&fade_stat); do { background_menu (); draw_quit_menu (0); pixelize_pos = read_htimer (pixelize_timer); if (pixelize_pos > 6) pixelize_pos = 6; pixelize[pixelize_pos] (pixbuf, corner[0]); flush_display (pixbuf); } while (fade_stat != F_FINISHED); free (pixbuf); free_htimer (pixelize_timer); } } static void get_input_directions (void) { /* for humans only */ unsigned char j = (opt.ctrl_one == 1); char flag1 = 0; char flag2 = 0; if (keyboard_map[HK_Pause] && enable_blit) pause_menu (); if (opt.ctrl_one == 0) { if (keyboard_map[opt.player_keys[0][0]]) { player[col2plr[0]].next_way = w_up; flag1 = 1; } if (keyboard_map[opt.player_keys[0][1]]) { player[col2plr[0]].next_way = w_left; flag1 = 1; } if (keyboard_map[opt.player_keys[0][2]]) { player[col2plr[0]].next_way = w_down; flag1 = 1; } if (keyboard_map[opt.player_keys[0][3]]) { player[col2plr[0]].next_way = w_right; flag1 = 1; } player[col2plr[0]].turbo = keyboard_map[opt.player_keys[0][4]] ? 2 : 1; if (keyboard_map[opt.player_keys[0][5]]) { if (player[col2plr[0]].turbo == 2) { /* two buttons pushed */ player[col2plr[0]].turbo = 1; } else player[col2plr[0]].turbo = 0; } } else { joystick_x[0] = 0; joystick_y[0] = 0; joystick_x[1] = 0; joystick_y[1] = 0; get_joystick_state (); if (is_joystick_up (0)) { player[col2plr[0]].next_way = w_up; flag1 = 1; } if (is_joystick_left (0)) { player[col2plr[0]].next_way = w_left; flag1 = 1; } if (is_joystick_down (0)) { player[col2plr[0]].next_way = w_down; flag1 = 1; } if (is_joystick_right (0)) { player[col2plr[0]].next_way = w_right; flag1 = 1; } player[col2plr[0]].turbo = (is_joystick_button_a (0) ? 2 : 1); if (is_joystick_button_b (0)) { if (player[col2plr[0]].turbo == 2) { /* two buttons pushed */ player[col2plr[0]].turbo = 1; } else player[col2plr[0]].turbo = 0; } } if (player[col2plr[0]].inversed_controls != 0) { if (flag1) player[col2plr[0]].next_way ^= 2; player[col2plr[0]].tunnel_inverse = 1; } else player[col2plr[0]].tunnel_inverse = 0; if (((player[col2plr[0]].next_way ^ 2) == player[col2plr[0]].tunnel_way) && (player[col2plr[0]].spec == t_tunnel)) player[col2plr[0]].next_way = player[col2plr[0]].tunnel_way; if (two_players == true) { if (opt.ctrl_two == 0) { if (keyboard_map[opt.player_keys[1][0]]) { player[col2plr[1]].next_way = w_up; flag2 = 1; } if (keyboard_map[opt.player_keys[1][1]]) { player[col2plr[1]].next_way = w_left; flag2 = 1; } if (keyboard_map[opt.player_keys[1][2]]) { player[col2plr[1]].next_way = w_down; flag2 = 1; } if (keyboard_map[opt.player_keys[1][3]]) { player[col2plr[1]].next_way = w_right; flag2 = 1; } player[col2plr[1]].turbo = keyboard_map[opt.player_keys[1][4]] ? 2 : 1; if (keyboard_map[opt.player_keys[1][5]]) { if (player[col2plr[1]].turbo == 2) { /* two buttons pushed */ player[col2plr[1]].turbo = 1; } else player[col2plr[1]].turbo = 0; } } else { if (!j) { joystick_x[0] = 0; joystick_y[0] = 0; get_joystick_state (); } if (is_joystick_up (j)) { player[col2plr[1]].next_way = w_up; flag2 = 1; } if (is_joystick_left (j)) { player[col2plr[1]].next_way = w_left; flag2 = 1; } if (is_joystick_down (j)) { player[col2plr[1]].next_way = w_down; flag2 = 1; } if (is_joystick_right (j)) { player[col2plr[1]].next_way = w_right; flag2 = 1; } player[col2plr[1]].turbo = (is_joystick_button_a (j) ? 2 : 1); if (is_joystick_button_b (j)) { if (player[col2plr[1]].turbo == 2) { /* two buttons pushed */ player[col2plr[1]].turbo = 1; } else player[col2plr[1]].turbo = 0; } } if (player[col2plr[1]].inversed_controls != 0) { if (flag2) player[col2plr[1]].next_way ^= 2; player[col2plr[1]].tunnel_inverse = 1; } else player[col2plr[1]].tunnel_inverse = 0; /* if ((player[col2plr[1]].spec==t_tunnel)) printf("ss:%d,nxss:%d,ssold:%d,ssold2:%d,sstun:%d.\n", */ /* player[col2plr[1]].way,player[col2plr[1]].next_way,player[col2plr[1]].old_way,player[col2plr[1]].old_old_way,player[col2plr[1]].tunnel_way); */ if (((player[col2plr[1]].next_way ^ 2) == player[col2plr[1]].tunnel_way) && (player[col2plr[1]].spec == t_tunnel)) player[col2plr[1]].next_way = player[col2plr[1]].tunnel_way; } if (opt.ctrl_one ^ opt.ctrl_two) { if (is_joystick_button_a (1) && enable_blit) keyboard_map[HK_Pause] = 1; } } static unsigned char play_game (char cont) { int n, i; a_keycode t; char notbyebye = 1, flag; int l = 0, pos, u; char editflag = 0; static char tmpname[20]; char bufstr[32]; a_sprite *levelname; dmsg (D_SECTION, "-- play game --"); in_menu = 0; tutor = (char) (game_mode == M_QUEST && current_quest_level == 0); if (loadulevel == 1) { char* tmp = get_non_null_rsc_file ("levels-dir"); strappend (tmp, level_name); if (load_level (level_name, cont)) emsg (_("Error during level loading")); free (tmp); } else if (game_mode == M_QUEST /*&& questmode==0 */ ) load_level_from_number (current_quest_level++, cont); /* else if (game_mode==M_QUEST) loadlvlpasrandq2(current_quest_level++,cont); */ else load_random_level (cont); play_soundtrack (); reset_htimer (sound_track_htimer); set_pal_with_luminance (&tile_set_img.palette); radar_current_pos = 81; radar_target_pos = 0; /* . ... game ... . */ if (two_players) { nbr_tiles_cols = 8; } init_camera (); init_keyboard_map (); n = 1; update_htimers (); reset_htimer_with_offset (event_htimer, 4); reset_htimer (clock_htimer); reset_htimer (bonus_anim_htimer); reset_htimer (tiles_anim_htimer); reset_htimer (blink_htimer); reset_htimer (update_htimer); dmsg (D_SECTION, "introduce game"); output_screen ((char) n); /* update corner[] */ process_input_events (); if (game_mode == M_QUEST) sprintf (bufstr, _("-LEVEL %d-"), current_quest_level); else sprintf (bufstr, _("-ROUND %d/%d-"), rounds_nbr_values[opt.gamerounds] - rounds + 1, rounds_nbr_values[opt.gamerounds]); levelname = compile_menu_text (bufstr, T_CENTERED, 99, 159); if (two_players == false) { int pendulum_pos; a_pendulum *p = pendulum_create (); n = 0; while (pendulum_update (p, &pendulum_pos) < 3000) { flip_buffer (pendulum_pos); DRAW_SPRITE (levelname, render_buffer[1]); flush_display (render_buffer[1]); output_screen ((char) n); process_input_events (); n = update_all (0); } pendulum_destroy (p); } if (two_players) { int buffer_pos = 39; corner[0] = render_buffer[0]; clear_scr_area (corner[0]); DRAW_SPRITE (levelname, corner[0]); flush_display (corner[0]); sleep (1); update_htimers (); reset_htimer (update_htimer); n = 1; do { DRAW_SPRITE (levelname, corner[swapside] + (buffer_pos << 2)); DRAW_SPRITE (levelname, corner[1 - swapside] - (buffer_pos << 2) - 160); flush_display2_moving (buffer_pos); output_screen ((char) n); process_input_events (); n = update_all (0); for (i = n; i > 0; i--) if (buffer_pos > 0) buffer_pos--; } while (buffer_pos != 0); } event_sfx (141); free_sprite (levelname); /* * * * * * * * * * * * * * *\ * MAIN LOOP during the games * \* * * * * * * * * * * * * * */ dmsg (D_SECTION, "game main loop"); do { event_time = read_htimer (event_htimer); update_text_waving_step (); if (enable_blit) { if (two_players == false) { flush_display (corner[0]); } else { flush_display2 (corner[0], corner[1]); } } enable_blit = 1; output_screen ((char) n); process_input_events (); get_input_directions (); n = update_all (1); if (devparm && keyboard_map[HK_F12]) level_is_finished = 1; if (opt.ctrl_one ^ opt.ctrl_two) if (is_joystick_button_b (1) && enable_blit) notbyebye = quit_yes_no (); if (keyboard_map[HK_Escape] && enable_blit) notbyebye = quit_yes_no (); } while (notbyebye && level_is_finished == 0); dmsg (D_SECTION, "game finished"); if (level_is_finished >= 1 && level_is_finished <= 4) player[level_is_finished - 1].wins++; radar_target_pos = 81; if (notbyebye) { dmsg (D_SECTION, "print end level info"); uninit_keyboard_map (); l = 0; if (level_is_finished != 15) if (player[level_is_finished - 1].cpu == 2) event_sfx (63); else event_sfx (64); else event_sfx (65); do { event_time = read_htimer (event_htimer); update_text_waving_step (); if (two_players == false) { draw_end_level_info (0, l); flush_display (corner[0]); } else { a_pixel* tmp; tmp = corner[0]; draw_end_level_info (swapside ? -160 : 0, l); corner[0] = corner[1]; draw_end_level_info (swapside ? 0 : -160, l); corner[0] = tmp; flush_display2 (corner[0], corner[1]); } output_screen ((char) n); n = update_all (1); t = 0; if (key_or_joy_ready ()) { t = get_key_or_joy (); if (t == HK_Down && game_mode == M_QUEST) l = 1; if (t == HK_Up) l = 0; } flag = 1; if (opt.ctrl_one || opt.ctrl_two) { get_joystick_state (); if (is_joystick_down (0)) l = 1; if (is_joystick_up (0)) l = 0; if (is_joystick_button_a (0)) flag = 0; if (opt.ctrl_one && opt.ctrl_two) { if (is_joystick_down (1)) l = 1; if (is_joystick_up (1)) l = 0; if (is_joystick_button_a (1)) flag = 0; } } if (l == 1 && (t == HK_Enter || flag == 0) && game_mode == M_QUEST) { event_sfx (67); load_save_records (); t = 0; l = 0; editflag = 0; do { if (two_players == false) { draw_saved_games_info (0, l, true); flush_display (corner[0]); } else { a_pixel *tmp; tmp = corner[0]; draw_saved_games_info (swapside ? -160 : 0, l, true); corner[0] = corner[1]; draw_saved_games_info (swapside ? 0 : -160, l, true); corner[0] = tmp; flush_display2 (corner[0], corner[1]); } output_screen ((char) n); n = update_all (1); if (key_or_joy_ready ()) { if (editflag == 2) editflag = 0; if (editflag == 0) { t = get_key_or_joy (); if (t == HK_Down) { ((l < 9) ? (l++) : (l = 0)); event_sfx (120); } if (t == HK_Up) { ((l > 0) ? (l--) : (l = 9)); event_sfx (120); } if (t == HK_BackSpace || t == HK_Delete) { saverec[l].used = 0; saverec[l].name[0] = 0; event_sfx (128); FREE_SPRITE0 (saverec_name[l]); /* force recompilation */ write_save_one_record (l); } if (t == HK_Enter) { editflag = 1; strcpy (tmpname, saverec[l].name); pos = strlen (saverec[l].name); saverec[l].name[pos] = '^'; saverec[l].name[pos + 1] = 0; event_sfx (125); FREE_SPRITE0 (saverec_name[l]); /* force recompilation */ } if (t == HK_Escape) event_sfx (123); } else { t = get_key_or_joy (); u = keycode_to_ascii (t); pos = strlen (saverec[l].name); if (u >= 'a' && u <= 'z') u -= 'a' - 'A'; if (pos < 13) if ((u > 20 && u <= 95) || (u == 20 && pos != 0)) { saverec[l].name[pos - 1] = u; saverec[l].name[pos] = '^'; saverec[l].name[pos + 1] = 0; event_sfx (121); FREE_SPRITE0 (saverec_name[l]); /* force recompilation */ } if ((t == HK_BackSpace || t == HK_Delete) && (pos > 1)) { saverec[l].name[pos - 1] = 0; saverec[l].name[pos - 2] = '^'; event_sfx (122); FREE_SPRITE0 (saverec_name[l]); /* force recompilation */ } else if (t == 0x1c0a) { /* FIXME: choose a keysym to use */ saverec[l].name[pos - 1] = 0; event_sfx (127); editflag = 2; FREE_SPRITE0 (saverec_name[l]); /* force recompilation */ } else if (t == HK_Escape) { strcpy (saverec[l].name, tmpname); event_sfx (123); editflag = 2; FREE_SPRITE0 (saverec_name[l]); /* force recompilation */ } else if (t == HK_Enter) { saverec[l].name[pos - 1] = 0; saverec[l].level = current_quest_level /*+1 */ ; for (u = 0; u < 4; u++) { saverec[l].points[u] = player[col2plr[u]].score; copy_gameid (saverec[l].gid, game_id); saverec[l].lifes[u] = player[col2plr[u]].lifes; } saverec[l].used = 1; editflag = 0; event_sfx (124); write_save_one_record (l); FREE_SPRITE0 (saverec_name[l]); /* force recompilation */ } } } } while ((t != HK_Escape && t != HK_Enter) || editflag != 0); /* while (keyboard_map[HK_Escape]) process_input_events (); */ l = 1; } else if (t == HK_Escape) { if (joystick_detected & 1) do get_joystick_state (); while (is_joystick_button_a (0) != 0); if (quit_yes_no () == 0) l = 255; } } while ( /*keyboard_map[HK_Escape]==0 */ l != 255 && ((t != HK_Enter && flag) || l == 1)); init_keyboard_map (); if (l == 255 || game_mode == M_QUEST) { if (l == 0) event_sfx (66); /* next level */ if (l == 1) event_sfx (67); /* save game */ if (l == 255) event_sfx (68); /* echap */ for (i = 1; i <= 40; i += n) { event_time = read_htimer (event_htimer); update_text_waving_step (); if (two_players == false) { draw_end_level_info (0, l); flush_display_moving (i); } else { a_pixel *tmp; tmp = corner[0]; draw_end_level_info (swapside ? -160 : 0, l); corner[0] = corner[1]; draw_end_level_info (swapside ? 0 : -160, l); corner[0] = tmp; flush_display2_moving (i); } output_screen ((char) n); process_input_events (); n = update_all (1); } if (two_players == false) { draw_end_level_info (0, l); flush_display_moving (40); } else { a_pixel *tmp; tmp = corner[0]; draw_end_level_info (swapside ? -160 : 0, l); corner[0] = corner[1]; draw_end_level_info (swapside ? 0 : -160, l); corner[0] = tmp; flush_display2_moving (40); } } else { dmsg (D_SECTION, "print round info"); l = 0; flag = 1; event_sfx (129); do { event_time = read_htimer (event_htimer); update_text_waving_step (); if (two_players == false) { draw_round_info (0); flush_display (corner[0]); } else { a_pixel *tmp; tmp = corner[0]; draw_round_info (swapside ? -160 : 0); corner[0] = corner[1]; draw_round_info (swapside ? 0 : -160); corner[0] = tmp; flush_display2 (corner[0], corner[1]); } if (! keyboard_map[HK_Enter]) flag = 0; output_screen ((char) n); process_input_events (); n = update_all (1); if (keyboard_map[HK_Escape]) if (quit_yes_no () == 0) l = 255; } while ( /*! keyboard_map[HK_Escape] */ l != 255 && (flag || ! keyboard_map[HK_Enter])); /* if (keyboard_map[HK_Escape]) l=255; */ if (l == 0) event_sfx (66); /*next */ if (l == 1) event_sfx (67); /*save */ if (l == 255) event_sfx (68); /*esc */ for (i = 1; i <= 40; i += n) { event_time = read_htimer (event_htimer); update_text_waving_step (); if (two_players == false) { draw_round_info (0); flush_display_moving (i); } else { a_pixel *tmp; tmp = corner[0]; draw_round_info (swapside ? -160 : 0); corner[0] = corner[1]; draw_round_info (swapside ? 0 : -160); corner[0] = tmp; flush_display2_moving (i); } output_screen ((char) n); process_input_events (); n = update_all (1); } if (two_players == false) { draw_round_info (0); flush_display_moving (40); } else { a_pixel *tmp; tmp = corner[0]; draw_round_info (swapside ? -160 : 0); corner[0] = corner[1]; draw_round_info (swapside ? 0 : -160); corner[0] = tmp; flush_display2_moving (40); } /* end of round info */ } } if ((!notbyebye) || (level_is_finished == 15)) l = 255; uninit_keyboard_map (); unload_level (); nbr_tiles_cols = 15; in_menu = 1; /* if (l!=0) cont=0; */ return (l); } int heroes_main (int argc, char *argv[]) { int i; mtrace (); /* GNU libc's malloc debugging facility */ dmsg_init (argv[0]); dmsg (D_SECTION, "initialization"); var_initialize (); /* Needed by init_persona. */ init_persona (); relocate_data (argv[0]); init_locales (); init_sound_track_list (); /* Allow to override system-conf. That's especially used by the testsuite; and not documented (although it could). */ { char *system_conf = getenv ("HEROES_SYSTEM_CONF"); if (system_conf) { dmsg (D_SYSTEM, "HEROES_SYSTEM_CONF = %s", system_conf); set_rsc_file ("system-conf", system_conf, false); } } /* Read the system-wide configuration file. */ { char* tmp; bool sec = true; tmp = get_rsc_file_secure ("system-conf", &sec); if (tmp) { read_userconf (tmp, sec); free (tmp); } } if (setup_userdir ()) exit (1); init_scores (); init_save_records (); user_persona_definitively (); add_default_extra_directories (); /* Read the user configuration file. */ { char* tmp; bool sec = true; tmp = get_rsc_file_secure ("user-conf", &sec); if (tmp) { read_userconf (tmp, sec); free (tmp); } } /* Reopen the score and save file, because the user might have changed them from his configuration file. */ reinit_scores_if_needed (); reinit_save_records_if_needed (); freeze_sound_track_list (); dmsg (D_SYSTEM, "parsing command line"); { int err = parse_argv (argc, argv, 0, 0); if (err < 0) exit (0); if (err > 0) exit (err); } dmsg (D_SYSTEM, "randomize"); srand (time (0)); read_level_list (); if (showlevels) { print_level_list (); exit (0); } browse_extra_directories (); if (reinitopt) reinit_preferences (); else load_preferences (); if (showprefs) { output_preferences (stdout); exit (0); } /* FIXME: remove this option. */ if (reinitsco) { clear_scores (); write_scores (); } if (reinitsav) { clear_save_records (); write_save_records (); } if (joyoff) { joystick_detected = 0; /* reset controlers configuration to keyboards */ opt.ctrl_one = 0; opt.ctrl_two = 0; } else joyinit (); sys_persona (); if (init_sound_engine ()) exit (2); user_persona (); /* We read the SFX configuration only once the sound engine has been initialized, because during this initialization we might decide to disable SFX (hence no need to load the config file). */ if (read_sfx_conf ()) emsg (_("error in sfx.cfg")); sys_persona (); init_video (); user_persona (); init_htimer (); clock_htimer = new_htimer (T_GLOBAL, HZ (10)); blink_htimer = new_htimer (T_GLOBAL, HZ (6)); event_htimer = new_htimer (T_GLOBAL, HZ (70)); waving_htimer = new_htimer (T_GLOBAL, HZ (70)); corner_htimer = new_htimer (T_GLOBAL, HZ (280)); update_htimer = new_htimer (T_LOCAL, HZ (70)); background_htimer = new_htimer (T_LOCAL, HZ (70)); sound_track_htimer = new_htimer (T_GLOBAL, HZ (2)); tiles_anim_htimer = new_htimer (T_GLOBAL, HZ (70)); demo_trigger_htimer = new_htimer (T_GLOBAL, HZ (1)); init_text_waving_step (); init_fader (); if (!directmenu || check_what == check_intro) { play_intro (); if (check_what == check_intro) exit_heroes (0); } init_buffers (); init_bonuses (); pcx_load_from_rsc ("main-font", &main_font_img); pcx_load_from_rsc ("vehicles-img", &vehicles_img); pcx_load_from_rsc ("jukebox-font", &font_deck_img); init_fonts (); init_explosions (); init_items (); for (i = 0; i != 32; i++) minisinus[i] = ceil (sin (i * 2.0 * 3.141592653 / 32.0) * 1.7); compute_lut (); init_menus_sprites (); dummy_moving_background_init (); update_htimers (); main_menu (); dummy_moving_background_uninit (); uninit_menus_sprites (); uninit_fader (); uninit_text_waving_step (); uninit_items (); uninit_explosions (); uninit_fonts (); free_htimer (demo_trigger_htimer); free_htimer (sound_track_htimer); free_htimer (tiles_anim_htimer); free_htimer (background_htimer); free_htimer (update_htimer); free_htimer (waving_htimer); free_htimer (event_htimer); free_htimer (corner_htimer); free_htimer (clock_htimer); free_htimer (blink_htimer); img_free (&font_deck_img); img_free (&vehicles_img); img_free (&main_font_img); free_all_sfx (); close_sfx_handle (); unload_level (); free_level_list (); uninit_bonuses (); close_buffers (); uninit_sound_engine (); uninit_video (); var_uninitialize (); uninit_sound_track_list (); free_extra_list (); free_extra_directories (); save_preferences (); free_save_records (); free_scores (); free_preferences (); free_userdir (); free_modified_rsc (); return 0; } heroes-0.21/src/heroes.h0000644004117000411500000000410507352614752010640 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__HEROES__H #define HEROES__HEROES__H #include "timer.h" extern a_timer clock_htimer; extern a_timer blink_htimer; extern a_timer bonus_anim_htimer; extern a_timer tiles_anim_htimer; extern a_timer corner_htimer; extern a_timer waving_htimer; extern a_timer background_htimer; extern a_timer corner_htimer; extern a_timer demo_trigger_htimer; extern a_timer sound_track_htimer; extern long event_time; extern a_timer event_htimer; extern a_timer update_htimer; extern void compute_corner (int p, int n); extern void play_demo (void); extern int level_is_finished; extern char enable_blit; extern int rounds; extern void grow_trail (int pl, int size); extern void shrink_trail (int pl, int size); #endif /* HEROES__HEROES__H */ heroes-0.21/src/intro.c0000644004117000411500000002033707352614752010506 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ /* the intro animation */ #include "system.h" #include "video.h" #include "pcx.h" #include "timer.h" #include "fastmem.h" #include "const.h" #include "strack.h" #include "intro.h" #include "debugmsg.h" #include "fader.h" #include "scrtools.h" /******* data of the intro *******/ a_palette fade_pal; a_pcx_image intro_img; a_pixel **erase_data; a_pixel **erase_data_cur; int color_nbr[256 + 1]; a_pixel **(erase_color_ptr[256]); int errori; a_timer intro_frame_htimer; a_timer intro_global_htimer; static a_pixel *intro_buffer; /********************************/ static void copy_vehicle_1 (int x) { int y; int dx = 248; if (x >= 320) dx -= x - 320; if (x < 248) { dx = x; for (y = 31; y >= 0; y--) memcpy (intro_buffer + (58 + y) * xbuf, intro_img.buffer + (58 + y) * 320 + 306 - dx, dx); } else for (y = 31; y >= 0; y--) memcpy (intro_buffer + (58 + y) * xbuf + x - 248, intro_img.buffer + (58 + y) * 320 + 58, dx); } static void copy_vehicle_2 (int x) { int y; int dx = 248; if (x >= 320) dx -= x - 320; if (x < 248) { dx = x; for (y = 31; y >= 0; y--) memcpy (intro_buffer + (110 + y) * xbuf, intro_img.buffer + (110 + y) * 320 + 262 - dx, dx); } else for (y = 31; y >= 0; y--) memcpy (intro_buffer + (110 + y) * xbuf + x - 248, intro_img.buffer + (110 + y) * 320 + 14, dx); } static void compute_erase_data (void) { a_pixel *dest = intro_buffer; a_pixel *src = intro_img.buffer; int i, j; for (i = 320 * 200; i > 0; i--) color_nbr[*src++]++; erase_color_ptr[0] = erase_data; for (i = 1; i <= 255; i++) erase_color_ptr[i] = erase_color_ptr[i - 1] + color_nbr[i - 1]; src = intro_img.buffer; for (i = 200; i > 0; i--) { for (j = 320; j > 0; j--) { *erase_color_ptr[*src]++ = dest; src++; dest++; } dest += xbuf - 320; } } static a_pixel ** erase (a_pixel **src, int j) { int nbr = color_nbr[j]; color_nbr[j + 1] += nbr & 1; nbr >>= 1; while (nbr) { a_pixel *a = src[0]; a_pixel *b = src[1]; *a = 0; src += 2; --nbr; *b = 0; } return src; } static void antialias (a_pixel *src, int height) { do { unsigned int a, b, c, d; unsigned int width; a = src[-1]; b = src[0]; for (width = 320 / 2; width; --width) { c = src[1]; ++src; a += c; d = src[1]; a >>= 1; b += d; src[-1] = a; b >>= 1; a = c; src[0] = b; b = d; ++src; } src += xbuf - 320; --height; } while (height); } static char show_intro (void) { a_palette pal; a_fader_status fade_stat; int i; load_soundtrack_from_alias ("INTRO"); XMALLOC_ARRAY (erase_data, 320 * 200); erase_data_cur = erase_data; pcx_load_from_rsc ("intro-logos-img", &intro_img); play_soundtrack (); memset (color_nbr, 0, 256 * sizeof(*color_nbr)); set_pal_entry (255, 0, 0, 0); memset (intro_buffer, 255, xbuf * 100); memset (intro_buffer + xbuf * 100, 0, xbuf * 100); reset_htimer (intro_frame_htimer); reset_htimer (intro_global_htimer); for (i = 0; i <= 63; i += read_htimer (intro_frame_htimer)) { set_pal_entry (255, i, i, i); fade_pal.indiv[255].r = i; fade_pal.indiv[255].g = i; fade_pal.indiv[255].b = i; flush_display (intro_buffer); if (key_or_joy_ready ()) { img_free (&intro_img); return (1); } } for (i = 767; i >= 0; i--) fade_pal.global[i] = pal.global[i] = ((i >= 384) ? 63 : 0); set_pal (pal.global, 0, 768); copy_image_to_scr_area (&intro_img, intro_buffer); while (read_htimer (intro_global_htimer) < 2) { flush_display (intro_buffer); if (key_or_joy_ready ()) { img_free (&intro_img); return (1); } } /* fade-in to the intro_img */ std_palette_fade (&pal, &intro_img.palette); fader_status_flagback (&fade_stat); do { flush_display (intro_buffer); if (key_or_joy_ready ()) { img_free (&intro_img); return (1); } } while (fade_stat != F_FINISHED); img_free (&intro_img); pcx_load_from_rsc ("intro-vehicles-img", &intro_img); while (read_htimer (intro_global_htimer) < 9) { flush_display (intro_buffer); if (key_or_joy_ready ()) { img_free (&intro_img); return (1); } } std_palette_fade (&intro_img.palette, &pal); fader_status_flagback (&fade_stat); fader_delay (64); do { antialias (intro_buffer + 85 * xbuf, 13); antialias (intro_buffer + 103 * xbuf, 13); flush_display (intro_buffer); if (key_or_joy_ready ()) { img_free (&intro_img); return (1); } } while (fade_stat != F_FINISHED); memset (intro_buffer, 255, xbuf * 100); memset (intro_buffer + xbuf * 100, 0, xbuf * 100); set_pal (intro_img.palette.global, 0, 768); while (read_htimer (intro_global_htimer) < 14) { flush_display (intro_buffer); if (key_or_joy_ready ()) { img_free (&intro_img); return (1); } } /* For this sequence, slices will be 4 times shorter */ intro_frame_htimer->slice_duration /= 4; reset_htimer (intro_frame_htimer); for (i = 0; i < 568; i += read_htimer (intro_frame_htimer)) { copy_vehicle_1 (i); copy_vehicle_2 (567 - i); flush_display (intro_buffer); if (key_or_joy_ready ()) { img_free (&intro_img); return (1); } } intro_frame_htimer->slice_duration *= 4; /* revert old speed. */ img_free (&intro_img); pcx_load_from_rsc ("intro-splash-img", &intro_img); copy_image_to_scr_area (&intro_img, intro_buffer); intro_img.palette.indiv[254].r = 0; intro_img.palette.indiv[254].g = 0; intro_img.palette.indiv[254].b = 0; img_free (&intro_img); /* will free the picture, not the palette */ std_white_fadein (&intro_img.palette); fader_status_flagback (&fade_stat); do { flush_display (intro_buffer); if (key_or_joy_ready ()) return (1); } while (fade_stat != F_FINISHED); pcx_load_from_rsc ("intro-erase-img", &intro_img); compute_erase_data (); img_free (&intro_img); while (read_htimer (intro_global_htimer) < 27) { flush_display (intro_buffer); if (key_or_joy_ready ()) return (1); } erase_data_cur = erase_data; reset_htimer (intro_frame_htimer); for (i = 0; i <= 255; i += read_htimer (intro_frame_htimer)) { flush_display (intro_buffer); erase_data_cur = erase (erase_data_cur, i); if (key_or_joy_ready ()) return (1); } return (0); } void play_intro (void) { a_palette pal; dmsg (D_SECTION, "-- game introduction --"); intro_frame_htimer = new_htimer (T_LOCAL|T_BLOCKING, HZ (70)); intro_global_htimer = new_htimer (T_GLOBAL, HZ (2)); XMALLOC_ARRAY (intro_buffer, xbuf * 200); show_intro (); free (intro_buffer); memset (pal.global, 0, 768); set_pal (pal.global, 0, 768); free (erase_data); unload_soundtrack (); while (key_or_joy_ready ()) get_key_or_joy (); free_htimer (intro_frame_htimer); free_htimer (intro_global_htimer); } heroes-0.21/src/intro.h0000644004117000411500000000270307352614752010510 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__INTRO__H #define HEROES__INTRO__H void play_intro (void); #endif /* HEROES__INTRO__H */ heroes-0.21/src/items.c0000644004117000411500000000740407352614752010474 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "items.h" #include "const.h" #include "sprshade.h" #include "sprglenz.h" #include "sprunish.h" a_sprite *big_dollar = 0; a_sprite *small_dollar = 0; a_sprite *clocks[NBR_CLOCK_FRAMES]; a_sprite *pyramids[NBR_PYRAMIDS]; a_sprite *trails[16][12]; a_sprite *red_cross[4] = { 0, 0, 0, 0 }; a_sprite *tutorial_arrow[NBR_ARROW_FRAMES] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int trail_row[16] = { 110, 0, -1, 30, 100, 20, 70, -1, -1, 10, 80, 40, 90, -1, 60, 50 }; void init_items (void) { int i, j; a_pcx_image trailimg, arrow_img; big_dollar = compile_sprshade (IMGPOS (main_font_img, 81, 0), 0, 1, glenz[0], 17, 17, main_font_img.width, xbuf); small_dollar = compile_sprshade (IMGPOS (main_font_img, 81, 18), 0, 1, glenz[0], 10, 10, main_font_img.width, xbuf); for (i = 0; i < NBR_CLOCK_FRAMES; ++i) clocks[i] = compile_sprshade (IMGPOS (main_font_img, 81, 52 + i * 10), 0, 1, glenz[0], 10, 10, main_font_img.width, xbuf); for (i = 0; i < NBR_PYRAMIDS; ++i) pyramids[i] = compile_sprshade (IMGPOS (main_font_img, 64, i * 16), 0, 1, glenz[0], 7, 9, main_font_img.width, xbuf); pcx_load_from_rsc ("arrow-img", &arrow_img); for (i = 0; i < 3; ++i) for (j = 0; j < 4; ++j) tutorial_arrow[i * 4 + j] = compile_sprunish (IMGPOS (arrow_img, i * 26, j * 26), 0, 200, glenz[0], 10, 26, 26, arrow_img.width, xbuf); img_free (&arrow_img); pcx_load_from_rsc ("trails-img", &trailimg); for (i = 0; i < 16; ++i) { if (trail_row[i] < 0) for (j = 0 ; j < 12; ++j) trails[i][j] = 0; else for (j = 0 ; j < 12; ++j) trails[i][j] = compile_sprglenz (IMGPOS (trailimg, trail_row[i], j << 4), 0, glenz[0], 10, 12, trailimg.width, xbuf); } for (i = 0; i < 4; ++i) red_cross[i] = compile_sprglenz (IMGPOS (main_font_img, 119, i << 6), 0, glenz[6], 22, 40, main_font_img.width, xbuf); img_free (&trailimg); } void uninit_items (void) { int i; FREE_SPRITE0 (big_dollar); FREE_SPRITE0 (small_dollar); for (i = 0; i < NBR_CLOCK_FRAMES; ++i) FREE_SPRITE0 (clocks[i]); for (i = 0; i < NBR_PYRAMIDS; ++i) FREE_SPRITE0 (pyramids[i]); for (i = 0; i < NBR_ARROW_FRAMES; ++i) FREE_SPRITE0 (tutorial_arrow[i]); for (i = 0; i < 16; ++i) { int j; for (j = 0 ; j < 12; ++j) FREE_SPRITE0 (trails[i][j]); } for (i = 0; i < 4; ++i) FREE_SPRITE0 (red_cross[i]); } heroes-0.21/src/items.h0000644004117000411500000000412507352614752010476 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__ITEMS__H #define HEROES__ITEMS__H /*----------------------------------------------------------------. | `Items' refers to the various items collectable during the game | | (color pyramids, dollars, etc.). | `----------------------------------------------------------------*/ #include "sprite.h" extern a_sprite *big_dollar; extern a_sprite *small_dollar; #define NBR_CLOCK_FRAMES 8 extern a_sprite *clocks[NBR_CLOCK_FRAMES]; #define NBR_PYRAMIDS 5 extern a_sprite *pyramids[NBR_PYRAMIDS]; extern a_sprite *trails[16][12]; extern a_sprite *red_cross[4]; #define NBR_ARROW_FRAMES 12 extern a_sprite *tutorial_arrow[NBR_ARROW_FRAMES]; void init_items (void); void uninit_items (void); #endif /* HEROES__ITEMS__H */ heroes-0.21/src/levellst.c0000644004117000411500000001063607430322543011175 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "levellst.h" #include "lvl.h" #include "debugmsg.h" #include "errors.h" #include "rsc_files.h" /* select only *.lvl files */ int select_file_lvl (const struct dirent *d) { int l = strlen (d->d_name); return (l > 4 && d->d_name[l - 4] == '.' && d->d_name[l - 3] == 'l' && d->d_name[l - 2] == 'v' && d->d_name[l - 1] == 'l'); } a_level_info *level_list = 0; size_t level_list_size = 0; static size_t level_list_max = 0; static void read_level_dir (const char *dirname) { DIR *dir; struct dirent* de; int n = 0; dmsg (D_FILE | D_SECTION, "reading level list from %s", dirname); dir = opendir (dirname); if (!dir) { dperror ("opendir"); emsg (_("cannot open directory %s"), dirname); } while ((de = readdir (dir))) if (select_file_lvl (de)) { char *filename; a_level tmp_lvl; if (level_list_size >= level_list_max) { level_list_max += 32; XREALLOC_ARRAY (level_list, level_list_max); } filename = xmalloc (strlen (dirname) + 1 + strlen (de->d_name) + 1); sprintf (filename, "%s/%s", dirname, de->d_name); level_list[level_list_size].name = filename; dmsg (D_FILE, "loading header from %s", filename); lvl_load_file (filename, &tmp_lvl, false); level_list[level_list_size].wrapped = (tmp_lvl.tile_width_wrap != DONT_WRAP && tmp_lvl.tile_height_wrap != DONT_WRAP); lvl_free (&tmp_lvl); ++level_list_size; } closedir (dir); dmsg (D_FILE, "... %d files", n); } /* Level should be played in the following order: niv010.lvl niv020.lvl niv030.lvl ... niv100.lvl niv011.lvl niv021.lvl niv031.lvl ... niv101.lvl niv019.lvl niv029.lvl niv039.lvl ... niv109.lvl I.e, sorted on the last digit first. */ static int cmp_levels (const void *a, const void *b) { const a_level_info *lia = a; const a_level_info *lib = b; int la = strlen (lia->name); int lb = strlen (lib->name); if (la != lb || la < 6) { /* This should not happen, unless someone intentionally add some strange level files to the directory. */ return strcmp (lia->name, lib->name); } else { /* Sort on the last digit first. */ int ret = (int) lia->name[la - 5] - (int) lib->name[lb - 5]; if (ret) return ret; else /* Then use the remaining of the name. */ return strncmp (lia->name, lib->name, la - 5); } } int read_level_list (void) { char *dirname = get_non_null_rsc_file ("levels-dir"); read_level_dir (dirname); free (dirname); /* Sort the levels array (files are numbered and we really want to play them in the right order). */ qsort (level_list, level_list_size, sizeof (*level_list), cmp_levels); return 0; } void free_level_list (void) { size_t i; for (i = 0; i < level_list_size; ++i) free (level_list[i].name); free (level_list); level_list = 0; level_list_max = 0; level_list_size = 0; } void print_level_list (void) { unsigned int i; for (i = 0; i < level_list_size; ++i) printf ("%3d. %s%s\n", i + 1, level_list[i].name, level_list[i].wrapped ? " (fully wrapped)" : ""); } heroes-0.21/src/levellst.h0000644004117000411500000000326607352614752011214 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__LEVELLST__H #define HEROES__LEVELLST__H typedef struct a_level_info a_level_info; struct a_level_info { char *name; bool wrapped; }; extern a_level_info *level_list; extern size_t level_list_size; int select_file_lvl (const struct dirent *d); int read_level_list (void); void free_level_list (void); void print_level_list (void); #endif /* HEROES__LEVELLST__H */ heroes-0.21/src/locales.c0000644004117000411500000000305307352614752010771 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "rsc_files.h" #include "locales.h" void init_locales (void) { char *ldir = get_non_null_rsc_file ("locale-dir"); setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, ldir); textdomain (PACKAGE); free (ldir); } heroes-0.21/src/menus.c0000644004117000411500000021743007420654047010501 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "const.h" #include "sfx.h" #include "prefs.h" #include "keyb.h" #include "keyvalues.h" #include "keysdef.h" #include "heroes.h" #include "structs.h" #include "extras.h" #include "video.h" #include "savegame.h" #include "hedlite.h" #include "render.h" #include "strack.h" #include "menus.h" #include "keyb.h" #include "misc.h" #include "rsc_files.h" #include "bytesex.h" #include "fader.h" #include "scrtools.h" #include "sprrle.h" #include "sprtext.h" #include "sprprogwav.h" #include "sprshade.h" #include "spropaque.h" #include "debugmsg.h" #include "timer.h" #include "joystick.h" #include "pixelize.h" #include "scores.h" #include "helptext.h" #include "readmake.h" #include "endscroll.h" #include "people.h" #include "camera.h" static a_timer lemming_htimer; static a_sprite* left_arrow = 0; static a_sprite* right_arrow = 0; static a_sprite* checked_box[2] = {0, 0}; static a_sprite* cursor_bg = 0; static a_sprite* cursor_fg = 0; static a_sprite* horizontal_rule = 0; static a_sprite* bigarr_cursor = 0; /* for the editor menu */ static a_sprite* sqr_cursor = 0; /* likewise */ static a_sprite* small_arrows[2][2] = {{ 0, 0 }, { 0, 0}}; static a_sprite* control_menu_txt = 0; static a_sprite* sound_menu_txt = 0; static a_sprite* music_vol_txt = 0; static a_sprite* sfx_vol_txt = 0; static a_sprite* screen_menu_txt = 0; static a_sprite* game_menu_txt = 0; static a_sprite* game_rounds_txt = 0; static a_sprite* keyboard_menu_txt = 0; static a_sprite* keyboard_keys_txt[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static a_sprite* extra_menu_txt = 0; static a_sprite* extra_modes_txt[3] = { 0, 0, 0 }; static a_sprite* extra_combine_txt[3] = { 0, 0, 0 }; static a_sprite* pause_menu_txt = 0; static a_sprite* quitgame_menu_txt = 0; static a_sprite* quitheroes_menu_txt = 0; static a_sprite* quit_yes_txt = 0; static a_sprite* quit_no_txt = 0; static a_sprite* ed_new_level_txt = 0; static a_sprite* ed_existing_level_txt = 0; static a_sprite* ed_name_txt = 0; static a_sprite* ed_x_wrap_txt = 0; static a_sprite* ed_y_wrap_txt = 0; static a_sprite* ed_x_size_txt = 0; static a_sprite* ed_y_size_txt = 0; static a_sprite* ed_edit_txt = 0; static a_sprite* edit_sel_txt = 0; static a_sprite* playmenu_title_txt = 0; static a_sprite* playmenu_players_txt[2] = { 0, 0 }; static a_sprite* playmenu_goback_txt = 0; static a_sprite* playmenu_load_txt = 0; static a_sprite* gamemode_txt[5] = { 0, 0, 0, 0, 0 }; static a_sprite* load_select_txt = 0; static a_sprite* save_select_txt = 0; a_sprite* saverec_name[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static a_sprite* enter_your_name_txt = 0; static a_sprite* info_mode_quest_txt = 0; static a_sprite* info_mode_deathm_txt = 0; static a_sprite* info_mode_killem_txt = 0; static a_sprite* info_mode_tcash_txt = 0; static a_sprite* info_mode_color_txt = 0; static a_sprite* info_mode_next_txt = 0; static a_sprite* info_mode_save_txt = 0; /* The column to start arrows on, depending of the width of info_mode_next_txt and info_mode_save_txt. */ unsigned int info_mode_next_save_arrow_pos = 0; static a_sprite* info_mode_return_txt = 0; static a_sprite* info_round_txt = 0; static a_sprite* info_martian[4] = { 0, 0, 0, 0 }; static a_sprite* higher_scores_txt = 0; static a_sprite* jukebox_frame = 0; static a_sprite* jukebox_back = 0; static a_sprite* jukebox_forw = 0; static a_sprite* jukebox_quit = 0; static a_sprite* vehicles_spr[4] = { 0, 0, 0, 0 }; static a_sprite* lemming[8] = { 0, 0, 0, 0, 0, 0, 0 }; static a_sprite* ctrl_ico[2] = { 0, 0 }; static a_sprite* autopilot_ico[2] = { 0, 0 }; static a_sprite* music_ico[7] = { 0, 0, 0, 0, 0, 0 }; static a_sprite* sfx_ico[7] = { 0, 0, 0, 0, 0, 0 }; static a_sprite* radar_ico[2] = { 0, 0 }; static a_sprite* infos_ico[2] = { 0, 0 }; static a_sprite* inertia_ico[2] = { 0, 0 }; static a_sprite* luminance_ico[7] = { 0, 0, 0, 0, 0, 0, 0 }; a_sprite* player_logo[4] = { 0, 0, 0, 0}; /* for end level info and game */ static a_sprite* player_ico[4] = { 0, 0, 0, 0}; /* for menus */ static a_sprite* speed_ico[5] = { 0, 0, 0, 0, 0}; static a_sprite* deck_digits[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static a_read_data* help_text = 0; static a_read_data* people_text = 0; static const char *mode_name[5] = { /* TRANS: in QUEST mode, the player goes throught all the levels, but have to search for specific powerups in order to jump to the next level. Hence this is a `quest' for those powerups. */ N_("QUEST"), /* TRANS: in DEATH MATCH mode, the user has to kill all other players. */ N_("DEATH MATCH"), /* TRANS: in KILL'EM ALL mode there are lemmings moving on the ground and the player must run over them all. You may want to translate `kill' as `run over', `squash', `mash' or something among those lines. */ N_("KILL'EM ALL"), /* TRANS: in TIME CA$H mode, the player must collect dollars with restricted time. */ N_("TIME CA$H"), /* TRANS: in COLOR mode, the player must collect some colored gems with restricted time. */ N_("COLORS") }; /* the following definitions are used to compile text-centered menus, that is, the main and the option menus */ typedef void (*an_entry_func) (void); typedef struct { const char *name; an_entry_func func; } a_menu_entry; typedef struct { a_sprite *title; a_sprite **entries; an_entry_func *funcs; int lines; int *hrules; unsigned arrows_col; unsigned first_row; } a_menu; static void game_menu (void); static void screen_menu (void); static void sound_menu (void); static void control_menu (void); static void keyboard_menu (void); static void extra_menu (void); static void editor_selector (void); static void editor_menu (void); a_menu_entry options_entries[] = { { N_("GAME"), game_menu }, { N_("SCREEN"), screen_menu }, { N_("SOUND"), sound_menu }, { N_("CONTROL"), control_menu }, { N_("KEYS"), keyboard_menu }, { N_("EXTRAS"), extra_menu }, { N_("GO BACK"), 0 }, { 0, 0 } }; a_menu *option_menu_data; a_menu_entry main_entries[] = { { N_("PLAY"), 0 }, { N_("OPTIONS"), 0 }, { N_("INFOS"), 0 }, { N_("CREDITS"), 0 }, { N_("SCORES"), 0 }, { N_("EDITOR"), 0 }, { N_("QUIT"), 0 }, { 0, 0 } }; a_menu *main_menu_data; a_menu_entry editor_entries[] = { /* TRANS: Create a new level. */ { N_("NEW LEVEL"), editor_menu }, /* TRANS: Load an existing level for edition. */ { N_("LOAD LEVEL"), editor_selector }, { N_("GO BACK"), 0 } }; a_menu *editor_menu_data; static a_menu * compile_menu (const char *name, const a_menu_entry *entries) { int tlines; /* number of text lines */ int row; /* row on screen */ const a_menu_entry *pos; int i; unsigned max_width = 0; NEW (a_menu, menu); /* title */ menu->title = compile_menu_text (name, T_CENTERED|T_WAVING, 12, 159); /* get the number of (text-)lines to draw */ tlines = 0; for (pos = entries; pos->name; ++pos) ++tlines; menu->lines = tlines; /* allocate space for entries, rules, and functions */ XMALLOC_ARRAY (menu->entries, tlines); XMALLOC_ARRAY (menu->funcs, tlines); XMALLOC_ARRAY (menu->hrules, tlines + 1); /* compute the row for the first text to draw (32 is the size reserved by the menu header) */ row = 32 + (200 - 32) / 2 - (tlines * 20) / 2; menu->first_row = row; /* compile the entry texts */ for (i = 0; i < tlines; ++i) { const char *ename = _(entries[i].name); unsigned width = compute_text_width (menu_font, ename, 0); menu->entries[i] = compile_menu_text (ename, T_CENTERED, row, 159); menu->funcs[i] = entries[i].func; if (width > max_width) max_width = width; row += 20; if (i + 1 != tlines) menu->hrules[i] = row - 7; } menu->arrows_col = (160 - max_width/2) - 20; return menu; } static void free_menu (a_menu *menu) { int i; i = menu->lines; while (i) free_sprite (menu->entries[--i]); free (menu->entries); free (menu->hrules); free_sprite (menu->title); free (menu->funcs); free (menu); } void init_menus_sprites (void) { a_pcx_image icons_img, jukebox_img; pcx_load_from_rsc ("menu-pictures-img", &icons_img); pcx_load_from_rsc ("jukebox-img", &jukebox_img); lemming_htimer = new_htimer (T_GLOBAL, HZ (18)); left_arrow = compile_sprrle (IMGPOS (main_font_img, 50, 134), 0, 20, 13, main_font_img.width, xbuf); right_arrow = compile_sprrle (IMGPOS (main_font_img, 50, 121), 0, 20, 13, main_font_img.width, xbuf); checked_box[0] = compile_sprrle (IMGPOS (main_font_img, 50, 218), 0, 14, 21, main_font_img.width, xbuf); checked_box[1] = compile_sprrle (IMGPOS (main_font_img, 50, 239), 0, 14, 21, main_font_img.width, xbuf); cursor_bg = compile_sprrle (IMGPOS (main_font_img, 53, 181), 0, 10, 37, main_font_img.width, xbuf); cursor_fg = compile_sprrle (IMGPOS (main_font_img, 51, 174), 0, 14, 7, main_font_img.width, xbuf); horizontal_rule = compile_sprrle (IMGPOS (main_font_img, 61, 0), 0, 3, 120, main_font_img.width, xbuf); bigarr_cursor = compile_spropaque (IMGPOS (main_font_img, 50, 260), 11, 16, main_font_img.width, xbuf); sqr_cursor = compile_spropaque (IMGPOS (main_font_img, 81, 32), 5, 8, main_font_img.width, xbuf); small_arrows[1][0] = compile_sprrle (IMGPOS (main_font_img, 60, 147), 0, 10, 10, main_font_img.width, xbuf); small_arrows[1][1] = compile_sprrle (IMGPOS (main_font_img, 60, 157), 0, 10, 10, main_font_img.width, xbuf); small_arrows[0][0] = compile_sprrle (IMGPOS (main_font_img, 50, 147), 0, 10, 10, main_font_img.width, xbuf); small_arrows[0][1] = compile_sprrle (IMGPOS (main_font_img, 50, 157), 0, 10, 10, main_font_img.width, xbuf); ctrl_ico[0] = compile_spropaque (IMGPOS (icons_img, 106, 0), 18, 32, icons_img.width, xbuf); ctrl_ico[1] = compile_spropaque (IMGPOS (icons_img, 106 + 19, 0), 18, 32, icons_img.width, xbuf); autopilot_ico[0] = compile_spropaque (IMGPOS (icons_img, 11, 144), 18, 32, icons_img.width, xbuf); autopilot_ico[1] = compile_spropaque (IMGPOS (icons_img, 11 + 19, 144), 18, 32, icons_img.width, xbuf); { int i; for (i = 0; i < 7; ++i) { music_ico[i] = compile_spropaque (IMGPOS (icons_img, 68 + 19 * i, 36), 18, 32, icons_img.width, xbuf); sfx_ico[i] = compile_spropaque (IMGPOS (icons_img, 68 + 19 * i, 72), 18, 32, icons_img.width, xbuf); luminance_ico[i] = compile_spropaque (IMGPOS (icons_img, 11 + 19 * i, 252), 18, 32, icons_img.width, xbuf); } } radar_ico[0] = compile_spropaque (IMGPOS (icons_img, 11, 36), 18, 32, icons_img.width, xbuf); radar_ico[1] = compile_spropaque (IMGPOS (icons_img, 11 + 19, 36), 18, 32, icons_img.width, xbuf); infos_ico[0] = compile_spropaque (IMGPOS (icons_img, 11, 180), 18, 32, icons_img.width, xbuf); infos_ico[1] = compile_spropaque (IMGPOS (icons_img, 11 + 19, 180), 18, 32, icons_img.width, xbuf); inertia_ico[0] = compile_spropaque (IMGPOS (icons_img, 68, 109), 18, 32, icons_img.width, xbuf); inertia_ico[1] = compile_spropaque (IMGPOS (icons_img, 68 + 19, 108), 18, 32, icons_img.width, xbuf); { int i; for (i = 0; i < 4; ++i) { player_logo[i] = compile_spropaque (IMGPOS (main_font_img, 72, 196 + i * 28), 11, 28, main_font_img.width, xbuf); player_ico[i] = compile_spropaque (IMGPOS (icons_img, 68 + 19 * i, 144), 18, 32, icons_img.width, xbuf); } for (i = 0; i < 5; ++i) speed_ico[i] = compile_spropaque (IMGPOS (icons_img, 11 + 19 * (4 - i), 216), 18, 32, icons_img.width, xbuf); } /* control menu */ new_sprprog (); add_sprprog0 (compile_menu_text (_("CONTROL OPTIONS"), T_CENTERED|T_WAVING, 5, 159)); add_sprprog0 (compile_menu_text (_("PLAYER 1"), T_FLUSHED_LEFT, 39, 56)); add_sprprog0 (compile_menu_text (_("AUTO PILOT"), T_FLUSHED_LEFT, 72, 56)); add_sprprog0 (compile_menu_text (_("PLAYER 2"), T_FLUSHED_LEFT, 111, 56)); add_sprprog0 (compile_menu_text (_("AUTO PILOT"), T_FLUSHED_LEFT, 144, 56)); add_sprprog0 (compile_menu_text (_("GO BACK"), T_FLUSHED_LEFT, 182, 56)); control_menu_txt = end_sprprog (); /* sound menu */ new_sprprog (); add_sprprog0 (compile_menu_text (_("SOUND OPTIONS"), T_CENTERED|T_WAVING, 5, 159)); add_sprprog0 (compile_menu_text (_("MUSIC"), T_FLUSHED_LEFT, 39, 56)); add_sprprog0 (compile_menu_text (_("SFX"), T_FLUSHED_LEFT, 109, 56)); add_sprprog0 (compile_menu_text (_("GO BACK"), T_FLUSHED_LEFT, 179, 56)); sound_menu_txt = end_sprprog (); music_vol_txt = compile_menu_text (_("MUSIC VOL"), T_FLUSHED_LEFT, 74, 56); sfx_vol_txt = compile_menu_text (_("SFX VOL"), T_FLUSHED_LEFT, 144, 56); /* screen menu */ new_sprprog (); add_sprprog0 (compile_menu_text (_("SCREEN OPTIONS"), T_CENTERED|T_WAVING, 5, 159)); add_sprprog0 (compile_menu_text (_("RADAR"), T_FLUSHED_LEFT, 41, 56)); add_sprprog0 (compile_menu_text (_("INFOS"), T_FLUSHED_LEFT, 75, 56)); add_sprprog0 (compile_menu_text (_("LIGHTING"), T_FLUSHED_LEFT, 109, 56)); add_sprprog0 (compile_menu_text (_("INERTIA"), T_FLUSHED_LEFT, 143, 56)); add_sprprog0 (compile_menu_text (_("GO BACK"), T_FLUSHED_LEFT, 179, 56)); screen_menu_txt = end_sprprog (); /* game menu */ new_sprprog (); add_sprprog0 (compile_menu_text (_("GAME OPTIONS"), T_CENTERED|T_WAVING, 5, 159)); add_sprprog0 (compile_menu_text (_("PLAYER 1"), T_FLUSHED_LEFT, 33, 56)); add_sprprog0 (compile_menu_text (_("PLAYER 2"), T_FLUSHED_LEFT, 57, 56)); add_sprprog0 (compile_menu_text (_("PLAYER 3"), T_FLUSHED_LEFT, 81, 56)); add_sprprog0 (compile_menu_text (_("PLAYER 4"), T_FLUSHED_LEFT, 105, 56)); add_sprprog0 (compile_menu_text (_("SPEED"), T_FLUSHED_LEFT, 129, 56)); add_sprprog0 (compile_menu_text (_("GO BACK"), T_FLUSHED_LEFT, 177, 56)); add_sprprog (compile_spropaque (IMGPOS (icons_img, 68 + 19 * 4, 144), 18, 32, icons_img.width, xbuf), 149 * xbuf + 20); game_menu_txt = end_sprprog (); /* keyboard menu */ new_sprprog (); add_sprprog0 (compile_menu_text (_("KEYBOARD DEFS"), T_CENTERED|T_WAVING, 5, 159)); add_sprprog0 (compile_menu_text (_("GO BACK"), T_CENTERED, 188, 159)); /* 1st player */ add_sprprog0 (compile_menu_text (_("PLAYER 1"), T_CENTERED, 25, 159)); add_sprprog0 (compile_menu_text (_("UP"), T_FLUSHED_LEFT, 38, 25)); add_sprprog0 (compile_menu_text (_("LEFT"), T_FLUSHED_LEFT, 60, 25)); add_sprprog0 (compile_menu_text (_("DOWN"), T_FLUSHED_LEFT, 49, 25)); add_sprprog0 (compile_menu_text (_("RIGHT"), T_FLUSHED_LEFT, 71, 25)); add_sprprog0 (compile_menu_text (_("TURBO"), T_FLUSHED_LEFT, 82, 25)); add_sprprog0 (compile_menu_text (_("STOP"), T_FLUSHED_LEFT, 93, 25)); /* 2nd player */ add_sprprog0 (compile_menu_text (_("PLAYER 2"), T_CENTERED, 108, 159)); add_sprprog0 (compile_menu_text (_("UP"), T_FLUSHED_LEFT, 121, 25)); add_sprprog0 (compile_menu_text (_("LEFT"), T_FLUSHED_LEFT, 143, 25)); add_sprprog0 (compile_menu_text (_("DOWN"), T_FLUSHED_LEFT, 132, 25)); add_sprprog0 (compile_menu_text (_("RIGHT"), T_FLUSHED_LEFT, 154, 25)); add_sprprog0 (compile_menu_text (_("TURBO"), T_FLUSHED_LEFT, 165, 25)); add_sprprog0 (compile_menu_text (_("STOP"), T_FLUSHED_LEFT, 176, 25)); keyboard_menu_txt = end_sprprog (); /* extra menu */ new_sprprog (); add_sprprog0 (compile_menu_text (_("EXTRAS LEVELS"), T_CENTERED|T_WAVING, 5, 169)); add_sprprog0 (compile_menu_text (_("GO BACK"), T_FLUSHED_LEFT, 180, 20)); extra_menu_txt = end_sprprog (); extra_modes_txt[0] = compile_menu_text (_("ORIGINAL LEVELS"), T_FLUSHED_LEFT, 35, 20); extra_modes_txt[1] = compile_menu_text (_("ORIGINAL+EXTRAS"), T_FLUSHED_LEFT, 35, 20); extra_modes_txt[2] = compile_menu_text (_("EXTRAS ONLY"), T_FLUSHED_LEFT, 35, 20); extra_combine_txt[0] = compile_menu_text (_("EXTRAS: NONE"), T_FLUSHED_LEFT, 57, 20); extra_combine_txt[1] = compile_menu_text (_("EXTRAS: ALL"), T_FLUSHED_LEFT, 57, 20); extra_combine_txt[2] = compile_menu_text (_("EXTRAS: SELECT"), T_FLUSHED_LEFT, 57, 20); jukebox_frame = compile_sprrle (IMGPOS (jukebox_img, 0, 0), 0, 19, 306, jukebox_img.width, xbuf); jukebox_forw = compile_sprrle (IMGPOS (jukebox_img, 19, 0), 0, 9, 12, jukebox_img.width, xbuf); jukebox_back = compile_sprrle (IMGPOS (jukebox_img, 19, 12), 0, 9, 12, jukebox_img.width, xbuf); jukebox_quit = compile_sprrle (IMGPOS (jukebox_img, 19, 24), 0, 9, 16, jukebox_img.width, xbuf); { int i; for (i = 0; i < 8; ++i) lemming[i] = compile_sprrle (IMGPOS (main_font_img, 81, 132 + 6 * i), 0, 10, 6, main_font_img.width, xbuf); for (i = 0; i < 10; ++i) { char text[2] = { 0, 0 }; text[0] = '0' + i; deck_digits[i] = compile_deck_text (text, T_FLUSHED_LEFT, 186, 8 + 227); } deck_digits[10] = compile_deck_text (":", T_FLUSHED_LEFT, 186, 8 + 227); } /* pause menu */ pause_menu_txt = compile_menu_text (_("PAUSE"), T_CENTERED|T_WAVING, 5, 159); /* quit y/n menus */ quitgame_menu_txt = compile_menu_text (_("QUIT THIS GAME?"), T_CENTERED|T_WAVING, 75, 159); quitheroes_menu_txt = compile_menu_text (_("REALLY QUIT?"), T_CENTERED|T_WAVING, 75, 159); quit_no_txt = compile_menu_text (_("NO"), T_CENTERED, 110, 159); quit_yes_txt = compile_menu_text (_("YES"), T_CENTERED, 95, 159); /* editor menu */ ed_new_level_txt = compile_menu_text (_("NEW LEVEL"), T_CENTERED|T_WAVING, 7, 159); ed_existing_level_txt = compile_menu_text (_("EXISTING LEVEL"), T_CENTERED|T_WAVING, 7, 159); ed_name_txt = compile_menu_text (_("NAME"), T_FLUSHED_LEFT, 54, 8); /* TRANS: in wrapped levels are unbounded level, e.g. whenever the player reach the left border it continue its way from the right border (except that the player doesn't even know there are borders, because the level is tiled infinitely). In unwrapped levels there are explicit bounds that you cannot cross. X-WRAP is a check box used to specified whether a level must be wrapped horizontally or not when creating a new level. */ ed_x_wrap_txt = compile_menu_text (_("X-WRAP"), T_FLUSHED_LEFT, 85, 8); /* TRANS: Y-WRAP is a check box used to specified whether a level must be wrapped vertically or not. */ ed_y_wrap_txt = compile_menu_text (_("Y-WRAP"), T_FLUSHED_LEFT, 106, 8); /* TRANS: width of the level */ ed_x_size_txt = compile_menu_text (_("X-SIZE"), T_FLUSHED_LEFT, 137, 8); /* TRANS: height of the level */ ed_y_size_txt = compile_menu_text (_("Y-SIZE"), T_FLUSHED_LEFT, 158, 8); ed_edit_txt = compile_menu_text (_("EDIT"), T_FLUSHED_LEFT, 186, 227); /* options menu */ option_menu_data = compile_menu (_("OPTIONS"), options_entries); /* main menu */ main_menu_data = compile_menu (_("HEROES"), main_entries); /* editor selector */ edit_sel_txt = compile_menu_text (_("SELECT A LEVEL"), T_CENTERED|T_WAVING, 10, 159); /* editor first menu */ editor_menu_data = compile_menu (_("EDITOR"), editor_entries); /* play menu */ playmenu_title_txt = compile_menu_text (_("PLAY"), T_CENTERED|T_WAVING, 4, 159); playmenu_players_txt[0] = compile_menu_text (_("ONE PLAYER"), T_CENTERED, 31, 159); playmenu_players_txt[1] = compile_menu_text (_("TWO PLAYERS"), T_CENTERED, 31, 159); playmenu_goback_txt = compile_menu_text (_("GO BACK"), T_CENTERED, 187, 159); playmenu_load_txt = compile_menu_text (_("LOAD..."), T_CENTERED, 160, 159); { int i; for (i = 0; i < 5; ++i) gamemode_txt[i] = compile_menu_text (_(mode_name[i]), T_CENTERED, 0, 159); } /* saved game selection */ save_select_txt = compile_menu_text (_("CHOOSE A SAVE SLOT"), T_CENTERED|T_WAVING, 10, 159); load_select_txt = compile_menu_text (_("CHOOSE A LOAD SLOT"), T_CENTERED|T_WAVING, 10, 159); /* enter your name */ enter_your_name_txt = compile_menu_text (_("ENTER YOUR NAME:"), T_CENTERED, 70, 159); /* end level info */ /* TRANS: SIZE is the size of the player trail, PTS the number of PoinTS */ info_mode_quest_txt = compile_menu_text (_("SIZE PTS LIVES"), T_CENTERED, 50, 180); info_mode_deathm_txt = compile_menu_text (_("PTS LIVES"), T_CENTERED, 50, 221); /* TRANS: this is for KILL'EM ALL mode, and MEN is the number of lemmings killed by one player */ info_mode_killem_txt = compile_menu_text (_(" MEN PTS LIVES"), T_CENTERED, 50, 180); info_mode_tcash_txt = compile_menu_text (_("CA$H PTS LIVES"), T_CENTERED, 50, 180); info_mode_color_txt = compile_menu_text (_("COLORS PTS LIVES"), T_CENTERED, 50, 170); { const char *str; unsigned int w1, w2; str = _("NEXT LEVEL"); w1 = compute_text_width (menu_font, str, 0); info_mode_next_txt = compile_menu_text (str, T_CENTERED, 150, 159); /* TRANS: this is a menu entry that introduce the user to another menu. This is NOT displayed DURING saving. */ str = _("SAVE..."); w2 = compute_text_width (menu_font, str, 0); info_mode_save_txt = compile_menu_text (str, T_CENTERED, 170, 159); info_mode_next_save_arrow_pos = (160 - ((w2 > w1) ? w2 : w1)/2) - 20; } info_mode_return_txt = compile_menu_text (_("PRESS RETURN"), T_CENTERED, 160, 159); { int i; for (i = 0; i < 4; ++i) info_martian[i] = compile_sprshade (IMGPOS (main_font_img, 120, 40 + i * 64), 0, 1, glenz[0], 19, 24, main_font_img.width, xbuf); } info_round_txt = compile_menu_text (_("WINS PTS LIVES"), T_CENTERED, 50, 180); { int i; for (i = 0; i < 4; ++i) vehicles_spr[i] = compile_sprrle (IMGPOS (vehicles_img, 0, (i << 6) + 16), 0, 10, 12, vehicles_img.width, xbuf); } /* higher scores */ higher_scores_txt = compile_menu_text (_("HIGHER SCORES"), T_CENTERED|T_WAVING, 10, 159); img_free (&icons_img); img_free (&jukebox_img); help_text = compile_helptext (); people_text = compile_people (); } void uninit_menus_sprites (void) { free_htimer (lemming_htimer); FREE_SPRITE0 (left_arrow); FREE_SPRITE0 (right_arrow); FREE_SPRITE0 (checked_box[0]); FREE_SPRITE0 (checked_box[1]); FREE_SPRITE0 (cursor_bg); FREE_SPRITE0 (cursor_fg); FREE_SPRITE0 (horizontal_rule); FREE_SPRITE0 (bigarr_cursor); FREE_SPRITE0 (sqr_cursor); FREE_SPRITE0 (small_arrows[0][0]); FREE_SPRITE0 (small_arrows[0][1]); FREE_SPRITE0 (small_arrows[1][0]); FREE_SPRITE0 (small_arrows[1][1]); FREE_SPRITE0 (ctrl_ico[0]); FREE_SPRITE0 (ctrl_ico[1]); FREE_SPRITE0 (autopilot_ico[0]); FREE_SPRITE0 (autopilot_ico[1]); { int i; for (i = 0; i < 7; ++i) { FREE_SPRITE0 (music_ico[i]); FREE_SPRITE0 (sfx_ico[i]); FREE_SPRITE0 (luminance_ico[i]); } } FREE_SPRITE0 (radar_ico[0]); FREE_SPRITE0 (radar_ico[1]); FREE_SPRITE0 (infos_ico[0]); FREE_SPRITE0 (infos_ico[1]); FREE_SPRITE0 (inertia_ico[0]); FREE_SPRITE0 (inertia_ico[1]); { int i; for (i = 0; i < 4; ++i) { FREE_SPRITE0 (player_logo[i]); FREE_SPRITE0 (player_ico[i]); } for (i = 0; i < 5; ++i) FREE_SPRITE0 (speed_ico[i]); } FREE_SPRITE0 (control_menu_txt); FREE_SPRITE0 (sound_menu_txt); FREE_SPRITE0 (music_vol_txt); FREE_SPRITE0 (sfx_vol_txt); FREE_SPRITE0 (screen_menu_txt); FREE_SPRITE0 (game_menu_txt); FREE_SPRITE0 (game_rounds_txt); FREE_SPRITE0 (keyboard_menu_txt); { int i; for (i = 11; i >= 0; --i) FREE_SPRITE0 (keyboard_keys_txt[i]); } FREE_SPRITE0 (extra_menu_txt); { int i; for (i = 2; i >= 0; --i) { FREE_SPRITE0 (extra_combine_txt[i]); FREE_SPRITE0 (extra_modes_txt[i]); } } FREE_SPRITE0 (jukebox_frame); FREE_SPRITE0 (jukebox_forw); FREE_SPRITE0 (jukebox_back); FREE_SPRITE0 (jukebox_quit); { int i; for (i = 0; i < 8; ++i) FREE_SPRITE0 (lemming[i]); for (i = 0; i < 11; ++i) FREE_SPRITE0 (deck_digits[i]); } FREE_SPRITE0 (pause_menu_txt); FREE_SPRITE0 (quitgame_menu_txt); FREE_SPRITE0 (quitheroes_menu_txt); FREE_SPRITE0 (quit_no_txt); FREE_SPRITE0 (quit_yes_txt); FREE_SPRITE0 (ed_new_level_txt); FREE_SPRITE0 (ed_existing_level_txt); FREE_SPRITE0 (ed_name_txt); FREE_SPRITE0 (ed_x_wrap_txt); FREE_SPRITE0 (ed_y_wrap_txt); FREE_SPRITE0 (ed_x_size_txt); FREE_SPRITE0 (ed_y_size_txt); FREE_SPRITE0 (ed_edit_txt); free_menu (option_menu_data); free_menu (main_menu_data); FREE_SPRITE0 (edit_sel_txt); free_menu (editor_menu_data); FREE_SPRITE0 (playmenu_title_txt); FREE_SPRITE0 (playmenu_players_txt[0]); FREE_SPRITE0 (playmenu_players_txt[1]); FREE_SPRITE0 (playmenu_goback_txt); FREE_SPRITE0 (playmenu_load_txt); { int i; for (i = 4; i >= 0; --i) FREE_SPRITE0 (gamemode_txt[i]); } FREE_SPRITE0 (load_select_txt); FREE_SPRITE0 (save_select_txt); { int i; for (i = 0; i < 10; ++i) FREE_SPRITE0 (saverec_name[i]); } FREE_SPRITE0 (enter_your_name_txt); FREE_SPRITE0 (info_mode_quest_txt); FREE_SPRITE0 (info_mode_deathm_txt); FREE_SPRITE0 (info_mode_killem_txt); FREE_SPRITE0 (info_mode_tcash_txt); FREE_SPRITE0 (info_mode_color_txt); FREE_SPRITE0 (info_mode_next_txt); FREE_SPRITE0 (info_mode_save_txt); FREE_SPRITE0 (info_mode_return_txt); { int i; for (i = 0; i < 4; ++i) FREE_SPRITE0 (info_martian[i]); } FREE_SPRITE0 (info_round_txt); { int i; for (i = 0; i < 4; ++i) FREE_SPRITE0 (vehicles_spr[i]); } FREE_SPRITE0 (higher_scores_txt); if (help_text) free_reader_data (help_text); if (people_text) free_reader_data (people_text); } static void arrows (unsigned int row, unsigned int col) { DRAW_SPRITE (left_arrow, corner[0] + row * xbuf + col); DRAW_SPRITE (right_arrow, corner[0] + row * xbuf + 320 - col - 13); } void waving_arrows (unsigned int row, unsigned int col) { col += minisinus[read_htimer (waving_htimer) & 31]; DRAW_SPRITE (left_arrow, corner[0] + row * xbuf + col); DRAW_SPRITE (right_arrow, corner[0] + row * xbuf + 320 - col - 13); } static void chkbox (unsigned int row, unsigned int col, int checked) { DRAW_SPRITE (checked_box[checked], corner[0] + row * xbuf + col); } static void cursor (unsigned int row, unsigned int col, unsigned int value, unsigned int max) { DRAW_SPRITE (cursor_bg, corner[0] + (row + 2) * xbuf + col); DRAW_SPRITE (cursor_fg, corner[0] + row * xbuf + col + 2 + (25*value/max)); } static void hrule (unsigned int row) { DRAW_SPRITE (horizontal_rule, corner [0] + row * xbuf + 100); } static a_keycode move_updown (a_keycode key, int *pos, int latest_pos) { if (key == HK_Up) { if (*pos > 0) --*pos; else *pos = latest_pos; /* wrap */ } else if (key == HK_Down) { if (*pos < latest_pos) ++*pos; else *pos = 0; /* wrap */ } else if (key == HK_Escape) { if (*pos != latest_pos) /* On first escape, */ *pos = latest_pos; /* go to the latest line; */ else /* on doubled espace, */ key = HK_Enter; /* arrange to escape the menu. */ } else { return key; /* Unknown key, return it. */ } /* The key has been handled. Tell it to the user. */ event_sfx (1); return key; } void background_menu (void) { static long int TTT = 0; TTT += read_htimer (background_htimer); lisajou_camera (TTT); compute_corner (0, 1); update_text_waving_step (); draw_level (0); } static void display_menu (a_menu *menu, int l, bool blit) { int line; background_menu (); draw_sprprogwav (menu->title, corner[0]); for (line = 0; line < menu->lines; ++line) draw_sprprogwav_if (l == line, menu->entries[line], corner[0]); for (line = 0; line < menu->lines - 1; ++line) hrule (menu->hrules[line]); waving_arrows (l * 20 + menu->first_row - 5, menu->arrows_col); if (blit) flush_display (corner[0]); } static void exec_menu (a_menu *menu) { int l = 0; a_keycode k; for (;;) { an_entry_func to_call; std_white_fadein (&tile_set_img.palette); do { display_menu (menu, l, true); if (key_or_joy_ready ()) { k = get_key_or_joy (); k = move_updown (k, &l, menu->lines - 1); } else k = 0; } while (k != HK_Enter); to_call = menu->funcs[l]; if (to_call) { event_sfx (2); to_call (); } else { event_sfx (8); break; } } } static void control_menu (void) { int l = 0; a_keycode t; std_white_fadein (&tile_set_img.palette); do { background_menu (); DRAW_SPRITE (ctrl_ico[opt.ctrl_one], corner[0] + 35 * xbuf + 20); DRAW_SPRITE (autopilot_ico[opt.autopilot_one], corner[0] + 68 * xbuf + 20); DRAW_SPRITE (ctrl_ico[opt.ctrl_two], corner[0] + 107 * xbuf + 20); DRAW_SPRITE (autopilot_ico[opt.autopilot_two], corner[0] + 140 * xbuf + 20); arrows (35 + l * 35 - 2 * (l == 1) + 2 * (l == 2 || l == 4), 1); chkbox (69, 260, opt.autopilot_one); chkbox (141, 260, opt.autopilot_two); hrule (95); DRAW_SPRITE (control_menu_txt, corner[0]); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); t = move_updown (t, &l, 4); if (t == HK_Right || t == HK_Left || t == HK_Enter) { if (l == 0) opt.ctrl_one ^= 1; if (l == 1) opt.autopilot_one ^= 1; if (l == 2) opt.ctrl_two ^= 1; if (l == 3) opt.autopilot_two ^= 1; if (l < 4) { if (l & 1) event_sfx (3); else event_sfx (5); } } } else t = 0; } while (t != HK_Enter || l != 4); event_sfx (8); } static const char* search_keyname (a_keycode key) { const struct keynames_s* k = keynames; while (k->name && k->code != key) ++k; return k->name; } static void keyboard_menu (void) { int l = 0, testing = 0; int i; a_keycode t = 0; int unconfigured_keys = -1; /* line for each keyname */ int keyline[12] = { 38, 49, 60, 71, 82, 93, 121, 132, 143, 154, 165, 176 }; /* array used to change the order in which keys are printed. */ int reorder[12] = { 0, 2, 1, 3, 4, 5, 6, 8, 7, 9, 10, 11 }; std_white_fadein (&tile_set_img.palette); do { background_menu (); arrows (11 * l + 33 + 15 * (l >= 6) + 4 * (l == 12), 1); DRAW_SPRITE (keyboard_menu_txt, corner[0]); /* Draw the key name, generate the associated sprite if needed. */ for (i = 0; i < 12; ++i) { int oi = reorder[i]; if (l != i || testing == 0) { if (!keyboard_keys_txt[i]) { /* need to generate a sprite ? */ a_sprite *res; int key = opt.player_keys[oi > 5][oi > 5 ? oi - 6 : oi]; const char *keyname = search_keyname (key); if (!keyname) { /* unknown key? print its code number */ char name[64]; sprintf (name, "(%d)", key); res = compile_menu_text (name, T_FLUSHED_RIGHT, keyline[i], 295); } else { /* make sure the key name is not too wide */ char name[10]; strncpy (name, keyname, 9); name[9] = 0; if (strlen (name) > 7) { /* keep only the 6 first chars as `...' is roughtly the width of one char */ name[6] = '.'; name[7] = '.'; name[8] = '.'; } res = compile_menu_text (name, T_FLUSHED_RIGHT, keyline[i], 295); } keyboard_keys_txt[i] = res; } DRAW_SPRITE (keyboard_keys_txt[i], corner[0]); } } flush_display (corner[0]); if (testing == 0) { if (key_or_joy_ready ()) { t = get_key_or_joy (); t = move_updown (t, &l, 12); if (t == HK_Enter && l != 12) { testing = 1; event_sfx (6); } } else t = 0; } else if (testing == 1) { if (!key_or_joy_ready ()) { testing = 2; } } else if (testing == 2) { if (key_ready ()) { int ll = reorder[l]; t = get_key (); for (i = 0; i != 6; i++) { if (ll != i && opt.player_keys[0][i] == t) { opt.player_keys[0][i] = HK_NIL; /* force the regeneration of key name on next display */ FREE_SPRITE0 (keyboard_keys_txt[reorder[i]]); keyboard_keys_txt[reorder[i]] = 0; } if (ll != i + 6 && opt.player_keys[1][i] == t) { opt.player_keys[1][i] = HK_NIL; /* force the regeneration of key name on next display */ FREE_SPRITE0 (keyboard_keys_txt[reorder[i + 6]]); keyboard_keys_txt[reorder[i + 6]] = 0; } } if (ll < 6) opt.player_keys[0][ll] = t; else opt.player_keys[1][ll - 6] = t; /* force the regeneration of key name on next display */ FREE_SPRITE0 (keyboard_keys_txt[l]); keyboard_keys_txt[l] = 0; l++; testing = 0; event_sfx (7); } } unconfigured_keys = -1; for (i = 0; i < 12; ++i) if (i < 6) { if (opt.player_keys[0][i] == HK_NIL) { unconfigured_keys = i; break; } } else { if (opt.player_keys[1][i - 6] == HK_NIL) { unconfigured_keys = i; break; } } if (unconfigured_keys >= 0 && t == HK_Enter && l == 12) { l = unconfigured_keys; if (l == 1) l = 2; else if (l == 2) l = 1; else if (l == 7) l = 8; else if (l == 8) l = 7; } } while (t != HK_Enter || l != 12); event_sfx (8); } static void sound_menu (void) { int l = 0; a_keycode t; std_white_fadein (&tile_set_img.palette); do { background_menu (); DRAW_SPRITE (music_ico[0], corner[0] + 35 * xbuf + 20); DRAW_SPRITE (sfx_ico[0], corner[0] + 105 * xbuf + 20); arrows (35 + l * 35, 1); chkbox (36, 260, opt.music); chkbox (106, 260, opt.sfx); if (opt.music) { DRAW_SPRITE (music_ico[opt.music_volume / 2], corner[0] + 70 * xbuf + 20); cursor (72, 251, 13 - opt.music_volume, 13); DRAW_SPRITE (music_vol_txt, corner[0]); } if (opt.sfx) { DRAW_SPRITE (sfx_ico[opt.sfx_volume / 2], corner[0] + 140 * xbuf + 20); cursor (142, 251, 13 - opt.sfx_volume, 13); DRAW_SPRITE (sfx_vol_txt, corner[0]); } DRAW_SPRITE (sound_menu_txt, corner[0]); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); t = move_updown (t, &l, 4); /* If music or sfx are disabled, we can't be on position 1 or 3. Therefore we call move_updown again to make a second step in the same direction. */ if ((!opt.music && l == 1) || (!opt.sfx && l == 3)) t = move_updown (t, &l, 4); if (t == HK_Right || t == HK_Left || t == HK_Enter) { if (l != 4) { if (l & 1) event_sfx (4); else event_sfx (3); } } if (t == HK_Right) { if (l == 0) opt.music ^= 1; if (l == 1 && opt.music_volume > 0) opt.music_volume--; if (l == 2) opt.sfx ^= 1; if (l == 3 && opt.sfx_volume > 0) opt.sfx_volume--; } if (t == HK_Left) { if (l == 0) opt.music ^= 1; if (l == 1 && opt.music_volume < 12) opt.music_volume++; if (l == 2) opt.sfx ^= 1; if (l == 3 && opt.sfx_volume < 12) opt.sfx_volume++; } if (t == HK_Enter) { if (l == 0) opt.music ^= 1; if (l == 1) { if (opt.music_volume < 12) opt.music_volume++; else opt.music_volume = 0; } if (l == 2) opt.sfx ^= 1; if (l == 3) { if (opt.sfx_volume < 12) opt.sfx_volume++; else opt.sfx_volume = 0; } } adjust_volume (); } else t = 0; } while (t != HK_Enter || l != 4); event_sfx (8); } static void screen_menu (void) { int l = 0; a_keycode t; std_white_fadein (&tile_set_img.palette); do { background_menu (); DRAW_SPRITE (radar_ico[opt.radar_map], corner[0] + 37 * xbuf + 20); DRAW_SPRITE (infos_ico[opt.display_infos], corner[0] + 71 * xbuf + 20); DRAW_SPRITE (luminance_ico[opt.luminance/2], corner[0] + 105 * xbuf + 20); DRAW_SPRITE (inertia_ico[opt.inertia], corner[0] + 139 * xbuf + 20); arrows (37 + l * 34 + 2 * (l == 4), 1); chkbox (38, 260, opt.radar_map); chkbox (72, 260, opt.display_infos); cursor (108, 251, 12 - opt.luminance, 12); chkbox (140, 260, opt.inertia); DRAW_SPRITE (screen_menu_txt, corner[0]); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); t = move_updown (t, &l, 4); if (t == HK_Right || t == HK_Left || t == HK_Enter) if (l < 5) { if (l == 0) opt.radar_map ^= 1; else if (l == 1) opt.display_infos ^= 1; else if (l == 2) { if (t == HK_Right && opt.luminance > 0) --opt.luminance; else if (t == HK_Left && opt.luminance < 12) ++opt.luminance; set_pal_with_luminance (&tile_set_img.palette); } else if (l == 3) opt.inertia ^= 1; if (l == 4) event_sfx (4); else event_sfx (3); } } else t = 0; } while (t != HK_Enter || l != 4); event_sfx (8); } static void game_menu (void) { int l = 0, tmp; a_keycode t; std_white_fadein (&tile_set_img.palette); do { background_menu (); DRAW_SPRITE (player_ico[opt.player_color[0]], corner[0] + 29 * xbuf + 20); DRAW_SPRITE (player_ico[opt.player_color[1]], corner[0] + 53 * xbuf + 20); DRAW_SPRITE (player_ico[opt.player_color[2]], corner[0] + 77 * xbuf + 20); DRAW_SPRITE (player_ico[opt.player_color[3]], corner[0] + 101 * xbuf + 20); DRAW_SPRITE (speed_ico[opt.speed * 2], corner[0] + 125 * xbuf + 20); cursor (128, 251, opt.speed, 2); cursor (154, 251, opt.gamerounds, 15); arrows (29 + l * 24 + 24 * (l > 2), 1); DRAW_SPRITE (game_menu_txt, corner[0]); if (!game_rounds_txt) { char rounds_txt[32]; sprintf (rounds_txt, ngettext ("%d ROUND", "%d ROUNDS", rounds_nbr_values[opt.gamerounds]), rounds_nbr_values[opt.gamerounds]); game_rounds_txt = compile_menu_text (rounds_txt, T_FLUSHED_LEFT, 153, 56); } DRAW_SPRITE (game_rounds_txt, corner[0]); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); t = move_updown (t, &l, 5); if (t == HK_Right || t == HK_Left || t == HK_Enter) if (l != 6) { if ((l == 3) || (l == 4)) event_sfx (4); else event_sfx (5); } if (t == HK_Right || t == HK_Enter) { if (l == 3) { if (opt.speed < 2) opt.speed++; } if (l == 4) { if (opt.gamerounds < 15) { opt.gamerounds++; /* Force regeneration of game_rounds_txt before next draw */ FREE_SPRITE0 (game_rounds_txt); game_rounds_txt = 0; } } if (l == 0) { tmp = opt.player_color[0]; opt.player_color[0] = opt.player_color[1]; opt.player_color[1] = opt.player_color[2]; opt.player_color[2] = opt.player_color[3]; opt.player_color[3] = tmp; } if (l == 1) { tmp = opt.player_color[1]; opt.player_color[1] = opt.player_color[2]; opt.player_color[2] = opt.player_color[3]; opt.player_color[3] = tmp; } if (l == 2) { tmp = opt.player_color[2]; opt.player_color[2] = opt.player_color[3]; opt.player_color[3] = tmp; } } if (t == HK_Left) { if (l == 3) if (opt.speed > 0) opt.speed--; if (l == 4) if (opt.gamerounds > 0) { opt.gamerounds--; /* Force regeneration of game_rounds_txt before next draw */ FREE_SPRITE0 (game_rounds_txt); game_rounds_txt = 0; } if (l == 0) { tmp = opt.player_color[3]; opt.player_color[3] = opt.player_color[2]; opt.player_color[2] = opt.player_color[1]; opt.player_color[1] = opt.player_color[0]; opt.player_color[0] = tmp; } if (l == 1) { tmp = opt.player_color[3]; opt.player_color[3] = opt.player_color[2]; opt.player_color[2] = opt.player_color[1]; opt.player_color[1] = tmp; } if (l == 2) { tmp = opt.player_color[3]; opt.player_color[3] = opt.player_color[2]; opt.player_color[2] = tmp; } } } else t = 0; } while (t != HK_Enter || l != 5); event_sfx (8); } char extrasel = 0; static void extra_menu (void) { int l = 0; a_keycode t; int i, ll = 0; /* We store only the sprites for the displayed level names, as the list can be big (hmmm... really?) */ a_sprite *levelnames[7] = { 0, 0, 0, 0, 0, 0, 0 }; if (extra_nbr <= 0) return; std_white_fadein (&tile_set_img.palette); do { background_menu (); DRAW_SPRITE (extra_menu_txt, corner[0]); DRAW_SPRITE (extra_modes_txt[opt.extras], corner[0]); if (opt.extras == 0) DRAW_SPRITE (extra_combine_txt[0], corner[0]); else DRAW_SPRITE (extra_combine_txt[(extrasel == 0)?1:2], corner[0]); if (extrasel && opt.extras != 0) { hrule (72); hrule (169); for (i = -3; i <= 3; i++) if ((i + ll) >= 0 && (unsigned int)(i + ll) < extra_nbr) { if (!levelnames[3 + i]) { char lname[FILENAME_SIZE + 1]; strcpy (lname, extra_list[i + ll].level_name); levelnames[3 + i] = compile_menu_text (lname, T_FLUSHED_RIGHT, 118, 200); } draw_sprprogwav_if (i==0, levelnames[3 + i], corner[0] + i * 13 * xbuf); chkbox (115 + i * 13, 210, extra_selected_list[i + ll]); } } arrows (30 + l * 22 + 40 * (l == 2) + 78 * (l == 3), 1); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); if (t == HK_Up || t == HK_Down || t == HK_Escape) event_sfx (1); if (l == 2) { if (t == HK_Home || t == HK_End || t == HK_PageUp || t == HK_PageDown) event_sfx (1); if (t == HK_Up) { if (ll > 0) { ll--; /* Rotate the levelnames. */ FREE_SPRITE0 (levelnames[6]); memmove (levelnames + 1, levelnames, 6 * sizeof (*levelnames)); levelnames[0] = 0; } else l = 1; } if (t == HK_Down) { if ((unsigned int) (ll + 1) < extra_nbr) { ll++; /* Rotate the levelnames. */ FREE_SPRITE0 (levelnames[0]); memmove (levelnames, levelnames + 1, 6 * sizeof (*levelnames)); levelnames[6] = 0; } else l = 3; } if (t == HK_Home || t == HK_End || t == HK_PageUp || t == HK_PageDown) { int j; /* Free all levelnames. */ for (j = 6; j >= 0; --j) { FREE_SPRITE0 (levelnames[j]); levelnames[j] = 0; } if (t == HK_Home) ll = 0; else if (t == HK_End) ll = extra_nbr - 1; else if (t == HK_PageUp) ll = (ll > 7) ? (ll - 7) : 0; else /* t == HK_PageDown */ ll = (ll + 7 < (int) extra_nbr) ? ll + 7 : ((int) extra_nbr - 1); } } else { if (t == HK_Up) { if (l > 0) l--; else l = 3; if (l == 2 && (extrasel == 0 || opt.extras == 0)) l = 1; } if (t == HK_Down) { if (l < 3) l++; else l = 0; if (l == 2 && (extrasel == 0 || opt.extras == 0)) l = 3; } } if (t == HK_Escape) { if (l != 3) l = 3; else t = HK_Enter; } if (t == HK_Right || t == HK_Left || t == HK_Enter) if (l != 3) { if (l < 2) event_sfx (5); else event_sfx (3); if (l == 0) { if (t == HK_Enter || t == HK_Right) { opt.extras = ((opt.extras == 2) ? 0 : (opt.extras + 1)); } else if (t == HK_Left) { opt.extras = ((opt.extras == 0) ? 2 : (opt.extras - 1)); } } if ((l == 1) && (opt.extras != 0)) extrasel ^= 1; if (l == 2) extra_selected_list[ll] ^= 1; } } else t = 0; } while (t != HK_Enter || l != 3); event_sfx (8); /* Free all levelnames. */ for (i = 6; i >= 0; --i) FREE_SPRITE0 (levelnames[i]); } void option_menu (void) { exec_menu (option_menu_data); } void draw_quit_menu (int l) { DRAW_SPRITE (quitheroes_menu_txt, corner[0]); draw_sprprogwav_if (l == 0, quit_yes_txt, corner[0]); draw_sprprogwav_if (l == 1, quit_no_txt, corner[0]); waving_arrows (91 + l * 15, 90); } char quit_menu (void) { int l = 0; a_keycode t; std_white_fadein (&tile_set_img.palette); do { background_menu (); draw_quit_menu (l); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); t = move_updown (t, &l, 1); } else t = 0; } while (t != HK_Enter); if (l == 1) { event_sfx (77); return (0); } else { event_sfx (78); return (1); } } void draw_play_menu (int l) { background_menu (); DRAW_SPRITE (playmenu_title_txt, corner[0]); hrule (21); draw_sprprogwav_if (l == 0, playmenu_players_txt[two_players], corner[0]); hrule (48); { int i; for (i = 0; i < 5; ++i) draw_sprprogwav_if (l == i + 1, gamemode_txt[i], corner[0] + (65 + 16 * i - 5 * (i == 0)) * xbuf); } hrule (150); draw_sprprogwav_if (l == 6, playmenu_load_txt, corner[0]); hrule (177); draw_sprprogwav_if (l == 7, playmenu_goback_txt, corner[0]); waving_arrows (41 + l * 16 + 5 * (l > 1) - 15 * (l == 0) + 13 * (l == 6) + 23 * (l == 7), 5); } void draw_main_menu (int l) { display_menu (main_menu_data, l, false); } char tile_sets_names[10][3] = { "01", "02", "03", "04", "05", "06", "07", "08", "09", "10" }; static void load_tile_set_preview (int num, a_pcx_image * ici) { char *t = get_non_null_rsc_file ("editor-preview-prefix"); t = strappend (t, tile_sets_names[num]); t = strappend (t, ".pcx"); pcx_load (t, ici); free (t); } static void editor_selector (void) { int l = 0; int i = 0; a_keycode t; a_sprite *filenames[11] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; if (extra_user_nbr == 1) { event_sfx (116); hmain (extra_list[0].level_name, 0, 0, 0, 0, 0); return; } std_white_fadein (&tile_set_img.palette); do { background_menu (); DRAW_SPRITE (edit_sel_txt, corner[0]); hrule (30); hrule (187); /* draw filenames (generate correspounding sprites if needed) */ for (i = -5; i <= 5; i++) if ((i + l) >= 0 && (unsigned int) (i + l) < extra_user_nbr) { if (!filenames [i + 5]) filenames [i + 5] = compile_menu_text (extra_list[i + l].level_name, T_CENTERED, 105, 159); draw_sprprogwav_if (i == 0, filenames [i + 5], corner[0] + i * 13 * xbuf); } waving_arrows (101, 60); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); if (t == HK_Up || t == HK_Down || t == HK_Escape || t == HK_Home || t == HK_End || t == HK_PageUp || t == HK_PageDown) { int j; event_sfx (1); /* free all filenames */ for (j = 0; j < 11; ++j) FREE_SPRITE0 (filenames[j]); } if (t == HK_Up) { if (l > 0) l--; else l = extra_user_nbr - 1; } else if (t == HK_Down) { if ((unsigned int) (l + 1) < extra_user_nbr) l++; else l = 0; } else if (t == HK_Home) { l = 0; } else if (t == HK_End) { l = extra_user_nbr - 1; } else if (t == HK_PageUp) { l = (l > 10) ? (l - 10) : 0; } else if (t == HK_PageDown) l = ((l + 11 < (int) extra_user_nbr) ? l + 10 : ((int)extra_user_nbr - 1)); } else t = 0; } while (t != HK_Enter && t != HK_Escape); if (t == HK_Enter) { event_sfx (116); hmain (extra_list[l].level_name, 0, 0, 0, 0, 0); } else event_sfx (8); } static void editor_menu (void) { a_pcx_image frmenu, tilesprev; int l = 0, pos = 0, i; a_keycode t = 0; int xwrap = 15; int ywrap = 15; int xsize = 16; int ysize = 16; char flag = 0, flaglock = 0; int l2; int tiles = 0; int j; FILE *tmphdl; a_level_header plinfo; char lname[FILENAME_SIZE + 1]; char ssize[32]; char titres[10][16] = { "CORRIDOR 1", "CAEROS", "THE DARK AGES", "CORRIDOR 2", "VOLCANO", "ELECTRIC DREAM", "METAL MASTER", "MOON 51", "CORRIDOR 3", "SWEET DREAM" }; a_sprite *tileset_name_txt = 0; a_sprite *level_name_txt = 0; a_sprite *x_size_txt = 0; a_sprite *y_size_txt = 0; memset (lname,0,FILENAME_SIZE + 1); pcx_load_from_rsc ("new-level-menu-img", (a_pcx_image *) & frmenu); load_tile_set_preview (0, (a_pcx_image *) & tilesprev); corner[0] = render_buffer[0]; for (i = 0; i < 52; i++) memcpy (frmenu.buffer + 217 + 74 * 320 + i * 320, tilesprev.buffer + i * 62, 62); std_white_fadein (&tilesprev.palette); do { /* generate mutable texts if needed */ if (!tileset_name_txt) tileset_name_txt = compile_menu_text (titres[tiles], T_CENTERED, 33, 138); if (!level_name_txt) level_name_txt = compile_menu_text (lname, T_CENTERED, 54, 185); if (!x_size_txt) { sprintf (ssize, "%d", xsize); x_size_txt = compile_menu_text (ssize, T_CENTERED, 137, 248); } if (!y_size_txt) { sprintf (ssize, "%d", ysize); y_size_txt = compile_menu_text (ssize, T_CENTERED, 158, 248); } /* draw everything */ update_text_waving_step (); j = minisinus[read_htimer (waving_htimer) & 31]; copy_image_to_scr_area (&frmenu, corner[0]); chkbox (82, 170, (xwrap != -1)); chkbox (103, 170, (ywrap != -1)); cursor (135, 153, xsize - 15, 64 - 15); cursor (156, 153, ysize - 11, 64 - 11); if (l == 0) DRAW_SPRITE (bigarr_cursor, corner[0] + 271 + 32 * xbuf); else if (l == 1) DRAW_SPRITE (sqr_cursor, corner[0] + 275 + 56 * xbuf); else if (l == 2) DRAW_SPRITE (sqr_cursor, corner[0] + 194 + 87 * xbuf); else if (l == 3) DRAW_SPRITE (sqr_cursor, corner[0] + 194 + 108 * xbuf); else if (l == 4) DRAW_SPRITE (sqr_cursor, corner[0] + 194 + 139 * xbuf); else if (l == 5) DRAW_SPRITE (sqr_cursor, corner[0] + 194 + 160 * xbuf); if (l == 6) { DRAW_SPRITE (small_arrows[1][0], corner[0] + 214 + 186 * xbuf + j); DRAW_SPRITE (small_arrows[1][1], corner[0] + 299 + 186 * xbuf - j); } else { DRAW_SPRITE (small_arrows[0][0], corner[0] + 214 + 186 * xbuf); DRAW_SPRITE (small_arrows[0][1], corner[0] + 299 + 186 * xbuf); } if (flaglock) DRAW_SPRITE (ed_existing_level_txt, corner[0]); else DRAW_SPRITE (ed_new_level_txt, corner[0]); DRAW_SPRITE (tileset_name_txt, corner[0]); draw_sprprogwav_if (l == 1, ed_name_txt, corner[0]); DRAW_SPRITE (level_name_txt, corner[0]); draw_sprprogwav_if (l == 2, ed_x_wrap_txt, corner[0]); DRAW_SPRITE (x_size_txt, corner[0]); draw_sprprogwav_if (l == 3, ed_y_wrap_txt, corner[0]); DRAW_SPRITE (y_size_txt, corner[0]); draw_sprprogwav_if (l == 4, ed_x_size_txt, corner[0]); draw_sprprogwav_if (l == 5, ed_y_size_txt, corner[0]); draw_sprprogwav_if (l == 6, ed_edit_txt, corner[0]); flush_display (corner[0]); /* handle key events */ if (key_or_joy_ready ()) { t = get_key_or_joy (); if (t == HK_Up) { if (flaglock == 0) if (l > 0) l--; else l = 6; else if (l == 1) l = 6; else l = 1; event_sfx (110); } else if (t == HK_Down) { if (flaglock == 0) if (l < 6) l++; else l = 0; else if (l == 6) l = 1; else l = 6; event_sfx (110); } else if (l == 0 && (t == HK_Right || t == HK_Left)) { FREE_SPRITE0 (tileset_name_txt); if (t == HK_Right) { if (tiles < 9) tiles++; else tiles = 0; } else { if (tiles > 0) tiles--; else tiles = 9; } img_free ((a_pcx_image *) & tilesprev); load_tile_set_preview (tiles, (a_pcx_image *) & tilesprev); for (i = 0; i < 52; i++) memcpy (frmenu.buffer + 217 + 74 * 320 + i * 320, tilesprev.buffer + i * 62, 62); set_pal_with_luminance (&tilesprev.palette); event_sfx (111); } else if (l == 1) { l2 = keycode_to_ascii (t); if (l2 >= 'a' && l2 <= 'z') l2 -= 'a' - 'A'; if ((l2 >= '0' && l2 <= '9') || (l2 >= '@' && l2 <= 'Z') || (l2 >= '#' && l2 <= '&') || l2 == '!' || l2 == '_') { if (pos < 8) { lname[pos] = l2; pos++; lname[pos] = 0; event_sfx (112); flag = 1; FREE_SPRITE0 (level_name_txt); } } if ((t == HK_BackSpace || t == HK_Delete) && (pos > 0)) { pos--; lname[pos] = 0; event_sfx (113); flag = 1; FREE_SPRITE0 (level_name_txt); } if (flag) { char *filename; XMALLOC_ARRAY (filename, (strlen (levels_output_dir) + 1 + strlen (lname) + 5)); sprintf (filename, "%s/%s.lvl", levels_output_dir, lname); /* Lowercasify the level name, because it's displayed uppercase but stored lowercase. */ strlwr (filename + strlen (levels_output_dir) + 1); dmsg (D_FILE, "trying to open %s for preview ...", filename); tmphdl = fopen (filename, "rb"); if (tmphdl != NULL) { if (fread ((void *) &plinfo, sizeof (a_level_header), 1, tmphdl) == 1) { xsize = BSWAP32 (plinfo.xt); ysize = BSWAP32 (plinfo.yt); xwrap = BSWAP32 (plinfo.xwrap); ywrap = BSWAP32 (plinfo.ywrap); tiles = atol ((char *) &(plinfo.tile_set_name[5])) - 1; img_free ((a_pcx_image *) & tilesprev); load_tile_set_preview (tiles, (a_pcx_image *) & tilesprev); for (i = 0; i < 52; i++) memcpy (frmenu.buffer + 217 + 74 * 320 + i * 320, tilesprev.buffer + i * 62, 62); set_pal_with_luminance (&tilesprev.palette); dmsg (D_FILE, "... reading successful"); flaglock = 1; event_sfx (117); } else { dmsg (D_FILE, "... reading failed"); flaglock = 0; } fclose (tmphdl); free (filename); } else { dmsg (D_FILE, "... opening failed"); flaglock = 0; } flag = 0; } } else if (l == 2 && (t == HK_Right || t == HK_Left || t == HK_Enter)) { event_sfx (114); if (xwrap != -1) xwrap = -1; else { if (xsize < 24) { xsize = 16; xwrap = 15; } else if (xsize < 48) { xsize = 32; xwrap = 31; } else { xsize = 64; xwrap = 63; } FREE_SPRITE0 (x_size_txt); } } else if (l == 3 && (t == HK_Right || t == HK_Left || t == HK_Enter)) { event_sfx (114); if (ywrap != -1) ywrap = -1; else { if (ysize < 24) { ysize = 16; ywrap = 15; } else if (ysize < 48) { ysize = 32; ywrap = 31; } else { ysize = 64; ywrap = 63; } FREE_SPRITE0 (y_size_txt); } } else if (l == 4 && (t == HK_Right || t == HK_Left || t == HK_Enter)) { event_sfx (115); if (t == HK_Left) { if (xsize > 15) xsize--; else xsize = 64; xwrap = -1; } if (t == HK_Right || t == HK_Enter) { if (xsize < 64) xsize++; else xsize = 15; xwrap = -1; } FREE_SPRITE0 (x_size_txt); } else if (l == 5 && (t == HK_Right || t == HK_Left || t == HK_Enter)) { event_sfx (115); if (t == HK_Left) { if (ysize > 11) ysize--; else ysize = 64; ywrap = -1; } if (t == HK_Right || t == HK_Enter) { if (ysize < 64) ysize++; else ysize = 11; ywrap = -1; } FREE_SPRITE0 (y_size_txt); } } else t = 0; if (l == 6 && t == HK_Enter && lname[0] == 0) l = 1; } while (t != HK_Escape && !(l == 6 && t == HK_Enter)); img_free (&frmenu); img_free (&tilesprev); FREE_SPRITE0 (level_name_txt); FREE_SPRITE0 (tileset_name_txt); FREE_SPRITE0 (x_size_txt); FREE_SPRITE0 (y_size_txt); if (l == 6 && t == HK_Enter) { event_sfx (116); hmain (lname, tile_sets_names[tiles], xsize, ysize, xwrap, ywrap); /* update extra-levels list */ free_extra_list (); browse_extra_directories (); } reset_htimer (background_htimer); std_white_fadein (&tile_set_img.palette); } void editor_first_menu (void) { if (extra_user_nbr == 0) editor_menu (); else exec_menu (editor_menu_data); } void draw_saved_games_info (int decal, int l, bool save) { int i; char c; if (save) DRAW_SPRITE (save_select_txt, corner[0] + decal); else DRAW_SPRITE (load_select_txt, corner[0] + decal); for (i = 0; i < 10; i++) { if (saverec[i].used != 0) { if ((in_menu == 0) && equal_gameid (saverec[i].gid, game_id)) c = 5; else c = 3; } else c = 0; draw_glenz_box (corner[0] + decal + (40 + i * 14) * xbuf + 2 * xbuf, c, 320, 6); } for (i = 0; i < 10; i++) { if (!saverec_name[i]) saverec_name[i] = compile_menu_text (saverec[i].name, T_CENTERED, 40 + i * 14, 159); DRAW_SPRITE (saverec_name[i], corner[0] + decal); } DRAW_SPRITE (left_arrow, corner[0] + decal + (35 + l * 14) * xbuf + 1); DRAW_SPRITE (right_arrow, corner[0] + decal + (35 + l * 14) * xbuf + 320 - 1 - 13); } static void jukebox_draw (int pos) { int t, t2, dp; dp = read_htimer (sound_track_htimer); t = dp/2; dp &= 1; if (t > 5999) t = 5999; DRAW_SPRITE (jukebox_frame, corner[0] + 180 * xbuf + 8); if (pos == 0) DRAW_SPRITE (jukebox_forw, corner[0] + 184 * xbuf + 8 + 5); else if (pos == 1) DRAW_SPRITE (jukebox_back, corner[0] + 184 * xbuf + 8 + 27); else if (pos == 2) DRAW_SPRITE (jukebox_quit, corner[0] + 184 * xbuf + 8 + 274); if (soundtrack_title) { if (!soundtrack_title_sprite) soundtrack_title_sprite = compile_deck_text (soundtrack_title, T_CENTERED, 186, 110); DRAW_SPRITE (soundtrack_title_sprite, corner[0]); } if (soundtrack_author) { if (!soundtrack_author_sprite) soundtrack_author_sprite = compile_deck_text (soundtrack_author, T_CENTERED, 186, 197); DRAW_SPRITE (soundtrack_author_sprite, corner[0]); } t2 = t % 60; t /= 60; DRAW_SPRITE (deck_digits[t2 % 10], corner[0] + 20); DRAW_SPRITE (deck_digits[t2 / 10], corner[0] + 14); if (dp == 0) DRAW_SPRITE (deck_digits[10], corner[0] + 12); DRAW_SPRITE (deck_digits[t % 10], corner[0] + 6); DRAW_SPRITE (deck_digits[t / 10], corner[0]); { int lempos = read_htimer (lemming_htimer); DRAW_SPRITE (lemming[lempos & 7], corner[0] + 190 * xbuf + (lempos / 2) - 6); if ((lempos / 2) >= 332) reset_htimer (lemming_htimer); } flush_display (corner[0]); } static bool handle_reader_keys (a_keycode t, int *top, a_read_data *text) { if (t == HK_Down) { *top += 10; } else if (t == HK_Up) { *top -= 10; } else if (t == HK_PageDown) { *top += 200; } else if (t == HK_PageUp) { *top -= 200; } else if (t == HK_End) { *top = text->max; } else if (t == HK_Home) { *top = 0; } else { return false; } return true; } static int jukebox_keys (int *pos, int *top) { a_keycode k; if (!key_or_joy_ready ()) return 1; k = get_key_or_joy (); if (!top || !handle_reader_keys (k, top, people_text)) { if (k == HK_Up || k == HK_Down || k == HK_Left || k == HK_Right) event_sfx (79); if (k == HK_Up || k == HK_Left) { if (*pos > 0) --*pos; else *pos = 2; } else if (k == HK_Down || k == HK_Right) { if (*pos < 2) ++*pos; else *pos = 0; } else if (k == HK_Enter) { if (*pos == 2) k = HK_Escape; else { unload_soundtrack (); if (*pos == 0) { event_sfx (74); load_next_soundtrack (); } if (*pos == 1) { event_sfx (75); load_prev_soundtrack (); } play_soundtrack (); reset_htimer (sound_track_htimer); } } } return (k != HK_Escape); } void jukebox_menu (void) { int top = 0; #define MULT_SHIFT 10 int curmult = 0; int l = 0; in_jokebox = 1; std_white_fadein (&tile_set_img.palette); do { if (top + 178 > people_text->max / xbuf) top = people_text->max / xbuf - 178; if (top < 0) top = 0; background_menu (); curmult += ((top << MULT_SHIFT) - curmult) / 8; draw_reader_data (people_text, corner[0] - 10 * xbuf, curmult >> MULT_SHIFT, (curmult >> MULT_SHIFT) + 220); jukebox_draw (l); } while (jukebox_keys (&l, &top)); event_sfx (76); in_jokebox = 0; } void pause_menu (void) { int l = 0; a_timer pause_htimer; dmsg (D_SECTION, "pause menu"); pause_htimer = new_htimer (T_GLOBAL, 1); halve_volume (); event_sfx (58); corner[0] = render_buffer[0]; uninit_keyboard_map (); std_white_fadein (&dummy_background_img.palette); do { dummy_moving_background_render (); update_text_waving_step (); DRAW_SPRITE (pause_menu_txt, corner[0]); jukebox_draw (l); } while (jukebox_keys (&l, 0)); init_keyboard_map (); adjust_volume (); enable_blit = 0; event_sfx (59); /* delay important timers that continued running during the pause */ shift_htimer (update_htimer, pause_htimer); shift_htimer (event_htimer, pause_htimer); free_htimer (pause_htimer); dmsg (D_SECTION, "exit pause menu"); force_palette (tile_set_img.palette.global); } char quit_yes_no (void) { int l = 0; a_keycode t; a_timer pause_htimer; dmsg (D_SECTION, "quit y/n menu"); pause_htimer = new_htimer (T_GLOBAL, 1); corner[0] = render_buffer[0]; if (opt.ctrl_one || opt.ctrl_two) do { get_joystick_state (); flush_display (corner[0]); } while (joystick_b[0] || joystick_b[1]); uninit_keyboard_map (); halve_volume (); event_sfx (85); std_white_fadein (&dummy_background_img.palette); do { dummy_moving_background_render (); update_text_waving_step (); DRAW_SPRITE (quitgame_menu_txt, corner[0]); draw_sprprogwav_if (l == 0, quit_yes_txt, corner[0]); draw_sprprogwav_if (l == 1, quit_no_txt, corner[0]); waving_arrows (91 + 15 * l, 90); flush_display (corner[0]); t = 0; if (key_or_joy_ready ()) { t = get_key_or_joy (); t = move_updown (t, &l, 1); } else t = 0; } while (t != HK_Enter); adjust_volume (); enable_blit = 0; if (l == 0) event_sfx (88); else event_sfx (87); init_keyboard_map (); /* delay important timers that continued running during the pause */ shift_htimer (update_htimer, pause_htimer); shift_htimer (event_htimer, pause_htimer); reset_htimer (background_htimer); free_htimer (pause_htimer); dmsg (D_SECTION, "exit quit menu"); force_palette (tile_set_img.palette.global); return l; } void enter_your_name (char c, char* name) { a_keycode t = 0; int pos = 0; char head[256]; a_timer pixelize_timer = new_htimer (T_GLOBAL, HZ (7)); a_sprite *player_number; a_sprite *player_name = 0; a_pixel *pixbuf; XMALLOC_ARRAY (pixbuf, 200 * xbuf); sprintf (head, _("PLAYER %d, YOU CAME IN THE TOP 10"), c); player_number = compile_menu_para (head, T_CENTERED, 20, 159, 310); memset (name, 0, PLAYER_NAME_SIZE + 1); std_white_fadein (&tile_set_img.palette); event_sfx (73); do { background_menu (); DRAW_SPRITE (player_number, corner[0]); DRAW_SPRITE (enter_your_name_txt, corner[0]); if (!player_name) player_name = compile_menu_text (name, T_CENTERED, 120, 159); DRAW_SPRITE (player_name, corner[0]); hrule (112); hrule (135); { long p = read_htimer (pixelize_timer); if (p <= 6) { pixelize[6 - p] (pixbuf, corner[0]); flush_display (pixbuf); } else { flush_display (corner[0]); } } if (key_ready ()) { t = get_key (); if (pos < PLAYER_NAME_SIZE) { int a = TOUPPER (keycode_to_ascii (t)); if ((a > ' ' && a <= '_') || (a == ' ' && pos > 0)) { name[pos++] = a; name[pos] = 0; event_sfx (70); FREE_SPRITE0 (player_name); /* force recompilation */ } } if ((t == HK_BackSpace || t == HK_Delete) && (pos > 0)) { pos--; name[pos] = 0; event_sfx (71); FREE_SPRITE0 (player_name); /* force recompilation */ } } } while (t != HK_Escape && t != HK_Enter); event_sfx (72); if (pos == 0 || t == HK_Escape) memset (name, 0, PLAYER_NAME_SIZE); free (pixbuf); free_htimer (pixelize_timer); FREE_SPRITE0 (player_number); FREE_SPRITE0 (player_name); } void draw_end_level_info (int decal, char l) { int i; char winner[128]; char nbr[32]; a_sprite *winner_txt = 0; a_sprite *lines[4][3] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }; if (!winner_txt) { if (level_is_finished != 15) { sprintf (winner, _("PLAYER %d WON!"), plr2col[level_is_finished - 1] + 1); draw_glenz_box (corner[0] + decal + 22 * xbuf, level_is_finished + 1, 320, 6); } else { if (two_players) sprintf (winner, _("EVERYONE LOST!")); else sprintf (winner, _("YOU LOST!")); draw_glenz_box (corner[0] + decal + 22 * xbuf, 7, 320, 6); } winner_txt = compile_menu_text (winner, T_CENTERED|T_WAVING, 20, 159); } DRAW_SPRITE (winner_txt, corner[0] + decal); if (game_mode == M_QUEST) DRAW_SPRITE (info_mode_quest_txt, corner[0] + decal); else if (game_mode == M_DEATHM) DRAW_SPRITE (info_mode_deathm_txt, corner[0] + decal); else if (game_mode == M_KILLEM) DRAW_SPRITE (info_mode_killem_txt, corner[0] + decal); else if (game_mode == M_TCASH) DRAW_SPRITE (info_mode_tcash_txt, corner[0] + decal); else if (game_mode == M_COLOR) DRAW_SPRITE (info_mode_color_txt, corner[0] + decal); if ((level_is_finished != 15) && (game_mode == M_QUEST)) { draw_sprprogwav_if (l == 0, info_mode_next_txt, corner[0] + decal); draw_sprprogwav_if (l == 1, info_mode_save_txt, corner[0] + decal); waving_arrows (145 + l * 20, info_mode_next_save_arrow_pos); } else { DRAW_SPRITE (info_mode_return_txt, corner[0] + decal); } for (i = 0; i < 4; i++) { draw_glenz_box (corner[0] + decal + (75 + i * 12) * xbuf + 2 * xbuf, col2plr[i] + 2, 284 + i * 6, 6); DRAW_SPRITE (vehicles_spr[col2plr[i]], corner[0] + decal + (75 + i * 12) * xbuf + 284 + i * 6); DRAW_SPRITE (player_logo[col2plr[i]], corner[0] + decal + (75 + i * 12) * xbuf + 5); if (player[col2plr[i]].martians_nbr) DRAW_SPRITE (info_martian[i], corner[0] + decal + (69 + i * 12) * xbuf + 35); if (!lines[i][0]) { if (game_mode == M_QUEST) sprintf (nbr, "%d", (trail_size[col2plr[i]] + 1) / 5 - 1); else if (game_mode == M_DEATHM) sprintf (nbr, " "); else if (game_mode == M_KILLEM) sprintf (nbr, "%d", player[col2plr[i]].lemmings_nbr); else if (game_mode >= M_TCASH) sprintf (nbr, "%d", player[col2plr[i]].cash); lines[i][0] = compile_menu_text (nbr, T_CENTERED, 75 + i * 12, 108 - 10); } DRAW_SPRITE (lines[i][0], corner[0] + decal); if (!lines[i][1]) { sprintf (nbr, "%d", player[col2plr[i]].score); lines[i][1] = compile_menu_text (nbr, T_CENTERED, 75 + i * 12, 182 - 10); } DRAW_SPRITE (lines[i][1], corner[0] + decal); if (!lines[i][2]) { sprintf (nbr, "%d", player[col2plr[i]].lifes); lines[i][2] = compile_menu_text (nbr, T_CENTERED, 75 + i * 12, 265 - 10); } DRAW_SPRITE (lines[i][2], corner[0] + decal); } FREE_SPRITE0 (winner_txt); for (i = 0; i < 4; ++i) { FREE_SPRITE0 (lines[i][0]); FREE_SPRITE0 (lines[i][1]); FREE_SPRITE0 (lines[i][2]); } } void draw_round_info (int decal) { int i; char info[128]; a_sprite *winner_txt = 0; a_sprite *lines[4][3] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 } }; draw_glenz_box (corner[0] + decal + 22 * xbuf, 1, 320, 6); if (!winner_txt) { sprintf (info, _("ROUND %d/%d"), rounds_nbr_values[opt.gamerounds] - rounds + 1, rounds_nbr_values[opt.gamerounds]); winner_txt = compile_menu_text (info, T_CENTERED, 20, 159); } DRAW_SPRITE (winner_txt, corner[0] + decal); DRAW_SPRITE (info_round_txt, corner[0] + decal); DRAW_SPRITE (info_mode_return_txt, corner[0] + decal); for (i = 0; i < 4; i++) { draw_glenz_box (corner[0] + decal + (75 + i * 12) * xbuf + 2 * xbuf, col2plr[i] + 2, 284 + i * 6, 6); DRAW_SPRITE (vehicles_spr[col2plr[i]], corner[0] + decal + (75 + i * 12) * xbuf + 284 + i * 6); DRAW_SPRITE (player_logo[col2plr[i]], corner[0] + decal + (75 + i * 12) * xbuf + 5); if (!lines[i][0]) { sprintf (info, "%d", player[col2plr[i]].wins); lines[i][0] = compile_menu_text (info, T_CENTERED, 75 + i * 12, 108 - 10); } DRAW_SPRITE (lines[i][0], corner[0] + decal); if (!lines[i][1]) { sprintf (info, "%d", player[col2plr[i]].score); lines[i][1] = compile_menu_text (info, T_CENTERED, 75 + i * 12, 182 - 10); } DRAW_SPRITE (lines[i][1], corner[0] + decal); if (!lines[i][2]) { sprintf (info, "%d", player[col2plr[i]].lifes); lines[i][2] = compile_menu_text (info, T_CENTERED, 75 + i * 12, 265 - 10); } DRAW_SPRITE (lines[i][2], corner[0] + decal); } for (i = 0; i < 4; ++i) { FREE_SPRITE0 (lines[i][0]); FREE_SPRITE0 (lines[i][1]); FREE_SPRITE0 (lines[i][2]); } } void scores_menu (void) { a_keycode t; int i, j; char flag = 0; int rolldec = 0; signed char rollflag = 0; a_sprite *points_txt[5][10]; a_sprite *highs_txt[5][10]; load_scores (); for (i = 0; i < 5; ++i) for (j = 0; j < 10; ++j) { char points[32]; highs_txt[i][j] = compile_menu_text (highs[i][j].name, T_FLUSHED_LEFT, 0, 3); sprintf (points, "%u", highs[i][j].points); points_txt[i][j] = compile_menu_text (points, T_FLUSHED_RIGHT, 0, 316); } i = 0; std_white_fadein (&tile_set_img.palette); do { if (flag) { if (rollflag) event_sfx (19); } else flag = 1; do { background_menu (); draw_glenz_box (corner[0] + xbuf * 70, 2, 320, 6); draw_glenz_box (corner[0] + xbuf * 83, 3, 320, 6); draw_glenz_box (corner[0] + xbuf * 96, 4, 320, 6); draw_glenz_box (corner[0] + xbuf * 109, 5, 320, 6); draw_glenz_box (corner[0] + xbuf * 122, 0, 320, 6); draw_glenz_box (corner[0] + xbuf * 135, 0, 320, 6); draw_glenz_box (corner[0] + xbuf * 148, 0, 320, 6); draw_glenz_box (corner[0] + xbuf * 161, 0, 320, 6); draw_glenz_box (corner[0] + xbuf * 174, 0, 320, 6); draw_glenz_box (corner[0] + xbuf * 187, 0, 320, 6); DRAW_SPRITE (higher_scores_txt, corner[0]); if (!rollflag) { DRAW_SPRITE (gamemode_txt[i], corner[0] + 40 * xbuf); for (j = 0; j < 10; j++) { DRAW_SPRITE (highs_txt[i][j], corner[0] + (68 + 13 * j) * xbuf); DRAW_SPRITE (points_txt[i][j], corner[0] + (68 + 13 * j) * xbuf); } } else { draw_sprprog_clipped_left (gamemode_txt[i - 1], corner[0] + 40 * xbuf - rolldec, - rolldec, -30); for (j = 0; j < 10; j++) { draw_sprprog_clipped_left (highs_txt[i - 1][j], corner[0] + (68 + 13 * j) * xbuf - rolldec, - rolldec, -30); draw_sprprog_clipped_left (points_txt[i - 1][j], corner[0] + (68 + 13 * j) * xbuf - rolldec, - rolldec, -30); } draw_sprprog_clipped_right (gamemode_txt[i], corner[0] + 40 * xbuf + 320 - rolldec, 320 - rolldec, 320); for (j = 0; j < 10; j++) { draw_sprprog_clipped_right (highs_txt[i][j], corner[0] + (68 + 13 * j) * xbuf + 320 - rolldec, 320 - rolldec, 320); draw_sprprog_clipped_right (points_txt[i][j], corner[0] + (68 + 13 * j) * xbuf + 320 - rolldec, 320 - rolldec, 320); } } hrule (28); hrule (59); flush_display (corner[0]); if (rollflag == 1) { rolldec += 1 + (320 - rolldec) / 8; if (rolldec == 320) rollflag = 0; } else if (rollflag == -1) { rolldec -= 1 + rolldec / 8; if (rolldec == 0) { rollflag = 0; i--; } } } while (!key_or_joy_ready ()); t = get_key_or_joy (); if ((t == HK_Right || t == 0x3920 || t == 0x1C0D || t == HK_Down) && i < 4) { rollflag = 1; rolldec = 0; i++; } else if ((t == HK_Left || t == HK_Up) && i != 0 && (i > 1 || rollflag != -1)) { if (rollflag == -1) i--; else rollflag = -1; rolldec = 320; } } while (t != HK_Escape); event_sfx (8); for (i = 0; i < 5; ++i) for (j = 0; j < 10; ++j) { FREE_SPRITE0 (points_txt[i][j]); FREE_SPRITE0 (highs_txt[i][j]); } } void help_menu (void) { a_keycode t; int top = 0; #define MULT_SHIFT 10 int curmult = 0; std_white_fadein (&tile_set_img.palette); do { background_menu (); curmult += ((top << MULT_SHIFT) - curmult) / 8; draw_reader_data (help_text, corner[0] - 10 * xbuf, curmult >> MULT_SHIFT, (curmult >> MULT_SHIFT) + 220); flush_display (corner[0]); if (key_or_joy_ready ()) { t = get_key_or_joy (); handle_reader_keys (t, &top, help_text); if (top + 200 > help_text->max / xbuf) top = help_text->max / xbuf - 200; if (top < 0) top = 0; } else { t = 0; } } while (t != HK_Escape); event_sfx (8); } heroes-0.21/src/locales.h0000644004117000411500000000264507352614752011004 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__LOCALES__H #define HEROES__LOCALES__H void init_locales (void); #endif /* HEROES__LOCALES__H */ heroes-0.21/src/menus.h0000644004117000411500000000422207352614752010502 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__MENUS__H #define HEROES__MENUS__H #include "sprite.h" void init_menus_sprites (void); void uninit_menus_sprites (void); void waving_arrows (unsigned int row, unsigned int col); void background_menu (void); void option_menu (void); char quit_menu (void); void draw_play_menu (int l); void draw_main_menu (int l); void draw_quit_menu (int l); void editor_first_menu (void); extern a_sprite *saverec_name[10]; extern a_sprite *player_logo[4]; void draw_saved_games_info (int decal, int l, bool save); void jukebox_menu (void); void pause_menu (void); char quit_yes_no (void); void enter_your_name (char c, char* name); void draw_round_info (int decal); void draw_end_level_info (int decal, char l); void scores_menu (void); void help_menu (void); extern char extrasel; #endif /* HEROES__MENUS__H */ heroes-0.21/src/misc.c0000644004117000411500000000405707352614752010307 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "misc.h" char * strlwr (char *in) { char *tmp = in; for (; *in != 0; ++in) *in = tolower (*in); return tmp; } char * strupr (char *in) { char *tmp = in; for (; *in != 0; ++in) *in = toupper (*in); return tmp; } char * strcat_alloc (const char *fst, const char *snd) { char *res = xmalloc (strlen (fst) + strlen (snd) + 1); return res ? strcat (strcpy (res,fst), snd) : NULL; } char * strappend (char *fst, const char *snd) { char *res = xrealloc (fst, strlen (fst) + strlen (snd) + 1); return res ? strcat (res, snd) : NULL; } char * chomp (char *str) { char *old = str; while (*str != 0 && *str != '\n' && *str != '\r') ++str; *str = 0; return old; } heroes-0.21/src/misc.h0000644004117000411500000000313207352614752010305 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__MISC__H #define HEROES__MISC__H char *strlwr (char *in); char *strupr (char *in); char *strcat_alloc (const char *fst, const char* snd); char *strappend (char *fst, const char* snd); char *chomp (char *str); #endif /* HEROES__MISC__H */ heroes-0.21/src/musicfiles.c0000644004117000411500000001567607451372147011527 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "getshline.h" #include "musicfiles.h" #include "misc.h" #include "rsc_files.h" #include "debugmsg.h" #include "errors.h" #include "hash.h" #include "dirname.h" #include "cast.h" /* we maintain the sound tracks in two structures: a hash and an array. The hash is used for most lookups, and when building the sound tracks database. The array is initialized once the hash has been finished, it is sorted (w.r.t. the alias name) and is used by the sound tracks selector in the game (which need to be able to load the `next' or `previous' sound track). */ static Hash_table *st_hash; static a_sound_track **st_array = 0; static unsigned n_st = 0; /* number of sound tracks */ /* comparison function for the hash */ static bool st_equ (const void *left, const void *right) { const a_sound_track *l = left; const a_sound_track *r = right; return !strcasecmp (l->alias, r->alias); } /* comparison function for qsort */ static int st_cmp (const void *left, const void *right) { const a_sound_track *const *l = left; const a_sound_track *const *r = right; return strcasecmp ((*l)->alias, (*r)->alias); } /* This is like hash_string, defined in lib/hash.c, but it maps lower and upercase strings to the same value. */ static unsigned hash_case_string (const char *string, unsigned n_buckets) { unsigned value = 0; while (*string) { value = ((value * 31 + (int) (unsigned char) TOLOWER (*string)) % n_buckets); ++string; } return value; } static unsigned st_hasher (const void *data, unsigned size) { const a_sound_track *d = data; return hash_case_string (d->alias, size); } static void st_uninit (a_sound_track *st) { free (st->alias); free (st->filename); free (st->title); free (st->author); } static void st_free (void *data) { a_sound_track *st = data; st_uninit (st); free (st); } static void st_init (a_sound_track *st, const char *alias, const char *filename, const char *title, const char *author) { st->alias = xstrdup (alias); st->filename = xstrdup (filename); st->title = xstrdup (title); st->author = xstrdup (author); st->rank = 0; } static a_sound_track * st_cons (char *alias, char *filename, char *title, char *author) { NEW (a_sound_track, st); st_init (st, alias, filename, title, author); return st; } void add_sound_track_cons (char *alias, char *filename, char *title, char *author) { /* If the alias already exists, overide it. Otherwise, create it. */ a_sound_track *st = get_sound_track_from_alias (alias); if (st) { st_uninit (st); st_init (st, alias, filename, title, author); } else if (!hash_insert (st_hash, st_cons (alias, filename, title, author))) xalloc_die (); } a_sound_track * get_sound_track_from_alias (const char *alias) { a_sound_track st; st.alias = const_cast_string (alias); return hash_lookup (st_hash, &st); } a_sound_track * get_sound_track_from_rank (unsigned rank) { return st_array[rank % n_st]; } int read_sound_config_file (char *filename) { FILE *fs; char *buf = 0; size_t bufsize = 0; int firstline = 0, endline = 0; char *expfilename = rsc_expand (filename); char *dir = dir_name (expfilename); size_t dirlen = strlen (dir); dmsg (D_SECTION | D_FILE, "reading sound config file: %s ...", expfilename); fs = fopen (expfilename, "r"); if (!fs) { dmsg (D_SECTION | D_FILE, "... could not open."); dperror ("fopen"); free (expfilename); free (dir); return 0; } while (getshline_numbered (&firstline, &endline, &buf, &bufsize, fs) != -1) { char *alias = strtok (buf, ":\n"); char *file = strtok (0, ":\n"); char *title = strtok (0, ":\n"); char *author = strtok (0, "\n"); if (!alias || !alias[0]) wmsg (_("%s:%d: missing alias name"), filename, firstline); else if (!file || !file[0]) wmsg (_("%s:%d: missing file name"), filename, firstline); else if (!title || !title[0]) wmsg (_("%s:%d: missing title"), filename, firstline); else if (!author || !author[0]) wmsg (_("%s:%d: missing author"), filename, firstline); else { if (dir && file[0] != '/') { char *tmp = malloc (dirlen + 1 + strlen (file) + 1); sprintf (tmp, "%s/%s", dir, file); add_sound_track_cons (alias, tmp, title, author); free (tmp); } else { add_sound_track_cons (alias, file, title, author); } } } fclose (fs); free (buf); free (dir); free (expfilename); dmsg (D_SECTION|D_FILE,"... done."); return 0; } void init_sound_track_list (void) { dmsg (D_MISC, "initialize sound track hash"); st_hash = hash_initialize (17, NULL, st_hasher, st_equ, st_free); if (!st_hash) xalloc_die (); } void uninit_sound_track_list (void) { dmsg (D_MISC, "free sound track hash"); hash_free (st_hash); XFREE0 (st_array); n_st = 0; } void print_sound_track_list (void) { unsigned pos; for (pos = 0; pos < n_st; ++pos) printf ("%s:%s:%s:%s\n", st_array[pos]->alias, st_array[pos]->filename, st_array[pos]->title, st_array[pos]->author); } void print_sound_track_list_stat (void) { hash_print_statistics (st_hash, stdout); } void freeze_sound_track_list (void) { a_sound_track *s; a_sound_track **p; unsigned pos; n_st = hash_get_n_entries (st_hash); if (!n_st) return; /* create an array of all existing aliases */ XMALLOC_ARRAY (st_array, n_st); pos = 0; for (s = hash_get_first (st_hash); s; s = hash_get_next (st_hash, s)) st_array[pos++] = s; assert (pos == n_st); /* sort it */ qsort (st_array, n_st, sizeof (*st_array), st_cmp); /* number each sound track */ p = st_array; for (pos = 0; pos < n_st; ++pos) (*p++)->rank = pos; } heroes-0.21/src/musicfiles.h0000644004117000411500000000402707352614752011521 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__MUSICFILES__H #define HEROES__MUSICFILES__H typedef struct sound_track_s { char* alias; /* name used in level files */ char* filename; char* title; char* author; unsigned rank; } a_sound_track; a_sound_track* get_sound_track_from_alias (const char* alias); a_sound_track* get_sound_track_from_rank (unsigned rank); void add_sound_track_cons (char* alias, char* filename, char* title, char* author); int read_sound_config_file (char* filename); void freeze_sound_track_list (void); void init_sound_track_list (void); void uninit_sound_track_list (void); void print_sound_track_list (void); void print_sound_track_list_stat (void); #endif /* HEROES__MUSICFILES__H */ heroes-0.21/src/parafmt.c0000644004117000411500000003153407352614752011006 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /*-------------------------------------------------------------------. | This is a "smart" paragraph formating function. The algorithm | | used here is roughly the same as in the command `fmt' from the GNU | | fileutils except that here we have to handle spaces of variable | | width, letters that does not all have the same width, and lines of | | differents width. | `-------------------------------------------------------------------*/ #include "system.h" #include "parafmt.h" typedef struct word_s a_word; typedef struct paragraph_s a_paragraph; typedef a_u32 a_cost; #define MAX_COST U32_MAX struct word_s { char *letters; /* positions in the string copy */ char *letters_end; /* end of the word in the string copy */ a_width width; /* width of the word */ unsigned int spaces; /* number of spaces after the word */ bool is_punct; /* if the word it is ended by a punctuation mark */ const a_word **next_break; /* Next word to break after, if this one is broken after. This is an array because we compute the next_break for any width of line possible. */ a_cost *next_break_cost; /* Cost for this next break, an array for the very same reason. */ }; struct paragraph_s { a_word *words; /* The list of words for the paragraph. */ unsigned int nwords; /* The number of words. */ unsigned int indent; /* Initial spaces, before the first word. */ const a_width *max_widths; /* like line_widths but sorted in ascending order, duplicate removed */ unsigned int nmax_widths; /* size of max_width (= number of expected lines). If there is more line than nmax_widths, the last value of max_width (namely max_width[nmax_width - 1]) will be used. */ a_width std_space_width; /* standard space width */ a_width min_space_width; /* minimun space_width */ const a_word *first_break; /* first word to break after */ char *data; /* a copy of the original string */ const a_word **break_data; /* a buffer allocated once for break pointers of all words */ a_cost *break_cost_data; /* a buffer allocated once for break costs of all words */ }; /* count the number of words in STR. Words are sequences of non-space characters */ static unsigned int count_words (const char *str) { unsigned int count = 0; for (;;) { /* skip initial spaces */ while (*str && ISSPACE (*str)) ++str; /* at end of string? */ if (!*str) break; ++count; /* skip the word */ while (*str && !ISSPACE (*str)) ++str; } return count; } /* Split STR in an array of words. Return this as a a_paragraph. */ static a_paragraph * split_words (const char *input_str, const a_width *wa) { unsigned int nwords; a_word *words; unsigned int i; char *str; NEW (a_paragraph, p); /* count initial spaces */ for (i = 0; *input_str && ISSPACE (*input_str); ++input_str) ++i; p->indent = i; /* duplicate the string, without the leading spaces */ p->data = str = xstrdup (input_str); /* allocate the words array */ nwords = count_words (str); XMALLOC_ARRAY (words, nwords); p->nwords = nwords; p->words = words; /* fill the words array */ for (i = 0; i < nwords; ++i) { words[i].letters = str; /* compute the a_width of the word (previous spaces have been skipped, and *str!=0 because imax_widths = line_widths; /* compute the muber of line widths given */ for (; *line_widths; ++line_widths) ++nwidths; p->nmax_widths = nwidths; /* allocate the break buffers */ XMALLOC_ARRAY (p->break_data, p->nmax_widths * p->nwords); XMALLOC_ARRAY (p->break_cost_data, p->nmax_widths * p->nwords); /* distribute amounts of these buffers to all words */ { unsigned int n; const a_word **w = p->break_data; a_cost *c = p->break_cost_data; for (n = 0; n < p->nwords; ++n) { p->words[n].next_break = w; p->words[n].next_break_cost = c; w += p->nmax_widths; c += p->nmax_widths; } } return p; } static a_cost wdist (a_width l, a_width r) { a_cost c = l > r ? l - r : r - l; return c * c; } /* Give the cost for breaking after word WN on a line which is WIDTH large and has SPACES spaces. You should play with the formulas here to give a better looking to the paragraph formating. WIDX is tha width index of the current line. */ static a_cost compute_break_cost (a_paragraph *p, unsigned int wn, a_width width, a_width spaces, unsigned widx) { a_cost cost = 0; a_width space_width, std_space_width; /* width for spaces */ space_width = p->max_widths[widx] - width; /* prefered width for spaces */ std_space_width = p->std_space_width * spaces; /* prefer the standard space width */ cost += wdist (space_width, std_space_width); /* prefer breaking on punctuation */ if (!p->words[wn].is_punct) cost += p->std_space_width * 3; /* account for the cost of following breaks */ if (widx + 1 < p->nmax_widths) cost += p->words[wn].next_break_cost[widx + 1]; else cost += p->words[wn].next_break_cost[p->nmax_widths - 1]; return cost; } /* Find the best break for a line starting on word wn, and with width max_widths[widx]. Update res->next_break and res->next_break_cost accordingly. WARNING: this does not handle words larger than p->max_width */ static const a_word * compute_best_break (a_paragraph *p, unsigned int wn, a_word *res, unsigned int widx) { unsigned int nwords = p->nwords; const a_word *w = p->words; unsigned int spaces = 0; a_width width = 0; a_cost best_cost = MAX_COST; const a_word *best_break = 0; /* find the best break position on this line */ while (wn < nwords) { a_cost cost; /* Add a new word */ width += w[wn].width; /* don't check more words than what can fit on this line */ if ((width + spaces * p->min_space_width) > p->max_widths[widx]) break; /* consider breaking after this word */ cost = compute_break_cost (p, wn, width, spaces, widx); if (cost < best_cost) { best_cost = cost; best_break = w + wn; } /* advance to next word */ spaces += w[wn].spaces; ++wn; } /* update res accordingly */ if (res) { res->next_break[widx] = best_break; res->next_break_cost[widx] = (wn >= nwords) ? 0 : best_cost; } return best_break; } /* compute breaking paths for the paragraph P */ static void compute_breaking_path (a_paragraph *p) { a_word *w = p->words; unsigned int wn; unsigned int widx; for (wn = p->nwords; wn > 0; --wn) { /* consider breaking right before w[wn] */ for (widx = 0; widx < p->nmax_widths; ++widx) compute_best_break (p, wn, w + wn - 1, widx); } /* finally, compute the best break for the first line */ /* FIXME: p->indent should be dealed with somewhere*/ p->first_break = compute_best_break (p, 0, 0, 0); } /* follow the (already computed) breaking path, and build and array of strings (one per line) */ static char ** convert_paragraph_to_array (a_paragraph *p) { unsigned int nlines; const a_word *fw; /* first word of the current line */ const a_word *lw; /* last word of the current line */ char **result; unsigned int curline; /* count the number of lines */ lw = p->first_break; nlines = 0; while (lw) { ++nlines; lw = lw->next_break[nlines < p->nmax_widths ? nlines : p->nmax_widths - 1]; } XMALLOC_ARRAY (result, nlines + 1); result[nlines] = 0; /* mark the end of the array */ fw = p->words; lw = p->first_break; curline = 0; while (lw) { /* copy the words for the current line */ *lw->letters_end = 0; /* split the string */ result[curline] = fw->letters; /* jump to next line */ ++curline; fw = lw + 1; lw = lw->next_break[curline < p->nmax_widths ? curline : p->nmax_widths - 1]; } assert (curline == nlines); return result; } char ** parafmt_var (const char *str, const a_width *wa, const a_width *max_widths, a_width min_space_width) { char **result; a_paragraph *p = split_words (str, wa); /* FIXME: make sure no words are larger than any max_width or compute_breaking_path may fail. */ initialize_width_data (p, max_widths); p->min_space_width = min_space_width; p->std_space_width = wa[' ']; compute_breaking_path (p); result = convert_paragraph_to_array (p); free (p->words); free (p->break_data); free (p->break_cost_data); free (p); return result; } char ** parafmt (const char *str, const a_width *wa, a_width max_width, a_width min_space_width) { a_width mw[2] = {max_width, 0}; return parafmt_var (str, wa, mw, min_space_width); } void free_pararray (char **p) { free (p[0]); /* this free ALL lines (p[0] is the ->data member of the original paragraph). */ free (p); } #ifdef TEST /*-----------------------------------------------------------------. | Run "make parafmt-check" in the src/ directory to compile this. | `-----------------------------------------------------------------*/ static char ** print_array (char **array, a_width width) { char spec[30]; char **a = array; sprintf (spec, "%%-%us|\n", width); for (; *a; ++a) printf (spec, *a); return array; } static char ** print_array_var (char **array, const a_width *widths) { char spec[30]; char **a = array; a_width width = *widths; for (; *a; ++a) { sprintf (spec, "%%-%us|\n", width); printf (spec, *a); if (widths[1]) width = *++widths; } return array; } static void check_parafmt (a_width width) { unsigned int test_widths[256]; const char *test_str = "\ This is a quit longish string, used to test whether parafmt format \ it correctly. Blah blah, blah blah. You can check that break on \ punctiation (non alaphanumeric, non spaces) are sometime prefered."; int i; for (i = 0; i < 256; ++i) test_widths[i] = 1; free_pararray (print_array (parafmt (test_str, test_widths, width, 1), width)); } static void check_parafmt_var (a_width width) { unsigned int test_widths[256]; const char *test_str = "\ This is another testing string. But this time we check the \ parafmt_var function. It is used to format paragraphs whose lines \ do not always have the same width. Blah blah, blah blah."; const a_width w[] = { width, width + 2, width + 4, width + 6, 0 }; int i; for (i = 0; i < 256; ++i) test_widths[i] = 1; free_pararray (print_array_var (parafmt_var (test_str, test_widths, w, 1), w)); } char *program_name; int main (void) { int i; for (i = 20; i < 80; ++i) check_parafmt (i); for (i = 20; i < 70; ++i) check_parafmt_var (i); return 0; } #endif heroes-0.21/src/parafmt.h0000644004117000411500000000531307352614752011007 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /*-------------------------------------------------. | This is a "smart" paragraph formating function. | `-------------------------------------------------*/ #ifndef HEROES__PARAFMT__H #define HEROES__PARAFMT__H /* The width of a string, or of a character */ typedef unsigned int a_width; /* Split the input string STR into an array of strings the sizes of which are never longer than MAX_WIDTH. Size of strings are computed according to WA, and array of widths for wach of the 256 characters. The returned array is mallocated and should be freed by the caller. Strings are broke on spaces, with a preference for spaces which follow punctuation. paramfmt will consider using spaces greater or equal to min_space_width, trying to use the value of wa[' '] ad much as possible. */ char **parafmt (const char *str, const a_width *wa, a_width max_width, a_width min_space_width); /* Likewise, but the width may be different on each line. max_widths is a 0 terminated array giving the width of each line. The last size given by max_width is used for the remaining lines, should there be more lines than widths given. */ char **parafmt_var (const char *str, const a_width *wa, const a_width *max_widths, a_width min_space_width); /* free an array of strings, as returned by parafmt */ void free_pararray (char **p); #endif /* HEROES__PARAFMT__H */ heroes-0.21/src/pcx.c0000644004117000411500000000677607352614752010160 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "errors.h" #include "pcx.h" #include "rsc_files.h" #include "bytesex.h" #include "debugmsg.h" static void img_init (a_pcx_image *image) { XMALLOC_ARRAY (image->buffer, image->size); } void img_free (a_pcx_image *image) { free (image->buffer); } char pcx_load (const char *file, a_pcx_image *image) { unsigned long compteur; FILE *fptr; int nbrbytes, i; a_u8 data; dmsg (D_FILE, "opening image file: %s", file); if ((fptr = fopen (file, "rb")) == NULL) { emsg (_("Cannot open %s"), file); } fread (&(image->header), sizeof (a_pcx_header), 1, fptr); /* convert to local endianess */ image->header.x = BSWAP16 (image->header.x); image->header.y = BSWAP16 (image->header.y); image->header.width = BSWAP16 (image->header.width); image->header.height = BSWAP16 (image->header.height); image->header.widthdpi = BSWAP16 (image->header.widthdpi); image->header.heightdpi = BSWAP16 (image->header.heightdpi); image->header.bytes_per_lines = BSWAP16 (image->header.bytes_per_lines); image->header.palette_kind = BSWAP16 (image->header.palette_kind); image->width = image->header.width - image->header.x + 1; image->height = image->header.height - image->header.y + 1; image->size = image->width * image->height; dmsg (D_FILE, "size=(%d,%d) rle=%d", image->header.width + 1, image->header.height + 1, image->header.rle); img_init (image); compteur = 0; if (image->header.rle) { while (compteur < image->size) { data = (a_u8) getc (fptr); if ((data & 192) == 192) { nbrbytes = data & 63; data = (a_u8) getc (fptr); while (nbrbytes--) image->buffer[compteur++] = data; } else { image->buffer[compteur++] = data; } } } else { fread (image->buffer, image->size, 1, fptr); } data = (a_u8) getc (fptr); /* data==0Ch expected */ fread (image->palette.global, 768, 1, fptr); for (i = 0; i < 256 * 3; i++) image->palette.global[i] >>= 2; fclose (fptr); return 0; } char pcx_load_from_rsc (const char *rsc, a_pcx_image *image) { char *res = get_non_null_rsc_file (rsc); char error = pcx_load (res, image); free (res); return error; } heroes-0.21/src/pcx.h0000644004117000411500000000437507352614752010156 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__PCX__H #define HEROES__PCX__H #include "video.h" typedef struct pcx_header_type { a_u8 signature; a_u8 version; a_u8 rle; char bits_per_pixels; a_u16 x, y; a_u16 width, height; a_u16 widthdpi, heightdpi; a_u8 egapal[48]; a_u8 inutil; a_u8 nbrplanes; a_u16 bytes_per_lines; a_u16 palette_kind; a_u8 rien[58]; } a_pcx_header ATTRIBUTE_PACKED; typedef struct { a_u8 r, g, b; } an_rvb_color; typedef union { an_rvb_color indiv[256]; a_u8 global[256 * 3]; } a_palette; typedef struct img_type { a_pcx_header header; a_palette palette; unsigned int width, height; unsigned int size; a_pixel *buffer; } a_pcx_image; void img_free (a_pcx_image * image); char pcx_load (const char *file, a_pcx_image * image); char pcx_load_from_rsc (const char *rsc, a_pcx_image * image); #define IMGPOS(img,row,col) ((img).buffer + (row) * (img).width + (col)) #endif /* HEROES__PCX__H */ heroes-0.21/src/pendulum.c0000644004117000411500000001051007421651500011161 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001, 2002 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "pendulum.h" #include "timer.h" /* An amortized pendulum, approximed using Euler's method. * * + * |\ * | \ * | \ * | \ * |_./ \ * |theta\ * | \ * | * * | * * The pendulum starts with theta(0) = PI/2, and then * swings down around 0 until it is stopped. * * Theta is a function of the time, and satisfies the * following differential equation: * * theta(t)'' = - (B * theta(t)' + A * sin(theta(t))) * * where A and B are two arbitray constants. (In physics * they would depend on the gravitation, and the weight of * the pendulum, but in Heroes we will take whatever values * produce a good result on screen.) * * This is a second-order differential equation, so we can't * really apply Euler's method on it. However, things get * easier if we break it into the two first-order equations * below: * * omega(t)' = - (B * omega(t) + A * sin(theta(t))) * theta(t)' = omega(t) * * Let's call a(0), a(1), ... a(N) the sequence of approximations * of theta, and b(0), b(1), ... b(N) the approxumations for omega. * * If we know a(n) and b(n), we can apply Euler's formula on * our first equation to compute b(n+1): * * b(n+1) = b(n) - h * (B * b(n) - A * sin(a(n)) * * where h is the step in Euler's formula. * Applying Euler's formula to the second equation gives: * * a(n+1) = a(n) + h * b(n) * * So finally we have an algorithm which allows us to compute a(n): * Initialization: * a(0) = PI/2 -- starting angle * b(0) = 0 -- starting speed * For n = 0 .. N: * b(n+1) = b(n) - h * (B * b(n) - A * sin(a(n)) * a(n+1) = a(n) + h * b(n) */ struct a_pendulum { double theta; /* a(n) above */ double theta_prime; /* b(n) above */ #define EULER_STEP 0.006 /* h above */ #define NBR_STEPS 10 /* we make many small steps rather than one big for more accuracy */ a_timer pendulum_timer; unsigned elapsed_time; /* Number of step performed. */ }; a_pendulum* pendulum_create (void) { NEW (a_pendulum, p); p->theta = 3.1415926535 / 2; p->theta_prime = 0; p->pendulum_timer = new_htimer (T_LOCAL, HZ (70)); p->elapsed_time = 0; return p; } static void pendulum_one_step (a_pendulum *p) { double aux; /* We use B = 0.33 and A = 1 here. */ aux = EULER_STEP * (0.33 * p->theta_prime + sin (p->theta)); p->theta += EULER_STEP * p->theta_prime; p->theta_prime -= aux; } unsigned pendulum_update (a_pendulum *p, int *angle256) { int i; int n = read_htimer (p->pendulum_timer); p->elapsed_time += NBR_STEPS * n; /* Make many smalls step rather than one big step for more accuracy. */ for (i = NBR_STEPS * n; i; --i) pendulum_one_step (p); /* ANGLE must be an integer between -256 and +256. */ *angle256 = floor (p->theta * 512.0 / 3.1415926535); return p->elapsed_time; } void pendulum_destroy (a_pendulum *p) { free_htimer (p->pendulum_timer); free (p); } heroes-0.21/src/pendulum.h0000644004117000411500000000317507421651500011177 /*------------------------------------------------------------------. | Copyright 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" typedef struct a_pendulum a_pendulum; a_pendulum *pendulum_create (void); void pendulum_destroy (a_pendulum *p); /* Returns the number of steps performed so far, and set ANGLE256 to a value between -256 (equivalant to -Pi/2) and +256 (+Pi/2). */ unsigned pendulum_update (a_pendulum *p, int *angle256); heroes-0.21/src/people.c0000444004117000411500000000772407451356455010645 /* -*- buffer-read-only: t -*- vi: set ro: ** ** DO NOT EDIT THIS FILE (src/people.c) ** ** It has been AutoGen-ed Saturday March 30, 2002 at 04:43:41 PM CET ** From the definitions src/people.def ** and the template file people */ /* ** Heroes is free software. ** ** You may 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. ** ** Heroes 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 Heroes. See the file "COPYING". If not, ** write to: The Free Software Foundation, Inc., ** 59 Temple Place - Suite 330, ** Boston, MA 02111-1307, USA. */ #include "system.h" #include "people.h" #include "misc.h" typedef struct a_strpair a_strpair; struct a_strpair { const char* str; bool i18n; }; const a_strpair people_strings[] = { { "\n", false }, { N_("%{center}You owe this game to the following people"), true }, { "\n%{head 1}", false }, { N_("Authors\n"), true }, { "\n", false }, { "%{>>>}Alexandre Duret-Lutz\n", false }, { "%{>>>}Romual Genevois\n", false }, { "%{>>>}Alexandre Liverneaux\n", false }, { "%{>>>}Philippe Meisburger\n", false }, { "\n%{head 2}", false }, { N_("Contributors\n"), true }, { "\n", false }, { "%{>>>}Pierre Baillet\n", false }, { "%{>>>}Uwe Hermann\n", false }, { "%{>>>}Ingo van Lil\n", false }, { "\n%{head 3}", false }, { N_("Translators\n"), true }, { "\n", false }, { "%{>>>}Hermann J. Beackers (%b", false }, { N_("German"), true }, { "%w)\n", false }, { "%{>>>}Jos Boersema (%b", false }, { N_("Dutch"), true }, { "%w)\n", false }, { "%{>>>}Luzemario Dantas Rocha (%b", false }, { N_("Brazilian Portuguese"), true }, { "%w)\n", false }, { "%{>>>}Alessandro Dotti (%b", false }, { N_("Italian"), true }, { "%w)\n", false }, { "%{>>>}Alexandre Duret-Lutz (%b", false }, { N_("French"), true }, { "%w)\n", false }, { "%{>>>}Ingo van Lil (%b", false }, { N_("German"), true }, { "%w)\n", false }, { "\n%{head 4}", false }, { N_("Packagers\n"), true }, { "\n", false }, { "%{>>>}Daniel Burrows (%bDebian GNU/Linux%w)\n", false }, { "%{>>>}Jean Delvare (%bRPM & Slackware Linux%w)\n", false }, { "%{>>>}Eugenia Loli-Queru (%bBeOS%w)\n", false }, { "%{>>>}Pascal Rigaux (%bLinux-Mandrake%w)\n", false }, { "%{>>>}Maxim Sobolev (%bFreeBSD%w)\n", false }, { "\n%{head 1}", false }, { N_("Porters\n"), true }, { "\n", false }, { "%{>>>}Stephane Denis (%bWin/Visual C%w)\n", false }, { "%{>>>}Mattias Engdegaard (%bSolaris%w)\n", false }, { "%{>>>}Maxim Sobolev (%bFreeBSD%w)\n", false }, { "\n%{head 2}", false }, { N_("Other people we wish to thanks\n"), true }, { "\n", false }, { "%{>>>}Todd Allendorf\n", false }, { "%{>>>}William Black\n", false }, { "%{>>>}Beiad Ian Q. Dalton\n", false }, { "%{>>>}Laurent Duperval\n", false }, { "%{>>>}Christoph Egger\n", false }, { "%{>>>}Gregory Giannoni\n", false }, { "%{>>>}Janos Holanyi\n", false }, { "%{>>>}Wolfgang Holzinger\n", false }, { "%{>>>}Brian S. Julin\n", false }, { "%{>>>}Jesper Kjolsrud\n", false }, { "%{>>>}David Olofson\n", false }, { "%{>>>}Raphael Poss\n", false }, { "%{>>>}Thomas Pospisek\n", false }, { "%{>>>}Benjamin Preidecker\n", false }, { "%{>>>}Christian T. Steigies\n", false }, { "%{>>>}Eero Tamminen\n", false }, { 0, 0 } }; a_read_data * compile_people (void) { a_read_data *p = 0; char *s = 0; const a_strpair *r = people_strings; s = xstrdup (r->i18n ? _(r->str) : r->str); while ((++r)->str) s = strappend (s, r->i18n ? _(r->str) : r->str); p = compile_reader_data (p, s); free (s); return p; } heroes-0.21/src/people.def0000644004117000411500000001176707450420473011154 autogen definitions people; /* ** This file record informations about all people which have ** contributed to Heroes in some ways. Each person is ** described in a `person' block with the following attributes: ** ** name: the full name ** aka: pseudo, or alternate name ** email: the email address ** www: the home page address ** author: authors' contributions ** contrib: what the person contributed ** i18n: what language have been translated ** package: what package the person maintain ** port: which architecture the person adapted Heroes too ** help: the help the person offered ** suggestions: (no value) if the personne suggested improvement ** bugs: (no value) if the person reported bugs ** thanks: another reason why the person should be thanked. ** ** The block are lexicographically sorted on the *last* name. */ person = { name = "Todd Allendorf"; email = toddal@alumni.caltech.edu; thanks = "reported heroes BeOS run out of the box"; }; person = { name = "Pierre Baillet"; email = octplane@via.ecp.fr; contrib = "Support for non-8bits depth video mode with LibGGI."; }; person = { name = "William Black"; email = psychopheles@users.sourceforge.net; bugs; }; person = { name = "Hermann J. Beackers"; email = beckers@st-oneline.de; i18n = German; }; person = { name = "Jos Boersema"; email = joshb@xs4all.nl; i18n = Dutch; }; person = { name = "Daniel Burrows"; email = Daniel_Burrows@brown.edu; package = "Debian GNU/Linux"; }; person = { name = "Beiad Ian Q. Dalton"; email = idalton@ferret.phonewave.net; bugs; }; person = { name = "Luzemario Dantas Rocha"; email = luza.solucao@uol.com.br; i18n = "Brazilian Portuguese"; }; person = { name = "Jean Delvare"; email = delvare@ensicaen.ismra.fr; package = "RPM & Slackware Linux"; suggestions; bugs; }; person = { name = "Stéphane Denis"; email = S.Denis@darkworks.com; port = "Win/Visual C"; help = "Windows advices"; }; person = { name = "Alessandro Dotti"; email = alessandro.dotti@libero.it; i18n = Italian; }; person = { name = "Laurent Duperval"; email = lduperval@microcelli5.com; suggestions; }; person = { name = "Alexandre Duret-Lutz"; email = duret_g@epita.fr; aka = Pollux; www = http://www.epita.fr/~duret_g/; i18n = French; author = "Wrote the original source code, ported it to GNU/Linux and created a few levels."; }; person = { name = "Christoph Egger"; email = Christoph_Egger@t-online.de; thanks = "Sent useful comments about BUGS and TODO."; }; person = { name = "Mattias Engdegård"; email = f91-men@nada.kth.se; port = Solaris; bugs; }; person = { name = "Romual Genevois"; aka = Guen; email = rgenevois@besancon.net; www = http://www.romualdgenevois.com/; author = "Had the idea of that game, designed most of it, drew the graphics, created most of the levels."; }; person = { name = "Gregory Giannoni"; email = gianno_g@epita.fr; suggestions = "Asked for --quadruple"; }; person = { name = "Uwe Hermann"; email = uh1763@bingo-ev.de; contrib = "Clean-ups and portability fixes."; }; person = { name = "Janos Holanyi"; email = csani@lme.linux.hu; bugs; }; person = { name = "Wolfgang Holzinger"; email = wholzi@gmx.at; bugs; }; person = { name = "Brian S. Julin"; email = bri@tull.umassp.edu; bugs; }; person = { name = "Jesper Kjolsrud"; email = jeppe@dneg.com; thanks = "Reported the Heroes runs on IRIX out of the box."; }; person = { name = "Alexandre Liverneaux"; aka = Alexel; email = alex.livernaux@wanadoo.fr; www = http://alexel.planet-d.net/; author = "Composed the soundtracks."; }; person = { name = "Eugenia Loli-Queru"; email = eloli@hotmail.com; package = BeOS; }; person = { name = "Philippe Meisburger"; aka = TNK; email = philmeis@mail.dotcom.fr; www = http://perso.club-internet.fr/philmeis/; author = "Composed the soundtracks and created some levels."; }; person = { name = "David Olofson"; email = david.olofson@reologica.se; bugs; }; person = { name = "Raphaël Poss"; email = raphael.poss@epita.fr; bugs; }; person = { name = "Thomas Pospisek"; email = tpo_deb@sourcepole.ch; bugs; }; person = { name = "Benjamin Preidecker"; email = bpreidecker@gmx.de; bugs; }; person = { name = "Pascal Rigaux"; aka = pixel; email = pixel@mandrakesoft.com; package = Linux-Mandrake; }; person = { name = "Maxim Sobolev"; email = sobomax@FreeBSD.org; port = FreeBSD; package = FreeBSD; }; person = { name = "Christian T. Steigies"; email = cts@debian.org; bugs; }; person = { name = "Eero Tamminen"; email = oak@welho.com; bugs; }; person = { name = "Ingo van Lil"; email = inguin@gmx.de; i18n = German; contrib = "Latin-1 characters in fonts."; }; heroes-0.21/src/people.h0000644004117000411500000000270307352614752010641 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__PEOPLE__H #define HEROES__PEOPLE__H #include "readmake.h" a_read_data *compile_people (void); #endif /* HEROES__PEOPLE__H */ heroes-0.21/src/people.tpl0000644004117000411500000001602507375467160011217 [~ autogen5 template authors=AUTHORS thanks=THANKS texi c # Copyright 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes 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. # # Heroes 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 ~] [~ (define (email) (sprintf "<%s>" (get "email"))) (define (char-to-texi c) (let ((res (case c ((#\å) "@aa{}") ((#\à) "@`a") ((#\ä) "@\"a") ((#\â) "@^a") ((#\é) "@'e") ((#\è) "@`e") ((#\ë) "@\"e") ((#\ê) "@^e") ((#\í) "@'i") ((#\ì) "@`i") ((#\ï) "@\"i") ((#\î) "@^i") ((#\ç) "@,{c}") ((#\ñ) "@~n") ((#\ß) "@ss{}") ((#\@) "@@") (else c)))) (if (string? res) (string->list res) (list res)))) (define (char-to-ascii c) (let ((res (case c ((#\å) "aa") ((#\à) "a") ((#\ä) "a") ((#\â) "a") ((#\é) "e") ((#\è) "e") ((#\ë) "e") ((#\ê) "e") ((#\í) "i") ((#\ì) "i") ((#\ï) "i") ((#\î) "i") ((#\ç) "c") ((#\ñ) "n") ((#\ß) "ss") ((#\@) "@") (else c)))) (if (string? res) (string->list res) (list res)))) (define (to-texi string-to-recode) (list->string (apply append (map char-to-texi (string->list string-to-recode))))) (define (to-ascii string-to-recode) (list->string (apply append (map char-to-ascii (string->list string-to-recode))))) (define (name-texi) (to-texi (get "name"))) (define (name-ascii) (to-ascii (get "name"))) (define (email-texi) (to-texi (get "email"))) (define (i18n-texi) (to-texi (get "i18n"))) (define (i18n-ascii) (to-texi (get "i18n"))) (define (package-texi) (to-texi (get "package"))) (define (package-ascii) (to-texi (get "package"))) (define (author-texi) (to-texi (get "author"))) (define (port-texi) (to-texi (get "port"))) (define (port-ascii) (to-texi (get "port"))) (define (contrib-texi) (to-texi (get "contrib"))) ~][~ CASE (suffix) ~][~ == authors ~][~ FOR person ~][~ IF author ~]* [~ name ~] [~ IF aka ~]([~ aka ~]) [~ ENDIF ~][~ (email) ~] [~ IF www ~] [~ www ~] [~ ENDIF www ~] [~ (out-push-new ".author") ~][~ author ~][~ (out-pop ) ~][~ `sed -e 's/^/ /' .author; rm -f .author` ~] [~ ENDIF author ~][~ ENDFOR person ~][~ == thanks ~]This file records people who contributed to Heroes by reporting problems, suggesting various improvements or submitting actual code. More details about the contributions can be found in the manual or the ChangeLog. If your name has been left out, if you'd rather not be listed, or if you'd prefer a different address be used, please send a note to . [~ FOR person ~][~ IF author ~][~ ELSE ~][~ (sprintf "%-38s %s\n" (get "name") (get "email")) ~][~ ENDIF ~][~ ENDFOR person ~][~ == texi ~][~ (import-head "PEOPLE") ~]@unnumberedsubsec Authors @itemize @bullet [~ FOR person ~][~ IF author ~]@item [~ IF email ~]@email{[~ (email-texi) ~],[~ (name-texi) ~]}[~ ELSE ~][~ (name-texi) ~][~ ENDIF ~] [~ (author-texi) ~] [~ ENDIF ~][~ ENDFOR person ~]@end itemize @unnumberedsubsec Contributors @itemize @bullet [~ FOR person ~][~ IF contrib ~]@item [~ IF email ~]@email{[~ (email-texi) ~],[~ (name-texi) ~]}[~ ELSE ~][~ (name-texi) ~][~ ENDIF ~] [~ (contrib-texi) ~] [~ ENDIF ~][~ ENDFOR person ~]@end itemize @unnumberedsubsec Translators @itemize @bullet [~ FOR person ~][~ IF i18n ~]@item [~ IF email ~]@email{[~ (email-texi) ~],[~ (name-texi) ~]}[~ ELSE ~][~ (name-texi) ~][~ ENDIF ~] ([~ (i18n-texi) ~]) [~ ENDIF ~][~ ENDFOR person ~]@end itemize @unnumberedsubsec Packagers @itemize @bullet [~ FOR person ~][~ IF package ~]@item [~ IF email ~]@email{[~ (email-texi) ~],[~ (name-texi) ~]}[~ ELSE ~][~ (name-texi) ~][~ ENDIF ~] ([~ (package-texi) ~]) [~ ENDIF ~][~ ENDFOR person ~]@end itemize @unnumberedsubsec Porters @itemize @bullet [~ FOR person ~][~ IF port ~]@item [~ IF email ~]@email{[~ (email-texi) ~],[~ (to-texi (get "name")) ~]}[~ ELSE ~][~ (name-texi) ~][~ ENDIF ~] ([~ (port-texi) ~]) [~ ENDIF ~][~ ENDFOR person ~]@end itemize [~ (import-tail "PEOPLE") ~][~ == c ~][~ (dne "** " "/*\t\t\t\t") ~] */ /* [~ (gpl "Heroes" "** ") ~] */ #include "system.h" #include "people.h" #include "misc.h" typedef struct a_strpair a_strpair; struct a_strpair { const char* str; bool i18n; }; const a_strpair people_strings[] = { { "\n", false }, { N_("%{center}You owe this game to the following people"), true }, { "\n%{head 1}", false }, { N_("Authors\n"), true }, { "\n", false }, [~ FOR person ~][~ IF author ~] { "%{>>>}[~ (name-ascii) ~]\n", false }, [~ ENDIF ~][~ ENDFOR person ~] { "\n%{head 2}", false }, { N_("Contributors\n"), true }, { "\n", false }, [~ FOR person ~][~ IF contrib ~] { "%{>>>}[~ (name-ascii) ~]\n", false }, [~ ENDIF ~][~ ENDFOR person ~] { "\n%{head 3}", false }, { N_("Translators\n"), true }, { "\n", false }, [~ FOR person ~][~ IF i18n ~] { "%{>>>}[~ (name-ascii) ~] (%b", false }, { N_("[~ i18n ~]"), true }, { "%w)\n", false }, [~ ENDIF ~][~ ENDFOR person ~] { "\n%{head 4}", false }, { N_("Packagers\n"), true }, { "\n", false }, [~ FOR person ~][~ IF package ~] { "%{>>>}[~ (name-ascii) ~] (%b[~ package ~]%w)\n", false }, [~ ENDIF ~][~ ENDFOR person ~] { "\n%{head 1}", false }, { N_("Porters\n"), true }, { "\n", false }, [~ FOR person ~][~ IF port ~] { "%{>>>}[~ (name-ascii) ~] (%b[~ port ~]%w)\n", false }, [~ ENDIF ~][~ ENDFOR person ~] { "\n%{head 2}", false }, { N_("Other people we wish to thanks\n"), true }, { "\n", false }, [~ FOR person ~][~ IF author ~][~ ELSE ~][~ IF contrib ~][~ ELSE ~][~ IF i18n ~][~ ELSE ~][~ IF package ~][~ ELSE ~][~ IF port ~][~ ELSE ~] { "%{>>>}[~ (name-ascii) ~]\n", false }, [~ ENDIF ~][~ ENDIF ~][~ ENDIF ~][~ ENDIF ~][~ ENDIF ~][~ ENDFOR person ~] { 0, 0 } }; a_read_data * compile_people (void) { a_read_data *p = 0; char *s = 0; const a_strpair *r = people_strings; s = xstrdup (r->i18n ? _(r->str) : r->str); while ((++r)->str) s = strappend (s, r->i18n ? _(r->str) : r->str); p = compile_reader_data (p, s); free (s); return p; } [~ ESAC ~] heroes-0.21/src/persona.c0000644004117000411500000000721007352614752011015 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "persona.h" #include "debugmsg.h" #include "rsc_files.h" #include "vars.h" bool keep_sgid = false; bool keep_suid = false; static uid_t sys_uid; static gid_t sys_gid; static uid_t user_uid; static gid_t user_gid; static void print_persona (void) { dmsg (D_SYSTEM, "Current persona: EUID=%d EGID=%d", geteuid (), getegid ()); } void init_persona (void) { sys_uid = geteuid (); sys_gid = getegid (); user_uid = getuid (); user_gid = getgid (); print_persona (); user_persona (); /* Define some variable to indicate the special permission, so we can use conditionnals in the config files. */ if (sys_uid != user_uid || sys_gid != sys_uid) { var_define ("suid-or-sgid", "true"); var_define (sys_uid != user_uid ? "suid" : "sgid", "true"); } } void user_persona (void) { dmsg (D_SYSTEM, "switching to the user persona"); #if HAVE_SETEGID && defined _POSIX_SAVED_IDS seteuid (user_uid); setegid (user_gid); #else setreuid (user_uid, sys_uid); setregid (user_gid, sys_gid); #endif print_persona (); } void user_persona_definitively (void) { if (! keep_suid) { dmsg (D_SYSTEM, "switching to the user's USER persona definitively"); setuid (user_uid); } if (! keep_sgid) { dmsg (D_SYSTEM, "switching to the user's GROUP persona definitively"); setgid (user_gid); } print_persona (); } void sys_persona (void) { dmsg (D_SYSTEM, "switching to the system persona"); #if HAVE_SETEGID && defined _POSIX_SAVED_IDS seteuid (sys_uid); setegid (sys_gid); #else setreuid (sys_uid, user_uid); setregid (sys_gid, user_gid); #endif print_persona (); } char * sys_persona_if_needed (const char *rsc, const char *mode) { char *sysdir; char *file; int syslen; bool sec = true; file = get_non_null_rsc_file_secure (rsc, &sec); /* If the file is open for reading only, we don't care about switching the persona. */ if (mode[0] == 'r' && mode[1] != '+') return file; sysdir = get_non_null_rsc_file_secure ("sys-dir", &sec); /* Don't even consider changing the persona if the resource hasn't been setup in a secure way. */ if (sec) { /* Switch the the system personal if the file is located beyond sysdir. */ syslen = strlen (sysdir); if (strncmp (file, sysdir, syslen) == 0) sys_persona (); } free (sysdir); return file; } heroes-0.21/src/persona.h0000644004117000411500000000437307352614752011031 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES_PERSONA_H #define HEROES_PERSONA_H /* * This handle the different persona of the process. The system * persona is used to write files in the $(sys-dir) directory. The * user persona is used for every other access. This makes a * difference only if the program has a sgid or suid bit. */ bool keep_sgid; /* Whether we should keep the */ bool keep_suid; /* SGID or SUID priviledge. */ /* Get information about the current persona, and switch to the user persona. */ void init_persona (void); /* Switch to the user persona. */ void user_persona (void); /* Likewise, but don't allow to swtich back to the system persona. */ void user_persona_definitively (void); /* Switch to the system persona. */ void sys_persona (void); /* Change persona if needed to open the resource `rsc' with mode `mode', and return the value of `rsc'. */ char *sys_persona_if_needed (const char *rsc, const char *mode); #endif /* HEROES_PERSONA_H */ heroes-0.21/src/pixelize.c0000644004117000411500000001655207352614752011210 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "video.h" #include "fastmem.h" #include "const.h" #include "pixelize.h" static void pixelize_1 (a_pixel *dd, const a_pixel *ss) { a_pixel *dest = dd; const a_pixel *src = ss; int i; for (i = 200; i != 0; i--, src += xbuf, dest += xbuf) fastmem4 (src, dest, 80); } static void pixelize_2_inline (const a_pixel *s, a_pixel *d) { int y, x; for (y = 200 / 2; y; --y) { for (x = 320 / 4; x; --x) { a_pixel t1, t2; t1 = s[0]; t2 = s[1]; d[0] = t1; d[2] = t2; d[1] = t1; d[3] = t2; d[xbuf + 0] = t1; d[xbuf + 2] = t2; d[xbuf + 1] = t1; d[xbuf + 3] = t2; s += 4; d += 4; } s += 2 * xbuf - 320; d += 2 * xbuf - 320; } } static void pixelize_2 (a_pixel *dd, const a_pixel *ss) { pixelize_2_inline (ss, dd); } static void pixelize_4_inline (const a_pixel *s, int *d) { int y, x; for (y = 200 / 4; y; --y) { for (x = 320 / 4; x; --x) { a_pixel t1 = *s; int t; t = t1 | (t1 << 8) | (t1 << 16) | (t1 << 24); d[0] = t; d[xbuf / 4] = t; d[2 * xbuf / 4] = t; d[3 * xbuf / 4] = t; s += 4; d += 1; } s += 4 * xbuf - 320; d += (4 * xbuf - 320) / 4; } } static void pixelize_4 (a_pixel *dd, const a_pixel *ss) { int *dest = ((int *) dd); const a_pixel *src = ss; pixelize_4_inline (src, dest); } static void pixelize_8_inline (const a_pixel *s, int *d) { int y, x; for (y = 200 / 8; y; --y) { for (x = 320 / 8; x; --x) { a_pixel t1 = *s; int t; t = t1 | (t1 << 8) | (t1 << 16) | (t1 << 24); d[0] = t; d[1] = t; d[xbuf / 4] = t; d[xbuf / 4 + 1] = t; d[2 * xbuf / 4] = t; d[2 * xbuf / 4 + 1] = t; d[3 * xbuf / 4] = t; d[3 * xbuf / 4 + 1] = t; d[4 * xbuf / 4] = t; d[4 * xbuf / 4 + 1] = t; d[5 * xbuf / 4] = t; d[5 * xbuf / 4 + 1] = t; d[6 * xbuf / 4] = t; d[6 * xbuf / 4 + 1] = t; d[7 * xbuf / 4] = t; d[7 * xbuf / 4 + 1] = t; s += 8; d += 2; } s += 8 * xbuf - 320; d += (8 * xbuf - 320) / 4; } } static void pixelize_8 (a_pixel *dd, const a_pixel *ss) { int *dest = ((int *) dd); const a_pixel *src = ss; pixelize_8_inline (src, dest); } static void pixelize_16_inline (const a_pixel *s, int *d) { int y, x, o; for (y = 200 / 16; y; --y) { for (x = 320 / 16; x; --x) { a_pixel t1 = *s; int t; t = t1 | (t1 << 8) | (t1 << 16) | (t1 << 24); for (o = 16 * xbuf / 4; o >= 0; o -= xbuf / 4) { d[o + 0] = t; d[o + 1] = t; d[o + 2] = t; d[o + 3] = t; } s += 16; d += 4; } s += 16 * xbuf - 320; d += (16 * xbuf - 320) / 4; } } static void pixel_16_inline_2 (const a_pixel *s, int *d) { int x, o; for (x = 320 / 16; x; --x) { a_pixel t1 = *s; int t; t = t1 | (t1 << 8) | (t1 << 16) | (t1 << 24); for (o = (200 % 16 - 1) * xbuf / 4; o >= 0; o -= xbuf / 4) { d[o + 0] = t; d[o + 1] = t; d[o + 2] = t; d[o + 3] = t; } s += 16; d += 4; } } static void pixelize_16 (a_pixel *dd, const a_pixel *ss) { int *dest = ((int *) dd); const a_pixel *src = ss; pixelize_16_inline (src, dest); pixel_16_inline_2 (src + xbuf * 192, dest + (xbuf * 192) / 4); } static void pixelize_32_inline (const a_pixel *s, int *d) { int y, x, o; for (y = 200 / 32; y; --y) { for (x = 320 / 32; x; --x) { a_pixel t1 = *s; int t; t = t1 | (t1 << 8) | (t1 << 16) | (t1 << 24); for (o = 32 * xbuf / 4; o >= 0; o -= xbuf / 4) { d[o + 0] = t; d[o + 1] = t; d[o + 2] = t; d[o + 3] = t; d[o + 4] = t; d[o + 5] = t; d[o + 6] = t; d[o + 7] = t; } s += 32; d += 8; } s += 32 * xbuf - 320; d += (32 * xbuf - 320) / 4; } } static void pixel_32_inline_2 (const a_pixel *s, int *d) { int x, o; for (x = 320 / 32; x; --x) { a_pixel t1 = *s; int t; t = t1 | (t1 << 8) | (t1 << 16) | (t1 << 24); for (o = (200 % 32 - 1) * xbuf / 4; o >= 0; o -= xbuf / 4) { d[o + 0] = t; d[o + 1] = t; d[o + 2] = t; d[o + 3] = t; d[o + 4] = t; d[o + 5] = t; d[o + 6] = t; d[o + 7] = t; } s += 32; d += 8; } } static void pixelize_32 (a_pixel *dd, const a_pixel *ss) { int *dest = ((int *) dd); const a_pixel *src = ss; pixelize_32_inline (src, dest); pixel_32_inline_2 (src + xbuf * 192, dest + (xbuf * 192) / 4); } static void pixelize_64_inline (const a_pixel *s, int *d) { int y, x, o; for (y = 200 / 64; y; --y) { for (x = 320 / 64; x; --x) { a_pixel t1 = *s; int t; t = t1 | (t1 << 8) | (t1 << 16) | (t1 << 24); for (o = 64 * xbuf / 4; o >= 0; o -= xbuf / 4) { d[o + 0] = t; d[o + 1] = t; d[o + 2] = t; d[o + 3] = t; d[o + 4] = t; d[o + 5] = t; d[o + 6] = t; d[o + 7] = t; d[o + 8] = t; d[o + 9] = t; d[o + 10] = t; d[o + 11] = t; d[o + 12] = t; d[o + 13] = t; d[o + 14] = t; d[o + 15] = t; } s += 64; d += 16; } s += 64 * xbuf - 320; d += (64 * xbuf- 320) / 4; } } static void pixel_64_inline_2 (const a_pixel *s, int *d) { int x, o; for (x = 320 / 64; x; --x) { a_pixel t1 = *s; int t; t = t1 | (t1 << 8) | (t1 << 16) | (t1 << 24); for (o = (200 % 64 - 1) * xbuf / 4; o >= 0; o -= xbuf / 4) { d[o + 0] = t; d[o + 1] = t; d[o + 2] = t; d[o + 3] = t; d[o + 4] = t; d[o + 5] = t; d[o + 6] = t; d[o + 7] = t; d[o + 8] = t; d[o + 9] = t; d[o + 10] = t; d[o + 11] = t; d[o + 12] = t; d[o + 13] = t; d[o + 14] = t; d[o + 15] = t; } s += 64; d += 16; } } static void pixelize_64 (a_pixel *dest, const a_pixel *src) { int *d = ((int *) dest); const a_pixel *s = src; pixelize_64_inline (s, d); pixel_64_inline_2 (s + xbuf * 192, d + (xbuf * 192) / 4); } void (*pixelize[7]) (a_pixel *, const a_pixel *) = { pixelize_1, pixelize_2, pixelize_4, pixelize_8, pixelize_16, pixelize_32, pixelize_64 }; heroes-0.21/src/pixelize.h0000644004117000411500000000300007352614752011175 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__PIXEL__H #define HEROES__PIXEL__H #include "video.h" extern void (*pixelize[7]) (a_pixel *dest, const a_pixel *src); #endif /* HEROES__PIXEL__H */ heroes-0.21/src/prefs.c0000444004117000411500000002705707451357131010471 /* -*- buffer-read-only: t -*- vi: set ro: ** ** DO NOT EDIT THIS FILE (prefs.c) ** ** It has been AutoGen-ed Saturday March 30, 2002 at 04:48:41 PM CET ** From the definitions prefs.def ** and the template file prefs */ /* ** Heroes is free software. ** ** You may 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. ** ** Heroes 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 Heroes. See the file "COPYING". If not, ** write to: The Free Software Foundation, Inc., ** 59 Temple Place - Suite 330, ** Boston, MA 02111-1307, USA. */ #include "system.h" #include "prefs.h" #include "debugmsg.h" #include "rsc_files.h" #include "getshline.h" #include "keyvalues.h" #include "errors.h" #include "misc.h" a_pref_set opt; static char* ignored_lines = 0; static int firstline; static char* name = 0; static char* preferences_file (void) { if (!name) name = get_non_null_rsc_file ("pref-file"); return name; } void reinit_preferences (void) { opt.radar_map = true; opt.display_infos = true; opt.luminance = 6; opt.inertia = true; opt.music = true; opt.music_volume = 6; opt.sfx = true; opt.sfx_volume = 6; opt.ctrl_one = 0; opt.autopilot_one = true; opt.ctrl_two = 0; opt.autopilot_two = true; opt.speed = 0; opt.gamerounds = 4; opt.player_color[0] = 0; opt.player_color[1] = 1; opt.player_color[2] = 2; opt.player_color[3] = 3; opt.extras = 0; opt.player_keys[0][0] = HK_Up; opt.player_keys[0][1] = HK_Left; opt.player_keys[0][2] = HK_Down; opt.player_keys[0][3] = HK_Right; opt.player_keys[0][4] = HK_CtrlR; opt.player_keys[0][5] = HK_ShiftR; opt.player_keys[1][0] = HK_E; opt.player_keys[1][1] = HK_S; opt.player_keys[1][2] = HK_D; opt.player_keys[1][3] = HK_F; opt.player_keys[1][4] = HK_CtrlL; opt.player_keys[1][5] = HK_ShiftL; } void free_preferences (void) { dmsg (D_MISC, "free preferences"); XFREE0 (name); XFREE0 (ignored_lines); } void output_preferences (FILE* fs) { fprintf (fs, "# Whether the radar must be drawn.\n"); fprintf (fs, "heroes.screen.display_radar: %d\n", opt.radar_map); fprintf (fs, "# Whether game counters must be drawn.\n"); fprintf (fs, "heroes.screen.display_infos: %d\n", opt.display_infos); fprintf (fs, "# Gamma setting.\n"); fprintf (fs, "heroes.screen.gamma: %d\n", opt.luminance); fprintf (fs, "# Whether the camera moves with inertia.\n"); fprintf (fs, "heroes.screen.inertia: %d\n", opt.inertia); fprintf (fs, "# Whether music is enabled.\n"); fprintf (fs, "heroes.sound.music_enable: %d\n", opt.music); fprintf (fs, "# Music volume.\n"); fprintf (fs, "heroes.sound.music_volume: %d\n", opt.music_volume); fprintf (fs, "# Whether sound effects are enabled.\n"); fprintf (fs, "heroes.sound.sfx_enable: %d\n", opt.sfx); fprintf (fs, "# Sound effects volume.\n"); fprintf (fs, "heroes.sound.sfx_volume: %d\n", opt.sfx_volume); fprintf (fs, "# Control type for player one (0=key, 1=joy).\n"); fprintf (fs, "heroes.control.player1: %d\n", opt.ctrl_one); fprintf (fs, "# Whether player one wants autopilot.\n"); fprintf (fs, "heroes.control.autopilot1: %d\n", opt.autopilot_one); fprintf (fs, "# Control type for player two (0=key, 1=joy).\n"); fprintf (fs, "heroes.control.player2: %d\n", opt.ctrl_two); fprintf (fs, "# Whether player two wants autopilot.\n"); fprintf (fs, "heroes.control.autopilot2: %d\n", opt.autopilot_two); fprintf (fs, "# Speed of the game.\n"); fprintf (fs, "heroes.game.speed: %d\n", opt.speed); fprintf (fs, "# Index of the number of rounds (not the number itself).\n"); fprintf (fs, "heroes.game.gamerounds: %d\n", opt.gamerounds); fprintf (fs, "# Color for players.\n"); fprintf (fs, "heroes.game.player_colors: %d %d %d %d\n", opt.player_color[0], opt.player_color[1], opt.player_color[2], opt.player_color[3]); fprintf (fs, "# How extras levels are included.\n"); fprintf (fs, "heroes.extras.mode: %d\n", opt.extras); fprintf (fs, "# Keycodes for player one.\n"); fprintf (fs, "heroes.%s.player1_keys: %d %d %d %d %d %d\n", keys_pref_group (), opt.player_keys[0][0], opt.player_keys[0][1], opt.player_keys[0][2], opt.player_keys[0][3], opt.player_keys[0][4], opt.player_keys[0][5]); fprintf (fs, "# Keycodes for player two.\n"); fprintf (fs, "heroes.%s.player2_keys: %d %d %d %d %d %d\n", keys_pref_group (), opt.player_keys[1][0], opt.player_keys[1][1], opt.player_keys[1][2], opt.player_keys[1][3], opt.player_keys[1][4], opt.player_keys[1][5]); if (ignored_lines) fprintf (fs, "# Currently ignored preferences.\n%s", ignored_lines); } bool save_preferences (void) { FILE* fs; dmsg (D_MISC, "save preferences to %s", preferences_file ()); fs = fopen (preferences_file (), "wt"); if (fs == 0) { wmsg ("cannot save preferences to %s", preferences_file ()); dperror ("fopen"); return true; } output_preferences (fs); fclose (fs); return false; } static unsigned long int parse_unsigned (char *token, unsigned long int min, unsigned long int max) { unsigned long int val = strtoul (token, 0, 10); if (val < min || val > max) { wmsg ("%s:%d: value %s is out of range (%lu-%lu)", preferences_file (), firstline, token, min, max); val = (val < min) ? min : max; } return val; } static bool parse_bool (char *token, bool min, bool max) { while (*token && ISSPACE(*token)) ++token; if (ISDIGIT (*token)) return parse_unsigned (token, min, max); /* FIXME: handle min and max. */ if (!strcasecmp (token, "true")) { return true; } else if (!strcasecmp (token, "false")) { return false; } else { emsg ("%s:%d: %s should be either false or true", preferences_file (), firstline, token); return false; /* Never reached. */ } } static void append_ignored (const char* ign) { if (ignored_lines) ignored_lines = strappend (ignored_lines, ign); else ignored_lines = strdup (ign); } bool load_preferences (void) { FILE* fs; int endline = 0; char* buf = 0; size_t bufsize = 0; firstline = 0; reinit_preferences (); dmsg (D_FILE, "reading option from %s", preferences_file ()); fs = fopen (preferences_file (), "rb"); if (fs == NULL) { /* Don't warn, the file doesn't exists the first time. */ dmsg (D_FILE, "cannot open preferences file %s", preferences_file ()); dperror ("fopen"); return true; } XFREE0 (ignored_lines); while (getshline_numbered (&firstline, &endline, &buf, &bufsize, fs) != -1) { char* token; char* line = xstrdup (buf); token = strtok (buf, " \t.:"); if (!strcasecmp ("heroes", token)) { token = strtok (0, " \t.:"); if (!strcasecmp ("screen", token)) { token = strtok (0, " \t.:"); if (!strcasecmp ("display_radar", token)) { token = strtok (0, "\n"); opt.radar_map = parse_bool (token, false, true); } else if (!strcasecmp ("display_infos", token)) { token = strtok (0, "\n"); opt.display_infos = parse_bool (token, false, true); } else if (!strcasecmp ("gamma", token)) { token = strtok (0, "\n"); opt.luminance = parse_unsigned (token, 0, 12); } else if (!strcasecmp ("inertia", token)) { token = strtok (0, "\n"); opt.inertia = parse_bool (token, false, true); } else { append_ignored (line); } } else if (!strcasecmp ("sound", token)) { token = strtok (0, " \t.:"); if (!strcasecmp ("music_enable", token)) { token = strtok (0, "\n"); opt.music = parse_bool (token, false, true); } else if (!strcasecmp ("music_volume", token)) { token = strtok (0, "\n"); opt.music_volume = parse_unsigned (token, 0, 12); } else if (!strcasecmp ("sfx_enable", token)) { token = strtok (0, "\n"); opt.sfx = parse_bool (token, false, true); } else if (!strcasecmp ("sfx_volume", token)) { token = strtok (0, "\n"); opt.sfx_volume = parse_unsigned (token, 0, 12); } else { append_ignored (line); } } else if (!strcasecmp ("control", token)) { token = strtok (0, " \t.:"); if (!strcasecmp ("player1", token)) { token = strtok (0, "\n"); opt.ctrl_one = parse_unsigned (token, 0, 1); } else if (!strcasecmp ("autopilot1", token)) { token = strtok (0, "\n"); opt.autopilot_one = parse_bool (token, false, true); } else if (!strcasecmp ("player2", token)) { token = strtok (0, "\n"); opt.ctrl_two = parse_unsigned (token, 0, 1); } else if (!strcasecmp ("autopilot2", token)) { token = strtok (0, "\n"); opt.autopilot_two = parse_bool (token, false, true); } else { append_ignored (line); } } else if (!strcasecmp ("game", token)) { token = strtok (0, " \t.:"); if (!strcasecmp ("speed", token)) { token = strtok (0, "\n"); opt.speed = parse_unsigned (token, 0, 2); } else if (!strcasecmp ("gamerounds", token)) { token = strtok (0, "\n"); opt.gamerounds = parse_unsigned (token, 0, 15); } else if (!strcasecmp ("player_colors", token)) { token = strtok (0, " \t"); opt.player_color[0] = parse_unsigned (token, 0, 4); token = strtok (0, " \t"); opt.player_color[1] = parse_unsigned (token, 0, 4); token = strtok (0, " \t"); opt.player_color[2] = parse_unsigned (token, 0, 4); token = strtok (0, " \t"); opt.player_color[3] = parse_unsigned (token, 0, 4); } else { append_ignored (line); } } else if (!strcasecmp ("extras", token)) { token = strtok (0, " \t.:"); if (!strcasecmp ("mode", token)) { token = strtok (0, "\n"); opt.extras = parse_unsigned (token, 0, 2); } else { append_ignored (line); } } else if (!strcasecmp (keys_pref_group (), token)) { token = strtok (0, " \t.:"); if (!strcasecmp ("player1_keys", token)) { token = strtok (0, " \t"); opt.player_keys[0][0] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[0][1] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[0][2] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[0][3] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[0][4] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[0][5] = parse_unsigned (token, 0, HKEYCODE_MAX); } else if (!strcasecmp ("player2_keys", token)) { token = strtok (0, " \t"); opt.player_keys[1][0] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[1][1] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[1][2] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[1][3] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[1][4] = parse_unsigned (token, 0, HKEYCODE_MAX); token = strtok (0, " \t"); opt.player_keys[1][5] = parse_unsigned (token, 0, HKEYCODE_MAX); } else { append_ignored (line); } } else { append_ignored (line); } } else { append_ignored (line); } free (line); } free (buf); fclose (fs); return false; } heroes-0.21/src/prefs.def0000644004117000411500000001355507351601604011001 autogen definitions prefs; /*------------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes 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. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /* ** This file describes the preference settings of Heroes. It is used ** to generate the preferences saving and loading code. ** ** Externally, the preferences are saved as text lines of the form: ** name: value ** and can be arranged into groups (and subgroups, to any depth): ** heroes.screen.gamma: 10 ** ** Internally, the preferences are stored in a flat structure ** called opt. So for the user preferences seems to be organized as ** a tree but it's not actually the case in the code. ** ** Group attributes: ** ----------------- ** name: name of the group ** verbatim: any verbatim declaration ** ** Pref attributes: ** ---------------- ** name: name of the preference ** attrib: name of the corresponding attribute in the struct ** array: size of the array, if this is an array ** nodec: don't declare the attribute in the struct (because ** it has been declared with `verbatim', for instance) ** type: the C type for the attribute (types `bool', `a_u8', ** `a_u16', `a_u32', are recognized for max and min) ** default: default value(s) for attrib ** max: maximum value for attribute (the default depends on `type') ** min: minimum value for attribute (the default depends on `type') ** doc: documentation for this preference */ group = { name = heroes; group = { name = screen; pref = { name = display_radar; attrib = radar_map; type = bool; default = true; doc = "Whether the radar must be drawn."; }; pref = { name = display_infos; attrib = display_infos; type = bool; default = true; doc = "Whether game counters must be drawn."; }; pref = { name = gamma; attrib = luminance; /* FIXME: rename to gamma. */ type = a_u8; max = 12; default = 6; doc = "Gamma setting."; }; pref = { name = inertia; attrib = inertia; type = bool; default = true; doc = "Whether the camera moves with inertia."; }; }; /* screen */ group = { name = sound; pref = { name = music_enable; attrib = music; type = bool; default = true; doc = "Whether music is enabled."; }; pref = { name = music_volume; attrib = music_volume; type = a_u8; max = 12; default = 6; doc = "Music volume."; }; pref = { name = sfx_enable; attrib = sfx; type = bool; default = true; doc = "Whether sound effects are enabled."; }; pref = { name = sfx_volume; attrib = sfx_volume; type = a_u8; max = 12; default = 6; doc = "Sound effects volume."; }; }; /* sound */ group = { name = control; pref = { name = player1; attrib = ctrl_one; type = a_u8; default = 0; max = 1; doc = "Control type for player one (0=key, 1=joy)."; }; pref = { name = autopilot1; attrib = autopilot_one; type = bool; default = true; doc = "Whether player one wants autopilot."; }; pref = { name = player2; attrib = ctrl_two; type = a_u8; default = 0; max = 1; doc = "Control type for player two (0=key, 1=joy)."; }; pref = { name = autopilot2; attrib = autopilot_two; type = bool; default = true; doc = "Whether player two wants autopilot."; }; }; /* control */ group = { name = game; pref = { name = speed; attrib = speed; type = a_u8; default = 0; max = 2; doc = "Speed of the game."; }; pref = { name = gamerounds; attrib = gamerounds; type = a_u8; default = 4; max = 15; doc = "Index of the number of rounds (not the number" " itself)."; }; pref = { name = player_colors; attrib = "player_color"; array = 4; type = a_u8; default = 0, 1, 2, 3; max = 4; doc = "Color for players."; }; }; /* game */ group = { name = extras; pref = { name = mode; attrib = extras; type = a_u8; default = 0; max = 2; doc = "How extras levels are included."; }; }; /* extras */ group = { name = 'keys_pref_group ()'; nameraw; verbatim = "a_keycode player_keys[2][6];"; pref = { name = player1_keys; attrib = "player_keys[0]"; array = 6; nodec; type = a_keycode; default = HK_Up, HK_Left, HK_Down, HK_Right, HK_CtrlR, HK_ShiftR; doc = "Keycodes for player one."; }; pref = { name = player2_keys; attrib = "player_keys[1]"; array = 6; nodec; type = a_keycode; default = HK_E, HK_S, HK_D, HK_F, HK_CtrlL, HK_ShiftL; doc = "Keycodes for player two."; }; }; /* ggi | sdl */ }; /* heroes */ heroes-0.21/src/prefs.h0000444004117000411500000000522407451357131010466 /* -*- buffer-read-only: t -*- vi: set ro: ** ** DO NOT EDIT THIS FILE (prefs.h) ** ** It has been AutoGen-ed Saturday March 30, 2002 at 04:48:41 PM CET ** From the definitions prefs.def ** and the template file prefs */ /* ** Heroes is free software. ** ** You may 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. ** ** Heroes 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 Heroes. See the file "COPYING". If not, ** write to: The Free Software Foundation, Inc., ** 59 Temple Place - Suite 330, ** Boston, MA 02111-1307, USA. */ #ifndef HEROES__PREFS__H #define HEROES__PREFS__H typedef struct { /* Whether the radar must be drawn. */ bool radar_map; /* Whether game counters must be drawn. */ bool display_infos; /* Gamma setting. */ a_u8 luminance; /* Whether the camera moves with inertia. */ bool inertia; /* Whether music is enabled. */ bool music; /* Music volume. */ a_u8 music_volume; /* Whether sound effects are enabled. */ bool sfx; /* Sound effects volume. */ a_u8 sfx_volume; /* Control type for player one (0=key, 1=joy). */ a_u8 ctrl_one; /* Whether player one wants autopilot. */ bool autopilot_one; /* Control type for player two (0=key, 1=joy). */ a_u8 ctrl_two; /* Whether player two wants autopilot. */ bool autopilot_two; /* Speed of the game. */ a_u8 speed; /* Index of the number of rounds (not the number itself). */ a_u8 gamerounds; /* Color for players. */ a_u8 player_color[4]; /* How extras levels are included. */ a_u8 extras; a_keycode player_keys[2][6]; /* Keycodes for player one. */ /* a_keycode player_keys[0][6]; */ /* Keycodes for player two. */ /* a_keycode player_keys[1][6]; */ } a_pref_set; extern a_pref_set opt; void reinit_preferences (void); void free_preferences (void); void output_preferences (FILE* fs); bool save_preferences (void); bool load_preferences (void); #endif /* HEROES__PREFS__H */ heroes-0.21/src/prefs.tpl0000644004117000411500000002341707351601604011040 [~ autogen5 template h c # Copyright 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes 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. # # Heroes 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 ~] [~ (dne "** " "/*\t\t\t\t") ~] */ [~ (begin (define (sget name) (and (exist? name) (get name))) (define (c-doc) (let ((doc (sget ".doc"))) (if doc (sprintf " /* %s */\n" doc) ""))) (define (sh-doc) (let ((doc (sget ".doc"))) (if doc (sprintf "# %s" doc) ""))) (define (c-attrib) (let* ((type (sget ".type")) (array (sget ".array")) (decl (if type (sprintf "%-20s %s%s" type (get ".attrib") (if array (sprintf "[%s]" array) "")) ""))) (sprintf (if (sget ".nodec") "/* %s; */" "%s;") decl))) (define (display-all . L) ; FIXME debug macro (for-each display L)) (define (print-init-attrib attr val) (sprintf " opt.%s = %s;\n" attr val)) (define (init-attrib) (let ((attr (sget ".attrib")) (array (sget ".array"))) (if array (let ((p (lambda (idx val) (print-init-attrib (sprintf "%s[%d]" attr idx) val)))) (apply string-append (map p (iota (string->number array)) (stack "default")))) (print-init-attrib attr (sget ".default"))))) (define *pref-name* '()) (define (dot-join ls) (let ((a (caar ls)) (d (cdr ls))) (if (null? d) a (string-append a "." (dot-join d))))) (define (e-join ls) (let ((a (cdar ls)) (d (cdr ls))) (if (null? d) a (string-append a (e-join d))))) (define (pref-name) (dot-join (reverse *pref-name*))) (define (pref-args) (e-join (reverse *pref-name*))) (define (pref-name-push) (set! *pref-name* (cons (if (exist? ".nameraw") (cons "%s" (string-append ", " (get "name"))) (cons (get "name") "")) *pref-name*))) (define (pref-name-pop) (set! *pref-name* (cdr *pref-name*))) (define (repeat n x) (if (zero? n) '() (cons x (repeat (1- n) x)))) (define (save-pref) (let ((attr (sget ".attrib")) (array (sget ".array"))) (string-append " fprintf (fs, \"" (pref-name) ":" (if array (let ((a (string->number array)) (p (lambda (idx) (sprintf ",\n\t opt.%s[%d]" attr idx)))) (string-append (apply string-append (repeat a " %d")) "\\n\"" (pref-args) (apply string-append (map p (iota a))) ");\n")) (sprintf " %%d\\n\"%s, opt.%s);\n" (pref-args) attr))))) (define *get-pref-token* #f) (define (get-pref-token) (string-append "token = strtok (" (if *get-pref-token* "0" (begin (set! *get-pref-token* #t) "buf")) ", \" \\t.:\");")) (define *types* '("a_u8" "parse_unsigned" "0" "255" "a_u16" "parse_unsigned" "0" "UINT16_MAX" "a_u32" "parse_unsigned" "0" "UINT32_MAX" "a_keycode" "parse_unsigned" "0" "HKEYCODE_MAX" "bool" "parse_bool" "false" "true")) (define (parse-pref) (let* ((type (sget ".type")) (array (sget ".array")) (type-info (or (member type *types*) (error (string-append "Unknow type " type " for preference " (sget "name"))))) (func (cadr type-info)) (min (or (sget "min") (caddr type-info))) (max (or (sget "max") (cadddr type-info))) (att (get "attrib"))) (if array (let ((p (lambda (idx) (parse-pref-array att (number->string idx) func min max)))) (apply string-append (map p (iota (string->number array))))) (parse-pref-single att func min max)))) (define (parse-pref-single att func min max) (string-append " token = strtok (0, \"\\n\");\n" " opt." att " = " func " (token, " min ", " max ");\n")) (define (parse-pref-array att idx func min max) (string-append " token = strtok (0, \" \\t\");\n" " opt." att "[" idx "] = " func " (token, " min ", " max ");\n")) ) ~] /* [~ (gpl "Heroes" "** ") ~] */ [~ DEFINE CREATE_STRUCT ~][~ FOR .verbatim ~] [~ (get ".verbatim") ~] [~ ENDFOR .verbatim ~][~ FOR .pref ~][~ (sprintf "\n%s %s\n" (c-doc) (c-attrib)) ~][~ ENDFOR .pref ~][~ FOR .group ~][~ CREATE_STRUCT ~][~ ENDFOR .group ~][~ ENDDEF CREATE_STRUCT ~][~ DEFINE REINIT_PREFS ~][~ FOR .pref ~][~ (init-attrib) ~][~ ENDFOR .pref ~][~ FOR .group ~][~ REINIT_PREFS ~][~ ENDFOR .group ~][~ ENDDEF REINIT_PREFS ~][~ DEFINE SAVE_PREFS ~][~ FOR .pref ~][~ (pref-name-push) ~] fprintf (fs, "[~ (sh-doc) ~]\n"); [~ (save-pref) ~][~ (pref-name-pop) ~][~ ENDFOR .pref ~][~ FOR .group ~][~ (pref-name-push) ~][~ SAVE_PREFS ~][~ (pref-name-pop) ~][~ ENDFOR .group ~][~ ENDDEF SAVE_PREFS ~][~ DEFINE LOAD_PREFS ~] [~ (get-pref-token) ~][~ FOR .group ~] if (!strcasecmp ([~ IF (exist? ".nameraw") ~][~ ELSE ~]"[~ ENDIF ~][~ (get ".name") ~][~ IF (exist? ".nameraw") ~][~ ELSE ~]"[~ ENDIF ~], token)) {[~ LOAD_PREFS ~] } else [~ ENDFOR .group ~][~ IF (exist? ".pref") ~][~ FOR .pref ~] if (!strcasecmp ("[~ (get ".name") ~]", token)) { [~ (parse-pref) ~] } else [~ ENDFOR .pref ~][~ ENDIF ~]{ append_ignored (line); }[~ ENDDEF LOAD_PREFS ~] [~ CASE (suffix) ~][~ == h ~][~ (define (multinc) (sprintf "HEROES__%s__H" (string-upcase! (base-name)))) ~] #ifndef [~ (multinc) ~] #define [~ (multinc) ~] typedef struct { [~ CREATE_STRUCT ~] } a_pref_set; extern a_pref_set opt; void reinit_preferences (void); void free_preferences (void); void output_preferences (FILE* fs); bool save_preferences (void); bool load_preferences (void); #endif /* [~ (multinc) ~] */ [~ == c ~] #include "system.h" #include "prefs.h" #include "debugmsg.h" #include "rsc_files.h" #include "getshline.h" #include "keyvalues.h" #include "errors.h" #include "misc.h" a_pref_set opt; static char* ignored_lines = 0; static int firstline; static char* name = 0; static char* preferences_file (void) { if (!name) name = get_non_null_rsc_file ("pref-file"); return name; } void reinit_preferences (void) { [~ REINIT_PREFS ~]} void free_preferences (void) { dmsg (D_MISC, "free preferences"); XFREE0 (name); XFREE0 (ignored_lines); } void output_preferences (FILE* fs) { [~ SAVE_PREFS ~] if (ignored_lines) fprintf (fs, "# Currently ignored preferences.\n%s", ignored_lines); } bool save_preferences (void) { FILE* fs; dmsg (D_MISC, "save preferences to %s", preferences_file ()); fs = fopen (preferences_file (), "wt"); if (fs == 0) { wmsg ("cannot save preferences to %s", preferences_file ()); dperror ("fopen"); return true; } output_preferences (fs); fclose (fs); return false; } static unsigned long int parse_unsigned (char *token, unsigned long int min, unsigned long int max) { unsigned long int val = strtoul (token, 0, 10); if (val < min || val > max) { wmsg ("%s:%d: value %s is out of range (%lu-%lu)", preferences_file (), firstline, token, min, max); val = (val < min) ? min : max; } return val; } static bool parse_bool (char *token, bool min, bool max) { while (*token && ISSPACE(*token)) ++token; if (ISDIGIT (*token)) return parse_unsigned (token, min, max); /* FIXME: handle min and max. */ if (!strcasecmp (token, "true")) { return true; } else if (!strcasecmp (token, "false")) { return false; } else { emsg ("%s:%d: %s should be either false or true", preferences_file (), firstline, token); return false; /* Never reached. */ } } static void append_ignored (const char* ign) { if (ignored_lines) ignored_lines = strappend (ignored_lines, ign); else ignored_lines = strdup (ign); } bool load_preferences (void) { FILE* fs; int endline = 0; char* buf = 0; size_t bufsize = 0; firstline = 0; reinit_preferences (); dmsg (D_FILE, "reading option from %s", preferences_file ()); fs = fopen (preferences_file (), "rb"); if (fs == NULL) { /* Don't warn, the file doesn't exists the first time. */ dmsg (D_FILE, "cannot open preferences file %s", preferences_file ()); dperror ("fopen"); return true; } XFREE0 (ignored_lines); while (getshline_numbered (&firstline, &endline, &buf, &bufsize, fs) != -1) { char* token; char* line = xstrdup (buf); [~ LOAD_PREFS ~] free (line); } free (buf); fclose (fs); return false; } [~ ESAC ~] heroes-0.21/src/readmake.c0000644004117000411500000002741007421623503011112 /*------------------------------------------------------------------------. | Copyright 2000, 2001, 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "readmake.h" #include "parafmt.h" #include "fontdata.h" #include "const.h" #include "sprtext.h" #include "sprprog.h" #include "sprrle.h" #include "sprglenz.h" #include "sprglauto.h" #include "pcx.h" #include "errors.h" struct private_read_data_s { a_sprite *sprite; int line; a_private_read_data *next; }; static a_read_data * insert_read_data (a_read_data *rd, a_sprite *spr, int line, bool bg) { a_private_read_data *p, *o, **q; NEW (a_private_read_data, res); if (!rd) { NEW (a_read_data, rhd); rhd->data_bg = 0; rhd->data = 0; rhd->max = 0; rd = rhd; } if (rd->max < line) rd->max = line; res->sprite = spr; res->line = line; if (bg) q = &rd->data_bg; else q = &rd->data; p = *q; if (!p || p->line >= line) { res->next = p; *q = res; return rd; } do { o = p; p = p->next; } while (p && p->line < line); o->next = res; res->next = p; return rd; } /* return the head of a string, cut on character ' ' (or '\0' or '}') and advance the input pointer to the character after that delimiter (unless '\0' is encountered in which case *STR is set to 0). */ static char * readtok (char **src) { int size; char *_src = *src; for (size = 0; _src[size] && _src[size] != ' ' && _src[size] != '}'; ++size) /* NOP */; if (_src[size]) { _src[size] = 0; *src = _src + size + 1; } else *src = 0; ++size; return _src; } /* default margins */ #define DEF_LM 5 #define DEF_RM 315 typedef struct a_margin_list_item a_margin_list_item; struct a_margin_list_item { int lm; /* left margin */ int rm; /* right margin */ a_margin_list_item *next; /* pointer to next item in list */ }; typedef struct a_margin_list a_margin_list; struct a_margin_list { int glm; /* global left margin */ int lines; /* Number of lines we track margins for */ a_margin_list_item *first, *last; /* pointers to first and last list item */ }; /* Inititalize margin list and default item. */ static void init_margins (a_margin_list *margins) { XMALLOC_VAR (margins->first); margins->last = margins->first; margins->first->next = 0; margins->first->lm = DEF_LM; margins->first->rm = DEF_RM; margins->lines = 1; } /* add (lm, rm) to the list of line margins. */ static a_margin_list_item* add_margin (a_margin_list *margins, int lm, int rm) { XMALLOC_VAR (margins->last->next); margins->last = margins->last->next; margins->last->next = 0; margins->last->lm = lm; margins->last->rm = rm; margins->lines++; return margins->last; } /* Remove margin list from memory. */ static void free_margins (a_margin_list *margins) { while (margins->first) { margins->last = margins->first; margins->first = margins->first->next; free (margins->last); } margins->first = margins->last = 0; margins->lines = 0; } /* Set wid with the computed width of each line in margins. */ static void compute_widths (a_margin_list *margins, a_width *wid) { a_margin_list_item *m; a_width *w; if (!margins->first) init_margins (margins); m = margins->first; w = wid; while (m) { *w++ = m->rm - m->lm - margins->glm; m = m->next; } *w = 0; /* end of array marker */ } static void /* progress one line */ shift_margins (a_margin_list *margins) { a_margin_list_item *m = margins->first; margins->first = margins->first->next; free (m); margins->lines--; /* The while loops in compile_reader_data needs this for their abort conditions. */ if (!margins->first) init_margins (margins); } static void flag_error (int flag, const char *cmd) { emsg (_("Unknown option '%c' for command '%s'."), flag, cmd); } a_read_data * compile_reader_data (a_read_data *head, const char *str) { a_margin_list margins; a_width *wid = 0; /* array of linewidths (= rm - lm) */ char *curstr; char *curstr_allocated; int voffset = 0; a_pcx_image help_pics_img; pcx_load_from_rsc ("help-pictures-img", &help_pics_img); init_margins (&margins); while (*str) { const char *start; enum text_option topt = T_JUSTIFIED; margins.glm = 0; /* get a line */ start = str; while (*str && *str != '\n') ++str; if (*str) { ++str; curstr = CCLONE (start, str - start); curstr[str - start - 1] = 0; } else curstr = xstrdup (start); curstr_allocated = curstr; /* scan for initial markup */ while (curstr[0] == '%' && curstr[1] == '{') { char *cmd; curstr += 2; cmd = readtok (&curstr); if (!strcmp (cmd, "img")) { char *flags = readtok (&curstr); int y = atoi (readtok (&curstr)); int x = atoi (readtok (&curstr)); int h = atoi (readtok (&curstr)); int w = atoi (readtok (&curstr)); int cl = 0; bool bg = false; bool gl = false; bool redgl = false; int offset = 0; a_margin_list_item *m; int i; for (; *flags; ++flags) { switch (*flags) { case 'B': bg = true; break; case 'G': gl = true; break; case 'r' : redgl = true; break; case 'C': /* centered */ m = margins.first; offset = margins.glm + m->lm + (m->rm-margins.glm-m->lm-w) / 2; break; case 'R': /* right */ offset = margins.first->rm - w; m = margins.first; if (!bg) for (i = h; i > 0; i -= 10) { m->rm = offset; if (!(m = m->next)) m = add_margin (&margins, DEF_LM, DEF_RM); } break; case 'L': /* left */ offset = margins.glm + margins.first->lm; m = margins.first; if (!bg) for (i = h; i > 0; i -= 10) { m->lm = offset - margins.glm + w; if (!(m = m->next)) m = add_margin (&margins, DEF_LM, DEF_RM); } break; case 'V': offset -= (h - 10) / 2 * xbuf; break; default: flag_error (*flags, "image"); } } while (h>0) { /* split the sprite in strip of 10 pixels heights */ a_sprite *s; if (redgl) { s = compile_sprglenz (IMGPOS (help_pics_img, y, x), 0, glenz[6], 10, w, help_pics_img.width, xbuf); } else { s = (gl ? compile_sprglauto : compile_sprrle) (IMGPOS (help_pics_img, y, x), 0, 10, w, help_pics_img.width, xbuf); } head = insert_read_data (head, s, offset + voffset + xbuf * cl * 10, bg); h -= 10; y += 10; ++cl; } /* FIXME: handle glenz images */ } else if (!strcmp (cmd, "flushleft")) { topt = T_FLUSHED_LEFT; } else if (!strcmp (cmd, "flushright")) { topt = T_FLUSHED_RIGHT; } else if (!strcmp (cmd, "center")) { topt = T_CENTERED; } else if (!strcmp (cmd, "head")) { int color = atoi (readtok (&curstr)); head = insert_read_data (head, compile_sprtext_color (help_font, curstr, T_FLUSHED_LEFT | T_WAVING, 0, 25), voffset, false); head = insert_read_data (head, compile_sprrle (IMGPOS (help_pics_img, 69 + color * 12, 0), 0, 10, 12, help_pics_img.width, xbuf), voffset + 5, true); head = insert_read_data (head, compile_sprglenz (IMGPOS (help_pics_img, 81, 12), 0, glenz[((color - 1) ^ 1) + 2], 10, 310 - 12, help_pics_img.width, xbuf), voffset + 5 + 12, true); voffset += xbuf * (help_font->line_skip + help_font->height); goto next_line; } else if (!strcmp (cmd, "textat")) { char *flags = readtok (&curstr); int y = atoi (readtok (&curstr)); int x = atoi (readtok (&curstr)); int pos = voffset + y * xbuf; int align = 0; for (; *flags; ++flags) { switch (*flags) { case 'L': /* y,x is the bottom left of text */ align |= T_FLUSHED_LEFT; break; case 'R': /* y,x is the bottom right of text */ align |= T_FLUSHED_RIGHT; break; case 'C': /* y,x is the center of the text */ align |= T_CENTERED; break; case 'W': /* waving text */ align |= T_WAVING; break; case 'c': /* x is relative to the middle of the screen */ pos += 320 / 2; break; default: flag_error (*flags, "textat"); } } head = insert_read_data (head, compile_sprtext_color (help_font, curstr, align, 0, x), pos, false); goto next_line; } else { if (cmd[0] == '>') { margins.glm += 5 * strlen (cmd); } } } /* no text to format? */ if (!*curstr) { do { voffset += xbuf * (help_font->line_skip + help_font->height); shift_margins (&margins); } while (margins.first->lm != DEF_LM || margins.first->rm != DEF_RM); goto next_line; } /* format the paragraph */ XMALLOC_ARRAY (wid, margins.lines + 1); compute_widths (&margins, wid); { char **p = parafmt_var (curstr, help_font->width, wid, help_font->min_space_width); char **l = p; while (*l) { int offset; compute_widths (&margins, wid); if (!l[1] && (topt & T_JUSTIFIED) == T_JUSTIFIED) topt = T_FLUSHED_LEFT; switch (topt) { case T_FLUSHED_LEFT: case T_JUSTIFIED: offset = margins.glm + margins.first->lm; break; case T_FLUSHED_RIGHT: offset = margins.first->rm; break; case T_CENTERED: offset = margins.glm + margins.first->lm + (margins.first->rm - margins.glm - margins.first->lm) / 2; break; default: assert (0); } head = insert_read_data (head, compile_sprtext_color (help_font, *l, topt, *wid, offset), voffset, false); voffset += xbuf * (help_font->line_skip + help_font->height); ++l; shift_margins (&margins); } free (wid); free_pararray (p); while (margins.first->lm != DEF_LM || margins.first->rm != DEF_RM) { voffset += xbuf * (help_font->line_skip + help_font->height); shift_margins (&margins); } } next_line: free (curstr_allocated); } free_margins (&margins); img_free (&help_pics_img); return head; } void free_reader_data (a_read_data *rd) { a_private_read_data *p = rd->data; while (p) { a_private_read_data *n = p->next; free_sprite (p->sprite); free (p); p = n; } p = rd->data_bg; while (p) { a_private_read_data *n = p->next; free_sprite (p->sprite); free (p); p = n; } free (rd); } void draw_reader_data (const a_read_data *rd, a_pixel *dest, int min, int max) { const a_private_read_data *p; min *= xbuf; max *= xbuf; /* draw the background */ p = rd->data_bg; while (p && p->line < min) p = p->next; while (p && p->line <= max) { DRAW_SPRITE (p->sprite, dest + p->line - min); p = p->next; } /* draw the foreground */ p = rd->data; while (p && p->line < min) p = p->next; while (p && p->line <= max) { DRAW_SPRITE (p->sprite, dest + p->line - min); p = p->next; } } heroes-0.21/src/readmake.h0000644004117000411500000000414407352614753011130 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__READMAKE__H #define HEROES__READMAKE__H #include "sprite.h" typedef struct private_read_data_s a_private_read_data; typedef struct read_data_s a_read_data; struct read_data_s { a_private_read_data *data; a_private_read_data *data_bg; int max; }; /* Prepare STR for the reader rendering function, and a append it to the already cooked data in HEAD. If HEAD is NULL, a new structure is allocated. */ a_read_data *compile_reader_data (a_read_data *head, const char *str); /* Free any data allocated by compile_reader_data for RD. */ void free_reader_data (a_read_data *rd); /* draw RD form line MIN to line MAX on DEST on DEST. */ void draw_reader_data (const a_read_data *rd, a_pixel *dest, int min, int max); #endif /* HEROES__READMAKE__H */ heroes-0.21/src/relocate.c0000644004117000411500000001375507353601453011152 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "relocate.h" #include "debugmsg.h" #include "errors.h" #include "isdir.h" #include "rsc_files.h" #include "dirname.h" #include "misc.h" static void check_localedir_env (void) { char* locale_dir; dmsg (D_SYSTEM, "looking for HEROES_LOCALE_DIR or HEROES_LOCALEDIR..."); if ((locale_dir = getenv ("HEROES_LOCALE_DIR")) || (locale_dir = getenv ("HEROES_LOCALEDIR"))) { dmsg (D_SYSTEM,"... found: %s", locale_dir); set_rsc_file ("locale-dir", locale_dir, false); } else { dmsg (D_SYSTEM, "... not found."); } } static void check_datadir_env (void) { char* data_dir; dmsg (D_SYSTEM, "looking for HEROES_DATA_DIR or HEROES_DATADIR..."); if ((data_dir = getenv ("HEROES_DATA_DIR")) || (data_dir = getenv ("HEROES_DATADIR"))) { dmsg (D_SYSTEM,"... found: %s", data_dir); set_rsc_file ("data-dir", data_dir, false); } else { dmsg (D_SYSTEM, "... not found."); } } static void check_homedir_env (void) { char* home_dir; dmsg (D_SYSTEM, "looking for HEROES_HOME_DIR, HEROES_HOMEDIR or HOME..."); if ((home_dir = getenv ("HEROES_HOME_DIR")) || (home_dir = getenv ("HEROES_HOMEDIR")) || (home_dir = getenv ("HOME"))) { dmsg (D_SYSTEM,"... found: %s", home_dir); set_rsc_file ("home-dir", home_dir, false); } else { dmsg (D_SYSTEM, "... not found."); wmsg (_("HOME variable not found in environment, defaulting to `.'")); set_rsc_file ("home-dir", ".", false); } } static bool check_prefix_env (void) { char* prefix; dmsg (D_SYSTEM, "looking for HEROES_PREFIX ..."); if ((prefix = getenv ("HEROES_PREFIX"))) { dmsg (D_SYSTEM,"... found: %s", prefix); set_rsc_file ("prefix", prefix, false); return true; } else { dmsg (D_SYSTEM, "... not found."); return false; } } /* Check whether the installation looks correct. */ static bool check_installation (void) { char *dir = get_non_null_rsc_file ("levels-dir"); bool ok; strip_trailing_slashes (dir); ok = isdir (dir); dmsg (D_SYSTEM, ok ? "directory %s found": "%s absent or not a directory", dir); free (dir); return ok; } /* Compute prefix from argv0, if possible. */ static bool try_to_derive_argv0 (const char *argv0) { /* Compute PREFIX using argv0. */ char *path = dir_name (argv0); if (path) { path = strappend (path, "/" BACKWARD_RELATIVE_BINDIR); set_rsc_file ("prefix", path, false); dmsg (D_SYSTEM, "trying $(prefix)='%s'", path); } XFREE (path); return check_installation (); } static bool try_backward_relative_bindir (void) { /* BACKWARD_RELATIVE_BINDIR is in case the binary has been run from the current directory. */ dmsg (D_SYSTEM, "trying $(prefix)='%s'", BACKWARD_RELATIVE_BINDIR); set_rsc_file ("prefix", BACKWARD_RELATIVE_BINDIR, false); return check_installation (); } static bool try_to_explore_path (void) { char *path_env = getenv ("PATH"); char *path; char *last; bool curdir_is_ok = false; const char *pathsep; if (!path_env) return false; /* If a semicolon is present in the PATH, assume it is the PATH separator character, otherwise we'll use a colon. */ pathsep = strchr (path_env, ';') ? ";" : ":"; /* Duplicate the string because it will be destroyed by strtok. */ path = xstrdup (path_env); last = strtok (path, pathsep); while (last) { char *dir = strcat_alloc (last, "/" BACKWARD_RELATIVE_BINDIR); dmsg (D_SYSTEM, "trying $(prefix)='%s'", dir); set_rsc_file ("prefix", dir, false); free (dir); if (check_installation ()) { curdir_is_ok = true; break; } last = strtok (0, pathsep); } free (path); return curdir_is_ok; } bool relocate_data (const char *argv0) { /* Check whether the user has set some environment variables to override internal paths. */ check_datadir_env (); check_localedir_env (); check_homedir_env (); if (!check_prefix_env ()) { if (!check_installation ()) { /* IF the user has not set HEROES_PREFIX and Heroes can't find its files, try to guess the prefix. */ dmsg (D_SYSTEM, "default prefix looks wrong"); if (!try_to_derive_argv0 (argv0)) { if (!try_to_explore_path ()) { if (!try_backward_relative_bindir ()) emsg (_("\ It looks like the game is not correctly installed.\n\ Maybe the data files have not been installed with the same configure options\n\ as the executable, or maybe the data files have been moved elsewhere.\n\ In the latter case it's probably enough to set the environment variable\n\ HEROES_PREFIX to the new location. You may also want to set\n\ HEROES_DEBUG=system to see what files Heroes is looking after.\n\ If none of this helps, contact \n")); } } } } return false; } heroes-0.21/src/relocate.h0000644004117000411500000000277007352614753011160 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES_RELOCATE_H #define HEROES_RELOCATE_H /* Find Heroes's data and adapt all paths. Return true on error. */ bool relocate_data (const char *argv0); #endif /* HEROES_RELOCATE_H */ heroes-0.21/src/render.c0000644004117000411500000005675507423344702010641 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "video.h" #include "const.h" #include "prefs.h" #include "fastmem.h" #include "render.h" #include "argv.h" #include "timer.h" #include "heroes.h" #include "renderdata.h" #include "bonus.h" #include "explosions.h" #include "items.h" #include "sprglenz.h" #include "sprunish.h" #include "menus.h" #include "camera.h" char tutor = 0; static a_sprite *clock_anim; static bool invincible[4]; /* When a cell is true, the corresponding player is highlighted. This happens pariodically when the player is invincible (blinking). */ /* The copy_tile function below looks a bit strange. It tries to copy the tile using two registers. Some benchmarking shows this is a good compromise. Use misc/copytile.c if you want to make some experiments. */ static void copy_tile (const a_pixel* src, a_pixel* dest, int tx) { const a_u32 *s = (const a_u32 *) src; a_u32 *d = (a_u32 *) dest; a_u32 t1, t2; int y; for (y = 20; y; --y) { t1 = s[0]; t2 = s[3]; d[0] = t1; d[3] = t2; t1 = s[1]; t2 = s[4]; d[1] = t1; d[4] = t2; t1 = s[2]; t2 = s[5]; d[2] = t1; d[5] = t2; s = (const a_u32 *) (((const a_pixel *) s) + tx); d = (a_u32 *) (((a_pixel *) d) + xbuf); } } static void copy_square_transp (const a_pixel* src, a_pixel* dest, char d, char e) { int j, k; a_pixel c; for (j = 10 - e; j != 0; j--) { for (k = 12 - d; k != 0; k--) { c = *src++; if (c != 0) *dest = c; dest++; } src += 320 - 12 + d; dest += xbuf - 12 + d; } } static void draw_trail_real (int c, a_dir8_pair s, a_pixel* dest, unsigned char fixe) { const a_sprite *spr; int d = 0; if (fixe) { if (s & 1) d = player[c].d.h.l / 5462; else d = player[c].d.h.l / 6554; } spr = trails[s][d]; draw_sprglenz_custom (spr, dest, glenz[c + 2]); } static void draw_vehicle_tail (int c, a_pixel* dest) { int d; const a_pixel *posit = 0; int s = DIR8_PAIR(REVERSE_DIR(player[c].old_way), REVERSE_DIR(player[c].way)); const a_sprite *spr; if (player[c].way & 1) { d = player[c].d.h.l / 5462; spr = trails[s][12 - (d + 12) / 2]; } else { d = player[c].d.h.l / 6554; spr = trails[s][10 - (d + 10) / 2]; } draw_sprglenz_custom (spr, dest, glenz[c + 2]); posit = vehicles_img.buffer + (c << 6) + (player[c].way << 4); if (invincible[c]) posit += 10 * 320; switch (player[c].way) { case D_LEFT: copy_square_transp (posit + d, dest, (char) d, 0); break; case D_RIGHT: copy_square_transp (posit, dest + d, (char) d, 0); break; case D_UP: copy_square_transp (posit + d * 320, dest, 0, (char) d); break; case D_DOWN: copy_square_transp (posit, dest + d * xbuf, 0, (char) d); break; } } static void draw_vehicle_head (int c, a_pixel* dest) { int d; char b; const a_pixel* posit; if (player[c].spec == t_tunnel) b = player[c].tunnel_way; else b = player[c].way; posit = vehicles_img.buffer + (c << 6) + (b << 4); if (invincible[c]) posit += 10 * 320; if (b == w_left) { d = 12 - player[c].d.e / 5461; copy_square_transp (posit, dest + d, (char) d, 0); } if (b == w_right) { d = 12 - player[c].d.e / 5461; copy_square_transp (posit + d, dest, (char) d, 0); } if (b == w_up) { d = 10 - player[c].d.e / 6554; copy_square_transp (posit, dest + d * xbuf, 0, (char) d); } if (b == w_down) { d = 10 - player[c].d.e / 6554; copy_square_transp (posit + d * 320, dest, 0, (char) d); } } static void draw_trail (int c, a_pixel* dest, a_dir8_pair d) { draw_trail_real ((char) (c - 2), d, dest, 0); } static void draw_trail_tail (int c, a_pixel* dest) { char k; int tmp1; c -= 2; tmp1 = trail_offset[c] + trail_size[c] - 1; k = trail_way[c][tmp1 & (maxq - 1)]; if (trail_pos[c][tmp1 & (maxq - 1)] != trail_pos[c][(tmp1 - 1) & (maxq - 1)]) draw_trail_real ((char) c, k, dest, 1); else draw_trail_real ((char) c, k, dest, 0); } static void copy_lemming_transp (const a_pixel* src, a_pixel *dest) { int j, k; for (j = 8; j != 0; j--) { for (k = 8; k != 0; k--) { if (*src != 0) { if (*src == 1) *dest = glenz[0][*dest]; else *dest = *src; } src++; dest++; } src += 320 - 8; dest += xbuf - 8; } } static void draw_color (a_pixel* dest, int c) { if (c & 16) DRAW_SPRITE (clock_anim, dest - 2 * xbuf); else DRAW_SPRITE (pyramids[c & 7], dest); if (c & 8) { int j, k; const a_pixel* src = main_font_img.buffer + 81 * 320 + 40; dest -= 2 + xbuf; for (j = 7; j != 0; j--) { for (k = 12; k != 0; k--) { if (*src == 16) *dest = glenz[6][*dest]; src++; dest++; } src += 320 - 12; dest += xbuf - 12; } } } static void draw_lemming (a_pixel *dest, const a_lemming *lem, unsigned int pos) { const a_pixel *src; assert (lem >= lemmings_support && lem < lemmings_support + lemmings_total); if (pos == lem->pos_tail) { int c = lem->couleur; a_dir d = lem->dir; src = vehicles_img.buffer + 164 * 320; src += 64 * c; if (d & 1) src += 8 * 320; /* If lem->pos_tail == lem->pos_head the lemmings is stopped and therefore we don't want to animate it. */ if (pos != lem->pos_head) { src += lemmings_anim_offset; if (d == w_up) dest -= (lemmings_move_offset / 6553) * xbuf; if (d == w_right) dest += lemmings_move_offset / 5461; if (d == w_down) dest += (lemmings_move_offset / 6553) * xbuf; if (d == w_left) dest -= lemmings_move_offset / 5461; } copy_lemming_transp (src, dest); } else { assert (pos == lem->pos_head); } } static void copy_dead_lemming_transp (const a_pixel* src, a_pixel* dest, int couleur) { int x, y; for (y = 10; y != 0; y--, src += 320 - 12, dest += xbuf - 12) for (x = 12; x != 0; x--, src++, dest++) if (*src != 0) *dest = glenz[couleur][*dest]; } static void draw_dead_lemming (a_pixel *dest_, const a_lemming *lem) { a_pixel *dest; char d; do { assert (lem >= lemmings_support && lem < lemmings_support + lemmings_total); dest = dest_; d = lem->dir; if (d == w_up) dest -= (lem->min / 6553) * xbuf; if (d == w_right) dest += lem->min / 5461; if (d == w_down) dest += (lem->min / 6553) * xbuf; if (d == w_left) dest -= lem->min / 5461; copy_dead_lemming_transp (IMGPOS (vehicles_img, 181, (lem->dead << 4) - 16), dest, 6 - (lem->couleur)); lem = lem->next_dead; } while (lem); } void draw_level (int p) { int i, j; int k, l; const a_lemming* tmppti; signed char bb; unsigned char b; a_pixel *dest = render_buffer[p] + sbuf; a_pixel *dest2; long anim_frame; int camera_stop_x[2]; int camera_stop_y[2]; clock_anim = clocks[read_htimer (clock_htimer) & 7]; lemmings_anim_offset = (lemmings_move_offset * 64 / 65536) & 7 << 3; if (read_htimer (blink_htimer) & 1) for (bb = 3; bb >= 0; bb--) invincible[bb] = (player[bb].invincible != 0); else for (bb = 3; bb >= 0; bb--) invincible[bb] = 0; bonus_anim_offset = read_htimer (bonus_anim_htimer) % 25; if (bonus_anim_offset >= 13) bonus_anim_offset = 25 - bonus_anim_offset; if (lvl.tile_height_wrap == DONT_WRAP && (corner_dy[p] + 11U) > lvl.tile_height) camera_stop_y[p] = 1; else camera_stop_y[p] = 0; if (lvl.tile_width_wrap == DONT_WRAP && (corner_dx[p] + nbr_tiles_cols) > lvl.tile_width) camera_stop_x[p] = 1; else camera_stop_x[p] = 0; /* Draw background tiles */ anim_frame = read_htimer (tiles_anim_htimer); for (k = corner_dy[p], l = 11 - camera_stop_y[p]; l > 0; l--, k++) { a_tile_index m; k = k & lvl.tile_height_wrap; m = k * lvl.tile_width; for (i = corner_dx[p], j = nbr_tiles_cols - camera_stop_x[p]; j > 0; j--, i++) { i = (i & lvl.tile_width_wrap); if ((i + m) < lvl.tile_count) { a_bg_data* tile = bg_data + i + m; switch (tile->kind) { case A_NONE: copy_tile (tile->source, dest, tile_set_img.width); break; case A_LOOP: copy_tile (tile->source + 24 * ((anim_frame/tile->anim_speed) % tile->anim_frames), dest, tile_set_img.width); break; case A_PINGPONG: { int frm = ((anim_frame / tile->anim_speed) % (tile->anim_frames * 2)); if (frm > tile->anim_frames) frm = 2 * tile->anim_frames - frm; copy_tile (tile->source + 24 * frm, dest, tile_set_img.width); } break; } } dest += 24; } dest += xbuf * 20 - 24 * (nbr_tiles_cols - camera_stop_x[p]); } /* draw bloody dead lemings */ if (game_mode == M_KILLEM) { dest = render_buffer[p] + sbuf - 24 - 10 * xbuf; for (k = corner_dy[p] * 2 - 1, l = 2 + (11 - camera_stop_y[p]) * 2; l > 0; l--, k++) { k &= lvl.square_height_wrap; if ((unsigned) k < lvl.square_height) { a_tile_index m; m = k * lvl.square_width; for (i = corner_dx[p] * 2 - 2, j = 2 + (nbr_tiles_cols - camera_stop_x[p]); j > 0; j--, i += 2) { i &= lvl.square_width_wrap; if ((unsigned) i < lvl.square_width) { tmppti = square_dead_lemmings_list[i + m]; if (tmppti != NULL) { draw_dead_lemming (dest, tmppti); } tmppti = square_dead_lemmings_list[i + m + 1]; if (tmppti != NULL) { draw_dead_lemming (dest + 12, tmppti); } } dest += 24; } dest += xbuf * 10 - 24 * (nbr_tiles_cols - camera_stop_x[p]) - 24 * 2; } else dest += xbuf * 10; } /* draw lemmings */ dest = render_buffer[p] + sbuf + 3 + xbuf; for (k = corner_dy[p] * 2, l = (11 - camera_stop_y[p]) * 2; l > 0; l--, k = ((k + 1) & lvl.square_height_wrap)) { a_tile_index m; m = k * lvl.square_width; for (i = corner_dx[p] * 2, j = (nbr_tiles_cols - camera_stop_x[p]); j > 0; j--, i = ((i + 2) & lvl.square_width_wrap)) { tmppti = square_lemmings_list[i + m]; if (tmppti != NULL) { draw_lemming (dest, tmppti, i + m); } tmppti = square_lemmings_list[i + m + 1]; if (tmppti != NULL) { draw_lemming (dest + 12, tmppti, i + m + 1); } dest += 24; } dest += xbuf * 10 - 24 * (nbr_tiles_cols - camera_stop_x[p]); } } /* draw color pyramids */ if (game_mode == M_COLOR) { dest = render_buffer[p] + sbuf + 2 + xbuf * 2; for (k = corner_dy[p] * 2, l = (11 - camera_stop_y[p]) * 2; l > 0; l--, k = ((k + 1) & lvl.square_height_wrap)) { a_tile_index m; m = k * lvl.square_width; for (i = corner_dx[p] * 2, j = (nbr_tiles_cols - camera_stop_x[p]); j > 0; j--, i = ((i + 2) & lvl.square_width_wrap)) { bb = square_object[i + m]; if (bb >= 0) draw_color (dest, bb); bb = square_object[i + m + 1]; if (bb >= 0) draw_color (dest + 12, bb); dest += 24; } dest += xbuf * 10 - 24 * (nbr_tiles_cols - camera_stop_x[p]); } } /* draw small dollars */ if (game_mode == M_TCASH) { dest = render_buffer[p] + sbuf + 2; for (k = corner_dy[p] * 2, l = (11 - camera_stop_y[p]) * 2; l > 0; l--, k = ((k + 1) & lvl.square_height_wrap)) { a_tile_index m; m = k * lvl.square_width; for (i = corner_dx[p] * 2, j = (nbr_tiles_cols - camera_stop_x[p]); j > 0; j--, i = ((i + 2) & lvl.square_width_wrap)) { bb = square_object[i + m]; if (bb == 15) DRAW_SPRITE (clock_anim, dest); else if (bb >= 0) DRAW_SPRITE (small_dollar, dest); bb = square_object[i + m + 1]; if (bb == 15) DRAW_SPRITE (clock_anim, dest + 12); else if (bb >= 0) DRAW_SPRITE (small_dollar, dest + 12); dest += 24; } dest += xbuf * 10 - 24 * (nbr_tiles_cols - camera_stop_x[p]); } } /* draw transparent trails */ dest = render_buffer[p] + sbuf; for (k = corner_dy[p] * 2, l = (11 - camera_stop_y[p]) * 2; l > 0; l--, k = ((k + 1) & lvl.square_height_wrap)) { a_tile_index m; m = k * lvl.square_width; for (i = corner_dx[p] * 2, j = (nbr_tiles_cols - camera_stop_x[p]); j > 0; j--, i = ((i + 2) & lvl.square_width_wrap)) { bb = square_occupied[i + m]; if (bb != -1) { if (bb >= 0 && bb < 4) draw_vehicle_tail (bb, dest); else if (bb >= 4 && bb < 8) draw_vehicle_head ((char) (bb - 4), dest); else if (bb >= 8 && bb < 12) draw_trail ((char) (bb - 6), dest, square_way[i + m]); else if (bb >= 12 && bb < 16) draw_trail_tail ((char) (bb - 10), dest); } bb = square_occupied[i + m + 1]; if (bb != -1) { dest2 = dest + 12; if (bb >= 0 && bb < 4) draw_vehicle_tail (bb, dest2); else if (bb >= 4 && bb < 8) draw_vehicle_head ((char) (bb - 4), dest2); else if (bb >= 8 && bb < 12) draw_trail ((char) (bb - 6), dest2, square_way[i + m + 1]); else if (bb >= 12 && bb < 16) draw_trail_tail ((char) (bb - 10), dest2); } dest += 24; } dest += xbuf * 10 - 24 * (nbr_tiles_cols - camera_stop_x[p]); } /* Draw transparent sprites (trees...), and bonuses. */ dest = render_buffer[p] + sbuf; for (k = corner_dy[p], l = 11 - camera_stop_y[p]; l > 0; l--, k = ((k + 1) & lvl.tile_height_wrap)) { a_tile_index m; m = k * lvl.tile_width; for (i = corner_dx[p], j = nbr_tiles_cols - camera_stop_x[p]; j > 0; j--, i = ((i + 1) & lvl.tile_width_wrap)) { int pos = i + m; if (fg_data[pos].bonus) DRAW_SPRITE (fg_data[pos].bonus[bonus_anim_offset], dest); if (fg_data[pos].big_dollar) DRAW_SPRITE (big_dollar, dest + 4 + 2 * xbuf); if (fg_data[pos].sprite) DRAW_SPRITE (fg_data[pos].sprite, dest); dest += 24; } dest += xbuf * 20 - 24 * (nbr_tiles_cols - camera_stop_x[p]); } /* Draw explosions */ dest = render_buffer[p] + sbuf - 12 - 11 * xbuf - 20 * xbuf - 12; for (k = corner_dy[p] * 2 - 2, l = 0; l != 4 + (11 - camera_stop_y[p]) * 2; l++, k++) { k &= lvl.square_height_wrap; if (((unsigned) k) < lvl.square_height) { a_tile_index m; m = k * lvl.square_width; for (i = corner_dx[p] * 2 - 1, j = 0; (unsigned)j != 2 + (nbr_tiles_cols - camera_stop_x[p]) * 2; j++, i++) { i &= lvl.square_width_wrap; if (((unsigned) i) < lvl.square_width) { b = square_explo_state[m + i]; if (b <= EXPLOSION_IMMEDIATE) DRAW_SPRITE (explosions[square_explo_type[m + i]][b], dest); } dest += 12; } dest += xbuf * 10 - 24 * (nbr_tiles_cols - camera_stop_x[p]) - 2 * 12; } else dest += xbuf * 10; } /* Draw tutorial arrows */ if (tutor) { int bonus_to_show = trail_size[col2plr[p]] < 55 ? 1 : 12; long wavepos = read_htimer (waving_htimer); /* Angle is the angle of the tail of the arrow, i.e. `<-' is 0 and `->' is M_PI. 1 rotation per second. */ double angle = M_PI_4 - (wavepos * 2.0 * M_PI / 70.0); int arrow_index = (wavepos * NBR_ARROW_FRAMES / 70) % NBR_ARROW_FRAMES; a_sprite *s = tutorial_arrow[arrow_index]; double d = 10.0 + 4.0 * sin (wavepos / 40.0); /* arbitrary */ /* Substract M_PI_4 so the arrow looks a bit inclinded. */ int dx = d * cos (angle - M_PI_4); int dy = - d * sin (angle - M_PI_4); int color = minisinus[wavepos & 31] + 10; dest = render_buffer[p] + sbuf + (dy - 4) * xbuf + dx - 25; for (k = corner_dy[p] - 0, l = 1 + 11 - camera_stop_y[p]; l > 0; l--, k++) { a_tile_index m; k &= lvl.tile_height_wrap; m = k * lvl.tile_width; for (i = corner_dx[p] - 1, j = 2 + nbr_tiles_cols - camera_stop_x[p]; j > 0; j--, i++) { i &= lvl.tile_width_wrap; if (tile_bonus[i + m] == bonus_to_show) draw_sprunish_custom (s, dest, color); dest += 24; } dest += xbuf * 20 - 24 * (2 + nbr_tiles_cols - camera_stop_x[p]); } } } /* colors used to draw trails on the radar (the indice is the value of the square_occupied array) */ static const a_pixel radar_trail_color[16] = { 111, 127, 143, 159, /* vehicle head */ 111, 127, 143, 159, /* vehicle tail */ 109, 125, 141, 157, /* trail */ 109, 125, 141, 157 /* trail tail */ }; /* colors use to draw walls on the radar (the indice is the value if the square_wall array) */ static const a_pixel radar_wall_color[16] = { 0, 89, 89, 91, 89, 91, 91, 93, 89, 91, 91, 93, 91, 93, 93, 95 }; static void draw_radar_frame (a_pixel *dest) { unsigned int y; /* Top horizontal line. */ memset (dest, 15, 75); dest += xbuf; /* Left and right lines. */ for (y = 40; y != 0; --y) { *dest = 15; dest[74] = 15; dest += xbuf; } /* Bottom line. */ memset (dest, 15, 75); } void draw_radar_map (a_square_coord dx, a_square_coord dy, int radar_shift) { a_pixel *src = corner[0] + 5 * xbuf + 239 + radar_shift; unsigned int x, y, tdym; a_square_coord tdx, tdy; signed char tmp; long blink = read_htimer (blink_htimer) & 2; /* If the radar is completly off the screen, don't bother drawing anything. */ if (radar_shift >= 81) return; draw_radar_frame (src); src += xbuf + 1; /* Now, draw the radar body. */ tdy = dy - 20; for (y = 40; y; --y) { tdy &= lvl.square_height_wrap; if (tdy < lvl.square_height) { tdym = tdy * lvl.square_width; tdx = dx - 36; for (x = 73; x; --x) { tdx &= lvl.square_width_wrap; if (tdx < lvl.square_width) { tmp = tile_bonus[square_tile[tdx + tdym]]; /* If there is a bonus on this square ... */ if (tmp != 0 && tmp != -1) { /* ... draw it, possibly blinking. */ if ((tmp & 127) == 1 && blink) *src = 31; else *src = 27; } else { /* Otherwise, maybe there is someone? */ if ((tmp = square_occupied[tdx + tdym]) != -1) *src = radar_trail_color[tmp]; /* or just a wall? */ else if ((tmp = lvl.square_walls_out[tdx + tdym]) != 0) *src = radar_wall_color[tmp]; /* or nothing interesting. */ else *src = glenz[0][*src]; } } else { /* The square is out of the level (because the level is not width-wrapped). */ *src = glenz[0][*src]; } src++; tdx++; } } else { /* The square is out of the level (because the level is not height-wrapped). */ for (x = 73; x; --x, ++src) *src = glenz[0][*src]; } src += xbuf - 73; tdy++; } } void draw_score (int c, int p, int row, int col, int score_shift) { a_pixel *src = corner[p] + row * xbuf + col + score_shift; a_pixel *tmp = src + 22 + 2 * xbuf; a_pixel *tmp2 = src + 25 + 5 * xbuf + 53 * xbuf; a_pixel *dest = src + 2 + 2 * xbuf; int x, y, i; char score[32]; /* Don't bother drawing the score if it's off the screen. */ if ((col + score_shift > 320) || (col + score_shift + 33 < 0)) return; for (y = ((game_mode < M_TCASH) ? 63 : 75); y != 0; y--) { for (x = 33; x != 0; --x, ++src) *src = glenz[0][*src]; src += xbuf - 33; } sprintf (score, "%.6d", player[c].score_delta >> 2); for (i = 0; i < 6; i++) { src = IMGPOS (main_font_img, 72, (score[i] - '0') * 18); for (y = 9; y != 0; y--) { for (x = 18; x != 0; x--, src++, dest++) if (*src != 0) *dest = *src; dest += xbuf - 18; src += 302; } dest += xbuf; } src = IMGPOS (main_font_img, 50, ((player[c].lifes < 11) ? player[c].lifes - 1 : 10) * 10); for (y = 11; y != 0; y--) { for (x = 9; x != 0; x--, src++, tmp++) if (*src != 0) *tmp = *src; tmp += xbuf - 9; src += 311; } tmp += xbuf; src = IMGPOS (main_font_img, 72, 184); for (y = 47; y != 0; y--) { for (x = 9; x != 0; x--, src++, tmp++) if (*src != 0) *tmp = *src; else *tmp = glenz[0][*tmp]; tmp += xbuf - 9; src += 311; } x = player[c].turbo_level_delta * 41 / 1024; tmp2 -= xbuf; src = IMGPOS (main_font_img, 71 + x, 193); for (y = x; y != 0; y--) { *tmp2++ = *src++; *tmp2++ = *src++; *tmp2++ = *src++; tmp2 -= 3 + xbuf; src -= 3 + 320; } if (game_mode >= M_TCASH) { sprintf (score, "%.3d", player[c].time / 70); for (i = 0; i < 3; i++) { src = IMGPOS (main_font_img, 50, (score[i] - '0') * 10); for (y = 11; y != 0; y--) { for (x = 9; x != 0; x--, src++, dest++) if (*src != 0) *dest = *src; dest += xbuf - 9; src += 320 - 9; } dest += 10 - 11 * xbuf; } } } void draw_logo_info (int c, int nbr, a_pixel* dest) { a_pixel* src = dest; a_pixel* tmp; a_pixel* tmp2; a_pixel* tmp3; int x, y; if (game_mode < M_TCASH) { for (x = 50; x != 0; --x, ++src) *src = glenz[0][*src]; src += xbuf - 50; tmp = src + 1; tmp2 = src + 11; for (y = 11; y != 0; y--) { for (x = 21; x != 0; --x, ++src) *src = glenz[0][*src]; *(src + 28) = glenz[0][*(src + 28)]; src += xbuf - 21; } for (x = 50; x != 0; --x, ++src) *src = glenz[0][*src]; DRAW_SPRITE (player_logo[c], dest + xbuf + 21); src = main_font_img.buffer + 50 * 320 + (nbr / 10) * 10; for (y = 11; y != 0; y--) { for (x = 9; x != 0; x--, src++, tmp++) if (*src != 0) *tmp = *src; tmp += xbuf - 9; src += 311; } src = main_font_img.buffer + 50 * 320 + (nbr % 10) * 10; for (y = 11; y != 0; y--) { for (x = 9; x != 0; x--, src++, tmp2++) if (*src != 0) *tmp2 = *src; tmp2 += xbuf - 9; src += 311; } if (nbr == 0) DRAW_SPRITE (red_cross[c], dest - 5 * xbuf + 20); } else { src -= 5; dest -= 5; for (x = 60; x != 0; --x, ++src) *src = glenz[0][*src]; src += xbuf - 60; tmp = src + 1; tmp2 = src + 11; tmp3 = src + 21; for (y = 11; y != 0; y--) { for (x = 31; x != 0; --x, ++src) *src = glenz[0][*src]; src[28] = glenz[0][src[28]]; src += xbuf - 31; } for (x = 60; x != 0; --x, ++src) *src = glenz[0][*src]; DRAW_SPRITE (player_logo[c], dest + xbuf + 31); src = main_font_img.buffer + 50 * 320 + (nbr / 100) * 10; for (y = 11; y != 0; y--) { for (x = 9; x != 0; x--, src++, tmp++) if (*src != 0) *tmp = *src; tmp += xbuf - 9; src += 311; } src = main_font_img.buffer + 50 * 320 + ((nbr / 10) % 10) * 10; for (y = 11; y != 0; y--) { for (x = 9; x != 0; x--, src++, tmp2++) if (*src != 0) *tmp2 = *src; tmp2 += xbuf - 9; src += 311; } src = main_font_img.buffer + 50 * 320 + (nbr % 10) * 10; for (y = 11; y != 0; y--) { for (x = 9; x != 0; x--, src++, tmp3++) if (*src != 0) *tmp3 = *src; tmp3 += xbuf - 9; src += 311; } if (player[c].spec == 0xde) DRAW_SPRITE (red_cross[c], dest - 5 * xbuf + 20); } } heroes-0.21/src/render.h0000644004117000411500000000332607352614753010637 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__RENDER__H #define HEROES__RENDER__H #include "lvl.h" extern char tutor; void draw_level (int p); void draw_radar_map (a_square_coord dx, a_square_coord dy, int radar_shift); void draw_score (int c, int p, int row, int col, int score_shift); void draw_logo_info (int c, int nbr, a_pixel* dest); #endif /* HEROES__RENDER__H */ heroes-0.21/src/renderdata.c0000644004117000411500000000706307352614753011466 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "renderdata.h" #include "errors.h" #include "debugmsg.h" #include "structs.h" #include "const.h" #include "sprrle.h" a_bg_data *bg_data = 0; a_fg_data *fg_data = 0; int tile_set_size = 0; /* number of tiles in the tile set */ a_sprite **tile_transp; /* An array as wide as the tile set, which might contains pointer to the a_sprite for a tile, when that tile is used as a transparant sprite. */ static void init_tile_sprites (void) { tile_set_size = (tile_set_img.width / 24) * 10; XCALLOC_ARRAY (tile_transp, tile_set_size); } static void uninit_tile_sprites (void) { while (tile_set_size--) XFREE0 (tile_transp[tile_set_size]); XFREE0 (tile_transp); } static a_sprite * get_tile_sprite (unsigned int offset) { /* convert an offset-in-image, into a tile-number */ int tile_row = offset / (tile_set_img.width * 20); int tile_col = (offset % (tile_set_img.width * 20)) / 24; int tile_pos = tile_row * (tile_set_img.width / 24) + tile_col; /* don't recompile the sprite if it's already done */ if (!tile_transp[tile_pos]) tile_transp[tile_pos] = compile_sprrle (tile_set_img.buffer + offset, 0, 20, 24, tile_set_img.width, xbuf); return tile_transp[tile_pos]; } void uninit_render_data (void) { dmsg (D_SECTION, "Uninitialize rendering data"); uninit_tile_sprites (); XFREE0 (bg_data); XFREE0 (fg_data); } void init_render_data (void) { a_tile_index pos; a_tile_index max_pos = lvl.tile_count; dmsg (D_SECTION, "Initialize rendering data"); XMALLOC_ARRAY (bg_data, max_pos); XMALLOC_ARRAY (fg_data, max_pos); init_tile_sprites (); /* initialize background tile information */ for (pos = 0; pos < max_pos; ++pos) { /* background data */ bg_data[pos].source = lvl_tile_sprite_offset (&lvl, pos) + tile_set_img.buffer; lvl_animation_info (&lvl, pos, &bg_data[pos].anim_frames, &bg_data[pos].anim_speed, &bg_data[pos].kind); /* foreground data */ { unsigned int ovlay = lvl_tile_sprite_overlay_offset (&lvl, pos); if (ovlay) fg_data[pos].sprite = get_tile_sprite (ovlay); else fg_data[pos].sprite = 0; } fg_data[pos].bonus = 0; fg_data[pos].big_dollar = 0; } } heroes-0.21/src/renderdata.h0000644004117000411500000000464607352614753011477 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /*----------------------------------------------------------. | This file defines data used by the renderering function. | `----------------------------------------------------------*/ #ifndef HEROES__RENDERDATA__H #define HEROES__RENDERDATA__H #include "video.h" #include "pcx.h" #include "sprite.h" #include "lvl.h" /* data for background tiles */ typedef struct { const a_pixel *source; /* address of the tile's image */ an_anim_kind kind; /* kind of animation */ int anim_speed; /* speed for animated tiles */ int anim_frames; /* number of frames in an animation */ } a_bg_data; extern a_bg_data *bg_data; /* data for foreground sprites (trees...) and bonuses, these are kept in the same struct because they are drawn in the same loop */ typedef struct { a_sprite *sprite; /* sprite to superpose if non nil */ a_sprite **bonus; /* bonus line, if non nil */ char big_dollar; /* 1 if a big dollar must be drawn */ } a_fg_data; extern a_fg_data *fg_data; extern void init_render_data (void); extern void uninit_render_data (void); #endif /* HEROES__RENDERDATA__H */ heroes-0.21/src/rsc_files.c0000644004117000411500000001075507352614753011330 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "rsc_files.h" #include "rsc_files_hash.h" #include "errors.h" #include "debugmsg.h" static void check_rsc_spelling_error (const char *rsc_name) { const char *approx = get_rsc_approx (rsc_name); if (approx) wmsg (_("%s: no such resource, possible misspelling of '%s'."), rsc_name, approx); else wmsg (_("%s: no such resource."), rsc_name); } int set_rsc_file (const char* rsc_name, const char* file_name, bool secure) { struct rsc_file* res = in_rsc_set (rsc_name, strlen(rsc_name)); if (res == 0) { check_rsc_spelling_error (rsc_name); return 1; } dmsg (D_RESOURCE, "set resource $(%s)=%s", rsc_name, file_name); if (res->modified_value) free (res->modified_value); res->modified_value = xstrdup (file_name); res->secure = secure; return 0; } /* Search value for strings of the form `$(name)' to expand. */ char* rsc_expand_secure (char *value, bool *secure) { int size = strlen (value) + 1; char *result; int dest; XMALLOC_ARRAY (result, size); for (dest = 0; *value; ++value) if (*value != '$' || value[1] != '(') result[dest++] = *value; else { char* end; value += 2; /* look for the closing parenthethis */ for (end = value; *end && *end != ')'; ++end) /* NOP */; if (*end == 0) { /* no closing parenthethis found */ free (result); return 0; } *end = 0; /* insert the expanded value into the result string */ { char* expanded; expanded = get_rsc_file_secure (value, secure); if (expanded) { char* src; size += strlen (expanded) - (end - value + 3); XREALLOC_ARRAY (result, size); for (src = expanded; *src;) result[dest++] = *src++; free (expanded); } value = end; } } result[dest] = 0; return result; } char* rsc_expand (char *value) { return rsc_expand_secure (value, 0); } char * get_rsc_file_secure (const char *rsc_name, bool *secure) { char *result; char *tmp; struct rsc_file *res = in_rsc_set (rsc_name, strlen(rsc_name)); if (res == 0) { check_rsc_spelling_error (rsc_name); return 0; } if (res->expanded) /* prevent infinite recursion */ return 0; if (secure) *secure &= res->secure; res->expanded = 1; /* duplicate the value because rsc_expand will modify it */ tmp = xstrdup (res->modified_value ? res->modified_value : res->value); dmsg (D_RESOURCE, "get resource $(%s)=%s [%s]", rsc_name, tmp, res->secure ? "trusted" : "untrusted"); result = rsc_expand_secure (tmp, secure); dmsg (D_RESOURCE, "expanded resource $(%s)=%s [%s]", rsc_name, result, secure ? (*secure ? "trusted" : "untrusted") : "don't care"); free (tmp); res->expanded = 0; return result; } char * get_rsc_file (const char *rsc_name) { return get_rsc_file_secure (rsc_name, 0); } char * get_non_null_rsc_file_secure (const char *rsc_name, bool *secure) { char* tmp = get_rsc_file_secure (rsc_name, secure); if (tmp == 0) emsg (_("%s: null resource"), rsc_name); if (!strcmp(tmp, "")) emsg (_("%s: empty resource"), rsc_name); return tmp; } char * get_non_null_rsc_file (const char *rsc_name) { return get_non_null_rsc_file_secure (rsc_name, 0); } heroes-0.21/src/rsc_files.h0000644004117000411500000000413407352614753011327 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__RSC_FILES__H #define HEROES__RSC_FILES__H int set_rsc_file (const char *rsc_name, const char *file_name, bool secure); /* * The secure calls tell whether the returned value has been * set in a secure way (i.e. hardcoded or from the global * configuration file). Note that the secure flag is set to 0 * when a value is not secure, but is never set to 1: this is * the job of the caller. */ char *get_rsc_file (const char *rsc_name); char *get_rsc_file_secure (const char *rsc_name, bool *secure); char *get_non_null_rsc_file (const char *rsc_name); char *get_non_null_rsc_file_secure (const char *rsc_name, bool *secure); char *rsc_expand (char *value); char *rsc_expand_secure (char *value, bool *secure); #endif /* HEROES__RSC_FILES__H */ heroes-0.21/src/rsc_files_hash.c0000644004117000411500000002042207451357132012316 /* ANSI-C code produced by gperf version 2.7.2 */ /* Command-line: gperf -t -L ANSI-C -G -N in_rsc_set -W rsc_set -k '1,3,7,$' ./rsc_files.gperf */ /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes 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. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "rsc_files_hash.h" #include "fstrcmp.h" struct rsc_file; #define TOTAL_KEYWORDS 38 #define MIN_WORD_LENGTH 6 #define MAX_WORD_LENGTH 21 #define MIN_HASH_VALUE 7 #define MAX_HASH_VALUE 91 /* maximum key range = 85, duplicates = 0 */ #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static unsigned int hash (register const char *str, register unsigned int len) { static unsigned char asso_values[] = { 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 0, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 10, 10, 15, 5, 0, 50, 0, 0, 0, 20, 0, 25, 45, 0, 0, 40, 92, 0, 0, 0, 0, 10, 5, 45, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92 }; register int hval = len; switch (hval) { default: case 7: hval += asso_values[(unsigned char)str[6]]; case 6: case 5: case 4: case 3: hval += asso_values[(unsigned char)str[2]]; case 2: case 1: hval += asso_values[(unsigned char)str[0]]; break; } return hval + asso_values[(unsigned char)str[len - 1]]; } static struct rsc_file rsc_set[] = { {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"sys-dir", "/var/games/heroes", 0,0,true}, {"user-dir", "$(home-dir)/.heroes", 0,0,true}, {"",0,0,0,false}, {"editor-img", "$(data-dir)/pics/edit.pcx", 0,0,true}, {"",0,0,0,false}, {"",0,0,0,false}, {"data-dir", "$(prefix)/"FORWARD_RELATIVE_PKGDATADIR,0,0,true}, {"",0,0,0,false}, {"intro-erase-img", "$(data-dir)/pics/erase.pcx", 0,0,true}, {"intro-splash-img", "$(data-dir)/pics/heroes.pcx", 0,0,true}, {"",0,0,0,false}, {"big-font", "$(data-dir)/pics/fontbig.pcx", 0,0,true}, {"arrow-img", "$(data-dir)/pics/arrow.pcx", 0,0,true}, {"trails-img", "$(data-dir)/pics/trail.pcx", 0,0,true}, {"",0,0,0,false}, {"vehicles-img", "$(data-dir)/pics/vehic.pcx", 0,0,true}, {"hedlite-output-dir", "$(user-dir)/levels/", 0,0,true}, {"end-scroller-bg-img", "$(data-dir)/pics/background.pcx", 0,0,true}, {"",0,0,0,false}, {"saved-games-file", "$(user-dir)/savedgames", 0,0,true}, {"",0,0,0,false}, {"intro-vehicles-img", "$(data-dir)/pics/intro.pcx", 0,0,true}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"new-level-menu-img", "$(data-dir)/pics/newlevel.pcx", 0,0,true}, {"help-font", "$(data-dir)/pics/fontread.pcx", 0,0,true}, {"brown-bonus-img", "$(data-dir)/pics/bonusb.pcx", 0,0,true}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"tiles-sets-dir", "$(data-dir)/tilesets/", 0,0,true}, {"intro-logos-img", "$(data-dir)/pics/olympus.pcx", 0,0,true}, {"extra-levels-dir", "$(data-dir)/extralvl/", 0,0,true}, {"help-pictures-img", "$(data-dir)/pics/helpics.pcx", 0,0,true}, {"",0,0,0,false}, {"",0,0,0,false}, {"levels-dir", "$(data-dir)/levels/", 0,0,true}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"pref-file", "$(user-dir)/preferences", 0,0,true}, {"locale-dir", "$(prefix)/"FORWARD_RELATIVE_LOCALEDIR, 0,0,true}, {"",0,0,0,false}, {"sfx-dir", "$(data-dir)/sfx/", 0,0,true}, {"home-dir", "is initialized from $HOME", 0,0,true}, {"main-font", "$(data-dir)/pics/fontem.pcx", 0,0,true}, {"",0,0,0,false}, {"purple-bonus-img", "$(data-dir)/pics/bonusa.pcx", 0,0,true}, {"sfx-conf-txt", "$(data-dir)/sfx/sfx.conf", 0,0,true}, {"",0,0,0,false}, {"user-conf", "$(user-dir)/heroesrc", 0,0,true}, {"score-file", "$(user-dir)/scores", 0,0,true}, {"system-conf", "$(data-dir)/etc/heroesrc", 0,0,true}, {"menu-pictures-img", "$(data-dir)/pics/fontem2.pcx", 0,0,true}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"editor-preview-prefix", "$(data-dir)/pics/editp", 0,0,true}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"bonus-font", "$(data-dir)/pics/typonus.pcx", 0,0,true}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"jukebox-img", "$(data-dir)/pics/jukebox.pcx", 0,0,true}, {"jukebox-font", "$(data-dir)/pics/fontdeck.pcx", 0,0,true}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"",0,0,0,false}, {"prefix", PREFIX, 0,0,true} }; #ifdef __GNUC__ __inline #endif struct rsc_file * in_rsc_set (register const char *str, register unsigned int len) { if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) { register int key = hash (str, len); if (key <= MAX_HASH_VALUE && key >= 0) { register const char *s = rsc_set[key].name; if (*str == *s && !strcmp (str + 1, s + 1)) return &rsc_set[key]; } } return 0; } void print_rsc_files (void) { int i; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (rsc_set[i].name[0]) { if (rsc_set[i].modified_value) { printf ("%24s = %s\n", rsc_set[i].name, rsc_set[i].modified_value); printf ("%16s (default: %s)\n", "", rsc_set[i].value); } else printf ("%24s = %s\n", rsc_set[i].name, rsc_set[i].value); } } } const char * get_rsc_approx (const char *rsc_name) { int i; const char *res = 0; double best_weight = 0.7; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (rsc_set[i].name[0]) { double weight = fstrcmp (rsc_name, rsc_set[i].name); if (weight > best_weight) { best_weight = weight; res = rsc_set[i].name; } } } return res; } void free_modified_rsc (void) { int i; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) XFREE (rsc_set[i].modified_value); } heroes-0.21/src/rsc_files_hash.h0000644004117000411500000000346507352614753012340 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__RSC_FILES_HASH__H #define HEROES__RSC_FILES_HASH__H struct rsc_file { const char *name; const char *value; char *modified_value; int expanded; /* Whether the value has been set from a secure system-wide file. */ bool secure; }; struct rsc_file *in_rsc_set (const char *str, unsigned int len); void print_rsc_files (void); const char *get_rsc_approx (const char *rsc_name); void free_modified_rsc (void); #endif /* HEROES__RSC_FILES_HASH__H */ heroes-0.21/src/savegame.c0000644004117000411500000001416307352614753011144 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "structs.h" #include "scores.h" #include "savegame.h" #include "argv.h" #include "misc.h" #include "userdir.h" #include "debugmsg.h" #include "rsc_files.h" #include "getshline.h" #include "errors.h" #include "persona.h" #include "filelock.h" saved_game saverec[10]; static char *name = 0; static FILE *fsave = 0; void init_save_records (void) { name = sys_persona_if_needed ("saved-games-file", "a+t"); dmsg (D_FILE | D_SYSTEM, "opening %s", name); fsave = fopen (name, "a+t"); if (!fsave) dperror ("fopen"); user_persona (); } void reinit_save_records_if_needed (void) { char *newname = get_non_null_rsc_file ("saved-games-file"); if (strcmp (newname, name)) { free_save_records (); init_save_records (); } free (newname); } void clear_save_records (void) { memset (saverec, 0, 10 * sizeof (saved_game)); if (x10sav) { unsigned int i; for (i = 0; i < 10; i++) { sprintf (saverec[i].name, "LVL%u", (1 + i) * 10); saverec[i].level = (1 + i) * 10 - 1; saverec[i].points[0] = saverec[i].points[1] = saverec[i].points[2] = saverec[i].points[3] = (1 + i) * 1000; saverec[i].lifes[0] = saverec[i].lifes[1] = saverec[i].lifes[2] = saverec[i].lifes[3] = 9; empty_gameid (saverec[i].gid); saverec[i].used = 1; } } } void write_save_records_locked (void) { int i; if (fsave == 0) { wmsg (_("cannot write %s"), name); dperror (name); } else { fflush (fsave); if (ftruncate (fileno (fsave), 0) != 0) emsg (_("%s: truncate error"), name); } if (fsave) { dmsg (D_FILE, "saving games to %s", name); for (i = 0; i < 10; ++i) { saved_game *sg = saverec + i; char *gidtxt = gameid_to_text (sg->gid); fprintf (fsave, "%u %u %u %u %u %u %u %u %u %u\n %s\n %s\n", sg->level, sg->points[0], sg->lifes[0], sg->points[1], sg->lifes[1], sg->points[2], sg->lifes[2], sg->points[3], sg->lifes[3], sg->used, gidtxt, sg->name); free (gidtxt); } /* We need to seek to the beginning of file before calling file_unlock on some systems. */ fseek (fsave, 0L, SEEK_SET); dmsg (D_FILE | D_SYSTEM, "unlocking %s", name); file_unlock (fileno (fsave)); } } static void load_save_records_error (int line) { wmsg (_("%s:%d: parse error. Clearing saved-games table."), name, line); clear_scores (); } static void load_save_records_read (void) { int i; int endline = 0; char* buf = 0; size_t bufsize = 0; int firstline = 0; clear_save_records (); if (fsave == 0) return; /* Read the scores from disk. */ i = 0; while (getshline_numbered (&firstline, &endline, &buf, &bufsize, fsave) != -1) { saved_game *sg = saverec + i; if (*buf != ' ') { unsigned int u[10]; if (sscanf (buf, "%u %u %u %u %u %u %u %u %u %u", u, u + 1, u + 2, u + 3, u + 4, u + 5, u + 6, u + 7, u + 8, u + 9) != 10 || u[9] > 1) { load_save_records_error (firstline); return; } sg->level = u[0]; sg->points[0] = u[1]; sg->lifes[0] = u[2]; sg->points[1] = u[3]; sg->lifes[1] = u[4]; sg->points[2] = u[5]; sg->lifes[2] = u[6]; sg->points[3] = u[7]; sg->lifes[3] = u[8]; sg->used = u[9]; } else if (buf[1] != ' ') { if (text_to_gameid (buf + 1, sg->gid)) { load_save_records_error (firstline); return; } } else { strncpy (sg->name, buf + 2, 16); chomp (sg->name); ++i; } /* Exit if the savedgame array is full. */ if (i >= 10) break; } free (buf); } static void load_save_records_seek (bool exclusive) { dmsg (D_FILE, "reading saved games from %s", name); if (fsave) { fseek (fsave, 0L, SEEK_SET); dmsg (D_FILE | D_SYSTEM, "locking %s", name); file_lock (fileno (fsave), exclusive); } } void load_save_records (void) { load_save_records_seek (false); load_save_records_read (); if (fsave) { /* We need to seek to the beginning of file before calling file_unlock on some systems. */ fseek (fsave, 0L, SEEK_SET); dmsg (D_FILE | D_SYSTEM, "unlocking %s", name); file_unlock (fileno (fsave)); } } void load_save_records_and_keep_locked (void) { load_save_records_seek (true); load_save_records_read (); if (fsave) fseek (fsave, 0L, SEEK_SET); } void write_save_records (void) { load_save_records_seek (true); write_save_records_locked (); } void free_save_records (void) { dmsg (D_MISC, "free save records"); if (name) free (name); name = 0; if (fsave) { fclose (fsave); fsave = 0; } } void write_save_one_record (int rec) { saved_game save = saverec[rec]; load_save_records_and_keep_locked (); saverec[rec] = save; write_save_records_locked (); } heroes-0.21/src/savegame.h0000644004117000411500000000371707352614753011154 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__SAVEGAME__H #define HEROES__SAVEGAME__H #include "gameid.h" typedef struct { char name[16]; a_u32 level; a_u32 points[4]; a_u32 lifes[4]; a_gameid gid; bool used; } saved_game; extern saved_game saverec[10]; void init_save_records (void); void reinit_save_records_if_needed (void); void clear_save_records (void); void write_save_records (void); void write_save_records_locked (void); void load_save_records (void); void load_save_records_and_keep_locked (void); void free_save_records (void); void write_save_one_record (int rec); #endif /* HEROES__SAVEGAME__H */ heroes-0.21/src/scores.c0000644004117000411500000001425007352614753010647 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "structs.h" #include "scores.h" #include "misc.h" #include "userdir.h" #include "debugmsg.h" #include "rsc_files.h" #include "getshline.h" #include "errors.h" #include "persona.h" #include "filelock.h" top_score highs[5][10]; static char *name = 0; static FILE *fscores = 0; void init_scores (void) { name = sys_persona_if_needed ("score-file", "a+t"); dmsg (D_SYSTEM | D_FILE, "opening %s", name); fscores = fopen (name, "a+t"); if (!fscores) dperror ("fopen"); user_persona (); } void reinit_scores_if_needed (void) { char *newname = get_non_null_rsc_file ("score-file"); if (strcmp (newname, name)) { free_scores (); init_scores (); } free (newname); } static int cmp_scores (const void *r1, const void *r2) { return (((const top_score *) r2)->points - ((const top_score *) r1)->points); } void sort_scores (void) { int i; for (i = 0; i < 5; i++) qsort (highs[i], 10, sizeof (top_score), cmp_scores); } int find_score_by_gameid (gameid_ptr gid) { int i; for (i = 0; i < 10; i++) if (equal_gameid (highs[0][i].gid, gid)) return (i); return (-1); } void clear_scores (void) { int i, j; for (i = 0; i < 5; i++) for (j = 0; j < 10; j++) { strncpy (highs[i][j].name, "\0", 8); empty_gameid (highs[i][j].gid); highs[i][j].points = (10 - j) * 250; } } void write_scores_locked (void) { unsigned int i, j; if (fscores == 0) { wmsg (_("cannot write %s"), name); } else { fflush (fscores); if (ftruncate (fileno (fscores), 0) != 0) emsg (_("%s: truncate error"), name); } if (fscores) { dmsg (D_FILE, "writing scores to %s", name); /* Write down scores to disk. */ for (i = 0; i < 5; ++i) for (j = 0; j < 10; ++j) { char *gidtxt = gameid_to_text (highs[i][j].gid); fprintf (fscores, "%u %u %u\n %s\n %s\n", i, j, highs[i][j].points, gidtxt, highs[i][j].name); free (gidtxt); } /* We need to seek to the beginning of file before calling file_unlock on some systems. */ fseek (fscores, 0L, SEEK_SET); dmsg (D_FILE | D_SYSTEM, "unlocking %s", name); file_unlock (fileno (fscores)); } } static void load_scores_seek (bool exclusive) { dmsg (D_FILE, "reading scores from %s", name); if (fscores) { fseek (fscores, 0L, SEEK_SET); dmsg (D_FILE | D_SYSTEM, "locking %s", name); file_lock (fileno (fscores), exclusive); } } void write_scores (void) { load_scores_seek (true); write_scores_locked (); } static void load_scores_error (int line) { wmsg (_("%s:%d: parse error. Clearing score table."), name, line); clear_scores (); } static void load_scores_read (void) { unsigned int i, j; a_u32 points; int endline = 0; char* buf = 0; size_t bufsize = 0; int firstline = 0; clear_scores (); if (fscores == 0) return; /* Read the scores from disk. */ while (getshline_numbered (&firstline, &endline, &buf, &bufsize, fscores) != -1) { if (*buf != ' ') { if (sscanf (buf, "%u %u %u", &i, &j, &points) != 3 || i >= 5 || j >= 10) { load_scores_error (firstline); return; } highs[i][j].points = points; } else if (buf[1] != ' ') { if (text_to_gameid (buf + 1, highs[i][j].gid)) { load_scores_error (firstline); return; } } else { strncpy (highs[i][j].name, buf + 2, PLAYER_NAME_SIZE + 1); chomp (highs[i][j].name); } } free (buf); } void load_scores (void) { load_scores_seek (false); load_scores_read (); if (fscores) { /* We need to seek to the beginning of file before calling file_unlock on some systems. */ fseek (fscores, 0L, SEEK_SET); dmsg (D_FILE | D_SYSTEM, "unlocking %s", name); file_unlock (fileno (fscores)); } } void load_scores_and_keep_locked (void) { load_scores_seek (true); load_scores_read (); if (fscores) fseek (fscores, 0L, SEEK_SET); } void free_scores (void) { dmsg (D_MISC, "free scores"); if (name) free (name); name = 0; if (fscores) { fclose (fscores); fscores = 0; } } /* Insert an score entry in the score table. If NAME is NULL, we just return true or false, whether the score would have been inserted or not (if it's too low). */ bool insert_scores (int gamemode, const char *player_name, a_gameid gid, a_u32 points) { int mag = find_score_by_gameid (gid); /* If we are not goiing to override the score for an existing game, override the last entry of the game... */ if (mag == -1) mag = 9; /* ... unless the score is too low, of course. */ if (highs[gamemode][mag].points >= points) mag = -1; if (mag == -1) return false; if (player_name) { copy_gameid (highs[gamemode][mag].gid, gid); highs[gamemode][mag].points = points; strcpy (highs[gamemode][mag].name, player_name); sort_scores (); } return true; } heroes-0.21/src/scores.h0000644004117000411500000000402007352614753010646 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__SCORES__H #define HEROES__SCORES__H #include "gameid.h" #define PLAYER_NAME_SIZE 8 typedef struct { char name[PLAYER_NAME_SIZE + 1]; a_gameid gid; a_u32 points; } top_score; extern top_score highs[5][10]; void init_scores (void); void reinit_scores_if_needed (void); void sort_scores (void); void clear_scores (void); void write_scores (void); void write_scores_locked (void); bool insert_scores (int gamemode, const char *player_name, a_gameid gid, a_u32 points); void load_scores (void); void load_scores_and_keep_locked (void); void free_scores (void); int find_score_by_gameid (gameid_ptr gid); #endif /* HEROES__SCORES__H */ heroes-0.21/src/scrtools.c0000644004117000411500000000755507352614753011233 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "scrtools.h" #include "fader.h" #include "timer.h" #include "video.h" #include "prefs.h" #include "const.h" #include "fastmem.h" #include "argv.h" #include "camera.h" void set_pal_with_luminance (const a_palette *palsrc) { a_palette paldest; int i; float gamma_coef = (opt.luminance + 5) / 11.0; /* preform gamma correction */ for (i = 767; i >= 0; i--) { float color = palsrc->global[i]; color = pow (color / 63.0, gamma_coef) * 63.0 + 0.5; if (color > 63.0) color = 63.0; paldest.global[i] = (a_u8) color; } set_pal (paldest.global, 0, 768); } void force_palette (const unsigned char *palette) { cancel_fader (); set_pal (palette, 0, 768); } void flush_display (const a_pixel *src) { run_fader (); vsynchro (src); update_htimers (); } void flush_display2 (const a_pixel *src1, const a_pixel *src2) { run_fader (); if (swapside) vsynchro2 (src2, src1); else vsynchro2 (src1, src2); update_htimers (); } void flush_display_moving (int x) { a_pixel *src = corner[0]; int *desti; int i, j; src += x << 2; for (i = 200; i > 0; i--, src += xbuf) { memmove (src + 160 + (x << 2), src + 160 - (x << 2), 160 - (x << 2)); desti = ((int *) src) + 40 - x; for (j = x << 1; j != 0; j--) *desti++ = 0; } flush_display (corner[0] + (x << 2)); } void flush_display2_moving (int x) { a_pixel *src1 = corner[swapside]; const a_pixel *src2 = corner[1 - swapside]; int *desti; int i, j; src1 += x << 2; for (i = 200; i > 0; i--, src1 += xbuf, src2 += xbuf) { desti = ((int *) src1) + 40 - x; for (j = x << 1; j != 0; j--) *desti++ = 0; fastmem4 (src2, src1 + 160 + (x << 2), 160 / 4 - x); } flush_display (corner[swapside] + (x << 2)); } void shade_scr_area (const a_pixel *src, a_pixel *dest) { unsigned row; unsigned col; for (row = 200; row; --row) { for (col = 0; col < 320; ++col) dest[col] = glenz[1][src[col]]; dest += xbuf; src += xbuf; } } void copy_scr_area (const a_pixel *src, a_pixel *dest) { unsigned row; for (row = 200; row; --row) { fastmem4 (src, dest, 320/4); src += xbuf; dest += xbuf; } } void copy_image_to_scr_area (const a_pcx_image *src, a_pixel *dest) { unsigned row; const a_pixel *s = src->buffer; for (row = 200; row; --row) { fastmem4 (s, dest, src->width/4); s += src->width; dest += xbuf; } } void clear_scr_area (a_pixel *dest) { unsigned row; for (row = 200; row; --row) { memset (dest, 0, 320); dest += xbuf; } } heroes-0.21/src/scrtools.h0000644004117000411500000000367507352614753011237 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SCRTOOLS__H #define HEROES__SCRTOOLS__H #include "pcx.h" void set_pal_with_luminance (const a_palette* palsrc); void force_palette (const unsigned char *palette); void flush_display (const a_pixel *src); void flush_display2 (const a_pixel *src1, const a_pixel *src2); void flush_display_moving (int x); void flush_display2_moving (int x); void shade_scr_area (const a_pixel *src, a_pixel *dest); void copy_scr_area (const a_pixel *src, a_pixel *dest); void copy_image_to_scr_area (const a_pcx_image *src, a_pixel *dest); void clear_scr_area (a_pixel *dest); #endif /* HEROES__SCRTOOLS__H */ heroes-0.21/src/sprglauto.c0000644004117000411500000000544207352614753011374 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprglauto.h" #include "sprrle.h" #include "const.h" void draw_sprglauto (const a_sprite *sprite, a_pixel *dest) { a_pixel *cur = dest; /* current writting possition */ a_u8 *pc; /* program counter */ a_u8 *epc; /* end of program code */ assert (sprite->all.kind == S_RLE_GLENZ_AUTO); pc = sprite->rle.code; epc = sprite->rle.end_code; while (pc < epc) { unsigned m, n; m = *pc++; n = *pc++; if (n == 0 && m == 0) { /* end of line */ cur += sprite->rle.line_skip; } else { cur += m; for (; n; --n) { a_pixel c = *pc; if (c == 1) *cur = glenz[0][*cur]; else if (c == 111) *cur = glenz[2][*cur]; else if (c == 127) *cur = glenz[3][*cur]; else if (c == 143) *cur = glenz[4][*cur]; else if (c == 159) *cur = glenz[5][*cur]; else if (c == 15) *cur = glenz[7][*cur]; else if (c == 16) *cur = glenz[6][*cur]; else *cur = c; ++cur; ++pc; } } } } a_sprite * compile_sprglauto (const a_pixel *src, a_pixel transp_color, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width) { a_sprite *s; s = compile_sprrle (src, transp_color, block_height, block_width, src_width, dest_width); s->all.kind = S_RLE_GLENZ_AUTO; s->draw = draw_sprglauto; return s; } void free_sprglauto (a_sprite *prog) { assert (prog->all.kind == S_RLE_GLENZ_AUTO); free (prog->rle.code); free (prog); } heroes-0.21/src/sprglauto.h0000644004117000411500000000371407352614753011401 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRGLAUTO__H #define HEROES__SPRGLAUTO__H /*------------------------------------------------------------------. | sprites with automatic (used for some sprites in the help reader) | `------------------------------------------------------------------*/ #include "sprite.h" void draw_sprglauto (const a_sprite* sprite, a_pixel* dest); a_sprite* compile_sprglauto (const a_pixel* src, a_pixel transp_color, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width); void free_sprglauto (a_sprite* sprite); #endif /* HEROES__SPRGLAUTO__H */ heroes-0.21/src/sprglenz.c0000644004117000411500000000765607376021201011213 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprglenz.h" void draw_sprglenz_custom (const a_sprite *sprite, a_pixel *dest, const a_pixel *glenz_line) { a_pixel *cur = dest; /* current writting possition */ a_u8 *pc; /* program counter */ a_u8 *epc; /* end of program code */ assert (sprite->all.kind == S_RLE_GLENZ); pc = sprite->glenz.code; epc = sprite->glenz.end_code; while (pc < epc) { unsigned m, n; m = *pc++; n = *pc++; if (n == 0 && m == 0) { /* end of line */ cur += sprite->glenz.line_skip; } else { /* skip transparent pixels */ cur += m; /* draw the glenz pixels */ for (; n; --n) { *cur = glenz_line[*cur]; ++cur; } } } } void draw_sprglenz (const a_sprite *sprite, a_pixel *dest) { assert (sprite->all.kind == S_RLE_GLENZ); draw_sprglenz_custom (sprite, dest, sprite->glenz.glenz); } a_sprite *compile_sprglenz (const a_pixel *src, a_pixel transp_color, a_pixel *glenz_line, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width) { a_sprite* sprite; unsigned int row; unsigned int code_size; a_u8 *pc; /* program counter */ /* In the worst case (start with an opaque pixel and alternate transparant and opaque), we need two bytes to encode two pixels, plus two bytes for the first pixel, and two for the end of line. */ code_size = block_height * ((block_width / 2 + 1) * 2 + 2); XMALLOC_VAR (sprite); XMALLOC_ARRAY (sprite->glenz.code, code_size); /* encode the bloc */ pc = sprite->glenz.code; for (row = block_height; row; --row) { unsigned int m, n; const a_pixel *eol = src + block_width; /* end of line */ /* encode a line */ do { /* count the number of transparant pixels */ for (m = 0; src < eol && m < 255 && *src == transp_color; ++src) ++m; /* count the number of glenz pixels */ for (n = 0; src < eol && n < 255 && *src != transp_color; ++src) ++n; /* write the corresponding data */ *pc++ = m; *pc++ = n; } while (src < eol); /* output an end of line */ *pc++ = 0; *pc++ = 0; /* prepare for next line */ src += src_width - block_width; } sprite->glenz.kind = S_RLE_GLENZ; sprite->glenz.draw = draw_sprglenz; sprite->glenz.end_code = pc; sprite->glenz.line_skip = dest_width - block_width; sprite->glenz.glenz = glenz_line; assert (pc < sprite->glenz.code + code_size); return sprite; } void free_sprglenz (a_sprite *prog) { assert (prog->all.kind == S_RLE_GLENZ); free (prog->glenz.code); free (prog); } heroes-0.21/src/sprglenz.h0000644004117000411500000000430507352614753011222 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRGLENZ__H #define HEROES__SPRGLENZ__H /*------------------------------------------------------------------. | transparent sprites whose non-transparent pixel are drawn using a | | glenz line. This is used for trails, amongst other things. | `------------------------------------------------------------------*/ #include "sprrle.h" void draw_sprglenz (const a_sprite *sprite, a_pixel *dest); /* Same as above, but allow to choose the glenz line used */ void draw_sprglenz_custom (const a_sprite *sprite, a_pixel *dest, const a_pixel *glenz_line); a_sprite *compile_sprglenz (const a_pixel *src, a_pixel transp_color, a_pixel *glenz_line, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width); void free_sprglenz (a_sprite *prog); #endif /* HEROES__SPRGLENZ__H */ heroes-0.21/src/sprite.c0000644004117000411500000000421307352614753010655 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprite.h" #include "sprrle.h" #include "sprprog.h" #include "sprzcol.h" #include "sprshade.h" #include "sprglenz.h" #include "spropaque.h" #include "sprunish.h" #include "sprglauto.h" void free_sprite (a_sprite* sprite) { if (!sprite) return; /* dispatch */ switch (sprite->all.kind) { case S_OPAQUE: free_spropaque (sprite); break; case S_RLE: free_sprrle (sprite); break; case S_RLE_ZCOL: free_sprzcol (sprite); break; case S_RLE_SHADE: free_sprshade (sprite); break; case S_RLE_GLENZ: free_sprglenz (sprite); break; case S_RLE_GLENZ_AUTO: free_sprglauto (sprite); break; case S_RLE_UNIC_SHADE: free_sprunish (sprite); break; case S_PROG: case S_PROG_WAV: free_sprprog (sprite); break; } } heroes-0.21/src/sprite.h0000644004117000411500000001533207352614753010666 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRITES__H #define HEROES__SPRITES__H /*-------------------------------------------------------------------. | This file define an abstraction for sprites, i.e., small blocks of | | pixels that can be pasted in memory (but you knew that). | `-------------------------------------------------------------------*/ #include "video.h" /* Different kind of sprites, they are not all used yet. These values should be used *internally* by the sprite handling functions. */ enum sprite_kind { S_OPAQUE, /* opaque (yes!) */ S_RLE, /* transparant */ S_RLE_SHADE, /* transparant, using one line of glenz */ S_RLE_ZCOL, /* transparant, using a kind of color-based z-buffer, for explosions */ S_RLE_GLENZ, /* transparant, using uniform glenz for the rest */ S_RLE_UNIC_SHADE, /* transparant, using a UNIque opaque Color, and one line of glenz */ S_RLE_GLENZ_AUTO, /* transparant, using glenz for some known colors (this is slow) */ S_PROG, /* a list of sprites, to draw all at once */ S_PROG_WAV /* like S_PROG but also wave */ }; typedef union sprite_s a_sprite; typedef void (*sprite_draw_func) (const a_sprite *sprite, a_pixel *dest); /*-------------------------------------------------------------------. | Because the various flavor of sprites are not drawn the same way, | | there exist various drawing functions. There is one drawing | | function for each kind of sprite. | | | | Each sprite contains a pointer to its drawing function. Therefore | | the DRAW_SPRITE macro below is the generic way to draw a sprite. | | It is more efficient, however, to call the right drawing function | | if you know it at compile time. | `-------------------------------------------------------------------*/ #define DRAW_SPRITE(s,dest) ((s)->draw ((s), (dest))) #define SPRITE_FIRST_MEMBER \ sprite_draw_func draw #define SPRITE_COMMON_MEMBERS \ SPRITE_FIRST_MEMBER; \ enum sprite_kind kind /* kind of sprite */ struct sprite_common_s { SPRITE_COMMON_MEMBERS; }; typedef struct sprite_prog_list_s a_sprite_prog_list; /* see sprprog.c */ struct sprite_prog_s { SPRITE_COMMON_MEMBERS; a_sprite_prog_list *list; }; #define SPRITE_RLE_MEMBERS \ SPRITE_COMMON_MEMBERS; \ \ /* The code of an rle-sprite is a sequence of \ 1 a_u8: number m of transparent pixels to skip \ 1 a_u8: number n of bytes to write \ n a_u8: actual bytes to write \ The end of a line can be announced using m=0 and n=0, \ and the code MUST terminate by m=0 and n=0. \ */ \ a_u8* code; \ \ /* a pointer the byte right after the end of code, \ in order to known where to stop. */ \ a_u8* end_code; \ \ /* the number of byte to skip to from the end of a line to the \ beginning of the next one */ \ unsigned int line_skip struct sprite_rle_s { SPRITE_RLE_MEMBERS; }; struct sprite_rle_shade_s { /* shaded sprites reuse the member of RLE, but the code used is extended. The code of a shaded sprite is a sequence of 1 a_u8: number m of transparent pixels to skip 1 a_u8: number n of bytes to write n a_u8: actual bytes to write 1 a_u8: number s of glenz pixels to draw right after The end of a line can be announced using m=0, n=0, and s=0, and the code MUST terminate by m=0, n=0, and s=0. */ SPRITE_RLE_MEMBERS; a_pixel* glenz; }; struct sprite_rle_glenz_s { /* glenz sprites reuse the member of RLE, but the code used is extended. The code of a shaded sprite is a sequence of 1 a_u8: number m of transparent pixels to skip 1 a_u8: number n of glenz pixels to write The end of a line can be announced using m=0, and n=0, and the code MUST terminate by m=0, and n=0. */ SPRITE_RLE_MEMBERS; a_pixel* glenz; }; struct sprite_rle_unic_shade_s { /* shaded sprites reuse the member of RLE, but the code used is extended. The code of a shaded sprite is a sequence of 1 a_u8: number m of transparent pixels to skip 1 a_u8: number n of bytes to write 1 a_u8: number s of glenz pixels to draw right after The end of a line can be announced using m=0, n=0, and s=0, and the code MUST terminate by m=0, n=0, and s=0. */ SPRITE_RLE_MEMBERS; a_pixel* glenz; a_pixel color; /* used to draw opaque pixels */ }; struct sprite_opaque_s { SPRITE_COMMON_MEMBERS; a_pixel* data; /* data to write (concatenated) */ a_pixel* end_data; /* pointer the pixel right after the last in data */ int width; /* number of data to write per line */ int line_skip; /* byte to skip at the end of a line, to jump to the next one. */ }; union sprite_s { SPRITE_FIRST_MEMBER; struct sprite_common_s all; struct sprite_prog_s prog; struct sprite_rle_s rle; struct sprite_rle_shade_s shade; struct sprite_rle_glenz_s glenz; struct sprite_opaque_s opaq; struct sprite_rle_unic_shade_s unish; }; /* generic sprite freeing function, this will dispatch to the right freeing function */ void free_sprite (a_sprite *sprite); #define FREE_SPRITE0(x) \ do { \ if (x) { \ free_sprite (x); \ x = 0; \ } \ } while (0) #endif /* HEROES__SPRITES__H */ heroes-0.21/src/spropaque.c0000644004117000411500000000523307352614753011371 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "spropaque.h" void draw_spropaque (const a_sprite *sprite, a_pixel *dest) { a_pixel *data; /* input position */ a_pixel *edata; /* end of input */ int width; int lskip; assert (sprite->all.kind == S_OPAQUE); data = sprite->opaq.data; edata = sprite->opaq.end_data; width = sprite->opaq.width; lskip = sprite->opaq.line_skip; while (data < edata) { int i = width; while (i--) *dest++ = *data++; dest += lskip; } } a_sprite * compile_spropaque (const a_pixel *src, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width) { a_sprite *sprite; unsigned int row; unsigned int data_size; a_pixel *data; data_size = block_height * block_width; XMALLOC_VAR (sprite); XMALLOC_ARRAY (sprite->opaq.data, data_size); data = sprite->opaq.data; for (row = block_height; row; --row) { memcpy (data, src, block_width); src += src_width; data += block_width; } sprite->opaq.kind = S_OPAQUE; sprite->opaq.draw = draw_spropaque; sprite->opaq.end_data = data; sprite->opaq.width = block_width; sprite->opaq.line_skip = dest_width - block_width; return sprite; } void free_spropaque (a_sprite *prog) { assert (prog->all.kind == S_OPAQUE); free (prog->opaq.data); free (prog); } heroes-0.21/src/spropaque.h0000644004117000411500000000347007352614753011377 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPROPAQUE__H #define HEROES__SPROPAQUE__H /*------------------------. | standard opaque-sprites | `------------------------*/ #include "sprite.h" void draw_spropaque (const a_sprite* sprite, a_pixel* dest); a_sprite* compile_spropaque (const a_pixel* src, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width); void free_spropaque (a_sprite* sprite); #endif /* HEROES__SPROPAQUE__H */ heroes-0.21/src/sprprog.c0000644004117000411500000000713407352614753011050 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprprog.h" #include "generic_list.h" void draw_sprprog (const a_sprite *sprite, a_pixel *dest) { a_sprite_prog_list *list; assert (sprite->all.kind == S_PROG || sprite->all.kind == S_PROG_WAV); for (list = sprite->prog.list; list; list = list->cdr) { a_sprite *s = list->car; s->draw (s, dest + list->offset); } } void draw_sprprog_clipped_left (const a_sprite *sprite, a_pixel *dest, int dest_col, int min_col) { a_sprite_prog_list *list; assert (sprite->all.kind == S_PROG || sprite->all.kind == S_PROG_WAV); for (list = sprite->prog.list; list; list = list->cdr) { a_sprite *s = list->car; if (list->offset + dest_col > min_col) s->draw (s, dest + list->offset); } } void draw_sprprog_clipped_right (const a_sprite *sprite, a_pixel *dest, int dest_col, int max_col) { a_sprite_prog_list *list; assert (sprite->all.kind == S_PROG || sprite->all.kind == S_PROG_WAV); for (list = sprite->prog.list; list; list = list->cdr) { a_sprite *s = list->car; if (list->offset + dest_col < max_col) s->draw (s, dest + list->offset); } } /* internal state */ static a_sprite_prog_list* prog = 0; static a_sprite_prog_list** last = 0; /* we need to save these two state, to allow recursive calls */ NEW_LIST (a_prog, a_sprite_prog_list*, STD_EQUAL, free); NEW_LIST (a_last, a_sprite_prog_list**, STD_EQUAL, free); a_prog_list prog_save = 0; a_last_list last_save = 0; void new_sprprog (void) { a_prog_push (&prog_save, prog); a_last_push (&last_save, last); last = &prog; } void add_sprprog (a_sprite *sprite, int offset) { XMALLOC_VAR (*last); (*last)->car = sprite; (*last)->offset = offset; last = &((*last)->cdr); } void add_sprprog0 (a_sprite *sprite) { add_sprprog (sprite, 0); } a_sprite * end_sprprog (void) { NEW (a_sprite, res); *last = 0; /* terminate the list */ res->prog.kind = S_PROG; res->prog.draw = draw_sprprog; res->prog.list = prog; prog = a_prog_pop (&prog_save); last = a_last_pop (&last_save); return res; } void free_sprprog (a_sprite *sprite) { a_sprite_prog_list *list = sprite->prog.list; while (list) { a_sprite_prog_list *next = list->cdr; free_sprite (list->car); free (list); list = next; } free (sprite); } heroes-0.21/src/sprprog.h0000644004117000411500000000653207352614753011056 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRPROG__H #define HEROES__SPRPROG__H #include "sprite.h" /*-----------------------------------------------------------------. | sprite-programs are singly linked list of sprites, which are all | | drawn at once. | `-----------------------------------------------------------------*/ /* it is safe to call the following on S_PROG_WAV too */ void draw_sprprog (const a_sprite *sprite, a_pixel *dest); void free_sprprog (a_sprite *sprite); /* secondary drawing functions, used in scores_menu: draw only the sprites whose offset are greater than min, or lower than max */ void draw_sprprog_clipped_left (const a_sprite *sprite, a_pixel *dest, int dest_row, int min_row); void draw_sprprog_clipped_right (const a_sprite *sprite, a_pixel *dest, int dest_row, int max_row); /* The following is not thread safe, because when you build a sprprog the state is kept in static variables. But this make the interface friendlier. But it can be called recusrively, i.e. you can build a new prog (new,add...,end) while you are already building another prog. new and end will actually save and restore the context. It is safe to do new_sprprog (); add_sprprog0 (compile_menu_text ("bar", T_CENTERED|T_WAVING, 5, 159)); add_sprprog0 (compile_menu_text ("foo", T_FLUSHED_LEFT, 39, 56)); end_sprprog (); even if compile_menu_text is itself using {new,add,end}_sprprog. */ /* call this to start a new sprprog */ void new_sprprog (void); /* add as many sprites as you wish */ void add_sprprog (a_sprite *sprite, int offset); /* likewise, with offset = 0 */ void add_sprprog0 (a_sprite *sprite); /* finish the sprprog, and return it */ a_sprite *end_sprprog (void); /* The following is an internal definition, which is made public for sprprogwav.c usage. */ struct sprite_prog_list_s { a_sprite_prog_list *cdr; a_sprite *car; int offset; /* offset to add to the destination supplied */ }; #endif /* HEROES__SPRPROG__H */ heroes-0.21/src/sprprogwav.c0000644004117000411500000000462307352614753011566 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprprogwav.h" #include "timer.h" unsigned char text_waving_step = 0; static a_timer text_waving_htimer = 0; void init_text_waving_step (void) { text_waving_htimer = new_htimer (T_LOCAL, HZ (70)); text_waving_step = 0; } void uninit_text_waving_step (void) { free_htimer (text_waving_htimer); } void update_text_waving_step (void) { text_waving_step += read_htimer (text_waving_htimer); } static int waving_offset (int pos) { return ceil (sin (((text_waving_step + pos*2) & 31) * 3.141592653 / 16.0) * 1.7) * xbuf; } void draw_sprprogwav (const a_sprite *sprite, a_pixel *dest) { a_sprite_prog_list *list; int pos = 0; assert (sprite->all.kind == S_PROG || sprite->all.kind == S_PROG_WAV); for (list = sprite->prog.list; list; list = list->cdr) { a_sprite *s = list->car; s->draw (s, dest + list->offset + waving_offset (pos++)); } } a_sprite * end_sprprogwav (void) { a_sprite *s = end_sprprog (); s->all.kind = S_PROG_WAV; /* overwrite */ s->all.draw = draw_sprprogwav; /* overwrite */ return s; } heroes-0.21/src/sprrle.c0000644004117000411500000000705107424074773010663 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprrle.h" void draw_sprrle (const a_sprite *sprite, a_pixel *dest) { a_pixel *cur = dest; /* current writting possition */ a_u8 *pc; /* program counter */ a_u8 *epc; /* end of program code */ assert (sprite->all.kind == S_RLE); pc = sprite->rle.code; epc = sprite->rle.end_code; while (pc < epc) { unsigned m, n; m = *pc++; n = *pc++; if (n == 0 && m == 0) { /* end of line */ cur += sprite->rle.line_skip; } else { cur += m; for (; n; --n) *cur++ = *pc++; } } } a_sprite * compile_sprrle (const a_pixel *src, a_pixel transp_color, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width) { a_sprite* sprite; unsigned int row; unsigned int code_size; a_u8 *pc; /* program counter */ /* In the worst case (start with an opaque pixel and alternate transparant and opaque), we need three bytes to encode two pixels, plus three byte for the first pixel, and two for the end of line. */ code_size = block_height * ((block_width / 2 + 1) * 3 + 2); XMALLOC_VAR (sprite); XMALLOC_ARRAY (sprite->rle.code, code_size); /* encode the bloc */ pc = sprite->rle.code; for (row = block_height; row; --row) { unsigned int m, n; const a_pixel *eol = src + block_width; /* end of line */ /* encode a line */ do { /* count the number of transparant pixels */ for (m = 0; src < eol && m < 255 && *src == transp_color; ++src) ++m; /* count the number of opaque pixels */ for (n = 0; src + n < eol && n < 255 && src[n] != transp_color;) ++n; /* write the corresponding program */ *pc++ = m; *pc++ = n; for (; n; --n) *pc++ = *src++; } while (src < eol); /* output an end of line */ *pc++ = 0; *pc++ = 0; /* prepare for next line */ src += src_width - block_width; } sprite->rle.kind = S_RLE; sprite->rle.draw = draw_sprrle; sprite->rle.end_code = pc; sprite->rle.line_skip = dest_width - block_width; assert (pc < sprite->rle.code + code_size); return sprite; } void free_sprrle (a_sprite *prog) { assert (prog->all.kind == S_RLE); free (prog->rle.code); free (prog); } heroes-0.21/src/sprprogwav.h0000644004117000411500000000461507352614753011574 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRPROGWAV__H #define HEROES__SPRPROGWAV__H #include "sprite.h" #include "sprprog.h" #include "const.h" /*-------------------------------------------------------------------. | S_PROG_WAV is the same as S_PROG, except that the drawing function | | will wave the sprites up and down | `-------------------------------------------------------------------*/ /* it is safe to call the following on S_PROG too */ void draw_sprprogwav (const a_sprite *sprite, a_pixel *dest); /* the following is called inheritance in some languages :o) */ #define free_sprprogwav free_sprprog #define new_sprprogwav new_sprprog #define add_sprprogwav add_sprprog a_sprite *end_sprprogwav (void); #define draw_sprprogwav_if(cond, spr, dest) \ ((cond) ? draw_sprprogwav : draw_sprprog) ((spr), (dest)) /* update_text_waving should be called periodically */ void init_text_waving_step (void); void uninit_text_waving_step (void); void update_text_waving_step (void); extern unsigned char text_waving_step; #endif /* HEROES__SPRPROGWAV__H */ heroes-0.21/src/sprrle.h0000644004117000411500000000345207352614753010667 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRRLE__H #define HEROES__SPRRLE__H /*---------------------. | standard rle-sprites | `---------------------*/ #include "sprite.h" void draw_sprrle (const a_sprite* sprite, a_pixel* dest); a_sprite* compile_sprrle (const a_pixel* src, a_pixel transp_color, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width); void free_sprrle (a_sprite* sprite); #endif /* HEROES__SPRRLE__H */ heroes-0.21/src/sprshade.c0000644004117000411500000001014507424074773011163 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprshade.h" void draw_sprshade (const a_sprite *sprite, a_pixel *dest) { a_pixel *cur = dest; /* current writting possition */ a_u8 *pc; /* program counter */ a_u8 *epc; /* end of program code */ assert (sprite->all.kind == S_RLE_SHADE); pc = sprite->shade.code; epc = sprite->shade.end_code; while (pc < epc) { unsigned m, n; m = *pc++; n = *pc++; if (n == 0 && m == 0 && *pc == 0) { /* end of line */ ++pc; cur += sprite->shade.line_skip; } else { /* skip transparent pixels */ cur += m; /* draw the opaque pixels */ for (; n; --n) *cur++ = *pc++; /* draw the glenz pixels */ for (m = *pc++; m; --m) { *cur = sprite->shade.glenz[*cur]; ++cur; } } } } a_sprite *compile_sprshade (const a_pixel *src, a_pixel transp_color, a_pixel glenz_color, a_pixel *glenz_line, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width) { a_sprite* sprite; unsigned int row; unsigned int code_size; a_u8 *pc; /* program counter */ /* In the worst case (start with an opaque pixel and alternate transparant and opaque), we need four bytes to encode two pixels, plus four bytes for the first pixel, and three for the end of line. */ code_size = block_height * ((block_width / 2 + 1) * 4 + 3); XMALLOC_VAR (sprite); XMALLOC_ARRAY (sprite->shade.code, code_size); /* encode the bloc */ pc = sprite->shade.code; for (row = block_height; row; --row) { unsigned int m, n, s; const a_pixel *eol = src + block_width; /* end of line */ /* encode a line */ do { /* count the number of transparant pixels */ for (m = 0; src < eol && m < 255 && *src == transp_color; ++src) ++m; /* count the number of opaque pixels */ for (n = 0; src + n < eol && n < 255 && src[n] != transp_color && src[n] != glenz_color;) ++n; /* write the corresponding data */ *pc++ = m; *pc++ = n; for (; n; --n) *pc++ = *src++; /* count the number of glenz pixels */ for (s = 0; src < eol && s < 255 && *src == glenz_color; ++src) ++s; /* record it */ *pc++ = s; } while (src < eol); /* output an end of line */ *pc++ = 0; *pc++ = 0; *pc++ = 0; /* prepare for next line */ src += src_width - block_width; } sprite->shade.kind = S_RLE_SHADE; sprite->shade.draw = draw_sprshade; sprite->shade.end_code = pc; sprite->shade.line_skip = dest_width - block_width; sprite->shade.glenz = glenz_line; assert (pc < sprite->shade.code + code_size); return sprite; } void free_sprshade (a_sprite *prog) { assert (prog->all.kind == S_RLE_SHADE); free (prog->shade.code); free (prog); } heroes-0.21/src/sprshade.h0000644004117000411500000000415707352614753011174 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRSHADE__H #define HEROES__SPRSHADE__H /*---------------------------------------------------------------. | transparent sprites that use one color key for glenz. This is | | used to draw dollars (with a shadow line), and other small | | objects. | `---------------------------------------------------------------*/ #include "sprrle.h" void draw_sprshade (const a_sprite *sprite, a_pixel *dest); a_sprite *compile_sprshade (const a_pixel *src, a_pixel transp_color, a_pixel glenz_color, a_pixel *glenz_line, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width); void free_sprshade (a_sprite *prog); #endif /* HEROES__SPRSHADE__H */ heroes-0.21/src/sprtext.c0000644004117000411500000001464307405735300011057 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprtext.h" #include "sprprogwav.h" #include "sprrle.h" #include "sprunish.h" #include "const.h" #include "parafmt.h" /* * Generate a a_sprite that display a text, using a given font. * * Currently, an S_RLE sprite is computed for each character and chained * together in a S_PROG sprite. This can be enhanced: unless waving, * there is no point in computing a S_RLE for each separate character, * it may be better to compute *one* S_RLE for the *whole* string. */ a_sprite * compile_sprtext (const a_fontdata *font, const char *text, enum text_option topt, unsigned int maxwidth, int offset) { unsigned int nspaces; unsigned int text_width = 0; check_message_is_drawable (font, text); if (topt & T_FLUSHED_LEFT) { /* FLUSHED_LEFT or JUSTIFIED */ if (topt & T_FLUSHED_RIGHT) { /* JUSTIFIED */ text_width = compute_text_width (font, text, &nspaces); if (nspaces == 0) { /* we cannot justify a text without spaces */ topt &= ~T_JUSTIFIED; topt |= T_FLUSHED_LEFT; } } } else { /* FLUSHED_RIGHT or CENTERED */ text_width = compute_text_width (font, text, 0); if (topt & T_FLUSHED_RIGHT) /* FLUSHED_RIGHT */ offset -= (int) text_width; else /* CENTERED */ offset -= (int) text_width/2; } new_sprprog (); for (; *text; ++text) { if (*text == ' ') { if ((topt & T_JUSTIFIED) == T_JUSTIFIED) { unsigned int off = (maxwidth - text_width) / nspaces; offset += off; text_width += off; --nspaces; } else offset += font->width[' ']; } else { /* ensure that the letter actually exists before drawing it */ if (font->width[UCHAR (*text)]) add_sprprog (compile_sprrle (font->upper_left[UCHAR (*text)], 0, font->height, font->width[UCHAR (*text)], font->line_size, xbuf), offset); offset += font->width[UCHAR (*text)]; } } if (topt & T_WAVING) return end_sprprogwav (); else return end_sprprog (); } a_sprite * compile_sprtext_color (const a_fontdata *font, const char *text, enum text_option topt, unsigned int maxwidth, int offset) { unsigned int nspaces; unsigned int text_width = 0; unsigned int colors[] = { 255, 111, 127, 143, 159, 16 }; unsigned int c = colors[0]; check_message_is_drawable (font, text); if (topt & T_FLUSHED_LEFT) { /* FLUSHED_LEFT or JUSTIFIED */ if (topt & T_FLUSHED_RIGHT) { /* JUSTIFIED */ text_width = compute_text_width (font, text, &nspaces); if (nspaces == 0) { /* we cannot justify a text without spaces */ topt &= ~T_JUSTIFIED; topt |= T_FLUSHED_LEFT; } } } else { /* FLUSHED_RIGHT or CENTERED */ text_width = compute_text_width (font, text, 0); if (topt & T_FLUSHED_RIGHT) /* FLUSHED_RIGHT */ offset -= (int) text_width; else /* CENTERED */ offset -= (int) text_width/2; } new_sprprog (); for (; *text; ++text) { if (*text == ' ') { if ((topt & T_JUSTIFIED) == T_JUSTIFIED) { unsigned int off = (maxwidth - text_width) / nspaces; offset += off; text_width += off; --nspaces; } else offset += font->width[' ']; } else if (*text == '%') { ++text; switch (*text) { case 'w': c = colors[0]; break; case 'p': c = colors[1]; break; case 'y': c = colors[2]; break; case 'b': c = colors[3]; break; case 'g': c = colors[4]; break; case 'r': c = colors[5]; break; default: goto compile_letter; } } else { compile_letter: /* ensure that the letter actually exists before drawing it */ if (font->width[UCHAR (*text)]) add_sprprog (compile_sprunish (font->upper_left[UCHAR (*text)], 0, 82, glenz[0], c, font->height, font->width[UCHAR (*text)], font->line_size, xbuf), offset); offset += font->width[UCHAR (*text)]; } } if (topt & T_WAVING) return end_sprprogwav (); else return end_sprprog (); } a_sprite * compile_sprpara (const a_fontdata *font, const char *text, enum text_option topt, unsigned int maxwidth, int offset) { char **p = parafmt (text, font->width, maxwidth, font->min_space_width); char **l = p; unsigned voffset = 0; new_sprprog (); while (*l) { add_sprprog (compile_sprtext (font, *l, topt, maxwidth, offset), voffset); voffset += xbuf * (font->line_skip + font->height); ++l; } free_pararray (p); return end_sprprog (); } a_sprite* compile_menu_text (const char *text, enum text_option topt, int row, int col) { return compile_sprtext (menu_font, text, topt, 0, row * xbuf + col); } a_sprite * compile_menu_para (const char *text, enum text_option topt, int row, int col, int maxwidth) { return compile_sprpara (menu_font, text, topt, maxwidth , row * xbuf + col); } a_sprite* compile_deck_text (const char *text, enum text_option topt, int row, int col) { return compile_sprtext (deck_font, text, topt, 0, row * xbuf + col); } a_sprite * compile_bonus_text (const char *text, enum text_option topt, int row, int col) { return compile_sprtext (bonus_font, text, topt, 0, row * xbuf + col); } heroes-0.21/src/sprtext.h0000644004117000411500000000515107352614753011067 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRTEXT__H #define HEROES__SPRTEXT__H #include "sprite.h" #include "fontdata.h" /* Don't change the order of the four first options. The code rely on these values (for instance we must have T_FLUSHED_RIGHT | T_FLUSHED_LEFT == T_JUSTIFIED). */ enum text_option { T_CENTERED = 0, T_FLUSHED_LEFT = 1, T_FLUSHED_RIGHT = 2, T_JUSTIFIED = 3, T_WAVING = 4}; a_sprite *compile_sprtext (const a_fontdata *font, const char *text, enum text_option topt, unsigned int maxwidth, int offset); a_sprite * compile_sprtext_color (const a_fontdata *font, const char *text, enum text_option topt, unsigned int maxwidth, int offset); a_sprite *compile_sprpara (const a_fontdata *font, const char *text, enum text_option topt, unsigned int maxwidth, int offset); /* short-hand functions */ a_sprite *compile_menu_text (const char *text, enum text_option topt, int row, int col); a_sprite *compile_menu_para (const char *text, enum text_option topt, int row, int col, int maxwidth); a_sprite *compile_deck_text (const char *text, enum text_option topt, int row, int col); a_sprite *compile_bonus_text (const char *text, enum text_option topt, int row, int col); #endif /* HEROES__SPRTEXT__H */ heroes-0.21/src/sprunish.c0000644004117000411500000001045607450420655011223 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprunish.h" void draw_sprunish_custom (const a_sprite *sprite, a_pixel *dest, a_pixel color) { a_pixel *cur = dest; /* current writting possition */ a_u8 *pc; /* program counter */ a_u8 *epc; /* end of program code */ assert (sprite->all.kind == S_RLE_UNIC_SHADE); pc = sprite->unish.code; epc = sprite->unish.end_code; while (pc < epc) { unsigned m, n; m = *pc++; n = *pc++; if (n == 0 && m == 0 && *pc == 0) { /* end of line */ ++pc; cur += sprite->unish.line_skip; } else { /* skip transparent pixels */ cur += m; /* draw the opaque pixels */ for (; n; --n) *cur++ = color; /* draw the glenz pixels */ for (m = *pc++; m; --m) { *cur = sprite->shade.glenz[*cur]; ++cur; } } } } void draw_sprunish (const a_sprite *sprite, a_pixel *dest) { assert (sprite->all.kind == S_RLE_UNIC_SHADE); draw_sprunish_custom (sprite, dest, sprite->unish.color); } a_sprite * compile_sprunish (const a_pixel *src, a_pixel transp_color, a_pixel glenz_color, a_pixel *glenz_line, a_pixel opaque_color, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width) { a_sprite* sprite; unsigned int row; unsigned int code_size; a_u8 *pc; /* program counter */ /* In the worst case (start with an opaque pixel and alternate transparant and opaque), we need three bytes to encode two pixels, plus three bytes for the first pixel, and three for the end of line. */ code_size = block_height * ((block_width / 2 + 1) * 3 + 3); XMALLOC_VAR (sprite); XMALLOC_ARRAY (sprite->unish.code, code_size); /* encode the bloc */ pc = sprite->unish.code; for (row = block_height; row; --row) { unsigned int m, n, s; const a_pixel *eol = src + block_width; /* end of line */ /* encode a line */ do { /* count the number of transparant pixels */ for (m = 0; src < eol && m < 255 && *src == transp_color; ++src) ++m; /* count the number of opaque pixels */ for (n = 0; src < eol && n < 255 && *src != transp_color && *src != glenz_color; ++src) ++n; /* count the number of glenz pixels */ for (s = 0; src < eol && s < 255 && *src == glenz_color; ++src) ++s; /* write the corresponding data */ *pc++ = m; *pc++ = n; *pc++ = s; } while (src < eol); /* output an end of line */ *pc++ = 0; *pc++ = 0; *pc++ = 0; /* prepare for next line */ src += src_width - block_width; } sprite->unish.kind = S_RLE_UNIC_SHADE; sprite->unish.draw = draw_sprunish; sprite->unish.end_code = pc; sprite->unish.line_skip = dest_width - block_width; sprite->unish.glenz = glenz_line; sprite->unish.color = opaque_color; assert (pc < sprite->unish.code + code_size); return sprite; } void free_sprunish (a_sprite *prog) { assert (prog->all.kind == S_RLE_UNIC_SHADE); free (prog->unish.code); free (prog); } heroes-0.21/src/sprunish.h0000644004117000411500000000434407352614753011234 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRUNISH__H #define HEROES__SPRUNISH__H /*---------------------------------------------------------------. | transparent sprites that use one color key for glenz and one | | unique colore for opaque pixel. This is used to draw the "Get | | this bonus" arrow. | `---------------------------------------------------------------*/ #include "sprite.h" void draw_sprunish (const a_sprite *sprite, a_pixel *dest); void draw_sprunish_custom (const a_sprite *sprite, a_pixel *dest, a_pixel color); a_sprite *compile_sprunish (const a_pixel *src, a_pixel transp_color, a_pixel glenz_color, a_pixel *glenz_line, a_pixel opaque_color, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width); void free_sprunish (a_sprite *prog); #endif /* HEROES__SPRSHADE__H */ heroes-0.21/src/sprzcol.c0000644004117000411500000000466307352614753011054 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "sprzcol.h" void draw_sprzcol (const a_sprite *sprite, a_pixel *dest) { a_pixel *cur = dest; /* current writting possition */ a_u8 *pc; /* program counter */ a_u8 *epc; /* end of program code */ assert (sprite->all.kind == S_RLE_ZCOL); pc = sprite->rle.code; epc = sprite->rle.end_code; while (pc < epc) { unsigned m, n; m = *pc++; n = *pc++; if (n == 0 && m == 0) { /* end of line */ cur += sprite->rle.line_skip; } else { cur += m; for (; n; --n) { a_pixel curcol; curcol = *cur; if (curcol > 15 || curcol < *pc) *cur = *pc; ++pc; ++cur; } } } } a_sprite * compile_sprzcol (const a_pixel *src, a_pixel transp_color, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width) { a_sprite *tmp = compile_sprrle (src, transp_color, block_height, block_width, src_width, dest_width); tmp->all.kind = S_RLE_ZCOL; tmp->all.draw = draw_sprzcol; return tmp; } void free_sprzcol (a_sprite *prog) { prog->all.kind = S_RLE; free_sprrle (prog); } heroes-0.21/src/sprzcol.h0000644004117000411500000000361307352614753011053 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__SPRZCOL__H #define HEROES__SPRZCOL__H /*---------------------------------------------------. | standard `z-colored' sprites (used for explosions) | `---------------------------------------------------*/ #include "sprrle.h" void draw_sprzcol (const a_sprite *sprite, a_pixel *dest); a_sprite *compile_sprzcol (const a_pixel *src, a_pixel transp_color, unsigned int block_height, unsigned int block_width, unsigned int src_width, unsigned int dest_width); void free_sprzcol (a_sprite *prog); #endif /* HEROES__SPRZCOL__H */ heroes-0.21/src/structs.h0000644004117000411500000001354107352614753011067 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES__STRUCTS__H #define HEROES__STRUCTS__H #include "lvl.h" /*----------------------- directions constants -----------------------*/ #define d_up 1 #define d_right 2 #define d_down 4 #define d_left 8 #define w_up 0 #define w_right 1 #define w_down 2 #define w_left 3 /*------------------- collide test constants -------------------*/ #define c_down 1 #define c_left 2 #define c_up 4 #define c_right 8 /*-------------------- tile types ---------------------*/ #define type_nbr 9 /* number of types */ #define t_none 0 #define t_stop 1 #define t_speed 2 /* info in: dalemem.info.param[] */ #define t_tunnel 3 /* info in: dalemem.info.tunnel */ #define t_boom 4 #define t_anim 5 /* info in: dalemem.info.anim */ #define t_ice 6 /* info in: dalemem.info.param[] */ #define t_dust 7 /* info in: dalemem.info.param[] */ #define t_outway 8 /*------------------- tiles structures --------------------*/ typedef struct { a_u32 output; /* tempo was never used with tunnels. The original purpose was to delay the player underground (for the time given by delay, computed by the level editor from the length of the tunnel). Its has been abandoned because handling of vehicles "out of the map" would complexify the game internals. FIXME: If we can make sure that tempo is 0 in *all* level files, the two fields below should better be replaced by a_u8 direction; */ #ifdef WORDS_BIGENDIAN a_u8 tempo:4; a_u8 direction:4; #else a_u8 direction:4; a_u8 tempo:4; #endif } ATTRIBUTE_PACKED a_tunnel; typedef struct { a_u8 frame_nbr; a_u8 speed; /* in VBL */ } ATTRIBUTE_PACKED an_anim; typedef union { a_u8 param[5]; a_tunnel tunnel; an_anim anim; } ATTRIBUTE_PACKED a_param; typedef struct { a_u32 number; a_u8 collision[4]; a_u16 sprite; a_param info; a_u8 type; } ATTRIBUTE_PACKED a_tile; /* 16 bytes */ typedef struct { a_u8 collision[4]; a_param info; a_u8 type; } ATTRIBUTE_PACKED a_tile_info; /* 10 bytes */ #define FILENAME_SIZE 8 typedef struct { a_u32 xt; a_u32 yt; a_u32 xwrap; a_u32 ywrap; a_u32 start[4]; /* starting tile */ a_u8 start_way[4]; /* starting direction and square */ char tile_set_name[FILENAME_SIZE + 1]; char soundtrack_name[FILENAME_SIZE + 1]; char unused[10]; } ATTRIBUTE_PACKED a_level_header; /* 64 bytes */ /*------------------ player records -------------------*/ /* these two structures are used to access the higher and lower part of a a_u32 */ typedef struct { #ifdef WORDS_BIGENDIAN a_u16 h, l; #else a_u16 l, h; #endif } hl; typedef union { a_u32 e; hl h; } ehl; typedef struct { int x, y; /* position */ int x2, y2; /* position square_occupied; */ int pos; /* address square */ int v; /* speed */ int vi; /* additional speed */ int vitt; /* speed to reach */ int vitp; /* current speed */ ehl d; /* offset */ a_dir way, next_way, old_way, old_old_way, tunnel_way; int delay; /* delay frames (FIXME: don't use frames) */ int spec; /* special event (tunnel,ice,death) */ int div; /* misc. (tunnel) */ int inversed_controls; /* inverted commands */ unsigned int score; /* points */ unsigned int score_delta; /* points++ */ int turbo_level; /* turbo left */ int turbo_level_delta; /* turbo left++ */ int speedup; /* bonus speedup or speeddown */ int rotozoom; /* roto */ int rotozoom_direction; int waves; int waves_begin; int fire_trail; int invincible; /* blinking */ int lifes; /* lifes LEFT */ int turbo; char notify_delay; /* a pause is coming */ char tunnel_inverse; char autopilot; char cpu; /* 0: local CPU [1: remote CPU] */ /* 2: player local [,3: player distant] */ int ia_max_depth; /* recusrion depth for CPU (keep <= 7, or it will be slow) */ int behaviour; /* 0.follower 1.bonus eater 2.squisher 3...*/ int target; /* target to follow */ int lemmings_nbr; int martians_nbr; /* ;-) */ int time; int cash; /* ... or colors */ int wins; /* games win */ } a_player; typedef struct a_lemming a_lemming; struct a_lemming { unsigned int pos_head, pos_tail; /* positions */ unsigned int min; /* position in the tile */ a_lemming *next_dead; /* next stain in the tile */ a_dir dir; int couleur; char dead; }; /*----------------------- game modes -------------------------*/ #define M_QUEST 0 #define M_DEATHM 1 #define M_KILLEM 2 #define M_TCASH 3 #define M_COLOR 4 #endif /* HEROES__STRUCTS__H */ heroes-0.21/src/system.h0000644004117000411500000003426207424071051010673 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ /* * Every .c file SHOULD include this file as the FIRST. * * It defines macros needed for portability, and includes system * headers that may be needed by some parts of the game. This means * that all .c files will therefore include all these system headers, * even if they don't need it; but since most of these headers can * have different names or may not be needed at all on some systems, * its safer if the selection is done in one unique place. * * Since this file is always included first, local .h files can assume * that this file has already been included. * * Do NOT include local headers (except config.h), only system * headers are included here. */ #ifndef HEROES__SYSTEM__H #define HEROES__SYSTEM__H #include "config.h" #include #include #if STDC_HEADERS # include #endif #include #include #if HAVE_FCNTL_H # include #else # include #endif #include #include #include #if HAVE_STRING_H # if HAVE_MEMORY_H && ! STDC_HEADERS # include # endif # include #else # if HAVE_STRINGS_H # include # endif #endif #if HAVE_UNISTD_H # include #endif #if HAVE_DIRENT_H # include #else # define dirent direct # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif #endif #if HAVE_DIRECT_H # include #endif #if HAVE_IO_H # include #endif #if HAVE_VPRINTF || HAVE_DOPRNT # if STDC_HEADERS # include # define VA_START(args, lastarg) va_start(args, lastarg) # else # include # define VA_START(args, lastarg) va_start(args) # endif #else # define va_alist a1, a2, a3, a4, a5, a6, a7, a8 # define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; #endif #if TIME_WITH_SYS_TIME # include # include #else # if HAVE_SYS_TIME_H # include # else # include # endif #endif #if HAVE_MMAP # include #endif #if HAVE_GETOPT_H && HAVE_GETOPT_LONG # include #else /* Getopt is not available on this system so we use the embedded getopt.h header. However, this header uses variables named __argc and __argv which are the name of macros defined in MinGW's "stdlib.h" and used in many other MinGW headers. We could modify getopt.h, but this files comes from the GNU libc and changing it locally would make updates harder. So instead we just disable __argc and __argv for the time getopt.h is included. Puke, puke, puke. */ # ifdef __argc # define HEROES__saved__argc __argc # undef __argc # endif # ifdef __argv # define HEROES__saved__argv __argv # undef __argv # endif # include "getopt.h" # ifdef HEROES__saved__argc # define __argc HEROES__saved__argc # undef HEROES__saved__argc # endif # ifdef HEROES__saved__argv # define __argv HEROES__saved__argv # undef HEROES__saved__argv # endif #endif /* Take care of NLS matters. */ #if HAVE_LOCALE_H # include #endif #if !HAVE_SETLOCALE # define setlocale(Category, Locale) /* empty */ #endif #if ENABLE_NLS # include # define _(Text) gettext (Text) #else # undef bindtextdomain # define bindtextdomain(Domain, Directory) /* empty */ # undef textdomain # define textdomain(Domain) /* empty */ # define _(Text) Text # define ngettext(msg1, msg2, n) ((n) == 1 ? (msg1) : (msg2)) #endif #define N_(Text) Text #if HAVE_WINDOWS_H # include # if ! HAVE_READDIR /* should be included after io.h */ # include "w_dirent.h" # endif # if ! HAVE_SLEEP # define sleep(x) (Sleep ((x) * 1000)) # endif #endif /* boolean type */ #if HAVE_STDBOOL_H # include #else typedef enum {false = 0, true = 1} bool; #endif #ifndef M_PI # define M_PI 3.14159265358979323846 /* pi */ #endif #ifndef M_PI_2 # define M_PI_2 1.57079632679489661923 /* pi/2 */ #endif #ifndef M_PI_4 # define M_PI_4 0.78539816339744830962 /* pi/4 */ #endif /* common integer sizes */ #if HAVE_STDINT_H # include typedef uint32_t a_u32; typedef uint16_t a_u16; typedef uint8_t a_u8; typedef int32_t a_s32; typedef int16_t a_s16; typedef int8_t a_s8; #define U16_MAX UINT16_MAX #define U32_MAX UINT32_MAX #else typedef unsigned int a_u32; typedef unsigned short int a_u16; typedef unsigned char a_u8; typedef signed int a_s32; typedef signed short int a_s16; typedef signed char a_s8; #define U16_MAX (0xffffU) #define U32_MAX (0xffffffffU) #endif #if ! HAVE_SSIZE_T typedef int ssize_t; #endif typedef a_u32 a_keycode; /* FIXME: move to media/ */ #define UCHAR(c) ((unsigned char) (c)) /* xalloc.h (from fileutils.h) define __attribute__ only for gcc >= 2.8 (according to the ChangeLog this is needed for OPENStep 4.2 cc) while we want to allow __attribute__ for gcc >= 2.7 in Heroes (because 2.7.2 is still widely used and __attribute__((packed)) is mandatory). So we need to undefine __attribute__ after xalloc has been included. */ #ifndef __attribute__ /* remember that __attribute has to be undefined after inclusion */ # define undefine__attribute__ #endif #include "xalloc.h" #ifdef undefine__attribute__ # undef __attribute__ # undef undefine__attribute__ #endif /* Like XFREE, but also zeroes Var */ #define XFREE0(Var) \ do { \ if (Var) { \ free (Var); \ (Var) = 0; \ } \ } while (0) #define XCALLOC_ARRAY(Array, N_items) \ Array = xcalloc (sizeof (*(Array)), (N_items)) #define XMALLOC_ARRAY(Array, N_items) \ Array = xmalloc (sizeof (*(Array)) * (N_items)) #define XREALLOC_ARRAY(Array, N_items) \ Array = xrealloc ((Array), sizeof (*(Array)) * (N_items)) #define XMALLOC_VAR(Var) XMALLOC_ARRAY ((Var), 1) #define XCALLOC_VAR(Var) XCALLOC_ARRAY ((Var), 1) /* Like XMALLOC_ARRAY but also performs a memSet */ #define XSALLOC_ARRAY(Array, N_items, Val) \ do { \ XMALLOC_ARRAY ((Array), (N_items)); \ memset ((Array), (Val), sizeof (*(Array)) * (N_items)); \ } while (0) #if HAVE_MTRACE # include #else # define mtrace() # define muntrace() #endif /* keep this header at the end of the include list, because it may define some macros to change the declaration of malloc functions */ #if HAVE_DMALLOC_H # define DMALLOC_FUNC_CHECK # include #endif #if HAVE_MPATROL_H # include #endif /* miscellaneous prototypes for replacement functions */ #if ! HAVE_DECL_STRCASECMP int strcasecmp (const char *s1, const char *s2); #endif #if ! HAVE_DECL_STPCPY # ifndef stpcpy char *stpcpy (const char *s1, const char *s2); # endif #endif #if HAVE_MKDIR # if MKDIR_TAKES_ONE_ARG # define mkdir(a,b) mkdir(a) # endif #else # if HAVE__MKDIR # define mkdir(a,b) _mkdir(a) # else # error "Don't know how to create a directory on this system." # endif #endif /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in fcntl.h */ #if !defined O_BINARY && defined _O_BINARY /* For MSC-compatible compilers. */ # define O_BINARY _O_BINARY # define O_TEXT _O_TEXT #endif #ifdef __BEOS__ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif #ifndef O_BINARY /* On reasonable systems, binary I/O is the default. */ # define O_BINARY 0 # define O_TEXT 0 #endif /* Define S_ISDIR if it isn't already defined in sys/stat.h */ #if defined(S_IFDIR) && !defined(S_ISDIR) # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) #endif /* Re-define S_ISDIR if the native implementation is broken. According to the autoconf info-file this is the case for Tektronix UTekV, Amdahl UTS and Motorola System V/88 */ #if defined(STAT_MACROS_BROKEN) # undef S_ISDIR # define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) #endif #if !S_IRUSR && S_IREAD # define S_IRUSR S_IREAD #endif #if !S_IRUSR # define S_IRUSR 00400 #endif #if !S_IRGRP # define S_IRGRP (S_IRUSR >> 3) #endif #if !S_IROTH # define S_IROTH (S_IRUSR >> 6) #endif #if !S_IWUSR && S_IWRITE # define S_IWUSR S_IWRITE #endif #if !S_IWUSR # define S_IWUSR 00200 #endif #if !S_IWGRP # define S_IWGRP (S_IWUSR >> 3) #endif #if !S_IWOTH # define S_IWOTH (S_IWUSR >> 6) #endif #if !S_IXUSR && S_IEXEC # define S_IXUSR S_IEXEC #endif #if !S_IXUSR # define S_IXUSR 00100 #endif #if !S_IXGRP # define S_IXGRP (S_IXUSR >> 3) #endif #if !S_IXOTH # define S_IXOTH (S_IXUSR >> 6) #endif #if !S_IRWXU # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) #endif #if !S_IRWXG # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) #endif #if !S_IRWXO # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) #endif /* S_IXUGO is a common extension to POSIX.1. */ #if !S_IXUGO # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) #endif #ifndef S_IRWXUGO # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO) #endif #ifndef S_IRUGO # define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) #endif #ifndef S_IWUGO # define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) #endif #ifndef S_IRWUGO # define S_IRWUGO (S_IRUGO | S_IWUGO) #endif /* ===== The following ctype definition are stolen from textutils ===== */ /* Jim Meyering writes: "... Some ctype macros are valid only for character codes that isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when using /bin/cc or gcc but without giving an ansi option). So, all ctype uses should be through macros like ISPRINT... If STDC_HEADERS is defined, then autoconf has verified that the ctype macros don't need to be guarded with references to isascii. ... Defining isascii to 1 should let any compiler worth its salt eliminate the && through constant folding." Bruno Haible adds: "... Furthermore, isupper(c) etc. have an undefined result if c is outside the range -1 <= c <= 255. One is tempted to write isupper(c) with c being of type `char', but this is wrong if c is an 8-bit character >= 128 which gets sign-extended to a negative value. The macro ISUPPER protects against this as well." */ #if STDC_HEADERS || (!defined (isascii) && !HAVE_ISASCII) # define IN_CTYPE_DOMAIN(c) 1 #else # define IN_CTYPE_DOMAIN(c) isascii(c) #endif #ifdef isblank # define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank (c)) #else # define ISBLANK(c) ((c) == ' ' || (c) == '\t') #endif #ifdef isgraph # define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isgraph (c)) #else # define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint (c) && !isspace (c)) #endif /* This is defined in on at least Solaris2.6 systems. */ #undef ISPRINT #define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint (c)) #define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum (c)) #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c)) #define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl (c)) #define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c)) #define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct (c)) #define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c)) #define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper (c)) #define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit (c)) #define ISDIGIT_LOCALE(c) (IN_CTYPE_DOMAIN (c) && isdigit (c)) #if STDC_HEADERS # define TOLOWER(Ch) tolower (Ch) # define TOUPPER(Ch) toupper (Ch) #else # define TOLOWER(Ch) (ISUPPER (Ch) ? tolower (Ch) : (Ch)) # define TOUPPER(Ch) (ISLOWER (Ch) ? toupper (Ch) : (Ch)) #endif /* ISDIGIT differs from ISDIGIT_LOCALE, as follows: - Its arg may be any int or unsigned int; it need not be an unsigned char. - It's guaranteed to evaluate its argument exactly once. - It's typically faster. Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that only '0' through '9' are digits. Prefer ISDIGIT to ISDIGIT_LOCALE unless it's important to use the locale's definition of `digit' even when the host does not conform to Posix. */ #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) /* ===== end of ctype definitions ===== */ #if ! HAVE_SETGID # if HAVE_SETREGID # define setuid(X) setreuid(X,X) # define setgid(X) setregid(X,X) # else # define setuid(X) # define setgid(X) # endif #endif #if ! HAVE_SETEGID # if HAVE_SETREGID # define seteuid(X) setreuid(-1,X) # define setegid(X) setregid(-1,X) # else # define seteuid(x) # define setegid(x) # endif #endif #if ! HAVE_SETREGID # define setreuid(x,y) # define setregid(x,y) #endif #if ! HAVE_GETEGID # define geteuid() 0 # define getuid() 0 # define getegid() 0 # define getgid() 0 #endif #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__ # define __attribute__(x) # endif #endif #ifndef ATTRIBUTE_NORETURN # define ATTRIBUTE_NORETURN __attribute__ ((noreturn)) #endif #ifndef ATTRIBUTE_UNUSED # define ATTRIBUTE_UNUSED __attribute__ ((unused)) #endif #ifndef ATTRIBUTE_PACKED # define ATTRIBUTE_PACKED __attribute__ ((packed)) #endif #ifndef ATTRIBUTE_PRINTF # define ATTRIBUTE_PRINTF(str,fst) __attribute__ ((format (printf, str, fst))) #endif #ifndef PTR_TO_INT # define PTR_TO_INT(P) (((char *) P) - (char *) 0) #endif #ifndef INT_TO_PTR # define INT_TO_PTR(P, TYPE) ((P) + ((TYPE) *) 0) #endif #endif /* HEROES__SYSTEM__H */ heroes-0.21/src/timer.c0000644004117000411500000001512407352614753010472 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "timer.h" #include "video.h" #include "debugmsg.h" time_type current_time; void reset_htimer (a_timer timer) { #if HAVE_GETTIMEOFDAY /*-----------------------------------------------------------------. | NOTE: This function used to perform a struct assignment. But it | | cause the gcc shipped with Red Hat 7.0 [gcc version 2.96 | | 20000731 (Red Hat Linux 7.0)] to produce unfaithful code when | | inlining the call to reset_htimer() in read_htimer(). Using | | member assignments appears to work around the bug HERE. | `-----------------------------------------------------------------*/ timer->orig_time.tv_sec = current_time.tv_sec; timer->orig_time.tv_usec = current_time.tv_usec; #else timer->orig_time = current_time; #endif } #if HAVE_GETTIMEOFDAY /* Subtract the `struct timeval' values X and Z, storing the result in RES_SEC, RES_USEC (unless they are NULL pointers). Return 1 if the difference is negative, otherwise 0. (adapted from the GNU libc6 manual to not modify arguments, and return res_sec and res_usec separately) */ static int timeval_subtract (long *res_sec, long *res_usec, const time_type *x, const time_type *z) { time_type y = *z; /* Perform the carry for the later subtraction by updating Y. */ if (x->tv_usec < y.tv_usec) { int nsec = (y.tv_usec - x->tv_usec) / SECOND + 1; y.tv_usec -= SECOND * nsec; y.tv_sec += nsec; } if (x->tv_usec - y.tv_usec > SECOND) { int nsec = (x->tv_usec - y.tv_usec) / SECOND; y.tv_usec += SECOND * nsec; y.tv_sec -= nsec; } /* Compute the time remaining to wait. `tv_usec' is certainly positive. */ if (res_sec) *res_sec = x->tv_sec - y.tv_sec; if (res_usec) *res_usec = x->tv_usec - y.tv_usec; /* Return 1 if result is negative. */ return x->tv_sec < y.tv_sec; } static time_type last_time; /* last time returned by gettimeofday */ /* make sure the times returned by gettimeofday are increasing... */ static void xgettimeofday (time_type *tv) { time_type t; gettimeofday (&t, 0); if (timeval_subtract (0, 0, &t, &last_time)) dmsg (D_TIMER, "successive calls to gettimeofday() returned decreasing values"); else last_time = t; *tv = last_time; } #endif void reset_htimer_with_offset (a_timer timer, long sec) { reset_htimer (timer); #ifdef HAVE_GETTIMEOFDAY timer->orig_time.tv_sec -= sec; #else timer->orig_time -= sec * SECOND; #endif } a_timer new_htimer (enum htimer_kind kind, long slice_duration) { a_timer result; XMALLOC_VAR (result); result->kind = kind; result->slice_duration = slice_duration; reset_htimer (result); dmsg (D_TIMER, "created new timer (kind=%d, slice_duration=%ld)=%p", kind, slice_duration, &result); return result; } void free_htimer (a_timer timer) { dmsg (D_TIMER, "free timer %p", timer); XFREE (timer); } void update_htimers (void) { #ifdef HAVE_GETTIMEOFDAY xgettimeofday (¤t_time); #else current_time = get_current_time (); #endif } void init_htimer (void) { #if HAVE_GETTIMEOFDAY gettimeofday (&last_time, 0); #endif update_htimers (); } long read_htimer (a_timer timer) { #if HAVE_GETTIMEOFDAY long s, u, d, res; timeval_subtract (&s, &u, ¤t_time, &timer->orig_time); d = timer->slice_duration; for (;;) { /* The following formula computes `(s*SECOND+u)/d', trying to not overflow (obviously `s*SECOND+u' is likely to be too big) */ res = (s*(SECOND/d)) + ((s*(SECOND%d))/d) + ((((s*(SECOND%d))%d)+u)/d); if ((res > 0) || (((timer->kind & T_BLOCKING) == 0))) break; else { /* The timer is blocking */ struct timeval present_time; xgettimeofday (&present_time); timeval_subtract (&s, &u, &present_time, &timer->orig_time); } } assert (res >= 0); if (timer->kind & T_LOCAL) { reset_htimer (timer); /* account for the time remaining from the last unfinished slice */ timer->orig_time.tv_usec -= (((s*(SECOND%d))%d)+u)%d; while (timer->orig_time.tv_usec < 0) { timer->orig_time.tv_usec += SECOND; --timer->orig_time.tv_sec; } } #else unsigned long c, d, res; c = current_time - timer->orig_time; d = timer->slice_duration; for (;;) { res = c / d; if ((res > 0) || (((timer->kind & T_BLOCKING) == 0))) break; else /* The timer is blocking */ c = get_current_time () - timer->orig_time; } if (timer->kind & T_LOCAL) { reset_htimer (timer); /* account for the time remaining from the last unfinished slice */ timer->orig_time -= c % d; } #endif dmsg (D_TIMER, "read timer %p, return %ld", timer, res); return res; } void shift_htimer (a_timer to_shift, a_timer amount) { #if HAVE_GETTIMEOFDAY long u,s; /* compute the amount to shift the timer with */ s = current_time.tv_sec - amount->orig_time.tv_sec; u = current_time.tv_usec - amount->orig_time.tv_usec; if (u < 0) { u += SECOND; --s; } /* add this amount from the timer's origin */ to_shift->orig_time.tv_usec += u; to_shift->orig_time.tv_sec += s; if (to_shift->orig_time.tv_usec >= SECOND) { to_shift->orig_time.tv_usec -= SECOND; ++to_shift->orig_time.tv_sec; } #else to_shift->orig_time += current_time - amount->orig_time; #endif dmsg (D_TIMER, "timer %p shifted", to_shift); } heroes-0.21/src/timer.h0000644004117000411500000000525607352614753010504 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__TIMER__H #define HEROES__TIMER__H /* If gettimeofday() does not exists, we use timeGetTime(), or clock() */ #if HAVE_GETTIMEOFDAY # define SECOND 1000000 typedef struct timeval time_type; #else # if HAVE_WINDOWS_H # define SECOND 1000 # define get_current_time timeGetTime typedef DWORD time_type; # else # define SECOND CLOCKS_PER_SEC # define get_current_time clock typedef clock_t time_type; # endif #endif #define HZ(x) (SECOND/(x)) /* A global timer returns durations between the reset of the timer and the current time, a local timer returns durations between two successive reads. Blocking timers will wait until they can return on non null number of slices on read_htimer. */ enum htimer_kind { T_GLOBAL = 0, T_LOCAL = 1, T_BLOCKING = 2}; typedef struct { time_type orig_time; enum htimer_kind kind; long slice_duration; /* duration of a slice in microseconds */ } htimer_s; typedef htimer_s* a_timer; a_timer new_htimer (enum htimer_kind kind, long slice_duration); void free_htimer (a_timer timer); void reset_htimer (a_timer timer); void reset_htimer_with_offset (a_timer timer, long sec); long read_htimer (a_timer timer); /* return elapsed time in slices */ void update_htimers (void); void init_htimer (void); void shift_htimer (a_timer to_shift, a_timer amount); #endif /* HEROES__TIMER__H */ heroes-0.21/src/userconf.c0000644004117000411500000001324607450420655011174 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "userdir.h" #include "misc.h" #include "getshline.h" #include "userconf.h" #include "argv.h" #include "extras.h" #include "musicfiles.h" #include "rsc_files.h" #include "debugmsg.h" #include "errors.h" #include "vars.h" #include "persona.h" int read_userconf (const char* file, bool secure) { FILE* fs; int firstline = 0, endline = 0; char* buf = 0; size_t bufsize = 0; #define MAX_ARGC 10 dmsg (D_SECTION|D_FILE, "reading configuration file: %s ...", file); fs = fopen (file, "r"); if (!fs) { dmsg (D_SECTION|D_FILE, "... could not open."); dperror ("fopen"); return 0; } while (getshline_numbered (&firstline, &endline, &buf, &bufsize, fs) != -1) { int argc; char* argv[MAX_ARGC]; argv[0] = strtok (buf, " \t\n"); if (!strcasecmp (argv[0], "Options:")) { /* fetch the options */ argc = 1; while (argc < MAX_ARGC) { argv [argc] = strtok (0, " \t\n"); if (argv[argc] == 0) break; else ++argc; } /* process the options */ { int err; argv[0] = 0; err = parse_argv (argc, argv, file, firstline); if (err) return err; } } else if (!strcasecmp (argv[0], "setenv:")) { char *s; /* get the variable name */ argv [1] = strtok (0, " \t\n"); if (argv[1] == 0) { wmsg (_("%s:%d: missing variable name"), file, firstline); goto non_fatal_error; } argv[2] = strtok (0, "\n"); dmsg (D_SYSTEM, "setenv(%s,%s)", argv[1], argv[2]); XMALLOC_ARRAY (s, strlen (argv[1]) + strlen (argv[2]) + 2); sprintf (s, "%s=%s", argv[1], argv[2]); putenv (s); /* Can't free s, because most implementation of putenv will not copy the string but add the pointer to the environment directly. So we create a memory leak, but in this case it doesn't really matters. FIXME: Use setenv when possible. Provide a setenv implementation (using putenv) for architectures lacking putenv. */ /* free (s); */ } else if (!strcasecmp (argv[0], "extradir:")) { argv[1] = strtok (0, "\n"); add_extra_directory (argv[1]); } else if (!strcasecmp (argv[0], "soundconf:")) { argv[1] = strtok (0, "\n"); read_sound_config_file (argv[1]); } else if (!strcasecmp (argv[0], "setrsc:")){ /* get the resource name */ argv[1] = strtok (0, " \t\n"); if (argv[1] == 0) { wmsg (_("%s:%d: missing resource name"), file, firstline); goto non_fatal_error; } argv[2] = strtok (0, "\n"); set_rsc_file (argv[1], argv[2], secure); } else if (!strcasecmp (argv[0], "ifdef")){ argv[1] = strtok (0, " \t\n"); if (argv[1] == 0) wmsg (_("%s:%d: missing variable name"), file, firstline); if (argv[1] == 0 || var_get_value (argv[1]) == 0) /* Skip all lines until "endif", this is very basic: it doesn't handled nested ifdef/endif. I don't really care, some day this config file should be parsed by guile or librep and thus be much powerful. */ while (getshline_numbered (&firstline, &endline, &buf, &bufsize, fs) != -1) { argv[0] = strtok (buf, " \t\n"); if (!strcasecmp (argv[0], "endif")) break; } } else if (!strcasecmp (argv[0], "endif")) { /* Ignore. */ } else if (!strcasecmp (argv[0], "keepsgid:")) { if (!secure) emsg (_("%s:%d: " "%s: can only be used from the system configuration file"), file, firstline, "keepsgid"); argv[1] = strtok (0, " \t\n"); if (!strcasecmp (argv[1], "yes")) { keep_sgid = true; } else if (!strcasecmp (argv[1], "no")) { keep_sgid = false; } else { emsg (_("%s:%d: %s: unknown value: %s"), file, firstline, "keepsgid", argv[1]); } } else if (!strcasecmp (argv[0], "keepsuid:")) { if (!secure) emsg (_("%s:%d: " "%s: can only be used from the system configuration file"), file, firstline, "keepsuid"); argv[1] = strtok (0, " \t\n"); if (!strcasecmp (argv[1], "yes")) { keep_suid = true; } else if (!strcasecmp (argv[1], "no")) { keep_suid = false; } else { emsg (_("%s:%d: %s: unknown value: %s"), file, firstline, "keepsuid", argv[1]); } } else { wmsg (_("%s:%d: unknown keyword `%s'"), file, firstline, argv[0]); return 1; } non_fatal_error: ; } free (buf); fclose (fs); dmsg (D_SECTION|D_FILE, "... finished reading %s.", file); return 0; } heroes-0.21/src/userconf.h0000644004117000411500000000274707352614753011212 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__USERCONF__H #define HEROES__USERCONF__H int read_userconf (const char* file, bool secure); #endif /* HEROES__USERCONF__H */ heroes-0.21/src/userdir.c0000644004117000411500000000500207353601453011013 /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "userdir.h" #include "debugmsg.h" #include "errors.h" #include "rsc_files.h" #include "dirname.h" char* userdir = 0; /* Test if a file exists and is a directory */ int exists_dir (char* dir) { struct stat s; int err = stat (dir, &s); if (err) { if (errno == ENOENT) return 0; dperror ("stat"); return -1; } if (!S_ISDIR(s.st_mode)) { wmsg ("`%s' is not a directory.\n", dir); return -1; } return 1; } /* create the $(user-dir) directory, if needed */ int setup_userdir (void) { dmsg (D_SECTION,"user directory setup"); if (userdir) free (userdir); userdir = get_non_null_rsc_file ("user-dir"); strip_trailing_slashes (userdir); { int err = exists_dir (userdir); if (err < 0) return 1; if (err == 0) { if (mkdir (userdir, 0700)) { dperror ("mkdir"); wmsg ("Cannot create directory `%s'.", userdir); return 1; } else { wmsg ("Directory `%s' created.", userdir); } } else { dmsg (D_SYSTEM, "directory `%s' already exists", userdir); } } return 0; } void free_userdir (void) { dmsg (D_SYSTEM, "free userdir"); free (userdir); userdir = 0; } heroes-0.21/src/userdir.h0000644004117000411500000000306307352614753011033 /*------------------------------------------------------------------------. | Copyright 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__USERDIR__H #define HEROES__USERDIR__H extern char* userdir; int exists_dir (char* dir); int setup_userdir (void); /* return !0 if failure */ void free_userdir (void); #endif /* HEROES__USERDIR__H */ heroes-0.21/src/vars.h0000644004117000411500000000307007352614753010327 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef HEROES_VARS_H #define HEROES_VARS_H void var_initialize (void); void var_uninitialize (void); void var_define (const char *name, const char *value); const char *var_get_value (const char* name); void var_print_all (void); #endif /* HEROES_VARS_H */ heroes-0.21/src/vars.c0000644004117000411500000000535207404237314010317 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "hash.h" #include "vars.h" #include "cast.h" typedef struct a_var_entry a_var_entry; struct a_var_entry { char *name; char *value; }; Hash_table *var_hash; static bool var_equ (const void *left, const void *right) { const a_var_entry *l = left; const a_var_entry *r = right; return !strcasecmp (l->name, r->name); } static unsigned var_hasher (const void *data, unsigned size) { const a_var_entry *l = data; return hash_string (l->name, size); } static void var_free (void *data) { a_var_entry *l = data; XFREE (l->name); XFREE (l->value); free (l); } static a_var_entry * var_cons (const char *name, const char *value) { NEW (a_var_entry, v); v->name = name ? xstrdup (name) : 0; v->value = value ? xstrdup (value) : 0; return v; } void var_initialize (void) { var_hash = hash_initialize (17, NULL, var_hasher, var_equ, var_free); if (!var_hash) xalloc_die (); } void var_uninitialize (void) { hash_free (var_hash); } void var_define (const char *name, const char *value) { if (!hash_insert (var_hash, var_cons (name, value))) xalloc_die (); } const char * var_get_value (const char *name) { a_var_entry ve; ve.name = const_cast_string (name); return hash_lookup (var_hash, &ve); } void var_print_all (void) { a_var_entry *cur = hash_get_first (var_hash); while (cur) { printf ("%s = %s\n", cur->name, cur->value); cur = hash_get_next (var_hash, cur); } } heroes-0.21/src/visuals.c0000644004117000411500000003147007352614753011042 /*------------------------------------------------------------------. | Copyright 1997, 1998, 2000, 2001 Alexandre Duret-Lutz | | | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "const.h" #include "video.h" #include "fastmem.h" #include "visuals.h" #include "bytesex.h" #include "timer.h" #include "heroes.h" #include "camera.h" int rotosinus[256]; int rotocosinus[256]; int rotosinus2[256]; int rotocosinus2[256]; signed char moyensinus[512]; int mulxbuf[200]; int angle; a_pixel *srcroto; void rotozoom_buffer (void) { a_pixel *dest = render_buffer[1] + xbuf; int x, y = 200; int debutx, debuty; int inx, iny; int deltax, deltay; int deltax2, deltay2; srcroto = corner[0]; angle = (player[col2plr[0]].rotozoom & 511) >> 1; if (player[col2plr[0]].rotozoom_direction) angle = (-angle) & 255; deltay = rotosinus[angle]; /* 2; */ deltax = rotocosinus[angle]; /* 2; */ deltay2 = rotosinus2[angle]; /* 2; */ deltax2 = rotocosinus2[angle]; /* 2; */ debutx = (160 << 16) - 160 * deltax - 100 * deltax2; debuty = (100 << 16) - 160 * deltay - 100 * deltay2; do { inx = debutx; iny = debuty; x = 320; if ((unsigned) inx >= (320 << 16) || (unsigned) iny >= (200 << 16)) do { *dest++ = 0; inx += deltax; iny += deltay; x--; } while ((unsigned) inx >= (320 << 16) || (unsigned) iny >= (200 << 16)); do { *dest++ = *(srcroto + (((unsigned) inx) >> 16) + mulxbuf[((unsigned) iny) >> 16]); x--; inx += deltax; iny += deltay; } while ((unsigned) inx < (320 << 16) && (unsigned) iny < (200 << 16) && x > 0); if (x > 0) do { *dest++ = 0; x--; } while (x > 0); debutx += deltax2; debuty += deltay2; dest += xbuf - 320; } while (--y); } void rotozoom_half_buffer (int c) { a_pixel *dest = render_buffer[c] + xbuf - 180 + xbuf; int x, y = 200; int debutx, debuty; int inx, iny; int deltax, deltay; int deltax2, deltay2; srcroto = corner[c]; angle = (player[col2plr[c]].rotozoom & 511) >> 1; if (player[col2plr[0]].rotozoom_direction) angle = (-angle) & 255; deltay = rotosinus[angle]; /* 2; */ deltax = rotocosinus[angle]; /* 2; */ deltay2 = rotosinus2[angle]; /* 2; */ deltax2 = rotocosinus2[angle]; /* 2; */ debutx = (80 << 16) - 80 * deltax - 100 * deltax2; debuty = (100 << 16) - 80 * deltay - 100 * deltay2; do { inx = debutx; iny = debuty; x = 160; if ((unsigned) inx >= (160 << 16) || (unsigned) iny >= (200 << 16)) do { *dest++ = 0; inx += deltax; iny += deltay; x--; if (x <= 0) goto endline; } while ((unsigned) inx >= (160 << 16) || (unsigned) iny >= (200 << 16)); do { *dest++ = *(srcroto + (((unsigned) inx) >> 16) + mulxbuf[((unsigned) iny) >> 16]); x--; if (x <= 0) goto endline; inx += deltax; iny += deltay; } while ((unsigned) inx < (160 << 16) && (unsigned) iny < (200 << 16) && x > 0); if (x > 0) do { *dest++ = 0; x--; } while (x > 0); endline: debutx += deltax2; debuty += deltay2; dest += xbuf - 160; } while (--y); } static void horizontal_zoom_wave (a_pixel *src, a_pixel *dest, int oldsize, int newsize) { unsigned long int x = 0; unsigned long int deltax = 4 * (((1 + oldsize) << 16) / newsize); unsigned long int rest = newsize & 3; /* treat pixel by group of four to go faster */ dest -= 4; newsize /= 4; do { a_pixel *s; dest += 4; s = src + (x >> 16); dest[0] = s[0]; dest[1] = s[1]; x += deltax; dest[2] = s[2]; dest[3] = s[3]; } while (--newsize); /* treat the remaining pixels individualy */ dest += 4; deltax /= 4; while (rest--) { a_pixel *s = src + (x >> 16); *dest++ = *s; x += deltax; } } static void horizontal_zoom_flip (a_pixel *src, a_pixel *dest, int oldsize, int newsize) { unsigned long int x = 0; unsigned long int deltax = 2 * (((1 + oldsize) << 16) / newsize); dest -= 2; newsize /= 2; do { a_pixel *s; dest += 2; s = src + (x >> 16); dest[0] = s[0]; x += deltax; dest[1] = s[1]; } while (--newsize); } static void vertical_zoom_wave (a_pixel *src, a_pixel *dest, int oldsize, int newsize) { unsigned long int y = 0; /* current line << 16 */ unsigned long int deltay = ((1 + oldsize) << 16) / newsize; a_u32 tmp1, tmp2; newsize--; do { a_pixel *p; p = src + ((y >> 16) * xbuf); tmp1 = GETWORD(p); p = src + (((y + deltay) >> 16) * xbuf); tmp2 = GETWORD(p); y += deltay << 1; *(a_u32 *) dest = tmp1; *(a_u32 *) (dest + xbuf) = tmp2; dest += xbuf * 2; newsize -= 2; } while (newsize > 0); if (newsize == 0) { a_pixel *p; p = src + ((y >> 16) * xbuf); tmp1 = GETWORD(p); *(a_u32 *) dest = tmp1; } } static int which_line (int y, int a) { float an; a &= 1023; an = a * 2 * 3.1415926535 / 1024; return (ceil ((200.0 * y) / (200.0 * cos (an) - y * sin (an)))); } static int which_column (int y, int a) { float an; a &= 1023; an = a * 2 * 3.1415926535 / 1024; return (ceil (-4 * (sin (an) * y + 200) / 5)); } static int which_offset (int y, int a) { float an; a &= 1023; an = a * 2 * 3.1415926535 / 1024; return (ceil ((-160 * 200) / (y * sin (an) + 200))); } void wave_buffer (void) { int i, p = player[col2plr[0]].waves * 7, left, right, j; int waves_begin = player[col2plr[0]].waves_begin; for (i = 0; i < 320; i += 4) { left = ((16 + moyensinus[(i * 2 + p) & 511]) * waves_begin) / 128; right = ((16 + moyensinus[(i + p) & 511]) * waves_begin) / 128; for (j = 0; j < left; j++) *(a_u32 *) (render_buffer[1] + i + j * xbuf) = 0; vertical_zoom_wave (corner[0] + i, render_buffer[1] + i + left * xbuf, 200, 200 - right - left); for (j = 0; j < right; j++) *(a_u32 *) (render_buffer[1] + i + (200 - j) * xbuf) = 0; } for (i = 0; i < 200; i++) { left = ((16 + moyensinus[(i * 2 + p) & 511]) * waves_begin) / 128; right = ((16 + moyensinus[(i - p) & 511]) * waves_begin) / 128; for (j = 0; j < left; j++) render_buffer[0][i * xbuf + j] = 0; horizontal_zoom_wave (render_buffer[1] + i * xbuf, render_buffer[0] + i * xbuf + left, 320, 320 - right - left); for (j = 0; j < right; j++) render_buffer[0][i * xbuf + 319 - j] = 0; } } void wave_half_buffer (int c) { int i, p = player[col2plr[c]].waves * 7, left, right, j; int waves_begin = player[col2plr[c]].waves_begin; for (i = 0; i < 160; i += 4) { left = ((16 + moyensinus[(i * 2 + p) & 511]) * waves_begin) / 128;; right = ((16 + moyensinus[(i + p) & 511]) * waves_begin) / 128;; for (j = 0; j < left; j++) *(a_u32 *) (render_buffer[c] + 200 + i + j * xbuf) = 0; vertical_zoom_wave (corner[c] + i, render_buffer[c] + 200 + i + left * xbuf, 200, 200 - right - left); for (j = 0; j < right; j++) *(a_u32 *) (render_buffer[c] + 200 + i + (200 - j) * xbuf) = 0; } for (i = 0; i < 200; i++) { left = ((16 + moyensinus[(i * 2 + p) & 511]) * waves_begin) / 128;; right = ((16 + moyensinus[(i - p) & 511]) * waves_begin) / 128;; for (j = 0; j < left; j++) *(render_buffer[c] + i * xbuf + j) = 0; horizontal_zoom_wave (render_buffer[c] + 200 + i * xbuf, render_buffer[c] + i * xbuf + left, 160, 160 - right - left); for (j = 0; j < right; j++) *(render_buffer[c] + i * xbuf + 159 - j) = 0; } } void flip_buffer (int p2) { int i, y, left, j; for (i = 0; i < 200; i++) { y = which_line (i - 100, p2); if (y >= -100 && y < 100) { left = which_offset (y, p2) + 160; if (left >= 0) { y += 100; for (j = 0; j < left; j++) render_buffer[1][i * xbuf + j] = 0; horizontal_zoom_wave (corner[0] + y * xbuf, render_buffer[1] + i * xbuf + left, 320, 320 - left - left); for (j = 320 - left; j < 320; j++) render_buffer[1][i * xbuf + j] = 0; } else { left = which_column (y, p2) + 160; y += 100; horizontal_zoom_flip (corner[0] + y * xbuf + left, render_buffer[1] + i * xbuf, 320 - left - left, 320); } } else { memset (render_buffer[1] + i * xbuf, 0, 320); } } } #define corner_buffer_glenz 1 static void corner_buffer_begin (int i) { int j, k, l; a_pixel *src; a_pixel *dest; a_pixel *dest2; a_pixel *glenzl = glenz[corner_buffer_glenz]; a_pixel *glenzd = glenz[0]; dest2 = corner[0] + xbuf * (200 - i - 1); for (j = 200 - i - 1, l = 0; j < 200; j++, l++) { src = corner[0] + j * xbuf + l; dest = corner[0] + j * xbuf; for (k = l; k != 0; k--) *dest++ = 0; for (k = i + 1; k != 0; k--) { *dest = glenzl[*src]; src += xbuf; dest++; } if (l > 9) { dest[0] = glenzd[dest[0]]; dest[1] = glenzd[dest[1]]; dest[2] = glenzd[dest[2]]; dest[3] = glenzd[dest[3]]; dest[4] = glenzd[dest[4]]; dest[5] = glenzd[dest[5]]; dest[6] = glenzd[dest[6]]; dest[7] = glenzd[dest[7]]; dest[8] = glenzd[dest[8]]; dest[9] = glenzd[dest[9]]; dest[10] = glenzd[dest[10]]; } i--; } for (j = 200 - i - 1, l = 0; j <= 200; j++, l++) { dest2[-xbuf] = glenzd[dest2[-xbuf]]; *dest2 = glenzd[glenzd[*dest2]]; dest2 += xbuf + 1; } } static void corner_buffer_middle (int i) { int j, k, l; a_pixel *src; a_pixel *dest; a_pixel *dest2; a_pixel *glenzl = glenz[corner_buffer_glenz]; a_pixel *glenzd = glenz[0]; i -= 199; dest2 = corner[0] + i; for (j = 0, l = 0; j < 200; j++, l++) { src = corner[0] + j * xbuf + i + l; dest = corner[0] + j * xbuf; for (k = i + l; k != 0; k--) *dest++ = 0; for (k = 200 - l; k != 0; k--) { *dest = glenzl[*src]; src += xbuf; dest++; } if (l > 9) { dest[0] = glenzd[dest[0]]; dest[1] = glenzd[dest[1]]; dest[2] = glenzd[dest[2]]; dest[3] = glenzd[dest[3]]; dest[4] = glenzd[dest[4]]; dest[5] = glenzd[dest[5]]; dest[6] = glenzd[dest[6]]; dest[7] = glenzd[dest[7]]; dest[8] = glenzd[dest[8]]; dest[9] = glenzd[dest[9]]; dest[10] = glenzd[dest[10]]; } } for (l = 0; l < 200; l++) { dest2[2] = glenzd[dest2[2]]; *dest2 = glenzd[glenzd[*dest2]]; dest2 += xbuf + 1; } } static void corner_buffer_end (int i) { int j, k, l; a_pixel *src; a_pixel *dest; a_pixel *dest2; a_pixel *glenzl = glenz[corner_buffer_glenz]; a_pixel *glenzd = glenz[0]; i -= 319; dest2 = corner[0] + i + 120; for (j = 0, l = 120; j < 200; j++, l++) { dest = corner[0] + j * xbuf; if (i + l < 320) { src = corner[0] + j * xbuf + i + l; for (k = i + l; k != 0; k--) *dest++ = 0; for (k = 320 - l - i; k != 0; k--) { *dest = glenzl[*src]; src += xbuf; dest++; } } else memset (dest, 0, 320); } for (l = 0; i + l < 200; l++) { dest2[1] = glenzd[dest2[1]]; *dest2 = glenzd[glenzd[*dest2]]; dest2 += xbuf + 1; } } extern int corner_buffer (void) { int t2 = read_htimer (corner_htimer); if (t2 < 200) corner_buffer_begin (t2); else if (t2 < 320) corner_buffer_middle (t2); else if (t2 < 520) corner_buffer_end (t2); else return 1; return 0; } extern void compute_lut (void) { int i; for (i = 0; i != 256; i++) { rotosinus[i] = ceil (sin (i * 3.141592653 / 128.0) * 65536 / 1.2); rotocosinus[i] = ceil (cos (i * 3.141592653 / 128.0) * 65536); rotosinus2[i] = ceil (sin (i * 3.141592653 / 128.0 + 3.141592653 / 2.0) * 65536); rotocosinus2[i] = ceil (cos (i * 3.141592653 / 128.0 + 3.141592653 / 2.0) * 65536 * 1.2); } for (i = 0; i != 512; i++) moyensinus[i] = ceil (sin (i * 2.0 * 3.141592653 / 512.0) * 16.2); for (i = 0; i != 200; i++) mulxbuf[i] = i * xbuf; } heroes-0.21/src/visuals.h0000644004117000411500000000373507352614753011052 /*------------------------------------------------------------------------. | Copyright 1997, 1998, 2000 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it under | | the terms of the GNU General Public License version 2 as published by | | the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #ifndef HEROES__VISUALS__H #define HEROES__VISUALS__H extern int rotosinus[256]; extern int rotocosinus[256]; extern int rotosinus2[256]; extern int rotocosinus2[256]; extern signed char moyensinus[512]; extern int mulxbuf[200]; extern int angle; extern a_pixel *srcroto; void rotozoom_buffer (void); /* rotozoom */ void rotozoom_half_buffer (int c); void wave_buffer (void); /* mushroom */ void wave_half_buffer (int c); void flip_buffer (int p2); /* flipping the screen horizontaly */ int corner_buffer (void); /* "removing" the screen from the corner */ void compute_lut (void); /* init tables sin/cos */ #endif /* HEROES__VISUALS__H */ heroes-0.21/src/heroeslvl.c0000644004117000411500000003355507422033662011355 /*------------------------------------------------------------------. | Copyright 2001, 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "error.h" #include "lvl.h" const char *program_name; /* argv[0] */ int exit_status = 0; /* $? */ struct an_option_set { bool print_directions; /* --print d */ bool print_filename; /* --print f */ bool print_header; /* --print h */ bool print_walls; /* --print w */ bool print_types; /* --print t */ bool print_type_keys; /* --print T */ bool print_tunnels; /* --print @ */ bool print_tile_details; /* --print i */ const char *indent; /* Set to a prefix output on every lines, e.g. " ". (--indent) */ } options = { false, false, false, false, false, false, false, false, "" }; static void default_options (void) { options.print_filename = true; options.print_header = true; options.indent = " "; } static void version (void) { puts ("heroeslvl (Heroes) " VERSION "\n"); printf (_("Copyright (C) %d Alexandre Duret-Lutz.\n"), 2002); puts (_("This is free software; see the source for copying conditions. " "There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS" " FOR A PARTICULAR PURPOSE.")); exit (0); } static void usage (int status) { if (status) { fprintf (stderr, _("Try '%s --help' for more information.\n"), program_name); exit (status); } printf (_("Usage: %s [OPTIONS]... levels\n\n"), program_name); puts (_("Heroeslvl is a tool used to inspect Heroes' level files.\n")); puts (_("\ Mandatory arguments to long options are mandatory for short options too.\n")); puts (_("\ -v, --version display version number")); puts (_("\ -h, --help display this help")); puts (_("\ -p, --print=WHAT select information to display. WHAT should be\n\ one or more of these characters:")); printf ("%34s%s\n", "", _("d print square directions")); printf ("%34s%s\n", "", _("f print filename")); printf ("%34s%s\n", "", _("h print header")); printf ("%34s%s\n", "", _("i print tile details")); printf ("%34s%s\n", "", _("t print square type map")); printf ("%34s%s\n", "", _("T print type keys")); printf ("%34s%s\n", "", _("w print square wall map")); printf ("%34s%s\n", "", _("@ print tunnels")); puts (_("\ -i, --indent indent everything but the filename")); puts (""); puts (_("When no options are given, the default is -ipfh.")); puts (_("Report bugs to .")); exit (status); } const struct option long_options[] = { {"help", no_argument, NULL, 'h'}, {"indent", no_argument, NULL, 'i'}, {"print", required_argument, NULL, 'p'}, {"version", no_argument, NULL, 'v'}, {NULL, 0, NULL, 0} }; static void decode_print_options (const char *flags) { while (*flags) { switch (*flags) { case 'd': options.print_directions = true; break; case 'f': options.print_filename = true; break; case 'h': options.print_header = true; break; case 'i': options.print_tile_details = true; break; case 't': options.print_types = true; break; case 'T': options.print_type_keys = true; break; case 'w': options.print_walls = true; break; case '@': options.print_tunnels = true; break; default: error (0, 0, "Unknown --print selection '%c'.", *flags); usage (1); } ++flags; } } static void decode_switches (int argc, char **argv) { int c; /* If DEFAULT_PRINT is still true after processing all the options, that means the default printing options should be used. */ bool default_print = true; while ((c = getopt_long (argc, argv, "hip:v", long_options, NULL)) != -1) { switch (c) { case 'h': usage (0); case 'v': version (); case 'i': options.indent = " "; break; case 'p': decode_print_options (optarg); default_print = false; break; default: usage (1); } } if (default_print) default_options (); } static const char * dir_to_string (a_dir dir) { switch (dir) { case D_UP: return "up"; case D_RIGHT: return "right"; case D_DOWN: return "down"; case D_LEFT: return "left"; } exit_status = 4; return "error"; } static void print_header (const a_level *lvl) { printf (_("%sheight:\t%d tiles\t(%d squares)\n"), options.indent, lvl->tile_height, lvl->square_height); printf (_("%swidth:\t%d tiles\t(%d squares)\n"), options.indent, lvl->tile_width, lvl->square_width); if (lvl->tile_height_wrap == DONT_WRAP) printf (_("%sY-wrap:\tno\n"), options.indent); else printf (_("%sY-wrap:\t%d tiles\t(%d squares)\n"), options.indent, lvl->tile_height_wrap, lvl->square_height_wrap); if (lvl->tile_width_wrap == DONT_WRAP) printf (_("%sX-wrap:\tno\n"), options.indent); else printf (_("%sX-wrap:\t%d tiles\t(%d squares)\n"), options.indent, lvl->tile_width_wrap, lvl->square_width_wrap); printf (_("%ssound track alias:\t%s\n"), options.indent, lvl_sound_track (lvl)); printf (_("%stile map basename:\t%s\n"), options.indent, lvl_tile_sprite_map_basename (lvl)); printf (_("%sstarting squares and directions (y x dir):\n"), options.indent); { int i; for (i = 0; i < 4; ++i) { a_square_corrd_pair co; a_dir di; lvl_start_position (lvl, i, &co, &di); printf ("%s #%d: %2d %2d %s\n", options.indent, i + 1, co.y, co.x, dir_to_string (di)); } } } static char type_to_char (a_dir dir) { switch (dir) { case T_NONE: return ' '; case T_STOP: return 'h'; case T_SPEED: return 's'; case T_TUNNEL: return 't'; case T_BOOM: return 'b'; case T_ANIM: return 'a'; case T_ICE: return 'i'; case T_DUST: return 'd'; case T_OUTWAY: return 'X'; default: exit_status = 4; return '?'; } } const char *type_names[T_MAXTYPE] = { N_("none"), N_("stop"), N_("speed"), N_("tunnel"), N_("boom"), N_("anim"), N_("ice"), N_("dust"), N_("outway") }; static void print_type_keys (void) { int i; const int ncols = 3; for (i = 0; i < T_MAXTYPE; ++i) { if (i % ncols == 0) printf ("%s", options.indent); printf ("'%c' %-20s", type_to_char (i), _(type_names[i])); if (i % ncols == ncols - 1) puts (""); } if (i % ncols != 0) puts (""); } static void print_square_types (const a_level *lvl) { a_square_coord y, x; a_square_index idx; for (y = 0, idx = 0; y < lvl->square_height; ++y) { printf ("%s|", options.indent); for (x = 0; x < lvl->square_width; ++x, ++idx) putchar (type_to_char (lvl->square_type[idx])); printf ("|%2u\n", y); } } static void print_dir_mask (a_dir_mask dm) { int nw = 0; if (dm & DM_UP) ++nw; if (dm & DM_RIGHT) ++nw; if (dm & DM_DOWN) ++nw; if (dm & DM_LEFT) ++nw; if (nw) printf ("%d", nw); else putchar (' '); } static void print_square_walls (const a_level *lvl) { a_square_coord y, x; a_square_index idx; for (y = 0, idx = 0; y < lvl->square_height; ++y) { printf ("%s|", options.indent); for (x = 0; x < lvl->square_width; ++x, ++idx) print_dir_mask (lvl->square_walls_out[idx]); printf ("|%2u\n", y); } } static char dir_to_char (a_dir d) { switch (d) { case D_UP: return '^'; case D_RIGHT: return '>'; case D_DOWN: return '.'; case D_LEFT: return '<'; default: return 'X'; } } static void print_square_directions (const a_level *lvl) { a_square_coord y, x; a_square_index idx; for (y = 0, idx = 0; y < lvl->square_height; ++y) { printf ("%s|", options.indent); for (x = 0; x < lvl->square_width; ++x, ++idx) putchar (dir_to_char (lvl->square_direction[idx])); printf ("|%2u\n", y); } } static void print_tunnels (const a_level *lvl) { a_square_coord y, x; a_square_index idx; int tunbr = 0; /* Number of tunnels. */ int curtun = 0; /* Curent tunnel index. */ a_square_index *outputs; for (idx = 0; idx < lvl->square_count; ++idx) if (lvl->square_type[idx] == T_TUNNEL) ++tunbr; if (tunbr == 0) { printf ("%sNo tunnels.\n", options.indent); return; } XMALLOC_ARRAY (outputs, tunbr); for (curtun = 0, idx = 0; idx < lvl->square_count; ++idx) if (lvl->square_type[idx] == T_TUNNEL) outputs[curtun++] = idx; printf (_("%sTunnels:\n"), options.indent); /* TRANS: This is the header of an array (output by heroeslvl -p@), so the position of these words is important. SRCIDX is a short for 'source index' (entrance of a tunnel) and DESTIDX means 'destination index' (output of the tunnel). */ printf (_("%s NBR SRCIDX Y X DIR DESTIDX\n"), options.indent); for (curtun = 0, y = 0, idx = 0; y < lvl->square_height; ++y) for (x = 0; x < lvl->square_width; ++x, ++idx) if (lvl->square_type[idx] == T_TUNNEL) { a_dir d = lvl->square_direction[idx]; a_square_index outidx = lvl->square_move[d][idx]; /* Search the number of the output tunnel. */ int i; for (i = 0; i < tunbr; ++i) if (outputs[i] == outidx) break; printf ("%s #%-2d %6d %3d %3d %-8s %7d", options.indent, ++curtun, idx, y, x, dir_to_string (d), lvl->square_move[d][idx]); if (i < tunbr) printf ("\t#%d", i + 1); puts (""); } free (outputs); } static const char * anim_kind_to_str (an_anim_kind k) { switch (k) { case A_NONE: /* TRANS: `still' is used to describe tiles which are not animated. */ return _("still"); case A_LOOP: /* TRANS: `loop' is for animated tiles where frames are displayed from 1 to n, and then again from 1 to n, etc. */ return _("loop"); case A_PINGPONG: /* TRANS: `pingpong' is for tiles animated in loop where frame displayed from 1 to n, then from n to 1, and then again from 1 to n, etc. */ return _("pingpong"); } assert (0); } static void print_tile_details (a_level *lvl) { a_tile_index i; /* TRANS: This is the header of an array (output by heroeslvl -pi) so the position of these word is important. SPRITE is the address of the sprite used to render the tile. OVERLAY is the address of a sprite that should be displayed on top of the players (e.g. trees). ANIM-TYPE is the kind of animation used for the tile, FRM the number of frame to display, DEL the delay between each frame. */ printf (_("\ %sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL\n"), options.indent); for (i = 0; i < lvl->tile_count; ++i) { unsigned int o, c, d; an_anim_kind k; printf ("%s%4u %2u %2u %-10s 0x%08x", options.indent, i, TILE_INDEX_TO_COORD_Y (lvl, i), TILE_INDEX_TO_COORD_X (lvl, i), type_names[lvl_tile_type (lvl, i)], lvl_tile_sprite_offset (lvl, i)); o = lvl_tile_sprite_overlay_offset (lvl, i); if (o) printf (" 0x%08x", o); else printf (" "); lvl_animation_info (lvl, i, &c, &d, &k); printf (" %-10s", anim_kind_to_str (k)); if (k) printf (" %2u %2u", c, d); else printf (" "); puts (""); } } static void process (const char *filename) { int err; a_level lvl; bool load_full; /* Sometime we don't need to load the full level, only the header is needed to print the requested information. */ if (options.print_types | options.print_walls | options.print_directions | options.print_tunnels | options.print_tile_details) load_full = true; else load_full = false; err = lvl_load_file (filename, &lvl, load_full); if (err) { error (0, err, _("cannot load %s"), filename); exit_status = 3; } else { if (options.print_filename) printf (_("File:\t%s\n"), filename); if (options.print_header) print_header (&lvl); if (options.print_type_keys) print_type_keys (); if (options.print_types) print_square_types (&lvl); if (options.print_walls) print_square_walls (&lvl); if (options.print_directions) print_square_directions (&lvl); if (options.print_tunnels) print_tunnels (&lvl); if (options.print_tile_details) print_tile_details (&lvl); } lvl_free (&lvl); } int main (int argc, char *argv[]) { mtrace (); /* GNU libc's malloc debugging facility */ program_name = argv[0]; setlocale (LC_ALL, ""); /* FIXME: Use $(locale-dir) as in Heroes. */ bindtextdomain (PACKAGE, PREFIX "/" FORWARD_RELATIVE_LOCALEDIR); textdomain (PACKAGE); decode_switches (argc, argv); if (optind == argc) { error (0, 0, _("Missing filename.")); usage (1); } /* Process all files. */ for (; optind < argc; ++optind) { process (argv[optind]); } return exit_status; } heroes-0.21/src/rsc_files.gperf0000644004117000411500000001060007405735300012165 %{ /*------------------------------------------------------------------------. | Copyright 2000, 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes 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. | | | | Heroes 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 | `------------------------------------------------------------------------*/ #include "system.h" #include "rsc_files_hash.h" #include "fstrcmp.h" %} struct rsc_file; %% arrow-img, "$(data-dir)/pics/arrow.pcx", 0,0,true big-font, "$(data-dir)/pics/fontbig.pcx", 0,0,true bonus-font, "$(data-dir)/pics/typonus.pcx", 0,0,true brown-bonus-img, "$(data-dir)/pics/bonusb.pcx", 0,0,true data-dir, "$(prefix)/"FORWARD_RELATIVE_PKGDATADIR,0,0,true editor-img, "$(data-dir)/pics/edit.pcx", 0,0,true editor-preview-prefix, "$(data-dir)/pics/editp", 0,0,true end-scroller-bg-img, "$(data-dir)/pics/background.pcx", 0,0,true extra-levels-dir, "$(data-dir)/extralvl/", 0,0,true saved-games-file, "$(user-dir)/savedgames", 0,0,true hedlite-output-dir, "$(user-dir)/levels/", 0,0,true help-font, "$(data-dir)/pics/fontread.pcx", 0,0,true help-pictures-img, "$(data-dir)/pics/helpics.pcx", 0,0,true home-dir, "is initialized from $HOME", 0,0,true intro-erase-img, "$(data-dir)/pics/erase.pcx", 0,0,true intro-logos-img, "$(data-dir)/pics/olympus.pcx", 0,0,true intro-splash-img, "$(data-dir)/pics/heroes.pcx", 0,0,true intro-vehicles-img, "$(data-dir)/pics/intro.pcx", 0,0,true jukebox-font, "$(data-dir)/pics/fontdeck.pcx", 0,0,true jukebox-img, "$(data-dir)/pics/jukebox.pcx", 0,0,true levels-dir, "$(data-dir)/levels/", 0,0,true locale-dir, "$(prefix)/"FORWARD_RELATIVE_LOCALEDIR, 0,0,true main-font, "$(data-dir)/pics/fontem.pcx", 0,0,true menu-pictures-img, "$(data-dir)/pics/fontem2.pcx", 0,0,true new-level-menu-img, "$(data-dir)/pics/newlevel.pcx", 0,0,true pref-file, "$(user-dir)/preferences", 0,0,true prefix, PREFIX, 0,0,true purple-bonus-img, "$(data-dir)/pics/bonusa.pcx", 0,0,true score-file, "$(user-dir)/scores", 0,0,true sfx-conf-txt, "$(data-dir)/sfx/sfx.conf", 0,0,true sfx-dir, "$(data-dir)/sfx/", 0,0,true system-conf, "$(data-dir)/etc/heroesrc", 0,0,true sys-dir, "/var/games/heroes", 0,0,true tiles-sets-dir, "$(data-dir)/tilesets/", 0,0,true trails-img, "$(data-dir)/pics/trail.pcx", 0,0,true user-conf, "$(user-dir)/heroesrc", 0,0,true user-dir, "$(home-dir)/.heroes", 0,0,true vehicles-img, "$(data-dir)/pics/vehic.pcx", 0,0,true %% void print_rsc_files (void) { int i; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (rsc_set[i].name[0]) { if (rsc_set[i].modified_value) { printf ("%24s = %s\n", rsc_set[i].name, rsc_set[i].modified_value); printf ("%16s (default: %s)\n", "", rsc_set[i].value); } else printf ("%24s = %s\n", rsc_set[i].name, rsc_set[i].value); } } } const char * get_rsc_approx (const char *rsc_name) { int i; const char *res = 0; double best_weight = 0.7; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (rsc_set[i].name[0]) { double weight = fstrcmp (rsc_name, rsc_set[i].name); if (weight > best_weight) { best_weight = weight; res = rsc_set[i].name; } } } return res; } void free_modified_rsc (void) { int i; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) XFREE (rsc_set[i].modified_value); } heroes-0.21/src/debughash.gperf0000444004117000411500000000666607451356455012200 %{ /* -*- buffer-read-only: t -*- vi: set ro: ** ** DO NOT EDIT THIS FILE (src/debughash.gperf) ** ** It has been AutoGen-ed Saturday March 30, 2002 at 04:43:41 PM CET ** From the definitions src/debugchn.def ** and the template file debugchn */ /* ** Heroes is free software. ** ** You may 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. ** ** Heroes 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 Heroes. See the file "COPYING". If not, ** write to: The Free Software Foundation, Inc., ** 59 Temple Place - Suite 330, ** Boston, MA 02111-1307, USA. */ #include "system.h" #include "debughash.h" #include "errors.h" #include "fstrcmp.h" /* prototype in_channel_set as static */ static struct debug_channel_s * in_channel_set (register const char *str, register unsigned int len); %} struct debug_channel_s { const char *name; const char *doc; enum debug_lvl number; }; %% all, N_("all messages"), -1 section, N_("different parts of the game"), D_SECTION system, N_("system related messages"), D_SYSTEM resource, N_("filename resources handling"), D_RESOURCE file, N_("files and directories handling"), D_FILE level, N_("levels handling"), D_LEVEL sound_track, N_("sound track events"), D_SOUND_TRACK sound_effect, N_("sound effects events"), D_SOUND_EFFECT video, N_("communication with the display driver"), D_VIDEO joystick, N_("joystick initialization and events"), D_JOYSTICK timer, N_("timer handling"), D_TIMER misc, N_("miscellaneous events"), D_MISC fader, N_("palette fade events"), D_FADER bonus, N_("bonus"), D_BONUS %% static const struct debug_channel_s * get_channel_approx (const char *name) { int i; const struct debug_channel_s *res = 0; double best_weight = 0.7; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (channel_set[i].name[0]) { double weight = fstrcmp (name, channel_set[i].name); if (weight > best_weight) { best_weight = weight; res = &(channel_set[i]); } } } return res; } enum debug_lvl get_channel_number (const char *name) { const struct debug_channel_s *res = in_channel_set (name, strlen (name)); if (!res) { /* try to find a channel which name is close to the given name */ res = get_channel_approx (name); if (res) wmsg (_("%s: no such channel, assuming you meant '%s'."), name, res->name); else emsg (_("%s: no such channel (--list=debug will list " "all known channels)"), name); } return res->number; } void print_debug_channels (void) { int i; for (i = MIN_HASH_VALUE; i <= MAX_HASH_VALUE; ++i) { if (channel_set[i].name[0]) { printf ("%-16s %s\n", channel_set[i].name, _(channel_set[i].doc)); } } } heroes-0.21/arch/0000777004117000411500000000000007451377035007414 5heroes-0.21/arch/mingw32/0000777004117000411500000000000007451377035010702 5heroes-0.21/arch/mingw32/cross.sh0000755004117000411500000000715307424076646012320 #! /bin/sh # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes 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. # # Heroes 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 # # ====================================================================== # # 1) I use this to cross compile Heroes for mingw32 and build a package. # 2) This script assumes too much. # # system to compile for BUILDNAME="i586-mingw32msvc" # path where the package should unpack PREFIX="/heroes" # prefix for cross-compiled SDL SDLPREFIX="/usr/local/$BUILDNAME" # configuration options CONFIGURE_OPTS="--host=$BUILDNAME --enable-html-doc=$PREFIX/doc \ --prefix=$PREFIX --with-sdl=$SDLPREFIX" # top level directory TOPSRC_DIR=`cd ../..; pwd` # configure script location CONFIGURE="$TOPSRC_DIR/configure" # temporary paths used to build and install the file before # they are packaged package BUILDDIR="$PWD/=build" DESTDIR="$PWD/=inst" cross_conf () { mkdir -p $BUILDDIR (cd $BUILDDIR && $CONFIGURE $CONFIGURE_OPTS) } cross_build () { (cd $BUILDDIR && make) } cross_install () { mkdir -p $DESTDIR # Using install-strip like this in a cross-compiling setup will # only work if Heroes has been packaged with Automake 1.5d or # later. (cd $BUILDDIR && make DESTDIR="$DESTDIR" install-strip) cp dest-readme-lib $DESTDIR/$PREFIX/doc/README-LIB cp dest-readme-txt $DESTDIR/$PREFIX/README.TXT cp dest-run-bat $DESTDIR/$PREFIX/run.bat for f in ABOUT-NLS \ BUGS \ ChangeLog \ ChangeLog.00 \ COPYING \ NEWS \ THANKS \ TODO ; do test -f $TOPSRC_DIR/$f && cp -f $TOPSRC_DIR/$f $DESTDIR/$PREFIX/doc/ done (cd $DESTDIR/$PREFIX/doc && zip -9 -m ChangeLog.zip ChangeLog ChangeLog.00) rm -rf $DESTDIR/$PREFIX/info rm -rf $DESTDIR/$PREFIX/man rm -rf $DESTDIR/$PREFIX/lib # charset.alias is hardcoded under Windows. } cross_pack () { # package name and version eval `cd $TOPSRC_DIR && autoconf --trace 'AC_INIT:VERSION=$2;PACKAGE=$1'` # zip file to create ZIPFILE="`pwd`/$PACKAGE-$VERSION-XXX.mingw32.zip" # use .$PREFIX instead of ./$PREFIX because $PREFIX already has a # leading slash and zip doesn't handle `.//' as expected (it just # strip the leading `./' part). cd $DESTDIR && zip -9 -r $ZIPFILE .$PREFIX } cross_clean () { rm -rf $BUILDDIR $DESTDIR } dispatch () { case $1 in conf*) cross_conf ;; make|build*) cross_build ;; inst*) cross_install ;; pack*|pkg) cross_pack ;; *clean*) cross_clean ;; all) dispatch conf && dispatch make && dispatch inst && dispatch pkg && dispatch clean ;; *) echo 'config -- configure the source' echo 'make -- build the source' echo 'install -- install in temporary directory' echo 'pack -- package the installed files' echo 'clean -- clean up everything but the packaged file' echo 'all -- run all the above in order' ;; esac } test $# -lt 1 && dispatch help for i; do dispatch $i done heroes-0.21/arch/mingw32/dest-readme-txt0000644004117000411500000000107207302136530013534 Installation intructions - You needs several ZIP archive to do the Heroes installation (from 2 to 4 depending on whether you want sound support or not). See http://heroes.sourceforge.net/download.html for details. - Unzip all archives in the same directory. - Run `run.bat' to launch Heroes. You may want to customize this file, see the embedded comments. - Documentation files are in the subdirectory `doc'. The manual is `doc\heroes.html' please read it before reporting bugs. - Report bugs to . heroes-0.21/arch/mingw32/dest-readme-lib0000644004117000411500000000376307425315111013474 This is the Windows binary for Heroes, cross-compiled from Linux and linked statically against SDL 1.2.3, SDL_mixer 1.2.0 and MinGW (from the mingw32 Debian package). The man page and info file have been replaced by an html page in the doc/ directory. Heroes has been configured with the following options: --host=i586-mingw32msvc --prefix=/heroes --enable-html-doc=/heroes/doc --with-sdl SDL and SDL_mixer have been configured with: --host=i586-mingw32msvc --target=i586-mingw32msvc --build=i586-linux --enable-static --disable-shared ----- Heroes is similar to the "Tron" and "Nibbles" games of yore, but includes many graphical improvements and new game features. Heroes source code is available from its home page: http://heroes.sourceforge.net/ The game is distributed under the terms of the GNU General Public License: http://www.gnu.org/copyleft/gpl.html ----- The Simple DirectMedia Layer (SDL for short) is a cross-platfrom library designed to make it easy to write multi-media software, such as games and emulators. The Simple DirectMedia Layer library source code is available from: http://www.libsdl.org/ This library is distributed under the terms of the GNU LGPL license: http://www.gnu.org/copyleft/lesser.html ----- The SDL_mixer library is a simple multi-channel audio mixer. It supports 4 channels of 16 bit stereo audio, plus a single channel of music, mixed by the popular MikMod MOD, Timidity MIDI and SMPEG MP3 libraries. The latest version of this library is available from: http://www.devolution.com/~slouken/SDL/projects/SDL_mixer/ This library is distributed under the terms of the GNU LGPL license: http://www.gnu.org/copyleft/lesser.html ----- MinGW (Minimalist GNU For Windows) MinGW is a collection of header files and import libraries that allow one to use GCC and produce native Windows32 programs that do not rely on any 3rd-party DLLs. The latest version of MinGW is available from: http://www.mingw.org/ MinGW base runtime package is uncopyrighted and placed in the public domain. heroes-0.21/arch/mingw32/dest-run-bat0000644004117000411500000000153507302136530013036 @echo off rem ## If Heroes cannot find its files, you may use a line rem ## like the following to tell it where they are. rem ## This should be the path to the directory containing the bin\ and rem ## datadir\ directories. rem set HEROES_PREFIX=C:\heroes rem ## Uncomment the following line to change the language to French. rem ## Other available languages are Dutch (nl_NL), German (de_DE), and rem ## Italian (it_IT). rem set LANG=fr_FR rem ## The following line launch Heroes, with 8bit and 11kHz sound output, rem ## this are safe values but very low qualit and you may want to rem ## suppress these options to try the default configuration instead rem ## (16bits, 22mHz), or higher values. rem ## Also, you may want to add some other options (such as -F for rem ## fullscreen), see the manual for details. bin\heroes.exe -8 -d freq=11050 heroes-0.21/arch/Makefile.inc0000644004117000411500000000166007401253126011530 ## -*- Makefile -*- ## Copyright 2000, 2001 Alexandre Duret-Lutz ## ## This file is part of Heroes. ## ## Heroes is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License version 2 as published by ## the Free Software Foundation. ## ## Heroes 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 ## EXTRA_DIST += \ arch/mingw32/cross.sh \ arch/mingw32/dest-readme-txt \ arch/mingw32/dest-readme-lib \ arch/mingw32/dest-run-bat heroes-0.21/intl/0000777004117000411500000000000007451377040007441 5heroes-0.21/intl/ChangeLog0000644004117000411500000000060707451356464011141 2001-04-24 Alexandre Duret-Lutz * dcigettext.c (HAVE_LOCALE_NULL): Don't define even if __GNU_LIBRARY__ is defined. Otherwise guess_category_value() uses glibc's setlocale() which make the libintl dependant on the glibc configuration and prevent testing the package with foreign languages. 2001-09-13 GNU * Version 0.10.40 released. heroes-0.21/intl/Makefile.in0000644004117000411500000002333107451356456011434 # Makefile for directory with message catalog handling in GNU NLS Utilities. # Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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. PACKAGE = @PACKAGE@ VERSION = @VERSION@ SHELL = /bin/sh srcdir = @srcdir@ top_srcdir = @top_srcdir@ top_builddir = .. VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ transform = @program_transform_name@ libdir = @libdir@ includedir = @includedir@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/intl aliaspath = $(localedir) subdir = intl INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` l = @INTL_LIBTOOL_SUFFIX_PREFIX@ AR = ar CC = @CC@ LIBTOOL = @LIBTOOL@ RANLIB = @RANLIB@ YACC = @INTLBISON@ -y -d YFLAGS = --name-prefix=__gettext DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ -DLIBDIR=\"$(libdir)\" @DEFS@ CPPFLAGS = @CPPFLAGS@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) HEADERS = $(COMHDRS) libgnuintl.h libgettext.h loadinfo.h COMHDRS = gettext.h gettextP.h hash-string.h SOURCES = $(COMSRCS) intl-compat.c COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \ finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \ explodename.c dcigettext.c dcngettext.c dngettext.c ngettext.c plural.y \ localcharset.c OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \ finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \ explodename.$lo dcigettext.$lo dcngettext.$lo dngettext.$lo ngettext.$lo \ plural.$lo localcharset.$lo GETTOBJS = intl-compat.$lo DISTFILES.common = Makefile.in \ config.charset locale.alias ref-add.sin ref-del.sin $(HEADERS) $(SOURCES) DISTFILES.generated = plural.c DISTFILES.normal = VERSION DISTFILES.gettext = COPYING.LIB-2 COPYING.LIB-2.1 libintl.glibc DISTFILES.obsolete = xopen-msg.sed linux-msg.sed po2tbl.sed.in cat-compat.c # Libtool's library version information for libintl. # Before making a gettext release, the gettext maintainer must change this # according to the libtool documentation, section "Library interface versions". # Maintainers of other packages that include the intl directory must *not* # change these values. LTV_CURRENT=1 LTV_REVISION=1 LTV_AGE=0 .SUFFIXES: .SUFFIXES: .c .y .o .lo .sin .sed .c.o: $(COMPILE) $< .c.lo: $(LIBTOOL) --mode=compile $(COMPILE) $< .y.c: $(YACC) $(YFLAGS) --output $@ $< rm -f $*.h .sin.sed: sed -e '/^#/d' -e 's/@''PACKAGE''@/@PACKAGE@/g' $< > t-$@ mv t-$@ $@ INCLUDES = -I.. -I. -I$(top_srcdir)/intl all: all-@USE_INCLUDED_LIBINTL@ all-yes: libintl.$la libintl.h charset.alias ref-add.sed ref-del.sed all-no: all-no-@BUILD_INCLUDED_LIBINTL@ all-no-yes: libgnuintl.$la all-no-no: libintl.a libgnuintl.a: $(OBJECTS) rm -f $@ $(AR) cru $@ $(OBJECTS) $(RANLIB) $@ libintl.la libgnuintl.la: $(OBJECTS) $(LIBTOOL) --mode=link \ $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \ $(OBJECTS) @LIBICONV@ \ -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \ -rpath $(libdir) \ -no-undefined libintl.h: libgnuintl.h cp $(srcdir)/libgnuintl.h libintl.h charset.alias: config.charset $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ mv t-$@ $@ check: all # This installation goal is only used in GNU gettext. Packages which # only use the library should use install instead. # We must not install the libintl.h/libintl.a files if we are on a # system which has the GNU gettext() function in its C library or in a # separate library. # If you want to use the one which comes with this version of the # package, you have to use `configure --with-included-gettext'. install: install-exec install-data install-exec: all if test "$(PACKAGE)" = "gettext" \ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir); \ $(INSTALL_DATA) libintl.h $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=install \ $(INSTALL_DATA) libintl.$la $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ $(mkinstalldirs) $(DESTDIR)$(libdir); \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ orig=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ if test @GLIBC21@ = no; then \ orig=charset.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ fi; \ fi; \ $(mkinstalldirs) $(DESTDIR)$(localedir); \ test -f $(DESTDIR)$(localedir)/locale.alias \ && orig=$(DESTDIR)$(localedir)/locale.alias \ || orig=$(srcdir)/locale.alias; \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-add.sed $$orig > $$temp; \ $(INSTALL_DATA) $$temp $$dest; \ rm -f $$temp; \ else \ : ; \ fi install-data: all if test "$(PACKAGE)" = "gettext"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ $(INSTALL_DATA) VERSION $(DESTDIR)$(gettextsrcdir)/VERSION; \ $(INSTALL_DATA) ChangeLog.inst $(DESTDIR)$(gettextsrcdir)/ChangeLog; \ dists="COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common)"; \ for file in $$dists; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ chmod a+x $(DESTDIR)$(gettextsrcdir)/config.charset; \ dists="$(DISTFILES.generated)"; \ for file in $$dists; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ $(INSTALL_DATA) $$dir/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ dists="$(DISTFILES.obsolete)"; \ for file in $$dists; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi # Define this as empty until I found a useful application. installcheck: uninstall: if test "$(PACKAGE)" = "gettext" \ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \ rm -f $(DESTDIR)$(includedir)/libintl.h; \ $(LIBTOOL) --mode=uninstall \ rm -f $(DESTDIR)$(libdir)/libintl.$la; \ else \ : ; \ fi if test '@USE_INCLUDED_LIBINTL@' = yes; then \ if test -f $(DESTDIR)$(libdir)/charset.alias; then \ temp=$(DESTDIR)$(libdir)/t-charset.alias; \ dest=$(DESTDIR)$(libdir)/charset.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ if test -f $(DESTDIR)$(localedir)/locale.alias; then \ temp=$(DESTDIR)$(localedir)/t-locale.alias; \ dest=$(DESTDIR)$(localedir)/locale.alias; \ sed -f ref-del.sed $$dest > $$temp; \ if grep '^# Packages using this file: $$' $$temp > /dev/null; then \ rm -f $$dest; \ else \ $(INSTALL_DATA) $$temp $$dest; \ fi; \ rm -f $$temp; \ fi; \ else \ : ; \ fi if test "$(PACKAGE)" = "gettext"; then \ for file in VERSION ChangeLog COPYING.LIB-2 COPYING.LIB-2.1 $(DISTFILES.common) $(DISTFILES.generated); do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi info dvi: $(OBJECTS): ../config.h libgnuintl.h bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h tags: TAGS TAGS: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES) id: ID ID: $(HEADERS) $(SOURCES) here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES) mostlyclean: rm -f *.a *.la *.o *.lo core core.* rm -f libintl.h charset.alias ref-add.sed ref-del.sed rm -f -r .libs _libs clean: mostlyclean distclean: clean rm -f Makefile ID TAGS if test "$(PACKAGE)" = gettext; then \ rm -f ChangeLog.inst $(DISTFILES.normal); \ else \ : ; \ fi maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." # GNU gettext needs not contain the file `VERSION' but contains some # other files which should not be distributed in other packages. distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: Makefile if test "$(PACKAGE)" = gettext; then \ additional="$(DISTFILES.gettext)"; \ else \ additional="$(DISTFILES.normal)"; \ fi; \ $(MAKE) $(DISTFILES.common) $(DISTFILES.generated) $$additional; \ for file in ChangeLog $(DISTFILES.common) $(DISTFILES.generated) $$additional; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ ln $$dir/$$file $(distdir) 2> /dev/null \ || cp -p $$dir/$$file $(distdir); \ done Makefile: Makefile.in ../config.status cd .. \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: heroes-0.21/intl/config.charset0000755004117000411500000003201507451356456012211 #! /bin/sh # Output a system dependent table of character encoding aliases. # # Copyright (C) 2000-2001 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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. # # The table consists of lines of the form # ALIAS CANONICAL # # ALIAS is the (system dependent) result of "nl_langinfo (CODESET)". # ALIAS is compared in a case sensitive way. # # CANONICAL is the GNU canonical name for this character encoding. # It must be an encoding supported by libiconv. Support by GNU libc is # also desirable. CANONICAL is case insensitive. Usually an upper case # MIME charset name is preferred. # The current list of GNU canonical charset names is as follows. # # name used by which systems a MIME name? # ASCII, ANSI_X3.4-1968 glibc solaris freebsd # ISO-8859-1 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-2 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-3 glibc yes # ISO-8859-4 osf solaris freebsd yes # ISO-8859-5 glibc aix hpux irix osf solaris freebsd yes # ISO-8859-6 glibc aix hpux solaris yes # ISO-8859-7 glibc aix hpux irix osf solaris yes # ISO-8859-8 glibc aix hpux osf solaris yes # ISO-8859-9 glibc aix hpux irix osf solaris yes # ISO-8859-13 glibc # ISO-8859-15 glibc aix osf solaris freebsd # KOI8-R glibc solaris freebsd yes # KOI8-U glibc freebsd yes # CP437 dos # CP775 dos # CP850 aix osf dos # CP852 dos # CP855 dos # CP856 aix # CP857 dos # CP861 dos # CP862 dos # CP864 dos # CP865 dos # CP866 freebsd dos # CP869 dos # CP874 win32 dos # CP922 aix # CP932 aix win32 dos # CP943 aix # CP949 osf win32 dos # CP950 win32 dos # CP1046 aix # CP1124 aix # CP1129 aix # CP1250 win32 # CP1251 glibc win32 # CP1252 aix win32 # CP1253 win32 # CP1254 win32 # CP1255 win32 # CP1256 win32 # CP1257 win32 # GB2312 glibc aix hpux irix solaris freebsd yes # EUC-JP glibc aix hpux irix osf solaris freebsd yes # EUC-KR glibc aix hpux irix osf solaris freebsd yes # EUC-TW glibc aix hpux irix osf solaris # BIG5 glibc aix hpux osf solaris freebsd yes # BIG5-HKSCS glibc # GBK aix osf win32 dos # GB18030 glibc # SHIFT_JIS hpux osf solaris freebsd yes # JOHAB glibc win32 # TIS-620 glibc aix hpux osf solaris # VISCII glibc yes # HP-ROMAN8 hpux # HP-ARABIC8 hpux # HP-GREEK8 hpux # HP-HEBREW8 hpux # HP-TURKISH8 hpux # HP-KANA8 hpux # DEC-KANJI osf # DEC-HANYU osf # UTF-8 glibc aix hpux osf solaris yes # # Note: Names which are not marked as being a MIME name should not be used in # Internet protocols for information interchange (mail, news, etc.). # # Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications # must understand both names and treat them as equivalent. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM host="$1" os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'` echo "# This file contains a table of character encoding aliases," echo "# suitable for operating system '${os}'." echo "# It was automatically generated from config.charset." # List of references, updated during installation: echo "# Packages using this file: " case "$os" in linux* | *-gnu*) # With glibc-2.1 or newer, we don't need any canonicalization, # because glibc has iconv and both glibc and libiconv support all # GNU canonical names directly. Therefore, the Makefile does not # need to install the alias file at all. # The following applies only to glibc-2.0.x and older libcs. echo "ISO_646.IRV:1983 ASCII" ;; aix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "IBM-850 CP850" echo "IBM-856 CP856" echo "IBM-921 ISO-8859-13" echo "IBM-922 CP922" echo "IBM-932 CP932" echo "IBM-943 CP943" echo "IBM-1046 CP1046" echo "IBM-1124 CP1124" echo "IBM-1129 CP1129" echo "IBM-1252 CP1252" echo "IBM-eucCN GB2312" echo "IBM-eucJP EUC-JP" echo "IBM-eucKR EUC-KR" echo "IBM-eucTW EUC-TW" echo "big5 BIG5" echo "GBK GBK" echo "TIS-620 TIS-620" echo "UTF-8 UTF-8" ;; hpux*) echo "iso88591 ISO-8859-1" echo "iso88592 ISO-8859-2" echo "iso88595 ISO-8859-5" echo "iso88596 ISO-8859-6" echo "iso88597 ISO-8859-7" echo "iso88598 ISO-8859-8" echo "iso88599 ISO-8859-9" echo "iso885915 ISO-8859-15" echo "roman8 HP-ROMAN8" echo "arabic8 HP-ARABIC8" echo "greek8 HP-GREEK8" echo "hebrew8 HP-HEBREW8" echo "turkish8 HP-TURKISH8" echo "kana8 HP-KANA8" echo "tis620 TIS-620" echo "big5 BIG5" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "hp15CN GB2312" #echo "ccdc ?" # what is this? echo "SJIS SHIFT_JIS" echo "utf8 UTF-8" ;; irix*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-9 ISO-8859-9" echo "eucCN GB2312" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" ;; osf*) echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "cp850 CP850" echo "big5 BIG5" echo "dechanyu DEC-HANYU" echo "dechanzi GB2312" echo "deckanji DEC-KANJI" echo "deckorean EUC-KR" echo "eucJP EUC-JP" echo "eucKR EUC-KR" echo "eucTW EUC-TW" echo "GBK GBK" echo "KSC5601 CP949" echo "sdeckanji EUC-JP" echo "SJIS SHIFT_JIS" echo "TACTIS TIS-620" echo "UTF-8 UTF-8" ;; solaris*) echo "646 ASCII" echo "ISO8859-1 ISO-8859-1" echo "ISO8859-2 ISO-8859-2" echo "ISO8859-4 ISO-8859-4" echo "ISO8859-5 ISO-8859-5" echo "ISO8859-6 ISO-8859-6" echo "ISO8859-7 ISO-8859-7" echo "ISO8859-8 ISO-8859-8" echo "ISO8859-9 ISO-8859-9" echo "ISO8859-15 ISO-8859-15" echo "koi8-r KOI8-R" echo "BIG5 BIG5" echo "gb2312 GB2312" echo "cns11643 EUC-TW" echo "5601 EUC-KR" echo "eucJP EUC-JP" echo "PCK SHIFT_JIS" echo "TIS620.2533 TIS-620" #echo "sun_eu_greek ?" # what is this? echo "UTF-8 UTF-8" ;; freebsd*) # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "C ASCII" echo "US-ASCII ASCII" for l in la_LN lt_LN; do echo "$l.ASCII ASCII" done for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \ fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \ lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do echo "$l.ISO_8859-1 ISO-8859-1" echo "$l.DIS_8859-15 ISO-8859-15" done for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do echo "$l.ISO_8859-2 ISO-8859-2" done for l in la_LN lt_LT; do echo "$l.ISO_8859-4 ISO-8859-4" done for l in ru_RU ru_SU; do echo "$l.KOI8-R KOI8-R" echo "$l.ISO_8859-5 ISO-8859-5" echo "$l.CP866 CP866" done echo "uk_UA.KOI8-U KOI8-U" echo "zh_TW.BIG5 BIG5" echo "zh_TW.Big5 BIG5" echo "zh_CN.EUC GB2312" echo "ja_JP.EUC EUC-JP" echo "ja_JP.SJIS SHIFT_JIS" echo "ja_JP.Shift_JIS SHIFT_JIS" echo "ko_KR.EUC EUC-KR" ;; beos*) # BeOS has a single locale, and it has UTF-8 encoding. echo "* UTF-8" ;; msdosdjgpp*) # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore # localcharset.c falls back to using the full locale name # from the environment variables. echo "#" echo "# The encodings given here may not all be correct." echo "# If you find that the encoding given for your language and" echo "# country is not the one your DOS machine actually uses, just" echo "# correct it in this file, and send a mail to" echo "# Juan Manuel Guerrero " echo "# and Bruno Haible ." echo "#" echo "C ASCII" # ISO-8859-1 languages echo "ca CP850" echo "ca_ES CP850" echo "da CP865" # not CP850 ?? echo "da_DK CP865" # not CP850 ?? echo "de CP850" echo "de_AT CP850" echo "de_CH CP850" echo "de_DE CP850" echo "en CP850" echo "en_AU CP850" # not CP437 ?? echo "en_CA CP850" echo "en_GB CP850" echo "en_NZ CP437" echo "en_US CP437" echo "en_ZA CP850" # not CP437 ?? echo "es CP850" echo "es_AR CP850" echo "es_BO CP850" echo "es_CL CP850" echo "es_CO CP850" echo "es_CR CP850" echo "es_CU CP850" echo "es_DO CP850" echo "es_EC CP850" echo "es_ES CP850" echo "es_GT CP850" echo "es_HN CP850" echo "es_MX CP850" echo "es_NI CP850" echo "es_PA CP850" echo "es_PY CP850" echo "es_PE CP850" echo "es_SV CP850" echo "es_UY CP850" echo "es_VE CP850" echo "et CP850" echo "et_EE CP850" echo "eu CP850" echo "eu_ES CP850" echo "fi CP850" echo "fi_FI CP850" echo "fr CP850" echo "fr_BE CP850" echo "fr_CA CP850" echo "fr_CH CP850" echo "fr_FR CP850" echo "ga CP850" echo "ga_IE CP850" echo "gd CP850" echo "gd_GB CP850" echo "gl CP850" echo "gl_ES CP850" echo "id CP850" # not CP437 ?? echo "id_ID CP850" # not CP437 ?? echo "is CP861" # not CP850 ?? echo "is_IS CP861" # not CP850 ?? echo "it CP850" echo "it_CH CP850" echo "it_IT CP850" echo "lt CP775" echo "lt_LT CP775" echo "lv CP775" echo "lv_LV CP775" echo "nb CP865" # not CP850 ?? echo "nb_NO CP865" # not CP850 ?? echo "nl CP850" echo "nl_BE CP850" echo "nl_NL CP850" echo "nn CP865" # not CP850 ?? echo "nn_NO CP865" # not CP850 ?? echo "no CP865" # not CP850 ?? echo "no_NO CP865" # not CP850 ?? echo "pt CP850" echo "pt_BR CP850" echo "pt_PT CP850" echo "sv CP850" echo "sv_SE CP850" # ISO-8859-2 languages echo "cs CP852" echo "cs_CZ CP852" echo "hr CP852" echo "hr_HR CP852" echo "hu CP852" echo "hu_HU CP852" echo "pl CP852" echo "pl_PL CP852" echo "ro CP852" echo "ro_RO CP852" echo "sk CP852" echo "sk_SK CP852" echo "sl CP852" echo "sl_SI CP852" echo "sq CP852" echo "sq_AL CP852" echo "sr CP852" # CP852 or CP866 or CP855 ?? echo "sr_YU CP852" # CP852 or CP866 or CP855 ?? # ISO-8859-3 languages echo "mt CP850" echo "mt_MT CP850" # ISO-8859-5 languages echo "be CP866" echo "be_BE CP866" echo "bg CP866" # not CP855 ?? echo "bg_BG CP866" # not CP855 ?? echo "mk CP866" # not CP855 ?? echo "mk_MK CP866" # not CP855 ?? echo "ru KOI8-R" # not CP866 ?? echo "ru_RU KOI8-R" # not CP866 ?? # ISO-8859-6 languages echo "ar CP864" echo "ar_AE CP864" echo "ar_DZ CP864" echo "ar_EG CP864" echo "ar_IQ CP864" echo "ar_IR CP864" echo "ar_JO CP864" echo "ar_KW CP864" echo "ar_MA CP864" echo "ar_OM CP864" echo "ar_QA CP864" echo "ar_SA CP864" echo "ar_SY CP864" # ISO-8859-7 languages echo "el CP869" echo "el_GR CP869" # ISO-8859-8 languages echo "he CP862" echo "he_IL CP862" # ISO-8859-9 languages echo "tr CP857" echo "tr_TR CP857" # Japanese echo "ja CP932" echo "ja_JP CP932" # Chinese echo "zh_CN GBK" echo "zh_TW CP950" # not CP938 ?? # Korean echo "kr CP949" # not CP934 ?? echo "kr_KR CP949" # not CP934 ?? # Thai echo "th CP874" echo "th_TH CP874" # Other echo "eo CP850" echo "eo_EO CP850" ;; esac heroes-0.21/intl/locale.alias0000644004117000411500000000514107451356460011633 # Locale name alias data base. # Copyright (C) 1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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. # The format of this file is the same as for the corresponding file of # the X Window System, which normally can be found in # /usr/lib/X11/locale/locale.alias # A single line contains two fields: an alias and a substitution value. # All entries are case independent. # Note: This file is far from being complete. If you have a value for # your own site which you think might be useful for others too, share # it with the rest of us. Send it using the `glibcbug' script to # bugs@gnu.org. # Packages using this file: bokmal no_NO.ISO-8859-1 bokmål no_NO.ISO-8859-1 catalan ca_ES.ISO-8859-1 croatian hr_HR.ISO-8859-2 czech cs_CZ.ISO-8859-2 danish da_DK.ISO-8859-1 dansk da_DK.ISO-8859-1 deutsch de_DE.ISO-8859-1 dutch nl_NL.ISO-8859-1 eesti et_EE.ISO-8859-1 estonian et_EE.ISO-8859-1 finnish fi_FI.ISO-8859-1 français fr_FR.ISO-8859-1 french fr_FR.ISO-8859-1 galego gl_ES.ISO-8859-1 galician gl_ES.ISO-8859-1 german de_DE.ISO-8859-1 greek el_GR.ISO-8859-7 hebrew he_IL.ISO-8859-8 hrvatski hr_HR.ISO-8859-2 hungarian hu_HU.ISO-8859-2 icelandic is_IS.ISO-8859-1 italian it_IT.ISO-8859-1 japanese ja_JP.eucJP japanese.euc ja_JP.eucJP ja_JP ja_JP.eucJP ja_JP.ujis ja_JP.eucJP japanese.sjis ja_JP.SJIS korean ko_KR.eucKR korean.euc ko_KR.eucKR ko_KR ko_KR.eucKR lithuanian lt_LT.ISO-8859-13 nb_NO no_NO.ISO-8859-1 nb_NO.ISO-8859-1 no_NO.ISO-8859-1 norwegian no_NO.ISO-8859-1 nynorsk nn_NO.ISO-8859-1 polish pl_PL.ISO-8859-2 portuguese pt_PT.ISO-8859-1 romanian ro_RO.ISO-8859-2 russian ru_RU.ISO-8859-5 slovak sk_SK.ISO-8859-2 slovene sl_SI.ISO-8859-2 slovenian sl_SI.ISO-8859-2 spanish es_ES.ISO-8859-1 swedish sv_SE.ISO-8859-1 thai th_TH.TIS-620 turkish tr_TR.ISO-8859-9 heroes-0.21/intl/ref-add.sin0000644004117000411500000000210107451356463011372 # Add this package to a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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. # # Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// ta :a s/ @PACKAGE@ / @PACKAGE@ / tb s/ $/ @PACKAGE@ / :b s/^/# Packages using this file:/ } heroes-0.21/intl/ref-del.sin0000644004117000411500000000202407451356463011412 # Remove this package from a list of references stored in a text file. # # Copyright (C) 2000 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU Library 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 # Library General Public License for more details. # # You should have received a copy of the GNU Library 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. # # Written by Bruno Haible . # /^# Packages using this file: / { s/# Packages using this file:// s/ @PACKAGE@ / / s/^/# Packages using this file:/ } heroes-0.21/intl/gettext.h0000644004117000411500000000604007451356457011223 /* Description of GNU message catalog format: general file layout. Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _GETTEXT_H #define _GETTEXT_H 1 #if HAVE_LIMITS_H || _LIBC # include #endif /* @@ end of prolog @@ */ /* The magic number of the GNU message catalog format. */ #define _MAGIC 0x950412de #define _MAGIC_SWAPPED 0xde120495 /* Revision number of the currently used .mo (binary) file format. */ #define MO_REVISION_NUMBER 0 /* The following contortions are an attempt to use the C preprocessor to determine an unsigned integral type that is 32 bits wide. An alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work when cross-compiling. */ #if __STDC__ # define UINT_MAX_32_BITS 4294967295U #else # define UINT_MAX_32_BITS 0xFFFFFFFF #endif /* If UINT_MAX isn't defined, assume it's a 32-bit type. This should be valid for all systems GNU cares about because that doesn't include 16-bit systems, and only modern systems (that certainly have ) have 64+-bit integral types. */ #ifndef UINT_MAX # define UINT_MAX UINT_MAX_32_BITS #endif #if UINT_MAX == UINT_MAX_32_BITS typedef unsigned nls_uint32; #else # if USHRT_MAX == UINT_MAX_32_BITS typedef unsigned short nls_uint32; # else # if ULONG_MAX == UINT_MAX_32_BITS typedef unsigned long nls_uint32; # else /* The following line is intended to throw an error. Using #error is not portable enough. */ "Cannot determine unsigned 32-bit data type." # endif # endif #endif /* Header for binary .mo file format. */ struct mo_file_header { /* The magic number. */ nls_uint32 magic; /* The revision number of the file format. */ nls_uint32 revision; /* The number of strings pairs. */ nls_uint32 nstrings; /* Offset of table with start offsets of original strings. */ nls_uint32 orig_tab_offset; /* Offset of table with start offsets of translation strings. */ nls_uint32 trans_tab_offset; /* Size of hashing table. */ nls_uint32 hash_tab_size; /* Offset of first hashing entry. */ nls_uint32 hash_tab_offset; }; struct string_desc { /* Length of addressed string. */ nls_uint32 length; /* Offset of string in file. */ nls_uint32 offset; }; /* @@ begin of epilog @@ */ #endif /* gettext.h */ heroes-0.21/intl/gettextP.h0000644004117000411500000001700607451356457011347 /* Header describing internals of libintl library. Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _GETTEXTP_H #define _GETTEXTP_H #include /* Get size_t. */ #ifdef _LIBC # include "../iconv/gconv_int.h" #else # if HAVE_ICONV # include # endif #endif #include "loadinfo.h" #include "gettext.h" /* Get nls_uint32. */ /* @@ end of prolog @@ */ #ifndef PARAMS # if __STDC__ # define PARAMS(args) args # else # define PARAMS(args) () # endif #endif #ifndef internal_function # define internal_function #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif #ifndef W # define W(flag, data) ((flag) ? SWAP (data) : (data)) #endif #ifdef _LIBC # include # define SWAP(i) bswap_32 (i) #else static inline nls_uint32 SWAP (i) nls_uint32 i; { return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24); } #endif /* This is the representation of the expressions to determine the plural form. */ struct expression { int nargs; /* Number of arguments. */ enum operator { /* Without arguments: */ var, /* The variable "n". */ num, /* Decimal number. */ /* Unary operators: */ lnot, /* Logical NOT. */ /* Binary operators: */ mult, /* Multiplication. */ divide, /* Division. */ module, /* Module operation. */ plus, /* Addition. */ minus, /* Subtraction. */ less_than, /* Comparison. */ greater_than, /* Comparison. */ less_or_equal, /* Comparison. */ greater_or_equal, /* Comparison. */ equal, /* Comparision for equality. */ not_equal, /* Comparision for inequality. */ land, /* Logical AND. */ lor, /* Logical OR. */ /* Ternary operators: */ qmop /* Question mark operator. */ } operation; union { unsigned long int num; /* Number value for `num'. */ struct expression *args[3]; /* Up to three arguments. */ } val; }; /* This is the data structure to pass information to the parser and get the result in a thread-safe way. */ struct parse_args { const char *cp; struct expression *res; }; /* The representation of an opened message catalog. */ struct loaded_domain { const char *data; int use_mmap; size_t mmap_size; int must_swap; nls_uint32 nstrings; struct string_desc *orig_tab; struct string_desc *trans_tab; nls_uint32 hash_size; nls_uint32 *hash_tab; int codeset_cntr; #ifdef _LIBC __gconv_t conv; #else # if HAVE_ICONV iconv_t conv; # endif #endif char **conv_tab; struct expression *plural; unsigned long int nplurals; }; /* We want to allocate a string at the end of the struct. But ISO C doesn't allow zero sized arrays. */ #ifdef __GNUC__ # define ZERO 0 #else # define ZERO 1 #endif /* A set of settings bound to a message domain. Used to store settings from bindtextdomain() and bind_textdomain_codeset(). */ struct binding { struct binding *next; char *dirname; int codeset_cntr; /* Incremented each time codeset changes. */ char *codeset; char domainname[ZERO]; }; /* A counter which is incremented each time some previous translations become invalid. This variable is part of the external ABI of the GNU libintl. */ extern int _nl_msg_cat_cntr; struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname, char *__locale, const char *__domainname, struct binding *__domainbinding)) internal_function; void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain, struct binding *__domainbinding)) internal_function; void _nl_unload_domain PARAMS ((struct loaded_domain *__domain)) internal_function; const char *_nl_init_domain_conv PARAMS ((struct loaded_l10nfile *__domain_file, struct loaded_domain *__domain, struct binding *__domainbinding)) internal_function; void _nl_free_domain_conv PARAMS ((struct loaded_domain *__domain)) internal_function; char *_nl_find_msg PARAMS ((struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, size_t *lengthp)) internal_function; #ifdef _LIBC extern char *__gettext PARAMS ((const char *__msgid)); extern char *__dgettext PARAMS ((const char *__domainname, const char *__msgid)); extern char *__dcgettext PARAMS ((const char *__domainname, const char *__msgid, int __category)); extern char *__ngettext PARAMS ((const char *__msgid1, const char *__msgid2, unsigned long int __n)); extern char *__dngettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int n)); extern char *__dcngettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category)); extern char *__dcigettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category)); extern char *__textdomain PARAMS ((const char *__domainname)); extern char *__bindtextdomain PARAMS ((const char *__domainname, const char *__dirname)); extern char *__bind_textdomain_codeset PARAMS ((const char *__domainname, const char *__codeset)); #else extern char *gettext__ PARAMS ((const char *__msgid)); extern char *dgettext__ PARAMS ((const char *__domainname, const char *__msgid)); extern char *dcgettext__ PARAMS ((const char *__domainname, const char *__msgid, int __category)); extern char *ngettext__ PARAMS ((const char *__msgid1, const char *__msgid2, unsigned long int __n)); extern char *dngettext__ PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n)); extern char *dcngettext__ PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category)); extern char *dcigettext__ PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, int __plural, unsigned long int __n, int __category)); extern char *textdomain__ PARAMS ((const char *__domainname)); extern char *bindtextdomain__ PARAMS ((const char *__domainname, const char *__dirname)); extern char *bind_textdomain_codeset__ PARAMS ((const char *__domainname, const char *__codeset)); #endif #ifdef _LIBC extern void __gettext_free_exp PARAMS ((struct expression *exp)) internal_function; extern int __gettextparse PARAMS ((void *arg)); #else extern void gettext_free_exp__ PARAMS ((struct expression *exp)) internal_function; extern int gettextparse__ PARAMS ((void *arg)); #endif /* @@ begin of epilog @@ */ #endif /* gettextP.h */ heroes-0.21/intl/hash-string.h0000644004117000411500000000345307451356457011773 /* Description of GNU message catalog format: string hashing function. Copyright (C) 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* @@ end of prolog @@ */ #ifndef PARAMS # if __STDC__ # define PARAMS(Args) Args # else # define PARAMS(Args) () # endif #endif /* We assume to have `unsigned long int' value with at least 32 bits. */ #define HASHWORDBITS 32 /* Defines the so called `hashpjw' function by P.J. Weinberger [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools, 1986, 1987 Bell Telephone Laboratories, Inc.] */ static unsigned long int hash_string PARAMS ((const char *__str_param)); static inline unsigned long int hash_string (str_param) const char *str_param; { unsigned long int hval, g; const char *str = str_param; /* Compute the hash value for the given string. */ hval = 0; while (*str != '\0') { hval <<= 4; hval += (unsigned long int) *str++; g = hval & ((unsigned long int) 0xf << (HASHWORDBITS - 4)); if (g != 0) { hval ^= g >> (HASHWORDBITS - 8); hval ^= g; } } return hval; } heroes-0.21/intl/libgnuintl.h0000644004117000411500000001045507451356460011705 /* Message catalogs for internationalization. Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _LIBINTL_H #define _LIBINTL_H 1 #include /* The LC_MESSAGES locale category is the category used by the functions gettext() and dgettext(). It is specified in POSIX, but not in ANSI C. On systems that don't define it, use an arbitrary value instead. On Solaris, defines __LOCALE_H then includes (i.e. this file!) and then only defines LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES in this case. */ #if !defined LC_MESSAGES && !defined __LOCALE_H # define LC_MESSAGES 1729 #endif /* We define an additional symbol to signal that we use the GNU implementation of gettext. */ #define __USE_GNU_GETTEXT 1 /* Resolve a platform specific conflict on DJGPP. GNU gettext takes precedence over _conio_gettext. */ #ifdef __DJGPP__ # undef gettext # define gettext gettext #endif #ifndef PARAMS # if __STDC__ || defined __cplusplus # define PARAMS(args) args # else # define PARAMS(args) () # endif #endif #ifdef __cplusplus extern "C" { #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ extern char *gettext PARAMS ((const char *__msgid)); /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid)); /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid, int __category)); /* Similar to `gettext' but select the plural form corresponding to the number N. */ extern char *ngettext PARAMS ((const char *__msgid1, const char *__msgid2, unsigned long int __n)); /* Similar to `dgettext' but select the plural form corresponding to the number N. */ extern char *dngettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n)); /* Similar to `dcgettext' but select the plural form corresponding to the number N. */ extern char *dcngettext PARAMS ((const char *__domainname, const char *__msgid1, const char *__msgid2, unsigned long int __n, int __category)); /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ extern char *textdomain PARAMS ((const char *__domainname)); /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ extern char *bindtextdomain PARAMS ((const char *__domainname, const char *__dirname)); /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ extern char *bind_textdomain_codeset PARAMS ((const char *__domainname, const char *__codeset)); /* Optimized version of the functions above. */ #if defined __OPTIMIZED /* These are macros, but could also be inline functions. */ # define gettext(msgid) \ dgettext (NULL, msgid) # define dgettext(domainname, msgid) \ dcgettext (domainname, msgid, LC_MESSAGES) # define ngettext(msgid1, msgid2, n) \ dngettext (NULL, msgid1, msgid2, n) # define dngettext(domainname, msgid1, msgid2, n) \ dcngettext (domainname, msgid1, msgid2, n, LC_MESSAGES) #endif /* Optimizing. */ #ifdef __cplusplus } #endif #endif /* libintl.h */ heroes-0.21/intl/libgettext.h0000644004117000411500000000361407451356460011710 /* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include #else # define gettext(Msgid) (Msgid) # define dgettext(Domainname, Msgid) (Msgid) # define dcgettext(Domainname, Msgid, Category) (Msgid) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (char *) (Msgid1) : (char *) (Msgid2)) # define textdomain(Domainname) ((char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) ((char *) (Codeset)) #endif /* For automatical extraction of messages sometimes no real translation is needed. Instead the string itself is the result. */ #define gettext_noop(Str) (Str) #endif /* _LIBGETTEXT_H */ heroes-0.21/intl/loadinfo.h0000644004117000411500000000646407451356460011336 /* Copyright (C) 1996-1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifndef _LOADINFO_H #define _LOADINFO_H 1 #ifndef PARAMS # if __STDC__ # define PARAMS(args) args # else # define PARAMS(args) () # endif #endif #ifndef internal_function # define internal_function #endif /* Tell the compiler when a conditional or integer expression is almost always true or almost always false. */ #ifndef HAVE_BUILTIN_EXPECT # define __builtin_expect(expr, val) (expr) #endif /* Separator in PATH like lists of pathnames. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define PATH_SEPARATOR ';' #else /* Unix */ # define PATH_SEPARATOR ':' #endif /* Encoding of locale name parts. */ #define CEN_REVISION 1 #define CEN_SPONSOR 2 #define CEN_SPECIAL 4 #define XPG_NORM_CODESET 8 #define XPG_CODESET 16 #define TERRITORY 32 #define CEN_AUDIENCE 64 #define XPG_MODIFIER 128 #define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE) #define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER) struct loaded_l10nfile { const char *filename; int decided; const void *data; struct loaded_l10nfile *next; struct loaded_l10nfile *successor[1]; }; /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ extern const char *_nl_normalize_codeset PARAMS ((const char *codeset, size_t name_len)); extern struct loaded_l10nfile * _nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list, const char *dirlist, size_t dirlist_len, int mask, const char *language, const char *territory, const char *codeset, const char *normalized_codeset, const char *modifier, const char *special, const char *sponsor, const char *revision, const char *filename, int do_allocate)); extern const char *_nl_expand_alias PARAMS ((const char *name)); /* normalized_codeset is dynamically allocated and has to be freed by the caller. */ extern int _nl_explode_name PARAMS ((char *name, const char **language, const char **modifier, const char **territory, const char **codeset, const char **normalized_codeset, const char **special, const char **sponsor, const char **revision)); extern char *_nl_find_language PARAMS ((const char *name)); #endif /* loadinfo.h */ heroes-0.21/intl/bindtextdom.c0000644004117000411500000002317007451356456012055 /* Implementation of the bindtextdomain(3) function Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "gettextP.h" #ifdef _LIBC /* We have to handle multi-threaded applications. */ # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_rwlock_define(CLASS, NAME) # define __libc_rwlock_wrlock(NAME) # define __libc_rwlock_unlock(NAME) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_dirname _nl_default_dirname__ # define _nl_domain_bindings _nl_domain_bindings__ #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ /* Contains the default location of the message catalogs. */ extern const char _nl_default_dirname[]; /* List with bindings of specific domains. */ extern struct binding *_nl_domain_bindings; /* Lock variable to protect the global data in the gettext implementation. */ __libc_rwlock_define (extern, _nl_state_lock) /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define BINDTEXTDOMAIN __bindtextdomain # define BIND_TEXTDOMAIN_CODESET __bind_textdomain_codeset # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define BINDTEXTDOMAIN bindtextdomain__ # define BIND_TEXTDOMAIN_CODESET bind_textdomain_codeset__ #endif /* Prototypes for local functions. */ static void set_binding_values PARAMS ((const char *domainname, const char **dirnamep, const char **codesetp)); /* Specifies the directory name *DIRNAMEP and the output codeset *CODESETP to be used for the DOMAINNAME message catalog. If *DIRNAMEP or *CODESETP is NULL, the corresponding attribute is not modified, only the current value is returned. If DIRNAMEP or CODESETP is NULL, the corresponding attribute is neither modified nor returned. */ static void set_binding_values (domainname, dirnamep, codesetp) const char *domainname; const char **dirnamep; const char **codesetp; { struct binding *binding; int modified; /* Some sanity checks. */ if (domainname == NULL || domainname[0] == '\0') { if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; return; } __libc_rwlock_wrlock (_nl_state_lock); modified = 0; for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding != NULL) { if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The current binding has be to returned. */ *dirnamep = binding->dirname; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->dirname; if (strcmp (dirname, result) != 0) { if (strcmp (dirname, _nl_default_dirname) == 0) result = (char *) _nl_default_dirname; else { #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, dirname, len); #endif } if (__builtin_expect (result != NULL, 1)) { if (binding->dirname != _nl_default_dirname) free (binding->dirname); binding->dirname = result; modified = 1; } } *dirnamep = result; } } if (codesetp) { const char *codeset = *codesetp; if (codeset == NULL) /* The current binding has be to returned. */ *codesetp = binding->codeset; else { /* The domain is already bound. If the new value and the old one are equal we simply do nothing. Otherwise replace the old binding. */ char *result = binding->codeset; if (result == NULL || strcmp (codeset, result) != 0) { #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result != NULL, 1)) memcpy (result, codeset, len); #endif if (__builtin_expect (result != NULL, 1)) { if (binding->codeset != NULL) free (binding->codeset); binding->codeset = result; binding->codeset_cntr++; modified = 1; } } *codesetp = result; } } } else if ((dirnamep == NULL || *dirnamep == NULL) && (codesetp == NULL || *codesetp == NULL)) { /* Simply return the default values. */ if (dirnamep) *dirnamep = _nl_default_dirname; if (codesetp) *codesetp = NULL; } else { /* We have to create a new binding. */ size_t len = strlen (domainname) + 1; struct binding *new_binding = (struct binding *) malloc (offsetof (struct binding, domainname) + len); if (__builtin_expect (new_binding == NULL, 0)) goto failed; memcpy (new_binding->domainname, domainname, len); if (dirnamep) { const char *dirname = *dirnamep; if (dirname == NULL) /* The default value. */ dirname = _nl_default_dirname; else { if (strcmp (dirname, _nl_default_dirname) == 0) dirname = _nl_default_dirname; else { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (dirname); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; #else size_t len = strlen (dirname) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_dirname; memcpy (result, dirname, len); #endif dirname = result; } } *dirnamep = dirname; new_binding->dirname = (char *) dirname; } else /* The default value. */ new_binding->dirname = (char *) _nl_default_dirname; new_binding->codeset_cntr = 0; if (codesetp) { const char *codeset = *codesetp; if (codeset != NULL) { char *result; #if defined _LIBC || defined HAVE_STRDUP result = strdup (codeset); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; #else size_t len = strlen (codeset) + 1; result = (char *) malloc (len); if (__builtin_expect (result == NULL, 0)) goto failed_codeset; memcpy (result, codeset, len); #endif codeset = result; new_binding->codeset_cntr++; } *codesetp = codeset; new_binding->codeset = (char *) codeset; } else new_binding->codeset = NULL; /* Now enqueue it. */ if (_nl_domain_bindings == NULL || strcmp (domainname, _nl_domain_bindings->domainname) < 0) { new_binding->next = _nl_domain_bindings; _nl_domain_bindings = new_binding; } else { binding = _nl_domain_bindings; while (binding->next != NULL && strcmp (domainname, binding->next->domainname) > 0) binding = binding->next; new_binding->next = binding->next; binding->next = new_binding; } modified = 1; /* Here we deal with memory allocation failures. */ if (0) { failed_codeset: if (new_binding->dirname != _nl_default_dirname) free (new_binding->dirname); failed_dirname: free (new_binding); failed: if (dirnamep) *dirnamep = NULL; if (codesetp) *codesetp = NULL; } } /* If we modified any binding, we flush the caches. */ if (modified) ++_nl_msg_cat_cntr; __libc_rwlock_unlock (_nl_state_lock); } /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ char * BINDTEXTDOMAIN (domainname, dirname) const char *domainname; const char *dirname; { set_binding_values (domainname, &dirname, NULL); return (char *) dirname; } /* Specify the character encoding in which the messages from the DOMAINNAME message catalog will be returned. */ char * BIND_TEXTDOMAIN_CODESET (domainname, codeset) const char *domainname; const char *codeset; { set_binding_values (domainname, NULL, &codeset); return (char *) codeset; } #ifdef _LIBC /* Aliases for function names in GNU C Library. */ weak_alias (__bindtextdomain, bindtextdomain); weak_alias (__bind_textdomain_codeset, bind_textdomain_codeset); #endif heroes-0.21/intl/dcgettext.c0000644004117000411500000000343207451356456011526 /* Implementation of the dcgettext(3) function. Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCGETTEXT __dcgettext # define DCIGETTEXT __dcigettext #else # define DCGETTEXT dcgettext__ # define DCIGETTEXT dcigettext__ #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCGETTEXT (domainname, msgid, category) const char *domainname; const char *msgid; int category; { return DCIGETTEXT (domainname, msgid, NULL, 0, 0, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dcgettext, dcgettext); #endif heroes-0.21/intl/dgettext.c0000644004117000411500000000337607451356457011373 /* Implementation of the dgettext(3) function. Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DGETTEXT __dgettext # define DCGETTEXT __dcgettext #else # define DGETTEXT dgettext__ # define DCGETTEXT dcgettext__ #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale. */ char * DGETTEXT (domainname, msgid) const char *domainname; const char *msgid; { return DCGETTEXT (domainname, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dgettext, dgettext); #endif heroes-0.21/intl/gettext.c0000644004117000411500000000354107451356457011221 /* Implementation of gettext(3) function. Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define GETTEXT __gettext # define DCGETTEXT __dcgettext #else # define GETTEXT gettext__ # define DCGETTEXT dcgettext__ #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ char * GETTEXT (msgid) const char *msgid; { return DCGETTEXT (NULL, msgid, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__gettext, gettext); #endif heroes-0.21/intl/finddomain.c0000644004117000411500000001314607451356457011647 /* Handle list of needed message catalogs Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. Written by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* List of already loaded domains. */ static struct loaded_l10nfile *_nl_loaded_domains; /* Return a data structure describing the message catalog described by the DOMAINNAME and CATEGORY parameters with respect to the currently established bindings. */ struct loaded_l10nfile * internal_function _nl_find_domain (dirname, locale, domainname, domainbinding) const char *dirname; char *locale; const char *domainname; struct binding *domainbinding; { struct loaded_l10nfile *retval; const char *language; const char *modifier; const char *territory; const char *codeset; const char *normalized_codeset; const char *special; const char *sponsor; const char *revision; const char *alias_value; int mask; /* LOCALE can consist of up to four recognized parts for the XPG syntax: language[_territory[.codeset]][@modifier] and six parts for the CEN syntax: language[_territory][+audience][+special][,[sponsor][_revision]] Beside the first part all of them are allowed to be missing. If the full specified locale is not found, the less specific one are looked for. The various parts will be stripped off according to the following order: (1) revision (2) sponsor (3) special (4) codeset (5) normalized codeset (6) territory (7) audience/modifier */ /* If we have already tested for this locale entry there has to be one data set in the list of loaded domains. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, 0, locale, NULL, NULL, NULL, NULL, NULL, NULL, NULL, domainname, 0); if (retval != NULL) { /* We know something about this locale. */ int cnt; if (retval->decided == 0) _nl_load_domain (retval, domainbinding); if (retval->data != NULL) return retval; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided == 0) _nl_load_domain (retval->successor[cnt], domainbinding); if (retval->successor[cnt]->data != NULL) break; } return cnt >= 0 ? retval : NULL; /* NOTREACHED */ } /* See whether the locale value is an alias. If yes its value *overwrites* the alias name. No test for the original value is done. */ alias_value = _nl_expand_alias (locale); if (alias_value != NULL) { #if defined _LIBC || defined HAVE_STRDUP locale = strdup (alias_value); if (locale == NULL) return NULL; #else size_t len = strlen (alias_value) + 1; locale = (char *) malloc (len); if (locale == NULL) return NULL; memcpy (locale, alias_value, len); #endif } /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_' and `@' if we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ mask = _nl_explode_name (locale, &language, &modifier, &territory, &codeset, &normalized_codeset, &special, &sponsor, &revision); /* Create all possible locale entries which might be interested in generalization. */ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname, strlen (dirname) + 1, mask, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, domainname, 1); if (retval == NULL) /* This means we are out of core. */ return NULL; if (retval->decided == 0) _nl_load_domain (retval, domainbinding); if (retval->data == NULL) { int cnt; for (cnt = 0; retval->successor[cnt] != NULL; ++cnt) { if (retval->successor[cnt]->decided == 0) _nl_load_domain (retval->successor[cnt], domainbinding); if (retval->successor[cnt]->data != NULL) break; } } /* The room for an alias was dynamically allocated. Free it now. */ if (alias_value != NULL) free (locale); /* The space for normalized_codeset is dynamically allocated. Free it. */ if (mask & XPG_NORM_CODESET) free ((void *) normalized_codeset); return retval; } #ifdef _LIBC static void __attribute__ ((unused)) free_mem (void) { struct loaded_l10nfile *runp = _nl_loaded_domains; while (runp != NULL) { struct loaded_l10nfile *here = runp; if (runp->data != NULL) _nl_unload_domain ((struct loaded_domain *) runp->data); runp = runp->next; free ((char *) here->filename); free (here); } } text_set_element (__libc_subfreeres, free_mem); #endif heroes-0.21/intl/loadmsgcat.c0000644004117000411500000003516107451356460011650 /* Load needed message catalogs. Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif #endif #include #include #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #ifdef _LIBC # include # include #endif #if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \ || (defined _LIBC && defined _POSIX_MAPPED_FILES) # include # undef HAVE_MMAP # define HAVE_MMAP 1 #else # undef HAVE_MMAP #endif #include "gettext.h" #include "gettextP.h" #ifdef _LIBC # include "../locale/localeinfo.h" #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ISO C functions. This is required by the standard because some ISO C functions will require linking with this object file and the name space must not be polluted. */ # define open __open # define close __close # define read __read # define mmap __mmap # define munmap __munmap #endif /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define PLURAL_PARSE __gettextparse #else # define PLURAL_PARSE gettextparse__ #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif /* For systems that distinguish between text and binary I/O. O_BINARY is usually declared in . */ #if !defined O_BINARY && defined _O_BINARY /* For MSC-compatible compilers. */ # define O_BINARY _O_BINARY # define O_TEXT _O_TEXT #endif #ifdef __BEOS__ /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect. */ # undef O_BINARY # undef O_TEXT #endif /* On reasonable systems, binary I/O is the default. */ #ifndef O_BINARY # define O_BINARY 0 #endif /* We need a sign, whether a new catalog was loaded, which can be associated with all translations. This is important if the translations are cached by one of GCC's features. */ int _nl_msg_cat_cntr; #if (defined __GNUC__ && !defined __APPLE_CC__) \ || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L) /* These structs are the constant expression for the germanic plural form determination. It represents the expression "n != 1". */ static const struct expression plvar = { .nargs = 0, .operation = var, }; static const struct expression plone = { .nargs = 0, .operation = num, .val = { .num = 1 } }; static struct expression germanic_plural = { .nargs = 2, .operation = not_equal, .val = { .args = { [0] = (struct expression *) &plvar, [1] = (struct expression *) &plone } } }; # define INIT_GERMANIC_PLURAL() #else /* For compilers without support for ISO C 99 struct/union initializers: Initialization at run-time. */ static struct expression plvar; static struct expression plone; static struct expression germanic_plural; static void init_germanic_plural () { if (plone.val.num == 0) { plvar.nargs = 0; plvar.operation = var; plone.nargs = 0; plone.operation = num; plone.val.num = 1; germanic_plural.nargs = 2; germanic_plural.operation = not_equal; germanic_plural.val.args[0] = &plvar; germanic_plural.val.args[1] = &plone; } } # define INIT_GERMANIC_PLURAL() init_germanic_plural () #endif /* Initialize the codeset dependent parts of an opened message catalog. Return the header entry. */ const char * internal_function _nl_init_domain_conv (domain_file, domain, domainbinding) struct loaded_l10nfile *domain_file; struct loaded_domain *domain; struct binding *domainbinding; { /* Find out about the character set the file is encoded with. This can be found (in textual form) in the entry "". If this entry does not exist or if this does not contain the `charset=' information, we will assume the charset matches the one the current locale and we don't have to perform any conversion. */ char *nullentry; size_t nullentrylen; /* Preinitialize fields, to avoid recursion during _nl_find_msg. */ domain->codeset_cntr = (domainbinding != NULL ? domainbinding->codeset_cntr : 0); #ifdef _LIBC domain->conv = (__gconv_t) -1; #else # if HAVE_ICONV domain->conv = (iconv_t) -1; # endif #endif domain->conv_tab = NULL; /* Get the header entry. */ nullentry = _nl_find_msg (domain_file, domainbinding, "", &nullentrylen); if (nullentry != NULL) { #if defined _LIBC || HAVE_ICONV const char *charsetstr; charsetstr = strstr (nullentry, "charset="); if (charsetstr != NULL) { size_t len; char *charset; const char *outcharset; charsetstr += strlen ("charset="); len = strcspn (charsetstr, " \t\n"); charset = (char *) alloca (len + 1); # if defined _LIBC || HAVE_MEMPCPY *((char *) mempcpy (charset, charsetstr, len)) = '\0'; # else memcpy (charset, charsetstr, len); charset[len] = '\0'; # endif /* The output charset should normally be determined by the locale. But sometimes the locale is not used or not correctly set up, so we provide a possibility for the user to override this. Moreover, the value specified through bind_textdomain_codeset overrides both. */ if (domainbinding != NULL && domainbinding->codeset != NULL) outcharset = domainbinding->codeset; else { outcharset = getenv ("OUTPUT_CHARSET"); if (outcharset == NULL || outcharset[0] == '\0') { # ifdef _LIBC outcharset = (*_nl_current[LC_CTYPE])->values[_NL_ITEM_INDEX (CODESET)].string; # else # if HAVE_ICONV extern const char *locale_charset (void); outcharset = locale_charset (); # endif # endif } } # ifdef _LIBC /* We always want to use transliteration. */ outcharset = norm_add_slashes (outcharset, "TRANSLIT"); charset = norm_add_slashes (charset, NULL); if (__gconv_open (outcharset, charset, &domain->conv, GCONV_AVOID_NOCONV) != __GCONV_OK) domain->conv = (__gconv_t) -1; # else # if HAVE_ICONV /* When using GNU libiconv, we want to use transliteration. */ # if _LIBICONV_VERSION >= 0x0105 len = strlen (outcharset); { char *tmp = (char *) alloca (len + 10 + 1); memcpy (tmp, outcharset, len); memcpy (tmp + len, "//TRANSLIT", 10 + 1); outcharset = tmp; } # endif domain->conv = iconv_open (outcharset, charset); # if _LIBICONV_VERSION >= 0x0105 freea (outcharset); # endif # endif # endif freea (charset); } #endif /* _LIBC || HAVE_ICONV */ } return nullentry; } /* Frees the codeset dependent parts of an opened message catalog. */ void internal_function _nl_free_domain_conv (domain) struct loaded_domain *domain; { if (domain->conv_tab != NULL && domain->conv_tab != (char **) -1) free (domain->conv_tab); #ifdef _LIBC if (domain->conv != (__gconv_t) -1) __gconv_close (domain->conv); #else # if HAVE_ICONV if (domain->conv != (iconv_t) -1) iconv_close (domain->conv); # endif #endif } /* Load the message catalogs specified by FILENAME. If it is no valid message catalog do nothing. */ void internal_function _nl_load_domain (domain_file, domainbinding) struct loaded_l10nfile *domain_file; struct binding *domainbinding; { int fd; size_t size; #ifdef _LIBC struct stat64 st; #else struct stat st; #endif struct mo_file_header *data = (struct mo_file_header *) -1; int use_mmap = 0; struct loaded_domain *domain; const char *nullentry; domain_file->decided = 1; domain_file->data = NULL; /* Note that it would be useless to store domainbinding in domain_file because domainbinding might be == NULL now but != NULL later (after a call to bind_textdomain_codeset). */ /* If the record does not represent a valid locale the FILENAME might be NULL. This can happen when according to the given specification the locale file name is different for XPG and CEN syntax. */ if (domain_file->filename == NULL) return; /* Try to open the addressed file. */ fd = open (domain_file->filename, O_RDONLY | O_BINARY); if (fd == -1) return; /* We must know about the size of the file. */ if ( #ifdef _LIBC __builtin_expect (fstat64 (fd, &st) != 0, 0) #else __builtin_expect (fstat (fd, &st) != 0, 0) #endif || __builtin_expect ((size = (size_t) st.st_size) != st.st_size, 0) || __builtin_expect (size < sizeof (struct mo_file_header), 0)) { /* Something went wrong. */ close (fd); return; } #ifdef HAVE_MMAP /* Now we are ready to load the file. If mmap() is available we try this first. If not available or it failed we try to load it. */ data = (struct mo_file_header *) mmap (NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); if (__builtin_expect (data != (struct mo_file_header *) -1, 1)) { /* mmap() call was successful. */ close (fd); use_mmap = 1; } #endif /* If the data is not yet available (i.e. mmap'ed) we try to load it manually. */ if (data == (struct mo_file_header *) -1) { size_t to_read; char *read_ptr; data = (struct mo_file_header *) malloc (size); if (data == NULL) return; to_read = size; read_ptr = (char *) data; do { long int nb = (long int) read (fd, read_ptr, to_read); if (nb <= 0) { #ifdef EINTR if (nb == -1 && errno == EINTR) continue; #endif close (fd); return; } read_ptr += nb; to_read -= nb; } while (to_read > 0); close (fd); } /* Using the magic number we can test whether it really is a message catalog file. */ if (__builtin_expect (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED, 0)) { /* The magic number is wrong: not a message catalog file. */ #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); return; } domain = (struct loaded_domain *) malloc (sizeof (struct loaded_domain)); if (domain == NULL) return; domain_file->data = domain; domain->data = (char *) data; domain->use_mmap = use_mmap; domain->mmap_size = size; domain->must_swap = data->magic != _MAGIC; /* Fill in the information about the available tables. */ switch (W (domain->must_swap, data->revision)) { case 0: domain->nstrings = W (domain->must_swap, data->nstrings); domain->orig_tab = (struct string_desc *) ((char *) data + W (domain->must_swap, data->orig_tab_offset)); domain->trans_tab = (struct string_desc *) ((char *) data + W (domain->must_swap, data->trans_tab_offset)); domain->hash_size = W (domain->must_swap, data->hash_tab_size); domain->hash_tab = (nls_uint32 *) ((char *) data + W (domain->must_swap, data->hash_tab_offset)); break; default: /* This is an invalid revision. */ #ifdef HAVE_MMAP if (use_mmap) munmap ((caddr_t) data, size); else #endif free (data); free (domain); domain_file->data = NULL; return; } /* Now initialize the character set converter from the character set the file is encoded with (found in the header entry) to the domain's specified character set or the locale's character set. */ nullentry = _nl_init_domain_conv (domain_file, domain, domainbinding); /* Also look for a plural specification. */ if (nullentry != NULL) { const char *plural; const char *nplurals; plural = strstr (nullentry, "plural="); nplurals = strstr (nullentry, "nplurals="); if (plural == NULL || nplurals == NULL) goto no_plural; else { /* First get the number. */ char *endp; unsigned long int n; struct parse_args args; nplurals += 9; while (*nplurals != '\0' && isspace (*nplurals)) ++nplurals; #if defined HAVE_STRTOUL || defined _LIBC n = strtoul (nplurals, &endp, 10); #else for (endp = nplurals, n = 0; *endp >= '0' && *endp <= '9'; endp++) n = n * 10 + (*endp - '0'); #endif domain->nplurals = n; if (nplurals == endp) goto no_plural; /* Due to the restrictions bison imposes onto the interface of the scanner function we have to put the input string and the result passed up from the parser into the same structure which address is passed down to the parser. */ plural += 7; args.cp = plural; if (PLURAL_PARSE (&args) != 0) goto no_plural; domain->plural = args.res; } } else { /* By default we are using the Germanic form: singular form only for `one', the plural form otherwise. Yes, this is also what English is using since English is a Germanic language. */ no_plural: INIT_GERMANIC_PLURAL (); domain->plural = &germanic_plural; domain->nplurals = 2; } } #ifdef _LIBC void internal_function _nl_unload_domain (domain) struct loaded_domain *domain; { if (domain->plural != &germanic_plural) __gettext_free_exp (domain->plural); _nl_free_domain_conv (domain); # ifdef _POSIX_MAPPED_FILES if (domain->use_mmap) munmap ((caddr_t) domain->data, domain->mmap_size); else # endif /* _POSIX_MAPPED_FILES */ free ((void *) domain->data); free (domain); } #endif heroes-0.21/intl/localealias.c0000644004117000411500000002234407451356460012002 /* Handle aliases for locale names. Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #include #include #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif #endif #include #include #if !HAVE_STRCHR && !defined _LIBC # ifndef strchr # define strchr index # endif #endif #include "gettextP.h" /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define strcasecmp __strcasecmp # ifndef mempcpy # define mempcpy __mempcpy # endif # define HAVE_MEMPCPY 1 /* We need locking here since we can be called from different places. */ # include __libc_lock_define_initialized (static, lock); #endif #ifndef internal_function # define internal_function #endif /* For those losing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA # define freea(p) /* nothing */ #else # define alloca(n) malloc (n) # define freea(p) free (p) #endif #if defined _LIBC_REENTRANT || defined HAVE_FGETS_UNLOCKED # undef fgets # define fgets(buf, len, s) fgets_unlocked (buf, len, s) #endif #if defined _LIBC_REENTRANT || defined HAVE_FEOF_UNLOCKED # undef feof # define feof(s) feof_unlocked (s) #endif struct alias_map { const char *alias; const char *value; }; static char *string_space; static size_t string_space_act; static size_t string_space_max; static struct alias_map *map; static size_t nmap; static size_t maxmap; /* Prototypes for local functions. */ static size_t read_alias_file PARAMS ((const char *fname, int fname_len)) internal_function; static int extend_alias_table PARAMS ((void)); static int alias_compare PARAMS ((const struct alias_map *map1, const struct alias_map *map2)); const char * _nl_expand_alias (name) const char *name; { static const char *locale_alias_path = LOCALE_ALIAS_PATH; struct alias_map *retval; const char *result = NULL; size_t added; #ifdef _LIBC __libc_lock_lock (lock); #endif do { struct alias_map item; item.alias = name; if (nmap > 0) retval = (struct alias_map *) bsearch (&item, map, nmap, sizeof (struct alias_map), (int (*) PARAMS ((const void *, const void *)) ) alias_compare); else retval = NULL; /* We really found an alias. Return the value. */ if (retval != NULL) { result = retval->value; break; } /* Perhaps we can find another alias file. */ added = 0; while (added == 0 && locale_alias_path[0] != '\0') { const char *start; while (locale_alias_path[0] == PATH_SEPARATOR) ++locale_alias_path; start = locale_alias_path; while (locale_alias_path[0] != '\0' && locale_alias_path[0] != PATH_SEPARATOR) ++locale_alias_path; if (start < locale_alias_path) added = read_alias_file (start, locale_alias_path - start); } } while (added != 0); #ifdef _LIBC __libc_lock_unlock (lock); #endif return result; } static size_t internal_function read_alias_file (fname, fname_len) const char *fname; int fname_len; { FILE *fp; char *full_fname; size_t added; static const char aliasfile[] = "/locale.alias"; full_fname = (char *) alloca (fname_len + sizeof aliasfile); #ifdef HAVE_MEMPCPY mempcpy (mempcpy (full_fname, fname, fname_len), aliasfile, sizeof aliasfile); #else memcpy (full_fname, fname, fname_len); memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile); #endif fp = fopen (full_fname, "r"); freea (full_fname); if (fp == NULL) return 0; added = 0; while (!feof (fp)) { /* It is a reasonable approach to use a fix buffer here because a) we are only interested in the first two fields b) these fields must be usable as file names and so must not be that long */ char buf[BUFSIZ]; char *alias; char *value; char *cp; if (fgets (buf, sizeof buf, fp) == NULL) /* EOF reached. */ break; /* Possibly not the whole line fits into the buffer. Ignore the rest of the line. */ if (strchr (buf, '\n') == NULL) { char altbuf[BUFSIZ]; do if (fgets (altbuf, sizeof altbuf, fp) == NULL) /* Make sure the inner loop will be left. The outer loop will exit at the `feof' test. */ break; while (strchr (altbuf, '\n') == NULL); } cp = buf; /* Ignore leading white space. */ while (isspace (cp[0])) ++cp; /* A leading '#' signals a comment line. */ if (cp[0] != '\0' && cp[0] != '#') { alias = cp++; while (cp[0] != '\0' && !isspace (cp[0])) ++cp; /* Terminate alias name. */ if (cp[0] != '\0') *cp++ = '\0'; /* Now look for the beginning of the value. */ while (isspace (cp[0])) ++cp; if (cp[0] != '\0') { size_t alias_len; size_t value_len; value = cp++; while (cp[0] != '\0' && !isspace (cp[0])) ++cp; /* Terminate value. */ if (cp[0] == '\n') { /* This has to be done to make the following test for the end of line possible. We are looking for the terminating '\n' which do not overwrite here. */ *cp++ = '\0'; *cp = '\n'; } else if (cp[0] != '\0') *cp++ = '\0'; if (nmap >= maxmap) if (__builtin_expect (extend_alias_table (), 0)) return added; alias_len = strlen (alias) + 1; value_len = strlen (value) + 1; if (string_space_act + alias_len + value_len > string_space_max) { /* Increase size of memory pool. */ size_t new_size = (string_space_max + (alias_len + value_len > 1024 ? alias_len + value_len : 1024)); char *new_pool = (char *) realloc (string_space, new_size); if (new_pool == NULL) return added; if (__builtin_expect (string_space != new_pool, 0)) { size_t i; for (i = 0; i < nmap; i++) { map[i].alias += new_pool - string_space; map[i].value += new_pool - string_space; } } string_space = new_pool; string_space_max = new_size; } map[nmap].alias = memcpy (&string_space[string_space_act], alias, alias_len); string_space_act += alias_len; map[nmap].value = memcpy (&string_space[string_space_act], value, value_len); string_space_act += value_len; ++nmap; ++added; } } } /* Should we test for ferror()? I think we have to silently ignore errors. --drepper */ fclose (fp); if (added > 0) qsort (map, nmap, sizeof (struct alias_map), (int (*) PARAMS ((const void *, const void *))) alias_compare); return added; } static int extend_alias_table () { size_t new_size; struct alias_map *new_map; new_size = maxmap == 0 ? 100 : 2 * maxmap; new_map = (struct alias_map *) realloc (map, (new_size * sizeof (struct alias_map))); if (new_map == NULL) /* Simply don't extend: we don't have any more core. */ return -1; map = new_map; maxmap = new_size; return 0; } #ifdef _LIBC static void __attribute__ ((unused)) free_mem (void) { if (string_space != NULL) free (string_space); if (map != NULL) free (map); } text_set_element (__libc_subfreeres, free_mem); #endif static int alias_compare (map1, map2) const struct alias_map *map1; const struct alias_map *map2; { #if defined _LIBC || defined HAVE_STRCASECMP return strcasecmp (map1->alias, map2->alias); #else const unsigned char *p1 = (const unsigned char *) map1->alias; const unsigned char *p2 = (const unsigned char *) map2->alias; unsigned char c1, c2; if (p1 == p2) return 0; do { /* I know this seems to be odd but the tolower() function in some systems libc cannot handle nonalpha characters. */ c1 = isupper (*p1) ? tolower (*p1) : *p1; c2 = isupper (*p2) ? tolower (*p2) : *p2; if (c1 == '\0') break; ++p1; ++p2; } while (c1 == c2); return c1 - c2; #endif } heroes-0.21/intl/textdomain.c0000644004117000411500000001057707451356463011715 /* Implementation of the textdomain(3) function. Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "gettextP.h" #ifdef _LIBC /* We have to handle multi-threaded applications. */ # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_rwlock_define(CLASS, NAME) # define __libc_rwlock_wrlock(NAME) # define __libc_rwlock_unlock(NAME) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_default_domain _nl_default_default_domain__ # define _nl_current_default_domain _nl_current_default_domain__ #endif /* @@ end of prolog @@ */ /* Name of the default text domain. */ extern const char _nl_default_default_domain[]; /* Default text domain in which entries for gettext(3) are to be found. */ extern const char *_nl_current_default_domain; /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define TEXTDOMAIN __textdomain # ifndef strdup # define strdup(str) __strdup (str) # endif #else # define TEXTDOMAIN textdomain__ #endif /* Lock variable to protect the global data in the gettext implementation. */ __libc_rwlock_define (extern, _nl_state_lock) /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ char * TEXTDOMAIN (domainname) const char *domainname; { char *new_domain; char *old_domain; /* A NULL pointer requests the current setting. */ if (domainname == NULL) return (char *) _nl_current_default_domain; __libc_rwlock_wrlock (_nl_state_lock); old_domain = (char *) _nl_current_default_domain; /* If domain name is the null string set to default domain "messages". */ if (domainname[0] == '\0' || strcmp (domainname, _nl_default_default_domain) == 0) { _nl_current_default_domain = _nl_default_default_domain; new_domain = (char *) _nl_current_default_domain; } else if (strcmp (domainname, old_domain) == 0) /* This can happen and people will use it to signal that some environment variable changed. */ new_domain = old_domain; else { /* If the following malloc fails `_nl_current_default_domain' will be NULL. This value will be returned and so signals we are out of core. */ #if defined _LIBC || defined HAVE_STRDUP new_domain = strdup (domainname); #else size_t len = strlen (domainname) + 1; new_domain = (char *) malloc (len); if (new_domain != NULL) memcpy (new_domain, domainname, len); #endif if (new_domain != NULL) _nl_current_default_domain = new_domain; } /* We use this possibility to signal a change of the loaded catalogs since this is most likely the case and there is no other easy we to do it. Do it only when the call was successful. */ if (new_domain != NULL) { ++_nl_msg_cat_cntr; if (old_domain != new_domain && old_domain != _nl_default_default_domain) free (old_domain); } __libc_rwlock_unlock (_nl_state_lock); return new_domain; } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__textdomain, textdomain); #endif heroes-0.21/intl/l10nflist.c0000644004117000411500000002435207451356460011346 /* Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* Tell glibc's to provide a prototype for stpcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #if !HAVE_STRCHR && !defined _LIBC # ifndef strchr # define strchr index # endif #endif #if defined _LIBC || defined HAVE_ARGZ_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # ifndef stpcpy # define stpcpy(dest, src) __stpcpy(dest, src) # endif #else # ifndef HAVE_STPCPY static char *stpcpy PARAMS ((char *dest, const char *src)); # endif #endif /* Define function which are usually not available. */ #if !defined _LIBC && !defined HAVE___ARGZ_COUNT /* Returns the number of strings in ARGZ. */ static size_t argz_count__ PARAMS ((const char *argz, size_t len)); static size_t argz_count__ (argz, len) const char *argz; size_t len; { size_t count = 0; while (len > 0) { size_t part_len = strlen (argz); argz += part_len + 1; len -= part_len + 1; count++; } return count; } # undef __argz_count # define __argz_count(argz, len) argz_count__ (argz, len) #endif /* !_LIBC && !HAVE___ARGZ_COUNT */ #if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY /* Make '\0' separated arg vector ARGZ printable by converting all the '\0's except the last into the character SEP. */ static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep)); static void argz_stringify__ (argz, len, sep) char *argz; size_t len; int sep; { while (len > 0) { size_t part_len = strlen (argz); argz += part_len; len -= part_len + 1; if (len > 0) *argz++ = sep; } } # undef __argz_stringify # define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep) #endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */ #if !defined _LIBC && !defined HAVE___ARGZ_NEXT static char *argz_next__ PARAMS ((char *argz, size_t argz_len, const char *entry)); static char * argz_next__ (argz, argz_len, entry) char *argz; size_t argz_len; const char *entry; { if (entry) { if (entry < argz + argz_len) entry = strchr (entry, '\0') + 1; return entry >= argz + argz_len ? NULL : (char *) entry; } else if (argz_len > 0) return argz; else return 0; } # undef __argz_next # define __argz_next(argz, len, entry) argz_next__ (argz, len, entry) #endif /* !_LIBC && !HAVE___ARGZ_NEXT */ /* Return number of bits set in X. */ static int pop PARAMS ((int x)); static inline int pop (x) int x; { /* We assume that no more than 16 bits are used. */ x = ((x & ~0x5555) >> 1) + (x & 0x5555); x = ((x & ~0x3333) >> 2) + (x & 0x3333); x = ((x >> 4) + x) & 0x0f0f; x = ((x >> 8) + x) & 0xff; return x; } struct loaded_l10nfile * _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, filename, do_allocate) struct loaded_l10nfile **l10nfile_list; const char *dirlist; size_t dirlist_len; int mask; const char *language; const char *territory; const char *codeset; const char *normalized_codeset; const char *modifier; const char *special; const char *sponsor; const char *revision; const char *filename; int do_allocate; { char *abs_filename; struct loaded_l10nfile *last = NULL; struct loaded_l10nfile *retval; char *cp; size_t entries; int cnt; /* Allocate room for the full file name. */ abs_filename = (char *) malloc (dirlist_len + strlen (language) + ((mask & TERRITORY) != 0 ? strlen (territory) + 1 : 0) + ((mask & XPG_CODESET) != 0 ? strlen (codeset) + 1 : 0) + ((mask & XPG_NORM_CODESET) != 0 ? strlen (normalized_codeset) + 1 : 0) + (((mask & XPG_MODIFIER) != 0 || (mask & CEN_AUDIENCE) != 0) ? strlen (modifier) + 1 : 0) + ((mask & CEN_SPECIAL) != 0 ? strlen (special) + 1 : 0) + (((mask & CEN_SPONSOR) != 0 || (mask & CEN_REVISION) != 0) ? (1 + ((mask & CEN_SPONSOR) != 0 ? strlen (sponsor) + 1 : 0) + ((mask & CEN_REVISION) != 0 ? strlen (revision) + 1 : 0)) : 0) + 1 + strlen (filename) + 1); if (abs_filename == NULL) return NULL; retval = NULL; last = NULL; /* Construct file name. */ memcpy (abs_filename, dirlist, dirlist_len); __argz_stringify (abs_filename, dirlist_len, PATH_SEPARATOR); cp = abs_filename + (dirlist_len - 1); *cp++ = '/'; cp = stpcpy (cp, language); if ((mask & TERRITORY) != 0) { *cp++ = '_'; cp = stpcpy (cp, territory); } if ((mask & XPG_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, codeset); } if ((mask & XPG_NORM_CODESET) != 0) { *cp++ = '.'; cp = stpcpy (cp, normalized_codeset); } if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0) { /* This component can be part of both syntaces but has different leading characters. For CEN we use `+', else `@'. */ *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@'; cp = stpcpy (cp, modifier); } if ((mask & CEN_SPECIAL) != 0) { *cp++ = '+'; cp = stpcpy (cp, special); } if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0) { *cp++ = ','; if ((mask & CEN_SPONSOR) != 0) cp = stpcpy (cp, sponsor); if ((mask & CEN_REVISION) != 0) { *cp++ = '_'; cp = stpcpy (cp, revision); } } *cp++ = '/'; stpcpy (cp, filename); /* Look in list of already loaded domains whether it is already available. */ last = NULL; for (retval = *l10nfile_list; retval != NULL; retval = retval->next) if (retval->filename != NULL) { int compare = strcmp (retval->filename, abs_filename); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It's not in the list. */ retval = NULL; break; } last = retval; } if (retval != NULL || do_allocate == 0) { free (abs_filename); return retval; } retval = (struct loaded_l10nfile *) malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len) * (1 << pop (mask)) * sizeof (struct loaded_l10nfile *))); if (retval == NULL) return NULL; retval->filename = abs_filename; retval->decided = (__argz_count (dirlist, dirlist_len) != 1 || ((mask & XPG_CODESET) != 0 && (mask & XPG_NORM_CODESET) != 0)); retval->data = NULL; if (last == NULL) { retval->next = *l10nfile_list; *l10nfile_list = retval; } else { retval->next = last->next; last->next = retval; } entries = 0; /* If the DIRLIST is a real list the RETVAL entry corresponds not to a real file. So we have to use the DIRLIST separation mechanism of the inner loop. */ cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask; for (; cnt >= 0; --cnt) if ((cnt & ~mask) == 0 && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0) && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0)) { /* Iterate over all elements of the DIRLIST. */ char *dir = NULL; while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir)) != NULL) retval->successor[entries++] = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt, language, territory, codeset, normalized_codeset, modifier, special, sponsor, revision, filename, 1); } retval->successor[entries] = NULL; return retval; } /* Normalize codeset name. There is no standard for the codeset names. Normalization allows the user to use any of the common names. The return value is dynamically allocated and has to be freed by the caller. */ const char * _nl_normalize_codeset (codeset, name_len) const char *codeset; size_t name_len; { int len = 0; int only_digit = 1; char *retval; char *wp; size_t cnt; for (cnt = 0; cnt < name_len; ++cnt) if (isalnum (codeset[cnt])) { ++len; if (isalpha (codeset[cnt])) only_digit = 0; } retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1); if (retval != NULL) { if (only_digit) wp = stpcpy (retval, "iso"); else wp = retval; for (cnt = 0; cnt < name_len; ++cnt) if (isalpha (codeset[cnt])) *wp++ = tolower (codeset[cnt]); else if (isdigit (codeset[cnt])) *wp++ = codeset[cnt]; *wp = '\0'; } return (const char *) retval; } /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (dest, src) char *dest; const char *src; { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif heroes-0.21/intl/explodename.c0000644004117000411500000001105007451356457012030 /* Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc. Contributed by Ulrich Drepper , 1995. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include "loadinfo.h" /* On some strange systems still no definition of NULL is found. Sigh! */ #ifndef NULL # if defined __STDC__ && __STDC__ # define NULL ((void *) 0) # else # define NULL 0 # endif #endif /* @@ end of prolog @@ */ char * _nl_find_language (name) const char *name; { while (name[0] != '\0' && name[0] != '_' && name[0] != '@' && name[0] != '+' && name[0] != ',') ++name; return (char *) name; } int _nl_explode_name (name, language, modifier, territory, codeset, normalized_codeset, special, sponsor, revision) char *name; const char **language; const char **modifier; const char **territory; const char **codeset; const char **normalized_codeset; const char **special; const char **sponsor; const char **revision; { enum { undecided, xpg, cen } syntax; char *cp; int mask; *modifier = NULL; *territory = NULL; *codeset = NULL; *normalized_codeset = NULL; *special = NULL; *sponsor = NULL; *revision = NULL; /* Now we determine the single parts of the locale name. First look for the language. Termination symbols are `_' and `@' if we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */ mask = 0; syntax = undecided; *language = cp = name; cp = _nl_find_language (*language); if (*language == cp) /* This does not make sense: language has to be specified. Use this entry as it is without exploding. Perhaps it is an alias. */ cp = strchr (*language, '\0'); else if (cp[0] == '_') { /* Next is the territory. */ cp[0] = '\0'; *territory = ++cp; while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@' && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= TERRITORY; if (cp[0] == '.') { /* Next is the codeset. */ syntax = xpg; cp[0] = '\0'; *codeset = ++cp; while (cp[0] != '\0' && cp[0] != '@') ++cp; mask |= XPG_CODESET; if (*codeset != cp && (*codeset)[0] != '\0') { *normalized_codeset = _nl_normalize_codeset (*codeset, cp - *codeset); if (strcmp (*codeset, *normalized_codeset) == 0) free ((char *) *normalized_codeset); else mask |= XPG_NORM_CODESET; } } } if (cp[0] == '@' || (syntax != xpg && cp[0] == '+')) { /* Next is the modifier. */ syntax = cp[0] == '@' ? xpg : cen; cp[0] = '\0'; *modifier = ++cp; while (syntax == cen && cp[0] != '\0' && cp[0] != '+' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= XPG_MODIFIER | CEN_AUDIENCE; } if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_')) { syntax = cen; if (cp[0] == '+') { /* Next is special application (CEN syntax). */ cp[0] = '\0'; *special = ++cp; while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_') ++cp; mask |= CEN_SPECIAL; } if (cp[0] == ',') { /* Next is sponsor (CEN syntax). */ cp[0] = '\0'; *sponsor = ++cp; while (cp[0] != '\0' && cp[0] != '_') ++cp; mask |= CEN_SPONSOR; } if (cp[0] == '_') { /* Next is revision (CEN syntax). */ cp[0] = '\0'; *revision = ++cp; mask |= CEN_REVISION; } } /* For CEN syntax values it might be important to have the separator character in the file name, not for XPG syntax. */ if (syntax == xpg) { if (*territory != NULL && (*territory)[0] == '\0') mask &= ~TERRITORY; if (*codeset != NULL && (*codeset)[0] == '\0') mask &= ~XPG_CODESET; if (*modifier != NULL && (*modifier)[0] == '\0') mask &= ~XPG_MODIFIER; } return mask; } heroes-0.21/intl/dcigettext.c0000644004117000411500000010227307451356464011701 /* Implementation of the internal dcigettext function. Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* Tell glibc's to provide a prototype for mempcpy(). This must come before because may include , and once has been included, it's too late. */ #ifndef _GNU_SOURCE # define _GNU_SOURCE 1 #endif #ifdef HAVE_CONFIG_H # include #endif #include #ifdef __GNUC__ # define alloca __builtin_alloca # define HAVE_ALLOCA 1 #else # if defined HAVE_ALLOCA_H || defined _LIBC # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca char *alloca (); # endif # endif # endif #endif #include #ifndef errno extern int errno; #endif #ifndef __set_errno # define __set_errno(val) errno = (val) #endif #include #include #include #if !HAVE_STRCHR && !defined _LIBC # ifndef strchr # define strchr index # endif #endif #if defined HAVE_UNISTD_H || defined _LIBC # include #endif #include #if defined HAVE_SYS_PARAM_H || defined _LIBC # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include "hash-string.h" /* Thread safetyness. */ #ifdef _LIBC # include #else /* Provide dummy implementation if this is outside glibc. */ # define __libc_lock_define_initialized(CLASS, NAME) # define __libc_lock_lock(NAME) # define __libc_lock_unlock(NAME) # define __libc_rwlock_define_initialized(CLASS, NAME) # define __libc_rwlock_rdlock(NAME) # define __libc_rwlock_unlock(NAME) #endif /* Alignment of types. */ #if defined __GNUC__ && __GNUC__ >= 2 # define alignof(TYPE) __alignof__ (TYPE) #else # define alignof(TYPE) \ ((int) &((struct { char dummy1; TYPE dummy2; } *) 0)->dummy2) #endif /* The internal variables in the standalone libintl.a must have different names than the internal variables in GNU libc, otherwise programs using libintl.a cannot be linked statically. */ #if !defined _LIBC # define _nl_default_default_domain _nl_default_default_domain__ # define _nl_current_default_domain _nl_current_default_domain__ # define _nl_default_dirname _nl_default_dirname__ # define _nl_domain_bindings _nl_domain_bindings__ #endif /* Some compilers, like SunOS4 cc, don't have offsetof in . */ #ifndef offsetof # define offsetof(type,ident) ((size_t)&(((type*)0)->ident)) #endif /* @@ end of prolog @@ */ #ifdef _LIBC /* Rename the non ANSI C functions. This is required by the standard because some ANSI C functions will require linking with this object file and the name space must not be polluted. */ # define getcwd __getcwd # ifndef stpcpy # define stpcpy __stpcpy # endif # define tfind __tfind #else # if !defined HAVE_GETCWD char *getwd (); # define getcwd(buf, max) getwd (buf) # else char *getcwd (); # endif # ifndef HAVE_STPCPY static char *stpcpy PARAMS ((char *dest, const char *src)); # endif # ifndef HAVE_MEMPCPY static void *mempcpy PARAMS ((void *dest, const void *src, size_t n)); # endif #endif /* Amount to increase buffer size by in each try. */ #define PATH_INCR 32 /* The following is from pathmax.h. */ /* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define PATH_MAX but might cause redefinition warnings when sys/param.h is later included (as on MORE/BSD 4.3). */ #if defined _POSIX_VERSION || (defined HAVE_LIMITS_H && !defined __GNUC__) # include #endif #ifndef _POSIX_PATH_MAX # define _POSIX_PATH_MAX 255 #endif #if !defined PATH_MAX && defined _PC_PATH_MAX # define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX)) #endif /* Don't include sys/param.h if it already has been. */ #if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN # include #endif #if !defined PATH_MAX && defined MAXPATHLEN # define PATH_MAX MAXPATHLEN #endif #ifndef PATH_MAX # define PATH_MAX _POSIX_PATH_MAX #endif /* Pathname support. ISSLASH(C) tests whether C is a directory separator character. IS_ABSOLUTE_PATH(P) tests whether P is an absolute path. If it is not, it may be concatenated to a directory pathname. IS_PATH_WITH_DIR(P) tests whether P contains a directory specification. */ #if defined _WIN32 || defined __WIN32__ || defined __EMX__ || defined __DJGPP__ /* Win32, OS/2, DOS */ # define ISSLASH(C) ((C) == '/' || (C) == '\\') # define HAS_DEVICE(P) \ ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \ && (P)[1] == ':') # define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P)) # define IS_PATH_WITH_DIR(P) \ (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P)) #else /* Unix */ # define ISSLASH(C) ((C) == '/') # define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0]) # define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL) #endif /* XPG3 defines the result of `setlocale (category, NULL)' as: ``Directs `setlocale()' to query `category' and return the current setting of `local'.'' However it does not specify the exact format. Neither do SUSV2 and ISO C 99. So we can use this feature only on selected systems (e.g. those using GNU C Library). */ #if defined _LIBC # define HAVE_LOCALE_NULL #endif /* This is the type used for the search tree where known translations are stored. */ struct known_translation_t { /* Domain in which to search. */ char *domainname; /* The category. */ int category; /* State of the catalog counter at the point the string was found. */ int counter; /* Catalog where the string was found. */ struct loaded_l10nfile *domain; /* And finally the translation. */ const char *translation; size_t translation_length; /* Pointer to the string in question. */ char msgid[ZERO]; }; /* Root of the search tree with known translations. We can use this only if the system provides the `tsearch' function family. */ #if defined HAVE_TSEARCH || defined _LIBC # include static void *root; # ifdef _LIBC # define tsearch __tsearch # endif /* Function to compare two entries in the table of known translations. */ static int transcmp PARAMS ((const void *p1, const void *p2)); static int transcmp (p1, p2) const void *p1; const void *p2; { const struct known_translation_t *s1; const struct known_translation_t *s2; int result; s1 = (const struct known_translation_t *) p1; s2 = (const struct known_translation_t *) p2; result = strcmp (s1->msgid, s2->msgid); if (result == 0) { result = strcmp (s1->domainname, s2->domainname); if (result == 0) /* We compare the category last (though this is the cheapest operation) since it is hopefully always the same (namely LC_MESSAGES). */ result = s1->category - s2->category; } return result; } #endif /* Name of the default domain used for gettext(3) prior any call to textdomain(3). The default value for this is "messages". */ const char _nl_default_default_domain[] = "messages"; /* Value used as the default domain for gettext(3). */ const char *_nl_current_default_domain = _nl_default_default_domain; /* Contains the default location of the message catalogs. */ const char _nl_default_dirname[] = LOCALEDIR; /* List with bindings of specific domains created by bindtextdomain() calls. */ struct binding *_nl_domain_bindings; /* Prototypes for local functions. */ static char *plural_lookup PARAMS ((struct loaded_l10nfile *domain, unsigned long int n, const char *translation, size_t translation_len)) internal_function; static unsigned long int plural_eval PARAMS ((struct expression *pexp, unsigned long int n)) internal_function; static const char *category_to_name PARAMS ((int category)) internal_function; static const char *guess_category_value PARAMS ((int category, const char *categoryname)) internal_function; /* For those loosing systems which don't have `alloca' we have to add some additional code emulating it. */ #ifdef HAVE_ALLOCA /* Nothing has to be done. */ # define ADD_BLOCK(list, address) /* nothing */ # define FREE_BLOCKS(list) /* nothing */ #else struct block_list { void *address; struct block_list *next; }; # define ADD_BLOCK(list, addr) \ do { \ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \ /* If we cannot get a free block we cannot add the new element to \ the list. */ \ if (newp != NULL) { \ newp->address = (addr); \ newp->next = (list); \ (list) = newp; \ } \ } while (0) # define FREE_BLOCKS(list) \ do { \ while (list != NULL) { \ struct block_list *old = list; \ list = list->next; \ free (old); \ } \ } while (0) # undef alloca # define alloca(size) (malloc (size)) #endif /* have alloca */ #ifdef _LIBC /* List of blocks allocated for translations. */ typedef struct transmem_list { struct transmem_list *next; char data[ZERO]; } transmem_block_t; static struct transmem_list *transmem_list; #else typedef unsigned char transmem_block_t; #endif /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCIGETTEXT __dcigettext #else # define DCIGETTEXT dcigettext__ #endif /* Lock variable to protect the global data in the gettext implementation. */ #ifdef _LIBC __libc_rwlock_define_initialized (, _nl_state_lock) #endif /* Checking whether the binaries runs SUID must be done and glibc provides easier methods therefore we make a difference here. */ #ifdef _LIBC # define ENABLE_SECURE __libc_enable_secure # define DETERMINE_SECURE #else # ifndef HAVE_GETUID # define getuid() 0 # endif # ifndef HAVE_GETGID # define getgid() 0 # endif # ifndef HAVE_GETEUID # define geteuid() getuid() # endif # ifndef HAVE_GETEGID # define getegid() getgid() # endif static int enable_secure; # define ENABLE_SECURE (enable_secure == 1) # define DETERMINE_SECURE \ if (enable_secure == 0) \ { \ if (getuid () != geteuid () || getgid () != getegid ()) \ enable_secure = 1; \ else \ enable_secure = -1; \ } #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale and, if PLURAL is nonzero, search over string depending on the plural form determined by N. */ char * DCIGETTEXT (domainname, msgid1, msgid2, plural, n, category) const char *domainname; const char *msgid1; const char *msgid2; int plural; unsigned long int n; int category; { #ifndef HAVE_ALLOCA struct block_list *block_list = NULL; #endif struct loaded_l10nfile *domain; struct binding *binding; const char *categoryname; const char *categoryvalue; char *dirname, *xdomainname; char *single_locale; char *retval; size_t retlen; int saved_errno; #if defined HAVE_TSEARCH || defined _LIBC struct known_translation_t *search; struct known_translation_t **foundp = NULL; size_t msgid_len; #endif size_t domainname_len; /* If no real MSGID is given return NULL. */ if (msgid1 == NULL) return NULL; __libc_rwlock_rdlock (_nl_state_lock); /* If DOMAINNAME is NULL, we are interested in the default domain. If CATEGORY is not LC_MESSAGES this might not make much sense but the definition left this undefined. */ if (domainname == NULL) domainname = _nl_current_default_domain; #if defined HAVE_TSEARCH || defined _LIBC msgid_len = strlen (msgid1) + 1; /* Try to find the translation among those which we found at some time. */ search = (struct known_translation_t *) alloca (offsetof (struct known_translation_t, msgid) + msgid_len); memcpy (search->msgid, msgid1, msgid_len); search->domainname = (char *) domainname; search->category = category; foundp = (struct known_translation_t **) tfind (search, &root, transcmp); if (foundp != NULL && (*foundp)->counter == _nl_msg_cat_cntr) { /* Now deal with plural. */ if (plural) retval = plural_lookup ((*foundp)->domain, n, (*foundp)->translation, (*foundp)->translation_length); else retval = (char *) (*foundp)->translation; __libc_rwlock_unlock (_nl_state_lock); return retval; } #endif /* Preserve the `errno' value. */ saved_errno = errno; /* See whether this is a SUID binary or not. */ DETERMINE_SECURE; /* First find matching binding. */ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next) { int compare = strcmp (domainname, binding->domainname); if (compare == 0) /* We found it! */ break; if (compare < 0) { /* It is not in the list. */ binding = NULL; break; } } if (binding == NULL) dirname = (char *) _nl_default_dirname; else if (IS_ABSOLUTE_PATH (binding->dirname)) dirname = binding->dirname; else { /* We have a relative path. Make it absolute now. */ size_t dirname_len = strlen (binding->dirname) + 1; size_t path_max; char *ret; path_max = (unsigned int) PATH_MAX; path_max += 2; /* The getcwd docs say to do this. */ for (;;) { dirname = (char *) alloca (path_max + dirname_len); ADD_BLOCK (block_list, dirname); __set_errno (0); ret = getcwd (dirname, path_max); if (ret != NULL || errno != ERANGE) break; path_max += path_max / 2; path_max += PATH_INCR; } if (ret == NULL) { /* We cannot get the current working directory. Don't signal an error but simply return the default string. */ FREE_BLOCKS (block_list); __libc_rwlock_unlock (_nl_state_lock); __set_errno (saved_errno); return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); } stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname); } /* Now determine the symbolic name of CATEGORY and its value. */ categoryname = category_to_name (category); categoryvalue = guess_category_value (category, categoryname); domainname_len = strlen (domainname); xdomainname = (char *) alloca (strlen (categoryname) + domainname_len + 5); ADD_BLOCK (block_list, xdomainname); stpcpy (mempcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"), domainname, domainname_len), ".mo"); /* Creating working area. */ single_locale = (char *) alloca (strlen (categoryvalue) + 1); ADD_BLOCK (block_list, single_locale); /* Search for the given string. This is a loop because we perhaps got an ordered list of languages to consider for the translation. */ while (1) { /* Make CATEGORYVALUE point to the next element of the list. */ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':') ++categoryvalue; if (categoryvalue[0] == '\0') { /* The whole contents of CATEGORYVALUE has been searched but no valid entry has been found. We solve this situation by implicitly appending a "C" entry, i.e. no translation will take place. */ single_locale[0] = 'C'; single_locale[1] = '\0'; } else { char *cp = single_locale; while (categoryvalue[0] != '\0' && categoryvalue[0] != ':') *cp++ = *categoryvalue++; *cp = '\0'; /* When this is a SUID binary we must not allow accessing files outside the dedicated directories. */ if (ENABLE_SECURE && IS_PATH_WITH_DIR (single_locale)) /* Ingore this entry. */ continue; } /* If the current locale value is C (or POSIX) we don't load a domain. Return the MSGID. */ if (strcmp (single_locale, "C") == 0 || strcmp (single_locale, "POSIX") == 0) { FREE_BLOCKS (block_list); __libc_rwlock_unlock (_nl_state_lock); __set_errno (saved_errno); return (plural == 0 ? (char *) msgid1 /* Use the Germanic plural rule. */ : n == 1 ? (char *) msgid1 : (char *) msgid2); } /* Find structure describing the message catalog matching the DOMAINNAME and CATEGORY. */ domain = _nl_find_domain (dirname, single_locale, xdomainname, binding); if (domain != NULL) { retval = _nl_find_msg (domain, binding, msgid1, &retlen); if (retval == NULL) { int cnt; for (cnt = 0; domain->successor[cnt] != NULL; ++cnt) { retval = _nl_find_msg (domain->successor[cnt], binding, msgid1, &retlen); if (retval != NULL) { domain = domain->successor[cnt]; break; } } } if (retval != NULL) { /* Found the translation of MSGID1 in domain DOMAIN: starting at RETVAL, RETLEN bytes. */ FREE_BLOCKS (block_list); __set_errno (saved_errno); #if defined HAVE_TSEARCH || defined _LIBC if (foundp == NULL) { /* Create a new entry and add it to the search tree. */ struct known_translation_t *newp; newp = (struct known_translation_t *) malloc (offsetof (struct known_translation_t, msgid) + msgid_len + domainname_len + 1); if (newp != NULL) { newp->domainname = mempcpy (newp->msgid, msgid1, msgid_len); memcpy (newp->domainname, domainname, domainname_len + 1); newp->category = category; newp->counter = _nl_msg_cat_cntr; newp->domain = domain; newp->translation = retval; newp->translation_length = retlen; /* Insert the entry in the search tree. */ foundp = (struct known_translation_t **) tsearch (newp, &root, transcmp); if (foundp == NULL || __builtin_expect (*foundp != newp, 0)) /* The insert failed. */ free (newp); } } else { /* We can update the existing entry. */ (*foundp)->counter = _nl_msg_cat_cntr; (*foundp)->domain = domain; (*foundp)->translation = retval; (*foundp)->translation_length = retlen; } #endif /* Now deal with plural. */ if (plural) retval = plural_lookup (domain, n, retval, retlen); __libc_rwlock_unlock (_nl_state_lock); return retval; } } } /* NOTREACHED */ } char * internal_function _nl_find_msg (domain_file, domainbinding, msgid, lengthp) struct loaded_l10nfile *domain_file; struct binding *domainbinding; const char *msgid; size_t *lengthp; { struct loaded_domain *domain; size_t act; char *result; size_t resultlen; if (domain_file->decided == 0) _nl_load_domain (domain_file, domainbinding); if (domain_file->data == NULL) return NULL; domain = (struct loaded_domain *) domain_file->data; /* Locate the MSGID and its translation. */ if (domain->hash_size > 2 && domain->hash_tab != NULL) { /* Use the hashing table. */ nls_uint32 len = strlen (msgid); nls_uint32 hash_val = hash_string (msgid); nls_uint32 idx = hash_val % domain->hash_size; nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2)); while (1) { nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]); if (nstr == 0) /* Hash table entry is empty. */ return NULL; /* Compare msgid with the original string at index nstr-1. We compare the lengths with >=, not ==, because plural entries are represented by strings with an embedded NUL. */ if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) >= len && (strcmp (msgid, domain->data + W (domain->must_swap, domain->orig_tab[nstr - 1].offset)) == 0)) { act = nstr - 1; goto found; } if (idx >= domain->hash_size - incr) idx -= domain->hash_size - incr; else idx += incr; } /* NOTREACHED */ } else { /* Try the default method: binary search in the sorted array of messages. */ size_t top, bottom; bottom = 0; top = domain->nstrings; while (bottom < top) { int cmp_val; act = (bottom + top) / 2; cmp_val = strcmp (msgid, (domain->data + W (domain->must_swap, domain->orig_tab[act].offset))); if (cmp_val < 0) top = act; else if (cmp_val > 0) bottom = act + 1; else goto found; } /* No translation was found. */ return NULL; } found: /* The translation was found at index ACT. If we have to convert the string to use a different character set, this is the time. */ result = ((char *) domain->data + W (domain->must_swap, domain->trans_tab[act].offset)); resultlen = W (domain->must_swap, domain->trans_tab[act].length) + 1; #if defined _LIBC || HAVE_ICONV if (domain->codeset_cntr != (domainbinding != NULL ? domainbinding->codeset_cntr : 0)) { /* The domain's codeset has changed through bind_textdomain_codeset() since the message catalog was initialized or last accessed. We have to reinitialize the converter. */ _nl_free_domain_conv (domain); _nl_init_domain_conv (domain_file, domain, domainbinding); } if ( # ifdef _LIBC domain->conv != (__gconv_t) -1 # else # if HAVE_ICONV domain->conv != (iconv_t) -1 # endif # endif ) { /* We are supposed to do a conversion. First allocate an appropriate table with the same structure as the table of translations in the file, where we can put the pointers to the converted strings in. There is a slight complication with plural entries. They are represented by consecutive NUL terminated strings. We handle this case by converting RESULTLEN bytes, including NULs. */ if (domain->conv_tab == NULL && ((domain->conv_tab = (char **) calloc (domain->nstrings, sizeof (char *))) == NULL)) /* Mark that we didn't succeed allocating a table. */ domain->conv_tab = (char **) -1; if (__builtin_expect (domain->conv_tab == (char **) -1, 0)) /* Nothing we can do, no more memory. */ goto converted; if (domain->conv_tab[act] == NULL) { /* We haven't used this string so far, so it is not translated yet. Do this now. */ /* We use a bit more efficient memory handling. We allocate always larger blocks which get used over time. This is faster than many small allocations. */ __libc_lock_define_initialized (static, lock) # define INITIAL_BLOCK_SIZE 4080 static unsigned char *freemem; static size_t freemem_size; const unsigned char *inbuf; unsigned char *outbuf; int malloc_count; # ifndef _LIBC transmem_block_t *transmem_list = NULL; # endif __libc_lock_lock (lock); inbuf = (const unsigned char *) result; outbuf = freemem + sizeof (size_t); malloc_count = 0; while (1) { transmem_block_t *newmem; # ifdef _LIBC size_t non_reversible; int res; if (freemem_size < sizeof (size_t)) goto resize_freemem; res = __gconv (domain->conv, &inbuf, inbuf + resultlen, &outbuf, outbuf + freemem_size - sizeof (size_t), &non_reversible); if (res == __GCONV_OK || res == __GCONV_EMPTY_INPUT) break; if (res != __GCONV_FULL_OUTPUT) { __libc_lock_unlock (lock); goto converted; } inbuf = result; # else # if HAVE_ICONV const char *inptr = (const char *) inbuf; size_t inleft = resultlen; char *outptr = (char *) outbuf; size_t outleft; if (freemem_size < sizeof (size_t)) goto resize_freemem; outleft = freemem_size - sizeof (size_t); if (iconv (domain->conv, (ICONV_CONST char **) &inptr, &inleft, &outptr, &outleft) != (size_t) (-1)) { outbuf = (unsigned char *) outptr; break; } if (errno != E2BIG) { __libc_lock_unlock (lock); goto converted; } # endif # endif resize_freemem: /* We must allocate a new buffer or resize the old one. */ if (malloc_count > 0) { ++malloc_count; freemem_size = malloc_count * INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) realloc (transmem_list, freemem_size); # ifdef _LIBC if (newmem != NULL) transmem_list = transmem_list->next; else { struct transmem_list *old = transmem_list; transmem_list = transmem_list->next; free (old); } # endif } else { malloc_count = 1; freemem_size = INITIAL_BLOCK_SIZE; newmem = (transmem_block_t *) malloc (freemem_size); } if (__builtin_expect (newmem == NULL, 0)) { freemem = NULL; freemem_size = 0; __libc_lock_unlock (lock); goto converted; } # ifdef _LIBC /* Add the block to the list of blocks we have to free at some point. */ newmem->next = transmem_list; transmem_list = newmem; freemem = newmem->data; freemem_size -= offsetof (struct transmem_list, data); # else transmem_list = newmem; freemem = newmem; # endif outbuf = freemem + sizeof (size_t); } /* We have now in our buffer a converted string. Put this into the table of conversions. */ *(size_t *) freemem = outbuf - freemem - sizeof (size_t); domain->conv_tab[act] = (char *) freemem; /* Shrink freemem, but keep it aligned. */ freemem_size -= outbuf - freemem; freemem = outbuf; freemem += freemem_size & (alignof (size_t) - 1); freemem_size = freemem_size & ~ (alignof (size_t) - 1); __libc_lock_unlock (lock); } /* Now domain->conv_tab[act] contains the translation of all the plural variants. */ result = domain->conv_tab[act] + sizeof (size_t); resultlen = *(size_t *) domain->conv_tab[act]; } converted: /* The result string is converted. */ #endif /* _LIBC || HAVE_ICONV */ *lengthp = resultlen; return result; } /* Look up a plural variant. */ static char * internal_function plural_lookup (domain, n, translation, translation_len) struct loaded_l10nfile *domain; unsigned long int n; const char *translation; size_t translation_len; { struct loaded_domain *domaindata = (struct loaded_domain *) domain->data; unsigned long int index; const char *p; index = plural_eval (domaindata->plural, n); if (index >= domaindata->nplurals) /* This should never happen. It means the plural expression and the given maximum value do not match. */ index = 0; /* Skip INDEX strings at TRANSLATION. */ p = translation; while (index-- > 0) { #ifdef _LIBC p = __rawmemchr (p, '\0'); #else p = strchr (p, '\0'); #endif /* And skip over the NUL byte. */ p++; if (p >= translation + translation_len) /* This should never happen. It means the plural expression evaluated to a value larger than the number of variants available for MSGID1. */ return (char *) translation; } return (char *) p; } /* Function to evaluate the plural expression and return an index value. */ static unsigned long int internal_function plural_eval (pexp, n) struct expression *pexp; unsigned long int n; { switch (pexp->nargs) { case 0: switch (pexp->operation) { case var: return n; case num: return pexp->val.num; default: break; } /* NOTREACHED */ break; case 1: { /* pexp->operation must be lnot. */ unsigned long int arg = plural_eval (pexp->val.args[0], n); return ! arg; } case 2: { unsigned long int leftarg = plural_eval (pexp->val.args[0], n); if (pexp->operation == lor) return leftarg || plural_eval (pexp->val.args[1], n); else if (pexp->operation == land) return leftarg && plural_eval (pexp->val.args[1], n); else { unsigned long int rightarg = plural_eval (pexp->val.args[1], n); switch (pexp->operation) { case mult: return leftarg * rightarg; case divide: return leftarg / rightarg; case module: return leftarg % rightarg; case plus: return leftarg + rightarg; case minus: return leftarg - rightarg; case less_than: return leftarg < rightarg; case greater_than: return leftarg > rightarg; case less_or_equal: return leftarg <= rightarg; case greater_or_equal: return leftarg >= rightarg; case equal: return leftarg == rightarg; case not_equal: return leftarg != rightarg; default: break; } } /* NOTREACHED */ break; } case 3: { /* pexp->operation must be qmop. */ unsigned long int boolarg = plural_eval (pexp->val.args[0], n); return plural_eval (pexp->val.args[boolarg ? 1 : 2], n); } } /* NOTREACHED */ return 0; } /* Return string representation of locale CATEGORY. */ static const char * internal_function category_to_name (category) int category; { const char *retval; switch (category) { #ifdef LC_COLLATE case LC_COLLATE: retval = "LC_COLLATE"; break; #endif #ifdef LC_CTYPE case LC_CTYPE: retval = "LC_CTYPE"; break; #endif #ifdef LC_MONETARY case LC_MONETARY: retval = "LC_MONETARY"; break; #endif #ifdef LC_NUMERIC case LC_NUMERIC: retval = "LC_NUMERIC"; break; #endif #ifdef LC_TIME case LC_TIME: retval = "LC_TIME"; break; #endif #ifdef LC_MESSAGES case LC_MESSAGES: retval = "LC_MESSAGES"; break; #endif #ifdef LC_RESPONSE case LC_RESPONSE: retval = "LC_RESPONSE"; break; #endif #ifdef LC_ALL case LC_ALL: /* This might not make sense but is perhaps better than any other value. */ retval = "LC_ALL"; break; #endif default: /* If you have a better idea for a default value let me know. */ retval = "LC_XXX"; } return retval; } /* Guess value of current locale from value of the environment variables. */ static const char * internal_function guess_category_value (category, categoryname) int category; const char *categoryname; { const char *language; const char *retval; /* The highest priority value is the `LANGUAGE' environment variable. But we don't use the value if the currently selected locale is the C locale. This is a GNU extension. */ language = getenv ("LANGUAGE"); if (language != NULL && language[0] == '\0') language = NULL; /* We have to proceed with the POSIX methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some systems this can be done by the `setlocale' function itself. */ #if defined _LIBC || (defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL) retval = setlocale (category, NULL); #else /* Setting of LC_ALL overwrites all other. */ retval = getenv ("LC_ALL"); if (retval == NULL || retval[0] == '\0') { /* Next comes the name of the desired category. */ retval = getenv (categoryname); if (retval == NULL || retval[0] == '\0') { /* Last possibility is the LANG environment variable. */ retval = getenv ("LANG"); if (retval == NULL || retval[0] == '\0') /* We use C as the default domain. POSIX says this is implementation defined. */ return "C"; } } #endif return language != NULL && strcmp (retval, "C") != 0 ? language : retval; } /* @@ begin of epilog @@ */ /* We don't want libintl.a to depend on any other library. So we avoid the non-standard function stpcpy. In GNU C Library this function is available, though. Also allow the symbol HAVE_STPCPY to be defined. */ #if !_LIBC && !HAVE_STPCPY static char * stpcpy (dest, src) char *dest; const char *src; { while ((*dest++ = *src++) != '\0') /* Do nothing. */ ; return dest - 1; } #endif #if !_LIBC && !HAVE_MEMPCPY static void * mempcpy (dest, src, n) void *dest; const void *src; size_t n; { return (void *) ((char *) memcpy (dest, src, n) + n); } #endif #ifdef _LIBC /* If we want to free all resources we have to do some work at program's end. */ static void __attribute__ ((unused)) free_mem (void) { void *old; while (_nl_domain_bindings != NULL) { struct binding *oldp = _nl_domain_bindings; _nl_domain_bindings = _nl_domain_bindings->next; if (oldp->dirname != _nl_default_dirname) /* Yes, this is a pointer comparison. */ free (oldp->dirname); free (oldp->codeset); free (oldp); } if (_nl_current_default_domain != _nl_default_default_domain) /* Yes, again a pointer comparison. */ free ((char *) _nl_current_default_domain); /* Remove the search tree with the known translations. */ __tdestroy (root, free); root = NULL; while (transmem_list != NULL) { old = transmem_list; transmem_list = transmem_list->next; free (old); } } text_set_element (__libc_subfreeres, free_mem); #endif heroes-0.21/intl/dcngettext.c0000644004117000411500000000354507451356457011712 /* Implementation of the dcngettext(3) function. Copyright (C) 1995-1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DCNGETTEXT __dcngettext # define DCIGETTEXT __dcigettext #else # define DCNGETTEXT dcngettext__ # define DCIGETTEXT dcigettext__ #endif /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ char * DCNGETTEXT (domainname, msgid1, msgid2, n, category) const char *domainname; const char *msgid1; const char *msgid2; unsigned long int n; int category; { return DCIGETTEXT (domainname, msgid1, msgid2, 1, n, category); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dcngettext, dcngettext); #endif heroes-0.21/intl/dngettext.c0000644004117000411500000000360507451356457011544 /* Implementation of the dngettext(3) function. Copyright (C) 1995-1997, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define DNGETTEXT __dngettext # define DCNGETTEXT __dcngettext #else # define DNGETTEXT dngettext__ # define DCNGETTEXT dcngettext__ #endif /* Look up MSGID in the DOMAINNAME message catalog of the current LC_MESSAGES locale and skip message according to the plural form. */ char * DNGETTEXT (domainname, msgid1, msgid2, n) const char *domainname; const char *msgid1; const char *msgid2; unsigned long int n; { return DCNGETTEXT (domainname, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__dngettext, dngettext); #endif heroes-0.21/intl/ngettext.c0000644004117000411500000000371707451356460011376 /* Implementation of ngettext(3) function. Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #ifdef _LIBC # define __need_NULL # include #else # include /* Just for NULL. */ #endif #include "gettextP.h" #ifdef _LIBC # include #else # include "libgnuintl.h" #endif #include /* @@ end of prolog @@ */ /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define NGETTEXT __ngettext # define DCNGETTEXT __dcngettext #else # define NGETTEXT ngettext__ # define DCNGETTEXT dcngettext__ #endif /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ char * NGETTEXT (msgid1, msgid2, n) const char *msgid1; const char *msgid2; unsigned long int n; { return DCNGETTEXT (NULL, msgid1, msgid2, n, LC_MESSAGES); } #ifdef _LIBC /* Alias for function name in GNU C Library. */ weak_alias (__ngettext, ngettext); #endif heroes-0.21/intl/plural.y0000644004117000411500000002026207451356463011056 %{ /* Expression parsing for plural form selection. Copyright (C) 2000, 2001 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* The bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include "gettextP.h" /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define FREE_EXPRESSION __gettext_free_exp #else # define FREE_EXPRESSION gettext_free_exp__ # define __gettextparse gettextparse__ #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg %} %pure_parser %expect 10 %union { unsigned long int num; enum operator op; struct expression *exp; } %{ /* Prototypes for local functions. */ static struct expression *new_exp PARAMS ((int nargs, enum operator op, struct expression * const *args)); static inline struct expression *new_exp_0 PARAMS ((enum operator op)); static inline struct expression *new_exp_1 PARAMS ((enum operator op, struct expression *right)); static struct expression *new_exp_2 PARAMS ((enum operator op, struct expression *left, struct expression *right)); static inline struct expression *new_exp_3 PARAMS ((enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch)); static int yylex PARAMS ((YYSTYPE *lval, const char **pexp)); static void yyerror PARAMS ((const char *str)); /* Allocation of expressions. */ static struct expression * new_exp (nargs, op, args) int nargs; enum operator op; struct expression * const *args; { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (op) enum operator op; { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (op, right) enum operator op; struct expression *right; { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (op, left, right) enum operator op; struct expression *left; struct expression *right; { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (op, bexp, tbranch, fbranch) enum operator op; struct expression *bexp; struct expression *tbranch; struct expression *fbranch; { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } %} /* This declares that all operators have the same associativity and the precedence order as in C. See [Harbison, Steele: C, A Reference Manual]. There is no unary minus and no bitwise operators. Operators with the same syntactic behaviour have been merged into a single token, to save space in the array generated by bison. */ %right '?' /* ? */ %left '|' /* || */ %left '&' /* && */ %left EQUOP2 /* == != */ %left CMPOP2 /* < > <= >= */ %left ADDOP2 /* + - */ %left MULOP2 /* * / % */ %right '!' /* ! */ %token EQUOP2 CMPOP2 ADDOP2 MULOP2 %token NUMBER %type exp %% start: exp { if ($1 == NULL) YYABORT; ((struct parse_args *) arg)->res = $1; } ; exp: exp '?' exp ':' exp { $$ = new_exp_3 (qmop, $1, $3, $5); } | exp '|' exp { $$ = new_exp_2 (lor, $1, $3); } | exp '&' exp { $$ = new_exp_2 (land, $1, $3); } | exp EQUOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp CMPOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp ADDOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | exp MULOP2 exp { $$ = new_exp_2 ($2, $1, $3); } | '!' exp { $$ = new_exp_1 (lnot, $2); } | 'n' { $$ = new_exp_0 (var); } | NUMBER { if (($$ = new_exp_0 (num)) != NULL) $$->val.num = $1; } | '(' exp ')' { $$ = $2; } ; %% void internal_function FREE_EXPRESSION (exp) struct expression *exp; { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (lval, pexp) YYSTYPE *lval; const char **pexp; { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (str) const char *str; { /* Do nothing. We don't print error messages here. */ } heroes-0.21/intl/localcharset.c0000644004117000411500000001535707451356460012203 /* Determine a canonical name for the current locale's character encoding. Copyright (C) 2000-2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* Written by Bruno Haible . */ #ifdef HAVE_CONFIG_H # include #endif #if HAVE_STDDEF_H # include #endif #include #if HAVE_STRING_H # include #else # include #endif #if HAVE_STDLIB_H # include #endif #if defined _WIN32 || defined __WIN32__ # undef WIN32 /* avoid warning on mingw32 */ # define WIN32 #endif #ifndef WIN32 # if HAVE_LANGINFO_CODESET # include # else # if HAVE_SETLOCALE # include # endif # endif #else /* WIN32 */ # define WIN32_LEAN_AND_MEAN # include #endif #ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' #endif #ifndef ISSLASH # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) #endif /* The following static variable is declared 'volatile' to avoid a possible multithread problem in the function get_charset_aliases. If we are running in a threaded environment, and if two threads initialize 'charset_aliases' simultaneously, both will produce the same value, and everything will be ok if the two assignments to 'charset_aliases' are atomic. But I don't know what will happen if the two assignments mix. */ #if __STDC__ != 1 # define volatile /* empty */ #endif /* Pointer to the contents of the charset.alias file, if it has already been read, else NULL. Its format is: ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0' */ static const char * volatile charset_aliases; /* Return a pointer to the contents of the charset.alias file. */ static const char * get_charset_aliases () { const char *cp; cp = charset_aliases; if (cp == NULL) { #ifndef WIN32 FILE *fp; const char *dir = LIBDIR; const char *base = "charset.alias"; char *file_name; /* Concatenate dir and base into freshly allocated file_name. */ { size_t dir_len = strlen (dir); size_t base_len = strlen (base); int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1])); file_name = (char *) malloc (dir_len + add_slash + base_len + 1); if (file_name != NULL) { memcpy (file_name, dir, dir_len); if (add_slash) file_name[dir_len] = DIRECTORY_SEPARATOR; memcpy (file_name + dir_len + add_slash, base, base_len + 1); } } if (file_name == NULL || (fp = fopen (file_name, "r")) == NULL) /* Out of memory or file not found, treat it as empty. */ cp = ""; else { /* Parse the file's contents. */ int c; char buf1[50+1]; char buf2[50+1]; char *res_ptr = NULL; size_t res_size = 0; size_t l1, l2; for (;;) { c = getc (fp); if (c == EOF) break; if (c == '\n' || c == ' ' || c == '\t') continue; if (c == '#') { /* Skip comment, to end of line. */ do c = getc (fp); while (!(c == EOF || c == '\n')); if (c == EOF) break; continue; } ungetc (c, fp); if (fscanf(fp, "%50s %50s", buf1, buf2) < 2) break; l1 = strlen (buf1); l2 = strlen (buf2); if (res_size == 0) { res_size = l1 + 1 + l2 + 1; res_ptr = malloc (res_size + 1); } else { res_size += l1 + 1 + l2 + 1; res_ptr = realloc (res_ptr, res_size + 1); } if (res_ptr == NULL) { /* Out of memory. */ res_size = 0; break; } strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1); strcpy (res_ptr + res_size - (l2 + 1), buf2); } fclose (fp); if (res_size == 0) cp = ""; else { *(res_ptr + res_size) = '\0'; cp = res_ptr; } } if (file_name != NULL) free (file_name); #else /* WIN32 */ /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ cp = "CP936" "\0" "GBK" "\0" "CP1361" "\0" "JOHAB" "\0"; #endif charset_aliases = cp; } return cp; } /* Determine the current locale's character encoding, and canonicalize it into one of the canonical names listed in config.charset. The result must not be freed; it is statically allocated. If the canonical name cannot be determined, the result is a non-canonical name. */ #ifdef STATIC STATIC #endif const char * locale_charset () { const char *codeset; const char *aliases; #ifndef WIN32 # if HAVE_LANGINFO_CODESET /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); # else /* On old systems which lack it, use setlocale or getenv. */ const char *locale = NULL; /* But most old systems don't have a complete set of locales. Some (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't use setlocale here; it would return "C" when it doesn't support the locale name the user has set. */ # if HAVE_SETLOCALE && 0 locale = setlocale (LC_CTYPE, NULL); # endif if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_ALL"); if (locale == NULL || locale[0] == '\0') { locale = getenv ("LC_CTYPE"); if (locale == NULL || locale[0] == '\0') locale = getenv ("LANG"); } } /* On some old systems, one used to set locale = "iso8859_1". On others, you set it to "language_COUNTRY.charset". In any case, we resolve it through the charset.alias file. */ codeset = locale; # endif #else /* WIN32 */ static char buf[2 + 10 + 1]; /* Win32 has a function returning the locale's codepage as a number. */ sprintf (buf, "CP%u", GetACP ()); codeset = buf; #endif if (codeset == NULL) /* The canonical name cannot be determined. */ codeset = ""; /* Resolve alias. */ for (aliases = get_charset_aliases (); *aliases != '\0'; aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1) if (strcmp (codeset, aliases) == 0 || (aliases[0] == '*' && aliases[1] == '\0')) { codeset = aliases + strlen (aliases) + 1; break; } return codeset; } heroes-0.21/intl/intl-compat.c0000644004117000411500000001123107451356457011757 /* intl-compat.c - Stub functions to call gettext functions from GNU gettext Library. Copyright (C) 1995, 2000, 2001 Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ #ifdef HAVE_CONFIG_H # include #endif #include "libgnuintl.h" #include "gettextP.h" /* @@ end of prolog @@ */ /* This file redirects the gettext functions (without prefix or suffix) to those defined in the included GNU gettext library (with "__" suffix). It is compiled into libintl when the included GNU gettext library is configured --with-included-gettext. This redirection works also in the case that the system C library or the system libintl library contain gettext/textdomain/... functions. If it didn't, we would need to add preprocessor level redirections to libgnuintl.h of the following form: # define gettext gettext__ # define dgettext dgettext__ # define dcgettext dcgettext__ # define ngettext ngettext__ # define dngettext dngettext__ # define dcngettext dcngettext__ # define textdomain textdomain__ # define bindtextdomain bindtextdomain__ # define bind_textdomain_codeset bind_textdomain_codeset__ How does this redirection work? There are two cases. A. When libintl.a is linked into an executable, it works because functions defined in the executable always override functions in the shared libraries. B. When libintl.so is used, it works because 1. those systems defining gettext/textdomain/... in the C library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer) are ELF systems and define these symbols as weak, thus explicitly letting other shared libraries override it. 2. those systems defining gettext/textdomain/... in a standalone libintl.so library (namely, Solaris 2.3 and newer) have this shared library in /usr/lib, and the linker will search /usr/lib *after* the directory where the GNU gettext library is installed. A third case, namely when libintl.a is linked into a shared library whose name is not libintl.so, is not supported. In this case, on Solaris, when -lintl precedes the linker option for the shared library containing GNU gettext, the system's gettext would indeed override the GNU gettext. Anyone doing this kind of stuff must be clever enough to 1. compile libintl.a with -fPIC, 2. remove -lintl from his linker command line. */ #undef gettext #undef dgettext #undef dcgettext #undef ngettext #undef dngettext #undef dcngettext #undef textdomain #undef bindtextdomain #undef bind_textdomain_codeset char * gettext (msgid) const char *msgid; { return gettext__ (msgid); } char * dgettext (domainname, msgid) const char *domainname; const char *msgid; { return dgettext__ (domainname, msgid); } char * dcgettext (domainname, msgid, category) const char *domainname; const char *msgid; int category; { return dcgettext__ (domainname, msgid, category); } char * ngettext (msgid1, msgid2, n) const char *msgid1; const char *msgid2; unsigned long int n; { return ngettext__ (msgid1, msgid2, n); } char * dngettext (domainname, msgid1, msgid2, n) const char *domainname; const char *msgid1; const char *msgid2; unsigned long int n; { return dngettext__ (domainname, msgid1, msgid2, n); } char * dcngettext (domainname, msgid1, msgid2, n, category) const char *domainname; const char *msgid1; const char *msgid2; unsigned long int n; int category; { return dcngettext__ (domainname, msgid1, msgid2, n, category); } char * textdomain (domainname) const char *domainname; { return textdomain__ (domainname); } char * bindtextdomain (domainname, dirname) const char *domainname; const char *dirname; { return bindtextdomain__ (domainname, dirname); } char * bind_textdomain_codeset (domainname, codeset) const char *domainname; const char *codeset; { return bind_textdomain_codeset__ (domainname, codeset); } heroes-0.21/intl/plural.c0000644004117000411500000010011707451356463011026 /* A Bison parser, made from plural.y by GNU Bison version 1.28 */ #define YYBISON 1 /* Identify Bison output. */ #define yyparse __gettextparse #define yylex __gettextlex #define yyerror __gettexterror #define yylval __gettextlval #define yychar __gettextchar #define yydebug __gettextdebug #define yynerrs __gettextnerrs #define EQUOP2 257 #define CMPOP2 258 #define ADDOP2 259 #define MULOP2 260 #define NUMBER 261 #line 1 "plural.y" /* Expression parsing for plural form selection. Copyright (C) 2000, 2001 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library 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 Library General Public License for more details. You should have received a copy of the GNU Library 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. */ /* The bison generated parser uses alloca. AIX 3 forces us to put this declaration at the beginning of the file. The declaration in bison's skeleton file comes too late. This must come before because may include arbitrary system headers. */ #if defined _AIX && !defined __GNUC__ #pragma alloca #endif #ifdef HAVE_CONFIG_H # include #endif #include #include "gettextP.h" /* Names for the libintl functions are a problem. They must not clash with existing names and they should follow ANSI C. But this source code is also used in GNU C Library where the names have a __ prefix. So we have to make a difference here. */ #ifdef _LIBC # define FREE_EXPRESSION __gettext_free_exp #else # define FREE_EXPRESSION gettext_free_exp__ # define __gettextparse gettextparse__ #endif #define YYLEX_PARAM &((struct parse_args *) arg)->cp #define YYPARSE_PARAM arg #line 53 "plural.y" typedef union { unsigned long int num; enum operator op; struct expression *exp; } YYSTYPE; #line 59 "plural.y" /* Prototypes for local functions. */ static struct expression *new_exp PARAMS ((int nargs, enum operator op, struct expression * const *args)); static inline struct expression *new_exp_0 PARAMS ((enum operator op)); static inline struct expression *new_exp_1 PARAMS ((enum operator op, struct expression *right)); static struct expression *new_exp_2 PARAMS ((enum operator op, struct expression *left, struct expression *right)); static inline struct expression *new_exp_3 PARAMS ((enum operator op, struct expression *bexp, struct expression *tbranch, struct expression *fbranch)); static int yylex PARAMS ((YYSTYPE *lval, const char **pexp)); static void yyerror PARAMS ((const char *str)); /* Allocation of expressions. */ static struct expression * new_exp (nargs, op, args) int nargs; enum operator op; struct expression * const *args; { int i; struct expression *newp; /* If any of the argument could not be malloc'ed, just return NULL. */ for (i = nargs - 1; i >= 0; i--) if (args[i] == NULL) goto fail; /* Allocate a new expression. */ newp = (struct expression *) malloc (sizeof (*newp)); if (newp != NULL) { newp->nargs = nargs; newp->operation = op; for (i = nargs - 1; i >= 0; i--) newp->val.args[i] = args[i]; return newp; } fail: for (i = nargs - 1; i >= 0; i--) FREE_EXPRESSION (args[i]); return NULL; } static inline struct expression * new_exp_0 (op) enum operator op; { return new_exp (0, op, NULL); } static inline struct expression * new_exp_1 (op, right) enum operator op; struct expression *right; { struct expression *args[1]; args[0] = right; return new_exp (1, op, args); } static struct expression * new_exp_2 (op, left, right) enum operator op; struct expression *left; struct expression *right; { struct expression *args[2]; args[0] = left; args[1] = right; return new_exp (2, op, args); } static inline struct expression * new_exp_3 (op, bexp, tbranch, fbranch) enum operator op; struct expression *bexp; struct expression *tbranch; struct expression *fbranch; { struct expression *args[3]; args[0] = bexp; args[1] = tbranch; args[2] = fbranch; return new_exp (3, op, args); } #include #ifndef __cplusplus #ifndef __STDC__ #define const #endif #endif #define YYFINAL 27 #define YYFLAG -32768 #define YYNTBASE 16 #define YYTRANSLATE(x) ((unsigned)(x) <= 261 ? yytranslate[x] : 18) static const char 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, 10, 2, 2, 2, 2, 5, 2, 14, 15, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 12, 2, 2, 2, 2, 3, 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, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 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, 6, 7, 8, 9, 11 }; #if YYDEBUG != 0 static const short yyprhs[] = { 0, 0, 2, 8, 12, 16, 20, 24, 28, 32, 35, 37, 39 }; static const short yyrhs[] = { 17, 0, 17, 3, 17, 12, 17, 0, 17, 4, 17, 0, 17, 5, 17, 0, 17, 6, 17, 0, 17, 7, 17, 0, 17, 8, 17, 0, 17, 9, 17, 0, 10, 17, 0, 13, 0, 11, 0, 14, 17, 15, 0 }; #endif #if YYDEBUG != 0 static const short yyrline[] = { 0, 178, 186, 190, 194, 198, 202, 206, 210, 214, 218, 222, 227 }; #endif #if YYDEBUG != 0 || defined (YYERROR_VERBOSE) static const char * const yytname[] = { "$","error","$undefined.","'?'","'|'", "'&'","EQUOP2","CMPOP2","ADDOP2","MULOP2","'!'","NUMBER","':'","'n'","'('","')'", "start","exp", NULL }; #endif static const short yyr1[] = { 0, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17 }; static const short yyr2[] = { 0, 1, 5, 3, 3, 3, 3, 3, 3, 2, 1, 1, 3 }; static const short yydefact[] = { 0, 0, 11, 10, 0, 1, 9, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 3, 4, 5, 6, 7, 8, 0, 2, 0, 0, 0 }; static const short yydefgoto[] = { 25, 5 }; static const short yypact[] = { -9, -9,-32768,-32768, -9, 34,-32768, 11, -9, -9, -9, -9, -9, -9, -9,-32768, 24, 39, 43, 16, 26, -3,-32768, -9, 34, 21, 53,-32768 }; static const short yypgoto[] = {-32768, -1 }; #define YYLAST 53 static const short yytable[] = { 6, 1, 2, 7, 3, 4, 14, 16, 17, 18, 19, 20, 21, 22, 8, 9, 10, 11, 12, 13, 14, 26, 24, 12, 13, 14, 15, 8, 9, 10, 11, 12, 13, 14, 13, 14, 23, 8, 9, 10, 11, 12, 13, 14, 10, 11, 12, 13, 14, 11, 12, 13, 14, 27 }; static const short yycheck[] = { 1, 10, 11, 4, 13, 14, 9, 8, 9, 10, 11, 12, 13, 14, 3, 4, 5, 6, 7, 8, 9, 0, 23, 7, 8, 9, 15, 3, 4, 5, 6, 7, 8, 9, 8, 9, 12, 3, 4, 5, 6, 7, 8, 9, 5, 6, 7, 8, 9, 6, 7, 8, 9, 0 }; #define YYPURE 1 /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple" /* This file comes from bison-1.28. */ /* Skeleton output parser for bison, Copyright (C) 1984, 1989, 1990 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, when this file is copied by Bison into a Bison output file, you may use that output file without restriction. This special exception was added by the Free Software Foundation in version 1.24 of Bison. */ /* This is the parser code that is written into each bison parser when the %semantic_parser declaration is not specified in the grammar. It was written by Richard Stallman by simplifying the hairy parser used when %semantic_parser is specified. */ #ifndef YYSTACK_USE_ALLOCA #ifdef alloca #define YYSTACK_USE_ALLOCA #else /* alloca not defined */ #ifdef __GNUC__ #define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #else /* not GNU C. */ #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) #define YYSTACK_USE_ALLOCA #include #else /* not sparc */ /* We think this test detects Watcom and Microsoft C. */ /* This used to test MSDOS, but that is a bad idea since that symbol is in the user namespace. */ #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) #if 0 /* No need for malloc.h, which pollutes the namespace; instead, just don't use alloca. */ #include #endif #else /* not MSDOS, or __TURBOC__ */ #if defined(_AIX) /* I don't know what this was needed for, but it pollutes the namespace. So I turned it off. rms, 2 May 1997. */ /* #include */ #pragma alloca #define YYSTACK_USE_ALLOCA #else /* not MSDOS, or __TURBOC__, or _AIX */ #if 0 #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, and on HPUX 10. Eventually we can turn this on. */ #define YYSTACK_USE_ALLOCA #define alloca __builtin_alloca #endif /* __hpux */ #endif #endif /* not _AIX */ #endif /* not MSDOS, or __TURBOC__ */ #endif /* not sparc */ #endif /* not GNU C */ #endif /* alloca not defined */ #endif /* YYSTACK_USE_ALLOCA not defined */ #ifdef YYSTACK_USE_ALLOCA #define YYSTACK_ALLOC alloca #else #define YYSTACK_ALLOC malloc #endif /* Note: there must be only one dollar sign in this file. It is replaced by the list of actions, each action as one case of the switch. */ #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 yyerrlab1 /* 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); \ yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) #define YYTERROR 1 #define YYERRCODE 256 #ifndef YYPURE #define YYLEX yylex() #endif #ifdef YYPURE #ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else #define YYLEX yylex(&yylval, &yylloc) #endif #else /* not YYLSP_NEEDED */ #ifdef YYLEX_PARAM #define YYLEX yylex(&yylval, YYLEX_PARAM) #else #define YYLEX yylex(&yylval) #endif #endif /* not YYLSP_NEEDED */ #endif /* If nonreentrant, generate the variables here */ #ifndef YYPURE int yychar; /* the lookahead symbol */ YYSTYPE yylval; /* the semantic value of the */ /* lookahead symbol */ #ifdef YYLSP_NEEDED YYLTYPE yylloc; /* location data for the lookahead */ /* symbol */ #endif int yynerrs; /* number of parse errors so far */ #endif /* not YYPURE */ #if YYDEBUG != 0 int yydebug; /* nonzero means print parse trace */ /* Since this is uninitialized, it does not stop multiple parsers from coexisting. */ #endif /* YYINITDEPTH indicates the initial size of the parser's stacks */ #ifndef YYINITDEPTH #define YYINITDEPTH 200 #endif /* YYMAXDEPTH is the maximum size the stacks can grow to (effective only if the built-in stack extension method is used). */ #if YYMAXDEPTH == 0 #undef YYMAXDEPTH #endif #ifndef YYMAXDEPTH #define YYMAXDEPTH 10000 #endif /* Define __yy_memcpy. Note that the size argument should be passed with type unsigned int, because that is what the non-GCC definitions require. With GCC, __builtin_memcpy takes an arg of type size_t, but it can handle unsigned int. */ #if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ #define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) #else /* not GNU C or C++ */ #ifndef __cplusplus /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (to, from, count) char *to; char *from; unsigned int count; { register char *f = from; register char *t = to; register int i = count; while (i-- > 0) *t++ = *f++; } #else /* __cplusplus */ /* This is the most reliable way to avoid incompatibilities in available built-in functions on various systems. */ static void __yy_memcpy (char *to, char *from, unsigned int count) { register char *t = to; register char *f = from; register int i = count; while (i-- > 0) *t++ = *f++; } #endif #endif #line 217 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple" /* The user can define YYPARSE_PARAM as the name of an argument to be passed into yyparse. The argument should have type void *. It should actually point to an object. Grammar actions can access the variable by casting it to the proper pointer type. */ #ifdef YYPARSE_PARAM #ifdef __cplusplus #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM #define YYPARSE_PARAM_DECL #else /* not __cplusplus */ #define YYPARSE_PARAM_ARG YYPARSE_PARAM #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; #endif /* not __cplusplus */ #else /* not YYPARSE_PARAM */ #define YYPARSE_PARAM_ARG #define YYPARSE_PARAM_DECL #endif /* not YYPARSE_PARAM */ /* Prevent warning if -Wstrict-prototypes. */ #ifdef __GNUC__ #ifdef YYPARSE_PARAM int yyparse (void *); #else int yyparse (void); #endif #endif int yyparse(YYPARSE_PARAM_ARG) YYPARSE_PARAM_DECL { register int yystate; register int yyn; register short *yyssp; register YYSTYPE *yyvsp; int yyerrstatus; /* number of tokens to shift before error messages enabled */ int yychar1 = 0; /* lookahead token as an internal (translated) token number */ short yyssa[YYINITDEPTH]; /* the state stack */ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ short *yyss = yyssa; /* refer to the stacks thru separate pointers */ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ #ifdef YYLSP_NEEDED YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) #else #define YYPOPSTACK (yyvsp--, yyssp--) #endif int yystacksize = YYINITDEPTH; int yyfree_stacks = 0; #ifdef YYPURE int yychar; YYSTYPE yylval; int yynerrs; #ifdef YYLSP_NEEDED YYLTYPE yylloc; #endif #endif YYSTYPE yyval; /* the variable used to return */ /* semantic values from the action */ /* routines */ int yylen; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Starting parse\n"); #endif 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 - 1; yyvsp = yyvs; #ifdef YYLSP_NEEDED yylsp = yyls; #endif /* Push a new state, which is found in yystate . */ /* In all cases, when you get here, the value and location stacks have just been pushed. so pushing a state here evens the stacks. */ yynewstate: *++yyssp = yystate; if (yyssp >= yyss + yystacksize - 1) { /* 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; short *yyss1 = yyss; #ifdef YYLSP_NEEDED YYLTYPE *yyls1 = yyls; #endif /* Get the current used size of the three stacks, in elements. */ int size = yyssp - yyss + 1; #ifdef yyoverflow /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. */ #ifdef YYLSP_NEEDED /* This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yyls1, size * sizeof (*yylsp), &yystacksize); #else yyoverflow("parser stack overflow", &yyss1, size * sizeof (*yyssp), &yyvs1, size * sizeof (*yyvsp), &yystacksize); #endif yyss = yyss1; yyvs = yyvs1; #ifdef YYLSP_NEEDED yyls = yyls1; #endif #else /* no yyoverflow */ /* Extend the stack our own way. */ if (yystacksize >= YYMAXDEPTH) { yyerror("parser stack overflow"); if (yyfree_stacks) { free (yyss); free (yyvs); #ifdef YYLSP_NEEDED free (yyls); #endif } return 2; } yystacksize *= 2; if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; #ifndef YYSTACK_USE_ALLOCA yyfree_stacks = 1; #endif yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); __yy_memcpy ((char *)yyss, (char *)yyss1, size * (unsigned int) sizeof (*yyssp)); yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); __yy_memcpy ((char *)yyvs, (char *)yyvs1, size * (unsigned int) sizeof (*yyvsp)); #ifdef YYLSP_NEEDED yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); __yy_memcpy ((char *)yyls, (char *)yyls1, size * (unsigned int) sizeof (*yylsp)); #endif #endif /* no yyoverflow */ yyssp = yyss + size - 1; yyvsp = yyvs + size - 1; #ifdef YYLSP_NEEDED yylsp = yyls + size - 1; #endif #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Stack size increased to %d\n", yystacksize); #endif if (yyssp >= yyss + yystacksize - 1) YYABORT; } #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Entering state %d\n", yystate); #endif goto yybackup; yybackup: /* Do appropriate processing given the current state. */ /* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYFLAG) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* yychar is either YYEMPTY or YYEOF or a valid token in external form. */ if (yychar == YYEMPTY) { #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Reading a token: "); #endif yychar = YYLEX; } /* Convert token to internal form (in yychar1) for indexing tables with */ if (yychar <= 0) /* This means end of input. */ { yychar1 = 0; yychar = YYEOF; /* Don't call YYLEX any more */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Now at end of input.\n"); #endif } else { yychar1 = YYTRANSLATE(yychar); #if YYDEBUG != 0 if (yydebug) { fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); /* Give the individual parser a way to print the precise meaning of a token, for further debugging info. */ #ifdef YYPRINT YYPRINT (stderr, yychar, yylval); #endif fprintf (stderr, ")\n"); } #endif } yyn += yychar1; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; yyn = yytable[yyn]; /* yyn is what to do for this token type in this state. Negative => reduce, -yyn is rule number. Positive => shift, yyn is new state. New state is final state => don't bother to shift, just return success. 0, or most negative number => error. */ if (yyn < 0) { if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; /* Shift the lookahead token. */ #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); #endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif /* count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; /* Do the default action for the current state. */ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; /* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: yylen = yyr2[yyn]; if (yylen > 0) yyval = yyvsp[1-yylen]; /* implement default value of the action */ #if YYDEBUG != 0 if (yydebug) { int i; fprintf (stderr, "Reducing via rule %d (line %d), ", yyn, yyrline[yyn]); /* Print the symbols being reduced, and their result. */ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) fprintf (stderr, "%s ", yytname[yyrhs[i]]); fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); } #endif switch (yyn) { case 1: #line 179 "plural.y" { if (yyvsp[0].exp == NULL) YYABORT; ((struct parse_args *) arg)->res = yyvsp[0].exp; ; break;} case 2: #line 187 "plural.y" { yyval.exp = new_exp_3 (qmop, yyvsp[-4].exp, yyvsp[-2].exp, yyvsp[0].exp); ; break;} case 3: #line 191 "plural.y" { yyval.exp = new_exp_2 (lor, yyvsp[-2].exp, yyvsp[0].exp); ; break;} case 4: #line 195 "plural.y" { yyval.exp = new_exp_2 (land, yyvsp[-2].exp, yyvsp[0].exp); ; break;} case 5: #line 199 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); ; break;} case 6: #line 203 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); ; break;} case 7: #line 207 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); ; break;} case 8: #line 211 "plural.y" { yyval.exp = new_exp_2 (yyvsp[-1].op, yyvsp[-2].exp, yyvsp[0].exp); ; break;} case 9: #line 215 "plural.y" { yyval.exp = new_exp_1 (lnot, yyvsp[0].exp); ; break;} case 10: #line 219 "plural.y" { yyval.exp = new_exp_0 (var); ; break;} case 11: #line 223 "plural.y" { if ((yyval.exp = new_exp_0 (num)) != NULL) yyval.exp->val.num = yyvsp[0].num; ; break;} case 12: #line 228 "plural.y" { yyval.exp = yyvsp[-1].exp; ; break;} } /* the action file gets copied in in place of this dollarsign */ #line 543 "/home/haible/gnu/arch/linuxlibc6/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; #ifdef YYLSP_NEEDED yylsp -= yylen; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif *++yyvsp = yyval; #ifdef YYLSP_NEEDED yylsp++; if (yylen == 0) { yylsp->first_line = yylloc.first_line; yylsp->first_column = yylloc.first_column; yylsp->last_line = (yylsp-1)->last_line; yylsp->last_column = (yylsp-1)->last_column; yylsp->text = 0; } else { yylsp->last_line = (yylsp+yylen-1)->last_line; yylsp->last_column = (yylsp+yylen-1)->last_column; } #endif /* 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 - YYNTBASE] + *yyssp; if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; yyerrlab: /* here on detecting error */ if (! yyerrstatus) /* If not already recovering from an error, report this error. */ { ++yynerrs; #ifdef YYERROR_VERBOSE yyn = yypact[yystate]; if (yyn > YYFLAG && yyn < YYLAST) { int size = 0; char *msg; int x, count; count = 0; /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) size += strlen(yytname[x]) + 15, count++; msg = (char *) malloc(size + 15); if (msg != 0) { strcpy(msg, "parse error"); if (count < 5) { count = 0; for (x = (yyn < 0 ? -yyn : 0); x < (sizeof(yytname) / sizeof(char *)); x++) if (yycheck[x + yyn] == x) { strcat(msg, count == 0 ? ", expecting `" : " or `"); strcat(msg, yytname[x]); strcat(msg, "'"); count++; } } yyerror(msg); free(msg); } else yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ yyerror("parse error"); } goto yyerrlab1; yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { /* if just tried and failed to reuse lookahead token after an error, discard it. */ /* return failure if at end of input */ if (yychar == YYEOF) YYABORT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); #endif yychar = YYEMPTY; } /* Else will try to reuse lookahead token after shifting the error token. */ yyerrstatus = 3; /* Each real token shifted decrements this */ goto yyerrhandle; yyerrdefault: /* current state does not do anything special for the error token. */ #if 0 /* This is wrong; only states that explicitly want error tokens should shift them. */ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ if (yyn) goto yydefault; #endif yyerrpop: /* pop the current state because it cannot handle the error token */ if (yyssp == yyss) YYABORT; yyvsp--; yystate = *--yyssp; #ifdef YYLSP_NEEDED yylsp--; #endif #if YYDEBUG != 0 if (yydebug) { short *ssp1 = yyss - 1; fprintf (stderr, "Error: state stack now"); while (ssp1 != yyssp) fprintf (stderr, " %d", *++ssp1); fprintf (stderr, "\n"); } #endif yyerrhandle: yyn = yypact[yystate]; if (yyn == YYFLAG) goto yyerrdefault; yyn += YYTERROR; if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) goto yyerrdefault; yyn = yytable[yyn]; if (yyn < 0) { if (yyn == YYFLAG) goto yyerrpop; yyn = -yyn; goto yyreduce; } else if (yyn == 0) goto yyerrpop; if (yyn == YYFINAL) YYACCEPT; #if YYDEBUG != 0 if (yydebug) fprintf(stderr, "Shifting error token, "); #endif *++yyvsp = yylval; #ifdef YYLSP_NEEDED *++yylsp = yylloc; #endif yystate = yyn; goto yynewstate; yyacceptlab: /* YYACCEPT comes here. */ if (yyfree_stacks) { free (yyss); free (yyvs); #ifdef YYLSP_NEEDED free (yyls); #endif } return 0; yyabortlab: /* YYABORT comes here. */ if (yyfree_stacks) { free (yyss); free (yyvs); #ifdef YYLSP_NEEDED free (yyls); #endif } return 1; } #line 233 "plural.y" void internal_function FREE_EXPRESSION (exp) struct expression *exp; { if (exp == NULL) return; /* Handle the recursive case. */ switch (exp->nargs) { case 3: FREE_EXPRESSION (exp->val.args[2]); /* FALLTHROUGH */ case 2: FREE_EXPRESSION (exp->val.args[1]); /* FALLTHROUGH */ case 1: FREE_EXPRESSION (exp->val.args[0]); /* FALLTHROUGH */ default: break; } free (exp); } static int yylex (lval, pexp) YYSTYPE *lval; const char **pexp; { const char *exp = *pexp; int result; while (1) { if (exp[0] == '\0') { *pexp = exp; return YYEOF; } if (exp[0] != ' ' && exp[0] != '\t') break; ++exp; } result = *exp++; switch (result) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { unsigned long int n = result - '0'; while (exp[0] >= '0' && exp[0] <= '9') { n *= 10; n += exp[0] - '0'; ++exp; } lval->num = n; result = NUMBER; } break; case '=': if (exp[0] == '=') { ++exp; lval->op = equal; result = EQUOP2; } else result = YYERRCODE; break; case '!': if (exp[0] == '=') { ++exp; lval->op = not_equal; result = EQUOP2; } break; case '&': case '|': if (exp[0] == result) ++exp; else result = YYERRCODE; break; case '<': if (exp[0] == '=') { ++exp; lval->op = less_or_equal; } else lval->op = less_than; result = CMPOP2; break; case '>': if (exp[0] == '=') { ++exp; lval->op = greater_or_equal; } else lval->op = greater_than; result = CMPOP2; break; case '*': lval->op = mult; result = MULOP2; break; case '/': lval->op = divide; result = MULOP2; break; case '%': lval->op = module; result = MULOP2; break; case '+': lval->op = plus; result = ADDOP2; break; case '-': lval->op = minus; result = ADDOP2; break; case 'n': case '?': case ':': case '(': case ')': /* Nothing, just return the character. */ break; case ';': case '\n': case '\0': /* Be safe and let the user call this function again. */ --exp; result = YYEOF; break; default: result = YYERRCODE; #if YYDEBUG != 0 --exp; #endif break; } *pexp = exp; return result; } static void yyerror (str) const char *str; { /* Do nothing. We don't print error messages here. */ } heroes-0.21/intl/VERSION0000644004117000411500000000005107451356456010431 GNU gettext library from gettext-0.10.40 heroes-0.21/m4/0000777004117000411500000000000007451377037007021 5heroes-0.21/m4/Makefile.inc0000644004117000411500000000163007451356466011150 ## This file was generated by tools/genm4mam.sh ## on Sat Mar 30 16:43:50 CET 2002 EXTRA_DIST += m4/README \ m4/bigendian.m4 \ m4/checkpkg.m4 \ m4/codeset.m4 \ m4/compat.m4 \ m4/debug.m4 \ m4/definedir.m4 \ m4/devel.m4 \ m4/dos.m4 \ m4/filelock.m4 \ m4/findheader.m4 \ m4/ftruncate.m4 \ m4/gccoptim.m4 \ m4/gccwarn.m4 \ m4/generic.m4 \ m4/getoptlong.m4 \ m4/gettext.m4 \ m4/glibc21.m4 \ m4/gnu-source.m4 \ m4/gprof.m4 \ m4/h-allegro.m4 \ m4/h-debug.m4 \ m4/h-display.m4 \ m4/h-ggi.m4 \ m4/h-joystick.m4 \ m4/h-media.m4 \ m4/h-mikmod.m4 \ m4/h-obsolete.m4 \ m4/h-paths.m4 \ m4/h-sdl.m4 \ m4/h-sdlmixer.m4 \ m4/h-sound.m4 \ m4/htmldoc.m4 \ m4/iconv.m4 \ m4/isc-posix.m4 \ m4/lcmessage.m4 \ m4/libalt.m4 \ m4/malloc.m4 \ m4/memdebug.m4 \ m4/mkdir.m4 \ m4/ndebug.m4 \ m4/normpath.m4 \ m4/pkgeneric.m4 \ m4/progtest.m4 \ m4/realloc.m4 \ m4/relpaths.m4 \ m4/runcheck.m4 \ m4/stdrelpaths.m4 \ m4/strerror_r.m4 \ m4/w_dirent.m4 heroes-0.21/m4/README0000644004117000411500000000115707227263735007621 Some files in this directory come from external packages. Read the file HACKING in the top level directory for a list of them. These files are used by a program called aclocal (part of the GNU automake package). aclocal uses these files to create aclocal.m4 which is in turn used by autoconf to create the configure script at the the top level in this distribution. The files starting with `h-' are meant to be specific to Heroes (precisely, they are just parts of configure.in moved here to to ease the reading of configure.in). The Makefile.am file in this directory is automatically generated by tools/genm4mam.sh. heroes-0.21/m4/bigendian.m40000644004117000411500000000516107223406755011117 dnl @synopsis AC_C_BIGENDIAN_CROSS dnl dnl Check endianess even when crosscompiling dnl (partially based on the original AC_C_BIGENDIAN). dnl dnl The implementation will create a binary, and instead of running dnl the binary it will be grep'ed for some symbols that will look dnl different for different endianess of the binary. dnl dnl @version $Id: ac_c_bigendian_cross.m4,v 1.1 2000/09/09 13:29:23 simons Exp $ dnl @author Guido Draheim dnl AC_DEFUN([AC_C_BIGENDIAN_CROSS], [AC_CACHE_CHECK([whether byte ordering is bigendian], [ac_cv_c_bigendian], [# See if sys/param.h defines the BYTE_ORDER macro. AC_TRY_COMPILE([#include #include ], [ #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif], [# It does; now see whether it defined to BIG_ENDIAN or not. AC_TRY_COMPILE([#include #include ], [ #if BYTE_ORDER != BIG_ENDIAN not big endian #endif], [ac_cv_c_bigendian=yes], [ac_cv_c_bigendian=no])], [# It does not, try to run a simple test AC_TRY_RUN([main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); }], [ac_cv_c_bigendian=no], [ac_cv_c_bigendian=yes], [ac_cv_c_bigendian="unknown (cross-compiling)"]) ])]) if test "$ac_cv_c_bigendian" = "unknown (cross-compiling)"; then AC_MSG_CHECKING([whether byte order LOOKS bigendian]) [cat >conftest.c < with fixes from Alexandre Duret-Lutz . dnl AC_DEFUN([AC_caolan_CHECK_PACKAGE], [ dnl we're going to need uppercase, lowercase and user-friendly versions of the dnl string `LIBRARY' pushdef([UP], MY_TR_CPP([$1]))dnl pushdef([DOWN], translit([$1], [-A-Z], [_a-z]))dnl pushdef([DOWNALT], translit([$1], [_A-Z], [-a-z]))dnl AC_ARG_WITH(DOWNALT, [AC_HELP_STRING([--with-]DOWNALT[=DIR],[root directory of $1 installation])], [with_[]DOWN=$withval if test "${with_[]DOWN}" != yes; then DOWN[]_include="$withval/include" DOWN[]_libdir="$withval/lib" fi] ) AC_ARG_WITH(DOWNALT[-include], [AC_HELP_STRING([--with-]DOWNALT[-include=DIR], [specify exact include dir for $1 headers])], [DOWN[]_include="$withval"]) AC_ARG_WITH(DOWNALT[-libdir], [AC_HELP_STRING([--with-]DOWNALT[-libdir=DIR], [specify exact library dir for $1 library]) AC_HELP_STRING([--without-]DOWNALT,[disables ]DOWN[ usage completely])], [DOWN[]_libdir="$withval"]) if test "${with_[]DOWN}" != no ; then OLD_LIBS="$LIBS" OLD_LDFLAGS="$LDFLAGS" OLD_CFLAGS="$CFLAGS" OLD_CPPFLAGS="$CPPFLAGS" if test "${DOWN[]_libdir}" ; then UP[]_LDFLAGS="-L${DOWN[]_libdir}" LDFLAGS="$LDFLAGS ${UP[]_LDFLAGS}" fi if test "${DOWN[]_include}" ; then UP[]_CFLAGS="-I${DOWN[]_include}" CPPFLAGS="$CPPFLAGS ${UP[]_CFLAGS}" CFLAGS="$CFLAGS ${UP[]_CFLAGS}" fi no_good=no dnl pass a third argument to AC_CHECK_LIB to dnl prevent HAVE_LIB$3 from being defined. AC_CHECK_LIB([$3],[$2],[:],[no_good=yes]) AC_CHECK_HEADER([$4],,[no_good=yes]) LIBS="$OLD_LIBS" LDFLAGS="$OLD_LDFLAGS" CPPFLAGS="$OLD_CPPFLAGS" CFLAGS="$OLD_CFLAGS" if test "$no_good" = yes; then dnl broken ifelse([$6], , , [$6]) UP[]_LDFLAGS="" UP[]_CFLAGS="" UP[]_LIBS="" else dnl fixed UP[]_LIBS="-l$3" ifelse([$5], , , [$5]) fi fi AC_SUBST(UP[]_CFLAGS) AC_SUBST(UP[]_LIBS) AC_SUBST(UP[]_LDFLAGS) popdef([UP]) popdef([DOWN]) popdef([DOWNALT]) ]) heroes-0.21/m4/codeset.m40000644004117000411500000000071607272215305010617 #serial AM1 dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) heroes-0.21/m4/compat.m40000644004117000411500000000110507332464427010455 dnl The Autoconf maintainers keep moving undocumented functions around, dnl so let's use what we find, to stay compatible with different version dnl of Autoconf... AC_DEFUN([MY_TR_SH],[ifdef([AS_TR_SH],[AS_TR_SH($@)],[AC_TR_SH($@)])]) AC_DEFUN([MY_TR_CPP],[ifdef([AS_TR_CPP],[AS_TR_CPP($@)],[AC_TR_CPP($@)])]) AC_DEFUN([MY_VAR_PUSHDEF], [ifdef([AS_VAR_PUSHDEF],[AS_VAR_PUSHDEF($@)],[AC_VAR_PUSHDEF($@)])]) AC_DEFUN([MY_VAR_POPDEF], [ifdef([AS_VAR_POPDEF],[AS_VAR_POPDEF($@)],[AC_VAR_POPDEF($@)])]) AC_DEFUN([MY_VAR_SET],[ifdef([AS_VAR_SET],[AS_VAR_SET($@)],[AC_VAR_SET($@)])]) heroes-0.21/m4/debug.m40000644004117000411500000000101707232763327010262 AC_DEFUN([adl_ENABLE_DEBUG], [AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug],[enable debugging symbols])]) case "${enable_debug}" in yes) AC_DEFINE([DEBUG],1,[Define if you want debugging code.]) if test -n "$GCC"; then CFLAGS="$CFLAGS -ggdb3" else if test "${ac_cv_prog_cc_g}" = yes; then CFLAGS="$CFLAGS -g" fi fi ;; no) ;; *) if test "${ac_cv_prog_cc_g}" = yes; then CFLAGS="$CFLAGS -g" fi ;; esac]) heroes-0.21/m4/definedir.m40000644004117000411500000000162207223406755011126 dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) dnl dnl This macro defines (with AC_DEFINE) VARNAME to the expansion of the DIR dnl variable, taking care of fixing up ${prefix} and such. dnl dnl Note that the 3 argument form is only supported with autoconf 2.13 and dnl later (i.e. only where AC_DEFINE supports 3 arguments). dnl dnl Examples: dnl dnl AC_DEFINE_DIR(DATADIR, datadir) dnl AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries]) dnl dnl @version $Id: ac_define_dir.m4,v 1.2 2000/07/19 13:03:32 simons Exp $ dnl @author Alexandre Oliva AC_DEFUN([AC_DEFINE_DIR], [ ac_expanded=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""[$]$2"\" )` ifelse($3, , AC_DEFINE_UNQUOTED($1, "$ac_expanded"), AC_DEFINE_UNQUOTED($1, "$ac_expanded", $3)) ]) heroes-0.21/m4/devel.m40000644004117000411500000000054407422650054010270 AC_DEFUN([adl_ENABLE_DEVEL], [AC_ARG_ENABLE([devel], [AC_HELP_STRING([--enable-devel], [turn on useful developer options])]) if test x"$enable_devel" = xyes; then enable_debug=${enable_debug-yes} enable_warnings=${enable_warnings-yes} enable_assert=${enable_assert-yes} enable_optimizations=${enable_optimizations--O} fi ]) heroes-0.21/m4/dos.m40000644004117000411500000000311607353601452007755 #serial 5 # Define some macros required for proper operation of code in lib/*.c # on MSDOS/Windows systems. # From Jim Meyering. AC_DEFUN([jm_AC_DOS], [ AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos], [ AC_TRY_COMPILE([], [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ neither MSDOS nor Windows #endif], [ac_cv_win_or_dos=yes], [ac_cv_win_or_dos=no]) ]) if test x"$ac_cv_win_or_dos" = xyes; then ac_fs_accepts_drive_letter_prefix=1 ac_fs_backslash_is_file_name_separator=1 else ac_fs_accepts_drive_letter_prefix=0 ac_fs_backslash_is_file_name_separator=0 fi AH_VERBATIM(FILESYSTEM_PREFIX_LEN, [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX # define FILESYSTEM_PREFIX_LEN(Filename) \ ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0) #else # define FILESYSTEM_PREFIX_LEN(Filename) 0 #endif]) AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX], $ac_fs_accepts_drive_letter_prefix, [Define on systems for which file names may have a so-called `drive letter' prefix, define this to compute the length of that prefix, including the colon.]) AH_VERBATIM(ISSLASH, [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR # define ISSLASH(C) ((C) == '/' || (C) == '\\') #else # define ISSLASH(C) ((C) == '/') #endif]) AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR], $ac_fs_backslash_is_file_name_separator, [Define if the backslash character may also serve as a file name component separator.]) ]) heroes-0.21/m4/filelock.m40000644004117000411500000000027407311432054010754 # Check for functions and headers needed by lib/filelock.c AC_DEFUN([adl_FILELOCK], [ AC_CHECK_HEADERS([fcntl.h sys/file.h io.h sys/locking.h]) AC_CHECK_FUNCS([fcntl flock _locking]) ]) heroes-0.21/m4/findheader.m40000644004117000411500000000334507332464427011273 dnl AC_adl_FIND_HEADER(HEADER-NAME, CPPFLAGS, OTHER-NAMES, REGEX, NMATCH dnl ACTION-IF-YES, ACTION-IF-NOT) dnl dnl Search for the exact location of header `' which must dnl match `NMATCH' times the regex `REGEX'. If is header is not found, dnl try the OTHER-NAMES list of headers. dnl dnl Generalized by Alexandre Duret-Lutz dnl from a test in Zsh's configure.in (written by?) AC_DEFUN([AC_adl_FIND_HEADER], [# Where is <$1> located? MY_VAR_PUSHDEF([ac_adl_Header], [ac_cv_header_path_$1]) AC_CACHE_CHECK([where $1 is located], ac_adl_Header, [# Look at the output from the preprocessor. # We should get lines of the form `# 1 "/usr/include/$1"' # The backslash substitution is to persuade cygwin to cough up # slashes rather than doubled backslashes in the path. echo "#include <$1>" > nametmp.c afh_file_list="`$CPP $2 nametmp.c 2> /dev/null | sed -n 's/^#[ ].*\"\(.*\)\"/\1/p' | sed 's/\\\\\\\\/\//g' | $AWK '{ if (\@S|@1 ~ \"$1\") files[[\@S|@1]] = \@S|@1 } END { for (var in files) print var }'`" dnl Note: `@S|@' will be translated into `$' by autoconf. rm -f nametmp.c if test -z "$afh_file_list"; then # In case we don't get the stuff from the preprocesor, use the # list of standard places. afh_file_list="$3 /dev/null" fi for ASH_FILE_H in $afh_file_list do # make sure it doesn't get confused by files that don't # define what is searched for ash_nmatch=`test -f $ASH_FILE_H && \ grep '$4' $ASH_FILE_H | \ wc -l | sed 's/[ ]//g'` test "x$ash_nmatch" != x && test "$ash_nmatch" -ge $5 && break done MY_VAR_SET(ac_adl_Header,[$ASH_FILE_H]) if test "$ASH_FILE_H" = "/dev/null"; then ifelse([$7], , [:], [$7]) else ifelse([$6], , [:], [$6]) fi]) MY_VAR_POPDEF([ac_adl_Header])]) heroes-0.21/m4/ftruncate.m40000644004117000411500000000047607353601452011171 #serial 4 # See if we need to emulate a missing ftruncate function using fcntl or chsize. AC_DEFUN([jm_FUNC_FTRUNCATE], [ AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes]) if test "$ftruncate_missing" = yes; then AC_CHECK_HEADERS([unistd.h]) AC_CHECK_FUNCS([chsize]) AC_LIBOBJ(ftruncate) fi ]) heroes-0.21/m4/gccoptim.m40000644004117000411500000000200707422650054010772 dnl Adapted from Akim Demaille ad_GCC_WARNINGS. AC_DEFUN([ad_GCC_OPTIM], [AC_ARG_ENABLE([optimizations], [AC_HELP_STRING([--disable-optimizations], [turn off aggressive optimizations])]) if test -n "$GCC" -a "${enable_optimizations-yes}" = "yes"; then AC_CACHE_CHECK([for gcc optimization options], ac_cv_prog_gcc_opt_flags, [changequote(,)dnl cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < dnl @version $Id: generic-config.m4,v 1.2 2000/07/19 13:03:32 simons Exp $ AC_DEFUN([AC_PATH_GENERIC], [dnl dnl we're going to need uppercase, lowercase and user-friendly versions of the dnl string `LIBRARY' pushdef([UP], translit([$1], [a-z], [A-Z]))dnl pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl dnl dnl Get the cflags and libraries from the LIBRARY-config script dnl AC_ARG_WITH(DOWN[-prefix], [AC_HELP_STRING([--with-]DOWN[-prefix=PFX], [Prefix where $1 is installed (optional)])], DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="") AC_ARG_WITH(DOWN[-exec-prefix], [AC_HELP_STRING([--with-]DOWN[-exec-prefix=PFX], [Exec prefix where $1 is installed (optional)])], DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="") if test x$DOWN[]_config_exec_prefix != x ; then DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix" if test x${UP[]_CONFIG+set} != xset ; then UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config fi fi if test x$DOWN[]_config_prefix != x ; then DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix" if test x${UP[]_CONFIG+set} != xset ; then UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config fi fi AC_PATH_PROG(UP[]_CONFIG, DOWN-config, no) ifelse([$2], , AC_MSG_CHECKING(for $1), AC_MSG_CHECKING(for $1 - version >= $2) ) no_[]DOWN="" if test "$UP[]_CONFIG" = "no" ; then no_[]DOWN=yes else UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`" UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`" ifelse([$2], , ,[ DOWN[]_config_major_version=`$UP[]_CONFIG $DOWN[]_config_args \ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` DOWN[]_config_minor_version=`$UP[]_CONFIG $DOWN[]_config_args \ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` DOWN[]_config_micro_version=`$UP[]_CONFIG $DOWN[]_config_args \ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` DOWN[]_wanted_major_version="regexp($2, [\<\([0-9]*\)], [\1])" DOWN[]_wanted_minor_version="regexp($2, [\<\([0-9]*\)\.\([0-9]*\)], [\2])" DOWN[]_wanted_micro_version="regexp($2, [\<\([0-9]*\).\([0-9]*\).\([0-9]*\)], [\3])" # Compare wanted version to what config script returned. # If I knew what library was being run, i'd probably also compile # a test program at this point (which also extracted and tested # the version in some library-specific way) if test "$DOWN[]_config_major_version" -lt \ "$DOWN[]_wanted_major_version" \ -o \( "$DOWN[]_config_major_version" -eq \ "$DOWN[]_wanted_major_version" \ -a "$DOWN[]_config_minor_version" -lt \ "$DOWN[]_wanted_minor_version" \) \ -o \( "$DOWN[]_config_major_version" -eq \ "$DOWN[]_wanted_major_version" \ -a "$DOWN[]_config_minor_version" -eq \ "$DOWN[]_wanted_minor_version" \ -a "$DOWN[]_config_micro_version" -lt \ "$DOWN[]_wanted_micro_version" \) ; then # older version found no_[]DOWN=yes echo -n "*** An old version of $1 " echo -n "($DOWN[]_config_major_version" echo -n ".$DOWN[]_config_minor_version" echo ".$DOWN[]_config_micro_version) was found." echo -n "*** You need a version of $1 newer than " echo -n "$DOWN[]_wanted_major_version" echo -n ".$DOWN[]_wanted_minor_version" echo ".$DOWN[]_wanted_micro_version." echo "***" echo "*** If you have already installed a sufficiently new version, this error" echo "*** probably means that the wrong copy of the DOWN-config shell script is" echo "*** being found. The easiest way to fix this is to remove the old version" echo "*** of $1, but you can also set the UP[]_CONFIG environment to point to the" echo "*** correct copy of DOWN-config. (In this case, you will have to" echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf" echo "*** so that the correct libraries are found at run-time)" fi ]) fi if test "x$no_[]DOWN" = x ; then AC_MSG_RESULT(yes) ifelse([$3], , :, [$3]) else AC_MSG_RESULT(no) ## We won't display this warning unless the installer used --with-DOWN. if test "$UP[]_CONFIG" = "no" && test "${with_[]DOWN[]-no}" != no ; then echo "*** The DOWN-config script installed by $1 could not be found" echo "*** If $1 was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the UP[]_CONFIG environment variable to the" echo "*** full path to DOWN-config." fi UP[]_CFLAGS="" UP[]_LIBS="" ifelse([$4], , :, [$4]) fi AC_SUBST(UP[]_CFLAGS) AC_SUBST(UP[]_LIBS) popdef([UP]) popdef([DOWN]) ]) heroes-0.21/m4/getoptlong.m40000644004117000411500000000177007263615654011367 dnl @synopsis adl_FUNC_GETOPT_LONG dnl dnl Check for getopt_long support. dnl dnl This assume that the standard getopt.h file (from GNU libc) is dnl available as lib/gnugetopt.h. If needed, this file will be linked dnl as getopt.h, but we want to default to the system's getopt.h file. dnl (See http://sources.redhat.com/ml/automake/2000-09/msg00041.html dnl for an explanation about why using the system's getopt.h file dnl is important.) dnl dnl @version $Id$ dnl @author Alexandre Duret-Lutz AC_PREREQ(2.49) AC_DEFUN([adl_FUNC_GETOPT_LONG], [# clean out junk possibly left behind by a previous configuration rm -f lib/getopt.h # Check for getopt_long support AC_CHECK_HEADER([getopt.h]) AC_CHECK_FUNCS([getopt_long],, [# FreeBSD has a gnugetopt library for this AC_CHECK_LIB([gnugetopt],[getopt_long],[AC_DEFINE([HAVE_GETOPT_LONG])], [# use the GNU replacement AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1) AC_CONFIG_LINKS([lib/getopt.h:lib/gnugetopt.h])])])]) heroes-0.21/m4/gettext.m40000644004117000411500000003254007322634342010657 # Macro to add for using GNU gettext. # Ulrich Drepper , 1995. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # serial 9 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]). dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). Otherwise, a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. dnl LIBDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_WITH_NLS], [AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no INTLLIBS= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. CATOBJEXT=NONE dnl Add a version number to the cache macros. define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc]) define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl]) AC_CHECK_HEADER(libintl.h, [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include extern int _nl_msg_cat_cntr;], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_LIBS="$LIBS" LIBS="$LIBS -lintl $LIBICONV" AC_TRY_LINK([#include extern int _nl_msg_cat_cntr;], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext; }; then AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) if test "$gt_cv_func_gnugettext_libintl" = "yes"; then dnl If iconv() is in a separate libiconv library, then anyone dnl linking with libintl{.a,.so} also needs to link with dnl libiconv. INTLLIBS="-lintl $LIBICONV" fi gt_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) LIBS="$gt_save_LIBS" AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) fi AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) CATOBJEXT=.gmo fi ]) if test "$CATOBJEXT" = "NONE"; then dnl GNU gettext is not found in the C library. dnl Fall back on GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. INTLOBJS="\$(GETTOBJS)" AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_SUBST(MSGFMT) BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi dnl We need to process the po/ directory. POSUB=po fi AC_OUTPUT_COMMANDS( [for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" fi ;; esac done]) dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext; then BUILD_INCLUDED_LIBINTL=yes fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.in. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(GMOFILES) AC_SUBST(INTLLIBS) AC_SUBST(INTLOBJS) AC_SUBST(POFILES) AC_SUBST(POSUB) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) ]) dnl Usage: Just like AM_WITH_NLS, which see. AC_DEFUN([AM_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([jm_GLIBC21])dnl AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \ getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) AM_ICONV AM_LANGINFO_CODESET AM_LC_MESSAGES AM_WITH_NLS([$1],[$2],[$3]) if test "x$CATOBJEXT" != "x"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], []) AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) heroes-0.21/m4/glibc21.m40000644004117000411500000000102607313135745010414 #serial 2 # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([jm_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) heroes-0.21/m4/gnu-source.m40000644004117000411500000000123307353601452011255 #serial 3 # Make sure _GNU_SOURCE is defined where necessary: as early as possible # for configure-time tests, as well as for every source file that includes # config.h. # From Jim Meyering. AC_DEFUN([AC__GNU_SOURCE], [ # Make sure that _GNU_SOURCE is defined for all subsequent # configure-time compile tests. # This definition must be emitted (into confdefs.h) before any # test that involves compilation. cat >>confdefs.h <<\EOF #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif EOF # Emit this code into config.h.in. # The ifndef is to avoid redefinition warnings. AH_VERBATIM([_GNU_SOURCE], [#ifndef _GNU_SOURCE # define _GNU_SOURCE #endif]) ]) heroes-0.21/m4/gprof.m40000644004117000411500000000031307223571315010301 AC_DEFUN([adl_ENABLE_GPROF], [AC_ARG_ENABLE([gprof], [AC_HELP_STRING([--enable-gprof],[enable gprof profiling])]) if test "${enable_gprof}" = "yes" -a -n "$GCC"; then CFLAGS="$CFLAGS -pg" fi]) heroes-0.21/m4/h-allegro.m40000644004117000411500000000265207405746454011060 AC_DEFUN([heroes_CHECK_ALLEGRO], [## Allegro support is hidden until it is better supported. ##AC_ARG_WITH([allegro], ## [AC_HELP_STRING([--with-allegro=DIR],[root directory of Allegro installation]) ##AC_HELP_STRING([--without-allegro],[disables Allegro usage completely])]) test "${with_allegro_exec_prefix-no}" != no && test "${with_allegro-yes}" = yes && with_allegro="$with_allegro_exec_prefix" test "${with_allegro-yes}" != yes && test "${with_allegro_exec_prefix-yes}" = yes && with_allegro_exec_prefix="$with_allegro" if test "${with_allegro-yes}" != no; then if test "${with_allegro-no}" != no; then user_selection_list_vkm="$user_selection_list_vkm allvkm" fi dnl I'd like to check that `install_allegro()' is present. dnl Unfortunally, Allegro is playing tricky game with the main() dnl definition, and the testing program compiled by configure to dnl check for `install_allegro()' is not aware of that. AC_adl_PKG_GENERIC(allegro, [3.9.33], [], [], [with_allegro=no]) fi ## Also change -no to -yes. See above. if test "${with_allegro-no}" != no; then AC_adl_FIND_HEADER([allegro.h],[$ALLEGRO_CFLAGS], [/usr/include/allegro.h] dnl [/usr/local/include/allegro.h], [#[ ]*define[ ][ ]*KEY_*],7,, [AC_MSG_ERROR([Keysyms definitions not found: where is Allegro installed?])]) ALLEGRO_H="$ac_cv_header_path_allegro_h" AC_SUBST([ALLEGRO_H]) $1 ifelse([$2],,,[else $2]) fi ]) heroes-0.21/m4/h-debug.m40000644004117000411500000000037707223601166010507 AC_DEFUN([heroes_DEBUG], [AC_ARG_ENABLE([heroes-debug], [AC_HELP_STRING([--disable-heroes-debug],[disable tracing facility])]) if test "x$enable_heroes_debug" != xno; then AC_DEFINE([USE_HEROES_DEBUG],1,[Define if you want tracing code.]) fi]) heroes-0.21/m4/h-display.m40000644004117000411500000000121707352356121011061 AC_DEFUN([heroes_CHECK_DISPLAY_LIB], [ heroes_CHECK_GGI([adl_LIBALT_OK([ggivkm], [LibGGI], [$GGI_LDFLAGS], [$GGI_LIBS])]) heroes_CHECK_SDL([adl_LIBALT_OK([sdlvkm], [SDL dnl $sdl_config_major_version.dnl $sdl_config_minor_version.dnl $sdl_config_micro_version], [], [$SDL_LIBS])], [# Set to `no' so that we don't check for joystick or sound support with_sdl=no]) heroes_CHECK_ALLEGRO([adl_LIBALT_OK([allvkm], [Allegro dnl $allegro_config_major_version.dnl $allegro_config_minor_version.dnl $allegro_config_micro_version], [], [$ALLEGRO_LIBS])], [# Set to `no' so that we don't check for joystick support with_allegro=no]) ]) heroes-0.21/m4/h-ggi.m40000644004117000411500000000124207340731162010157 AC_DEFUN([heroes_CHECK_GGI], [if test "${with_ggi-yes}" != no; then if test "${with_ggi-no}" != no; then user_selection_list_vkm="$user_selection_list_vkm ggivkm" fi AC_caolan_CHECK_PACKAGE([GGI],[ggiOpen],[ggi],[ggi/ggi.h],,[with_ggi=no]) fi if test "${with_ggi-yes}" != no; then AC_adl_FIND_HEADER([ggi/keyboard.h],, [/usr/include/ggi/keyboard.h] dnl [${ggi_include-/usr/local/include}/ggi/keyboard.h], [#[ ]*define[ ][ ]*GIIUC*],7,, [AC_MSG_ERROR([Keysyms macros not found: where is GGI installed?])]) GGI_KEYBOARD_H="$ac_cv_header_path_ggi_keyboard_h" AC_SUBST([GGI_KEYBOARD_H]) $1 ifelse([$2],,,[else $2]) fi ]) heroes-0.21/m4/h-joystick.m40000644004117000411500000000256707405224034011260 AC_DEFUN([heroes_CHECK_JOYSTICK_LIB], [AC_ARG_ENABLE([joystick], [AC_HELP_STRING([--disable-joystick], [turn off joystick support])]) if test "${enable_joystick-yes}" = yes; then # -- check for Joystick support in SDL if test "${with_sdl-yes}" != no; then if test "${with_sdl-no}" != no; then user_selection_list_j="$user_selection_list_j sdlj" fi OLIBS="$LIBS" LIBS="$LIBS $SDL_LIBS" AC_CHECK_FUNCS([SDL_JoystickOpen], [ adl_LIBALT_OK([sdlj], [SDL dnl $sdl_config_major_version.dnl $sdl_config_minor_version.dnl $sdl_config_micro_version], [], [], [sdlvkm])]) LIBS="$OLIBS" fi # -- Joystick support in Allegro is OK. if test "${with_allegro-yes}" != no; then if test "${with_allegro-no}" != no; then user_selection_list_j="$user_selection_list_j allj" fi adl_LIBALT_OK([allj], [Allegro dnl $allegro_config_major_version.dnl $allegro_config_minor_version.dnl $allegro_config_micro_version], [], [], [allvkm]) fi # -- check for LibGII (another way to get joystick support) if test "${with_gii-yes}" != no; then if test "${with_gii-no}" != no; then user_selection_list_j="$user_selection_list_j giij" fi AC_caolan_CHECK_PACKAGE([GII], [giiOpen], [gii], [ggi/gii.h], [adl_LIBALT_OK([giij], [LibGII], [$GII_LDFLAGS], [$GII_LIBS])]) fi else user_selection_list_j="dumj $user_selection_list_j" fi ]) heroes-0.21/m4/h-media.m40000644004117000411500000000553407405224034010475 AC_DEFUN([heroes_MEDIALIB_SELECTION], [ user_selection_list_vkm='' user_selection_list_s='' user_selection_list_j='' heroes_CHECK_DISPLAY_LIB heroes_CHECK_JOYSTICK_LIB heroes_CHECK_SOUND_LIB # These libraries do not need any checking. adl_LIBALT_OK([dums], [none], [], []) adl_LIBALT_OK([dumj], [none], [], []) adl_LIBALT_OK([stdm], [standard main], [], []) # There is a trick here. Usually our static library are added # to LIBALT_LOCAL_LDADD which is listed before LIBALT_LDADD (the system # libraries) on the link line. However, SDL_main and Allegro are special: # they refer to OUR code (practically they call our main, which has been # renamed to SDL_main() or _mangled_main()). So in addition to adding # sys/libhallm.a to LIBALT_LOCAL_LDADD (done automatically by adl_LIBALT_OK), # we will also list it in LIBALT_LDADD (requested below). The 'APPEND' means # the libraries should be appended instead of being prepended, since we # want them to be listed after -lSDL_main or -lallegro. adl_LIBALT_OK([sdlm], [SDL_main], [], [sys/libhsdlm.a], [sdlvkm], [APPEND]) adl_LIBALT_OK([allm], [Allegro mangled main], [], [sys/libhallm.a], [allvkm], [APPEND]) # Heroes can run without display, but usually this is not what # the user wants :), so this "feature" is enabled only if # --disable-display is supplied. AC_ARG_ENABLE([display], [AC_HELP_STRING([--disable-display], [don't draw anything on screen])]) if test "${enable_display-yes}" = no; then user_selection_list_vkm="dumvkm $user_selection_list_vkm" adl_LIBALT_OK([dumvkm], [none], [], []) fi # If the user has no preference, we'll use our own preference list. if test -z "$user_selection_list_vkm"; then selection_list_vkm="ggivkm sdlvkm allvkm dumvkm" else selection_list_vkm="$user_selection_list_vkm dumvkm" fi if test -z "$user_selection_list_s"; then # Keep sdls first. It won't be used if sdlvkm is not selected, # but otherwise it should be prefered over miks. selection_list_s="sdls miks dums" else selection_list_s="$user_selection_list_s dums" fi if test -z "$user_selection_list_j"; then # Keep sdlj first. It won't be used if sdlvkm is not selected, # but otherwise it should be prefered over giij. # Keep allj second for the same reason. selection_list_j="sdlj allj giij dumj" else selection_list_j="$user_selection_list_j dumj" fi adl_LIBALT_EITHER([$selection_list_vkm], [video-keyboard-mouse library], [selection_vkm], [media/libh]) adl_LIBALT_EITHER([$selection_list_s], [sound library], [selection_s], [media/libh]) adl_LIBALT_EITHER([$selection_list_j], [joystick library], [selection_j], [media/libh]) adl_LIBALT_EITHER([sdlm allm stdm], [startup library], [selection_m], [sys/libh]) ]) heroes-0.21/m4/h-mikmod.m40000644004117000411500000000233107430322302010661 AC_DEFUN([heroes_CHECK_MIKMOD], [AC_ARG_WITH([mikmod], [AC_HELP_STRING([--with-mikmod=DIR], [root directory of LibMikMod installation]) AC_HELP_STRING([--without-mikmod], [disables LibMikMod usage completely])]) # --with-mikmod-exec-prefix should imply --with-mikmod, and vice-versa test "${with_mikmod_exec_prefix-no}" != no && test "${with_mikmod-yes}" = yes && with_mikmod="$with_mikmod_exec_prefix" test "${with_mikmod-yes}" != yes && test "${with_mikmod_exec_prefix-yes}" = yes && with_mikmod_exec_prefix="$with_mikmod" if test "${with_mikmod-yes}" != no; then if test "${with_mikmod-no}" != no; then user_selection_list_s="$user_selection_list_s miks" fi AC_adl_PKG_GENERIC([LibMikMod], [3.1.7], [MikMod_Init], [], [with_mikmod=no]) # Since LibMikMod 3.1.10, libmikmod-config has moved some of # the libraries listed by --libs to the output of the --ldadd # option. So we append them to LIBMIKMOD_LIBS here. if test "${with_mikmod-yes}" != no; then LIBMIKMOD_LIBS="$LIBMIKMOD_LIBS `$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd`" fi fi if test "${with_mikmod-yes}" != no; then ifelse([$1],,[:],[$1]) ifelse([$2],,,[else $2]) fi]) heroes-0.21/m4/h-obsolete.m40000644004117000411500000000127507332464427011243 AC_DEFUN([heroes_aux_OBSOPT], [if test -n "$MY_TR_SH($1)"; then AC_MSG_ERROR([--$1 is an obsolete option[]ifelse([$2],,,[, you should use --$2 instead])]) fi]) AC_DEFUN([heroes_aux_ERROPT], [if test -n "$MY_TR_SH($1)"; then AC_MSG_ERROR([--$1 is an illegal option[]ifelse([$2],,,[, you probably want to use --$2])]) fi]) AC_DEFUN([heroes_CHECK_OBSOLETE_OPTIONS], [# check for opsolete or erroneous options heroes_aux_ERROPT([with-SDL],[with-sdl]) dnl It's not possible to test for the next one: dnl because both sides maps to the same shell variable :o( dnl heroes_aux_OBSOPT([with-sdl_mixer],[with-sdl-mixer]) heroes_aux_OBSOPT([with-GGI],[with-ggi]) heroes_aux_OBSOPT([with-GII],[with-gii]) ]) heroes-0.21/m4/h-paths.m40000644004117000411500000000476407302133766010550 AC_DEFUN([heroes_COMPUTE_PATHS], [AC_REQUIRE([AM_WITH_NLS])dnl ## With gettext <= 0.10.35, localedir used to be defined as ## localedir='${prefix}'"/$DATADIRNAME/locale" ## DATADIRNAME being set to share (or lib) by AM_GNU_GETTEXT. So this ## path had nothing to do with datadir and when Heroes was configured ## with --prefix=/usr --bindir=/usr/games --datadir=/usr/share/games as ## the FHS requests for games, locale data would go into ## /usr/share/locale. ## ## In gettext >= 0.10.36, localedir is defined as ## localedir='${datadir}'/locale ## Thus with the same configuration locales will go into ## /usr/share/games/locale. ## ## The FHS is fuzzy enough to let both setups be seen as correct. ## ## Another important point is that there is no way to change the ## locales installation path. `make localedir=/somewhere/else install' ## will NOT work because we need to know the real $localedir path at ## configure time (this macro compute a relative path between $prefix ## and $localedir). ## ## Ideally there should be a --localedir option to configure to set ## this path. Both Akim Demaille (Autoconf) and Bruno Haible (Gettext) ## are aware of this problem. Gettext needs Autoconf support before ## changing its macros and Makefiles, but Autoconf 2.50 is about to be ## released and won't include that change. So this is unlikely to be ## solved anytime soon. Since such change will probably involve an ## update of the GNU Standards, Bruno said he will contact RMS. ## ## By the meantime, if people do need to be able to change the localedir ## path it should be possible to add a option such as ## --enable-localedir=DIR or --with-localedir=DIR. This requires ## going through the trouble of patching gettext's m4 macro and Makefiles. localedir='${datadir}'/locale pkgdatadir="$datadir/heroes" adl_COMPUTE_RELATIVE_PATHS([dnl bindir:prefix:backward_relative_bindir dnl prefix:pkgdatadir:forward_relative_pkgdatadir dnl prefix:localedir:forward_relative_localedir dnl ]) AC_DEFINE_UNQUOTED([BACKWARD_RELATIVE_BINDIR], ["$backward_relative_bindir"], [Relative path from BINDIR to PREFIX.]) AC_DEFINE_UNQUOTED([FORWARD_RELATIVE_PKGDATADIR], ["$forward_relative_pkgdatadir"], [Relative path from PREFIX to PKGDATADIR.]) AC_DEFINE_UNQUOTED([FORWARD_RELATIVE_LOCALEDIR], ["$forward_relative_localedir"], [Relative path from PREFIX to LOCALEDIR.]) AC_DEFINE_DIR([PREFIX],[prefix],[Installation prefix path.]) ]) heroes-0.21/m4/h-sdl.m40000644004117000411500000000217107352356121010176 AC_DEFUN([heroes_CHECK_SDL], [AC_ARG_WITH([sdl], [AC_HELP_STRING([--with-sdl=DIR],[root directory of SDL installation]) AC_HELP_STRING([--without-sdl],[disables SDL usage completely])]) # --with-sdl-exec-prefix should imply --with-sdl, and vice-versa test "${with_sdl_exec_prefix-no}" != no && test "${with_sdl-yes}" = yes && with_sdl="$with_sdl_exec_prefix" test "${with_sdl-yes}" != yes && test "${with_sdl_exec_prefix-yes}" = yes && with_sdl_exec_prefix="$with_sdl" if test "${with_sdl-yes}" != no; then if test "${with_sdl-no}" != no; then user_selection_list_vkm="$user_selection_list_vkm sdlvkm" fi AC_adl_PKG_GENERIC(sdl,[1.0.1],[SDL_Init], [AC_CHECK_FUNCS([SDL_EnableKeyRepeat])], [with_sdl=no]) fi if test "${with_sdl-yes}" != no; then AC_adl_FIND_HEADER([SDL_keysym.h],[$SDL_CFLAGS], [/usr/include/SDL/SDL_keysym.h] dnl [/usr/local/include/SDL/SDL_keysym.h], [#[ ]*define[ ][ ]*SDLK_*],7,, [AC_MSG_ERROR([Keysyms definitions not found: where is SDL installed?])]) SDL_KEYSYM_H="$ac_cv_header_path_SDL_keysym_h" AC_SUBST([SDL_KEYSYM_H]) $1 ifelse([$2],,,[else $2]) fi ]) heroes-0.21/m4/h-sdlmixer.m40000644004117000411500000000172107357261774011261 AC_DEFUN([heroes_CHECK_SDL_MIXER], [# don't even try to check for SDL_mixer if SDL is not installed if test "${with_sdl-yes}" = no; then with_sdl_mixer=no fi # with_sdl if test "${with_sdl_mixer-yes}" != no; then if test "${with_sdl_mixer-no}" != no; then user_selection_list_s="$user_selection_list_s sdls" fi # temporaly put the CFLAGS for SDL in CPPFLAGS # so that AC_caolan_CHECK_PACKAGE can find SDL_mixer.h in the same directory. tmp_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$SDL_CFLAGS $CPPFLAGS" tmp_LIBS="$CPPLIBS" LIBS="$SDL_LIBS $LIBS" AC_caolan_CHECK_PACKAGE([SDL_mixer], [Mix_OpenAudio], [SDL_mixer], [SDL_mixer.h], [AC_DEFINE([HAVE_LIBSDL_MIXER], 1, [Define if you have the SDL_mixer library installed.])], [with_sdl_mixer=no]) # revert old value CPPFLAGS="$tmp_CPPFLAGS" LIBS="$tmp_LIBS" fi # with_sdl_mixer if test "x${with_sdl_mixer}" != xno; then with_sdl_mixer=yes $1 ifelse([$2],,,[else $2]) fi # with_sdl_mixer ]) heroes-0.21/m4/h-sound.m40000644004117000411500000000120707340731162010542 AC_DEFUN([heroes_CHECK_SOUND_LIB], [AC_ARG_ENABLE([sound], [AC_HELP_STRING([--disable-sound],[turn off sound support])]) if test "${enable_sound-yes}" != no; then if test "${enable_sound-no}" != no; then user_selection_list_s="dums $user_selection_list_s" fi heroes_CHECK_SDL_MIXER([adl_LIBALT_OK([sdls], [SDL_mixer], [$SDL_MIXER_LDFLAGS], [$SDL_MIXER_LIBS], [sdlvkm])]) heroes_CHECK_MIKMOD([adl_LIBALT_OK([miks], [LibMikMod dnl $libmikmod_config_major_version.dnl $libmikmod_config_minor_version.dnl $libmikmod_config_micro_version], [], [$LIBMIKMOD_LIBS])]) fi]) heroes-0.21/m4/htmldoc.m40000644004117000411500000000173207223572116010624 dnl Handle the --enable-html-doc option. dnl dnl The following snippet goes into doc/Makefile.am dnl ------------------------ dnl CLEANFILES = yourfile.html dnl dnl if MAKE_HTML dnl hdir = @htmldir@ dnl h_DATA = yourfile.html dnl endif dnl dnl SUFFIXES = .html dnl dnl .texi.html: dnl @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] dnl cd $(srcdir) && $(MAKEINFO) --html `echo $< | sed 's,.*/,,'` dnl ------------------------ dnl dnl Written by Alexandre Duret-Lutz AC_DEFUN([adl_ENABLE_HTML_DOC], [AC_ARG_ENABLE([html-doc], [AC_HELP_STRING([--enable-html-doc=DIR], [build and install html documentation])]) if test "${enable_html_doc-no}" != no; then if test "x$enable_html_doc" = xyes; then htmldir="$data_dir/doc" else htmldir="$enable_html_doc" fi AC_SUBST([htmldir]) else htmldir='\' fi AM_CONDITIONAL(MAKE_HTML, [test "${enable_html_doc-no}" != no])]) heroes-0.21/m4/iconv.m40000644004117000411500000000436207313135745010315 #serial AM2 dnl From Bruno Haible. AC_DEFUN([AM_ICONV], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_ARG_WITH([libiconv-prefix], [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi done ]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi LIBICONV= if test "$am_cv_lib_iconv" = yes; then LIBICONV="-liconv" fi AC_SUBST(LIBICONV) ]) heroes-0.21/m4/isc-posix.m40000644004117000411500000000113407272215305011102 #serial 1 # This test replaces the one in autoconf. # Currently this macro should have the same name as the autoconf macro # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ] ) heroes-0.21/m4/lcmessage.m40000644004117000411500000000205207353601452011131 # Check whether LC_MESSAGES is available in . # Ulrich Drepper , 1995. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License or the GNU Library General Public License but which still want # to provide support for the GNU gettext functionality. # Please note that the actual code of the GNU gettext library is covered # by the GNU Library General Public License, and the rest of the GNU # gettext package package is covered by the GNU General Public License. # They are *not* in the public domain. # serial 2 AC_DEFUN([AM_LC_MESSAGES], [if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) heroes-0.21/m4/libalt.m40000644004117000411500000000422107417110563010434 # adl_LIBALT_OK (HANDLE, NAME, LDFLAGS, LDADD, [DEPENDENCIES], [OPTION]) # ---------------------------------------------------------------------- AC_DEFUN([adl_LIBALT_OK], [ adl_libalt_$1_ok=yes adl_libalt_$1_name="$2" adl_libalt_$1_LDFLAGS="$3" adl_libalt_$1_LDADD="$4" adl_libalt_$1_selected=no adl_libalt_$1_depend_on="$5" adl_libalt_$1_opt="$6" ]) # adl_LIBALT_EITHER (HANDLES, DOC, VAR, LDADD_PREFIX) # --------------------------------------------------- AC_DEFUN([adl_LIBALT_EITHER], [ $3=NONE for i in $1; do if eval test "x\$adl_libalt_${i}_ok" = xyes ; then # make sure all dependencies for this module have already been selected. eval adl_libalt_tmp_dep="\$adl_libalt_${i}_depend_on" adl_libalt_tmp_ok=yes for j in $adl_libalt_tmp_dep : ; do if test $j = : ; then break fi if eval test "x\$adl_libalt_${j}_selected" != xyes ; then adl_libalt_tmp_ok=no break fi done if test "$adl_libalt_tmp_ok" = yes ; then eval adl_libalt_tmp_opt=\"\$adl_libalt_${i}_opt\" # The default is to prepend. if test x"$adl_libalt_tmp_opt" = xAPPEND; then eval LIBALT_LDFLAGS=\"\$LIBALT_LDFLAGS \$adl_libalt_${i}_LDFLAGS\" eval LIBALT_LDADD=\"\$LIBALT_LDADD \$adl_libalt_${i}_LDADD\" ifelse([$4],,, [LIBALT_LOCAL_LDADD="$LIBALT_LOCAL_LDADD $4$i.a"]) else eval LIBALT_LDFLAGS=\"\$adl_libalt_${i}_LDFLAGS \$LIBALT_LDFLAGS\" eval LIBALT_LDADD=\"\$adl_libalt_${i}_LDADD \$LIBALT_LDADD\" ifelse([$4],,, [LIBALT_LOCAL_LDADD="$4$i.a $LIBALT_LOCAL_LDADD"]) fi eval "adl_libalt_${i}_selected=yes" $3=$i break fi fi done if test "x$$3" = xNONE ; then AC_MSG_ERROR([No $2 found. The supported libraries are listed in README.]) else eval adl_tmp_libalt_name='$adl_libalt_'"$$3"'_name' AC_MSG_NOTICE([Selected $2: $adl_tmp_libalt_name]) fi # Use _XLDLAGS, _XLDADS, etc. because Automake reserves _LDFLAGS, etc. AC_SUBST([LIBALT_XLDFLAGS], [$LIBALT_LDFLAGS]) AC_SUBST([LIBALT_XLDADD], [$LIBALT_LDADD]) AC_SUBST([LIBALT_LOCAL_XLDADD], [$LIBALT_LOCAL_LDADD]) ]) heroes-0.21/m4/malloc.m40000644004117000411500000000166607353601452010447 #serial 5 dnl From Jim Meyering. dnl Determine whether malloc accepts 0 as its argument. dnl If it doesn't, arrange to use the replacement function. dnl AC_DEFUN([jm_FUNC_MALLOC], [ dnl xmalloc.c requires that this symbol be defined so it doesn't dnl mistakenly use a broken malloc -- as it might if this test were omitted. AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1, [Define if the malloc check has been performed. ]) AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc, [AC_TRY_RUN([ char *malloc (); int main () { exit (malloc (0) ? 0 : 1); } ], jm_cv_func_working_malloc=yes, jm_cv_func_working_malloc=no, dnl When crosscompiling, assume malloc is broken. jm_cv_func_working_malloc=no) ]) if test $jm_cv_func_working_malloc = no; then AC_LIBOBJ(malloc) AC_DEFINE(malloc, rpl_malloc, [Define to rpl_malloc if the replacement function should be used.]) fi ]) heroes-0.21/m4/memdebug.m40000644004117000411500000001730207232534454010762 dnl Some macros to configure with malloc() debugging libraries. dnl dnl Main functions: dnl adl_WITH_MTRACE handle the --with-mtrace option dnl adl_WITH_DMALLOC handle the --with-dmalloc option dnl adl_WITH_EFENCE handle the --with-efence option dnl adl_WITH_MPATROL handle the --with-mpatrol option dnl adl_ENABLE_MEM_DEBUG handle the --enable-mem-debug option dnl (i.e. use mpatrol, mtrace, dmalloc dnl or efence, whatever the first found is) dnl dnl Auxiliary functions: dnl adl_CHECK_MTRACE actually check for mtrace availability dnl adl_CHECK_DMALLOC actually check for dmalloc availability dnl adl_CHECK_EFENCE actually check for efence availability dnl adl_CHECK_MPATROL actually check for mpatrol availability dnl adl_CHECK_MEMORY_USAGE actually check gcc -fcheck-memory-usage dnl (can be used with mpatrol, currently dnl not called) dnl adl_CHECK_MPATROL_LIBS actually check for libraries needed by dnl mpatrol. dnl dnl Written by Alexandre Duret-Lutz AC_PREREQ([2.49]) dnl for AC_HELP_STRING dnl adl_CHECK_MTRACE([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for mtrace (GNU libc malloc debugging functions). dnl dnl This will define HAVE_MTRACE if mcheck.h and mtrace() exists. dnl dnl Use this macro in conjunction with the following code. dnl #if HAVE_MTRACE dnl # include dnl #else dnl # define mtrace() dnl # define muntrace() dnl #endif dnl and put the call to mtrace and muntrace where appropriate. AC_DEFUN([adl_CHECK_MTRACE], [test_failed='no' # should we check for mtrace? if test "$with_mtrace" = no; then test_failed='yes' else AC_CHECK_HEADER([mcheck.h], [AC_CHECK_FUNCS([mtrace],[$1],[test_failed=yes])], [test_failed=yes]) ifelse([$2],, [if test $test_failed = 'yes'; then AC_MSG_ERROR([Cannot find mtrace]) fi]) fi ifelse([$2],,, [if test "$test_failed" = yes; then $2 fi])]) dnl adl_WITH_MTRACE ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for dmalloc on user request. AC_DEFUN([adl_WITH_MTRACE], [AC_ARG_WITH([mtrace], [AC_HELP_STRING([--with-mtrace], [use GNU libc's mtrace for malloc () debugging])]) if test "$with_mtrace" = yes; then adl_CHECK_MTRACE fi]) dnl adl_CHECK_DMALLOC ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for dmalloc. dnl dnl This macro defines HAVE_DMALLOC_H when the dmalloc.h header is found. dnl dmalloc.h is not mandatory to use dmalloc, but it is better to dnl include it when available. Here is how: dnl dnl /* keep this header at the end of the include list, because it may dnl define some macros to change the declaration of malloc functions */ dnl #if HAVE_DMALLOC_H dnl # define DMALLOC_FUNC_CHECK dnl # include dnl #endif AC_DEFUN([adl_CHECK_DMALLOC], [test_failed='no' # should we check for dmalloc? if test "${with_dmalloc}" = no; then test_failed='yes' else # see if dmalloc is usable AC_CHECK_LIB([dmalloc],[malloc], [$1 LIBS="-ldmalloc $LIBS" AC_CHECK_HEADERS([dmalloc.h])], [ifelse([$2],,[AC_MSG_ERROR([Cannot find dmalloc])],[test_failed='yes'])]) fi ifelse([$2],,, [if test "$test_failed" = yes; then $2 fi])]) dnl adl_WITH_DMALLOC ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for dmalloc on user request. AC_DEFUN([adl_WITH_DMALLOC], [AC_ARG_WITH([dmalloc], [AC_HELP_STRING([--with-dmalloc], [link with dmalloc (a malloc() debugger)])]) if test "$with_dmalloc" = yes; then adl_CHECK_DMALLOC fi]) dnl adl_CHECK_EFENCE ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for efence. AC_DEFUN([adl_CHECK_EFENCE], [test_failed='no' # should we check for efence? if test "${with_efence}" = no; then test_failed='yes' else # see if efence is usable AC_CHECK_LIB([efence],[malloc], [$1 LIBS="-lefence $LIBS"], [ifelse([$2],,[AC_MSG_ERROR([Cannot find Electric Fence])], [test_failed='yes'])]) fi ifelse([$2],,, [if test "$test_failed" = yes; then $2 fi])]) dnl adl_WITH_EFENCE ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for efence on user request. AC_DEFUN([adl_WITH_EFENCE], [AC_ARG_WITH([efence], [AC_HELP_STRING([--with-efence], [link with efence (a malloc() debugger)])]) if test "$with_efence" = yes; then adl_CHECK_EFENCE fi]) dnl adl_CHECK_MEMORY_USAGE dnl Check wheter $CC supports the -fcheck-memory-usage option. AC_DEFUN([adl_CHECK_MEMORY_USAGE], [if test -n "$GCC"; then AC_CACHE_CHECK([wether $CC supports -fcheck-memory-usage], [ac_cv_check_memory_usage], [changequote(,)dnl cat > conftest.$ac_ext < dnl #endif AC_DEFUN([adl_CHECK_MPATROL], [test_failed='no' # should we check for mpatrol? if test "${with_mpatrol}" = no; then test_failed='yes' else # see if mpatrol is usable adl_CHECK_MPATROL_LIBS([$1 dnl CHECK_MEMORY_USAGE is disabled, because it causes much troubles dnl with asm statements in system headers. dnl adl_CHECK_MEMORY_USAGE AC_CHECK_HEADERS([mpatrol.h])], [ifelse([$2],,[AC_MSG_ERROR([Cannot find mpatrol])],[test_failed='yes'])]) fi ifelse([$2],,, [if test "$test_failed" = yes; then $2 fi])]) dnl adl_WITH_MPATROL ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for mpatrol on user request. AC_DEFUN([adl_WITH_MPATROL], [AC_ARG_WITH([mpatrol], [AC_HELP_STRING([--with-patrol], [link with mpatrol (a malloc() debugger)])]) if test "$with_mpatrol" = yes; then adl_CHECK_MPATROL fi]) dnl adl_ENABLE_MEM_DEBUG dnl Check for dmalloc or efence on request, use the first library found. AC_DEFUN([adl_ENABLE_MEM_DEBUG], [# don't test anything if --with-dmalloc or --with-efence # was given (assume that adl_WITH_DMALLOC or adl_WITH_EFENCE # has already run). if test "${with_mpatrol-no}" = no && test "${with_mtrace-no}" = no && test "${with_dmalloc-no}" = no && test "${with_efence-no}" = no; then AC_ARG_ENABLE([mem-debug], [AC_HELP_STRING([--enable-mem-debug], [link with any malloc() debugger available])]) if test "$enable_mem_debug" = yes; then adl_CHECK_MPATROL(,[dnl adl_CHECK_MTRACE(,[dnl adl_CHECK_DMALLOC(,[dnl adl_CHECK_EFENCE])])]) fi fi]) heroes-0.21/m4/mkdir.m40000644004117000411500000000363307247230714010303 dnl @synopsis AC_FUNC_MKDIR dnl dnl Check whether mkdir() is mkdir or _mkdir, and whether it takes one or two dnl arguments. dnl dnl This macro can define HAVE_MKDIR, HAVE__MKDIR, and MKDIR_TAKES_ONE_ARG, dnl which are expected to be used as follow: dnl dnl #if HAVE_MKDIR dnl # if MKDIR_TAKES_ONE_ARG dnl /* Mingw32 */ dnl # define mkdir(a,b) mkdir(a) dnl # endif dnl #else dnl # if HAVE__MKDIR dnl /* plain Win32 */ dnl # define mkdir(a,b) _mkdir(a) dnl # else dnl # error "Don't know how to create a directory on this system." dnl # endif dnl #endif dnl dnl @version $Id$ dnl @author Written by Alexandre Duret-Lutz . AC_DEFUN([AC_FUNC_MKDIR], [AC_CHECK_FUNCS([mkdir _mkdir]) AC_CACHE_CHECK([whether mkdir takes one argument], [ac_cv_mkdir_takes_one_arg], [AC_TRY_COMPILE([ #include #if HAVE_UNISTD_H # include #endif ],[mkdir (".");], [ac_cv_mkdir_takes_one_arg=yes],[ac_cv_mkdir_takes_one_arg=no])]) if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then AC_DEFINE([MKDIR_TAKES_ONE_ARG],1, [Define if mkdir takes only one argument.]) fi ]) dnl Note: dnl ===== dnl I have not implemented the following suggestion because I don't have dnl access to such a broken environment to test the macro. So I'm just dnl appending the comments here in case you have, and want to fix dnl AC_FUNC_MKDIR that way. dnl dnl |Thomas E. Dickey (dickey@herndon4.his.com) said: dnl | it doesn't cover the problem areas (compilers that mistreat mkdir dnl | may prototype it in dir.h and dirent.h, for instance). dnl | dnl |Alexandre: dnl | Would it be sufficient to check for these headers and #include dnl | them in the AC_TRY_COMPILE block? (and is AC_HEADER_DIRENT dnl | suitable for this?) dnl | dnl |Thomas: dnl | I think that might be a good starting point (with the set of recommended dnl | ifdef's and includes for AC_HEADER_DIRENT, of course). heroes-0.21/m4/ndebug.m40000644004117000411500000000027207223571315010434 AC_DEFUN([adl_NDEBUG], [AC_ARG_ENABLE([assert], [AC_HELP_STRING([--enable-assert],[turn on assertions])]) if test "$enable_assert" != yes; then CFLAGS="$CFLAGS -DNDEBUG" fi]) heroes-0.21/m4/normpath.m40000644004117000411500000000601307302766540011023 dnl @synopsis adl_NORMALIZE_PATH(VARNAME, [REFERENCE_STRING]) dnl dnl Perform some cleanups on the value of $VARNAME (interpreted as a path): dnl - empty paths are changed to '.' dnl - trailing slashes are removed dnl - repeated slashes are squeezed except a leading doubled slash '//' dnl (which might indicate a networked disk on some OS). dnl dnl REFERENCE_STRING is used to turn '/' into '\' and vice-versa: dnl if REFERENCE_STRING contains some backslashes, all slashes and backslashes dnl are turned into backslashes, otherwise they are all turned into slashes. dnl dnl This makes processing of DOS filenames quite easier, because you dnl can turn a filename to the Unix notation, make your processing, and dnl turn it back to original notation. dnl dnl filename='A:\FOO\\BAR\' dnl old_filename="$filename" dnl # Switch to the unix notation dnl adl_NORMALIZE_PATH([filename], ["/"]) dnl # now we have $filename = 'A:/FOO/BAR' and we can process it as if dnl # it was a Unix path. For instance let's say that you want dnl # to append '/subpath': dnl filename="$filename/subpath" dnl # finally switch back to the original notation dnl adl_NORMALIZE_PATH([filename], ["$old_filename"]) dnl # now $filename equals to 'A:\FOO\BAR\subpath' dnl dnl One good reason to make all path processing with the unix convention dnl is that backslashes have a special meaning in many cases. For instance dnl dnl expr 'A:\FOO' : 'A:\Foo' dnl dnl will return 0 because the second argument is a regex in which dnl backslashes have to be backslashed. In other words, to have the dnl two strings to match you should write this instead: dnl dnl expr 'A:\Foo' : 'A:\\Foo' dnl dnl Such behavior makes DOS filenames extremely unpleasant to work with. dnl So temporary turn your paths to the Unix notation, and revert dnl them to the original notation after the processing. See the dnl macro adl_COMPUTE_RELATIVE_PATHS for a concrete example of this. dnl dnl REFERENCE_STRING defaults to $VARIABLE, this means that slashes dnl will be converted to backslashes if $VARIABLE already contains dnl some backslashes (see $thirddir below). dnl dnl firstdir='/usr/local//share' dnl seconddir='C:\Program Files\\' dnl thirddir='C:\home/usr/' dnl adl_NORMALIZE_PATH([firstdir]) dnl adl_NORMALIZE_PATH([seconddir]) dnl adl_NORMALIZE_PATH([thirddir]) dnl # $firstdir = '/usr/local/share' dnl # $seconddir = 'C:\Program Files' dnl # $thirddir = 'C:\home\usr' dnl dnl @author Alexandre Duret-Lutz dnl @version $Id: $ AC_DEFUN([adl_NORMALIZE_PATH], [case ":[$]$1:" in # change empty paths to '.' ::) $1='.' ;; # strip trailing slashes :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;; :*:) ;; esac # squeze repeated slashes case ifelse($2,,"[$]$1",$2) in # if the path contains any backslashes, turn slashes into backslashes *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;; # if the path contains slashes, also turn backslashes into slashes *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;; esac]) heroes-0.21/m4/pkgeneric.m40000644004117000411500000000162207357261774011154 dnl This will call AC_PATH_GENERIC but check that the library actually link. dnl (people installing library from binary packages can have libraries dnl that do NOT link when dependencies are not satisfied) dnl dnl AC_adl_PKG_GENERIC(library,version,function,action-if-ok,action-if-not) dnl dnl Inspired from AC_CAOLAN_CHECK_PACKAGE. dnl Alexandre Duret-Lutz AC_DEFUN([AC_adl_PKG_GENERIC],[ pushdef([UP], translit([$1], [a-z], [A-Z]))dnl OLD_LIBS="$LIBS" OLD_CFLAGS="$CFLAGS" jolly_good=true AC_PATH_GENERIC([$1],[$2],,[jolly_good=false]) ifelse([$3],,,[if $jolly_good; then CFLAGS="$UP[]_CFLAGS $CFLAGS" LIBS="$UP[]_LIBS $LIBS" AC_CHECK_FUNC([$3],,[jolly_good=false]) fi]) if $jolly_good; then ifelse([$4],,,[$4]) LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" else LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" ifelse([$5],,,[$5]) fi popdef([UP]) ]) heroes-0.21/m4/progtest.m40000644004117000411500000000323407353601452011040 # Search path for a program which passes the given test. # Ulrich Drepper , 1996. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License or the GNU Library General Public License but which still want # to provide support for the GNU gettext functionality. # Please note that the actual code of the GNU gettext library is covered # by the GNU Library General Public License, and the rest of the GNU # gettext package package is covered by the GNU General Public License. # They are *not* in the public domain. # serial 2 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) heroes-0.21/m4/realloc.m40000644004117000411500000000172107353601452010611 #serial 5 dnl From Jim Meyering. dnl Determine whether realloc works when both arguments are 0. dnl If it doesn't, arrange to use the replacement function. dnl AC_DEFUN([jm_FUNC_REALLOC], [ dnl xmalloc.c requires that this symbol be defined so it doesn't dnl mistakenly use a broken realloc -- as it might if this test were omitted. AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1, [Define if the realloc check has been performed. ]) AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc, [AC_TRY_RUN([ char *realloc (); int main () { exit (realloc (0, 0) ? 0 : 1); } ], jm_cv_func_working_realloc=yes, jm_cv_func_working_realloc=no, dnl When crosscompiling, assume realloc is broken. jm_cv_func_working_realloc=no) ]) if test $jm_cv_func_working_realloc = no; then AC_LIBOBJ(realloc) AC_DEFINE(realloc, rpl_realloc, [Define to rpl_realloc if the replacement function should be used.]) fi ]) heroes-0.21/m4/relpaths.m40000644004117000411500000001367407304450525011023 dnl @synopsis adl_COMPUTE_RELATIVE_PATHS(PATH_LIST) dnl dnl PATH_LIST is a space-separated list of colon-separated dnl triplets of the form 'FROM:TO:RESULT'. This function dnl iterates over these triplets and set $RESULT to the dnl relative path from $FROM to $TO. Note that $FROM dnl and $TO needs to be absolute filenames for this macro dnl to success. dnl dnl For instance, dnl dnl first=/usr/local/bin dnl second=/usr/local/share dnl adl_COMPUTE_RELATIVE_PATHS([first:second:fs second:first:sf]) dnl # $fs is set to ../share dnl # $sf is set to ../bin dnl dnl $FROM and $TO are both eval'ed recursively and normalized, dnl this means that you can call this macro with autoconf's dirnames dnl like `prefix' or `datadir'. For example: dnl dnl adl_COMPUTE_RELATIVE_PATHS([bindir:datadir:bin_to_data]) dnl dnl adl_COMPUTE_RELATIVE_PATHS should also works with DOS filenames. dnl dnl You may want to use this macro in order to make your package dnl relocatable. Instead of hardcoding $datadir into your programs dnl just encode $bin_to_data and try to determine $bindir at run-time. dnl dnl This macro requires adl_NORMALIZE_PATH. dnl dnl @author Alexandre Duret-Lutz dnl @version $Id: $ AC_DEFUN([adl_COMPUTE_RELATIVE_PATHS], [for _lcl_i in $1; do _lcl_from=\[$]`echo "[$]_lcl_i" | sed 's,:.*$,,'` _lcl_to=\[$]`echo "[$]_lcl_i" | sed 's,^[[^:]]*:,,' | sed 's,:[[^:]]*$,,'` _lcl_result_var=`echo "[$]_lcl_i" | sed 's,^.*:,,'` adl_RECURSIVE_EVAL([[$]_lcl_from], [_lcl_from]) adl_RECURSIVE_EVAL([[$]_lcl_to], [_lcl_to]) _lcl_notation="$_lcl_from$_lcl_to" adl_NORMALIZE_PATH([_lcl_from],['/']) adl_NORMALIZE_PATH([_lcl_to],['/']) adl_COMPUTE_RELATIVE_PATH([_lcl_from], [_lcl_to], [_lcl_result_tmp]) adl_NORMALIZE_PATH([_lcl_result_tmp],["[$]_lcl_notation"]) eval $_lcl_result_var='[$]_lcl_result_tmp' done]) ## Note: ## ***** ## The following helper macros are too fragile to be used out ## of adl_COMPUTE_RELATIVE_PATHS (mainly because they assume that ## paths are normalized), that's why I'm keeping them in the same file. ## Still, some of them maybe worth to reuse. dnl adl_COMPUTE_RELATIVE_PATH(FROM, TO, RESULT) dnl =========================================== dnl Compute the relative path to go from $FROM to $TO and set the value dnl of $RESULT to that value. This function work on raw filenames dnl (for instance it will consider /usr//local and /usr/local as dnl two distinct paths), you should really use adl_COMPUTE_REALTIVE_PATHS dnl instead to have the paths sanitized automatically. dnl dnl For instance: dnl first_dir=/somewhere/on/my/disk/bin dnl second_dir=/somewhere/on/another/disk/share dnl adl_COMPUTE_RELATIVE_PATH(first_dir, second_dir, first_to_second) dnl will set $first_to_second to '../../../another/disk/share'. AC_DEFUN([adl_COMPUTE_RELATIVE_PATH], [adl_COMPUTE_COMMON_PATH([$1], [$2], [_lcl_common_prefix]) adl_COMPUTE_BACK_PATH([$1], [_lcl_common_prefix], [_lcl_first_rel]) adl_COMPUTE_SUFFIX_PATH([$2], [_lcl_common_prefix], [_lcl_second_suffix]) $3="[$]_lcl_first_rel[$]_lcl_second_suffix"]) dnl adl_COMPUTE_COMMON_PATH(LEFT, RIGHT, RESULT) dnl ============================================ dnl Compute the common path to $LEFT and $RIGHT and set the result to $RESULT. dnl dnl For instance: dnl first_path=/somewhere/on/my/disk/bin dnl second_path=/somewhere/on/another/disk/share dnl adl_COMPUTE_COMMON_PATH(first_path, second_path, common_path) dnl will set $common_path to '/somewhere/on'. AC_DEFUN([adl_COMPUTE_COMMON_PATH], [$3='' _lcl_second_prefix_match='' while test "[$]_lcl_second_prefix_match" != 0; do _lcl_first_prefix=`expr "x[$]$1" : "x\([$]$3/*[[^/]]*\)"` _lcl_second_prefix_match=`expr "x[$]$2" : "x[$]_lcl_first_prefix"` if test "[$]_lcl_second_prefix_match" != 0; then if test "[$]_lcl_first_prefix" != "[$]$3"; then $3="[$]_lcl_first_prefix" else _lcl_second_prefix_match=0 fi fi done]) dnl adl_COMPUTE_SUFFIX_PATH(PATH, SUBPATH, RESULT) dnl ============================================== dnl Substrack $SUBPATH from $PATH, and set the resulting suffix dnl (or the empty string if $SUBPATH is not a subpath of $PATH) dnl to $RESULT. dnl dnl For instance: dnl first_path=/somewhere/on/my/disk/bin dnl second_path=/somewhere/on dnl adl_COMPUTE_SUFFIX_PATH(first_path, second_path, common_path) dnl will set $common_path to '/my/disk/bin'. AC_DEFUN([adl_COMPUTE_SUFFIX_PATH], [$3=`expr "x[$]$1" : "x[$]$2/*\(.*\)"`]) dnl adl_COMPUTE_BACK_PATH(PATH, SUBPATH, RESULT) dnl ============================================ dnl Compute the relative path to go from $PATH to $SUBPATH, knowing that dnl $SUBPATH is a subpath of $PATH (any other words, only repeated '../' dnl should be needed to move from $PATH to $SUBPATH) and set the value dnl of $RESULT to that value. If $SUBPATH is not a subpath of PATH, dnl set $RESULT to the empty string. dnl dnl For instance: dnl first_path=/somewhere/on/my/disk/bin dnl second_path=/somewhere/on dnl adl_COMPUTE_BACK_PATH(first_path, second_path, back_path) dnl will set $back_path to '../../../'. AC_DEFUN([adl_COMPUTE_BACK_PATH], [adl_COMPUTE_SUFFIX_PATH([$1], [$2], [_lcl_first_suffix]) $3='' _lcl_tmp='xxx' while test "[$]_lcl_tmp" != ''; do _lcl_tmp=`expr "x[$]_lcl_first_suffix" : "x[[^/]]*/*\(.*\)"` if test "[$]_lcl_first_suffix" != ''; then _lcl_first_suffix="[$]_lcl_tmp" $3="../[$]$3" fi done]) dnl adl_RECURSIVE_EVAL(VALUE, RESULT) dnl ================================= dnl Interpolate the VALUE in loop until it doesn't change, dnl and set the result to $RESULT. dnl WARNING: It's easy to get an infinite loop with some unsane input. AC_DEFUN([adl_RECURSIVE_EVAL], [_lcl_receval="$1" $2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" _lcl_receval_old='' while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do _lcl_receval_old="[$]_lcl_receval" eval _lcl_receval="\"[$]_lcl_receval\"" done echo "[$]_lcl_receval")`]) heroes-0.21/m4/runcheck.m40000644004117000411500000000134107224064730010767 dnl Compile, link, and run a dummy program. dnl This is used to ensure that further uses of AC_TRY_RUN dnl not fail (usually due to some unloadable libraries), AC_DEFUN([adl_RUN_CHECK], [AC_TRY_RUN( [main () { exit (0); }],, [AC_MSG_ERROR([=== Compiled programs no longer run whith this setup. Most usually this means one of the library checked for above is not correctly installed (for example it can depens over some other uninstalled library, or been installed in a location which is not looked at by your system). You might want to check the error messages in the file 'config.log'. If you believe this is a bug in Heroes, be sure to send the file 'config.log' with your report to . ])],[:])]) heroes-0.21/m4/stdrelpaths.m40000644004117000411500000000414207262026250011521 dnl @synopsis adl_COMPUTE_STANDARD_RELATIVE_PATHS dnl dnl Here is the standard hierarchy of paths, dnl as defined by the GNU Coding Standards: dnl dnl prefix dnl exec_prefix dnl bindir dnl libdir dnl libexecdir dnl sbindir dnl datadir dnl sysconfdir dnl sharestatedir dnl localstatedir dnl infodir dnl lispdir dnl includedir dnl oldincludedir dnl mandir dnl dnl This macro will setup a set of variables of the form dnl 'xxx_forward_relative_path' and 'xxx_backward_relative_path' dnl where xxx is one of the above directories. The latter variable dnl is set to the relative path to go from xxx to its parent dnl directory, while the former hold the other way. dnl dnl For instance `bindir_relative_path' will contains the value to dnl add to $exec_prefix to reach the $bindir directory (usually 'bin'), dnl and `bindir_backward_relative_path' the value to append to $bindir dnl to reach the $exec_prefix directory (usually '..'). dnl dnl This macro requires adl_COMPUTE_RELATIVE_PATHS which itself dnl requires adl_NORMALIZE_PATH. dnl dnl @author Alexandre Duret-Lutz dnl @version $Id: $ AC_DEFUN([adl_COMPUTE_STANDARD_RELATIVE_PATHS], ## These calls need to be on separate lines for aclocal to work! [adl_COMPUTE_RELATIVE_PATHS(dnl adl_STANDARD_RELATIVE_PATH_LIST)]) dnl adl_STANDARD_RELATIVE_PATH_LIST dnl =============================== dnl A list of standard paths, ready to supply to adl_COMPUTE_RELATIVE_PATHS. AC_DEFUN([adl_STANDARD_RELATIVE_PATH_LIST], [pushdef([TRIPLET], [$][1:$][2:$][2_forward_relative_path $]dnl [2:$][1:$][2_backward_relative_path])dnl TRIPLET(prefix, exec_prefix) dnl TRIPLET(exec_prefix, bindir) dnl TRIPLET(exec_prefix, libdir) dnl TRIPLET(exec_prefix, libexecdir) dnl TRIPLET(exec_prefix, sbindir) dnl TRIPLET(prefix, datadir) dnl TRIPLET(prefix, sysconfdir) dnl TRIPLET(prefix, sharestatedir) dnl TRIPLET(prefix, localstatedir) dnl TRIPLET(prefix, infodir) dnl TRIPLET(prefix, lispdir) dnl TRIPLET(prefix, includedir) dnl TRIPLET(prefix, oldincludedir) dnl TRIPLET(prefix, mandir) dnl popdef([TRIPLET])]) heroes-0.21/m4/strerror_r.m40000644004117000411500000000426107375270046011402 #serial 1003 # Experimental replacement for the function in the latest CVS autoconf. # Use with the error.c file in ../lib. # Copyright 2001 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. */ undefine([AC_FUNC_STRERROR_R]) # AC_FUNC_STRERROR_R # ------------------ AC_DEFUN([AC_FUNC_STRERROR_R], [AC_CHECK_DECLS([strerror_r]) AC_CHECK_FUNCS([strerror_r]) AC_CACHE_CHECK([whether strerror_r returns char *], ac_cv_func_strerror_r_char_p, [ ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[ char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); ]])], ac_cv_func_strerror_r_char_p=yes) else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT extern char *strerror_r ();], [[char buf[100]; char x = *strerror_r (0, buf, sizeof buf); exit (!isalpha (x));]])], ac_cv_func_strerror_r_char_p=yes, , :) fi ]) if test $ac_cv_func_strerror_r_char_p = yes; then AC_DEFINE([STRERROR_R_CHAR_P], 1, [Define to 1 if strerror_r returns char *.]) fi ])# AC_FUNC_STRERROR_R heroes-0.21/m4/w_dirent.m40000644004117000411500000000146107357261774011021 dnl We need opendir, readdir and closedir. This checks only for dnl readdir and assumes that opendir and closedir are present if readdir is. dnl Under plain Win32 (i.e. not Mingw or Cygwin) these functions are not dnl available, but can be emulated with lib/w_dirent.c. It's a bit odd to dnl perform that test here, since "plain Win32" users are unlikely to dnl run configure... Hence this code only documents when w_dirent.c should dnl be built. dnl dnl Written by Alexandre Duret-Lutz AC_DEFUN([adl_FUNC_READDIR], [AC_CHECK_FUNC([readdir], [AC_DEFINE([HAVE_READDIR],1,[Define if you have readdir and friends.])], [AC_CHECK_HEADER([windows.h], [# build w_dirent if readdir is absent and windows.h exists AC_LIBOBJ(w_dirent)], [AC_MSG_ERROR([Could not find `readdir'.])])])]) heroes-0.21/misc/0000777004117000411500000000000007451377034007431 5heroes-0.21/misc/copytile.c0000644004117000411500000001101107424074773011337 /* This program tests various tile_copying functions. Here are some results seen so far. Pentium 2 K6-2 Alpha UltraSparc 5.380000 2.820000 7.051600 3.260000 5.030000 2.650000 9.738528 4.690000 6.050000 3.160000 7.072096 3.260000 17.930000 untested untested untested Pentium G3 33.251687 2.490000 33.260924 2.630000 50.832590 2.620000 untested untested */ #include #include #include #include #include #define xbuf 512 #define buf 20*24*1000 typedef unsigned int a_u32; typedef unsigned char a_pixel; a_pixel s[27 * 10 * 20 * 24]; a_pixel d[20 * 24 * 1000]; static void copy_tile1 (const a_pixel* src, a_pixel* dest, int tx) { const a_u32 *s = (const a_u32 *) src; a_u32 *d = (a_u32 *) dest; a_u32 t1, t2; int y; for (y = 20; y; --y) { /* FIXME: Is this really faster than a */ t1 = s[0]; /* straight copy? Need a benchmark */ t2 = s[3]; d[0] = t1; d[3] = t2; t1 = s[1]; t2 = s[4]; d[1] = t1; d[4] = t2; t1 = s[2]; t2 = s[5]; d[2] = t1; d[5] = t2; s = (const a_u32 *) (((a_pixel *) s) + tx); d = (a_u32 *) (((a_pixel *) d) + xbuf); } } static void copy_tile2 (const a_pixel* src, a_pixel* dest, int tx) { const a_u32 *s = (const a_u32 *) src; a_u32 *d = (a_u32 *) dest; int y; for (y = 20; y; --y) { d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; d[3] = s[3]; d[4] = s[4]; d[5] = s[5]; s = (const a_u32 *) (((a_pixel *) s) + tx); d = (a_u32 *) (((a_pixel *) d) + xbuf); } } static void copy_tile3 (const a_pixel* src, a_pixel* dest, int tx) { const a_u32 *s = (const a_u32 *) src; const a_u32 *s2 = (const a_u32 *) (src + tx); a_u32 *d = (a_u32 *) dest; a_u32 *d2 = (a_u32 *) (dest + xbuf); int y; tx *= 2; for (y = 10; y; --y) { a_u32 t1 = s[0]; a_u32 t2 = s2[0]; d[0] = t1; d2[0] = t2; t1 = s[1]; t2 = s2[1]; d[1] = t1; d2[1] = t2; t1 = s[2]; t2 = s2[2]; d[2] = t1; d2[2] = t2; t1 = s[3]; t2 = s2[3]; d[3] = t1; d2[3] = t2; t1 = s[4]; t2 = s2[4]; d[4] = t1; d2[4] = t2; t1 = s[5]; t2 = s2[5]; d[5] = t1; d2[5] = t2; s = (const a_u32 *) (((const a_pixel *) s) + tx); s2 = (const a_u32 *) (((const a_pixel *) s2) + tx); d = (a_u32 *) (((a_pixel *) d) + 2 * xbuf); d2 = (a_u32 *) (((a_pixel *) d2) + 2 * xbuf); } } static void copy_tile4 (const a_pixel* src, a_pixel* dest, int tx) { int y; for (y = 20; y; --y) { memcpy (dest, src, 24); src += tx; dest += xbuf; } } /* Subtract the `struct timeval' values X and Y, storing the result in RESULT. Return 1 if the difference is negative, otherwise 0. */ int timeval_subtract (struct timeval *result, struct timeval *x, struct timeval *y) { /* Perform the carry for the later subtraction by updating Y. */ if (x->tv_usec < y->tv_usec) { int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1; y->tv_usec -= 1000000 * nsec; y->tv_sec += nsec; } if (x->tv_usec - y->tv_usec > 1000000) { int nsec = (x->tv_usec - y->tv_usec) / 1000000; y->tv_usec += 1000000 * nsec; y->tv_sec -= nsec; } /* Compute the time remaining to wait. `tv_usec' is certainly positive. */ result->tv_sec = x->tv_sec - y->tv_sec; result->tv_usec = x->tv_usec - y->tv_usec; /* Return 1 if result is negative. */ return x->tv_sec < y->tv_sec; } struct timeval utime; void start (void) { struct rusage usage; getrusage (RUSAGE_SELF, &usage); utime = usage.ru_utime; } void stop (void) { struct timeval result; struct rusage usage; getrusage (RUSAGE_SELF, &usage); timeval_subtract (&result, &usage.ru_utime, &utime); printf ("%f\n", result.tv_sec * 1.0 + result.tv_usec / 1000000.0); } #define TIMES 5000000 int main() { unsigned i, n; memset (s, 0, sizeof s); memset (d, 0, sizeof d); start(); for (i = 1, n = 0; i < TIMES; i++) { copy_tile1 (s + (n * 547) % (27 * 10), d + (n % 1000) * 20 * 24, 27 * 24); } stop(); start(); for (i = 1, n = 0; i < TIMES; i++) { copy_tile2 (s + (n * 547) % (27 * 10), d + (n % 1000) * 20 * 24, 27 * 24); } stop(); start(); for (i = 1, n = 0; i < TIMES; i++) { copy_tile3 (s + (n * 547) % (27 * 10), d + (n % 1000) * 20 * 24, 27 * 24); } stop(); start(); for (i = 1, n = 0; i < TIMES; i++) { copy_tile4 (s + (n * 547) % (27 * 10), d + (n % 1000) * 20 * 24, 27 * 24); } stop(); return 0; } heroes-0.21/misc/heroes-1.xpm0000644004117000411500000000543007206167342011515 /* XPM */ static char *magick[] = { /* columns rows colors chars-per-pixel */ "48 48 16 1", " c None", ". c #690c7a", "X c #76138b", "o c #8d1ea8", "O c #a22bc5", "+ c #ab68a4", "@ c #c77fc9", "# c #b758cb", "$ c #b1aaa6", "% c #cdbab3", "& c #caaa9f", "* c #d392d1", "= c #e0c2bd", "- c #ebd4ce", "; c #f9e5dd", ": c #feeae2", /* pixels */ " $=%%%%%%%%%$ ", " %%%---;::::;;--%%% ", " %%-::::::::::::::::-%% ", " %=-::::::::::::::::::::-%% ", " $%=;:::::;:;;;;;-;;:::::::;=%$ ", " $%;:::::::;;--=====-;;:::::::;%$ ", " %%-::::;---===%%%%%%%%=----;:::;%% ", " %%:::::;-*@#@+++@%&%*++++@#@-:::::%% ", " $%;::::;-*oXo....+&&&+..XXooo*:::::;%$ ", " $%;:::;;;-+X......+&&$+.....XX@--;;::;%$ ", " %-::::;-==+.......+&&&+.....XX+=-=;:::;% ", " %=::::;;==%+X......+&&&+...XXXX+===-::::-% ", " %::::;-----@XX.....+$&&+...XXXX+=--;::::;% ", " %-::::;=--;:*oo.....+&&&+.XXXXXo@;;-;:::::-% ", " %:::::;-;;;:*ooo....+&&%+XXooooo@-;;:::::::% ", " $-:::;;---;::*OooX...+%%%+oooooOO*:;;:::::::-% ", " %-:::;;;-;:;;*OOoo...+%==@oooooOO*::::::::::;% ", " %::::;--;:::;*OOO....+%==+ooOOOOO@:::::::::::% ", "$-::::-=;:::::*OOOo...+===@oOOOOOO*:::::::::::-$", "%;::::;=-:::::*OOOX...+=--*oOOOOOO*:::::::::::-%", "%;::::-=--::::%OOoX...+=--*OOOOOOO*;::::::::::;%", "%:::::-==-;:;;*OooX..X+%*%@OOOOOOO*;::::::::::;%", "%::::;-=%=--;;*ooo...XO+##OOOOOOOO*::::::::::::%", "%::::;=%%%=--;@oo...X.ooOOOOOOOOOO*::::::::::::%", "%:::;;-%=%%===+oXX..XXooOOOOOOOOOO*::::::::::::%", "%:::;;===&&&&&+.....XXoOOOOOOOOOOO*;:::::::::::%", "%;::;:-=%&&&&&+...X.XXO#+##OOOOOOO*:::::::::::;%", "%;::::-==&&&&&+...XXXo@*=-#OOOOOOO*:::::::::::;%", "%-::::;-=&&&&$+.....oo@:::*OOOOOOO*:::::::::::-%", "$=::::;-=&&&&$+....XXo@:::*OOOOOOO*:::::::::::-$", " %::::;;=%&&&&+....XXo*:::@OOOOOOO*:::::::::::= ", " %::::;;-%&&&&+....Xoo*:::*OOOOOOO*:::::::::::% ", " %-:::::;=%&&&+.X.XXXo@:::*OOOOOOO*::::::::::-% ", " %:::::;-=%&&+.XXXXXo*:::*OOOOOOO*::::::::::% ", " %-::::;-==%&+.XXXXOO@:::@OOOOOOO*:::::::::;% ", " %::::;;;-%&+.XXXoOO*:::*OOOOOOO*:::::::::% ", " %-:::;;;-=%+.XXXoOO*:::@OOOOOOO*::::::::-$ ", " %-:::;;--=$.XXooOO@:::@OOOOOOO*:::::::;% ", " $%::::;;--+XXXXoOO*:::*OOOOOOO@:::::::=$ ", " $%::::;;;@oXXooOO*:::*OOOOOOO*::::::%$ ", " $=;:::::*oXoOOOO@:::*OOOOOOO*:::::-% ", " %%;::::&*@##@@*-:::**@***@*-::::%% ", " $%-:::;---=---;:::;-------;:::%$ ", " $%-:::::::;;:::::::::::::::-%$ ", " %%-::::::::::::::::::::;%% ", " %%;::::::::::::::::;%% ", " $%%--::::::::--%%$ ", " $%%%%%=%%%=$ " }; heroes-0.21/misc/heroes-2.xpm0000644004117000411500000000543007206167342011516 /* XPM */ static char *magick[] = { /* columns rows colors chars-per-pixel */ "48 48 16 1", " c None", ". c #6a0c7b", "X c #791491", "o c #86199f", "O c #9421b0", "+ c #a237bf", "@ c #a22ac5", "# c #9c46b3", "$ c #9b609a", "% c #b54fc9", "& c #c07bbe", "* c #d1b2a8", "= c #d391d3", "- c #dfc4ba", "; c #edd5cd", ": c #fde9e1", /* pixels */ " $##+@@@@+##$ ", " $#@@@@@@@@@@@@@@#$ ", " #@@@@@@@@+@@@@@@@@@@@# ", " $@@@@@@+@@@@+@@@@@@@@@@@@$ ", " @@@@@@@@@@@@OOOO@+@@@@@@@@@+ ", " $@@@@@@@@@@@OOOooooOOO@@@@@@@@@$ ", " $@@@@@@@%%++@+OoXXXO++++%+%+@@@@@$ ", " $@@@@@@@%&&&&$$&#...#$$$&=&&%@@@@@@$ ", " $@@@+@@@O&;******$...$*****--&@@@@@@@$ ", " @@@@@@@OO$-******$...$******-&OOO@@@@@ ", " #@@@@@OOoo$*******$...$*******$oooO@@@@+ ", " $@+@@@@OOoX&******$$...$*****-*$XooO@@@@@$ ", " @@@@@@OOOOO$;******$...$******-$oOO@@+@@@@ ", " #@@@@@OOoo@@=;******$...$*****;;=OOO@@@@@@@# ", " @@@@@@OOOO@@&;-*****$...$-----;;&@@O@@@@@@@@ ", " $@@@@@OOX@@@@=:;*****$.Xo$-;;;;;:=@@@@@@@@@@@$ ", " +@@O@@O@O@@@@=::;-***$.oo&-;:;;::=@@@@@@@@@@@# ", " @@@@@OOOO@@@@=:::****$.XX&;;;::::=@@@@@@@@@@@@ ", "$@@@@@@o@@@@@@=:::-***$ooo&;;:::::=@@@@@@@@@@@@$", "#@@@@@OoOO@+@@=:::****$ooO&;::::::=@@@@@@@@@@@@#", "+@@@@@OoOOO@@@=:;;-***$oOO=:::::::=@@@+@@@@@@@@+", "++@@@@OXoo@@++=::-****=&#%*:::::::=@@@@+@@@@@@@+", "@@@@@@oXoXoO++=;--*******=;:::::::=@@@@@@@+@@@@+", "@@@@@ooXXXoOoO&;-*****-;::::::::::=@@@@@@@@+@@@@", "@@@@@@oX.XXoXo$-*****-;:::::::::::=@@@@@@@@@@@@@", "+@@@@OXXXX...X$******-;;::::::::::=@@@+@@@@@@@@+", "+@@@@@OXX.....$******--=-;::::::::=@@@@@@@@@+@@+", "#@@@@@Oo......$*****--=%%%=:::::::=@@@@@+@@@@@@#", "#@@@@@OOX......******;&@@@=:::::::=@@@@@@@@@@@@#", "$@@@@@@OX.....$*****-;=@@@=:::::::=@@@@@@@@@@@@$", " @@@@@@OX.....$*****;;=@@@=:::::::=@@@+@@@@@@@@ ", " #@@@@@@o.....$*****;;=@@@=:::::::=@@@@@@@@+@@# ", " $@@@@@@OoX...$*****;;=@@@=:::::::=@@@@@+@@@@@$ ", " @@@@@@OoX...$*****;;=@@@=:::::::=@@@@@@@@@@@ ", " #@@@@@@OoXX.$****;;:=@@@=:::::::=@@+@@@@@@@# ", " @@@@@OOOoX.$****;;:=@@@=:::::::=@@@@@@@+@@ ", " $@@@@@@OOXX$***;;;:=@@@=:::::::=@@@@@@@@@# ", " +@@@@@@OoX$***;;::=@@@=:::::::=@@@+@@@@# ", " @@@@@@OOO&-*;;;::=@@@=:::::::=@@@@@@@@ ", " $@@@@@@+O&-**;;::=@@@=:::::::=@@@@@@@$ ", " $@@@@@@@&;---;;:=@@@=:::::::=@@@+@@$ ", " $@@@@@@%=&=====%@@@%=======%@@@@@$ ", " $@@@@@+%%@#++%+@@@+%%%%%%%+@@@@$ ", " +@@@@O@@@O@@@+@@@@@@@@@@@@@+ ", " #@@@@@@@@@@@@@@@@@@@@@@@@% ", " #@@@@@@@@@@@+@@@@@@@@# ", " $#@@@@@@@@@@@@@@+$ ", " $##++@@@@##$ " }; heroes-0.21/misc/heroes-3.xpm0000644004117000411500000000543007206167342011517 /* XPM */ static char *magick[] = { /* columns rows colors chars-per-pixel */ "48 48 16 1", " c None", ". c #6b0e7b", "X c #7a168f", "o c #88229d", "O c #9f28c1", "+ c #a535c6", "@ c #a96d9b", "# c #aa65a6", "$ c #b658c8", "% c #b8a8a5", "& c #ceb9b3", "* c #e5b6d9", "= c #d08ed1", "- c #dfcbc2", "; c #f0d7d5", ": c #fde9e1", /* pixels */ " %-&&&&&&&&&% ", " %-&--;:::::::;-&-% ", " &&;::::::::::::::::;&& ", " %--::::::::::::::::::::;&% ", " %&-::::::::::;;;;;:::::::::-&% ", " %&;:::::::::;;-&----;::::::::;&% ", " %&;:::;;;;;-;&&&%&&&&-;::::::::;&& ", " %&::::*$=$$=#@#@#@o@##%--;;:::::::-% ", " %&:::::=OOooXXX........@&&&--;::::::&% ", " %&::::;=$ooXXX..........o@%&&-;;:;::::&% ", " &;::::=$OXXX.............o@%&&&---;:::;& ", " &-:::::=oXXXX..XXoX........@&&&&&*&;::::-& ", " &:::::;%oooooX.@@@@X.......@&*--;%$*:::::& ", " &-::::;;$oOOOoXX@%%%@......o@--;;;$O=:::::;& ", " &::::::;#OOOOOoX@%%&@....XXo#-;;-=$+$=;::::- ", " %-:::::;;=OO+OOOX@%&%o..XXooo=:;:=$+O$$=::::-% ", " &:::::;;;=O$$#OOo@&@&@XXooooO=-;*$OOOO+#;;::;& ", " &::::;;;;=O#*$OOO@&&&@.oXoooO=;*$$+O+OO$$*:::- ", "%-::::;-;;=+=;=OOO$&&&@oooOOO+=;=+++++++++=:::-&", "%:::::;-;:=O$=$+OO@%&&@$@$$===*;*=========;:::;&", "&:::::;--;=OO$O+Oo@&%&&&*;-;*;;::;;;*;;;;;;:::;&", "&:::::;*--=OO$OOoo@@@@%=&=*;**;:;*********;:::;-", "&::::;;&-&#OOOOoooooo@#$$$$$$$*;*$$$$$$$$$*::::&", "&::::;;&*&=OOOooXX..X.XoOOOO+O=:=+$+$+++++=::::&", "&::::;;&%&@@oX.XX....oooO+OOOO=:*=========*::::&", "&:::::;&&&&&@........ooOOOO+O+=:;:;;;;::;::::::&", "&::::;;-&&&%@.@@o@ooo$OOOOOOO+=:;*********;::::&", "&:::::;-&%&&%@@@@@@@%%$OO+O+OO=:=$$$$$$$$$-:::;&", "&;::::;;-&%@%@%%%@%%-;=OOOOOOO=:=$$$$+$$$$=:::;&", "%-::::;;-%@@@@@@@@@%-*=OO+O+O+=:*=========*:::-&", " &:::::;&&@.......@&-;=OOOOOO+=;::;:;:::;:::::& ", " &::::::&&@.......@&;;=O++O+OO=:**=*=*=*=*;:::& ", " &;:::::;-@.......@*-;=OOOO+OO=:=$$$$$$$$$=::-% ", " &:::::;;@.......@-;;=O+OOOOO=:=$$$$$$+$$*::& ", " &-:::::;%XX.....@-;;=OOO++OO=:;===*=====-::% ", " &::::;:#XX.....@;;:=O+OOO+O=:::::::::::::& ", " --:::::=OXXX.X.+===$OOO+OOO=::::::::::::;% ", " &::::;=ooXX.XXX+$$++OO+O+O=:::::::::::;& ", " %&::::=OOooXXXXoOOOOOOOOOO=:::::::::::&% ", " %&:::=OOOoXXXoOOO+O+O+OO+=::::::::::&& ", " %-::=O+OOXooO+++++OOOO++=:::::::::-% ", " &&:*===$==$$$==========;::::::::&% ", " %&;;;*;;;*;*-;;*;;;;;;;:::::::&% ", " %&*:::::::;:::::::::::::::::&% ", " &&;:::::::::::::::::::::&& ", " &&;:::::::::::::::::&& ", " %&&-;;::::::;:;--& ", " &&&&&&&&&&%% " }; heroes-0.21/misc/heroes-4.xpm0000644004117000411500000000543007206167342011520 /* XPM */ static char *magick[] = { /* columns rows colors chars-per-pixel */ "48 48 16 1", " c None", ". c #76227e", "X c #741388", "o c #8c1ea7", "O c #9228a8", "+ c #a22bc5", "@ c #955e9a", "# c #a05da1", "$ c #b550c9", "% c #c372cb", "& c #b58799", "* c #cfafa7", "= c #d599d2", "- c #ddc0b7", "; c #efd5d2", ": c #feeae2", /* pixels */ " @##++++++@O@ ", " @++++++++++++++++@ ", " #++++++++++++++++++++# ", " @++++++++++++++++++++++++@ ", " ++++++++++++OO+o++++++++++++ ", " @++++++++++O+OoooooOOO+++++++++@ ", " @+++++$$++$+$+O@o.o@+OoO+++++++++@ ", " @+++++$=%=%%%####@#@##Ooooo+O++++++@ ", " @++++++=;;;-****=*=*=**@..XXO++++++++@ ", " +++++$%=;-*************#@..oXo++o+++++ ", " ++++++$=*;**************&#O.XXXXXoo+++++ ", " @++++++%;;;-****&&##*******@.XXXo+O++++++# ", " +++++++&;;;;*-*&@@@@*******@oXoXoO=$++++++ ", " #+++++Oo#;::;;--@...@&*****-$oXooO=:=++++++# ", " ++++++Oo=:::::;-#...@****--;#ooo+%*:=%$+++++ ", " @+++++oOo#:::::;-@...@--*-;-;%O++%;;::;%+++++@ ", " +++++++Oo=:::::;:#...@**-;;;;%++$=:::::=$$++++ ", " +++++ooo+&::::::;#...@*-;-;;:=+%=::::::;=%++++ ", "@+++++Oo++=:::::::#...@--;;;;:%+%::::::;::%++++@", "@++++++Xo+=::::::;#....##&&===$+$=========%++++O", "++++++OooO=::::::;#....O+$+$+$+++$$$$$$$+$+++++#", "++++++oXXo#:::::;-&..O@#$$$%$$$+$%$$$$$%$$$+++++", "++++++oXXo%::::;;-*#&&==**;===%+%=;==;====%+++++", "+++++Oo.XX#-;::;-*****-;::::::=+%;;;;;;;::=+++++", "+++++oooXXX@*----****--:;:::::=+$====%====$+++++", "+++++OoXX.XX@*-******-;:::::::=++$+$+$+$+$++++++", "+++++ooX....X&@@&@&&&&*;::::::=+$%$%%%%%%%++++++", "$++++++o.X..X@.@..XO+#=:::::::%+%=;====;=;%++++@", "O+++++OoX...........oo=:::::::=+=;;;;;;;;;%++++#", "#++++++o...@@@@@@@@.Xo=:::::::%+$=%=%=%=%=$++++@", " ++++++oX.@**&****@.oo=:::::::=+++++++$++++++++ ", " +++++++o.@******&$.Xo%:::::::%+$%%%%%%%%%$++++ ", " @++++++oo#*******@XOO=:::::::%+%;;==;==;;%+++$ ", " ++++++Oo#*******$XO+%:::::::=+==;;;;:;:=%+++ ", " #+++++Oo#-******#oO+=:::::::%+$%%%%%%%%%$++$ ", " +++++++&;;*****$o++=:::::::=++++++++++++++ ", " @++++++=;;****-&%%%=:::::::=+++++++++++++@ ", " ++++++#;;-;**-*-;;::::::::=+++++++++++++ ", " +++++=::;;**-;;;:::::::::%++++++++++++ ", " @++++&:;;;;-*;;::::::::::=+++++++++++@ ", " @+++=;::;---;;;:::::::;;=++++++++++@ ", " @++$=====&%=%==%=======%+++++++++@ ", " @++$$$++$+$++$$$$+$+$$+++++++++@ ", " +++++++++o+++++++++++++++++$ ", " #++++++++++++++++++++++++$ ", " @++++++++++++++++++++$ ", " @+++O+++++++++++$$ ", " @@$++++++$$@ " }; heroes-0.21/misc/heroes-5.xpm0000644004117000411500000000543007206167342011521 /* XPM */ static char *magick[] = { /* columns rows colors chars-per-pixel */ "48 48 16 1", " c None", ". c #6a0d7c", "X c #78178c", "o c #851a9e", "O c #9422af", "+ c #a32fc4", "@ c #a5649c", "# c #b654c8", "$ c #c16fcb", "% c #b298a4", "& c #cbb2ad", "* c #d290d4", "= c #e2b0d7", "- c #ecd2d1", "; c #fae4dd", ": c #feeae2", /* pixels */ " %&--;::;--&% ", " %;:::::::::::;::-& ", " &::::::::;;::::::::::- ", " &:::::::::::;:::::::::::;& ", " -::::::::::;;;-;;;:::::::::;% ", " %::::::::::;-;------;;:::::::::% ", " &::::::;-;---&&-&&&-------:::::::& ", " %:::::::**$@@$@@%&&&&&%@@@=;;::::::& ", " %::::::;;%OXX....@&&&&%@.XX@--:::::::% ", " :::::::--@X......@&%&%%X.XX@%&;;;::::: ", " -::::::---@.......@%&&@.X...XX%--&;::::; ", " &::::::;---@X......@%%%@.....XX@*&--:::::= ", " :::::;----;@XXX....@&%@X..XXXXX+@*-::::::: ", " &:::::----;:*OX.....@%@...XXXXoXoO%::::::::& ", " ::::::--;;;:*OOo....@&@@@@@@@@$$$$=::::::::: ", " &::::::;--:::*OOoX...@&&&&=&&-&=----:::::::::& ", " -::::;--;-:::*++OX...@&&=&========;-:::::::::; ", " :::::;-;::::;*+++X...@&%@$@@$$$$$$$=:::::::::: ", "%:::::;--:::::*+++o...@-@OOO+#++++++*::::::::::%", "&:::::---:::::*++OX...@-*@$$$*$$$***=::::::::::&", "-:::::;&--;:;;&+OOX...@--=-;-------;:::::::::::-", ";:::::-----:;;*+Oo....@-============-:::::::::::", ":::::;-&&--;-;&OOXX..X@-*@$$$$$$$$$$=:::::::::::", "::::;;-&&&----*XXX...X@-*+#+++++#+++*:::::::::::", ":::::;-&&&&&-&@.X...Xo%;=**$=*******=:::::::::::", "::::;;-&&&&&&&@.....Xo@-;;---;---;-;::::::::::::", ";:::;;--&&&&&&@......o%--===========-::::::::::;", "-:::;;--&%&&&&@.....Xo*:=#####$#####=::::::::::-", "&:::;:---&&&%%@.....oo$;*####+#####+*::::::::::&", "%:::::;--&&&&%@....Xoo*;=***********-::::::::::%", " :::::;;-&&%&%@....XoO*:;;;;;;;;;;::::::::::::: ", " -::::;;-&&&&&@....XoO*:-*=*=*=*=*==-:::::::::; ", " &::::::;-&&&&@.X..XXX*:*#####$#####=:::::::::& ", " ::::::;--&&&@.XXXXO+$:*##########+=::::::::: ", " &:::::;--&&&@.XXXoO+$:-=*******=**-::::::::= ", " :::::;;--&&@.XXXX++$:::::::::::::::::::::: ", " &::::;;;-&-@.XXXO++$***********;:::::::::- ", " ;:::;;;;--@.XXOX+++###########*::::::::; ", " :::;:;;;-@oXXXOO+++++++++++++*:::::::: ", " %:::::;;;*oXXO+++++++++++++++*:::::::& ", " &:::::::%OOXO+++++++++++++++*::::::& ", " &::::::=*$$$$$**$***$******-:::::& ", " %:::::-----=--=;----------:::::& ", " ;::::::::;::::::::::::::::::& ", " -::::::::::::::::::::::::-% ", " &::::::::::::::::::::; ", " &-::::::::::::::;& ", " %&-;::::;-&% " }; heroes-0.21/misc/heroes-6.xpm0000644004117000411500000000543007206167342011522 /* XPM */ static char *magick[] = { /* columns rows colors chars-per-pixel */ "48 48 16 1", " c None", ". c #6d0e7f", "X c #7f1797", "o c #8d1da7", "O c #a13cba", "+ c #9324ae", "@ c #a22bc5", "# c #96579d", "$ c #9f5ba7", "% c #b350c7", "& c #c478c9", "* c #bb8d9d", "= c #d1b1a8", "- c #d79ad4", "; c #edcfd2", ": c #fce7e1", /* pixels */ " ##OO@@@@OO## ", " #O@@@@@@@@@@@@@@O# ", " #@@@@@@@@O@@@@@@@@@@@O ", " #@@@@@@@@@@@O@@@@@@@@@@@@# ", " O@@@@@@@@@@@++++o@@@@@@@@@@O# ", " #@@@@@@@@@@@+oo+oXoo++@@@@@@@@@# ", " #@@@@@@+O%OOO@Oo.XXXo+O@%O@@@@@@@# ", " #@@@@@@@%-&&&$$$O....XO&&&%+@@@@@@@# ", " #@@@@@@O+&;======#.....#===$o+@@@@@@@# ", " @@@@@@@oo&=====*=#...X#$===*%$+++@@@@@ ", " O@@@@@++oo$=======#...O**====*#ooo+OO@@@ ", " #@@@@@@+ooo$===*===#..X#=======$OoX+O@@@@# ", " @@@@@@+ooo+$;======#..#*========*%++@@@@@@ ", " #@@@@@+o++@@&;======#.*=======;;;;&+@@@@@@@# ", " @@@@@@+o+@@@&:;;====#..*$*$*--*---%@@@@@@@@@ ", " #@@@@@++o+@@@-:;=====#.X#XOOOO$@%%%@@@@@@@@@@# ", " O@@@@@o+++@@@&::;;===#X.$OOO$%$%%%&%@@@@@@@@@@ ", " @@@@@+o+@@@@@-:::====#.#***=-------&@@@@@@@@@@ ", "#@@@@@@oo@@@@@-:::====$X$;;;;:::::::-@@@@@@@@@@#", "#@@@@@ooo@@@@@-:::====$X%-*---------%@@@@@@@@@@$", "O@@@@@oXo+@@@@&::;====*Xo@@%O%%@%@%@@@@@@@@@@@@@", "@@@@@@oXoo+@@@*:;;====$XO%%%%%%%&%%&%@@@@@@@@@@@", "@@@@@@oXXXo+O@=:;;====*X$;-;--;;-;--&@@@@@@@@@@@", "@@@@@oo.XXoo+O&;;=====*o&:;:::;;;::;-@@@@@@@@@@@", "@@@@@+oXo..oo.#=======$+%--&--&-----%@@@@@@O@@@@", "@@@@++oX......#==*====&+O%@@@%@%@%@@@@@@@@@@@@@O", "O@@@@@oX......#=====;;&@O%&&%&%&%&%&%@@@@@@@@@@O", "O@@@@@oX......#======;&@&-;;-;-;-;-;&@@@@@@@@@@O", "#@@@@@+o......#======;&@&;;::;;:;;;;&@@@@@@@@@@#", "#@@@@@@o......#=*===;;-O%-&&-&&&--&&%@@@@@@@@@@#", " @@@@@@oo.....#=====;;&@@@@@@@@@@@@@@@@@@@@@@@@ ", " O@@@@@@o.....#=====;;-@%&&&&&&&&&&&%@@@@@@@@@O ", " #@@@@@@oX....#=====;;-+&--;-;;---:-&@@@@@@@@@% ", " @@@@@@+o....#=====;:-@&;;;;;;;:;;:&@@@@@@@@@ ", " #@@@@@@+o...#====;::-@%&&&&&&&&&&&%@@@@@@@@$ ", " @@@@@@+ooX.#====;;:-@@@@@@@@@@@@@@@@@@@@@@ ", " #@@@@@+++XX$==;=:::;&&&-&&&&&&&%@@@@@@@@@@ ", " @@@@@@++oo$==;;;;:;;;;;;;;;;;;&@@@@@@@@% ", " @@@@@@@oo$===;:::::::::::::::-@@@@@@@@ ", " #@@@@@OO+-;==;;::::::::::::::&@@@@@@@$ ", " #@@@@@@@&;==;;::::::::::::::-@@@@@@# ", " #@@@@@@%*-&&---------------%@@@@@# ", " #@@@@@OOO%O@O@%O@%%O%OO%%@@@O@@% ", " O@@@@@@@@+@@@@@@@@@@@@@@@@@O# ", " O@@@@@@@@@@@@@@@@@@@@@@@@%# ", " #@@@@@@@@@@@@@@@@@@@@O ", " #O@@@@@@@@@@@@@@%# ", " #%O@@@@@OO%# " }; heroes-0.21/misc/heroes-7.xpm0000644004117000411500000000543007206167342011523 /* XPM */ static char *magick[] = { /* columns rows colors chars-per-pixel */ "48 48 16 1", " c None", ". c #690c7a", "X c #7b178f", "o c #8d29a0", "O c #a029c3", "+ c #9c5e8f", "@ c #b76fb6", "# c #ac719d", "$ c #b34dc9", "% c #b7a1a8", "& c #d2b4af", "* c #dea6da", "= c #d396d0", "- c #ebd4cd", "; c #f9e2de", ": c #feeae2", /* pixels */ " %&--;::;--&% ", " %-::::::::::::::-% ", " &::::::::::::::::::::- ", " &:::::::::::;::::::::::::& ", " -::::::::::;-;-;;;:::::::::-% ", " %::::::::::;;----*--;;:::::::::% ", " %:::::::::::--&%%=%&&--;;::::::::& ", " %::::::;;-----%#++++++%-----;::::::% ", " %:::::::;;--&&&#.......+&&&--;:::::::% ", " ::::::;---&&&&&+.......+&&&&&---:::::: ", " -:::::;-&&&&&&&&+.......+&&&&&&*---;:::- ", " &::::::-&&&=%%&&&+.......+&&&%%%=&&-;::::& ", " :::::;-*@@@@+%&&&+.......+&&&%$$@#@*:::::: ", " &:::::--@OOOOX+&&%+.......+&&&#oXoOO=::::::& ", " ::::::;-@XOOOO@-&&+......X#---@oOOXO=::::::: ", " &::::::--=OOOOO%&&%+..X.XXX@-;;=OOOOO=:::::::% ", " -:::::-;-=@$$$$=-&&#XXo+Oo$%--;=$$$@$*:::::::- ", " ::::;;--;******-;-%%#%#%%%=*-:;******-:::::::: ", "%:::::---;;;;;--;;&&&&&&&---;;:;;;;;:;:::::::::%", "&:::::&@==========%&&&&&----:;-===========*::::&", "-:::;;%ooOO$$$$$oO#&&%---;-;::=$$$O$$$$O$$*;:::-", ";:::;;@oooOOOOOOOo+&&&&---;:::=OOOOOOOOOOO=::::-", "::::;;@XXoooOOOOoo+&&&&-;;::;;=OOOOOOOOOOO=::::;", "::::;;@XXXooOOooo.+%&&--;:::;;=OOOOOOOOOOO=:::::", "::::;;#X.X.XXoooo.+%&---;:::::=OOOOOOOOOOO=:::::", ":::::;@X.X........+&&&-;::::::=OOOOOOOOOOO=::::;", "-::::;@XX.........+&&--;:::::;=OOO$OO$OOOO=:::::", "-:::::%XX.........+&&--::::::;=OOOOOOOOOOO=::::-", "&:::::=OX..XXX...X+&&-;:::::::*$$$$$$$$$$$=;:::&", "%::::;&=####++#+++%&&-;:::::::*===========-;:::%", " :::::;--&&%&&%&%&&&--;:::;::::;::;;-;:;;;;:::: ", " -::::;;-&%######&&&&=******-:::*****;::::::::- ", " &:::::;--%XXXo.+&&&%O$$@$$$*;;:*$$$*;::::::::% ", " ::::::;-#.....+&&-@OOOOOOO=:::=OOO=::::::::: ", " &:::::;-%X....+&&&@OOOOOOO=;::=OOO=;:::::::* ", " :::::;-@oX...+&&-@OOOO$OO=:::=OOO=:::::::: ", " &::::;;&%#+++%&*-=OOOOOOO=:::*==@*;::::::- ", " ;::::;-&-&&%&&--=OOOOOOO=::;;*--:::::::- ", " :::::;----&&&--@OOO$OOO=:::::::::::::: ", " %::::::;----=-;=OOOOOOO=:::::::::::::& ", " %:::::::------=$O$O$O$=::::::::::::& ", " &::::::;-;---====@===-:::::::::::& ", " %::::::;;;;;---*--*-;::::::::::& ", " ;:::::;;;;;;;:::::::::::::::& ", " -:::::::;::::::::::::::::-% ", " &::::::::::::::::::::- ", " %-:::::::::::::::& ", " %&-;::::;-&& " }; heroes-0.21/misc/heroes-8.xpm0000644004117000411500000000543007206167342011524 /* XPM */ static char *magick[] = { /* columns rows colors chars-per-pixel */ "48 48 16 1", " c None", ". c #6a0d7b", "X c #76148b", "o c #8e1ea8", "O c #a03abe", "+ c #8e24a5", "@ c #a22ac5", "# c #985a9b", "$ c #b653c8", "% c #c479c9", "& c #bb9099", "* c #d1b2a8", "= c #c8a69e", "- c #d69cd2", "; c #fde9e1", ": c #edd1cf", /* pixels */ " ###O@@@@OO## ", " #@@@@@@@@@@@@@@@@# ", " #@@@@@@@@@@@@@@@@@@@@O ", " #@@@@@@@@@@@@@@@@@@@@@@@@# ", " O@@@@@@@@@@@@+OoOO@@@@@@@@@O# ", " #@@@@@@@@@@@@o++ooo+@o@@@@@@@@@# ", " #@@@@@@@@@@@oo+++++#+@o@O@@@@@@@@# ", " #@@@@@@@@oooXo########+Xooo@@@@@@@@# ", " #@@@@@@@ooo+X..#=======#.XXX+@@@@@@@@# ", " @@@@@@@oo++....#*====*=#..XX++o@@@@@@@ ", " O@@@@@@+XXX.....#=*=====#..XXXXXX+o@@@@O ", " #@@@@@@OOO#+++...#=====**#.X.XX+##+O@@@@@# ", " @@@@@@o$-&-&%#...#=*=*=**#XXXO-%&-&$@@@@@@ ", " #@@@@@oX%:;;::&...#==*=*=*#XX+#:::::-@@@@@@# ", " @@@@@@@o-:;;;;%++.#**:=***#+++%::;;;-@@@@@@@ ", " #@@@@@ooo%;;;;;%+..#=****:*%+++%;;;;;-@@@@@@@# ", " @@@@@@@@o%:-::*%oX.#&&&&=*=$oo@%:-:-:%@@@@@@@O ", " @@@@@ooo@$%%%%%$oX.X+#$##$$OO@O$%%%%%$@@@@@@@@ ", "#@@@@@@o@@@@@@O+OOo....+oo+oo@@O@@@@@@@@@@@@@@@#", "#@@@@@$#%%%%%---%-+....++ooo@@$%%%-%%%--%-$@@@@O", "#@@@@@%**:::::;::-%....oooo@@@-:::;:::::;:%@@@@O", "@@@@@@%*:::;;;;;;:#....+o@@@@@-;;;;;;;;;;;%@@@@O", "@@@@@@%:*:::;;;:::#...+oo@@@@@-;;;;;;;;;;;%@@@@@", "@@@@@o%**-:::;::**#..++o@@@@@@%;;;;;;;;;;;-@@@@@", "@@@@@@%***:*:::***#..oooo@@@@@%;;;;;;;;;;;-@@@@@", "@@@@@o%*******==*=#.Xooo@@@@@@-;;;;;;;;;;;-@@@@@", "@@@@@o%****=*=***=#.Xoo@@@@@@@-;;;;;;;;;;;-@@@@O", "O@@@@@-:*==*=====*#.XXo@@@@@@@-;;;;;;;;;;;-@O@@#", "O@@@@@%*=&&&&&&&&&#Xooo@@@@@@@%:::::;:::::%@@@@#", "#@@@@@$%##########+XXo@@@@@@@@$-%--%%-%-%-$@@@@#", " @@@@@@@+X......X.XXooo@@@@@@@@@@@@@@@@O@@@@@@@ ", " O@@@@@o+..####++..XO$%%%%%%$@@@$%%%$@@@@@@@@@O ", " #@@@@@@oo#&&&&&+.X+%=:-::-:%@@@%-:-%@@@@@@@@@# ", " @@@@@@oo#*====#..X-;;;;;;;-@@@-;;;-@@@@@@@@@ ", " #@@@@@@@%***==#.Xo%;;;;;;;%@@@-;;;%@@@@@@@@O ", " @@@@@@o%::**=#.XX%;;;;;;;-@@@-;;;-@@@@@@@@ ", " #@@@@@o$&-%##+XXo%;;;;;;;-@@@%---$@@@@@@@# ", " O@@@@@OO+##+oX+o-;;;;;;;-@@@@$$$$@@@@@@O ", " @@@@@@@oooXXXoo%;;;;;;;-@@@@@@@@@@@@@@ ", " #@@@@@@@oo+XXoo-;;;;;;;%@@@@@@@@@@@@@# ", " #@@@@@@@Oo+Xo@%;;;;;;;-@@@@@@@@@@@@# ", " #@@@@@@oo@oo@$-------$@@@@@@@@@@@# ", " #@@@@@@@@o@oO$$O$$$$O@@@@@@@O@@# ", " O@@@@@@@@@@@@@@@@@@@@@@@@@@OO ", " #@@@@@@@o@@@@@@@@@@@@@@@@$# ", " #@@@@@@@@@@@@@@@@@@@@O ", " #@@@@@@@@@@@@@@@$# ", " ##OO@@@@O@$# " }; heroes-0.21/misc/01-intl.patch0000644004117000411500000000172507272215470011553 Warning: the gettext maintainer says this patch is WRONG. I should remove it as soon as I figure how it can be worked-around properly (using localdef). --- intl/ChangeLog +++ intl/ChangeLog @@ -1,1 +1,9 @@ +2001-04-24 Alexandre Duret-Lutz + + * dcigettext.c (HAVE_LOCALE_NULL): Don't define even if + __GNU_LIBRARY__ is defined. Otherwise guess_category_value() + uses glibc's setlocale() which make the libintl dependant + on the glibc configuration and prevent testing the package with + foreign languages. + --- intl/dcigettext.c.old Tue Apr 24 19:49:54 2001 +++ intl/dcigettext.c Tue Apr 24 19:50:26 2001 @@ -203,7 +203,7 @@ However it does not specify the exact format. Neither do SUSV2 and ISO C 99. So we can use this feature only on selected systems (e.g. those using GNU C Library). */ -#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2) +#if defined _LIBC # define HAVE_LOCALE_NULL #endif heroes-0.21/misc/05-po.patch0000644004117000411500000000077007272215470011226 We don't use po/ChangeLog. All changes to po/*.po should go into to main ChangeLog, and having a file po/ChangeLog would make emacs default to the latter which is really annoying. --- po/Makefile.in.in Wed Apr 25 21:11:13 2001 +++ po/Makefile.in.in Wed Apr 25 21:11:25 2001 @@ -45,7 +45,7 @@ POFILES = @POFILES@ GMOFILES = @GMOFILES@ -DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \ $(POFILES) $(GMOFILES) POTFILES = \ heroes-0.21/po/0000777004117000411500000000000007451377063007116 5heroes-0.21/po/Makefile.in.in0000644004117000411500000001213207451356464011505 # Makefile for program source directory in GNU NLS utilities package. # Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper # # This file file be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. PACKAGE = @PACKAGE@ VERSION = @VERSION@ # These two variables depend on the location of this directory. subdir = po top_builddir = .. SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datadir = @datadir@ localedir = $(datadir)/locale gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` CC = @CC@ GMSGFMT = @GMSGFMT@ MSGFMT = @MSGFMT@ XGETTEXT = @XGETTEXT@ MSGMERGE = msgmerge DEFS = @DEFS@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ INCLUDES = -I.. -I$(top_srcdir)/intl COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) POFILES = @POFILES@ GMOFILES = @GMOFILES@ DISTFILES = Makefile.in.in POTFILES.in $(PACKAGE).pot \ $(POFILES) $(GMOFILES) POTFILES = \ CATALOGS = @CATALOGS@ .SUFFIXES: .SUFFIXES: .c .o .po .pox .gmo .mo .c.o: $(COMPILE) $< .po.pox: $(MAKE) $(PACKAGE).pot $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox .po.mo: $(MSGFMT) -o $@ $< .po.gmo: file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ && rm -f $$file && $(GMSGFMT) --statistics -o $$file $< all: all-@USE_NLS@ all-yes: $(CATALOGS) all-no: # Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. $(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ --add-comments --keyword=_ --keyword=N_ \ --files-from=$(srcdir)/POTFILES.in \ && test ! -f $(PACKAGE).po \ || ( rm -f $(srcdir)/$(PACKAGE).pot \ && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext"; then \ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi install-data-no: all install-data-yes: all $(mkinstalldirs) $(DESTDIR)$(datadir) @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkinstalldirs) $(DESTDIR)$$dir; \ if test -r $$cat; then \ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \ else \ $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \ echo "installing $(srcdir)/$$cat as" \ "$(DESTDIR)$$dir/$(PACKAGE).mo"; \ fi; \ done # Define this as empty until I found a useful application. installcheck: uninstall: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\.gmo$$//'`; \ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \ done if test "$(PACKAGE)" = "gettext"; then \ rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi check: all dvi info tags TAGS ID: mostlyclean: rm -f core core.* *.pox $(PACKAGE).po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: $(MAKE) update-po @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: $(DISTFILES) dists="$(DISTFILES)"; \ for file in $$dists; do \ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \ cp -p $$dir/$$file $(distdir); \ done update-po: Makefile $(MAKE) $(PACKAGE).pot if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ cd $(srcdir); \ catalogs='$(GMOFILES)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\.gmo$$//'`; \ echo "$$lang:"; \ if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \ mv -f $$lang.new.po $$lang.po; \ else \ echo "msgmerge for $$cat failed!"; \ rm -f $$lang.new.po; \ fi; \ done $(MAKE) update-gmo update-gmo: Makefile $(GMOFILES) @: Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ $(SHELL) ./config.status # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: heroes-0.21/po/POTFILES.in0000644004117000411500000000123407451356466010613 # This file was generated by tools/genpotfiles.sh # on Sat Mar 30 16:43:48 CET 2002 lib/error.c lib/getopt.c lib/xmalloc.c lib/error.h lib/xalloc.h src/argv.c src/bonus.c src/endscroll.c src/fontdata.c src/hedlite.c src/helptext.c src/heroes.c src/heroeslvl.c src/levellst.c src/menus.c src/musicfiles.c src/pcx.c src/people.c src/readmake.c src/relocate.c src/rsc_files.c src/savegame.c src/scores.c src/userconf.c src/system.h src/debughash.gperf src/media/sfx.c src/media/allegro/joystick.c src/media/dummy/strack.c src/media/ggi/video.c src/media/gii/joystick.c src/media/mikmod/strack.c src/media/sdl/joystick.c src/media/sdl/video.c src/media/sdl_mixer/strack.c heroes-0.21/po/heroes.pot0000644004117000411500000007601207451374623011050 # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "POT-Creation-Date: 2002-03-30 18:44+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: lib/error.c:129 lib/error.c:157 msgid "Unknown system error" msgstr "" #: lib/getopt.c:694 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "" #: lib/getopt.c:719 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "" #: lib/getopt.c:724 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "" #: lib/getopt.c:742 lib/getopt.c:915 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "" #. --option #: lib/getopt.c:771 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "" #. +option or -option #: lib/getopt.c:775 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "" #. 1003.2 specifies the format of this message. #: lib/getopt.c:801 #, c-format msgid "%s: illegal option -- %c\n" msgstr "" #: lib/getopt.c:804 #, c-format msgid "%s: invalid option -- %c\n" msgstr "" #. 1003.2 specifies the format of this message. #: lib/getopt.c:834 lib/getopt.c:964 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "" #: lib/getopt.c:881 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "" #: lib/getopt.c:899 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "" #. If XALLOC_FAIL_FUNC is NULL, or does return, display this message #. before exiting when memory is exhausted. Goes through gettext. #: lib/xmalloc.c:66 msgid "memory exhausted" msgstr "" #: src/argv.c:60 #, c-format msgid "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux and Philippe Meisburger.\n" msgstr "" #: src/argv.c:63 src/heroeslvl.c:64 msgid "" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." msgstr "" #: src/argv.c:74 msgid "Use `-lWORD' or `--list=WORD' where WORD can be:" msgstr "" #: src/argv.c:76 msgid "display all debugging channels" msgstr "" #: src/argv.c:78 msgid "list all level files" msgstr "" #: src/argv.c:80 msgid "print the preferences settings" msgstr "" #: src/argv.c:82 msgid "print the resources list" msgstr "" #: src/argv.c:84 msgid "print the sound driver list" msgstr "" #: src/argv.c:86 msgid "print the sound track list" msgstr "" #: src/argv.c:145 src/heroeslvl.c:74 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "" #: src/argv.c:150 #, c-format msgid "" "Usage: %s [OPTIONS]...\n" "\n" msgstr "" #: src/argv.c:151 msgid "" "Heroes is a game similar to the \"Tron\" and \"Nibbles\" games of yore\n" "but includes many graphical improvements and new game features.\n" msgstr "" #: src/argv.c:154 src/heroeslvl.c:81 msgid "" "Mandatory arguments to long options are mandatory for short options too.\n" msgstr "" #: src/argv.c:156 msgid "" "General options:\n" " -v, --version display version number\n" " -h, --help display this help\n" " -q, --quiet don't print warning messages\n" " -Q, --really-quiet don't even print error messages\n" " -v, --verbose=CHANNELS enable or disable debugging channels\n" " (see --list=debug for available channels)\n" " -l, --list=WORD show some internal information; WORD can be\n" " 'debug', 'resources', 'sound-drivers' or\n" " 'sound-tracks'\n" msgstr "" #: src/argv.c:167 msgid "" "Sound options:\n" " -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:" "autodetect)\n" " (see --list=sound-drivers for available Ns)\n" " -S, --no-sound disable sound\n" " -X, --no-sfx disable sound-effects\n" " -m, --mono non-stereo output\n" " -8, --8bits 8bits sound output\n" " -i, --high-quality high quality mixer\n" msgstr "" #: src/argv.c:176 msgid "" "Display options:\n" " -G, --gfx-options=OPTIONS pass OPTIONS to the display driver\n" " -F, --full-screen full screen mode\n" " -2, --double stretch the display twofold\n" " -3, --triple stretch the display threefold\n" " -4, --quadruple stretch the display fourfold\n" " -e, --even-lines display only even-lines\n" msgstr "" #. TRANS: rotozoom is a graphical effect used in the demo of yore #. where the screen rotate and zoom (actually it doesn't zoom in Heroes); #. waves is another effect where the screen is agitated like some #. jelly (this was also called the `mushroom effect' in game like #. Death Rally). #: src/argv.c:189 msgid "" "Miscellaneous options:\n" " --cpu-off disable computer opponents\n" " --default-scores restore default scores file\n" " --default-options restore default options file\n" " --default-saves restore default saves file\n" " -s, --swap-sides swap sides in two player mode\n" " --no-double-fx disable combination of rotozoom and waves\n" " -g, --go skip the introduction\n" " -J, --no-joystick disable joystick handling\n" msgstr "" #: src/argv.c:199 msgid "" "These options can be set in your file ~/.heroes/heroesrc (which is read\n" "before parsing other command line options) using a line like the following:\n" "\n" " Options: -gs -d3,buffer=11,count=4\n" msgstr "" #: src/argv.c:204 msgid "" "Visit http://heroes.sourceforge.net/ for news, documentation, and updates." msgstr "" #: src/argv.c:206 src/heroeslvl.c:102 msgid "Report bugs to ." msgstr "" #: src/argv.c:312 msgid "-n is an obsolete option, you should use --list=sound-drivers" msgstr "" #: src/bonus.c:324 src/bonus.c:329 #, c-format msgid "SIZE IS %d" msgstr "" #: src/bonus.c:334 msgid "SPEEDED UP" msgstr "" #: src/bonus.c:338 msgid "SPEEDED DOWN" msgstr "" #: src/bonus.c:345 #, c-format msgid "GET %dPTS" msgstr "" #: src/bonus.c:350 msgid "FIRE TRAIL!" msgstr "" #: src/bonus.c:364 msgid "GET TURBO+" msgstr "" #: src/bonus.c:371 msgid "GET TURBO-" msgstr "" #: src/bonus.c:379 msgid "INVINCIBLE!" msgstr "" #: src/bonus.c:391 msgid "EXTRA-LIFE!" msgstr "" #: src/endscroll.c:113 msgid "THE END" msgstr "" #: src/fontdata.c:243 #, c-format msgid "character '%c' is not drawable (in message '%s')" msgstr "" #: src/hedlite.c:1622 #, c-format msgid "Cannot create directory `%s'." msgstr "" #: src/hedlite.c:1679 src/hedlite.c:1686 #, c-format msgid "%s: invalid level file" msgstr "" #: src/helptext.c:24 msgid "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "\n" "%{center}%pUse the arrow keys to scroll up and down.\n" "\n" "%{head 1}CONTROL & BOARD\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSE\n" "%{textat cR -9 97}%yQUIT GAME\n" "%{textat cR 26 -62}%yCONTROL\n" "%{textat cL 30 74}%ySTOP\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%ySCORE\n" "%{textat cR 1 8}%yCOMMENTARY\n" "%{textat cL 16 29}%yHEROES\n" "%{textat cL 33 29}%yWALLS\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yLIFES\n" "%{textat cL 51 -109}%yTURBO ENERGY\n" "%{textat cL 72 -104}%yTIME\n" "%{textat cR 96 40}%yPLAYER COLOR\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" msgstr "" #: src/helptext.c:71 msgid "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Affects the player that gets the item\n" "%{img L 60 22 20 22}Affects all players except the one who gets the bonus\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points\n" "%{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions\n" "\n" msgstr "" #: src/helptext.c:99 msgid "" "%{head 3}GAME MODES\n" "\n" "%{>>}%yQUEST\n" "\n" "%{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers " "you. Your aim is to collect a given number (10) of Trail+1 bonuses and then " "to get the End-of-Level bonus that will send you to next level.\n" "%{>>>}%{img L 20 176 20 22}End-of-Level\n" "%{img R 0 0 20 22}%{flushright}Trail+1\n" "%{>>>}Trail+1 has the effect of growing your trail. There are two way to " "get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first " "appears when someone's trail reach 10 units.\n" "\n" "%{>>}%yDEATH MATCH\n" "\n" "%{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a " "fight to death. The aim of the game is to be the last player still alive. " "For this, feel free to use any stratagems you want. Nothing is forbidden.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL\n" "\n" "%{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm " "all the people of your competitors. It was said \"There can be only one\", " "make sure it is yours!\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}They are among us, find them !\n" "\n" "%{>>}%yCOLOR\n" "\n" "%{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time " "to get a maximum of gems of your color. Beware, if you go over your " "competitor's gems, it's your competitor's gem account that you will " "increase. Be also sure not to get crossed gems because you'll lose " "collected gems. Grey ones gives gems to all players except the one that " "goes over it. The Clocks give you extra time.\n" "\n" "%{>>}%yTIME CA$H\n" "\n" "%{>>>}In %yTIME CA$H%w mode the winner is the player who collected the " "largest amount of money.\n" "\n" msgstr "" #: src/helptext.c:145 msgid "" "%{head 4}GAME OPTIONS\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gCOLOR SELECT\n" "\n" "%{>>>}This option allows you to choose the color of your vehicle between %" "pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gGAME SPEED\n" "\n" "%{>>>}The %gGAME SPEED%w option allows you to select the initial speed of " "the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gROUNDS\n" "\n" "%{>>>}The %gROUNDS%w option allows you to select the number of rounds in the " "tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. These " "values range from 1 to 100 rounds.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMATION\n" "\n" "%{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better " "visibility.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gLIGHTING\n" "\n" "%{>>>}The %gLIGHTING%w option is here to tune the luminosity of your " "screen.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gINERTIA\n" "\n" "%{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOT\n" "\n" "%{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, rest in " "peace... Note that %gAUTOPILOT%w does not work against fire trails.\n" "\n" msgstr "" #: src/helptext.c:191 msgid "" "%{head 1}CONTACT\n" "\n" "%{center}home page:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}send bug reports to:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" msgstr "" #: src/helptext.c:204 msgid "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's " "environmental and ecological issues and did our best to use only recycled " "bytes in this program.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux and Philippe Meisburger.\n" "\n" msgstr "" #: src/heroes.c:677 src/heroes.c:763 #, c-format msgid "Cannot load level %s (error %d)" msgstr "" #: src/heroes.c:1969 #, c-format msgid "INVERTED %d" msgstr "" #: src/heroes.c:2003 #, c-format msgid "STOPPED %d" msgstr "" #. TRANS: %d, the number of remaining lives, is always #. positive. #: src/heroes.c:2300 msgid "LAST LIFE" msgid_plural "%d LIVES LEFT" msgstr[0] "" msgstr[1] "" #: src/heroes.c:2873 msgid "Error during level loading" msgstr "" #: src/heroes.c:2909 #, c-format msgid "-LEVEL %d-" msgstr "" #: src/heroes.c:2911 #, c-format msgid "-ROUND %d/%d-" msgstr "" #: src/heroes.c:3416 msgid "error in sfx.cfg" msgstr "" #: src/heroeslvl.c:63 #, c-format msgid "Copyright (C) %d Alexandre Duret-Lutz.\n" msgstr "" #: src/heroeslvl.c:79 #, c-format msgid "" "Usage: %s [OPTIONS]... levels\n" "\n" msgstr "" #: src/heroeslvl.c:80 msgid "Heroeslvl is a tool used to inspect Heroes' level files.\n" msgstr "" #: src/heroeslvl.c:83 msgid " -v, --version display version number" msgstr "" #: src/heroeslvl.c:85 msgid " -h, --help display this help" msgstr "" #: src/heroeslvl.c:87 msgid "" " -p, --print=WHAT select information to display. WHAT should " "be\n" " one or more of these characters:" msgstr "" #: src/heroeslvl.c:90 msgid "d print square directions" msgstr "" #: src/heroeslvl.c:91 msgid "f print filename" msgstr "" #: src/heroeslvl.c:92 msgid "h print header" msgstr "" #: src/heroeslvl.c:93 msgid "i print tile details" msgstr "" #: src/heroeslvl.c:94 msgid "t print square type map" msgstr "" #: src/heroeslvl.c:95 msgid "T print type keys" msgstr "" #: src/heroeslvl.c:96 msgid "w print square wall map" msgstr "" #: src/heroeslvl.c:97 msgid "@ print tunnels" msgstr "" #: src/heroeslvl.c:98 msgid " -i, --indent indent everything but the filename" msgstr "" #: src/heroeslvl.c:101 msgid "When no options are given, the default is -ipfh." msgstr "" #: src/heroeslvl.c:201 #, c-format msgid "%sheight:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:203 #, c-format msgid "%swidth:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:206 #, c-format msgid "%sY-wrap:\tno\n" msgstr "" #: src/heroeslvl.c:208 #, c-format msgid "%sY-wrap:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:211 #, c-format msgid "%sX-wrap:\tno\n" msgstr "" #: src/heroeslvl.c:213 #, c-format msgid "%sX-wrap:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:215 #, c-format msgid "%ssound track alias:\t%s\n" msgstr "" #: src/heroeslvl.c:217 #, c-format msgid "%stile map basename:\t%s\n" msgstr "" #: src/heroeslvl.c:219 #, c-format msgid "%sstarting squares and directions (y x dir):\n" msgstr "" #: src/heroeslvl.c:261 msgid "none" msgstr "" #: src/heroeslvl.c:262 msgid "stop" msgstr "" #: src/heroeslvl.c:263 msgid "speed" msgstr "" #: src/heroeslvl.c:264 msgid "tunnel" msgstr "" #: src/heroeslvl.c:265 msgid "boom" msgstr "" #: src/heroeslvl.c:266 msgid "anim" msgstr "" #: src/heroeslvl.c:267 msgid "ice" msgstr "" #: src/heroeslvl.c:268 msgid "dust" msgstr "" #: src/heroeslvl.c:269 msgid "outway" msgstr "" #: src/heroeslvl.c:389 #, c-format msgid "%sTunnels:\n" msgstr "" #. TRANS: This is the header of an array (output by heroeslvl -p@), #. so the position of these words is important. #. #. SRCIDX is a short for 'source index' (entrance of a tunnel) and #. DESTIDX means 'destination index' (output of the tunnel). #: src/heroeslvl.c:395 #, c-format msgid "%s NBR SRCIDX Y X DIR DESTIDX\n" msgstr "" #. TRANS: `still' is used to describe tiles which are not animated. #: src/heroeslvl.c:426 msgid "still" msgstr "" #. TRANS: `loop' is for animated tiles where frames are displayed #. from 1 to n, and then again from 1 to n, etc. #: src/heroeslvl.c:430 msgid "loop" msgstr "" #. TRANS: `pingpong' is for tiles animated in loop where frame #. displayed from 1 to n, then from n to 1, and then again from 1 #. to n, etc. #: src/heroeslvl.c:435 msgid "pingpong" msgstr "" #. TRANS: This is the header of an array (output by heroeslvl -pi) so #. the position of these word is important. #. #. SPRITE is the address of the sprite used to render the tile. OVERLAY #. is the address of a sprite that should be displayed on top #. of the players (e.g. trees). ANIM-TYPE is the kind of animation used #. for the tile, FRM the number of frame to display, DEL the delay #. between each frame. #: src/heroeslvl.c:453 #, c-format msgid "%sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL\n" msgstr "" #: src/heroeslvl.c:503 #, c-format msgid "cannot load %s" msgstr "" #: src/heroeslvl.c:507 #, c-format msgid "File:\t%s\n" msgstr "" #: src/heroeslvl.c:539 msgid "Missing filename." msgstr "" #: src/levellst.c:53 #, c-format msgid "cannot open directory %s" msgstr "" #. TRANS: in QUEST mode, the player goes throught all the levels, but #. have to search for specific powerups in order to jump to the next #. level. Hence this is a `quest' for those powerups. #: src/menus.c:146 msgid "QUEST" msgstr "" #. TRANS: in DEATH MATCH mode, the user has to kill all other players. #: src/menus.c:148 msgid "DEATH MATCH" msgstr "" #. TRANS: in KILL'EM ALL mode there are lemmings moving on the ground #. and the player must run over them all. You may want to translate #. `kill' as `run over', `squash', `mash' or something among those #. lines. #: src/menus.c:153 msgid "KILL'EM ALL" msgstr "" #. TRANS: in TIME CA$H mode, the player must collect dollars with #. restricted time. #: src/menus.c:156 msgid "TIME CA$H" msgstr "" #. TRANS: in COLOR mode, the player must collect some colored gems #. with restricted time. #: src/menus.c:159 msgid "COLORS" msgstr "" #: src/menus.c:192 msgid "GAME" msgstr "" #: src/menus.c:193 msgid "SCREEN" msgstr "" #: src/menus.c:194 msgid "SOUND" msgstr "" #: src/menus.c:195 msgid "CONTROL" msgstr "" #: src/menus.c:196 msgid "KEYS" msgstr "" #: src/menus.c:197 msgid "EXTRAS" msgstr "" #: src/menus.c:198 src/menus.c:222 src/menus.c:385 src/menus.c:395 #: src/menus.c:409 src/menus.c:421 src/menus.c:431 src/menus.c:454 #: src/menus.c:545 msgid "GO BACK" msgstr "" #. play menu #: src/menus.c:205 src/menus.c:539 msgid "PLAY" msgstr "" #. options menu #: src/menus.c:206 src/menus.c:526 msgid "OPTIONS" msgstr "" #: src/menus.c:207 src/menus.c:406 msgid "INFOS" msgstr "" #: src/menus.c:208 msgid "CREDITS" msgstr "" #: src/menus.c:209 msgid "SCORES" msgstr "" #. editor first menu #: src/menus.c:210 src/menus.c:536 msgid "EDITOR" msgstr "" #: src/menus.c:211 msgid "QUIT" msgstr "" #. TRANS: Create a new level. #: src/menus.c:219 src/menus.c:503 msgid "NEW LEVEL" msgstr "" #. TRANS: Load an existing level for edition. #: src/menus.c:221 msgid "LOAD LEVEL" msgstr "" #: src/menus.c:375 msgid "CONTROL OPTIONS" msgstr "" #. 1st player #: src/menus.c:377 src/menus.c:416 src/menus.c:433 msgid "PLAYER 1" msgstr "" #: src/menus.c:379 src/menus.c:383 msgid "AUTO PILOT" msgstr "" #. 2nd player #: src/menus.c:381 src/menus.c:417 src/menus.c:441 msgid "PLAYER 2" msgstr "" #: src/menus.c:391 msgid "SOUND OPTIONS" msgstr "" #: src/menus.c:393 msgid "MUSIC" msgstr "" #: src/menus.c:394 msgid "SFX" msgstr "" #: src/menus.c:398 msgid "MUSIC VOL" msgstr "" #: src/menus.c:399 msgid "SFX VOL" msgstr "" #: src/menus.c:403 msgid "SCREEN OPTIONS" msgstr "" #: src/menus.c:405 msgid "RADAR" msgstr "" #: src/menus.c:407 msgid "LIGHTING" msgstr "" #: src/menus.c:408 msgid "INERTIA" msgstr "" #: src/menus.c:414 msgid "GAME OPTIONS" msgstr "" #: src/menus.c:418 msgid "PLAYER 3" msgstr "" #: src/menus.c:419 msgid "PLAYER 4" msgstr "" #: src/menus.c:420 msgid "SPEED" msgstr "" #: src/menus.c:429 msgid "KEYBOARD DEFS" msgstr "" #: src/menus.c:434 src/menus.c:442 msgid "UP" msgstr "" #: src/menus.c:435 src/menus.c:443 msgid "LEFT" msgstr "" #: src/menus.c:436 src/menus.c:444 msgid "DOWN" msgstr "" #: src/menus.c:437 src/menus.c:445 msgid "RIGHT" msgstr "" #: src/menus.c:438 src/menus.c:446 msgid "TURBO" msgstr "" #: src/menus.c:439 src/menus.c:447 msgid "STOP" msgstr "" #: src/menus.c:452 msgid "EXTRAS LEVELS" msgstr "" #: src/menus.c:456 msgid "ORIGINAL LEVELS" msgstr "" #: src/menus.c:458 msgid "ORIGINAL+EXTRAS" msgstr "" #: src/menus.c:460 msgid "EXTRAS ONLY" msgstr "" #: src/menus.c:462 msgid "EXTRAS: NONE" msgstr "" #: src/menus.c:464 msgid "EXTRAS: ALL" msgstr "" #: src/menus.c:466 msgid "EXTRAS: SELECT" msgstr "" #. pause menu #: src/menus.c:491 msgid "PAUSE" msgstr "" #. quit y/n menus #: src/menus.c:495 msgid "QUIT THIS GAME?" msgstr "" #: src/menus.c:497 msgid "REALLY QUIT?" msgstr "" #: src/menus.c:499 msgid "NO" msgstr "" #: src/menus.c:500 msgid "YES" msgstr "" #: src/menus.c:505 msgid "EXISTING LEVEL" msgstr "" #: src/menus.c:507 msgid "NAME" msgstr "" #. TRANS: in wrapped levels are unbounded level, e.g. whenever the #. player reach the left border it continue its way from the right border #. (except that the player doesn't even know there are borders, because #. the level is tiled infinitely). In unwrapped levels there are explicit #. bounds that you cannot cross. X-WRAP is a check box used to specified #. whether a level must be wrapped horizontally or not when creating a #. new level. #: src/menus.c:515 msgid "X-WRAP" msgstr "" #. TRANS: Y-WRAP is a check box used to specified whether a level #. must be wrapped vertically or not. #: src/menus.c:518 msgid "Y-WRAP" msgstr "" #. TRANS: width of the level #: src/menus.c:520 msgid "X-SIZE" msgstr "" #. TRANS: height of the level #: src/menus.c:522 msgid "Y-SIZE" msgstr "" #: src/menus.c:523 msgid "EDIT" msgstr "" #. main menu #: src/menus.c:529 msgid "HEROES" msgstr "" #. editor selector #: src/menus.c:532 msgid "SELECT A LEVEL" msgstr "" #: src/menus.c:541 msgid "ONE PLAYER" msgstr "" #: src/menus.c:543 msgid "TWO PLAYERS" msgstr "" #: src/menus.c:547 msgid "LOAD..." msgstr "" #. saved game selection #: src/menus.c:556 msgid "CHOOSE A SAVE SLOT" msgstr "" #: src/menus.c:558 msgid "CHOOSE A LOAD SLOT" msgstr "" #. enter your name #: src/menus.c:562 msgid "ENTER YOUR NAME:" msgstr "" #. end level info #. TRANS: SIZE is the size of the player trail, PTS the #. number of PoinTS #: src/menus.c:568 msgid "SIZE PTS LIVES" msgstr "" #: src/menus.c:570 msgid "PTS LIVES" msgstr "" #. TRANS: this is for KILL'EM ALL mode, and MEN is the number #. of lemmings killed by one player #: src/menus.c:574 msgid " MEN PTS LIVES" msgstr "" #: src/menus.c:576 msgid "CA$H PTS LIVES" msgstr "" #: src/menus.c:578 msgid "COLORS PTS LIVES" msgstr "" #: src/menus.c:583 msgid "NEXT LEVEL" msgstr "" #. TRANS: this is a menu entry that introduce the user to another #. menu. This is NOT displayed DURING saving. #: src/menus.c:588 msgid "SAVE..." msgstr "" #: src/menus.c:593 msgid "PRESS RETURN" msgstr "" #: src/menus.c:602 msgid "WINS PTS LIVES" msgstr "" #. higher scores #: src/menus.c:613 msgid "HIGHER SCORES" msgstr "" #: src/menus.c:1231 #, c-format msgid "%d ROUND" msgid_plural "%d ROUNDS" msgstr[0] "" msgstr[1] "" #: src/menus.c:2220 #, c-format msgid "PLAYER %d, YOU CAME IN THE TOP 10" msgstr "" #: src/menus.c:2287 #, c-format msgid "PLAYER %d WON!" msgstr "" #: src/menus.c:2293 msgid "EVERYONE LOST!" msgstr "" #: src/menus.c:2295 msgid "YOU LOST!" msgstr "" #: src/menus.c:2374 #, c-format msgid "ROUND %d/%d" msgstr "" #: src/musicfiles.c:174 #, c-format msgid "%s:%d: missing alias name" msgstr "" #: src/musicfiles.c:176 #, c-format msgid "%s:%d: missing file name" msgstr "" #: src/musicfiles.c:178 #, c-format msgid "%s:%d: missing title" msgstr "" #: src/musicfiles.c:180 #, c-format msgid "%s:%d: missing author" msgstr "" #: src/pcx.c:53 #, c-format msgid "Cannot open %s" msgstr "" #: src/people.c:39 msgid "%{center}You owe this game to the following people" msgstr "" #: src/people.c:41 msgid "Authors\n" msgstr "" #: src/people.c:49 msgid "Contributors\n" msgstr "" #: src/people.c:56 msgid "Translators\n" msgstr "" #: src/people.c:59 src/people.c:74 msgid "German" msgstr "" #: src/people.c:62 msgid "Dutch" msgstr "" #: src/people.c:65 msgid "Brazilian Portuguese" msgstr "" #: src/people.c:68 msgid "Italian" msgstr "" #: src/people.c:71 msgid "French" msgstr "" #: src/people.c:78 msgid "Packagers\n" msgstr "" #: src/people.c:87 msgid "Porters\n" msgstr "" #: src/people.c:94 msgid "Other people we wish to thanks\n" msgstr "" #: src/readmake.c:188 #, c-format msgid "Unknown option '%c' for command '%s'." msgstr "" #: src/relocate.c:70 msgid "HOME variable not found in environment, defaulting to `.'" msgstr "" #: src/relocate.c:182 msgid "" "It looks like the game is not correctly installed.\n" "Maybe the data files have not been installed with the same configure " "options\n" "as the executable, or maybe the data files have been moved elsewhere.\n" "In the latter case it's probably enough to set the environment variable\n" "HEROES_PREFIX to the new location. You may also want to set\n" "HEROES_DEBUG=system to see what files Heroes is looking after.\n" "If none of this helps, contact \n" msgstr "" #: src/rsc_files.c:31 #, c-format msgid "%s: no such resource, possible misspelling of '%s'." msgstr "" #: src/rsc_files.c:34 #, c-format msgid "%s: no such resource." msgstr "" #: src/rsc_files.c:149 #, c-format msgid "%s: null resource" msgstr "" #: src/rsc_files.c:151 #, c-format msgid "%s: empty resource" msgstr "" #: src/savegame.c:90 src/scores.c:103 #, c-format msgid "cannot write %s" msgstr "" #: src/savegame.c:95 src/scores.c:107 #, c-format msgid "%s: truncate error" msgstr "" #: src/savegame.c:126 #, c-format msgid "%s:%d: parse error. Clearing saved-games table." msgstr "" #: src/scores.c:150 #, c-format msgid "%s:%d: parse error. Clearing score table." msgstr "" #: src/userconf.c:82 src/userconf.c:115 #, c-format msgid "%s:%d: missing variable name" msgstr "" #: src/userconf.c:107 #, c-format msgid "%s:%d: missing resource name" msgstr "" #: src/userconf.c:131 src/userconf.c:145 #, c-format msgid "%s:%d: %s: can only be used from the system configuration file" msgstr "" #: src/userconf.c:140 src/userconf.c:154 #, c-format msgid "%s:%d: %s: unknown value: %s" msgstr "" #: src/userconf.c:158 #, c-format msgid "%s:%d: unknown keyword `%s'" msgstr "" #: src/debughash.gperf:45 msgid "all messages" msgstr "" #: src/debughash.gperf:46 msgid "different parts of the game" msgstr "" #: src/debughash.gperf:47 msgid "system related messages" msgstr "" #: src/debughash.gperf:48 msgid "filename resources handling" msgstr "" #: src/debughash.gperf:49 msgid "files and directories handling" msgstr "" #: src/debughash.gperf:50 msgid "levels handling" msgstr "" #: src/debughash.gperf:51 msgid "sound track events" msgstr "" #: src/debughash.gperf:52 msgid "sound effects events" msgstr "" #: src/debughash.gperf:53 msgid "communication with the display driver" msgstr "" #: src/debughash.gperf:54 msgid "joystick initialization and events" msgstr "" #: src/debughash.gperf:55 msgid "timer handling" msgstr "" #: src/debughash.gperf:56 msgid "miscellaneous events" msgstr "" #: src/debughash.gperf:57 msgid "palette fade events" msgstr "" #: src/debughash.gperf:58 msgid "bonus" msgstr "" #: src/debughash.gperf:87 #, c-format msgid "%s: no such channel, assuming you meant '%s'." msgstr "" #: src/debughash.gperf:90 #, c-format msgid "%s: no such channel (--list=debug will list all known channels)" msgstr "" #: src/media/sfx.c:94 #, c-format msgid "" "Cannot open %s, disabling sound-effects\n" "(run with -X to supress this message)." msgstr "" #: src/media/sfx.c:260 #, c-format msgid "Unable to load sample %s" msgstr "" #: src/media/allegro/joystick.c:45 src/media/gii/joystick.c:109 #: src/media/sdl/joystick.c:50 msgid "No joystick found (run with `-J' to suppress this message)." msgstr "" #: src/media/dummy/strack.c:75 msgid "Heroes has been compiled without sound support." msgstr "" #. FIXME: ask to send a bug report with a trace #: src/media/ggi/video.c:174 msgid "failed to get any direct buffer for this visual" msgstr "" #. TRANS: a `visual' is associated by LibGGI to a display. You can #. actually call it a `display', this makes no big difference. #: src/media/ggi/video.c:196 msgid "failed to open visual." msgstr "" #: src/media/ggi/video.c:204 msgid "cannot setup a correct display." msgstr "" #: src/media/ggi/video.c:211 #, c-format msgid "negotiated video mode is too small (width=%d, height=%d)" msgstr "" #. TRANS: `display-memory' is the name of a LibGGI driver and #. make no sense to translate. #: src/media/ggi/video.c:224 msgid "Failed to open an internal `display-memory' visual." msgstr "" #: src/media/ggi/video.c:226 msgid "Failed to set 320x200x8 mode on display-memory" msgstr "" #: src/media/ggi/video.c:304 msgid "failed to acquire direct-buffer" msgstr "" #: src/media/ggi/video.c:321 msgid "failed to release direct-buffer" msgstr "" #: src/media/gii/joystick.c:96 #, c-format msgid "unexpected event %d\n" msgstr "" #: src/media/mikmod/strack.c:104 #, c-format msgid "" "Could not initialize sound, reason: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" #: src/media/mikmod/strack.c:114 msgid "" "Could not initialize sound, reason: LibMikMod is not thread safe.\n" "Disabling sound output (use -S to suppress this message)." msgstr "" #: src/media/mikmod/strack.c:149 src/media/sdl_mixer/strack.c:133 #, c-format msgid "Could not load %s, reason: %s" msgstr "" #: src/media/mikmod/strack.c:214 #, c-format msgid "LibMikMod version %ld.%ld.%ld\n" msgstr "" #: src/media/mikmod/strack.c:217 #, c-format msgid "" "\n" "Available drivers:\n" "%s\n" msgstr "" #: src/media/mikmod/strack.c:233 #, c-format msgid "" "Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information." msgstr "" #: src/media/sdl/video.c:114 #, c-format msgid "Failed to open visual: %s" msgstr "" #: src/media/sdl_mixer/strack.c:95 #, c-format msgid "" "Couldn't open audio: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" #: src/media/sdl_mixer/strack.c:171 msgid "" "Heroes has been compiled with SDL_mixer, there is no driver list available." msgstr "" #: src/media/sdl_mixer/strack.c:187 #, c-format msgid "%s: missing parameter for 'freq'" msgstr "" #: src/media/sdl_mixer/strack.c:193 #, c-format msgid "%s: missing parameter for `buffers'" msgstr "" #: src/media/sdl_mixer/strack.c:195 #, c-format msgid "%s: recognized sound options are freq=nnn and buffers=nnn" msgstr "" heroes-0.21/po/de.po0000644004117000411500000014070007451377057007767 # verdeutschlichte Meldungsdatei fuer Heroess. # Copyright 2000, 2001 Free Software Foundation, Inc. # Copyright is left from Hermann J. Beckers, beckers@st-oneline.de 2001. # msgid "" msgstr "" "Project-Id-Version: Heroes 0.17a\n" "POT-Creation-Date: 2002-03-30 18:44+0100\n" "PO-Revision-Date: 2001-12-15 12:17+0100\n" "Last-Translator: Ingo van Lil \n" "Language-Team: deutsch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: vim 5.6\n" #: lib/error.c:129 lib/error.c:157 msgid "Unknown system error" msgstr "Unbekannter Systemfehler" #: lib/getopt.c:694 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: Die Option `%s' ist nicht eindeutig\n" #: lib/getopt.c:719 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: Die Option `--%s' darf kein Argument haben.\n" #: lib/getopt.c:724 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: Die Option `%c%s' darf kein Argument haben.\n" #: lib/getopt.c:742 lib/getopt.c:915 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: Die Option `%s' erfordert ein Argument.\n" #. --option #: lib/getopt.c:771 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: Unbekannte Option: `--%s'\n" #. +option or -option #: lib/getopt.c:775 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: Unbekannte Option: `%c%s'\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:801 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: Ungültige Option: --%c\n" #: lib/getopt.c:804 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: Ungültige Option --%c\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:834 lib/getopt.c:964 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: Die Option erfordert ein Argument: --%c\n" #: lib/getopt.c:881 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: Die Option `-W %s' ist nicht eindeutig\n" #: lib/getopt.c:899 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: Die Option `-W %s' darf kein Argument haben.\n" #. If XALLOC_FAIL_FUNC is NULL, or does return, display this message #. before exiting when memory is exhausted. Goes through gettext. #: lib/xmalloc.c:66 msgid "memory exhausted" msgstr "Kein Speicher verfügbar" #: src/argv.c:60 #, c-format msgid "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux and Philippe Meisburger.\n" msgstr "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux und Philippe Meisburger.\n" #: src/argv.c:63 src/heroeslvl.c:64 msgid "" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." msgstr "" "Dieses Programm ist freie Software, die Sie unter bestimmten Bedingungen\n" "weitergeben dürfen. Details finden Sie im Quellcode.\n" "Die Veröffentlichung erfolgt OHNE JEDE GEWÄHRLEISTUNG - sogar ohne die\n" "implizite Gewährleistung der MARKTREIFE oder der EIGNUNG FÜR EINEN\n" "BESTIMMTEN ZWECK." #: src/argv.c:74 msgid "Use `-lWORD' or `--list=WORD' where WORD can be:" msgstr "Verwende `-lWORT' oder `--list=WORT', mit WORT ersetzt durch:" #: src/argv.c:76 msgid "display all debugging channels" msgstr "verfügbare Debug-Kanäle" #: src/argv.c:78 msgid "list all level files" msgstr "Liste aller Level-Dateien" #: src/argv.c:80 msgid "print the preferences settings" msgstr "Zeige Programmeinstellungen" #: src/argv.c:82 msgid "print the resources list" msgstr "Liste der verwendeten Datenfiles" #: src/argv.c:84 msgid "print the sound driver list" msgstr "verfügbare Soundtreiber" #: src/argv.c:86 msgid "print the sound track list" msgstr "Liste aller Musikstücke" #: src/argv.c:145 src/heroeslvl.c:74 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Rufe '%s --help' auf, um mehr Informationen zu bekommen.\n" #: src/argv.c:150 #, c-format msgid "" "Usage: %s [OPTIONS]...\n" "\n" msgstr "" "Aufruf: %s [OPTIONEN]...\n" "\n" #: src/argv.c:151 msgid "" "Heroes is a game similar to the \"Tron\" and \"Nibbles\" games of yore\n" "but includes many graphical improvements and new game features.\n" msgstr "" "Heroes ist ein Spiel, ähnlich \"Tron\" und \"Nibbles\" aus vergangenen " "Zeiten,\n" "enthält aber viele grafische Verbesserungen und neue Spielvarianten.\n" #: src/argv.c:154 src/heroeslvl.c:81 msgid "" "Mandatory arguments to long options are mandatory for short options too.\n" msgstr "" "Erforderliche Argumente für lange Optionen sind auch für kurze Optionen " "erforderlich.\n" #: src/argv.c:156 msgid "" "General options:\n" " -v, --version display version number\n" " -h, --help display this help\n" " -q, --quiet don't print warning messages\n" " -Q, --really-quiet don't even print error messages\n" " -v, --verbose=CHANNELS enable or disable debugging channels\n" " (see --list=debug for available channels)\n" " -l, --list=WORD show some internal information; WORD can be\n" " 'debug', 'resources', 'sound-drivers' or\n" " 'sound-tracks'\n" msgstr "" "Allgemeine Optionen:\n" " -v, --version Versionsnummer anzeigen\n" " -h, --help dieser Hilfetext\n" " -q, --quiet keine Warnungen anzeigen\n" " -Q, --really-quiet auch keine Fehlermeldungen anzeigen\n" " -v, --verbose=Kanäle de/aktiviere DEBUG-Kanäle\n" " (siehe --list=debug fuer verfügbare Kanäle)\n" " -l, --list=WORT zeige interne Informationen, für WORT\n" " kann 'debug', 'resources', 'sound-drivers'\n" " oder 'sound-tracks' eingesetzt werden.\n" #: src/argv.c:167 msgid "" "Sound options:\n" " -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:" "autodetect)\n" " (see --list=sound-drivers for available Ns)\n" " -S, --no-sound disable sound\n" " -X, --no-sfx disable sound-effects\n" " -m, --mono non-stereo output\n" " -8, --8bits 8bits sound output\n" " -i, --high-quality high quality mixer\n" msgstr "" "Sound-Optionen:\n" " -d, --driver=N[,OPTIONEN] benutze Nten Treiber für Sound\n" " (0: automatische Erkennung)\n" " (s. --list=sound-drivers für mögliche N)\n" " -S, --no-sound Klänge und Musik deaktivieren\n" " -X, --no-sfx Klangeffekte deaktivieren\n" " -m, --mono keine Stereo-Ausgabe\n" " -8, --8bits 8-Bit-Klang-Ausgabe\n" " -i, --high-quality Mixen in hoher Qualität\n" #: src/argv.c:176 msgid "" "Display options:\n" " -G, --gfx-options=OPTIONS pass OPTIONS to the display driver\n" " -F, --full-screen full screen mode\n" " -2, --double stretch the display twofold\n" " -3, --triple stretch the display threefold\n" " -4, --quadruple stretch the display fourfold\n" " -e, --even-lines display only even-lines\n" msgstr "" "Anzeige-Optionen:\n" " -G, --gfx-options=OPTIONEN OPTIONEN an den Bildschirmtreiber übergeben\n" " -F, --full-screen Vollbild-Modus\n" " -2, --double Anzeige doppelt strecken\n" " -3, --triple Anzeige dreifach strecken\n" " -4, --quadruple Anzeige vierfach strecken\n" " -e, --even-lines nur geradzahlige Linien anzeigen\n" #. TRANS: rotozoom is a graphical effect used in the demo of yore #. where the screen rotate and zoom (actually it doesn't zoom in Heroes); #. waves is another effect where the screen is agitated like some #. jelly (this was also called the `mushroom effect' in game like #. Death Rally). #: src/argv.c:189 msgid "" "Miscellaneous options:\n" " --cpu-off disable computer opponents\n" " --default-scores restore default scores file\n" " --default-options restore default options file\n" " --default-saves restore default saves file\n" " -s, --swap-sides swap sides in two player mode\n" " --no-double-fx disable combination of rotozoom and waves\n" " -g, --go skip the introduction\n" " -J, --no-joystick disable joystick handling\n" msgstr "" "Sonstige Optionen:\n" " --cpu-off Computergegner deaktivieren\n" " --default-scores Standard-Highscore-Datei wiederherstellen\n" " --default-options Standard-Options-Datei wiederherstellen\n" " --default-saves Standard-Sicherungs-Datei wiederherstellen\n" " -s, --swap-sides Seitentausch im 2-Spieler-Modus\n" " --no-double-fx Kombination von Roto-Zoom und Wellen " "deaktivieren\n" " -g, --go Einleitung überspringen\n" " -J, --no-joystick Joystick deaktivieren\n" #: src/argv.c:199 msgid "" "These options can be set in your file ~/.heroes/heroesrc (which is read\n" "before parsing other command line options) using a line like the following:\n" "\n" " Options: -gs -d3,buffer=11,count=4\n" msgstr "" "Diese Optionen können in der Datei ~/.heroes/heroesrc wie folgt\n" "gesetzt werden:\n" " Options: -gs -d3,buffer=11,count=4\n" "(Diese Datei wird vor den Befehlszeilenoptionen ausgewertet)\n" #: src/argv.c:204 msgid "" "Visit http://heroes.sourceforge.net/ for news, documentation, and updates." msgstr "" "Besuche http://heroes.sourceforge.net/ für Informationen, Dokumentation \n" "und Aktualisierungen." #: src/argv.c:206 src/heroeslvl.c:102 msgid "Report bugs to ." msgstr "Fehlermeldungen an ." #: src/argv.c:312 msgid "-n is an obsolete option, you should use --list=sound-drivers" msgstr "-n ist eine veraltete Option, benutze besser --list=sound-drivers" #: src/bonus.c:324 src/bonus.c:329 #, c-format msgid "SIZE IS %d" msgstr "LAENGE: %d" #: src/bonus.c:334 msgid "SPEEDED UP" msgstr "BESCHLEUNIGT" #: src/bonus.c:338 msgid "SPEEDED DOWN" msgstr "VERLANGSAMT" #: src/bonus.c:345 #, c-format msgid "GET %dPTS" msgstr "%d PUNKTE" #: src/bonus.c:350 msgid "FIRE TRAIL!" msgstr "FEUERSPUR!" #: src/bonus.c:364 msgid "GET TURBO+" msgstr "TURBO+" #: src/bonus.c:371 msgid "GET TURBO-" msgstr "TURBO-" #: src/bonus.c:379 msgid "INVINCIBLE!" msgstr "UNBESIEGBAR!" #: src/bonus.c:391 msgid "EXTRA-LIFE!" msgstr "EXTRA-LEBEN!" #: src/endscroll.c:113 msgid "THE END" msgstr "ENDE" #: src/fontdata.c:243 #, c-format msgid "character '%c' is not drawable (in message '%s')" msgstr "Zeichen '%c' (in Meldung '%s') kann nicht dargestellt werden" #: src/hedlite.c:1622 #, c-format msgid "Cannot create directory `%s'." msgstr "Kann Verzeicnis `%s' nicht anlegen." #: src/hedlite.c:1679 src/hedlite.c:1686 #, c-format msgid "%s: invalid level file" msgstr "%s: fehlerhafte Level-Datei" #: src/helptext.c:24 msgid "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "\n" "%{center}%pUse the arrow keys to scroll up and down.\n" "\n" "%{head 1}CONTROL & BOARD\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSE\n" "%{textat cR -9 97}%yQUIT GAME\n" "%{textat cR 26 -62}%yCONTROL\n" "%{textat cL 30 74}%ySTOP\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%ySCORE\n" "%{textat cR 1 8}%yCOMMENTARY\n" "%{textat cL 16 29}%yHEROES\n" "%{textat cL 33 29}%yWALLS\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yLIFES\n" "%{textat cL 51 -109}%yTURBO ENERGY\n" "%{textat cL 72 -104}%yTIME\n" "%{textat cR 96 40}%yPLAYER COLOR\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" msgstr "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "%{center}%pBenutze die Pfeiltasten zum Weiterlesen.\n" "\n" "%{head 1}STEUERUNG UND SPIELPLAN\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSE\n" "%{textat cR -9 97}%ySPIEL BEENDEN\n" "%{textat cR 26 -62}%ySTEUERUNG\n" "%{textat cL 30 74}%ySTOP\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%yPUNKTE\n" "%{textat cR 1 8}%yMELDUNGEN\n" "%{textat cL 16 29}%yHEROES\n" "%{textat cL 33 29}%yWÄNDE\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yLEBEN\n" "%{textat cL 51 -109}%yTURBO-ENERGIE\n" "%{textat cL 72 -104}%yZEIT\n" "%{textat cR 96 40}%ySPIELER-FARBEN\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" #: src/helptext.c:71 msgid "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Affects the player that gets the item\n" "%{img L 60 22 20 22}Affects all players except the one who gets the bonus\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points\n" "%{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions\n" "\n" msgstr "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Wirkt auf den Spieler, der den Bonus einsammelt\n" "%{img L 60 22 20 22}Wirkt auf alle Spieler außer dem, der es sammelt\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Länge +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Länge -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Schneller\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Langsamer\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Zufalls-Bonus\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Punkte\n" "%{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Feuer-Spur\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Invertierte Steuerung\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Energie +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Energie -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}Level-Ende\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Unbesiegbarkeit\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra-Leben\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Welleneffekt\n" "\n" #: src/helptext.c:99 msgid "" "%{head 3}GAME MODES\n" "\n" "%{>>}%yQUEST\n" "\n" "%{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers " "you. Your aim is to collect a given number (10) of Trail+1 bonuses and then " "to get the End-of-Level bonus that will send you to next level.\n" "%{>>>}%{img L 20 176 20 22}End-of-Level\n" "%{img R 0 0 20 22}%{flushright}Trail+1\n" "%{>>>}Trail+1 has the effect of growing your trail. There are two way to " "get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first " "appears when someone's trail reach 10 units.\n" "\n" "%{>>}%yDEATH MATCH\n" "\n" "%{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a " "fight to death. The aim of the game is to be the last player still alive. " "For this, feel free to use any stratagems you want. Nothing is forbidden.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL\n" "\n" "%{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm " "all the people of your competitors. It was said \"There can be only one\", " "make sure it is yours!\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}They are among us, find them !\n" "\n" "%{>>}%yCOLOR\n" "\n" "%{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time " "to get a maximum of gems of your color. Beware, if you go over your " "competitor's gems, it's your competitor's gem account that you will " "increase. Be also sure not to get crossed gems because you'll lose " "collected gems. Grey ones gives gems to all players except the one that " "goes over it. The Clocks give you extra time.\n" "\n" "%{>>}%yTIME CA$H\n" "\n" "%{>>>}In %yTIME CA$H%w mode the winner is the player who collected the " "largest amount of money.\n" "\n" msgstr "" "%{head 3}Spiel-Modi\n" "\n" "%{>>}%yQUEST\n" "\n" "%{>>>}Der %yQUEST%w-Modus erlaubt Dir, alle 100 von HEROES angebotenen Level " "zu spielen. Du mußt eine bestimmte Anzahl (10) von Länge+1 Bonusobjekten und " "dann den Level-Ende-Bonus erreichen, der Dich zum nächsten Level bringt.\n" "%{>>>}%{img L 20 176 20 22}Level-Ende\n" "%{img R 0 0 20 22}%{flushright}Länge+1\n" "%{>>>}Länge+1 verlängert Deine Spur. Zum Verkleinern gibt es zwei " "Möglichkeiten: Nimm ein \"Länge-1\" oder verliere ein Leben. Der Level-Ende-" "Bonus erscheint erst, wenn ein Spieler eine Spurlänge von zehn Einheiten " "erreicht.\n" "\n" "%{>>}%yDEATH MATCH\n" "\n" "%{>>>}Der %yDEATH MATCH%w-Modus erlaubt Dir, Dich anderen Spielern in einem " "Kampf auf Leben und Tod zu stellen. Ziel ist es, der letzte überlebende " "Spieler zu sein. Dabei kannst Du jede beliebige Strategie anwenden, nichts " "ist verboten.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL\n" "\n" "%{>>>}Der %yKILL THEM ALL%w-Modus hat nur eine einzige Regel: Du mußt alle " "Lemminge Deiner Gegner erledigen. Einst wurde gesagt: \"Es kann nur einen " "geben\". Stelle sicher, daß er Dir gehört!\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}Sie sind unter uns, finde sie!\n" "\n" "%{>>}%yCOLOR\n" "\n" "%{>>>}Der %yCOLOR%w-Modus ist sehr einfach. Du hast eine bestimmte Zeit, um " "möglichst viele Perlen Deiner Farbe zu sammeln. Vorsicht: Wenn Du Perlen " "Deiner Gegner einsammelst, werden sie deren Konto gutgeschrieben. Sei " "vorsichtig, keine durchgestrichenen Perlen aufzunehmen, denn sonst verlierst " "Du bereits gesammelte Perlen. Graue erhöhen den Stand aller Spieler, außer " "desjenigen, der sie sammelt. Uhren geben Dir ein wenig mehr Zeit.\n" "\n" "%{>>}%yTIME CA$H\n" "\n" "%{>>>}Im %yTIME CA$H%w-Modus gewinnt der Spieler, der den größten Geldbetrag " "einsammelt.\n" "\n" #: src/helptext.c:145 msgid "" "%{head 4}GAME OPTIONS\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gCOLOR SELECT\n" "\n" "%{>>>}This option allows you to choose the color of your vehicle between %" "pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gGAME SPEED\n" "\n" "%{>>>}The %gGAME SPEED%w option allows you to select the initial speed of " "the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gROUNDS\n" "\n" "%{>>>}The %gROUNDS%w option allows you to select the number of rounds in the " "tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. These " "values range from 1 to 100 rounds.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMATION\n" "\n" "%{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better " "visibility.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gLIGHTING\n" "\n" "%{>>>}The %gLIGHTING%w option is here to tune the luminosity of your " "screen.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gINERTIA\n" "\n" "%{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOT\n" "\n" "%{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, rest in " "peace... Note that %gAUTOPILOT%w does not work against fire trails.\n" "\n" msgstr "" "%{head 4}SPIEL-OPTIONEN\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gFARBAUSWAHL\n" "\n" "%{>>>}Diese Option erlaubt Dir, die Farbe Deines Vehikels aus %pVIOLETT%w, %" "yGELB%w, %bBLAU%w und %gGRÜN%w zu wählen.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gSPIELGESCHWINDIGKEIT\n" "\n" "%{>>>}Die %gGESCHWINDIGKEIT%ws-Option erlaubt es, Deine Anfangs- " "geschwindigkeit festzulegen. Die drei verfügbaren Stufen sind für " "NORMALSTERBLICHE, EXPERTEN und HEROES geeignet.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gRUNDEN\n" "\n" "%{>>>}Die %gRUNDEN%w-Option setzt die Anzahl der Durchgänge für die " "Spielmodi DEATH MATCH, KILL'EM ALL, COLOR und TIME CA$H. Zulässig sind Werte " "zwischen 1 und 100.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMATION\n" "\n" "%{>>>}Für mehr Übersichtlichkeit können %gRADAR%w- und %gINFORMATION%ws- " "Fenster deaktiviert werden.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gHELLIGKEIT\n" "\n" "%{>>>}Mit der %gHELLIGKEIT%ws-Option kann die Leuchtstärke der " "Bildschirmanzeige geregelt werden.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gTRÄGHEIT\n" "\n" "%{>>>}Die %gTRÄGHEIT%ws-Option schaltet den Trägheitseffekt beim Rollen der " "Anzeige ein oder aus.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOT\n" "\n" "%{>>>}Wenn Du verrückt bist, kannst Du versuchen, ohne %gAUTOPILOT%w zu " "spielen! Ruhe in Frieden... Achtung: Der Autopilot schützt nicht vor Feuer-" "Spuren.\n" "\n" #: src/helptext.c:191 msgid "" "%{head 1}CONTACT\n" "\n" "%{center}home page:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}send bug reports to:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" msgstr "" "%{head 1}Kontaktadressen\n" "\n" "%{center}Webseite:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}Fehlermeldungen bitte an:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" #: src/helptext.c:204 msgid "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's " "environmental and ecological issues and did our best to use only recycled " "bytes in this program.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux and Philippe Meisburger.\n" "\n" msgstr "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} Im Interesse unserer Umwelt sind " "wir stets bemüht, nur recyclete Bytes bei der Erstellung dieses Programmes " "zu verwenden.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux und Philippe Meisburger.\n" "\n" #: src/heroes.c:677 src/heroes.c:763 #, c-format msgid "Cannot load level %s (error %d)" msgstr "Kann Level %s nicht laden (Fehler %d)" #: src/heroes.c:1969 #, c-format msgid "INVERTED %d" msgstr "INVERTIERT %d" #: src/heroes.c:2003 #, c-format msgid "STOPPED %d" msgstr "GESTOPPT %d" #. TRANS: %d, the number of remaining lives, is always #. positive. #: src/heroes.c:2300 msgid "LAST LIFE" msgid_plural "%d LIVES LEFT" msgstr[0] "LETZTES LEBEN" msgstr[1] "NOCH %d LEBEN" #: src/heroes.c:2873 msgid "Error during level loading" msgstr "Fehler beim Laden des Levels" #: src/heroes.c:2909 #, c-format msgid "-LEVEL %d-" msgstr "-LEVEL %d-" #: src/heroes.c:2911 #, c-format msgid "-ROUND %d/%d-" msgstr "-RUNDE %d/%d-" #: src/heroes.c:3416 msgid "error in sfx.cfg" msgstr "Fehler in sfx.cfg" #: src/heroeslvl.c:63 #, c-format msgid "Copyright (C) %d Alexandre Duret-Lutz.\n" msgstr "" #: src/heroeslvl.c:79 #, c-format msgid "" "Usage: %s [OPTIONS]... levels\n" "\n" msgstr "" "Aufruf: %s [OPTIONEN]... Level\n" "\n" #: src/heroeslvl.c:80 msgid "Heroeslvl is a tool used to inspect Heroes' level files.\n" msgstr "Heroeslvl ist ein Tool, um Heroes-Leveldateien zu betrachten.\n" #: src/heroeslvl.c:83 msgid " -v, --version display version number" msgstr " -v, --version Versionsnummer anzeigen" #: src/heroeslvl.c:85 msgid " -h, --help display this help" msgstr " -h, --help dieser Hilfetext" #: src/heroeslvl.c:87 msgid "" " -p, --print=WHAT select information to display. WHAT should " "be\n" " one or more of these characters:" msgstr "" " -p, --print=WAS anzuzeigende Information auswählen. WAS " "sollte\n" " eines oder mehrere dieser Zeichen enthalten: " #: src/heroeslvl.c:90 msgid "d print square directions" msgstr "d Feldrichtungen" #: src/heroeslvl.c:91 msgid "f print filename" msgstr "f Dateiname" #: src/heroeslvl.c:92 msgid "h print header" msgstr "h Kopfzeilen" #: src/heroeslvl.c:93 msgid "i print tile details" msgstr "i Feld-Details" #: src/heroeslvl.c:94 msgid "t print square type map" msgstr "t Karte der Feldtypen" #: src/heroeslvl.c:95 msgid "T print type keys" msgstr "T Legende für Feldtypenkarte" #: src/heroeslvl.c:96 msgid "w print square wall map" msgstr "w Karte der Wandtypen" #: src/heroeslvl.c:97 msgid "@ print tunnels" msgstr "@ Liste aller Tunnels" #: src/heroeslvl.c:98 msgid " -i, --indent indent everything but the filename" msgstr " -i, --indent alles außer Dateiname einrücken" #: src/heroeslvl.c:101 msgid "When no options are given, the default is -ipfh." msgstr "Ohne Angabe von Optionen wird standardmäßig -ipfh verwendet." #: src/heroeslvl.c:201 #, c-format msgid "%sheight:\t%d tiles\t(%d squares)\n" msgstr "%sHöhe:\t%d Blöcke\t(%d Felder)\n" #: src/heroeslvl.c:203 #, c-format msgid "%swidth:\t%d tiles\t(%d squares)\n" msgstr "%sBreite:\t%d Blöcke\t(%d Felder)\n" #: src/heroeslvl.c:206 #, c-format msgid "%sY-wrap:\tno\n" msgstr "%sY-Umlauf:\tnein\n" #: src/heroeslvl.c:208 #, c-format msgid "%sY-wrap:\t%d tiles\t(%d squares)\n" msgstr "%sY-Umlauf:\t%d Blöcke\t(%d Felder)\n" #: src/heroeslvl.c:211 #, c-format msgid "%sX-wrap:\tno\n" msgstr "%sX-Umlauf:\tnein\n" #: src/heroeslvl.c:213 #, c-format msgid "%sX-wrap:\t%d tiles\t(%d squares)\n" msgstr "%sX-Umlauf:\t%d Blöcke\t(%d Felder)\n" #: src/heroeslvl.c:215 #, c-format msgid "%ssound track alias:\t%s\n" msgstr "%sHintergrundmusik:\t%s\n" #: src/heroeslvl.c:217 #, c-format msgid "%stile map basename:\t%s\n" msgstr "%sFeldtypen-Datei:\t%s\n" #: src/heroeslvl.c:219 #, c-format msgid "%sstarting squares and directions (y x dir):\n" msgstr "%sStartfelder und -richtungen (y, x, Richtung):\n" #: src/heroeslvl.c:261 msgid "none" msgstr "normal" #: src/heroeslvl.c:262 msgid "stop" msgstr "Stop" #: src/heroeslvl.c:263 msgid "speed" msgstr "Tempo" #: src/heroeslvl.c:264 msgid "tunnel" msgstr "Tunnel" #: src/heroeslvl.c:265 msgid "boom" msgstr "explosiv" #: src/heroeslvl.c:266 msgid "anim" msgstr "animiert" #: src/heroeslvl.c:267 msgid "ice" msgstr "Eis" #: src/heroeslvl.c:268 msgid "dust" msgstr "Staub" #: src/heroeslvl.c:269 msgid "outway" msgstr "außerhalb" #: src/heroeslvl.c:389 #, c-format msgid "%sTunnels:\n" msgstr "%sTunnel:\n" #. TRANS: This is the header of an array (output by heroeslvl -p@), #. so the position of these words is important. #. #. SRCIDX is a short for 'source index' (entrance of a tunnel) and #. DESTIDX means 'destination index' (output of the tunnel). #: src/heroeslvl.c:395 #, c-format msgid "%s NBR SRCIDX Y X DIR DESTIDX\n" msgstr "%s NR START Y X RICHTUNG ZIEL\n" #. TRANS: `still' is used to describe tiles which are not animated. #: src/heroeslvl.c:426 msgid "still" msgstr "Standbild" #. TRANS: `loop' is for animated tiles where frames are displayed #. from 1 to n, and then again from 1 to n, etc. #: src/heroeslvl.c:430 msgid "loop" msgstr "Schleife" #. TRANS: `pingpong' is for tiles animated in loop where frame #. displayed from 1 to n, then from n to 1, and then again from 1 #. to n, etc. #: src/heroeslvl.c:435 msgid "pingpong" msgstr "Pingpong" #. TRANS: This is the header of an array (output by heroeslvl -pi) so #. the position of these word is important. #. #. SPRITE is the address of the sprite used to render the tile. OVERLAY #. is the address of a sprite that should be displayed on top #. of the players (e.g. trees). ANIM-TYPE is the kind of animation used #. for the tile, FRM the number of frame to display, DEL the delay #. between each frame. #: src/heroeslvl.c:453 #, c-format msgid "%sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL\n" msgstr "%sBLOCK Y X TYP SPRITE OVERLAY ANIMATION ANZ VERZ\n" #: src/heroeslvl.c:503 #, c-format msgid "cannot load %s" msgstr "Kann %s nicht öffnen" #: src/heroeslvl.c:507 #, c-format msgid "File:\t%s\n" msgstr "Datei:\t%s\n" #: src/heroeslvl.c:539 msgid "Missing filename." msgstr "fehlender Dateiname." #: src/levellst.c:53 #, c-format msgid "cannot open directory %s" msgstr "Kann Verzeicnis '%s' nicht öffnen." #. TRANS: in QUEST mode, the player goes throught all the levels, but #. have to search for specific powerups in order to jump to the next #. level. Hence this is a `quest' for those powerups. #: src/menus.c:146 msgid "QUEST" msgstr "QUEST" #. TRANS: in DEATH MATCH mode, the user has to kill all other players. #: src/menus.c:148 msgid "DEATH MATCH" msgstr "DEATH MATCH" #. TRANS: in KILL'EM ALL mode there are lemmings moving on the ground #. and the player must run over them all. You may want to translate #. `kill' as `run over', `squash', `mash' or something among those #. lines. #: src/menus.c:153 msgid "KILL'EM ALL" msgstr "KILL'EM ALL" #. TRANS: in TIME CA$H mode, the player must collect dollars with #. restricted time. #: src/menus.c:156 msgid "TIME CA$H" msgstr "TIME CA$H" #. TRANS: in COLOR mode, the player must collect some colored gems #. with restricted time. #: src/menus.c:159 msgid "COLORS" msgstr "COLORS" #: src/menus.c:192 msgid "GAME" msgstr "SPIEL" #: src/menus.c:193 msgid "SCREEN" msgstr "ANZEIGE" #: src/menus.c:194 msgid "SOUND" msgstr "SOUND" #: src/menus.c:195 msgid "CONTROL" msgstr "STEUERUNG" #: src/menus.c:196 msgid "KEYS" msgstr "TASTEN" #: src/menus.c:197 msgid "EXTRAS" msgstr "EXTRAS" #: src/menus.c:198 src/menus.c:222 src/menus.c:385 src/menus.c:395 #: src/menus.c:409 src/menus.c:421 src/menus.c:431 src/menus.c:454 #: src/menus.c:545 msgid "GO BACK" msgstr "ZURÜCK" #. play menu #: src/menus.c:205 src/menus.c:539 msgid "PLAY" msgstr "SPIELEN" #. options menu #: src/menus.c:206 src/menus.c:526 msgid "OPTIONS" msgstr "OPTIONEN" #: src/menus.c:207 src/menus.c:406 msgid "INFOS" msgstr "INFOS" #: src/menus.c:208 msgid "CREDITS" msgstr "CREDITS" #: src/menus.c:209 msgid "SCORES" msgstr "HIGHSCORE" #. editor first menu #: src/menus.c:210 src/menus.c:536 msgid "EDITOR" msgstr "EDITOR" #: src/menus.c:211 msgid "QUIT" msgstr "BEENDEN" #. TRANS: Create a new level. #: src/menus.c:219 src/menus.c:503 msgid "NEW LEVEL" msgstr "NEUER LEVEL" #. TRANS: Load an existing level for edition. #: src/menus.c:221 msgid "LOAD LEVEL" msgstr "LADE LEVEL" #: src/menus.c:375 msgid "CONTROL OPTIONS" msgstr "STEUERUNG" #. 1st player #: src/menus.c:377 src/menus.c:416 src/menus.c:433 msgid "PLAYER 1" msgstr "SPIELER 1" #: src/menus.c:379 src/menus.c:383 msgid "AUTO PILOT" msgstr "AUTO-PILOT" #. 2nd player #: src/menus.c:381 src/menus.c:417 src/menus.c:441 msgid "PLAYER 2" msgstr "SPIELER 2" #: src/menus.c:391 msgid "SOUND OPTIONS" msgstr "SOUND-OPTIONEN" #: src/menus.c:393 msgid "MUSIC" msgstr "MUSIK" #: src/menus.c:394 msgid "SFX" msgstr "EFFEKTE" #: src/menus.c:398 msgid "MUSIC VOL" msgstr "LAUTST." #: src/menus.c:399 msgid "SFX VOL" msgstr "LAUTST." #: src/menus.c:403 msgid "SCREEN OPTIONS" msgstr "ANZEIGE-OPTIONEN" #: src/menus.c:405 msgid "RADAR" msgstr "RADAR" #: src/menus.c:407 msgid "LIGHTING" msgstr "HELLIGKEIT" #: src/menus.c:408 msgid "INERTIA" msgstr "TRÄGHEIT" #: src/menus.c:414 msgid "GAME OPTIONS" msgstr "SPIEL-OPTIONEN" #: src/menus.c:418 msgid "PLAYER 3" msgstr "SPIELER 3" #: src/menus.c:419 msgid "PLAYER 4" msgstr "SPIELER 4" #: src/menus.c:420 msgid "SPEED" msgstr "GESCHW." #: src/menus.c:429 msgid "KEYBOARD DEFS" msgstr "TASTENBELEGUNG" #: src/menus.c:434 src/menus.c:442 msgid "UP" msgstr "HOCH" #: src/menus.c:435 src/menus.c:443 msgid "LEFT" msgstr "LINKS" #: src/menus.c:436 src/menus.c:444 msgid "DOWN" msgstr "RUNTER" #: src/menus.c:437 src/menus.c:445 msgid "RIGHT" msgstr "RECHTS" #: src/menus.c:438 src/menus.c:446 msgid "TURBO" msgstr "TURBO" #: src/menus.c:439 src/menus.c:447 msgid "STOP" msgstr "STOP" #: src/menus.c:452 msgid "EXTRAS LEVELS" msgstr "EXTRA-LEVEL" #: src/menus.c:456 msgid "ORIGINAL LEVELS" msgstr "ORIGINAL-LEVEL" #: src/menus.c:458 msgid "ORIGINAL+EXTRAS" msgstr "ORIGINAL+EXTRAS" #: src/menus.c:460 msgid "EXTRAS ONLY" msgstr "NUR EXTRAS" #: src/menus.c:462 msgid "EXTRAS: NONE" msgstr "EXTRAS: KEINE" #: src/menus.c:464 msgid "EXTRAS: ALL" msgstr "EXTRAS: ALLE" #: src/menus.c:466 msgid "EXTRAS: SELECT" msgstr "EXTRAS: AUSWAHL" #. pause menu #: src/menus.c:491 msgid "PAUSE" msgstr "PAUSE" #. quit y/n menus #: src/menus.c:495 msgid "QUIT THIS GAME?" msgstr "SPIEL BEENDEN?" #: src/menus.c:497 msgid "REALLY QUIT?" msgstr "WIRKLICH BEENDEN?" #: src/menus.c:499 msgid "NO" msgstr "NEIN" #: src/menus.c:500 msgid "YES" msgstr "JA" #: src/menus.c:505 msgid "EXISTING LEVEL" msgstr "BESTEHENDER LEVEL" #: src/menus.c:507 msgid "NAME" msgstr "NAME" #. TRANS: in wrapped levels are unbounded level, e.g. whenever the #. player reach the left border it continue its way from the right border #. (except that the player doesn't even know there are borders, because #. the level is tiled infinitely). In unwrapped levels there are explicit #. bounds that you cannot cross. X-WRAP is a check box used to specified #. whether a level must be wrapped horizontally or not when creating a #. new level. #: src/menus.c:515 msgid "X-WRAP" msgstr "X-UMLAUF" #. TRANS: Y-WRAP is a check box used to specified whether a level #. must be wrapped vertically or not. #: src/menus.c:518 msgid "Y-WRAP" msgstr "Y-UMLAUF" #. TRANS: width of the level #: src/menus.c:520 msgid "X-SIZE" msgstr "BREITE" #. TRANS: height of the level #: src/menus.c:522 msgid "Y-SIZE" msgstr "HÖHE" #: src/menus.c:523 msgid "EDIT" msgstr "EDIT" #. main menu #: src/menus.c:529 msgid "HEROES" msgstr "HEROES" #. editor selector #: src/menus.c:532 msgid "SELECT A LEVEL" msgstr "LEVEL WÄHLEN" #: src/menus.c:541 msgid "ONE PLAYER" msgstr "EIN SPIELER" #: src/menus.c:543 msgid "TWO PLAYERS" msgstr "ZWEI SPIELER" #: src/menus.c:547 msgid "LOAD..." msgstr "LADE..." #. saved game selection #: src/menus.c:556 msgid "CHOOSE A SAVE SLOT" msgstr "SICHERUNGS-PLATZ WÄHLEN" #: src/menus.c:558 msgid "CHOOSE A LOAD SLOT" msgstr "LADE-PLATZ WÄHLEN" #. enter your name #: src/menus.c:562 msgid "ENTER YOUR NAME:" msgstr "NAME EINGEBEN:" #. end level info #. TRANS: SIZE is the size of the player trail, PTS the #. number of PoinTS #: src/menus.c:568 msgid "SIZE PTS LIVES" msgstr "LÄNGE PKT LEBEN" #: src/menus.c:570 msgid "PTS LIVES" msgstr "PKT LEBEN" #. TRANS: this is for KILL'EM ALL mode, and MEN is the number #. of lemmings killed by one player #: src/menus.c:574 msgid " MEN PTS LIVES" msgstr " LEM PKT LEBEN" #: src/menus.c:576 msgid "CA$H PTS LIVES" msgstr "GELD PKT LEBEN" #: src/menus.c:578 msgid "COLORS PTS LIVES" msgstr "FARBEN PKT LEBEN" #: src/menus.c:583 msgid "NEXT LEVEL" msgstr "NÄCHSTER LEVEL" #. TRANS: this is a menu entry that introduce the user to another #. menu. This is NOT displayed DURING saving. #: src/menus.c:588 msgid "SAVE..." msgstr "SPEICHERN..." #: src/menus.c:593 msgid "PRESS RETURN" msgstr "DRÜCKE ENTER" #: src/menus.c:602 msgid "WINS PTS LIVES" msgstr "SIEGE PKT LEBEN" #. higher scores #: src/menus.c:613 msgid "HIGHER SCORES" msgstr "DIE CHAMPIONS" #: src/menus.c:1231 #, c-format msgid "%d ROUND" msgid_plural "%d ROUNDS" msgstr[0] "%d RUNDE" msgstr[1] "%d RUNDEN" #: src/menus.c:2220 #, c-format msgid "PLAYER %d, YOU CAME IN THE TOP 10" msgstr "SPIELER %d, DU HAST DIE TOP 10 ERREICHT" #: src/menus.c:2287 #, c-format msgid "PLAYER %d WON!" msgstr "SPIELER %d GEWINNT!" #: src/menus.c:2293 msgid "EVERYONE LOST!" msgstr "ALLE HABEN VERLOREN!" #: src/menus.c:2295 msgid "YOU LOST!" msgstr "DU HAST VERLOREN!" #: src/menus.c:2374 #, c-format msgid "ROUND %d/%d" msgstr "RUNDE %d/%d" #: src/musicfiles.c:174 #, c-format msgid "%s:%d: missing alias name" msgstr "%s:%d: fehlender Alias-Name" #: src/musicfiles.c:176 #, c-format msgid "%s:%d: missing file name" msgstr "%s:%d: fehlender Dateiname" #: src/musicfiles.c:178 #, c-format msgid "%s:%d: missing title" msgstr "%s:%d: Titel fehlt" #: src/musicfiles.c:180 #, c-format msgid "%s:%d: missing author" msgstr "%s:%d: Autor fehlt" #: src/pcx.c:53 #, c-format msgid "Cannot open %s" msgstr "Kann %s nicht öffnen" #: src/people.c:39 msgid "%{center}You owe this game to the following people" msgstr "%{center}Dieses Spiel verdankst Du folgenden Leuten" #: src/people.c:41 msgid "Authors\n" msgstr "Autoren\n" #: src/people.c:49 msgid "Contributors\n" msgstr "Beitragende\n" #: src/people.c:56 msgid "Translators\n" msgstr "Übersetzer\n" #: src/people.c:59 src/people.c:74 msgid "German" msgstr "Deutsch" #: src/people.c:62 msgid "Dutch" msgstr "Niederländisch" #: src/people.c:65 msgid "Brazilian Portuguese" msgstr "" #: src/people.c:68 msgid "Italian" msgstr "Italienisch" #: src/people.c:71 msgid "French" msgstr "Französisch" #: src/people.c:78 msgid "Packagers\n" msgstr "Programmpakete\n" #: src/people.c:87 msgid "Porters\n" msgstr "Portierungen\n" #: src/people.c:94 msgid "Other people we wish to thanks\n" msgstr "Weitere Personen, denen Dank gebührt\n" #: src/readmake.c:188 #, c-format msgid "Unknown option '%c' for command '%s'." msgstr "Unbekannte Option '%c' für Kommando '%s'." #: src/relocate.c:70 msgid "HOME variable not found in environment, defaulting to `.'" msgstr "Variable HOME nicht gesetzt, Standardwert `.'." #: src/relocate.c:182 msgid "" "It looks like the game is not correctly installed.\n" "Maybe the data files have not been installed with the same configure " "options\n" "as the executable, or maybe the data files have been moved elsewhere.\n" "In the latter case it's probably enough to set the environment variable\n" "HEROES_PREFIX to the new location. You may also want to set\n" "HEROES_DEBUG=system to see what files Heroes is looking after.\n" "If none of this helps, contact \n" msgstr "" "Anscheinend wurde das Spiel nicht korrekt installiert.\n" "Eventuell wurden die Datenfiles nicht mit den selben configure-Optionen\n" "wie die Programmdateien installiert, oder sie wurden an eine andere\n" "Stelle verschoben.\n" "Im letzteren Fall ist es wahrscheinlich ausreichend, die Umgebungsvariable\n" "HEROES_PREFIX auf die neue Position zu setzen. Eine weitere Möglichkeit\n" "ist es, HEROES_DEBUG=system zu setzen, um zu sehen, an welcher StelleHeroes " "danach sucht.\n" "Wenn alles nicht hilft, kontaktiere \n" #: src/rsc_files.c:31 #, c-format msgid "%s: no such resource, possible misspelling of '%s'." msgstr "%s: keine bekannte Ressource, vielleicht Tippfehler bei '%s'." #: src/rsc_files.c:34 #, c-format msgid "%s: no such resource." msgstr "%s: Ressource unbekannt." #: src/rsc_files.c:149 #, c-format msgid "%s: null resource" msgstr "%s: Null-Ressource" #: src/rsc_files.c:151 #, c-format msgid "%s: empty resource" msgstr "%s: Ressource leer" #: src/savegame.c:90 src/scores.c:103 #, c-format msgid "cannot write %s" msgstr "Kann %s nicht öffnen" #: src/savegame.c:95 src/scores.c:107 #, c-format msgid "%s: truncate error" msgstr "%s: Fehler beim Abschneiden" #: src/savegame.c:126 #, c-format msgid "%s:%d: parse error. Clearing saved-games table." msgstr "%s:%d: Parser-Fehler. Lösche Savegame-Tabelle." #: src/scores.c:150 #, c-format msgid "%s:%d: parse error. Clearing score table." msgstr "%s:%d: Parser-Fehler. Lösche Highscore-Tabelle." #: src/userconf.c:82 src/userconf.c:115 #, c-format msgid "%s:%d: missing variable name" msgstr "%s:%d: Variablenname fehlt" #: src/userconf.c:107 #, c-format msgid "%s:%d: missing resource name" msgstr "%s:%d: Ressourcen-Name fehlt" #: src/userconf.c:131 src/userconf.c:145 #, c-format msgid "%s:%d: %s: can only be used from the system configuration file" msgstr "%s:%d: %s: Kann nur in globaler Config-Datei verwendet werden." #: src/userconf.c:140 src/userconf.c:154 #, c-format msgid "%s:%d: %s: unknown value: %s" msgstr "%s:%d: %s: unbekannter Wert: `%s'" #: src/userconf.c:158 #, c-format msgid "%s:%d: unknown keyword `%s'" msgstr "%s:%d: unbekanntes Schlüsselwort `%s'" #: src/debughash.gperf:45 msgid "all messages" msgstr "Alle Meldungen" #: src/debughash.gperf:46 msgid "different parts of the game" msgstr "verschiedene Teile des Spieles" #: src/debughash.gperf:47 msgid "system related messages" msgstr "Systembezogene Meldungen" #: src/debughash.gperf:48 msgid "filename resources handling" msgstr "Dateinamen-Behandlung" #: src/debughash.gperf:49 msgid "files and directories handling" msgstr "Datei- und Verzeichnisbehandlung" #: src/debughash.gperf:50 msgid "levels handling" msgstr "Levelbehandlung" #: src/debughash.gperf:51 msgid "sound track events" msgstr "Musik-Ereignisse" #: src/debughash.gperf:52 msgid "sound effects events" msgstr "Klangeffekt-Ereignisse" #: src/debughash.gperf:53 msgid "communication with the display driver" msgstr "Kommunikation mit dem Bildschirmtreiber" #: src/debughash.gperf:54 msgid "joystick initialization and events" msgstr "Joystick-Initialisierung und -Ereignisse" #: src/debughash.gperf:55 msgid "timer handling" msgstr "Zeitgeber-Behandlung" #: src/debughash.gperf:56 msgid "miscellaneous events" msgstr "sonstige Ereignisse" #: src/debughash.gperf:57 msgid "palette fade events" msgstr "Palettenblende-Effekte" #: src/debughash.gperf:58 msgid "bonus" msgstr "Bonus-Ereignisse" #: src/debughash.gperf:87 #, c-format msgid "%s: no such channel, assuming you meant '%s'." msgstr "%s: Kein solcher Kanal, ich vermute, Du meinst '%s'." #: src/debughash.gperf:90 #, c-format msgid "%s: no such channel (--list=debug will list all known channels)" msgstr "%s: Kein solcher Kanal (--list=debug listet alle verfügbaren Kanäle)" #: src/media/sfx.c:94 #, c-format msgid "" "Cannot open %s, disabling sound-effects\n" "(run with -X to supress this message)." msgstr "" "Kann %s nicht öffnen, Sound deaktiviert.\n" "(-X unterdrückt diese Meldung)." #: src/media/sfx.c:260 #, c-format msgid "Unable to load sample %s" msgstr "Kann Sample %s nicht laden" #: src/media/allegro/joystick.c:45 src/media/gii/joystick.c:109 #: src/media/sdl/joystick.c:50 msgid "No joystick found (run with `-J' to suppress this message)." msgstr "Kein Joystick gefunden (-J unterdrückt diese Meldung)" #: src/media/dummy/strack.c:75 msgid "Heroes has been compiled without sound support." msgstr "Heroes wurde ohne Sound-Unterstützung compiliert." #. FIXME: ask to send a bug report with a trace #: src/media/ggi/video.c:174 msgid "failed to get any direct buffer for this visual" msgstr "Konnte keinen Direkt-Puffer fuer dieses Visual bekommen" #. TRANS: a `visual' is associated by LibGGI to a display. You can #. actually call it a `display', this makes no big difference. #: src/media/ggi/video.c:196 msgid "failed to open visual." msgstr "Konnte Visual nicht öffnen" #: src/media/ggi/video.c:204 msgid "cannot setup a correct display." msgstr "Kann keine korrekte Anzeige einrichten." #: src/media/ggi/video.c:211 #, fuzzy, c-format msgid "negotiated video mode is too small (width=%d, height=%d)" msgstr "Videomodus ist zu klein (Breite=%d, Hoehe=%d)" #. TRANS: `display-memory' is the name of a LibGGI driver and #. make no sense to translate. #: src/media/ggi/video.c:224 msgid "Failed to open an internal `display-memory' visual." msgstr "Konnte keine interne `Anzeigespeicher'-Visual öffnen." #: src/media/ggi/video.c:226 msgid "Failed to set 320x200x8 mode on display-memory" msgstr "Konnte Modus 320x200x8 im Anzeigespeicher nicht setzen" #: src/media/ggi/video.c:304 msgid "failed to acquire direct-buffer" msgstr "Konnte Direkt-Puffer nicht belegen" #: src/media/ggi/video.c:321 msgid "failed to release direct-buffer" msgstr "Konnte Direkt-Puffer nicht freigeben." #: src/media/gii/joystick.c:96 #, c-format msgid "unexpected event %d\n" msgstr "unerwartetes Ereignis %d\n" #: src/media/mikmod/strack.c:104 #, c-format msgid "" "Could not initialize sound, reason: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Kann Sound nicht initialisieren, Grund: %s\n" "Sound deaktiviert (-S unterdrückt diese Meldung)." #: src/media/mikmod/strack.c:114 msgid "" "Could not initialize sound, reason: LibMikMod is not thread safe.\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Kann Sound nicht initialisieren, Grund: LibMikMod ist nicht thread-sicher.\n" "Sound ist deaktiviert (-S unterdrückt diese Meldung)." #: src/media/mikmod/strack.c:149 src/media/sdl_mixer/strack.c:133 #, c-format msgid "Could not load %s, reason: %s" msgstr "Konnte %s nicht laden, Grund: %s" #: src/media/mikmod/strack.c:214 #, c-format msgid "LibMikMod version %ld.%ld.%ld\n" msgstr "LibMikMod Version %ld.%ld.%ld\n" #: src/media/mikmod/strack.c:217 #, c-format msgid "" "\n" "Available drivers:\n" "%s\n" msgstr "" "\n" "Verfügbare Treiber:\n" "%s\n" #: src/media/mikmod/strack.c:233 #, c-format msgid "" "Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information." msgstr "" "Argument '%s': Bereichsüberschreitung, muß zwischen %d und %d liegen.\n" "Benutze '%s --help' für weitere Informationen." #: src/media/sdl/video.c:114 #, c-format msgid "Failed to open visual: %s" msgstr "Konnte Visual %s nicht öffnen" #: src/media/sdl_mixer/strack.c:95 #, c-format msgid "" "Couldn't open audio: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Konnte Audio nicht öffnen: %s\n" "Sound ist deaktiviert (-S unterdrückt diese Meldung)." #: src/media/sdl_mixer/strack.c:171 msgid "" "Heroes has been compiled with SDL_mixer, there is no driver list available." msgstr "Heroes wurde mit SDL_mixer compiliert, keine Treiberliste verfügbar." #: src/media/sdl_mixer/strack.c:187 #, c-format msgid "%s: missing parameter for 'freq'" msgstr "%s: fehlender Parameter für 'freq'" #: src/media/sdl_mixer/strack.c:193 #, c-format msgid "%s: missing parameter for `buffers'" msgstr "%s: fehlender Parameter für `buffers'" #: src/media/sdl_mixer/strack.c:195 #, c-format msgid "%s: recognized sound options are freq=nnn and buffers=nnn" msgstr "%s: zulässige Klangoptionen sind freq=nnn und buffers=nnn" #, fuzzy #~ msgid "" #~ "Use `-lWORD' or `--list=WORD' where WORD can be:\n" #~ " debug display all debugging channels\n" #~ " preferences print the preferences settings\n" #~ " resources print the resources list\n" #~ " sound-drivers print the sound driver list\n" #~ " sound-tracks\t\tprint the sound track list" #~ msgstr "" #~ "Benutze `-lWORT' oder `--list=WORT'; fuer WORT zulaessig:\n" #~ " debug alle Debug-Kanaele anzeigen\n" #~ " resources Ressourcenliste anzeigen\n" #~ " sound-drivers Sound-Treiberliste anzeigen\n" #~ " sound-tracks Klangliste anzeigen" #~ msgid "Error %d during loading level" #~ msgstr "Fehler %d beim Level-Laden" #~ msgid "Error %d occured while loading level %s" #~ msgstr "Fehler %d beim Laden von Level %s" #~ msgid "Cannot open %s." #~ msgstr "Kann %s nicht oeffnen." #~ msgid "" #~ "\n" #~ "%{img C 444 0 40 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{center}%pUse the arrow keys to scroll up and down.\n" #~ "\n" #~ "%{head 1}CONTROL & BOARD\n" #~ "\n" #~ "%{img C 357 55 80 205}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{img CG 486 0 140 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ msgstr "" #~ "\n" #~ "%{img C 444 0 40 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{center}%pPfeiltasten zum Scrollen benutzen.\n" #~ "\n" #~ "%{head 1}CONTROL & BOARD\n" #~ "\n" #~ "%{img C 357 55 80 205}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{img CG 486 0 140 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ msgid "Unknown image flag '%c'." #~ msgstr "Unbekannte Bildkennung '%c'." #~ msgid "GFX AND IDEA:" #~ msgstr "GFX UND IDEE:" #~ msgid "MUSIC:" #~ msgstr "MUSIK:" #~ msgid "CODE:" #~ msgstr "CODE:" #~ msgid "PLEASE READ THE LIST OF OTHER CONTRIBUTORS IN THE FILE 'THANKS'" #~ msgstr "WEITERE MITWIRKENDE SIND IN DER DATEI 'THANKS' AUFGEFUEHRT." #~ msgid "%d LIVES LEFT" #~ msgstr "%d Leben uebrig" heroes-0.21/po/fr.po0000644004117000411500000014273307451377060010010 # Messages francais pour Heroes. # Copyright 2000, 2001 Free Software Foundation, Inc. # Alexandre Duret-Lutz , 2000, 2001. # msgid "" msgstr "" "Project-Id-Version: Heroes 0.17a\n" "POT-Creation-Date: 2002-03-30 18:44+0100\n" "PO-Revision-Date: 2001-12-14 22:01+0100\n" "Last-Translator: Alexandre Duret-Lutz \n" "Language-Team: none \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" #: lib/error.c:129 lib/error.c:157 msgid "Unknown system error" msgstr "Erreur système inconnue" #: lib/getopt.c:694 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: l'option `%s' est ambiguë\n" #: lib/getopt.c:719 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: l'option `--%s' ne requiert pas de paramètre.\n" #: lib/getopt.c:724 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: l'option `%c%s' ne requiert pas de paramètre.\n" #: lib/getopt.c:742 lib/getopt.c:915 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: l'option `%s' requiert un paramètre.\n" #. --option #: lib/getopt.c:771 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: option non reconnue `--%s'\n" #. +option or -option #: lib/getopt.c:775 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: option non reconnue `%c%s'\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:801 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: option illégale --%c\n" #: lib/getopt.c:804 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: option invalide --%c\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:834 lib/getopt.c:964 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: l'option requiert un paramètre --%c\n" #: lib/getopt.c:881 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: l'option `-W %s' est ambiguë\n" #: lib/getopt.c:899 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: l'option `-W %s' ne requiert pas de paramètre.\n" #. If XALLOC_FAIL_FUNC is NULL, or does return, display this message #. before exiting when memory is exhausted. Goes through gettext. #: lib/xmalloc.c:66 msgid "memory exhausted" msgstr "mémoire épuisée" #: src/argv.c:60 #, c-format msgid "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux and Philippe Meisburger.\n" msgstr "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux et Philippe Meisburger.\n" #: src/argv.c:63 src/heroeslvl.c:64 msgid "" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." msgstr "" "Ce logiciel est libre ; consultez les sources pour les conditions de copie.\n" "AUCUNE garantie n'est donnée, pas même sa concernant sa COMMERCIABILITÉ\n" "ou son APTITUDE À RÉPONDRE À UN BESOIN PARTICULIER." #: src/argv.c:74 msgid "Use `-lWORD' or `--list=WORD' where WORD can be:" msgstr "Utilisez `-lMOT' ou `--list=MOT' où MOT peut être :" #: src/argv.c:76 msgid "display all debugging channels" msgstr "liste les cannaux de deboggage" #: src/argv.c:78 msgid "list all level files" msgstr "liste tous les niveaux" #: src/argv.c:80 msgid "print the preferences settings" msgstr "liste l'état des préférences" #: src/argv.c:82 msgid "print the resources list" msgstr "liste toutes les resources" #: src/argv.c:84 msgid "print the sound driver list" msgstr "liste les pilotes sonores" #: src/argv.c:86 msgid "print the sound track list" msgstr "liste les musiques" #: src/argv.c:145 src/heroeslvl.c:74 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Essayez '%s --help' pour plus d'informations.\n" #: src/argv.c:150 #, c-format msgid "" "Usage: %s [OPTIONS]...\n" "\n" msgstr "" "Utilisation : %s [OPTIONS]...\n" "\n" #: src/argv.c:151 msgid "" "Heroes is a game similar to the \"Tron\" and \"Nibbles\" games of yore\n" "but includes many graphical improvements and new game features.\n" msgstr "" "Heroes est un jeu similaire aux jeux \"Tron\" and \"Nibbles\" d'antan mais\n" "plus est plus élaboré et ajoute plusieurs effets graphiques.\n" #: src/argv.c:154 src/heroeslvl.c:81 msgid "" "Mandatory arguments to long options are mandatory for short options too.\n" msgstr "" "Les argument obligatoires pour les options longues le sont aussi pour les\n" "courtes.\n" #: src/argv.c:156 msgid "" "General options:\n" " -v, --version display version number\n" " -h, --help display this help\n" " -q, --quiet don't print warning messages\n" " -Q, --really-quiet don't even print error messages\n" " -v, --verbose=CHANNELS enable or disable debugging channels\n" " (see --list=debug for available channels)\n" " -l, --list=WORD show some internal information; WORD can be\n" " 'debug', 'resources', 'sound-drivers' or\n" " 'sound-tracks'\n" msgstr "" "Options générales :\n" " -v, --version affiche le numéro de version\n" " -h, --help affiche cette aide\n" " -q, --quiet supprime les messages d'avertissement\n" " -Q, --really-quiet supprime aussi les messages d'erreur\n" " -v, --verbose=CANNAUX active ou désactives des cannaux de deboggage\n" " (voyez --list=debug pour la liste de ceux-" "ci)\n" " -l, --list=MOTS affiche certaines informations internes ; " "MOTS\n" " peut être : 'debug', 'resources', \n" " 'sound-drivers' ou 'sound-tracks'\n" #: src/argv.c:167 msgid "" "Sound options:\n" " -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:" "autodetect)\n" " (see --list=sound-drivers for available Ns)\n" " -S, --no-sound disable sound\n" " -X, --no-sfx disable sound-effects\n" " -m, --mono non-stereo output\n" " -8, --8bits 8bits sound output\n" " -i, --high-quality high quality mixer\n" msgstr "" "Options sonores :\n" " -d, --driver=N[,OPTIONS] utilise le Nième pilote sonore (0: " "autodétection)\n" " (voir --list=sound-drivers pour la liste des " "N)\n" " -S, --no-sound désactive tous sons\n" " -X, --no-sfx désactive les bruitages\n" " -m, --mono sortie non-stéréo\n" " -8, --8bits sortie sonore sur 8 bits\n" " -i, --high-quality mixeur de bonne qualité\n" #: src/argv.c:176 msgid "" "Display options:\n" " -G, --gfx-options=OPTIONS pass OPTIONS to the display driver\n" " -F, --full-screen full screen mode\n" " -2, --double stretch the display twofold\n" " -3, --triple stretch the display threefold\n" " -4, --quadruple stretch the display fourfold\n" " -e, --even-lines display only even-lines\n" msgstr "" "Options d'affichage :\n" " -G, --gfx-options=OPTIONS passe OPTIONS au pilote d'affichage\n" " -F, --full-screen mode plein écran\n" " -2, --double aggrandit l'affichage deux fois\n" " -3, --triple aggrandit l'affichage trois fois\n" " -4, --quadruple aggrandit l'affichage quatre fois\n" " -e, --even-lines affiche seulement les lignes paires\n" #. TRANS: rotozoom is a graphical effect used in the demo of yore #. where the screen rotate and zoom (actually it doesn't zoom in Heroes); #. waves is another effect where the screen is agitated like some #. jelly (this was also called the `mushroom effect' in game like #. Death Rally). #: src/argv.c:189 msgid "" "Miscellaneous options:\n" " --cpu-off disable computer opponents\n" " --default-scores restore default scores file\n" " --default-options restore default options file\n" " --default-saves restore default saves file\n" " -s, --swap-sides swap sides in two player mode\n" " --no-double-fx disable combination of rotozoom and waves\n" " -g, --go skip the introduction\n" " -J, --no-joystick disable joystick handling\n" msgstr "" "Options diverses :\n" " --cpu-off désactive les opposants gérés par " "l'ordinateur\n" " --default-scores restaure les scores par défaut\n" " --default-options restaure les options par défaut\n" " --default-saves restaure les sauvegardes par défaut\n" " -s, --swap-sides permute les côtés en mode deux joueurs\n" " --no-double-fx interdit la combinaison des ondes et \n" " des rotations\n" " -g, --go saute l'introduction\n" " -J, --no-joystick désactive la gestion des manettes de jeu\n" #: src/argv.c:199 msgid "" "These options can be set in your file ~/.heroes/heroesrc (which is read\n" "before parsing other command line options) using a line like the following:\n" "\n" " Options: -gs -d3,buffer=11,count=4\n" msgstr "" "Ces options peuvent être précisées dans le fichier ~/.heroes/heroesrc (qui\n" "est lu avant que les options passées en ligne de commande ne soient prises\n" "en compte) en utilisant une ligne de la forme suivante :\n" "\n" " Options: -gs -d3,buffer=11,count=4\n" #: src/argv.c:204 msgid "" "Visit http://heroes.sourceforge.net/ for news, documentation, and updates." msgstr "" "Visitez http://heroes.sourceforge.net/ pour information, documentation, et\n" "mises à jour." #: src/argv.c:206 src/heroeslvl.c:102 msgid "Report bugs to ." msgstr "Rapporter toutes anomalies à ." #: src/argv.c:312 msgid "-n is an obsolete option, you should use --list=sound-drivers" msgstr "-n est une option obsolète, vous devriez utiliser --list=sound-drivers" #: src/bonus.c:324 src/bonus.c:329 #, c-format msgid "SIZE IS %d" msgstr "TAILLE %d" #: src/bonus.c:334 msgid "SPEEDED UP" msgstr "ACCELERATION" #: src/bonus.c:338 msgid "SPEEDED DOWN" msgstr "RALENTISSEMENT" #: src/bonus.c:345 #, c-format msgid "GET %dPTS" msgstr "%d POINTS" #: src/bonus.c:350 msgid "FIRE TRAIL!" msgstr "TRAINEE DE FEU" #: src/bonus.c:364 msgid "GET TURBO+" msgstr "TURBO+" #: src/bonus.c:371 msgid "GET TURBO-" msgstr "TURBO-" #: src/bonus.c:379 msgid "INVINCIBLE!" msgstr "INVINCIBLE !" #: src/bonus.c:391 msgid "EXTRA-LIFE!" msgstr "NOUVELLE VIE" #: src/endscroll.c:113 msgid "THE END" msgstr "FIN" #: src/fontdata.c:243 #, c-format msgid "character '%c' is not drawable (in message '%s')" msgstr "le caractère '%c' n'est pas représentable (dans le message '%s')" #: src/hedlite.c:1622 #, c-format msgid "Cannot create directory `%s'." msgstr "Impossible de créer les répertoire `%s'." #: src/hedlite.c:1679 src/hedlite.c:1686 #, c-format msgid "%s: invalid level file" msgstr "%s: carte de niveau invalide" #: src/helptext.c:24 msgid "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "\n" "%{center}%pUse the arrow keys to scroll up and down.\n" "\n" "%{head 1}CONTROL & BOARD\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSE\n" "%{textat cR -9 97}%yQUIT GAME\n" "%{textat cR 26 -62}%yCONTROL\n" "%{textat cL 30 74}%ySTOP\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%ySCORE\n" "%{textat cR 1 8}%yCOMMENTARY\n" "%{textat cL 16 29}%yHEROES\n" "%{textat cL 33 29}%yWALLS\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yLIFES\n" "%{textat cL 51 -109}%yTURBO ENERGY\n" "%{textat cL 72 -104}%yTIME\n" "%{textat cR 96 40}%yPLAYER COLOR\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" msgstr "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "\n" "%{center}%pUtilisez les flèches pour vous déplacer verticalement.\n" "\n" "%{head 1}CONTRÔLE & INDICATEURS\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSE\n" "%{textat cR -9 97}%yQUITTER\n" "%{textat cR 26 -62}%yDIRECTIONS\n" "%{textat cL 30 74}%ySTOP\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%ySCORE\n" "%{textat cR 1 8}%yCOMMENTAIRE\n" "%{textat cL 16 29}%yHÉROS\n" "%{textat cL 33 29}%yMURS\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yVIES\n" "%{textat cL 51 -109}%yJAUGE TURBO\n" "%{textat cL 72 -104}%yTEMPS\n" "%{textat cR 96 40}%yCOULEUR DU JOUEUR\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" #: src/helptext.c:71 msgid "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Affects the player that gets the item\n" "%{img L 60 22 20 22}Affects all players except the one who gets the bonus\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points\n" "%{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions\n" "\n" msgstr "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Concerne tous les joueurs qui prennent le bonus\n" "%{img L 60 22 20 22}Concerne tous les joueurs a l'exception de celui qui " "prend le bonus.\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Traînée +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Traînée -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Accélération\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Ralentissement\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Bonus aléatoire\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points\n" "%{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Traînée de feu\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Commandes inversées\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Puissance supplémentaire\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Perte de puissance\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}Fin de niveau\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnérabilité\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotation\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Vie supplémentaire\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Vision ondulée\n" "\n" #: src/helptext.c:99 msgid "" "%{head 3}GAME MODES\n" "\n" "%{>>}%yQUEST\n" "\n" "%{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers " "you. Your aim is to collect a given number (10) of Trail+1 bonuses and then " "to get the End-of-Level bonus that will send you to next level.\n" "%{>>>}%{img L 20 176 20 22}End-of-Level\n" "%{img R 0 0 20 22}%{flushright}Trail+1\n" "%{>>>}Trail+1 has the effect of growing your trail. There are two way to " "get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first " "appears when someone's trail reach 10 units.\n" "\n" "%{>>}%yDEATH MATCH\n" "\n" "%{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a " "fight to death. The aim of the game is to be the last player still alive. " "For this, feel free to use any stratagems you want. Nothing is forbidden.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL\n" "\n" "%{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm " "all the people of your competitors. It was said \"There can be only one\", " "make sure it is yours!\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}They are among us, find them !\n" "\n" "%{>>}%yCOLOR\n" "\n" "%{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time " "to get a maximum of gems of your color. Beware, if you go over your " "competitor's gems, it's your competitor's gem account that you will " "increase. Be also sure not to get crossed gems because you'll lose " "collected gems. Grey ones gives gems to all players except the one that " "goes over it. The Clocks give you extra time.\n" "\n" "%{>>}%yTIME CA$H\n" "\n" "%{>>>}In %yTIME CA$H%w mode the winner is the player who collected the " "largest amount of money.\n" "\n" msgstr "" "%{head 3}MODES DE JEU\n" "\n" "%{>>}%yQUÊTE\n" "\n" "%{>>>}Dans le mode %yQUÊTE%w vous jouerez les 100 niveaux d'HEROES. Dans " "chaque niveau, le but est de collecter 10 bonus \"Traînée +1\" puis un bonus " "\"Fin de niveau\" pour passer au niveau suivant.\n" "%{>>>}%{img L 20 176 20 22}Fin de niveau\n" "%{img R 0 0 20 22}%{flushright}Traînée+1\n" "%{>>>}\"Traînée+1\" aggrandit la queue de votre véhicule. Il n'y a que deux " "façons de la rendre plus petite: prendre un bonus \"Traînée-1\" ou perdre " "une vie. Les bonus de type \"Fin de niveau\" apparaissent dès que l'un des " "joueurs a une traînée de dix unitées.\n" "\n" "%{>>}%yCOMBAT À MORT\n" "\n" "%{>>>}Le mode %yCOMBAT À MORT%w vous met face à face avec les autres joueurs " "dans une lute à mort. Le but est de survivre, bien sûr ! Le dernier joueur " "en vie gagne.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yTUE LES TOUS\n" "\n" "%{>>>}Le mode %yTUE LES TOUS%w est peuplé de petits lemmings aux couleurs " "des joueurs. Votre objectif est d'écraser ceux des autres, et de protéger " "les vôtres. S'il ne peut en rester qu'un, faites en sorte que ce soit le " "vôtre.\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}Ils sont parmi nous, trouvez-les !\n" "\n" "%{>>}%yCOLEURS\n" "\n" "%{>>>}Le mode %yCOULEURS%w est très simple. De nombreux cristaux colorés " "sont répendus sur la surface du jeu et vous disposez d'un temps limité pour " "collecter le maximum de cristaux de votre couleur. Mais attention : chaque " "joueur a un compteur de cristaux, et prendre les cristaux des autres joueurs " "augmente leur compteur ! Les cristaux barés d'une croix rouge diminuent la " "valeur du compteur du joueur correspondant. Les cristaux gris concernent " "tous les joueurs a l'exception de celui qui les prend. Les petites montres " "vous donnent du temps supplémentaire.\n" "\n" "%{>>}%yTEMPS & ARGENT\n" "\n" "%{>>>}Le but du mode %yTEMPS & ARGENT%w est de ramasser le maximum de " "dollards en un temps limité.\n" "\n" #: src/helptext.c:145 msgid "" "%{head 4}GAME OPTIONS\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gCOLOR SELECT\n" "\n" "%{>>>}This option allows you to choose the color of your vehicle between %" "pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gGAME SPEED\n" "\n" "%{>>>}The %gGAME SPEED%w option allows you to select the initial speed of " "the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gROUNDS\n" "\n" "%{>>>}The %gROUNDS%w option allows you to select the number of rounds in the " "tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. These " "values range from 1 to 100 rounds.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMATION\n" "\n" "%{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better " "visibility.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gLIGHTING\n" "\n" "%{>>>}The %gLIGHTING%w option is here to tune the luminosity of your " "screen.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gINERTIA\n" "\n" "%{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOT\n" "\n" "%{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, rest in " "peace... Note that %gAUTOPILOT%w does not work against fire trails.\n" "\n" msgstr "" "%{head 4}OPTIONS DU JEU\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gCHOIX DE COULEUR\n" "\n" "%{>>>}Cette option permet de choisir la couleur de votre véhicule parmi %" "pROSE%w, %yJAUNE%w, %bBLEU%w et %gVERT%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gVITESSE DU JEU\n" "\n" "%{>>>}L'option %gVITESSE DU JEU%w vous permet de régler la vitesse initiale " "des véhicules. Les 3 vitesses sont: NORMAL, EXPERT, HEROES.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gMANCHES\n" "\n" "%{>>>}Choisissez le nombre de %gMANCHES%w des parties jouées dans l'un des " "modes tournois (c'est-à-dire COMBAT À MORT, TUE LE TOUS, COULEUR ou TEMPS & " "ARGENT). Les valeurs varient de 1 à 100 manches.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMATIONS\n" "\n" "%{>>>}Le radar et les informations supplémentaires comme les compteurs " "peuvent-être désactivés pour une meilleure visibilité.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gÉCLAIRAGE\n" "\n" "%{>>>}L'option %gÉCLAIRAGE%w permet de régler la luminosité de l'affichage.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gINERTIE\n" "\n" "%{>>>}L'option %gINERTIE%w active ou desactive l'inertie de la camera.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOTE\n" "\n" "%{>>>}Les casse-cou pourront essayer de jouer sans l'option %gAUTOPILOT%w; " "reposez en paix... Notez que l'%gAUTOPILOTE%w ne fonctionne pas contre les " "trainées de feu.\n" "\n" #: src/helptext.c:191 msgid "" "%{head 1}CONTACT\n" "\n" "%{center}home page:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}send bug reports to:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" msgstr "" "%{head 1}CONTACT\n" "\n" "%{center}page web :\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}signaler tout bug a :\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" #: src/helptext.c:204 msgid "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's " "environmental and ecological issues and did our best to use only recycled " "bytes in this program.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux and Philippe Meisburger.\n" "\n" msgstr "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} Nous sommes conscients des " "problèmes écologiques de notre époque et avons pris soin de n'utiliser que " "des octets recyclés dans ce programme.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux et Philippe Meisburger.\n" "\n" #: src/heroes.c:677 src/heroes.c:763 #, c-format msgid "Cannot load level %s (error %d)" msgstr "Impossible de charger le niveau %s (erreur %d)" #: src/heroes.c:1969 #, c-format msgid "INVERTED %d" msgstr "INVERSE %d" #: src/heroes.c:2003 #, c-format msgid "STOPPED %d" msgstr "ARRETE %d" #. TRANS: %d, the number of remaining lives, is always #. positive. #: src/heroes.c:2300 msgid "LAST LIFE" msgid_plural "%d LIVES LEFT" msgstr[0] "DERNIERE VIE" msgstr[1] "RESTE %d VIES" #: src/heroes.c:2873 msgid "Error during level loading" msgstr "Erreur pendant le chargement du niveau" #: src/heroes.c:2909 #, c-format msgid "-LEVEL %d-" msgstr "-NIVEAU %d-" #: src/heroes.c:2911 #, c-format msgid "-ROUND %d/%d-" msgstr "-MANCHE %d/%d-" #: src/heroes.c:3416 msgid "error in sfx.cfg" msgstr "erreur dans sfx.cfg" #: src/heroeslvl.c:63 #, c-format msgid "Copyright (C) %d Alexandre Duret-Lutz.\n" msgstr "Copyright (C) %d Alexamdre Duret-Lutz.\n" #: src/heroeslvl.c:79 #, c-format msgid "" "Usage: %s [OPTIONS]... levels\n" "\n" msgstr "" "Utilisation : %s [OPTIONS]... niveaux\n" "\n" #: src/heroeslvl.c:80 msgid "Heroeslvl is a tool used to inspect Heroes' level files.\n" msgstr "" "Heroeslvl est un outil servant à inspecter les fichiers de niveaux " "d'Heroes.\n" #: src/heroeslvl.c:83 msgid " -v, --version display version number" msgstr " -v, --version affiche le numéro de version" #: src/heroeslvl.c:85 msgid " -h, --help display this help" msgstr " -h, --help affiche cette aide" #: src/heroeslvl.c:87 msgid "" " -p, --print=WHAT select information to display. WHAT should " "be\n" " one or more of these characters:" msgstr "" " -p, --print=QUOI choisit les informations a afficher. QUOI " "peut\n" " être un ou plusieurs des caractères " "suivants :" #: src/heroeslvl.c:90 msgid "d print square directions" msgstr "d affiche les directions des carrés" #: src/heroeslvl.c:91 msgid "f print filename" msgstr "f affiche le nom du fichier" #: src/heroeslvl.c:92 msgid "h print header" msgstr "h affiche l'entête" #: src/heroeslvl.c:93 msgid "i print tile details" msgstr "i affiche les détails des tuiles" #: src/heroeslvl.c:94 msgid "t print square type map" msgstr "t affiche la carte des type des carrés" #: src/heroeslvl.c:95 msgid "T print type keys" msgstr "T affiche la légende des types" #: src/heroeslvl.c:96 msgid "w print square wall map" msgstr "w affiche les murs de chaque carré" #: src/heroeslvl.c:97 msgid "@ print tunnels" msgstr "@ affiche les tunnels" #: src/heroeslvl.c:98 msgid " -i, --indent indent everything but the filename" msgstr " -i, --indent indente tout sauf the nom de fichier" #: src/heroeslvl.c:101 msgid "When no options are given, the default is -ipfh." msgstr "Lorsqu'aucune option n'est donnée, -ipfh est utilisé." #: src/heroeslvl.c:201 #, c-format msgid "%sheight:\t%d tiles\t(%d squares)\n" msgstr "%shauteur:\t%d tuile\t(%d carrés)\n" #: src/heroeslvl.c:203 #, c-format msgid "%swidth:\t%d tiles\t(%d squares)\n" msgstr "%slargeur:\t%d tuile\t(%d carrés)\n" #: src/heroeslvl.c:206 #, c-format msgid "%sY-wrap:\tno\n" msgstr "%sBoucle-Y:\tnon\n" #: src/heroeslvl.c:208 #, c-format msgid "%sY-wrap:\t%d tiles\t(%d squares)\n" msgstr "%sBoucle-Y:\t%d tuile\t(%d carrés)\n" #: src/heroeslvl.c:211 #, c-format msgid "%sX-wrap:\tno\n" msgstr "%sBoucle-X:\tnon\n" #: src/heroeslvl.c:213 #, c-format msgid "%sX-wrap:\t%d tiles\t(%d squares)\n" msgstr "%sBoucle-X:\t%d tuile\t(%d carrés)\n" #: src/heroeslvl.c:215 #, c-format msgid "%ssound track alias:\t%s\n" msgstr "%salias bande son:\t%s\n" #: src/heroeslvl.c:217 #, c-format msgid "%stile map basename:\t%s\n" msgstr "%simage des tuiles:\t%s\n" #: src/heroeslvl.c:219 #, c-format msgid "%sstarting squares and directions (y x dir):\n" msgstr "%scarrés et directions de départ (y x dir):\n" #: src/heroeslvl.c:261 msgid "none" msgstr "rien" #: src/heroeslvl.c:262 msgid "stop" msgstr "stop" #: src/heroeslvl.c:263 msgid "speed" msgstr "vitesse" #: src/heroeslvl.c:264 msgid "tunnel" msgstr "tunnel" #: src/heroeslvl.c:265 msgid "boom" msgstr "explosion" #: src/heroeslvl.c:266 msgid "anim" msgstr "animation" #: src/heroeslvl.c:267 msgid "ice" msgstr "glace" #: src/heroeslvl.c:268 msgid "dust" msgstr "poussière" #: src/heroeslvl.c:269 msgid "outway" msgstr "inaccessible" #: src/heroeslvl.c:389 #, c-format msgid "%sTunnels:\n" msgstr "%sTunnels:\n" #. TRANS: This is the header of an array (output by heroeslvl -p@), #. so the position of these words is important. #. #. SRCIDX is a short for 'source index' (entrance of a tunnel) and #. DESTIDX means 'destination index' (output of the tunnel). #: src/heroeslvl.c:395 #, c-format msgid "%s NBR SRCIDX Y X DIR DESTIDX\n" msgstr "%s NBR SRCIDX Y X DIR DESTIDX\n" #. TRANS: `still' is used to describe tiles which are not animated. #: src/heroeslvl.c:426 msgid "still" msgstr "fixe" #. TRANS: `loop' is for animated tiles where frames are displayed #. from 1 to n, and then again from 1 to n, etc. #: src/heroeslvl.c:430 msgid "loop" msgstr "boucle" #. TRANS: `pingpong' is for tiles animated in loop where frame #. displayed from 1 to n, then from n to 1, and then again from 1 #. to n, etc. #: src/heroeslvl.c:435 msgid "pingpong" msgstr "pingpong" #. TRANS: This is the header of an array (output by heroeslvl -pi) so #. the position of these word is important. #. #. SPRITE is the address of the sprite used to render the tile. OVERLAY #. is the address of a sprite that should be displayed on top #. of the players (e.g. trees). ANIM-TYPE is the kind of animation used #. for the tile, FRM the number of frame to display, DEL the delay #. between each frame. #: src/heroeslvl.c:453 #, c-format msgid "%sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL\n" msgstr "%sTUILE Y X TYPE IMAGE SURIMPR TYPE-ANIM IMG ATTENTE\n" #: src/heroeslvl.c:503 #, c-format msgid "cannot load %s" msgstr "impossible de charger %s" #: src/heroeslvl.c:507 #, c-format msgid "File:\t%s\n" msgstr "Fichier:\t%s\n" #: src/heroeslvl.c:539 msgid "Missing filename." msgstr "Nom de fichier manquant." #: src/levellst.c:53 #, c-format msgid "cannot open directory %s" msgstr "impossible d'ouvrir le répertoire %s" #. TRANS: in QUEST mode, the player goes throught all the levels, but #. have to search for specific powerups in order to jump to the next #. level. Hence this is a `quest' for those powerups. #: src/menus.c:146 msgid "QUEST" msgstr "QUÊTE" #. TRANS: in DEATH MATCH mode, the user has to kill all other players. #: src/menus.c:148 msgid "DEATH MATCH" msgstr "COMBAT À MORT" #. TRANS: in KILL'EM ALL mode there are lemmings moving on the ground #. and the player must run over them all. You may want to translate #. `kill' as `run over', `squash', `mash' or something among those #. lines. #: src/menus.c:153 msgid "KILL'EM ALL" msgstr "TUE LES TOUS" #. TRANS: in TIME CA$H mode, the player must collect dollars with #. restricted time. #: src/menus.c:156 msgid "TIME CA$H" msgstr "TEMPS & ARGENT" #. TRANS: in COLOR mode, the player must collect some colored gems #. with restricted time. #: src/menus.c:159 msgid "COLORS" msgstr "COULEURS" #: src/menus.c:192 msgid "GAME" msgstr "JEU" #: src/menus.c:193 msgid "SCREEN" msgstr "AFFICHAGE" #: src/menus.c:194 msgid "SOUND" msgstr "SON" #: src/menus.c:195 msgid "CONTROL" msgstr "CONTRÔLE" #: src/menus.c:196 msgid "KEYS" msgstr "TOUCHES" #: src/menus.c:197 msgid "EXTRAS" msgstr "EXTRAS" #: src/menus.c:198 src/menus.c:222 src/menus.c:385 src/menus.c:395 #: src/menus.c:409 src/menus.c:421 src/menus.c:431 src/menus.c:454 #: src/menus.c:545 msgid "GO BACK" msgstr "RETOUR" #. play menu #: src/menus.c:205 src/menus.c:539 msgid "PLAY" msgstr "JOUER" #. options menu #: src/menus.c:206 src/menus.c:526 msgid "OPTIONS" msgstr "OPTIONS" #: src/menus.c:207 src/menus.c:406 msgid "INFOS" msgstr "INFOS" #: src/menus.c:208 msgid "CREDITS" msgstr "CRÉDITS" #: src/menus.c:209 msgid "SCORES" msgstr "SCORES" #. editor first menu #: src/menus.c:210 src/menus.c:536 msgid "EDITOR" msgstr "ÉDITEUR" #: src/menus.c:211 msgid "QUIT" msgstr "QUITTER" #. TRANS: Create a new level. #: src/menus.c:219 src/menus.c:503 msgid "NEW LEVEL" msgstr "NOUVEAU NIVEAU" #. TRANS: Load an existing level for edition. #: src/menus.c:221 msgid "LOAD LEVEL" msgstr "CHARGER" #: src/menus.c:375 msgid "CONTROL OPTIONS" msgstr "CONTRÔLE" #. 1st player #: src/menus.c:377 src/menus.c:416 src/menus.c:433 msgid "PLAYER 1" msgstr "JOUEUR 1" #: src/menus.c:379 src/menus.c:383 msgid "AUTO PILOT" msgstr "AUTO PILOTE" #. 2nd player #: src/menus.c:381 src/menus.c:417 src/menus.c:441 msgid "PLAYER 2" msgstr "JOUEUR 2" #: src/menus.c:391 msgid "SOUND OPTIONS" msgstr "OPTIONS SONORES" #: src/menus.c:393 msgid "MUSIC" msgstr "MUSIQUE" #: src/menus.c:394 msgid "SFX" msgstr "BRUITAGES" #: src/menus.c:398 msgid "MUSIC VOL" msgstr "VOL. MUS." #: src/menus.c:399 msgid "SFX VOL" msgstr "VOL. BRUIT." #: src/menus.c:403 msgid "SCREEN OPTIONS" msgstr "AFFICHAGE" #: src/menus.c:405 msgid "RADAR" msgstr "RADAR" #: src/menus.c:407 msgid "LIGHTING" msgstr "ÉCLAIRAGE" #: src/menus.c:408 msgid "INERTIA" msgstr "INERTIE" #: src/menus.c:414 msgid "GAME OPTIONS" msgstr "OPTIONS DE JEU" #: src/menus.c:418 msgid "PLAYER 3" msgstr "JOUEUR 3" #: src/menus.c:419 msgid "PLAYER 4" msgstr "JOUEUR 4" #: src/menus.c:420 msgid "SPEED" msgstr "VITESSE" #: src/menus.c:429 msgid "KEYBOARD DEFS" msgstr "CONFIG CLAVIER" #: src/menus.c:434 src/menus.c:442 msgid "UP" msgstr "HAUT" #: src/menus.c:435 src/menus.c:443 msgid "LEFT" msgstr "GAUCHE" #: src/menus.c:436 src/menus.c:444 msgid "DOWN" msgstr "BAS" #: src/menus.c:437 src/menus.c:445 msgid "RIGHT" msgstr "DROITE" #: src/menus.c:438 src/menus.c:446 msgid "TURBO" msgstr "TURBO" #: src/menus.c:439 src/menus.c:447 msgid "STOP" msgstr "STOP" #: src/menus.c:452 msgid "EXTRAS LEVELS" msgstr "NIVEAUX EXTRAS" #: src/menus.c:456 msgid "ORIGINAL LEVELS" msgstr "NIVEAUX ORIGINAUX" #: src/menus.c:458 msgid "ORIGINAL+EXTRAS" msgstr "ORIGINAUX+EXTRAS" #: src/menus.c:460 msgid "EXTRAS ONLY" msgstr "EXTRAS UNIQUEMENT" #: src/menus.c:462 msgid "EXTRAS: NONE" msgstr "EXTRAS: AUCUN" #: src/menus.c:464 msgid "EXTRAS: ALL" msgstr "EXTRAS: TOUS" #: src/menus.c:466 msgid "EXTRAS: SELECT" msgstr "EXTRAS: CHOIX" #. pause menu #: src/menus.c:491 msgid "PAUSE" msgstr "PAUSE" #. quit y/n menus #: src/menus.c:495 msgid "QUIT THIS GAME?" msgstr "QUITTER LA PARTIE ?" #: src/menus.c:497 msgid "REALLY QUIT?" msgstr "QUITTER LE JEU ?" #: src/menus.c:499 msgid "NO" msgstr "NON" #: src/menus.c:500 msgid "YES" msgstr "OUI" #: src/menus.c:505 msgid "EXISTING LEVEL" msgstr "NIVEAU ÉXISTANT" #: src/menus.c:507 msgid "NAME" msgstr "NOM" #. TRANS: in wrapped levels are unbounded level, e.g. whenever the #. player reach the left border it continue its way from the right border #. (except that the player doesn't even know there are borders, because #. the level is tiled infinitely). In unwrapped levels there are explicit #. bounds that you cannot cross. X-WRAP is a check box used to specified #. whether a level must be wrapped horizontally or not when creating a #. new level. #: src/menus.c:515 msgid "X-WRAP" msgstr "BOUCLE-X" #. TRANS: Y-WRAP is a check box used to specified whether a level #. must be wrapped vertically or not. #: src/menus.c:518 msgid "Y-WRAP" msgstr "BOUCLE-Y" #. TRANS: width of the level #: src/menus.c:520 msgid "X-SIZE" msgstr "LARGEUR" #. TRANS: height of the level #: src/menus.c:522 msgid "Y-SIZE" msgstr "HAUTEUR" #: src/menus.c:523 msgid "EDIT" msgstr "EDIT" #. main menu #: src/menus.c:529 msgid "HEROES" msgstr "HEROES" #. editor selector #: src/menus.c:532 msgid "SELECT A LEVEL" msgstr "CHOISSEZ UN NIVEAU" #: src/menus.c:541 msgid "ONE PLAYER" msgstr "UN JOUEUR" #: src/menus.c:543 msgid "TWO PLAYERS" msgstr "DEUX JOUEURS" #: src/menus.c:547 msgid "LOAD..." msgstr "CHARGER..." #. saved game selection #: src/menus.c:556 msgid "CHOOSE A SAVE SLOT" msgstr "CHOISISSEZ UN EMPLACEMENT" #: src/menus.c:558 msgid "CHOOSE A LOAD SLOT" msgstr "CHOISISSEZ UN EMPLACEMENT" #. enter your name #: src/menus.c:562 msgid "ENTER YOUR NAME:" msgstr "ENTREZ VOTRE NOM" #. end level info #. TRANS: SIZE is the size of the player trail, PTS the #. number of PoinTS #: src/menus.c:568 msgid "SIZE PTS LIVES" msgstr "TAILLE PTS VIES" #: src/menus.c:570 msgid "PTS LIVES" msgstr "POINTS VIES" #. TRANS: this is for KILL'EM ALL mode, and MEN is the number #. of lemmings killed by one player #: src/menus.c:574 msgid " MEN PTS LIVES" msgstr "LEMS PTS VIES" #: src/menus.c:576 msgid "CA$H PTS LIVES" msgstr "SOUS PTS VIES" #: src/menus.c:578 msgid "COLORS PTS LIVES" msgstr "COULEURS PTS VIES" #: src/menus.c:583 msgid "NEXT LEVEL" msgstr "NIVEAU SUIVANT" #. TRANS: this is a menu entry that introduce the user to another #. menu. This is NOT displayed DURING saving. #: src/menus.c:588 msgid "SAVE..." msgstr "SAUVER..." #: src/menus.c:593 msgid "PRESS RETURN" msgstr "FRAPPEZ ENTRÉE" #: src/menus.c:602 msgid "WINS PTS LIVES" msgstr "GAINS PTS VIES" #. higher scores #: src/menus.c:613 msgid "HIGHER SCORES" msgstr "MEILLEURS SCORES" #: src/menus.c:1231 #, c-format msgid "%d ROUND" msgid_plural "%d ROUNDS" msgstr[0] "%d MANCHE" msgstr[1] "%d MANCHES" #: src/menus.c:2220 #, c-format msgid "PLAYER %d, YOU CAME IN THE TOP 10" msgstr "JOUEUR %d, VOUS FIGUREZ PARMI LES 10 MEILLEURS" #: src/menus.c:2287 #, c-format msgid "PLAYER %d WON!" msgstr "LE JOUEUR %d GAGNE !" #: src/menus.c:2293 msgid "EVERYONE LOST!" msgstr "TOUT LE MONDE PERD" #: src/menus.c:2295 msgid "YOU LOST!" msgstr "VOUS AVEZ PERDU !" #: src/menus.c:2374 #, c-format msgid "ROUND %d/%d" msgstr "MANCHE %d/%d" #: src/musicfiles.c:174 #, c-format msgid "%s:%d: missing alias name" msgstr "%s:%d: nom d'alias manquant" #: src/musicfiles.c:176 #, c-format msgid "%s:%d: missing file name" msgstr "%s:%d: nom de fichier manquant" #: src/musicfiles.c:178 #, c-format msgid "%s:%d: missing title" msgstr "%s:%d: titre manquant" #: src/musicfiles.c:180 #, c-format msgid "%s:%d: missing author" msgstr "%s:%d: auteur manquant" #: src/pcx.c:53 #, c-format msgid "Cannot open %s" msgstr "Impossible d'ouvrir %s" #: src/people.c:39 msgid "%{center}You owe this game to the following people" msgstr "%{center}Vous devez ce jeu aux personnes suivantes" #: src/people.c:41 msgid "Authors\n" msgstr "Auteurs\n" #: src/people.c:49 msgid "Contributors\n" msgstr "Contributeurs\n" #: src/people.c:56 msgid "Translators\n" msgstr "Traducteurs\n" #: src/people.c:59 src/people.c:74 msgid "German" msgstr "allemand" #: src/people.c:62 msgid "Dutch" msgstr "hollandais" #: src/people.c:65 msgid "Brazilian Portuguese" msgstr "" #: src/people.c:68 msgid "Italian" msgstr "italien" #: src/people.c:71 msgid "French" msgstr "français" #: src/people.c:78 msgid "Packagers\n" msgstr "Emballeurs\n" #: src/people.c:87 msgid "Porters\n" msgstr "Porteurs\n" #: src/people.c:94 msgid "Other people we wish to thanks\n" msgstr "Autres personnes que nous souhaitons remercier\n" #: src/readmake.c:188 #, c-format msgid "Unknown option '%c' for command '%s'." msgstr "L'option '%c' est inconnue pour la commande '%s'." #: src/relocate.c:70 msgid "HOME variable not found in environment, defaulting to `.'" msgstr "Variable d'environment `HOME' inexistante, `.' utilisé à défaut." #: src/relocate.c:182 msgid "" "It looks like the game is not correctly installed.\n" "Maybe the data files have not been installed with the same configure " "options\n" "as the executable, or maybe the data files have been moved elsewhere.\n" "In the latter case it's probably enough to set the environment variable\n" "HEROES_PREFIX to the new location. You may also want to set\n" "HEROES_DEBUG=system to see what files Heroes is looking after.\n" "If none of this helps, contact \n" msgstr "" "On dirait que le jeu n'est pas correctement installé.\n" "Peut-être que les fichiers de données n'ont pas été installés\n" "en passant à configure les mêmes options que celles utilisées\n" "pour construire l'exécutable, ou peut-être que les données\n" "ont été déplacées ailleurs. Dans ce dernier cas il est probablement\n" "suffisant de définir la variable d'environement HEROES_PREFIX avec\n" "le nouvel emplacement. Vous voudrez peut-être aussi définir\n" "HEROES_PREFIX=system pour voir quels fichiers Heroes cherche.\n" "Si rien de tout cela ne vous aide, écrivez à \n" ".\n" #: src/rsc_files.c:31 #, c-format msgid "%s: no such resource, possible misspelling of '%s'." msgstr "%s: pas de telle ressource, vous vouliez peut-être '%s'." #: src/rsc_files.c:34 #, c-format msgid "%s: no such resource." msgstr "%s: aucune ressource de ce nom" #: src/rsc_files.c:149 #, c-format msgid "%s: null resource" msgstr "%s: ressource nulle" #: src/rsc_files.c:151 #, c-format msgid "%s: empty resource" msgstr "%s: ressource vide" #: src/savegame.c:90 src/scores.c:103 #, c-format msgid "cannot write %s" msgstr "impossible d'ouvrir %s" #: src/savegame.c:95 src/scores.c:107 #, c-format msgid "%s: truncate error" msgstr "%s: erreur de troncation" #: src/savegame.c:126 #, c-format msgid "%s:%d: parse error. Clearing saved-games table." msgstr "%s:%d: erreur de syntaxe. La table des sauvegarde a été vidée." #: src/scores.c:150 #, c-format msgid "%s:%d: parse error. Clearing score table." msgstr "%s:%d: erreur de syntaxe. La table des scores a été vidée." #: src/userconf.c:82 src/userconf.c:115 #, c-format msgid "%s:%d: missing variable name" msgstr "%s:%d: il manque le nom de la variable" #: src/userconf.c:107 #, c-format msgid "%s:%d: missing resource name" msgstr "%s:%d: il manque le nom de la ressource" #: src/userconf.c:131 src/userconf.c:145 #, c-format msgid "%s:%d: %s: can only be used from the system configuration file" msgstr "%s:%d: %s: can only be used from the system configuration file" #: src/userconf.c:140 src/userconf.c:154 #, c-format msgid "%s:%d: %s: unknown value: %s" msgstr "%s:%d: %s: valeur inconnue: %s" #: src/userconf.c:158 #, c-format msgid "%s:%d: unknown keyword `%s'" msgstr "%s:%d: mot clef inconnu `%s'" #: src/debughash.gperf:45 msgid "all messages" msgstr "tous les messages" #: src/debughash.gperf:46 msgid "different parts of the game" msgstr "différentes parties du jeu" #: src/debughash.gperf:47 msgid "system related messages" msgstr "messages relatifs au système" #: src/debughash.gperf:48 msgid "filename resources handling" msgstr "gestion des resources de noms de fichiers" #: src/debughash.gperf:49 msgid "files and directories handling" msgstr "gestion des fichiers et répertoires" #: src/debughash.gperf:50 msgid "levels handling" msgstr "gestion des niveaux" #: src/debughash.gperf:51 msgid "sound track events" msgstr "évènements musicaux" #: src/debughash.gperf:52 msgid "sound effects events" msgstr "évènements liés aux bruitages" #: src/debughash.gperf:53 msgid "communication with the display driver" msgstr "communication avec le pilote d'affichage" #: src/debughash.gperf:54 msgid "joystick initialization and events" msgstr "initialization et évènements du joystick" #: src/debughash.gperf:55 msgid "timer handling" msgstr "gestion des temporisateurs" #: src/debughash.gperf:56 msgid "miscellaneous events" msgstr "évènements divers" #: src/debughash.gperf:57 msgid "palette fade events" msgstr "dégradés de palettes" #: src/debughash.gperf:58 msgid "bonus" msgstr "bonus" #: src/debughash.gperf:87 #, c-format msgid "%s: no such channel, assuming you meant '%s'." msgstr "%s : pas de tel cannal, je considère que vous vouliez '%s'." #: src/debughash.gperf:90 #, c-format msgid "%s: no such channel (--list=debug will list all known channels)" msgstr "" "%s : pas de tel cannal (--list=debug affichera la liste les cannaux " "existants)" #: src/media/sfx.c:94 #, c-format msgid "" "Cannot open %s, disabling sound-effects\n" "(run with -X to supress this message)." msgstr "" "Impossible d'ouvrir %s, les bruitages sont désactivés.\n" "(lancez avec -X pour supprimer ce message)." #: src/media/sfx.c:260 #, c-format msgid "Unable to load sample %s" msgstr "Impossible de charger l'échantillon %s" #: src/media/allegro/joystick.c:45 src/media/gii/joystick.c:109 #: src/media/sdl/joystick.c:50 msgid "No joystick found (run with `-J' to suppress this message)." msgstr "Pas de manette trouvée (utilisez `-J' pour supprimer ce message)" #: src/media/dummy/strack.c:75 msgid "Heroes has been compiled without sound support." msgstr "Heroes à été compilé sans support du son." #. FIXME: ask to send a bug report with a trace #: src/media/ggi/video.c:174 msgid "failed to get any direct buffer for this visual" msgstr "" "impossible d'obtenir un accès direct au tampon d'affichage de ce visuel" #. TRANS: a `visual' is associated by LibGGI to a display. You can #. actually call it a `display', this makes no big difference. #: src/media/ggi/video.c:196 msgid "failed to open visual." msgstr "echec lors de l'ouverture du visuel." #: src/media/ggi/video.c:204 msgid "cannot setup a correct display." msgstr "impossible de configurer un affichage correct." #: src/media/ggi/video.c:211 #, fuzzy, c-format msgid "negotiated video mode is too small (width=%d, height=%d)" msgstr "le mode vidéo négocié est trop petit (largeur=%d, hauteur=%d)" #. TRANS: `display-memory' is the name of a LibGGI driver and #. make no sense to translate. #: src/media/ggi/video.c:224 msgid "Failed to open an internal `display-memory' visual." msgstr "Echec lors de l'ouverture du visuel interne `display-memory'." #: src/media/ggi/video.c:226 msgid "Failed to set 320x200x8 mode on display-memory" msgstr "Impossible d'ouvrir le visuel `display-memory' en 320x200x8" #: src/media/ggi/video.c:304 msgid "failed to acquire direct-buffer" msgstr "impossible d'obtenir un accès direct au tampon d'affichage" #: src/media/ggi/video.c:321 msgid "failed to release direct-buffer" msgstr "impossible de libérer l'accès direct au tampon d'affichage" #: src/media/gii/joystick.c:96 #, c-format msgid "unexpected event %d\n" msgstr "évènements inattendu %d\n" #: src/media/mikmod/strack.c:104 #, c-format msgid "" "Could not initialize sound, reason: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Impossible d'initialiser le son, raison: %s\n" "Le son est désactivé (utilisez -S pour supprimer ce message)." #: src/media/mikmod/strack.c:114 msgid "" "Could not initialize sound, reason: LibMikMod is not thread safe.\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Impossible d'initialiser le son, raison: LibMikMod ne supporte pas les " "threads.\n" "Le son est désactivé (utilisez -S pour supprimer ce message)." #: src/media/mikmod/strack.c:149 src/media/sdl_mixer/strack.c:133 #, c-format msgid "Could not load %s, reason: %s" msgstr "Impossible de charger %s, reason: %s" #: src/media/mikmod/strack.c:214 #, c-format msgid "LibMikMod version %ld.%ld.%ld\n" msgstr "LibMikMod version %ld.%ld.%ld\n" #: src/media/mikmod/strack.c:217 #, c-format msgid "" "\n" "Available drivers:\n" "%s\n" msgstr "" "\n" "Pilotes disponibles :\n" "%s\n" #: src/media/mikmod/strack.c:233 #, c-format msgid "" "Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information." msgstr "" "L'argument '%s' est en dehors des bornes, il doit être entre %d et %d.\n" "Utilisez '%s --help' pour plus d'information." #: src/media/sdl/video.c:114 #, c-format msgid "Failed to open visual: %s" msgstr "Impossible d'ouvrir le visuel : %s" #: src/media/sdl_mixer/strack.c:95 #, c-format msgid "" "Couldn't open audio: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Impossible d'initialiser le son : %s\n" "Le son est désactiver (utilisez -S pour supprimer ce message)." #: src/media/sdl_mixer/strack.c:171 msgid "" "Heroes has been compiled with SDL_mixer, there is no driver list available." msgstr "" "Heroes à été compilé avec avec SDL_mixer, il n'y a pas de liste de pilotes\n" "disponibles." #: src/media/sdl_mixer/strack.c:187 #, c-format msgid "%s: missing parameter for 'freq'" msgstr "%s: il manque un paramètre pour 'freq'" #: src/media/sdl_mixer/strack.c:193 #, c-format msgid "%s: missing parameter for `buffers'" msgstr "%s: il manque un paramètre pour `buffers'" #: src/media/sdl_mixer/strack.c:195 #, c-format msgid "%s: recognized sound options are freq=nnn and buffers=nnn" msgstr "%s: les options reconnues sont freq=nnn et buffers=nnn" #~ msgid "" #~ "Use `-lWORD' or `--list=WORD' where WORD can be:\n" #~ " debug display all debugging channels\n" #~ " preferences print the preferences settings\n" #~ " resources print the resources list\n" #~ " sound-drivers print the sound driver list\n" #~ " sound-tracks\t\tprint the sound track list" #~ msgstr "" #~ "Utilisez `-lMOT' ou `--list=MOT' où MOT peut être :\n" #~ " debug afficher les cannaux de deboggage\n" #~ " preferences afficher les preferences enregistrées\n" #~ " resources afficher la liste des resources\n" #~ " sound-drivers afficher la liste des pilotes sonores\n" #~ " sound-tracks afficher les musiques" #~ msgid "Error %d during loading level" #~ msgstr "Erreur %d pendant le chargement du niveau" #~ msgid "Error %d occured while loading level %s" #~ msgstr "L'erreur %d est survenue pendant le chargement du niveau %s" #~ msgid "Cannot open %s." #~ msgstr "Impossible d'ouvrir %s." #~ msgid "" #~ "\n" #~ "%{img C 444 0 40 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{center}%pUse the arrow keys to scroll up and down.\n" #~ "\n" #~ "%{head 1}CONTROL & BOARD\n" #~ "\n" #~ "%{img C 357 55 80 205}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{img CG 486 0 140 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ msgstr "" #~ "\n" #~ "%{img C 444 0 40 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{center}%pUtilisez les fleches pour vous deplacer verticalement.\n" #~ "\n" #~ "%{head 1}CONTROLE & INDICATEURS\n" #~ "\n" #~ "%{img C 357 55 80 205}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{img CG 486 0 140 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ msgid "Unknown image flag '%c'." #~ msgstr "Option d'image inconnue '%c'." #~ msgid "GFX AND IDEA:" #~ msgstr "GRAPH & IDEE:" #~ msgid "MUSIC:" #~ msgstr "MUSIQUE:" #~ msgid "CODE:" #~ msgstr "CODE:" #~ msgid "PLEASE READ THE LIST OF OTHER CONTRIBUTORS IN THE FILE 'THANKS'" #~ msgstr "LES AUTRES CONTRIBUTEURS SONT LISTES DANS LE FICHIER 'THANKS'" heroes-0.21/po/it.po0000644004117000411500000013611007451377060010005 # Messaggi in italiano per Heroes. # Copyright (C) 2001 Free Software Foundation, Inc. # Alessandro Dotti , 2001. # msgid "" msgstr "" "Project-Id-Version: Heroes 0.9\n" "POT-Creation-Date: 2002-03-30 18:44+0100\n" "PO-Revision-Date: 2001-04-27 21:15+01:00\n" "Last-Translator: Alessandro Dotti \n" "Language-Team: none \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1\n" #: lib/error.c:129 lib/error.c:157 msgid "Unknown system error" msgstr "Errore di sistema sconosciuto" #: lib/getopt.c:694 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: l'opzione `%s' è ambigua\n" #: lib/getopt.c:719 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: l'opzione `--%s' non accetta argomenti\n" #: lib/getopt.c:724 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: l'opzione `%c%s' non accetta argomenti\n" #: lib/getopt.c:742 lib/getopt.c:915 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: l'opzione `%s' richiede un argomento\n" #. --option #: lib/getopt.c:771 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: opzione non riconosciuta `--%s'\n" #. +option or -option #: lib/getopt.c:775 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: opzione non riconosciuta `%c%s'\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:801 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: opzione illegale -- %c\n" #: lib/getopt.c:804 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: opzione non valida -- %c\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:834 lib/getopt.c:964 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: l'opzione richiede un argomento -- %c\n" #: lib/getopt.c:881 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: l'opzione `-W %s' è ambigua\n" #: lib/getopt.c:899 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: l'opzione `-W %s' non accetta argomenti\n" #. If XALLOC_FAIL_FUNC is NULL, or does return, display this message #. before exiting when memory is exhausted. Goes through gettext. #: lib/xmalloc.c:66 msgid "memory exhausted" msgstr "memoria esaurita" #: src/argv.c:60 #, c-format msgid "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux and Philippe Meisburger.\n" msgstr "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux e Philippe Meisburger.\n" #: src/argv.c:63 src/heroeslvl.c:64 msgid "" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." msgstr "" "Questo è software libero; consultate il codice sorgente per le modalità di " "copia.\n" "Non vi è ALCUNA garanzia, nemmeno per ciò che riguarda la COMMERCIABILITA',\n" "o LA RISPOSTA AD UNO SCOPO PRECISO." #: src/argv.c:74 msgid "Use `-lWORD' or `--list=WORD' where WORD can be:" msgstr "" #: src/argv.c:76 msgid "display all debugging channels" msgstr "" #: src/argv.c:78 #, fuzzy msgid "list all level files" msgstr "%s: file di livello no valido" #: src/argv.c:80 msgid "print the preferences settings" msgstr "" #: src/argv.c:82 #, fuzzy msgid "print the resources list" msgstr "gestione dei nomi dei file" #: src/argv.c:84 msgid "print the sound driver list" msgstr "" #: src/argv.c:86 #, fuzzy msgid "print the sound track list" msgstr "eventi sonori" #: src/argv.c:145 src/heroeslvl.c:74 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "" #: src/argv.c:150 #, c-format msgid "" "Usage: %s [OPTIONS]...\n" "\n" msgstr "" "Uso: %s [OPZIONI]...\n" "\n" #: src/argv.c:151 msgid "" "Heroes is a game similar to the \"Tron\" and \"Nibbles\" games of yore\n" "but includes many graphical improvements and new game features.\n" msgstr "" "Heroes è un gioco simile ai vecchi \"Tron\" e \"Nibble\"\n" "ma più elaborato e con diversi miglioramenti grafici\n" #: src/argv.c:154 src/heroeslvl.c:81 msgid "" "Mandatory arguments to long options are mandatory for short options too.\n" msgstr "" "Gli argomenti obbligatori per le opzioni estese lo sono anche per le opzioni " "brevi\n" #: src/argv.c:156 msgid "" "General options:\n" " -v, --version display version number\n" " -h, --help display this help\n" " -q, --quiet don't print warning messages\n" " -Q, --really-quiet don't even print error messages\n" " -v, --verbose=CHANNELS enable or disable debugging channels\n" " (see --list=debug for available channels)\n" " -l, --list=WORD show some internal information; WORD can be\n" " 'debug', 'resources', 'sound-drivers' or\n" " 'sound-tracks'\n" msgstr "" "Opzioni generali:\n" " -v, --version \t\tmostra il numero di versione\n" " -h, --help\t\t\tmostra questo aiuto\n" " -q, --quiet\t\t\tnon mostra i messaggi di avvertimento\n" " -Q, --really-quiet\t\tnon mostra nemmeno i messaggi di errore\n" " -V, --verbose=CHANNELS\tabilita o disabilita i canali di debugging\n" "\t\t\t\t(--list=debug per i canali disponibili)\n" " -l, --list=WORD\t\tmostra alcune informazioni interne\n" "\t\t\t\tWORD può assumere i valori: 'debug', 'resources',\n" "\t\t\t\t'sound-drivers' o 'sound-tracks'\n" #: src/argv.c:167 msgid "" "Sound options:\n" " -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:" "autodetect)\n" " (see --list=sound-drivers for available Ns)\n" " -S, --no-sound disable sound\n" " -X, --no-sfx disable sound-effects\n" " -m, --mono non-stereo output\n" " -8, --8bits 8bits sound output\n" " -i, --high-quality high quality mixer\n" msgstr "" "Opzioni audio\n" " -d, --driver=N[,OPZIONI]\tusa il driver N per l'output sonoro (0:rileva " "automaticamente)\n" "\t\t\t\t(--list=sound-drivers per i valori di N disponibili)\n" " -S, --no-sound\t\tdisabilita il sonoro\n" " -X, --no-sfx\t\t\tdisabilita gli effetti sonori\n" " -m, --mono\t\t\toutput non stereo\n" " -8, --8bits\t\t\toutput sonoro a 8 bit\n" " -i, --high-quality\t\tmixer ad alta qualità\n" #: src/argv.c:176 msgid "" "Display options:\n" " -G, --gfx-options=OPTIONS pass OPTIONS to the display driver\n" " -F, --full-screen full screen mode\n" " -2, --double stretch the display twofold\n" " -3, --triple stretch the display threefold\n" " -4, --quadruple stretch the display fourfold\n" " -e, --even-lines display only even-lines\n" msgstr "" "Opzioni video:\n" " -G, --gfx-options=OPZIONI\tpassa le OPZIONI al driver video\n" " -F, --full-screen\t\tmodalità a tutto schermo\n" " -2, --double\t\t\tradoppia le dimensioni dello schermo\n" " -3, --triple\t\t\ttriplica le dimensioni dello schermo\n" " -4, --quadruple\t\tquadruplica le dimensioni dello schermo\n" " -e, --even-lines\t\tmostra solo le linee pari\n" #. TRANS: rotozoom is a graphical effect used in the demo of yore #. where the screen rotate and zoom (actually it doesn't zoom in Heroes); #. waves is another effect where the screen is agitated like some #. jelly (this was also called the `mushroom effect' in game like #. Death Rally). #: src/argv.c:189 msgid "" "Miscellaneous options:\n" " --cpu-off disable computer opponents\n" " --default-scores restore default scores file\n" " --default-options restore default options file\n" " --default-saves restore default saves file\n" " -s, --swap-sides swap sides in two player mode\n" " --no-double-fx disable combination of rotozoom and waves\n" " -g, --go skip the introduction\n" " -J, --no-joystick disable joystick handling\n" msgstr "" "Opzioni varie:\n" " --cpu-off \t\tdisabilita gli avversari controllati dal\n" "\t\t\t\tcomputer\n" " --default-scores\t\tripristina i punteggi standard\n" " --default-options \tripristina le opzioni standard\n" " --default-saves\t\tripristina i salvataggi standard\n" " -s, --swap-sides\t\tscambia i lati in modalità due giocatori\n" " --no-double-fx\t\tdisabilta la combinazione degli effetti di\n" "\t\t\t\trotazione e ondeggiamento\n" " -g, --go\t\t\tsalta l'introdzione\n" " -J, --no-joystick\t\tdisabilita il joystick\n" #: src/argv.c:199 msgid "" "These options can be set in your file ~/.heroes/heroesrc (which is read\n" "before parsing other command line options) using a line like the following:\n" "\n" " Options: -gs -d3,buffer=11,count=4\n" msgstr "" "Queste opzioni possono essere impostate nel file ~/.heroes/heroesrc\n" "(che viene letto prima di esaminare le opzioni da linea di comando)\n" "utilizzando linee del tipo:\n" " Options: -gs -d3,buffer=11,count=4\n" #: src/argv.c:204 msgid "" "Visit http://heroes.sourceforge.net/ for news, documentation, and updates." msgstr "" "Visitate il sito http://heroes.sourceforge.net/ per informazioni, " "documentazione e\n" "aggiornamenti." #: src/argv.c:206 src/heroeslvl.c:102 msgid "Report bugs to ." msgstr "Segnalate errori e anomalie a ." #: src/argv.c:312 msgid "-n is an obsolete option, you should use --list=sound-drivers" msgstr "-n è un'opzione obsoleta, dovresti usare --list=sound-divers" #: src/bonus.c:324 src/bonus.c:329 #, c-format msgid "SIZE IS %d" msgstr "DIMENSIONE %d" #: src/bonus.c:334 msgid "SPEEDED UP" msgstr "ACCELLERAZIONE" #: src/bonus.c:338 msgid "SPEEDED DOWN" msgstr "RALLENTAMENTO" #: src/bonus.c:345 #, c-format msgid "GET %dPTS" msgstr "%d PUNTI" #: src/bonus.c:350 msgid "FIRE TRAIL!" msgstr "" #: src/bonus.c:364 msgid "GET TURBO+" msgstr "TURBO+" #: src/bonus.c:371 msgid "GET TURBO-" msgstr "TURBO-" #: src/bonus.c:379 msgid "INVINCIBLE!" msgstr "INVINCIBILE" #: src/bonus.c:391 msgid "EXTRA-LIFE!" msgstr "VITA EXTRA" #: src/endscroll.c:113 msgid "THE END" msgstr "FINE" #: src/fontdata.c:243 #, c-format msgid "character '%c' is not drawable (in message '%s')" msgstr "il carattere '%c' non può essere disegnato (nel messaggio '%s')" #: src/hedlite.c:1622 #, c-format msgid "Cannot create directory `%s'." msgstr "Impossibile creare la directory `%s'." #: src/hedlite.c:1679 src/hedlite.c:1686 #, c-format msgid "%s: invalid level file" msgstr "%s: file di livello no valido" #: src/helptext.c:24 msgid "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "\n" "%{center}%pUse the arrow keys to scroll up and down.\n" "\n" "%{head 1}CONTROL & BOARD\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSE\n" "%{textat cR -9 97}%yQUIT GAME\n" "%{textat cR 26 -62}%yCONTROL\n" "%{textat cL 30 74}%ySTOP\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%ySCORE\n" "%{textat cR 1 8}%yCOMMENTARY\n" "%{textat cL 16 29}%yHEROES\n" "%{textat cL 33 29}%yWALLS\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yLIFES\n" "%{textat cL 51 -109}%yTURBO ENERGY\n" "%{textat cL 72 -104}%yTIME\n" "%{textat cR 96 40}%yPLAYER COLOR\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" msgstr "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "\n" "%{center}%pUsa le frecce per muoverti.\n" "\n" "%{head 1}CONTROLLI & INDICATORI\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSA\n" "%{textat cR -9 97}%yESCI\n" "%{textat cR 26 -62}%yCONTROLLI\n" "%{textat cL 30 74}%ySTOP\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%yPUNTEGGIO\n" "%{textat cR 1 8}%yCOMMENTI\n" "%{textat cL 16 29}%yHEROES\n" "%{textat cL 33 29}%yMURI\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yVITE\n" "%{textat cL 51 -109}%yTURBO\n" "%{textat cL 72 -104}%yTEMPO\n" "%{textat cR 96 40}%yCOLORE DEL GIOCATORE\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" #: src/helptext.c:71 #, fuzzy msgid "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Affects the player that gets the item\n" "%{img L 60 22 20 22}Affects all players except the one who gets the bonus\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points\n" "%{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions\n" "\n" msgstr "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Concerne il giocatore che raccoglie l' elemento\n" "%{img L 60 22 20 22}Concerne tutti i giocatori tranne quello che ottiene il " "bonus\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Coda +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Coda -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Accellerazione\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Rallentamento\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Bonus casuale\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Punti\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Controlli invertiti\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Potenza +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Potenza -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}Fine del livello\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerabilita'\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotazione\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Vite extra\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Visione ondulata\n" "\n" #: src/helptext.c:99 msgid "" "%{head 3}GAME MODES\n" "\n" "%{>>}%yQUEST\n" "\n" "%{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers " "you. Your aim is to collect a given number (10) of Trail+1 bonuses and then " "to get the End-of-Level bonus that will send you to next level.\n" "%{>>>}%{img L 20 176 20 22}End-of-Level\n" "%{img R 0 0 20 22}%{flushright}Trail+1\n" "%{>>>}Trail+1 has the effect of growing your trail. There are two way to " "get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first " "appears when someone's trail reach 10 units.\n" "\n" "%{>>}%yDEATH MATCH\n" "\n" "%{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a " "fight to death. The aim of the game is to be the last player still alive. " "For this, feel free to use any stratagems you want. Nothing is forbidden.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL\n" "\n" "%{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm " "all the people of your competitors. It was said \"There can be only one\", " "make sure it is yours!\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}They are among us, find them !\n" "\n" "%{>>}%yCOLOR\n" "\n" "%{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time " "to get a maximum of gems of your color. Beware, if you go over your " "competitor's gems, it's your competitor's gem account that you will " "increase. Be also sure not to get crossed gems because you'll lose " "collected gems. Grey ones gives gems to all players except the one that " "goes over it. The Clocks give you extra time.\n" "\n" "%{>>}%yTIME CA$H\n" "\n" "%{>>>}In %yTIME CA$H%w mode the winner is the player who collected the " "largest amount of money.\n" "\n" msgstr "" "%{head 3}MODALITA' DI GIOCO\n" "\n" "%{>>}%yRICERCA\n" "\n" "%{>>>}La modalita' %yRICERCA%w ti permette di giocare i 100 livelli che " "HEROES offre. Il tuo scopo e' collezzionare un dato numero (10) di bonus " "\"Coda +1\" e quindi prendere il bonus \"Fine di livello\" per accedere al " "livello successivo\n" "%{>>>}%{img L 20 176 20 22}Fine di livello\n" "%{img R 0 0 20 22}%{flushright}Coda +1\n" "%{>>>}Coda +1 fa aumentare la tua coda. Ci sono due modi per ridurne la " "dimensione: prendere un Coda-1 o perdere una vita. Il bonus \"Fine di livello" "\" appare quando la coda di un giocatore raggiunge le dieci unita'.\n" "\n" "%{>>}%ySCONTRO MORTALE\n" "\n" "%{>>>}La modalita' %ySCONTRO MORTALE%w ti consente di affrontare gli altri " "giocatori in un combattimento all'ultimo sangue. Lo scopo del gioco e' " "quello di essere l'unico giocatore a rimanere in vita. Quindi, sentiti " "libero di usare qualsiasi stratagemma. Nulla e' proibito\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yAMMAZZALI TUTTI\n" "\n" "%{>>>}Nella modalita' %yAMMAZZALI TUTTI%w esiste un'unica regola: devi " "sconfiggere tutti i tuoi avversari. Si dice \"Ne restera' uno solo\", fai in " "modo di essere tu!\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}Sono fra noi, trovali!\n" "\n" "%{>>}%yCOLORI\n" "\n" "%{>>>}La modalita' %yCOLORI%w e' molto semplice. Hai un tempo prefissato per " "raccogliere il maggior numero di gemme del tuo colore. Attenzione! Se " "raccogli una gemme del colore di un avversario, sara' il suo numero di gemme " "che andrai ad incrementare. Stai inoltre attento a non raccogliere gemme con " "una croce perche' perderai le gemme raccolte. Le gemme grigie incrementano " "il conto di tutti i giocatori tranne di quello che le raccoglie. Gli orologi " "danno tempo extra.\n" "\n" "%{>>}%yIL TEMPO E' DENARO\n" "\n" "%{>>>}Nella modalita' %yIL TEMPO E' DENARO%w il vincitore e' colui che " "raccoglie il maggior numero di \"monete\".\n" "\n" #: src/helptext.c:145 #, fuzzy msgid "" "%{head 4}GAME OPTIONS\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gCOLOR SELECT\n" "\n" "%{>>>}This option allows you to choose the color of your vehicle between %" "pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gGAME SPEED\n" "\n" "%{>>>}The %gGAME SPEED%w option allows you to select the initial speed of " "the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gROUNDS\n" "\n" "%{>>>}The %gROUNDS%w option allows you to select the number of rounds in the " "tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. These " "values range from 1 to 100 rounds.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMATION\n" "\n" "%{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better " "visibility.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gLIGHTING\n" "\n" "%{>>>}The %gLIGHTING%w option is here to tune the luminosity of your " "screen.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gINERTIA\n" "\n" "%{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOT\n" "\n" "%{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, rest in " "peace... Note that %gAUTOPILOT%w does not work against fire trails.\n" "\n" msgstr "" "%{head 4}OPZIONI DI GIOCO\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gSELEZIONE DEL COLORE\n" "\n" "%{>>>}Questa opzione ti consente di scegliere il colore del tuo veicolo tra %" "pROSA%w, %yGIALLO%w, %bBLU%w and %gVERDE%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gVELOCITA' DI GIOCO\n" "\n" "%{>>>}Questa opzione ti consente di scegliere la velocita' inziale del " "veicolo. I tre valori disponibili sono: NORMALE, ESPERTO, EROE.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gROUND\n" "\n" "%{>>>}Questa opzione ti permettere di scegliere il numero di round nelle " "modalita' torneo: SCONTRO MORTALE, AMMAZZALI TUTTI, COLORI e IL TEMPO E' " "DENARO. Il valore varia da 1 a 100 round.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMAZIONI\n" "\n" "%{>>>}Puoi disabilitare il radar e le informazioni per migliorare la " "visibilita'.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gLUMINOSITA'\n" "\n" "%{>>>}Questa opzione consente di regolare la luminosita' dello schermo.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gINERZIA\n" "\n" "%{>>>}Questo parametro abilita o disabilita l'inerzia di scorrimento.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOTA\n" "\n" "%{>>>}Se sei pazzo, puoi provare a giocare senza usare l'Autopilota. Riposa " "in pace...\n" "\n" #: src/helptext.c:191 msgid "" "%{head 1}CONTACT\n" "\n" "%{center}home page:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}send bug reports to:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" msgstr "" "%{head 1}CONTATTI\n" "\n" "%{center}home page:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}Riportate eventuali errori a:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" #: src/helptext.c:204 msgid "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's " "environmental and ecological issues and did our best to use only recycled " "bytes in this program.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux and Philippe Meisburger.\n" "\n" msgstr "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} Noi ci preoccupiamo degli odierni " "problemi ecologici ed ambientali, e facciamo del nostro meglio per " "utilizzare solo byte riciclati in questo programma.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux e Philippe Meisburger.\n" "\n" #: src/heroes.c:677 src/heroes.c:763 #, c-format msgid "Cannot load level %s (error %d)" msgstr "" #: src/heroes.c:1969 #, c-format msgid "INVERTED %d" msgstr "INVERTITO %d" #: src/heroes.c:2003 #, c-format msgid "STOPPED %d" msgstr "FERMATO %d" #. TRANS: %d, the number of remaining lives, is always #. positive. #: src/heroes.c:2300 msgid "LAST LIFE" msgid_plural "%d LIVES LEFT" msgstr[0] "ULTIMA VITA" msgstr[1] "%d VITE RIMASTE" #: src/heroes.c:2873 msgid "Error during level loading" msgstr "Errore durante il caricamento del livello" #: src/heroes.c:2909 #, c-format msgid "-LEVEL %d-" msgstr "-LIVELLO %d-" #: src/heroes.c:2911 #, c-format msgid "-ROUND %d/%d-" msgstr "-ROUND %d/%d-" #: src/heroes.c:3416 msgid "error in sfx.cfg" msgstr "errore in sfx.cfg" #: src/heroeslvl.c:63 #, c-format msgid "Copyright (C) %d Alexandre Duret-Lutz.\n" msgstr "" #: src/heroeslvl.c:79 #, fuzzy, c-format msgid "" "Usage: %s [OPTIONS]... levels\n" "\n" msgstr "" "Uso: %s [OPZIONI]...\n" "\n" #: src/heroeslvl.c:80 msgid "Heroeslvl is a tool used to inspect Heroes' level files.\n" msgstr "" #: src/heroeslvl.c:83 msgid " -v, --version display version number" msgstr "" #: src/heroeslvl.c:85 msgid " -h, --help display this help" msgstr "" #: src/heroeslvl.c:87 msgid "" " -p, --print=WHAT select information to display. WHAT should " "be\n" " one or more of these characters:" msgstr "" #: src/heroeslvl.c:90 msgid "d print square directions" msgstr "" #: src/heroeslvl.c:91 msgid "f print filename" msgstr "" #: src/heroeslvl.c:92 msgid "h print header" msgstr "" #: src/heroeslvl.c:93 msgid "i print tile details" msgstr "" #: src/heroeslvl.c:94 msgid "t print square type map" msgstr "" #: src/heroeslvl.c:95 msgid "T print type keys" msgstr "" #: src/heroeslvl.c:96 msgid "w print square wall map" msgstr "" #: src/heroeslvl.c:97 msgid "@ print tunnels" msgstr "" #: src/heroeslvl.c:98 msgid " -i, --indent indent everything but the filename" msgstr "" #: src/heroeslvl.c:101 msgid "When no options are given, the default is -ipfh." msgstr "" #: src/heroeslvl.c:201 #, c-format msgid "%sheight:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:203 #, c-format msgid "%swidth:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:206 #, c-format msgid "%sY-wrap:\tno\n" msgstr "" #: src/heroeslvl.c:208 #, c-format msgid "%sY-wrap:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:211 #, c-format msgid "%sX-wrap:\tno\n" msgstr "" #: src/heroeslvl.c:213 #, c-format msgid "%sX-wrap:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:215 #, fuzzy, c-format msgid "%ssound track alias:\t%s\n" msgstr "eventi sonori" #: src/heroeslvl.c:217 #, c-format msgid "%stile map basename:\t%s\n" msgstr "" #: src/heroeslvl.c:219 #, c-format msgid "%sstarting squares and directions (y x dir):\n" msgstr "" #: src/heroeslvl.c:261 msgid "none" msgstr "" #: src/heroeslvl.c:262 msgid "stop" msgstr "" #: src/heroeslvl.c:263 msgid "speed" msgstr "" #: src/heroeslvl.c:264 msgid "tunnel" msgstr "" #: src/heroeslvl.c:265 msgid "boom" msgstr "" #: src/heroeslvl.c:266 msgid "anim" msgstr "" #: src/heroeslvl.c:267 msgid "ice" msgstr "" #: src/heroeslvl.c:268 msgid "dust" msgstr "" #: src/heroeslvl.c:269 msgid "outway" msgstr "" #: src/heroeslvl.c:389 #, c-format msgid "%sTunnels:\n" msgstr "" #. TRANS: This is the header of an array (output by heroeslvl -p@), #. so the position of these words is important. #. #. SRCIDX is a short for 'source index' (entrance of a tunnel) and #. DESTIDX means 'destination index' (output of the tunnel). #: src/heroeslvl.c:395 #, c-format msgid "%s NBR SRCIDX Y X DIR DESTIDX\n" msgstr "" #. TRANS: `still' is used to describe tiles which are not animated. #: src/heroeslvl.c:426 msgid "still" msgstr "" #. TRANS: `loop' is for animated tiles where frames are displayed #. from 1 to n, and then again from 1 to n, etc. #: src/heroeslvl.c:430 msgid "loop" msgstr "" #. TRANS: `pingpong' is for tiles animated in loop where frame #. displayed from 1 to n, then from n to 1, and then again from 1 #. to n, etc. #: src/heroeslvl.c:435 msgid "pingpong" msgstr "" #. TRANS: This is the header of an array (output by heroeslvl -pi) so #. the position of these word is important. #. #. SPRITE is the address of the sprite used to render the tile. OVERLAY #. is the address of a sprite that should be displayed on top #. of the players (e.g. trees). ANIM-TYPE is the kind of animation used #. for the tile, FRM the number of frame to display, DEL the delay #. between each frame. #: src/heroeslvl.c:453 #, c-format msgid "%sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL\n" msgstr "" #: src/heroeslvl.c:503 #, fuzzy, c-format msgid "cannot load %s" msgstr "Impossibile aprire %s" #: src/heroeslvl.c:507 #, c-format msgid "File:\t%s\n" msgstr "" #: src/heroeslvl.c:539 #, fuzzy msgid "Missing filename." msgstr "%s:%d: manca il nome del file" #: src/levellst.c:53 #, fuzzy, c-format msgid "cannot open directory %s" msgstr "Impossibile creare la directory `%s'." #. TRANS: in QUEST mode, the player goes throught all the levels, but #. have to search for specific powerups in order to jump to the next #. level. Hence this is a `quest' for those powerups. #: src/menus.c:146 msgid "QUEST" msgstr "RICERCA" #. TRANS: in DEATH MATCH mode, the user has to kill all other players. #: src/menus.c:148 msgid "DEATH MATCH" msgstr "SCONTRO MORTALE" #. TRANS: in KILL'EM ALL mode there are lemmings moving on the ground #. and the player must run over them all. You may want to translate #. `kill' as `run over', `squash', `mash' or something among those #. lines. #: src/menus.c:153 msgid "KILL'EM ALL" msgstr "AMMAZZALI TUTTI" #. TRANS: in TIME CA$H mode, the player must collect dollars with #. restricted time. #: src/menus.c:156 msgid "TIME CA$H" msgstr "IL TEMPO E' DENARO" #. TRANS: in COLOR mode, the player must collect some colored gems #. with restricted time. #: src/menus.c:159 msgid "COLORS" msgstr "COLORI" #: src/menus.c:192 msgid "GAME" msgstr "GIOCO" #: src/menus.c:193 msgid "SCREEN" msgstr "SCHERMO" #: src/menus.c:194 msgid "SOUND" msgstr "SONORO" #: src/menus.c:195 msgid "CONTROL" msgstr "CONTROLLI" #: src/menus.c:196 msgid "KEYS" msgstr "TASTI" #: src/menus.c:197 msgid "EXTRAS" msgstr "EXTRA" #: src/menus.c:198 src/menus.c:222 src/menus.c:385 src/menus.c:395 #: src/menus.c:409 src/menus.c:421 src/menus.c:431 src/menus.c:454 #: src/menus.c:545 msgid "GO BACK" msgstr "INDIETRO" #. play menu #: src/menus.c:205 src/menus.c:539 msgid "PLAY" msgstr "GIOCA" #. options menu #: src/menus.c:206 src/menus.c:526 msgid "OPTIONS" msgstr "OPZIONI" #: src/menus.c:207 src/menus.c:406 msgid "INFOS" msgstr "INFO" #: src/menus.c:208 msgid "CREDITS" msgstr "CREDITI" #: src/menus.c:209 msgid "SCORES" msgstr "PUNTEGGI" #. editor first menu #: src/menus.c:210 src/menus.c:536 msgid "EDITOR" msgstr "EDITOR" #: src/menus.c:211 msgid "QUIT" msgstr "ABBANDONA" #. TRANS: Create a new level. #: src/menus.c:219 src/menus.c:503 msgid "NEW LEVEL" msgstr "NUOVO LIVELLO" #. TRANS: Load an existing level for edition. #: src/menus.c:221 msgid "LOAD LEVEL" msgstr "CARICA LIVELLO" #: src/menus.c:375 msgid "CONTROL OPTIONS" msgstr "OPZIONI CONTROLLI" #. 1st player #: src/menus.c:377 src/menus.c:416 src/menus.c:433 msgid "PLAYER 1" msgstr "GIOCATORE 1" #: src/menus.c:379 src/menus.c:383 msgid "AUTO PILOT" msgstr "AUTOPILOTA" #. 2nd player #: src/menus.c:381 src/menus.c:417 src/menus.c:441 msgid "PLAYER 2" msgstr "GIOCATORE 2" #: src/menus.c:391 msgid "SOUND OPTIONS" msgstr "OPZIONI SONORE" #: src/menus.c:393 msgid "MUSIC" msgstr "MUSICA" #: src/menus.c:394 msgid "SFX" msgstr "EFF. SONORI" #: src/menus.c:398 msgid "MUSIC VOL" msgstr "VOL. AUDIO" #: src/menus.c:399 msgid "SFX VOL" msgstr "VOL. EFFETTI" #: src/menus.c:403 msgid "SCREEN OPTIONS" msgstr "OPZIONI SCHERMO" #: src/menus.c:405 msgid "RADAR" msgstr "RADAR" #: src/menus.c:407 msgid "LIGHTING" msgstr "LUMINOSITA'" #: src/menus.c:408 msgid "INERTIA" msgstr "INERZIA" #: src/menus.c:414 msgid "GAME OPTIONS" msgstr "OPZIONI DI GIOCO" #: src/menus.c:418 msgid "PLAYER 3" msgstr "GIOCATORE 3" #: src/menus.c:419 msgid "PLAYER 4" msgstr "GIOCATORE 4" #: src/menus.c:420 msgid "SPEED" msgstr "VELOCITA'" #: src/menus.c:429 msgid "KEYBOARD DEFS" msgstr "CONFIG TASTI" #: src/menus.c:434 src/menus.c:442 msgid "UP" msgstr "SU" #: src/menus.c:435 src/menus.c:443 msgid "LEFT" msgstr "SINISTRA" #: src/menus.c:436 src/menus.c:444 msgid "DOWN" msgstr "GIU" #: src/menus.c:437 src/menus.c:445 msgid "RIGHT" msgstr "DESTRA" #: src/menus.c:438 src/menus.c:446 msgid "TURBO" msgstr "TURBO" #: src/menus.c:439 src/menus.c:447 msgid "STOP" msgstr "STOP" #: src/menus.c:452 msgid "EXTRAS LEVELS" msgstr "LIVELLI EXTRA" #: src/menus.c:456 msgid "ORIGINAL LEVELS" msgstr "LIVELLI ORIGINALI" #: src/menus.c:458 msgid "ORIGINAL+EXTRAS" msgstr "ORIGINALI+EXTRA" #: src/menus.c:460 msgid "EXTRAS ONLY" msgstr "SOLO EXTRA" #: src/menus.c:462 msgid "EXTRAS: NONE" msgstr "EXTRA: NESSUNO" #: src/menus.c:464 msgid "EXTRAS: ALL" msgstr "EXTRA: TUTTI" #: src/menus.c:466 msgid "EXTRAS: SELECT" msgstr "EXTRA: SCEGLI" #. pause menu #: src/menus.c:491 msgid "PAUSE" msgstr "PAUSA" #. quit y/n menus #: src/menus.c:495 msgid "QUIT THIS GAME?" msgstr "ESCI DAL GIOCO?" #: src/menus.c:497 msgid "REALLY QUIT?" msgstr "ESCI DAVVERO?" #: src/menus.c:499 msgid "NO" msgstr "NO" #: src/menus.c:500 msgid "YES" msgstr "SI" #: src/menus.c:505 msgid "EXISTING LEVEL" msgstr "LIVELLI ESISTENTI" #: src/menus.c:507 msgid "NAME" msgstr "NOME" #. TRANS: in wrapped levels are unbounded level, e.g. whenever the #. player reach the left border it continue its way from the right border #. (except that the player doesn't even know there are borders, because #. the level is tiled infinitely). In unwrapped levels there are explicit #. bounds that you cannot cross. X-WRAP is a check box used to specified #. whether a level must be wrapped horizontally or not when creating a #. new level. #: src/menus.c:515 msgid "X-WRAP" msgstr "X CONT." #. TRANS: Y-WRAP is a check box used to specified whether a level #. must be wrapped vertically or not. #: src/menus.c:518 msgid "Y-WRAP" msgstr "Y CONT." #. TRANS: width of the level #: src/menus.c:520 msgid "X-SIZE" msgstr "LAR. LIV." #. TRANS: height of the level #: src/menus.c:522 msgid "Y-SIZE" msgstr "ALT. LIV." #: src/menus.c:523 msgid "EDIT" msgstr "MOD." #. main menu #: src/menus.c:529 msgid "HEROES" msgstr "HEROES" #. editor selector #: src/menus.c:532 msgid "SELECT A LEVEL" msgstr "SCEGLI UN LIVELLO" #: src/menus.c:541 msgid "ONE PLAYER" msgstr "UN GIOCATORE" #: src/menus.c:543 msgid "TWO PLAYERS" msgstr "DUE GIOCATORI" #: src/menus.c:547 msgid "LOAD..." msgstr "CARICA..." #. saved game selection #: src/menus.c:556 msgid "CHOOSE A SAVE SLOT" msgstr "SLOT DI SALVATAGGIO" #: src/menus.c:558 msgid "CHOOSE A LOAD SLOT" msgstr "SLOT DA CARICARE" #. enter your name #: src/menus.c:562 msgid "ENTER YOUR NAME:" msgstr "INSERISCI IL NOME:" #. end level info #. TRANS: SIZE is the size of the player trail, PTS the #. number of PoinTS #: src/menus.c:568 msgid "SIZE PTS LIVES" msgstr "DIM PNT VITE" #: src/menus.c:570 msgid "PTS LIVES" msgstr "PNT VITE" #. TRANS: this is for KILL'EM ALL mode, and MEN is the number #. of lemmings killed by one player #: src/menus.c:574 msgid " MEN PTS LIVES" msgstr " UCCISI PNT VITE" #: src/menus.c:576 msgid "CA$H PTS LIVES" msgstr "DENARO PNT VITE" #: src/menus.c:578 msgid "COLORS PTS LIVES" msgstr "COLORI PNT VITE" #: src/menus.c:583 msgid "NEXT LEVEL" msgstr "PROX LIVELLO" #. TRANS: this is a menu entry that introduce the user to another #. menu. This is NOT displayed DURING saving. #: src/menus.c:588 msgid "SAVE..." msgstr "SALVATAGGIO..." #: src/menus.c:593 msgid "PRESS RETURN" msgstr "PREMI INVIO" #: src/menus.c:602 msgid "WINS PTS LIVES" msgstr "VINTE PNT VITE" #. higher scores #: src/menus.c:613 msgid "HIGHER SCORES" msgstr "PUNTEGGI MIGLIORI" #: src/menus.c:1231 #, c-format msgid "%d ROUND" msgid_plural "%d ROUNDS" msgstr[0] "%d ROUND" #: src/menus.c:2220 #, c-format msgid "PLAYER %d, YOU CAME IN THE TOP 10" msgstr "GIOCATORE %d, SEI ENTRATO NEI PRIMI 10" #: src/menus.c:2287 #, c-format msgid "PLAYER %d WON!" msgstr "VINCE IL GIOCAT. %d" #: src/menus.c:2293 msgid "EVERYONE LOST!" msgstr "TUTTI SCONFITTI!" #: src/menus.c:2295 msgid "YOU LOST!" msgstr "HAI PERSO!" #: src/menus.c:2374 #, c-format msgid "ROUND %d/%d" msgstr "ROUND %d/%d" #: src/musicfiles.c:174 #, c-format msgid "%s:%d: missing alias name" msgstr "%s:%d: manca l'alias" #: src/musicfiles.c:176 #, c-format msgid "%s:%d: missing file name" msgstr "%s:%d: manca il nome del file" #: src/musicfiles.c:178 #, c-format msgid "%s:%d: missing title" msgstr "%s:%d: manca il titolo" #: src/musicfiles.c:180 #, c-format msgid "%s:%d: missing author" msgstr "%s:%d: manca l'autore" #: src/pcx.c:53 #, c-format msgid "Cannot open %s" msgstr "Impossibile aprire %s" #: src/people.c:39 msgid "%{center}You owe this game to the following people" msgstr "%{center}Questo gioco e' merito delle seguenti persone" #: src/people.c:41 msgid "Authors\n" msgstr "Autori\n" #: src/people.c:49 msgid "Contributors\n" msgstr "Contributori\n" #: src/people.c:56 msgid "Translators\n" msgstr "Traduttori\n" #: src/people.c:59 src/people.c:74 msgid "German" msgstr "Tedesco" #: src/people.c:62 msgid "Dutch" msgstr "Olandese" #: src/people.c:65 msgid "Brazilian Portuguese" msgstr "" #: src/people.c:68 msgid "Italian" msgstr "Italiano" #: src/people.c:71 msgid "French" msgstr "Francese" #: src/people.c:78 msgid "Packagers\n" msgstr "Pacchettizzatori\n" #: src/people.c:87 msgid "Porters\n" msgstr "Chi ha fatto il port\n" #: src/people.c:94 msgid "Other people we wish to thanks\n" msgstr "Altre persone che vorremmo ringraziare\n" #: src/readmake.c:188 #, c-format msgid "Unknown option '%c' for command '%s'." msgstr "Opzione sconosciuta '%c' per il comando '%s'." #: src/relocate.c:70 msgid "HOME variable not found in environment, defaulting to `.'" msgstr "Variabile d'ambiente `HOME' inesistente, `.' usata come default. " #: src/relocate.c:182 msgid "" "It looks like the game is not correctly installed.\n" "Maybe the data files have not been installed with the same configure " "options\n" "as the executable, or maybe the data files have been moved elsewhere.\n" "In the latter case it's probably enough to set the environment variable\n" "HEROES_PREFIX to the new location. You may also want to set\n" "HEROES_DEBUG=system to see what files Heroes is looking after.\n" "If none of this helps, contact \n" msgstr "" "Sembra che il gioco no sia correttamente installato.\n" "Forse il file dati non e' stato installato con le stesse opzioni di " "configurazione dell'eseguibile, o forse il file dati e' stato\n" "spostato altrove.\n" "Nel secondo caso probabilmente e' sufficiente impostare la variabile\n" "di ambiente HEROES_PREFIX con la nuova posizione. Puoi inoltre impostare\n" "HEROES_DEBUG=system per vedere quali file Heroes ricerca.\n" "Se nulla di tutto cio' e' di aiuto, contattate:\n" "\n" #: src/rsc_files.c:31 #, c-format msgid "%s: no such resource, possible misspelling of '%s'." msgstr "%s: risorsa inesistente, forse si voleva indicare '%s'." #: src/rsc_files.c:34 #, c-format msgid "%s: no such resource." msgstr "%s: risorsa inesistente." #: src/rsc_files.c:149 #, c-format msgid "%s: null resource" msgstr "%s: risorsa nulla" #: src/rsc_files.c:151 #, c-format msgid "%s: empty resource" msgstr "%s: risorsa vuota" #: src/savegame.c:90 src/scores.c:103 #, c-format msgid "cannot write %s" msgstr "Impossibile salvare %s" #: src/savegame.c:95 src/scores.c:107 #, c-format msgid "%s: truncate error" msgstr "%s: errore di troncamento" #: src/savegame.c:126 #, c-format msgid "%s:%d: parse error. Clearing saved-games table." msgstr "%s:%d: errore di analisi. Cancello l'elenco delle partite salvate." #: src/scores.c:150 #, c-format msgid "%s:%d: parse error. Clearing score table." msgstr "%s:%d: errore di analisi. cancello la tabella dei punteggi." #: src/userconf.c:82 src/userconf.c:115 #, c-format msgid "%s:%d: missing variable name" msgstr "%s:%d: nome di variabile assente" #: src/userconf.c:107 #, c-format msgid "%s:%d: missing resource name" msgstr "%s:%d: nome di risorsa assente" #: src/userconf.c:131 src/userconf.c:145 #, c-format msgid "%s:%d: %s: can only be used from the system configuration file" msgstr "" #: src/userconf.c:140 src/userconf.c:154 #, fuzzy, c-format msgid "%s:%d: %s: unknown value: %s" msgstr "%s:%d: parola chiave sconosciuta `%s'" #: src/userconf.c:158 #, c-format msgid "%s:%d: unknown keyword `%s'" msgstr "%s:%d: parola chiave sconosciuta `%s'" #: src/debughash.gperf:45 msgid "all messages" msgstr "tutti i messaggi" #: src/debughash.gperf:46 msgid "different parts of the game" msgstr "diverse fasi del gioco" #: src/debughash.gperf:47 msgid "system related messages" msgstr "messaggi di sistema" #: src/debughash.gperf:48 msgid "filename resources handling" msgstr "gestione dei nomi dei file" #: src/debughash.gperf:49 msgid "files and directories handling" msgstr "gestione di file e directory" #: src/debughash.gperf:50 msgid "levels handling" msgstr "gestione di file e directory" #: src/debughash.gperf:51 msgid "sound track events" msgstr "eventi sonori" #: src/debughash.gperf:52 msgid "sound effects events" msgstr "event degli effetti sonori" #: src/debughash.gperf:53 msgid "communication with the display driver" msgstr "comunicazion con il driver video" #: src/debughash.gperf:54 #, fuzzy msgid "joystick initialization and events" msgstr "inizializzazione del joystick" #: src/debughash.gperf:55 msgid "timer handling" msgstr "gestione del timer" #: src/debughash.gperf:56 msgid "miscellaneous events" msgstr "eventi vari" #: src/debughash.gperf:57 msgid "palette fade events" msgstr "dissolvenza della paletta" #: src/debughash.gperf:58 msgid "bonus" msgstr "bonus" #: src/debughash.gperf:87 #, c-format msgid "%s: no such channel, assuming you meant '%s'." msgstr "%s: canale inesistente, suppongo volessi dire '%s'." #: src/debughash.gperf:90 #, c-format msgid "%s: no such channel (--list=debug will list all known channels)" msgstr "%s: canale inesistente (--list=debug elenca tutti i canali)" #: src/media/sfx.c:94 #, c-format msgid "" "Cannot open %s, disabling sound-effects\n" "(run with -X to supress this message)." msgstr "" "Impossibile aprire %s, disabilito gli effetti sonori\n" "(esegui con l'opzione -X per eliminare questo messaggio)." #: src/media/sfx.c:260 #, c-format msgid "Unable to load sample %s" msgstr "Impossibile caricare l'esempio %s" #: src/media/allegro/joystick.c:45 src/media/gii/joystick.c:109 #: src/media/sdl/joystick.c:50 msgid "No joystick found (run with `-J' to suppress this message)." msgstr "" "Joystick non trovato (esegui con l'opzione `-J' per eliminare questo " "messaggio)." #: src/media/dummy/strack.c:75 msgid "Heroes has been compiled without sound support." msgstr "Heroes è stato compilato senza il supporto audio." #. FIXME: ask to send a bug report with a trace #: src/media/ggi/video.c:174 msgid "failed to get any direct buffer for this visual" msgstr "impossibile ottenere un buffer diretto per questo schermo" #. TRANS: a `visual' is associated by LibGGI to a display. You can #. actually call it a `display', this makes no big difference. #: src/media/ggi/video.c:196 msgid "failed to open visual." msgstr "impossibile aprire lo schermo." #: src/media/ggi/video.c:204 msgid "cannot setup a correct display." msgstr "impossibile impostare uno schermo corretto." #: src/media/ggi/video.c:211 #, fuzzy, c-format msgid "negotiated video mode is too small (width=%d, height=%d)" msgstr "il modo video negoziato è troppo piccolo (ampiezza=%d, larghezza=%d)" #. TRANS: `display-memory' is the name of a LibGGI driver and #. make no sense to translate. #: src/media/ggi/video.c:224 msgid "Failed to open an internal `display-memory' visual." msgstr "Impossibile aprire un `display-memory' interno." #: src/media/ggi/video.c:226 msgid "Failed to set 320x200x8 mode on display-memory" msgstr "Impossibile impostare il modo 320x200x8 su `display-memory'" #: src/media/ggi/video.c:304 msgid "failed to acquire direct-buffer" msgstr "impossibile acquisire il buffer diretto" #: src/media/ggi/video.c:321 msgid "failed to release direct-buffer" msgstr "impossibile rilasciare il buffer diretto" #: src/media/gii/joystick.c:96 #, c-format msgid "unexpected event %d\n" msgstr "evento inaspettato %d\n" #: src/media/mikmod/strack.c:104 #, c-format msgid "" "Could not initialize sound, reason: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Impossibile inizializzare il sonoro, ragione: %s\n" "Disabilto l'output sonoro (usa -S per eliminare questo messaggio)." #: src/media/mikmod/strack.c:114 msgid "" "Could not initialize sound, reason: LibMikMod is not thread safe.\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Impossibile inizilizzare il sonoro, ragione: LibMikMod non è tread safe.\n" "Disabilito l'uotput sonoro (usa -S per eliminare questo messaggio)." #: src/media/mikmod/strack.c:149 src/media/sdl_mixer/strack.c:133 #, c-format msgid "Could not load %s, reason: %s" msgstr "Impossibile caricare %s, ragione: %s" #: src/media/mikmod/strack.c:214 #, c-format msgid "LibMikMod version %ld.%ld.%ld\n" msgstr "LibMikMod versione %ld.%ld.%ld\n" #: src/media/mikmod/strack.c:217 #, c-format msgid "" "\n" "Available drivers:\n" "%s\n" msgstr "" "\n" "Driver disponibili:\n" "%s\n" #: src/media/mikmod/strack.c:233 #, c-format msgid "" "Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information." msgstr "" "Argomento '%s' fuori scala, deve essere fra %d e %d.\n" "Usa '%s --help' per ulteriori informazioni." #: src/media/sdl/video.c:114 #, c-format msgid "Failed to open visual: %s" msgstr "Impossibile aprire lo schermo: %s" #: src/media/sdl_mixer/strack.c:95 #, c-format msgid "" "Couldn't open audio: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Impossibile usare l'audio: %s\n" "Disabilito l'output sonoro (usa -S per eliminare questo messaggio)." #: src/media/sdl_mixer/strack.c:171 msgid "" "Heroes has been compiled with SDL_mixer, there is no driver list available." msgstr "" "Heroes è stato compilato con SDL_mixer, non c'è un elenco dei driver " "disponibile." #: src/media/sdl_mixer/strack.c:187 #, c-format msgid "%s: missing parameter for 'freq'" msgstr "%s: parametro mancante per `freq'" #: src/media/sdl_mixer/strack.c:193 #, c-format msgid "%s: missing parameter for `buffers'" msgstr "%s: parametro mancante per `buffers'" #: src/media/sdl_mixer/strack.c:195 #, c-format msgid "%s: recognized sound options are freq=nnn and buffers=nnn" msgstr "%s: le opzioni sonore riconosciute sono freq=nnn e buffers=nnn" #~ msgid "" #~ "Use `-lWORD' or `--list=WORD' where WORD can be:\n" #~ " debug display all debugging channels\n" #~ " preferences print the preferences settings\n" #~ " resources print the resources list\n" #~ " sound-drivers print the sound driver list\n" #~ " sound-tracks\t\tprint the sound track list" #~ msgstr "" #~ "Usa `-lWORD' oppure `--list=WORD' dove WORD può essere:\n" #~ " debug mostra i canali di debugging\n" #~ " preferences visualizza le preferenze\n" #~ " resources elenca le risorse\n" #~ " sound-drivers elenca i driver sonori\n" #~ " sond-tracks elenca le tracce sonore" #~ msgid "Error %d during loading level" #~ msgstr "Errore %d durante il caricamento del livello" #~ msgid "Error %d occured while loading level %s" #~ msgstr "Errore %d durante il caricamento del livello %s" #~ msgid "Cannot open %s." #~ msgstr "Imposibile aprire %s." #~ msgid "" #~ "\n" #~ "%{img C 444 0 40 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{center}%pUse the arrow keys to scroll up and down.\n" #~ "\n" #~ "%{head 1}CONTROL & BOARD\n" #~ "\n" #~ "%{img C 357 55 80 205}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{img CG 486 0 140 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ msgstr "" #~ "\n" #~ "%{img C 444 0 40 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{center}%pUsa le frecce per spostarti verticalmente.\n" #~ "\n" #~ "%{head 1}CONTROLLI & INDICATORI\n" #~ "\n" #~ "%{img C 357 55 80 205}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{img CG 486 0 140 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ msgid "Unknown image flag '%c'." #~ msgstr "Opzione image sconosciuta '%c'." #~ msgid "GFX AND IDEA:" #~ msgstr "GRAFICA E IDEA:" #~ msgid "MUSIC:" #~ msgstr "SONORO:" #~ msgid "CODE:" #~ msgstr "CODICE:" #~ msgid "PLEASE READ THE LIST OF OTHER CONTRIBUTORS IN THE FILE 'THANKS'" #~ msgstr "LEGGETE L'ELENCO DEGLI ALTRI COLLABORATORI NEL FILE 'THANKS'" #~ msgid "%d LIVES LEFT" #~ msgstr "%d VITE RIMASTE" heroes-0.21/po/nl.po0000644004117000411500000013600607451377061010007 # Nederlandse berichten voor `Heroes` # Copyright (C) 2001 Free Software Foundation, Inc. # Jos Boersema , 2001. # When in doubt the translations-list from nl.linux.org was consulted. # msgid "" msgstr "" "Project-Id-Version: Heroes 0.8c\n" "POT-Creation-Date: 2002-03-30 18:44+0100\n" "PO-Revision-Date: 2001-02-23 22:37+01:00\n" "Last-Translator: Jos Boersema \n" "Language-Team: none \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ISO-8859-1\n" "Content-Transfer-Encoding: 8-bit\n" #: lib/error.c:129 lib/error.c:157 msgid "Unknown system error" msgstr "Onbekende systeem-fout" #: lib/getopt.c:694 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: optie `%s' is dubbelzinnig\n" #: lib/getopt.c:719 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: optie `--%s' staat geen argument toe\n" #: lib/getopt.c:724 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: optie `%c%s' staat geen argument toe\n" #: lib/getopt.c:742 lib/getopt.c:915 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: optie `%s' vereist een argument\n" #. --option #: lib/getopt.c:771 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: niet herkende optie `--%s'\n" #. +option or -option #: lib/getopt.c:775 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: niet herkende optie `%c%s'\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:801 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: ongeldige optie -- %c\n" # "illegal" and "invalid" both translate as `ongeldig'. # if you want difference: make the above `verkeerde optie' ("wrong option") # (or email me/someone-nl ofcource...) #: lib/getopt.c:804 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: ongeldige optie -- %c\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:834 lib/getopt.c:964 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: optie vereist een argument -- %c\n" #: lib/getopt.c:881 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: optie `-W %s' is dubbelzinnig\n" #: lib/getopt.c:899 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: optie `-W %s' staat geen argumenten toe\n" #. If XALLOC_FAIL_FUNC is NULL, or does return, display this message #. before exiting when memory is exhausted. Goes through gettext. #: lib/xmalloc.c:66 msgid "memory exhausted" msgstr "geheugen uitgeput" #: src/argv.c:60 #, c-format msgid "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux and Philippe Meisburger.\n" msgstr "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux en Philippe Meisburger.\n" #: src/argv.c:63 src/heroeslvl.c:64 msgid "" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." msgstr "" "Dit is vrije software; zie de broncode voor kopiëer voorwaarden. Er is GEEN\n" "garantie; zelfs niet voor VERKOOPBAARHEID of GESCHIKTHEID VOOR EEN BEPAALD\n" "DOEL." #: src/argv.c:74 msgid "Use `-lWORD' or `--list=WORD' where WORD can be:" msgstr "" #: src/argv.c:76 msgid "display all debugging channels" msgstr "" #: src/argv.c:78 #, fuzzy msgid "list all level files" msgstr "%s: ongeldig level bestand" #: src/argv.c:80 msgid "print the preferences settings" msgstr "" #: src/argv.c:82 #, fuzzy msgid "print the resources list" msgstr "bestandsnaam hulpbronnen behandeling" #: src/argv.c:84 msgid "print the sound driver list" msgstr "" #: src/argv.c:86 #, fuzzy msgid "print the sound track list" msgstr "muziek-nummers gebeurtenissen" #: src/argv.c:145 src/heroeslvl.c:74 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "" #: src/argv.c:150 #, c-format msgid "" "Usage: %s [OPTIONS]...\n" "\n" msgstr "" "Gebruik: %s [OPTIES]...\n" "\n" # Change "spel" to "game" and "spelen" to "games" to sound more 'popular'. #: src/argv.c:151 msgid "" "Heroes is a game similar to the \"Tron\" and \"Nibbles\" games of yore\n" "but includes many graphical improvements and new game features.\n" msgstr "" "Heroes is een spel dat op de \"Tron\" en \"Nibbles\" spelen van yore lijkt\n" "maar het heeft vele grafische verbeteringen en nieuwe spel onderdelen.\n" #: src/argv.c:154 src/heroeslvl.c:81 msgid "" "Mandatory arguments to long options are mandatory for short options too.\n" msgstr "" "Verplichte argumenten voor lange opties zijn ook verplicht voor korte " "opties.\n" #: src/argv.c:156 msgid "" "General options:\n" " -v, --version display version number\n" " -h, --help display this help\n" " -q, --quiet don't print warning messages\n" " -Q, --really-quiet don't even print error messages\n" " -v, --verbose=CHANNELS enable or disable debugging channels\n" " (see --list=debug for available channels)\n" " -l, --list=WORD show some internal information; WORD can be\n" " 'debug', 'resources', 'sound-drivers' or\n" " 'sound-tracks'\n" msgstr "" "Algemene opties:\n" " -n, --version laat versienummer zien\n" " -h, --help laat deze hulp zien\n" " -q, --quiet druk geen waarschuwings-berichten af\n" " -Q, --really-quiet druk zelfs geen foutmeldingen af\n" " -v, --verbose=KANALEN zet debugging kanalen aan of uit\n" " (zie --list=debug voor beschikbare kanalen)\n" " -l, --list=WOORD toon enige interne informatie; WOORD kan " "zijn:\n" " 'debug', 'resources', 'sound-drivers' or\n" " 'sound-tracks'\n" # Note: extra (new)line (nr 2), else exceeds 80 columns. # Note2: line 3 freely translated because else it would be longer than # 80 columns (reads as: "...for info about N)\n"). #: src/argv.c:167 msgid "" "Sound options:\n" " -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:" "autodetect)\n" " (see --list=sound-drivers for available Ns)\n" " -S, --no-sound disable sound\n" " -X, --no-sfx disable sound-effects\n" " -m, --mono non-stereo output\n" " -8, --8bits 8bits sound output\n" " -i, --high-quality high quality mixer\n" msgstr "" "Geluid opties:\n" " -d, --driver=N[,OPTIES] gebruik Nde driver voor geluid uitvoer\n" " (0:vind-automatisch)\n" " (zie --list=sound-drivers voor info over N)\n" " -S, --no-sound gebruik geen geluid\n" " -X, --no-sfx gebruik geen geluids-effecten\n" " -m, --mono geen stereo uitvoer\n" " -8, --8bits 8bits geluid uitvoer\n" " -i, --high-quality hoge kwaliteit mixer\n" #: src/argv.c:176 msgid "" "Display options:\n" " -G, --gfx-options=OPTIONS pass OPTIONS to the display driver\n" " -F, --full-screen full screen mode\n" " -2, --double stretch the display twofold\n" " -3, --triple stretch the display threefold\n" " -4, --quadruple stretch the display fourfold\n" " -e, --even-lines display only even-lines\n" msgstr "" "Weergave opties:\n" " -G, --gfx-options=OPTIES geef OPTIES aan de weergave driver\n" " -F, --full-screen volledige scherm modus\n" " -2, --double verleng de weergave twee keer\n" " -3, --triple verleng de weergave drie keer\n" " -4, --quadruple verleng de weergave vier keer\n" " -e, --even-lines toon alleen even regels\n" # disable superposition of rotozoom and waves\n" # ^^^^^^^^^^^^^^^^^^^^^^^^^ ? what does that mean ;) #. TRANS: rotozoom is a graphical effect used in the demo of yore #. where the screen rotate and zoom (actually it doesn't zoom in Heroes); #. waves is another effect where the screen is agitated like some #. jelly (this was also called the `mushroom effect' in game like #. Death Rally). #: src/argv.c:189 #, fuzzy msgid "" "Miscellaneous options:\n" " --cpu-off disable computer opponents\n" " --default-scores restore default scores file\n" " --default-options restore default options file\n" " --default-saves restore default saves file\n" " -s, --swap-sides swap sides in two player mode\n" " --no-double-fx disable combination of rotozoom and waves\n" " -g, --go skip the introduction\n" " -J, --no-joystick disable joystick handling\n" msgstr "" "Diverse opties:\n" " --cpu-off zet computer tegenstanders uit\n" " --default-scores herstel standaard scores bestand\n" " --default-options herstel standaard opties bestand\n" " --default-saves herstel standaard bewaar bestand\n" " -s, --swap-sides wissel van helft in twee speler modus\n" " --no-double-fx zet draai-inzoemen met golven uit\n" " -g, --go sla de intro over\n" " -J, --no-joystick zet joystick uit\n" #: src/argv.c:199 msgid "" "These options can be set in your file ~/.heroes/heroesrc (which is read\n" "before parsing other command line options) using a line like the following:\n" "\n" " Options: -gs -d3,buffer=11,count=4\n" msgstr "" "Deze opties kunnen gezet worden in uw ~/.heroes/heroesrc bestand (dat " "gelezen\n" "wordt voordat andere opdrachtregel opties worden verwerkt) met een regel " "zoals de volgende:\n" " Options: -gs -d3,buffer=11,count=4\n" #: src/argv.c:204 msgid "" "Visit http://heroes.sourceforge.net/ for news, documentation, and updates." msgstr "" "Bezoek http://heroes.sourceforg.net/ voor nieuws, documentatie, en\n" "bijwerkingen." #: src/argv.c:206 src/heroeslvl.c:102 msgid "Report bugs to ." msgstr "Raporteer bugs aan ." #: src/argv.c:312 msgid "-n is an obsolete option, you should use --list=sound-drivers" msgstr "-n is een verouderde optie, u moet nu --list=sound-drivers gebruiken" #: src/bonus.c:324 src/bonus.c:329 #, c-format msgid "SIZE IS %d" msgstr "GROOTTE IS %d" #: src/bonus.c:334 msgid "SPEEDED UP" msgstr "VERSNELD" #: src/bonus.c:338 msgid "SPEEDED DOWN" msgstr "VERLANGZAAMD" #: src/bonus.c:345 #, c-format msgid "GET %dPTS" msgstr "KRIJG %dPTS" #: src/bonus.c:350 msgid "FIRE TRAIL!" msgstr "" #: src/bonus.c:364 msgid "GET TURBO+" msgstr "KRIJG TURBP+" #: src/bonus.c:371 msgid "GET TURBO-" msgstr "KRIJG TURBO-" #: src/bonus.c:379 msgid "INVINCIBLE!" msgstr "ONSCHENDBAAR!" #: src/bonus.c:391 msgid "EXTRA-LIFE!" msgstr "EXTRA-LEVEN!" #: src/endscroll.c:113 msgid "THE END" msgstr "EINDE" #: src/fontdata.c:243 #, c-format msgid "character '%c' is not drawable (in message '%s')" msgstr "karakter `%c' is niet afdrukbaar (in bericht `%s')" #: src/hedlite.c:1622 #, c-format msgid "Cannot create directory `%s'." msgstr "Kan directorie `%s' niet maken." #: src/hedlite.c:1679 src/hedlite.c:1686 #, c-format msgid "%s: invalid level file" msgstr "%s: ongeldig level bestand" #: src/helptext.c:24 msgid "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "\n" "%{center}%pUse the arrow keys to scroll up and down.\n" "\n" "%{head 1}CONTROL & BOARD\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSE\n" "%{textat cR -9 97}%yQUIT GAME\n" "%{textat cR 26 -62}%yCONTROL\n" "%{textat cL 30 74}%ySTOP\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%ySCORE\n" "%{textat cR 1 8}%yCOMMENTARY\n" "%{textat cL 16 29}%yHEROES\n" "%{textat cL 33 29}%yWALLS\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yLIFES\n" "%{textat cL 51 -109}%yTURBO ENERGY\n" "%{textat cL 72 -104}%yTIME\n" "%{textat cR 96 40}%yPLAYER COLOR\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" msgstr "" # "rotozoom"?? now like: `turning zoom-in' # "wavy visions" visions as in "vision of a landscape" #: src/helptext.c:71 #, fuzzy msgid "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Affects the player that gets the item\n" "%{img L 60 22 20 22}Affects all players except the one who gets the bonus\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points\n" "%{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions\n" "\n" msgstr "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Beinvloed de speler die het item krijgt\n" "%{img L 60 22 20 22}Beinvloed alle spelers behalve degene die de bonus " "krijgt\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Spoor +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Spoor -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Sneller\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Langzamer\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Punten\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Omgekeerde besturing\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Kracht +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Kracht -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}Einde van level\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Onschendbaarheid\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Draai-inzoemen\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Leven\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Golvende uitzichten\n" "\n" #: src/helptext.c:99 msgid "" "%{head 3}GAME MODES\n" "\n" "%{>>}%yQUEST\n" "\n" "%{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers " "you. Your aim is to collect a given number (10) of Trail+1 bonuses and then " "to get the End-of-Level bonus that will send you to next level.\n" "%{>>>}%{img L 20 176 20 22}End-of-Level\n" "%{img R 0 0 20 22}%{flushright}Trail+1\n" "%{>>>}Trail+1 has the effect of growing your trail. There are two way to " "get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first " "appears when someone's trail reach 10 units.\n" "\n" "%{>>}%yDEATH MATCH\n" "\n" "%{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a " "fight to death. The aim of the game is to be the last player still alive. " "For this, feel free to use any stratagems you want. Nothing is forbidden.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL\n" "\n" "%{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm " "all the people of your competitors. It was said \"There can be only one\", " "make sure it is yours!\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}They are among us, find them !\n" "\n" "%{>>}%yCOLOR\n" "\n" "%{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time " "to get a maximum of gems of your color. Beware, if you go over your " "competitor's gems, it's your competitor's gem account that you will " "increase. Be also sure not to get crossed gems because you'll lose " "collected gems. Grey ones gives gems to all players except the one that " "goes over it. The Clocks give you extra time.\n" "\n" "%{>>}%yTIME CA$H\n" "\n" "%{>>>}In %yTIME CA$H%w mode the winner is the player who collected the " "largest amount of money.\n" "\n" msgstr "" "%{head 3}SPEL MODUSSEN\n" "\n" "%{>>}%yTOCHT\n" "\n" "%{>>>}De %yTOCHT%w modus laat je alle 100 levels spelen die HEROES biedt. Je " "doel is om een gegeven aantal (10) Spoor+1 bonussen te verzamelen en dan de " "Einde-van-Level bonus die je naar het volgende level zal sturen.\n" "%{>>>}%{img L 20 176 20 22}Einde-van-level\n" "%{img R 0 0 20 22}%{flushright}Spoor+1\n" "%{>>>}Spoor+1 heeft het gevolg dat je spoor groeit. Er zijn twee manieren om " "kleiner te worden: neem een Spoor-1 of verlies een leven. De Einde-van-Level " "bonus verschijnt voor het eerst als iemand's spoor 10 eenheden wordt.\n" "\n" "%{>>}%yDOODS STRIJD\n" "\n" "%{>>>}De %yDOODS STRIJD%w modus laat je tegen de andere spelers vechten tot " "in de dood. Het doel van het spel is om de laatste overlevende te zijn. Voel " "je vrij om wat dan ook te doen. Niets is verboden.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yVERTRAPPEN DAT ONGEDIERTE\n" "\n" "%{>>>}De %yVERTRAPPEN DAT ONGEDIERTE%w modus heeft 1 regel: overspoel alle " "mensen van je tegenstanders. Zoals werd gezegd \"Er kan maar er maar 1 " "bestaan\", zorg ervoor dat het de jouwe zijn!\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}Ze zijn onder ons, vind ze !\n" "\n" "%{>>}%yKLEUR\n" "\n" "%{>>>}De %yKLEUR%w modus is heel simpel. Je hebt een bepaalde hoeveelheid " "tijd om maximaal veel edelstenen van je kleur te pakken. Pas op dat je niet " "over de edelstenen van de competitie heen gaat want dan worden zijn/haar " "edelstenen vermeerderd. Zorg er ook voor dat je niet over gekruiste " "edelstenen heen gaat want dan verlies je al verzamelde edelstenen. Grijze " "edelstenen geven edelstenen aan iedereen behalve degene die eroverheen gaat. " "De Klok geeft je extra tijd.\n" "\n" "%{>>}%yTIJD IS GELD\n" "\n" "%{>>>}In %yTIJD IS GELD%w modus de winnaar is de speler die het meeste geld " "pakt.\n" "\n" #: src/helptext.c:145 #, fuzzy msgid "" "%{head 4}GAME OPTIONS\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gCOLOR SELECT\n" "\n" "%{>>>}This option allows you to choose the color of your vehicle between %" "pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gGAME SPEED\n" "\n" "%{>>>}The %gGAME SPEED%w option allows you to select the initial speed of " "the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gROUNDS\n" "\n" "%{>>>}The %gROUNDS%w option allows you to select the number of rounds in the " "tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. These " "values range from 1 to 100 rounds.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMATION\n" "\n" "%{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better " "visibility.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gLIGHTING\n" "\n" "%{>>>}The %gLIGHTING%w option is here to tune the luminosity of your " "screen.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gINERTIA\n" "\n" "%{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOT\n" "\n" "%{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, rest in " "peace... Note that %gAUTOPILOT%w does not work against fire trails.\n" "\n" msgstr "" "%{head 4}SPEL OPTIES\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gKIES KLEUR\n" "\n" "%{>>>}Deze optie laat je een kleur kiezen voor je voertuig uit: %pROZE%w, %" "yGEEL%w, %bBLAUW%w and %gGROEN%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gSPEL SNELHEID\n" "\n" "%{>>>}De %gSPEL SNELHEID%w optie laat je toe een begin-snelheid te kiezen " "voor de shuttles. De 3 beschikbare snelheden zijn: NORMAAL, EXPERT, HEROES.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gRONDES\n" "\n" "%{>>>}De %gRONDES%w optie laat je toe het aantal rondes te kiezen in de " "toernooi modussen: DOODS STRIJD, VERTRAPPEN DAT ONGEDIERTE, KLEUR en TIJD IS " "GELD. De waardes gaan van 1 tot 100 rondes.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMATIE\n" "\n" "%{>>>}Je kunt de %gRADAR%w en %gINFORMATIE%w uitzetten voor beter zicht.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gVERLICHTING\n" "\n" "%{>>>}De %gVERLICHTING%w optie is er om de lichtheid van je scherm in te " "stellen.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gTRAAGHEID\n" "\n" "%{>>>}De %gTRAAGHEID%w schakeling maakt het mogelijk de traagheid voor het " "schuiven (scrollen) aan of uit te zetten.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOMATISCHE PILOOT\n" "\n" "%{>>>}Als je gestoord bent kun je proberen te spelen zonder %gAUTOMATISCHE " "PILOOT%w, rust zacht...\n" "\n" #: src/helptext.c:191 msgid "" "%{head 1}CONTACT\n" "\n" "%{center}home page:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}send bug reports to:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" msgstr "" "%{head 1}CONTACT\n" "\n" "%{center}home page:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}stuur bug raporten naar:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" #: src/helptext.c:204 msgid "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's " "environmental and ecological issues and did our best to use only recycled " "bytes in this program.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux and Philippe Meisburger.\n" "\n" msgstr "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} We dragen ook ons steentje bij " "aan de hedendaagse milieu problemen en hebben geprobeerd alleen gerecyclede " "bytes in dit programma te gebruiken.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux en Philippe Meisburger.\n" "\n" #: src/heroes.c:677 src/heroes.c:763 #, c-format msgid "Cannot load level %s (error %d)" msgstr "" #: src/heroes.c:1969 #, c-format msgid "INVERTED %d" msgstr "OMGEKEERD %d" #: src/heroes.c:2003 #, c-format msgid "STOPPED %d" msgstr "GESTOPT %d" #. TRANS: %d, the number of remaining lives, is always #. positive. #: src/heroes.c:2300 msgid "LAST LIFE" msgid_plural "%d LIVES LEFT" msgstr[0] "LAATSTE LEVEN" #: src/heroes.c:2873 msgid "Error during level loading" msgstr "Fout tijdens level laden" #: src/heroes.c:2909 #, c-format msgid "-LEVEL %d-" msgstr "-LEVEL %d-" #: src/heroes.c:2911 #, c-format msgid "-ROUND %d/%d-" msgstr "-RONDE %d/%d-" #: src/heroes.c:3416 msgid "error in sfx.cfg" msgstr "fout in sfx.cfg" #: src/heroeslvl.c:63 #, c-format msgid "Copyright (C) %d Alexandre Duret-Lutz.\n" msgstr "" #: src/heroeslvl.c:79 #, fuzzy, c-format msgid "" "Usage: %s [OPTIONS]... levels\n" "\n" msgstr "" "Gebruik: %s [OPTIES]...\n" "\n" #: src/heroeslvl.c:80 msgid "Heroeslvl is a tool used to inspect Heroes' level files.\n" msgstr "" #: src/heroeslvl.c:83 msgid " -v, --version display version number" msgstr "" #: src/heroeslvl.c:85 msgid " -h, --help display this help" msgstr "" #: src/heroeslvl.c:87 msgid "" " -p, --print=WHAT select information to display. WHAT should " "be\n" " one or more of these characters:" msgstr "" #: src/heroeslvl.c:90 msgid "d print square directions" msgstr "" #: src/heroeslvl.c:91 msgid "f print filename" msgstr "" #: src/heroeslvl.c:92 msgid "h print header" msgstr "" #: src/heroeslvl.c:93 msgid "i print tile details" msgstr "" #: src/heroeslvl.c:94 msgid "t print square type map" msgstr "" #: src/heroeslvl.c:95 msgid "T print type keys" msgstr "" #: src/heroeslvl.c:96 msgid "w print square wall map" msgstr "" #: src/heroeslvl.c:97 msgid "@ print tunnels" msgstr "" #: src/heroeslvl.c:98 msgid " -i, --indent indent everything but the filename" msgstr "" #: src/heroeslvl.c:101 msgid "When no options are given, the default is -ipfh." msgstr "" #: src/heroeslvl.c:201 #, c-format msgid "%sheight:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:203 #, c-format msgid "%swidth:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:206 #, c-format msgid "%sY-wrap:\tno\n" msgstr "" #: src/heroeslvl.c:208 #, c-format msgid "%sY-wrap:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:211 #, c-format msgid "%sX-wrap:\tno\n" msgstr "" #: src/heroeslvl.c:213 #, c-format msgid "%sX-wrap:\t%d tiles\t(%d squares)\n" msgstr "" #: src/heroeslvl.c:215 #, fuzzy, c-format msgid "%ssound track alias:\t%s\n" msgstr "muziek-nummers gebeurtenissen" #: src/heroeslvl.c:217 #, c-format msgid "%stile map basename:\t%s\n" msgstr "" #: src/heroeslvl.c:219 #, c-format msgid "%sstarting squares and directions (y x dir):\n" msgstr "" #: src/heroeslvl.c:261 msgid "none" msgstr "" #: src/heroeslvl.c:262 msgid "stop" msgstr "" #: src/heroeslvl.c:263 msgid "speed" msgstr "" #: src/heroeslvl.c:264 msgid "tunnel" msgstr "" #: src/heroeslvl.c:265 msgid "boom" msgstr "" #: src/heroeslvl.c:266 msgid "anim" msgstr "" #: src/heroeslvl.c:267 msgid "ice" msgstr "" #: src/heroeslvl.c:268 msgid "dust" msgstr "" #: src/heroeslvl.c:269 msgid "outway" msgstr "" #: src/heroeslvl.c:389 #, c-format msgid "%sTunnels:\n" msgstr "" #. TRANS: This is the header of an array (output by heroeslvl -p@), #. so the position of these words is important. #. #. SRCIDX is a short for 'source index' (entrance of a tunnel) and #. DESTIDX means 'destination index' (output of the tunnel). #: src/heroeslvl.c:395 #, c-format msgid "%s NBR SRCIDX Y X DIR DESTIDX\n" msgstr "" #. TRANS: `still' is used to describe tiles which are not animated. #: src/heroeslvl.c:426 msgid "still" msgstr "" #. TRANS: `loop' is for animated tiles where frames are displayed #. from 1 to n, and then again from 1 to n, etc. #: src/heroeslvl.c:430 msgid "loop" msgstr "" #. TRANS: `pingpong' is for tiles animated in loop where frame #. displayed from 1 to n, then from n to 1, and then again from 1 #. to n, etc. #: src/heroeslvl.c:435 msgid "pingpong" msgstr "" #. TRANS: This is the header of an array (output by heroeslvl -pi) so #. the position of these word is important. #. #. SPRITE is the address of the sprite used to render the tile. OVERLAY #. is the address of a sprite that should be displayed on top #. of the players (e.g. trees). ANIM-TYPE is the kind of animation used #. for the tile, FRM the number of frame to display, DEL the delay #. between each frame. #: src/heroeslvl.c:453 #, c-format msgid "%sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL\n" msgstr "" # %s is a filename, right? #: src/heroeslvl.c:503 #, fuzzy, c-format msgid "cannot load %s" msgstr "Kan `%s' niet openen" #: src/heroeslvl.c:507 #, c-format msgid "File:\t%s\n" msgstr "" #: src/heroeslvl.c:539 #, fuzzy msgid "Missing filename." msgstr "%s:%d: bestandsnaam mist" #: src/levellst.c:53 #, fuzzy, c-format msgid "cannot open directory %s" msgstr "Kan directorie `%s' niet maken." # "quest" as in "journey": `TOCHT' # "quest" as in "search": `ZOEK', "searching": `ZOEKEN' # "quest" as in "adventure": "AVONTUUR" ;) #. TRANS: in QUEST mode, the player goes throught all the levels, but #. have to search for specific powerups in order to jump to the next #. level. Hence this is a `quest' for those powerups. #: src/menus.c:146 #, fuzzy msgid "QUEST" msgstr "TOCHT" #. TRANS: in DEATH MATCH mode, the user has to kill all other players. #: src/menus.c:148 msgid "DEATH MATCH" msgstr "DOODS STRIJD" #. TRANS: in KILL'EM ALL mode there are lemmings moving on the ground #. and the player must run over them all. You may want to translate #. `kill' as `run over', `squash', `mash' or something among those #. lines. #: src/menus.c:153 msgid "KILL'EM ALL" msgstr "VERTRAPPEN DAT ONGEDIERTE" # Technically should be "TIJD CONTANT-GELD" but that sound like nothing in # Dutch. # "tijd is geld" translates to "time is money" #. TRANS: in TIME CA$H mode, the player must collect dollars with #. restricted time. #: src/menus.c:156 #, fuzzy msgid "TIME CA$H" msgstr "TIJD IS GELD" #. TRANS: in COLOR mode, the player must collect some colored gems #. with restricted time. #: src/menus.c:159 msgid "COLORS" msgstr "KLEUREN" #: src/menus.c:192 msgid "GAME" msgstr "SPEL" #: src/menus.c:193 msgid "SCREEN" msgstr "SCHERM" #: src/menus.c:194 msgid "SOUND" msgstr "GELUID" #: src/menus.c:195 msgid "CONTROL" msgstr "CONTROLE" # "keys" as in "keyboard-keys": `toetsen' #: src/menus.c:196 msgid "KEYS" msgstr "TOETSEN" #: src/menus.c:197 msgid "EXTRAS" msgstr "EXTRAS" #: src/menus.c:198 src/menus.c:222 src/menus.c:385 src/menus.c:395 #: src/menus.c:409 src/menus.c:421 src/menus.c:431 src/menus.c:454 #: src/menus.c:545 msgid "GO BACK" msgstr "GA TERUG" #. play menu #: src/menus.c:205 src/menus.c:539 msgid "PLAY" msgstr "SPEEL" #. options menu #: src/menus.c:206 src/menus.c:526 msgid "OPTIONS" msgstr "OPTIES" #: src/menus.c:207 src/menus.c:406 msgid "INFOS" msgstr "INFO" # "credits" doens't really exist in Dutch (?), used "THANKS" #: src/menus.c:208 #, fuzzy msgid "CREDITS" msgstr "DANK" #: src/menus.c:209 msgid "SCORES" msgstr "SCORES" # `editor' would do fine too though #. editor first menu #: src/menus.c:210 src/menus.c:536 msgid "EDITOR" msgstr "TEXTVERWERKER" #: src/menus.c:211 msgid "QUIT" msgstr "STOP" #. TRANS: Create a new level. #: src/menus.c:219 src/menus.c:503 msgid "NEW LEVEL" msgstr "NIEUW LEVEL" #. TRANS: Load an existing level for edition. #: src/menus.c:221 msgid "LOAD LEVEL" msgstr "LAAD LEVEL" #: src/menus.c:375 msgid "CONTROL OPTIONS" msgstr "CONTROLE OPTIES" #. 1st player #: src/menus.c:377 src/menus.c:416 src/menus.c:433 msgid "PLAYER 1" msgstr "SPELER 1" #: src/menus.c:379 src/menus.c:383 msgid "AUTO PILOT" msgstr "AUTOMATISCHE PILOOT" #. 2nd player #: src/menus.c:381 src/menus.c:417 src/menus.c:441 msgid "PLAYER 2" msgstr "SPELER 2" #: src/menus.c:391 msgid "SOUND OPTIONS" msgstr "GELUID OPTIES" #: src/menus.c:393 msgid "MUSIC" msgstr "MUZIEK" # if length is no problem: use GELUIDSEFFECTEN # if it is: GEL.EFF., or SFX (not shure if that is understandable) #: src/menus.c:394 msgid "SFX" msgstr "GELUIDSEFF." #: src/menus.c:398 msgid "MUSIC VOL" msgstr "MUZIEK VOL" #: src/menus.c:399 msgid "SFX VOL" msgstr "GELUIDSEFF. VOL" #: src/menus.c:403 msgid "SCREEN OPTIONS" msgstr "SCHERM OPTIES" #: src/menus.c:405 msgid "RADAR" msgstr "RADAR" #: src/menus.c:407 msgid "LIGHTING" msgstr "VERLICHTING" #: src/menus.c:408 msgid "INERTIA" msgstr "TRAAGHEID" #: src/menus.c:414 msgid "GAME OPTIONS" msgstr "SPEL OPTIES" #: src/menus.c:418 msgid "PLAYER 3" msgstr "SPELER 3" #: src/menus.c:419 msgid "PLAYER 4" msgstr "SPELER 4" #: src/menus.c:420 msgid "SPEED" msgstr "SNELHEID" #: src/menus.c:429 msgid "KEYBOARD DEFS" msgstr "TOETSENBORD DEF." #: src/menus.c:434 src/menus.c:442 msgid "UP" msgstr "OMHOOG" #: src/menus.c:435 src/menus.c:443 msgid "LEFT" msgstr "LINKS" #: src/menus.c:436 src/menus.c:444 msgid "DOWN" msgstr "OMLAAG" #: src/menus.c:437 src/menus.c:445 msgid "RIGHT" msgstr "RECHTS" #: src/menus.c:438 src/menus.c:446 msgid "TURBO" msgstr "TURBO" #: src/menus.c:439 src/menus.c:447 msgid "STOP" msgstr "STOP" #: src/menus.c:452 msgid "EXTRAS LEVELS" msgstr "EXTRA LEVELS" #: src/menus.c:456 msgid "ORIGINAL LEVELS" msgstr "ORIGINELE LEVELS" #: src/menus.c:458 msgid "ORIGINAL+EXTRAS" msgstr "ORIGINEEL+EXTRAS" #: src/menus.c:460 msgid "EXTRAS ONLY" msgstr "ALLEEN EXTRAS" #: src/menus.c:462 msgid "EXTRAS: NONE" msgstr "EXTRAS: GEEN" #: src/menus.c:464 msgid "EXTRAS: ALL" msgstr "EXTRAS: ALLES" #: src/menus.c:466 msgid "EXTRAS: SELECT" msgstr "EXTRAS: KIES" #. pause menu #: src/menus.c:491 msgid "PAUSE" msgstr "PAUZE" #. quit y/n menus #: src/menus.c:495 msgid "QUIT THIS GAME?" msgstr "STOP DIT SPEL?" #: src/menus.c:497 msgid "REALLY QUIT?" msgstr "ECHT STOPPEN?" #: src/menus.c:499 msgid "NO" msgstr "NEE" #: src/menus.c:500 msgid "YES" msgstr "JA" #: src/menus.c:505 msgid "EXISTING LEVEL" msgstr "BESTAAND LEVEL" #: src/menus.c:507 msgid "NAME" msgstr "NAAM" #. TRANS: in wrapped levels are unbounded level, e.g. whenever the #. player reach the left border it continue its way from the right border #. (except that the player doesn't even know there are borders, because #. the level is tiled infinitely). In unwrapped levels there are explicit #. bounds that you cannot cross. X-WRAP is a check box used to specified #. whether a level must be wrapped horizontally or not when creating a #. new level. #: src/menus.c:515 #, fuzzy msgid "X-WRAP" msgstr "X-OMVOUWEN" #. TRANS: Y-WRAP is a check box used to specified whether a level #. must be wrapped vertically or not. #: src/menus.c:518 #, fuzzy msgid "Y-WRAP" msgstr "Y-OMVOUWEN" #. TRANS: width of the level #: src/menus.c:520 msgid "X-SIZE" msgstr "X-GROOTTE" #. TRANS: height of the level #: src/menus.c:522 msgid "Y-SIZE" msgstr "Y-GROOTTE" #: src/menus.c:523 msgid "EDIT" msgstr "BEWERKEN" #. main menu #: src/menus.c:529 msgid "HEROES" msgstr "HEROES" #. editor selector #: src/menus.c:532 msgid "SELECT A LEVEL" msgstr "KIES EEN LEVEL" #: src/menus.c:541 msgid "ONE PLAYER" msgstr "1 SPELER" #: src/menus.c:543 #, fuzzy msgid "TWO PLAYERS" msgstr "TWEE SPELERS" #: src/menus.c:547 msgid "LOAD..." msgstr "LADEN..." # FIXME: shouldn't that be "choOse a save slot"? #. saved game selection #: src/menus.c:556 #, fuzzy msgid "CHOOSE A SAVE SLOT" msgstr "KIES EEN BEWAAR POSITIE" #: src/menus.c:558 #, fuzzy msgid "CHOOSE A LOAD SLOT" msgstr "KIES EEN LAAD POSITIE" #. enter your name #: src/menus.c:562 msgid "ENTER YOUR NAME:" msgstr "GEEF UW NAAM:" #. end level info #. TRANS: SIZE is the size of the player trail, PTS the #. number of PoinTS #: src/menus.c:568 msgid "SIZE PTS LIVES" msgstr "GROOTTE PUNTEN LEVENS" #: src/menus.c:570 msgid "PTS LIVES" msgstr "PUNTEN LEVENS" # "MEN" as in male-people? # "lives" translates to plural: `levens', cut `s' leaves "life" #. TRANS: this is for KILL'EM ALL mode, and MEN is the number #. of lemmings killed by one player #: src/menus.c:574 #, fuzzy msgid " MEN PTS LIVES" msgstr " MAN PNT LEVEN" #: src/menus.c:576 msgid "CA$H PTS LIVES" msgstr "GELD PNT LEVEN" #: src/menus.c:578 msgid "COLORS PTS LIVES" msgstr "KLEUR PNT LEVEN" #: src/menus.c:583 msgid "NEXT LEVEL" msgstr "VOLGENDE LEVEL" #. TRANS: this is a menu entry that introduce the user to another #. menu. This is NOT displayed DURING saving. #: src/menus.c:588 msgid "SAVE..." msgstr "BEWAAR..." #: src/menus.c:593 msgid "PRESS RETURN" msgstr "DRUK OP ENTER" #: src/menus.c:602 msgid "WINS PTS LIVES" msgstr "WINS PNT LEVEN" #. higher scores #: src/menus.c:613 msgid "HIGHER SCORES" msgstr "HOGERE SCORES" #: src/menus.c:1231 #, fuzzy, c-format msgid "%d ROUND" msgid_plural "%d ROUNDS" msgstr[0] "%d RONDES" #: src/menus.c:2220 #, c-format msgid "PLAYER %d, YOU CAME IN THE TOP 10" msgstr "SPELER %d, U STAAT IN DE TOP 10" #: src/menus.c:2287 #, c-format msgid "PLAYER %d WON!" msgstr "SPELER %d WINT!" #: src/menus.c:2293 msgid "EVERYONE LOST!" msgstr "IEDEREEN VERLIEST!" #: src/menus.c:2295 msgid "YOU LOST!" msgstr "U VERLIEST!" #: src/menus.c:2374 #, c-format msgid "ROUND %d/%d" msgstr "RONDE %d/%d" #: src/musicfiles.c:174 #, c-format msgid "%s:%d: missing alias name" msgstr "%s:%d: alias naam mist" #: src/musicfiles.c:176 #, c-format msgid "%s:%d: missing file name" msgstr "%s:%d: bestandsnaam mist" #: src/musicfiles.c:178 #, c-format msgid "%s:%d: missing title" msgstr "%s:%d: titel mist" #: src/musicfiles.c:180 #, c-format msgid "%s:%d: missing author" msgstr "%s:%d: auteur mist" # %s is a filename, right? #: src/pcx.c:53 #, fuzzy, c-format msgid "Cannot open %s" msgstr "Kan `%s' niet openen" #: src/people.c:39 msgid "%{center}You owe this game to the following people" msgstr "" #: src/people.c:41 msgid "Authors\n" msgstr "" #: src/people.c:49 msgid "Contributors\n" msgstr "" #: src/people.c:56 msgid "Translators\n" msgstr "" #: src/people.c:59 src/people.c:74 msgid "German" msgstr "" #: src/people.c:62 msgid "Dutch" msgstr "" #: src/people.c:65 msgid "Brazilian Portuguese" msgstr "" #: src/people.c:68 msgid "Italian" msgstr "" #: src/people.c:71 msgid "French" msgstr "" #: src/people.c:78 msgid "Packagers\n" msgstr "" #: src/people.c:87 msgid "Porters\n" msgstr "" #: src/people.c:94 msgid "Other people we wish to thanks\n" msgstr "" #: src/readmake.c:188 #, c-format msgid "Unknown option '%c' for command '%s'." msgstr "" #: src/relocate.c:70 msgid "HOME variable not found in environment, defaulting to `.'" msgstr "HOME variabele niet gevonden in omgeving, neem `.'" #: src/relocate.c:182 msgid "" "It looks like the game is not correctly installed.\n" "Maybe the data files have not been installed with the same configure " "options\n" "as the executable, or maybe the data files have been moved elsewhere.\n" "In the latter case it's probably enough to set the environment variable\n" "HEROES_PREFIX to the new location. You may also want to set\n" "HEROES_DEBUG=system to see what files Heroes is looking after.\n" "If none of this helps, contact \n" msgstr "" #: src/rsc_files.c:31 #, c-format msgid "%s: no such resource, possible misspelling of '%s'." msgstr "%s: niet zo'n hulpbron, mogelijk foute gespelling voor `%s'." #: src/rsc_files.c:34 #, c-format msgid "%s: no such resource." msgstr "%s: niet zo'n hulpbron." #: src/rsc_files.c:149 #, c-format msgid "%s: null resource" msgstr "%s: nul hulpbron" #: src/rsc_files.c:151 #, c-format msgid "%s: empty resource" msgstr "%s: lege hulpbron" # %s is a filename, right? #: src/savegame.c:90 src/scores.c:103 #, fuzzy, c-format msgid "cannot write %s" msgstr "Kan `%s' niet openen" #: src/savegame.c:95 src/scores.c:107 #, c-format msgid "%s: truncate error" msgstr "" #: src/savegame.c:126 #, c-format msgid "%s:%d: parse error. Clearing saved-games table." msgstr "" #: src/scores.c:150 #, c-format msgid "%s:%d: parse error. Clearing score table." msgstr "" #: src/userconf.c:82 src/userconf.c:115 #, c-format msgid "%s:%d: missing variable name" msgstr "%s:%d: missende variabele naam" #: src/userconf.c:107 #, c-format msgid "%s:%d: missing resource name" msgstr "%s:%d: missende hulpbron naam" #: src/userconf.c:131 src/userconf.c:145 #, c-format msgid "%s:%d: %s: can only be used from the system configuration file" msgstr "" #: src/userconf.c:140 src/userconf.c:154 #, fuzzy, c-format msgid "%s:%d: %s: unknown value: %s" msgstr "%s:%d: onbekend sleutelwoord `%s'" #: src/userconf.c:158 #, c-format msgid "%s:%d: unknown keyword `%s'" msgstr "%s:%d: onbekend sleutelwoord `%s'" #: src/debughash.gperf:45 msgid "all messages" msgstr "alle berichten" #: src/debughash.gperf:46 msgid "different parts of the game" msgstr "verschillende delen van het spel" #: src/debughash.gperf:47 msgid "system related messages" msgstr "systeem gerelateerde berichten" #: src/debughash.gperf:48 msgid "filename resources handling" msgstr "bestandsnaam hulpbronnen behandeling" #: src/debughash.gperf:49 msgid "files and directories handling" msgstr "bestanden en directories behandeling" #: src/debughash.gperf:50 msgid "levels handling" msgstr "levels behandeling" #: src/debughash.gperf:51 msgid "sound track events" msgstr "muziek-nummers gebeurtenissen" #: src/debughash.gperf:52 msgid "sound effects events" msgstr "geluidseffecten gebeurtenissen" #: src/debughash.gperf:53 msgid "communication with the display driver" msgstr "communicatie met de weergave driver" #: src/debughash.gperf:54 #, fuzzy msgid "joystick initialization and events" msgstr "joystick initialisatie" # anybody? #: src/debughash.gperf:55 #, fuzzy msgid "timer handling" msgstr "timer behandeling" #: src/debughash.gperf:56 msgid "miscellaneous events" msgstr "diverse gebeurtenissen" #: src/debughash.gperf:57 msgid "palette fade events" msgstr "palet-vervaag gebeurtenissen" #: src/debughash.gperf:58 msgid "bonus" msgstr "bonus" #: src/debughash.gperf:87 #, c-format msgid "%s: no such channel, assuming you meant '%s'." msgstr "%s: niet zo'n kanaal, neem aan dat u `%s' bedoeld." #: src/debughash.gperf:90 #, c-format msgid "%s: no such channel (--list=debug will list all known channels)" msgstr "%s: niet zo'n kanaal (--list=debug zal alle bekende kanalen geven)" # %s is taken to be an item #: src/media/sfx.c:94 #, c-format msgid "" "Cannot open %s, disabling sound-effects\n" "(run with -X to supress this message)." msgstr "" "Kan `%s' niet openen, zet geluids-effecten uit\n" "(draai met -X om dit bericht te onderdrukken)." # %s is taken to be an item #: src/media/sfx.c:260 #, c-format msgid "Unable to load sample %s" msgstr "Niet in staat om voorproefje `%s' te laden" #: src/media/allegro/joystick.c:45 src/media/gii/joystick.c:109 #: src/media/sdl/joystick.c:50 msgid "No joystick found (run with `-J' to suppress this message)." msgstr "" "Geen joystick gevonden (draai met `-J' om dit bericht te onderdrukken)." #: src/media/dummy/strack.c:75 msgid "Heroes has been compiled without sound support." msgstr "Heroes werd zonde geluidsondersteuning gecompileerd" #. FIXME: ask to send a bug report with a trace #: src/media/ggi/video.c:174 msgid "failed to get any direct buffer for this visual" msgstr "" #. TRANS: a `visual' is associated by LibGGI to a display. You can #. actually call it a `display', this makes no big difference. #: src/media/ggi/video.c:196 msgid "failed to open visual." msgstr "openen van scherm mislukt." #: src/media/ggi/video.c:204 msgid "cannot setup a correct display." msgstr "kon geen correct scherm opzetten." #: src/media/ggi/video.c:211 #, c-format msgid "negotiated video mode is too small (width=%d, height=%d)" msgstr "" #. TRANS: `display-memory' is the name of a LibGGI driver and #. make no sense to translate. #: src/media/ggi/video.c:224 #, fuzzy msgid "Failed to open an internal `display-memory' visual." msgstr "Openen van intern scherm-geheugen voor scherm mislukt." #: src/media/ggi/video.c:226 #, fuzzy msgid "Failed to set 320x200x8 mode on display-memory" msgstr "Openen van intern scherm-geheugen voor scherm mislukt." #: src/media/ggi/video.c:304 msgid "failed to acquire direct-buffer" msgstr "" #: src/media/ggi/video.c:321 msgid "failed to release direct-buffer" msgstr "" #: src/media/gii/joystick.c:96 #, c-format msgid "unexpected event %d\n" msgstr "onverwachte gebeurtenis %d\n" #: src/media/mikmod/strack.c:104 #, c-format msgid "" "Could not initialize sound, reason: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Kon geluid niet starten, reden: %s\n" "Geluid uitvoer wordt uitgezet (gebruik -S om dit bericht te onderdrukken)." #: src/media/mikmod/strack.c:114 msgid "" "Could not initialize sound, reason: LibMikMod is not thread safe.\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Kon geluid niet starten, reden: LibMikMod is niet 'thread' veilig.\n" "Geluid uitvoer wordt uitgezet (gebruik -S om dit bericht te onderdrukken)." # %s(1) is taken to be an item (intead of a short sentence, whatever) #: src/media/mikmod/strack.c:149 src/media/sdl_mixer/strack.c:133 #, c-format msgid "Could not load %s, reason: %s" msgstr "Kon `%s' niet laden, reden: %s" #: src/media/mikmod/strack.c:214 #, c-format msgid "LibMikMod version %ld.%ld.%ld\n" msgstr "LibMikMod versie %ld.%ld.%ld\n" #: src/media/mikmod/strack.c:217 #, c-format msgid "" "\n" "Available drivers:\n" "%s\n" msgstr "" "\n" "Beschikbare drivers:\n" "%s\n" #: src/media/mikmod/strack.c:233 #, c-format msgid "" "Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information." msgstr "" "Argument `%s' buiten begrenzingen, moet binnen %d en %d zijn.\n" "Gebruik `%s --help' voor meer informatie." #: src/media/sdl/video.c:114 #, c-format msgid "Failed to open visual: %s" msgstr "Openen van scherm mislukt: %s" # %s taken to be an item #: src/media/sdl_mixer/strack.c:95 #, c-format msgid "" "Couldn't open audio: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Kon audio `%s' niet openen\n" "Geluid uitvoer wordt uitgezet (gebruik -S om dit bericht te onderdrukken)." #: src/media/sdl_mixer/strack.c:171 msgid "" "Heroes has been compiled with SDL_mixer, there is no driver list available." msgstr "" "Heroes werd gecompileerd met SDL-mixer, er is geen drivers lijst beschikbaar." #: src/media/sdl_mixer/strack.c:187 #, c-format msgid "%s: missing parameter for 'freq'" msgstr "%s: missende parameter voor 'freq'" #: src/media/sdl_mixer/strack.c:193 #, c-format msgid "%s: missing parameter for `buffers'" msgstr "%s: missende parameter voor `buffers'" #: src/media/sdl_mixer/strack.c:195 #, c-format msgid "%s: recognized sound options are freq=nnn and buffers=nnn" msgstr "%s: herkende geluids opties zijn freq=nnn en buffers=nnn" #, fuzzy #~ msgid "" #~ "Use `-lWORD' or `--list=WORD' where WORD can be:\n" #~ " debug display all debugging channels\n" #~ " preferences print the preferences settings\n" #~ " resources print the resources list\n" #~ " sound-drivers print the sound driver list\n" #~ " sound-tracks\t\tprint the sound track list" #~ msgstr "" #~ "Gebruik `-lWOORD' of `--list=WOORD' waar WOORD kan zijn:\n" #~ " debug laat alle debug kanalen zien\n" #~ " resources druk hulpbronnen-lijst af\n" #~ " sound-drivers druk de geluidsdriver-lijst af\n" #~ " sound-tracks\t\tdruk de muzieknummers-lijst af" #~ msgid "Error %d during loading level" #~ msgstr "Fout %d tijdens laden level" #~ msgid "Error %d occured while loading level %s" #~ msgstr "Fout %d trad op tijdens laden level %s" #~ msgid "Cannot open %s." #~ msgstr "Kan `%s' niet openen." #~ msgid "" #~ "\n" #~ "%{img C 444 0 40 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{center}%pUse the arrow keys to scroll up and down.\n" #~ "\n" #~ "%{head 1}CONTROL & BOARD\n" #~ "\n" #~ "%{img C 357 55 80 205}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{img CG 486 0 140 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ msgstr "" #~ "\n" #~ "%{img C 444 0 40 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{center}%pGebruik de pijltjestoetsen om omhoog en naar beneden te " #~ "schuiven.\n" #~ "\n" #~ "%{head 1}CONTROLE & BORD\n" #~ "\n" #~ "%{img C 357 55 80 205}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "%{img CG 486 0 140 320}\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" #~ "\n" # "image" as in picture `beeld' (for instance...). #, fuzzy #~ msgid "Unknown image flag '%c'." #~ msgstr "Onbekende `image' vlag '%c'." #, fuzzy #~ msgid "GFX AND IDEA:" #~ msgstr "GRAPHISCH EN IDEE:" #~ msgid "MUSIC:" #~ msgstr "MUZIEK" #~ msgid "CODE:" #~ msgstr "CODE:" # exceeds 80 columns #~ msgid "PLEASE READ THE LIST OF OTHER CONTRIBUTORS IN THE FILE 'THANKS'" #~ msgstr "" #~ "LEES ALSTUBLIEFT DE LIJST VAN ANDERE `SCHENKERS' IN HET 'THANKS' BESTAND" #~ msgid "%d LIVES LEFT" #~ msgstr "%d LEVENS OVER" heroes-0.21/po/pt_BR.po0000644004117000411500000013377507451377061010416 # HEROES Brazilian Portuguese PO file # Copyright (C) 2001 Free Software Foundation, Inc. # Luzemario Dantas Rocha , 2001. # msgid "" msgstr "" "Project-Id-Version: Heroes 0.18\n" "POT-Creation-Date: 2002-03-30 18:44+0100\n" "PO-Revision-Date: 2001-12-27 20:30+0100\n" "Last-Translator: Luzemario Dantas Rocha \n" "Language-Team: none \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n>1;\n" #: lib/error.c:129 lib/error.c:157 msgid "Unknown system error" msgstr "Erro desconhecido do sistema" #: lib/getopt.c:694 #, c-format msgid "%s: option `%s' is ambiguous\n" msgstr "%s: opção %s é ambígua\n" #: lib/getopt.c:719 #, c-format msgid "%s: option `--%s' doesn't allow an argument\n" msgstr "%s: opção `--%s' não permite um argumento\n" #: lib/getopt.c:724 #, c-format msgid "%s: option `%c%s' doesn't allow an argument\n" msgstr "%s: opção `%c%s' não permite um argumento\n" #: lib/getopt.c:742 lib/getopt.c:915 #, c-format msgid "%s: option `%s' requires an argument\n" msgstr "%s: opção `%s' requer um argumento\n" #. --option #: lib/getopt.c:771 #, c-format msgid "%s: unrecognized option `--%s'\n" msgstr "%s: opção desconhecida `--%s'\n" #. +option or -option #: lib/getopt.c:775 #, c-format msgid "%s: unrecognized option `%c%s'\n" msgstr "%s: opção desconhecida `%c%s'\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:801 #, c-format msgid "%s: illegal option -- %c\n" msgstr "%s: opção ilegal -- %c\n" #: lib/getopt.c:804 #, c-format msgid "%s: invalid option -- %c\n" msgstr "%s: opção inválida -- %c\n" #. 1003.2 specifies the format of this message. #: lib/getopt.c:834 lib/getopt.c:964 #, c-format msgid "%s: option requires an argument -- %c\n" msgstr "%s: opção requer um argumento -- %c\n" #: lib/getopt.c:881 #, c-format msgid "%s: option `-W %s' is ambiguous\n" msgstr "%s: opção `-W %s' é ambígua\n" #: lib/getopt.c:899 #, c-format msgid "%s: option `-W %s' doesn't allow an argument\n" msgstr "%s: opção `-W %s' não permite um argumento\n" #. If XALLOC_FAIL_FUNC is NULL, or does return, display this message #. before exiting when memory is exhausted. Goes through gettext. #: lib/xmalloc.c:66 msgid "memory exhausted" msgstr "memória insuficiente" #: src/argv.c:60 #, c-format msgid "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux and Philippe Meisburger.\n" msgstr "" "Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois,\n" "Alexandre Liverneaux e Philippe Meisburger.\n" #: src/argv.c:63 src/heroeslvl.c:64 msgid "" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." msgstr "" "Isto é software livre; veja os fontes para condições de cópia. NÃO há\n" "garantia; nem mesmo COMERCIAL ou para ATENDIMENTO A PROPÓSITO PARTICULAR." #: src/argv.c:74 msgid "Use `-lWORD' or `--list=WORD' where WORD can be:" msgstr "Use `-lNOME' ou `--list=NOME' onde NOME pode ser:" #: src/argv.c:76 msgid "display all debugging channels" msgstr "mostra todos os canais de debug" #: src/argv.c:78 msgid "list all level files" msgstr "lista todos os arquivos de nível" #: src/argv.c:80 msgid "print the preferences settings" msgstr "imprime as preferências" #: src/argv.c:82 msgid "print the resources list" msgstr "imprime a lista de recursos" #: src/argv.c:84 msgid "print the sound driver list" msgstr "imprime a lista de drivers de som" #: src/argv.c:86 msgid "print the sound track list" msgstr "imprime a lista de músicas" #: src/argv.c:145 src/heroeslvl.c:74 #, c-format msgid "Try '%s --help' for more information.\n" msgstr "Tente '%s --help' para mais informação.\n" #: src/argv.c:150 #, c-format msgid "" "Usage: %s [OPTIONS]...\n" "\n" msgstr "" "Uso: %s [OPÇÕES]...\n" "\n" #: src/argv.c:151 msgid "" "Heroes is a game similar to the \"Tron\" and \"Nibbles\" games of yore\n" "but includes many graphical improvements and new game features.\n" msgstr "" "Heroes é um jogo similar a \"Tron\" e \"Nibbles\" mas inclui muitos\n" "melhoramentos gráficos e novas características de jogo.\n" #: src/argv.c:154 src/heroeslvl.c:81 msgid "" "Mandatory arguments to long options are mandatory for short options too.\n" msgstr "" "Argumentos obrigatórios para opções longas também são obrigatórios para\n" "opções curtas.\n" #: src/argv.c:156 msgid "" "General options:\n" " -v, --version display version number\n" " -h, --help display this help\n" " -q, --quiet don't print warning messages\n" " -Q, --really-quiet don't even print error messages\n" " -v, --verbose=CHANNELS enable or disable debugging channels\n" " (see --list=debug for available channels)\n" " -l, --list=WORD show some internal information; WORD can be\n" " 'debug', 'resources', 'sound-drivers' or\n" " 'sound-tracks'\n" msgstr "" "Opções Gerais:\n" " -v, --version mostra a versão do programa\n" " -h, --help mostra esta ajuda\n" " -q, --quiet não imprime mensagens de alerta\n" " -Q, --really-quiet não imprime nem mesmo mensagens de erro\n" " -v, --verbose=CHANNELS ativa ou desativa canais de debug\n" " (veja --list=debug para canais disponíveis)\n" " -l, --list=NOME mostra informação interna; NOME pode ser\n" " 'debug', 'resources', 'sound-drivers' ou\n" " 'sound-tracks'\n" #: src/argv.c:167 msgid "" "Sound options:\n" " -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:" "autodetect)\n" " (see --list=sound-drivers for available Ns)\n" " -S, --no-sound disable sound\n" " -X, --no-sfx disable sound-effects\n" " -m, --mono non-stereo output\n" " -8, --8bits 8bits sound output\n" " -i, --high-quality high quality mixer\n" msgstr "" "Opções de som:\n" " -d, --driver=N[,OPÇÕES] use driver N para saída de som (0:" "autodetecta)\n" " (veja --list=sound-drivers para ver os N's)\n" " -S, --no-sound desativa som\n" " -X, --no-sfx desativa efeitos sonoros\n" " -m, --mono saída não-estéreo\n" " -8, --8bits saída de som em 8 bits\n" " -i, --high-quality mixer de alta qualidade\n" #: src/argv.c:176 msgid "" "Display options:\n" " -G, --gfx-options=OPTIONS pass OPTIONS to the display driver\n" " -F, --full-screen full screen mode\n" " -2, --double stretch the display twofold\n" " -3, --triple stretch the display threefold\n" " -4, --quadruple stretch the display fourfold\n" " -e, --even-lines display only even-lines\n" msgstr "" "Opções de tela:\n" " -G, --gfx-options=OPÇÕES passa OPÇÕES para o driver de tela\n" " -F, --full-screen modo tela cheia\n" " -2, --double duplica o tamanho da tela\n" " -3, --triple triplica o tamanho da tela\n" " -4, --quadruple quadruplica o tamanho da tela\n" " -e, --even-lines mostra somente as linhas pares\n" #. TRANS: rotozoom is a graphical effect used in the demo of yore #. where the screen rotate and zoom (actually it doesn't zoom in Heroes); #. waves is another effect where the screen is agitated like some #. jelly (this was also called the `mushroom effect' in game like #. Death Rally). #: src/argv.c:189 msgid "" "Miscellaneous options:\n" " --cpu-off disable computer opponents\n" " --default-scores restore default scores file\n" " --default-options restore default options file\n" " --default-saves restore default saves file\n" " -s, --swap-sides swap sides in two player mode\n" " --no-double-fx disable combination of rotozoom and waves\n" " -g, --go skip the introduction\n" " -J, --no-joystick disable joystick handling\n" msgstr "" "Opções miscelâneas:\n" " --cpu-off desativa o controle dos oponentes pela CPU\n" " --default-scores recria um arquivo padrão para os escores\n" " --default-options recria um arquivo padrão para as opções\n" " --default-saves recria um arquivo padrão para jogos salvos\n" " -s, --swap-sides troca lados no modo de dois jogadores\n" " --no-double-fx desativa a combinação de rotozoom e ondas\n" " -g, --go pula a introdução\n" " -J, --no-joystick desativa o uso de joystick\n" #: src/argv.c:199 msgid "" "These options can be set in your file ~/.heroes/heroesrc (which is read\n" "before parsing other command line options) using a line like the following:\n" "\n" " Options: -gs -d3,buffer=11,count=4\n" msgstr "" "Estas opções podem ser postas no seu arquivo ~/.heroes/heroesrc\n" "(que é lido antes de analisar outras opções da linha de comando)\n" "usando uma linha igual a seguinte:\n" "\n" " Options: -gs -d3,buffer=11,count=4\n" #: src/argv.c:204 msgid "" "Visit http://heroes.sourceforge.net/ for news, documentation, and updates." msgstr "" "Visite http://heroes.sourceforge.net/ para notícias, documentos e " "atualizações." #: src/argv.c:206 src/heroeslvl.c:102 msgid "Report bugs to ." msgstr "Reporte bugs a ." #: src/argv.c:312 msgid "-n is an obsolete option, you should use --list=sound-drivers" msgstr "-n é uma opção obsoleta, você deve usar --list=sound-drivers" #: src/bonus.c:324 src/bonus.c:329 #, c-format msgid "SIZE IS %d" msgstr "TAMANHO %d" #: src/bonus.c:334 msgid "SPEEDED UP" msgstr "VELOCIDADE+" #: src/bonus.c:338 msgid "SPEEDED DOWN" msgstr "VELOCIDADE-" #: src/bonus.c:345 #, c-format msgid "GET %dPTS" msgstr "%d PONTOS" #: src/bonus.c:350 msgid "FIRE TRAIL!" msgstr "CAUDA DE FOGO!" #: src/bonus.c:364 msgid "GET TURBO+" msgstr "TURBO+" #: src/bonus.c:371 msgid "GET TURBO-" msgstr "TURBO-" #: src/bonus.c:379 msgid "INVINCIBLE!" msgstr "INVENCÍVEL!" #: src/bonus.c:391 msgid "EXTRA-LIFE!" msgstr "VIDA EXTRA!" #: src/endscroll.c:113 msgid "THE END" msgstr "FIM" #: src/fontdata.c:243 #, c-format msgid "character '%c' is not drawable (in message '%s')" msgstr "caracter '%c' não é desenhável (na mensagem '%s')" #: src/hedlite.c:1622 #, c-format msgid "Cannot create directory `%s'." msgstr "Impossível criar diretório `%s'." #: src/hedlite.c:1679 src/hedlite.c:1686 #, c-format msgid "%s: invalid level file" msgstr "%s: arquivo de nível inválido" #: src/helptext.c:24 msgid "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "\n" "%{center}%pUse the arrow keys to scroll up and down.\n" "\n" "%{head 1}CONTROL & BOARD\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSE\n" "%{textat cR -9 97}%yQUIT GAME\n" "%{textat cR 26 -62}%yCONTROL\n" "%{textat cL 30 74}%ySTOP\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%ySCORE\n" "%{textat cR 1 8}%yCOMMENTARY\n" "%{textat cL 16 29}%yHEROES\n" "%{textat cL 33 29}%yWALLS\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yLIFES\n" "%{textat cL 51 -109}%yTURBO ENERGY\n" "%{textat cL 72 -104}%yTIME\n" "%{textat cR 96 40}%yPLAYER COLOR\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" msgstr "" "\n" "%{img C 444 0 40 320}\n" "\n" "\n" "\n" "\n" "%{center}%pUse as teclas de seta para ver acima e abaixo.\n" "\n" "%{head 1}CONTROLE & TECLAS\n" "\n" "%{img BC 357 55 80 205}\n" "%{textat cL -9 -81}%yPAUSA\n" "%{textat cR -9 97}%ySAI DO JOGO\n" "%{textat cR 26 -62}%yCONTROLE\n" "%{textat cL 30 74}%yPARAR\n" "%{textat cL 52 68}%yTURBO\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img BCG 486 0 140 320}\n" "%{textat cR -7 -82}%yESCORE\n" "%{textat cR 1 8}%yCOMENTÁRIOS\n" "%{textat cL 16 29}%yHEROES\n" "%{textat cL 33 29}%yPAREDES\n" "%{textat cL 55 29}%yBONUS\n" "%{textat cL 29 -102}%yVIDAS\n" "%{textat cL 51 -109}%yENERGIA DO TURBO\n" "%{textat cL 72 -104}%yTEMPO\n" "%{textat cR 96 40}%yCOR DO JOGADOR\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" #: src/helptext.c:71 msgid "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Affects the player that gets the item\n" "%{img L 60 22 20 22}Affects all players except the one who gets the bonus\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points\n" "%{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions\n" "\n" msgstr "" "\n" "\n" "\n" "%{head 2}BONUS\n" "\n" "%{img L 60 0 20 22}Afeta o jogador que pega o item\n" "%{img L 60 22 20 22}Afeta todos os jogadores exceto quem pega o item\n" "\n" "%{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Cauda +1\n" "%{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Cauda -1\n" "%{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Aumenta a velocidade\n" "%{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Baixa a velocidade\n" "%{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Bonus aleatório\n" "%{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Pontos\n" "%{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Cauda de fogo\n" "%{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Parar\n" "%{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Controles invertidos\n" "%{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Turbo +\n" "%{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Turbo -\n" "%{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}Fim do Nível\n" "%{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerabilidade\n" "%{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom\n" "%{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Vida extra\n" "%{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Visões onduladas\n" "\n" #: src/helptext.c:99 msgid "" "%{head 3}GAME MODES\n" "\n" "%{>>}%yQUEST\n" "\n" "%{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers " "you. Your aim is to collect a given number (10) of Trail+1 bonuses and then " "to get the End-of-Level bonus that will send you to next level.\n" "%{>>>}%{img L 20 176 20 22}End-of-Level\n" "%{img R 0 0 20 22}%{flushright}Trail+1\n" "%{>>>}Trail+1 has the effect of growing your trail. There are two way to " "get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first " "appears when someone's trail reach 10 units.\n" "\n" "%{>>}%yDEATH MATCH\n" "\n" "%{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a " "fight to death. The aim of the game is to be the last player still alive. " "For this, feel free to use any stratagems you want. Nothing is forbidden.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL\n" "\n" "%{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm " "all the people of your competitors. It was said \"There can be only one\", " "make sure it is yours!\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}They are among us, find them !\n" "\n" "%{>>}%yCOLOR\n" "\n" "%{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time " "to get a maximum of gems of your color. Beware, if you go over your " "competitor's gems, it's your competitor's gem account that you will " "increase. Be also sure not to get crossed gems because you'll lose " "collected gems. Grey ones gives gems to all players except the one that " "goes over it. The Clocks give you extra time.\n" "\n" "%{>>}%yTIME CA$H\n" "\n" "%{>>>}In %yTIME CA$H%w mode the winner is the player who collected the " "largest amount of money.\n" "\n" msgstr "" "%{head 3}MODOS DE JOGO\n" "\n" "%{>>}%yCAÇADA\n" "\n" "%{>>>}O modo %yCAÇADA%w permite jogar todos os 94 níveis que HEROES " "oferece. Seu objetivo é pegar um número dado de bonus Cauda+1 (10) e então " "pegar o bonus Fim de nível que enviará você ao próximo nível.\n" "%{>>>}%{img L 20 176 20 22}Fim de nível\n" "%{img R 0 0 20 22}%{flushright}Cauda+1\n" "%{>>>}Cauda+1 aumenta sua cauda. Existem duas maneiras de fazer ela " "diminuir: pegue um Cauda-1 ou perdendo uma vida. O bonus Fim do nível " "aparece apenas quando a cauda de alguém atinge 10 unidades.\n" "\n" "%{>>}%yENCONTRO MORTAL\n" "\n" "%{>>>}O modo %yENCONTRO MORTAL%w permite encarar outros jogadores em uma " "luta mortal. O objetivo do jogo é ser o último jogador vivo. Para isso, " "sinta-se livre para usar qualquer estratégia que você precisar. Nada é " "proibido.\n" "\n" "%{img BLVr 130 9 30 57}%{>>}%yMATAR TODOS\n" "\n" "%{>>>}O modo %yMATAR TODOS%w tem apenas uma regra: Voce tem que atropelar o " "povo dos seus competidores. Foi dito \"Só pode haver um\", tenha certeza " "que é você !\n" "\n" "%{img LG 131 70 20 100}\n" "%{img LG 151 70 20 80}Eles estao contra nós, ache-os !\n" "\n" "%{>>}%yCORES\n" "\n" "%{>>>}O modo %yCORES%w é muito simples. Você tem uma certa quantidade de " "tempo para pegar o máximo de pedras da sua cor. Cuidado, se você passar " "pelas pedras dos seus competidores, é a conta deles que aumenta. Também " "tenha certeza de não pegar pedras com X porque você perde pedras coletadas. " "As pedras cinzas vão para todos exceto quem pegou elas. Os relógios dão a " "você tempo extra.\n" "\n" "%{>>}%yTEMPO É DINHEIRO\n" "\n" "%{>>>}No modo %yTEMPO É DINHEIRO%w o vencedor é o jogador que pegar mais " "dinheiro.\n" "\n" #: src/helptext.c:145 msgid "" "%{head 4}GAME OPTIONS\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gCOLOR SELECT\n" "\n" "%{>>>}This option allows you to choose the color of your vehicle between %" "pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gGAME SPEED\n" "\n" "%{>>>}The %gGAME SPEED%w option allows you to select the initial speed of " "the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gROUNDS\n" "\n" "%{>>>}The %gROUNDS%w option allows you to select the number of rounds in the " "tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. These " "values range from 1 to 100 rounds.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMATION\n" "\n" "%{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better " "visibility.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gLIGHTING\n" "\n" "%{>>>}The %gLIGHTING%w option is here to tune the luminosity of your " "screen.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gINERTIA\n" "\n" "%{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOT\n" "\n" "%{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, rest in " "peace... Note that %gAUTOPILOT%w does not work against fire trails.\n" "\n" msgstr "" "%{head 4}OPÇÕES DE JOGO\n" "\n" "%{img L 293 165 20 134}\n" "%{>>}%gESCOLHA DE COR\n" "\n" "%{>>>}Esta opção permite mudar a cor do seu veiculo entre %pROSA%w, %yAMARELO" "%w, %bAZUL%w and %gVERDE%w.\n" "\n" "%{img L 335 165 20 32}\n" "%{>>}%gVELOCIDADE DE JOGO\n" "\n" "%{>>>}A opção %gVELOCIDADE DE JOGO%w permite selecionar a velocidade inicial " "dos veículos. As 3 velocidades disponíveis são: NORMAL, EXPERT, HEROES.\n" "\n" "%{img L 314 264 20 32}\n" "%{>>}%gROUNDS\n" "\n" "%{>>>}A opção %gROUNDS%w permite selecionar o número de rounds nos modos de " "torneio: ENCONTRO MORTAL, MATAR TODOS, CORES e TEMPO É DINHEIRO. Estes " "valores estão entre 1 e 100 rounds.\n" "\n" "%{img L 293 0 20 33}%{img L 293 132 20 33}\n" "%{>>}%gRADAR & INFORMAÇÃO\n" "\n" "%{>>>}Voce pode desativar o %gRADAR%w e as %gINFORMAÇÕES%w para melhor " "visibilidade.\n" "\n" "%{img L 314 231 20 32}\n" "%{>>}%gBRILHO\n" "\n" "%{>>>}A opcao %gBRILHO%w está aqui para ajustar a luminosidade da sua tela.\n" "\n" "%{img L 314 0 20 32}\n" "%{>>}%gINÉRCIA\n" "\n" "%{>>>}A chave %gINÉRCIA%w ativa ou desativa a inércia de deslocamento da " "tela.\n" "\n" "%{img L 293 99 20 32}\n" "%{>>}%gAUTOPILOTO\n" "\n" "%{>>>}Se você for doido, pode tentar jogar sem %gAUTOPILOTO%w, descanse em " "paz... Note que %gAUTOPILOTO%w não funciona contra caudas de fogo.\n" "\n" #: src/helptext.c:191 msgid "" "%{head 1}CONTACT\n" "\n" "%{center}home page:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}send bug reports to:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" msgstr "" "%{head 1}CONTATO\n" "\n" "%{center}home page:\n" "%{img BCVr 183 124 30 41}\n" "%{center}http://heroes.sourceforge.net/\n" "\n" "%{center}mande relatório de bugs para:\n" "%{img BCVr 183 124 30 41}\n" "%{center}heroes-bugs@lists.sourceforge.net\n" "\n" #: src/helptext.c:204 msgid "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's " "environmental and ecological issues and did our best to use only recycled " "bytes in this program.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux and Philippe Meisburger.\n" "\n" msgstr "" "%{img C 175 0 10 119}\n" "%{img L 96 200 40 50}%{img R 96 200 40 50} Tivemos o cuidado com as " "preocupações ambientais e ecológicas de hoje e fizemos o melhor para usar " "somente bytes reciclados neste programa.\n" "%{img C 175 0 10 119}\n" "\n" "\n" "%{img CG 145 150 40 120}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{img C 220 3 60 130}\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "%{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, " "Alexandre Liverneaux e Philippe Meisburger.\n" "\n" #: src/heroes.c:677 src/heroes.c:763 #, c-format msgid "Cannot load level %s (error %d)" msgstr "Impossível carregar nível %s (erro %d)" #: src/heroes.c:1969 #, c-format msgid "INVERTED %d" msgstr "INVERTIDO %d" #: src/heroes.c:2003 #, c-format msgid "STOPPED %d" msgstr "PARADO %d" #. TRANS: %d, the number of remaining lives, is always #. positive. #: src/heroes.c:2300 msgid "LAST LIFE" msgid_plural "%d LIVES LEFT" msgstr[0] "ULTIMA VIDA" msgstr[1] "%d VIDAS RESTANTES" #: src/heroes.c:2873 msgid "Error during level loading" msgstr "Erro durante a carga do nível" #: src/heroes.c:2909 #, c-format msgid "-LEVEL %d-" msgstr "-NÍVEL %d-" #: src/heroes.c:2911 #, c-format msgid "-ROUND %d/%d-" msgstr "-ROUND %d/%d-" #: src/heroes.c:3416 msgid "error in sfx.cfg" msgstr "erro em sfx.cfg" #: src/heroeslvl.c:63 #, c-format msgid "Copyright (C) %d Alexandre Duret-Lutz.\n" msgstr "Copyright (C) %d Alexandre Duret-Lutz.\n" #: src/heroeslvl.c:79 #, c-format msgid "" "Usage: %s [OPTIONS]... levels\n" "\n" msgstr "" "Uso: %s [OPÇÕES]... níveis\n" "\n" #: src/heroeslvl.c:80 msgid "Heroeslvl is a tool used to inspect Heroes' level files.\n" msgstr "" "Heroeslvl é uma ferramenta usada para inspecionar arquivos de nível do " "Heroes.\n" #: src/heroeslvl.c:83 msgid " -v, --version display version number" msgstr " -v, --version mostra o número da versão" #: src/heroeslvl.c:85 msgid " -h, --help display this help" msgstr " -h, --help mostra esta ajuda" #: src/heroeslvl.c:87 msgid "" " -p, --print=WHAT select information to display. WHAT should " "be\n" " one or more of these characters:" msgstr "" " -p, --print=NOME seleciona informação para mostrar. NOME deve " "ser\n" " um ou mais destes caracteres:" #: src/heroeslvl.c:90 msgid "d print square directions" msgstr "d imprime direções" #: src/heroeslvl.c:91 msgid "f print filename" msgstr "f imprime o nome do arquivo" #: src/heroeslvl.c:92 msgid "h print header" msgstr "h imprime cabeçalho" #: src/heroeslvl.c:93 msgid "i print tile details" msgstr "i imprime detalhes do bloco" #: src/heroeslvl.c:94 msgid "t print square type map" msgstr "t imprime mapa tipo quadrado" #: src/heroeslvl.c:95 msgid "T print type keys" msgstr "T imprime teclas" #: src/heroeslvl.c:96 msgid "w print square wall map" msgstr "w imprime mapa das parades" #: src/heroeslvl.c:97 msgid "@ print tunnels" msgstr "@ imprime túneis" #: src/heroeslvl.c:98 msgid " -i, --indent indent everything but the filename" msgstr " -i, --indent indenta tudo menos o nome do arquivo" #: src/heroeslvl.c:101 msgid "When no options are given, the default is -ipfh." msgstr "Quando não são fornecidas opções, o default é -ipfh." #: src/heroeslvl.c:201 #, c-format msgid "%sheight:\t%d tiles\t(%d squares)\n" msgstr "%saltura:\t%d blocos\t(%d quadros)\n" #: src/heroeslvl.c:203 #, c-format msgid "%swidth:\t%d tiles\t(%d squares)\n" msgstr "%slargura:\t%d blocos\t(%d quadros)\n" #: src/heroeslvl.c:206 #, c-format msgid "%sY-wrap:\tno\n" msgstr "%scruza-Y:\tnão\n" #: src/heroeslvl.c:208 #, c-format msgid "%sY-wrap:\t%d tiles\t(%d squares)\n" msgstr "%scruza-Y:\t%d blocos\t(%d quadros)\n" #: src/heroeslvl.c:211 #, c-format msgid "%sX-wrap:\tno\n" msgstr "%scruza-X:\tnão\n" #: src/heroeslvl.c:213 #, c-format msgid "%sX-wrap:\t%d tiles\t(%d squares)\n" msgstr "%scruza-X:\t%d blocos\t(%d quadros)\n" #: src/heroeslvl.c:215 #, c-format msgid "%ssound track alias:\t%s\n" msgstr "%smúsica:\t%s\n" #: src/heroeslvl.c:217 #, c-format msgid "%stile map basename:\t%s\n" msgstr "%sbloco mapa nome:\t%s\n" #: src/heroeslvl.c:219 #, c-format msgid "%sstarting squares and directions (y x dir):\n" msgstr "%squadros iniciais e direções (y x dir):\n" #: src/heroeslvl.c:261 msgid "none" msgstr "nenhum" #: src/heroeslvl.c:262 msgid "stop" msgstr "parar" #: src/heroeslvl.c:263 msgid "speed" msgstr "velocidade" #: src/heroeslvl.c:264 msgid "tunnel" msgstr "túnel" #: src/heroeslvl.c:265 msgid "boom" msgstr "bomba" #: src/heroeslvl.c:266 msgid "anim" msgstr "anim" #: src/heroeslvl.c:267 msgid "ice" msgstr "gelo" #: src/heroeslvl.c:268 msgid "dust" msgstr "poeira" #: src/heroeslvl.c:269 msgid "outway" msgstr "desvio" #: src/heroeslvl.c:389 #, c-format msgid "%sTunnels:\n" msgstr "%sTúneis:\n" #. TRANS: This is the header of an array (output by heroeslvl -p@), #. so the position of these words is important. #. #. SRCIDX is a short for 'source index' (entrance of a tunnel) and #. DESTIDX means 'destination index' (output of the tunnel). #: src/heroeslvl.c:395 #, c-format msgid "%s NBR SRCIDX Y X DIR DESTIDX\n" msgstr "%s NUM ORIGEM Y X DIR DESTINO\n" #. TRANS: `still' is used to describe tiles which are not animated. #: src/heroeslvl.c:426 msgid "still" msgstr "fixo" #. TRANS: `loop' is for animated tiles where frames are displayed #. from 1 to n, and then again from 1 to n, etc. #: src/heroeslvl.c:430 msgid "loop" msgstr "volta" #. TRANS: `pingpong' is for tiles animated in loop where frame #. displayed from 1 to n, then from n to 1, and then again from 1 #. to n, etc. #: src/heroeslvl.c:435 msgid "pingpong" msgstr "pinguepongue" #. TRANS: This is the header of an array (output by heroeslvl -pi) so #. the position of these word is important. #. #. SPRITE is the address of the sprite used to render the tile. OVERLAY #. is the address of a sprite that should be displayed on top #. of the players (e.g. trees). ANIM-TYPE is the kind of animation used #. for the tile, FRM the number of frame to display, DEL the delay #. between each frame. #: src/heroeslvl.c:453 #, c-format msgid "%sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL\n" msgstr "%sBLOC Y X TIPO SPRITE OVERLAY TIPO-ANIM FRM ESP\n" #: src/heroeslvl.c:503 #, c-format msgid "cannot load %s" msgstr "Impossível carregar %s" #: src/heroeslvl.c:507 #, c-format msgid "File:\t%s\n" msgstr "Arquivo:\t%s\n" #: src/heroeslvl.c:539 msgid "Missing filename." msgstr "Arquivo não encontrado." #: src/levellst.c:53 #, c-format msgid "cannot open directory %s" msgstr "Impossível abrir diretório %s" #. TRANS: in QUEST mode, the player goes throught all the levels, but #. have to search for specific powerups in order to jump to the next #. level. Hence this is a `quest' for those powerups. #: src/menus.c:146 msgid "QUEST" msgstr "CAÇADA" #. TRANS: in DEATH MATCH mode, the user has to kill all other players. #: src/menus.c:148 msgid "DEATH MATCH" msgstr "ENCONTRO MORTAL" #. TRANS: in KILL'EM ALL mode there are lemmings moving on the ground #. and the player must run over them all. You may want to translate #. `kill' as `run over', `squash', `mash' or something among those #. lines. #: src/menus.c:153 msgid "KILL'EM ALL" msgstr "MATAR TODOS" #. TRANS: in TIME CA$H mode, the player must collect dollars with #. restricted time. #: src/menus.c:156 msgid "TIME CA$H" msgstr "TEMPO É DINHEIRO" #. TRANS: in COLOR mode, the player must collect some colored gems #. with restricted time. #: src/menus.c:159 msgid "COLORS" msgstr "CORES" #: src/menus.c:192 msgid "GAME" msgstr "JOGO" #: src/menus.c:193 msgid "SCREEN" msgstr "TELA" #: src/menus.c:194 msgid "SOUND" msgstr "SOM" #: src/menus.c:195 msgid "CONTROL" msgstr "CONTROLE" #: src/menus.c:196 msgid "KEYS" msgstr "TECLAS" #: src/menus.c:197 msgid "EXTRAS" msgstr "EXTRAS" #: src/menus.c:198 src/menus.c:222 src/menus.c:385 src/menus.c:395 #: src/menus.c:409 src/menus.c:421 src/menus.c:431 src/menus.c:454 #: src/menus.c:545 msgid "GO BACK" msgstr "VOLTA" #. play menu #: src/menus.c:205 src/menus.c:539 msgid "PLAY" msgstr "JOGAR" #. options menu #: src/menus.c:206 src/menus.c:526 msgid "OPTIONS" msgstr "OPÇOES" #: src/menus.c:207 src/menus.c:406 msgid "INFOS" msgstr "INFOS" #: src/menus.c:208 msgid "CREDITS" msgstr "CRÉDITOS" #: src/menus.c:209 msgid "SCORES" msgstr "ESCORES" #. editor first menu #: src/menus.c:210 src/menus.c:536 msgid "EDITOR" msgstr "EDITOR" #: src/menus.c:211 msgid "QUIT" msgstr "SAIR" #. TRANS: Create a new level. #: src/menus.c:219 src/menus.c:503 msgid "NEW LEVEL" msgstr "NOVO NÍVEL" #. TRANS: Load an existing level for edition. #: src/menus.c:221 msgid "LOAD LEVEL" msgstr "CARREGA NÍVEL" #: src/menus.c:375 msgid "CONTROL OPTIONS" msgstr "CONTROLE" #. 1st player #: src/menus.c:377 src/menus.c:416 src/menus.c:433 msgid "PLAYER 1" msgstr "JOGADOR 1" #: src/menus.c:379 src/menus.c:383 msgid "AUTO PILOT" msgstr "AUTO PILOTO" #. 2nd player #: src/menus.c:381 src/menus.c:417 src/menus.c:441 msgid "PLAYER 2" msgstr "JOGADOR 2" #: src/menus.c:391 msgid "SOUND OPTIONS" msgstr "OPÇOES DE SOM" #: src/menus.c:393 msgid "MUSIC" msgstr "MÚSICA" #: src/menus.c:394 msgid "SFX" msgstr "SOM FX" #: src/menus.c:398 msgid "MUSIC VOL" msgstr "VOL MÚSICA" #: src/menus.c:399 msgid "SFX VOL" msgstr "VOL SFX" #: src/menus.c:403 msgid "SCREEN OPTIONS" msgstr "OPÇOES DE TELA" #: src/menus.c:405 msgid "RADAR" msgstr "RADAR" #: src/menus.c:407 msgid "LIGHTING" msgstr "BRILHO" #: src/menus.c:408 msgid "INERTIA" msgstr "INÉRCIA" #: src/menus.c:414 msgid "GAME OPTIONS" msgstr "OPÇOES DE JOGO" #: src/menus.c:418 msgid "PLAYER 3" msgstr "JOGADOR 3" #: src/menus.c:419 msgid "PLAYER 4" msgstr "JOGADOR 4" #: src/menus.c:420 msgid "SPEED" msgstr "VELOCIDADE" #: src/menus.c:429 msgid "KEYBOARD DEFS" msgstr "TECLADO" #: src/menus.c:434 src/menus.c:442 msgid "UP" msgstr "ACIMA" #: src/menus.c:435 src/menus.c:443 msgid "LEFT" msgstr "ESQUERDA" #: src/menus.c:436 src/menus.c:444 msgid "DOWN" msgstr "ABAIXO" #: src/menus.c:437 src/menus.c:445 msgid "RIGHT" msgstr "DIREITA" #: src/menus.c:438 src/menus.c:446 msgid "TURBO" msgstr "TURBO" #: src/menus.c:439 src/menus.c:447 msgid "STOP" msgstr "PARAR" #: src/menus.c:452 msgid "EXTRAS LEVELS" msgstr "NÍVEIS EXTRAS" #: src/menus.c:456 msgid "ORIGINAL LEVELS" msgstr "NÍVEIS ORIGINAIS" #: src/menus.c:458 msgid "ORIGINAL+EXTRAS" msgstr "ORIGINAL+EXTRAS" #: src/menus.c:460 msgid "EXTRAS ONLY" msgstr "EXTRAS SOMENTE" #: src/menus.c:462 msgid "EXTRAS: NONE" msgstr "EXTRAS: NENHUM" #: src/menus.c:464 msgid "EXTRAS: ALL" msgstr "EXTRAS: TODOS" #: src/menus.c:466 msgid "EXTRAS: SELECT" msgstr "EXTRAS: ESCOLHA" #. pause menu #: src/menus.c:491 msgid "PAUSE" msgstr "PAUSA" #. quit y/n menus #: src/menus.c:495 msgid "QUIT THIS GAME?" msgstr "SAIR DESTE JOGO?" #: src/menus.c:497 msgid "REALLY QUIT?" msgstr "REALMENTE SAIR?" #: src/menus.c:499 msgid "NO" msgstr "NAO" #: src/menus.c:500 msgid "YES" msgstr "SIM" #: src/menus.c:505 msgid "EXISTING LEVEL" msgstr "NÍVEL EXISTENTE" #: src/menus.c:507 msgid "NAME" msgstr "NOME" #. TRANS: in wrapped levels are unbounded level, e.g. whenever the #. player reach the left border it continue its way from the right border #. (except that the player doesn't even know there are borders, because #. the level is tiled infinitely). In unwrapped levels there are explicit #. bounds that you cannot cross. X-WRAP is a check box used to specified #. whether a level must be wrapped horizontally or not when creating a #. new level. #: src/menus.c:515 msgid "X-WRAP" msgstr "CRUZA-X" #. TRANS: Y-WRAP is a check box used to specified whether a level #. must be wrapped vertically or not. #: src/menus.c:518 msgid "Y-WRAP" msgstr "CRUZA-Y" #. TRANS: width of the level #: src/menus.c:520 msgid "X-SIZE" msgstr "TAM-X" #. TRANS: height of the level #: src/menus.c:522 msgid "Y-SIZE" msgstr "TAM-Y" #: src/menus.c:523 msgid "EDIT" msgstr "EDITA" #. main menu #: src/menus.c:529 msgid "HEROES" msgstr "HEROES" #. editor selector #: src/menus.c:532 msgid "SELECT A LEVEL" msgstr "ESCOLHA UM NÍVEL" #: src/menus.c:541 msgid "ONE PLAYER" msgstr "UM JOGADOR" #: src/menus.c:543 msgid "TWO PLAYERS" msgstr "DOIS JOGADORES" #: src/menus.c:547 msgid "LOAD..." msgstr "CARREGAR..." #. saved game selection #: src/menus.c:556 msgid "CHOOSE A SAVE SLOT" msgstr "SALVAR ONDE?" #: src/menus.c:558 msgid "CHOOSE A LOAD SLOT" msgstr "CARREGAR QUAL?" #. enter your name #: src/menus.c:562 msgid "ENTER YOUR NAME:" msgstr "ENTRE SEU NOME:" #. end level info #. TRANS: SIZE is the size of the player trail, PTS the #. number of PoinTS #: src/menus.c:568 msgid "SIZE PTS LIVES" msgstr "TAM PTS VIDAS" #: src/menus.c:570 msgid "PTS LIVES" msgstr "PTS VIDAS" #. TRANS: this is for KILL'EM ALL mode, and MEN is the number #. of lemmings killed by one player #: src/menus.c:574 msgid " MEN PTS LIVES" msgstr " NUM PTS VIDAS" #: src/menus.c:576 msgid "CA$H PTS LIVES" msgstr "DINH PTS VIDAS" #: src/menus.c:578 msgid "COLORS PTS LIVES" msgstr "CORES PTS VIDAS" #: src/menus.c:583 msgid "NEXT LEVEL" msgstr "PROXIMO NIVEL" #. TRANS: this is a menu entry that introduce the user to another #. menu. This is NOT displayed DURING saving. #: src/menus.c:588 msgid "SAVE..." msgstr "SALVAR..." #: src/menus.c:593 msgid "PRESS RETURN" msgstr "TECLE ENTER" #: src/menus.c:602 msgid "WINS PTS LIVES" msgstr "GANHOU PTS VIDAS" #. higher scores #: src/menus.c:613 msgid "HIGHER SCORES" msgstr "MAIORES ESCORES" #: src/menus.c:1231 #, fuzzy, c-format msgid "%d ROUND" msgid_plural "%d ROUNDS" msgstr[0] "SOM" #: src/menus.c:2220 #, c-format msgid "PLAYER %d, YOU CAME IN THE TOP 10" msgstr "JOGADOR %d, VOCE VEIO AO TOP 10" #: src/menus.c:2287 #, c-format msgid "PLAYER %d WON!" msgstr "JOGADOR %d VENCEU!" #: src/menus.c:2293 msgid "EVERYONE LOST!" msgstr "TODOS PERDERAM!" #: src/menus.c:2295 msgid "YOU LOST!" msgstr "VOCÊ PERDEU!" #: src/menus.c:2374 #, c-format msgid "ROUND %d/%d" msgstr "ROUND %d/%d" #: src/musicfiles.c:174 #, c-format msgid "%s:%d: missing alias name" msgstr "%s:%d: apelido não encontrado" #: src/musicfiles.c:176 #, c-format msgid "%s:%d: missing file name" msgstr "%s:%d: arquivo não encontrado" #: src/musicfiles.c:178 #, c-format msgid "%s:%d: missing title" msgstr "%s:%d: título não encontrado" #: src/musicfiles.c:180 #, c-format msgid "%s:%d: missing author" msgstr "%s:%d: autor não encontrado" #: src/pcx.c:53 #, c-format msgid "Cannot open %s" msgstr "Impossível abrir %s" #: src/people.c:39 msgid "%{center}You owe this game to the following people" msgstr "%{center}Você deve este jogo as seguintes pessoas" #: src/people.c:41 msgid "Authors\n" msgstr "Autores\n" #: src/people.c:49 msgid "Contributors\n" msgstr "Contribuintes\n" #: src/people.c:56 msgid "Translators\n" msgstr "Tradutores\n" #: src/people.c:59 src/people.c:74 msgid "German" msgstr "Alemão" #: src/people.c:62 msgid "Dutch" msgstr "Suíço" #: src/people.c:65 msgid "Brazilian Portuguese" msgstr "" #: src/people.c:68 msgid "Italian" msgstr "Italiano" #: src/people.c:71 msgid "French" msgstr "Francês" #: src/people.c:78 msgid "Packagers\n" msgstr "Empacotadores\n" #: src/people.c:87 msgid "Porters\n" msgstr "Portadores\n" #: src/people.c:94 msgid "Other people we wish to thanks\n" msgstr "Outras pessoas que gostaríamos de agradecer\n" #: src/readmake.c:188 #, c-format msgid "Unknown option '%c' for command '%s'." msgstr "Opção '%c' desconhecida para o comando '%s'." #: src/relocate.c:70 msgid "HOME variable not found in environment, defaulting to `.'" msgstr "variável HOME não encontrada do ambiente, assumindo '.'" #: src/relocate.c:182 msgid "" "It looks like the game is not correctly installed.\n" "Maybe the data files have not been installed with the same configure " "options\n" "as the executable, or maybe the data files have been moved elsewhere.\n" "In the latter case it's probably enough to set the environment variable\n" "HEROES_PREFIX to the new location. You may also want to set\n" "HEROES_DEBUG=system to see what files Heroes is looking after.\n" "If none of this helps, contact \n" msgstr "" "Parece que o jogo não está instalado corretamente.\n" "Talvez os arquivos de dados não tenham sido instalados com as mesmas opções\n" "de configuração do executável, ou os arquivos de dados foram movidos para\n" "algum lugar.\n" "Neste último caso é provavelmente suficiente setar a variável de ambiente\n" "HEROES_PREFIX para a nova localização. Você ainda pode precisar setar\n" "HEROES_DEBUG=system para ver que arquivos Heroes está procurando.\n" "Se nada disso ajuda, contacte \n" #: src/rsc_files.c:31 #, c-format msgid "%s: no such resource, possible misspelling of '%s'." msgstr "%s: recurso inexistente, possível digitação errada de '%s'." #: src/rsc_files.c:34 #, c-format msgid "%s: no such resource." msgstr "%s: recurso inexistente." #: src/rsc_files.c:149 #, c-format msgid "%s: null resource" msgstr "%s: recurso nulo" #: src/rsc_files.c:151 #, c-format msgid "%s: empty resource" msgstr "%s: recurso vazio" #: src/savegame.c:90 src/scores.c:103 #, c-format msgid "cannot write %s" msgstr "impossível gravar %s" #: src/savegame.c:95 src/scores.c:107 #, c-format msgid "%s: truncate error" msgstr "%s: erro de truncamento" #: src/savegame.c:126 #, c-format msgid "%s:%d: parse error. Clearing saved-games table." msgstr "%s:%d: erro de leitura. Apagando tabela de jogos salvos." #: src/scores.c:150 #, c-format msgid "%s:%d: parse error. Clearing score table." msgstr "%s:%d: erro de leitura. Apagando tabela de escores." #: src/userconf.c:82 src/userconf.c:115 #, c-format msgid "%s:%d: missing variable name" msgstr "%s:%d: variável inexistente" #: src/userconf.c:107 #, c-format msgid "%s:%d: missing resource name" msgstr "%s:%d: nome de recurso inexistente" #: src/userconf.c:131 src/userconf.c:145 #, c-format msgid "%s:%d: %s: can only be used from the system configuration file" msgstr "%s:%d: %s: só pode ser usado no arquivo de configuração" #: src/userconf.c:140 src/userconf.c:154 #, c-format msgid "%s:%d: %s: unknown value: %s" msgstr "%s:%d: %s: valor desconhecido: %s" #: src/userconf.c:158 #, c-format msgid "%s:%d: unknown keyword `%s'" msgstr "%s:%d: palavra-chave desconhecida '%s'" #: src/debughash.gperf:45 msgid "all messages" msgstr "todas as mensagens" #: src/debughash.gperf:46 msgid "different parts of the game" msgstr "partes diferentes do jogo" #: src/debughash.gperf:47 msgid "system related messages" msgstr "mensagens relacionadas ao sistema" #: src/debughash.gperf:48 msgid "filename resources handling" msgstr "uso de recursos de nomes de arquivo" #: src/debughash.gperf:49 msgid "files and directories handling" msgstr "uso de arquivos e diretórios" #: src/debughash.gperf:50 msgid "levels handling" msgstr "uso de níveis" #: src/debughash.gperf:51 msgid "sound track events" msgstr "eventos de música" #: src/debughash.gperf:52 msgid "sound effects events" msgstr "eventos de efeitos sonoros" #: src/debughash.gperf:53 msgid "communication with the display driver" msgstr "comunicação com o driver de tela" #: src/debughash.gperf:54 msgid "joystick initialization and events" msgstr "inicialização e eventos de joystick" #: src/debughash.gperf:55 msgid "timer handling" msgstr "uso do timer" #: src/debughash.gperf:56 msgid "miscellaneous events" msgstr "eventos miscelâneos" #: src/debughash.gperf:57 msgid "palette fade events" msgstr "eventos de \"fade\" da palette" #: src/debughash.gperf:58 msgid "bonus" msgstr "bonus" #: src/debughash.gperf:87 #, c-format msgid "%s: no such channel, assuming you meant '%s'." msgstr "%s: canal inexistente, assumindo que você disse '%s'." #: src/debughash.gperf:90 #, c-format msgid "%s: no such channel (--list=debug will list all known channels)" msgstr "" "%s: canal inexistente (--list=debug irá mostrar todos os canais conhecidos)" #: src/media/sfx.c:94 #, c-format msgid "" "Cannot open %s, disabling sound-effects\n" "(run with -X to supress this message)." msgstr "" "Impossível abrir %s, desativando efeitos de som\n" "(rode com -X para suprimir esta mensagem)." #: src/media/sfx.c:260 #, c-format msgid "Unable to load sample %s" msgstr "Impossível abrir efeito de som %s" #: src/media/allegro/joystick.c:45 src/media/gii/joystick.c:109 #: src/media/sdl/joystick.c:50 msgid "No joystick found (run with `-J' to suppress this message)." msgstr "Joystick não encontrado (rode com `-J' para suprimir esta mensagem)." #: src/media/dummy/strack.c:75 msgid "Heroes has been compiled without sound support." msgstr "Heroes foi compilado sem suporte a som." #. FIXME: ask to send a bug report with a trace #: src/media/ggi/video.c:174 msgid "failed to get any direct buffer for this visual" msgstr "falha tentando conseguir um 'buffer direto' para este visual" #. TRANS: a `visual' is associated by LibGGI to a display. You can #. actually call it a `display', this makes no big difference. #: src/media/ggi/video.c:196 msgid "failed to open visual." msgstr "falha abrindo visual." #: src/media/ggi/video.c:204 msgid "cannot setup a correct display." msgstr "impossível ajustar uma tela correta." #: src/media/ggi/video.c:211 #, fuzzy, c-format msgid "negotiated video mode is too small (width=%d, height=%d)" msgstr "modo de vídeo negociado é muito pequeno (largura=%d, altura=%d)" #. TRANS: `display-memory' is the name of a LibGGI driver and #. make no sense to translate. #: src/media/ggi/video.c:224 msgid "Failed to open an internal `display-memory' visual." msgstr "Falha abrindo um visual interno 'display-memory'." #: src/media/ggi/video.c:226 msgid "Failed to set 320x200x8 mode on display-memory" msgstr "Falha setando o modo 320x200x8 em 'display-memory'" #: src/media/ggi/video.c:304 msgid "failed to acquire direct-buffer" msgstr "falha adquirindo 'direct-buffer'" #: src/media/ggi/video.c:321 msgid "failed to release direct-buffer" msgstr "falha liberando 'direct-buffer'" #: src/media/gii/joystick.c:96 #, c-format msgid "unexpected event %d\n" msgstr "evento inesperado %d\n" #: src/media/mikmod/strack.c:104 #, c-format msgid "" "Could not initialize sound, reason: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Impossível inicializar o som, razão: %s\n" "Desativando saída de som (use -S para suprimir esta mensagem)." #: src/media/mikmod/strack.c:114 msgid "" "Could not initialize sound, reason: LibMikMod is not thread safe.\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Impossível inicializar o som, razão: LIbMikMod não é uma tarefa segura.\n" "Desativando saída de som (use -S para suprimir esta mensagem)." #: src/media/mikmod/strack.c:149 src/media/sdl_mixer/strack.c:133 #, c-format msgid "Could not load %s, reason: %s" msgstr "Impossível carregar %s, razão: %s" #: src/media/mikmod/strack.c:214 #, c-format msgid "LibMikMod version %ld.%ld.%ld\n" msgstr "LibMikMod versão %ld.%ld.%ld\n" #: src/media/mikmod/strack.c:217 #, c-format msgid "" "\n" "Available drivers:\n" "%s\n" msgstr "" "\n" "Drivers Disponíveis:\n" "%s\n" #: src/media/mikmod/strack.c:233 #, c-format msgid "" "Argument '%s' out of bounds, must be between %d and %d.\n" "Use '%s --help' for more information." msgstr "" "Argumento '%s' fora da faixa, deve estar entre %d e %d.\n" "Use '%s --help' para mais informação." #: src/media/sdl/video.c:114 #, c-format msgid "Failed to open visual: %s" msgstr "Falha abrindo visual: %s" #: src/media/sdl_mixer/strack.c:95 #, c-format msgid "" "Couldn't open audio: %s\n" "Disabling sound output (use -S to suppress this message)." msgstr "" "Impossível abrir audio: %s\n" "Desativando saída de som (use -S para suprimir esta mensagem)." #: src/media/sdl_mixer/strack.c:171 msgid "" "Heroes has been compiled with SDL_mixer, there is no driver list available." msgstr "" "Heroes foi compilado com SDL_mixer, não há lista de drivers disponível." #: src/media/sdl_mixer/strack.c:187 #, c-format msgid "%s: missing parameter for 'freq'" msgstr "%s: parâmetro não encontrado para 'freq'" #: src/media/sdl_mixer/strack.c:193 #, c-format msgid "%s: missing parameter for `buffers'" msgstr "%s: parâmetro não encontrado para 'buffers'" #: src/media/sdl_mixer/strack.c:195 #, c-format msgid "%s: recognized sound options are freq=nnn and buffers=nnn" msgstr "%s: opções reconhecidas para som são freq=nnn e buffers=nnn" heroes-0.21/po/de.gmo0000644004117000411500000010326607451377062010135 Þ• da¬0c19•Ï/ç@X4æ,*?j}—® È#é? -M3{¯Å,× %" ,H -u £ &Ä 9ë %!8!X!>x!·!Ô!î!"":"O"0l"*"È"?ä" $# 0# Q# _# €# Ž#¯#-È#ö#$2/$Íb$;0%Šl+Œ÷/ „1 1=1Û1 í1]ø1V2_2p2ƒ2–22°2¸2È2Ð2î23N3 l3hz3`ã3{D4À4QÞ4 05<5hA5ª6°6µ6¼6Í6Ü6 ë6÷6 þ6 7 7 $717@7 [73g7›7.µ7 ä7î7õ7 ú7 8 8 8'8>/8n:u: |:9Š:KÄ:/;ƒ@;9Ä;þ;< < <Í$<ò= ú=> >>1>6> ?>J>R>q> w>I>îË>º@Ì@ Ñ@ Û@æ@;é@ %A0A8AHAXAxA~AƒA!’A´A½AÆAÏA ØA åA ðAûAB BBB %B2B 8B3DBxB€B‡BŽBB¬B°B¸B ÉBÔB ÚBèB îB ûBC CšC±DÅD ÍD×D ÝDºéD–¤E ;F&HFoFrF%‹F±FÆFßF0ÿFJ0G{G0ŒG½GÄGËGÒGÙG ÝG çGôGùGÿGHH,HLH0\H%H³HÏHëH II I3I/SIƒIšIºIÖIõIJJ"!JDJTJiJnJJ”J™J J´J½JÜJõJK,KAKTKZK`KeK}K—K¦K­KÂK7ÜKpMH…QÎS.çS=T˜TT5íT#U4U'GUoU‚UžUºU"ÕU%øUDV4cV=˜VÖVïV0W(3W,\W0‰W1ºW+ìW,X9EXX›XºX>ÙX!Y:YVYiY„Y¡Y´Y/ÏY0ÿY%0Z@VZ —Z"¢ZÅZ"×ZúZ [+[0C[t[ ‹[3¬[Ùà[Ÿº\÷ZcRh ài ëiAùi;j Sjt^jÓjÜjíjÿjkk 1k ;kEk#Mk%qk—kH¬k õkhl\kl€Èl ImSjm ¾mÊmoÑmAoPoUo\oko€o ’oŸo ¦o ²o ½o ÊoØoèo p5pFp6dp ›p ¦p²p¸p ÇpÑpØpßp%æp ss s.)sDXs1sÏs>`tŸt¨t ®t ¼t Ét Õvávðv ÷vww %w 0w;wCwbwhwVpwÇwÌyáy æyòyz5z {D{L{[{a{s{ z{7†{ ¾{ Ë{Õ{Ý{ î{û{| | |'|-|<| D| P|]| b|án|P~o~ t~~~ „~²‘~D ^€9j€¤€©€)Ä€î€ "=C^à<ñ.‚5‚>‚C‚L‚O‚a‚p‚y‚Š‚“‚"¨‚'Ë‚ó‚<ƒ'Eƒmƒ€ƒŸƒ·ƒ½ƒ σ"݃7„8„%S„y„ „°„¿„Є(Ô„ý„ …'…0…H…\… c…m…„…… ©…Ê…â…ú…†"† (†2†7†P†h†}†„†ž†Yôl'h$.Ÿ¯\ ̧ßc¥j瑌*Šÿ„ùšÜ¸+z5ÒuñBMÞÊ‹² E)û´df¶J!¨D#/|нÄÅ«…k<G†–^À,Éò¦ ·ús `¡©"4COÝÈËæ­ºè}‰oî¬ÇF[¢N(ü%äK”WeZ8õVˆTÕwbÎéÚ=êƒR»›³HÔï7i Q3Æ£ptqn˜X¾µý?0¤ª_LAžU; ×9íå°þϱØx“~Ž]ó:€&øì¿@’Í—ëá aö1Ñ®6Süã™IPrÖ‚Ávð•>âÂ2{œ÷-àmÓgÛ¹Ùy‡ %{head 2}BONUS %{img L 60 0 20 22}Affects the player that gets the item %{img L 60 22 20 22}Affects all players except the one who gets the bonus %{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1 %{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1 %{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up %{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down %{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus %{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points %{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail %{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop %{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls %{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power + %{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power - %{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level %{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability %{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom %{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life %{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions %{img C 444 0 40 320} %{center}%pUse the arrow keys to scroll up and down. %{head 1}CONTROL & BOARD %{img BC 357 55 80 205} %{textat cL -9 -81}%yPAUSE %{textat cR -9 97}%yQUIT GAME %{textat cR 26 -62}%yCONTROL %{textat cL 30 74}%ySTOP %{textat cL 52 68}%yTURBO %{img BCG 486 0 140 320} %{textat cR -7 -82}%ySCORE %{textat cR 1 8}%yCOMMENTARY %{textat cL 16 29}%yHEROES %{textat cL 33 29}%yWALLS %{textat cL 55 29}%yBONUS %{textat cL 29 -102}%yLIFES %{textat cL 51 -109}%yTURBO ENERGY %{textat cL 72 -104}%yTIME %{textat cR 96 40}%yPLAYER COLOR Available drivers: %s -h, --help display this help -i, --indent indent everything but the filename -p, --print=WHAT select information to display. WHAT should be one or more of these characters: -v, --version display version number MEN PTS LIVES%d ROUND%d ROUNDS%s NBR SRCIDX Y X DIR DESTIDX %s: empty resource%s: illegal option -- %c %s: invalid level file%s: invalid option -- %c %s: missing parameter for 'freq'%s: missing parameter for `buffers'%s: no such channel (--list=debug will list all known channels)%s: no such channel, assuming you meant '%s'.%s: no such resource, possible misspelling of '%s'.%s: no such resource.%s: null resource%s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: recognized sound options are freq=nnn and buffers=nnn%s: truncate error%s: unrecognized option `%c%s' %s: unrecognized option `--%s' %s:%d: %s: can only be used from the system configuration file%s:%d: %s: unknown value: %s%s:%d: missing alias name%s:%d: missing author%s:%d: missing file name%s:%d: missing resource name%s:%d: missing title%s:%d: missing variable name%s:%d: parse error. Clearing saved-games table.%s:%d: parse error. Clearing score table.%s:%d: unknown keyword `%s'%sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL %sTunnels: %sX-wrap: %d tiles (%d squares) %sX-wrap: no %sY-wrap: %d tiles (%d squares) %sY-wrap: no %sheight: %d tiles (%d squares) %ssound track alias: %s %sstarting squares and directions (y x dir): %stile map basename: %s %swidth: %d tiles (%d squares) %{center}You owe this game to the following people%{head 1}CONTACT %{center}home page: %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}send bug reports to: %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}GAME MODES %{>>}%yQUEST %{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers you. Your aim is to collect a given number (10) of Trail+1 bonuses and then to get the End-of-Level bonus that will send you to next level. %{>>>}%{img L 20 176 20 22}End-of-Level %{img R 0 0 20 22}%{flushright}Trail+1 %{>>>}Trail+1 has the effect of growing your trail. There are two way to get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first appears when someone's trail reach 10 units. %{>>}%yDEATH MATCH %{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a fight to death. The aim of the game is to be the last player still alive. For this, feel free to use any stratagems you want. Nothing is forbidden. %{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL %{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm all the people of your competitors. It was said "There can be only one", make sure it is yours! %{img LG 131 70 20 100} %{img LG 151 70 20 80}They are among us, find them ! %{>>}%yCOLOR %{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time to get a maximum of gems of your color. Beware, if you go over your competitor's gems, it's your competitor's gem account that you will increase. Be also sure not to get crossed gems because you'll lose collected gems. Grey ones gives gems to all players except the one that goes over it. The Clocks give you extra time. %{>>}%yTIME CA$H %{>>>}In %yTIME CA$H%w mode the winner is the player who collected the largest amount of money. %{head 4}GAME OPTIONS %{img L 293 165 20 134} %{>>}%gCOLOR SELECT %{>>>}This option allows you to choose the color of your vehicle between %pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w. %{img L 335 165 20 32} %{>>}%gGAME SPEED %{>>>}The %gGAME SPEED%w option allows you to select the initial speed of the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES. %{img L 314 264 20 32} %{>>}%gROUNDS %{>>>}The %gROUNDS%w option allows you to select the number of rounds in the tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. These values range from 1 to 100 rounds. %{img L 293 0 20 33}%{img L 293 132 20 33} %{>>}%gRADAR & INFORMATION %{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better visibility. %{img L 314 231 20 32} %{>>}%gLIGHTING %{>>>}The %gLIGHTING%w option is here to tune the luminosity of your screen. %{img L 314 0 20 32} %{>>}%gINERTIA %{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia. %{img L 293 99 20 32} %{>>}%gAUTOPILOT %{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, rest in peace... Note that %gAUTOPILOT%w does not work against fire trails. %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's environmental and ecological issues and did our best to use only recycled bytes in this program. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. -LEVEL %d--ROUND %d/%d--n is an obsolete option, you should use --list=sound-drivers@ print tunnelsAUTO PILOTArgument '%s' out of bounds, must be between %d and %d. Use '%s --help' for more information.Authors CA$H PTS LIVESCHOOSE A LOAD SLOTCHOOSE A SAVE SLOTCOLORSCOLORS PTS LIVESCONTROLCONTROL OPTIONSCREDITSCannot create directory `%s'.Cannot load level %s (error %d)Cannot open %sCannot open %s, disabling sound-effects (run with -X to supress this message).Contributors Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. Could not initialize sound, reason: %s Disabling sound output (use -S to suppress this message).Could not initialize sound, reason: LibMikMod is not thread safe. Disabling sound output (use -S to suppress this message).Could not load %s, reason: %sCouldn't open audio: %s Disabling sound output (use -S to suppress this message).DEATH MATCHDOWNDisplay options: -G, --gfx-options=OPTIONS pass OPTIONS to the display driver -F, --full-screen full screen mode -2, --double stretch the display twofold -3, --triple stretch the display threefold -4, --quadruple stretch the display fourfold -e, --even-lines display only even-lines DutchEDITEDITORENTER YOUR NAME:EVERYONE LOST!EXISTING LEVELEXTRA-LIFE!EXTRASEXTRAS LEVELSEXTRAS ONLYEXTRAS: ALLEXTRAS: NONEEXTRAS: SELECTError during level loadingFIRE TRAIL!Failed to open an internal `display-memory' visual.Failed to open visual: %sFailed to set 320x200x8 mode on display-memoryFile: %s FrenchGAMEGAME OPTIONSGET %dPTSGET TURBO+GET TURBO-GO BACKGeneral options: -v, --version display version number -h, --help display this help -q, --quiet don't print warning messages -Q, --really-quiet don't even print error messages -v, --verbose=CHANNELS enable or disable debugging channels (see --list=debug for available channels) -l, --list=WORD show some internal information; WORD can be 'debug', 'resources', 'sound-drivers' or 'sound-tracks' GermanHEROESHIGHER SCORESHOME variable not found in environment, defaulting to `.'Heroes has been compiled with SDL_mixer, there is no driver list available.Heroes has been compiled without sound support.Heroes is a game similar to the "Tron" and "Nibbles" games of yore but includes many graphical improvements and new game features. Heroeslvl is a tool used to inspect Heroes' level files. INERTIAINFOSINVERTED %dINVINCIBLE!It looks like the game is not correctly installed. Maybe the data files have not been installed with the same configure options as the executable, or maybe the data files have been moved elsewhere. In the latter case it's probably enough to set the environment variable HEROES_PREFIX to the new location. You may also want to set HEROES_DEBUG=system to see what files Heroes is looking after. If none of this helps, contact ItalianKEYBOARD DEFSKEYSKILL'EM ALLLAST LIFE%d LIVES LEFTLEFTLIGHTINGLOAD LEVELLOAD...LibMikMod version %ld.%ld.%ld MUSICMUSIC VOLMandatory arguments to long options are mandatory for short options too. Miscellaneous options: --cpu-off disable computer opponents --default-scores restore default scores file --default-options restore default options file --default-saves restore default saves file -s, --swap-sides swap sides in two player mode --no-double-fx disable combination of rotozoom and waves -g, --go skip the introduction -J, --no-joystick disable joystick handling Missing filename.NAMENEW LEVELNEXT LEVELNONo joystick found (run with `-J' to suppress this message).ONE PLAYEROPTIONSORIGINAL LEVELSORIGINAL+EXTRASOther people we wish to thanks PAUSEPLAYPLAYER %d WON!PLAYER %d, YOU CAME IN THE TOP 10PLAYER 1PLAYER 2PLAYER 3PLAYER 4PRESS RETURNPTS LIVESPackagers Porters QUESTQUITQUIT THIS GAME?RADARREALLY QUIT?RIGHTROUND %d/%dReport bugs to .SAVE...SCORESSCREENSCREEN OPTIONSSELECT A LEVELSFXSFX VOLSIZE PTS LIVESSIZE IS %dSOUNDSOUND OPTIONSSPEEDSPEEDED DOWNSPEEDED UPSTOPSTOPPED %dSound options: -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:autodetect) (see --list=sound-drivers for available Ns) -S, --no-sound disable sound -X, --no-sfx disable sound-effects -m, --mono non-stereo output -8, --8bits 8bits sound output -i, --high-quality high quality mixer T print type keysTHE ENDTIME CA$HTURBOTWO PLAYERSThese options can be set in your file ~/.heroes/heroesrc (which is read before parsing other command line options) using a line like the following: Options: -gs -d3,buffer=11,count=4 This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Translators Try '%s --help' for more information. UPUnable to load sample %sUnknown option '%c' for command '%s'.Unknown system errorUsage: %s [OPTIONS]... Usage: %s [OPTIONS]... levels Use `-lWORD' or `--list=WORD' where WORD can be:Visit http://heroes.sourceforge.net/ for news, documentation, and updates.WINS PTS LIVESWhen no options are given, the default is -ipfh.X-SIZEX-WRAPY-SIZEY-WRAPYESYOU LOST!all messagesanimbonusboomcannot load %scannot open directory %scannot setup a correct display.cannot write %scharacter '%c' is not drawable (in message '%s')communication with the display driverd print square directionsdifferent parts of the gamedisplay all debugging channelsdusterror in sfx.cfgf print filenamefailed to acquire direct-bufferfailed to get any direct buffer for this visualfailed to open visual.failed to release direct-bufferfilename resources handlingfiles and directories handlingh print headeri print tile detailsicejoystick initialization and eventslevels handlinglist all level filesloopmemory exhaustedmiscellaneous eventsnoneoutwaypalette fade eventspingpongprint the preferences settingsprint the resources listprint the sound driver listprint the sound track listsound effects eventssound track eventsspeedstillstopsystem related messagest print square type maptimer handlingtunnelunexpected event %d w print square wall mapProject-Id-Version: Heroes 0.17a POT-Creation-Date: 2002-03-30 18:44+0100 PO-Revision-Date: 2001-12-15 12:17+0100 Last-Translator: Ingo van Lil Language-Team: deutsch MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Generator: vim 5.6 %{head 2}BONUS %{img L 60 0 20 22}Wirkt auf den Spieler, der den Bonus einsammelt %{img L 60 22 20 22}Wirkt auf alle Spieler außer dem, der es sammelt %{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Länge +1 %{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Länge -1 %{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Schneller %{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Langsamer %{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Zufalls-Bonus %{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Punkte %{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Feuer-Spur %{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop %{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Invertierte Steuerung %{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Energie + %{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Energie - %{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}Level-Ende %{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Unbesiegbarkeit %{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom %{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra-Leben %{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Welleneffekt %{img C 444 0 40 320} %{center}%pBenutze die Pfeiltasten zum Weiterlesen. %{head 1}STEUERUNG UND SPIELPLAN %{img BC 357 55 80 205} %{textat cL -9 -81}%yPAUSE %{textat cR -9 97}%ySPIEL BEENDEN %{textat cR 26 -62}%ySTEUERUNG %{textat cL 30 74}%ySTOP %{textat cL 52 68}%yTURBO %{img BCG 486 0 140 320} %{textat cR -7 -82}%yPUNKTE %{textat cR 1 8}%yMELDUNGEN %{textat cL 16 29}%yHEROES %{textat cL 33 29}%yWÄNDE %{textat cL 55 29}%yBONUS %{textat cL 29 -102}%yLEBEN %{textat cL 51 -109}%yTURBO-ENERGIE %{textat cL 72 -104}%yZEIT %{textat cR 96 40}%ySPIELER-FARBEN Verfügbare Treiber: %s -h, --help dieser Hilfetext -i, --indent alles außer Dateiname einrücken -p, --print=WAS anzuzeigende Information auswählen. WAS sollte eines oder mehrere dieser Zeichen enthalten: -v, --version Versionsnummer anzeigen LEM PKT LEBEN%d RUNDE%d RUNDEN%s NR START Y X RICHTUNG ZIEL %s: Ressource leer%s: Ungültige Option: --%c %s: fehlerhafte Level-Datei%s: Ungültige Option --%c %s: fehlender Parameter für 'freq'%s: fehlender Parameter für `buffers'%s: Kein solcher Kanal (--list=debug listet alle verfügbaren Kanäle)%s: Kein solcher Kanal, ich vermute, Du meinst '%s'.%s: keine bekannte Ressource, vielleicht Tippfehler bei '%s'.%s: Ressource unbekannt.%s: Null-Ressource%s: Die Option `%c%s' darf kein Argument haben. %s: Die Option `%s' ist nicht eindeutig %s: Die Option `%s' erfordert ein Argument. %s: Die Option `--%s' darf kein Argument haben. %s: Die Option `-W %s' darf kein Argument haben. %s: Die Option `-W %s' ist nicht eindeutig %s: Die Option erfordert ein Argument: --%c %s: zulässige Klangoptionen sind freq=nnn und buffers=nnn%s: Fehler beim Abschneiden%s: Unbekannte Option: `%c%s' %s: Unbekannte Option: `--%s' %s:%d: %s: Kann nur in globaler Config-Datei verwendet werden.%s:%d: %s: unbekannter Wert: `%s'%s:%d: fehlender Alias-Name%s:%d: Autor fehlt%s:%d: fehlender Dateiname%s:%d: Ressourcen-Name fehlt%s:%d: Titel fehlt%s:%d: Variablenname fehlt%s:%d: Parser-Fehler. Lösche Savegame-Tabelle.%s:%d: Parser-Fehler. Lösche Highscore-Tabelle.%s:%d: unbekanntes Schlüsselwort `%s'%sBLOCK Y X TYP SPRITE OVERLAY ANIMATION ANZ VERZ %sTunnel: %sX-Umlauf: %d Blöcke (%d Felder) %sX-Umlauf: nein %sY-Umlauf: %d Blöcke (%d Felder) %sY-Umlauf: nein %sHöhe: %d Blöcke (%d Felder) %sHintergrundmusik: %s %sStartfelder und -richtungen (y, x, Richtung): %sFeldtypen-Datei: %s %sBreite: %d Blöcke (%d Felder) %{center}Dieses Spiel verdankst Du folgenden Leuten%{head 1}Kontaktadressen %{center}Webseite: %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}Fehlermeldungen bitte an: %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}Spiel-Modi %{>>}%yQUEST %{>>>}Der %yQUEST%w-Modus erlaubt Dir, alle 100 von HEROES angebotenen Level zu spielen. Du mußt eine bestimmte Anzahl (10) von Länge+1 Bonusobjekten und dann den Level-Ende-Bonus erreichen, der Dich zum nächsten Level bringt. %{>>>}%{img L 20 176 20 22}Level-Ende %{img R 0 0 20 22}%{flushright}Länge+1 %{>>>}Länge+1 verlängert Deine Spur. Zum Verkleinern gibt es zwei Möglichkeiten: Nimm ein "Länge-1" oder verliere ein Leben. Der Level-Ende-Bonus erscheint erst, wenn ein Spieler eine Spurlänge von zehn Einheiten erreicht. %{>>}%yDEATH MATCH %{>>>}Der %yDEATH MATCH%w-Modus erlaubt Dir, Dich anderen Spielern in einem Kampf auf Leben und Tod zu stellen. Ziel ist es, der letzte überlebende Spieler zu sein. Dabei kannst Du jede beliebige Strategie anwenden, nichts ist verboten. %{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL %{>>>}Der %yKILL THEM ALL%w-Modus hat nur eine einzige Regel: Du mußt alle Lemminge Deiner Gegner erledigen. Einst wurde gesagt: "Es kann nur einen geben". Stelle sicher, daß er Dir gehört! %{img LG 131 70 20 100} %{img LG 151 70 20 80}Sie sind unter uns, finde sie! %{>>}%yCOLOR %{>>>}Der %yCOLOR%w-Modus ist sehr einfach. Du hast eine bestimmte Zeit, um möglichst viele Perlen Deiner Farbe zu sammeln. Vorsicht: Wenn Du Perlen Deiner Gegner einsammelst, werden sie deren Konto gutgeschrieben. Sei vorsichtig, keine durchgestrichenen Perlen aufzunehmen, denn sonst verlierst Du bereits gesammelte Perlen. Graue erhöhen den Stand aller Spieler, außer desjenigen, der sie sammelt. Uhren geben Dir ein wenig mehr Zeit. %{>>}%yTIME CA$H %{>>>}Im %yTIME CA$H%w-Modus gewinnt der Spieler, der den größten Geldbetrag einsammelt. %{head 4}SPIEL-OPTIONEN %{img L 293 165 20 134} %{>>}%gFARBAUSWAHL %{>>>}Diese Option erlaubt Dir, die Farbe Deines Vehikels aus %pVIOLETT%w, %yGELB%w, %bBLAU%w und %gGRÜN%w zu wählen. %{img L 335 165 20 32} %{>>}%gSPIELGESCHWINDIGKEIT %{>>>}Die %gGESCHWINDIGKEIT%ws-Option erlaubt es, Deine Anfangs- geschwindigkeit festzulegen. Die drei verfügbaren Stufen sind für NORMALSTERBLICHE, EXPERTEN und HEROES geeignet. %{img L 314 264 20 32} %{>>}%gRUNDEN %{>>>}Die %gRUNDEN%w-Option setzt die Anzahl der Durchgänge für die Spielmodi DEATH MATCH, KILL'EM ALL, COLOR und TIME CA$H. Zulässig sind Werte zwischen 1 und 100. %{img L 293 0 20 33}%{img L 293 132 20 33} %{>>}%gRADAR & INFORMATION %{>>>}Für mehr Übersichtlichkeit können %gRADAR%w- und %gINFORMATION%ws- Fenster deaktiviert werden. %{img L 314 231 20 32} %{>>}%gHELLIGKEIT %{>>>}Mit der %gHELLIGKEIT%ws-Option kann die Leuchtstärke der Bildschirmanzeige geregelt werden. %{img L 314 0 20 32} %{>>}%gTRÄGHEIT %{>>>}Die %gTRÄGHEIT%ws-Option schaltet den Trägheitseffekt beim Rollen der Anzeige ein oder aus. %{img L 293 99 20 32} %{>>}%gAUTOPILOT %{>>>}Wenn Du verrückt bist, kannst Du versuchen, ohne %gAUTOPILOT%w zu spielen! Ruhe in Frieden... Achtung: Der Autopilot schützt nicht vor Feuer-Spuren. %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} Im Interesse unserer Umwelt sind wir stets bemüht, nur recyclete Bytes bei der Erstellung dieses Programmes zu verwenden. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux und Philippe Meisburger. -LEVEL %d--RUNDE %d/%d--n ist eine veraltete Option, benutze besser --list=sound-drivers@ Liste aller TunnelsAUTO-PILOTArgument '%s': Bereichsüberschreitung, muß zwischen %d und %d liegen. Benutze '%s --help' für weitere Informationen.Autoren GELD PKT LEBENLADE-PLATZ WÄHLENSICHERUNGS-PLATZ WÄHLENCOLORSFARBEN PKT LEBENSTEUERUNGSTEUERUNGCREDITSKann Verzeicnis `%s' nicht anlegen.Kann Level %s nicht laden (Fehler %d)Kann %s nicht öffnenKann %s nicht öffnen, Sound deaktiviert. (-X unterdrückt diese Meldung).Beitragende Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux und Philippe Meisburger. Kann Sound nicht initialisieren, Grund: %s Sound deaktiviert (-S unterdrückt diese Meldung).Kann Sound nicht initialisieren, Grund: LibMikMod ist nicht thread-sicher. Sound ist deaktiviert (-S unterdrückt diese Meldung).Konnte %s nicht laden, Grund: %sKonnte Audio nicht öffnen: %s Sound ist deaktiviert (-S unterdrückt diese Meldung).DEATH MATCHRUNTERAnzeige-Optionen: -G, --gfx-options=OPTIONEN OPTIONEN an den Bildschirmtreiber übergeben -F, --full-screen Vollbild-Modus -2, --double Anzeige doppelt strecken -3, --triple Anzeige dreifach strecken -4, --quadruple Anzeige vierfach strecken -e, --even-lines nur geradzahlige Linien anzeigen NiederländischEDITEDITORNAME EINGEBEN:ALLE HABEN VERLOREN!BESTEHENDER LEVELEXTRA-LEBEN!EXTRASEXTRA-LEVELNUR EXTRASEXTRAS: ALLEEXTRAS: KEINEEXTRAS: AUSWAHLFehler beim Laden des LevelsFEUERSPUR!Konnte keine interne `Anzeigespeicher'-Visual öffnen.Konnte Visual %s nicht öffnenKonnte Modus 320x200x8 im Anzeigespeicher nicht setzenDatei: %s FranzösischSPIELSPIEL-OPTIONEN%d PUNKTETURBO+TURBO-ZURÜCKAllgemeine Optionen: -v, --version Versionsnummer anzeigen -h, --help dieser Hilfetext -q, --quiet keine Warnungen anzeigen -Q, --really-quiet auch keine Fehlermeldungen anzeigen -v, --verbose=Kanäle de/aktiviere DEBUG-Kanäle (siehe --list=debug fuer verfügbare Kanäle) -l, --list=WORT zeige interne Informationen, für WORT kann 'debug', 'resources', 'sound-drivers' oder 'sound-tracks' eingesetzt werden. DeutschHEROESDIE CHAMPIONSVariable HOME nicht gesetzt, Standardwert `.'.Heroes wurde mit SDL_mixer compiliert, keine Treiberliste verfügbar.Heroes wurde ohne Sound-Unterstützung compiliert.Heroes ist ein Spiel, ähnlich "Tron" und "Nibbles" aus vergangenen Zeiten, enthält aber viele grafische Verbesserungen und neue Spielvarianten. Heroeslvl ist ein Tool, um Heroes-Leveldateien zu betrachten. TRÄGHEITINFOSINVERTIERT %dUNBESIEGBAR!Anscheinend wurde das Spiel nicht korrekt installiert. Eventuell wurden die Datenfiles nicht mit den selben configure-Optionen wie die Programmdateien installiert, oder sie wurden an eine andere Stelle verschoben. Im letzteren Fall ist es wahrscheinlich ausreichend, die Umgebungsvariable HEROES_PREFIX auf die neue Position zu setzen. Eine weitere Möglichkeit ist es, HEROES_DEBUG=system zu setzen, um zu sehen, an welcher StelleHeroes danach sucht. Wenn alles nicht hilft, kontaktiere ItalienischTASTENBELEGUNGTASTENKILL'EM ALLLETZTES LEBENNOCH %d LEBENLINKSHELLIGKEITLADE LEVELLADE...LibMikMod Version %ld.%ld.%ld MUSIKLAUTST.Erforderliche Argumente für lange Optionen sind auch für kurze Optionen erforderlich. Sonstige Optionen: --cpu-off Computergegner deaktivieren --default-scores Standard-Highscore-Datei wiederherstellen --default-options Standard-Options-Datei wiederherstellen --default-saves Standard-Sicherungs-Datei wiederherstellen -s, --swap-sides Seitentausch im 2-Spieler-Modus --no-double-fx Kombination von Roto-Zoom und Wellen deaktivieren -g, --go Einleitung überspringen -J, --no-joystick Joystick deaktivieren fehlender Dateiname.NAMENEUER LEVELNÄCHSTER LEVELNEINKein Joystick gefunden (-J unterdrückt diese Meldung)EIN SPIELEROPTIONENORIGINAL-LEVELORIGINAL+EXTRASWeitere Personen, denen Dank gebührt PAUSESPIELENSPIELER %d GEWINNT!SPIELER %d, DU HAST DIE TOP 10 ERREICHTSPIELER 1SPIELER 2SPIELER 3SPIELER 4DRÜCKE ENTERPKT LEBENProgrammpakete Portierungen QUESTBEENDENSPIEL BEENDEN?RADARWIRKLICH BEENDEN?RECHTSRUNDE %d/%dFehlermeldungen an .SPEICHERN...HIGHSCOREANZEIGEANZEIGE-OPTIONENLEVEL WÄHLENEFFEKTELAUTST.LÄNGE PKT LEBENLAENGE: %dSOUNDSOUND-OPTIONENGESCHW.VERLANGSAMTBESCHLEUNIGTSTOPGESTOPPT %dSound-Optionen: -d, --driver=N[,OPTIONEN] benutze Nten Treiber für Sound (0: automatische Erkennung) (s. --list=sound-drivers für mögliche N) -S, --no-sound Klänge und Musik deaktivieren -X, --no-sfx Klangeffekte deaktivieren -m, --mono keine Stereo-Ausgabe -8, --8bits 8-Bit-Klang-Ausgabe -i, --high-quality Mixen in hoher Qualität T Legende für FeldtypenkarteENDETIME CA$HTURBOZWEI SPIELERDiese Optionen können in der Datei ~/.heroes/heroesrc wie folgt gesetzt werden: Options: -gs -d3,buffer=11,count=4 (Diese Datei wird vor den Befehlszeilenoptionen ausgewertet) Dieses Programm ist freie Software, die Sie unter bestimmten Bedingungen weitergeben dürfen. Details finden Sie im Quellcode. Die Veröffentlichung erfolgt OHNE JEDE GEWÄHRLEISTUNG - sogar ohne die implizite Gewährleistung der MARKTREIFE oder der EIGNUNG FÜR EINEN BESTIMMTEN ZWECK.Übersetzer Rufe '%s --help' auf, um mehr Informationen zu bekommen. HOCHKann Sample %s nicht ladenUnbekannte Option '%c' für Kommando '%s'.Unbekannter SystemfehlerAufruf: %s [OPTIONEN]... Aufruf: %s [OPTIONEN]... Level Verwende `-lWORT' oder `--list=WORT', mit WORT ersetzt durch:Besuche http://heroes.sourceforge.net/ für Informationen, Dokumentation und Aktualisierungen.SIEGE PKT LEBENOhne Angabe von Optionen wird standardmäßig -ipfh verwendet.BREITEX-UMLAUFHÖHEY-UMLAUFJADU HAST VERLOREN!Alle MeldungenanimiertBonus-EreignisseexplosivKann %s nicht öffnenKann Verzeicnis '%s' nicht öffnen.Kann keine korrekte Anzeige einrichten.Kann %s nicht öffnenZeichen '%c' (in Meldung '%s') kann nicht dargestellt werdenKommunikation mit dem Bildschirmtreiberd Feldrichtungenverschiedene Teile des Spielesverfügbare Debug-KanäleStaubFehler in sfx.cfgf DateinameKonnte Direkt-Puffer nicht belegenKonnte keinen Direkt-Puffer fuer dieses Visual bekommenKonnte Visual nicht öffnenKonnte Direkt-Puffer nicht freigeben.Dateinamen-BehandlungDatei- und Verzeichnisbehandlungh Kopfzeileni Feld-DetailsEisJoystick-Initialisierung und -EreignisseLevelbehandlungListe aller Level-DateienSchleifeKein Speicher verfügbarsonstige EreignissenormalaußerhalbPalettenblende-EffektePingpongZeige ProgrammeinstellungenListe der verwendeten Datenfilesverfügbare SoundtreiberListe aller MusikstückeKlangeffekt-EreignisseMusik-EreignisseTempoStandbildStopSystembezogene Meldungent Karte der FeldtypenZeitgeber-BehandlungTunnelunerwartetes Ereignis %d w Karte der Wandtypenheroes-0.21/po/fr.gmo0000644004117000411500000010523707451377062010154 Þ• lg¼XcY9½÷/@?€4CT*g’¥¿Ö ð#?5-u3£×í,ÿ, %J ,p - Ë &ì 9!M!`!€!> !ß!ü!","E"b"w"0”"*Å"ð"? # L# X# y# ‡# ¨# ¶#×#-ð#$7$2W$ÍŠ$;X%Š”+Œ0 ¬1 ·1=Å12 2] 2~2‡2˜2«2¾2Å2Ø2à2ð2ø2363NE3 ”3h¢3( 4`44{•45Q/5 55h’5û677 77-7 <7H7 O7 ]7 i7 u7‚7‘7 ¬73¸7ì7.8 58?8F8 K8 X8 b8 m8x8>€8¿:Æ: Í:9Û:K;/a;ƒ‘;9<O<W< ]< i<Íu<C> K>Y> ^>j>‚>‡> >›>£>Â> È>IÒ>î? AA "A ,A7A;:A vAA‰A™A©AÉAÏAÔA!ãABBB B )B 6B ABLBUB[B`BpB vBƒB ‰B3•BÉBÑBØBßBîBýBC C C%C +C9C ?C LCWC \CšgCEE E(E .Eº:E–õE ŒF&™FÀFÃF%ÜFGG0G0PGJGÌG0ÝGHHH#H*H .H 8HEHJHPHUHdH}HH0­H%ÞHI I«YêY Z%Zm¡mg°m(niAn«n$9oc^o ÂoÐo†Ôo [qfqkqsq„q—q §q´q»qÊq Üq éq ÷q&r,r=;r"yr;œr Ørårîròr s ssss s”uu¤u@µuWöu)Nv„xvMývKwSw Yw dwCqwµy½yÌy Ôyáyüy z z z z?z GzSQzN¥zô| }} }/}@3} t}~}†}˜}/©}Ù}ß}å}.ú})~2~;~D~M~ \~ h~ t~~~„~Œ~ ~¦~·~ ¾~AË~   (2 E O[ kuy‰‘  ­ ²·¼ t•™¨ ®õ»Ç±‚ yƒ.†ƒµƒ&ºƒ1Ⴤ+„'K„3s„X§„…5…F…N…W…_…h…l…~… …š…  …ª…$Ã….è…†@.†(o†%˜†¾†Ù† ø†‡‡:4‡Go‡$·‡:܇)ˆ#Aˆeˆ"zˆˆ(£ˆ̈àˆ÷ˆþˆ‰ ‰ %‰2‰G‰P‰m‰ˆ‰¢‰µ‰Ó‰ç‰ï‰ô‰ù‰(Š?ŠZŠaŠ$zŠºÿÉùøà qrFš¯7PC®xÕm'D ¸z!„Á¥«+¾MÚNGúΗ“¢û¬ÇŸ ¡l€$B™T[°iSü) ªóЍƒXµuecKþöUO¼(·1Æ_Ü,˜žLYpd†èJ À.3EÝ£ âïÖ`aowj¤2*´ ±ÛåÌÒÊyItRQ³»òˆ-%Þ6ñô‰báÔØ‚ý˧gÓœsv>Ï¿]¶Aì÷‡ë0õ”5k¹©ÈÅ<Ä &@;¦Ã×n{ã­/Ð^²æ}ZfíV9ÍÂ…’~"ß?•#Žh|Œ8:‘‹½é=Ñ\–HîçðÙ›W4 êä %{head 2}BONUS %{img L 60 0 20 22}Affects the player that gets the item %{img L 60 22 20 22}Affects all players except the one who gets the bonus %{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1 %{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1 %{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up %{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down %{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus %{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points %{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail %{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop %{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls %{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power + %{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power - %{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level %{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability %{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom %{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life %{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions %{img C 444 0 40 320} %{center}%pUse the arrow keys to scroll up and down. %{head 1}CONTROL & BOARD %{img BC 357 55 80 205} %{textat cL -9 -81}%yPAUSE %{textat cR -9 97}%yQUIT GAME %{textat cR 26 -62}%yCONTROL %{textat cL 30 74}%ySTOP %{textat cL 52 68}%yTURBO %{img BCG 486 0 140 320} %{textat cR -7 -82}%ySCORE %{textat cR 1 8}%yCOMMENTARY %{textat cL 16 29}%yHEROES %{textat cL 33 29}%yWALLS %{textat cL 55 29}%yBONUS %{textat cL 29 -102}%yLIFES %{textat cL 51 -109}%yTURBO ENERGY %{textat cL 72 -104}%yTIME %{textat cR 96 40}%yPLAYER COLOR Available drivers: %s -h, --help display this help -i, --indent indent everything but the filename -p, --print=WHAT select information to display. WHAT should be one or more of these characters: -v, --version display version number MEN PTS LIVES%d ROUND%d ROUNDS%s NBR SRCIDX Y X DIR DESTIDX %s: empty resource%s: illegal option -- %c %s: invalid level file%s: invalid option -- %c %s: missing parameter for 'freq'%s: missing parameter for `buffers'%s: no such channel (--list=debug will list all known channels)%s: no such channel, assuming you meant '%s'.%s: no such resource, possible misspelling of '%s'.%s: no such resource.%s: null resource%s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: recognized sound options are freq=nnn and buffers=nnn%s: truncate error%s: unrecognized option `%c%s' %s: unrecognized option `--%s' %s:%d: %s: can only be used from the system configuration file%s:%d: %s: unknown value: %s%s:%d: missing alias name%s:%d: missing author%s:%d: missing file name%s:%d: missing resource name%s:%d: missing title%s:%d: missing variable name%s:%d: parse error. Clearing saved-games table.%s:%d: parse error. Clearing score table.%s:%d: unknown keyword `%s'%sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL %sTunnels: %sX-wrap: %d tiles (%d squares) %sX-wrap: no %sY-wrap: %d tiles (%d squares) %sY-wrap: no %sheight: %d tiles (%d squares) %ssound track alias: %s %sstarting squares and directions (y x dir): %stile map basename: %s %swidth: %d tiles (%d squares) %{center}You owe this game to the following people%{head 1}CONTACT %{center}home page: %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}send bug reports to: %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}GAME MODES %{>>}%yQUEST %{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers you. Your aim is to collect a given number (10) of Trail+1 bonuses and then to get the End-of-Level bonus that will send you to next level. %{>>>}%{img L 20 176 20 22}End-of-Level %{img R 0 0 20 22}%{flushright}Trail+1 %{>>>}Trail+1 has the effect of growing your trail. There are two way to get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first appears when someone's trail reach 10 units. %{>>}%yDEATH MATCH %{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a fight to death. The aim of the game is to be the last player still alive. For this, feel free to use any stratagems you want. Nothing is forbidden. %{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL %{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm all the people of your competitors. It was said "There can be only one", make sure it is yours! %{img LG 131 70 20 100} %{img LG 151 70 20 80}They are among us, find them ! %{>>}%yCOLOR %{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time to get a maximum of gems of your color. Beware, if you go over your competitor's gems, it's your competitor's gem account that you will increase. Be also sure not to get crossed gems because you'll lose collected gems. Grey ones gives gems to all players except the one that goes over it. The Clocks give you extra time. %{>>}%yTIME CA$H %{>>>}In %yTIME CA$H%w mode the winner is the player who collected the largest amount of money. %{head 4}GAME OPTIONS %{img L 293 165 20 134} %{>>}%gCOLOR SELECT %{>>>}This option allows you to choose the color of your vehicle between %pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w. %{img L 335 165 20 32} %{>>}%gGAME SPEED %{>>>}The %gGAME SPEED%w option allows you to select the initial speed of the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES. %{img L 314 264 20 32} %{>>}%gROUNDS %{>>>}The %gROUNDS%w option allows you to select the number of rounds in the tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. These values range from 1 to 100 rounds. %{img L 293 0 20 33}%{img L 293 132 20 33} %{>>}%gRADAR & INFORMATION %{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better visibility. %{img L 314 231 20 32} %{>>}%gLIGHTING %{>>>}The %gLIGHTING%w option is here to tune the luminosity of your screen. %{img L 314 0 20 32} %{>>}%gINERTIA %{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia. %{img L 293 99 20 32} %{>>}%gAUTOPILOT %{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, rest in peace... Note that %gAUTOPILOT%w does not work against fire trails. %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's environmental and ecological issues and did our best to use only recycled bytes in this program. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. -LEVEL %d--ROUND %d/%d--n is an obsolete option, you should use --list=sound-drivers@ print tunnelsAUTO PILOTArgument '%s' out of bounds, must be between %d and %d. Use '%s --help' for more information.Authors CA$H PTS LIVESCHOOSE A LOAD SLOTCHOOSE A SAVE SLOTCOLORSCOLORS PTS LIVESCONTROLCONTROL OPTIONSCREDITSCannot create directory `%s'.Cannot load level %s (error %d)Cannot open %sCannot open %s, disabling sound-effects (run with -X to supress this message).Contributors Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. Copyright (C) %d Alexandre Duret-Lutz. Could not initialize sound, reason: %s Disabling sound output (use -S to suppress this message).Could not initialize sound, reason: LibMikMod is not thread safe. Disabling sound output (use -S to suppress this message).Could not load %s, reason: %sCouldn't open audio: %s Disabling sound output (use -S to suppress this message).DEATH MATCHDOWNDisplay options: -G, --gfx-options=OPTIONS pass OPTIONS to the display driver -F, --full-screen full screen mode -2, --double stretch the display twofold -3, --triple stretch the display threefold -4, --quadruple stretch the display fourfold -e, --even-lines display only even-lines DutchEDITEDITORENTER YOUR NAME:EVERYONE LOST!EXISTING LEVELEXTRA-LIFE!EXTRASEXTRAS LEVELSEXTRAS ONLYEXTRAS: ALLEXTRAS: NONEEXTRAS: SELECTError during level loadingFIRE TRAIL!Failed to open an internal `display-memory' visual.Failed to open visual: %sFailed to set 320x200x8 mode on display-memoryFile: %s FrenchGAMEGAME OPTIONSGET %dPTSGET TURBO+GET TURBO-GO BACKGeneral options: -v, --version display version number -h, --help display this help -q, --quiet don't print warning messages -Q, --really-quiet don't even print error messages -v, --verbose=CHANNELS enable or disable debugging channels (see --list=debug for available channels) -l, --list=WORD show some internal information; WORD can be 'debug', 'resources', 'sound-drivers' or 'sound-tracks' GermanHEROESHIGHER SCORESHOME variable not found in environment, defaulting to `.'Heroes has been compiled with SDL_mixer, there is no driver list available.Heroes has been compiled without sound support.Heroes is a game similar to the "Tron" and "Nibbles" games of yore but includes many graphical improvements and new game features. Heroeslvl is a tool used to inspect Heroes' level files. INERTIAINFOSINVERTED %dINVINCIBLE!It looks like the game is not correctly installed. Maybe the data files have not been installed with the same configure options as the executable, or maybe the data files have been moved elsewhere. In the latter case it's probably enough to set the environment variable HEROES_PREFIX to the new location. You may also want to set HEROES_DEBUG=system to see what files Heroes is looking after. If none of this helps, contact ItalianKEYBOARD DEFSKEYSKILL'EM ALLLAST LIFE%d LIVES LEFTLEFTLIGHTINGLOAD LEVELLOAD...LibMikMod version %ld.%ld.%ld MUSICMUSIC VOLMandatory arguments to long options are mandatory for short options too. Miscellaneous options: --cpu-off disable computer opponents --default-scores restore default scores file --default-options restore default options file --default-saves restore default saves file -s, --swap-sides swap sides in two player mode --no-double-fx disable combination of rotozoom and waves -g, --go skip the introduction -J, --no-joystick disable joystick handling Missing filename.NAMENEW LEVELNEXT LEVELNONo joystick found (run with `-J' to suppress this message).ONE PLAYEROPTIONSORIGINAL LEVELSORIGINAL+EXTRASOther people we wish to thanks PAUSEPLAYPLAYER %d WON!PLAYER %d, YOU CAME IN THE TOP 10PLAYER 1PLAYER 2PLAYER 3PLAYER 4PRESS RETURNPTS LIVESPackagers Porters QUESTQUITQUIT THIS GAME?RADARREALLY QUIT?RIGHTROUND %d/%dReport bugs to .SAVE...SCORESSCREENSCREEN OPTIONSSELECT A LEVELSFXSFX VOLSIZE PTS LIVESSIZE IS %dSOUNDSOUND OPTIONSSPEEDSPEEDED DOWNSPEEDED UPSTOPSTOPPED %dSound options: -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:autodetect) (see --list=sound-drivers for available Ns) -S, --no-sound disable sound -X, --no-sfx disable sound-effects -m, --mono non-stereo output -8, --8bits 8bits sound output -i, --high-quality high quality mixer T print type keysTHE ENDTIME CA$HTURBOTWO PLAYERSThese options can be set in your file ~/.heroes/heroesrc (which is read before parsing other command line options) using a line like the following: Options: -gs -d3,buffer=11,count=4 This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Translators Try '%s --help' for more information. UPUnable to load sample %sUnknown option '%c' for command '%s'.Unknown system errorUsage: %s [OPTIONS]... Usage: %s [OPTIONS]... levels Use `-lWORD' or `--list=WORD' where WORD can be:Visit http://heroes.sourceforge.net/ for news, documentation, and updates.WINS PTS LIVESWhen no options are given, the default is -ipfh.X-SIZEX-WRAPY-SIZEY-WRAPYESYOU LOST!all messagesanimbonusboomcannot load %scannot open directory %scannot setup a correct display.cannot write %scharacter '%c' is not drawable (in message '%s')communication with the display driverd print square directionsdifferent parts of the gamedisplay all debugging channelsdusterror in sfx.cfgf print filenamefailed to acquire direct-bufferfailed to get any direct buffer for this visualfailed to open visual.failed to release direct-bufferfilename resources handlingfiles and directories handlingh print headeri print tile detailsicejoystick initialization and eventslevels handlinglist all level filesloopmemory exhaustedmiscellaneous eventsnoneoutwaypalette fade eventspingpongprint the preferences settingsprint the resources listprint the sound driver listprint the sound track listsound effects eventssound track eventsspeedstillstopsystem related messagest print square type maptimer handlingtunnelunexpected event %d w print square wall mapProject-Id-Version: Heroes 0.17a POT-Creation-Date: 2002-03-30 18:44+0100 PO-Revision-Date: 2001-12-14 22:01+0100 Last-Translator: Alexandre Duret-Lutz Language-Team: none MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8-bit Plural-Forms: nplurals=2; plural=n>1; %{head 2}BONUS %{img L 60 0 20 22}Concerne tous les joueurs qui prennent le bonus %{img L 60 22 20 22}Concerne tous les joueurs a l'exception de celui qui prend le bonus. %{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Traînée +1 %{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Traînée -1 %{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Accélération %{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Ralentissement %{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Bonus aléatoire %{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points %{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Traînée de feu %{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop %{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Commandes inversées %{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Puissance supplémentaire %{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Perte de puissance %{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}Fin de niveau %{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnérabilité %{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotation %{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Vie supplémentaire %{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Vision ondulée %{img C 444 0 40 320} %{center}%pUtilisez les flèches pour vous déplacer verticalement. %{head 1}CONTRÔLE & INDICATEURS %{img BC 357 55 80 205} %{textat cL -9 -81}%yPAUSE %{textat cR -9 97}%yQUITTER %{textat cR 26 -62}%yDIRECTIONS %{textat cL 30 74}%ySTOP %{textat cL 52 68}%yTURBO %{img BCG 486 0 140 320} %{textat cR -7 -82}%ySCORE %{textat cR 1 8}%yCOMMENTAIRE %{textat cL 16 29}%yHÉROS %{textat cL 33 29}%yMURS %{textat cL 55 29}%yBONUS %{textat cL 29 -102}%yVIES %{textat cL 51 -109}%yJAUGE TURBO %{textat cL 72 -104}%yTEMPS %{textat cR 96 40}%yCOULEUR DU JOUEUR Pilotes disponibles : %s -h, --help affiche cette aide -i, --indent indente tout sauf the nom de fichier -p, --print=QUOI choisit les informations a afficher. QUOI peut être un ou plusieurs des caractères suivants : -v, --version affiche le numéro de versionLEMS PTS VIES%d MANCHE%d MANCHES%s NBR SRCIDX Y X DIR DESTIDX %s: ressource vide%s: option illégale --%c %s: carte de niveau invalide%s: option invalide --%c %s: il manque un paramètre pour 'freq'%s: il manque un paramètre pour `buffers'%s : pas de tel cannal (--list=debug affichera la liste les cannaux existants)%s : pas de tel cannal, je considère que vous vouliez '%s'.%s: pas de telle ressource, vous vouliez peut-être '%s'.%s: aucune ressource de ce nom%s: ressource nulle%s: l'option `%c%s' ne requiert pas de paramètre. %s: l'option `%s' est ambiguë %s: l'option `%s' requiert un paramètre. %s: l'option `--%s' ne requiert pas de paramètre. %s: l'option `-W %s' ne requiert pas de paramètre. %s: l'option `-W %s' est ambiguë %s: l'option requiert un paramètre --%c %s: les options reconnues sont freq=nnn et buffers=nnn%s: erreur de troncation%s: option non reconnue `%c%s' %s: option non reconnue `--%s' %s:%d: %s: can only be used from the system configuration file%s:%d: %s: valeur inconnue: %s%s:%d: nom d'alias manquant%s:%d: auteur manquant%s:%d: nom de fichier manquant%s:%d: il manque le nom de la ressource%s:%d: titre manquant%s:%d: il manque le nom de la variable%s:%d: erreur de syntaxe. La table des sauvegarde a été vidée.%s:%d: erreur de syntaxe. La table des scores a été vidée.%s:%d: mot clef inconnu `%s'%sTUILE Y X TYPE IMAGE SURIMPR TYPE-ANIM IMG ATTENTE %sTunnels: %sBoucle-X: %d tuile (%d carrés) %sBoucle-X: non %sBoucle-Y: %d tuile (%d carrés) %sBoucle-Y: non %shauteur: %d tuile (%d carrés) %salias bande son: %s %scarrés et directions de départ (y x dir): %simage des tuiles: %s %slargeur: %d tuile (%d carrés) %{center}Vous devez ce jeu aux personnes suivantes%{head 1}CONTACT %{center}page web : %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}signaler tout bug a : %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}MODES DE JEU %{>>}%yQUÊTE %{>>>}Dans le mode %yQUÊTE%w vous jouerez les 100 niveaux d'HEROES. Dans chaque niveau, le but est de collecter 10 bonus "Traînée +1" puis un bonus "Fin de niveau" pour passer au niveau suivant. %{>>>}%{img L 20 176 20 22}Fin de niveau %{img R 0 0 20 22}%{flushright}Traînée+1 %{>>>}"Traînée+1" aggrandit la queue de votre véhicule. Il n'y a que deux façons de la rendre plus petite: prendre un bonus "Traînée-1" ou perdre une vie. Les bonus de type "Fin de niveau" apparaissent dès que l'un des joueurs a une traînée de dix unitées. %{>>}%yCOMBAT À MORT %{>>>}Le mode %yCOMBAT À MORT%w vous met face à face avec les autres joueurs dans une lute à mort. Le but est de survivre, bien sûr ! Le dernier joueur en vie gagne. %{img BLVr 130 9 30 57}%{>>}%yTUE LES TOUS %{>>>}Le mode %yTUE LES TOUS%w est peuplé de petits lemmings aux couleurs des joueurs. Votre objectif est d'écraser ceux des autres, et de protéger les vôtres. S'il ne peut en rester qu'un, faites en sorte que ce soit le vôtre. %{img LG 131 70 20 100} %{img LG 151 70 20 80}Ils sont parmi nous, trouvez-les ! %{>>}%yCOLEURS %{>>>}Le mode %yCOULEURS%w est très simple. De nombreux cristaux colorés sont répendus sur la surface du jeu et vous disposez d'un temps limité pour collecter le maximum de cristaux de votre couleur. Mais attention : chaque joueur a un compteur de cristaux, et prendre les cristaux des autres joueurs augmente leur compteur ! Les cristaux barés d'une croix rouge diminuent la valeur du compteur du joueur correspondant. Les cristaux gris concernent tous les joueurs a l'exception de celui qui les prend. Les petites montres vous donnent du temps supplémentaire. %{>>}%yTEMPS & ARGENT %{>>>}Le but du mode %yTEMPS & ARGENT%w est de ramasser le maximum de dollards en un temps limité. %{head 4}OPTIONS DU JEU %{img L 293 165 20 134} %{>>}%gCHOIX DE COULEUR %{>>>}Cette option permet de choisir la couleur de votre véhicule parmi %pROSE%w, %yJAUNE%w, %bBLEU%w et %gVERT%w. %{img L 335 165 20 32} %{>>}%gVITESSE DU JEU %{>>>}L'option %gVITESSE DU JEU%w vous permet de régler la vitesse initiale des véhicules. Les 3 vitesses sont: NORMAL, EXPERT, HEROES. %{img L 314 264 20 32} %{>>}%gMANCHES %{>>>}Choisissez le nombre de %gMANCHES%w des parties jouées dans l'un des modes tournois (c'est-à-dire COMBAT À MORT, TUE LE TOUS, COULEUR ou TEMPS & ARGENT). Les valeurs varient de 1 à 100 manches. %{img L 293 0 20 33}%{img L 293 132 20 33} %{>>}%gRADAR & INFORMATIONS %{>>>}Le radar et les informations supplémentaires comme les compteurs peuvent-être désactivés pour une meilleure visibilité. %{img L 314 231 20 32} %{>>}%gÉCLAIRAGE %{>>>}L'option %gÉCLAIRAGE%w permet de régler la luminosité de l'affichage. %{img L 314 0 20 32} %{>>}%gINERTIE %{>>>}L'option %gINERTIE%w active ou desactive l'inertie de la camera. %{img L 293 99 20 32} %{>>}%gAUTOPILOTE %{>>>}Les casse-cou pourront essayer de jouer sans l'option %gAUTOPILOT%w; reposez en paix... Notez que l'%gAUTOPILOTE%w ne fonctionne pas contre les trainées de feu. %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} Nous sommes conscients des problèmes écologiques de notre époque et avons pris soin de n'utiliser que des octets recyclés dans ce programme. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux et Philippe Meisburger. -NIVEAU %d--MANCHE %d/%d--n est une option obsolète, vous devriez utiliser --list=sound-drivers@ affiche les tunnelsAUTO PILOTEL'argument '%s' est en dehors des bornes, il doit être entre %d et %d. Utilisez '%s --help' pour plus d'information.Auteurs SOUS PTS VIESCHOISISSEZ UN EMPLACEMENTCHOISISSEZ UN EMPLACEMENTCOULEURSCOULEURS PTS VIESCONTRÔLECONTRÔLECRÉDITSImpossible de créer les répertoire `%s'.Impossible de charger le niveau %s (erreur %d)Impossible d'ouvrir %sImpossible d'ouvrir %s, les bruitages sont désactivés. (lancez avec -X pour supprimer ce message).Contributeurs Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux et Philippe Meisburger. Copyright (C) %d Alexamdre Duret-Lutz. Impossible d'initialiser le son, raison: %s Le son est désactivé (utilisez -S pour supprimer ce message).Impossible d'initialiser le son, raison: LibMikMod ne supporte pas les threads. Le son est désactivé (utilisez -S pour supprimer ce message).Impossible de charger %s, reason: %sImpossible d'initialiser le son : %s Le son est désactiver (utilisez -S pour supprimer ce message).COMBAT À MORTBASOptions d'affichage : -G, --gfx-options=OPTIONS passe OPTIONS au pilote d'affichage -F, --full-screen mode plein écran -2, --double aggrandit l'affichage deux fois -3, --triple aggrandit l'affichage trois fois -4, --quadruple aggrandit l'affichage quatre fois -e, --even-lines affiche seulement les lignes paires hollandaisEDITÉDITEURENTREZ VOTRE NOMTOUT LE MONDE PERDNIVEAU ÉXISTANTNOUVELLE VIEEXTRASNIVEAUX EXTRASEXTRAS UNIQUEMENTEXTRAS: TOUSEXTRAS: AUCUNEXTRAS: CHOIXErreur pendant le chargement du niveauTRAINEE DE FEUEchec lors de l'ouverture du visuel interne `display-memory'.Impossible d'ouvrir le visuel : %sImpossible d'ouvrir le visuel `display-memory' en 320x200x8Fichier: %s françaisJEUOPTIONS DE JEU%d POINTSTURBO+TURBO-RETOUROptions générales : -v, --version affiche le numéro de version -h, --help affiche cette aide -q, --quiet supprime les messages d'avertissement -Q, --really-quiet supprime aussi les messages d'erreur -v, --verbose=CANNAUX active ou désactives des cannaux de deboggage (voyez --list=debug pour la liste de ceux-ci) -l, --list=MOTS affiche certaines informations internes ; MOTS peut être : 'debug', 'resources', 'sound-drivers' ou 'sound-tracks' allemandHEROESMEILLEURS SCORESVariable d'environment `HOME' inexistante, `.' utilisé à défaut.Heroes à été compilé avec avec SDL_mixer, il n'y a pas de liste de pilotes disponibles.Heroes à été compilé sans support du son.Heroes est un jeu similaire aux jeux "Tron" and "Nibbles" d'antan mais plus est plus élaboré et ajoute plusieurs effets graphiques. Heroeslvl est un outil servant à inspecter les fichiers de niveaux d'Heroes. INERTIEINFOSINVERSE %dINVINCIBLE !On dirait que le jeu n'est pas correctement installé. Peut-être que les fichiers de données n'ont pas été installés en passant à configure les mêmes options que celles utilisées pour construire l'exécutable, ou peut-être que les données ont été déplacées ailleurs. Dans ce dernier cas il est probablement suffisant de définir la variable d'environement HEROES_PREFIX avec le nouvel emplacement. Vous voudrez peut-être aussi définir HEROES_PREFIX=system pour voir quels fichiers Heroes cherche. Si rien de tout cela ne vous aide, écrivez à . italienCONFIG CLAVIERTOUCHESTUE LES TOUSDERNIERE VIERESTE %d VIESGAUCHEÉCLAIRAGECHARGERCHARGER...LibMikMod version %ld.%ld.%ld MUSIQUEVOL. MUS.Les argument obligatoires pour les options longues le sont aussi pour les courtes. Options diverses : --cpu-off désactive les opposants gérés par l'ordinateur --default-scores restaure les scores par défaut --default-options restaure les options par défaut --default-saves restaure les sauvegardes par défaut -s, --swap-sides permute les côtés en mode deux joueurs --no-double-fx interdit la combinaison des ondes et des rotations -g, --go saute l'introduction -J, --no-joystick désactive la gestion des manettes de jeu Nom de fichier manquant.NOMNOUVEAU NIVEAUNIVEAU SUIVANTNONPas de manette trouvée (utilisez `-J' pour supprimer ce message)UN JOUEUROPTIONSNIVEAUX ORIGINAUXORIGINAUX+EXTRASAutres personnes que nous souhaitons remercier PAUSEJOUERLE JOUEUR %d GAGNE !JOUEUR %d, VOUS FIGUREZ PARMI LES 10 MEILLEURSJOUEUR 1JOUEUR 2JOUEUR 3JOUEUR 4FRAPPEZ ENTRÉEPOINTS VIESEmballeurs Porteurs QUÊTEQUITTERQUITTER LA PARTIE ?RADARQUITTER LE JEU ?DROITEMANCHE %d/%dRapporter toutes anomalies à .SAUVER...SCORESAFFICHAGEAFFICHAGECHOISSEZ UN NIVEAUBRUITAGESVOL. BRUIT.TAILLE PTS VIESTAILLE %dSONOPTIONS SONORESVITESSERALENTISSEMENTACCELERATIONSTOPARRETE %dOptions sonores : -d, --driver=N[,OPTIONS] utilise le Nième pilote sonore (0: autodétection) (voir --list=sound-drivers pour la liste des N) -S, --no-sound désactive tous sons -X, --no-sfx désactive les bruitages -m, --mono sortie non-stéréo -8, --8bits sortie sonore sur 8 bits -i, --high-quality mixeur de bonne qualité T affiche la légende des typesFINTEMPS & ARGENTTURBODEUX JOUEURSCes options peuvent être précisées dans le fichier ~/.heroes/heroesrc (qui est lu avant que les options passées en ligne de commande ne soient prises en compte) en utilisant une ligne de la forme suivante : Options: -gs -d3,buffer=11,count=4 Ce logiciel est libre ; consultez les sources pour les conditions de copie. AUCUNE garantie n'est donnée, pas même sa concernant sa COMMERCIABILITÉ ou son APTITUDE À RÉPONDRE À UN BESOIN PARTICULIER.Traducteurs Essayez '%s --help' pour plus d'informations. HAUTImpossible de charger l'échantillon %sL'option '%c' est inconnue pour la commande '%s'.Erreur système inconnueUtilisation : %s [OPTIONS]... Utilisation : %s [OPTIONS]... niveaux Utilisez `-lMOT' ou `--list=MOT' où MOT peut être :Visitez http://heroes.sourceforge.net/ pour information, documentation, et mises à jour.GAINS PTS VIESLorsqu'aucune option n'est donnée, -ipfh est utilisé.LARGEURBOUCLE-XHAUTEURBOUCLE-YOUIVOUS AVEZ PERDU !tous les messagesanimationbonusexplosionimpossible de charger %simpossible d'ouvrir le répertoire %simpossible de configurer un affichage correct.impossible d'ouvrir %sle caractère '%c' n'est pas représentable (dans le message '%s')communication avec le pilote d'affichaged affiche les directions des carrésdifférentes parties du jeuliste les cannaux de deboggagepoussièreerreur dans sfx.cfgf affiche le nom du fichierimpossible d'obtenir un accès direct au tampon d'affichageimpossible d'obtenir un accès direct au tampon d'affichage de ce visuelechec lors de l'ouverture du visuel.impossible de libérer l'accès direct au tampon d'affichagegestion des resources de noms de fichiersgestion des fichiers et répertoiresh affiche l'entêtei affiche les détails des tuilesglaceinitialization et évènements du joystickgestion des niveauxliste tous les niveauxbouclemémoire épuiséeévènements diversrieninaccessibledégradés de palettespingpongliste l'état des préférencesliste toutes les resourcesliste les pilotes sonoresliste les musiquesévènements liés aux bruitagesévènements musicauxvitessefixestopmessages relatifs au systèmet affiche la carte des type des carrésgestion des temporisateurstunnelévènements inattendu %d w affiche les murs de chaque carréheroes-0.21/po/it.gmo0000644004117000411500000006127307451377062010162 Þ•Ï” `9a›³Ä×ê 5#V?z-º3è2,Dq%,µ-â &19X’¥Ååÿ.K`0}*®Ù2õÍ(;öŒ2 ¿ Ê =Ø !]!!!ˆ!™!¬!¿!Æ!Ù!á!ñ!ù!"N&" u"hƒ"`ì"{M#É#Qç# 9$E$hJ$³%¹%¾%Å%Ö%å% ô%& & & !& -&:&I&3d&˜&.²&á&è& í& ú& ' ''>"'a)h) o)9})K·)/*ƒ3*·*¿* Å* Ñ*ÍÝ*«, ³,Á, Æ,Ò,ê,ï, ø,- -*- 0-I:-î„-s/ x/ ‚//;/ Ì/×/ß/ï/ÿ/0%0*0!90[0d0m0v0 0 Œ0 —0¢0«0±0¶0Æ0 Ì0Ù0 ß03ë01'1.151D1S1W1_1 p1{1 11 •1 ¢1­1 ²1š½1X3 `3j3 p3º|3–74 Î4Û4Þ4%÷4525JK5–5§5®5µ5¼5Ã5 Ç5 Ñ5Þ5ä5606%E6k6‡6˜6/¸6è6ÿ67;7Z7j7{77¤7¹7Ì7ä7ó7X81a9“;¬;¿;È;Ú;ö;<!2<$T<;y<3µ<7é<!=:=+L=x=)–=+À=,ì= >*:>>e>¤>$¾>$ã>??3?Q?p? ‡?B¨?;ë?%'@6M@ׄ@ý\AªZH J J< J ]J`hJÉJÑJãJôJKK !K+K=K%EKkKnK ðKfþKseLŒÙL$fMa‹MíMýMONQOZO_OfOyOŠO œO§O ­O »O ÆOÓO âO)ðO/P!JP;lP¨P±P·PÈPÑPØPßPÙèPÂRÊRÑRBãRQ&S1xSjªSTT "T /Tå;T!V *V7V=VMViV rV~V V—V·V ¾VSÉVçWY Y Y%YP(Y yY†YŽY Y'°YØYÞYäY&øY Z +Z 7Z CZ OZ [ZeZwZZ •ZŸZ¯Z µZÃZ ÊZBÖZ[([1[9[I[ [[ g[t[ ƒ[‘[˜[ §[ ±[¿[Î[ Ó[jÞ[I]N]a] g]Éu]Á?^ _ _!_-2_`_~_a•_÷_ `` `$`,` /`:`K`+Q`}`?”` Ô`õ` a'a9Fa€a(ŸaÈaãabb .b:bTb ob}b‘b¤b…‡lˆ!9–'¤X4‘»?ƒ Ÿ¡@Å7ÈNÃ-$­v¨K¶¥uge%V3W"=—`¯jL®t”Ê Ë/,•º2¦i¹ O0{ÏFÁ¸‹™MZ#Àc´£o|HŒ˜B’œ_²€³^w§r)(QÄA&1n}±<¿Sš8¼aR ¾+*Æ«xžD¬J†~Cªq·©;pz‚k]E‰Çy¢“Pf.d\:>TY5IÍ[GŽb›U sÌm½ÉÎ6 µ°Šh„ %{img C 444 0 40 320} %{center}%pUse the arrow keys to scroll up and down. %{head 1}CONTROL & BOARD %{img BC 357 55 80 205} %{textat cL -9 -81}%yPAUSE %{textat cR -9 97}%yQUIT GAME %{textat cR 26 -62}%yCONTROL %{textat cL 30 74}%ySTOP %{textat cL 52 68}%yTURBO %{img BCG 486 0 140 320} %{textat cR -7 -82}%ySCORE %{textat cR 1 8}%yCOMMENTARY %{textat cL 16 29}%yHEROES %{textat cL 33 29}%yWALLS %{textat cL 55 29}%yBONUS %{textat cL 29 -102}%yLIFES %{textat cL 51 -109}%yTURBO ENERGY %{textat cL 72 -104}%yTIME %{textat cR 96 40}%yPLAYER COLOR Available drivers: %s MEN PTS LIVES%d ROUND%d ROUNDS%s: empty resource%s: illegal option -- %c %s: invalid level file%s: invalid option -- %c %s: missing parameter for 'freq'%s: missing parameter for `buffers'%s: no such channel (--list=debug will list all known channels)%s: no such channel, assuming you meant '%s'.%s: no such resource, possible misspelling of '%s'.%s: no such resource.%s: null resource%s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: recognized sound options are freq=nnn and buffers=nnn%s: truncate error%s: unrecognized option `%c%s' %s: unrecognized option `--%s' %s:%d: missing alias name%s:%d: missing author%s:%d: missing file name%s:%d: missing resource name%s:%d: missing title%s:%d: missing variable name%s:%d: parse error. Clearing saved-games table.%s:%d: parse error. Clearing score table.%s:%d: unknown keyword `%s'%{center}You owe this game to the following people%{head 1}CONTACT %{center}home page: %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}send bug reports to: %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}GAME MODES %{>>}%yQUEST %{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers you. Your aim is to collect a given number (10) of Trail+1 bonuses and then to get the End-of-Level bonus that will send you to next level. %{>>>}%{img L 20 176 20 22}End-of-Level %{img R 0 0 20 22}%{flushright}Trail+1 %{>>>}Trail+1 has the effect of growing your trail. There are two way to get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first appears when someone's trail reach 10 units. %{>>}%yDEATH MATCH %{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a fight to death. The aim of the game is to be the last player still alive. For this, feel free to use any stratagems you want. Nothing is forbidden. %{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL %{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm all the people of your competitors. It was said "There can be only one", make sure it is yours! %{img LG 131 70 20 100} %{img LG 151 70 20 80}They are among us, find them ! %{>>}%yCOLOR %{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time to get a maximum of gems of your color. Beware, if you go over your competitor's gems, it's your competitor's gem account that you will increase. Be also sure not to get crossed gems because you'll lose collected gems. Grey ones gives gems to all players except the one that goes over it. The Clocks give you extra time. %{>>}%yTIME CA$H %{>>>}In %yTIME CA$H%w mode the winner is the player who collected the largest amount of money. %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's environmental and ecological issues and did our best to use only recycled bytes in this program. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. -LEVEL %d--ROUND %d/%d--n is an obsolete option, you should use --list=sound-driversAUTO PILOTArgument '%s' out of bounds, must be between %d and %d. Use '%s --help' for more information.Authors CA$H PTS LIVESCHOOSE A LOAD SLOTCHOOSE A SAVE SLOTCOLORSCOLORS PTS LIVESCONTROLCONTROL OPTIONSCREDITSCannot create directory `%s'.Cannot open %sCannot open %s, disabling sound-effects (run with -X to supress this message).Contributors Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. Could not initialize sound, reason: %s Disabling sound output (use -S to suppress this message).Could not initialize sound, reason: LibMikMod is not thread safe. Disabling sound output (use -S to suppress this message).Could not load %s, reason: %sCouldn't open audio: %s Disabling sound output (use -S to suppress this message).DEATH MATCHDOWNDisplay options: -G, --gfx-options=OPTIONS pass OPTIONS to the display driver -F, --full-screen full screen mode -2, --double stretch the display twofold -3, --triple stretch the display threefold -4, --quadruple stretch the display fourfold -e, --even-lines display only even-lines DutchEDITEDITORENTER YOUR NAME:EVERYONE LOST!EXISTING LEVELEXTRA-LIFE!EXTRASEXTRAS LEVELSEXTRAS ONLYEXTRAS: ALLEXTRAS: NONEEXTRAS: SELECTError during level loadingFailed to open an internal `display-memory' visual.Failed to open visual: %sFailed to set 320x200x8 mode on display-memoryFrenchGAMEGAME OPTIONSGET %dPTSGET TURBO+GET TURBO-GO BACKGeneral options: -v, --version display version number -h, --help display this help -q, --quiet don't print warning messages -Q, --really-quiet don't even print error messages -v, --verbose=CHANNELS enable or disable debugging channels (see --list=debug for available channels) -l, --list=WORD show some internal information; WORD can be 'debug', 'resources', 'sound-drivers' or 'sound-tracks' GermanHEROESHIGHER SCORESHOME variable not found in environment, defaulting to `.'Heroes has been compiled with SDL_mixer, there is no driver list available.Heroes has been compiled without sound support.Heroes is a game similar to the "Tron" and "Nibbles" games of yore but includes many graphical improvements and new game features. INERTIAINFOSINVERTED %dINVINCIBLE!It looks like the game is not correctly installed. Maybe the data files have not been installed with the same configure options as the executable, or maybe the data files have been moved elsewhere. In the latter case it's probably enough to set the environment variable HEROES_PREFIX to the new location. You may also want to set HEROES_DEBUG=system to see what files Heroes is looking after. If none of this helps, contact ItalianKEYBOARD DEFSKEYSKILL'EM ALLLAST LIFE%d LIVES LEFTLEFTLIGHTINGLOAD LEVELLOAD...LibMikMod version %ld.%ld.%ld MUSICMUSIC VOLMandatory arguments to long options are mandatory for short options too. Miscellaneous options: --cpu-off disable computer opponents --default-scores restore default scores file --default-options restore default options file --default-saves restore default saves file -s, --swap-sides swap sides in two player mode --no-double-fx disable combination of rotozoom and waves -g, --go skip the introduction -J, --no-joystick disable joystick handling NAMENEW LEVELNEXT LEVELNONo joystick found (run with `-J' to suppress this message).ONE PLAYEROPTIONSORIGINAL LEVELSORIGINAL+EXTRASOther people we wish to thanks PAUSEPLAYPLAYER %d WON!PLAYER %d, YOU CAME IN THE TOP 10PLAYER 1PLAYER 2PLAYER 3PLAYER 4PRESS RETURNPTS LIVESPackagers Porters QUESTQUITQUIT THIS GAME?RADARREALLY QUIT?RIGHTROUND %d/%dReport bugs to .SAVE...SCORESSCREENSCREEN OPTIONSSELECT A LEVELSFXSFX VOLSIZE PTS LIVESSIZE IS %dSOUNDSOUND OPTIONSSPEEDSPEEDED DOWNSPEEDED UPSTOPSTOPPED %dSound options: -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:autodetect) (see --list=sound-drivers for available Ns) -S, --no-sound disable sound -X, --no-sfx disable sound-effects -m, --mono non-stereo output -8, --8bits 8bits sound output -i, --high-quality high quality mixer THE ENDTIME CA$HTURBOTWO PLAYERSThese options can be set in your file ~/.heroes/heroesrc (which is read before parsing other command line options) using a line like the following: Options: -gs -d3,buffer=11,count=4 This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Translators UPUnable to load sample %sUnknown option '%c' for command '%s'.Unknown system errorUsage: %s [OPTIONS]... Visit http://heroes.sourceforge.net/ for news, documentation, and updates.WINS PTS LIVESX-SIZEX-WRAPY-SIZEY-WRAPYESYOU LOST!all messagesbonuscannot setup a correct display.cannot write %scharacter '%c' is not drawable (in message '%s')communication with the display driverdifferent parts of the gameerror in sfx.cfgfailed to acquire direct-bufferfailed to get any direct buffer for this visualfailed to open visual.failed to release direct-bufferfilename resources handlingfiles and directories handlinglevels handlingmemory exhaustedmiscellaneous eventspalette fade eventssound effects eventssound track eventssystem related messagestimer handlingunexpected event %d Project-Id-Version: Heroes 0.9 POT-Creation-Date: 2002-03-30 18:44+0100 PO-Revision-Date: 2001-04-27 21:15+01:00 Last-Translator: Alessandro Dotti Language-Team: none MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8-bit Plural-Forms: nplurals=2; plural=n != 1 %{img C 444 0 40 320} %{center}%pUsa le frecce per muoverti. %{head 1}CONTROLLI & INDICATORI %{img BC 357 55 80 205} %{textat cL -9 -81}%yPAUSA %{textat cR -9 97}%yESCI %{textat cR 26 -62}%yCONTROLLI %{textat cL 30 74}%ySTOP %{textat cL 52 68}%yTURBO %{img BCG 486 0 140 320} %{textat cR -7 -82}%yPUNTEGGIO %{textat cR 1 8}%yCOMMENTI %{textat cL 16 29}%yHEROES %{textat cL 33 29}%yMURI %{textat cL 55 29}%yBONUS %{textat cL 29 -102}%yVITE %{textat cL 51 -109}%yTURBO %{textat cL 72 -104}%yTEMPO %{textat cR 96 40}%yCOLORE DEL GIOCATORE Driver disponibili: %s UCCISI PNT VITE%d ROUND%s: risorsa vuota%s: opzione illegale -- %c %s: file di livello no valido%s: opzione non valida -- %c %s: parametro mancante per `freq'%s: parametro mancante per `buffers'%s: canale inesistente (--list=debug elenca tutti i canali)%s: canale inesistente, suppongo volessi dire '%s'.%s: risorsa inesistente, forse si voleva indicare '%s'.%s: risorsa inesistente.%s: risorsa nulla%s: l'opzione `%c%s' non accetta argomenti %s: l'opzione `%s' è ambigua %s: l'opzione `%s' richiede un argomento %s: l'opzione `--%s' non accetta argomenti %s: l'opzione `-W %s' non accetta argomenti %s: l'opzione `-W %s' è ambigua %s: l'opzione richiede un argomento -- %c %s: le opzioni sonore riconosciute sono freq=nnn e buffers=nnn%s: errore di troncamento%s: opzione non riconosciuta `%c%s' %s: opzione non riconosciuta `--%s' %s:%d: manca l'alias%s:%d: manca l'autore%s:%d: manca il nome del file%s:%d: nome di risorsa assente%s:%d: manca il titolo%s:%d: nome di variabile assente%s:%d: errore di analisi. Cancello l'elenco delle partite salvate.%s:%d: errore di analisi. cancello la tabella dei punteggi.%s:%d: parola chiave sconosciuta `%s'%{center}Questo gioco e' merito delle seguenti persone%{head 1}CONTATTI %{center}home page: %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}Riportate eventuali errori a: %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}MODALITA' DI GIOCO %{>>}%yRICERCA %{>>>}La modalita' %yRICERCA%w ti permette di giocare i 100 livelli che HEROES offre. Il tuo scopo e' collezzionare un dato numero (10) di bonus "Coda +1" e quindi prendere il bonus "Fine di livello" per accedere al livello successivo %{>>>}%{img L 20 176 20 22}Fine di livello %{img R 0 0 20 22}%{flushright}Coda +1 %{>>>}Coda +1 fa aumentare la tua coda. Ci sono due modi per ridurne la dimensione: prendere un Coda-1 o perdere una vita. Il bonus "Fine di livello" appare quando la coda di un giocatore raggiunge le dieci unita'. %{>>}%ySCONTRO MORTALE %{>>>}La modalita' %ySCONTRO MORTALE%w ti consente di affrontare gli altri giocatori in un combattimento all'ultimo sangue. Lo scopo del gioco e' quello di essere l'unico giocatore a rimanere in vita. Quindi, sentiti libero di usare qualsiasi stratagemma. Nulla e' proibito %{img BLVr 130 9 30 57}%{>>}%yAMMAZZALI TUTTI %{>>>}Nella modalita' %yAMMAZZALI TUTTI%w esiste un'unica regola: devi sconfiggere tutti i tuoi avversari. Si dice "Ne restera' uno solo", fai in modo di essere tu! %{img LG 131 70 20 100} %{img LG 151 70 20 80}Sono fra noi, trovali! %{>>}%yCOLORI %{>>>}La modalita' %yCOLORI%w e' molto semplice. Hai un tempo prefissato per raccogliere il maggior numero di gemme del tuo colore. Attenzione! Se raccogli una gemme del colore di un avversario, sara' il suo numero di gemme che andrai ad incrementare. Stai inoltre attento a non raccogliere gemme con una croce perche' perderai le gemme raccolte. Le gemme grigie incrementano il conto di tutti i giocatori tranne di quello che le raccoglie. Gli orologi danno tempo extra. %{>>}%yIL TEMPO E' DENARO %{>>>}Nella modalita' %yIL TEMPO E' DENARO%w il vincitore e' colui che raccoglie il maggior numero di "monete". %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} Noi ci preoccupiamo degli odierni problemi ecologici ed ambientali, e facciamo del nostro meglio per utilizzare solo byte riciclati in questo programma. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux e Philippe Meisburger. -LIVELLO %d--ROUND %d/%d--n è un'opzione obsoleta, dovresti usare --list=sound-diversAUTOPILOTAArgomento '%s' fuori scala, deve essere fra %d e %d. Usa '%s --help' per ulteriori informazioni.Autori DENARO PNT VITESLOT DA CARICARESLOT DI SALVATAGGIOCOLORICOLORI PNT VITECONTROLLIOPZIONI CONTROLLICREDITIImpossibile creare la directory `%s'.Impossibile aprire %sImpossibile aprire %s, disabilito gli effetti sonori (esegui con l'opzione -X per eliminare questo messaggio).Contributori Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux e Philippe Meisburger. Impossibile inizializzare il sonoro, ragione: %s Disabilto l'output sonoro (usa -S per eliminare questo messaggio).Impossibile inizilizzare il sonoro, ragione: LibMikMod non è tread safe. Disabilito l'uotput sonoro (usa -S per eliminare questo messaggio).Impossibile caricare %s, ragione: %sImpossibile usare l'audio: %s Disabilito l'output sonoro (usa -S per eliminare questo messaggio).SCONTRO MORTALEGIUOpzioni video: -G, --gfx-options=OPZIONI passa le OPZIONI al driver video -F, --full-screen modalità a tutto schermo -2, --double radoppia le dimensioni dello schermo -3, --triple triplica le dimensioni dello schermo -4, --quadruple quadruplica le dimensioni dello schermo -e, --even-lines mostra solo le linee pari OlandeseMOD.EDITORINSERISCI IL NOME:TUTTI SCONFITTI!LIVELLI ESISTENTIVITA EXTRAEXTRALIVELLI EXTRASOLO EXTRAEXTRA: TUTTIEXTRA: NESSUNOEXTRA: SCEGLIErrore durante il caricamento del livelloImpossibile aprire un `display-memory' interno.Impossibile aprire lo schermo: %sImpossibile impostare il modo 320x200x8 su `display-memory'FranceseGIOCOOPZIONI DI GIOCO%d PUNTITURBO+TURBO-INDIETROOpzioni generali: -v, --version mostra il numero di versione -h, --help mostra questo aiuto -q, --quiet non mostra i messaggi di avvertimento -Q, --really-quiet non mostra nemmeno i messaggi di errore -V, --verbose=CHANNELS abilita o disabilita i canali di debugging (--list=debug per i canali disponibili) -l, --list=WORD mostra alcune informazioni interne WORD può assumere i valori: 'debug', 'resources', 'sound-drivers' o 'sound-tracks' TedescoHEROESPUNTEGGI MIGLIORIVariabile d'ambiente `HOME' inesistente, `.' usata come default. Heroes è stato compilato con SDL_mixer, non c'è un elenco dei driver disponibile.Heroes è stato compilato senza il supporto audio.Heroes è un gioco simile ai vecchi "Tron" e "Nibble" ma più elaborato e con diversi miglioramenti grafici INERZIAINFOINVERTITO %dINVINCIBILESembra che il gioco no sia correttamente installato. Forse il file dati non e' stato installato con le stesse opzioni di configurazione dell'eseguibile, o forse il file dati e' stato spostato altrove. Nel secondo caso probabilmente e' sufficiente impostare la variabile di ambiente HEROES_PREFIX con la nuova posizione. Puoi inoltre impostare HEROES_DEBUG=system per vedere quali file Heroes ricerca. Se nulla di tutto cio' e' di aiuto, contattate: ItalianoCONFIG TASTITASTIAMMAZZALI TUTTIULTIMA VITA%d VITE RIMASTESINISTRALUMINOSITA'CARICA LIVELLOCARICA...LibMikMod versione %ld.%ld.%ld MUSICAVOL. AUDIOGli argomenti obbligatori per le opzioni estese lo sono anche per le opzioni brevi Opzioni varie: --cpu-off disabilita gli avversari controllati dal computer --default-scores ripristina i punteggi standard --default-options ripristina le opzioni standard --default-saves ripristina i salvataggi standard -s, --swap-sides scambia i lati in modalità due giocatori --no-double-fx disabilta la combinazione degli effetti di rotazione e ondeggiamento -g, --go salta l'introdzione -J, --no-joystick disabilita il joystick NOMENUOVO LIVELLOPROX LIVELLONOJoystick non trovato (esegui con l'opzione `-J' per eliminare questo messaggio).UN GIOCATOREOPZIONILIVELLI ORIGINALIORIGINALI+EXTRAAltre persone che vorremmo ringraziare PAUSAGIOCAVINCE IL GIOCAT. %dGIOCATORE %d, SEI ENTRATO NEI PRIMI 10GIOCATORE 1GIOCATORE 2GIOCATORE 3GIOCATORE 4PREMI INVIOPNT VITEPacchettizzatori Chi ha fatto il port RICERCAABBANDONAESCI DAL GIOCO?RADARESCI DAVVERO?DESTRAROUND %d/%dSegnalate errori e anomalie a .SALVATAGGIO...PUNTEGGISCHERMOOPZIONI SCHERMOSCEGLI UN LIVELLOEFF. SONORIVOL. EFFETTIDIM PNT VITEDIMENSIONE %dSONOROOPZIONI SONOREVELOCITA'RALLENTAMENTOACCELLERAZIONESTOPFERMATO %dOpzioni audio -d, --driver=N[,OPZIONI] usa il driver N per l'output sonoro (0:rileva automaticamente) (--list=sound-drivers per i valori di N disponibili) -S, --no-sound disabilita il sonoro -X, --no-sfx disabilita gli effetti sonori -m, --mono output non stereo -8, --8bits output sonoro a 8 bit -i, --high-quality mixer ad alta qualità FINEIL TEMPO E' DENAROTURBODUE GIOCATORIQueste opzioni possono essere impostate nel file ~/.heroes/heroesrc (che viene letto prima di esaminare le opzioni da linea di comando) utilizzando linee del tipo: Options: -gs -d3,buffer=11,count=4 Questo è software libero; consultate il codice sorgente per le modalità di copia. Non vi è ALCUNA garanzia, nemmeno per ciò che riguarda la COMMERCIABILITA', o LA RISPOSTA AD UNO SCOPO PRECISO.Traduttori SUImpossibile caricare l'esempio %sOpzione sconosciuta '%c' per il comando '%s'.Errore di sistema sconosciutoUso: %s [OPZIONI]... Visitate il sito http://heroes.sourceforge.net/ per informazioni, documentazione e aggiornamenti.VINTE PNT VITELAR. LIV.X CONT.ALT. LIV.Y CONT.SIHAI PERSO!tutti i messaggibonusimpossibile impostare uno schermo corretto.Impossibile salvare %sil carattere '%c' non può essere disegnato (nel messaggio '%s')comunicazion con il driver videodiverse fasi del giocoerrore in sfx.cfgimpossibile acquisire il buffer direttoimpossibile ottenere un buffer diretto per questo schermoimpossibile aprire lo schermo.impossibile rilasciare il buffer direttogestione dei nomi dei filegestione di file e directorygestione di file e directorymemoria esauritaeventi varidissolvenza della palettaevent degli effetti sonorieventi sonorimessaggi di sistemagestione del timerevento inaspettato %d heroes-0.21/po/nl.gmo0000644004117000411500000004670107451377062010156 Þ•«tåÌ `ayŒ¦½ ×#ø?-\3оÔ,æ%1,W-„ ²&Ó9ú4Ttޤ½Úï Í(;öŒ2 ¿ Ê=Ø ]!—ª²ÂNàh/`˜{ùuQ“ åñhö_dk|‹ 𦠭 » Ç Óàï $ ) 6 @ K V >^ " ¤"9²"Kì"/8#ƒh#ì#ô# ú# $ $ $ %$1$I$N$ W$b$j$‰$ $I™$ã$ è$ ò$ý$;% <%G%O%_%o%u%z%!‰%«%´%½%Æ% Ï% Ü%ç%ì%ü% && &3!&U&]&d&k&z&‰&&•& ¦&±& ·&Å& Ë& Ø&ã& è&šó&Ž(–(ºœ(–W)î)ñ) **J8*ƒ*”*›*¢* ¦* °*½*Ã*0ã*%+:+V+g+~+š+¹+É+Ú+ï+,,+,C,X,w-‘-£-¾-Ù-"ô-%.B=.2€.<³.ð./)/C/$c/)ˆ/,²/"ß/%08(0a00¡0¸0Ë0ä011!31ÑU1©'2¢Ñ8 t: :D:Ò:gæ:N;_;g;z;ƒ;“;]³;g<my<ç<u=e”= ú=>q>€? ‰? —?¥?¸? Ç?Ô? Û? è? ö? @ @@7@U@ Z@ f@ r@ @Œ@J•@àB çB2õBM(C3vCŽªC 9DCD HD UDcDtD|D –D¤D ªD ¶DÁDÊDèD ïDNúDIE NEZEiEGmEµE¾EÅEÖEçEíEóEF#F,F5F>F GF UFcFhFwF }F‹F ’F7žF ÖFàFçF îFüF GG'G =GKG RG`G iGvGG „GÛGkIqIÏwIœGJäJ*ëJK-KPGK˜K ©K ³K½K ÀKÌKÛK!áK2L#6L ZL{L‹L$¦L$ËLðLMM,MIMhM†M¥MU”4kL§–¡,Hy€r©&[Œ5 2K03C] |¨NnWoYp+A*I˜‡D1 u—¤)¦GŠ ‰‹8œlT†i:\q «w‘7š_'%až/"=x™“Q‚„ˆ•ZE`gS>£m6<J?R ;j$M9^¢cbª.…hPB›dŸf-~}#s{v(eƒ !Ž¥VOX’zt@F Available drivers: %s %s: empty resource%s: illegal option -- %c %s: invalid level file%s: invalid option -- %c %s: missing parameter for 'freq'%s: missing parameter for `buffers'%s: no such channel (--list=debug will list all known channels)%s: no such channel, assuming you meant '%s'.%s: no such resource, possible misspelling of '%s'.%s: no such resource.%s: null resource%s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: recognized sound options are freq=nnn and buffers=nnn%s: unrecognized option `%c%s' %s: unrecognized option `--%s' %s:%d: missing alias name%s:%d: missing author%s:%d: missing file name%s:%d: missing resource name%s:%d: missing title%s:%d: missing variable name%s:%d: unknown keyword `%s'%{head 1}CONTACT %{center}home page: %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}send bug reports to: %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}GAME MODES %{>>}%yQUEST %{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers you. Your aim is to collect a given number (10) of Trail+1 bonuses and then to get the End-of-Level bonus that will send you to next level. %{>>>}%{img L 20 176 20 22}End-of-Level %{img R 0 0 20 22}%{flushright}Trail+1 %{>>>}Trail+1 has the effect of growing your trail. There are two way to get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first appears when someone's trail reach 10 units. %{>>}%yDEATH MATCH %{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a fight to death. The aim of the game is to be the last player still alive. For this, feel free to use any stratagems you want. Nothing is forbidden. %{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL %{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm all the people of your competitors. It was said "There can be only one", make sure it is yours! %{img LG 131 70 20 100} %{img LG 151 70 20 80}They are among us, find them ! %{>>}%yCOLOR %{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time to get a maximum of gems of your color. Beware, if you go over your competitor's gems, it's your competitor's gem account that you will increase. Be also sure not to get crossed gems because you'll lose collected gems. Grey ones gives gems to all players except the one that goes over it. The Clocks give you extra time. %{>>}%yTIME CA$H %{>>>}In %yTIME CA$H%w mode the winner is the player who collected the largest amount of money. %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's environmental and ecological issues and did our best to use only recycled bytes in this program. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. -LEVEL %d--ROUND %d/%d--n is an obsolete option, you should use --list=sound-driversAUTO PILOTArgument '%s' out of bounds, must be between %d and %d. Use '%s --help' for more information.CA$H PTS LIVESCOLORSCOLORS PTS LIVESCONTROLCONTROL OPTIONSCannot create directory `%s'.Cannot open %s, disabling sound-effects (run with -X to supress this message).Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. Could not initialize sound, reason: %s Disabling sound output (use -S to suppress this message).Could not initialize sound, reason: LibMikMod is not thread safe. Disabling sound output (use -S to suppress this message).Could not load %s, reason: %sCouldn't open audio: %s Disabling sound output (use -S to suppress this message).DEATH MATCHDOWNDisplay options: -G, --gfx-options=OPTIONS pass OPTIONS to the display driver -F, --full-screen full screen mode -2, --double stretch the display twofold -3, --triple stretch the display threefold -4, --quadruple stretch the display fourfold -e, --even-lines display only even-lines EDITEDITORENTER YOUR NAME:EVERYONE LOST!EXISTING LEVELEXTRA-LIFE!EXTRASEXTRAS LEVELSEXTRAS ONLYEXTRAS: ALLEXTRAS: NONEEXTRAS: SELECTError during level loadingFailed to open visual: %sGAMEGAME OPTIONSGET %dPTSGET TURBO+GET TURBO-GO BACKGeneral options: -v, --version display version number -h, --help display this help -q, --quiet don't print warning messages -Q, --really-quiet don't even print error messages -v, --verbose=CHANNELS enable or disable debugging channels (see --list=debug for available channels) -l, --list=WORD show some internal information; WORD can be 'debug', 'resources', 'sound-drivers' or 'sound-tracks' HEROESHIGHER SCORESHOME variable not found in environment, defaulting to `.'Heroes has been compiled with SDL_mixer, there is no driver list available.Heroes has been compiled without sound support.Heroes is a game similar to the "Tron" and "Nibbles" games of yore but includes many graphical improvements and new game features. INERTIAINFOSINVERTED %dINVINCIBLE!KEYBOARD DEFSKEYSKILL'EM ALLLAST LIFE%d LIVES LEFTLEFTLIGHTINGLOAD LEVELLOAD...LibMikMod version %ld.%ld.%ld MUSICMUSIC VOLMandatory arguments to long options are mandatory for short options too. NAMENEW LEVELNEXT LEVELNONo joystick found (run with `-J' to suppress this message).ONE PLAYEROPTIONSORIGINAL LEVELSORIGINAL+EXTRASPAUSEPLAYPLAYER %d WON!PLAYER %d, YOU CAME IN THE TOP 10PLAYER 1PLAYER 2PLAYER 3PLAYER 4PRESS RETURNPTS LIVESQUITQUIT THIS GAME?RADARREALLY QUIT?RIGHTROUND %d/%dReport bugs to .SAVE...SCORESSCREENSCREEN OPTIONSSELECT A LEVELSFXSFX VOLSIZE PTS LIVESSIZE IS %dSOUNDSOUND OPTIONSSPEEDSPEEDED DOWNSPEEDED UPSTOPSTOPPED %dSound options: -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:autodetect) (see --list=sound-drivers for available Ns) -S, --no-sound disable sound -X, --no-sfx disable sound-effects -m, --mono non-stereo output -8, --8bits 8bits sound output -i, --high-quality high quality mixer THE ENDTURBOThese options can be set in your file ~/.heroes/heroesrc (which is read before parsing other command line options) using a line like the following: Options: -gs -d3,buffer=11,count=4 This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.UPUnable to load sample %sUnknown system errorUsage: %s [OPTIONS]... Visit http://heroes.sourceforge.net/ for news, documentation, and updates.WINS PTS LIVESX-SIZEY-SIZEYESYOU LOST!all messagesbonuscannot setup a correct display.character '%c' is not drawable (in message '%s')communication with the display driverdifferent parts of the gameerror in sfx.cfgfailed to open visual.filename resources handlingfiles and directories handlinglevels handlingmemory exhaustedmiscellaneous eventspalette fade eventssound effects eventssound track eventssystem related messagesunexpected event %d Project-Id-Version: Heroes 0.8c POT-Creation-Date: 2002-03-30 18:44+0100 PO-Revision-Date: 2001-02-23 22:37+01:00 Last-Translator: Jos Boersema Language-Team: none MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8-bit Beschikbare drivers: %s %s: lege hulpbron%s: ongeldige optie -- %c %s: ongeldig level bestand%s: ongeldige optie -- %c %s: missende parameter voor 'freq'%s: missende parameter voor `buffers'%s: niet zo'n kanaal (--list=debug zal alle bekende kanalen geven)%s: niet zo'n kanaal, neem aan dat u `%s' bedoeld.%s: niet zo'n hulpbron, mogelijk foute gespelling voor `%s'.%s: niet zo'n hulpbron.%s: nul hulpbron%s: optie `%c%s' staat geen argument toe %s: optie `%s' is dubbelzinnig %s: optie `%s' vereist een argument %s: optie `--%s' staat geen argument toe %s: optie `-W %s' staat geen argumenten toe %s: optie `-W %s' is dubbelzinnig %s: optie vereist een argument -- %c %s: herkende geluids opties zijn freq=nnn en buffers=nnn%s: niet herkende optie `%c%s' %s: niet herkende optie `--%s' %s:%d: alias naam mist%s:%d: auteur mist%s:%d: bestandsnaam mist%s:%d: missende hulpbron naam%s:%d: titel mist%s:%d: missende variabele naam%s:%d: onbekend sleutelwoord `%s'%{head 1}CONTACT %{center}home page: %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}stuur bug raporten naar: %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}SPEL MODUSSEN %{>>}%yTOCHT %{>>>}De %yTOCHT%w modus laat je alle 100 levels spelen die HEROES biedt. Je doel is om een gegeven aantal (10) Spoor+1 bonussen te verzamelen en dan de Einde-van-Level bonus die je naar het volgende level zal sturen. %{>>>}%{img L 20 176 20 22}Einde-van-level %{img R 0 0 20 22}%{flushright}Spoor+1 %{>>>}Spoor+1 heeft het gevolg dat je spoor groeit. Er zijn twee manieren om kleiner te worden: neem een Spoor-1 of verlies een leven. De Einde-van-Level bonus verschijnt voor het eerst als iemand's spoor 10 eenheden wordt. %{>>}%yDOODS STRIJD %{>>>}De %yDOODS STRIJD%w modus laat je tegen de andere spelers vechten tot in de dood. Het doel van het spel is om de laatste overlevende te zijn. Voel je vrij om wat dan ook te doen. Niets is verboden. %{img BLVr 130 9 30 57}%{>>}%yVERTRAPPEN DAT ONGEDIERTE %{>>>}De %yVERTRAPPEN DAT ONGEDIERTE%w modus heeft 1 regel: overspoel alle mensen van je tegenstanders. Zoals werd gezegd "Er kan maar er maar 1 bestaan", zorg ervoor dat het de jouwe zijn! %{img LG 131 70 20 100} %{img LG 151 70 20 80}Ze zijn onder ons, vind ze ! %{>>}%yKLEUR %{>>>}De %yKLEUR%w modus is heel simpel. Je hebt een bepaalde hoeveelheid tijd om maximaal veel edelstenen van je kleur te pakken. Pas op dat je niet over de edelstenen van de competitie heen gaat want dan worden zijn/haar edelstenen vermeerderd. Zorg er ook voor dat je niet over gekruiste edelstenen heen gaat want dan verlies je al verzamelde edelstenen. Grijze edelstenen geven edelstenen aan iedereen behalve degene die eroverheen gaat. De Klok geeft je extra tijd. %{>>}%yTIJD IS GELD %{>>>}In %yTIJD IS GELD%w modus de winnaar is de speler die het meeste geld pakt. %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} We dragen ook ons steentje bij aan de hedendaagse milieu problemen en hebben geprobeerd alleen gerecyclede bytes in dit programma te gebruiken. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux en Philippe Meisburger. -LEVEL %d--RONDE %d/%d--n is een verouderde optie, u moet nu --list=sound-drivers gebruikenAUTOMATISCHE PILOOTArgument `%s' buiten begrenzingen, moet binnen %d en %d zijn. Gebruik `%s --help' voor meer informatie.GELD PNT LEVENKLEURENKLEUR PNT LEVENCONTROLECONTROLE OPTIESKan directorie `%s' niet maken.Kan `%s' niet openen, zet geluids-effecten uit (draai met -X om dit bericht te onderdrukken).Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux en Philippe Meisburger. Kon geluid niet starten, reden: %s Geluid uitvoer wordt uitgezet (gebruik -S om dit bericht te onderdrukken).Kon geluid niet starten, reden: LibMikMod is niet 'thread' veilig. Geluid uitvoer wordt uitgezet (gebruik -S om dit bericht te onderdrukken).Kon `%s' niet laden, reden: %sKon audio `%s' niet openen Geluid uitvoer wordt uitgezet (gebruik -S om dit bericht te onderdrukken).DOODS STRIJDOMLAAGWeergave opties: -G, --gfx-options=OPTIES geef OPTIES aan de weergave driver -F, --full-screen volledige scherm modus -2, --double verleng de weergave twee keer -3, --triple verleng de weergave drie keer -4, --quadruple verleng de weergave vier keer -e, --even-lines toon alleen even regels BEWERKENTEXTVERWERKERGEEF UW NAAM:IEDEREEN VERLIEST!BESTAAND LEVELEXTRA-LEVEN!EXTRASEXTRA LEVELSALLEEN EXTRASEXTRAS: ALLESEXTRAS: GEENEXTRAS: KIESFout tijdens level ladenOpenen van scherm mislukt: %sSPELSPEL OPTIESKRIJG %dPTSKRIJG TURBP+KRIJG TURBO-GA TERUGAlgemene opties: -n, --version laat versienummer zien -h, --help laat deze hulp zien -q, --quiet druk geen waarschuwings-berichten af -Q, --really-quiet druk zelfs geen foutmeldingen af -v, --verbose=KANALEN zet debugging kanalen aan of uit (zie --list=debug voor beschikbare kanalen) -l, --list=WOORD toon enige interne informatie; WOORD kan zijn: 'debug', 'resources', 'sound-drivers' or 'sound-tracks' HEROESHOGERE SCORESHOME variabele niet gevonden in omgeving, neem `.'Heroes werd gecompileerd met SDL-mixer, er is geen drivers lijst beschikbaar.Heroes werd zonde geluidsondersteuning gecompileerdHeroes is een spel dat op de "Tron" en "Nibbles" spelen van yore lijkt maar het heeft vele grafische verbeteringen en nieuwe spel onderdelen. TRAAGHEIDINFOOMGEKEERD %dONSCHENDBAAR!TOETSENBORD DEF.TOETSENVERTRAPPEN DAT ONGEDIERTELAATSTE LEVENLINKSVERLICHTINGLAAD LEVELLADEN...LibMikMod versie %ld.%ld.%ld MUZIEKMUZIEK VOLVerplichte argumenten voor lange opties zijn ook verplicht voor korte opties. NAAMNIEUW LEVELVOLGENDE LEVELNEEGeen joystick gevonden (draai met `-J' om dit bericht te onderdrukken).1 SPELEROPTIESORIGINELE LEVELSORIGINEEL+EXTRASPAUZESPEELSPELER %d WINT!SPELER %d, U STAAT IN DE TOP 10SPELER 1SPELER 2SPELER 3SPELER 4DRUK OP ENTERPUNTEN LEVENSSTOPSTOP DIT SPEL?RADARECHT STOPPEN?RECHTSRONDE %d/%dRaporteer bugs aan .BEWAAR...SCORESSCHERMSCHERM OPTIESKIES EEN LEVELGELUIDSEFF.GELUIDSEFF. VOLGROOTTE PUNTEN LEVENSGROOTTE IS %dGELUIDGELUID OPTIESSNELHEIDVERLANGZAAMDVERSNELDSTOPGESTOPT %dGeluid opties: -d, --driver=N[,OPTIES] gebruik Nde driver voor geluid uitvoer (0:vind-automatisch) (zie --list=sound-drivers voor info over N) -S, --no-sound gebruik geen geluid -X, --no-sfx gebruik geen geluids-effecten -m, --mono geen stereo uitvoer -8, --8bits 8bits geluid uitvoer -i, --high-quality hoge kwaliteit mixer EINDETURBODeze opties kunnen gezet worden in uw ~/.heroes/heroesrc bestand (dat gelezen wordt voordat andere opdrachtregel opties worden verwerkt) met een regel zoals de volgende: Options: -gs -d3,buffer=11,count=4 Dit is vrije software; zie de broncode voor kopiëer voorwaarden. Er is GEEN garantie; zelfs niet voor VERKOOPBAARHEID of GESCHIKTHEID VOOR EEN BEPAALD DOEL.OMHOOGNiet in staat om voorproefje `%s' te ladenOnbekende systeem-foutGebruik: %s [OPTIES]... Bezoek http://heroes.sourceforg.net/ voor nieuws, documentatie, en bijwerkingen.WINS PNT LEVENX-GROOTTEY-GROOTTEJAU VERLIEST!alle berichtenbonuskon geen correct scherm opzetten.karakter `%c' is niet afdrukbaar (in bericht `%s')communicatie met de weergave driververschillende delen van het spelfout in sfx.cfgopenen van scherm mislukt.bestandsnaam hulpbronnen behandelingbestanden en directories behandelinglevels behandelinggeheugen uitgeputdiverse gebeurtenissenpalet-vervaag gebeurtenissengeluidseffecten gebeurtenissenmuziek-nummers gebeurtenissensysteem gerelateerde berichtenonverwachte gebeurtenis %d heroes-0.21/po/pt_BR.gmo0000644004117000411500000010252507451377062010550 Þ• da¬0c19•Ï/ç@X4æ*,Wj„› µ#Ö?ú-:3hœ²,Äñ% ,5 -b &± 9Ø !%!E!>e!¤!Á!Û!ñ! "'"<"0Y"*Š"µ"?Ñ" # # ># L# m# {#œ#-µ#ã#ü#2$ÍO$;%ŠY+Œä/ q1 |1=Š1È1 Ú1]å1C2L2]2p2ƒ2Š22¥2µ2½2Û2û2N 3 Y3hg3(Ð3`ù3{Z4Ö4Qô4 F5R5hW5À6Æ6Ë6Ò6ã6ò6 7 7 7 "7 .7 :7G7V7 q73}7±7.Ë7 ú78 8 8 8 '8 28=8>E8„:‹: ’:9 :KÚ:/&;ƒV;9Ú;<< "< .<Í:<> >> #>/>G>L> U>`>h>‡> >I—>îá>Ð@â@ ç@ ñ@ü@;ÿ@ ;AFANA^AnAŽA”A™A!¨AÊAÓAÜAåA îA ûA BBB B%B5B ;BHB NB3ZBŽB–BB¤B³BÂBÆBÎB ßBêB ðBþB C CC !Cš,CÇDÛD ãDíD óDºÿD–ºE QF&^F…FˆF%¡FÇFÜFõF0GJFG‘G0¢GÓGÚGáGèGïG óG ýG HHHH)HBHbH0rH%£HÉHåHI I%I6III/iI™I°IÐIìI JJ3J"7JZJjJJ„J•JªJ¯J¶JÊJÓJòJ K'KBKWKjKpKvK{K“K­K¼KÃKØKXòK|KMOÈQT/2TBbTŒ¥T72UjU*{U¦U¸UÐUîU(V+1VK]V5©V;ßVW4W*EWpW#ˆW*¬W+×WX$ X;EXX™X¸X7×X!Y1YOYkY"‰Y¬YÉY8åY3Z&RZ?yZ ¹Z"ÄZçZ"÷Z[!*[ L[)Z[„["›[1¾[Öð[)Ç\—ñb‰g 'i 2i<@i}i i]œiúijj #j0j6jIjRj[j dj&…j¬jZÀjkf*k(‘kfºk†!l!¨lYÊl$m4mi;m¥n«n±n¸nÈnØn ènôn ûn o o&o5oEoco1ro¤o2½o ðoýop p p#p*p1pH7p€r‡rŽr7žrGÖr'sxFsO¿stt t *tê6t!v*v2v 9vEvdvmv tv ‚vŽv¬v ³vW¾v(w?yWy \y gyuyDyy ¾yÉyÐyáy,ñyz$z*z=z ]z gz qz {z …z ‘zœz «z·z¾zÃzÔzÚzêz òz3þz 2{<{D{I{X{i{p{x{ ‰{”{ ˜{ ¦{ ±{ ½{É{ Ï{¥Ù{}’}–}§}­}ʼ}‡~ (#L!R,t¡¾Ô1ñO#€s€4†€»€Á€É€Ï€×€ Û€è€û€ #$Af1{ ­Îãý‚$‚4‚ R‚<s‚°‚Æ‚#æ‚ ƒ'ƒ=ƒ[ƒ#`ƒ „ƒ ’ƒ³ƒ¹ƒ΃âƒéƒðƒ „„2„!N„p„‹„¦„ ¸„ÄÈ„!΄ð„ ……"…8…Yôl&h#-Ÿ¯\ ̧ßc¥j瑌)™ÿ„šÜ¸*z4ÒuñALÞÊ‹²D(û´df¶QI ¨C".|нÄÅ«…k;F†–^À+Éò¦ ·ús `¡©!3BNÝÈËæ­ºè}‰oî¬ÇE[¢M'ü$ùJ”WeZ7õVˆTÕwbÎéÚ<êƒR»›³GÔï6ig P2Æ£ptqn˜X¾µý>/¤ª_K@žU: ×8íå°þϱØx“~Ž]ó9€%øì¿?’Í—ëá aö0Ñ®5 SüãäHOrÖŠÁvð•=âÂ1{œ÷,àmÓ‚Û¹Ùy‡ %{head 2}BONUS %{img L 60 0 20 22}Affects the player that gets the item %{img L 60 22 20 22}Affects all players except the one who gets the bonus %{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Trail +1 %{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Trail -1 %{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Speed Up %{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Speed Down %{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Random Bonus %{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Points %{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Fire Trail %{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Stop %{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Inverted controls %{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Power + %{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Power - %{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}End of Level %{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerability %{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom %{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Extra Life %{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Wavy visions %{img C 444 0 40 320} %{center}%pUse the arrow keys to scroll up and down. %{head 1}CONTROL & BOARD %{img BC 357 55 80 205} %{textat cL -9 -81}%yPAUSE %{textat cR -9 97}%yQUIT GAME %{textat cR 26 -62}%yCONTROL %{textat cL 30 74}%ySTOP %{textat cL 52 68}%yTURBO %{img BCG 486 0 140 320} %{textat cR -7 -82}%ySCORE %{textat cR 1 8}%yCOMMENTARY %{textat cL 16 29}%yHEROES %{textat cL 33 29}%yWALLS %{textat cL 55 29}%yBONUS %{textat cL 29 -102}%yLIFES %{textat cL 51 -109}%yTURBO ENERGY %{textat cL 72 -104}%yTIME %{textat cR 96 40}%yPLAYER COLOR Available drivers: %s -h, --help display this help -i, --indent indent everything but the filename -p, --print=WHAT select information to display. WHAT should be one or more of these characters: -v, --version display version number MEN PTS LIVES%s NBR SRCIDX Y X DIR DESTIDX %s: empty resource%s: illegal option -- %c %s: invalid level file%s: invalid option -- %c %s: missing parameter for 'freq'%s: missing parameter for `buffers'%s: no such channel (--list=debug will list all known channels)%s: no such channel, assuming you meant '%s'.%s: no such resource, possible misspelling of '%s'.%s: no such resource.%s: null resource%s: option `%c%s' doesn't allow an argument %s: option `%s' is ambiguous %s: option `%s' requires an argument %s: option `--%s' doesn't allow an argument %s: option `-W %s' doesn't allow an argument %s: option `-W %s' is ambiguous %s: option requires an argument -- %c %s: recognized sound options are freq=nnn and buffers=nnn%s: truncate error%s: unrecognized option `%c%s' %s: unrecognized option `--%s' %s:%d: %s: can only be used from the system configuration file%s:%d: %s: unknown value: %s%s:%d: missing alias name%s:%d: missing author%s:%d: missing file name%s:%d: missing resource name%s:%d: missing title%s:%d: missing variable name%s:%d: parse error. Clearing saved-games table.%s:%d: parse error. Clearing score table.%s:%d: unknown keyword `%s'%sTILE Y X TYPE SPRITE OVERLAY ANIM-TYPE FRM DEL %sTunnels: %sX-wrap: %d tiles (%d squares) %sX-wrap: no %sY-wrap: %d tiles (%d squares) %sY-wrap: no %sheight: %d tiles (%d squares) %ssound track alias: %s %sstarting squares and directions (y x dir): %stile map basename: %s %swidth: %d tiles (%d squares) %{center}You owe this game to the following people%{head 1}CONTACT %{center}home page: %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}send bug reports to: %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}GAME MODES %{>>}%yQUEST %{>>>}The %yQUEST%w mode allows you to play all 100 levels HEROES offers you. Your aim is to collect a given number (10) of Trail+1 bonuses and then to get the End-of-Level bonus that will send you to next level. %{>>>}%{img L 20 176 20 22}End-of-Level %{img R 0 0 20 22}%{flushright}Trail+1 %{>>>}Trail+1 has the effect of growing your trail. There are two way to get it smaller: take a Trail-1 or lose a life. The End-of-Level bonus first appears when someone's trail reach 10 units. %{>>}%yDEATH MATCH %{>>>}The %yDEATH MATCH%w mode allows you to face the other players in a fight to death. The aim of the game is to be the last player still alive. For this, feel free to use any stratagems you want. Nothing is forbidden. %{img BLVr 130 9 30 57}%{>>}%yKILL THEM ALL %{>>>}The %yKILL THEM ALL%w mode has only one rule: You have to overwhelm all the people of your competitors. It was said "There can be only one", make sure it is yours! %{img LG 131 70 20 100} %{img LG 151 70 20 80}They are among us, find them ! %{>>}%yCOLOR %{>>>}The %yCOLOR%w mode is very simple. You have a certain amount of time to get a maximum of gems of your color. Beware, if you go over your competitor's gems, it's your competitor's gem account that you will increase. Be also sure not to get crossed gems because you'll lose collected gems. Grey ones gives gems to all players except the one that goes over it. The Clocks give you extra time. %{>>}%yTIME CA$H %{>>>}In %yTIME CA$H%w mode the winner is the player who collected the largest amount of money. %{head 4}GAME OPTIONS %{img L 293 165 20 134} %{>>}%gCOLOR SELECT %{>>>}This option allows you to choose the color of your vehicle between %pPINK%w, %yYELLOW%w, %bBLUE%w and %gGREEN%w. %{img L 335 165 20 32} %{>>}%gGAME SPEED %{>>>}The %gGAME SPEED%w option allows you to select the initial speed of the shuttles. The 3 available speeds are: NORMAL, EXPERT, HEROES. %{img L 314 264 20 32} %{>>}%gROUNDS %{>>>}The %gROUNDS%w option allows you to select the number of rounds in the tournament modes: DEATH MATCH, KILL'EM ALL, COLOR and TIME CA$H. These values range from 1 to 100 rounds. %{img L 293 0 20 33}%{img L 293 132 20 33} %{>>}%gRADAR & INFORMATION %{>>>}You can disable the %gRADAR%w and the %gINFORMATIONS%w for better visibility. %{img L 314 231 20 32} %{>>}%gLIGHTING %{>>>}The %gLIGHTING%w option is here to tune the luminosity of your screen. %{img L 314 0 20 32} %{>>}%gINERTIA %{>>>}The %gINERTIA%w switch enables or disables the scrolling inertia. %{img L 293 99 20 32} %{>>}%gAUTOPILOT %{>>>}If you are mad, you can try to play without %gAUTOPILOT%w, rest in peace... Note that %gAUTOPILOT%w does not work against fire trails. %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} We take care of today's environmental and ecological issues and did our best to use only recycled bytes in this program. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. -LEVEL %d--ROUND %d/%d--n is an obsolete option, you should use --list=sound-drivers@ print tunnelsAUTO PILOTArgument '%s' out of bounds, must be between %d and %d. Use '%s --help' for more information.Authors CA$H PTS LIVESCHOOSE A LOAD SLOTCHOOSE A SAVE SLOTCOLORSCOLORS PTS LIVESCONTROLCONTROL OPTIONSCREDITSCannot create directory `%s'.Cannot load level %s (error %d)Cannot open %sCannot open %s, disabling sound-effects (run with -X to supress this message).Contributors Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. Copyright (C) %d Alexandre Duret-Lutz. Could not initialize sound, reason: %s Disabling sound output (use -S to suppress this message).Could not initialize sound, reason: LibMikMod is not thread safe. Disabling sound output (use -S to suppress this message).Could not load %s, reason: %sCouldn't open audio: %s Disabling sound output (use -S to suppress this message).DEATH MATCHDOWNDisplay options: -G, --gfx-options=OPTIONS pass OPTIONS to the display driver -F, --full-screen full screen mode -2, --double stretch the display twofold -3, --triple stretch the display threefold -4, --quadruple stretch the display fourfold -e, --even-lines display only even-lines DutchEDITEDITORENTER YOUR NAME:EVERYONE LOST!EXISTING LEVELEXTRA-LIFE!EXTRASEXTRAS LEVELSEXTRAS ONLYEXTRAS: ALLEXTRAS: NONEEXTRAS: SELECTError during level loadingFIRE TRAIL!Failed to open an internal `display-memory' visual.Failed to open visual: %sFailed to set 320x200x8 mode on display-memoryFile: %s FrenchGAMEGAME OPTIONSGET %dPTSGET TURBO+GET TURBO-GO BACKGeneral options: -v, --version display version number -h, --help display this help -q, --quiet don't print warning messages -Q, --really-quiet don't even print error messages -v, --verbose=CHANNELS enable or disable debugging channels (see --list=debug for available channels) -l, --list=WORD show some internal information; WORD can be 'debug', 'resources', 'sound-drivers' or 'sound-tracks' GermanHEROESHIGHER SCORESHOME variable not found in environment, defaulting to `.'Heroes has been compiled with SDL_mixer, there is no driver list available.Heroes has been compiled without sound support.Heroes is a game similar to the "Tron" and "Nibbles" games of yore but includes many graphical improvements and new game features. Heroeslvl is a tool used to inspect Heroes' level files. INERTIAINFOSINVERTED %dINVINCIBLE!It looks like the game is not correctly installed. Maybe the data files have not been installed with the same configure options as the executable, or maybe the data files have been moved elsewhere. In the latter case it's probably enough to set the environment variable HEROES_PREFIX to the new location. You may also want to set HEROES_DEBUG=system to see what files Heroes is looking after. If none of this helps, contact ItalianKEYBOARD DEFSKEYSKILL'EM ALLLAST LIFE%d LIVES LEFTLEFTLIGHTINGLOAD LEVELLOAD...LibMikMod version %ld.%ld.%ld MUSICMUSIC VOLMandatory arguments to long options are mandatory for short options too. Miscellaneous options: --cpu-off disable computer opponents --default-scores restore default scores file --default-options restore default options file --default-saves restore default saves file -s, --swap-sides swap sides in two player mode --no-double-fx disable combination of rotozoom and waves -g, --go skip the introduction -J, --no-joystick disable joystick handling Missing filename.NAMENEW LEVELNEXT LEVELNONo joystick found (run with `-J' to suppress this message).ONE PLAYEROPTIONSORIGINAL LEVELSORIGINAL+EXTRASOther people we wish to thanks PAUSEPLAYPLAYER %d WON!PLAYER %d, YOU CAME IN THE TOP 10PLAYER 1PLAYER 2PLAYER 3PLAYER 4PRESS RETURNPTS LIVESPackagers Porters QUESTQUITQUIT THIS GAME?RADARREALLY QUIT?RIGHTROUND %d/%dReport bugs to .SAVE...SCORESSCREENSCREEN OPTIONSSELECT A LEVELSFXSFX VOLSIZE PTS LIVESSIZE IS %dSOUNDSOUND OPTIONSSPEEDSPEEDED DOWNSPEEDED UPSTOPSTOPPED %dSound options: -d, --driver=N[,OPTIONS] use Nth driver for sound output (0:autodetect) (see --list=sound-drivers for available Ns) -S, --no-sound disable sound -X, --no-sfx disable sound-effects -m, --mono non-stereo output -8, --8bits 8bits sound output -i, --high-quality high quality mixer T print type keysTHE ENDTIME CA$HTURBOTWO PLAYERSThese options can be set in your file ~/.heroes/heroesrc (which is read before parsing other command line options) using a line like the following: Options: -gs -d3,buffer=11,count=4 This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Translators Try '%s --help' for more information. UPUnable to load sample %sUnknown option '%c' for command '%s'.Unknown system errorUsage: %s [OPTIONS]... Usage: %s [OPTIONS]... levels Use `-lWORD' or `--list=WORD' where WORD can be:Visit http://heroes.sourceforge.net/ for news, documentation, and updates.WINS PTS LIVESWhen no options are given, the default is -ipfh.X-SIZEX-WRAPY-SIZEY-WRAPYESYOU LOST!all messagesanimbonusboomcannot load %scannot open directory %scannot setup a correct display.cannot write %scharacter '%c' is not drawable (in message '%s')communication with the display driverd print square directionsdifferent parts of the gamedisplay all debugging channelsdusterror in sfx.cfgf print filenamefailed to acquire direct-bufferfailed to get any direct buffer for this visualfailed to open visual.failed to release direct-bufferfilename resources handlingfiles and directories handlingh print headeri print tile detailsicejoystick initialization and eventslevels handlinglist all level filesloopmemory exhaustedmiscellaneous eventsnoneoutwaypalette fade eventspingpongprint the preferences settingsprint the resources listprint the sound driver listprint the sound track listsound effects eventssound track eventsspeedstillstopsystem related messagest print square type maptimer handlingtunnelunexpected event %d w print square wall mapProject-Id-Version: Heroes 0.18 POT-Creation-Date: 2002-03-30 18:44+0100 PO-Revision-Date: 2001-12-27 20:30+0100 Last-Translator: Luzemario Dantas Rocha Language-Team: none MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=n>1; %{head 2}BONUS %{img L 60 0 20 22}Afeta o jogador que pega o item %{img L 60 22 20 22}Afeta todos os jogadores exceto quem pega o item %{img L 0 0 20 22}%{>}%{img L 0 22 20 22}%{>>>}Cauda +1 %{img L 0 44 20 22}%{>}%{img L 0 66 20 22}%{>>>}Cauda -1 %{img L 0 88 20 22}%{>}%{img L 0 110 20 22}%{>>>}Aumenta a velocidade %{img L 0 132 20 22}%{>}%{img L 0 154 20 22}%{>>>}Baixa a velocidade %{img L 0 176 20 22}%{>}%{img L 0 198 20 22}%{>>>}Bonus aleatório %{img L 0 220 20 22}%{>}%{img L 0 242 20 22}%{>>>}Pontos %{img L 0 264 20 22}%{>}%{img L 0 286 20 22}%{>>>}Cauda de fogo %{img L 20 0 20 22}%{>}%{img L 20 22 20 22}%{>>>}Parar %{img L 20 44 20 22}%{>}%{img L 20 66 20 22}%{>>>}Controles invertidos %{img L 20 88 20 22}%{>}%{img L 20 110 20 22}%{>>>}Turbo + %{img L 20 132 20 22}%{>}%{img L 20 154 20 22}%{>>>}Turbo - %{img L 20 176 20 22}%{>}%{img L 20 198 20 22}%{>>>}Fim do Nível %{img L 20 220 20 22}%{>}%{img L 20 242 20 22}%{>>>}Invulnerabilidade %{img L 20 264 20 22}%{>}%{img L 20 286 20 22}%{>>>}Rotozoom %{img L 40 0 20 22}%{>}%{img L 40 22 20 22}%{>>>}Vida extra %{img L 40 44 20 22}%{>}%{img L 40 66 20 22}%{>>>}Visões onduladas %{img C 444 0 40 320} %{center}%pUse as teclas de seta para ver acima e abaixo. %{head 1}CONTROLE & TECLAS %{img BC 357 55 80 205} %{textat cL -9 -81}%yPAUSA %{textat cR -9 97}%ySAI DO JOGO %{textat cR 26 -62}%yCONTROLE %{textat cL 30 74}%yPARAR %{textat cL 52 68}%yTURBO %{img BCG 486 0 140 320} %{textat cR -7 -82}%yESCORE %{textat cR 1 8}%yCOMENTÁRIOS %{textat cL 16 29}%yHEROES %{textat cL 33 29}%yPAREDES %{textat cL 55 29}%yBONUS %{textat cL 29 -102}%yVIDAS %{textat cL 51 -109}%yENERGIA DO TURBO %{textat cL 72 -104}%yTEMPO %{textat cR 96 40}%yCOR DO JOGADOR Drivers Disponíveis: %s -h, --help mostra esta ajuda -i, --indent indenta tudo menos o nome do arquivo -p, --print=NOME seleciona informação para mostrar. NOME deve ser um ou mais destes caracteres: -v, --version mostra o número da versão NUM PTS VIDAS%s NUM ORIGEM Y X DIR DESTINO %s: recurso vazio%s: opção ilegal -- %c %s: arquivo de nível inválido%s: opção inválida -- %c %s: parâmetro não encontrado para 'freq'%s: parâmetro não encontrado para 'buffers'%s: canal inexistente (--list=debug irá mostrar todos os canais conhecidos)%s: canal inexistente, assumindo que você disse '%s'.%s: recurso inexistente, possível digitação errada de '%s'.%s: recurso inexistente.%s: recurso nulo%s: opção `%c%s' não permite um argumento %s: opção %s é ambígua %s: opção `%s' requer um argumento %s: opção `--%s' não permite um argumento %s: opção `-W %s' não permite um argumento %s: opção `-W %s' é ambígua %s: opção requer um argumento -- %c %s: opções reconhecidas para som são freq=nnn e buffers=nnn%s: erro de truncamento%s: opção desconhecida `%c%s' %s: opção desconhecida `--%s' %s:%d: %s: só pode ser usado no arquivo de configuração%s:%d: %s: valor desconhecido: %s%s:%d: apelido não encontrado%s:%d: autor não encontrado%s:%d: arquivo não encontrado%s:%d: nome de recurso inexistente%s:%d: título não encontrado%s:%d: variável inexistente%s:%d: erro de leitura. Apagando tabela de jogos salvos.%s:%d: erro de leitura. Apagando tabela de escores.%s:%d: palavra-chave desconhecida '%s'%sBLOC Y X TIPO SPRITE OVERLAY TIPO-ANIM FRM ESP %sTúneis: %scruza-X: %d blocos (%d quadros) %scruza-X: não %scruza-Y: %d blocos (%d quadros) %scruza-Y: não %saltura: %d blocos (%d quadros) %smúsica: %s %squadros iniciais e direções (y x dir): %sbloco mapa nome: %s %slargura: %d blocos (%d quadros) %{center}Você deve este jogo as seguintes pessoas%{head 1}CONTATO %{center}home page: %{img BCVr 183 124 30 41} %{center}http://heroes.sourceforge.net/ %{center}mande relatório de bugs para: %{img BCVr 183 124 30 41} %{center}heroes-bugs@lists.sourceforge.net %{head 3}MODOS DE JOGO %{>>}%yCAÇADA %{>>>}O modo %yCAÇADA%w permite jogar todos os 94 níveis que HEROES oferece. Seu objetivo é pegar um número dado de bonus Cauda+1 (10) e então pegar o bonus Fim de nível que enviará você ao próximo nível. %{>>>}%{img L 20 176 20 22}Fim de nível %{img R 0 0 20 22}%{flushright}Cauda+1 %{>>>}Cauda+1 aumenta sua cauda. Existem duas maneiras de fazer ela diminuir: pegue um Cauda-1 ou perdendo uma vida. O bonus Fim do nível aparece apenas quando a cauda de alguém atinge 10 unidades. %{>>}%yENCONTRO MORTAL %{>>>}O modo %yENCONTRO MORTAL%w permite encarar outros jogadores em uma luta mortal. O objetivo do jogo é ser o último jogador vivo. Para isso, sinta-se livre para usar qualquer estratégia que você precisar. Nada é proibido. %{img BLVr 130 9 30 57}%{>>}%yMATAR TODOS %{>>>}O modo %yMATAR TODOS%w tem apenas uma regra: Voce tem que atropelar o povo dos seus competidores. Foi dito "Só pode haver um", tenha certeza que é você ! %{img LG 131 70 20 100} %{img LG 151 70 20 80}Eles estao contra nós, ache-os ! %{>>}%yCORES %{>>>}O modo %yCORES%w é muito simples. Você tem uma certa quantidade de tempo para pegar o máximo de pedras da sua cor. Cuidado, se você passar pelas pedras dos seus competidores, é a conta deles que aumenta. Também tenha certeza de não pegar pedras com X porque você perde pedras coletadas. As pedras cinzas vão para todos exceto quem pegou elas. Os relógios dão a você tempo extra. %{>>}%yTEMPO É DINHEIRO %{>>>}No modo %yTEMPO É DINHEIRO%w o vencedor é o jogador que pegar mais dinheiro. %{head 4}OPÇÕES DE JOGO %{img L 293 165 20 134} %{>>}%gESCOLHA DE COR %{>>>}Esta opção permite mudar a cor do seu veiculo entre %pROSA%w, %yAMARELO%w, %bAZUL%w and %gVERDE%w. %{img L 335 165 20 32} %{>>}%gVELOCIDADE DE JOGO %{>>>}A opção %gVELOCIDADE DE JOGO%w permite selecionar a velocidade inicial dos veículos. As 3 velocidades disponíveis são: NORMAL, EXPERT, HEROES. %{img L 314 264 20 32} %{>>}%gROUNDS %{>>>}A opção %gROUNDS%w permite selecionar o número de rounds nos modos de torneio: ENCONTRO MORTAL, MATAR TODOS, CORES e TEMPO É DINHEIRO. Estes valores estão entre 1 e 100 rounds. %{img L 293 0 20 33}%{img L 293 132 20 33} %{>>}%gRADAR & INFORMAÇÃO %{>>>}Voce pode desativar o %gRADAR%w e as %gINFORMAÇÕES%w para melhor visibilidade. %{img L 314 231 20 32} %{>>}%gBRILHO %{>>>}A opcao %gBRILHO%w está aqui para ajustar a luminosidade da sua tela. %{img L 314 0 20 32} %{>>}%gINÉRCIA %{>>>}A chave %gINÉRCIA%w ativa ou desativa a inércia de deslocamento da tela. %{img L 293 99 20 32} %{>>}%gAUTOPILOTO %{>>>}Se você for doido, pode tentar jogar sem %gAUTOPILOTO%w, descanse em paz... Note que %gAUTOPILOTO%w não funciona contra caudas de fogo. %{img C 175 0 10 119} %{img L 96 200 40 50}%{img R 96 200 40 50} Tivemos o cuidado com as preocupações ambientais e ecológicas de hoje e fizemos o melhor para usar somente bytes reciclados neste programa. %{img C 175 0 10 119} %{img CG 145 150 40 120} %{img C 220 3 60 130} %{center}Copyright 1997, 1998, 2000 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux e Philippe Meisburger. -NÍVEL %d--ROUND %d/%d--n é uma opção obsoleta, você deve usar --list=sound-drivers@ imprime túneisAUTO PILOTOArgumento '%s' fora da faixa, deve estar entre %d e %d. Use '%s --help' para mais informação.Autores DINH PTS VIDASCARREGAR QUAL?SALVAR ONDE?CORESCORES PTS VIDASCONTROLECONTROLECRÉDITOSImpossível criar diretório `%s'.Impossível carregar nível %s (erro %d)Impossível abrir %sImpossível abrir %s, desativando efeitos de som (rode com -X para suprimir esta mensagem).Contribuintes Copyright (C) %d Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux e Philippe Meisburger. Copyright (C) %d Alexandre Duret-Lutz. Impossível inicializar o som, razão: %s Desativando saída de som (use -S para suprimir esta mensagem).Impossível inicializar o som, razão: LIbMikMod não é uma tarefa segura. Desativando saída de som (use -S para suprimir esta mensagem).Impossível carregar %s, razão: %sImpossível abrir audio: %s Desativando saída de som (use -S para suprimir esta mensagem).ENCONTRO MORTALABAIXOOpções de tela: -G, --gfx-options=OPÇÕES passa OPÇÕES para o driver de tela -F, --full-screen modo tela cheia -2, --double duplica o tamanho da tela -3, --triple triplica o tamanho da tela -4, --quadruple quadruplica o tamanho da tela -e, --even-lines mostra somente as linhas pares SuíçoEDITAEDITORENTRE SEU NOME:TODOS PERDERAM!NÍVEL EXISTENTEVIDA EXTRA!EXTRASNÍVEIS EXTRASEXTRAS SOMENTEEXTRAS: TODOSEXTRAS: NENHUMEXTRAS: ESCOLHAErro durante a carga do nívelCAUDA DE FOGO!Falha abrindo um visual interno 'display-memory'.Falha abrindo visual: %sFalha setando o modo 320x200x8 em 'display-memory'Arquivo: %s FrancêsJOGOOPÇOES DE JOGO%d PONTOSTURBO+TURBO-VOLTAOpções Gerais: -v, --version mostra a versão do programa -h, --help mostra esta ajuda -q, --quiet não imprime mensagens de alerta -Q, --really-quiet não imprime nem mesmo mensagens de erro -v, --verbose=CHANNELS ativa ou desativa canais de debug (veja --list=debug para canais disponíveis) -l, --list=NOME mostra informação interna; NOME pode ser 'debug', 'resources', 'sound-drivers' ou 'sound-tracks' AlemãoHEROESMAIORES ESCORESvariável HOME não encontrada do ambiente, assumindo '.'Heroes foi compilado com SDL_mixer, não há lista de drivers disponível.Heroes foi compilado sem suporte a som.Heroes é um jogo similar a "Tron" e "Nibbles" mas inclui muitos melhoramentos gráficos e novas características de jogo. Heroeslvl é uma ferramenta usada para inspecionar arquivos de nível do Heroes. INÉRCIAINFOSINVERTIDO %dINVENCÍVEL!Parece que o jogo não está instalado corretamente. Talvez os arquivos de dados não tenham sido instalados com as mesmas opções de configuração do executável, ou os arquivos de dados foram movidos para algum lugar. Neste último caso é provavelmente suficiente setar a variável de ambiente HEROES_PREFIX para a nova localização. Você ainda pode precisar setar HEROES_DEBUG=system para ver que arquivos Heroes está procurando. Se nada disso ajuda, contacte ItalianoTECLADOTECLASMATAR TODOSULTIMA VIDA%d VIDAS RESTANTESESQUERDABRILHOCARREGA NÍVELCARREGAR...LibMikMod versão %ld.%ld.%ld MÚSICAVOL MÚSICAArgumentos obrigatórios para opções longas também são obrigatórios para opções curtas. Opções miscelâneas: --cpu-off desativa o controle dos oponentes pela CPU --default-scores recria um arquivo padrão para os escores --default-options recria um arquivo padrão para as opções --default-saves recria um arquivo padrão para jogos salvos -s, --swap-sides troca lados no modo de dois jogadores --no-double-fx desativa a combinação de rotozoom e ondas -g, --go pula a introdução -J, --no-joystick desativa o uso de joystick Arquivo não encontrado.NOMENOVO NÍVELPROXIMO NIVELNAOJoystick não encontrado (rode com `-J' para suprimir esta mensagem).UM JOGADOROPÇOESNÍVEIS ORIGINAISORIGINAL+EXTRASOutras pessoas que gostaríamos de agradecer PAUSAJOGARJOGADOR %d VENCEU!JOGADOR %d, VOCE VEIO AO TOP 10JOGADOR 1JOGADOR 2JOGADOR 3JOGADOR 4TECLE ENTERPTS VIDASEmpacotadores Portadores CAÇADASAIRSAIR DESTE JOGO?RADARREALMENTE SAIR?DIREITAROUND %d/%dReporte bugs a .SALVAR...ESCORESTELAOPÇOES DE TELAESCOLHA UM NÍVELSOM FXVOL SFXTAM PTS VIDASTAMANHO %dSOMOPÇOES DE SOMVELOCIDADEVELOCIDADE-VELOCIDADE+PARARPARADO %dOpções de som: -d, --driver=N[,OPÇÕES] use driver N para saída de som (0:autodetecta) (veja --list=sound-drivers para ver os N's) -S, --no-sound desativa som -X, --no-sfx desativa efeitos sonoros -m, --mono saída não-estéreo -8, --8bits saída de som em 8 bits -i, --high-quality mixer de alta qualidade T imprime teclasFIMTEMPO É DINHEIROTURBODOIS JOGADORESEstas opções podem ser postas no seu arquivo ~/.heroes/heroesrc (que é lido antes de analisar outras opções da linha de comando) usando uma linha igual a seguinte: Options: -gs -d3,buffer=11,count=4 Isto é software livre; veja os fontes para condições de cópia. NÃO há garantia; nem mesmo COMERCIAL ou para ATENDIMENTO A PROPÓSITO PARTICULAR.Tradutores Tente '%s --help' para mais informação. ACIMAImpossível abrir efeito de som %sOpção '%c' desconhecida para o comando '%s'.Erro desconhecido do sistemaUso: %s [OPÇÕES]... Uso: %s [OPÇÕES]... níveis Use `-lNOME' ou `--list=NOME' onde NOME pode ser:Visite http://heroes.sourceforge.net/ para notícias, documentos e atualizações.GANHOU PTS VIDASQuando não são fornecidas opções, o default é -ipfh.TAM-XCRUZA-XTAM-YCRUZA-YSIMVOCÊ PERDEU!todas as mensagensanimbonusbombaImpossível carregar %sImpossível abrir diretório %simpossível ajustar uma tela correta.impossível gravar %scaracter '%c' não é desenhável (na mensagem '%s')comunicação com o driver de telad imprime direçõespartes diferentes do jogomostra todos os canais de debugpoeiraerro em sfx.cfgf imprime o nome do arquivofalha adquirindo 'direct-buffer'falha tentando conseguir um 'buffer direto' para este visualfalha abrindo visual.falha liberando 'direct-buffer'uso de recursos de nomes de arquivouso de arquivos e diretóriosh imprime cabeçalhoi imprime detalhes do blocogeloinicialização e eventos de joystickuso de níveislista todos os arquivos de nívelvoltamemória insuficienteeventos miscelâneosnenhumdesvioeventos de "fade" da palettepinguepongueimprime as preferênciasimprime a lista de recursosimprime a lista de drivers de somimprime a lista de músicaseventos de efeitos sonoroseventos de músicavelocidadefixopararmensagens relacionadas ao sistemat imprime mapa tipo quadradouso do timertúnelevento inesperado %d w imprime mapa das paradesheroes-0.21/tools/0000777004117000411500000000000007451377037007641 5heroes-0.21/tools/README0000644004117000411500000000200607327235463010431 These files are miscellaneous tools used by the configure, build, install, or/and release processes. Most of them are used from the Makefiles (maybe only if ./configure decided so), but a few of them are meant to be run manually. The list below attempts to give a short summary for each of the file that doesn't come along with autoconf or automake. alpha.sh make an alpha release (distcheck, upload, web-update, announce) autogen.sh create all autoconf/automake generated files cvsboot.sh bootstrap a fresh CVS checkout exnews.pl get latest entry from any ChangeLog-like file (used with NEWS) fetish-sync.sh update all files shared with (=stolen from) fetish genm4mam.sh create m4/Makefile.inc genpotfile.sh create po/POTFILES.in readme.sed used to extract the top-level README from the Texinfo manual upgettext.sh install gettext's files and patch them The file `HACKING', at the top-level directory of the distribution, might give some instructions regarding the usage of these files. heroes-0.21/tools/compile0000755004117000411500000000532607450625734011140 #! /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. 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 heroes-0.21/tools/config.guess0000755004117000411500000011304507450625733012077 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. timestamp='2002-03-04' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 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 Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mac68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; macppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme68k:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvme88k:OpenBSD:*:*) echo m88k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sgi:OpenBSD:*:*) echo mipseb-unknown-openbsd${UNAME_RELEASE} exit 0 ;; sun3:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; wgrisc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. cat <$dummy.s .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; esac fi rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit 0 ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit 0 ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit 0;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit 0 ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit 0 ;; *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit 0;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit 0 ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit 0 ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit 0 ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit 0 ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit 0 ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit 0 ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit 0 ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit 0 ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit 0 ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit 0 ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit 0 ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit 0 ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy \ && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit 0 ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit 0 ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit 0 ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit 0 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit 0 ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit 0 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit 0 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit 0 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit 0 ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit 0 ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit 0 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit 0 ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:*:*) echo rs6000-ibm-aix exit 0 ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit 0 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit 0 ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit 0 ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit 0 ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit 0 ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit 0 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit 0 ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit 0 ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit 0 ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit 0 ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit 0 ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit 0 ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit 0 ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit 0 ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit 0 ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit 0 ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit 0 ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit 0 ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit 0 ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; x86:Interix*:3*) echo i386-pc-interix3 exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i386-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit 0 ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit 0 ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` rm -f $dummy.c test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #ifdef __INTEL_COMPILER LIBC=gnu #else LIBC=gnuaout #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` rm -f $dummy.c test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit 0 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit 0 ;; i*86:*:5:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit 0 ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit 0 ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit 0 ;; paragon:*:*:*) echo i860-intel-osf1 exit 0 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit 0 ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4.3${OS_REL} && exit 0 /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && echo i486-ncr-sysv4 && exit 0 ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit 0 ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit 0 ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit 0 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit 0 ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit 0 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit 0 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit 0 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit 0 ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit 0 ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit 0 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit 0 ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit 0 ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit 0 ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit 0 ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit 0 ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_MACHINE=pc echo i386-${UNAME_MACHINE}-nto-qnx else echo `uname -p`-${UNAME_MACHINE}-nto-qnx fi exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit 0 ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit 0 ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit 0 ;; c34*) echo c34-convex-bsd exit 0 ;; c38*) echo c38-convex-bsd exit 0 ;; c4*) echo c4-convex-bsd exit 0 ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: heroes-0.21/tools/config.sub0000755004117000411500000007052707450625733011551 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002 Free Software Foundation, Inc. timestamp='2002-03-04' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dsp16xx \ | fr30 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | m32r | m68000 | m68k | m88k | mcore \ | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mipsisa32 \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | avr-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; or32 | or32-*) basic_machine=or32-unknown os=-coff ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3d) basic_machine=alpha-cray os=-unicos ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; sh64) basic_machine=sh64-unknown ;; sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; c4x*) basic_machine=c4x-none os=-coff ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -ptx*) vendor=sequent ;; -vxsim* | -vxworks*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: heroes-0.21/tools/depcomp0000755004117000411500000003033507450625734011135 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 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. 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. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then # 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" ;; 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. base=`echo "$object" | sed -e 's/\.o$//' -e 's/\.lo$//'` tmpdepfile1="$base.o.d" tmpdepfile2="$base.d" if test "$libtool" = yes; then "$@" -Wc,-MD else "$@" -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 space and a tab 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 proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. test -z "$dashmflag" && dashmflag=-M ( IFS=" " case " $* " in *" --mode=compile "*) # this is libtool, let us make it quiet for arg do # cycle over the arguments case "$arg" in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" $dashmflag | sed 's:^[^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi 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) # 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;; -*) ;; *) set fnord "$@" "$arg"; shift;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} 2>/dev/null -o"$obj_suffix" -f"$tmpdepfile" "$@" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi 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 proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. ( IFS=" " case " $* " in *" --mode=compile "*) for arg do # cycle over the arguments case $arg in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi 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 proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. ( IFS=" " case " $* " in *" --mode=compile "*) for arg do # cycle over the arguments case $arg in "--mode=compile") # insert --quiet before "--mode=compile" set fnord "$@" --quiet shift # fnord ;; esac set fnord "$@" "$arg" shift # fnord shift # "$arg" done ;; esac 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" ) & proc=$! "$@" stat=$? wait "$proc" if test "$stat" != 0; then exit $stat; fi 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 heroes-0.21/tools/install-sh0000755004117000411500000001267107450625734011567 #!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5 (mit/util/scripts/install.sh). # # Copyright 1991 by the Massachusetts Institute of Technology # # Permission to use, copy, modify, distribute, and sell this software and its # documentation for any purpose is hereby granted without fee, provided that # the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of M.I.T. not be used in advertising or # publicity pertaining to distribution of the software without specific, # written prior permission. M.I.T. makes no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else : 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 -o -d $src ] then : else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" 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 temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;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 rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 heroes-0.21/tools/mdate-sh0000755004117000411500000000560307450625734011210 #!/bin/sh # Get modification time of a file or directory and pretty-print it. # Copyright 1995, 1996, 1997 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # 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. # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # Get the extended ls output of the file or directory. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. if ls -L /dev/null 1>/dev/null 2>&1; then set - x`ls -L -l -d $1` else set - x`ls -l -d $1` fi # The month is at least the fourth argument # (3 shifts here, the next inside the loop). shift shift shift # Find the month. Next argument is day, followed by the year or time. month= until test $month do shift case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done day=$2 # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year heroes-0.21/tools/missing0000755004117000411500000002405007450625734011154 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright 1996, 1997, 1999, 2000 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 \`$1Help2man' 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 ${1+"$@"} && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar ${1+"$@"} && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" ${1+"$@"} && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" ${1+"$@"} && 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 prerequirements 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 heroes-0.21/tools/mkinstalldirs0000755004117000411500000000350407450625734012364 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ errstatus=0 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 ;; -- ) shift; break ;; # stop option processing -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option * ) break ;; # first non-opt arg 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: 3 # End: # mkinstalldirs ends here heroes-0.21/tools/texinfo.tex0000644004117000411500000063162207450625733011763 % texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2002-03-01.06} % % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, % 2000, 01, 02 Free Software Foundation, Inc. % % This texinfo.tex file is free software; you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation; either version 2, or (at % your option) any later version. % % This texinfo.tex file 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 texinfo.tex file; see the file COPYING. If not, write % to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, % Boston, MA 02111-1307, USA. % % In other words, you are welcome to use, share and improve this program. % You are forbidden to forbid anyone else to use, share and improve % what you give them. Help stamp out software-hoarding! % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % ftp://ftp.gnu.org/gnu/texinfo.tex % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) % ftp://texinfo.org/texinfo/texinfo.tex % ftp://tug.org/tex/texinfo.tex % (and all CTAN mirrors, see http://www.ctan.org), % and /home/gd/gnu/doc/texinfo.tex on the GNU machines. % % The texinfo.tex in any given Texinfo distribution could well be out % of date, so if that's what you're using, please check. % % Texinfo has a small home page at http://texinfo.org/ and also % http://www.gnu.org/software/texinfo. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages. You can get % the existing language-specific files from the full Texinfo distribution. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} % Save some parts of plain tex whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexi=\i \let\ptexlbrace=\{ \let\ptexrbrace=\} \let\ptexstar=\* \let\ptext=\t % We never want plain's outer \+ definition in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax \message{Basics,} \chardef\other=12 % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi % Ignore a token. % \def\gobble#1{} \hyphenation{ap-pen-dix} \hyphenation{mini-buf-fer mini-buf-fers} \hyphenation{eshell} \hyphenation{white-space} % Margin to add to right of even pages, to left of odd pages. \newdimen \bindingoffset \newdimen \normaloffset \newdimen\pagewidth \newdimen\pageheight % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \ifx\eTeXversion\undefined \def\loggingall{\tracingcommands2 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% \else \def\loggingall{\tracingcommands3 \tracingstats2 \tracingpages1 \tracingoutput1 \tracinglostchars1 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 \tracingscantokens1 \tracingassigns1 \tracingifs1 \tracinggroups1 \tracingnesting2 \showboxbreadth\maxdimen\showboxdepth\maxdimen }% \fi % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % For @cropmarks command. % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \escapechar = `\\ % use backslash in output files. \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingxxx.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 2\baselineskip \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \turnoffactive \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1 \unvbox#1 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg#1{% \let\next = #1% \begingroup \obeylines \futurelet\temp\parseargx } % If the next token is an obeyed space (from an @example environment or % the like), remove it and recurse. Otherwise, we're done. \def\parseargx{% % \obeyedspace is defined far below, after the definition of \sepspaces. \ifx\obeyedspace\temp \expandafter\parseargdiscardspace \else \expandafter\parseargline \fi } % Remove a single space (as the delimiter token to the macro call). {\obeyspaces % \gdef\parseargdiscardspace {\futurelet\temp\parseargx}} {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. % % First remove any @c comment, then any @comment. % Result of each macro is put in \toks0. \argremovec #1\c\relax % \expandafter\argremovecomment \the\toks0 \comment\relax % % % Call the caller's macro, saved as \next in \parsearg. \expandafter\next\expandafter{\the\toks0}% }% } % Since all \c{,omment} does is throw away the argument, we can let TeX % do that for us. The \relax here is matched by the \relax in the call % in \parseargline; it could be more or less anything, its purpose is % just to delimit the argument to the \c. \def\argremovec#1\c#2\relax{\toks0 = {#1}} \def\argremovecomment#1\comment#2\relax{\toks0 = {#1}} % \argremovec{,omment} might leave us with trailing spaces, though; e.g., % @end itemize @c foo % will have two active spaces as part of the argument with the % `itemize'. Here we remove all active spaces from #1, and assign the % result to \toks0. % % This loses if there are any *other* active characters besides spaces % in the argument -- _ ^ +, for example -- since they get expanded. % Fortunately, Texinfo does not define any such commands. (If it ever % does, the catcode of the characters in questionwill have to be changed % here.) But this means we cannot call \removeactivespaces as part of % \argremovec{,omment}, since @c uses \parsearg, and thus the argument % that \parsearg gets might well have any character at all in it. % \def\removeactivespaces#1{% \begingroup \ignoreactivespaces \edef\temp{#1}% \global\toks0 = \expandafter{\temp}% \endgroup } % Change the active space to expand to nothing. % \begingroup \obeyspaces \gdef\ignoreactivespaces{\obeyspaces\let =\empty} \endgroup \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} %% These are used to keep @begin/@end levels from running away %% Call \inENV within environments (after a \begingroup) \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi} \def\ENVcheck{% \ifENV\errmessage{Still within an environment; press RETURN to continue} \endgroup\fi} % This is not perfect, but it should reduce lossage % @begin foo is the same as @foo, for now. \newhelp\EMsimple{Press RETURN to continue.} \outer\def\begin{\parsearg\beginxxx} \def\beginxxx #1{% \expandafter\ifx\csname #1\endcsname\relax {\errhelp=\EMsimple \errmessage{Undefined command @begin #1}}\else \csname #1\endcsname\fi} % @end foo executes the definition of \Efoo. % \def\end{\parsearg\endxxx} \def\endxxx #1{% \removeactivespaces{#1}% \edef\endthing{\the\toks0}% % \expandafter\ifx\csname E\endthing\endcsname\relax \expandafter\ifx\csname \endthing\endcsname\relax % There's no \foo, i.e., no ``environment'' foo. \errhelp = \EMsimple \errmessage{Undefined command `@end \endthing'}% \else \unmatchedenderror\endthing \fi \else % Everything's ok; the right environment has been started. \csname E\endthing\endcsname \fi } % There is an environment #1, but it hasn't been started. Give an error. % \def\unmatchedenderror#1{% \errhelp = \EMsimple \errmessage{This `@end #1' doesn't have a matching `@#1'}% } % Define the control sequence \E#1 to give an unmatched @end error. % \def\defineunmatchedend#1{% \expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}% } % Single-spacing is done by various environments (specifically, in % \nonfillstart and \quotations). \newskip\singlespaceskip \singlespaceskip = 12.5pt \def\singlespace{% % Why was this kern here? It messes up equalizing space above and below % environments. --karl, 6may93 %{\advance \baselineskip by -\singlespaceskip %\kern \baselineskip}% \setleading\singlespaceskip } %% Simple single-character @ commands % @@ prints an @ % Kludge this until the fonts are right (grr). \def\@{{\tt\char64}} % This is turned off because it was never documented % and you can use @w{...} around a quote to suppress ligatures. %% Define @` and @' to be the same as ` and ' %% but suppressing ligatures. %\def\`{{`}} %\def\'{{'}} % Used to generate quoted braces. \def\mylbrace {{\tt\char123}} \def\myrbrace {{\tt\char125}} \let\{=\mylbrace \let\}=\myrbrace \begingroup % Definitions to produce actual \{ & \} command in an index. \catcode`\{ = 12 \catcode`\} = 12 \catcode`\[ = 1 \catcode`\] = 2 \catcode`\@ = 0 \catcode`\\ = 12 @gdef@lbracecmd[\{]% @gdef@rbracecmd[\}]% @endgroup % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. \let\, = \c \let\dotaccent = \. \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \t \let\ubaraccent = \b \let\udotaccent = \d % Other special characters: @questiondown @exclamdown % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ptexi \else\ifx\temp\jmacro \j \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\hfil\break\hbox{}\ignorespaces} % @. is an end-of-sentence period. \def\.{.\spacefactor=3000 } % @! is an end-of-sentence bang. \def\!{!\spacefactor=3000 } % @? is an end-of-sentence query. \def\?{?\spacefactor=3000 } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % \def\group{\begingroup \ifnum\catcode13=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi % % The \vtop we start below produces a box with normal height and large % depth; thus, TeX puts \baselineskip glue before it, and (when the % next line of text is done) \lineskip glue after it. (See p.82 of % the TeXbook.) Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% \egroup % End the \vtop. \endgroup % End the \group. }% % \vtop\bgroup % We have to put a strut on the last line in case the @group is in % the midst of an example, rather than completely enclosing it. % Otherwise, the interline space between the last line of the group % and the first line afterwards is too small. But we can't put the % strut in \Egroup, since there it would be on a line by itself. % Hence this just inserts a strut at the beginning of each line. \everypar = {\strut}% % % Since we have a strut on every line, we don't need any of TeX's % normal interline spacing. \offinterlineskip % % OK, but now we have to do something about blank % lines in the input in @example-like environments, which normally % just turn into \lisppar, which will insert no space now that we've % turned off the interline space. Simplest is to make them be an % empty paragraph. \ifx\par\lisppar \edef\par{\leavevmode \par}% % % Reset ^^M's definition to new definition of \par. \obeylines \fi % % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \def\need{\parsearg\needx} % Old definition--didn't work. %\def\needx #1{\par % %% This method tries to make TeX break the page naturally %% if the depth of the box does not fit. %{\baselineskip=0pt% %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak %\prevdepth=-1000pt %}} \def\needx#1{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break \let\br = \par % @dots{} output an ellipsis using the current font. % We do .5em per period so that it has the same spacing in a typewriter % font as three actual period characters. % \def\dots{% \leavevmode \hbox to 1.5em{% \hskip 0pt plus 0.25fil minus 0.25fil .\hss.\hss.% \hskip 0pt plus 0.5fil minus 0.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \leavevmode \hbox to 2em{% \hskip 0pt plus 0.25fil minus 0.25fil .\hss.\hss.\hss.% \hskip 0pt plus 0.5fil minus 0.5fil }% \spacefactor=3000 } % @page forces the start of a new page % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \def\exdent{\parsearg\exdentyyy} \def\exdentyyy #1{{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}} % This defn is used inside nofill environments such as @example. \def\nofillexdent{\parsearg\nofillexdentyyy} \def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @include file insert text of that file as input. % Allow normal characters that we make active in the argument (a file name). \def\include{\begingroup \catcode`\\=12 \catcode`~=12 \catcode`^=12 \catcode`_=12 \catcode`|=12 \catcode`<=12 \catcode`>=12 \catcode`+=12 \parsearg\includezzz} % Restore active chars for included file. \def\includezzz#1{\endgroup\begingroup % Read the included file in a group so nested @include's work. \def\thisfile{#1}% \input\thisfile \endgroup} \def\thisfile{} % @center line outputs that line, centered \def\center{\parsearg\centerzzz} \def\centerzzz #1{{\advance\hsize by -\leftskip \advance\hsize by -\rightskip \centerline{#1}}} % @sp n outputs n lines of vertical space \def\sp{\parsearg\spxxx} \def\spxxx #1{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % We cannot implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \def\paragraphindent{\parsearg\doparagraphindent} \def\doparagraphindent#1{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \def\exampleindent{\parsearg\doexampleindent} \def\doexampleindent#1{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % We don't use $'s directly in the definition of \math because we need % to set catcodes according to plain TeX first, to allow for subscripts, % superscripts, special math chars, etc. % % @math does not do math typesetting in section titles, index % entries, and other such contexts where the catcodes are set before % @math gets a chance to work. This could perhaps be fixed, but for now % at least we can have real math in the main text, where it's needed most. % % \let\implicitmath = $%$ font-lock fix % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ within @math be active (mathcode "8000), and distinguish by seeing % if the current family is \slfam, which is what @var uses. % {\catcode95 = \active % 95 = _ \gdef\mathunderscore{% \catcode95=\active \def_{\ifnum\fam=\slfam\_\else\sb\fi}% }} % \def\math{\tex\mathcode`\_="8000\mathunderscore \implicitmath\finishmath} \def\finishmath#1{#1\implicitmath\Etex} % @bullet and @minus need the same treatment as @math, just above. \def\bullet{\implicitmath\ptexbullet\implicitmath} \def\minus{\implicitmath-\implicitmath} % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \iflinks \readauxfile \fi % \openindices needs to do some work in any case. \openindices \fixbackslash % Turn off hack to swallow `\input texinfo'. \global\let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. % Just to be on the safe side, close the input stream before the \input. \openin 1 texinfo.cnf \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi \closein1 \temp % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest \ifx\pdfoutput\undefined \pdffalse \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\linkcolor = \relax \let\pdfmakeoutlines = \relax \else \pdftrue \pdfoutput = 1 \input pdfcolor \def\dopdfimage#1#2#3{% \def\imagewidth{#2}% \def\imageheight{#3}% % without \immediate, pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifx\empty\imagewidth\else width \imagewidth \fi \ifx\empty\imageheight\else height \imageheight \fi \ifnum\pdftexversion<13 #1.pdf% \else {#1.pdf}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}} \def\pdfmkpgn#1{#1} \let\linkcolor = \Blue % was Cyan, but that seems light? \def\endlink{\Black\pdfendlink} % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} \def\pdfmakeoutlines{{% \openin 1 \jobname.toc \ifeof 1\else\begingroup \closein 1 \indexnofonts \def\tt{} \let\_ = \normalunderscore % Thanh's hack / proper braces in bookmarks \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace % \def\chapentry ##1##2##3{} \let\appendixentry = \chapentry \def\unnumbchapentry ##1##2{} \def\secentry ##1##2##3##4{\advancenumber{chap##2}} \def\unnumbsecentry ##1##2{} \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} \def\unnumbsubsecentry ##1##2{} \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} \def\unnumbsubsubsecentry ##1##2{} \input \jobname.toc \def\chapentry ##1##2##3{% \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} \let\appendixentry = \chapentry \def\unnumbchapentry ##1##2{% \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} \def\secentry ##1##2##3##4{% \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} \def\unnumbsecentry ##1##2{% \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} \def\subsecentry ##1##2##3##4##5{% \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} \def\unnumbsubsecentry ##1##2{% \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} \def\subsubsecentry ##1##2##3##4##5##6{% \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} \def\unnumbsubsubsecentry ##1##2{% \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} \input \jobname.toc \endgroup\fi }} \def\makelinks #1,{% \def\params{#1}\def\E{END}% \ifx\params\E \let\nextmakelinks=\relax \else \let\nextmakelinks=\makelinks \ifnum\lnkcount>0,\fi \picknum{#1}% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{\the\pgn}}% \linkcolor #1% \advance\lnkcount by 1% \endlink \fi \nextmakelinks } \def\picknum#1{\expandafter\pn#1} \def\pn#1{% \def\p{#1}% \ifx\p\lbrace \let\nextpn=\ppn \else \let\nextpn=\ppnn \def\first{#1} \fi \nextpn } \def\ppn#1{\pgn=#1\gobble} \def\ppnn{\pgn=\first} \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \ifx\p\space\else\addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \fi \nextsp} \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi \def\pdfurl#1{% \begingroup \normalturnoffactive\def\@{@}% \let\value=\expandablevalue \leavevmode\Red \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% % #1 \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS| \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \linkcolor #1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \fi % \ifx\pdfoutput \message{fonts,} % Font-change commands. % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf analogous to plain's \rm, etc. \newfam\sffam \def\sf{\fam=\sffam \tensf} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this one. \def\ttsl{\tenttsl} % Default leading. \newdimen\textleading \textleading = 13.2pt % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % \def\setleading#1{% \normalbaselineskip = #1\relax \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). % #3 is the font's design size, #4 is a scale factor \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\undefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} %where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} \newcount\mainmagstep \ifx\bigger\relax % not really supported. \let\mainmagstep=\magstep1 \setfont\textrm\rmshape{12}{1000} \setfont\texttt\ttshape{12}{1000} \else \mainmagstep=\magstephalf \setfont\textrm\rmshape{10}{\mainmagstep} \setfont\texttt\ttshape{10}{\mainmagstep} \fi % Instead of cmb10, you many want to use cmbx10. % cmbx10 is a prettier font on its own, but cmb10 % looks better when embedded in a line with cmr10. \setfont\textbf\bfshape{10}{\mainmagstep} \setfont\textit\itshape{10}{\mainmagstep} \setfont\textsl\slshape{10}{\mainmagstep} \setfont\textsf\sfshape{10}{\mainmagstep} \setfont\textsc\scshape{10}{\mainmagstep} \setfont\textttsl\ttslshape{10}{\mainmagstep} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep % A few fonts for @defun, etc. \setfont\defbf\bxshape{10}{\magstep1} %was 1314 \setfont\deftt\ttshape{10}{\magstep1} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} % Fonts for indices, footnotes, small examples (9pt). \setfont\smallrm\rmshape{9}{1000} \setfont\smalltt\ttshape{9}{1000} \setfont\smallbf\bfshape{10}{900} \setfont\smallit\itshape{9}{1000} \setfont\smallsl\slshape{9}{1000} \setfont\smallsf\sfshape{9}{1000} \setfont\smallsc\scshape{10}{900} \setfont\smallttsl\ttslshape{10}{900} \font\smalli=cmmi9 \font\smallsy=cmsy9 % Fonts for small examples (8pt). \setfont\smallerrm\rmshape{8}{1000} \setfont\smallertt\ttshape{8}{1000} \setfont\smallerbf\bfshape{10}{800} \setfont\smallerit\itshape{8}{1000} \setfont\smallersl\slshape{8}{1000} \setfont\smallersf\sfshape{8}{1000} \setfont\smallersc\scshape{10}{800} \setfont\smallerttsl\ttslshape{10}{800} \font\smalleri=cmmi8 \font\smallersy=cmsy8 % Fonts for title page: \setfont\titlerm\rmbshape{12}{\magstep3} \setfont\titleit\itbshape{10}{\magstep4} \setfont\titlesl\slbshape{10}{\magstep4} \setfont\titlett\ttbshape{12}{\magstep3} \setfont\titlettsl\ttslshape{10}{\magstep4} \setfont\titlesf\sfbshape{17}{\magstep1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\authorrm{\secrm} % Chapter (and unnumbered) fonts (17.28pt). \setfont\chaprm\rmbshape{12}{\magstep2} \setfont\chapit\itbshape{10}{\magstep3} \setfont\chapsl\slbshape{10}{\magstep3} \setfont\chaptt\ttbshape{12}{\magstep2} \setfont\chapttsl\ttslshape{10}{\magstep3} \setfont\chapsf\sfbshape{17}{1000} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 % Section fonts (14.4pt). \setfont\secrm\rmbshape{12}{\magstep1} \setfont\secit\itbshape{10}{\magstep2} \setfont\secsl\slbshape{10}{\magstep2} \setfont\sectt\ttbshape{12}{\magstep1} \setfont\secttsl\ttslshape{10}{\magstep2} \setfont\secsf\sfbshape{12}{\magstep1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 % Subsection fonts (13.15pt). \setfont\ssecrm\rmbshape{12}{\magstephalf} \setfont\ssecit\itbshape{10}{1315} \setfont\ssecsl\slbshape{10}{1315} \setfont\ssectt\ttbshape{12}{\magstephalf} \setfont\ssecttsl\ttslshape{10}{1315} \setfont\ssecsf\sfbshape{12}{\magstephalf} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{\magstep1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, % but that is not a standard magnification. % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this so that font changes will continue to work % in math mode, where it is the current \fam that is relevant in most % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam % \tenbf}, for example. By redefining \tenbf, we obviate the need to % redefine \bf itself. \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \resetmathfonts \setleading{25pt}} \def\titlefont#1{{\titlefonts\rm #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \resetmathfonts \setleading{9.5pt}} \let\smallexamplefonts = \smallerfonts % Set up the default fonts, so we can use them for creating boxes. % \textfonts % Define these so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000} \setfont\shortcontbf\bxshape{12}{1000} \setfont\shortcontsl\slshape{12}{1000} %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic % \smartitalic{ARG} outputs arg in italics, followed by an italic correction % unless the following character is such as not to need one. \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} \def\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx} \let\i=\smartitalic \let\var=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic \let\cite=\smartslanted \def\b#1{{\bf #1}} \let\strong=\b % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } \def\t#1{% {\tt \rawbackslash \frenchspacing #1}% \null } \let\ttfont=\t \def\samp#1{`\tclose{#1}'\null} \setfont\keyrm\rmshape{8}{1000} \font\keysy=cmsy9 \def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% \vbox{\hrule\kern-0.4pt \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% \kern-0.4pt\hrule}% \kern-.06em\raise0.4pt\hbox{\angleright}}}} % The old definition, with no lozenge: %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @file, @option are the same as @samp. \let\file=\samp \let\option=\samp % @code is a modification of @t, % which makes spaces the same size as normal in the surrounding text. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \frenchspacing #1% }% \null } % We *must* turn on hyphenation at `-' and `_' in \code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active % \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex } % % If we end up with any active - characters when handling the index, % just treat them as a normal -. \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} } \def\realdash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} \def\codex #1{\tclose{#1}\endgroup} %\let\exp=\tclose %Was temporary % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \def\kbdinputstyle{\parsearg\kbdinputstylexxx} \def\kbdinputstylexxx#1{% \def\arg{#1}% \ifx\arg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\arg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\arg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is kbdinputdistinct. (Too much of a hassle to call the macro, % the catcodes are wrong for parsearg to work.) \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl} \def\xkey{\key} \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\look}}\fi \else{\tclose{\kbdfont\look}}\fi} % For @url, @env, @command quotes seem unnecessary, so use \code. \let\url=\code \let\env=\code \let\command=\code % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. Perhaps eventually put in % a hypertex \special here. % \def\uref#1{\douref #1,,,\finish} \def\douref#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} \def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @acronym downcases the argument and prints in smallcaps. \def\acronym#1{{\smallcaps \lowercase{#1}}} % @pounds{} is a sterling sign. \def\pounds{{\it\$}} \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \def\shorttitlepage{\parsearg\shorttitlepagezzz} \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \def\titlepage{\begingroup \parindent=0pt \textfonts \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}% % \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}% % % Leave some space at the very top of the page. \vglue\titlepagetopglue % % Now you can print the title using @title. \def\title{\parsearg\titlezzz}% \def\titlezzz##1{\leftline{\titlefonts\rm ##1} % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Now you can put text using @subtitle. \def\subtitle{\parsearg\subtitlezzz}% \def\subtitlezzz##1{{\subtitlefont \rightline{##1}}}% % % @author should come last, but may come many times. \def\author{\parsearg\authorzzz}% \def\authorzzz##1{\ifseenauthor\else\vskip 0pt plus 1filll\seenauthortrue\fi {\authorfont \leftline{##1}}}% % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \oldpage \let\page = \oldpage \hbox{}}% % \def\page{\oldpage \hbox{}} } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi % \ifpdf \pdfmakepagedesttrue \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } %%% Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make Tex use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\oddheading{\parsearg\oddheadingxxx} \def\everyheading{\parsearg\everyheadingxxx} \def\evenfooting{\parsearg\evenfootingxxx} \def\oddfooting{\parsearg\oddfootingxxx} \def\everyfooting{\parsearg\everyfootingxxx} {\catcode`\@=0 % \gdef\evenheadingxxx #1{\evenheadingyyy #1@|@|@|@|\finish} \gdef\evenheadingyyy #1@|#2@|#3@|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -\baselineskip \global\advance\vsize by -\baselineskip } \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}} % }% unbind the catcode of @. % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\HEADINGSoff{ \global\evenheadline={\hfil} \global\evenfootline={\hfil} \global\oddheadline={\hfil} \global\oddfootline={\hfil}} \HEADINGSoff % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{ \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{ \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\undefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg\settitlezzz} \def\settitlezzz #1{\gdef\thistitle{#1}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x), @kitem(x), @xitem(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @vtable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\internalBxitem "#1"{\def\xitemsubtopix{#1} \smallbreak \parsearg\xitemzzz} \def\internalBxitemx "#1"{\def\xitemsubtopix{#1} \itemxpar \parsearg\xitemzzz} \def\internalBkitem{\smallbreak \parsearg\kitemzzz} \def\internalBkitemx{\itemxpar \parsearg\kitemzzz} \def\kitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \lastfunction}}% \itemzzz {#1}} \def\xitemzzz #1{\dosubind {kw}{\code{#1}}{for {\bf \xitemsubtopic}}% \itemzzz {#1}} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemfont{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. Unfortunately % we can't prevent a possible page break at the following % \baselineskip glue. \nobreak \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a table}} \def\itemx{\errmessage{@itemx while not in a table}} \def\kitem{\errmessage{@kitem while not in a table}} \def\kitemx{\errmessage{@kitemx while not in a table}} \def\xitem{\errmessage{@xitem while not in a table}} \def\xitemx{\errmessage{@xitemx while not in a table}} % Contains a kludge to get @end[description] to work. \def\description{\tablez{\dontindex}{1}{}{}{}{}} % @table, @ftable, @vtable. \def\table{\begingroup\inENV\obeylines\obeyspaces\tablex} {\obeylines\obeyspaces% \gdef\tablex #1^^M{% \tabley\dontindex#1 \endtabley}} \def\ftable{\begingroup\inENV\obeylines\obeyspaces\ftablex} {\obeylines\obeyspaces% \gdef\ftablex #1^^M{% \tabley\fnitemindex#1 \endtabley \def\Eftable{\endgraf\afterenvbreak\endgroup}% \let\Etable=\relax}} \def\vtable{\begingroup\inENV\obeylines\obeyspaces\vtablex} {\obeylines\obeyspaces% \gdef\vtablex #1^^M{% \tabley\vritemindex#1 \endtabley \def\Evtable{\endgraf\afterenvbreak\endgroup}% \let\Etable=\relax}} \def\dontindex #1{} \def\fnitemindex #1{\doind {fn}{\code{#1}}}% \def\vritemindex #1{\doind {vr}{\code{#1}}}% {\obeyspaces % \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup% \tablez{#1}{#2}{#3}{#4}{#5}{#6}}} \def\tablez #1#2#3#4#5#6{% \aboveenvbreak % \begingroup % \def\Edescription{\Etable}% Necessary kludge. \let\itemindex=#1% \ifnum 0#3>0 \advance \leftskip by #3\mil \fi % \ifnum 0#4>0 \tableindent=#4\mil \fi % \ifnum 0#5>0 \advance \rightskip by #5\mil \fi % \def\itemfont{#2}% \itemmax=\tableindent % \advance \itemmax by -\itemmargin % \advance \leftskip by \tableindent % \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi% \def\Etable{\endgraf\afterenvbreak\endgroup}% \let\item = \internalBitem % \let\itemx = \internalBitemx % \let\kitem = \internalBkitem % \let\kitemx = \internalBkitemx % \let\xitem = \internalBxitem % \let\xitemx = \internalBxitemx % } % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \def\itemize{\parsearg\itemizezzz} \def\itemizezzz #1{% \begingroup % ended by the @end itemize \itemizey {#1}{\Eitemize} } \def\itemizey #1#2{% \aboveenvbreak % \itemmax=\itemindent % \advance \itemmax by -\itemmargin % \advance \leftskip by \itemindent % \exdentamount=\itemindent \parindent = 0pt % \parskip = \smallskipamount % \ifdim \parskip=0pt \parskip=2pt \fi% \def#2{\endgraf\afterenvbreak\endgroup}% \def\itemcontents{#1}% \let\item=\itemizeitem} % Set sfcode to normal for the chars that usually have another value. % These are `.?!:;,' \def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000 \sfcode58=1000 \sfcode59=1000 \sfcode44=1000 } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \def\enumerate{\parsearg\enumeratezzz} \def\enumeratezzz #1{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% \begingroup % ended by the @end enumerate % % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call itemizey, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \itemizey{#1.}\Eenumerate\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % Definition of @item while inside @itemize. \def\itemizeitem{% \advance\itemno by 1 {\let\par=\endgraf \smallbreak}% \ifhmode \errmessage{In hmode at itemizeitem}\fi {\parskip=0in \hskip 0pt \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% \vadjust{\penalty 1200}}% \flushcr} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % % For those who want to use more than one line's worth of words in % the preamble, break the line within one argument and it % will parse correctly, i.e., % % @multitable {Column 1 template} {Column 2 template} {Column 3 % template} % Not: % @multitable {Column 1 template} {Column 2 template} % {Column 3 template} % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab, @multitable or @end multitable do not need to be on their % own lines, but it will not hurt if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the part of the @columnfraction before the decimal point, which % is presumably either 0 or the empty string (but we don't check, we % just throw it away). #2 is the decimal part, which we use as the % percent of \hsize for this column. \def\pickupwholefraction#1.#2 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{.#2\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator; % typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % This used to have \hskip1sp. But then the space in a template line is % not enough. That is bad. So let's go back to just & until we % encounter the problem it was intended to solve again. % --karl, nathan@acm.org, 20apr99. \def\tab{&} % @multitable ... @end multitable definitions: % \def\multitable{\parsearg\dotable} \def\dotable#1{\bgroup \vskip\parskip \let\item\crcr \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% % % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % \everycr will reset column counter, \colcount, at the end of % each line. Every column entry will cause \colcount to advance by one. % The table preamble % looks at the current \colcount to find the correct column width. \everycr{\noalign{% % % \filbreak%% keeps underfull box messages off when table breaks over pages. % Maybe so, but it also creates really weird page breaks when the table % breaks over pages. Wouldn't \vfil be better? Wait until the problem % manifests itself, so it can be fixed for real --karl. \global\colcount=0\relax}}% % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup&\global\advance\colcount by 1\relax \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively marking % characters. \noindent\ignorespaces##\unskip\multistrut}\cr } \def\setmultitablespacing{% test to see if user has set \multitablelinespace. % If so, do nothing. If not, give it an appropriate dimension based on % current baselineskip. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 %% strut to put in table in case some entry doesn't have descenders, %% to keep lines equally spaced \let\multistrut = \strut \else %% FIXME: what is \box0 supposed to be? \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 width0pt\relax} \fi %% Test to see if parskip is larger than space between lines of %% table. If not, do nothing. %% If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller %% than skip between lines in the table. \fi} \message{conditionals,} % Prevent errors for section commands. % Used in @ignore and in failing conditionals. \def\ignoresections{% \let\chapter=\relax \let\unnumbered=\relax \let\top=\relax \let\unnumberedsec=\relax \let\unnumberedsection=\relax \let\unnumberedsubsec=\relax \let\unnumberedsubsection=\relax \let\unnumberedsubsubsec=\relax \let\unnumberedsubsubsection=\relax \let\section=\relax \let\subsec=\relax \let\subsubsec=\relax \let\subsection=\relax \let\subsubsection=\relax \let\appendix=\relax \let\appendixsec=\relax \let\appendixsection=\relax \let\appendixsubsec=\relax \let\appendixsubsection=\relax \let\appendixsubsubsec=\relax \let\appendixsubsubsection=\relax \let\contents=\relax \let\smallbook=\relax \let\titlepage=\relax } % Used in nested conditionals, where we have to parse the Texinfo source % and so want to turn off most commands, in case they are used % incorrectly. % \def\ignoremorecommands{% \let\defcodeindex = \relax \let\defcv = \relax \let\deffn = \relax \let\deffnx = \relax \let\defindex = \relax \let\defivar = \relax \let\defmac = \relax \let\defmethod = \relax \let\defop = \relax \let\defopt = \relax \let\defspec = \relax \let\deftp = \relax \let\deftypefn = \relax \let\deftypefun = \relax \let\deftypeivar = \relax \let\deftypeop = \relax \let\deftypevar = \relax \let\deftypevr = \relax \let\defun = \relax \let\defvar = \relax \let\defvr = \relax \let\ref = \relax \let\xref = \relax \let\printindex = \relax \let\pxref = \relax \let\settitle = \relax \let\setchapternewpage = \relax \let\setchapterstyle = \relax \let\everyheading = \relax \let\evenheading = \relax \let\oddheading = \relax \let\everyfooting = \relax \let\evenfooting = \relax \let\oddfooting = \relax \let\headings = \relax \let\include = \relax \let\lowersections = \relax \let\down = \relax \let\raisesections = \relax \let\up = \relax \let\set = \relax \let\clear = \relax \let\item = \relax } % Ignore @ignore ... @end ignore. % \def\ignore{\doignore{ignore}} % Also ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, % @documentdescription, and @direntry text. % \def\ifinfo{\doignore{ifinfo}} \def\ifhtml{\doignore{ifhtml}} \def\ifnottex{\doignore{ifnottex}} \def\html{\doignore{html}} \def\menu{\doignore{menu}} \def\documentdescription{\doignore{documentdescription}} \def\direntry{\doignore{direntry}} % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory = \comment % Ignore text until a line `@end #1'. % \def\doignore#1{\begingroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define a command to swallow text until we reach `@end #1'. % This @ is a catcode 12 token (that is the normal catcode of @ in % this texinfo.tex file). We change the catcode of @ below to match. \long\def\doignoretext##1@end #1{\enddoignore}% % % Make sure that spaces turn into tokens that match what \doignoretext wants. \catcode32 = 10 % % Ignore braces, too, so mismatched braces don't cause trouble. \catcode`\{ = 9 \catcode`\} = 9 % % We must not have @c interpreted as a control sequence. \catcode`\@ = 12 % % Make the letter c a comment character so that the rest of the line % will be ignored. This way, the document can have (for example) % @c @end ifinfo % and the @end ifinfo will be properly ignored. % (We've just changed @ to catcode 12.) \catcode`\c = 14 % % And now expand that command. \doignoretext } % What we do to finish off ignored text. % \def\enddoignore{\endgroup\ignorespaces}% \newif\ifwarnedobs\warnedobsfalse \def\obstexwarn{% \ifwarnedobs\relax\else % We need to warn folks that they may have trouble with TeX 3.0. % This uses \immediate\write16 rather than \message to get newlines. \immediate\write16{} \immediate\write16{WARNING: for users of Unix TeX 3.0!} \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} \immediate\write16{If you are running another version of TeX, relax.} \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} \immediate\write16{ Then upgrade your TeX installation if you can.} \immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} \immediate\write16{If you are stuck with version 3.0, run the} \immediate\write16{ script ``tex3patch'' from the Texinfo distribution} \immediate\write16{ to use a workaround.} \immediate\write16{} \global\warnedobstrue \fi } % **In TeX 3.0, setting text in \nullfont hangs tex. For a % workaround (which requires the file ``dummy.tfm'' to be installed), % uncomment the following line: %%%%%\font\nullfont=dummy\let\obstexwarn=\relax % Ignore text, except that we keep track of conditional commands for % purposes of nesting, up to an `@end #1' command. % \def\nestedignore#1{% \obstexwarn % We must actually expand the ignored text to look for the @end % command, so that nested ignore constructs work. Thus, we put the % text into a \vbox and then do nothing with the result. To minimize % the change of memory overflow, we follow the approach outlined on % page 401 of the TeXbook: make the current font be a dummy font. % \setbox0 = \vbox\bgroup % Don't complain about control sequences we have declared \outer. \ignoresections % % Define `@end #1' to end the box, which will in turn undefine the % @end command again. \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% % % We are going to be parsing Texinfo commands. Most cause no % trouble when they are used incorrectly, but some commands do % complicated argument parsing or otherwise get confused, so we % undefine them. % % We can't do anything about stray @-signs, unfortunately; % they'll produce `undefined control sequence' errors. \ignoremorecommands % % Set the current font to be \nullfont, a TeX primitive, and define % all the font commands to also use \nullfont. We don't use % dummy.tfm, as suggested in the TeXbook, because not all sites % might have that installed. Therefore, math mode will still % produce output, but that should be an extremely small amount of % stuff compared to the main input. % \nullfont \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont \let\tensf=\nullfont % Similarly for index fonts. \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont \let\smallsf=\nullfont % Similarly for smallexample fonts. \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont \let\smallersf=\nullfont % % Don't complain when characters are missing from the fonts. \tracinglostchars = 0 % % Don't bother to do space factor calculations. \frenchspacing % % Don't report underfull hboxes. \hbadness = 10000 % % Do minimal line-breaking. \pretolerance = 10000 % % Do not execute instructions in @tex \def\tex{\doignore{tex}}% % Do not execute macro definitions. % `c' is a comment character, so the word `macro' will get cut off. \def\macro{\doignore{ma}}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. Make sure the catcode of space is correct to avoid % losing inside @example, for instance. % \def\set{\begingroup\catcode` =10 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. \parsearg\setxxx} \def\setxxx#1{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% \def\temp{#2}% \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. \fi \endgroup } % Can't use \xdef to pre-expand #2 and save some time, since \temp or % \next or other control sequences that we've defined might get us into % an infinite loop. Consider `@set foo @cite{bar}'. \def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} % @clear VAR clears (i.e., unsets) the variable VAR. % \def\clear{\parsearg\clearxxx} \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} % @value{foo} gets the text saved in variable foo. { \catcode`\_ = \active % % We might end up with active _ or - characters in the argument if % we're called from @code, as @code{@value{foo-bar_}}. So \let any % such active characters to their normal equivalents. \gdef\value{\begingroup \catcode`\-=12 \catcode`\_=12 \indexbreaks \let_\normalunderscore \valuexxx} } \def\valuexxx#1{\expandablevalue{#1}\endgroup} % We have this subroutine so that we can handle at least some @value's % properly in indexes (we \let\value to this in \indexdummies). Ones % whose names contain - or _ still won't work, but we can't do anything % about that. The command has to be fully expandable, since the result % winds up in the index file. This means that if the variable's value % contains other Texinfo commands, it's almost certain it will fail % (although perhaps we could fix that with sufficient work to do a % one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % \def\ifset{\parsearg\ifsetxxx} \def\ifsetxxx #1{% \expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifsetfail \else \expandafter\ifsetsucceed \fi } \def\ifsetsucceed{\conditionalsucceed{ifset}} \def\ifsetfail{\nestedignore{ifset}} \defineunmatchedend{ifset} % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % \def\ifclear{\parsearg\ifclearxxx} \def\ifclearxxx #1{% \expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifclearsucceed \else \expandafter\ifclearfail \fi } \def\ifclearsucceed{\conditionalsucceed{ifclear}} \def\ifclearfail{\nestedignore{ifclear}} \defineunmatchedend{ifclear} % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text % following, through the first @end iftex (etc.). Make `@end iftex' % (etc.) valid only after an @iftex. % \def\iftex{\conditionalsucceed{iftex}} \def\ifnothtml{\conditionalsucceed{ifnothtml}} \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} \defineunmatchedend{iftex} \defineunmatchedend{ifnothtml} \defineunmatchedend{ifnotinfo} % We can't just want to start a group at @iftex (for example) and end it % at @end iftex, since then @set commands inside the conditional have no % effect (they'd get reverted at the end of the group). So we must % define \Eiftex to redefine itself to be its previous value. (We can't % just define it to fail again with an ``unmatched end'' error, since % the @ifset might be nested.) % \def\conditionalsucceed#1{% \edef\temp{% % Remember the current value of \E#1. \let\nece{prevE#1} = \nece{E#1}% % % At the `@end #1', redefine \E#1 to be its previous value. \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% }% \temp } % We need to expand lots of \csname's, but we don't want to expand the % control sequences after we've constructed them. % \def\nece#1{\expandafter\noexpand\csname#1\endcsname} % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within \newindex. {\catcode`\@=11 \gdef\newwrite{\alloc@7\write\chardef\sixt@@n}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \undefined % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname\donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of texinfo commands likely to appear in an index entry. % (Must be a way to avoid doing expansion at all, and thus not have to % laboriously list every single command here.) % \def\indexdummies{% \def\ { }% \def\@{@}% change to @@ when we switch to @ as escape char in aux files. % Need these in case \tex is in effect and \{ is a \delimiter again. % But can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. \let\{ = \mylbrace \let\} = \myrbrace \def\_{{\realbackslash _}}% \normalturnoffactive % % Take care of the plain tex accent commands. \def\,##1{\realbackslash ,{##1}}% \def\"{\realbackslash "}% \def\`{\realbackslash `}% \def\'{\realbackslash '}% \def\^{\realbackslash ^}% \def\~{\realbackslash ~}% \def\={\realbackslash =}% \def\b{\realbackslash b}% \def\c{\realbackslash c}% \def\d{\realbackslash d}% \def\u{\realbackslash u}% \def\v{\realbackslash v}% \def\H{\realbackslash H}% \def\dotless##1{\realbackslash dotless {##1}}% % Take care of the plain tex special European modified letters. \def\AA{\realbackslash AA}% \def\AE{\realbackslash AE}% \def\L{\realbackslash L}% \def\OE{\realbackslash OE}% \def\O{\realbackslash O}% \def\aa{\realbackslash aa}% \def\ae{\realbackslash ae}% \def\l{\realbackslash l}% \def\oe{\realbackslash oe}% \def\o{\realbackslash o}% \def\ss{\realbackslash ss}% % % Although these internals commands shouldn't show up, sometimes they do. \def\bf{\realbackslash bf }% \def\gtr{\realbackslash gtr}% \def\hat{\realbackslash hat}% \def\less{\realbackslash less}% %\def\rm{\realbackslash rm }% \def\sf{\realbackslash sf}% \def\sl{\realbackslash sl }% \def\tclose##1{\realbackslash tclose {##1}}% \def\tt{\realbackslash tt}% % \def\b##1{\realbackslash b {##1}}% \def\i##1{\realbackslash i {##1}}% \def\sc##1{\realbackslash sc {##1}}% \def\t##1{\realbackslash t {##1}}% \def\r##1{\realbackslash r {##1}}% % \def\TeX{\realbackslash TeX}% \def\acronym##1{\realbackslash acronym {##1}}% \def\cite##1{\realbackslash cite {##1}}% \def\code##1{\realbackslash code {##1}}% \def\command##1{\realbackslash command {##1}}% \def\dfn##1{\realbackslash dfn {##1}}% \def\dots{\realbackslash dots }% \def\emph##1{\realbackslash emph {##1}}% \def\env##1{\realbackslash env {##1}}% \def\file##1{\realbackslash file {##1}}% \def\kbd##1{\realbackslash kbd {##1}}% \def\key##1{\realbackslash key {##1}}% \def\math##1{\realbackslash math {##1}}% \def\option##1{\realbackslash option {##1}}% \def\samp##1{\realbackslash samp {##1}}% \def\strong##1{\realbackslash strong {##1}}% \def\uref##1{\realbackslash uref {##1}}% \def\url##1{\realbackslash url {##1}}% \def\var##1{\realbackslash var {##1}}% \def\w{\realbackslash w }% % % These math commands don't seem likely to be used in index entries. \def\copyright{\realbackslash copyright}% \def\equiv{\realbackslash equiv}% \def\error{\realbackslash error}% \def\expansion{\realbackslash expansion}% \def\point{\realbackslash point}% \def\print{\realbackslash print}% \def\result{\realbackslash result}% % % Handle some cases of @value -- where the variable name does not % contain - or _, and the value does not contain any % (non-fully-expandable) commands. \let\value = \expandablevalue % \unsepspaces % Turn off macro expansion \turnoffmacros } % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\\leavevmode \penalty \@M \ ). {\obeyspaces \gdef\unsepspaces{\obeyspaces\let =\space}} % \indexnofonts no-ops all font-change commands. % This is used when outputting the strings to sort the index by. \def\indexdummyfont#1{#1} \def\indexdummytex{TeX} \def\indexdummydots{...} \def\indexnofonts{% \def\@{@}% % how to handle braces? \def\_{\normalunderscore}% % \let\,=\indexdummyfont \let\"=\indexdummyfont \let\`=\indexdummyfont \let\'=\indexdummyfont \let\^=\indexdummyfont \let\~=\indexdummyfont \let\==\indexdummyfont \let\b=\indexdummyfont \let\c=\indexdummyfont \let\d=\indexdummyfont \let\u=\indexdummyfont \let\v=\indexdummyfont \let\H=\indexdummyfont \let\dotless=\indexdummyfont % Take care of the plain tex special European modified letters. \def\AA{AA}% \def\AE{AE}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\aa{aa}% \def\ae{ae}% \def\l{l}% \def\oe{oe}% \def\o{o}% \def\ss{ss}% % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\indexdummyfont % \let\b=\indexdummyfont \let\i=\indexdummyfont \let\r=\indexdummyfont \let\sc=\indexdummyfont \let\t=\indexdummyfont % \let\TeX=\indexdummytex \let\acronym=\indexdummyfont \let\cite=\indexdummyfont \let\code=\indexdummyfont \let\command=\indexdummyfont \let\dfn=\indexdummyfont \let\dots=\indexdummydots \let\emph=\indexdummyfont \let\env=\indexdummyfont \let\file=\indexdummyfont \let\kbd=\indexdummyfont \let\key=\indexdummyfont \let\math=\indexdummyfont \let\option=\indexdummyfont \let\samp=\indexdummyfont \let\strong=\indexdummyfont \let\uref=\indexdummyfont \let\url=\indexdummyfont \let\var=\indexdummyfont \let\w=\indexdummyfont } % To define \realbackslash, we must make \ not be an escape. % We must first make another character (@) an escape % so we do not become unable to do a definition. {\catcode`\@=0 \catcode`\\=\other @gdef@realbackslash{\}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % For \ifx comparisons. \def\emptymacro{\empty} % Most index entries go through here, but \dosubind is the general case. % \def\doind#1#2{\dosubind{#1}{#2}\empty} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % \empty if called from \doind, as we usually are. The main exception % is with defuns, which call us directly. % \def\dosubind#1#2#3{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt #2}}% \fi {% \count255=\lastpenalty {% \indexdummies % Must do this here, since \bf, etc expand at this stage \escapechar=`\\ {% \let\folio = 0% We will expand all macros now EXCEPT \folio. \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % \def\thirdarg{#3}% % % If third arg is present, precede it with space in sort key. \ifx\thirdarg\emptymacro \let\subentry = \empty \else \def\subentry{ #3}% \fi % % First process the index entry with all font commands turned % off to get the string to sort by. {\indexnofonts \xdef\indexsorttmp{#2\subentry}}% % % Now the real index entry with the fonts. \toks0 = {#2}% % % If the third (subentry) arg is present, add it to the index % line to write. \ifx\thirdarg\emptymacro \else \toks0 = \expandafter{\the\toks0{#3}}% \fi % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\csname#1indfile\endcsname{% \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% }% % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write will make \lastskip zero. The result is that sequences % like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % \iflinks \ifvmode \skip0 = \lastskip \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi \fi % \temp % do the write % % \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi \fi }% }% \penalty\count255 }% } % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \def\printindex{\parsearg\doprintindex} \def\doprintindex#1{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \indexbreaks % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\rawbackslashxx}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \penalty -300 % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% \vskip .33\baselineskip plus .1\baselineskip % % Do our best not to break after the initial. \nobreak }} % This typesets a paragraph consisting of #1, dot leaders, and then #2 % flush to the right margin. It is used for index and table of contents % entries. The paragraph is indented by \leftskip. % \def\entry#1#2{\begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing columns. \vskip 0pt plus1pt % % Start a ``paragraph'' for the index entry so the line breaking % parameters we've set above will have an effect. \noindent % % Insert the text of the index entry. TeX will do line-breaking on it. #1% % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \def\tempa{{\rm }}% \def\tempb{#2}% \edef\tempc{\tempa}% \edef\tempd{\tempb}% \ifx\tempc\tempd\ \else% % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else \ #2% The page number ends the paragraph. \fi \fi% \par \endgroup} % Like \dotfill except takes at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % \def\appendixletter{\char\the\appendixno} % We do the following for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines this as the name of the chapter. % page headings and footings can use it. @section does likewise. \def\thischapter{} \def\thissection{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raise/lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % Choose a numbered-heading macro % #1 is heading level if unmodified by @raisesections or @lowersections % #2 is text for heading \def\numhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \chapterzzz{#2} \or \seczzz{#2} \or \numberedsubseczzz{#2} \or \numberedsubsubseczzz{#2} \else \ifnum \absseclevel<0 \chapterzzz{#2} \else \numberedsubsubseczzz{#2} \fi \fi } % like \numhead, but chooses appendix heading levels \def\apphead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \appendixzzz{#2} \or \appendixsectionzzz{#2} \or \appendixsubseczzz{#2} \or \appendixsubsubseczzz{#2} \else \ifnum \absseclevel<0 \appendixzzz{#2} \else \appendixsubsubseczzz{#2} \fi \fi } % like \numhead, but chooses numberless heading levels \def\unnmhead#1#2{\absseclevel=\secbase\advance\absseclevel by #1 \ifcase\absseclevel \unnumberedzzz{#2} \or \unnumberedseczzz{#2} \or \unnumberedsubseczzz{#2} \or \unnumberedsubsubseczzz{#2} \else \ifnum \absseclevel<0 \unnumberedzzz{#2} \else \unnumberedsubsubseczzz{#2} \fi \fi } % @chapter, @appendix, @unnumbered. \def\thischaptername{No Chapter Title} \outer\def\chapter{\parsearg\chapteryyy} \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% \chapmacro {#1}{\the\chapno}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% % We don't substitute the actual chapter name into \thischapter % because we don't want its macros evaluated now. \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% {\the\chapno}}}% \temp \donoderef \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\def\appendix{\parsearg\appendixyyy} \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz \def\appendixzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 \global\advance \appendixno by 1 \message{\putwordAppendix\space \appendixletter}% \chapmacro {#1}{\putwordAppendix{} \appendixletter}% \gdef\thissection{#1}% \gdef\thischaptername{#1}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}% {\appendixletter}}}% \temp \appendixnoderef \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\def\centerchap{\parsearg\centerchapyyy} \def\centerchapyyy #1{{\let\unnumbchapmacro=\centerchapmacro \unnumberedyyy{#1}}} % @top is like @unnumbered. \outer\def\top{\parsearg\unnumberedyyy} \outer\def\unnumbered{\parsearg\unnumberedyyy} \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz \def\unnumberedzzz #1{% \secno=0 \subsecno=0 \subsubsecno=0 % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}\message{(\the\toks0)}% % \unnumbchapmacro {#1}% \gdef\thischapter{#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}}}% \temp \unnumbnoderef \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % Sections. \outer\def\numberedsec{\parsearg\secyyy} \def\secyyy #1{\numhead1{#1}} % normally calls seczzz \def\seczzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% {\the\chapno}{\the\secno}}}% \temp \donoderef \nobreak } \outer\def\appendixsection{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy} \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz \def\appendixsectionzzz #1{% \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% {\appendixletter}{\the\secno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz \def\unnumberedseczzz #1{% \plainsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% \temp \unnumbnoderef \nobreak } % Subsections. \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz \def\numberedsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% {\the\chapno}{\the\secno}{\the\subsecno}}}% \temp \donoderef \nobreak } \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz \def\appendixsubseczzz #1{% \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% {\appendixletter}{\the\secno}{\the\subsecno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz \def\unnumberedsubseczzz #1{% \plainsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% {\the\toks0}}}% \temp \unnumbnoderef \nobreak } % Subsubsections. \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz \def\numberedsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \temp \donoderef \nobreak } \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz \def\appendixsubsubseczzz #1{% \gdef\thissection{#1}\global\advance \subsubsecno by 1 % \subsubsecheading {#1} {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \temp \appendixnoderef \nobreak } \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz \def\unnumberedsubsubseczzz #1{% \plainsubsubsecheading {#1}\gdef\thissection{#1}% \toks0 = {#1}% \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% {\the\toks0}}}% \temp \unnumbnoderef \nobreak } % These are variants which are not "outer", so they can appear in @ifinfo. % Actually, they should now be obsolete; ordinary section commands should work. \def\infotop{\parsearg\unnumberedzzz} \def\infounnumbered{\parsearg\unnumberedzzz} \def\infounnumberedsec{\parsearg\unnumberedseczzz} \def\infounnumberedsubsec{\parsearg\unnumberedsubseczzz} \def\infounnumberedsubsubsec{\parsearg\unnumberedsubsubseczzz} \def\infoappendix{\parsearg\appendixzzz} \def\infoappendixsec{\parsearg\appendixseczzz} \def\infoappendixsubsec{\parsearg\appendixsubseczzz} \def\infoappendixsubsubsec{\parsearg\appendixsubsubseczzz} \def\infochapter{\parsearg\chapterzzz} \def\infosection{\parsearg\sectionzzz} \def\infosubsection{\parsearg\subsectionzzz} \def\infosubsubsection{\parsearg\subsubsectionzzz} % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading % NOTE on use of \vbox for chapter headings, section headings, and such: % 1) We use \vbox rather than the earlier \line to permit % overlong headings to fold. % 2) \hyphenpenalty is set to 10000 because hyphenation in a % heading is obnoxious; this forbids it. % 3) Likewise, headings look best if no \parindent is used, and % if justification is not attempted. Hence \raggedright. \def\majorheading{\parsearg\majorheadingzzz} \def\majorheadingzzz #1{% {\advance\chapheadingskip by 10pt \chapbreak }% {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\penalty 200} \def\chapheading{\parsearg\chapheadingzzz} \def\chapheadingzzz #1{\chapbreak % {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\penalty 200} % @heading, @subheading, @subsubheading. \def\heading{\parsearg\plainsecheading} \def\subheading{\parsearg\plainsubsecheading} \def\subsubheading{\parsearg\plainsubsubsecheading} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. %%% Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} %%% Define plain chapter starts, and page on/off switching for it % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} \def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{ \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon \def\CHAPFplain{ \global\let\chapmacro=\chfplain \global\let\unnumbchapmacro=\unnchfplain \global\let\centerchapmacro=\centerchfplain} % Plain chapter opening. % #1 is the text, #2 the chapter number or empty if unnumbered. \def\chfplain#1#2{% \pchapsepmacro {% \chapfonts \rm \def\chapnum{#2}% \setbox0 = \hbox{#2\ifx\chapnum\empty\else\enspace\fi}% \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent = \wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % Plain opening for unnumbered. \def\unnchfplain#1{\chfplain{#1}{}} % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerchfplain#1{{% \def\centerparametersmaybe{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt }% \chfplain{#1}{}% }} \CHAPFplain % The default \def\unnchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt\raggedright \rm #1\hfill}}\bigskip \par\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 \parindent=0pt \hfill {\rm #1}\hfill}}\bigskip \par\nobreak } \def\CHAPFopen{ \global\let\chapmacro=\chfopen \global\let\unnumbchapmacro=\unnchfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip {-1000}} \def\secheading#1#2#3{\sectionheading{sec}{#2.#3}{#1}} \def\plainsecheading#1{\sectionheading{sec}{}{#1}} % Subsection titles. \newskip \subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip {-500}} \def\subsecheading#1#2#3#4{\sectionheading{subsec}{#2.#3.#4}{#1}} \def\plainsubsecheading#1{\sectionheading{subsec}{}{#1}} % Subsubsection titles. \let\subsubsecheadingskip = \subsecheadingskip \let\subsubsecheadingbreak = \subsecheadingbreak \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} % Print any size section title. % % #1 is the section type (sec/subsec/subsubsec), #2 is the section % number (maybe empty), #3 the text. \def\sectionheading#1#2#3{% {% \expandafter\advance\csname #1headingskip\endcsname by \parskip \csname #1headingbreak\endcsname }% {% % Switch to the right set of fonts. \csname #1fonts\endcsname \rm % % Only insert the separating space if we have a section number. \def\secnum{#2}% \setbox0 = \hbox{#2\ifx\secnum\empty\else\enspace\fi}% % \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent = \wd0 % zero if no section number \unhbox0 #3}% }% \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. We supply {\folio} at the end of the % argument, which will end up as the last argument to the \...entry macro. % % We open the .toc file here instead of at @setfilename or any other % given time so that @contents can be put in the document anywhere. % \newif\iftocfileopened \def\writetocentry#1{% \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi \iflinks \write\tocfile{#1{\folio}}\fi } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Finish up the main text and prepare to read what we've written % to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \unnumbchapmacro{#1}\def\thischapter{}% \savepageno = \pageno \begingroup % Set up to handle contents files properly. \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 % We can't do this, because then an actual ^ in a section % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97. %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \pageno = \lastnegativepageno \fi } % Normal (long) toc. \def\contents{% \startcontents{\putwordTOC}% \openin 1 \jobname.toc \ifeof 1 \else \closein 1 \input \jobname.toc \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \pdfmakeoutlines \endgroup \lastnegativepageno = \pageno \pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\chapentry = \shortchapentry \let\appendixentry = \shortappendixentry \let\unnumbchapentry = \shortunnumberedentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\secentry ##1##2##3##4{} \def\unnumbsecentry ##1##2{} \def\subsecentry ##1##2##3##4##5{} \def\unnumbsubsecentry ##1##2{} \def\subsubsecentry ##1##2##3##4##5##6{} \def\unnumbsubsubsecentry ##1##2{} \openin 1 \jobname.toc \ifeof 1 \else \closein 1 \input \jobname.toc \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \pageno = \savepageno } \let\shortcontents = \summarycontents \ifpdf \pdfcatalog{/PageMode /UseOutlines}% \fi % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Chapters, in the main contents. \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% } % Appendices, in the main contents. \def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}} % % Appendices, in the short toc. \let\shortappendixentry = \shortchapentry % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter. % We could simplify the code here by writing out an \appendixentry % command in the toc file for appendices, instead of using \chapentry % for both, but it doesn't seem worth it. % \newdimen\shortappendixwidth % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) \dimen0 = 1em \hbox to \dimen0{#1\hss}% } % Unnumbered chapters. \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} % Sections. \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} % Subsections. \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} % And subsubsections. \def\subsubsecentry#1#2#3#4#5#6{% \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} % This parameter controls the indentation of the various levels. \newdimen\tocindent \tocindent = 3pc % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % Final typesetting of a toc entry; we use the same \entry macro as for % the index entries, but we want to suppress hyphenation here. (We % can't do that in the \entry macro, since index entries might consist % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) \def\tocentry#1#2{\begingroup \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks % Do not use \turnoffactive in these arguments. Since the toc is % typeset in cmr, characters such as _ would come out wrong; we % have to do the usual translation tricks. \entry{#1}{#2}% \endgroup} % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \let\subsecentryfonts = \textfonts \let\subsubsecentryfonts = \textfonts \message{environments,} % @foo ... @end foo. % Since these characters are used in examples, it should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % Furthermore, these definitions must come after we define our fonts. \newbox\dblarrowbox \newbox\longdblarrowbox \newbox\pushcharbox \newbox\bullbox \newbox\equivbox \newbox\errorbox %{\tentt %\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil} %\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil} %\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil} %\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil} % Adapted from the manmac format (p.420 of TeXbook) %\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex % depth .1ex\hfil} %} % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. \def\point{$\star$} \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} % Adapted from the TeXbook's \boxit. {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} \global\setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{ \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % The @error{} command. \def\error{\leavevmode\lower.7ex\copy\errorbox} % @tex ... @end tex escapes into raw Tex temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain tex @ character. \def\tex{\begingroup \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie \catcode `\%=14 \catcode 43=12 % plus \catcode`\"=12 \catcode`\==12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \escapechar=`\\ % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\*=\ptexstar \let\t=\ptext % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% \let\Etex=\endgroup} % Define @lisp ... @endlisp. % @lisp does a \begingroup so it can rebind things, % including the definition of @endlisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % {\obeyspaces % \gdef\sepspaces{\obeyspaces\let =\tie}} % Define \obeyedspace to be our active space, whatever it is. This is % for use in \parsearg. {\sepspaces% \global\let\obeyedspace= } % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip % \def\aboveenvbreak{{% \ifnum\lastpenalty < 10000 \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip \penalty-50 \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \long\def\cartouche{% \begingroup \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt %we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing=\comment \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \hsize=\cartinner \kern3pt \begingroup \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \def\Ecartouche{% \endgroup \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \endgroup }} % This macro is called at the beginning of all the @example variants, % inside a group. \def\nonfillstart{% \aboveenvbreak \inENV % This group ends at the end of the body \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \singlespace \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt \parindent = 0pt \emergencystretch = 0pt % don't try to avoid overfull boxes % @cartouche defines \nonarrowing to inhibit narrowing % at next level down. \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \let\exdent=\nofillexdent \let\nonarrowing=\relax \fi } % Define the \E... control sequence only if we are inside the particular % environment, so the error checking in \end will work. % % To end an @example-like environment, we first end the paragraph (via % \afterenvbreak's vertical glue), and then the group. That way we keep % the zero \parskip that the environments set -- \parskip glue will be % inserted at the beginning of the next paragraph in the document, after % the environment. % \def\nonfillfinish{\afterenvbreak\endgroup} % @lisp: indented, narrowed, typewriter font. \def\lisp{\begingroup \nonfillstart \let\Elisp = \nonfillfinish \tt \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @example: Same as @lisp. \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} % @small... is usually equivalent to the non-small (@smallbook % redefines). We must call \example (or whatever) last in the % definition, since it reads the return following the @example (or % whatever) command. % % This actually allows (for example) @end display inside an % @smalldisplay. Too bad, but makeinfo will catch the error anyway. % \def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display} \def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp} \def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format} \def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp} % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. % Originally contributed by Pavel@xerox. \def\smalllispx{\begingroup \def\Esmalllisp{\nonfillfinish\endgroup}% \def\Esmallexample{\nonfillfinish\endgroup}% \smallexamplefonts \lisp } % @display: same as @lisp except keep current font. % \def\display{\begingroup \nonfillstart \let\Edisplay = \nonfillfinish \gobble } % % @smalldisplay (when @smallbook): @display plus smaller fonts. % \def\smalldisplayx{\begingroup \def\Esmalldisplay{\nonfillfinish\endgroup}% \smallexamplefonts \rm \display } % @format: same as @display except don't narrow margins. % \def\format{\begingroup \let\nonarrowing = t \nonfillstart \let\Eformat = \nonfillfinish \gobble } % % @smallformat (when @smallbook): @format plus smaller fonts. % \def\smallformatx{\begingroup \def\Esmallformat{\nonfillfinish\endgroup}% \smallexamplefonts \rm \format } % @flushleft (same as @format). % \def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} % @flushright. % \def\flushright{\begingroup \let\nonarrowing = t \nonfillstart \let\Eflushright = \nonfillfinish \advance\leftskip by 0pt plus 1fill \gobble } % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. % \def\quotation{% \begingroup\inENV %This group ends at the end of the @quotation body {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \singlespace \parindent=0pt % We have retained a nonzero parskip for the environment, since we're % doing normal filling. So to avoid extra space below the environment... \def\Equotation{\parskip = 0pt \nonfillfinish}% % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing \exdentamount = \lispnarrowing \let\nonarrowing = \relax \fi } % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p. 344; only we need to do '@' too \def\dospecials{% \do\ \do\\\do\@\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~} % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=12}\dospecials} % % [Knuth] pp. 380,381,391 % Disable Spanish ligatures ?` and !` of \tt font \begingroup \catcode`\`=\active\gdef`{\relax\lq} \endgroup % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \catcode`\`=\active \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % \def\starttabbox{\setbox0=\hbox\bgroup} \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen0=\wd0 % the width so far, or since the previous tab \divide\dimen0 by\tabw \multiply\dimen0 by\tabw % compute previous multiple of \tabw \advance\dimen0 by\tabw % advance to next multiple of \tabw \wd0=\dimen0 \box0 \starttabbox }% } \endgroup \def\setupverbatim{% % Easiest (and conventionally used) font for verbatim \tt \def\par{\leavevmode\egroup\box0\endgraf}% \catcode`\`=\active \tabexpand % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}' % % Inspired by LaTeX's verbatim command set [latex.ltx] %% Include LaTeX hack for completeness -- never know %% \begingroup %% \catcode`|=0 \catcode`[=1 %% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active %% \catcode`\\=12|gdef|doverbatim#1@end verbatim[ %% #1|endgroup|def|Everbatim[]|end[verbatim]] %% |endgroup \begingroup \catcode`\ =\active \gdef\doverbatim#1@end verbatim{#1\end{verbatim}} \endgroup % \def\verbatim{% \def\Everbatim{\nonfillfinish\endgroup}% \begingroup \nonfillstart \advance\leftskip by -\defbodyindent \begingroup\setupverbatim\doverbatim } % @verbatiminclude FILE - insert text of file in verbatim environment. % % Allow normal characters that we make active in the argument (a file name). \def\verbatiminclude{% \begingroup \catcode`\\=12 \catcode`~=12 \catcode`^=12 \catcode`_=12 \catcode`|=12 \catcode`<=12 \catcode`>=12 \catcode`+=12 \parsearg\doverbatiminclude } \def\setupverbatiminclude{% \begingroup \nonfillstart \advance\leftskip by -\defbodyindent \begingroup\setupverbatim } % \def\doverbatiminclude#1{% % Restore active chars for included file. \endgroup \begingroup \def\thisfile{#1}% \expandafter\expandafter\setupverbatiminclude\input\thisfile \endgroup\nonfillfinish\endgroup } \message{defuns,} % @defun etc. % Allow user to change definition object font (\df) internally \def\setdeffont #1 {\csname DEF#1\endcsname} \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deftypemargin \deftypemargin=12pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\parencount % define \functionparens, which makes ( and ) and & do special things. % \functionparens affects the group it is contained in. \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active \catcode`\[=\active \catcode`\]=\active} % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) {\activeparens % Now, smart parens don't turn on until &foo (see \amprm) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \gdef\functionparens{\boldbrax\let&=\amprm\parencount=0 } \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} % This is used to turn on special parens % but make & act ordinary (given that it's active). \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} % Definitions of (, ) and & used in args for functions. % This is the definition of ( outside of all parentheses. \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested \global\advance\parencount by 1 } % % This is the definition of ( when already inside a level of parens. \gdef\opnested{\char`\(\global\advance\parencount by 1 } % \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. % also in that case restore the outer-level definition of (. \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi \global\advance \parencount by -1 } % If we encounter &foo, then turn on ()-hacking afterwards \gdef\amprm#1 {{\rm\}\let(=\oprm \let)=\clrm\ } % \gdef\normalparens{\boldbrax\let&=\ampnr} } % End of definition inside \activeparens %% These parens (in \boldbrax) actually are a little bolder than the %% contained text. This is especially needed for [ and ] \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } \let\ampnr = \& \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} % Active &'s sneak into the index arguments, so make sure it's defined. { \catcode`& = 13 \global\let& = \ampnr } % First, defname, which formats the header line itself. % #1 should be the function name. % #2 should be the type of definition, such as "Function". \def\defname #1#2{% % Get the values of \leftskip and \rightskip as they were % outside the @def... \dimen2=\leftskip \advance\dimen2 by -\defbodyindent \noindent \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}% \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations \parshape 2 0in \dimen0 \defargsindent \dimen1 % Now output arg 2 ("Function" or some such) % ending at \deftypemargin from the right margin, % but stuck inside a box of width 0 so it does not interfere with linebreaking {% Adjust \hsize to exclude the ambient margins, % so that \rightline will obey them. \advance \hsize by -\dimen2 \rlap{\rightline{{\rm #2}\hskip -1.25pc }}}% % Make all lines underfull and no complaints: \tolerance=10000 \hbadness=10000 \advance\leftskip by -\defbodyindent \exdentamount=\defbodyindent {\df #1}\enskip % Generate function name } % Actually process the body of a definition % #1 should be the terminating control sequence, such as \Edefun. % #2 should be the "another name" control sequence, such as \defunx. % #3 should be the control sequence that actually processes the header, % such as \defunheader. \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\activeparens\spacesplit#3}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % 61 is `=' \obeylines\activeparens\spacesplit#3} % #1 is the \E... control sequence to end the definition (which we define). % #2 is the \...x control sequence for consecutive fns (which we define). % #3 is the control sequence to call to resume processing. % #4, delimited by the space, is the class name. % \def\defmethparsebody#1#2#3#4 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#4}}} % Used for @deftypemethod and @deftypeivar. % #1 is the \E... control sequence to end the definition (which we define). % #2 is the \...x control sequence for consecutive fns (which we define). % #3 is the control sequence to call to resume processing. % #4, delimited by a space, is the class name. % #5 is the method's return type. % \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV \medbreak \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} % Used for @deftypeop. The change from \deftypemethparsebody is an % extra argument at the beginning which is the `category', instead of it % being the hardwired string `Method' or `Instance Variable'. We have % to account for this both in the \...x definition and in parsing the % input at hand. Thus also need a control sequence (passed as #5) for % the \E... definition to assign the category name to. % \def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV \medbreak \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 ##3 {% \def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}} \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\activeparens\spacesplit{#3{#5}}} % These parsing functions are similar to the preceding ones % except that they do not make parens into active characters. % These are used for "variables" since they have no arguments. \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2{\begingroup\obeylines\spacesplit#3}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup % \catcode 61=\active % \obeylines\spacesplit#3} % This is used for \def{tp,vr}parsebody. It could probably be used for % some of the others, too, with some judicious conditionals. % \def\parsebodycommon#1#2#3{% \begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines } \def\defvrparsebody#1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% \spacesplit{#3{#4}}% } % This loses on `@deftp {Data Type} {struct termios}' -- it thinks the % type is just `struct', because we lose the braces in `{struct % termios}' when \spacesplit reads its undelimited argument. Sigh. % \let\deftpparsebody=\defvrparsebody % % So, to get around this, we put \empty in with the type name. That % way, TeX won't find exactly `{...}' as an undelimited argument, and % won't strip off the braces. % \def\deftpparsebody #1#2#3#4 {% \parsebodycommon{#1}{#2}{#3}% \spacesplit{\parsetpheaderline{#3{#4}}}\empty } % Fine, but then we have to eventually remove the \empty *and* the % braces (if any). That's what this does. % \def\removeemptybraces\empty#1\relax{#1} % After \spacesplit has done its work, this is called -- #1 is the final % thing to call, #2 the type name (which starts with \empty), and #3 % (which might be empty) the arguments. % \def\parsetpheaderline#1#2#3{% #1{\removeemptybraces#2\relax}{#3}% }% \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % \medbreak % % Define the end token that this defining construct specifies % so that it will exit this group. \def#1{\endgraf\endgroup\medbreak}% \def#2##1 ##2 {\def#4{##1}% \begingroup\obeylines\spacesplit{#3{##2}}}% \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent \begingroup\obeylines\spacesplit{#3{#5}}} % Split up #2 at the first space token. % call #1 with two arguments: % the first is all of #2 before the space token, % the second is all of #2 after that space token. % If #2 contains no space token, all of it is passed as the first arg % and the second is passed as empty. {\obeylines \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}% \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{% \ifx\relax #3% #1{#2}{}\else #1{#2}{#3#4}\fi}} % So much for the things common to all kinds of definitions. % Define @defun. % First, define the processing that is wanted for arguments of \defun % Use this to expand the args and terminate the paragraph they make up \def\defunargs#1{\functionparens \sl % Expand, preventing hyphenation at `-' chars. % Note that groups don't affect changes in \hyphenchar. % Set the font temporarily and use \font in case \setfont made \tensl a macro. {\tensl\hyphenchar\font=0}% #1% {\tensl\hyphenchar\font=45}% \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil \endgraf\nobreak\vskip -\parskip\nobreak } \def\deftypefunargs #1{% % Expand, preventing hyphenation at `-' chars. % Note that groups don't affect changes in \hyphenchar. % Use \boldbraxnoamp, not \functionparens, so that & is not special. \boldbraxnoamp \tclose{#1}% avoid \code because of side effects on active chars \interlinepenalty=10000 \advance\rightskip by 0pt plus 1fil \endgraf\nobreak\vskip -\parskip\nobreak } % Do complete processing of one @defun or @defunx line already parsed. % @deffn Command forward-char nchars \def\deffn{\defmethparsebody\Edeffn\deffnx\deffnheader} \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defun == @deffn Function \def\defun{\defparsebody\Edefun\defunx\defunheader} \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{\putwordDeffunc}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @deftypefun int foobar (int @var{foo}, float @var{bar}) \def\deftypefun{\defparsebody\Edeftypefun\deftypefunx\deftypefunheader} % #1 is the data type. #2 is the name and args. \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} % #1 is the data type, #2 the name, #3 the args. \def\deftypefunheaderx #1#2 #3\relax{% \doind {fn}{\code{#2}}% Make entry in function index \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% \deftypefunargs {#3}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} % \defheaderxcond#1\relax$.$ % puts #1 in @code, followed by a space, but does nothing if #1 is null. \def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi} % #1 is the classification. #2 is the data type. #3 is the name and args. \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} % #1 is the classification, #2 the data type, #3 the name, #4 the args. \def\deftypefnheaderx #1#2#3 #4\relax{% \doind {fn}{\code{#3}}% Make entry in function index \begingroup \normalparens % notably, turn off `&' magic, which prevents % at least some C++ text from working \defname {\defheaderxcond#2\relax$.$#3}{#1}% \deftypefunargs {#4}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defmac == @deffn Macro \def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{\putwordDefmac}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defspec == @deffn Special Form \def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \begingroup\defname {#1}{\putwordDefspec}% \defunargs {#2}\endgroup % \catcode 61=\other % Turn off change made in \defparsebody } % @defop CATEGORY CLASS OPERATION ARG... % \def\defop #1 {\def\defoptype{#1}% \defopparsebody\Edefop\defopx\defopheader\defoptype} % \def\defopheader#1#2#3{% \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index \begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% \defunargs {#3}\endgroup % } % @deftypeop CATEGORY CLASS TYPE OPERATION ARG... % \def\deftypeop #1 {\def\deftypeopcategory{#1}% \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader \deftypeopcategory} % % #1 is the class name, #2 the data type, #3 the operation name, #4 the args. \def\deftypeopheader#1#2#3#4{% \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{\defheaderxcond#2\relax$.$#3} {\deftypeopcategory\ \putwordon\ \code{#1}}% \deftypefunargs{#4}% \endgroup } % @deftypemethod CLASS TYPE METHOD ARG... % \def\deftypemethod{% \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} % % #1 is the class name, #2 the data type, #3 the method name, #4 the args. \def\deftypemethodheader#1#2#3#4{% \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}% \deftypefunargs{#4}% \endgroup } % @deftypeivar CLASS TYPE VARNAME % \def\deftypeivar{% \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} % % #1 is the class name, #2 the data type, #3 the variable name. \def\deftypeivarheader#1#2#3{% \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index \begingroup \defname{\defheaderxcond#2\relax$.$#3} {\putwordInstanceVariableof\ \code{#1}}% \defvarargs{#3}% \endgroup } % @defmethod == @defop Method % \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} % % #1 is the class name, #2 the method name, #3 the args. \def\defmethodheader#1#2#3{% \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% entry in function index \begingroup \defname{#2}{\putwordMethodon\ \code{#1}}% \defunargs{#3}% \endgroup } % @defcv {Class Option} foo-class foo-flag \def\defcv #1 {\def\defcvtype{#1}% \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} \def\defcvarheader #1#2#3{% \dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index \begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% \defvarargs {#3}\endgroup % } % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME % \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} % \def\defivarheader#1#2#3{% \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index \begingroup \defname{#2}{\putwordInstanceVariableof\ #1}% \defvarargs{#3}% \endgroup } % @defvar % First, define the processing that is wanted for arguments of @defvar. % This is actually simple: just print them in roman. % This must expand the args and terminate the paragraph they make up \def\defvarargs #1{\normalparens #1% \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak} % @defvr Counter foo-count \def\defvr{\defvrparsebody\Edefvr\defvrx\defvrheader} \def\defvrheader #1#2#3{\doind {vr}{\code{#2}}% \begingroup\defname {#2}{#1}\defvarargs{#3}\endgroup} % @defvar == @defvr Variable \def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} \def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index \begingroup\defname {#1}{\putwordDefvar}% \defvarargs {#2}\endgroup % } % @defopt == @defvr {User Option} \def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} \def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index \begingroup\defname {#1}{\putwordDefopt}% \defvarargs {#2}\endgroup % } % @deftypevar int foobar \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} % #1 is the data type. #2 is the name, perhaps followed by text that % is actually part of the data type, which should not be put into the index. \def\deftypevarheader #1#2{% \dovarind#2 \relax% Make entry in variables index \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak \endgroup} \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} % @deftypevr {Global Flag} int enable \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} \def\deftypevrheader #1#2#3{\dovarind#3 \relax% \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} \interlinepenalty=10000 \endgraf\nobreak\vskip -\parskip\nobreak \endgroup} % Now define @deftp % Args are printed in bold, a slight difference from @defvar. \def\deftpargs #1{\bf \defvarargs{#1}} % @deftp Class window height width ... \def\deftp{\deftpparsebody\Edeftp\deftpx\deftpheader} \def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% \begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} % These definitions are used if you use @defunx (etc.) % anywhere other than immediately after a @defun or @defunx. % \def\defcvx#1 {\errmessage{@defcvx in invalid context}} \def\deffnx#1 {\errmessage{@deffnx in invalid context}} \def\defivarx#1 {\errmessage{@defivarx in invalid context}} \def\defmacx#1 {\errmessage{@defmacx in invalid context}} \def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} \def\defoptx #1 {\errmessage{@defoptx in invalid context}} \def\defopx#1 {\errmessage{@defopx in invalid context}} \def\defspecx#1 {\errmessage{@defspecx in invalid context}} \def\deftpx#1 {\errmessage{@deftpx in invalid context}} \def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} \def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} \def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} \def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} \def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} \def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} \def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} \def\defunx#1 {\errmessage{@defunx in invalid context}} \def\defvarx#1 {\errmessage{@defvarx in invalid context}} \def\defvrx#1 {\errmessage{@defvrx in invalid context}} \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\undefined \newwrite\macscribble \def\scanmacro#1{% \begingroup \newlinechar`\^^M % Undo catcode changes of \startcontents and \doprintindex \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ % Append \endinput to make sure that TeX does not see the ending newline. \toks0={#1\endinput}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \let\xeatspaces\eatspaces \input \jobname.tmp \endgroup } \else \def\scanmacro#1{% \begingroup \newlinechar`\^^M % Undo catcode changes of \startcontents and \doprintindex \catcode`\@=0 \catcode`\\=12 \escapechar=`\@ \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} \fi \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? \def\macrolist{} % List of all defined macros in the form % \do\macro1\do\macro2... % Utility routines. % Thisdoes \let #1 = #2, except with \csnames. \def\cslet#1#2{% \expandafter\expandafter \expandafter\let \expandafter\expandafter \csname#1\endcsname \csname#2\endcsname} % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=12\catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \. % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. \def\macrobodyctxt{% \catcode`\~=12 \catcode`\^=12 \catcode`\_=12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \catcode`\+=12 \catcode`\{=12 \catcode`\}=12 \catcode`\@=12 \catcode`\^^M=12 \usembodybackslash} \def\macroargctxt{% \catcode`\~=12 \catcode`\^=12 \catcode`\_=12 \catcode`\|=12 \catcode`\<=12 \catcode`\>=12 \catcode`\+=12 \catcode`\@=12 \catcode`\\=12} % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0% \else \expandafter\parsemargdef \argl;% \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{The name \the\macname\space is reserved}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% % Add the macroname to \macrolist \toks0 = \expandafter{\macrolist\do}% \xdef\macrolist{\the\toks0 \expandafter\noexpand\csname\the\macname\endcsname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \def\unmacro{\parsearg\unmacroxxx} \def\unmacroxxx#1{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist \begingroup \edef\tempa{\expandafter\noexpand\csname#1\endcsname}% \def\do##1{% \def\tempb{##1}% \ifx\tempa\tempb % remove this \else \toks0 = \expandafter{\newmacrolist\do}% \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}% \fi}% \def\newmacrolist{}% % Execute macro list to define \newmacrolist \macrolist \global\let\macrolist\newmacrolist \endgroup \else \errmessage{Macro #1 not defined}% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname #1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.blah for each blah % in the params list, to be ##N where N is the position in that list. % That gets used by \mbodybackslash (above). % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. \def\parsemargdef#1;{\paramno=0\def\paramlist{}% \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1% \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% % This defines the macro itself. There are six cases: recursive and % nonrecursive macros of zero, one, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % many \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \fi \fi} \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg) \def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \next} % We mant to disable all macros during \shipout so that they are not % expanded by \write. \def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% \edef\next{\macrolist}\expandafter\endgroup\next} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Just make them active and then expand them all to nothing. \def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{\ignoreactivespaces \edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% \expandafter\noexpand\csname#2\endcsname}% \expandafter\endgroup\next} \message{cross references,} % @xref etc. \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's job is to define \lastnode. \def\node{\ENVcheck\parsearg\nodezzz} \def\nodezzz#1{\nodexxx [#1,]} \def\nodexxx[#1,#2]{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\relax % The sectioning commands (@chapter, etc.) call these. \def\donoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}% {Ysectionnumberandtype}% \global\let\lastnode=\relax \fi } \def\unnumbnoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}{Ynothing}% \global\let\lastnode=\relax \fi } \def\appendixnoderef{% \ifx\lastnode\relax\else \expandafter\expandafter\expandafter\setref{\lastnode}% {Yappendixletterandtype}% \global\let\lastnode=\relax \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister \gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME, namely % NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have % to set \indexdummies so commands such as @code in a section title % aren't expanded. It would be nicer not to expand the titles in the % first place, but there's so many layers that that is hard to do. % \def\setref#1#2{{% \indexdummies \pdfmkdest{#1}% \dosetq{#1-title}{Ytitle}% \dosetq{#1-pg}{Ypagenumber}% \dosetq{#1-snt}{#2}% }} % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces \def\printedmanual{\ignorespaces #5}% \def\printednodename{\ignorespaces #3}% \setbox1=\hbox{\printedmanual}% \setbox0=\hbox{\printednodename}% \ifdim \wd0 = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax % Use the node name inside the square brackets. \def\printednodename{\ignorespaces #1}% \else % Use the actual chapter/section title appear inside % the square brackets. Use the real section title if we have it. \ifdim \wd1 > 0pt % It is in another manual, so we don't have it. \def\printednodename{\ignorespaces #1}% \else \ifhavexrefs % We know the real title if we have the xref values. \def\printednodename{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printednodename{\ignorespaces #1}% \fi% \fi \fi \fi % % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not % insert empty discretionaries after hyphens, which means that it will % not find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, this % is a loss. Therefore, we give the text of the node name again, so it % is as if TeX is seeing it for the first time. \ifpdf \leavevmode \getfilename{#4}% {\normalturnoffactive \ifnum\filenamelength>0 \startlink attr{/Border [0 0 0]}% goto file{\the\filename.pdf} name{#1}% \else \startlink attr{/Border [0 0 0]}% goto name{#1}% \fi }% \linkcolor \fi % \ifdim \wd1 > 0pt \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% \else % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\normalturnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % [mynode], [\printednodename],\space % page 3 \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi \endlink \endgroup} % \dosetq is the interface for calls from other macros % Use \normalturnoffactive so that punctuation chars such as underscore % and backslash work in node names. (\turnoffactive doesn't do \.) \def\dosetq#1#2{% {\let\folio=0% \normalturnoffactive \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% \iflinks \next \fi }% } % \internalsetq {foo}{page} expands into % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} % When the aux file is read, ' is the escape character \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}} % Things to be expanded by \internalsetq \def\Ypagenumber{\folio} \def\Ytitle{\thissection} \def\Ynothing{} \def\Ysectionnumberandtype{% \ifnum\secno=0 \putwordChapter\xreftie\the\chapno % \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % \else \ifnum \subsubsecno=0 % \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % \else % \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % \fi \fi \fi } \def\Yappendixletterandtype{% \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% \else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % \else \ifnum \subsubsecno=0 % \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % \else % \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % \fi \fi \fi } \gdef\xreftie{'tie} % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Non-3.0. \else \def\linenumber{\the\inputlineno:\space} \fi % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. \def\refx#1#2{% \expandafter\ifx\csname X#1\endcsname\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs \message{\linenumber Undefined cross reference `#1'.}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \csname X#1\endcsname \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. % \def\xrdef#1{\begingroup % Reenable \ as an escape while reading the second argument. \catcode`\\ = 0 \afterassignment\endgroup \expandafter\gdef\csname X#1\endcsname } % Read the last existing aux file, if any. No error if none exists. \def\readauxfile{\begingroup \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other \catcode`\@=\other \catcode`\^=\other % It was suggested to define this as 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % Make the characters 128-255 be printing characters {% \count 1=128 \def\loop{% \catcode\count 1=\other \advance\count 1 by 1 \ifnum \count 1<256 \loop \fi }% }% % The aux file uses ' as the escape (for now). % Turn off \ as an escape so we do not lose on % entries which were dumped with control sequences in their names. % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ % Reference to such entries still does not work the way one would wish, % but at least they do not bomb out when the aux file is read in. \catcode`\{=1 \catcode`\}=2 \catcode`\%=\other \catcode`\'=0 \catcode`\\=\other % \openin 1 \jobname.aux \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue \global\warnedobstrue \fi % Open the new aux file. TeX will close it automatically at exit. \openout\auxfile=\jobname.aux \endgroup} % Footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for info output only. \let\footnotestyle=\comment \let\ptexfootnote=\footnote {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \footnotezzz }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset and anything else that uses % \parseargline fail inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \long\gdef\footnotezzz{\insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut \futurelet\next\fo@t } \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t \else\let\next\f@t\fi \next} \def\f@@t{\bgroup\aftergroup\@foot\let\next} \def\f@t#1{#1\@foot} \def\@foot{\strut\par\egroup} }%end \catcode `\@=11 % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt} % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else \closein 1 % Do not bother showing banner with post-v2.7 epsf.tex (available in % doc/epsf.tex until it shows up on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\undefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing this stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \nobreak\bigskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \line\bgroup\hss \fi % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \hss \egroup \bigbreak \fi % space after the image \endgroup} \message{localization,} % and i18n. % @documentlanguage is usually given very early, just after % @setfilename. If done too late, it may not override everything % properly. Single argument is the language abbreviation. % It would be nice if we could set up a hyphenation file here. % \def\documentlanguage{\parsearg\dodocumentlanguage} \def\dodocumentlanguage#1{% \tex % read txi-??.tex file in plain TeX. % Read the file if it exists. \openin 1 txi-#1.tex \ifeof1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \let\temp = \relax \else \def\temp{\input txi-#1.tex }% \fi \temp \endgroup } \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? In the current directory should work if nowhere else does.} % @documentencoding should change something in TeX eventually, most % likely, but for now just recognize it. \let\documentencoding = \comment % Page size parameters. % \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be so finicky about underfull hboxes, either. \hbadness = 2000 % Following George Bush, just get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; % 4) hoffset; 5) binding offset; 6) topskip. We also call % \setleading{\textleading}, so the caller should define \textleading. % The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % Use `small' versions. % \def\smallenvironments{% \let\smalldisplay = \smalldisplayx \let\smallexample = \smalllispx \let\smallformat = \smallformatx \let\smalllisp = \smalllispx } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% }} % Use @smallbook to reset parameters for 7x9.5 (or so) format. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \deftypemargin = 0pt \defbodyindent = .5cm \smallenvironments }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 12pt % \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% % \tolerance = 700 \hfuzz = 1pt }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0mm \deftypemargin = 0pt \defbodyindent = 2mm \tableindent = 12mm % \smallenvironments }} % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin % 29mm, hence bottom margin 28mm, nominal side margin 3cm. \def\afourlatex{{\globaldefs = 1 \textleading = 13.6pt % \afourpaper \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% % % Must explicitly reset to 0 because we call \afourpaper, apparently, % although this does not entirely make sense. \globaldefs = 0 }} % Use @afourwide to print on European A4 paper in wide format. \def\afourwide{% \afourpaper \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% } % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \def\pagesizes{\parsearg\pagesizesxxx} \def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \catcode`\~=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\+=\other \catcode`\$=\other \def\normaldoublequote{"} \def\normaltilde{~} \def\normalcaret{^} \def\normalunderscore{_} \def\normalverticalbar{|} \def\normalless{<} \def\normalgreater{>} \def\normalplus{+} \def\normaldollar{$}%$ font-lock fix % This macro is used to make a character print one way in ttfont % where it can probably just be output, and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} % Subroutine for the previous macro. \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix %\catcode 27=\active %\def^^[{$\diamondsuit$} % Set up an active definition for =, but don't enable it most of the time. {\catcode`\==\active \global\def={{\tt \char 61}}} \catcode`+=\active \catcode`\_=\active % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} \catcode`\@=0 % \rawbackslashxx output one backslash character in current font \global\chardef\rawbackslashxx=`\\ %{\catcode`\\=\other %@gdef@rawbackslashxx{\}} % \rawbackslash redefines \ as input to do \rawbackslashxx. {\catcode`\\=\active @gdef@rawbackslash{@let\=@rawbackslashxx }} % \normalbackslash outputs one backslash in fixed width font. \def\normalbackslash{{\tt\rawbackslashxx}} % \catcode 17=0 % Define control-q \catcode`\\=\active % Used sometimes to turn off (effectively) the active characters % even after parsing them. @def@turnoffactive{@let"=@normaldoublequote @let\=@realbackslash @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus @let$=@normaldollar}%$ font-lock fix @def@normalturnoffactive{@let"=@normaldoublequote @let\=@normalbackslash @let~=@normaltilde @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let<=@normalless @let>=@normalgreater @let+=@normalplus @let$=@normaldollar}%$ font-lock fix % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\{ in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also back turn on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These look ok in all fonts, so just make them not special. @catcode`@& = @other @catcode`@# = @other @catcode`@% = @other @c Set initial fonts. @textfonts @rm @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: heroes-0.21/tools/Makefile.inc0000644004117000411500000000177007401253126011755 ## -*- Makefile -*- ## Copyright 2001 Alexandre Duret-Lutz ## ## This file is part of Heroes. ## ## Heroes is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License version 2 as published by ## the Free Software Foundation. ## ## Heroes 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 ## EXTRA_DIST += tools/README \ tools/alpha.sh \ tools/autogen.sh \ tools/cvsboot.sh \ tools/exnews.pl \ tools/fetish-sync.sh \ tools/genm4mam.sh \ tools/genpotfiles.sh \ tools/readme.sed \ tools/upgettext.sh heroes-0.21/tools/alpha.sh0000755004117000411500000000250407340735547011203 #!/bin/sh -ex HTDOCS_DIR=/home/groups/h/he/heroes/htdocs WHO='Alexandre Duret-Lutz' EMAIL='duret_g@epita.fr' WHOCL="$WHO <$EMAIL>" # package name and version eval `autoconf --trace 'AC_INIT:VERSION=$2;PACKAGE=$1'` VERSION_=`echo $VERSION | tr . _` PACKAGEUP=`echo ${PACKAGE}_ALPHA | tr 'a-z-' 'A-Z_'` # make distribution make distcheck make dist-bzip2 # commit it, tag it clcommit cvs tag ${PACKAGE}_${VERSION_} # upload it scp $PACKAGE-$VERSION.tar.gz $PACKAGE-$VERSION.tar.bz2 shell.sf.net:$HTDOCS_DIR/dl/prereleases # Prepare announce mail. cat > mailtxt <> mailtxt cat >> mailtxt < ChangeLog.head < ChangeLog rm ChangeLog.head clcommit ) ssh shell.sf.net "cd $HTDOCS_DIR; cvs up; make -k; true" # Mail announcement. mail -s "$PACKAGE $VERSION uploaded" heroes-discuss@lists.sourceforge.net < mailtxt rm mailtxt heroes-0.21/tools/autogen.sh0000755004117000411500000000454107364271362011557 #! /bin/sh # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA verb=':' moreverb='' usage () { echo "Usage: autogen.sh [-h] [-v] [-V]" } die () { echo ${1+"$@"} exit 1 } saferun () { $verb $@ $@ || die "*** Error '${1+\"$@\"}' exited with bad status." } generate () { test -f configure.ac || test -f configure.in || die "Cannot find configure.in in current directory (`pwd`)." if test -f Makefile.am; then # use the same aclocal flags as in Makefile.am, if specified aclocalflags=`sed -n -e '/ACLOCAL_AMFLAGS/{s/.*=\(.*\)$/\1/ p }' Makefile.am` fi # generate aclocal.m4 saferun aclocal $aclocalflags ${moreverb} # generate configure saferun autoconf ${moreverb} if grep AC_CONFIG_HEADER configure.* >/dev/null 2>/dev/null; then # generate src/config.h.in saferun autoheader ${moreverb} fi # generate **/Makefile.in and add mssing files # Use --force-missing, or it's possible that we'll use # some obsolete files (for instance if the Automake location # changer and the symlink still point to the old). saferun automake --force-missing --add-missing ${moreverb} } while test $# -gt 0 ; do case "${1}" in -h | --h*) usage exit 0 ;; -v | --v*) verb='echo' shift ;; -V | --V*) verb='echo' moreverb='--verbose' shift ;; *) usage exit 1;; esac done targets=`find . \( -name 'configure.ac' -o -name 'configure.in' \) -print` test -n "$targets" || die "Cannot find any configure.in or configure.ac." set $targets for i; do dir=`expr "x$i" : 'x\(.*\)/[^/]*' \| '.' : '.'` test $# -gt 1 && echo "=== configuring '$dir' ===" (cd $dir && generate) done heroes-0.21/tools/cvsboot.sh0000755004117000411500000000243407275441712011572 #! /bin/sh # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA verb=':' opts='' usage () { echo "Usage: cvsboot.sh [-h] [-v] [-V]" } die () { echo ${1+"$@"} exit 1 } saferun () { $verb $@ $@ || die "*** Error '${1+\"$@\"}' exited with bad status." } opts="$@" while test $# -gt 0 ; do case "${1}" in -h | --h*) usage exit 0 ;; -v | --v* | -V | --V*) verb='echo' shift ;; *) usage exit 1;; esac done saferun tools/upgettext.sh $opts saferun tools/genpotfiles.sh $opts saferun tools/genm4mam.sh $opts saferun tools/autogen.sh $opts heroes-0.21/tools/exnews.pl0000644004117000411500000000016207327235463011420 #!/usr/bin/perl while (<>) { if (/^\w/) { print; while (<>) { exit if (/^\w/); print; } } } heroes-0.21/tools/fetish-sync.sh0000755004117000411500000000475107353601453012350 #! /bin/sh # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # This script is used to synchronize (i.e. just copy, presently) various # files from the lib/, m4/, and intl/ directories with the latest # fetish release (fetish = textutils | fileutils | shellutils). # These files come from various sources, but since Jim Meyering does # the painful job to track all changes and keep the files up to date it # would be overkill to maintain them separately. Let's upgrade our # files whenever a new fetish is released. files=' lib/alloca.c lib/basename.c lib/dirname.c lib/dirname.h lib/error.c lib/error.h lib/ftruncate.c lib/getopt.c lib/getopt1.c lib/getopt.h:lib/gnugetopt.h lib/hash.c lib/hash.h lib/isdir.c lib/malloc.c lib/realloc.c lib/stpcpy.c lib/strcasecmp.c lib/stripslash.c lib/strndup.c lib/xalloc.h lib/xmalloc.c lib/xstrdup.c m4/dos.m4 m4/ftruncate.m4 m4/glibc21.m4 m4/gnu-source.m4 m4/lcmessage.m4 m4/malloc.m4 m4/progtest.m4 m4/realloc.m4 m4/strerror_r.m4' check_syntax () { if test -z $1; then echo "fetish-sync.sh [-f] FETISHDIR [DESTDIR]" exit 1 fi } check_syntax "$@" if test "$1" = "-f"; then force=: shift check_syntax "$@" else force=false fi if test -d $1/lib; then fetsrc="$1" elif test -d $1/../lib; then fetsrc="$1/.." else echo "can't find $1/lib" exit 2 fi if test -z $2; then topsrc='.' else topsrc="$2" fi if test -d $topsrc/lib; then : elif test -d $topsrc/../lib; then $topsrc="$topsrc/.." else echo "can't find $topsrc/lib" exit 3 fi for f in $files; do case $f in *:*) dest=`echo $f | cut -d: -f2` src=`echo $f | cut -d: -f1` ;; *) dest=$f src=$f ;; esac dest=$topsrc/$dest src=$fetsrc/$src if $force || test ! -f $dest || (cmp $src $dest; test $? = 1); then echo "$src -> $dest" cp $src $dest fi done heroes-0.21/tools/genm4mam.sh0000755004117000411500000000224507323014107011604 #! /bin/sh # Copyright 2000 Alexandre Duret-Lutz # # This file is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # This file is called `genm4mam.sh' because it used to # generate `m4/Makefile.am'. But it now generate `m4/Makefile.inc'. set -e mam='m4/Makefile.tmp' mamreal='m4/Makefile.inc' rm -f "$mam" echo '## This file was generated by tools/genm4mam.sh' > "$mam" echo "## on `date`" >> "$mam" echo "EXTRA_DIST += m4/README \\" >> "$mam" echo m4/*.m4 | sed 's/ / \\@/g' | tr '@' '\n' >> "$mam" rm -f $mamreal mv $mam $mamreal heroes-0.21/tools/genpotfiles.sh0000755004117000411500000000170707340735057012435 #! /bin/sh # Copyright 2000 Alexandre Duret-Lutz # # This file is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA pf=po/POTFILES.in rm -f $pf echo '# This file was generated by tools/genpotfiles.sh' > $pf echo "# on `date`" >> $pf egrep -l '_\(|N_\(' {lib,src{,/media{,/*}}}/*.{c,h,gperf} >> $pf 2> /dev/null trueheroes-0.21/tools/readme.sed0000644004117000411500000000310407352634264011503 1 { i\ \ .---------------------------------------------------------------------.\ \ | The following information has been extracted automatically from the |\ \ | Texinfo documentation to help you install Heroes. You should read |\ \ | the full manual for more complete documentation. |\ \ `---------------------------------------------------------------------'\ \ Summary\ *******\ \ * Overview of Heroes\ - License\ - Getting Heroes\ - Reporting bugs, sending suggestions or contributions\ \ * Installation of Heroes\ - Needed Libraries\ - configure generic instructions\ - configure options for Heroes\ - Building a relocatable package\ - Machines\ } /^Getting Heroes/ { i\ License\ =======\ \ The full game (that is: source code, pictures, sound-tracks, and levels)\ is distributed under the terms of the GNU General Public License version 2.\ See the file COPYING for details.\ } /^Overview of Heroes/,/^Mailing lists/ { /^Mailing lists/d p } /^Installation of Heroes/ { i\ Reporting bugs, sending suggestions or contributions\ ====================================================\ \ We welcome bug reports or suggestions for Heroes (both program or\ documentation). Please email them to \ or . Please, see the Texinfo\ documentation of Heroes for guidelines regarding bug reporting.\ } /^Installation of Heroes/,/^Running Heroes/ { /^Running Heroes/d s/To be filled./Read the file INSTALL if you are not familiar with configure scripts./ p } heroes-0.21/tools/upgettext.sh0000755004117000411500000000451207327571501012141 #! /bin/sh # Copyright 2001 Alexandre Duret-Lutz # # This file is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA verb=':' moreverb='' usage () { echo "Usage: upgettext.sh [-h] [-v] [-f]" } die () { echo ${1+"$@"} exit 1 } saferun () { $verb $@ $@ || die "*** Error '${1+\"$@\"}' exited with bad status." } checkversion () { # We need a recent gettext (one that offer ngettext, and compile # fine on Win32 platforms). 0.10.38 is the minimal version. major=`gettext --version | sed -n 's/[^0-9]*\([0-9]*\)\.[0-9]*\.[0-9]*/\1/p'` minor=`gettext --version | sed -n 's/[^0-9]*[0-9]*\.\([0-9]*\)\.[0-9]*/\1/p'` micro=`gettext --version | sed -n 's/[^0-9]*[0-9]*\.[0-9]*\.\([0-9]*\)/\1/p'` $verb "gettext version $major.$minor.$micro" if test "$major" -lt 0 \ -o \( "$major" -eq 0 -a "$minor" -lt 10 \) \ -o \( "$major" -eq 0 -a "$minor" -eq 10 -a "$micro" -lt 38 \) ; then echo '*** Your gettext is old. We need at least gettext 0.10.38' echo '*** Please fetch a d^Hrecent copy from ftp://ftp.gnu.org/gnu/gettext/' exit 1 fi } while test $# -gt 0 ; do case "${1}" in -h | --h*) usage exit 0 ;; -v | --v* | -V) verb='echo' shift ;; -f | --f*) force=yes ;; *) usage exit 1;; esac done test -f configure.ac || test -f configure.in || die "Cannot find configure.in in current directory." test x"$force" = xyes || checkversion # install gettext by copying files to patch them saferun touch configure.in # gettextize 0.10.37 doesn't yet know configure.ac saferun gettextize --force --copy saferun rm -f po/ChangeLog configure.in for i in misc/*-intl.patch misc/*-po.patch ; do patch -f -p0 < $i done heroes-0.21/README0000644004117000411500000003717707451374604007311 .---------------------------------------------------------------------. | The following information has been extracted automatically from the | | Texinfo documentation to help you install Heroes. You should read | | the full manual for more complete documentation. | `---------------------------------------------------------------------' Summary ******* * Overview of Heroes - License - Getting Heroes - Reporting bugs, sending suggestions or contributions * Installation of Heroes - Needed Libraries - configure generic instructions - configure options for Heroes - Building a relocatable package - Machines Overview of Heroes ****************** Heroes is similar to the "Tron" and "Nibbles" games of yore, but includes many graphical improvements and new game features. In it, you must maneuver a small vehicle around a world and collect powerups while avoiding obstacles, your opponents' trails, and even your own trail. There are five game modes available. Quest is the classical Nibbles, in Death Match you start with very long tails a must kill your opponents, in Kill'em All you must run over lemmings moving on the ground, in Time Cash or Color modes you must collect money or pyramids of color. Heroes features 12 original sound tracks, 94 levels (in 10 different tile sets) plus a level editor. Heroes source code originates from an original MS-DOS game but has been heavily modified to enhance the portability and some new features have been added. MS-DOS support has been lost by the meantime. The original MS-DOS version can still be found on the Internet but is unmaintained and should be considered obsolete. The current development focus on cleaning the code and port the game to available operating systems. Our objective is to release the version 1.0 as a clean and portable base that would allow further important works such as network support or programmable vehicles. License ======= The full game (that is: source code, pictures, sound-tracks, and levels) is distributed under the terms of the GNU General Public License version 2. See the file COPYING for details. Getting Heroes ============== Where to fetch new releases? ---------------------------- Heroes development is powered by the free services offered by SourceForge to the Open-Source community. The web page of Heroes is `http://heroes.sourceforge.net/'. The latest releases of Heroes is always uploaded to SourceForge and available from `http://sourceforge.net/projects/heroes/'. Announces are sent to the `heroes-announce' mailing list (*note Mailing lists::). Source code releases are also uploaded to Ibiblio (formerly MetaLab, and Sunsite)) in `/pub/linux/games'; see the Ibiblio mirror list (http://ibiblio.org/pub/linux/MIRRORS.html) to find your nearest mirror. You will have to wait three or four days to have the files available on Ibiblio after a release. A public CVS server is also accessible. See `http://sourceforge.net/cvs/?group_id=7982' for details. What to download? ----------------- Heroes is distributed as five packages with independent version numbering and release schedule. `heroes' The source code, info file, and man page. `heroes-data' The level data (level maps, sprites, etc.) `heroes-sound-tracks' Sound tracks for the game (.xm files). `heroes-sound-effects' The sound effects for the game (.wav files). `heroes-hq-sound-tracks' High quality sound tracks (.xm files), they will replace some sound-tracks from `heroes-sound-track'. The two first packages are required, the others are optional. The game has been so split because the data and sound files are big and don't evolve as often as the code does. It would therefore be unfair to bloat the bandwidth by requiring the mirrors and users to download everything on each release. Reporting bugs, sending suggestions or contributions ==================================================== We welcome bug reports or suggestions for Heroes (both program or documentation). Please email them to or . Please, see the Texinfo documentation of Heroes for guidelines regarding bug reporting. Installation of Heroes ********************** Needed Libraries ================ Heroes can be configured to use several libraries to handle display, sound output and joystick support. Following is a list of supported libraries (hopefully you won't have to install all of them but just a subset). * LibGGI (General Graphic Interface) can be used as a display and keyboard driver. Get it from `http://www.ggi-project.org/'. * LibGII (General Input Interface) will provide joystick support (the game can be compiled without). Get it from `http://www.ggi-project.org/'. It is needed by LibGGI, by the way. * SDL can be used as a display and keyboard driver. Recent revisions will also provide support for joysticks. Get it from `http://www.libsdl.org/'. * Allegro, a game programming library, can be used as a display, keyboard, and joystick driver. `http://alleg.sourceforge.net/'. * LibMikMod is a sound library. You don't need it if you want to compile Heroes without sound support. Get it from `http://www.mikmod.org/' or from `ftp://ftp.ibiblio.org/pub/linux/apps/sound/libs/'. If you install LibMikMod from sources you may want to compile LibMikMod without Alsa support (*note Troubleshooting::). * SDL_Mixer is an alternative sound engine that can be used only if you use SDL as display driver. You don't need it if you want to compile Heroes without sound support. Get it from `http://www.devolution.com/~slouken/SDL/projects/SDL_mixer/'. To summarize, install at least LibGGI, SDL, or Allegro to get video output and keyboard handling. Install LibGII to get joystick support, unless you use a recent SDL or Allegro. And install LibMikMod (or SDL_mixer if you have SDL) if you want sound output. My personal preference goes to LibGGI/LibGII and LibMikMod which give you more control over the drivers used. On the other hand, SDL seems better at doing full screen display and is maintained actively. Allegro is quite new on Unix. Heroes also supports memory debugging libraries, such as `dmalloc' or `efence'. See the `--enable-mem-debug' option in section *Note configure options::. configure generic instructions ============================== Read the file INSTALL if you are not familiar with configure scripts. configure options for Heroes ============================ `configure' will do its best to find the libraries and functions needed by the game. Still, you may give several options to `configure' to help it, or to fine tune special features of Heroes. `--enable-html-doc[=DIR]' Build and install html documentation in directory `DIR'. If `DIR' is not given, install in `$datadir/heroes/doc'. `--disable-sound' Turn off sound support. Sound is enabled by default, unless no sound engine is found). `--disable-joystick' Do not include joystick support in the game. Joystick support is enabled by default, unless you don't have GII or joystick support in SDL. `--with-sdl[=DIR]' Specify that you want to link with SDL. This is the default if LibGGI is not installed. If you installed SDL in some non-standard place, you can specify the installation path as an argument. For example: ./configure --with-sdl=/home/adl/usr `configure' will then look for `/home/adl/usr/bin/sdl-config' and configure Heroes accordingly. `--with-ggi[=DIR]' Link with LibGGI. This is the default if LibGGI is installed. If you installed LibGGI in some non-standard place, you can specify the installation path as an argument `--with-allegro[=DIR]' Link with Allegro. This is the default is neither LibGGI not SDL can be used. If you installed Allegro in some non-standard place, you can specify the installation path as an argument `--with-mikmod[=DIR]' Use LibMikMod four sound output. This is the default if LibMikMod is installed and LibGGI have been selected. You may specify where LibMikMod is installed using the optional argument. `--with-sdl-mixer[=DIR]' Use SDL_mixer for sound output. This is the default if SDL_mixer is installed and SDL has been selected. You may specify where SDL_mixer is installed using the optional argument. Using this option implies `--with-sdl'. `--disable-heroes-debug' Turn off tracing support. See the description of the `HEROES_DEBUG' variable (*note Environment::). This is enabled by default to facilitate bug reporting. Using this options should reduce the size of the resulting binary, and speed up the game by an indiscernible amount. The following options are for developing purpose. The default configuration should be suitable for end users (i.e. players) but people attempting to hack the code may want debugging symbols or compiler warnings. `--enable-debug' `--disable-debug' This is a three state option. The default is to compile with debugging symbols: this produce bigger binaries but allow to get helpfull coredumps, without slowing down the game. You may want to use `--enable-debug' to include more debugging data and turn on some debugging code. Use `--disable-debug' to turn this off. Translators: you _do want_ to turn this option on, really! Because the debugging code includes some checks on the translated messages. `--disable-optimizations' Turn off compiler optimizations options. This can ease debugging. If you want to supply your own optimizations options, use something like `--enable-optimizations='-O3 -march=pentium''. `--enable-warnings' Try to turn on a large bunch of compiler warnings. `--enable-assert' Turn on some assertions squattered over the source code. This can slow down things a bit. `--enable-devel' Is a shorthand for `--enable-debug --disable-optimizations --enable-warnings --enable-assert'. `--with-mpatrol' Link with MPatrol, a `malloc()' debugger. `--with-mtrace' Use GNU libc's `mtrace()' facility to check `malloc()' usage. `--with-dmalloc' Link with Dmalloc, a `malloc()' debugger. `--with-efence' Link with Electric Fence, a `malloc()' debugger. `--enable-mem-debug' Check for `mtrace()', Dmalloc, or Electric Fence. Use the first found. `--enable-gprof' Enable profiling support with `gcc', you need `gprof' to inspect the file resulting from a run of Heroes. `--disable-display' This disable all screen output, making the game rather unplayable. This suppress decencies over third party libraries like GGI or SDL, therefore you may find it useful with some debugging tools like checkergcc. Building a relocatable package ============================== "Relocation" refers to the ability to install or move the game in a directory which is different from the one it has been configured for. This usually happens if you create a binary package for Heroes and don't know in advance where the user will unpack it. This section describe how Heroes find for his files, in order to allow relocatable packages. Most people don't need to read this section, only packagers might be interested. The values of the `./configure' options you used to specify directories (such as `--prefix', `--bindir', or `--datadir') are all transformed into paths relative to PREFIX and then hardcoded into the Heroes binary. Because Heroes uses only paths relative to PREFIX, the relocation process is just a matter of guessing the correct value of PREFIX at runtime. This guess is done using various informations available: first the original value of PREFIX is tried, then PREFIX is computed from the path to the current binary (`argv[0]') when available, then the content of the environment variable `PATH' is used to find the binary and derive PREFIX, finally Heroes assumes it is running from the BINDIR directory. The whole process is not garanteed to succeed, but you can also override those paths with some enivronment variables (*note Environment::). Machines ======== Heroes has been reported to compile and run on the following architectures. Since Heroes can use SDL, GGI, or Allegro as display driver, the following list shows the driver which was used. Linux/i386 (GGI, SDL, or Allegro) Should build out of the box. Packages for some Linux distributions are available from the web pages. Suse 7.1 users, the libc shipped with your distribution (glibc-2.2-7) will crash every time Heroes calls the `ngettext()' function. The workaround is to configure Heroes with `configure --with-included-gettext' so that it uses its own version of `ngettext()'. Red Hat 7.0 users, the compiler shipped with your distribution (packaged as `gcc-2.96-54.i386.rpm') is an experimental version which is still _bugged_ despite the pile of fixes applied. It actually produces unfaithful code for Heroes, so please use another compiler. Either upgrade to a newer version (`gcc-2.96-64.i386.rpm' is known to work) or use the one provided by the `kgcc' package. Linux/m68k (SDL) Is reported to work when the sound (`SDL_mixer') is disabled (`configure --disable-sound' or `heroes -S'). Any feedback on this issue is welcome. See also the `BUGS' file. FreeBSD (SDL) Should build out of the box. Packages are available from the web pages. Solaris (SDL) Should build out of the box. Win32/MinGW32 (SDL) Can be cross-compiled (native compilation untested). The script used to cross build the Heroes package available on the web page is in the subdirectory `arch/mingw32'. Win32/VisualC (SDL) See the files in the `arch/VisualC' subdirectory of the Heroes CVS tree. We used to distribute these files along with the rest of the sources, but stopped because they are now completely out-of-date (they have not been updated since version 0.7). However you can use them as a start point if you think about compiling Heroes with MSVC. Digital Unix (GGI) Should build out of the box. NetBSD (SDL) I had to tweak SDL 1.1.6 to get it working, and also force Heroes' configure to use the result of `sdl-config --static-libs' instead of `sdl-config --libs'. Both issues should be fixed today (FIXME: need to check). OpenBSD 2.9 (GGI & SDL) It looks like some configure hints need to be given when using either libs. A build of Heroes configured with GGI will apperently complete successfully, however the resulting binary fails to load, with the dynamic loader complaining about a missing symbol from libpthread. So you'd rather configure Heroes with ./configure --with-ggi=/usr/local LDFLAGS=-pthread Then Heroes appears to work fine. If you prefer to use SDL, things are different. I had to configure Heroes with ./configure --with-sdl=/usr/local LDFLAGS=-L/usr/X11R6/lib X11BASE=/usr/X11R6 Unfortunately, the resulting binary froze when initializing SDL (in `SDL_init()'). Please send us a note if you are luckier. FIXME: Look how other packages using SDL are built, I'm probably missing something. IRIX 6.5 (SDL) Heroes 0.7 has been reported to compile and run with SDL 1.1.3 and `gcc' + libraries from `freeware.sgi.com' on IRIX 6.5. BeOS (SDL) Heroes 0.9 has been reported to compile and run out of the box. If you got Heroes working on a platform which is not listed here, please send a notice to . heroes-0.21/ABOUT-NLS0000644004117000411500000004464407451356456007662 Notes on the Free Translation Project ************************************* Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work at translations should contact the appropriate team. When reporting bugs in the `intl/' directory or bugs which may be related to internationalization, you should tell about the version of `gettext' which is used. The information can be found in the `intl/VERSION' file, in internationalized packages. Quick configuration advice ========================== If you want to exploit the full power of internationalization, you should configure it using ./configure --with-included-gettext to force usage of internationalizing routines provided within this package, despite the existence of internationalizing capabilities in the operating system where this package is being installed. So far, only the `gettext' implementation in the GNU C library version 2 provides as many features (such as locale alias, message inheritance, automatic charset conversion or plural form handling) as the implementation here. It is also not possible to offer this additional functionality on top of a `catgets' implementation. Future versions of GNU `gettext' will very likely convey even more functionality. So it might be a good idea to change to GNU `gettext' as soon as possible. So you need _not_ provide this option if you are using GNU libc 2 or you have installed a recent copy of the GNU gettext package with the included `libintl'. INSTALL Matters =============== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. If not, the GNU `gettext' own library will be used. This library is wholly contained within this package, usually in the `intl/' subdirectory, so prior installation of the GNU `gettext' package is _not_ required. Installers may use special options at configuration time for changing the default behaviour. The commands: ./configure --with-included-gettext ./configure --disable-nls will respectively bypass any pre-existing `gettext' to use the internationalizing routines provided within this package, or else, _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl.a' file and will decide to use this. This might be not what is desirable. You should use the more recent version of the GNU `gettext' library. I.e. if the file `intl/VERSION' shows that the library which comes with this package is more recent, you should use ./configure --with-included-gettext to prevent auto-detection. The configuration process will not test for the `catgets' function and therefore it will not be used. The reason is that even an emulation of `gettext' on top of `catgets' could not provide all the extensions of the GNU `gettext' library. Internationalized packages have usually many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. Using This Package ================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. Translating Teams ================= For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://www.iro.umontreal.ca/contrib/po/HTML/', in the "National teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `translation@iro.umontreal.ca' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skill are praised more than programming skill, here. Available Packages ================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of September 2001. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files bg cs da de el en eo es et fi fr gl he hr id it ja +----------------------------------------------------+ a2ps | [] [] [] | bash | [] [] [] [] | bfd | | binutils | [] | bison | [] [] [] [] [] | clisp | [] [] [] [] | cpio | [] [] [] [] [] | diffutils | [] [] [] [] [] [] [] | enscript | [] [] | error | [] [] | fetchmail | | fileutils | [] [] [] [] [] [] [] [] | findutils | [] [] [] [] [] [] [] [] | flex | [] [] [] | freetype | | gas | | gawk | [] [] | gcal | | gcc | | gettext | [] [] [] [] [] [] [] [] [] [] | gnupg | [] [] [] [] [] [] [] | gprof | | grep | [] [] [] [] [] [] [] [] | hello | [] [] [] [] [] [] [] [] [] [] [] | id-utils | [] [] [] | indent | [] [] [] [] [] | jpilot | [] | kbd | | ld | [] | libc | [] [] [] [] [] [] [] [] | lilypond | [] | lynx | [] [] [] [] | m4 | [] [] [] [] [] [] [] [] | make | [] [] [] [] [] [] | mysecretdiary | [] | nano | [] [] [] | opcodes | | parted | [] [] [] | ptx | [] [] [] [] [] [] [] | python | | recode | [] [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] [] [] [] | sh-utils | [] [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] [] | sketch | | soundtracker | [] [] [] | sp | | tar | [] [] [] [] [] [] [] [] | texinfo | [] [] [] [] [] [] | textutils | [] [] [] [] [] [] [] [] | util-linux | [] [] | wdiff | [] [] [] | wget | [] [] [] [] [] [] [] [] [] [] | +----------------------------------------------------+ bg cs da de el en eo es et fi fr gl he hr id it ja 0 14 24 32 11 1 8 23 13 1 33 22 4 0 7 9 18 ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh +----------------------------------------------------+ a2ps | [] [] [] | 6 bash | | 4 bfd | | 0 binutils | | 1 bison | [] | 6 clisp | [] | 5 cpio | [] [] [] [] [] | 10 diffutils | [] [] [] [] | 11 enscript | [] [] [] | 5 error | [] [] | 4 fetchmail | | 0 fileutils | [] [] [] [] [] [] [] [] [] | 17 findutils | [] [] [] [] [] [] [] [] | 16 flex | [] [] [] | 6 freetype | | 0 gas | | 0 gawk | [] | 3 gcal | | 0 gcc | | 0 gettext | [] [] [] [] [] [] [] [] | 18 gnupg | [] [] [] | 10 gprof | | 0 grep | [] [] [] [] | 12 hello | [] [] [] [] [] [] [] [] [] [] [] | 22 id-utils | [] [] [] | 6 indent | [] [] [] [] [] [] [] | 12 jpilot | | 1 kbd | [] | 1 ld | | 1 libc | [] [] [] [] [] [] [] [] | 16 lilypond | [] [] | 3 lynx | [] [] [] [] | 8 m4 | [] [] [] [] | 12 make | [] [] [] [] [] [] | 12 mysecretdiary | | 1 nano | [] | 4 opcodes | [] | 1 parted | [] [] | 5 ptx | [] [] [] [] [] [] [] [] | 15 python | | 0 recode | [] [] [] [] | 13 sed | [] [] [] [] [] [] [] | 19 sh-utils | [] [] [] [] [] [] [] [] [] [] [] | 21 sharutils | [] [] [] | 11 sketch | | 0 soundtracker | | 3 sp | | 0 tar | [] [] [] [] [] [] [] | 15 texinfo | [] | 7 textutils | [] [] [] [] [] [] [] [] | 16 util-linux | [] [] | 4 wdiff | [] [] [] [] | 7 wget | [] [] [] [] [] [] [] | 17 +----------------------------------------------------+ 33 teams ko lv nb nl nn no pl pt pt_BR ru sk sl sv tr uk zh 53 domains 9 1 6 20 0 6 17 1 13 25 10 11 23 21 2 2 387 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If September 2001 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://www.iro.umontreal.ca/contrib/po/HTML/matrix.html'. Using `gettext' in new packages =============================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle to use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `translation@iro.umontreal.ca' to make the `.pot' files available to the translation teams. heroes-0.21/AUTHORS0000444004117000411500000000115407451356454007464 * Alexandre Duret-Lutz (Pollux) http://www.epita.fr/~duret_g/ Wrote the original source code, ported it to GNU/Linux and created a few levels. * Romual Genevois (Guen) http://www.romualdgenevois.com/ Had the idea of that game, designed most of it, drew the graphics, created most of the levels. * Alexandre Liverneaux (Alexel) http://alexel.planet-d.net/ Composed the soundtracks. * Philippe Meisburger (TNK) http://perso.club-internet.fr/philmeis/ Composed the soundtracks and created some levels. heroes-0.21/COPYING0000644004117000411500000004311007450625732007444 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. heroes-0.21/ChangeLog0000644004117000411500000006700507451374566010203 2002-03-30 Alexandre Duret-Lutz * configure.ac: Bump version to 0.21. * NEWS, ANNOUNCE: Update for 0.21. * doc/heroes.texi (Getting Heroes): Mention heroes-hq-sound-tracks. 2002-03-30 Alexandre Duret-Lutz * src/musicfiles.c (st_uninit, st_init): New functions. (st_free, st_cons): Use them. (add_sound_track_cons): If the alias already exist, override it. This used to be done by hash_insert. 2002-03-30 Alexandre Duret-Lutz * doc/heroes.texi (heroesrc): Don't use `:' in index entry names. 2002-03-30 Alexandre Duret-Lutz * src/etc/heroesrc: Try to read soundfiles from $(data-dir)/hqmod/sound.conf too. 2002-03-26 Alexandre Duret-Lutz * src/lvl/en_head.c (encode_level_header): Clear unused bytes before saving. * src/lvl/en_body.c (encode_level_body): Zero initialize the square_walls_in array. 2002-03-26 Alexandre Duret-Lutz * src/lvl/de_body.c (decode_level_body): Initialize lvl->square_direction for all square, even when it doesn't matter. Otherwise `heroeslvl' will display some uninitialized directions. 2002-03-26 Alexandre Duret-Lutz * src/sprunish.c (compile_sprunish): Check for src * src/media/ggi/video.c: s/negociate/negotiate/. (setup_WWWxHHHxB_display): Don't call ggiSetMode unless ggiCheckMode succeeded. From Brian S. Julin . 2002-02-07 Alexandre Duret-Lutz * configure.ac: Bump version to 0.20. * NEWS, ANNOUNCE: Update for 0.20. 2002-02-06 Alexandre Duret-Lutz * src/heroes.c (play_game): Process input directions right before updating the game state, not after the next display. This was reported to improve responsiveness significantly. Reported by Tomas Pospisek. 2002-02-06 Alexandre Duret-Lutz * src/levellst.c (cmp_levels): Fix the sorting order of levels, broken since 0.12d. Reported by Raphaël Poss. 2002-02-03 Alexandre Duret-Lutz * src/hedlite.c (gestclav) : Don't ignore tile #0 when propagating walls to neighbors. Reported by Ingo. 2002-02-01 Alexandre Duret-Lutz * m4/h-mikmod.m4 (heroes_CHECK_MIKMOD): Complete LIBMIKMOD_LIBS with the output of libmikmod-config --ldadd, required to build Heroes since libmikmod 3.1.10. 2002-02-01 Ingo van Lil * src/lvl/lvl.h (lvl_tile_type): Fix the type of the tile argument. * src/lvl/privacc.c (lvl_tile_type): Likewise. * src/lvl/access.h (READ_U16): Typo. 2002-01-28 Alexandre Duret-Lutz * configure.ac: Bump version to 0.19. * ANNOUNCE, NEWS, arch/mingw32/dest-readme-lib: Update for 0.19. 2002-01-25 Alexandre Duret-Lutz * src/lvl/en_head.c: Do not include xstrduplwr.h. 2002-01-24 Alexandre Duret-Lutz * arch/mingw32/cross.sh (cross_install): Use make install-strip. (STRIPPROG): Remove. 2002-01-24 Alexandre Duret-Lutz * misc/copytile.c (copy_tile4): New function. (main): Call it. * src/sprshade.c (draw_sprshade): Remove FIXME about memcpy being possibly faster. * src/sprrle.c (draw_sprrle): Likewise. * src/lvl/README: Update. 2002-01-24 Alexandre Duret-Lutz * TODO: Add some items I posted to heroes-discuss a couple of week ago. 2002-01-24 Alexandre Duret-Lutz * src/system.h (getopt.h): Disable MinGW's definition of __argc and __argv during the inclusion of getopt.h. 2002-01-24 Alexandre Duret-Lutz * lib/filelock.c (file_unlock): Use _LK_UNLCK instead of _LK_UNLOCK (it seems this has changed in MinGW32), but still support _LK_UNLOCK just in case. 2002-01-23 Alexandre Duret-Lutz * configure.ac: Bump version to 0.18b. * NEWS: Update. * tests/Makefile.am (EXTRA_PROGRAMS): Replace by ... (check_PROGRAMS): ... this. 2002-01-22 Alexandre Duret-Lutz * misc/copytile.c: New file. * Makefile.am (EXTRA_DIST): Add it. * src/render.c (copy_tile): Point people to misc/copytile.c. 2002-01-22 Alexandre Duret-Lutz * src/lvl/lvl.h (SQR_COORD_X_HOLD, SQR_COORD_Y_HOLD): Rename as ... (SQR_COORD_X_VALID, SQR_COORD_Y_VALID): ... these. (SQR_COORD_VALIDE): New macro. * src/lvl/en_body.c (en_reverse_walls): Adjust. 2002-01-21 Alexandre Duret-Lutz * src/lvl/lvl.h (SQR_COORD_X_HOLD, SQR_COORD_Y_HOLD): New macros. * src/lvl/en_body.c (en_reverse_walls): Simplify, don't add wall to border squares (this is already done on loading), don't compute `dest' before it is needed. 2002-01-21 Alexandre Duret-Lutz * src/lvl/loadmac.h, src/lvl/savemac.h: Delete and merge into ... * src/lvl/access.h: ... this file. * src/lvl/de_body.c, src/lvl/en_body.c: Extract format-related macros into ... * src/lvl/format.h: ... this new file. Macros from de_body.c are all prefixed with GET_; macros for en_body are rewritten using a SET_ prefix, take a new 'val' argument, and use the endian-safe macros from access.h. Adjust all user functions. * src/lvl/Makefile.inc (lvl_libhlvl_a_SOURCES): Remove lvl/savemac.h, and lvl/loadmac.h. Add lvl/format.h and lvl/access.h. 2002-01-21 Alexandre Duret-Lutz * src/system.h (S_IRUSR, S_IRGRP, S_IROTH, S_IWUSR, S_IWGRP, S_IWOTH, S_IXUSR, S_IXGRP, S_IXOTH, S_IRWXU, S_IRWXG, S_IRWXO, S_IXUGO, S_IRWXUGO, S_IRUGO, S_IWUGO, S_IRWUGO): New macros. * src/lvl/save.c (lvl_save_file): Create the file in S_IRWUGO mode. * tests/lvlsave.c: Include error.h. 2002-01-21 Ingo van Lil * src/lvl/en_body.c (en_reverse_walls): Fix warnings. * src/lvl/en_head.c (encode_level_header): Likewise. * src/lvl/save.c (lvl_save_header_file, lvl_save_file): Likewise. 2002-01-20 Alexandre Duret-Lutz * doc/heroes.texi (configure options): Document --enable-optimizations' argument. * m4/devel.m4 (adl_ENABLE_DEVEL): Set enable_optimizations to -O. * m4/gccoptim.m4 (ad_GCC_OPTIM): Handle $enable_optimizations. 2002-01-20 Alexandre Duret-Lutz Test that saved levels are identical to loaded levels. * tests/Makefile.am (lvlsave_LDADD, lvlsave_SOURCES, EXTRA_PROGRAMS, INCLUDES, AM_CFLAGS): New variables. (TESTS): Add lvlsave.test. * tests/lvlsave.test, tests/lvlsave.c: New files. * tests/defs: Set HEROESLVL. Handle VERBOSE=x. 2002-01-20 Ingo van Lil Teach liblvl how to save a level. * src/lvl/en_body.c, src/lvl/en_head.c, src/lvl/save.c, src/lvl/savemac.h: New files. * src/lvl/Makefile.inc (lvl_libhlvl_a_SOURCES): Add them. * src/lvl/lvl.h (lvl_save_file): New function. * src/lvl/lvl_priv.h (encode_level_header, encode_level_body): New function. 2002-01-18 Alexandre Duret-Lutz * src/heroeslvl.c (version): Bump copyright year to 2002. 2002-01-17 Alexandre Duret-Lutz * src/pendulum.c, src/pendulum.h: New files. * src/Makefile.am (HEROES_SOURCES): Add them. * src/heroes (pendulum_create, pandulum_one_step, pendulum_update): Move these functions ... * src/pendulum.c (pendulum_create, pendulum_one_step, pendulum_update): ... here. And adjust them to work with... (a_pendulum): This new struct. * src/heroes.c (play_game, play_demo): Adjust to use the new interface. 2002-01-17 Ingo van Lil Alt+Enter toggles full screen mode. * src/media/sdl/video.c (Handle_AltEnter): New function. (init_SDL): Setup Handle_AltEnter as an event filter. 2002-01-17 Ingo van Lil * src/readmake.c (a_margin_list_item, a_margin_list): New structs. (init_margins, add_margin, free_margins): New functions. (compute_width, compile_reader_data): Use the new structs and functions to allocate memory for margins dynamically, instead of using and static array. 2002-01-14 Ingo van Lil * src/heroes.c (find_free_way): Ignore explicit turn back. 2002-01-14 Alexandre Duret-Lutz * src/menus.c (editor_selector, extra_menu): Fix gcc-3.0 warnings. 2002-01-09 Alexandre Duret-Lutz * configure.ac: Bump version to 0.18a. * NEWS: Update. * src/argv.c (version): Bump copyright year to 2002. * m4/libalt.m4 (LIBALT_LDFLAGS, LIBALT_LDADD, LIBALT_LOCAL_LDADD): Rename as ... (LIBALT_XLDFLAGS, LIBALT_XLDADD, LIBALT_LOCAL_XLDADD): ... these. * src/Makefile.am: Adjust. 2002-01-07 Alexandre Duret-Lutz * src/heroes.c (ai_throttle): Use player[c].invincible instead of ia_is_invincible. 2002-01-07 Ingo van Lil Alexandre Duret-Lutz * src/heroes.c (ai_throttle): New function. (update_player): Call it. (reinit_player): Initialize player[p].pos. 2002-01-01 Alexandre Duret-Lutz * src/Makefile.am (heroes_SOURCES): Remove font_help.hh * src/font_help.hh: Delete. 2001-12-30 Alexandre Duret-Lutz * src/media/ggi/video.c (dont_request_8bit_mode): New flag. (set_display_params): Set dont_request_8bit_mode if `-G not8'. (setup_320x200x8_display): Do nothing if dont_request_8bit_mode. * doc/heroes.texi (Invoking heroes, Troubleshooting): Document this. 2001-12-29 Alexandre Duret-Lutz * src/Makefile.am (parafmt_check_LDADD): New. 2001-12-27 Alexandre Duret-Lutz * configure.ac (ALL_LINGUAS): Add pt_BR. * po/pt_BR.po: New file. From Luzemario Dantas Rocha . 2001-12-15 Alexandre Duret-Lutz * configure.ac: Bump version to 0.18. * ANNOUNCE, NEWS: Update. 2001-12-15 Alexandre Duret-Lutz * po/de.po: Update copying/warranty message. From Ingo van Lil . 2001-12-14 Alexandre Duret-Lutz * po/fr.po: Update (use new latin-1 characters). 2001-12-14 Alexandre Duret-Lutz * src/camera.c (compute_corner): Don't take `two_player' into account while we are `in_menu'. (Fix a bug introduced in 0.12c.) Reported by Ingo van Lil . 2001-12-14 Alexandre Duret-Lutz * src/fontdata.c (initialize_deck_font): Revert change from 2001-12-12. Reported by Ingo van Lil . 2001-12-14 Alexandre Duret-Lutz * po/de.po: Update (use new latin-1 characters). From Ingo van Lil . 2001-12-13 Alexandre Duret-Lutz * configure.ac: Bump version to 0.17a. * NEWS, HACKING: Update. 2001-12-12 Alexandre Duret-Lutz * tests/defs: Don't assume heroes has been built in $srcdir. * Makefile.am (my-distcheck-nodisplay, my-distcheck-ggi): Run `make check'. (my-distcheck-allegro): New target. (distcheck-hook): Depend upon my-distcheck-allegro. * doc/heroes.texi (Libraries): Add an entry for Allegro. (configure options): Document --with-allegro. (Machines): Pretend that Heroes-Allegro works on Linux/i386. * m4/h-allegro.m4: "unhide" the check for Allegro. 2001-12-12 Alexandre Duret-Lutz Support Latin-1 characters in `help reader' and `big' fonts. * src/rsc_files.gperf: Add big-font. * src/fontdata.c (big_font_img): New variable. (uninit_fonts): Free big_font_img. (initialize_menu_font): Use big_font_img. (initialize_deck_font): Don't convert lowercase letters to upper case letters in DEBUG mode. (compute_text_width): Use UCHAR. * src/sprtext.c (compile_sprtext, compile_sprtext_color): Test whether width[ch]!=0 to make sure character ch is supported, not upper_left[ch]!=0. (compile_sprtext_color): Use UCHAR. 2001-12-12 Alexandre Duret-Lutz * src/media/allegro/joystick.c (get_joystick_state): Reset joystick axes when needed. 2001-12-11 Alexandre Duret-Lutz * po/de.po: Update. From Ingo van Lil . 2001-12-10 Alexandre Duret-Lutz Joystick support for Allegro. (Untested yet, I have no joystick on this host...) * m4/h-joystick.m4: Add LIBALT support for the Allegro joystick driver (allj). * m4/h-allegro.m4: Don't handle allj here. * m4/h-media.m4: Consider allk for selection. * src/media/allegro/joystick.c: New file. * src/media/allegro/video.c (heroes_init_allegro): New function. (init_video_low): Call heroes_init_allegro() instead of init_allegro(). * src/media/Makefile.inc (EXTRA_LIBRARIES): Add media/libhallj.a. (media_libhallj_a_CFLAGS, media_libhallj_a_SOURCES): New variables. 2001-12-10 Alexandre Duret-Lutz * src/media/allegro/keyb.c (process_input_events): Call clear_keybuf(). * src/heroes.c (play_game): Call keycode_to_ascii(). 2001-12-09 Alexandre Duret-Lutz * src/media/allegro/video.c (init_allegro): Call install_mouse (). * src/media/allegro/keyb.c (enable_mouse): Remove. 2001-12-09 Alexandre Duret-Lutz * src/media/keyb.h (keycode_to_ascii): Declare. * src/media/dummy/keyb.c (keycode_to_ascii): Define. * src/media/sdl/keyb.c (keycode_to_ascii): Define. * src/media/ggi/keyb.c (keycode_to_ascii): Define. * src/media/allegro/keyb.c (keycode_to_ascii): Define. * src/menus.c (editor_menu, enter_your_name): Use it. 2001-12-09 Alexandre Duret-Lutz * src/heroes.c (get_input_directions): Don't assume keyboard_map contains 0 or 1 (that's not true with Allegro). * src/media/Makefile.inc (media_libhallvkm_a_CFLAGS): Don't use $(MORE_WARNINGS_CFLAGS). * src/sys/Makefile.inc (sys_libhallm_a_CFLAGS): Likewise. 2001-12-07 Alexandre Duret-Lutz * src/Makefile.am (GGI_CFLAGS, GII_CFLAGS, LIBMIKMOD_CFLAGS, SDL_CFLAGS, SDL_MIXER_CFLAGS, ALLEGRO_CFLAGS): Define. * m4/gccwarn.m4 (CF_GCC_MORE_WARNINGS): Add -Werror. * lib/cast.h, lib/cast.c: New files. * lib/Makefile.am (libheroes_a_SOURCES): Add them. * src/vars.c (var_get_value): Call const_cast_string (). * src/musicfiles.c (get_sound_track_from_alias): Likewise. * src/media/mikmod/strack.c (init_sound_engine): Likewise. * src/media/sdl/video.c (uninit_video_low): Likewise. (init_video_low): Cast SDL_ALLEVENTS to Uint8. 2001-12-02 Alexandre Duret-Lutz * configure.ac: Check for declaration of strerror. * lib/error.c, lib/hash.c, lib/hash.h, lib/xstrdup.c: Update from textutils-2.0.18. * lib/unlocked-io.h: New (empty) file. Needed by lib/error.c. * lib/Makefile.am (libheroes_a_SOURCES): Add it. * src/musicfiles.c (get_sound_track_from_alias): Use hash_lookup. * src/vars.c (var_get_value): Likewise. 2001-11-28 Alexandre Duret-Lutz * src/media/Makefile.inc (media/ggi/keysdef.c, media/sdl/keysdef.c, media/allegro/keysdef.c): Allow these file to be built even if their source file do not exists. This is needed by target such as TAGS. 2001-11-28 Alexandre Duret-Lutz * src/Makefile.am, src/media/Makefile.inc, src/sys/Makefile.inc: Use $(MUMBLE) instead of @MUMBLE@ for AC_SUBST'ed variables. * arch/Makefile.inc, tools/Makefile.inc, src/etc/Makefile.inc: Add emacs hint for Makefile mode. * m4/gccwarn.m4 (CF_GCC_MORE_WARNINGS): Don't include $(CFLAGS) in MORE_WARNINGS_CFLAGS. 2001-11-25 Alexandre Duret-Lutz * src/media/Makefile.inc (DISTCLEANFILES): Add media/allegro/keydef.c. (media/ggi/keysdef.c, media/sdl/keysdef.c, media/allegro/keysdef.c): Depend upon .dirstamp in each directory. 2001-11-19 Alexandre Duret-Lutz * configure.ac: Bump version to 0.17. * tests/Makefile.am (EXTRA_DIST): Add $(TESTS). 2001-11-19 Alexandre Duret-Lutz * src/heroes.c (heroes_main): Set system-conf from the HEROES_SYSTEM_CONF envvar. * tests/Makefile.am (EXTRA_DIST): Add defs. * tests/defs: Set HEROES_SYSTEM_CONF to $srcdir/../src/etc/heroesrc, otherwise the testsuite would use the (maybe not installed) system configuration. 2001-11-18 Alexandre Duret-Lutz * ANNOUNCE, NEWS: Update for 0.17. 2001-11-18 Alexandre Duret-Lutz * tests/demo.test, tests/intro.test, tests/defs, tests/Makefile.am: New file. * Makefile.am (SUBDIRS): Add tests. * configure.ac: Output tests/Makefile. 2001-11-18 Alexandre Duret-Lutz * src/argv.h (a_check, check_what): New. * src/argv.c (check): New function. (long_options): Add --check. (parse_argv): Call check(). * src/heroes.c (heroes_main): Handle check_intro. (main_menu): Handle check_demo. * src/const.c (key_or_joy_ready): Handle check_demo. 2001-11-18 Alexandre Duret-Lutz * src/sprglenz.c (compile_sprglenz): Check for src * src/render.c (draw_vehicle_tail): Thinko, resulting in a SEGV :( Reported by Daniel. 2001-11-18 Alexandre Duret-Lutz * configure.ac: Bump version to 0.16. * NEWS, ANNOUNCE: Update for 0.16. 2001-11-18 Alexandre Duret-Lutz * configure.ac: Don't AC_SUBST(LIBOBJS), it's already done. 2001-11-17 Alexandre Duret-Lutz * doc/heroes.texi (Machines): Add a notice for Suse 7.1 users. * BUGS: Update. 2001-11-17 Alexandre Duret-Lutz * doc/doc.scm: New file (define import-head and import-tail). * doc/Makefile.am (EXTRA_DIST): Add doc.scm. (heroes_TEXINFOS, CLEANFILES, debugchn.texi, people.texi): Remove. (heroes.texi): Build from debugchn.tpl, people.tpl, and heroes.texi itself. * doc/heroes.texi: Merge vr and cp at the beginning (it has no effect on dvi output otherwise). Add START and END markers for debugchn.texi and people.texi output. * src/debugchn.tpl, src/people.tpl: Call import-head and import-tail for texi output. 2001-11-16 Alexandre Duret-Lutz * lib/error.c, lib/getopt.c, lib/hash.c, m4/strerror_r.m4: Update from fileutils-4.1.1. 2001-11-11 Alexandre Duret-Lutz * BUGS: Suppress Benjamin Preidecker's report about Heroes 0.5 frozen with KGI error messages. Christoph Egger (GGI devel) says it's obsolete. 2001-11-09 Alexandre Duret-Lutz * ChangeLog.01: New file. * Makefile.am (EXTRA_DIST): Add it. 2001-11-08 Alexandre Duret-Lutz * src/const.c (trail_way, square_way): Define as an array of a_dir8_pair. * src/const.h (trail_way, square_way): Likewise. * src/heroes.c (reinit_player, update_player): Use DIR8_PAIR. (grow_trail): Beautify. * src/lvl/lvl.h (DIR8_TAIL, DIR8_HEAD, DIR8_PAIR): New macros. * src/render.c (draw_trail_real, draw_vehicle_tail, draw_vehicle_head, draw_trail_tail): Use a_dir8_pair, REVERSE_DIR, and DIR8_PAIR. * src/heroes.c (shrink_trail): Don't redraw the trail tail if the trail has been erased. This completes the fix from 2001-10-28. 2001-10-28 Alexandre Duret-Lutz * src/heroes.c (update_player): Call erase_trail() before shrink_trail() when a player is destroyed. Reported by Daniel Burrows. 2001-10-20 Alexandre Duret-Lutz * configure.ac: AC_CHECK_DECLS for strnlen. 2001-10-20 Alexandre Duret-Lutz * configure.ac: Bump version to 0.15. * NEWS, ANNOUNCE: Update for 0.15. Modernize lib/Makefile.am. * lib/Makefile.am (CFLAGS): Remove (useless). (EXTRA_DIST, libheroes_a_DEPENDENCIES): Remove (automatically filled by Automake). (noinst_HEADERS): Merge with libheroes_a_SOURCES. * configure.ac: AC_REPLACE_FUNC strndup. Avoid duplication of CFLAGS on targets using per-target CFLAGS. * src/Makefile.am (CFLAGS): Don't define this variable, but ... (AM_CFLAGS): ... define this one instead. (parafmt_check_CFLAGS): Remove @CFLAGS@. * src/media/Makefile.am (media_libhggivkm_a_CFLAGS, media_libhgiij_a_CFLAGS, media_libhmiks_a_CFLAGS, media_libhsdlvkm_a_CFLAGS, media_libhsdlj_a_CFLAGS, media_libhsdls_a_CFLAGS, media_libhallvkm_a_CFLAGS): Likewise. * src/sys/Makefile.inc (sys_libhsdlm_a_CFLAGS, sys_libhallm_a_CFLAGS): Likewise. 2001-10-20 Alexandre Duret-Lutz * BUGS: Update with input from Eero Tamminen . 2001-10-20 Alexandre Duret-Lutz * tools/autogen.sh (moreverb): Use automake --force-missing. Don't run autoheader if AC_CONFIG_HEADER is not called. Call autoconf before autoheader, so the latter can use the traces cached during the run of the former. 2001-10-14 Alexandre Duret-Lutz Rewrite the explosion code (again). This fix some issues present in the old explosion handling: 1- the explosions could propagate to the neighboring square already activated (leading to an exponential growth of the number of explosions, hindering game-play as reported by Daniel); 2- the propagation did not occur at a precise time after activation (see comment in the code); 3- vanished explosions were not immediately removed from explo_list. * src/explosions.c (an_explosion_info): Remove frame_start. (allocate_explosions): Reset explo_time. (compute_explosion_state, propagate_to_neighbors_maybe, trigger_eplosion_at_time): New functions. (trigger_explosion, trigger_possible_explosion, update_explosions): Rewrite functions. * src/explosions.h (square_explo_type, trigger_explosion): Fix type. (EXPLOSION_SQUARE_TRIGGERED_P, EXPLOSION_SQUARE_TRIGGERABLE_P): New macros. 2001-10-05 Alexandre Duret-Lutz * m4/checkpkg.m4 (AC_caolan_CHECK_PACKAGE): Quote strings. * m4/pkgeneric.m4 (AC_adl_PKG_GENERIC): Likewise. * m4/w_dirent.m4 (adl_FUNC_READIR): Add missing comma. I wonder how this macro could ever work. * m4/h-sdlmixer.m4 (heroes_CHECK_SDL_MIXER): Use $SDL_LIBS. 2001-09-24 Alexandre Duret-Lutz * lib/alloca.c, lib/basename.c, lib/dirname.c, lib/dirname.h, lib/error.c, lib/error.h, lib/getopt.c, lib/getopt1.c, lib/gnugetopt.h, lib/hash.c, lib/stripslash.c, m4/dos.m4, m4/ftruncate.m4, m4/gnu-source.m4, m4/lcmessage.m4, m4/malloc.m4, m4/progtest.m4, m4/realloc.m4, m4/strerror_r.m4: Update from textutils-2.0.15. * HACKING, tools/fetish-sync.sh: Add lib/dirname.c and lib/dirname.h. * lib/stripslash.h: Delete. * lib/Makefile.am (noinst_HEADERS): Remove lib/stripslash.h. * src/hedlite.c, src/relocate.c, src/userdir.c: Include "dirname.h" instead of "stripslash.h". 2001-09-22 Alexandre Duret-Lutz * configure.ac: Bump to version 0.14. * po/fr.po: Update. 2001-09-21 Alexandre Duret-Lutz * ANNOUNCE: Update for 0.14 * NEWS: Likewise. 2001-09-21 Alexandre Duret-Lutz * HACKING: Update help2man URL. 2001-09-21 Alexandre Duret-Lutz * src/people.def (Romuald Genevois): Update www. 2001-09-21 Alexandre Duret-Lutz * tools/readme.sed: Update License. * doc/heroes.texi (Getting Heroes): Update Metalab link, now Ibiblio. (Libraries): Update the LibMikMod home page. 2001-09-21 Alexandre Duret-Lutz Change the license from 'GPL version 2 or any later version' to 'GPL version 2'. * Makefile.am, configure.ac, arch/Makefile.inc, doc/Makefile.am, lib/Makefile.am, man/Makefile.am, src/Makefile.am, src/argv.c, src/argv.h, src/bonus.c, src/bonus.h, src/bytesex.h, src/camera.c, src/camera.h, src/const.c, src/const.h, src/debughash.h, src/debugmsg.c, src/debugmsg.h, src/endscroll.c, src/endscroll.h, src/errors.c, src/errors.h, src/explosions.c, src/explosions.h, src/extras.c, src/extras.h, src/fader.c, src/fader.h, src/fastmem.h, src/font.h, src/font_help.h, src/fontdata.c, src/fontdata.h, src/gameid.c, src/gameid.h, src/generic_list.h, src/hedlite.c, src/hedlite.h, src/helptext.c, src/helptext.h, src/hendian.c, src/hendian.h, src/heroes.c, src/heroes.h, src/heroeslvl.c, src/intro.c, src/intro.h, src/items.c, src/items.h, src/levellst.c, src/levellst.h, src/locales.c, src/locales.h, src/menus.c, src/menus.h, src/misc.c, src/misc.h, src/musicfiles.c, src/musicfiles.h, src/parafmt.c, src/parafmt.h, src/pcx.c, src/pcx.h, src/people.h, src/persona.c, src/persona.h, src/pixelize.c, src/pixelize.h, src/readmake.c, src/readmake.h, src/relocate.c, src/relocate.h, src/render.c, src/render.h, src/renderdata.c, src/renderdata.h, src/rsc_files.c, src/rsc_files.h, src/rsc_files_hash.h, src/savegame.c, src/savegame.h, src/scores.c, src/scores.h, src/scrtools.c, src/scrtools.h, src/sprglauto.c, src/sprglauto.h, src/sprglenz.c, src/sprglenz.h, src/sprite.c, src/sprite.h, src/spropaque.c, src/spropaque.h, src/sprprog.c, src/sprprog.h, src/sprprogwav.c, src/sprprogwav.h, src/sprrle.c, src/sprrle.h, src/sprshade.c, src/sprshade.h, src/sprtext.c, src/sprtext.h, src/sprunish.c, src/sprunish.h, src/sprzcol.c, src/sprzcol.h, src/structs.h, src/system.h, src/timer.c, src/timer.h, src/userconf.c, src/userconf.h, src/userdir.c, src/userdir.h, src/vars.c, src/vars.h, src/visuals.c, src/visuals.h, src/etc/Makefile.inc, src/lvl/Makefile.inc, src/lvl/de_body.c, src/lvl/de_head.c, src/lvl/free.c, src/lvl/in_body.c, src/lvl/load.c, src/lvl/loadmac.h, src/lvl/lvl.h, src/lvl/lvl_priv.h, src/lvl/privacc.c, src/media/Makefile.inc, src/media/joystick.h, src/media/keyb.c, src/media/keyb.h, src/media/keyb_low.h, src/media/keysdef.h, src/media/keyvalues.h, src/media/sfx.c, src/media/sfx.h, src/media/strack.c, src/media/strack.h, src/media/video.c, src/media/video.h, src/media/video_low.h, src/media/allegro/keyb.c, src/media/allegro/keyvalues.c src/media/allegro/video.c, src/media/dummy/joystick.c, src/media/dummy/keyb.c, src/media/dummy/keysdef.c, src/media/dummy/keyvalues.c, src/media/dummy/sfx.c, src/media/dummy/strack.c, src/media/dummy/video.c, src/media/ggi/keyvalues.c, src/media/ggi/video.c, src/media/gii/joystick.c, src/media/mikmod/sfx.c, src/media/mikmod/strack.c, src/media/sdl/joystick.c, src/media/sdl/keyb.c, src/media/sdl/keyvalues.c, src/media/sdl/video.c, src/media/sdl_mixer/sfx.c, src/media/sdl_mixer/strack.c, src/sys/Makefile.inc, src/sys/main.h, src/sys/allegro/main.c, src/sys/std/main.c, tools/Makefile.inc: Change license. * README: Update the license section. 2001-09-21 Alexandre Duret-Lutz * src/levellst.c (print_level_list): New function. * src/levellst.h (print_level_list): New function. * src/heroes.c (heroes_main): Call print_level_list(). * src/argv.h (showlevels): New variable. * src/argv.c (showlevels): New variable. (list): Handle --list=levels. * doc/heroes.texi (Invoking heroes): Document --list=levels. 2001-09-21 Alexandre Duret-Lutz * src/argv.c (print_help): Take a 'status' argument and use it as exit value. (parse_argv): Return -1 instead of 1 when the game must quit but not with a non-null exit status. (heroes_main): Handle return values of parse_argv(). 2001-09-20 Alexandre Duret-Lutz * configure.ac: Rewrite the configuration report. 2001-09-20 Alexandre Duret-Lutz * m4/h-display.m4 (heroes_CHECK_DISPLAY_LIB): Typo preventing SDL_mixer to be checked for when Allegro is not used. Reported by Daniel Burrows . * m4/h-sdl.m4 (heroes_CHECK_SDL): Don't force-append sdlj and sdls in the user selections (so that for instance --with-sdl does still allow giij or miks to be used without user hints) * m4/h-sdlmixer.m4 (heroes_CHECK_SDL_MIXER): Don't append sdlvkm and sdlj for similar reason. * m4/h-joystick.m4 (heroes_CHECK_JOYSTICK_LIB) : Add sdlj to the user selection. 2001-XX-XX Older entries belong to ChangeLog.01. heroes-0.21/INSTALL0000644004117000411500000002230607450625733007447 Copyright 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for variables by setting them in the environment. You can do that on the command line like this: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not support the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it cannot guess the host type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the host platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. In this case, you should also specify the build platform with `--build=TYPE', because, in this case, it may not be possible to guess the build platform (it sometimes involves compiling and running simple test programs, and this can't be done if the compiler is a cross compiler). Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. heroes-0.21/Makefile.am0000644004117000411500000001077707423344701010454 # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 # AUTOMAKE_OPTIONS = 1.4b gnits dist-bzip2 ACLOCAL_AMFLAGS = -I m4 # Some files, such as AUTHORS or THANKS, usually automatically added # by automake are listed here because they don't exist on the CVS # but are generated from a rule in this Makefile (and automake # is not smart enough to handle this :o)). EXTRA_DIST = ANNOUNCE AUTHORS BUGS ChangeLog.00 ChangeLog.01 \ GNUmakefile HACKING THANKS \ misc/copytile.c \ misc/heroes-1.xpm \ misc/heroes-2.xpm \ misc/heroes-3.xpm \ misc/heroes-4.xpm \ misc/heroes-5.xpm \ misc/heroes-6.xpm \ misc/heroes-7.xpm \ misc/heroes-8.xpm \ misc/01-intl.patch \ misc/05-po.patch # lib must be built after intl # man must be built after src SUBDIRS = intl lib src man po doc tests README: $(top_srcdir)/doc/heroes.texi $(top_srcdir)/tools/readme.sed LC_ALL=C $(MAKEINFO) --no-header -I $(top_srcdir)/doc heroes.texi | \ sed -n -f $(top_srcdir)/tools/readme.sed > README.tmp mv README.tmp README THANKS: $(top_srcdir)/src/people.def $(top_srcdir)/src/people.tpl $(AUTOGEN) -L $(top_srcdir)/src -o 'thanks=THANKS' $(top_srcdir)/src/people.def AUTHORS: $(top_srcdir)/src/people.def $(top_srcdir)/src/people.tpl $(AUTOGEN) -L $(top_srcdir)/src -o 'authors=AUTHORS' $(top_srcdir)/src/people.def MAINTAINERCLEANFILES = \ ABOUT-NLS \ AUTHORS \ COPYING \ INSTALL \ THANKS \ aclocal.m4 \ configure \ m4/Makefile.am \ po/POTFILES.in \ po/heroes.pot \ src/config.h.in # additional checks to perform during distcheck. # this is heavily inspired from Jim Meyring's setup # in Fileutils & Shellutils & Textutils. distcheck-hook: \ man-distcheck \ my-distcheck-allegro \ my-distcheck-sdl \ my-distcheck-ggi \ my-distcheck-nodisplay # Use this to make sure we don't run these programs when building # from a virgin tgz file, below. null_AM_MAKEFLAGS = \ ACLOCAL=false \ AUTOCONF=false \ AUTOMAKE=false \ AUTOHEADER=false \ MAKEINFO=false \ AUTOGEN=false t=./=test # build with libggi and mikmod (VPATH build) my-distcheck-ggi: -rm -rf $(t) mkdir $(t) cd $(t) \ && ../$(distdir)/configure --disable-nls --with-ggi --with-gii \ --with-mikmod \ && $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ && $(MAKE) check -rm -rf $(t) # build with Allegro and mikmod (VPATH build) my-distcheck-allegro: -rm -rf $(t) mkdir $(t) cd $(t) \ && ../$(distdir)/configure --disable-nls --with-allegro \ --with-mikmod \ && $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ && $(MAKE) check -rm -rf $(t) # build without any library (VPATH build) my-distcheck-nodisplay: -rm -rf $(t) mkdir $(t) cd $(t) \ && ../$(distdir)/configure --disable-nls --disable-display \ --disable-joystick --disable-sound \ && $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ && $(MAKE) check -rm -rf $(t) # build with libsdl and sdl_mixer (build in current directory, then # ensure that no files were modified). my-distcheck-sdl: -rm -rf $(t) mkdir $(t) GZIP=$(GZIP) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz cd $(t)/$(distdir) \ && ./configure --disable-nls --with-sdl --with-sdl-mixer \ --enable-html-doc \ && $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ && $(MAKE) dvi \ && $(MAKE) check \ && $(MAKE) distclean \ && rm -rf $(DEPDIR) # Removing $(DEPDIR) like this is a gross kludge to work around a bug # in automake. Remove that line once it's fixed. cd $(t) && mv $(distdir) $(distdir).new \ && $(AMTAR) -zxf ../$(distdir).tar.gz diff -ur $(t)/$(distdir) $(t)/$(distdir).new -rm -rf $(t) man-distcheck: cd man && $(MAKE) man-distcheck # Make sure no sticky bits go into the distribution. # (Debian policy is to create user directories in g+s, # we don't want to export this :o)). dist-hook: -chmod -R a-s $(distdir) EXTRA_DIST += arch/Makefile.inc m4/Makefile.inc tools/Makefile.inc include arch/Makefile.inc include m4/Makefile.inc include tools/Makefile.inc heroes-0.21/Makefile.in0000644004117000411500000005127607451373563010475 # Makefile.in generated by automake 1.6 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 # SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ ALLEGRO_H = @ALLEGRO_H@ AMTAR = @AMTAR@ AUTOGEN = @AUTOGEN@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ DATADIRNAME = @DATADIRNAME@ DEPDIR = @DEPDIR@ GENCAT = @GENCAT@ GGI_KEYBOARD_H = @GGI_KEYBOARD_H@ GLIBC21 = @GLIBC21@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GPERF = @GPERF@ HELP2MAN = @HELP2MAN@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LIBALT_LOCAL_XLDADD = @LIBALT_LOCAL_XLDADD@ LIBALT_XLDADD = @LIBALT_XLDADD@ LIBALT_XLDFLAGS = @LIBALT_XLDFLAGS@ LIBICONV = @LIBICONV@ LN_S = @LN_S@ MKINSTALLDIRS = @MKINSTALLDIRS@ MORE_WARNINGS_CFLAGS = @MORE_WARNINGS_CFLAGS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL_KEYSYM_H = @SDL_KEYSYM_H@ STRIP = @STRIP@ U = @U@ UNZIP = @UNZIP@ UP = @UP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ ZIP = @ZIP@ am__include = @am__include@ am__quote = @am__quote@ htmldir = @htmldir@ install_sh = @install_sh@ AUTOMAKE_OPTIONS = 1.4b gnits dist-bzip2 ACLOCAL_AMFLAGS = -I m4 # Some files, such as AUTHORS or THANKS, usually automatically added # by automake are listed here because they don't exist on the CVS # but are generated from a rule in this Makefile (and automake # is not smart enough to handle this :o)). EXTRA_DIST = ANNOUNCE AUTHORS BUGS ChangeLog.00 ChangeLog.01 \ GNUmakefile HACKING THANKS \ misc/copytile.c \ misc/heroes-1.xpm \ misc/heroes-2.xpm \ misc/heroes-3.xpm \ misc/heroes-4.xpm \ misc/heroes-5.xpm \ misc/heroes-6.xpm \ misc/heroes-7.xpm \ misc/heroes-8.xpm \ misc/01-intl.patch \ misc/05-po.patch\ arch/Makefile.inc m4/Makefile.inc tools/Makefile.inc \ arch/mingw32/cross.sh \ arch/mingw32/dest-readme-txt \ arch/mingw32/dest-readme-lib \ arch/mingw32/dest-run-bat\ m4/README \ m4/bigendian.m4 \ m4/checkpkg.m4 \ m4/codeset.m4 \ m4/compat.m4 \ m4/debug.m4 \ m4/definedir.m4 \ m4/devel.m4 \ m4/dos.m4 \ m4/filelock.m4 \ m4/findheader.m4 \ m4/ftruncate.m4 \ m4/gccoptim.m4 \ m4/gccwarn.m4 \ m4/generic.m4 \ m4/getoptlong.m4 \ m4/gettext.m4 \ m4/glibc21.m4 \ m4/gnu-source.m4 \ m4/gprof.m4 \ m4/h-allegro.m4 \ m4/h-debug.m4 \ m4/h-display.m4 \ m4/h-ggi.m4 \ m4/h-joystick.m4 \ m4/h-media.m4 \ m4/h-mikmod.m4 \ m4/h-obsolete.m4 \ m4/h-paths.m4 \ m4/h-sdl.m4 \ m4/h-sdlmixer.m4 \ m4/h-sound.m4 \ m4/htmldoc.m4 \ m4/iconv.m4 \ m4/isc-posix.m4 \ m4/lcmessage.m4 \ m4/libalt.m4 \ m4/malloc.m4 \ m4/memdebug.m4 \ m4/mkdir.m4 \ m4/ndebug.m4 \ m4/normpath.m4 \ m4/pkgeneric.m4 \ m4/progtest.m4 \ m4/realloc.m4 \ m4/relpaths.m4 \ m4/runcheck.m4 \ m4/stdrelpaths.m4 \ m4/strerror_r.m4 \ m4/w_dirent.m4\ tools/README \ tools/alpha.sh \ tools/autogen.sh \ tools/cvsboot.sh \ tools/exnews.pl \ tools/fetish-sync.sh \ tools/genm4mam.sh \ tools/genpotfiles.sh \ tools/readme.sed \ tools/upgettext.sh # lib must be built after intl # man must be built after src SUBDIRS = intl lib src man po doc tests MAINTAINERCLEANFILES = \ ABOUT-NLS \ AUTHORS \ COPYING \ INSTALL \ THANKS \ aclocal.m4 \ configure \ m4/Makefile.am \ po/POTFILES.in \ po/heroes.pot \ src/config.h.in # Use this to make sure we don't run these programs when building # from a virgin tgz file, below. null_AM_MAKEFLAGS = \ ACLOCAL=false \ AUTOCONF=false \ AUTOMAKE=false \ AUTOHEADER=false \ MAKEINFO=false \ AUTOGEN=false t = ./=test subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/tools/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = intl/Makefile DIST_SOURCES = RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ uninstall-info-recursive all-recursive install-data-recursive \ install-exec-recursive installdirs-recursive install-recursive \ uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = README ./src/config.h.in ABOUT-NLS AUTHORS COPYING \ ChangeLog INSTALL Makefile.am Makefile.in NEWS THANKS TODO \ aclocal.m4 configure configure.ac tools/README tools/compile \ tools/config.guess tools/config.sub tools/depcomp \ tools/install-sh tools/mdate-sh tools/missing \ tools/mkinstalldirs tools/texinfo.tex DIST_SUBDIRS = $(SUBDIRS) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(srcdir)/arch/Makefile.inc $(srcdir)/m4/Makefile.inc $(srcdir)/tools/Makefile.inc $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnits Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe) $(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): configure.ac m4/bigendian.m4 m4/checkpkg.m4 m4/codeset.m4 m4/compat.m4 m4/debug.m4 m4/definedir.m4 m4/devel.m4 m4/dos.m4 m4/filelock.m4 m4/findheader.m4 m4/ftruncate.m4 m4/gccoptim.m4 m4/gccwarn.m4 m4/generic.m4 m4/getoptlong.m4 m4/gettext.m4 m4/glibc21.m4 m4/gnu-source.m4 m4/gprof.m4 m4/h-allegro.m4 m4/h-debug.m4 m4/h-display.m4 m4/h-ggi.m4 m4/h-joystick.m4 m4/h-media.m4 m4/h-mikmod.m4 m4/h-obsolete.m4 m4/h-paths.m4 m4/h-sdl.m4 m4/h-sdlmixer.m4 m4/h-sound.m4 m4/htmldoc.m4 m4/iconv.m4 m4/isc-posix.m4 m4/lcmessage.m4 m4/libalt.m4 m4/malloc.m4 m4/memdebug.m4 m4/mkdir.m4 m4/ndebug.m4 m4/normpath.m4 m4/pkgeneric.m4 m4/progtest.m4 m4/realloc.m4 m4/relpaths.m4 m4/runcheck.m4 m4/stdrelpaths.m4 m4/strerror_r.m4 m4/w_dirent.m4 cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/./src/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/./src/config.h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOHEADER) touch $(srcdir)/./src/config.h.in distclean-hdr: -rm -f config.h intl/Makefile: $(top_builddir)/config.status $(top_srcdir)/intl/Makefile.in cd $(top_builddir) && $(SHELL) ./config.status $@ uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. $(RECURSIVE_TARGETS): @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: @set fnord $(MAKEFLAGS); amf=$$2; \ dot_seen=no; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = . distdir = $(PACKAGE)-$(VERSION) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } GZIP_ENV = --best distcleancheck_listfiles = find . -type f -print distdir: $(DISTFILES) @if sed 15q $(srcdir)/NEWS | fgrep -e "$(VERSION)" >/dev/null; \ then :; else \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1; \ fi $(am__remove_distdir) mkdir $(distdir) $(mkinstalldirs) $(distdir)/./src $(distdir)/arch $(distdir)/arch/mingw32 $(distdir)/intl $(distdir)/m4 $(distdir)/misc $(distdir)/po $(distdir)/tools @for file in $(DISTFILES); do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir)$$dir \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" \ distdir=../$(distdir)/$$subdir \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="${top_distdir}" distdir="$(distdir)" \ dist-hook -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist dist-all: distdir $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2 $(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 $(am__remove_distdir) GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/=build mkdir $(distdir)/=inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \ && $(MAKE) $(AM_MAKEFLAGS) distcheck-hook \ && cd $(distdir)/=build \ && ../configure --srcdir=.. --prefix=$$dc_install_base \ --with-included-gettext \ $(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 \ && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ find $$dc_install_base -type f -print ; \ exit 1; } >&2 ) \ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \ && rm -f $(distdir).tar.gz \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @echo "$(distdir).tar.gz is ready for distribution" | \ sed 'h;s/./=/g;p;x;p;x' 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 after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* 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 "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f config.status config.cache config.log distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: info: info-recursive info-am: install-data-am: install-exec-am: install-info: install-info-recursive install-man: installcheck-am: maintainer-clean: maintainer-clean-recursive maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic uninstall-am: uninstall-info-am uninstall-info: uninstall-info-recursive .PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ clean-generic clean-recursive dist dist-all dist-bzip2 \ dist-gzip distcheck distclean distclean-generic distclean-hdr \ distclean-recursive distclean-tags distcleancheck distdir dvi \ dvi-am dvi-recursive info info-am info-recursive install \ install-am install-data install-data-am install-data-recursive \ install-exec install-exec-am install-exec-recursive \ install-info install-info-am install-info-recursive install-man \ install-recursive install-strip installcheck installcheck-am \ installdirs installdirs-am installdirs-recursive \ maintainer-clean maintainer-clean-generic \ maintainer-clean-recursive mostlyclean mostlyclean-generic \ mostlyclean-recursive tags tags-recursive uninstall \ uninstall-am uninstall-info-am uninstall-info-recursive \ uninstall-recursive README: $(top_srcdir)/doc/heroes.texi $(top_srcdir)/tools/readme.sed LC_ALL=C $(MAKEINFO) --no-header -I $(top_srcdir)/doc heroes.texi | \ sed -n -f $(top_srcdir)/tools/readme.sed > README.tmp mv README.tmp README THANKS: $(top_srcdir)/src/people.def $(top_srcdir)/src/people.tpl $(AUTOGEN) -L $(top_srcdir)/src -o 'thanks=THANKS' $(top_srcdir)/src/people.def AUTHORS: $(top_srcdir)/src/people.def $(top_srcdir)/src/people.tpl $(AUTOGEN) -L $(top_srcdir)/src -o 'authors=AUTHORS' $(top_srcdir)/src/people.def # additional checks to perform during distcheck. # this is heavily inspired from Jim Meyring's setup # in Fileutils & Shellutils & Textutils. distcheck-hook: \ man-distcheck \ my-distcheck-allegro \ my-distcheck-sdl \ my-distcheck-ggi \ my-distcheck-nodisplay # build with libggi and mikmod (VPATH build) my-distcheck-ggi: -rm -rf $(t) mkdir $(t) cd $(t) \ && ../$(distdir)/configure --disable-nls --with-ggi --with-gii \ --with-mikmod \ && $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ && $(MAKE) check -rm -rf $(t) # build with Allegro and mikmod (VPATH build) my-distcheck-allegro: -rm -rf $(t) mkdir $(t) cd $(t) \ && ../$(distdir)/configure --disable-nls --with-allegro \ --with-mikmod \ && $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ && $(MAKE) check -rm -rf $(t) # build without any library (VPATH build) my-distcheck-nodisplay: -rm -rf $(t) mkdir $(t) cd $(t) \ && ../$(distdir)/configure --disable-nls --disable-display \ --disable-joystick --disable-sound \ && $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ && $(MAKE) check -rm -rf $(t) # build with libsdl and sdl_mixer (build in current directory, then # ensure that no files were modified). my-distcheck-sdl: -rm -rf $(t) mkdir $(t) GZIP=$(GZIP) $(AMTAR) -C $(t) -zxf $(distdir).tar.gz cd $(t)/$(distdir) \ && ./configure --disable-nls --with-sdl --with-sdl-mixer \ --enable-html-doc \ && $(MAKE) AM_MAKEFLAGS='$(null_AM_MAKEFLAGS)' \ && $(MAKE) dvi \ && $(MAKE) check \ && $(MAKE) distclean \ && rm -rf $(DEPDIR) # Removing $(DEPDIR) like this is a gross kludge to work around a bug # in automake. Remove that line once it's fixed. cd $(t) && mv $(distdir) $(distdir).new \ && $(AMTAR) -zxf ../$(distdir).tar.gz diff -ur $(t)/$(distdir) $(t)/$(distdir).new -rm -rf $(t) man-distcheck: cd man && $(MAKE) man-distcheck # Make sure no sticky bits go into the distribution. # (Debian policy is to create user directories in g+s, # we don't want to export this :o)). dist-hook: -chmod -R a-s $(distdir) # 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: heroes-0.21/NEWS0000644004117000411500000005116107451373023007107 Heroes 0.21 March 30, 2002 * Support for the heroes-hq-sound-tracks package. * Bug fixes: - `soundconf:' failed to override aliases. - Heroes' GGI driver failed to report an error if no two-frame mode was available. - Various code nits. Heroes 0.20 February 7, 2002 * Bug fixes: - Improve responsiveness by not delaying input processing for one iteration of the main loop. - Support the new behavior of the libmikmod-config script installed by LibMikMod 3.1.10. - Fix the sorting of levels for Quest mode. (Since 0.12d) - Fix computation of walls for tile #0 in the level editor. Heroes 0.19 January 28, 2002 * Minor portability tweaks for MinGW. Heroes 0.18b January 23, 2002 * Alt+Enter toggles full screen mode (works only with the SDL driver and is not supported by all targets). * Harmful turn backs are ignored even if the autopilot is disabled by the fire trails. Heroes 0.18a January 9, 2002 * Brazilian Portuguese translations. * Computer players will stop and speed up. * `-G not8' should work around a bug in GGI. Heroes 0.18 December 15, 2001 * Bug fixes: - Display lowercase characters in deck font (introduced in 0.17a). - Fix background shift when switching from/to one player mode to/from two player mode in the "game" menu (since 0.12c). Heroes 0.17a December 13, 2001 * This version requires heroes-data-1.4. * Support Allegro as display/keyboard/joystick interface. * Support Latin-1 characters in `help reader' and `big' fonts. Heroes 0.17 November 19, 2001 * Bug fix: - Segfault introduced by previous bug fix. (Ahem.) * Very basic testsuite (it just runs the game in demo mode -- but that would have been enough to caught the aforementioned segfault). Heroes 0.16 November 18, 2001 * Bug fixes: - Explosions of dead players happens on the full trail (the last five squares used to not explode). - Check for the definition strlen() (prevented Heroes to compile on system lacking strndup()). Heroes 0.15 October 20, 2001 * Bug fix: - Some thinko in the explosion handling code could bring the game on its knees. Making it momently unplayable even on fast machines. (Since 0.12a.) Heroes 0.14 September 22, 2001 * Most files are now shipped under the terms of 'GPL version 2'. * New option to heroes: --list=levels: list level files. * Bug fixes: - Check for SDL_mixer in configure (lost in 0.13). - Allow to fall back to LibMikMod if SDL_mixer is not available and to GII if SDL does not support Joystick (lost in 0.12e). - Don't exit with an error code on operations like --version. Heroes 0.13 September 19, 2001 * Bug fixes: - Dummy keyboard driver doesn't need GGI (0.12e). - Rename all type names to prevent clashes with POSIX types. - Fix segfault in (incomplete) Allegro support. Heroes 0.12f August 26, 2001 * Document heroeslvl. * heroeslvl is internationalized. * Preliminary support for Allegro (not functional yet). * Bug fixes: - Reintroduce support from SDL_main (lost in 0.12e). - Cleanup configury changes from 0.12e. - Thinko in lemmings handling (since 0.12a). Heroes 0.12e August 22, 2001 * Interfaces with media libraries (SDL/GGI/GII/MikMod/SDL_mixer) completly revamped. See src/media/. This look cleaner, and should make addition of new interfaces easier. * ./configure will now check for *all* supported media libraries (e.g. it used to not check for SDL if GGI was found: it will now check for both and make a selection later). --with-package options are used by the installer to give his/her *preference* on which package to use. --without-package options are used to disable the checks for package (it's probably a bug if you need this). * Bug fixes: - The SDL version won't initialize sound or joystick if not needed. - Animation were looping to fast (since 0.12a). Heroes 0.12d August 6, 2001 * Portability tweaks for MinGW and OpenBSD. * Bug fixes: - Radar display was bogus on Y-wrapped levels (since 0.12a). - Prevent lemmings from entering tunnels (since 0.12a). - Sort the level list so that they are played in the same order as when level.lst was used (since 0.12b). - Wrong computation of camera position caused segfaults on unwrapped levels (since 0.12c). Heroes 0.12c July 30, 2001 * Compile flags handling revamped: - heroes and heroeslvl do not use the same libraries. - lib/ and intl/ use less strict -Woptions than src/. * heroeslvl has a manpage. * heroes can be configured to not drop s-bit privileges with the `keepsuid: yes' and `keepsgid: yes' system-wide settings. * Bug fixes: - A couple of memory leaks. - ``heroes-sdl -G mumble'' didn't work. Heroes 0.12b July 24, 2001 * heroes: - Compute the list of levels on startup; level.lst is not used anymore. * heroeslvl: - Don't load the body of the level if only the header is needed. - Add option -pi to display tile details. * common: - Free level structures once they are no longuer needed. - Load the levels with mmap if possible. Heroes 0.12a July 16, 2001 * A new utility, heroeslvl, can load levels and dump various information. * Level loading and representation code rewritten as a library (used by the game and heroeslvl, but not yet the level editor). * Explosion handling code rewritten. Two noticeable differences: - explosions from dead players are now harmful, - explosions from dead players will propagate to neighbor explosive squares. * New bonus: fire trail (appears more frequently in Death Match mode). * Autopilot is disabled against direct collisions with fire trails. Heroes 0.12 July 10, 2001 * Locking support for windows (untested). * Bug fixes: - Heroes used to be mute on five levels. - Various cosmetic issues in menus. - Correct Joystick reading code for libggi. Heroes 0.11 May 23, 2001 * Bug fixes: - strip trailing slashes before creating directories. - don't install charset.alias on glibc 2.1 systems. Heroes 0.10b May 21, 2001 * Open the global score/saved-game file once the game start, drop all privileges immediately afterward, and keep the file open until exit; instead of opening them many time, and switching persona for each opening. * Bug fixes: - Misc. errors in documentation. - Fix display of the bottommost line in the `waves' effect. - Two typos in code that prevent compilation on non-Unix systems. - Build intl/ before other subdirectories so that libintl.h is available if needed. - Fix relocation process under MinGW by o supporting semicolon-separated PATHs o supporting \ as a directory separator o stripping trailing slashes before stat()ing directories - Heroes is now aware that gettext installs locales into $datadir/locale rather that $prefix/share/locale. See the comment in m4/h-path.m4 for details. Heroes 0.10a May 8, 2001 * This version requires heroes-data-1.0a. * The labels in pictures of the help reader are translatable. * Use a new eye-catching `tutorial arrow', without text. Heroes 0.10 May 7, 2001 * Obsolete Visual C files are not longer distributed. * The CREDITS screen now thanks everybody. By the way the THANKS and AUTHORS files, the related section of the documentation, and the CREDITS screen are maintained from a single file. * Bug fixes: - make sure ngettext() is available. - don't segfault if Heroes is not found in the PATH. Heroes 0.9b May 2, 2001 * Italian translations. * Drop fetish's gettext and use the latest gettext (0.10.37) - use ngettext() to handle plural forms - gettext now works under MinGW * Support for conditionals in config files (undocumented, but used in src/etc/heroesrc) * Improve relocation magic: - also try to use argv[0] or $PATH to compute $prefix. - document (see README) * Better handling of locked files in two `dangerous' places. Heroes 0.9a April 21, 2001 * German translations. * Support for system-wide score&save files, this includes: - file locking - handling of process persona (when Heroes has the sgid or suid bits) - "tainting" of filename resources See node 'Global score file' of the manual. * Save score/save/preferences files as text. * Record keyboard preferences for SDL and GGI separately, so one can use both heroes-sdl and heroes-ggi without key conflicts. * Better support for relocation - support for the HEROES_PREFIX environment variable - all paths are now relative to this prefix - if the default prefix is incorrect, Heroes will try to set it to the relative path from $bindir to $prefix (as supplied to the configure --prefix and --bindir option), i.e., it assumes the current directory is the executable's directory. Not yet documented, can be improved. * Bug fixes: - fix handling of extended keys in the "enter your name" screen - output debug messages to stdout Heroes 0.9 February 24, 2001 * Misc typos. Heroes 0.8f February 20, 2001 * New configure option: --disable-display. * Bug fixes: - correctly update screen on key conflicts (since 0.6c) - get support for gcc 2.7.2 back (apparently dropped since 0.6e) Heroes 0.8e February 14, 2001 * GGI usage enhancements: - use buffer locking - do double buffering when possible - don't crossblit when the display is already 8bit (== speedup for people running a 8bit display) * Replace the stupid lightning formula with gamma correction (the scale and default value have changed, this means that your current saved setup is likely to be lighter than what you expect) * Bug fixes: - don't set palette for non-palletized modes [GGI] - strip large keynames in keyboard menu to prevent overstrike Heroes 0.8d February 7, 2001 * Dutch message catalog. * Report non-drawable character in messages on startup. Heroes 0.8c February 2, 2001 * One intermediate screen buffer has been removed from the rendering pipe. The good news is that this should lead to a slight speed-up in some configuration (when stretching is used or when display require locking). The bad news is that shading the screen in the PAUSE and QUIT menus is no longer possible, therefore this has been changed. * The middle mouse button can be used to select a temporary tile in the level editor (for tunnel setup). * configure changes: - CFLAGS now defaults to `-g' - New options: --with-mpatrol, --with-mtrace. * Bug fixes: - compilation for targets not using gettimeofday (e.g. mingw32) was not fixed correctly in 0.8a... - the `catch bonuses' behavior (used by computer opponents) was lacking the call to the valuation function since 0.6d! Heroes 0.8b Juanary 11, 2001 * Cleanup of config.h's #define macros. * Improvement and fixes in Makefiles' maintainer targets. * Update configure options description (manual/README) * configure shaking (continued): New option: --enable-devel Changed: --enable-debug is now disabled by default * arch/mingw32/: files used to cross-build the MinGW32 package. Heroes 0.8a Juanary 1, 2001 * Internationalization of menus and text output. * French translations included. * Bug fixes: - compilation for targets not using gettimeofday (e.g. mingw32) was broken since 0.7a - cross-compile build was broken since 0.7a * configure has been shaked a lot: - many checks moved into separate files in m5/ - New options: --disable-nls, --enable-assert, --enable-warnings, --disable-optimizations, --with-dmalloc, --with-efence, --with-included-gettext, --with-catgets - Renamed options: --with*-GGI* => --with*-ggi* --with*-GII* => --with*-gii* --with*-sdl_mixer* => --with*-sdl-mixer* * previous releases used to strip binaries by default, this is no longer the case: use `make install-strip' instead. Heroes 0.8 December 20, 2000 * Bug fixes: - --without-mikmod was not always taken into account (since 0.6) - the key configurator was not working properly (since 0.6c) - memory leaks (since 0.7b) - segfault due to the help reader (since 0.7b) Heroes 0.7b December 18, 2000 * full rewrite of the help reader * remove the end-scroller * lib/ and m4/ update * the 'txt_cfg/' directory no longer exists Heroes 0.7a December 7, 2000 * use autoconf 2.49b * make sure in configure that the selected libraries are correctly installed * the file 'txt_cfg/txti.cfg' is no longer used * New option: -4, --quadruple: stretch the screen fourfold. * Bug fixes: - add a warning in the documentation and a workaround in the code for the buggy compiler shipped with Red Hat 7.0 - fix the color selection function used when linked with SDL - fix wrapping of counters after 127 in TIME CASH and COLORS modes - fix wrong timing calculation (could cause stalls) - adds @direntry and @dircategory commands in the Texinfo manual - explicitly forbid turn backs in the game (can otherwise cause segfaults on some levels) Heroes 0.7 November 29, 2000 * Bug fixes: - failed assertion in sfx.c (since 0.6d) - vehicle drawing at tunnel output (caused segfaults since 0.6e) - TIME CASH and COLOR modes endings (pre 0.1 bug) Heroes 0.6f November 25, 2000 * Fixes for recent (0.6d) bugs: - unfreed memory blocks - various typos - inaccurate waving effect (uncleared pixels on the right side) - redundant error messages when decoding sound options (SDL_mixer) * Fixes for older (pre 0.1) bugs: - thinko in vehicle drawing functions - fence-post read in the help reader * Updated VisualC files. Heroes 0.6e November 20, 2000 * New section `Machines' in Texinfo manual (and README) * New icons (misc/heroes-?.xpm) * Should work on DEC/OSF (out of the box), and NetBSD (not smooth yet) * The use glenz option (screen menu) is no longer supported * Fixes for bugs introduced in 0.6d: - CFLAGS were overwritten by optimisation flags in configure - work around the non-exiting check for realloc on DEC/OSF - Bonus texts were only displayed for the purple player Heroes 0.6d November 16, 2000 * New aliases can be added to the sound config files, they will be shown in the jukebox * New options: --list=sound-tracks: list the configured sound tracks --list=debug: show the debug channels * Spelling errors in debug channels or file resources are reported as `possible misspelling of xxx' * Bug fixes: - timer reads could leads to quasi-infinite loop - etc/heroesrc was not installed under share/heroes - the internal level editor was unable to load levels generated by the DOS version (such as the levels from heroes-data) - -fstrict-aliasing is not recognized by any gcc - LDFLAGS could be erased in configure.in in some conditions * New configure option: --enable-gprof * Major internal changes: - new sprite drawing interface (a large part of the code has been converted to it) - base directory cleaned up Heroes 0.6c October 20, 2000 * New option: --list: show various internal information * Obsoleted option: --drivers-info * Internal changes: - many cleanups Heroes 0.6b October 5, 2000 * More Win32 support, again. * Distribute VisualC projects files (in arch/VisualC/). * REMOVED configure options: --disable-user-config --disable-user-scores --disable-user-saves They are superseded by the options-file, scores-file and games-file resources. See src/etc/heroesrc. * Renamed options: -q is now -i. * New options: -v, --verbose: debug output. -q, --quiet: suppress warnings. -Q, --really-qiet: suppress errors. * Bugs fixed: - Tunnels didn't work on bigendian machines. - A subtle bug in a configure macro prevented SDL_mixer to be found if the detection of GGI failed. - A couple of memory leaks. * Internal changes: - configure macros moved to m4/ - fading code rewritten - ./configure --enable-debug will enable a pile of compile checks. Heroes 0.6a September 19, 2000 * Better support for Win32: - more accurate timing - working full screen - should be easier to compile without any Unix layer * Closing window is now handled with SDL * Stronger checks for libMikMod and SDL * New option: -e: display only even lines (try -2e !) * Bugs fixed: - correct usage of --host for cross-compiling - --double and --triple were not handled correctly - memory leaks - the "Quit yes/no" screen was called in a loop on some machines - src/etc/heroesrc was doubled - building of html files was not handled correctly Heroes 0.6 September 2, 2000 * heroes has been split in four packages, with different version numbering and release schedules. - heroes: source code, documentation - heroes-data: level maps, graphics - heroes-sound-track: sound tracks - heroes-sound-effects: sound effects * SDL_mixer support (as an alternative for LibMikMod). * Options, games, and scores are saved as soon as possible, not only on exit. * Option list reordered in help screen and man page. * Filenames are handled internally via aliases that can be overridden with the `setrsc:' command in heroesrc. * Filenames from sound configuration files not beginning by `/' are relative to the configuration file directory. * Filename given after a `soundconf:' command are subject to alias expansion (e.g. `$(data-dir)/mod/sound.conf'). * New run-time options: -2: double display size (slow) -3: triple display size (slower) -S: disable sound -X: disable sfx (not new, but was undocumented) * New environment variables: HEROES_DEBUG: control debugging output HEROES_DATA_DIR: permit relocation of the game * New configure options: --enable-html-doc[=DIR]: build and install html documentation --disable-heroes-debug: disable support for HEROES_DEBUG --with-mikmod: link with LibMikMod --with-sdl_mixer: link with SDL_Mixer * Bugs fixed: - -q option wasn't handled - keysdef-inc.h was not build if --with-sdl or --with-GGI were given an argument - keysdef-inc.h included wrong SDL header - typos in the game texts and in the documentation - endian bugs in timing code - -DDEBUG was not in CFLAGS if the user specified her own CFLAGS at configure time. - mouse support for SDL 1.0.x was missing. - a ./configure test was broken due to unquoted variable substitution. - some more big-endian issues have been fixed - some unaligned memory access have been removed * Internal major changes: - new directory lib/ for utility and compatibility functions. - timer code fully rewritten Heroes 0.5 July 22, 2000 * Level editor integration. * Documentation updates. * Sound configuration files allow specification of played sound-tracks (`soundconf:' in ~/.heroes/heroesrc). * New options: -8: 8bits audio -q: high quality mixer -F: full screen video (where available) * Preliminary support for big-endian machines [untested] * Handle multiple extra level directories (`extradir:' in ~/.heroes/heroesrc). * Bugs fixed: - configure went wrong on joystick tests when GGI was not available and SDL didn't have joystick support. - `make distclean' did not remove all generated files. - VPATH build did not work. - --gfx-options used to segfault. * Minor improvements: - Allow to continue paused games. - With SDL, the --gfx-options will set SDL_VIDEODRIVER. Heroes 0.4 July 3, 2000 * Simple DirectMedia Layer (SDL) support. * Texinfo documentation. * `setenv:' command in ~/.heroes/heroesrc. * ./configure --disable-joystick. Heroes 0.3 June 24, 2000 * Joystick support. * Support of options specification in ~/.heroes/heroesrc. * Sound driver selection via -n and -d options. * LibGGI configuration via --ggi-display option. * Handling of music and sfx volume configuration. * Smarter keyboard configurator. * ./configure --enable-mem-debug will link with dmalloc or electric fence. Heroes 0.2 June 3, 2000 * Support for non-8bits video mode (thanks to Pierre Baillet). * Sound effects now works. * Options, scores, and saved games are now written in the ~/.heroes/ user directory (old behaviour still available with ./configure options). * Better keycode handling. Report correct keysyms in the KEYS menu. * Improved ./configure options to specify LibGGI location. * Bugs fixed: - a buffer overflow in pixelize - backspace and delete didn't work in console - the `orange vertical line' when playing a two player game Heroes 0.1 May 25, 2000 * First release under GNU/Linux. Local Variables: mode: indented-text End: heroes-0.21/THANKS0000444004117000411500000000427107451356454007332 This file records people who contributed to Heroes by reporting problems, suggesting various improvements or submitting actual code. More details about the contributions can be found in the manual or the ChangeLog. If your name has been left out, if you'd rather not be listed, or if you'd prefer a different address be used, please send a note to . Todd Allendorf toddal@alumni.caltech.edu Pierre Baillet octplane@via.ecp.fr William Black psychopheles@users.sourceforge.net Hermann J. Beackers beckers@st-oneline.de Jos Boersema joshb@xs4all.nl Daniel Burrows Daniel_Burrows@brown.edu Beiad Ian Q. Dalton idalton@ferret.phonewave.net Luzemario Dantas Rocha luza.solucao@uol.com.br Jean Delvare delvare@ensicaen.ismra.fr Stéphane Denis S.Denis@darkworks.com Alessandro Dotti alessandro.dotti@libero.it Laurent Duperval lduperval@microcelli5.com Christoph Egger Christoph_Egger@t-online.de Mattias Engdegård f91-men@nada.kth.se Gregory Giannoni gianno_g@epita.fr Uwe Hermann uh1763@bingo-ev.de Janos Holanyi csani@lme.linux.hu Wolfgang Holzinger wholzi@gmx.at Brian S. Julin bri@tull.umassp.edu Jesper Kjolsrud jeppe@dneg.com Eugenia Loli-Queru eloli@hotmail.com David Olofson david.olofson@reologica.se Raphaël Poss raphael.poss@epita.fr Thomas Pospisek tpo_deb@sourcepole.ch Benjamin Preidecker bpreidecker@gmx.de Pascal Rigaux pixel@mandrakesoft.com Maxim Sobolev sobomax@FreeBSD.org Christian T. Steigies cts@debian.org Eero Tamminen oak@welho.com Ingo van Lil inguin@gmx.de heroes-0.21/TODO0000644004117000411500000001127207424073667007112 Tasks for Heroes. If you think something is missing here, please send a note to . * Use the level-loading library in the level editor, so as to get rid of most struct in src/struct.h (and their ugly ATTRIBUTE_PACKED). This require makeing the level editor work with libhlvl (see src/lvl/README for more details). * Add `FIXME: obscure' comments at will, so I know where comments or rewrite is really important. (Actually this can be done by anyone reading the code.) * Check dependencies. Heroes >= 0.11 requires heroes-data >= 1.1, Heroes >= 0.18 requires heroes-data >= 1.4. Heroes will abort with a "cannot open file X" message on error. These is definitely some room for improvement here. * The code is VERY UGLY and needs to be cleaned up. * hedlite.c should be cleaned. * If possible, Get rid of GETWORD, SETWORD and Cie, see src/endian.h. * The default installation path on BeOS should not be /usr/local (?). I need some more input about this. * There are several comments in French. They should be translated. * Check every place were filenames are used, use buffer allocated dynamically. * Split heroes.c * Split hedlite.c * const.[ch] should not exist. * Use {u,s}{8,16,32}_t types where it's important. * __attribute__ ((packed)) is a gcc-isms, something must be done to avoid them. `something' may be using a different level format, in which case the `heroeslvl' above would be helpful. * Add an option that add a new life each time you start a new level. Suggested by Samuel Tardieu (sam@infres.enst.fr). * Programmable vehicles (for CPU controlled ones) would be nice. It would be fun to link with Guile and control the vehicles in scheme. Or in Python. Or in C (using shared libraries like pluggins). * The external editor could be ported too, this would need many many more work. (It's probably easier to rewrite it from scratch or from hedlite.c.) * Network support. * Direct X11 support would be nice. * What is the effect of removing the DMODE_SOFT_MUSIC from MikMod options ? * Would Hermes be faster than LibGGI's crossblit ? * Redesign the way menus are handled internally. * Write assembly routines for stretching code. * Use makeheaders ? (provided I can get in touch with its maintainer) * Load GGI, SDL, and MikMod libraries dymically (i.e. select available library at run-time versus configure-time). This is probably easier to do now, with the new way media libraries are handled. * Proof-read the documentation. * Full screen support with Allegro. Is it possible? * It would be nice to have the argument processing and argument documentation of `heroes' and `heroeslvl' generated automatically from a definition file (well, two definition files, one for each program) using AutoGen. AutoGen ships with a tools called AutoOpts that performs a similar task, but I find the result horrible. Our command line parsing code should follow the Gnits standards and use getopt_long. (Such alternate tool is on the TODO list of AutoGen, so it might be contribued back.) * The end-scroller used to be an end-scroller :) Now it's just a screen that display "THE END". That's not really rewarding for the player. It would be nice to have something more delighting here. * Heroes-data should ships with 100 levels, shouldn't it? (There is only 94 levels, IIRC.) * There are some "extra" levels in heroes/src/extralvl/ on CVS. Do they deserve some packaging? * There are some hq modules packaged in http://heroes.sf.net/dl/misc/ Should they be packaged in a more "official" way? * Some files #include too much headers (for historical reasons), this slows down compilation times. That's quite unrelated to Heroes, but a tool that can figure which #include are superfluous would be appreciated by several people I have talked to. * The "AI", if I may call this "AI" (see `ia_*' functions in heroes.c, but have some aspirin handy) is ABSOLUTELY HORRIBLE. It's using a very stupid and inefficient recursive algorithm. `A*' is not usable as-is with the current path evaluation functions, but maybe these heuristics can be changed too. A better "AI" have been required several times in the comments about Heroes on www.happypenguin.org. * Heroes is relocatable (the manual explains that), but heroeslvl isn't. * The paragraph formater (parafmt.c), has two minor issues: it does not handle a paragraph with leading spaces (i.e. first line is indented) properly, and will probably fail to format a paragraph where one word is larger than one of the line (even if that's not the line the word is finally put on). * Improve the test suite (whatever you think it can mean). * Add more items to this TODO list. heroes-0.21/aclocal.m40000644004117000411500000035651507451373555010275 # aclocal.m4 generated automatically by aclocal 1.6 -*- Autoconf -*- # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. # Do all the work for Automake. -*- Autoconf -*- # 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. # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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. # serial 8 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... AC_PREREQ([2.52]) # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow # the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl # 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_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, "aclocal-${am__api_version}") AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, "automake-${am__api_version}") AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_MISSING_PROG(AMTAR, tar) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP # 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 _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 ]) ]) # Copyright 2002 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 # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6"]) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION so it can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.6])]) # Helper functions for option handling. -*- Autoconf -*- # Copyright 2001, 2002 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. # serial 2 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # # Copyright 1996, 1997, 2000, 2001 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. # serial 3 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # -*- Autoconf -*- # Copyright 1997, 1999, 2000, 2001 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. # serial 3 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # AM_AUX_DIR_EXPAND # Copyright 2001 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. # 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. # Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50]) AC_DEFUN([AM_AUX_DIR_EXPAND], [ # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. # Copyright 2001 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. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"$am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # AM_PROG_INSTALL_STRIP # Copyright 2001 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. # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # serial 4 -*- Autoconf -*- # Copyright 1999, 2000, 2001 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. # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'] [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_$1_dependencies_compiler_type=$depmode break 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_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null AC_SUBST([DEPDIR]) ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking Speeds up one-time builds --enable-dependency-tracking Do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH]) ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright 1999, 2000, 2001, 2002 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. #serial 2 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` if (sed 1q $mf | fgrep 'generated by automake') > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //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"]) ]) # Copyright 2001 Free Software Foundation, Inc. -*- Autoconf -*- # 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. # serial 2 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST(am__include) AC_SUBST(am__quote) AC_MSG_RESULT($_am_result) rm -f confinc confmf ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright 1997, 2000, 2001 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. # serial 5 AC_PREREQ(2.52) # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE]) AC_SUBST([$1_FALSE]) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([conditional \"$1\" was never defined. Usually this means the macro was only invoked conditionally.]) fi])]) AC_DEFUN([heroes_aux_OBSOPT], [if test -n "$MY_TR_SH($1)"; then AC_MSG_ERROR([--$1 is an obsolete option[]ifelse([$2],,,[, you should use --$2 instead])]) fi]) AC_DEFUN([heroes_aux_ERROPT], [if test -n "$MY_TR_SH($1)"; then AC_MSG_ERROR([--$1 is an illegal option[]ifelse([$2],,,[, you probably want to use --$2])]) fi]) AC_DEFUN([heroes_CHECK_OBSOLETE_OPTIONS], [# check for opsolete or erroneous options heroes_aux_ERROPT([with-SDL],[with-sdl]) dnl It's not possible to test for the next one: dnl because both sides maps to the same shell variable :o( dnl heroes_aux_OBSOPT([with-sdl_mixer],[with-sdl-mixer]) heroes_aux_OBSOPT([with-GGI],[with-ggi]) heroes_aux_OBSOPT([with-GII],[with-gii]) ]) dnl The Autoconf maintainers keep moving undocumented functions around, dnl so let's use what we find, to stay compatible with different version dnl of Autoconf... AC_DEFUN([MY_TR_SH],[ifdef([AS_TR_SH],[AS_TR_SH($@)],[AC_TR_SH($@)])]) AC_DEFUN([MY_TR_CPP],[ifdef([AS_TR_CPP],[AS_TR_CPP($@)],[AC_TR_CPP($@)])]) AC_DEFUN([MY_VAR_PUSHDEF], [ifdef([AS_VAR_PUSHDEF],[AS_VAR_PUSHDEF($@)],[AC_VAR_PUSHDEF($@)])]) AC_DEFUN([MY_VAR_POPDEF], [ifdef([AS_VAR_POPDEF],[AS_VAR_POPDEF($@)],[AC_VAR_POPDEF($@)])]) AC_DEFUN([MY_VAR_SET],[ifdef([AS_VAR_SET],[AS_VAR_SET($@)],[AC_VAR_SET($@)])]) #serial 1 # This test replaces the one in autoconf. # Currently this macro should have the same name as the autoconf macro # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ] ) # serial 2 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. # Copyright 1999, 2000, 2001 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. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ]) #serial 3 # Make sure _GNU_SOURCE is defined where necessary: as early as possible # for configure-time tests, as well as for every source file that includes # config.h. # From Jim Meyering. AC_DEFUN([AC__GNU_SOURCE], [ # Make sure that _GNU_SOURCE is defined for all subsequent # configure-time compile tests. # This definition must be emitted (into confdefs.h) before any # test that involves compilation. cat >>confdefs.h <<\EOF #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif EOF # Emit this code into config.h.in. # The ifndef is to avoid redefinition warnings. AH_VERBATIM([_GNU_SOURCE], [#ifndef _GNU_SOURCE # define _GNU_SOURCE #endif]) ]) AC_DEFUN([heroes_MEDIALIB_SELECTION], [ user_selection_list_vkm='' user_selection_list_s='' user_selection_list_j='' heroes_CHECK_DISPLAY_LIB heroes_CHECK_JOYSTICK_LIB heroes_CHECK_SOUND_LIB # These libraries do not need any checking. adl_LIBALT_OK([dums], [none], [], []) adl_LIBALT_OK([dumj], [none], [], []) adl_LIBALT_OK([stdm], [standard main], [], []) # There is a trick here. Usually our static library are added # to LIBALT_LOCAL_LDADD which is listed before LIBALT_LDADD (the system # libraries) on the link line. However, SDL_main and Allegro are special: # they refer to OUR code (practically they call our main, which has been # renamed to SDL_main() or _mangled_main()). So in addition to adding # sys/libhallm.a to LIBALT_LOCAL_LDADD (done automatically by adl_LIBALT_OK), # we will also list it in LIBALT_LDADD (requested below). The 'APPEND' means # the libraries should be appended instead of being prepended, since we # want them to be listed after -lSDL_main or -lallegro. adl_LIBALT_OK([sdlm], [SDL_main], [], [sys/libhsdlm.a], [sdlvkm], [APPEND]) adl_LIBALT_OK([allm], [Allegro mangled main], [], [sys/libhallm.a], [allvkm], [APPEND]) # Heroes can run without display, but usually this is not what # the user wants :), so this "feature" is enabled only if # --disable-display is supplied. AC_ARG_ENABLE([display], [AC_HELP_STRING([--disable-display], [don't draw anything on screen])]) if test "${enable_display-yes}" = no; then user_selection_list_vkm="dumvkm $user_selection_list_vkm" adl_LIBALT_OK([dumvkm], [none], [], []) fi # If the user has no preference, we'll use our own preference list. if test -z "$user_selection_list_vkm"; then selection_list_vkm="ggivkm sdlvkm allvkm dumvkm" else selection_list_vkm="$user_selection_list_vkm dumvkm" fi if test -z "$user_selection_list_s"; then # Keep sdls first. It won't be used if sdlvkm is not selected, # but otherwise it should be prefered over miks. selection_list_s="sdls miks dums" else selection_list_s="$user_selection_list_s dums" fi if test -z "$user_selection_list_j"; then # Keep sdlj first. It won't be used if sdlvkm is not selected, # but otherwise it should be prefered over giij. # Keep allj second for the same reason. selection_list_j="sdlj allj giij dumj" else selection_list_j="$user_selection_list_j dumj" fi adl_LIBALT_EITHER([$selection_list_vkm], [video-keyboard-mouse library], [selection_vkm], [media/libh]) adl_LIBALT_EITHER([$selection_list_s], [sound library], [selection_s], [media/libh]) adl_LIBALT_EITHER([$selection_list_j], [joystick library], [selection_j], [media/libh]) adl_LIBALT_EITHER([sdlm allm stdm], [startup library], [selection_m], [sys/libh]) ]) AC_DEFUN([heroes_CHECK_DISPLAY_LIB], [ heroes_CHECK_GGI([adl_LIBALT_OK([ggivkm], [LibGGI], [$GGI_LDFLAGS], [$GGI_LIBS])]) heroes_CHECK_SDL([adl_LIBALT_OK([sdlvkm], [SDL dnl $sdl_config_major_version.dnl $sdl_config_minor_version.dnl $sdl_config_micro_version], [], [$SDL_LIBS])], [# Set to `no' so that we don't check for joystick or sound support with_sdl=no]) heroes_CHECK_ALLEGRO([adl_LIBALT_OK([allvkm], [Allegro dnl $allegro_config_major_version.dnl $allegro_config_minor_version.dnl $allegro_config_micro_version], [], [$ALLEGRO_LIBS])], [# Set to `no' so that we don't check for joystick support with_allegro=no]) ]) AC_DEFUN([heroes_CHECK_GGI], [if test "${with_ggi-yes}" != no; then if test "${with_ggi-no}" != no; then user_selection_list_vkm="$user_selection_list_vkm ggivkm" fi AC_caolan_CHECK_PACKAGE([GGI],[ggiOpen],[ggi],[ggi/ggi.h],,[with_ggi=no]) fi if test "${with_ggi-yes}" != no; then AC_adl_FIND_HEADER([ggi/keyboard.h],, [/usr/include/ggi/keyboard.h] dnl [${ggi_include-/usr/local/include}/ggi/keyboard.h], [#[ ]*define[ ][ ]*GIIUC*],7,, [AC_MSG_ERROR([Keysyms macros not found: where is GGI installed?])]) GGI_KEYBOARD_H="$ac_cv_header_path_ggi_keyboard_h" AC_SUBST([GGI_KEYBOARD_H]) $1 ifelse([$2],,,[else $2]) fi ]) dnl @synopsis AC_caolan_CHECK_PACKAGE(PACKAGE, FUNCTION, LIBRARY, HEADERFILE [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) dnl dnl Provides --with-PACKAGE, --with-PACKAGE-include and --with-PACKAGE-libdir dnl options to configure. Supports the now standard --with-PACKAGE=DIR dnl approach where the package's include dir and lib dir are underneath DIR, dnl but also allows the include and lib directories to be specified seperately dnl dnl adds the extra -Ipath to CFLAGS if needed dnl adds extra -Lpath to LD_FLAGS if needed dnl searches for the FUNCTION in the LIBRARY with dnl AC_CHECK_LIBRARY and thus adds the lib to LIBS dnl dnl defines HAVE_PKG_PACKAGE if it is found, (where PACKAGE in the dnl HAVE_PKG_PACKAGE is replaced with the actual first parameter passed) dnl note that autoheader will complain of not having the HAVE_PKG_PACKAGE and you dnl will have to add it to acconfig.h manually dnl dnl @version $Id: ac_caolan_check_package.m4,v 1.5 2000/08/30 08:50:25 simons Exp $ dnl @author Caolan McNamara with fixes from Alexandre Duret-Lutz . dnl AC_DEFUN([AC_caolan_CHECK_PACKAGE], [ dnl we're going to need uppercase, lowercase and user-friendly versions of the dnl string `LIBRARY' pushdef([UP], MY_TR_CPP([$1]))dnl pushdef([DOWN], translit([$1], [-A-Z], [_a-z]))dnl pushdef([DOWNALT], translit([$1], [_A-Z], [-a-z]))dnl AC_ARG_WITH(DOWNALT, [AC_HELP_STRING([--with-]DOWNALT[=DIR],[root directory of $1 installation])], [with_[]DOWN=$withval if test "${with_[]DOWN}" != yes; then DOWN[]_include="$withval/include" DOWN[]_libdir="$withval/lib" fi] ) AC_ARG_WITH(DOWNALT[-include], [AC_HELP_STRING([--with-]DOWNALT[-include=DIR], [specify exact include dir for $1 headers])], [DOWN[]_include="$withval"]) AC_ARG_WITH(DOWNALT[-libdir], [AC_HELP_STRING([--with-]DOWNALT[-libdir=DIR], [specify exact library dir for $1 library]) AC_HELP_STRING([--without-]DOWNALT,[disables ]DOWN[ usage completely])], [DOWN[]_libdir="$withval"]) if test "${with_[]DOWN}" != no ; then OLD_LIBS="$LIBS" OLD_LDFLAGS="$LDFLAGS" OLD_CFLAGS="$CFLAGS" OLD_CPPFLAGS="$CPPFLAGS" if test "${DOWN[]_libdir}" ; then UP[]_LDFLAGS="-L${DOWN[]_libdir}" LDFLAGS="$LDFLAGS ${UP[]_LDFLAGS}" fi if test "${DOWN[]_include}" ; then UP[]_CFLAGS="-I${DOWN[]_include}" CPPFLAGS="$CPPFLAGS ${UP[]_CFLAGS}" CFLAGS="$CFLAGS ${UP[]_CFLAGS}" fi no_good=no dnl pass a third argument to AC_CHECK_LIB to dnl prevent HAVE_LIB$3 from being defined. AC_CHECK_LIB([$3],[$2],[:],[no_good=yes]) AC_CHECK_HEADER([$4],,[no_good=yes]) LIBS="$OLD_LIBS" LDFLAGS="$OLD_LDFLAGS" CPPFLAGS="$OLD_CPPFLAGS" CFLAGS="$OLD_CFLAGS" if test "$no_good" = yes; then dnl broken ifelse([$6], , , [$6]) UP[]_LDFLAGS="" UP[]_CFLAGS="" UP[]_LIBS="" else dnl fixed UP[]_LIBS="-l$3" ifelse([$5], , , [$5]) fi fi AC_SUBST(UP[]_CFLAGS) AC_SUBST(UP[]_LIBS) AC_SUBST(UP[]_LDFLAGS) popdef([UP]) popdef([DOWN]) popdef([DOWNALT]) ]) dnl AC_adl_FIND_HEADER(HEADER-NAME, CPPFLAGS, OTHER-NAMES, REGEX, NMATCH dnl ACTION-IF-YES, ACTION-IF-NOT) dnl dnl Search for the exact location of header `' which must dnl match `NMATCH' times the regex `REGEX'. If is header is not found, dnl try the OTHER-NAMES list of headers. dnl dnl Generalized by Alexandre Duret-Lutz dnl from a test in Zsh's configure.in (written by?) AC_DEFUN([AC_adl_FIND_HEADER], [# Where is <$1> located? MY_VAR_PUSHDEF([ac_adl_Header], [ac_cv_header_path_$1]) AC_CACHE_CHECK([where $1 is located], ac_adl_Header, [# Look at the output from the preprocessor. # We should get lines of the form `# 1 "/usr/include/$1"' # The backslash substitution is to persuade cygwin to cough up # slashes rather than doubled backslashes in the path. echo "#include <$1>" > nametmp.c afh_file_list="`$CPP $2 nametmp.c 2> /dev/null | sed -n 's/^#[ ].*\"\(.*\)\"/\1/p' | sed 's/\\\\\\\\/\//g' | $AWK '{ if (\@S|@1 ~ \"$1\") files[[\@S|@1]] = \@S|@1 } END { for (var in files) print var }'`" dnl Note: `@S|@' will be translated into `$' by autoconf. rm -f nametmp.c if test -z "$afh_file_list"; then # In case we don't get the stuff from the preprocesor, use the # list of standard places. afh_file_list="$3 /dev/null" fi for ASH_FILE_H in $afh_file_list do # make sure it doesn't get confused by files that don't # define what is searched for ash_nmatch=`test -f $ASH_FILE_H && \ grep '$4' $ASH_FILE_H | \ wc -l | sed 's/[ ]//g'` test "x$ash_nmatch" != x && test "$ash_nmatch" -ge $5 && break done MY_VAR_SET(ac_adl_Header,[$ASH_FILE_H]) if test "$ASH_FILE_H" = "/dev/null"; then ifelse([$7], , [:], [$7]) else ifelse([$6], , [:], [$6]) fi]) MY_VAR_POPDEF([ac_adl_Header])]) # adl_LIBALT_OK (HANDLE, NAME, LDFLAGS, LDADD, [DEPENDENCIES], [OPTION]) # ---------------------------------------------------------------------- AC_DEFUN([adl_LIBALT_OK], [ adl_libalt_$1_ok=yes adl_libalt_$1_name="$2" adl_libalt_$1_LDFLAGS="$3" adl_libalt_$1_LDADD="$4" adl_libalt_$1_selected=no adl_libalt_$1_depend_on="$5" adl_libalt_$1_opt="$6" ]) # adl_LIBALT_EITHER (HANDLES, DOC, VAR, LDADD_PREFIX) # --------------------------------------------------- AC_DEFUN([adl_LIBALT_EITHER], [ $3=NONE for i in $1; do if eval test "x\$adl_libalt_${i}_ok" = xyes ; then # make sure all dependencies for this module have already been selected. eval adl_libalt_tmp_dep="\$adl_libalt_${i}_depend_on" adl_libalt_tmp_ok=yes for j in $adl_libalt_tmp_dep : ; do if test $j = : ; then break fi if eval test "x\$adl_libalt_${j}_selected" != xyes ; then adl_libalt_tmp_ok=no break fi done if test "$adl_libalt_tmp_ok" = yes ; then eval adl_libalt_tmp_opt=\"\$adl_libalt_${i}_opt\" # The default is to prepend. if test x"$adl_libalt_tmp_opt" = xAPPEND; then eval LIBALT_LDFLAGS=\"\$LIBALT_LDFLAGS \$adl_libalt_${i}_LDFLAGS\" eval LIBALT_LDADD=\"\$LIBALT_LDADD \$adl_libalt_${i}_LDADD\" ifelse([$4],,, [LIBALT_LOCAL_LDADD="$LIBALT_LOCAL_LDADD $4$i.a"]) else eval LIBALT_LDFLAGS=\"\$adl_libalt_${i}_LDFLAGS \$LIBALT_LDFLAGS\" eval LIBALT_LDADD=\"\$adl_libalt_${i}_LDADD \$LIBALT_LDADD\" ifelse([$4],,, [LIBALT_LOCAL_LDADD="$4$i.a $LIBALT_LOCAL_LDADD"]) fi eval "adl_libalt_${i}_selected=yes" $3=$i break fi fi done if test "x$$3" = xNONE ; then AC_MSG_ERROR([No $2 found. The supported libraries are listed in README.]) else eval adl_tmp_libalt_name='$adl_libalt_'"$$3"'_name' AC_MSG_NOTICE([Selected $2: $adl_tmp_libalt_name]) fi # Use _XLDLAGS, _XLDADS, etc. because Automake reserves _LDFLAGS, etc. AC_SUBST([LIBALT_XLDFLAGS], [$LIBALT_LDFLAGS]) AC_SUBST([LIBALT_XLDADD], [$LIBALT_LDADD]) AC_SUBST([LIBALT_LOCAL_XLDADD], [$LIBALT_LOCAL_LDADD]) ]) AC_DEFUN([heroes_CHECK_SDL], [AC_ARG_WITH([sdl], [AC_HELP_STRING([--with-sdl=DIR],[root directory of SDL installation]) AC_HELP_STRING([--without-sdl],[disables SDL usage completely])]) # --with-sdl-exec-prefix should imply --with-sdl, and vice-versa test "${with_sdl_exec_prefix-no}" != no && test "${with_sdl-yes}" = yes && with_sdl="$with_sdl_exec_prefix" test "${with_sdl-yes}" != yes && test "${with_sdl_exec_prefix-yes}" = yes && with_sdl_exec_prefix="$with_sdl" if test "${with_sdl-yes}" != no; then if test "${with_sdl-no}" != no; then user_selection_list_vkm="$user_selection_list_vkm sdlvkm" fi AC_adl_PKG_GENERIC(sdl,[1.0.1],[SDL_Init], [AC_CHECK_FUNCS([SDL_EnableKeyRepeat])], [with_sdl=no]) fi if test "${with_sdl-yes}" != no; then AC_adl_FIND_HEADER([SDL_keysym.h],[$SDL_CFLAGS], [/usr/include/SDL/SDL_keysym.h] dnl [/usr/local/include/SDL/SDL_keysym.h], [#[ ]*define[ ][ ]*SDLK_*],7,, [AC_MSG_ERROR([Keysyms definitions not found: where is SDL installed?])]) SDL_KEYSYM_H="$ac_cv_header_path_SDL_keysym_h" AC_SUBST([SDL_KEYSYM_H]) $1 ifelse([$2],,,[else $2]) fi ]) dnl This will call AC_PATH_GENERIC but check that the library actually link. dnl (people installing library from binary packages can have libraries dnl that do NOT link when dependencies are not satisfied) dnl dnl AC_adl_PKG_GENERIC(library,version,function,action-if-ok,action-if-not) dnl dnl Inspired from AC_CAOLAN_CHECK_PACKAGE. dnl Alexandre Duret-Lutz AC_DEFUN([AC_adl_PKG_GENERIC],[ pushdef([UP], translit([$1], [a-z], [A-Z]))dnl OLD_LIBS="$LIBS" OLD_CFLAGS="$CFLAGS" jolly_good=true AC_PATH_GENERIC([$1],[$2],,[jolly_good=false]) ifelse([$3],,,[if $jolly_good; then CFLAGS="$UP[]_CFLAGS $CFLAGS" LIBS="$UP[]_LIBS $LIBS" AC_CHECK_FUNC([$3],,[jolly_good=false]) fi]) if $jolly_good; then ifelse([$4],,,[$4]) LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" else LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" ifelse([$5],,,[$5]) fi popdef([UP]) ]) dnl @synopsis AC_PATH_GENERIC(LIBRARY [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl dnl Runs a LIBRARY-config script and defines LIBRARY_CFLAGS and LIBRARY_LIBS dnl dnl The script must support `--cflags' and `--libs' args. dnl If MINIMUM-VERSION is specified, the script must also support the dnl `--version' arg. dnl If the `--with-library-[exec-]prefix' arguments to ./configure are given, dnl it must also support `--prefix' and `--exec-prefix'. dnl (In other words, it must be like gtk-config.) dnl dnl For example: dnl dnl AC_PATH_GENERIC(Foo, 1.0.0) dnl dnl would run `foo-config --version' and check that it is at least 1.0.0 dnl dnl If so, the following would then be defined: dnl dnl FOO_CFLAGS to `foo-config --cflags` dnl FOO_LIBS to `foo-config --libs` dnl dnl At present there is no support for additional "MODULES" (see AM_PATH_GTK) dnl (shamelessly stolen from gtk.m4 and then hacked around a fair amount) dnl dnl @author Angus Lees dnl @version $Id: generic-config.m4,v 1.2 2000/07/19 13:03:32 simons Exp $ AC_DEFUN([AC_PATH_GENERIC], [dnl dnl we're going to need uppercase, lowercase and user-friendly versions of the dnl string `LIBRARY' pushdef([UP], translit([$1], [a-z], [A-Z]))dnl pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl dnl dnl Get the cflags and libraries from the LIBRARY-config script dnl AC_ARG_WITH(DOWN[-prefix], [AC_HELP_STRING([--with-]DOWN[-prefix=PFX], [Prefix where $1 is installed (optional)])], DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="") AC_ARG_WITH(DOWN[-exec-prefix], [AC_HELP_STRING([--with-]DOWN[-exec-prefix=PFX], [Exec prefix where $1 is installed (optional)])], DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="") if test x$DOWN[]_config_exec_prefix != x ; then DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix" if test x${UP[]_CONFIG+set} != xset ; then UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config fi fi if test x$DOWN[]_config_prefix != x ; then DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix" if test x${UP[]_CONFIG+set} != xset ; then UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config fi fi AC_PATH_PROG(UP[]_CONFIG, DOWN-config, no) ifelse([$2], , AC_MSG_CHECKING(for $1), AC_MSG_CHECKING(for $1 - version >= $2) ) no_[]DOWN="" if test "$UP[]_CONFIG" = "no" ; then no_[]DOWN=yes else UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`" UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`" ifelse([$2], , ,[ DOWN[]_config_major_version=`$UP[]_CONFIG $DOWN[]_config_args \ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` DOWN[]_config_minor_version=`$UP[]_CONFIG $DOWN[]_config_args \ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` DOWN[]_config_micro_version=`$UP[]_CONFIG $DOWN[]_config_args \ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` DOWN[]_wanted_major_version="regexp($2, [\<\([0-9]*\)], [\1])" DOWN[]_wanted_minor_version="regexp($2, [\<\([0-9]*\)\.\([0-9]*\)], [\2])" DOWN[]_wanted_micro_version="regexp($2, [\<\([0-9]*\).\([0-9]*\).\([0-9]*\)], [\3])" # Compare wanted version to what config script returned. # If I knew what library was being run, i'd probably also compile # a test program at this point (which also extracted and tested # the version in some library-specific way) if test "$DOWN[]_config_major_version" -lt \ "$DOWN[]_wanted_major_version" \ -o \( "$DOWN[]_config_major_version" -eq \ "$DOWN[]_wanted_major_version" \ -a "$DOWN[]_config_minor_version" -lt \ "$DOWN[]_wanted_minor_version" \) \ -o \( "$DOWN[]_config_major_version" -eq \ "$DOWN[]_wanted_major_version" \ -a "$DOWN[]_config_minor_version" -eq \ "$DOWN[]_wanted_minor_version" \ -a "$DOWN[]_config_micro_version" -lt \ "$DOWN[]_wanted_micro_version" \) ; then # older version found no_[]DOWN=yes echo -n "*** An old version of $1 " echo -n "($DOWN[]_config_major_version" echo -n ".$DOWN[]_config_minor_version" echo ".$DOWN[]_config_micro_version) was found." echo -n "*** You need a version of $1 newer than " echo -n "$DOWN[]_wanted_major_version" echo -n ".$DOWN[]_wanted_minor_version" echo ".$DOWN[]_wanted_micro_version." echo "***" echo "*** If you have already installed a sufficiently new version, this error" echo "*** probably means that the wrong copy of the DOWN-config shell script is" echo "*** being found. The easiest way to fix this is to remove the old version" echo "*** of $1, but you can also set the UP[]_CONFIG environment to point to the" echo "*** correct copy of DOWN-config. (In this case, you will have to" echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf" echo "*** so that the correct libraries are found at run-time)" fi ]) fi if test "x$no_[]DOWN" = x ; then AC_MSG_RESULT(yes) ifelse([$3], , :, [$3]) else AC_MSG_RESULT(no) ## We won't display this warning unless the installer used --with-DOWN. if test "$UP[]_CONFIG" = "no" && test "${with_[]DOWN[]-no}" != no ; then echo "*** The DOWN-config script installed by $1 could not be found" echo "*** If $1 was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the UP[]_CONFIG environment variable to the" echo "*** full path to DOWN-config." fi UP[]_CFLAGS="" UP[]_LIBS="" ifelse([$4], , :, [$4]) fi AC_SUBST(UP[]_CFLAGS) AC_SUBST(UP[]_LIBS) popdef([UP]) popdef([DOWN]) ]) AC_DEFUN([heroes_CHECK_ALLEGRO], [## Allegro support is hidden until it is better supported. test "${with_allegro_exec_prefix-no}" != no && test "${with_allegro-yes}" = yes && with_allegro="$with_allegro_exec_prefix" test "${with_allegro-yes}" != yes && test "${with_allegro_exec_prefix-yes}" = yes && with_allegro_exec_prefix="$with_allegro" if test "${with_allegro-yes}" != no; then if test "${with_allegro-no}" != no; then user_selection_list_vkm="$user_selection_list_vkm allvkm" fi dnl I'd like to check that `install_allegro()' is present. dnl Unfortunally, Allegro is playing tricky game with the main() dnl definition, and the testing program compiled by configure to dnl check for `install_allegro()' is not aware of that. AC_adl_PKG_GENERIC(allegro, [3.9.33], [], [], [with_allegro=no]) fi ## Also change -no to -yes. See above. if test "${with_allegro-no}" != no; then AC_adl_FIND_HEADER([allegro.h],[$ALLEGRO_CFLAGS], [/usr/include/allegro.h] dnl [/usr/local/include/allegro.h], [#[ ]*define[ ][ ]*KEY_*],7,, [AC_MSG_ERROR([Keysyms definitions not found: where is Allegro installed?])]) ALLEGRO_H="$ac_cv_header_path_allegro_h" AC_SUBST([ALLEGRO_H]) $1 ifelse([$2],,,[else $2]) fi ]) AC_DEFUN([heroes_CHECK_JOYSTICK_LIB], [AC_ARG_ENABLE([joystick], [AC_HELP_STRING([--disable-joystick], [turn off joystick support])]) if test "${enable_joystick-yes}" = yes; then # -- check for Joystick support in SDL if test "${with_sdl-yes}" != no; then if test "${with_sdl-no}" != no; then user_selection_list_j="$user_selection_list_j sdlj" fi OLIBS="$LIBS" LIBS="$LIBS $SDL_LIBS" AC_CHECK_FUNCS([SDL_JoystickOpen], [ adl_LIBALT_OK([sdlj], [SDL dnl $sdl_config_major_version.dnl $sdl_config_minor_version.dnl $sdl_config_micro_version], [], [], [sdlvkm])]) LIBS="$OLIBS" fi # -- Joystick support in Allegro is OK. if test "${with_allegro-yes}" != no; then if test "${with_allegro-no}" != no; then user_selection_list_j="$user_selection_list_j allj" fi adl_LIBALT_OK([allj], [Allegro dnl $allegro_config_major_version.dnl $allegro_config_minor_version.dnl $allegro_config_micro_version], [], [], [allvkm]) fi # -- check for LibGII (another way to get joystick support) if test "${with_gii-yes}" != no; then if test "${with_gii-no}" != no; then user_selection_list_j="$user_selection_list_j giij" fi AC_caolan_CHECK_PACKAGE([GII], [giiOpen], [gii], [ggi/gii.h], [adl_LIBALT_OK([giij], [LibGII], [$GII_LDFLAGS], [$GII_LIBS])]) fi else user_selection_list_j="dumj $user_selection_list_j" fi ]) AC_DEFUN([heroes_CHECK_SOUND_LIB], [AC_ARG_ENABLE([sound], [AC_HELP_STRING([--disable-sound],[turn off sound support])]) if test "${enable_sound-yes}" != no; then if test "${enable_sound-no}" != no; then user_selection_list_s="dums $user_selection_list_s" fi heroes_CHECK_SDL_MIXER([adl_LIBALT_OK([sdls], [SDL_mixer], [$SDL_MIXER_LDFLAGS], [$SDL_MIXER_LIBS], [sdlvkm])]) heroes_CHECK_MIKMOD([adl_LIBALT_OK([miks], [LibMikMod dnl $libmikmod_config_major_version.dnl $libmikmod_config_minor_version.dnl $libmikmod_config_micro_version], [], [$LIBMIKMOD_LIBS])]) fi]) AC_DEFUN([heroes_CHECK_SDL_MIXER], [# don't even try to check for SDL_mixer if SDL is not installed if test "${with_sdl-yes}" = no; then with_sdl_mixer=no fi # with_sdl if test "${with_sdl_mixer-yes}" != no; then if test "${with_sdl_mixer-no}" != no; then user_selection_list_s="$user_selection_list_s sdls" fi # temporaly put the CFLAGS for SDL in CPPFLAGS # so that AC_caolan_CHECK_PACKAGE can find SDL_mixer.h in the same directory. tmp_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$SDL_CFLAGS $CPPFLAGS" tmp_LIBS="$CPPLIBS" LIBS="$SDL_LIBS $LIBS" AC_caolan_CHECK_PACKAGE([SDL_mixer], [Mix_OpenAudio], [SDL_mixer], [SDL_mixer.h], [AC_DEFINE([HAVE_LIBSDL_MIXER], 1, [Define if you have the SDL_mixer library installed.])], [with_sdl_mixer=no]) # revert old value CPPFLAGS="$tmp_CPPFLAGS" LIBS="$tmp_LIBS" fi # with_sdl_mixer if test "x${with_sdl_mixer}" != xno; then with_sdl_mixer=yes $1 ifelse([$2],,,[else $2]) fi # with_sdl_mixer ]) AC_DEFUN([heroes_CHECK_MIKMOD], [AC_ARG_WITH([mikmod], [AC_HELP_STRING([--with-mikmod=DIR], [root directory of LibMikMod installation]) AC_HELP_STRING([--without-mikmod], [disables LibMikMod usage completely])]) # --with-mikmod-exec-prefix should imply --with-mikmod, and vice-versa test "${with_mikmod_exec_prefix-no}" != no && test "${with_mikmod-yes}" = yes && with_mikmod="$with_mikmod_exec_prefix" test "${with_mikmod-yes}" != yes && test "${with_mikmod_exec_prefix-yes}" = yes && with_mikmod_exec_prefix="$with_mikmod" if test "${with_mikmod-yes}" != no; then if test "${with_mikmod-no}" != no; then user_selection_list_s="$user_selection_list_s miks" fi AC_adl_PKG_GENERIC([LibMikMod], [3.1.7], [MikMod_Init], [], [with_mikmod=no]) # Since LibMikMod 3.1.10, libmikmod-config has moved some of # the libraries listed by --libs to the output of the --ldadd # option. So we append them to LIBMIKMOD_LIBS here. if test "${with_mikmod-yes}" != no; then LIBMIKMOD_LIBS="$LIBMIKMOD_LIBS `$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd`" fi fi if test "${with_mikmod-yes}" != no; then ifelse([$1],,[:],[$1]) ifelse([$2],,,[else $2]) fi]) dnl Some macros to configure with malloc() debugging libraries. dnl dnl Main functions: dnl adl_WITH_MTRACE handle the --with-mtrace option dnl adl_WITH_DMALLOC handle the --with-dmalloc option dnl adl_WITH_EFENCE handle the --with-efence option dnl adl_WITH_MPATROL handle the --with-mpatrol option dnl adl_ENABLE_MEM_DEBUG handle the --enable-mem-debug option dnl (i.e. use mpatrol, mtrace, dmalloc dnl or efence, whatever the first found is) dnl dnl Auxiliary functions: dnl adl_CHECK_MTRACE actually check for mtrace availability dnl adl_CHECK_DMALLOC actually check for dmalloc availability dnl adl_CHECK_EFENCE actually check for efence availability dnl adl_CHECK_MPATROL actually check for mpatrol availability dnl adl_CHECK_MEMORY_USAGE actually check gcc -fcheck-memory-usage dnl (can be used with mpatrol, currently dnl not called) dnl adl_CHECK_MPATROL_LIBS actually check for libraries needed by dnl mpatrol. dnl dnl Written by Alexandre Duret-Lutz AC_PREREQ([2.49]) dnl for AC_HELP_STRING dnl adl_CHECK_MTRACE([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for mtrace (GNU libc malloc debugging functions). dnl dnl This will define HAVE_MTRACE if mcheck.h and mtrace() exists. dnl dnl Use this macro in conjunction with the following code. dnl #if HAVE_MTRACE dnl # include dnl #else dnl # define mtrace() dnl # define muntrace() dnl #endif dnl and put the call to mtrace and muntrace where appropriate. AC_DEFUN([adl_CHECK_MTRACE], [test_failed='no' # should we check for mtrace? if test "$with_mtrace" = no; then test_failed='yes' else AC_CHECK_HEADER([mcheck.h], [AC_CHECK_FUNCS([mtrace],[$1],[test_failed=yes])], [test_failed=yes]) ifelse([$2],, [if test $test_failed = 'yes'; then AC_MSG_ERROR([Cannot find mtrace]) fi]) fi ifelse([$2],,, [if test "$test_failed" = yes; then $2 fi])]) dnl adl_WITH_MTRACE ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for dmalloc on user request. AC_DEFUN([adl_WITH_MTRACE], [AC_ARG_WITH([mtrace], [AC_HELP_STRING([--with-mtrace], [use GNU libc's mtrace for malloc () debugging])]) if test "$with_mtrace" = yes; then adl_CHECK_MTRACE fi]) dnl adl_CHECK_DMALLOC ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for dmalloc. dnl dnl This macro defines HAVE_DMALLOC_H when the dmalloc.h header is found. dnl dmalloc.h is not mandatory to use dmalloc, but it is better to dnl include it when available. Here is how: dnl dnl /* keep this header at the end of the include list, because it may dnl define some macros to change the declaration of malloc functions */ dnl #if HAVE_DMALLOC_H dnl # define DMALLOC_FUNC_CHECK dnl # include dnl #endif AC_DEFUN([adl_CHECK_DMALLOC], [test_failed='no' # should we check for dmalloc? if test "${with_dmalloc}" = no; then test_failed='yes' else # see if dmalloc is usable AC_CHECK_LIB([dmalloc],[malloc], [$1 LIBS="-ldmalloc $LIBS" AC_CHECK_HEADERS([dmalloc.h])], [ifelse([$2],,[AC_MSG_ERROR([Cannot find dmalloc])],[test_failed='yes'])]) fi ifelse([$2],,, [if test "$test_failed" = yes; then $2 fi])]) dnl adl_WITH_DMALLOC ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for dmalloc on user request. AC_DEFUN([adl_WITH_DMALLOC], [AC_ARG_WITH([dmalloc], [AC_HELP_STRING([--with-dmalloc], [link with dmalloc (a malloc() debugger)])]) if test "$with_dmalloc" = yes; then adl_CHECK_DMALLOC fi]) dnl adl_CHECK_EFENCE ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for efence. AC_DEFUN([adl_CHECK_EFENCE], [test_failed='no' # should we check for efence? if test "${with_efence}" = no; then test_failed='yes' else # see if efence is usable AC_CHECK_LIB([efence],[malloc], [$1 LIBS="-lefence $LIBS"], [ifelse([$2],,[AC_MSG_ERROR([Cannot find Electric Fence])], [test_failed='yes'])]) fi ifelse([$2],,, [if test "$test_failed" = yes; then $2 fi])]) dnl adl_WITH_EFENCE ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for efence on user request. AC_DEFUN([adl_WITH_EFENCE], [AC_ARG_WITH([efence], [AC_HELP_STRING([--with-efence], [link with efence (a malloc() debugger)])]) if test "$with_efence" = yes; then adl_CHECK_EFENCE fi]) dnl adl_CHECK_MEMORY_USAGE dnl Check wheter $CC supports the -fcheck-memory-usage option. AC_DEFUN([adl_CHECK_MEMORY_USAGE], [if test -n "$GCC"; then AC_CACHE_CHECK([wether $CC supports -fcheck-memory-usage], [ac_cv_check_memory_usage], [changequote(,)dnl cat > conftest.$ac_ext < dnl #endif AC_DEFUN([adl_CHECK_MPATROL], [test_failed='no' # should we check for mpatrol? if test "${with_mpatrol}" = no; then test_failed='yes' else # see if mpatrol is usable adl_CHECK_MPATROL_LIBS([$1 dnl CHECK_MEMORY_USAGE is disabled, because it causes much troubles dnl with asm statements in system headers. dnl adl_CHECK_MEMORY_USAGE AC_CHECK_HEADERS([mpatrol.h])], [ifelse([$2],,[AC_MSG_ERROR([Cannot find mpatrol])],[test_failed='yes'])]) fi ifelse([$2],,, [if test "$test_failed" = yes; then $2 fi])]) dnl adl_WITH_MPATROL ([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) dnl Check for mpatrol on user request. AC_DEFUN([adl_WITH_MPATROL], [AC_ARG_WITH([mpatrol], [AC_HELP_STRING([--with-patrol], [link with mpatrol (a malloc() debugger)])]) if test "$with_mpatrol" = yes; then adl_CHECK_MPATROL fi]) dnl adl_ENABLE_MEM_DEBUG dnl Check for dmalloc or efence on request, use the first library found. AC_DEFUN([adl_ENABLE_MEM_DEBUG], [# don't test anything if --with-dmalloc or --with-efence # was given (assume that adl_WITH_DMALLOC or adl_WITH_EFENCE # has already run). if test "${with_mpatrol-no}" = no && test "${with_mtrace-no}" = no && test "${with_dmalloc-no}" = no && test "${with_efence-no}" = no; then AC_ARG_ENABLE([mem-debug], [AC_HELP_STRING([--enable-mem-debug], [link with any malloc() debugger available])]) if test "$enable_mem_debug" = yes; then adl_CHECK_MPATROL(,[dnl adl_CHECK_MTRACE(,[dnl adl_CHECK_DMALLOC(,[dnl adl_CHECK_EFENCE])])]) fi fi]) dnl Compile, link, and run a dummy program. dnl This is used to ensure that further uses of AC_TRY_RUN dnl not fail (usually due to some unloadable libraries), AC_DEFUN([adl_RUN_CHECK], [AC_TRY_RUN( [main () { exit (0); }],, [AC_MSG_ERROR([=== Compiled programs no longer run whith this setup. Most usually this means one of the library checked for above is not correctly installed (for example it can depens over some other uninstalled library, or been installed in a location which is not looked at by your system). You might want to check the error messages in the file 'config.log'. If you believe this is a bug in Heroes, be sure to send the file 'config.log' with your report to . ])],[:])]) # Copyright 1996, 1997, 1998, 2000, 2001 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. # serial 1 AC_DEFUN([AM_C_PROTOTYPES], [AC_REQUIRE([AM_PROG_CC_STDC]) AC_REQUIRE([AC_PROG_CPP]) AC_MSG_CHECKING([for function prototypes]) if test "$am_cv_prog_cc_stdc" != no; then AC_MSG_RESULT(yes) AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes]) U= ANSI2KNR= else AC_MSG_RESULT(no) U=_ ANSI2KNR=./ansi2knr fi # Ensure some checks needed by ansi2knr itself. AC_HEADER_STDC AC_CHECK_HEADERS(string.h) AC_SUBST(U)dnl AC_SUBST(ANSI2KNR)dnl ]) # Copyright 1996, 1997, 1999, 2000, 2001 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. # serial 1 # @defmac AC_PROG_CC_STDC # @maindex PROG_CC_STDC # @ovindex CC # If the C compiler in not in ANSI C mode by default, try to add an option # to output variable @code{CC} to make it so. This macro tries various # options that select ANSI C on some system or another. It considers the # compiler to be in ANSI C mode if it handles function prototypes correctly. # # If you use this macro, you should check after calling it whether the C # compiler has been set to accept ANSI C; if not, the shell variable # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source # code in ANSI C, you can make an un-ANSIfied copy of it by using the # program @code{ansi2knr}, which comes with Ghostscript. # @end defmac AC_DEFUN([AM_PROG_CC_STDC], [AC_REQUIRE([AC_PROG_CC]) AC_BEFORE([$0], [AC_C_INLINE]) AC_BEFORE([$0], [AC_C_CONST]) dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require dnl a magic option to avoid problems with ANSI preprocessor commands dnl like #elif. dnl FIXME: can't do this because then AC_AIX won't work due to a dnl circular dependency. dnl AC_BEFORE([$0], [AC_PROG_CPP]) AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C]) AC_CACHE_VAL(am_cv_prog_cc_stdc, [am_cv_prog_cc_stdc=no ac_save_CC="$CC" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" AC_TRY_COMPILE( [#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; } 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; ], [ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ], [am_cv_prog_cc_stdc="$ac_arg"; break]) done CC="$ac_save_CC" ]) if test -z "$am_cv_prog_cc_stdc"; then AC_MSG_RESULT([none needed]) else AC_MSG_RESULT([$am_cv_prog_cc_stdc]) fi case "x$am_cv_prog_cc_stdc" in x|xno) ;; *) CC="$CC $am_cv_prog_cc_stdc" ;; esac ]) dnl We need opendir, readdir and closedir. This checks only for dnl readdir and assumes that opendir and closedir are present if readdir is. dnl Under plain Win32 (i.e. not Mingw or Cygwin) these functions are not dnl available, but can be emulated with lib/w_dirent.c. It's a bit odd to dnl perform that test here, since "plain Win32" users are unlikely to dnl run configure... Hence this code only documents when w_dirent.c should dnl be built. dnl dnl Written by Alexandre Duret-Lutz AC_DEFUN([adl_FUNC_READDIR], [AC_CHECK_FUNC([readdir], [AC_DEFINE([HAVE_READDIR],1,[Define if you have readdir and friends.])], [AC_CHECK_HEADER([windows.h], [# build w_dirent if readdir is absent and windows.h exists AC_LIBOBJ(w_dirent)], [AC_MSG_ERROR([Could not find `readdir'.])])])]) dnl @synopsis AC_FUNC_MKDIR dnl dnl Check whether mkdir() is mkdir or _mkdir, and whether it takes one or two dnl arguments. dnl dnl This macro can define HAVE_MKDIR, HAVE__MKDIR, and MKDIR_TAKES_ONE_ARG, dnl which are expected to be used as follow: dnl dnl #if HAVE_MKDIR dnl # if MKDIR_TAKES_ONE_ARG dnl /* Mingw32 */ dnl # define mkdir(a,b) mkdir(a) dnl # endif dnl #else dnl # if HAVE__MKDIR dnl /* plain Win32 */ dnl # define mkdir(a,b) _mkdir(a) dnl # else dnl # error "Don't know how to create a directory on this system." dnl # endif dnl #endif dnl dnl @version $Id$ dnl @author Written by Alexandre Duret-Lutz . AC_DEFUN([AC_FUNC_MKDIR], [AC_CHECK_FUNCS([mkdir _mkdir]) AC_CACHE_CHECK([whether mkdir takes one argument], [ac_cv_mkdir_takes_one_arg], [AC_TRY_COMPILE([ #include #if HAVE_UNISTD_H # include #endif ],[mkdir (".");], [ac_cv_mkdir_takes_one_arg=yes],[ac_cv_mkdir_takes_one_arg=no])]) if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then AC_DEFINE([MKDIR_TAKES_ONE_ARG],1, [Define if mkdir takes only one argument.]) fi ]) dnl Note: dnl ===== dnl I have not implemented the following suggestion because I don't have dnl access to such a broken environment to test the macro. So I'm just dnl appending the comments here in case you have, and want to fix dnl AC_FUNC_MKDIR that way. dnl dnl |Thomas E. Dickey (dickey@herndon4.his.com) said: dnl | it doesn't cover the problem areas (compilers that mistreat mkdir dnl | may prototype it in dir.h and dirent.h, for instance). dnl | dnl |Alexandre: dnl | Would it be sufficient to check for these headers and #include dnl | them in the AC_TRY_COMPILE block? (and is AC_HEADER_DIRENT dnl | suitable for this?) dnl | dnl |Thomas: dnl | I think that might be a good starting point (with the set of recommended dnl | ifdef's and includes for AC_HEADER_DIRENT, of course). #serial 5 dnl From Jim Meyering. dnl Determine whether malloc accepts 0 as its argument. dnl If it doesn't, arrange to use the replacement function. dnl AC_DEFUN([jm_FUNC_MALLOC], [ dnl xmalloc.c requires that this symbol be defined so it doesn't dnl mistakenly use a broken malloc -- as it might if this test were omitted. AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1, [Define if the malloc check has been performed. ]) AC_CACHE_CHECK([for working malloc], jm_cv_func_working_malloc, [AC_TRY_RUN([ char *malloc (); int main () { exit (malloc (0) ? 0 : 1); } ], jm_cv_func_working_malloc=yes, jm_cv_func_working_malloc=no, dnl When crosscompiling, assume malloc is broken. jm_cv_func_working_malloc=no) ]) if test $jm_cv_func_working_malloc = no; then AC_LIBOBJ(malloc) AC_DEFINE(malloc, rpl_malloc, [Define to rpl_malloc if the replacement function should be used.]) fi ]) #serial 5 dnl From Jim Meyering. dnl Determine whether realloc works when both arguments are 0. dnl If it doesn't, arrange to use the replacement function. dnl AC_DEFUN([jm_FUNC_REALLOC], [ dnl xmalloc.c requires that this symbol be defined so it doesn't dnl mistakenly use a broken realloc -- as it might if this test were omitted. AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1, [Define if the realloc check has been performed. ]) AC_CACHE_CHECK([for working realloc], jm_cv_func_working_realloc, [AC_TRY_RUN([ char *realloc (); int main () { exit (realloc (0, 0) ? 0 : 1); } ], jm_cv_func_working_realloc=yes, jm_cv_func_working_realloc=no, dnl When crosscompiling, assume realloc is broken. jm_cv_func_working_realloc=no) ]) if test $jm_cv_func_working_realloc = no; then AC_LIBOBJ(realloc) AC_DEFINE(realloc, rpl_realloc, [Define to rpl_realloc if the replacement function should be used.]) fi ]) #serial 1003 # Experimental replacement for the function in the latest CVS autoconf. # Use with the error.c file in ../lib. # Copyright 2001 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. */ undefine([AC_FUNC_STRERROR_R]) # AC_FUNC_STRERROR_R # ------------------ AC_DEFUN([AC_FUNC_STRERROR_R], [AC_CHECK_DECLS([strerror_r]) AC_CHECK_FUNCS([strerror_r]) AC_CACHE_CHECK([whether strerror_r returns char *], ac_cv_func_strerror_r_char_p, [ ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT], [[ char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); ]])], ac_cv_func_strerror_r_char_p=yes) else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT extern char *strerror_r ();], [[char buf[100]; char x = *strerror_r (0, buf, sizeof buf); exit (!isalpha (x));]])], ac_cv_func_strerror_r_char_p=yes, , :) fi ]) if test $ac_cv_func_strerror_r_char_p = yes; then AC_DEFINE([STRERROR_R_CHAR_P], 1, [Define to 1 if strerror_r returns char *.]) fi ])# AC_FUNC_STRERROR_R #serial 4 # See if we need to emulate a missing ftruncate function using fcntl or chsize. AC_DEFUN([jm_FUNC_FTRUNCATE], [ AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes]) if test "$ftruncate_missing" = yes; then AC_CHECK_HEADERS([unistd.h]) AC_CHECK_FUNCS([chsize]) AC_LIBOBJ(ftruncate) fi ]) dnl @synopsis adl_FUNC_GETOPT_LONG dnl dnl Check for getopt_long support. dnl dnl This assume that the standard getopt.h file (from GNU libc) is dnl available as lib/gnugetopt.h. If needed, this file will be linked dnl as getopt.h, but we want to default to the system's getopt.h file. dnl (See http://sources.redhat.com/ml/automake/2000-09/msg00041.html dnl for an explanation about why using the system's getopt.h file dnl is important.) dnl dnl @version $Id$ dnl @author Alexandre Duret-Lutz AC_PREREQ(2.49) AC_DEFUN([adl_FUNC_GETOPT_LONG], [# clean out junk possibly left behind by a previous configuration rm -f lib/getopt.h # Check for getopt_long support AC_CHECK_HEADER([getopt.h]) AC_CHECK_FUNCS([getopt_long],, [# FreeBSD has a gnugetopt library for this AC_CHECK_LIB([gnugetopt],[getopt_long],[AC_DEFINE([HAVE_GETOPT_LONG])], [# use the GNU replacement AC_LIBOBJ(getopt) AC_LIBOBJ(getopt1) AC_CONFIG_LINKS([lib/getopt.h:lib/gnugetopt.h])])])]) # Check for functions and headers needed by lib/filelock.c AC_DEFUN([adl_FILELOCK], [ AC_CHECK_HEADERS([fcntl.h sys/file.h io.h sys/locking.h]) AC_CHECK_FUNCS([fcntl flock _locking]) ]) dnl @synopsis AC_C_BIGENDIAN_CROSS dnl dnl Check endianess even when crosscompiling dnl (partially based on the original AC_C_BIGENDIAN). dnl dnl The implementation will create a binary, and instead of running dnl the binary it will be grep'ed for some symbols that will look dnl different for different endianess of the binary. dnl dnl @version $Id: ac_c_bigendian_cross.m4,v 1.1 2000/09/09 13:29:23 simons Exp $ dnl @author Guido Draheim dnl AC_DEFUN([AC_C_BIGENDIAN_CROSS], [AC_CACHE_CHECK([whether byte ordering is bigendian], [ac_cv_c_bigendian], [# See if sys/param.h defines the BYTE_ORDER macro. AC_TRY_COMPILE([#include #include ], [ #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif], [# It does; now see whether it defined to BIG_ENDIAN or not. AC_TRY_COMPILE([#include #include ], [ #if BYTE_ORDER != BIG_ENDIAN not big endian #endif], [ac_cv_c_bigendian=yes], [ac_cv_c_bigendian=no])], [# It does not, try to run a simple test AC_TRY_RUN([main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); }], [ac_cv_c_bigendian=no], [ac_cv_c_bigendian=yes], [ac_cv_c_bigendian="unknown (cross-compiling)"]) ])]) if test "$ac_cv_c_bigendian" = "unknown (cross-compiling)"; then AC_MSG_CHECKING([whether byte order LOOKS bigendian]) [cat >conftest.c <, 1995. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU Public License # but which still want to provide support for the GNU gettext functionality. # Please note that the actual code is *not* freely available. # serial 9 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]). dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, dnl depending on --{enable,disable}-{shared,static} and on the presence of dnl AM-DISABLE-SHARED). Otherwise, a static library dnl $(top_builddir)/intl/libintl.a will be created. dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext dnl implementations (in libc or libintl) without the ngettext() function dnl will be ignored. dnl LIBDIR is used to find the intl libraries. If empty, dnl the value `$(top_builddir)/intl/' is used. dnl dnl The result of the configuration is one of three cases: dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled dnl and used. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 2) GNU gettext has been found in the system's C library. dnl Catalog format: GNU --> install in $(datadir) dnl Catalog extension: .mo after installation, .gmo in source tree dnl 3) No internationalization, always use English msgid. dnl Catalog format: none dnl Catalog extension: none dnl The use of .gmo is historical (it was needed to avoid overwriting the dnl GNU format catalogs when building on a platform with an X/Open gettext), dnl but we keep it in order not to force irrelevant filename changes on the dnl maintainers. dnl AC_DEFUN([AM_WITH_NLS], [AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS AC_ARG_ENABLE(nls, [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) AC_MSG_RESULT($USE_NLS) AC_SUBST(USE_NLS) BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no INTLLIBS= dnl If we use NLS figure out what method if test "$USE_NLS" = "yes"; then AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if translation of program messages to the user's native language is requested.]) AC_MSG_CHECKING([whether included gettext is requested]) AC_ARG_WITH(included-gettext, [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then dnl User does not insist on using GNU NLS library. Figure out what dnl to use. If GNU gettext is available we use this. Else we have dnl to fall back to GNU NLS library. CATOBJEXT=NONE dnl Add a version number to the cache macros. define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc]) define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl]) AC_CHECK_HEADER(libintl.h, [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, [AC_TRY_LINK([#include extern int _nl_msg_cat_cntr;], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], gt_cv_func_gnugettext_libc=yes, gt_cv_func_gnugettext_libc=no)]) if test "$gt_cv_func_gnugettext_libc" != "yes"; then AC_CACHE_CHECK([for GNU gettext in libintl], gt_cv_func_gnugettext_libintl, [gt_save_LIBS="$LIBS" LIBS="$LIBS -lintl $LIBICONV" AC_TRY_LINK([#include extern int _nl_msg_cat_cntr;], [bindtextdomain ("", ""); return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], gt_cv_func_gnugettext_libintl=yes, gt_cv_func_gnugettext_libintl=no) LIBS="$gt_save_LIBS"]) fi dnl If an already present or preinstalled GNU gettext() is found, dnl use it. But if this macro is used in GNU gettext, and GNU dnl gettext is already preinstalled in libintl, we update this dnl libintl. (Cf. the install rule in intl/Makefile.in.) if test "$gt_cv_func_gnugettext_libc" = "yes" \ || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ && test "$PACKAGE" != gettext; }; then AC_DEFINE(HAVE_GETTEXT, 1, [Define if the GNU gettext() function is already present or preinstalled.]) if test "$gt_cv_func_gnugettext_libintl" = "yes"; then dnl If iconv() is in a separate libiconv library, then anyone dnl linking with libintl{.a,.so} also needs to link with dnl libiconv. INTLLIBS="-lintl $LIBICONV" fi gt_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" AC_CHECK_FUNCS(dcgettext) LIBS="$gt_save_LIBS" AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl if test "$MSGFMT" != "no"; then AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) fi AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) CATOBJEXT=.gmo fi ]) if test "$CATOBJEXT" = "NONE"; then dnl GNU gettext is not found in the C library. dnl Fall back on GNU gettext library. nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then dnl Mark actions used to generate GNU NLS library. INTLOBJS="\$(GETTOBJS)" AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) AC_SUBST(MSGFMT) BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi dnl Test whether we really found GNU xgettext. if test "$XGETTEXT" != ":"; then dnl If it is no GNU xgettext we define it as : so that the dnl Makefiles still can work. if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else AC_MSG_RESULT( [found xgettext program is not GNU xgettext; ignore it]) XGETTEXT=":" fi fi dnl We need to process the po/ directory. POSUB=po fi AC_OUTPUT_COMMANDS( [for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" fi ;; esac done]) dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL dnl to 'yes' because some of the testsuite requires it. if test "$PACKAGE" = gettext; then BUILD_INCLUDED_LIBINTL=yes fi dnl intl/plural.c is generated from intl/plural.y. It requires bison, dnl because plural.y uses bison specific features. It requires at least dnl bison-1.26 because earlier versions generate a plural.c that doesn't dnl compile. dnl bison is only needed for the maintainer (who touches plural.y). But in dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put dnl the rule in general Makefile. Now, some people carelessly touch the dnl files or have a broken "make" program, hence the plural.c rule will dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not dnl present or too old. AC_CHECK_PROGS([INTLBISON], [bison]) if test -z "$INTLBISON"; then ac_verc_fail=yes else dnl Found it, now check the version. AC_MSG_CHECKING([version of bison]) changequote(<<,>>)dnl ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) changequote([,])dnl ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac AC_MSG_RESULT([$ac_prog_version]) fi if test $ac_verc_fail = yes; then INTLBISON=: fi dnl These rules are solely for the distribution goal. While doing this dnl we only have to keep exactly one list of the available catalogs dnl in configure.in. for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done dnl Make all variables we use known to autoconf. AC_SUBST(BUILD_INCLUDED_LIBINTL) AC_SUBST(USE_INCLUDED_LIBINTL) AC_SUBST(CATALOGS) AC_SUBST(CATOBJEXT) AC_SUBST(GMOFILES) AC_SUBST(INTLLIBS) AC_SUBST(INTLOBJS) AC_SUBST(POFILES) AC_SUBST(POSUB) dnl For backward compatibility. Some configure.ins may be using this. nls_cv_header_intl= nls_cv_header_libgt= dnl For backward compatibility. Some Makefiles may be using this. DATADIRNAME=share AC_SUBST(DATADIRNAME) dnl For backward compatibility. Some Makefiles may be using this. INSTOBJEXT=.mo AC_SUBST(INSTOBJEXT) dnl For backward compatibility. Some Makefiles may be using this. GENCAT=gencat AC_SUBST(GENCAT) ]) dnl Usage: Just like AM_WITH_NLS, which see. AC_DEFUN([AM_GNU_GETTEXT], [AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_RANLIB])dnl AC_REQUIRE([AC_ISC_POSIX])dnl AC_REQUIRE([AC_HEADER_STDC])dnl AC_REQUIRE([AC_C_CONST])dnl AC_REQUIRE([AC_C_INLINE])dnl AC_REQUIRE([AC_TYPE_OFF_T])dnl AC_REQUIRE([AC_TYPE_SIZE_T])dnl AC_REQUIRE([AC_FUNC_ALLOCA])dnl AC_REQUIRE([AC_FUNC_MMAP])dnl AC_REQUIRE([jm_GLIBC21])dnl AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h]) AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \ getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) AM_ICONV AM_LANGINFO_CODESET AM_LC_MESSAGES AM_WITH_NLS([$1],[$2],[$3]) if test "x$CATOBJEXT" != "x"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else AC_MSG_CHECKING(for catalogs to be installed) NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS AC_MSG_RESULT($LINGUAS) fi dnl Construct list of names of catalog files to be constructed. if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly dnl find the mkinstalldirs script in another subdir but $(top_srcdir). dnl Try to locate is. MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi AC_SUBST(MKINSTALLDIRS) dnl Enable libtool support if the surrounding package wishes it. INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], []) AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) ]) # Search path for a program which passes the given test. # Ulrich Drepper , 1996. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License or the GNU Library General Public License but which still want # to provide support for the GNU gettext functionality. # Please note that the actual code of the GNU gettext library is covered # by the GNU Library General Public License, and the rest of the GNU # gettext package package is covered by the GNU General Public License. # They are *not* in the public domain. # serial 2 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) AC_DEFUN([AM_PATH_PROG_WITH_TEST], [# Extract the first word of "$2", so it can be a program name with args. set dummy $2; ac_word=[$]2 AC_MSG_CHECKING([for $ac_word]) AC_CACHE_VAL(ac_cv_path_$1, [case "[$]$1" in /*) ac_cv_path_$1="[$]$1" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in ifelse([$5], , $PATH, [$5]); do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if [$3]; then ac_cv_path_$1="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" dnl If no 4th arg is given, leave the cache variable unset, dnl so AC_PATH_PROGS will keep looking. ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" ])dnl ;; esac])dnl $1="$ac_cv_path_$1" if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then AC_MSG_RESULT([$]$1) else AC_MSG_RESULT(no) fi AC_SUBST($1)dnl ]) #serial 2 # Test for the GNU C Library, version 2.1 or newer. # From Bruno Haible. AC_DEFUN([jm_GLIBC21], [ AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, ac_cv_gnu_library_2_1, [AC_EGREP_CPP([Lucky GNU user], [ #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif ], ac_cv_gnu_library_2_1=yes, ac_cv_gnu_library_2_1=no) ] ) AC_SUBST(GLIBC21) GLIBC21="$ac_cv_gnu_library_2_1" ] ) #serial AM2 dnl From Bruno Haible. AC_DEFUN([AM_ICONV], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_ARG_WITH([libiconv-prefix], [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi done ]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi LIBICONV= if test "$am_cv_lib_iconv" = yes; then LIBICONV="-liconv" fi AC_SUBST(LIBICONV) ]) #serial AM1 dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([#include ], [char* cs = nl_langinfo(CODESET);], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test $am_cv_langinfo_codeset = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ]) # Check whether LC_MESSAGES is available in . # Ulrich Drepper , 1995. # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License or the GNU Library General Public License but which still want # to provide support for the GNU gettext functionality. # Please note that the actual code of the GNU gettext library is covered # by the GNU Library General Public License, and the rest of the GNU # gettext package package is covered by the GNU General Public License. # They are *not* in the public domain. # serial 2 AC_DEFUN([AM_LC_MESSAGES], [if test $ac_cv_header_locale_h = yes; then AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, [AC_TRY_LINK([#include ], [return LC_MESSAGES], am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) if test $am_cv_val_LC_MESSAGES = yes; then AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your file defines LC_MESSAGES.]) fi fi]) AC_DEFUN([adl_ENABLE_DEVEL], [AC_ARG_ENABLE([devel], [AC_HELP_STRING([--enable-devel], [turn on useful developer options])]) if test x"$enable_devel" = xyes; then enable_debug=${enable_debug-yes} enable_warnings=${enable_warnings-yes} enable_assert=${enable_assert-yes} enable_optimizations=${enable_optimizations--O} fi ]) AC_DEFUN([adl_NDEBUG], [AC_ARG_ENABLE([assert], [AC_HELP_STRING([--enable-assert],[turn on assertions])]) if test "$enable_assert" != yes; then CFLAGS="$CFLAGS -DNDEBUG" fi]) AC_DEFUN([adl_ENABLE_GPROF], [AC_ARG_ENABLE([gprof], [AC_HELP_STRING([--enable-gprof],[enable gprof profiling])]) if test "${enable_gprof}" = "yes" -a -n "$GCC"; then CFLAGS="$CFLAGS -pg" fi]) AC_DEFUN([adl_ENABLE_DEBUG], [AC_ARG_ENABLE([debug], [AC_HELP_STRING([--enable-debug],[enable debugging symbols])]) case "${enable_debug}" in yes) AC_DEFINE([DEBUG],1,[Define if you want debugging code.]) if test -n "$GCC"; then CFLAGS="$CFLAGS -ggdb3" else if test "${ac_cv_prog_cc_g}" = yes; then CFLAGS="$CFLAGS -g" fi fi ;; no) ;; *) if test "${ac_cv_prog_cc_g}" = yes; then CFLAGS="$CFLAGS -g" fi ;; esac]) dnl Adapted from Akim Demaille ad_GCC_WARNINGS. AC_DEFUN([ad_GCC_OPTIM], [AC_ARG_ENABLE([optimizations], [AC_HELP_STRING([--disable-optimizations], [turn off aggressive optimizations])]) if test -n "$GCC" -a "${enable_optimizations-yes}" = "yes"; then AC_CACHE_CHECK([for gcc optimization options], ac_cv_prog_gcc_opt_flags, [changequote(,)dnl cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < dnl @version $Id: $ AC_DEFUN([adl_COMPUTE_RELATIVE_PATHS], [for _lcl_i in $1; do _lcl_from=\[$]`echo "[$]_lcl_i" | sed 's,:.*$,,'` _lcl_to=\[$]`echo "[$]_lcl_i" | sed 's,^[[^:]]*:,,' | sed 's,:[[^:]]*$,,'` _lcl_result_var=`echo "[$]_lcl_i" | sed 's,^.*:,,'` adl_RECURSIVE_EVAL([[$]_lcl_from], [_lcl_from]) adl_RECURSIVE_EVAL([[$]_lcl_to], [_lcl_to]) _lcl_notation="$_lcl_from$_lcl_to" adl_NORMALIZE_PATH([_lcl_from],['/']) adl_NORMALIZE_PATH([_lcl_to],['/']) adl_COMPUTE_RELATIVE_PATH([_lcl_from], [_lcl_to], [_lcl_result_tmp]) adl_NORMALIZE_PATH([_lcl_result_tmp],["[$]_lcl_notation"]) eval $_lcl_result_var='[$]_lcl_result_tmp' done]) dnl adl_COMPUTE_RELATIVE_PATH(FROM, TO, RESULT) dnl =========================================== dnl Compute the relative path to go from $FROM to $TO and set the value dnl of $RESULT to that value. This function work on raw filenames dnl (for instance it will consider /usr//local and /usr/local as dnl two distinct paths), you should really use adl_COMPUTE_REALTIVE_PATHS dnl instead to have the paths sanitized automatically. dnl dnl For instance: dnl first_dir=/somewhere/on/my/disk/bin dnl second_dir=/somewhere/on/another/disk/share dnl adl_COMPUTE_RELATIVE_PATH(first_dir, second_dir, first_to_second) dnl will set $first_to_second to '../../../another/disk/share'. AC_DEFUN([adl_COMPUTE_RELATIVE_PATH], [adl_COMPUTE_COMMON_PATH([$1], [$2], [_lcl_common_prefix]) adl_COMPUTE_BACK_PATH([$1], [_lcl_common_prefix], [_lcl_first_rel]) adl_COMPUTE_SUFFIX_PATH([$2], [_lcl_common_prefix], [_lcl_second_suffix]) $3="[$]_lcl_first_rel[$]_lcl_second_suffix"]) dnl adl_COMPUTE_COMMON_PATH(LEFT, RIGHT, RESULT) dnl ============================================ dnl Compute the common path to $LEFT and $RIGHT and set the result to $RESULT. dnl dnl For instance: dnl first_path=/somewhere/on/my/disk/bin dnl second_path=/somewhere/on/another/disk/share dnl adl_COMPUTE_COMMON_PATH(first_path, second_path, common_path) dnl will set $common_path to '/somewhere/on'. AC_DEFUN([adl_COMPUTE_COMMON_PATH], [$3='' _lcl_second_prefix_match='' while test "[$]_lcl_second_prefix_match" != 0; do _lcl_first_prefix=`expr "x[$]$1" : "x\([$]$3/*[[^/]]*\)"` _lcl_second_prefix_match=`expr "x[$]$2" : "x[$]_lcl_first_prefix"` if test "[$]_lcl_second_prefix_match" != 0; then if test "[$]_lcl_first_prefix" != "[$]$3"; then $3="[$]_lcl_first_prefix" else _lcl_second_prefix_match=0 fi fi done]) dnl adl_COMPUTE_SUFFIX_PATH(PATH, SUBPATH, RESULT) dnl ============================================== dnl Substrack $SUBPATH from $PATH, and set the resulting suffix dnl (or the empty string if $SUBPATH is not a subpath of $PATH) dnl to $RESULT. dnl dnl For instance: dnl first_path=/somewhere/on/my/disk/bin dnl second_path=/somewhere/on dnl adl_COMPUTE_SUFFIX_PATH(first_path, second_path, common_path) dnl will set $common_path to '/my/disk/bin'. AC_DEFUN([adl_COMPUTE_SUFFIX_PATH], [$3=`expr "x[$]$1" : "x[$]$2/*\(.*\)"`]) dnl adl_COMPUTE_BACK_PATH(PATH, SUBPATH, RESULT) dnl ============================================ dnl Compute the relative path to go from $PATH to $SUBPATH, knowing that dnl $SUBPATH is a subpath of $PATH (any other words, only repeated '../' dnl should be needed to move from $PATH to $SUBPATH) and set the value dnl of $RESULT to that value. If $SUBPATH is not a subpath of PATH, dnl set $RESULT to the empty string. dnl dnl For instance: dnl first_path=/somewhere/on/my/disk/bin dnl second_path=/somewhere/on dnl adl_COMPUTE_BACK_PATH(first_path, second_path, back_path) dnl will set $back_path to '../../../'. AC_DEFUN([adl_COMPUTE_BACK_PATH], [adl_COMPUTE_SUFFIX_PATH([$1], [$2], [_lcl_first_suffix]) $3='' _lcl_tmp='xxx' while test "[$]_lcl_tmp" != ''; do _lcl_tmp=`expr "x[$]_lcl_first_suffix" : "x[[^/]]*/*\(.*\)"` if test "[$]_lcl_first_suffix" != ''; then _lcl_first_suffix="[$]_lcl_tmp" $3="../[$]$3" fi done]) dnl adl_RECURSIVE_EVAL(VALUE, RESULT) dnl ================================= dnl Interpolate the VALUE in loop until it doesn't change, dnl and set the result to $RESULT. dnl WARNING: It's easy to get an infinite loop with some unsane input. AC_DEFUN([adl_RECURSIVE_EVAL], [_lcl_receval="$1" $2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" _lcl_receval_old='' while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do _lcl_receval_old="[$]_lcl_receval" eval _lcl_receval="\"[$]_lcl_receval\"" done echo "[$]_lcl_receval")`]) dnl @synopsis adl_NORMALIZE_PATH(VARNAME, [REFERENCE_STRING]) dnl dnl Perform some cleanups on the value of $VARNAME (interpreted as a path): dnl - empty paths are changed to '.' dnl - trailing slashes are removed dnl - repeated slashes are squeezed except a leading doubled slash '//' dnl (which might indicate a networked disk on some OS). dnl dnl REFERENCE_STRING is used to turn '/' into '\' and vice-versa: dnl if REFERENCE_STRING contains some backslashes, all slashes and backslashes dnl are turned into backslashes, otherwise they are all turned into slashes. dnl dnl This makes processing of DOS filenames quite easier, because you dnl can turn a filename to the Unix notation, make your processing, and dnl turn it back to original notation. dnl dnl filename='A:\FOO\\BAR\' dnl old_filename="$filename" dnl # Switch to the unix notation dnl adl_NORMALIZE_PATH([filename], ["/"]) dnl # now we have $filename = 'A:/FOO/BAR' and we can process it as if dnl # it was a Unix path. For instance let's say that you want dnl # to append '/subpath': dnl filename="$filename/subpath" dnl # finally switch back to the original notation dnl adl_NORMALIZE_PATH([filename], ["$old_filename"]) dnl # now $filename equals to 'A:\FOO\BAR\subpath' dnl dnl One good reason to make all path processing with the unix convention dnl is that backslashes have a special meaning in many cases. For instance dnl dnl expr 'A:\FOO' : 'A:\Foo' dnl dnl will return 0 because the second argument is a regex in which dnl backslashes have to be backslashed. In other words, to have the dnl two strings to match you should write this instead: dnl dnl expr 'A:\Foo' : 'A:\\Foo' dnl dnl Such behavior makes DOS filenames extremely unpleasant to work with. dnl So temporary turn your paths to the Unix notation, and revert dnl them to the original notation after the processing. See the dnl macro adl_COMPUTE_RELATIVE_PATHS for a concrete example of this. dnl dnl REFERENCE_STRING defaults to $VARIABLE, this means that slashes dnl will be converted to backslashes if $VARIABLE already contains dnl some backslashes (see $thirddir below). dnl dnl firstdir='/usr/local//share' dnl seconddir='C:\Program Files\\' dnl thirddir='C:\home/usr/' dnl adl_NORMALIZE_PATH([firstdir]) dnl adl_NORMALIZE_PATH([seconddir]) dnl adl_NORMALIZE_PATH([thirddir]) dnl # $firstdir = '/usr/local/share' dnl # $seconddir = 'C:\Program Files' dnl # $thirddir = 'C:\home\usr' dnl dnl @author Alexandre Duret-Lutz dnl @version $Id: $ AC_DEFUN([adl_NORMALIZE_PATH], [case ":[$]$1:" in # change empty paths to '.' ::) $1='.' ;; # strip trailing slashes :*[[\\/]]:) $1=`echo "[$]$1" | sed 's,[[\\/]]*[$],,'` ;; :*:) ;; esac # squeze repeated slashes case ifelse($2,,"[$]$1",$2) in # if the path contains any backslashes, turn slashes into backslashes *\\*) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1\\\\,g'` ;; # if the path contains slashes, also turn backslashes into slashes *) $1=`echo "[$]$1" | sed 's,\(.\)[[\\/]][[\\/]]*,\1/,g'` ;; esac]) dnl @synopsis AC_DEFINE_DIR(VARNAME, DIR [, DESCRIPTION]) dnl dnl This macro defines (with AC_DEFINE) VARNAME to the expansion of the DIR dnl variable, taking care of fixing up ${prefix} and such. dnl dnl Note that the 3 argument form is only supported with autoconf 2.13 and dnl later (i.e. only where AC_DEFINE supports 3 arguments). dnl dnl Examples: dnl dnl AC_DEFINE_DIR(DATADIR, datadir) dnl AC_DEFINE_DIR(PROG_PATH, bindir, [Location of installed binaries]) dnl dnl @version $Id: ac_define_dir.m4,v 1.2 2000/07/19 13:03:32 simons Exp $ dnl @author Alexandre Oliva AC_DEFUN([AC_DEFINE_DIR], [ ac_expanded=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""[$]$2"\" )` ifelse($3, , AC_DEFINE_UNQUOTED($1, "$ac_expanded"), AC_DEFINE_UNQUOTED($1, "$ac_expanded", $3)) ]) dnl Handle the --enable-html-doc option. dnl dnl The following snippet goes into doc/Makefile.am dnl ------------------------ dnl CLEANFILES = yourfile.html dnl dnl if MAKE_HTML dnl hdir = @htmldir@ dnl h_DATA = yourfile.html dnl endif dnl dnl SUFFIXES = .html dnl dnl .texi.html: dnl @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] dnl cd $(srcdir) && $(MAKEINFO) --html `echo $< | sed 's,.*/,,'` dnl ------------------------ dnl dnl Written by Alexandre Duret-Lutz AC_DEFUN([adl_ENABLE_HTML_DOC], [AC_ARG_ENABLE([html-doc], [AC_HELP_STRING([--enable-html-doc=DIR], [build and install html documentation])]) if test "${enable_html_doc-no}" != no; then if test "x$enable_html_doc" = xyes; then htmldir="$data_dir/doc" else htmldir="$enable_html_doc" fi AC_SUBST([htmldir]) else htmldir='\' fi AM_CONDITIONAL(MAKE_HTML, [test "${enable_html_doc-no}" != no])]) AC_DEFUN([heroes_DEBUG], [AC_ARG_ENABLE([heroes-debug], [AC_HELP_STRING([--disable-heroes-debug],[disable tracing facility])]) if test "x$enable_heroes_debug" != xno; then AC_DEFINE([USE_HEROES_DEBUG],1,[Define if you want tracing code.]) fi]) # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- # Copyright 1996, 1997, 2000, 2001 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. AC_PREREQ([2.52]) # serial 6 # 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. We must strip everything past the first ":", # and everything past the last "/". # _AM_DIRNAME(PATH) # ----------------- # Like AS_DIRNAME, only do it during macro expansion AC_DEFUN([_AM_DIRNAME], [m4_if(regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1, m4_if(regexp([$1], [^//\([^/]\|$\)]), -1, m4_if(regexp([$1], [^/.*]), -1, [.], patsubst([$1], [^\(/\).*], [\1])), patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])), patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl ])# _AM_DIRNAME # The stamp files are numbered to have different names. # We could number them on a directory basis, but that's additional # complications, let's have a unique counter. m4_define([_AM_STAMP_Count], [0]) # _AM_STAMP(HEADER) # ----------------- # The name of the stamp file for HEADER. AC_DEFUN([_AM_STAMP], [m4_define([_AM_STAMP_Count], m4_incr(_AM_STAMP_Count))dnl AS_ESCAPE(_AM_DIRNAME(patsubst([$1], [:.*])))/stamp-h[]_AM_STAMP_Count]) # _AM_CONFIG_HEADER(HEADER[:SOURCES], COMMANDS, INIT-COMMANDS) # ------------------------------------------------------------ # We used to try to get a real timestamp in stamp-h. But the fear is that # that will cause unnecessary cvs conflicts. AC_DEFUN([_AM_CONFIG_HEADER], [# Add the stamp file to the list of files AC keeps track of, # along with our hook. AC_CONFIG_HEADERS([$1], [# update the timestamp echo 'timestamp for $1' >"_AM_STAMP([$1])" $2], [$3]) ])# _AM_CONFIG_HEADER # AM_CONFIG_HEADER(HEADER[:SOURCES]..., COMMANDS, INIT-COMMANDS) # -------------------------------------------------------------- AC_DEFUN([AM_CONFIG_HEADER], [AC_FOREACH([_AM_File], [$1], [_AM_CONFIG_HEADER(_AM_File, [$2], [$3])]) ])# AM_CONFIG_HEADER heroes-0.21/configure0000755004117000411500000153575307451373620010341 #! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.53 for heroes 0.21. # # Report bugs to . # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # # Copyright 2000, 2001, 2002 Alexandre Duret-Lutz if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='heroes' PACKAGE_TARNAME='heroes' PACKAGE_VERSION='0.21' PACKAGE_STRING='heroes 0.21' PACKAGE_BUGREPORT='heroes-bugs@lists.sourceforge.net' ac_unique_file="src/heroes.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" # Initialize some variables set by options. ac_init_help= ac_init_version=false # 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. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= 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 ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -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 | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$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 ;; -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 ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) 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 ;; -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_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=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 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && 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'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac 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 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 # 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 its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | 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 if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # 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 heroes 0.21 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 \`..'] _ACEOF cat <<_ACEOF 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] --datadir=DIR read-only architecture-independent data [PREFIX/share] --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] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of heroes 0.21:";; esac cat <<\_ACEOF Optional Features: --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 builds --enable-dependency-tracking Do not reject slow dependency extractors --disable-joystick turn off joystick support --disable-sound turn off sound support --disable-display don't draw anything on screen --enable-mem-debug link with any malloc() debugger available --disable-nls do not use Native Language Support --enable-devel turn on useful developer options --enable-assert turn on assertions --enable-gprof enable gprof profiling --enable-debug enable debugging symbols --disable-optimizations turn off aggressive optimizations --enable-warnings enable compiler warnings --enable-html-doc=DIR build and install html documentation --disable-heroes-debug disable tracing facility Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-ggi=DIR root directory of GGI installation --with-ggi-include=DIR specify exact include dir for GGI headers --with-ggi-libdir=DIR specify exact library dir for GGI library --without-ggi disables ggi usage completely --with-sdl=DIR root directory of SDL installation --without-sdl disables SDL usage completely --with-sdl-prefix=PFX Prefix where sdl is installed (optional) --with-sdl-exec-prefix=PFX Exec prefix where sdl is installed (optional) --with-allegro-prefix=PFX Prefix where allegro is installed (optional) --with-allegro-exec-prefix=PFX Exec prefix where allegro is installed (optional) --with-gii=DIR root directory of GII installation --with-gii-include=DIR specify exact include dir for GII headers --with-gii-libdir=DIR specify exact library dir for GII library --without-gii disables gii usage completely --with-sdl-mixer=DIR root directory of SDL_mixer installation --with-sdl-mixer-include=DIR specify exact include dir for SDL_mixer headers --with-sdl-mixer-libdir=DIR specify exact library dir for SDL_mixer library --without-sdl-mixer disables sdl_mixer usage completely --with-mikmod=DIR root directory of LibMikMod installation --without-mikmod disables LibMikMod usage completely --with-libmikmod-prefix=PFX Prefix where LibMikMod is installed (optional) --with-libmikmod-exec-prefix=PFX Exec prefix where LibMikMod is installed (optional) --with-patrol link with mpatrol (a malloc() debugger) --with-mtrace use GNU libc's mtrace for malloc () debugging --with-dmalloc link with dmalloc (a malloc() debugger) --with-efence link with efence (a malloc() debugger) --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib --with-included-gettext use the GNU gettext library included here 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 CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory 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 fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` cd $ac_dir # Check for guested configure; otherwise get Cygnus style 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 elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF heroes configure 0.21 generated by GNU Autoconf 2.53 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. Copyright 2000, 2001, 2002 Alexandre Duret-Lutz _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by heroes $as_me 0.21, which was generated by GNU Autoconf 2.53. Invocation command line was $ $0 $@ _ACEOF { 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` hostinfo = `(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=. echo "PATH: $as_dir" done } >&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. # Also quote any args containing shell meta-characters. ac_configure_args= ac_sep= for ac_arg do case $ac_arg in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n ) continue ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; esac # Get rid of the leading space. done # 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: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core core.* *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >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 # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" 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. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 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 `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 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 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`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. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } 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 ac_aux_dir= for ac_dir in tools $srcdir/tools; 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 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tools $srcdir/tools" >&5 echo "$as_me: error: cannot find install-sh or install.sh in tools $srcdir/tools" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. am__api_version="1.6" # 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" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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/* | \ /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 $as_executable_p "$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 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done 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. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$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' echo "$as_me:$LINENO: checking whether build environment is sane" >&5 echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}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 $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="${MAKE}"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi # test to see if srcdir already configured if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi # Define the identity of the package. PACKAGE=heroes VERSION=0.21 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"} AMTAR=${AMTAR-"${am_missing_run}tar"} install_sh=${install_sh-"$am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then echo "$as_me:$LINENO: result: $STRIP" >&5 echo "${ECHO_T}$STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 echo "${ECHO_T}$ac_ct_STRIP" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # check for opsolete or erroneous options if test -n "$with_SDL"; then { { echo "$as_me:$LINENO: error: --with-SDL is an illegal option, you probably want to use --with-sdl" >&5 echo "$as_me: error: --with-SDL is an illegal option, you probably want to use --with-sdl" >&2;} { (exit 1); exit 1; }; } fi if test -n "$with_GGI"; then { { echo "$as_me:$LINENO: error: --with-GGI is an obsolete option, you should use --with-ggi instead" >&5 echo "$as_me: error: --with-GGI is an obsolete option, you should use --with-ggi instead" >&2;} { (exit 1); exit 1; }; } fi if test -n "$with_GII"; then { { echo "$as_me:$LINENO: error: --with-GII is an obsolete option, you should use --with-gii instead" >&5 echo "$as_me: error: --with-GII is an obsolete option, you should use --with-gii instead" >&2;} { (exit 1); exit 1; }; } fi # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` cat >>confdefs.h <<_ACEOF #define HOST "$host" _ACEOF # If the user didn't supplied a CFLAGS value, # set an empty one to prevent autoconf to stick -O2 -g here. test -z "$CFLAGS" && CFLAGS="" # =================== # Check for programs. # =================== 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$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" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done 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 set dummy "$as_dir/$ac_word" ${1+"$@"} shift ac_cv_prog_CC="$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe" # 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. echo "$as_me:$LINENO: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; 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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$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 # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ '#include ' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_declaration #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext 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 rm -f .deps 2>/dev/null mkdir .deps 2>/dev/null if test -d .deps; then DEPDIR=.deps else # MS-DOS does not allow filenames that begin with a dot. DEPDIR=_deps fi rmdir .deps 2>/dev/null ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' doit: @echo done END # If we don't find an include directive, just comment out the code. echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi echo "$as_me:$LINENO: result: $_am_result" >&5 echo "${ECHO_T}$_am_result" >&6 rm -f confinc confmf # Check whether --enable-dependency-tracking or --disable-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= echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # 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. echo '#include "conftest.h"' > conftest.c echo 'int i;' > conftest.h echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=conftest.c object=conftest.o \ depfile=conftest.Po tmpdepfile=conftest.TPo \ $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 && grep conftest.h conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then am_cv_CC_dependencies_compiler_type=$depmode break fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type echo "$as_me:$LINENO: checking for strerror in -lcposix" >&5 echo $ECHO_N "checking for strerror in -lcposix... $ECHO_C" >&6 if test "${ac_cv_lib_cposix_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcposix $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char strerror (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { strerror (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cposix_strerror=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_cposix_strerror=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_cposix_strerror" >&5 echo "${ECHO_T}$ac_cv_lib_cposix_strerror" >&6 if test $ac_cv_lib_cposix_strerror = yes; then LIBS="$LIBS -lcposix" fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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; } 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; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac if test "x$CC" != xcc; then echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6 else echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6 fi set dummy $CC; ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest.$ac_objext >&5' if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&5' if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest.$ac_objext && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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. # 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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f 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 echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$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. # 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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } 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 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then echo "$as_me:$LINENO: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done 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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}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 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi echo "$as_me:$LINENO: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} ZIP=${ZIP-"${am_missing_run}zip"} UNZIP=${UNZIP-"${am_missing_run}unzip"} AUTOGEN=${AUTOGEN-"${am_missing_run}autogen"} # Extract the first word of "gperf", so it can be a program name with args. set dummy gperf; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GPERF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GPERF in [\\/]* | ?:[\\/]*) ac_cv_path_GPERF="$GPERF" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GPERF="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done ;; esac fi GPERF=$ac_cv_path_GPERF if test -n "$GPERF"; then echo "$as_me:$LINENO: result: $GPERF" >&5 echo "${ECHO_T}$GPERF" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test \! -z "$GPERF"; then HAVE_GPERF_TRUE= HAVE_GPERF_FALSE='#' else HAVE_GPERF_TRUE='#' HAVE_GPERF_FALSE= fi 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 overriden 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, don't put newlines in cache variables' values. # 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. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache # Set _GNU_SOURCE before any other tests. # Make sure that _GNU_SOURCE is defined for all subsequent # configure-time compile tests. # This definition must be emitted (into confdefs.h) before any # test that involves compilation. cat >>confdefs.h <<\EOF #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif EOF # Emit this code into config.h.in. # The ifndef is to avoid redefinition warnings. # ===================== # Checks for libraries. # ===================== echo "$as_me:$LINENO: checking for sin in -lm" >&5 echo $ECHO_N "checking for sin in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sin (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { sin (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_m_sin=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_m_sin=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_m_sin" >&5 echo "${ECHO_T}$ac_cv_lib_m_sin" >&6 if test $ac_cv_lib_m_sin = yes; then LIBS="-lm $LIBS" fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF 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=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done user_selection_list_vkm='' user_selection_list_s='' user_selection_list_j='' if test "${with_ggi-yes}" != no; then if test "${with_ggi-no}" != no; then user_selection_list_vkm="$user_selection_list_vkm ggivkm" fi # Check whether --with-ggi or --without-ggi was given. if test "${with_ggi+set}" = set; then withval="$with_ggi" with_ggi=$withval if test "${with_ggi}" != yes; then ggi_include="$withval/include" ggi_libdir="$withval/lib" fi fi; # Check whether --with-ggi-include or --without-ggi-include was given. if test "${with_ggi_include+set}" = set; then withval="$with_ggi_include" ggi_include="$withval" fi; # Check whether --with-ggi-libdir or --without-ggi-libdir was given. if test "${with_ggi_libdir+set}" = set; then withval="$with_ggi_libdir" ggi_libdir="$withval" fi; if test "${with_ggi}" != no ; then OLD_LIBS="$LIBS" OLD_LDFLAGS="$LDFLAGS" OLD_CFLAGS="$CFLAGS" OLD_CPPFLAGS="$CPPFLAGS" if test "${ggi_libdir}" ; then GGI_LDFLAGS="-L${ggi_libdir}" LDFLAGS="$LDFLAGS ${GGI_LDFLAGS}" fi if test "${ggi_include}" ; then GGI_CFLAGS="-I${ggi_include}" CPPFLAGS="$CPPFLAGS ${GGI_CFLAGS}" CFLAGS="$CFLAGS ${GGI_CFLAGS}" fi no_good=no echo "$as_me:$LINENO: checking for ggiOpen in -lggi" >&5 echo $ECHO_N "checking for ggiOpen in -lggi... $ECHO_C" >&6 if test "${ac_cv_lib_ggi_ggiOpen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lggi $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char ggiOpen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ggiOpen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ggi_ggiOpen=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_ggi_ggiOpen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ggi_ggiOpen" >&5 echo "${ECHO_T}$ac_cv_lib_ggi_ggiOpen" >&6 if test $ac_cv_lib_ggi_ggiOpen = yes; then : else no_good=yes fi if test "${ac_cv_header_ggi_ggi_h+set}" = set; then echo "$as_me:$LINENO: checking for ggi/ggi.h" >&5 echo $ECHO_N "checking for ggi/ggi.h... $ECHO_C" >&6 if test "${ac_cv_header_ggi_ggi_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_ggi_ggi_h" >&5 echo "${ECHO_T}$ac_cv_header_ggi_ggi_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking ggi/ggi.h usability" >&5 echo $ECHO_N "checking ggi/ggi.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking ggi/ggi.h presence" >&5 echo $ECHO_N "checking ggi/ggi.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: ggi/ggi.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: ggi/ggi.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: ggi/ggi.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ggi/ggi.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: ggi/ggi.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: ggi/ggi.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: ggi/ggi.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: ggi/ggi.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: ggi/ggi.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ggi/ggi.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for ggi/ggi.h" >&5 echo $ECHO_N "checking for ggi/ggi.h... $ECHO_C" >&6 if test "${ac_cv_header_ggi_ggi_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_ggi_ggi_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_ggi_ggi_h" >&5 echo "${ECHO_T}$ac_cv_header_ggi_ggi_h" >&6 fi if test $ac_cv_header_ggi_ggi_h = yes; then : else no_good=yes fi LIBS="$OLD_LIBS" LDFLAGS="$OLD_LDFLAGS" CPPFLAGS="$OLD_CPPFLAGS" CFLAGS="$OLD_CFLAGS" if test "$no_good" = yes; then with_ggi=no GGI_LDFLAGS="" GGI_CFLAGS="" GGI_LIBS="" else GGI_LIBS="-lggi" fi fi fi if test "${with_ggi-yes}" != no; then # Where is located? echo "$as_me:$LINENO: checking where ggi/keyboard.h is located" >&5 echo $ECHO_N "checking where ggi/keyboard.h is located... $ECHO_C" >&6 if test "${ac_cv_header_path_ggi_keyboard_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Look at the output from the preprocessor. # We should get lines of the form `# 1 "/usr/include/ggi/keyboard.h"' # The backslash substitution is to persuade cygwin to cough up # slashes rather than doubled backslashes in the path. echo "#include " > nametmp.c afh_file_list="`$CPP nametmp.c 2> /dev/null | sed -n 's/^#[ ].*\"\(.*\)\"/\1/p' | sed 's/\\\\\\\\/\//g' | $AWK '{ if (\$1 ~ \"ggi/keyboard.h\") files[\$1] = \$1 } END { for (var in files) print var }'`" rm -f nametmp.c if test -z "$afh_file_list"; then # In case we don't get the stuff from the preprocesor, use the # list of standard places. afh_file_list="/usr/include/ggi/keyboard.h ${ggi_include-/usr/local/include}/ggi/keyboard.h /dev/null" fi for ASH_FILE_H in $afh_file_list do # make sure it doesn't get confused by files that don't # define what is searched for ash_nmatch=`test -f $ASH_FILE_H && \ grep '#[ ]*define[ ][ ]*GIIUC*' $ASH_FILE_H | \ wc -l | sed 's/ //g'` test "x$ash_nmatch" != x && test "$ash_nmatch" -ge 7 && break done ac_cv_header_path_ggi_keyboard_h=$ASH_FILE_H if test "$ASH_FILE_H" = "/dev/null"; then { { echo "$as_me:$LINENO: error: Keysyms macros not found: where is GGI installed?" >&5 echo "$as_me: error: Keysyms macros not found: where is GGI installed?" >&2;} { (exit 1); exit 1; }; } else : fi fi echo "$as_me:$LINENO: result: $ac_cv_header_path_ggi_keyboard_h" >&5 echo "${ECHO_T}$ac_cv_header_path_ggi_keyboard_h" >&6 GGI_KEYBOARD_H="$ac_cv_header_path_ggi_keyboard_h" adl_libalt_ggivkm_ok=yes adl_libalt_ggivkm_name="LibGGI" adl_libalt_ggivkm_LDFLAGS="$GGI_LDFLAGS" adl_libalt_ggivkm_LDADD="$GGI_LIBS" adl_libalt_ggivkm_selected=no adl_libalt_ggivkm_depend_on="" adl_libalt_ggivkm_opt="" fi # Check whether --with-sdl or --without-sdl was given. if test "${with_sdl+set}" = set; then withval="$with_sdl" fi; # --with-sdl-exec-prefix should imply --with-sdl, and vice-versa test "${with_sdl_exec_prefix-no}" != no && test "${with_sdl-yes}" = yes && with_sdl="$with_sdl_exec_prefix" test "${with_sdl-yes}" != yes && test "${with_sdl_exec_prefix-yes}" = yes && with_sdl_exec_prefix="$with_sdl" if test "${with_sdl-yes}" != no; then if test "${with_sdl-no}" != no; then user_selection_list_vkm="$user_selection_list_vkm sdlvkm" fi OLD_LIBS="$LIBS" OLD_CFLAGS="$CFLAGS" jolly_good=true # Check whether --with-sdl-prefix or --without-sdl-prefix was given. if test "${with_sdl_prefix+set}" = set; then withval="$with_sdl_prefix" sdl_config_prefix="$withval" else sdl_config_prefix="" fi; # Check whether --with-sdl-exec-prefix or --without-sdl-exec-prefix was given. if test "${with_sdl_exec_prefix+set}" = set; then withval="$with_sdl_exec_prefix" sdl_config_exec_prefix="$withval" else sdl_config_exec_prefix="" fi; if test x$sdl_config_exec_prefix != x ; then sdl_config_args="$sdl_config_args --exec-prefix=$sdl_config_exec_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_config_exec_prefix/bin/sdl-config fi fi if test x$sdl_config_prefix != x ; then sdl_config_args="$sdl_config_args --prefix=$sdl_config_prefix" if test x${SDL_CONFIG+set} != xset ; then SDL_CONFIG=$sdl_config_prefix/bin/sdl-config fi fi # Extract the first word of "sdl-config", so it can be a program name with args. set dummy sdl-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_SDL_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SDL_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SDL_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no" ;; esac fi SDL_CONFIG=$ac_cv_path_SDL_CONFIG if test -n "$SDL_CONFIG"; then echo "$as_me:$LINENO: result: $SDL_CONFIG" >&5 echo "${ECHO_T}$SDL_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for sdl - version >= 1.0.1" >&5 echo $ECHO_N "checking for sdl - version >= 1.0.1... $ECHO_C" >&6 no_sdl="" if test "$SDL_CONFIG" = "no" ; then no_sdl=yes else SDL_CFLAGS="`$SDL_CONFIG $sdl_config_args --cflags`" SDL_LIBS="`$SDL_CONFIG $sdl_config_args --libs`" sdl_config_major_version=`$SDL_CONFIG $sdl_config_args \ --version | sed 's/[^0-9]*\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` sdl_config_minor_version=`$SDL_CONFIG $sdl_config_args \ --version | sed 's/[^0-9]*\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` sdl_config_micro_version=`$SDL_CONFIG $sdl_config_args \ --version | sed 's/[^0-9]*\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` sdl_wanted_major_version="1" sdl_wanted_minor_version="0" sdl_wanted_micro_version="1" # Compare wanted version to what config script returned. # If I knew what library was being run, i'd probably also compile # a test program at this point (which also extracted and tested # the version in some library-specific way) if test "$sdl_config_major_version" -lt \ "$sdl_wanted_major_version" \ -o \( "$sdl_config_major_version" -eq \ "$sdl_wanted_major_version" \ -a "$sdl_config_minor_version" -lt \ "$sdl_wanted_minor_version" \) \ -o \( "$sdl_config_major_version" -eq \ "$sdl_wanted_major_version" \ -a "$sdl_config_minor_version" -eq \ "$sdl_wanted_minor_version" \ -a "$sdl_config_micro_version" -lt \ "$sdl_wanted_micro_version" \) ; then # older version found no_sdl=yes echo -n "*** An old version of sdl " echo -n "($sdl_config_major_version" echo -n ".$sdl_config_minor_version" echo ".$sdl_config_micro_version) was found." echo -n "*** You need a version of sdl newer than " echo -n "$sdl_wanted_major_version" echo -n ".$sdl_wanted_minor_version" echo ".$sdl_wanted_micro_version." echo "***" echo "*** If you have already installed a sufficiently new version, this error" echo "*** probably means that the wrong copy of the sdl-config shell script is" echo "*** being found. The easiest way to fix this is to remove the old version" echo "*** of sdl, but you can also set the SDL_CONFIG environment to point to the" echo "*** correct copy of sdl-config. (In this case, you will have to" echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf" echo "*** so that the correct libraries are found at run-time)" fi fi if test "x$no_sdl" = x ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 : else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ## We won't display this warning unless the installer used --with-DOWN. if test "$SDL_CONFIG" = "no" && test "${with_sdl-no}" != no ; then echo "*** The sdl-config script installed by sdl could not be found" echo "*** If sdl was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the SDL_CONFIG environment variable to the" echo "*** full path to sdl-config." fi SDL_CFLAGS="" SDL_LIBS="" jolly_good=false fi if $jolly_good; then CFLAGS="$SDL_CFLAGS $CFLAGS" LIBS="$SDL_LIBS $LIBS" echo "$as_me:$LINENO: checking for SDL_Init" >&5 echo $ECHO_N "checking for SDL_Init... $ECHO_C" >&6 if test "${ac_cv_func_SDL_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char SDL_Init (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char SDL_Init (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_SDL_Init) || defined (__stub___SDL_Init) choke me #else f = SDL_Init; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_SDL_Init=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_SDL_Init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_SDL_Init" >&5 echo "${ECHO_T}$ac_cv_func_SDL_Init" >&6 if test $ac_cv_func_SDL_Init = yes; then : else jolly_good=false fi fi if $jolly_good; then for ac_func in SDL_EnableKeyRepeat do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" else LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" with_sdl=no fi fi if test "${with_sdl-yes}" != no; then # Where is located? echo "$as_me:$LINENO: checking where SDL_keysym.h is located" >&5 echo $ECHO_N "checking where SDL_keysym.h is located... $ECHO_C" >&6 if test "${ac_cv_header_path_SDL_keysym_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Look at the output from the preprocessor. # We should get lines of the form `# 1 "/usr/include/SDL_keysym.h"' # The backslash substitution is to persuade cygwin to cough up # slashes rather than doubled backslashes in the path. echo "#include " > nametmp.c afh_file_list="`$CPP $SDL_CFLAGS nametmp.c 2> /dev/null | sed -n 's/^#[ ].*\"\(.*\)\"/\1/p' | sed 's/\\\\\\\\/\//g' | $AWK '{ if (\$1 ~ \"SDL_keysym.h\") files[\$1] = \$1 } END { for (var in files) print var }'`" rm -f nametmp.c if test -z "$afh_file_list"; then # In case we don't get the stuff from the preprocesor, use the # list of standard places. afh_file_list="/usr/include/SDL/SDL_keysym.h /usr/local/include/SDL/SDL_keysym.h /dev/null" fi for ASH_FILE_H in $afh_file_list do # make sure it doesn't get confused by files that don't # define what is searched for ash_nmatch=`test -f $ASH_FILE_H && \ grep '#[ ]*define[ ][ ]*SDLK_*' $ASH_FILE_H | \ wc -l | sed 's/ //g'` test "x$ash_nmatch" != x && test "$ash_nmatch" -ge 7 && break done ac_cv_header_path_SDL_keysym_h=$ASH_FILE_H if test "$ASH_FILE_H" = "/dev/null"; then { { echo "$as_me:$LINENO: error: Keysyms definitions not found: where is SDL installed?" >&5 echo "$as_me: error: Keysyms definitions not found: where is SDL installed?" >&2;} { (exit 1); exit 1; }; } else : fi fi echo "$as_me:$LINENO: result: $ac_cv_header_path_SDL_keysym_h" >&5 echo "${ECHO_T}$ac_cv_header_path_SDL_keysym_h" >&6 SDL_KEYSYM_H="$ac_cv_header_path_SDL_keysym_h" adl_libalt_sdlvkm_ok=yes adl_libalt_sdlvkm_name="SDL $sdl_config_major_version.$sdl_config_minor_version.$sdl_config_micro_version" adl_libalt_sdlvkm_LDFLAGS="" adl_libalt_sdlvkm_LDADD="$SDL_LIBS" adl_libalt_sdlvkm_selected=no adl_libalt_sdlvkm_depend_on="" adl_libalt_sdlvkm_opt="" else # Set to `no' so that we don't check for joystick or sound support with_sdl=no fi ## Allegro support is hidden until it is better supported. test "${with_allegro_exec_prefix-no}" != no && test "${with_allegro-yes}" = yes && with_allegro="$with_allegro_exec_prefix" test "${with_allegro-yes}" != yes && test "${with_allegro_exec_prefix-yes}" = yes && with_allegro_exec_prefix="$with_allegro" if test "${with_allegro-yes}" != no; then if test "${with_allegro-no}" != no; then user_selection_list_vkm="$user_selection_list_vkm allvkm" fi OLD_LIBS="$LIBS" OLD_CFLAGS="$CFLAGS" jolly_good=true # Check whether --with-allegro-prefix or --without-allegro-prefix was given. if test "${with_allegro_prefix+set}" = set; then withval="$with_allegro_prefix" allegro_config_prefix="$withval" else allegro_config_prefix="" fi; # Check whether --with-allegro-exec-prefix or --without-allegro-exec-prefix was given. if test "${with_allegro_exec_prefix+set}" = set; then withval="$with_allegro_exec_prefix" allegro_config_exec_prefix="$withval" else allegro_config_exec_prefix="" fi; if test x$allegro_config_exec_prefix != x ; then allegro_config_args="$allegro_config_args --exec-prefix=$allegro_config_exec_prefix" if test x${ALLEGRO_CONFIG+set} != xset ; then ALLEGRO_CONFIG=$allegro_config_exec_prefix/bin/allegro-config fi fi if test x$allegro_config_prefix != x ; then allegro_config_args="$allegro_config_args --prefix=$allegro_config_prefix" if test x${ALLEGRO_CONFIG+set} != xset ; then ALLEGRO_CONFIG=$allegro_config_prefix/bin/allegro-config fi fi # Extract the first word of "allegro-config", so it can be a program name with args. set dummy allegro-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_ALLEGRO_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ALLEGRO_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ALLEGRO_CONFIG="$ALLEGRO_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ALLEGRO_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_ALLEGRO_CONFIG" && ac_cv_path_ALLEGRO_CONFIG="no" ;; esac fi ALLEGRO_CONFIG=$ac_cv_path_ALLEGRO_CONFIG if test -n "$ALLEGRO_CONFIG"; then echo "$as_me:$LINENO: result: $ALLEGRO_CONFIG" >&5 echo "${ECHO_T}$ALLEGRO_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for allegro - version >= 3.9.33" >&5 echo $ECHO_N "checking for allegro - version >= 3.9.33... $ECHO_C" >&6 no_allegro="" if test "$ALLEGRO_CONFIG" = "no" ; then no_allegro=yes else ALLEGRO_CFLAGS="`$ALLEGRO_CONFIG $allegro_config_args --cflags`" ALLEGRO_LIBS="`$ALLEGRO_CONFIG $allegro_config_args --libs`" allegro_config_major_version=`$ALLEGRO_CONFIG $allegro_config_args \ --version | sed 's/[^0-9]*\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` allegro_config_minor_version=`$ALLEGRO_CONFIG $allegro_config_args \ --version | sed 's/[^0-9]*\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` allegro_config_micro_version=`$ALLEGRO_CONFIG $allegro_config_args \ --version | sed 's/[^0-9]*\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` allegro_wanted_major_version="3" allegro_wanted_minor_version="9" allegro_wanted_micro_version="33" # Compare wanted version to what config script returned. # If I knew what library was being run, i'd probably also compile # a test program at this point (which also extracted and tested # the version in some library-specific way) if test "$allegro_config_major_version" -lt \ "$allegro_wanted_major_version" \ -o \( "$allegro_config_major_version" -eq \ "$allegro_wanted_major_version" \ -a "$allegro_config_minor_version" -lt \ "$allegro_wanted_minor_version" \) \ -o \( "$allegro_config_major_version" -eq \ "$allegro_wanted_major_version" \ -a "$allegro_config_minor_version" -eq \ "$allegro_wanted_minor_version" \ -a "$allegro_config_micro_version" -lt \ "$allegro_wanted_micro_version" \) ; then # older version found no_allegro=yes echo -n "*** An old version of allegro " echo -n "($allegro_config_major_version" echo -n ".$allegro_config_minor_version" echo ".$allegro_config_micro_version) was found." echo -n "*** You need a version of allegro newer than " echo -n "$allegro_wanted_major_version" echo -n ".$allegro_wanted_minor_version" echo ".$allegro_wanted_micro_version." echo "***" echo "*** If you have already installed a sufficiently new version, this error" echo "*** probably means that the wrong copy of the allegro-config shell script is" echo "*** being found. The easiest way to fix this is to remove the old version" echo "*** of allegro, but you can also set the ALLEGRO_CONFIG environment to point to the" echo "*** correct copy of allegro-config. (In this case, you will have to" echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf" echo "*** so that the correct libraries are found at run-time)" fi fi if test "x$no_allegro" = x ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 : else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ## We won't display this warning unless the installer used --with-DOWN. if test "$ALLEGRO_CONFIG" = "no" && test "${with_allegro-no}" != no ; then echo "*** The allegro-config script installed by allegro could not be found" echo "*** If allegro was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the ALLEGRO_CONFIG environment variable to the" echo "*** full path to allegro-config." fi ALLEGRO_CFLAGS="" ALLEGRO_LIBS="" jolly_good=false fi if $jolly_good; then LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" else LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" with_allegro=no fi fi ## Also change -no to -yes. See above. if test "${with_allegro-no}" != no; then # Where is located? echo "$as_me:$LINENO: checking where allegro.h is located" >&5 echo $ECHO_N "checking where allegro.h is located... $ECHO_C" >&6 if test "${ac_cv_header_path_allegro_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Look at the output from the preprocessor. # We should get lines of the form `# 1 "/usr/include/allegro.h"' # The backslash substitution is to persuade cygwin to cough up # slashes rather than doubled backslashes in the path. echo "#include " > nametmp.c afh_file_list="`$CPP $ALLEGRO_CFLAGS nametmp.c 2> /dev/null | sed -n 's/^#[ ].*\"\(.*\)\"/\1/p' | sed 's/\\\\\\\\/\//g' | $AWK '{ if (\$1 ~ \"allegro.h\") files[\$1] = \$1 } END { for (var in files) print var }'`" rm -f nametmp.c if test -z "$afh_file_list"; then # In case we don't get the stuff from the preprocesor, use the # list of standard places. afh_file_list="/usr/include/allegro.h /usr/local/include/allegro.h /dev/null" fi for ASH_FILE_H in $afh_file_list do # make sure it doesn't get confused by files that don't # define what is searched for ash_nmatch=`test -f $ASH_FILE_H && \ grep '#[ ]*define[ ][ ]*KEY_*' $ASH_FILE_H | \ wc -l | sed 's/ //g'` test "x$ash_nmatch" != x && test "$ash_nmatch" -ge 7 && break done ac_cv_header_path_allegro_h=$ASH_FILE_H if test "$ASH_FILE_H" = "/dev/null"; then { { echo "$as_me:$LINENO: error: Keysyms definitions not found: where is Allegro installed?" >&5 echo "$as_me: error: Keysyms definitions not found: where is Allegro installed?" >&2;} { (exit 1); exit 1; }; } else : fi fi echo "$as_me:$LINENO: result: $ac_cv_header_path_allegro_h" >&5 echo "${ECHO_T}$ac_cv_header_path_allegro_h" >&6 ALLEGRO_H="$ac_cv_header_path_allegro_h" adl_libalt_allvkm_ok=yes adl_libalt_allvkm_name="Allegro $allegro_config_major_version.$allegro_config_minor_version.$allegro_config_micro_version" adl_libalt_allvkm_LDFLAGS="" adl_libalt_allvkm_LDADD="$ALLEGRO_LIBS" adl_libalt_allvkm_selected=no adl_libalt_allvkm_depend_on="" adl_libalt_allvkm_opt="" else # Set to `no' so that we don't check for joystick support with_allegro=no fi # Check whether --enable-joystick or --disable-joystick was given. if test "${enable_joystick+set}" = set; then enableval="$enable_joystick" fi; if test "${enable_joystick-yes}" = yes; then # -- check for Joystick support in SDL if test "${with_sdl-yes}" != no; then if test "${with_sdl-no}" != no; then user_selection_list_j="$user_selection_list_j sdlj" fi OLIBS="$LIBS" LIBS="$LIBS $SDL_LIBS" for ac_func in SDL_JoystickOpen do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF adl_libalt_sdlj_ok=yes adl_libalt_sdlj_name="SDL $sdl_config_major_version.$sdl_config_minor_version.$sdl_config_micro_version" adl_libalt_sdlj_LDFLAGS="" adl_libalt_sdlj_LDADD="" adl_libalt_sdlj_selected=no adl_libalt_sdlj_depend_on="sdlvkm" adl_libalt_sdlj_opt="" fi done LIBS="$OLIBS" fi # -- Joystick support in Allegro is OK. if test "${with_allegro-yes}" != no; then if test "${with_allegro-no}" != no; then user_selection_list_j="$user_selection_list_j allj" fi adl_libalt_allj_ok=yes adl_libalt_allj_name="Allegro $allegro_config_major_version.$allegro_config_minor_version.$allegro_config_micro_version" adl_libalt_allj_LDFLAGS="" adl_libalt_allj_LDADD="" adl_libalt_allj_selected=no adl_libalt_allj_depend_on="allvkm" adl_libalt_allj_opt="" fi # -- check for LibGII (another way to get joystick support) if test "${with_gii-yes}" != no; then if test "${with_gii-no}" != no; then user_selection_list_j="$user_selection_list_j giij" fi # Check whether --with-gii or --without-gii was given. if test "${with_gii+set}" = set; then withval="$with_gii" with_gii=$withval if test "${with_gii}" != yes; then gii_include="$withval/include" gii_libdir="$withval/lib" fi fi; # Check whether --with-gii-include or --without-gii-include was given. if test "${with_gii_include+set}" = set; then withval="$with_gii_include" gii_include="$withval" fi; # Check whether --with-gii-libdir or --without-gii-libdir was given. if test "${with_gii_libdir+set}" = set; then withval="$with_gii_libdir" gii_libdir="$withval" fi; if test "${with_gii}" != no ; then OLD_LIBS="$LIBS" OLD_LDFLAGS="$LDFLAGS" OLD_CFLAGS="$CFLAGS" OLD_CPPFLAGS="$CPPFLAGS" if test "${gii_libdir}" ; then GII_LDFLAGS="-L${gii_libdir}" LDFLAGS="$LDFLAGS ${GII_LDFLAGS}" fi if test "${gii_include}" ; then GII_CFLAGS="-I${gii_include}" CPPFLAGS="$CPPFLAGS ${GII_CFLAGS}" CFLAGS="$CFLAGS ${GII_CFLAGS}" fi no_good=no echo "$as_me:$LINENO: checking for giiOpen in -lgii" >&5 echo $ECHO_N "checking for giiOpen in -lgii... $ECHO_C" >&6 if test "${ac_cv_lib_gii_giiOpen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgii $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char giiOpen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { giiOpen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gii_giiOpen=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gii_giiOpen=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_gii_giiOpen" >&5 echo "${ECHO_T}$ac_cv_lib_gii_giiOpen" >&6 if test $ac_cv_lib_gii_giiOpen = yes; then : else no_good=yes fi if test "${ac_cv_header_ggi_gii_h+set}" = set; then echo "$as_me:$LINENO: checking for ggi/gii.h" >&5 echo $ECHO_N "checking for ggi/gii.h... $ECHO_C" >&6 if test "${ac_cv_header_ggi_gii_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_ggi_gii_h" >&5 echo "${ECHO_T}$ac_cv_header_ggi_gii_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking ggi/gii.h usability" >&5 echo $ECHO_N "checking ggi/gii.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking ggi/gii.h presence" >&5 echo $ECHO_N "checking ggi/gii.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: ggi/gii.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: ggi/gii.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: ggi/gii.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ggi/gii.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: ggi/gii.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: ggi/gii.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: ggi/gii.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: ggi/gii.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: ggi/gii.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: ggi/gii.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for ggi/gii.h" >&5 echo $ECHO_N "checking for ggi/gii.h... $ECHO_C" >&6 if test "${ac_cv_header_ggi_gii_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_ggi_gii_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_ggi_gii_h" >&5 echo "${ECHO_T}$ac_cv_header_ggi_gii_h" >&6 fi if test $ac_cv_header_ggi_gii_h = yes; then : else no_good=yes fi LIBS="$OLD_LIBS" LDFLAGS="$OLD_LDFLAGS" CPPFLAGS="$OLD_CPPFLAGS" CFLAGS="$OLD_CFLAGS" if test "$no_good" = yes; then GII_LDFLAGS="" GII_CFLAGS="" GII_LIBS="" else GII_LIBS="-lgii" adl_libalt_giij_ok=yes adl_libalt_giij_name="LibGII" adl_libalt_giij_LDFLAGS="$GII_LDFLAGS" adl_libalt_giij_LDADD="$GII_LIBS" adl_libalt_giij_selected=no adl_libalt_giij_depend_on="" adl_libalt_giij_opt="" fi fi fi else user_selection_list_j="dumj $user_selection_list_j" fi # Check whether --enable-sound or --disable-sound was given. if test "${enable_sound+set}" = set; then enableval="$enable_sound" fi; if test "${enable_sound-yes}" != no; then if test "${enable_sound-no}" != no; then user_selection_list_s="dums $user_selection_list_s" fi # don't even try to check for SDL_mixer if SDL is not installed if test "${with_sdl-yes}" = no; then with_sdl_mixer=no fi # with_sdl if test "${with_sdl_mixer-yes}" != no; then if test "${with_sdl_mixer-no}" != no; then user_selection_list_s="$user_selection_list_s sdls" fi # temporaly put the CFLAGS for SDL in CPPFLAGS # so that AC_caolan_CHECK_PACKAGE can find SDL_mixer.h in the same directory. tmp_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$SDL_CFLAGS $CPPFLAGS" tmp_LIBS="$CPPLIBS" LIBS="$SDL_LIBS $LIBS" # Check whether --with-sdl-mixer or --without-sdl-mixer was given. if test "${with_sdl_mixer+set}" = set; then withval="$with_sdl_mixer" with_sdl_mixer=$withval if test "${with_sdl_mixer}" != yes; then sdl_mixer_include="$withval/include" sdl_mixer_libdir="$withval/lib" fi fi; # Check whether --with-sdl-mixer-include or --without-sdl-mixer-include was given. if test "${with_sdl_mixer_include+set}" = set; then withval="$with_sdl_mixer_include" sdl_mixer_include="$withval" fi; # Check whether --with-sdl-mixer-libdir or --without-sdl-mixer-libdir was given. if test "${with_sdl_mixer_libdir+set}" = set; then withval="$with_sdl_mixer_libdir" sdl_mixer_libdir="$withval" fi; if test "${with_sdl_mixer}" != no ; then OLD_LIBS="$LIBS" OLD_LDFLAGS="$LDFLAGS" OLD_CFLAGS="$CFLAGS" OLD_CPPFLAGS="$CPPFLAGS" if test "${sdl_mixer_libdir}" ; then SDL_MIXER_LDFLAGS="-L${sdl_mixer_libdir}" LDFLAGS="$LDFLAGS ${SDL_MIXER_LDFLAGS}" fi if test "${sdl_mixer_include}" ; then SDL_MIXER_CFLAGS="-I${sdl_mixer_include}" CPPFLAGS="$CPPFLAGS ${SDL_MIXER_CFLAGS}" CFLAGS="$CFLAGS ${SDL_MIXER_CFLAGS}" fi no_good=no echo "$as_me:$LINENO: checking for Mix_OpenAudio in -lSDL_mixer" >&5 echo $ECHO_N "checking for Mix_OpenAudio in -lSDL_mixer... $ECHO_C" >&6 if test "${ac_cv_lib_SDL_mixer_Mix_OpenAudio+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lSDL_mixer $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char Mix_OpenAudio (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { Mix_OpenAudio (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_SDL_mixer_Mix_OpenAudio=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_SDL_mixer_Mix_OpenAudio=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_SDL_mixer_Mix_OpenAudio" >&5 echo "${ECHO_T}$ac_cv_lib_SDL_mixer_Mix_OpenAudio" >&6 if test $ac_cv_lib_SDL_mixer_Mix_OpenAudio = yes; then : else no_good=yes fi if test "${ac_cv_header_SDL_mixer_h+set}" = set; then echo "$as_me:$LINENO: checking for SDL_mixer.h" >&5 echo $ECHO_N "checking for SDL_mixer.h... $ECHO_C" >&6 if test "${ac_cv_header_SDL_mixer_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_SDL_mixer_h" >&5 echo "${ECHO_T}$ac_cv_header_SDL_mixer_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking SDL_mixer.h usability" >&5 echo $ECHO_N "checking SDL_mixer.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking SDL_mixer.h presence" >&5 echo $ECHO_N "checking SDL_mixer.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: SDL_mixer.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: SDL_mixer.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: SDL_mixer.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: SDL_mixer.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: SDL_mixer.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: SDL_mixer.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: SDL_mixer.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: SDL_mixer.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: SDL_mixer.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: SDL_mixer.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for SDL_mixer.h" >&5 echo $ECHO_N "checking for SDL_mixer.h... $ECHO_C" >&6 if test "${ac_cv_header_SDL_mixer_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_SDL_mixer_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_SDL_mixer_h" >&5 echo "${ECHO_T}$ac_cv_header_SDL_mixer_h" >&6 fi if test $ac_cv_header_SDL_mixer_h = yes; then : else no_good=yes fi LIBS="$OLD_LIBS" LDFLAGS="$OLD_LDFLAGS" CPPFLAGS="$OLD_CPPFLAGS" CFLAGS="$OLD_CFLAGS" if test "$no_good" = yes; then with_sdl_mixer=no SDL_MIXER_LDFLAGS="" SDL_MIXER_CFLAGS="" SDL_MIXER_LIBS="" else SDL_MIXER_LIBS="-lSDL_mixer" cat >>confdefs.h <<\_ACEOF #define HAVE_LIBSDL_MIXER 1 _ACEOF fi fi # revert old value CPPFLAGS="$tmp_CPPFLAGS" LIBS="$tmp_LIBS" fi # with_sdl_mixer if test "x${with_sdl_mixer}" != xno; then with_sdl_mixer=yes adl_libalt_sdls_ok=yes adl_libalt_sdls_name="SDL_mixer" adl_libalt_sdls_LDFLAGS="$SDL_MIXER_LDFLAGS" adl_libalt_sdls_LDADD="$SDL_MIXER_LIBS" adl_libalt_sdls_selected=no adl_libalt_sdls_depend_on="sdlvkm" adl_libalt_sdls_opt="" fi # with_sdl_mixer # Check whether --with-mikmod or --without-mikmod was given. if test "${with_mikmod+set}" = set; then withval="$with_mikmod" fi; # --with-mikmod-exec-prefix should imply --with-mikmod, and vice-versa test "${with_mikmod_exec_prefix-no}" != no && test "${with_mikmod-yes}" = yes && with_mikmod="$with_mikmod_exec_prefix" test "${with_mikmod-yes}" != yes && test "${with_mikmod_exec_prefix-yes}" = yes && with_mikmod_exec_prefix="$with_mikmod" if test "${with_mikmod-yes}" != no; then if test "${with_mikmod-no}" != no; then user_selection_list_s="$user_selection_list_s miks" fi OLD_LIBS="$LIBS" OLD_CFLAGS="$CFLAGS" jolly_good=true # Check whether --with-libmikmod-prefix or --without-libmikmod-prefix was given. if test "${with_libmikmod_prefix+set}" = set; then withval="$with_libmikmod_prefix" libmikmod_config_prefix="$withval" else libmikmod_config_prefix="" fi; # Check whether --with-libmikmod-exec-prefix or --without-libmikmod-exec-prefix was given. if test "${with_libmikmod_exec_prefix+set}" = set; then withval="$with_libmikmod_exec_prefix" libmikmod_config_exec_prefix="$withval" else libmikmod_config_exec_prefix="" fi; if test x$libmikmod_config_exec_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --exec-prefix=$libmikmod_config_exec_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_exec_prefix/bin/libmikmod-config fi fi if test x$libmikmod_config_prefix != x ; then libmikmod_config_args="$libmikmod_config_args --prefix=$libmikmod_config_prefix" if test x${LIBMIKMOD_CONFIG+set} != xset ; then LIBMIKMOD_CONFIG=$libmikmod_config_prefix/bin/libmikmod-config fi fi # Extract the first word of "libmikmod-config", so it can be a program name with args. set dummy libmikmod-config; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LIBMIKMOD_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $LIBMIKMOD_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_LIBMIKMOD_CONFIG="$LIBMIKMOD_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_LIBMIKMOD_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_LIBMIKMOD_CONFIG" && ac_cv_path_LIBMIKMOD_CONFIG="no" ;; esac fi LIBMIKMOD_CONFIG=$ac_cv_path_LIBMIKMOD_CONFIG if test -n "$LIBMIKMOD_CONFIG"; then echo "$as_me:$LINENO: result: $LIBMIKMOD_CONFIG" >&5 echo "${ECHO_T}$LIBMIKMOD_CONFIG" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi echo "$as_me:$LINENO: checking for LibMikMod - version >= 3.1.7" >&5 echo $ECHO_N "checking for LibMikMod - version >= 3.1.7... $ECHO_C" >&6 no_libmikmod="" if test "$LIBMIKMOD_CONFIG" = "no" ; then no_libmikmod=yes else LIBMIKMOD_CFLAGS="`$LIBMIKMOD_CONFIG $libmikmod_config_args --cflags`" LIBMIKMOD_LIBS="`$LIBMIKMOD_CONFIG $libmikmod_config_args --libs`" libmikmod_config_major_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args \ --version | sed 's/[^0-9]*\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` libmikmod_config_minor_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args \ --version | sed 's/[^0-9]*\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` libmikmod_config_micro_version=`$LIBMIKMOD_CONFIG $libmikmod_config_args \ --version | sed 's/[^0-9]*\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` libmikmod_wanted_major_version="3" libmikmod_wanted_minor_version="1" libmikmod_wanted_micro_version="7" # Compare wanted version to what config script returned. # If I knew what library was being run, i'd probably also compile # a test program at this point (which also extracted and tested # the version in some library-specific way) if test "$libmikmod_config_major_version" -lt \ "$libmikmod_wanted_major_version" \ -o \( "$libmikmod_config_major_version" -eq \ "$libmikmod_wanted_major_version" \ -a "$libmikmod_config_minor_version" -lt \ "$libmikmod_wanted_minor_version" \) \ -o \( "$libmikmod_config_major_version" -eq \ "$libmikmod_wanted_major_version" \ -a "$libmikmod_config_minor_version" -eq \ "$libmikmod_wanted_minor_version" \ -a "$libmikmod_config_micro_version" -lt \ "$libmikmod_wanted_micro_version" \) ; then # older version found no_libmikmod=yes echo -n "*** An old version of LibMikMod " echo -n "($libmikmod_config_major_version" echo -n ".$libmikmod_config_minor_version" echo ".$libmikmod_config_micro_version) was found." echo -n "*** You need a version of LibMikMod newer than " echo -n "$libmikmod_wanted_major_version" echo -n ".$libmikmod_wanted_minor_version" echo ".$libmikmod_wanted_micro_version." echo "***" echo "*** If you have already installed a sufficiently new version, this error" echo "*** probably means that the wrong copy of the libmikmod-config shell script is" echo "*** being found. The easiest way to fix this is to remove the old version" echo "*** of LibMikMod, but you can also set the LIBMIKMOD_CONFIG environment to point to the" echo "*** correct copy of libmikmod-config. (In this case, you will have to" echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf" echo "*** so that the correct libraries are found at run-time)" fi fi if test "x$no_libmikmod" = x ; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 : else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 ## We won't display this warning unless the installer used --with-DOWN. if test "$LIBMIKMOD_CONFIG" = "no" && test "${with_libmikmod-no}" != no ; then echo "*** The libmikmod-config script installed by LibMikMod could not be found" echo "*** If LibMikMod was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the LIBMIKMOD_CONFIG environment variable to the" echo "*** full path to libmikmod-config." fi LIBMIKMOD_CFLAGS="" LIBMIKMOD_LIBS="" jolly_good=false fi if $jolly_good; then CFLAGS="$LIBMIKMOD_CFLAGS $CFLAGS" LIBS="$LIBMIKMOD_LIBS $LIBS" echo "$as_me:$LINENO: checking for MikMod_Init" >&5 echo $ECHO_N "checking for MikMod_Init... $ECHO_C" >&6 if test "${ac_cv_func_MikMod_Init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char MikMod_Init (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char MikMod_Init (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_MikMod_Init) || defined (__stub___MikMod_Init) choke me #else f = MikMod_Init; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_MikMod_Init=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_MikMod_Init=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_MikMod_Init" >&5 echo "${ECHO_T}$ac_cv_func_MikMod_Init" >&6 if test $ac_cv_func_MikMod_Init = yes; then : else jolly_good=false fi fi if $jolly_good; then LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" else LIBS="$OLD_LIBS" CFLAGS="$OLD_CFLAGS" with_mikmod=no fi # Since LibMikMod 3.1.10, libmikmod-config has moved some of # the libraries listed by --libs to the output of the --ldadd # option. So we append them to LIBMIKMOD_LIBS here. if test "${with_mikmod-yes}" != no; then LIBMIKMOD_LIBS="$LIBMIKMOD_LIBS `$LIBMIKMOD_CONFIG $libmikmod_config_args --ldadd`" fi fi if test "${with_mikmod-yes}" != no; then adl_libalt_miks_ok=yes adl_libalt_miks_name="LibMikMod $libmikmod_config_major_version.$libmikmod_config_minor_version.$libmikmod_config_micro_version" adl_libalt_miks_LDFLAGS="" adl_libalt_miks_LDADD="$LIBMIKMOD_LIBS" adl_libalt_miks_selected=no adl_libalt_miks_depend_on="" adl_libalt_miks_opt="" fi fi # These libraries do not need any checking. adl_libalt_dums_ok=yes adl_libalt_dums_name="none" adl_libalt_dums_LDFLAGS="" adl_libalt_dums_LDADD="" adl_libalt_dums_selected=no adl_libalt_dums_depend_on="" adl_libalt_dums_opt="" adl_libalt_dumj_ok=yes adl_libalt_dumj_name="none" adl_libalt_dumj_LDFLAGS="" adl_libalt_dumj_LDADD="" adl_libalt_dumj_selected=no adl_libalt_dumj_depend_on="" adl_libalt_dumj_opt="" adl_libalt_stdm_ok=yes adl_libalt_stdm_name="standard main" adl_libalt_stdm_LDFLAGS="" adl_libalt_stdm_LDADD="" adl_libalt_stdm_selected=no adl_libalt_stdm_depend_on="" adl_libalt_stdm_opt="" # There is a trick here. Usually our static library are added # to LIBALT_LOCAL_LDADD which is listed before LIBALT_LDADD (the system # libraries) on the link line. However, SDL_main and Allegro are special: # they refer to OUR code (practically they call our main, which has been # renamed to SDL_main() or _mangled_main()). So in addition to adding # sys/libhallm.a to LIBALT_LOCAL_LDADD (done automatically by adl_LIBALT_OK), # we will also list it in LIBALT_LDADD (requested below). The 'APPEND' means # the libraries should be appended instead of being prepended, since we # want them to be listed after -lSDL_main or -lallegro. adl_libalt_sdlm_ok=yes adl_libalt_sdlm_name="SDL_main" adl_libalt_sdlm_LDFLAGS="" adl_libalt_sdlm_LDADD="sys/libhsdlm.a" adl_libalt_sdlm_selected=no adl_libalt_sdlm_depend_on="sdlvkm" adl_libalt_sdlm_opt="APPEND" adl_libalt_allm_ok=yes adl_libalt_allm_name="Allegro mangled main" adl_libalt_allm_LDFLAGS="" adl_libalt_allm_LDADD="sys/libhallm.a" adl_libalt_allm_selected=no adl_libalt_allm_depend_on="allvkm" adl_libalt_allm_opt="APPEND" # Heroes can run without display, but usually this is not what # the user wants :), so this "feature" is enabled only if # --disable-display is supplied. # Check whether --enable-display or --disable-display was given. if test "${enable_display+set}" = set; then enableval="$enable_display" fi; if test "${enable_display-yes}" = no; then user_selection_list_vkm="dumvkm $user_selection_list_vkm" adl_libalt_dumvkm_ok=yes adl_libalt_dumvkm_name="none" adl_libalt_dumvkm_LDFLAGS="" adl_libalt_dumvkm_LDADD="" adl_libalt_dumvkm_selected=no adl_libalt_dumvkm_depend_on="" adl_libalt_dumvkm_opt="" fi # If the user has no preference, we'll use our own preference list. if test -z "$user_selection_list_vkm"; then selection_list_vkm="ggivkm sdlvkm allvkm dumvkm" else selection_list_vkm="$user_selection_list_vkm dumvkm" fi if test -z "$user_selection_list_s"; then # Keep sdls first. It won't be used if sdlvkm is not selected, # but otherwise it should be prefered over miks. selection_list_s="sdls miks dums" else selection_list_s="$user_selection_list_s dums" fi if test -z "$user_selection_list_j"; then # Keep sdlj first. It won't be used if sdlvkm is not selected, # but otherwise it should be prefered over giij. # Keep allj second for the same reason. selection_list_j="sdlj allj giij dumj" else selection_list_j="$user_selection_list_j dumj" fi selection_vkm=NONE for i in $selection_list_vkm; do if eval test "x\$adl_libalt_${i}_ok" = xyes ; then # make sure all dependencies for this module have already been selected. eval adl_libalt_tmp_dep="\$adl_libalt_${i}_depend_on" adl_libalt_tmp_ok=yes for j in $adl_libalt_tmp_dep : ; do if test $j = : ; then break fi if eval test "x\$adl_libalt_${j}_selected" != xyes ; then adl_libalt_tmp_ok=no break fi done if test "$adl_libalt_tmp_ok" = yes ; then eval adl_libalt_tmp_opt=\"\$adl_libalt_${i}_opt\" # The default is to prepend. if test x"$adl_libalt_tmp_opt" = xAPPEND; then eval LIBALT_LDFLAGS=\"\$LIBALT_LDFLAGS \$adl_libalt_${i}_LDFLAGS\" eval LIBALT_LDADD=\"\$LIBALT_LDADD \$adl_libalt_${i}_LDADD\" LIBALT_LOCAL_LDADD="$LIBALT_LOCAL_LDADD media/libh$i.a" else eval LIBALT_LDFLAGS=\"\$adl_libalt_${i}_LDFLAGS \$LIBALT_LDFLAGS\" eval LIBALT_LDADD=\"\$adl_libalt_${i}_LDADD \$LIBALT_LDADD\" LIBALT_LOCAL_LDADD="media/libh$i.a $LIBALT_LOCAL_LDADD" fi eval "adl_libalt_${i}_selected=yes" selection_vkm=$i break fi fi done if test "x$selection_vkm" = xNONE ; then { { echo "$as_me:$LINENO: error: No video-keyboard-mouse library found. The supported libraries are listed in README." >&5 echo "$as_me: error: No video-keyboard-mouse library found. The supported libraries are listed in README." >&2;} { (exit 1); exit 1; }; } else eval adl_tmp_libalt_name='$adl_libalt_'"$selection_vkm"'_name' { echo "$as_me:$LINENO: Selected video-keyboard-mouse library: $adl_tmp_libalt_name" >&5 echo "$as_me: Selected video-keyboard-mouse library: $adl_tmp_libalt_name" >&6;} fi # Use _XLDLAGS, _XLDADS, etc. because Automake reserves _LDFLAGS, etc. LIBALT_XLDFLAGS=$LIBALT_LDFLAGS LIBALT_XLDADD=$LIBALT_LDADD LIBALT_LOCAL_XLDADD=$LIBALT_LOCAL_LDADD selection_s=NONE for i in $selection_list_s; do if eval test "x\$adl_libalt_${i}_ok" = xyes ; then # make sure all dependencies for this module have already been selected. eval adl_libalt_tmp_dep="\$adl_libalt_${i}_depend_on" adl_libalt_tmp_ok=yes for j in $adl_libalt_tmp_dep : ; do if test $j = : ; then break fi if eval test "x\$adl_libalt_${j}_selected" != xyes ; then adl_libalt_tmp_ok=no break fi done if test "$adl_libalt_tmp_ok" = yes ; then eval adl_libalt_tmp_opt=\"\$adl_libalt_${i}_opt\" # The default is to prepend. if test x"$adl_libalt_tmp_opt" = xAPPEND; then eval LIBALT_LDFLAGS=\"\$LIBALT_LDFLAGS \$adl_libalt_${i}_LDFLAGS\" eval LIBALT_LDADD=\"\$LIBALT_LDADD \$adl_libalt_${i}_LDADD\" LIBALT_LOCAL_LDADD="$LIBALT_LOCAL_LDADD media/libh$i.a" else eval LIBALT_LDFLAGS=\"\$adl_libalt_${i}_LDFLAGS \$LIBALT_LDFLAGS\" eval LIBALT_LDADD=\"\$adl_libalt_${i}_LDADD \$LIBALT_LDADD\" LIBALT_LOCAL_LDADD="media/libh$i.a $LIBALT_LOCAL_LDADD" fi eval "adl_libalt_${i}_selected=yes" selection_s=$i break fi fi done if test "x$selection_s" = xNONE ; then { { echo "$as_me:$LINENO: error: No sound library found. The supported libraries are listed in README." >&5 echo "$as_me: error: No sound library found. The supported libraries are listed in README." >&2;} { (exit 1); exit 1; }; } else eval adl_tmp_libalt_name='$adl_libalt_'"$selection_s"'_name' { echo "$as_me:$LINENO: Selected sound library: $adl_tmp_libalt_name" >&5 echo "$as_me: Selected sound library: $adl_tmp_libalt_name" >&6;} fi # Use _XLDLAGS, _XLDADS, etc. because Automake reserves _LDFLAGS, etc. LIBALT_XLDFLAGS=$LIBALT_LDFLAGS LIBALT_XLDADD=$LIBALT_LDADD LIBALT_LOCAL_XLDADD=$LIBALT_LOCAL_LDADD selection_j=NONE for i in $selection_list_j; do if eval test "x\$adl_libalt_${i}_ok" = xyes ; then # make sure all dependencies for this module have already been selected. eval adl_libalt_tmp_dep="\$adl_libalt_${i}_depend_on" adl_libalt_tmp_ok=yes for j in $adl_libalt_tmp_dep : ; do if test $j = : ; then break fi if eval test "x\$adl_libalt_${j}_selected" != xyes ; then adl_libalt_tmp_ok=no break fi done if test "$adl_libalt_tmp_ok" = yes ; then eval adl_libalt_tmp_opt=\"\$adl_libalt_${i}_opt\" # The default is to prepend. if test x"$adl_libalt_tmp_opt" = xAPPEND; then eval LIBALT_LDFLAGS=\"\$LIBALT_LDFLAGS \$adl_libalt_${i}_LDFLAGS\" eval LIBALT_LDADD=\"\$LIBALT_LDADD \$adl_libalt_${i}_LDADD\" LIBALT_LOCAL_LDADD="$LIBALT_LOCAL_LDADD media/libh$i.a" else eval LIBALT_LDFLAGS=\"\$adl_libalt_${i}_LDFLAGS \$LIBALT_LDFLAGS\" eval LIBALT_LDADD=\"\$adl_libalt_${i}_LDADD \$LIBALT_LDADD\" LIBALT_LOCAL_LDADD="media/libh$i.a $LIBALT_LOCAL_LDADD" fi eval "adl_libalt_${i}_selected=yes" selection_j=$i break fi fi done if test "x$selection_j" = xNONE ; then { { echo "$as_me:$LINENO: error: No joystick library found. The supported libraries are listed in README." >&5 echo "$as_me: error: No joystick library found. The supported libraries are listed in README." >&2;} { (exit 1); exit 1; }; } else eval adl_tmp_libalt_name='$adl_libalt_'"$selection_j"'_name' { echo "$as_me:$LINENO: Selected joystick library: $adl_tmp_libalt_name" >&5 echo "$as_me: Selected joystick library: $adl_tmp_libalt_name" >&6;} fi # Use _XLDLAGS, _XLDADS, etc. because Automake reserves _LDFLAGS, etc. LIBALT_XLDFLAGS=$LIBALT_LDFLAGS LIBALT_XLDADD=$LIBALT_LDADD LIBALT_LOCAL_XLDADD=$LIBALT_LOCAL_LDADD selection_m=NONE for i in sdlm allm stdm; do if eval test "x\$adl_libalt_${i}_ok" = xyes ; then # make sure all dependencies for this module have already been selected. eval adl_libalt_tmp_dep="\$adl_libalt_${i}_depend_on" adl_libalt_tmp_ok=yes for j in $adl_libalt_tmp_dep : ; do if test $j = : ; then break fi if eval test "x\$adl_libalt_${j}_selected" != xyes ; then adl_libalt_tmp_ok=no break fi done if test "$adl_libalt_tmp_ok" = yes ; then eval adl_libalt_tmp_opt=\"\$adl_libalt_${i}_opt\" # The default is to prepend. if test x"$adl_libalt_tmp_opt" = xAPPEND; then eval LIBALT_LDFLAGS=\"\$LIBALT_LDFLAGS \$adl_libalt_${i}_LDFLAGS\" eval LIBALT_LDADD=\"\$LIBALT_LDADD \$adl_libalt_${i}_LDADD\" LIBALT_LOCAL_LDADD="$LIBALT_LOCAL_LDADD sys/libh$i.a" else eval LIBALT_LDFLAGS=\"\$adl_libalt_${i}_LDFLAGS \$LIBALT_LDFLAGS\" eval LIBALT_LDADD=\"\$adl_libalt_${i}_LDADD \$LIBALT_LDADD\" LIBALT_LOCAL_LDADD="sys/libh$i.a $LIBALT_LOCAL_LDADD" fi eval "adl_libalt_${i}_selected=yes" selection_m=$i break fi fi done if test "x$selection_m" = xNONE ; then { { echo "$as_me:$LINENO: error: No startup library found. The supported libraries are listed in README." >&5 echo "$as_me: error: No startup library found. The supported libraries are listed in README." >&2;} { (exit 1); exit 1; }; } else eval adl_tmp_libalt_name='$adl_libalt_'"$selection_m"'_name' { echo "$as_me:$LINENO: Selected startup library: $adl_tmp_libalt_name" >&5 echo "$as_me: Selected startup library: $adl_tmp_libalt_name" >&6;} fi # Use _XLDLAGS, _XLDADS, etc. because Automake reserves _LDFLAGS, etc. LIBALT_XLDFLAGS=$LIBALT_LDFLAGS LIBALT_XLDADD=$LIBALT_LDADD LIBALT_LOCAL_XLDADD=$LIBALT_LOCAL_LDADD # ================================ # Check for any malloc() debugger. # ================================ # Check whether --with-mpatrol or --without-mpatrol was given. if test "${with_mpatrol+set}" = set; then withval="$with_mpatrol" fi; if test "$with_mpatrol" = yes; then test_failed='no' # should we check for mpatrol? if test "${with_mpatrol}" = no; then test_failed='yes' else # see if mpatrol is usable echo "$as_me:$LINENO: checking for library needed by mpatrol" >&5 echo $ECHO_N "checking for library needed by mpatrol... $ECHO_C" >&6 if test "${ac_cv_mpatrol_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_mpatrol_libs=missing adl_save_LIBS=$LIBS for lib_try in '' '-lelf' '-lbfd -liberty' '-lbfd -liberty -lcl'; do LIBS="$adl_save_LIBS -lmpatrol $lib_try" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char malloc (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_mpatrol_libs="-lmpatrol $lib_try" break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done LIBS="$adl_save_LIBS" fi echo "$as_me:$LINENO: result: $ac_cv_mpatrol_libs" >&5 echo "${ECHO_T}$ac_cv_mpatrol_libs" >&6 if test "$ac_cv_mpatrol_libs" != missing; then LIBS="$LIBS $ac_cv_mpatrol_libs" for ac_header in mpatrol.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done else { { echo "$as_me:$LINENO: error: Cannot find mpatrol" >&5 echo "$as_me: error: Cannot find mpatrol" >&2;} { (exit 1); exit 1; }; } fi fi fi # Check whether --with-mtrace or --without-mtrace was given. if test "${with_mtrace+set}" = set; then withval="$with_mtrace" fi; if test "$with_mtrace" = yes; then test_failed='no' # should we check for mtrace? if test "$with_mtrace" = no; then test_failed='yes' else if test "${ac_cv_header_mcheck_h+set}" = set; then echo "$as_me:$LINENO: checking for mcheck.h" >&5 echo $ECHO_N "checking for mcheck.h... $ECHO_C" >&6 if test "${ac_cv_header_mcheck_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_mcheck_h" >&5 echo "${ECHO_T}$ac_cv_header_mcheck_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking mcheck.h usability" >&5 echo $ECHO_N "checking mcheck.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking mcheck.h presence" >&5 echo $ECHO_N "checking mcheck.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: mcheck.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: mcheck.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: mcheck.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: mcheck.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: mcheck.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: mcheck.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: mcheck.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: mcheck.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: mcheck.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: mcheck.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for mcheck.h" >&5 echo $ECHO_N "checking for mcheck.h... $ECHO_C" >&6 if test "${ac_cv_header_mcheck_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_mcheck_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_mcheck_h" >&5 echo "${ECHO_T}$ac_cv_header_mcheck_h" >&6 fi if test $ac_cv_header_mcheck_h = yes; then for ac_func in mtrace do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else test_failed=yes fi done else test_failed=yes fi if test $test_failed = 'yes'; then { { echo "$as_me:$LINENO: error: Cannot find mtrace" >&5 echo "$as_me: error: Cannot find mtrace" >&2;} { (exit 1); exit 1; }; } fi fi fi # Check whether --with-dmalloc or --without-dmalloc was given. if test "${with_dmalloc+set}" = set; then withval="$with_dmalloc" fi; if test "$with_dmalloc" = yes; then test_failed='no' # should we check for dmalloc? if test "${with_dmalloc}" = no; then test_failed='yes' else # see if dmalloc is usable echo "$as_me:$LINENO: checking for malloc in -ldmalloc" >&5 echo $ECHO_N "checking for malloc in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char malloc (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_malloc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dmalloc_malloc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dmalloc_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_malloc" >&6 if test $ac_cv_lib_dmalloc_malloc = yes; then LIBS="-ldmalloc $LIBS" for ac_header in dmalloc.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done else { { echo "$as_me:$LINENO: error: Cannot find dmalloc" >&5 echo "$as_me: error: Cannot find dmalloc" >&2;} { (exit 1); exit 1; }; } fi fi fi # Check whether --with-efence or --without-efence was given. if test "${with_efence+set}" = set; then withval="$with_efence" fi; if test "$with_efence" = yes; then test_failed='no' # should we check for efence? if test "${with_efence}" = no; then test_failed='yes' else # see if efence is usable echo "$as_me:$LINENO: checking for malloc in -lefence" >&5 echo $ECHO_N "checking for malloc in -lefence... $ECHO_C" >&6 if test "${ac_cv_lib_efence_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lefence $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char malloc (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_efence_malloc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_efence_malloc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_efence_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_efence_malloc" >&6 if test $ac_cv_lib_efence_malloc = yes; then LIBS="-lefence $LIBS" else { { echo "$as_me:$LINENO: error: Cannot find Electric Fence" >&5 echo "$as_me: error: Cannot find Electric Fence" >&2;} { (exit 1); exit 1; }; } fi fi fi # don't test anything if --with-dmalloc or --with-efence # was given (assume that adl_WITH_DMALLOC or adl_WITH_EFENCE # has already run). if test "${with_mpatrol-no}" = no && test "${with_mtrace-no}" = no && test "${with_dmalloc-no}" = no && test "${with_efence-no}" = no; then # Check whether --enable-mem-debug or --disable-mem-debug was given. if test "${enable_mem_debug+set}" = set; then enableval="$enable_mem_debug" fi; if test "$enable_mem_debug" = yes; then test_failed='no' # should we check for mpatrol? if test "${with_mpatrol}" = no; then test_failed='yes' else # see if mpatrol is usable echo "$as_me:$LINENO: checking for library needed by mpatrol" >&5 echo $ECHO_N "checking for library needed by mpatrol... $ECHO_C" >&6 if test "${ac_cv_mpatrol_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_mpatrol_libs=missing adl_save_LIBS=$LIBS for lib_try in '' '-lelf' '-lbfd -liberty' '-lbfd -liberty -lcl'; do LIBS="$adl_save_LIBS -lmpatrol $lib_try" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char malloc (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_mpatrol_libs="-lmpatrol $lib_try" break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done LIBS="$adl_save_LIBS" fi echo "$as_me:$LINENO: result: $ac_cv_mpatrol_libs" >&5 echo "${ECHO_T}$ac_cv_mpatrol_libs" >&6 if test "$ac_cv_mpatrol_libs" != missing; then LIBS="$LIBS $ac_cv_mpatrol_libs" for ac_header in mpatrol.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done else test_failed='yes' fi fi if test "$test_failed" = yes; then test_failed='no' # should we check for mtrace? if test "$with_mtrace" = no; then test_failed='yes' else if test "${ac_cv_header_mcheck_h+set}" = set; then echo "$as_me:$LINENO: checking for mcheck.h" >&5 echo $ECHO_N "checking for mcheck.h... $ECHO_C" >&6 if test "${ac_cv_header_mcheck_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_mcheck_h" >&5 echo "${ECHO_T}$ac_cv_header_mcheck_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking mcheck.h usability" >&5 echo $ECHO_N "checking mcheck.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking mcheck.h presence" >&5 echo $ECHO_N "checking mcheck.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: mcheck.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: mcheck.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: mcheck.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: mcheck.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: mcheck.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: mcheck.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: mcheck.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: mcheck.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: mcheck.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: mcheck.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for mcheck.h" >&5 echo $ECHO_N "checking for mcheck.h... $ECHO_C" >&6 if test "${ac_cv_header_mcheck_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_mcheck_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_mcheck_h" >&5 echo "${ECHO_T}$ac_cv_header_mcheck_h" >&6 fi if test $ac_cv_header_mcheck_h = yes; then for ac_func in mtrace do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else test_failed=yes fi done else test_failed=yes fi fi if test "$test_failed" = yes; then test_failed='no' # should we check for dmalloc? if test "${with_dmalloc}" = no; then test_failed='yes' else # see if dmalloc is usable echo "$as_me:$LINENO: checking for malloc in -ldmalloc" >&5 echo $ECHO_N "checking for malloc in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char malloc (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_malloc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_dmalloc_malloc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dmalloc_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_malloc" >&6 if test $ac_cv_lib_dmalloc_malloc = yes; then LIBS="-ldmalloc $LIBS" for ac_header in dmalloc.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done else test_failed='yes' fi fi if test "$test_failed" = yes; then test_failed='no' # should we check for efence? if test "${with_efence}" = no; then test_failed='yes' else # see if efence is usable echo "$as_me:$LINENO: checking for malloc in -lefence" >&5 echo $ECHO_N "checking for malloc in -lefence... $ECHO_C" >&6 if test "${ac_cv_lib_efence_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lefence $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char malloc (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_efence_malloc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_efence_malloc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_efence_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_efence_malloc" >&6 if test $ac_cv_lib_efence_malloc = yes; then LIBS="-lefence $LIBS" else { { echo "$as_me:$LINENO: error: Cannot find Electric Fence" >&5 echo "$as_me: error: Cannot find Electric Fence" >&2;} { (exit 1); exit 1; }; } fi fi fi fi fi fi fi # ============================================== # Now that we have all the libraries, check that # compiled programs are still runnable. # ============================================== if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" main () { exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: === Compiled programs no longer run whith this setup. Most usually this means one of the library checked for above is not correctly installed (for example it can depens over some other uninstalled library, or been installed in a location which is not looked at by your system). You might want to check the error messages in the file 'config.log'. If you believe this is a bug in Heroes, be sure to send the file 'config.log' with your report to . " >&5 echo "$as_me: error: === Compiled programs no longer run whith this setup. Most usually this means one of the library checked for above is not correctly installed (for example it can depens over some other uninstalled library, or been installed in a location which is not looked at by your system). You might want to check the error messages in the file 'config.log'. If you believe this is a bug in Heroes, be sure to send the file 'config.log' with your report to . " >&2;} { (exit 1); exit 1; }; } fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi # ======================== # Checks for header files. # ======================== echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include <$ac_hdr> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi fi for ac_header in direct.h io.h memory.h stdbool.h stdint.h string.h strings.h stdlib.h sys/time.h unistd.h windows.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6 if test "${ac_cv_header_stat_broken+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #if defined(S_ISBLK) && defined(S_IFDIR) # if S_ISBLK (S_IFDIR) You lose. # endif #endif #if defined(S_ISBLK) && defined(S_IFCHR) # if S_ISBLK (S_IFCHR) You lose. # endif #endif #if defined(S_ISLNK) && defined(S_IFREG) # if S_ISLNK (S_IFREG) You lose. # endif #endif #if defined(S_ISSOCK) && defined(S_IFREG) # if S_ISSOCK (S_IFREG) You lose. # endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "You lose" >/dev/null 2>&1; then ac_cv_header_stat_broken=yes else ac_cv_header_stat_broken=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 echo "${ECHO_T}$ac_cv_header_stat_broken" >&6 if test $ac_cv_header_stat_broken = yes; then cat >>confdefs.h <<\_ACEOF #define STAT_MACROS_BROKEN 1 _ACEOF fi # ============================================================== # Checks for typedefs, structures, and compiler characteristics. # ============================================================== echo "$as_me:$LINENO: checking for ${CC-cc} option to accept ANSI C" >&5 echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6 if test "${am_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_prog_cc_stdc=no ac_save_CC="$CC" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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; } 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; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_prog_cc_stdc="$ac_arg"; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done CC="$ac_save_CC" fi if test -z "$am_cv_prog_cc_stdc"; then echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 else echo "$as_me:$LINENO: result: $am_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$am_cv_prog_cc_stdc" >&6 fi case "x$am_cv_prog_cc_stdc" in x|xno) ;; *) CC="$CC $am_cv_prog_cc_stdc" ;; esac echo "$as_me:$LINENO: checking for function prototypes" >&5 echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6 if test "$am_cv_prog_cc_stdc" != no; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define PROTOTYPES 1 _ACEOF U= ANSI2KNR= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 U=_ ANSI2KNR=./ansi2knr fi # Ensure some checks needed by ansi2knr itself. echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #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)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi for ac_header in string.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* 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"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 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; } #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const _ACEOF fi echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "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 echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi echo "$as_me:$LINENO: checking for ssize_t" >&5 echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 if test "${ac_cv_type_ssize_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { if ((ssize_t *) 0) return 0; if (sizeof (ssize_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_ssize_t=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_type_ssize_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 echo "${ECHO_T}$ac_cv_type_ssize_t" >&6 if test $ac_cv_type_ssize_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SSIZE_T 1 _ACEOF fi # ============================= # Checks for library functions. # ============================= echo "$as_me:$LINENO: checking whether malloc is declared" >&5 echo $ECHO_N "checking whether malloc is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef malloc char *p = (char *) malloc; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_malloc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_malloc=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_malloc" >&5 echo "${ECHO_T}$ac_cv_have_decl_malloc" >&6 if test $ac_cv_have_decl_malloc = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MALLOC 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MALLOC 0 _ACEOF fi echo "$as_me:$LINENO: checking whether realloc is declared" >&5 echo $ECHO_N "checking whether realloc is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_realloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef realloc char *p = (char *) realloc; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_realloc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_realloc=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_realloc" >&5 echo "${ECHO_T}$ac_cv_have_decl_realloc" >&6 if test $ac_cv_have_decl_realloc = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_REALLOC 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_REALLOC 0 _ACEOF fi echo "$as_me:$LINENO: checking whether calloc is declared" >&5 echo $ECHO_N "checking whether calloc is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_calloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef calloc char *p = (char *) calloc; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_calloc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_calloc=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_calloc" >&5 echo "${ECHO_T}$ac_cv_have_decl_calloc" >&6 if test $ac_cv_have_decl_calloc = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CALLOC 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_CALLOC 0 _ACEOF fi echo "$as_me:$LINENO: checking whether free is declared" >&5 echo $ECHO_N "checking whether free is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_free+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef free char *p = (char *) free; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_free=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_free=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_free" >&5 echo "${ECHO_T}$ac_cv_have_decl_free" >&6 if test $ac_cv_have_decl_free = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FREE 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_FREE 0 _ACEOF fi echo "$as_me:$LINENO: checking whether memrchr is declared" >&5 echo $ECHO_N "checking whether memrchr is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_memrchr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef memrchr char *p = (char *) memrchr; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_memrchr=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_memrchr=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_memrchr" >&5 echo "${ECHO_T}$ac_cv_have_decl_memrchr" >&6 if test $ac_cv_have_decl_memrchr = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MEMRCHR 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_MEMRCHR 0 _ACEOF fi echo "$as_me:$LINENO: checking whether stpcpy is declared" >&5 echo $ECHO_N "checking whether stpcpy is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_stpcpy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef stpcpy char *p = (char *) stpcpy; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_stpcpy=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_stpcpy=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_stpcpy" >&5 echo "${ECHO_T}$ac_cv_have_decl_stpcpy" >&6 if test $ac_cv_have_decl_stpcpy = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STPCPY 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STPCPY 0 _ACEOF fi echo "$as_me:$LINENO: checking whether strcasecmp is declared" >&5 echo $ECHO_N "checking whether strcasecmp is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strcasecmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef strcasecmp char *p = (char *) strcasecmp; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strcasecmp=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_strcasecmp=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strcasecmp" >&5 echo "${ECHO_T}$ac_cv_have_decl_strcasecmp" >&6 if test $ac_cv_have_decl_strcasecmp = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRCASECMP 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRCASECMP 0 _ACEOF fi echo "$as_me:$LINENO: checking whether strnlen is declared" >&5 echo $ECHO_N "checking whether strnlen is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strnlen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef strnlen char *p = (char *) strnlen; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strnlen=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_strnlen=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strnlen" >&5 echo "${ECHO_T}$ac_cv_have_decl_strnlen" >&6 if test $ac_cv_have_decl_strnlen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNLEN 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRNLEN 0 _ACEOF fi for ac_func in gettimeofday memcpy sleep getegid setgid setegid setregid do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for readdir" >&5 echo $ECHO_N "checking for readdir... $ECHO_C" >&6 if test "${ac_cv_func_readdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char readdir (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char readdir (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_readdir) || defined (__stub___readdir) choke me #else f = readdir; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_readdir=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_readdir=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_readdir" >&5 echo "${ECHO_T}$ac_cv_func_readdir" >&6 if test $ac_cv_func_readdir = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_READDIR 1 _ACEOF else if test "${ac_cv_header_windows_h+set}" = set; then echo "$as_me:$LINENO: checking for windows.h" >&5 echo $ECHO_N "checking for windows.h... $ECHO_C" >&6 if test "${ac_cv_header_windows_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 echo "${ECHO_T}$ac_cv_header_windows_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking windows.h usability" >&5 echo $ECHO_N "checking windows.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking windows.h presence" >&5 echo $ECHO_N "checking windows.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: windows.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: windows.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: windows.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: windows.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: windows.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: windows.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for windows.h" >&5 echo $ECHO_N "checking for windows.h... $ECHO_C" >&6 if test "${ac_cv_header_windows_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_windows_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 echo "${ECHO_T}$ac_cv_header_windows_h" >&6 fi if test $ac_cv_header_windows_h = yes; then # build w_dirent if readdir is absent and windows.h exists LIBOBJS="$LIBOBJS w_dirent.$ac_objext" else { { echo "$as_me:$LINENO: error: Could not find \`readdir'." >&5 echo "$as_me: error: Could not find \`readdir'." >&2;} { (exit 1); exit 1; }; } fi fi for ac_func in vprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF echo "$as_me:$LINENO: checking for _doprnt" >&5 echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6 if test "${ac_cv_func__doprnt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char _doprnt (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char _doprnt (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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__doprnt) || defined (__stub____doprnt) choke me #else f = _doprnt; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func__doprnt=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func__doprnt=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5 echo "${ECHO_T}$ac_cv_func__doprnt" >&6 if test $ac_cv_func__doprnt = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_DOPRNT 1 _ACEOF fi fi done for ac_func in mkdir _mkdir do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether mkdir takes one argument" >&5 echo $ECHO_N "checking whether mkdir takes one argument... $ECHO_C" >&6 if test "${ac_cv_mkdir_takes_one_arg+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #if HAVE_UNISTD_H # include #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { mkdir ("."); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_mkdir_takes_one_arg=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_mkdir_takes_one_arg=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_mkdir_takes_one_arg" >&5 echo "${ECHO_T}$ac_cv_mkdir_takes_one_arg" >&6 if test x"$ac_cv_mkdir_takes_one_arg" = xyes; then cat >>confdefs.h <<\_ACEOF #define MKDIR_TAKES_ONE_ARG 1 _ACEOF fi for ac_func in memrchr stpcpy strndup strcasecmp do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else LIBOBJS="$LIBOBJS $ac_func.$ac_objext" fi done cat >>confdefs.h <<\_ACEOF #define HAVE_DONE_WORKING_MALLOC_CHECK 1 _ACEOF echo "$as_me:$LINENO: checking for working malloc" >&5 echo $ECHO_N "checking for working malloc... $ECHO_C" >&6 if test "${jm_cv_func_working_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then jm_cv_func_working_malloc=no else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" char *malloc (); int main () { exit (malloc (0) ? 0 : 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then jm_cv_func_working_malloc=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) jm_cv_func_working_malloc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $jm_cv_func_working_malloc" >&5 echo "${ECHO_T}$jm_cv_func_working_malloc" >&6 if test $jm_cv_func_working_malloc = no; then LIBOBJS="$LIBOBJS malloc.$ac_objext" cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi # We used to clear LIBS to work around a bug (?) on # alphaev56-dec-osf4.0d where conftest (run by jm_FUNC_REALLOC) never # exits when linked with `-lgii' or `-lggi'. But today `-lggi' and # `-lgii' are not put in LIBS any longer. cat >>confdefs.h <<\_ACEOF #define HAVE_DONE_WORKING_REALLOC_CHECK 1 _ACEOF echo "$as_me:$LINENO: checking for working realloc" >&5 echo $ECHO_N "checking for working realloc... $ECHO_C" >&6 if test "${jm_cv_func_working_realloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then jm_cv_func_working_realloc=no else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" char *realloc (); int main () { exit (realloc (0, 0) ? 0 : 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then jm_cv_func_working_realloc=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) jm_cv_func_working_realloc=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $jm_cv_func_working_realloc" >&5 echo "${ECHO_T}$jm_cv_func_working_realloc" >&6 if test $jm_cv_func_working_realloc = no; then LIBOBJS="$LIBOBJS realloc.$ac_objext" cat >>confdefs.h <<\_ACEOF #define realloc rpl_realloc _ACEOF fi # for error.c for ac_func in strerror do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether strerror is declared" >&5 echo $ECHO_N "checking whether strerror is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strerror+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef strerror char *p = (char *) strerror; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strerror=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_strerror=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror" >&5 echo "${ECHO_T}$ac_cv_have_decl_strerror" >&6 if test $ac_cv_have_decl_strerror = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR 0 _ACEOF fi echo "$as_me:$LINENO: checking whether strerror_r is declared" >&5 echo $ECHO_N "checking whether strerror_r is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_strerror_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef strerror_r char *p = (char *) strerror_r; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_have_decl_strerror_r=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_have_decl_strerror_r=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_have_decl_strerror_r" >&5 echo "${ECHO_T}$ac_cv_have_decl_strerror_r" >&6 if test $ac_cv_have_decl_strerror_r = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 1 _ACEOF else cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R 0 _ACEOF fi for ac_func in strerror_r do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking whether strerror_r returns char *" >&5 echo $ECHO_N "checking whether strerror_r returns char *... $ECHO_C" >&6 if test "${ac_cv_func_strerror_r_char_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default extern char *strerror_r (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); exit (!isalpha (x)); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_strerror_r_char_p=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_func_strerror_r_char_p" >&5 echo "${ECHO_T}$ac_cv_func_strerror_r_char_p" >&6 if test $ac_cv_func_strerror_r_char_p = yes; then cat >>confdefs.h <<\_ACEOF #define STRERROR_R_CHAR_P 1 _ACEOF fi for ac_func in ftruncate do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else ftruncate_missing=yes fi done if test "$ftruncate_missing" = yes; then for ac_header in unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in chsize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBOBJS="$LIBOBJS ftruncate.$ac_objext" fi # clean out junk possibly left behind by a previous configuration rm -f lib/getopt.h # Check for getopt_long support if test "${ac_cv_header_getopt_h+set}" = set; then echo "$as_me:$LINENO: checking for getopt.h" >&5 echo $ECHO_N "checking for getopt.h... $ECHO_C" >&6 if test "${ac_cv_header_getopt_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_getopt_h" >&5 echo "${ECHO_T}$ac_cv_header_getopt_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking getopt.h usability" >&5 echo $ECHO_N "checking getopt.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking getopt.h presence" >&5 echo $ECHO_N "checking getopt.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: getopt.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: getopt.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: getopt.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: getopt.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: getopt.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: getopt.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: getopt.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: getopt.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: getopt.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: getopt.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for getopt.h" >&5 echo $ECHO_N "checking for getopt.h... $ECHO_C" >&6 if test "${ac_cv_header_getopt_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_getopt_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_getopt_h" >&5 echo "${ECHO_T}$ac_cv_header_getopt_h" >&6 fi for ac_func in getopt_long do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else # FreeBSD has a gnugetopt library for this echo "$as_me:$LINENO: checking for getopt_long in -lgnugetopt" >&5 echo $ECHO_N "checking for getopt_long in -lgnugetopt... $ECHO_C" >&6 if test "${ac_cv_lib_gnugetopt_getopt_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgnugetopt $LIBS" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char getopt_long (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { getopt_long (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gnugetopt_getopt_long=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_lib_gnugetopt_getopt_long=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_gnugetopt_getopt_long" >&5 echo "${ECHO_T}$ac_cv_lib_gnugetopt_getopt_long" >&6 if test $ac_cv_lib_gnugetopt_getopt_long = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETOPT_LONG 1 _ACEOF else # use the GNU replacement LIBOBJS="$LIBOBJS getopt.$ac_objext" LIBOBJS="$LIBOBJS getopt1.$ac_objext" ac_config_links="$ac_config_links lib/getopt.h:lib/gnugetopt.h" fi fi done for ac_header in fcntl.h sys/file.h io.h sys/locking.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in fcntl flock _locking do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # ==================== # Check for endianess. # ==================== echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 # It does not, try to run a simple test if test "$cross_compiling" = yes; then ac_cv_c_bigendian="unknown (cross-compiling)" else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 if test "$ac_cv_c_bigendian" = "unknown (cross-compiling)"; then echo "$as_me:$LINENO: checking whether byte order LOOKS bigendian" >&5 echo $ECHO_N "checking whether byte order LOOKS bigendian... $ECHO_C" >&6 cat >conftest.c <&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 fi case "$ac_cv_c_bigendian" in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF BYTEORDER=4321 ;; no) BYTEORDER=1234 ;; *) { { echo "$as_me:$LINENO: error: unknown endianess - sorry" >&5 echo "$as_me: error: unknown endianess - sorry" >&2;} { (exit 1); exit 1; }; } ;; esac cat >>confdefs.h <<_ACEOF #define BYTEORDER $BYTEORDER _ACEOF # =============== # Filename style. # =============== echo "$as_me:$LINENO: checking whether system is Windows or MSDOS" >&5 echo $ECHO_N "checking whether system is Windows or MSDOS... $ECHO_C" >&6 if test "${ac_cv_win_or_dos+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ neither MSDOS nor Windows #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_win_or_dos=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_win_or_dos=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_win_or_dos" >&5 echo "${ECHO_T}$ac_cv_win_or_dos" >&6 if test x"$ac_cv_win_or_dos" = xyes; then ac_fs_accepts_drive_letter_prefix=1 ac_fs_backslash_is_file_name_separator=1 else ac_fs_accepts_drive_letter_prefix=0 ac_fs_backslash_is_file_name_separator=0 fi cat >>confdefs.h <<_ACEOF #define FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX $ac_fs_accepts_drive_letter_prefix _ACEOF cat >>confdefs.h <<_ACEOF #define FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR $ac_fs_backslash_is_file_name_separator _ACEOF # ===================== # Internationalization. # ===================== ALL_LINGUAS="de fr it nl pt_BR" echo "$as_me:$LINENO: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifndef __cplusplus static $ac_kw int static_foo () {return 0; } $ac_kw int foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done fi echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; no) cat >>confdefs.h <<\_ACEOF #define inline _ACEOF ;; *) cat >>confdefs.h <<_ACEOF #define inline $ac_cv_c_inline _ACEOF ;; esac echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _ACEOF fi echo "$as_me:$LINENO: checking for size_t" >&5 echo $ECHO_N "checking for size_t... $ECHO_C" >&6 if test "${ac_cv_type_size_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { if ((size_t *) 0) return 0; if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_size_t=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_type_size_t=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 echo "${ECHO_T}$ac_cv_type_size_t" >&6 if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned _ACEOF fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo "$as_me:$LINENO: checking for working alloca.h" >&5 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 if test "${ac_cv_working_alloca_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { char *p = (char *) alloca (2 * sizeof (int)); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_alloca_h=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_working_alloca_h=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 if test $ac_cv_working_alloca_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #ifdef __GNUC__ # define alloca __builtin_alloca #else # ifdef _MSC_VER # include # define alloca _alloca # else # if HAVE_ALLOCA_H # include # else # ifdef _AIX #pragma alloca # else # ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); # endif # endif # endif # endif #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { char *p = (char *) alloca (1); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_cv_func_alloca_works=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 if test $ac_cv_func_alloca_works = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else ac_cv_os_cray=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 echo "${ECHO_T}$ac_cv_os_cray" >&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { exit (find_stack_direction () < 0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_stack_direction=-1 fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 cat >>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_header in stdlib.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done echo "$as_me:$LINENO: checking for working mmap" >&5 echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !STDC_HEADERS && !HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # if HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) exit (1); for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) exit (1); if (write (fd, data, pagesize) != pagesize) exit (1); close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) exit (1); data2 = (char *) malloc (2 * pagesize); if (!data2) exit (1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) exit (1); /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) exit (1); if (read (fd, data3, pagesize) != pagesize) exit (1); for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) exit (1); close (fd); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap echo "$as_me:$LINENO: checking whether we are using the GNU C Library 2.1 or newer" >&5 echo $ECHO_N "checking whether we are using the GNU C Library 2.1 or newer... $ECHO_C" >&6 if test "${ac_cv_gnu_library_2_1+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #ifdef __GNU_LIBRARY__ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) Lucky GNU user #endif #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "Lucky GNU user" >/dev/null 2>&1; then ac_cv_gnu_library_2_1=yes else ac_cv_gnu_library_2_1=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_gnu_library_2_1" >&5 echo "${ECHO_T}$ac_cv_gnu_library_2_1" >&6 GLIBC21="$ac_cv_gnu_library_2_1" for ac_header in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ stdlib.h string.h unistd.h sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \ getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ strdup strtoul tsearch __argz_count __argz_stringify __argz_next do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval="$with_libiconv_prefix" for dir in `echo "$withval" | tr : ' '`; do if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi done fi; echo "$as_me:$LINENO: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6 if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS -liconv" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6 if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF echo "$as_me:$LINENO: checking for iconv declaration" >&5 echo $ECHO_N "checking for iconv declaration... $ECHO_C" >&6 if test "${am_cv_proto_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_proto_iconv_arg1="" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 echo "${ECHO_T}${ac_t:- }$am_cv_proto_iconv" >&6 cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi LIBICONV= if test "$am_cv_lib_iconv" = yes; then LIBICONV="-liconv" fi echo "$as_me:$LINENO: checking for nl_langinfo and CODESET" >&5 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { char* cs = nl_langinfo(CODESET); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 am_cv_langinfo_codeset=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 if test $am_cv_langinfo_codeset = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LANGINFO_CODESET 1 _ACEOF fi if test $ac_cv_header_locale_h = yes; then echo "$as_me:$LINENO: checking for LC_MESSAGES" >&5 echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 if test "${am_cv_val_LC_MESSAGES+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return LC_MESSAGES ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_val_LC_MESSAGES=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 am_cv_val_LC_MESSAGES=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 if test $am_cv_val_LC_MESSAGES = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 _ACEOF fi fi echo "$as_me:$LINENO: checking whether NLS is requested" >&5 echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes fi; echo "$as_me:$LINENO: result: $USE_NLS" >&5 echo "${ECHO_T}$USE_NLS" >&6 BUILD_INCLUDED_LIBINTL=no USE_INCLUDED_LIBINTL=no INTLLIBS= if test "$USE_NLS" = "yes"; then cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 _ACEOF echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 # Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no fi; echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then CATOBJEXT=NONE if test "${ac_cv_header_libintl_h+set}" = set; then echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking libintl.h usability" >&5 echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking libintl.h presence" >&5 echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc in yes:no ) { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;};; no:yes ) { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;};; esac echo "$as_me:$LINENO: checking for libintl.h" >&5 echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 if test "${ac_cv_header_libintl_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_libintl_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 fi if test $ac_cv_header_libintl_h = yes; then echo "$as_me:$LINENO: checking for GNU gettext in libc" >&5 echo $ECHO_N "checking for GNU gettext in libc... $ECHO_C" >&6 if test "${gt_cv_func_gnugettext2_libc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include extern int _nl_msg_cat_cntr; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { bindtextdomain ("", ""); return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_gnugettext2_libc=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 gt_cv_func_gnugettext2_libc=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext2_libc" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext2_libc" >&6 if test "$gt_cv_func_gnugettext2_libc" != "yes"; then echo "$as_me:$LINENO: checking for GNU gettext in libintl" >&5 echo $ECHO_N "checking for GNU gettext in libintl... $ECHO_C" >&6 if test "${gt_cv_func_gnugettext2_libintl+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else gt_save_LIBS="$LIBS" LIBS="$LIBS -lintl $LIBICONV" cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" #include extern int _nl_msg_cat_cntr; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { bindtextdomain ("", ""); return (int) gettext ("") + (int) ngettext ("", "", 0) + _nl_msg_cat_cntr ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then gt_cv_func_gnugettext2_libintl=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 gt_cv_func_gnugettext2_libintl=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi echo "$as_me:$LINENO: result: $gt_cv_func_gnugettext2_libintl" >&5 echo "${ECHO_T}$gt_cv_func_gnugettext2_libintl" >&6 fi if test "$gt_cv_func_gnugettext2_libc" = "yes" \ || { test "$gt_cv_func_gnugettext2_libintl" = "yes" \ && test "$PACKAGE" != gettext; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 _ACEOF if test "$gt_cv_func_gnugettext2_libintl" = "yes"; then INTLLIBS="-lintl $LIBICONV" fi gt_save_LIBS="$LIBS" LIBS="$LIBS $INTLLIBS" for ac_func in dcgettext do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF #line $LINENO "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ #include /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (); char (*f) (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* 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_$ac_func) || defined (__stub___$ac_func) choke me #else f = $ac_func; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done LIBS="$gt_save_LIBS" # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="no" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != "no"; then echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$MSGFMT" != "no"; then # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CATOBJEXT=.gmo fi fi if test "$CATOBJEXT" = "NONE"; then nls_cv_use_gnu_gettext=yes fi fi if test "$nls_cv_use_gnu_gettext" = "yes"; then INTLOBJS="\$(GETTOBJS)" # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_MSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"; then ac_cv_path_MSGFMT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt" ;; esac fi MSGFMT="$ac_cv_path_MSGFMT" if test "$MSGFMT" != "msgfmt"; then echo "$as_me:$LINENO: result: $MSGFMT" >&5 echo "${ECHO_T}$MSGFMT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GMSGFMT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GMSGFMT in [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi GMSGFMT=$ac_cv_path_GMSGFMT if test -n "$GMSGFMT"; then echo "$as_me:$LINENO: result: $GMSGFMT" >&5 echo "${ECHO_T}$GMSGFMT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_XGETTEXT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then ac_cv_path_XGETTEXT="$ac_dir/$ac_word" break fi fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" ;; esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test "$XGETTEXT" != ":"; then echo "$as_me:$LINENO: result: $XGETTEXT" >&5 echo "${ECHO_T}$XGETTEXT" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi BUILD_INCLUDED_LIBINTL=yes USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo INTLLIBS="\$(top_builddir)/intl/libintl.a $LIBICONV" LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` fi if test "$XGETTEXT" != ":"; then if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else echo "$as_me:$LINENO: result: found xgettext program is not GNU xgettext; ignore it" >&5 echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 XGETTEXT=":" fi fi POSUB=po fi ac_config_commands="$ac_config_commands default-1" if test "$PACKAGE" = gettext; then BUILD_INCLUDED_LIBINTL=yes fi for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_INTLBISON+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$INTLBISON"; then ac_cv_prog_INTLBISON="$INTLBISON" # 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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_INTLBISON="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi INTLBISON=$ac_cv_prog_INTLBISON if test -n "$INTLBISON"; then echo "$as_me:$LINENO: result: $INTLBISON" >&5 echo "${ECHO_T}$INTLBISON" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$INTLBISON" && break done if test -z "$INTLBISON"; then ac_verc_fail=yes else echo "$as_me:$LINENO: checking version of bison" >&5 echo $ECHO_N "checking version of bison... $ECHO_C" >&6 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison .* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; esac echo "$as_me:$LINENO: result: $ac_prog_version" >&5 echo "${ECHO_T}$ac_prog_version" >&6 fi if test $ac_verc_fail = yes; then INTLBISON=: fi for lang in $ALL_LINGUAS; do GMOFILES="$GMOFILES $lang.gmo" POFILES="$POFILES $lang.po" done nls_cv_header_intl= nls_cv_header_libgt= DATADIRNAME=share INSTOBJEXT=.mo GENCAT=gencat if test "x$CATOBJEXT" != "x"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 NEW_LINGUAS= for presentlang in $ALL_LINGUAS; do useit=no for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do # Use the presentlang catalog if desiredlang is # a. equal to presentlang, or # b. a variant of presentlang (because in this case, # presentlang can be used as a fallback for messages # which are not translated in the desiredlang catalog). case "$desiredlang" in "$presentlang"*) useit=yes;; esac done if test $useit = yes; then NEW_LINGUAS="$NEW_LINGUAS $presentlang" fi done LINGUAS=$NEW_LINGUAS echo "$as_me:$LINENO: result: $LINGUAS" >&5 echo "${ECHO_T}$LINGUAS" >&6 fi if test -n "$LINGUAS"; then for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done fi fi MKINSTALLDIRS= if test -n "$ac_aux_dir"; then MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" fi if test -z "$MKINSTALLDIRS"; then MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" fi INTL_LIBTOOL_SUFFIX_PREFIX= # =================================== # Setup the correct compiler options. # =================================== # Check whether --enable-devel or --disable-devel was given. if test "${enable_devel+set}" = set; then enableval="$enable_devel" fi; if test x"$enable_devel" = xyes; then enable_debug=${enable_debug-yes} enable_warnings=${enable_warnings-yes} enable_assert=${enable_assert-yes} enable_optimizations=${enable_optimizations--O} fi # Check whether --enable-assert or --disable-assert was given. if test "${enable_assert+set}" = set; then enableval="$enable_assert" fi; if test "$enable_assert" != yes; then CFLAGS="$CFLAGS -DNDEBUG" fi # Check whether --enable-gprof or --disable-gprof was given. if test "${enable_gprof+set}" = set; then enableval="$enable_gprof" fi; if test "${enable_gprof}" = "yes" -a -n "$GCC"; then CFLAGS="$CFLAGS -pg" fi # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" fi; case "${enable_debug}" in yes) cat >>confdefs.h <<\_ACEOF #define DEBUG 1 _ACEOF if test -n "$GCC"; then CFLAGS="$CFLAGS -ggdb3" else if test "${ac_cv_prog_cc_g}" = yes; then CFLAGS="$CFLAGS -g" fi fi ;; no) ;; *) if test "${ac_cv_prog_cc_g}" = yes; then CFLAGS="$CFLAGS -g" fi ;; esac # Check whether --enable-optimizations or --disable-optimizations was given. if test "${enable_optimizations+set}" = set; then enableval="$enable_optimizations" fi; if test -n "$GCC" -a "${enable_optimizations-yes}" = "yes"; then echo "$as_me:$LINENO: checking for gcc optimization options" >&5 echo $ECHO_N "checking for gcc optimization options... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_opt_flags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_cv_prog_gcc_opt_flags="$ac_cv_prog_gcc_opt_flags -$cf_opt" fi done rm -f conftest* CFLAGS="$cf_save_CFLAGS $ac_cv_prog_gcc_opt_flags" fi echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_opt_flags" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_opt_flags" >&6 else case $enable_optimizations in no) ;; *) CFLAGS="$CFLAGS $enable_optimizations" ;; esac fi # Check whether --enable-warnings or --disable-warnings was given. if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" fi; if test "$enable_warnings" = "yes"; then if test -n "$GCC"; then echo "$as_me:$LINENO: checking for gcc warning options" >&5 echo $ECHO_N "checking for gcc warning options... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_warn_flags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_cv_prog_gcc_warn_flags="$ac_cv_prog_gcc_warn_flags -$cf_opt" test "$cf_opt" = Wcast-qual && ac_cv_prog_gcc_warn_flags="$ac_cv_prog_gcc_warn_flags -DXTSTRINGDEFINES" fi done rm -f conftest* CFLAGS="$cf_save_CFLAGS" fi echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_warn_flags" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_warn_flags" >&6 fi CFLAGS="${CFLAGS} ${ac_cv_prog_gcc_warn_flags}" if test -n "$GCC"; then echo "$as_me:$LINENO: checking for more gcc warning options" >&5 echo $ECHO_N "checking for more gcc warning options... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_more_warn_flags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_cv_prog_gcc_more_warn_flags="$ac_cv_prog_gcc_more_warn_flags -$cf_opt" test "$cf_opt" = Wcast-qual && ac_cv_prog_gcc_more_warn_flags="$ac_cv_prog_gcc_more_warn_flags -DXTSTRINGDEFINES" fi done rm -f conftest* CFLAGS="$cf_save_CFLAGS" fi echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_more_warn_flags" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_more_warn_flags" >&6 fi MORE_WARNINGS_CFLAGS="${ac_cv_prog_gcc_more_warn_flags}" fi # ========================== # Directories configuration. # ========================== localedir='${datadir}'/locale pkgdatadir="$datadir/heroes" for _lcl_i in bindir:prefix:backward_relative_bindir prefix:pkgdatadir:forward_relative_pkgdatadir prefix:localedir:forward_relative_localedir ; do _lcl_from=\$`echo "$_lcl_i" | sed 's,:.*$,,'` _lcl_to=\$`echo "$_lcl_i" | sed 's,^[^:]*:,,' | sed 's,:[^:]*$,,'` _lcl_result_var=`echo "$_lcl_i" | sed 's,^.*:,,'` _lcl_receval="$_lcl_from" _lcl_from=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" _lcl_receval_old='' while test "$_lcl_receval_old" != "$_lcl_receval"; do _lcl_receval_old="$_lcl_receval" eval _lcl_receval="\"$_lcl_receval\"" done echo "$_lcl_receval")` _lcl_receval="$_lcl_to" _lcl_to=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" _lcl_receval_old='' while test "$_lcl_receval_old" != "$_lcl_receval"; do _lcl_receval_old="$_lcl_receval" eval _lcl_receval="\"$_lcl_receval\"" done echo "$_lcl_receval")` _lcl_notation="$_lcl_from$_lcl_to" case ":$_lcl_from:" in # change empty paths to '.' ::) _lcl_from='.' ;; # strip trailing slashes :*[\\/]:) _lcl_from=`echo "$_lcl_from" | sed 's,[\\/]*$,,'` ;; :*:) ;; esac # squeze repeated slashes case '/' in # if the path contains any backslashes, turn slashes into backslashes *\\*) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1\\\\,g'` ;; # if the path contains slashes, also turn backslashes into slashes *) _lcl_from=`echo "$_lcl_from" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; esac case ":$_lcl_to:" in # change empty paths to '.' ::) _lcl_to='.' ;; # strip trailing slashes :*[\\/]:) _lcl_to=`echo "$_lcl_to" | sed 's,[\\/]*$,,'` ;; :*:) ;; esac # squeze repeated slashes case '/' in # if the path contains any backslashes, turn slashes into backslashes *\\*) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1\\\\,g'` ;; # if the path contains slashes, also turn backslashes into slashes *) _lcl_to=`echo "$_lcl_to" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; esac _lcl_common_prefix='' _lcl_second_prefix_match='' while test "$_lcl_second_prefix_match" != 0; do _lcl_first_prefix=`expr "x$_lcl_from" : "x\($_lcl_common_prefix/*[^/]*\)"` _lcl_second_prefix_match=`expr "x$_lcl_to" : "x$_lcl_first_prefix"` if test "$_lcl_second_prefix_match" != 0; then if test "$_lcl_first_prefix" != "$_lcl_common_prefix"; then _lcl_common_prefix="$_lcl_first_prefix" else _lcl_second_prefix_match=0 fi fi done _lcl_first_suffix=`expr "x$_lcl_from" : "x$_lcl_common_prefix/*\(.*\)"` _lcl_first_rel='' _lcl_tmp='xxx' while test "$_lcl_tmp" != ''; do _lcl_tmp=`expr "x$_lcl_first_suffix" : "x[^/]*/*\(.*\)"` if test "$_lcl_first_suffix" != ''; then _lcl_first_suffix="$_lcl_tmp" _lcl_first_rel="../$_lcl_first_rel" fi done _lcl_second_suffix=`expr "x$_lcl_to" : "x$_lcl_common_prefix/*\(.*\)"` _lcl_result_tmp="$_lcl_first_rel$_lcl_second_suffix" case ":$_lcl_result_tmp:" in # change empty paths to '.' ::) _lcl_result_tmp='.' ;; # strip trailing slashes :*[\\/]:) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,[\\/]*$,,'` ;; :*:) ;; esac # squeze repeated slashes case "$_lcl_notation" in # if the path contains any backslashes, turn slashes into backslashes *\\*) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1\\\\,g'` ;; # if the path contains slashes, also turn backslashes into slashes *) _lcl_result_tmp=`echo "$_lcl_result_tmp" | sed 's,\(.\)[\\/][\\/]*,\1/,g'` ;; esac eval $_lcl_result_var='$_lcl_result_tmp' done cat >>confdefs.h <<_ACEOF #define BACKWARD_RELATIVE_BINDIR "$backward_relative_bindir" _ACEOF cat >>confdefs.h <<_ACEOF #define FORWARD_RELATIVE_PKGDATADIR "$forward_relative_pkgdatadir" _ACEOF cat >>confdefs.h <<_ACEOF #define FORWARD_RELATIVE_LOCALEDIR "$forward_relative_localedir" _ACEOF ac_expanded=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""$prefix"\" )` cat >>confdefs.h <<_ACEOF #define PREFIX "$ac_expanded" _ACEOF # ============== # Misc. options. # ============== # Check whether --enable-html-doc or --disable-html-doc was given. if test "${enable_html_doc+set}" = set; then enableval="$enable_html_doc" fi; if test "${enable_html_doc-no}" != no; then if test "x$enable_html_doc" = xyes; then htmldir="$data_dir/doc" else htmldir="$enable_html_doc" fi else htmldir='\' fi if test "${enable_html_doc-no}" != no; then MAKE_HTML_TRUE= MAKE_HTML_FALSE='#' else MAKE_HTML_TRUE='#' MAKE_HTML_FALSE= fi # Check whether --enable-heroes-debug or --disable-heroes-debug was given. if test "${enable_heroes_debug+set}" = set; then enableval="$enable_heroes_debug" fi; if test "x$enable_heroes_debug" != xno; then cat >>confdefs.h <<\_ACEOF #define USE_HEROES_DEBUG 1 _ACEOF fi # ============ # Output files # ============ # Put config.h in the base directory because libintl expects it here, # but keep src/config.h.in in the src/ directory to keep the base directory # as clean as possible. # Add the stamp file to the list of files AC keeps track of, # along with our hook. ac_config_headers="$ac_config_headers config.h:src/config.h.in" ac_config_files="$ac_config_files Makefile doc/Makefile intl/Makefile lib/Makefile man/Makefile po/Makefile.in src/Makefile tests/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 overriden 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, don't put newlines in cache variables' values. # 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. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *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 \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if cmp -s $cache_file confcache; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" 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}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ 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[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GPERF_TRUE}" && test -z "${HAVE_GPERF_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"HAVE_GPERF\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"HAVE_GPERF\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${MAKE_HTML_TRUE}" && test -z "${MAKE_HTML_FALSE}"; then { { echo "$as_me:$LINENO: error: conditional \"MAKE_HTML\" was never defined. Usually this means the macro was only invoked conditionally." >&5 echo "$as_me: error: conditional \"MAKE_HTML\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $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 SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi # NLS nuisances. # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && { $as_unset LANG || test "${LANG+set}" != set; } || { LANG=C; export LANG; } (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || { LC_ALL=C; export LC_ALL; } (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || { LC_TIME=C; export LC_TIME; } (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || { LC_CTYPE=C; export LC_CTYPE; } (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || { LANGUAGE=C; export LANGUAGE; } (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || { LC_COLLATE=C; export LC_COLLATE; } (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || { LC_NUMERIC=C; export LC_NUMERIC; } (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || { LC_MESSAGES=C; export LC_MESSAGES; } # Name of the executable. as_me=`(basename "$0") 2>/dev/null || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # 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 # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conftest.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. 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 ;; 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 { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); 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 sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by heroes $as_me 0.21, which was generated by GNU Autoconf 2.53. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -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 links: $config_links Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ heroes config.status 0.21 configured by $0, generated by GNU Autoconf 2.53, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` shift set dummy "$ac_option" "$ac_optarg" ${1+"$@"} shift ;; -*);; *) # This is not an option, so the user has probably given explicit # arguments. ac_need_defaults=false;; esac case $1 in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) shift CONFIG_FILES="$CONFIG_FILES $1" ac_need_defaults=false;; --header | --heade | --head | --hea ) shift CONFIG_HEADERS="$CONFIG_HEADERS $1" ac_need_defaults=false;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # INIT-COMMANDS section. # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "intl/Makefile" ) CONFIG_FILES="$CONFIG_FILES intl/Makefile" ;; "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "lib/getopt.h" ) CONFIG_LINKS="$CONFIG_LINKS lib/getopt.h:lib/gnugetopt.h" ;; "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:src/config.h.in" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; 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_LINKS+set}" = set || CONFIG_LINKS=$config_links test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. : ${TMPDIR=/tmp} { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=$TMPDIR/cs$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@PACKAGE@,$PACKAGE,;t t s,@VERSION@,$VERSION,;t t s,@ACLOCAL@,$ACLOCAL,;t t s,@AUTOCONF@,$AUTOCONF,;t t s,@AUTOMAKE@,$AUTOMAKE,;t t s,@AUTOHEADER@,$AUTOHEADER,;t t s,@MAKEINFO@,$MAKEINFO,;t t s,@AMTAR@,$AMTAR,;t t s,@install_sh@,$install_sh,;t t s,@STRIP@,$STRIP,;t t s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t s,@AWK@,$AWK,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@DEPDIR@,$DEPDIR,;t t s,@am__include@,$am__include,;t t s,@am__quote@,$am__quote,;t t s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t s,@CCDEPMODE@,$CCDEPMODE,;t t s,@CPP@,$CPP,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@LN_S@,$LN_S,;t t s,@HELP2MAN@,$HELP2MAN,;t t s,@ZIP@,$ZIP,;t t s,@UNZIP@,$UNZIP,;t t s,@AUTOGEN@,$AUTOGEN,;t t s,@GPERF@,$GPERF,;t t s,@HAVE_GPERF_TRUE@,$HAVE_GPERF_TRUE,;t t s,@HAVE_GPERF_FALSE@,$HAVE_GPERF_FALSE,;t t s,@GGI_CFLAGS@,$GGI_CFLAGS,;t t s,@GGI_LIBS@,$GGI_LIBS,;t t s,@GGI_LDFLAGS@,$GGI_LDFLAGS,;t t s,@GGI_KEYBOARD_H@,$GGI_KEYBOARD_H,;t t s,@SDL_CONFIG@,$SDL_CONFIG,;t t s,@SDL_CFLAGS@,$SDL_CFLAGS,;t t s,@SDL_LIBS@,$SDL_LIBS,;t t s,@SDL_KEYSYM_H@,$SDL_KEYSYM_H,;t t s,@ALLEGRO_CONFIG@,$ALLEGRO_CONFIG,;t t s,@ALLEGRO_CFLAGS@,$ALLEGRO_CFLAGS,;t t s,@ALLEGRO_LIBS@,$ALLEGRO_LIBS,;t t s,@ALLEGRO_H@,$ALLEGRO_H,;t t s,@GII_CFLAGS@,$GII_CFLAGS,;t t s,@GII_LIBS@,$GII_LIBS,;t t s,@GII_LDFLAGS@,$GII_LDFLAGS,;t t s,@SDL_MIXER_CFLAGS@,$SDL_MIXER_CFLAGS,;t t s,@SDL_MIXER_LIBS@,$SDL_MIXER_LIBS,;t t s,@SDL_MIXER_LDFLAGS@,$SDL_MIXER_LDFLAGS,;t t s,@LIBMIKMOD_CONFIG@,$LIBMIKMOD_CONFIG,;t t s,@LIBMIKMOD_CFLAGS@,$LIBMIKMOD_CFLAGS,;t t s,@LIBMIKMOD_LIBS@,$LIBMIKMOD_LIBS,;t t s,@LIBALT_XLDFLAGS@,$LIBALT_XLDFLAGS,;t t s,@LIBALT_XLDADD@,$LIBALT_XLDADD,;t t s,@LIBALT_LOCAL_XLDADD@,$LIBALT_LOCAL_XLDADD,;t t s,@U@,$U,;t t s,@ANSI2KNR@,$ANSI2KNR,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@ALLOCA@,$ALLOCA,;t t s,@GLIBC21@,$GLIBC21,;t t s,@LIBICONV@,$LIBICONV,;t t s,@USE_NLS@,$USE_NLS,;t t s,@MSGFMT@,$MSGFMT,;t t s,@GMSGFMT@,$GMSGFMT,;t t s,@XGETTEXT@,$XGETTEXT,;t t s,@INTLBISON@,$INTLBISON,;t t s,@BUILD_INCLUDED_LIBINTL@,$BUILD_INCLUDED_LIBINTL,;t t s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t s,@CATALOGS@,$CATALOGS,;t t s,@CATOBJEXT@,$CATOBJEXT,;t t s,@GMOFILES@,$GMOFILES,;t t s,@INTLLIBS@,$INTLLIBS,;t t s,@INTLOBJS@,$INTLOBJS,;t t s,@POFILES@,$POFILES,;t t s,@POSUB@,$POSUB,;t t s,@DATADIRNAME@,$DATADIRNAME,;t t s,@INSTOBJEXT@,$INSTOBJEXT,;t t s,@GENCAT@,$GENCAT,;t t s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t s,@INTL_LIBTOOL_SUFFIX_PREFIX@,$INTL_LIBTOOL_SUFFIX_PREFIX,;t t s,@MORE_WARNINGS_CFLAGS@,$MORE_WARNINGS_CFLAGS,;t t s,@htmldir@,$htmldir,;t t s,@MAKE_HTML_TRUE@,$MAKE_HTML_TRUE,;t t s,@MAKE_HTML_FALSE@,$MAKE_HTML_FALSE,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # 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. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;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,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; *) # Relative if test -f "$f"; then # Build tree echo $f elif test -f "$srcdir/$f"; then # Source tree echo $srcdir/$f else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #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. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # egrep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # 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. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { case "$ac_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi # Run the commands associated with the file. case $ac_file in config.h ) # update the timestamp echo 'timestamp for config.h:src/config.h.in' >"./stamp-h1" ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_LINKS section. # for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5 echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;} if test ! -r $srcdir/$ac_source; then { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi rm -f $ac_dest # Make relative symlinks. ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { case "$ac_dest_dir" in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy="$ac_dest_dir" for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create \"$ac_dest_dir\"" >&5 echo "$as_me: error: cannot create \"$ac_dest_dir\"" >&2;} { (exit 1); exit 1; }; } ;; esac done; } ac_builddir=. if test "$ac_dest_dir" != .; then ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dest_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dest_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dest_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dest_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dest_dir" && cd $ac_top_srcdir && pwd` case $srcdir in [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; esac # Make a symlink if possible; otherwise try a hard link. ln -s $ac_rel_source $ac_dest 2>/dev/null || ln $srcdir/$ac_source $ac_dest || { { echo "$as_me:$LINENO: error: cannot link $ac_dest to $srcdir/$ac_source" >&5 echo "$as_me: error: cannot link $ac_dest to $srcdir/$ac_source" >&2;} { (exit 1); exit 1; }; } done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_dir=`(dirname "$ac_dest") 2>/dev/null || $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_dest" : 'X\(//\)[^/]' \| \ X"$ac_dest" : 'X\(//\)$' \| \ X"$ac_dest" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_dest" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be # absolute. ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 echo "$as_me: executing $ac_dest commands" >&6;} case $ac_dest in depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` if (sed 1q $mf | fgrep 'generated by automake') > /dev/null 2>&1; then dirpart=`(dirname "$mf") 2>/dev/null || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || 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 grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue # Extract the definition of DEP_FILES from the Makefile without # running `make'. DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"` test -z "$DEPDIR" && continue # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n -e '/^U = / s///p' < "$mf"` test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" # 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 -e ' /^DEP_FILES = .*\\\\$/ { s/^DEP_FILES = // :loop s/\\\\$// p n /\\\\$/ b loop p } /^DEP_FILES = / s/^DEP_FILES = //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=`(dirname "$file") 2>/dev/null || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { case $dirpart/$fdir in [\\/]* | ?:[\\/]* ) as_incr_dir=;; *) as_incr_dir=.;; esac as_dummy=$dirpart/$fdir for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do case $as_mkdir_dir in # Skip DOS drivespec ?:) as_incr_dir=$as_mkdir_dir ;; *) as_incr_dir=$as_incr_dir/$as_mkdir_dir test -d "$as_incr_dir" || mkdir "$as_incr_dir" || { { echo "$as_me:$LINENO: error: cannot create $dirpart/$fdir" >&5 echo "$as_me: error: cannot create $dirpart/$fdir" >&2;} { (exit 1); exit 1; }; } ;; esac done; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; default-1 ) for ac_file in $CONFIG_FILES; do # Support "outfile[:infile[:infile...]]" case "$ac_file" in *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; esac # PO directories have a Makefile.in generated from Makefile.in.in. case "$ac_file" in */Makefile.in) # Adjust a relative srcdir. ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" case "$ac_given_srcdir" in .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; /*) top_srcdir="$ac_given_srcdir" ;; *) top_srcdir="$ac_dots$ac_given_srcdir" ;; esac if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then rm -f "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" fi ;; esac done ;; esac done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # 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=: exec 5>/dev/null $SHELL $CONFIG_STATUS || 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 || { (exit 1); exit 1; } fi eval bindir="$bindir" eval bindir="$bindir" eval datadir="$datadir" eval mandir="$mandir" eval infodir="$infodir" eval htmldir="$htmldir" eval vkm_libalt_name='$adl_libalt_'$selection_vkm'_name' eval j_libalt_name='$adl_libalt_'$selection_j'_name' eval s_libalt_name='$adl_libalt_'$selection_s'_name' eval m_libalt_name='$adl_libalt_'$selection_m'_name' echo " Heroes configuration -------------------- Heroes version : $VERSION host : $host binary install path : $bindir data install path : ${datadir}/heroes manual page install path : $mandir info manual install path : $infodir html doc install path : $htmldir compiler : $CC general options CFLAGS : $CFLAGS $MORE_WARNINGS_CFLAGS LIBS : $LDFLAGS $LIBS display, keyboard, mouse : ${vkm_libalt_name} joystick : ${j_libalt_name} sound : ${s_libalt_name} main : ${m_libalt_name}" heroes-0.21/configure.ac0000644004117000411500000001347107451372427010707 dnl Copyright 2000, 2001 Alexandre Duret-Lutz dnl dnl This file is part of Heroes. dnl dnl Heroes is free software; you can redistribute it and/or modify it under dnl the terms of the GNU General Public License version 2 as published by dnl the Free Software Foundation. dnl dnl Heroes is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License dnl for more details. dnl dnl You should have received a copy of the GNU General Public License along dnl with this program; if not, write to the Free Software Foundation, Inc., dnl 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA dnl AC_PREREQ(2.50) AC_INIT([heroes], [0.21], [heroes-bugs@lists.sourceforge.net]) AC_CONFIG_AUX_DIR(tools) AC_CONFIG_SRCDIR([src/heroes.c]) AM_INIT_AUTOMAKE([heroes], [0.21]) AC_COPYRIGHT([Copyright 2000, 2001, 2002 Alexandre Duret-Lutz]) heroes_CHECK_OBSOLETE_OPTIONS AC_CANONICAL_HOST AC_DEFINE_UNQUOTED([HOST],["$host"],[The canonical host]) # If the user didn't supplied a CFLAGS value, # set an empty one to prevent autoconf to stick -O2 -g here. test -z "$CFLAGS" && CFLAGS="" # =================== # Check for programs. # =================== AC_PROG_CC AC_ISC_POSIX AC_PROG_CC_STDC AM_PROG_CC_C_O AC_PROG_CPP AC_PROG_AWK AC_PROG_RANLIB AC_PROG_LN_S AM_MISSING_PROG([HELP2MAN], [help2man]) AM_MISSING_PROG([ZIP], [zip]) AM_MISSING_PROG([UNZIP], [unzip]) AM_MISSING_PROG([AUTOGEN], [autogen]) AC_PATH_PROG([GPERF], [gperf]) AM_CONDITIONAL(HAVE_GPERF, [test \! -z "$GPERF"]) AC_CACHE_SAVE # Set _GNU_SOURCE before any other tests. AC__GNU_SOURCE # ===================== # Checks for libraries. # ===================== dnl pass a third argument to AC_CHECK_LIB to dnl prevent HAVE_LIBM from being defined (we don't need it). AC_CHECK_LIB([m], [sin], [LIBS="-lm $LIBS"]) heroes_MEDIALIB_SELECTION # ================================ # Check for any malloc() debugger. # ================================ adl_WITH_MPATROL adl_WITH_MTRACE adl_WITH_DMALLOC adl_WITH_EFENCE adl_ENABLE_MEM_DEBUG # ============================================== # Now that we have all the libraries, check that # compiled programs are still runnable. # ============================================== adl_RUN_CHECK # ======================== # Checks for header files. # ======================== AC_HEADER_STDC AC_HEADER_DIRENT AC_CHECK_HEADERS( [direct.h] dnl [io.h] dnl [memory.h] dnl [stdbool.h] dnl [stdint.h] dnl [string.h] dnl [strings.h] dnl [stdlib.h] dnl [sys/time.h] dnl [unistd.h] dnl [windows.h] dnl ) AC_HEADER_TIME AC_HEADER_STAT # ============================================================== # Checks for typedefs, structures, and compiler characteristics. # ============================================================== AM_C_PROTOTYPES AC_C_CONST AC_TYPE_UID_T dnl This checks for gid_t too. AC_CHECK_TYPES([ssize_t]) # ============================= # Checks for library functions. # ============================= AC_CHECK_DECLS([malloc, realloc, calloc, free, memrchr, stpcpy, strcasecmp, strnlen]) AC_CHECK_FUNCS([gettimeofday memcpy sleep getegid setgid setegid setregid]) adl_FUNC_READDIR AC_FUNC_VPRINTF AC_FUNC_MKDIR AC_REPLACE_FUNCS([memrchr stpcpy strndup strcasecmp]) jm_FUNC_MALLOC # We used to clear LIBS to work around a bug (?) on # alphaev56-dec-osf4.0d where conftest (run by jm_FUNC_REALLOC) never # exits when linked with `-lgii' or `-lggi'. But today `-lggi' and # `-lgii' are not put in LIBS any longer. jm_FUNC_REALLOC # for error.c AC_CHECK_FUNCS([strerror]) AC_CHECK_DECLS([strerror]) AC_FUNC_STRERROR_R jm_FUNC_FTRUNCATE adl_FUNC_GETOPT_LONG adl_FILELOCK # ==================== # Check for endianess. # ==================== AC_C_BIGENDIAN_CROSS # =============== # Filename style. # =============== jm_AC_DOS # ===================== # Internationalization. # ===================== ALL_LINGUAS="de fr it nl pt_BR" AM_GNU_GETTEXT(,[need-ngettext]) # =================================== # Setup the correct compiler options. # =================================== adl_ENABLE_DEVEL adl_NDEBUG adl_ENABLE_GPROF adl_ENABLE_DEBUG ad_GCC_OPTIM ad_GCC_WARNINGS # ========================== # Directories configuration. # ========================== heroes_COMPUTE_PATHS # ============== # Misc. options. # ============== adl_ENABLE_HTML_DOC heroes_DEBUG # ============ # Output files # ============ # Put config.h in the base directory because libintl expects it here, # but keep src/config.h.in in the src/ directory to keep the base directory # as clean as possible. dnl Don't quote the following argument, it is parsed by automake. AM_CONFIG_HEADER(config.h:src/config.h.in) AC_CONFIG_FILES([ Makefile doc/Makefile intl/Makefile lib/Makefile man/Makefile po/Makefile.in src/Makefile tests/Makefile ]) AC_OUTPUT eval bindir="$bindir" eval bindir="$bindir" eval datadir="$datadir" eval mandir="$mandir" eval infodir="$infodir" eval htmldir="$htmldir" eval vkm_libalt_name='$adl_libalt_'$selection_vkm'_name' eval j_libalt_name='$adl_libalt_'$selection_j'_name' eval s_libalt_name='$adl_libalt_'$selection_s'_name' eval m_libalt_name='$adl_libalt_'$selection_m'_name' echo " Heroes configuration -------------------- Heroes version : $VERSION host : $host binary install path : $bindir data install path : ${datadir}/heroes manual page install path : $mandir info manual install path : $infodir html doc install path : $htmldir compiler : $CC general options CFLAGS : $CFLAGS $MORE_WARNINGS_CFLAGS LIBS : $LDFLAGS $LIBS display, keyboard, mouse : ${vkm_libalt_name} joystick : ${j_libalt_name} sound : ${s_libalt_name} main : ${m_libalt_name}" heroes-0.21/ANNOUNCE0000644004117000411500000000254607451373033007545 I am pleased to announce the release of Heroes 0.21 Heroes is similar to the "Tron" and "Nibbles" games of yore, but includes many graphical improvements and new game features. In it, you must maneuver a small vehicle around a world and collect powerups while avoiding obstacles, your opponents' trails, and even your own trail. There are five game modes available. Quest is the classical Nibbles, in Death Match you start with very long tails a must kill your opponents, in Kill'em All you must run over lemmings moving on the ground, in Time Cash or Color modes you must collect money or pyramids of color. Heroes features 12 original sound tracks, 94 levels (in 10 different tile sets) plus a level editor. You are invited to visit the following links: home page: http://heroes.sourceforge.net/ screenshots: http://heroes.sourceforge.net/screenshots.html download: http://heroes.sourceforge.net/download.html This is a bug fix release. See NEWS for details. This version requires at least Heroes-data-1.4. HELP! Heroes development is open to anyone and we welcome any contribution. In the hypothetical case you would like to spend some time on the source code and don't know what to do, please, ask the mailing list: there is presently some (non-boring) tasks that needs to be done and for which understanding the full source tree is not a prerequisite. heroes-0.21/BUGS0000644004117000411500000004061207375500023007067 ******************************************************************* * * * These are bugs which have been reported but never acted upon, * * because they are unreproducible, obscure, or whatever. * * * * If you are experiencing one of these bug, please REPORT IT, * * even if it is alredy listed here. The more reports we get * * about a bug, the more details we have, and the greater the * * chances to understand it are. * * * ******************************************************************* ====================================================================== From: "Christian T. Steigies" Date: Wed, 30 Aug 2000 17:49:34 +0200 Version: 0.6pre3 Hi, On Wed, Aug 30, 2000 at 05:31:27PM +0200, Alexandre Duret-Lutz wrote: > Have you seen other things in 0.6pre3 that would require cleanup? Seems my mail from home has not come through... I built a complete set of (debian) heroes packages on m68k, no problem. However it does not run, I got a variety of segfaults. I will resent the mail, there were some error codes, maybe somebody can make use of that. The fun thing, every time I started heroes, I got a different error message... ---------- From: "Christian T. Steigies" Date: Thu, 31 Aug 2000 12:11:20 +0200 Version: 0.6pre3 On Wed, Aug 30, 2000 at 06:10:11PM +0200, Alexandre Duret-Lutz wrote: > Yes please. Also, have you configured with --enable-debug? > This would allow: I had not, I did not (oups, no coredump, guess I switched that off). The old error messages: extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) Failed to open visual: extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) Xlib: unexpected async reply (sequence 0x48)! X connection to :0.0 broken (explicit kill or server shutdown). extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) X Error of failed request: BadWindow (invalid Window parameter) Major opcode of failed request: 38 (X_QueryPointer) Resource id in failed request: 0x240000c Serial number of failed request: 73 Current serial number in output stream: 76 extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) Failed to open visual: extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) X Error of failed request: BadShmSeg (invalid shared segment parameter) Major opcode of failed request: 129 (MIT-SHM) Minor opcode of failed request: 3 (X_ShmPutImage) Segment id in failed request: 0x240000e Serial number of failed request: 20 Current serial number in output stream: 23 extradir: /usr/share/games/heroes/extralvl/: No such file or directory Fatal signal: Segmentation Fault (SDL Parachute Deployed) extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) X Error of failed request: BadShmSeg (invalid shared segment parameter) Major opcode of failed request: 129 (MIT-SHM) Minor opcode of failed request: 3 (X_ShmPutImage) Segment id in failed request: 0x240000e Serial number of failed request: 20 Current serial number in output stream: 23 extradir: /usr/share/games/heroes/extralvl/: No such file or directory Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). Fatal signal: Segmentation Fault (SDL Parachute Deployed) Xlib: unexpected async reply (sequence 0x44)! X connection to :0.0 broken (explicit kill or server shutdown). The new messages with HEROES_DEBUG heroes: set debug level to fffffbff heroes: initialization heroes: looking for HEROES_DATA_DIR or HEROES_DATADIR... heroes: ... not found. heroes: set resource $(data-dir)=/usr/share/games/heroes heroes: get resource $(heroesrc-txt)=$(data-dir)/etc/heroesrc heroes: get resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(heroesrc-txt)=/usr/share/games/heroes/etc/heroesrc heroes: reading configuration file: /usr/share/games/heroes/etc/heroesrc ... heroes: get resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(data-dir)=/usr/share/games/heroes heroes: reading sound config file: /usr/share/games/heroes/mod/sound.conf ... heroes: ... could not open. heroes: reading sound config file: /sound.conf ... heroes: ... could not open. heroes: ... finished reading /usr/share/games/heroes/etc/heroesrc. heroes: user directory setup heroes: directory /home/cts/.heroes/ already exists heroes: setup default extra directory heroes: get resource $(extra-levels-dir)=$(data-dir)/extralvl/ heroes: get resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(extra-levels-dir)=/usr/share/games/heroes/extralvl/ heroes: reading configuration file: /home/cts/.heroes/heroesrc ... heroes: ... could not open. heroes: parsing command line heroes: get resource $(text-conf-txt)=$(data-dir)/txt_cfg/txti.cfg heroes: get resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(text-conf-txt)=/usr/share/games/heroes/txt_cfg/txti.cfg heroes: parsing text configuration file: /usr/share/games/heroes/txt_cfg/txti.cfg ... heroes: ... done. heroes: randomize heroes: get resource $(levels-list-txt)=$(data-dir)/levels/level.lst heroes: get resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(levels-list-txt)=/usr/share/games/heroes/levels/level.lst heroes: read level list: /usr/share/games/heroes/levels/level.lst ... heroes: ... done heroes: browsing directory /home/cts/.heroes/levels ... heroes: ... 0 files heroes: browsing directory /usr/share/games/heroes/extralvl/ ... extradir: /usr/share/games/heroes/extralvl/: No such file or directory heroes: reading option from /home/cts/.heroes/options.dat heroes: cannot open /home/cts/.heroes/options.dat heroes: reading scores from /home/cts/.heroes/scores.dat heroes: cannot open /home/cts/.heroes/scores.dat heroes: reading saved games from /home/cts/.heroes/savegame.dat heroes: cannot open /home/cts/.heroes/savegame.dat heroes: get resource $(sfx-dir)=$(data-dir)/sfx/ heroes: get resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(sfx-dir)=/usr/share/games/heroes/sfx/ heroes: get resource $(sfx-conf-txt)=$(data-dir)/sfx/sfx.conf heroes: get resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(data-dir)=/usr/share/games/heroes heroes: expanded resource $(sfx-conf-txt)=/usr/share/games/heroes/sfx/sfx.conf heroes: reading sound effects config: /usr/share/games/heroes/sfx/sfx.conf Cannot open /usr/share/games/heroes/sfx/sfx.conf, disabling sound-effects (run with -X to supress this message). heroes: initialize SDL heroes: initialize joystick heroes: opening audio at 22050 Hz 16 bit stereo, 1024 bytes audio buffer heroes: opened audio at 22050 Hz 16 bit stereo, 1024 bytes audio buffer heroes: set volume to 68/128 heroes: set video mode ---------- From: "Christian T. Steigies" Date: Thu, 31 Aug 2000 15:28:52 +0200 Version: 0.6pre3 > - what version of SDL are you using? Hmm, a mixture of 1.1.2 and 1.0.[1 or 8] I think. I am not exactly sure which is used for the package, will check again, was late last night... > - is a window mapped before the crash or not? window mapped? If you mean opened, yes a small window is opened, like with i386, drawn with a black background, maybe a little white. > - how is configured you X server (resolution, depth)? m68k uses xserver-fbdev, with my grafics board it is not yet possible to change the resolution. so now its using 1024x768 in 8 bit. But also when I run heroes via ssh from my i386 machine (32bit) it crashes (did no ttest last night though). > - can you cite me a couple of games that work well with SDL > on m68k so I can look their sources for differences? Sure. I would think all the SDL games I maintain are working on m68k. Actually I did not test them all, but I am pretty sure at least gemdropx works, see here for the links: http://master.debian.org/~cts/packages.html ---------- From: "Christian T. Steigies" Date: Thu, 21 Sep 2000 00:32:22 +0200 Version: 0.6pre3 > Please try to configure Heroes with --enable-debug, > --disable-joystick and --disable-sound and ensure > to have coredump turned on (bash: ulimit -c unlimited > tcsh: unlimit coredumpsize). Ok, good news. Tried that, its very slow, but it seems to work much better. I remember seeing on the list the -S option, when I use that (with the non-debug version) heroes runs much better. Actually it runs very good, so its only a sound problem. It runs so good, the gameplay is much too fast, I thought it would be much too slow... maybe there is a problem with calculating game/machine speed? Do you use bogomips for that? My Amiga has around 100 Bogomips, but the speed compares to a 486/100, maybe Pentium90, with a clock frequency of 50MHz. So there is another problem, but not as bad, as I first thought. ---------- From: "Christian T. Steigies" Date: Thu, 21 Sep 2000 13:28:16 +0200 Version: 0.6pre3 On Thu, Sep 21, 2000 at 11:20:49AM +0200, Alexandre Duret-Lutz wrote: > Great, thanks for tracking this down. Other things you can try > is to run the game with sound but without sound effects (-X); or > to link with libMikMod instead of SDL_mixer. This may help to > narrow the bug. Can try that. > cts> It runs so good, the gameplay is > cts> much too fast, I thought it would be much too > cts> slow... maybe there is a problem with calculating > cts> game/machine speed? > > By "too fast", do you mean "so fast that the camera is > not quick enough to follow the vehicles"? This was The vehicles are running much too fast, the camera could follow (most of the time) which I find very astonishing for such an old machine. > a bug reported by Mattias Engdegård (on Solaris), and have > been fixed between the 0.6-pre3 and 0.6 versions. Are you > still using 0.6-pre3? Yup... will change that. ---------- From: "Christian T. Steigies" Date: Fri, 22 Sep 2000 19:16:30 +0200 Version: 0.6 On Thu, Sep 21, 2000 at 11:20:49AM +0200, Alexandre Duret-Lutz wrote: > > Great, thanks for tracking this down. Other things you can try > is to run the game with sound but without sound effects (-X); or > to link with libMikMod instead of SDL_mixer. This may help to > narrow the bug. Didnt work, but I did not spend much time on it. I think the debian maintainer should update the package to support other arches as well, maybe I did something wrong while building the package. I couldn't build a complete package, since on m68k I can only build for sdl, not for ggi. Thats one thing I was not able to get into the debian files, but thats Daniel's jobs, isn't it? ;-) > By "too fast", do you mean "so fast that the camera is > not quick enough to follow the vehicles"? This was > a bug reported by Mattias Engdegård (on Solaris), and have > been fixed between the 0.6-pre3 and 0.6 versions. Are you > still using 0.6-pre3? With 0.6 I get the right speed. So its working pretty well (besides the sound problem) on m68k. Maybe a note in the readme (Daniel: its working for me on m68k only with -S) but otherwise its fine for non-i386 I think. ====================================================================== From: Stéphane Denis Date: Fri, 22 Sep 2000 10:38:46 +0200 Version: 0.6a Heroes configuration ------------------- Heroes version : 0.6a host : i586-pc-beos display & keyboard : SDL 1.1.5 joystick : SDL 1.1.5 sound : compiler : gcc compiler flags : -I/boot/develop/tools/gnupro/include -I/boot/develop/tools/gnupro/include/SDL -DNDEBUG -ffast-math -fstrict-aliasing -fomit-frame-pointer -O3 linker flags : -s -L/boot/develop/tools/gnupro/lib -lSDL binary install path : /usr/local/bin data install path : /usr/local/share/heroes manual page install path : /usr/local/man info manual install path : /usr/local/info html doc install path : $ make install Making install in lib [...] make[1]: Leaving directory `/boot/realtech/Heroes/lib' Making install in src make[1]: Entering directory `/boot/realtech/Heroes/src' Making install in etc make[2]: Entering directory `/boot/realtech/Heroes/src/etc' make[3]: Entering directory `/boot/realtech/Heroes/src/etc' make[3]: Nothing to be done for `install-exec-am'. /bin/sh ../../mkinstalldirs /usr/local/share/heroes/etc/ /bin/install -c -m 644 heroesrc /usr/local/share/heroes/etc//heroesrc /bin/install: cannot create regular file `/usr/local/share/heroes/etc//heroesrc': Invalid argument make[3]: *** [install-xDATA] Error 1 make[3]: Leaving directory `/boot/realtech/Heroes/src/etc' make[2]: *** [install-am] Error 2 make[2]: Leaving directory `/boot/realtech/Heroes/src/etc' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/boot/realtech/Heroes/src' make: *** [install-recursive] Error 1 ====================================================================== From: raven Date: 05 Dec 2000 Version: 0.6 hello I've compiled heroes recently on my linux system. everything runs fine, but I do have a problem with the controls. I mean, that the reaction of the vehicle is too slow (it turns too slow) . This shouldn't depend on my machine configuration (350 mhz k6-2 128 MB RAM). ---------- From: mat Date: Wed, 06 Dec 2000 09:52:27 +0100 Version: 0.6 I've compiled it with SDL. I have a SUSE linux 6.4 distribution (with a "few" changes (ie: newer ver. of make a few newer and updated libs...)) by too slow I mean that the vehicle doesn't turn at that moment when I press the key. This delay is not long enough to be mesureable, but it disturbs, so that the gameplay isn't fluent enough... ---------- From: Alexandre Duret-Lutz Date: 21 Feb 2001 20:16:23 +0100 Version: 0.8 Just a notice to say I have seen what you describe on a laptop running FreeBSD, a couple of week ago. And no, that's not the *standard* behaviour as I answered you :). Still I have no idea what the reason is. (For the records that was an Heroes 0.8, compiled against SDL too; I don't even know if GGI works on FreeBSD.) heroes-0.21/ChangeLog.000000644004117000411500000066314407302411165010405 2000-12-31 Alexandre Duret-Lutz * m4/libintl.m4: Expand a possible relative $ac_aux_dir. * src/timer.c (reset_htimer): The patch from 2000-12-06 broke the non-gettimeofday support, add non-member copy back in this case. * src/Makefile.am (INCLUDES): Add -I../lib and -I, because getopt.h and keysdef-inc.h are created in the build directory. * m4/runcheck.m4: Fix the cross-compile case. * configure.in: Clear CC to prevent autoconf to add -O2 -g. 2000-12-31 Alexandre Duret-Lutz * m4/checkpkg.m4 (UP,DOWN,DOWNALT): Rewrite to work around a possible bug in m4 ??? (HAVE_PKG_SDL_MIXER was understood as HAVE_PKG_SDLMIXER for autoheader - not for autoconf; I can reproduce this if I run autoconf with autoheader's four --trace, but the bug disappear if one of the four traces is removed.) 2000-12-31 Alexandre Duret-Lutz * src/Makefile.am (localdatadir): Delete (localedir): Redefine and comment. * m4/h-display.m4: Don't imbricate tests for SDL and GGI. * m4/h-ggi.m4: Move the AM_CONDITIONAL at the end. * m4/h-sdl.m4: Likewise. 2000-12-30 Alexandre Duret-Lutz * configure.in: Call heroes_CHECK_OPSOLETE_OPTIONS. * m4/h-obsolete.m4: New file. 2000-12-30 Alexandre Duret-Lutz * m4/pkgeneric.m4: Add missing popdefs. * m4/checkpkg.m4: Likewise. Unquote DOWNALT. 2000-12-30 Alexandre Duret-Lutz * configure.in: Typo. * m4/checkpkg.m4 (UP,DOWN,DOWNLAT): New. (AC_caolan_CHECK_PACKAGE): Use them. * m4/h-display.m4: Use with_ggi instead of with_GGI. * m4/h-ggi.m4: Likewise. * m4/h-joystick.m4: Likewise. * m4/h-sound.m4: Likewise. * m4/h-mikmod.m4: Use LibMikMod instead of libMikMod. * m4/h-sdlmixer.m4: Use HAVE_PKG_SDL_MIXER instead of HAVE_PKG_sdl_mixer. 2000-12-28 Alexandre Duret-Lutz * configure.in: Use heroes_DEBUG. * m4/h-debug.m4: New file. 2000-12-28 Alexandre Duret-Lutz * configure.in: Use heroes_CHECK_JOYSTICK_LIB. * m4/h-joystick.m4: New. 2000-12-28 Alexandre Duret-Lutz Move the SDL_mixer and Mikmod tests out of configure.in. * configure.in: Use heroes_CHECK_SOUND_LIB and heroes_CHECK_SOUND_LIB_PRELIM. * m4/h-sound.m4: New file. * m4/h-sdlmixer.m4: New file. * m4/h-mikmod.m4: New file. * m4/h-sdl.m4: Remove spaces before --without-sdl. 2000-12-28 Alexandre Duret-Lutz Move out the SDL and GGI test from configure.in. * configure.in: Use heroes_CHECK_DISPLAY_LIB. * m4/h-display.m4: New file. * m4/h-ggi.m4: New file. * m4/h-sdl.m4: New file. 2000-12-28 Alexandre Duret-Lutz * configure.in: Use adl_ENABLE_HTML_DOC. * m4/htmldoc.m4: New file. 2000-12-28 Alexandre Duret-Lutz * m4/memdebug.m4 (adl_CHECK_DMALLOC): Don't test if without-dmalloc. (adl_CHECK_EFENCE): Don't test if without-efence. (adl_WITH_DMALLOC): Don't check for dmalloc in AC_ARG_WITH call. (adl_WITH_EFENCE): Don't check for efence in AC_ARG_WITH call. (adl_ENABLE_MEM_DEBUG): Don't any check in AC_ARG_ENABLE call. 2000-12-28 Alexandre Duret-Lutz Move compiler options handling to separate files. * configure.in: Use adl_NDEBUG, adl_ENABLE_GPROF, and adl_ENABLE_DEBUG. * m4/debug.m4: New file. * m4/gccoptim.m4: Handle --disable-optimizations. * m4/gccwarn.m4: Remove serial. * m4/gprof.m4: New file. * m4/ndebug.m4: New file. 2000-12-27 Alexandre Duret-Lutz Move malloc() debugger tests in their own file. * m4/memdebug.m4: New file. * configure.in: Call adl_WITH_DMALLOC, adl_WITH_EFENCE, and adl_ENABLE_MEM_DEBUG. Don't display the malloc() debugger used in the summary. * src/system.h: Use HAVE_DMALLOC_H, not HAVE_DMALLOC. 2000-12-27 Alexandre Duret-Lutz Move the readdir test in its own file. * m4/w_dirent.m4: New file. * configure.in: Use adl_FUNC_READDIR. 2000-12-27 Alexandre Duret-Lutz Move the getopt_long test in its own file. * m4/getoptlong.m4: New file. * configure.in: Use adl_FUNC_GETOPT_LONG. 2000-12-27 Alexandre Duret-Lutz * m4/Makefile.am: Delete (generated by tools/genm4mam.sh). * m4/README: New file. * po/POTFILES.in: Delete (generated by tools/genpotfiles.sh). * tools/Makefile.am: Add cvsboot.m4 and genm4mam.sh. * tools/cvsboot.sh: New file. * tools/genm4mam.sh: New file. * HACKING: Update accordingly. 2000-12-27 Alexandre Duret-Lutz Shorten some filenames in m4/. * m4/ac_adl_find_header.m4: Rename as ... * m4/findheader.m4: ... this. * m4/ac_adl_gcc_optim.m4: Rename as ... * m4/gccoptim.m4: ... this. * m4/ac_adl_pkg_generic.m4: Rename as ... * m4/pkgeneric.m4: ... this. * m4/ac_c_bigendian_cross.m4: Rename as ... * m4/bigendian.m4: ... this. * m4/ac_caolan_check_package.m4: Rename as ... * m4/checkpkg.m4: ... this. * m4/ac_define_dir.m4: Rename as ... * m4/definedir.m4: ... this. * m4/ac_func_mkdir.m4: Rename as ... * m4/mkdir.m4: ... this. * m4/generic-config.m4: Rename as ... * m4/generic.m4: ... this. 2000-12-26 Alexandre Duret-Lutz More internationalizable strings. * po/POFILES.in: Regenerate. * po/fr.po: Update. * tools/genpotfiles.sh: Typo. * src/argv.c: Markup messages for translations. * src/debuhash.gperf: Likewise * src/display.c: Likewise. * src/hedlite.c: Likewise. * src/heroes.c: Likewise. * src/joystick.c: Likewise. * src/pcx.c: Likewise. * src/readmake.c: Likewise. * src/rsc_files.c: Likewise. * src/sfx.c: Likewise. * src/sound.c: Likewise. * src/userconf.c: Likewise. 2000-12-26 Alexandre Duret-Lutz * src/helptext.c (help_text4): Fix TIME CA$H description. (hepl_text5): Correct homepage URL. * src/menus.c (init_menus_sprites): Fix radar text in screen menu. * po/fr.po: Update. 2000-12-25 Alexandre Duret-Lutz * Makefile.am (EXTRA_DIST): Add ABOUT-NLS. * ABOUT-NLS: New file. * HACKING: Update. 2000-12-25 Alexandre Duret-Lutz * configure.in (ALL_LINGUAS): Add fr. * m4/libintl.m4 (AM_WITH_NLS): When using AC_CONFIG_AUX_DIR, prefix $(top_srcdir) to the value of MKINSTALLDIRS so that it can be used in subdirectories. * po/fr.po: New file. * src/Makefile.am (INCLUDES): Add -I.. (localdatadir,localedir,DEFS): NEW. * src/heroes.c (main): Handle NLS stuffs. 2000-12-25 Alexandre Duret-Lutz Gettextize the package. * HACKING: Update. * Makefile.am (SUBDIRS): Add intl and po. (DISTCLEANFILES): New. * configure.in: Test for ISC UNIX. Check for gettext. Create config.h in base directory. Create intl/Makefile and po/Makefile.in. * intl/Changelog: New file (from textutils-2.0.10). * intl/Makefile.in: Likewise. * intl/VERSION: Likewise. * intl/bindtextdom.c: Likewise. * intl/cat-compat.c: Likewise. * intl/dcgettext.c: Likewise. * intl/dgettext.c: Likewise. * intl/explodename.c: Likewise. * intl/finddomain.c: Likewise. * intl/gettext.c: Likewise. * intl/gettext.h: Likewise. * intl/gettextP.h: Likewise. * intl/hash-string.h: Likewise. * intl/intl-compat.c: Likewise. * intl/l10nflist.c: Likewise. * intl/libgettext.h: Likewise. * intl/linux-msg.sed: Likewise. * intl/loadinfo.h: Likewise. * intl/loadmsgcat.c: Likewise. * intl/localealias.c: Likewise. * intl/po2tbl.sed.in: Likewise. * intl/textdomain.c: Likewise. * intl/xopen-msg.sed: Likewise. * lib/alloca.c: Likewise. * m4/lcmessage.m4: Likewise. * m4/libintl.m4: Likewise. * m4/progtest.m4: Likewise. * po/Makefile.in.in: Likewise. * lib/Makefile.am (INCLUDES): Add ../intl, and search config.h in the upper directory. (libheroes_a_LDADD): Add @ALLOCA@. * m4/Makefile.am (EXTRA_DIST): Add lcmessage.m4, libintl.m4, progtest.m4. * src/Makefile.am (INCLUDE): Add ../intl. (LDADD): Add @INTLIBS@. (keysdef-inc.h): Use $(CONFIG_HEADER) instead of config.h. * src/system.h: Include locale.h. * tools/Makfefile.am (EXTRA_DIST): Add genpotfiles.sh. * tools/fetishsync.sh: Fetch all the above new files and display only updated files. Add an -f switch. * tools/genpotfiles.sh: New file. 2000-12-21 Alexandre Duret-Lutz * configure.in: Set version to 0.8a. 2000-12-19 Alexandre Duret-Lutz * configure.in: Bump to version 0.8. * NEWS: Update for 0.8. 2000-12-19 Alexandre Duret-Lutz Keys in the keyboard configuration menu were not printed nor updated correctly. Reported by Jean Delvare. * src/menus.c (keyboard_menu): Thinko. 2000-12-19 Alexandre Duret-Lutz Memory leaks. * src/readmake.c (compile_reader_data): Free curstr_allocated. Free the formated array. (readtok): Don't strdup the returned token. 2000-12-19 Alexandre Duret-Lutz * src/menus.c (help_menu): Draw only 220 row, no 340! This caused segfaults, of course. 2000-12-19 Alexandre Duret-Lutz * configure.in: Bug fix, --without-mikmod should really disable libmikmod checks. 2000-12-19 Alexandre Duret-Lutz * TODO: Add a note about pair of config.h variables. 2000-12-19 Alexandre Duret-Lutz * src/readmake.c (free_reader_data): Also free data_bg. (compile_reader_data): Skip the formating block on empty strings. 2000-12-17 Alexandre Duret-Lutz * TODO: Update. 2000-12-17 Alexandre Duret-Lutz * NEWS: Update for 0.7b. * arch/VisualC/heroes.dsp: Update. * arch/VisualC/config.h: Update. * ANNOUNCE: Prepare for 0.8. 2000-12-17 Alexandre Duret-Lutz * configure.in: Check for `ln -s'. Use it to link getopt.h to gnugetopt.h if the former is not found. Don't generate src/txt_cfg/Makefile. * lib/gnugetopt.h: Update from latest fetish (textutils 2.0.10). * lib/getopt.c: Likewise. * lib/getopt1.c: Likewise. * lib/error.c: Likewise. * lib/error.h: Likewise. * lib/hash.c: Likewise. * lib/malloc.c: Likewise. * lib/realloc.c: Likewise. * lib/strcasecmp.c: Likewise. * lib/strndup.c: Likewise. * lib/xalloc.h: Likewise. * lib/xmalloc.c: Likewise. * lib/xstrdup.c: Likewise. * m4/malloc.m4: Likewise. * m4/realloc.m4: Likewise. * m4/strerror_r.m4: New file, from fetish. * m4/Makefile.am (EXTRA_DIST): Add strerror_r.m4. * src/system.h: Don't include gnugetopt.h any longer. * tools/fetish-sync.sh: New file. * tools/Makefile.am (EXTRA_DIST): Add fetish-sync.sh. * HACKING (Files in CVS, but maintained elsewhere): Update. 2000-12-17 Alexandre Duret-Lutz Rewrite the endscroll to not use gfx_reader.h. This is not an end scroller any longer by the way. * src/gfx_reader.h: Delete file. * src/txt_cfg/heroes.sdf: Delete file. * src/txt_cfg/Makfile.am: Delete file. * src/Makefile.am (SUBDIRS): Remove txt_cfg. (heroes_SOURCES): Remove gfx_reader.h. * src/endscroll.c (draw_background): Use corner[0]. (display_page): Remove. (render_background): Use background_htimer. (end_scrool): Adapt to not use gfx_reader any more. Just display "THE END". * src/rsc_files.gperf (end-scroller-bg-img): Use the correct filename. 2000-12-17 Alexandre Duret-Lutz The parafmt cost computation was wrong: in the help reader, short strings (two words) were split on two lines. * src/parafmt.c (wdist): New. (compute_break_cost): Do measure costs for mean spaces width and total spaces width separately. Use a new formula which doesn't require to pay special attention to isolated words. 2000-12-16 Alexandre Duret-Lutz Rewrite the help reader totally, using the sprite layer and the parafmt functions to ease i18n. * src/helptext.h: New file. * src/helptext.c: New file. * src/readmake.h: New file. * src/readmake.c: New file. * src/sprglauto.h: New file. * src/sprglauto.c: New file. * src/Makefile.am (heroes_SOURCES): Add the above files. * src/txt_cfg/heroes.hlp: Delete (obsoleted by helptext.c) * src/txt_cfg/Makefile.am (z_DATA): Remove heroes.hlp. * src/fontdata.c (help_font_img, initializ_help_font): New. (init_fonts): Call initilize_help_font and free help_font_img. (compute_text_witdh): Make the last argument a pointer. * src/fontdata.h (compute_text_width): Likewise. * src/heroes.c (main_menu): Call help_menu instead of graphic_reader. * src/menus.c (help_text, help_menu): New. (init_menus_sprites, uninit_menus_sprites): Create and destroy help_text. * src/menus.h (help_menu): New. * src/parafmt.c (split_words): Ignore '%' commands. * src/sprite.h (sprite_kind): Add S_RLE_GLENZ_AUTO. * src/sprite.c (free_sprite): Handle S_RLE_GLENZ_AUTO. * src/sprtext.c (compile_sprtext): Handle T_JUSTIFIED. (compile_sprtext_color): New. * src/sprtext.h (compile_sprtext_color): New. 2000-12-10 Alexandre Duret-Lutz * src/parafmt.c (word_s): Declare next_break and next_break_cost as arrays. (paragraph_s): Replace max_width by max_widths and nmax_widths, add break_data and break_cost_data. (split_words): Change constness of argument wa. (initialize_width_data): New. (compute_break_cost): Take a new argument, widx, to indicate the line width to consider. Adjust the body to use widx. (compute_best_break): Likewise. (compute_breaking_path): Adapt to call compute_best_break for each possible widx. (convert_paragraph_to_array): Adapt to handle next_break as an array. (parafmt_var): New. (parafmt): Rewrite using paragmt_var. [TEST] (print_array_var, check_parafmt_var): New. [TEST] (main): Call check_parafmt_var. * src/parafmt.h (parafmt_var): New. 2000-12-07 Alexandre Duret-Lutz * src/bonus.h (set_txt_bonus): Set constness of txt to suppress warnings. * src/bonus.c (set_txt_bonus): Likewise. 2000-12-07 Alexandre Duret-Lutz Use a paragraph formating function in the CREDITS and ENTER YOUR NAME menus. * spr/sprtext.c (compile_sprpara): New. (compil_menu_para): New. * spr/sprtext.h (compile_sprpara): New. (compil_menu_para): New. * src/fontdata.h (fontdata_t): Add member line_skip and min_space_width. * src/fontdata.c (initialize_menu_font, initialize_deck_font, initialize_bonus_font): Setup line_skip and min_space_width. * src/menus.c (init_menus_sprites, enter_your_name): Use compile_menu_para (and so, remove FIXME). * src/parafmt.c (parafmt): Set constness of argument wa. * src/parafmt.h (parafmt): Likewise. 2000-12-07 Alexandre Duret-Lutz * src/Makefile.am (heroes_SOURCES): Add parafmt.c and parafmt.h. (parafmt-check.o, parafmt-check): New. * src/parafmt.h: New file. * src/parafmt.c: New file. * src/system.h: Add common CTYPE macros, as in textutils. (UCHAR): New. 2000-12-07 Alexandre Duret-Lutz `endian.h' is the name of a system file, having the same filename in another -I'ncluded directory cause troubles. Rename it as bytesex.h. * src/endian.h: Move to ... * src/bytesex.h: ... here. * src/Makefile.am (heroes_SOURCES): Rename endian.h as bytesex.h. * src/gfx_reader.h: Adapt inclusion. * src/hedlite.c: Likewise. * src/hendian.c: Likewise. * src/heroes.c: Likewise. * src/menus.c: Likewise. * src/options: Likewise. * src/pcx.c: Likewise. * src/savegame.c: Likewise. * src/scores.c: Likewise. * src/visuals.c: Likewise. 2000-12-07 Alexandre Duret-Lutz * configure.in: Bump to 0.7b. 2000-12-07 Alexandre Duret-Lutz * NEWS: Update for 0.7a. 2000-12-07 Alexandre Duret-Lutz Make sure compiled programs are still runnable once the library selection have been done. Otherwise next tests, such as AC_HEADER_STDC, may fail (and thus produce some unrelated compile time error). * m4/runcheck.m4: New file. * m4/Makefile.am (EXTRA_DIST): Add runcheck.m4. * configure.in: Use it. 2000-12-06 Alexandre Duret-Lutz * doc/heroes.texi (Machines): Update to say that gcc-2.96-64.i386.rpm is known to work. 2000-12-06 Alexandre Duret-Lutz The gcc shipped with Red Hat 7.0 produces unfaithful code in src/timer.c (and maybe elsewhere). In timer.c, it causes wrong computation of orig_time for local timers: orig_time might be set to a date into the future which leads read_htimer to either abort (if assertions are turned on) or return negative values (this in turn leads to wrong updates (far to fast) in the game code. Reported by David Olofson . * src/timer.c (reset_htimer): Use member assignments to at least work around the bug where it is known. * doc/heroes.texi (Machines): Advise Red Hat 7.0 users to use another compiler. 2000-12-03 Alexandre Duret-Lutz [HAVE_SDL] set_color always set color #0, this is visible at the begining of the introduction when half of the screen has a random color for 1second. Reported by Daniel Burrow. * src/display.c [HAVE_SDL] (set_color): Rewrite, using only one SDL_Color struct instead of a full palette. 2000-12-03 Alexandre Duret-Lutz Get rid of txti.cfg. Inline in the sources all the strings that was defined here. While doing this, enclose them all in a call to _() to prepare of i18n. * src/txts.c: Delete. * src/txts.h: Delete. * src/Makefile.am (heroes_SOURCES): Remove txts.c and txts.h. * src/txt_cfg/txti.cfg: Delete. * src/txt_cfg/Makefile (z_DATA): Remove txti.cfg. * src/bonus.c (apply_bonus): Inline txti strings. * src/const.c (mode_name): Prefix strings with N_. * src/heroes.c (update_player, play_game): Inline txti strings. (main): Don't call read_txti_cfg and close_txti. * src/menus.c (options_entries, main_entries): Prefix strings with N_. (compile_menu): Translate them here. (init_menus_sprites, game_menu, enter_your_name, draw_end_level_info, draw_round_info): Inline txti strings. * src/system.h: Add standard gettext definitions. 2000-12-03 Alexandre Duret-Lutz Allow to strech the screen fourfold. Suggested by Gregory Giannoni who can run heroes -3 smooth on his UltraSparc. * src/argv.c (print_help): Mention -4. (long_options): Add --quadruple. (parse_argv): Handle -4. * doc/heroes.texi (Invoking): Document -4 and --quadruple. * src/display.c (stretch_fourfold, stretch_fourfold_even): New. (copy_display): Use them. 2000-12-02 Alexandre Duret-Lutz * src/heroes.c (output_screen): Declare loginf as ints rather than chars, prevent wrapping of counter after 127. Reported by Jean Delvare. 2000-12-02 Alexandre Duret-Lutz Adapt config stuffs to the upcoming autoconf 2.49b. * m4/ac_adl_find_header.m4 (AC_adl_FIND_HEADER): Don't use AC_SHELL_IFELSE (it has be renamed as AS_IFELSE), prefer plain shell if/then/else instead. * configure.in: Use AC_CONFIG_FILES to specify parameters of AC_OUPUT. 2000-12-01 Alexandre Duret-Lutz Introduce xgettimeofday to prevent successive calls to gettimeofday to return decreasing values. Use timeval_substract to compute s and u in read_htimer: this force u to be positive, and thus (((s*(SECOND%d))%d)+u)%d is positive too (this wasn't the case before and could cause stalls). Stalls reported by David Olofson . * src/timer.c [HAVE_GETTIME_OF_DAY] (timeval_subtract, last_time, xgettimeofday): New. (update_htimers) [HAVE_GETTIME_OF_DAY]: Use xgettimeofday. (read_htimer) [HAVE_GETTIME_OF_DAY]: Use xgettimeofday and timeval_substract. Replace the kluge introduced on 2000-11-12 to make sure res>=0 by an assert: this should not happens anymore thanks to xgettimeofday. 2000-11-30 Alexandre Duret-Lutz * doc/heroes.texi: Add @dircategory and @direntry commands. (Options): Rename as ... (Invoking): ... this. 2000-11-30 Alexandre Duret-Lutz * src/heroes.c (find_free_way): Forbid turn back. This prevents old_way and way to be opposed (a configuration which is not drawable and cause segfault). The last patch on src/heroes.c tried to address the same bug, unsuccessfully. 2000-11-29 Alexandre Duret-Lutz * doc/heroes.texi (Machines): Heroes compiles and run on IRIX 6.5. Reported by Jesper Kjolsrud . 2000-11-29 Alexandre Duret-Lutz * doc/heroes.texi (Overview): Typo. 2000-11-29 Alexandre Duret-Lutz * HACKING (Where to announce): Typo. 2000-11-29 Alexandre Duret-Lutz * configure.in: Set version to 0.7a. 2000-11-28 Alexandre Duret-Lutz * configure.in: Bump to version 0.7. * NEWS: Update for 0.7. * man/Makefile.am (heroes.6): Depends upon configure.in to force a rebuild when VERSION change. * src/sound.h (get_decode_sound_options): Fix constness of argv0. * src/sound.c (get_int, decode_sound_options): Likewise. 2000-11-28 Alexandre Duret-Lutz * src/heroes.c (update_player): When going out frmo a tunnel, set old_way to the way of the tunnel (as way is also set to). This avoid in try to draw oddities such as {old_way=up, way=down}, which would otherwise result in a segfault (easy to repoduce by playing level 032). 2000-11-28 Alexandre Duret-Lutz * src/heroes.c (play_game): Continue to update event_time once the game is finished so that explosions from dead players are updated. 2000-11-28 Alexandre Duret-Lutz * src/heroes.c (update_player): In TCASH or COLORS, when the level is finished, mark all players whose time is null as dead. Otherwise only the first player would be. Reported by Jean Delvare. 2000-11-27 Alexandre Duret-Lutz * src/sfx.c (std_sfx_set): Mark sfx #1 for loading, it is needed by move_updown(), now called by quit_yes_no() which can be used in any modes. This fix the "Assertion `sfx_loaded[event_handle[event]]' failed" bug reported by Jean Delvare. 2000-11-26 Alexandre Duret-Lutz * src/menus.c (main_entries): Display "QUIT" for the exit entry. 2000-11-24 Alexandre Duret-Lutz * NEWS: Update for version 0.6f. 2000-11-24 Alexandre Duret-Lutz * src/menus.c (free_menu): Free title and funcs. (uninit_menus_sprites): Typo (resulting in unfree memory). 2000-11-24 Alexandre Duret-Lutz * src/sprprog.c (free_sprprog): Also free the sprite. 2000-11-24 Alexandre Duret-Lutz * src/system.h [HAVE_DMALLOC]: Define DMALLOC_FUNC_CHECK. 2000-11-24 Alexandre Duret-Lutz Modified resources have been strduped: free them on exit. * src/rsc_files.gperf (free_modified_rsc): New. * src/rsc_files_hash.h (free_modified_rsc): New. * src/heroes.c (main): Call free_modified_rsc. 2000-11-24 Alexandre Duret-Lutz * src/gfx_reader.h (graphic_reader): Fix a fence-post read. 2000-11-23 Alexandre Duret-Lutz * ANNOUNCE: New file. * Makefile.am (EXTRA_DIST): Add ANNOUNCE. 2000-11-23 Alexandre Duret-Lutz * src/render.c (draw_vehicle_head): The head of the vehicle should be drawn using the way of the output of a tunnel, not the input. 2000-11-22 Alexandre Duret-Lutz * src/visuals.c (horizontal_zoom_wave): handle the case where newsize is not a multiple of four and additionnal pixels needs to be drawn. This suppress an ungly vertical wave that appeared at the bottom right of the screen with the waving effect. 2000-11-22 Alexandre Duret-Lutz * src/render.c (draw_vehicle_tail, draw_vehicle_tail): Adjust divisor so that `d' can never be 12. This fix a bug reported by Jean Delvare (the patch two entries below also tried to address the same bug). 2000-11-22 Alexandre Duret-Lutz * src/menus.c (draw_end_level_info): Also shift winner_txt. 2000-11-22 Alexandre Duret-Lutz * src/render.c (draw_trail_real, draw_vehicle_tail): Use only the lower part of the players' positions to make sure `d' is never greater than 12 (or 10). * src/structs.h (hl, ehl): Use u16_t and u32_t to make bit width of members explicit. 2000-11-22 Alexandre Duret-Lutz * src/menus.c (init_menus_sprites): Typo. 2000-11-20 Alexandre Duret-Lutz * arch/VisualC/heroes.dsp: New version from Stéphane Denis . * src/gfx_reader.h (show_help): Do a break in the default case to satisfy VisualC. 2000-11-20 Alexandre Duret-Lutz * src/sound.c: Remove trailing '\n' in all warning or debug messages. * src/scrtools.c (set_pal_with_luminance): Fix computation. Fix warning messages output on wrong sound options (for SDL_mixer). Also use program_name whenever possible. * src/argv.c (print_help): Don't take argv0 as argument, use program_name instead. (parse_argv): Take from_file and from_line arguments, build argv[0] from them. Use from_file when calling decode_sound_options. * src/argv.h (parse_argv): Adjust accordingly. * src/debugmsg.h (program_name): Export. * src/heroes.c (main): Adapt calls to read_userconf and parse_argv. * src/userconf.c (read_userconf): Don't take argv0 as argument and don't pass it to parse_argv. * src/userconf.h (read_userconf): Adjust accordingly. 2000-11-20 Alexandre Duret-Lutz * configure.in: Bump version to 0.6f. 2000-11-20 Alexandre Duret-Lutz * NEWS: Mention the new icons. 2000-11-20 Alexandre Duret-Lutz New icons from Jean Delvare . * misc/heroes.xpm: Delete. * misc/heroes-1.xpm: New file. * misc/heroes-2.xpm: New file. * misc/heroes-3.xpm: New file. * misc/heroes-4.xpm: New file. * misc/heroes-5.xpm: New file. * misc/heroes-6.xpm: New file. * misc/heroes-7.xpm: New file. * misc/heroes-8.xpm: New file. * Makefile.am (EXTRA_DIST): Adjust accordingly. 2000-11-19 Alexandre Duret-Lutz * src/sound.c (sound_initialized, sound_track_loaded, sound_track_playing): Declare only if (HAVE_LIBSDL_MIXER || HAVE_LIBMIKMOD). 2000-11-19 Alexandre Duret-Lutz * NEWS: Update. * arch/VisualC/heroes.dsp: Remove font_deck.h and font_menu.h. 2000-11-19 Alexandre Duret-Lutz * arch/VisualC/config.h: Blind update. * arch/VisualC/heroes.dsp: Likewise. 2000-11-19 Alexandre Duret-Lutz * doc/heroes.texi (Machines): New section. * tools/readme.sed: List the Machines section in the summary. * TODO: Update. 2000-11-19 Alexandre Duret-Lutz New sprite kind, used to draw the "Get this bonus" arrows. * src/sprunish.c: New. * src/sprunish.h: New. * src/sprite.h (sprite_kind): Add S_RLE_UNIC_SHARE. (sprite_rle_unic_shade): New. (sprite_s): Add the unish member. * src/sprite.c (free_sprite): Handle the S_RLE_UNIC_SHARE case. * src/Makefile.am (heroes_SOURCES): Add sprunish.c, and sprunish.h. * src/render.c (draw_level): Call draw_sprunish_custom. * src/items (init_items): Build catch_this using compile_sprunish. 2000-11-19 Alexandre Duret-Lutz * src/sprprog.c (draw_sprprog_clipped_left, draw_sprprog_clipped_right): New. * src/sprprog.h (draw_sprprog_clipped_left, draw_sprprog_clipped_right): New. * src/menus.c (scores_menu): Use draw_sprprog_clipped_left and draw_sprprog_clipped_right. 2000-11-19 Alexandre Duret-Lutz * src/const.h (xbuf): Set to 512. * src/const.c (xbuf, ybuf, sbuf, NOGLENZPLR, NOGLENZRED, maxq, lemmings_per_players, lemmings_total): Remove, since they are defined in const.h. * src/visuals.c (vertical_zoom_wave): Use xbuf. * src/render.c (copy_square_transp): Use xbuf. 2000-11-19 Alexandre Duret-Lutz * src/menus.c (jukebox_menu): Rename sinl as sh to suppress a warning. * src/render.c (draw_level): Adapt to remove the sinl local variable. 2000-11-19 Alexandre Duret-Lutz * src/const.c (temppal, pal): Remove. * src/const.h (temppal, pal): Remove. * src/heroes.c (play_demo): Don't set pal.global. * src/intro.c (play_intro): Declare pal as local. 2000-11-19 Alexandre Duret-Lutz * src/sprtext.c (compile_sprtext): Qualify maxwidth as unused to suppress a warning. 2000-11-19 Alexandre Duret-Lutz * src/sprglenz.c (draw_sprglenz_custom): Rename the glenz argument as glenz_line to suppress a warning. * src/sprglenz.h (draw_sprglenz_custom): Likewise. 2000-11-19 Alexandre Duret-Lutz * src/const.c (icons_img, jukebox_img): Remove. * src/const.h (icons_img, jukebox_img): Remove. * src/heroes.c (main): Don't handle icons_img and jukebox_img here ... * src/menus.c (init_menus_sprites): ... but do it there. 2000-11-19 Alexandre Duret-Lutz * src/const.c (trailimg): Remove. * src/const.h (trailimg): Remove. * src/heroes.c (main): Don't handle trailimg here ... * src/itemc.c (init_items): ... but do it there. 2000-11-19 Alexandre Duret-Lutz * src/bonus.c (init_bonuses): Free bonus_b_img and bonus_a_img once the sprite have been generated. (uninit_bonuses): Don't free bonus_b_img and bonus_a_img anymore. 2000-11-19 Alexandre Duret-Lutz * m4/ac_adl_gcc_optim.m4: Don't erase CFLAGS, append to it. 2000-11-19 Alexandre Duret-Lutz * src/gfx_reader.h (show_help, graphic_reader): Don't cast a pointer to an int. Heroes seems to run fine on alphaev56-dec-osf4.0d, now. Great! 2000-11-19 Alexandre Duret-Lutz * src/visuals.c (horizontal_zoom_wave, horizontal_zoom_flip): Simplify. Supress GETWORD calls. As a side effect, suppress run-time alignment warnings on alphaev56-dec-osf4.0d. 2000-11-19 Alexandre Duret-Lutz * src/bonus.c (show_txt_bonus): Bug fix, display the text for the given player, not always the first player. 2000-11-19 Alexandre Duret-Lutz Get rid of draw.c and draw.h, hurrah! * src/draw.c (aff_buffer): Move to ... * src/scrtools.c (aff_buffer): ... here. * src/draw.h (aff_buffer): Move to ... * src/scrtools.h (aff_buffer): ... here. * src/draw.c: Delete. * src/draw.h: Delete. * src/Makefile.am (heroes_SOURCES): Remove draw.c and draw.h. * src/bonus.c: Don't include draw.h. * src/heroes.c: Likewise. * src/menus.c: Likewise. * src/render.c: Likewise. * src/sprprogwav.h: Likewise. * src/menus.c (player_logo): Don't keep it static. * src/menus.h (player_logo): Export. * src/render.c (draw_logo_info): Use player_logo. 2000-11-18 Alexandre Duret-Lutz Don't support the use_glenz option any longer. * src/menus.c (init_menus_sprites): Remove the "GLENZ" options from screen_menu_txt, and recenter the other lines on the screen. (screen_menu): Remove handling of use_glenz, relayout every thing. * src/options.c (reinit_options): Don't initialize opt.use_glenz. * src/options.h (options_t): Rename `use_glenz' as `_obsolete'. * src/render,c (copy_lemming_transp, copy_dead_lemming_transp): Remove use_glenz handling. 2000-11-18 Alexandre Duret-Lutz * src/menus.c (deck_digits): New. (init_menus_sprites, uninit_menus_sprites): (Un)initialize it. (jukebox_draw): Adapt to use it. 2000-11-18 Alexandre Duret-Lutz Add a new sprite type: S_OPAQUE. * src/spropaque.c: New file. * src/spropaque.h: New file. * src/Makefile.am (heroes_SOURCES): Add spropaque.c and spropaque.h. * src/sprite.h (sprite_kind): Add S_OPAQUE. (sprite_opaque_s): New. (sprite_s): Add member opaq. * src/sprite.c (free_sprite): Handle the S_OPAQUE case. Use this new kind of sprite to replace copy_rect_transp_* calls. * src/menus.c (ctrl_ico, autopilot_ico, music_ico, sfx_ico, radar_ico, infos_ico, inertia_ico, luminance_ico, player_logo, player_ico, speed_ico): New. (init_menus_sprites, uninit_menus_sprites): (Un)initialize them. (control_menu, sound_menu, screen_menu, game_menu, draw_end_level_info, draw_round_info): Adapt to use them. 2000-11-18 Alexandre Duret-Lutz * src/render.c (draw_logo_info): Adapt to use red_cross. * src/draw.c (copy_rect_transp_red): Remove. * src/draw.h (copy_rect_transp_red): Remove. * src/items.c (red_cross): New. (init_items, uninit_items): Handle red_cross. * src/items.h (red_cross): New. 2000-11-18 Alexandre Duret-Lutz * src/system.h (INT_TO_PTR): Fix. * src/render.c (copy_tile): Fix constness. (draw_trail_real): Remove useless local variable. 2000-11-18 Alexandre Duret-Lutz * src/const.c (camera_x, camera_y, corner_x, corner_y, corner_dx, corner_dy, inert_x, inert_y): Declare as int (not long). Change signedness. * src/const.h: Likewise. * src/heroes.c (compute_corner): Suppress useless casts. Disable inertia when the framerate does not allow it. 2000-11-18 Alexandre Duret-Lutz Add a new kind of sprite (S_RLE_GLENZ) and use it to draw the trails. * src/sprglenz.c: New file. * src/sprglenz.h: New file. * src/Makefile.am (heroes_SOURCES): Add sprglenz.c and sprglenz.h. * src/sprite.h (sprite_kind): Add S_RLE_GLENZ. (sprite_rle_glenz_s): New. (sprite_s): Add member glenz. * src/sprite.c (free_sprite): Add the S_RLE_GLENZ case. * src/const.c (trail): Remove. * src/const.h (trail): Remove. * src/heroes.c (main): Do not initialize trail any more. * src/items.c (trails, trail_row): New. (init_items, uninit_items): (Un)initialize trails. * src/items.h (trails): New. * src/render.c (draw_trail_real, draw_vehicle_tail): Adapt to use trails. 2000-11-18 Alexandre Duret-Lutz * src/visuals.c (horizontal_zoom_flip): Use PTR_TO_INT. 2000-11-18 Alexandre Duret-Lutz * src/system.h (PTR_TO_INT, INT_TO_PTR): New. * src/visuals.c (horizontal_zoom_wave): Use PTR_TO_INT. 2000-11-18 Alexandre Duret-Lutz * src/render.c (copy_tile): Don't cast pointer to int. Use u32_t where relevant. 2000-11-18 Alexandre Duret-Lutz * src/sound.h [!HAVE_LIBSDL_MIXER && !HAVE_LIBMIKMOD] (set_volume, halve_volume, init_sound_engine, uninit_sound_engine, unload_soundtrack, play_soundtrack, decode_sound_options, load_soundtrack_from_alias, load_next_soundtrack, load_prev_soundtrack): Define as empty macros. * src/sound.c [!HAVE_LIBSDL_MIXER && !HAVE_LIBMIKMOD] (set_volume, halve_volume, init_sound_engine, uninit_sound_engine, unload_soundtrack, play_soundtrack, decode_sound_options, load_soundtrack_from_alias, load_next_soundtrack, load_prev_soundtrack): Don't define. 2000-11-18 Alexandre Duret-Lutz * configure.in: Work around a bug in the realloc test on Alpha. 2000-11-17 Alexandre Duret-Lutz Draw "Take this bonus" using a S_RLE_SHADE sprite. This has two side effects: the yellow color is not blinking any more, a text printed on the rightmost tile can wrap on the left of the screen (this will disappear when xbuf is widened). * src/items.c (catch_this): New. (init_items, uninit_items): Use catch_this. * src/items.h (catch_this): New. * src/render.c (draw_level): Use catch_this and simplify the loops. Remove useless functions. * src/draw.c (copy_rect_transp_8, draw_demo_stick): Remove. (aff_buffer): Don't call draw_demo_stick. * src/draw.h (copy_rect_transp_8, draw_demo_stick): Remove. * src/render.c (display_buffer_tmp1, display_buffer_moving, display_two_buffers_moving, display_two_buffers_moving_and_clear): Remove. 2000-11-17 Alexandre Duret-Lutz * src/draw.c (copy_rect_transp): Remove. * src/draw.h (copy_rect_transp): Remove. * src/menus.c (lemming): New. (init_menus_sprites, uninit_menus_sprites): Handle lemming. (jukebox_draw): Use lemming. 2000-11-17 Alexandre Duret-Lutz * src/menus.c (vehicles_spr): New. (init_menus_sprites, uninit_menus_sprites): Handle vehicles_spr. (draw_end_level_info, draw_round_info): Use it. 2000-11-17 Alexandre Duret-Lutz * src/bonus.c (txt_bonus): Use sprite_t and qualify as static. (set_txt_bonus): Compile the bonus text as a sprite. (show_txt_bonus): Use DRAW_SPRITE. Change prototype and take a destination argument. * src/bonus.h (txt_bonus): Remove. (show_txt_bonus): Change prototype and take a destination argument. * src/fontdata.c (bonus_font, initialize_bonus_font): New. (init_fonts): Call initialize_bonus_font. (uninit_fonts): Free bonus_font. * src/fontdata.h (bonus_font): New. * src/heroes.c (output_screen): Adapt call to show_txt_bonus. * src/sprtext.c (compile_bonus_text): New. * src/sprtext.h (compile_bonus_text): New. * src/draw.c (draw_text_bonus): Remove. * src/draw.h (draw_text_bonus): Remove. 2000-11-17 Alexandre Duret-Lutz * src/draw.c (text_waving_step, text_waving_htimer, init_text_waving_step, uninit_text_waving_step, update_text_waving_step): Move to ... * src/sprprogwav.c (text_waving_step, text_waving_htimer, init_text_waving_step, uninit_text_waving_step, update_text_waving_step): ... here. * src/draw.h (text_waving_step, init_text_waving_step, uninit_text_waving_step, update_text_waving_step): Move to ... * src/sprprogwav.h (text_waving_step, init_text_waving_step, uninit_text_waving_step, update_text_waving_step): ... here. * src/heroes.c: Include sprprogwav.h. 2000-11-17 Alexandre Duret-Lutz * src/font_deck.h: Delete. * src/font_menu.h: Delete. * src/Makefile.am (heroes_SOURCES): Remove font_deck.h and font_menu.h. * src/draw.c: Don't include them anymore. 2000-11-16 Alexandre Duret-Lutz Ensure that the lemming is draw on top of the deck (not behind), by moving the drawing code into jukebox_draw. As a side effect this also draws the lemmings in the pause screen. * src/draw.c (jukebox_menu): Move the lemming_htimer definition ... (lemming_htimer): ... here (global). (jukebox_menu): Move the lemming drawing code to ... (jukebox_draw): ... here. (init_menu_sprites,uninit_menus_sprites): Take care of lemming_htimer. 2000-11-16 Alexandre Duret-Lutz Adapt the deck_text font to the new sprtext functions. * src/draw.c (deck_text_conv, draw_deck_text): Remove. * src/draw.h (draw_deck_text): Remove. * src/fontdata.c (initialize_deck_font): New. (init_font): Call initialize_deck_font. * src/menus.c (jukebox_draw): Adapt to use the new sprite drawing functions instead of draw_deck_text. * src/sound.c (soundtrack_author, soundtrack_title, soundtrack_author_sprite, soundtrack_title_sprite): New. (sound_initialized, sound_track_loaded, sound_track_playing): Qualify as static. (unload_soundtrack, load-and_setup_sound_track): Free soundtrack_title_sprite and soundtrack_author_sprite. * src/sound.h (soundtrack_author, soundtrack_title): Qualify as extern. (soundtrack_title_sprite, soundtrack_author_sprite): New. * src/sprtext.c (compile_deck_text): New. * src/sprtext.h (compile_deck_text): New. 2000-11-16 Alexandre Duret-Lutz * configure.in: Set version to 0.6e. 2000-11-15 Alexandre Duret-Lutz * NEWS: Update. * tools/Makefile.am (EXTRA_DIST): Rename readme.sh as readme.sed. * src/Makefile.am (EXTRA_DIST): Add debughash.gperf. * arch/VisualC/heroes.dsp: Blind update. 2000-11-15 Alexandre Duret-Lutz * src/const.c (clock_anim_offset): Remove. * src/const.h (clock_anim_offset): Remove. * src/items.c (small_dollar, clocks, pyramids): New. (init_items, uninit_items): Initialize them. * src/items.h (small_dollar, clocks, pyramids, NBR_CLOCK_FRAMES, NBR_PYRAMIDS): New. * src/render.c (draw_color): Rewrite using the above sprite, but the red cross is still drawn manually. (draw_cash): Remove. (draw_level): Adapt to draw clocks and dollars using DRAW_SPRITE. 2000-11-15 Alexandre Duret-Lutz * src/heroes.c (play_menu): Reverse M_DEATHM and M_KILLEM selection since their name are swaped in draw_play_menu. 2000-11-15 Alexandre Duret-Lutz * src/items.c: New file. * src/items.h: New file. * src/Makefile.am: Add them. * src/heroes.c (main): Call init_items and uninit_item. * src/render.c (draw_dollar): Remove. (draw_level): Use the big_dollar sprite (compiled by items.c) instead of calling draw_dollar. 2000-11-15 Alexandre Duret-Lutz Generalize copy_rect_transp_shadow as a new kind of sprite. Use it to draw the martians. * src/sprshade.c: New file. * src/sprshade.h: New file. * src/Makefile.am (heroes_SOURCES): Add them. * src/draw.c (copy_rect_transp_shadow): Remove. * src/draw.h (copy_rect_transp_shadow, copy_32x32_transp_z): Remove. * src/sprite.c (free_sprite): Handle S_RLE_SHADE. * src/sprite.h (sprite_kind): Add S_RLE_SHADE. (sprite_rle_s): Define members in ... (SPRITE_RLE_MEMBERS): ... this macro. (sprite_rle_shade_s): New. (sprite_s): Add shade member. * src/menu.c (info_martian): New. (init_menus_sprites, uninit_explosions): Handle it. (draw_end_level_info): Use it. 2000-11-14 Alexandre Duret-Lutz Declare explosion sprites to explosion.{c,h} using new sprite functions. Rename nbrexplo1 as NBR_EXPLOSION_FRAMES, and fst_explo_list and snd_explo_list are now compiled as sprite_t* into explosions[0] and explosions[1]. * src/explosions.c: New file. * src/explosions.h: New file. * src/sprzcol.c: New file. * src/sprzcol.h: New file. * src/Makefile.am (heroes_SOURCES): Add these four files. * src/sprite.h (sprite_kind): Add S_RLE_ZCOL. * src/sprite.c (free_sprite): Handle S_RLE_ZCOL. * src/draw.c (copy_32x32_transp_z): Remove (now obsoleted by sprzcol). * src/const.c (nfrexplo1,fst_explo_list,snd_explo_list): Remove. * src/const.h (nfrexplo1,fst_explo_list,snd_explo_list): Remove. * src/heroes.c (load_level, ia_eval_dir_target_inline, ia_eval_dir_bonus_inline, ia_eval_dir_lemming_inline, ia_eval_dir_cash_inline, ia_eval_dir_color_inline, ia_goto_target_inline, ia_goto_bonus_inline, ia_goto_lemming_inline, ia_goto_color_inline, ia_goto_cash_inline, update_player): Adapt to new explosion definitions. (main): Call init_explosions and uninit_explosions. * src/render.c (draw_level): Adapt to new explosions. 2000-11-13 Alexandre Duret-Lutz * src/draw.c (JUSTIF_CALC, Id, draw_text, draw_text_clipped_left, draw_text_clipped_right, draw_text_waving, draw_text_array): Remove. * src/draw.h (draw_text, draw_text_clipped_left, draw_text_clipped_right, draw_text_waving, draw_text_array): Remove. 2000-11-13 Alexandre Duret-Lutz * src/heroes.c (scores_menu): Move to ... * src/menus.c (scores_menu): ... here. * src/menus.c (higher_scores_txt): New. (init_menus_sprites, uninit_menus_sprites): Handle higher_scores_txt. (scores_menu): Adapt to use the new drawing functions. This needs additional work, either to clip the text or enlarge xbuf. * src/menus.h (scores_menu): Export. 2000-11-13 Alexandre Duret-Lutz * src/heroes.c (draw_end_level_info, draw_round_info): Move to ... * src/menus.c (draw_end_level_info, draw_round_info): ... here. * src/heroes.c (play_game): Call update_text_wavinf_step when drawing end level and round info. * src/heroes.h (rounds): Export. * src/menus.c (info_mode_quest_txt, info_mode_deathm_txt, info_mode_killem_txt, info_mode_tcash_txt, info_mode_color_txt, info_mode_next_txt, info_mode_save_txt, info_mode_return_txt, info_round_txt): New sprites. (init_menus_sprites, uninit_menus_sprites): Handle them. (game_menu): Rename local variable rounds as rounds_txt to suppress a warning. (draw_end_level_info, draw_round_info): Adapt to use new text drawing functions. * src/menus.h (draw_round_info, draw_end_level_info): Export. 2000-11-12 Alexandre Duret-Lutz * src/menu.c (display_menu): Blit conditionally (add a 3rd arg) (exec_menu, draw_main_menu): Call display_menu with the right blitting option. * src/heroes.c (main_menu): Cosmetic change. * src/visual.c (corner_buffer_end, corner_buffer): Strip trailing spaces. 2000-11-12 Alexandre Duret-Lutz * src/heroes.c (enter_your_name): Move ... * src/menus.c (enter_your_name): ... here. Adapt to use the new text drawing functions. (enter_your_name_txt): New. (init_menus_sprites, uninit_menus_sprites): Handle enter_your_name_txt. * src/menus.h (enter_your_name_txt): Export. 2000-11-12 Alexandre Duret-Lutz Kludgy bug fix: for some unknown reason, read_timer can return negative values. This is not expected and leads to very large (MAX_INT wide) loops in the code. * src/timer.c (read_htimer): Ensure that res cannot be negative (simply return 0 if this happens). 2000-11-12 Alexandre Duret-Lutz * src/menus.c (load_select_txt, save_select_txt, savrec_name): New. (init_menus_sprites, uninit_menus_sprites): handle the above sprites. (draw_saved_games_info): Use them. Rename and retype 3rd arg. * src/menus.h (draw_saved_games_info): Change 3rd arg. (saverec_name): Export. * src/heroes.c (play_menu, play_game): Adapt calls to draw_saved_games_info. (play_game): Clear saverec_name[l] when needed. 2000-11-12 Alexandre Duret-Lutz * src/const.h (two_players): Declare as boolean. * src/const.c (two_players): Likewise. * src/heroes.c: Adapt all most refences to two_players. 2000-11-12 Alexandre Duret-Lutz * src/menu.c (edit_first_menu_txt, edit_first_new_txt, edit_first_load_txt): New. (init_menus_sprites, uninit_menus_sprites): Handle the above new sprites. (editor_first_menu): Use them. Simplify keys handling. 2000-11-12 Alexandre Duret-Lutz * src/argv.h (nosfx, joyoff, loadulevel, directmenu, swapside, mono, bits8, hqmix, nosound, even_lines): Define as booleans. * src.argv.c (nosfx, joyoff, loadulevel, directmenu, swapside, mono, bits8, hqmix, nosound, even_lines): Likewise. (long_options): Fix no-joystick lines (useless 3rd arg). (parse_argv): Use true and false for boolean variables. 2000-11-12 Alexandre Duret-Lutz * src/menu.c (playmenu_title_txt, playmenu_players_txt, playmenu_goback_txt, playmenu_load_txt, gamemode_txt): New. (init_menus_sprites, uninit_menus_sprites): Handle the above new sprites. (draw_play_menu): Use them. 2000-11-12 Alexandre Duret-Lutz * src/menu.c (quitgame_yes_txt, quitgame_no_txt): Rename as ... (quit_yes_txt, quit_no_txt): ... this. (quitheroes_menu_txt): New. (init_menus_sprites, uninit_menus_sprites): Handle the above new sprites. (draw_quit_menu): Use them. (quit_yes_no): Exchange `yes' and `no'. Use move_updown. 2000-11-11 Alexandre Duret-Lutz * src/menus.c (edit_sel_txt): New. (init_menus_sprites): Create edit_sel_txt. (uninit_menus_sprites): Free it. (editor_selector): Adapt to use edit_sel_txt and the new sprite drawing functions. Remove lname. 2000-11-11 Alexandre Duret-Lutz * src/menu.c (entry_func_t, menu_entry_t, menu_t, options_entries, main_entries, main_menu_data, option_menu_data, compile_menu, display_menu, exec_menu, free_menu): New. (game_menu, screen_menu, sound_menu, control_menu, keyboard_menu, extra_menu): Forward declare. (init_menus_sprites): Initialize option_menu_data and main_menu_data. (uninit_menus_sprites): Free them. (extra_menu): Return if no extra levels are available (this used ot be checked in options_menu). (options_menu): Rewrite using exec_menu. (draw_main_menu): Rewrite using display_menu. 2000-11-08 Alexandre Duret-Lutz * src/draw.h (draw_text_320, draw_text_waving_320, draw_text_array_320,copy_rect_2_320, copy_rect_4_320): Remove (now useless). * src/draw.c (draw_text_320, draw_text_waving_320, draw_text_array_320,copy_rect_2_320, copy_rect_4_320): Remove (now useless): Likewise. 2000-11-08 Alexandre Duret-Lutz Install files in right directories. * src/etc/Makefile.am (xdir): Install in $(pkgdatadir). * src/txt_cfg/Makefile.am (zdir): Likewise. 2000-11-05 Alexandre Duret-Lutz * src/hedlite.c (hmain): convert tile_set_name to lowercase (this allow to load existing levels). 2000-11-05 Alexandre Duret-Lutz Adapt editor_menu to xbuf-wide buffer and new sprite functions. * src/menus.c (bigarr_cursor, sqr_cursor, small_arrows, ed_new_level_txt, ed_existing_level_txt, ed_name_txt, ed_x_wrap_txt, ed_y_wrap_txt, ed_x_size_txt, ed_y_size_txt, ed_edit_txt): New. (init_menus_sprites): Compile the above sprites. (uninit_menus_sprites): Free them. (editor_menu): Adapt to use a xbuf wide buffers, and the new sprite routines. Also change the color palette when the tileset preview change (a bug introduced with fader on 2000-09-27). * src/scrtools.c (copy_image_to_scr_area): New. * src/scrtools.h (copy_image_to_scr_area): New. 2000-11-05 Alexandre Duret-Lutz * src/heroes.c (play_game): Do not call draw_text_320 to display the level name, use the sprtext routines instead. Bugfix: reset update_htimer after the sleep, the we see the moving buffers. * src/scrtools.c (clear_src_area): New. * src/scrtools.h (clear_src_area): New. 2000-11-05 Alexandre Duret-Lutz Cleanup quit_yes_no. * src/heroes.c (quit_yes_no): Move to ... * src/menus.c (quit_yes_no): ... here. Rewrite using the new sprite routines, and using xbuf wide buffers. (quitgame_menu_txt, quitgame_yes_txt, quitgame_no_txt): New. (init_menus_sprites): Initialize the three above variables. (uninit_menus_sprites): Free them. * src/menus.h (quit_yes_no): Export. 2000-11-05 Alexandre Duret-Lutz Cleanup pause_menu. * src/heroes.h (event_htimer, update_htimer, enable_blit): Export. * src/heroes.c (pause_menu): Move to ... * src/menus.c (pause_menu): ... here. Rewrite using the new sprite routines, and using xbuf wide buffers. (pause_menu_txt): New. (init_menus_sprites): Initialize pause_menu_txt. (uninit_menus_sprites): Free it. (jukebox_draw, jukebox_keys): Tag static. * src/menus.h (jukebox_draw, jukebox_keys): Remove. (pause_menu): New. * src/scrtools.c (backup_screen, shade_scr_area, copy_scr_area): New. * src/scrtools.h (backup_screen, shade_scr_area, copy_scr_area): New. 2000-11-05 Alexandre Duret-Lutz Fix A_LOOP tiles (which were not animated anymore...) * src/render.c (draw_level): Parenthesize tile source computation. 2000-11-04 Alexandre Duret-Lutz Rewrite parts of jukebox_menu so that it use the new sprites drawing routines. Factor code for pause_menu. * src/menus.c (credit_menu_txt, jukebox_frame, jukebox_back, jukebox_forw, jukebox_quit): New sprites. (init_menus_sprites): Create them. (uninit_menus_sprites): Free them. (jukebox_draw): New. (jukebox_keys): New. (jukebox_menu): Use the above sprites. Move some code to jukebox_keys and jukebox_draw so that pause_menu can reuse it. * src/heroes.c (pause_menu): Adapt to call jukebox_draw and jukebox_keys. * src/menus.h (jukebox_draw, jukebox_keys): Declare. Fixes. * src/sprprogwav.c (end_sprprogwav): Overwrite the drawing function. * src/sprrle.c (compile_sprrle): Ensure to not overflow to tranparant and opaque pixel counters. * src/gfx_reader.h (show_help): Don't zero keys not handled in the switch. 2000-11-04 Alexandre Duret-Lutz Use get_sound_track_from_rank to cycle into the sound track list. The jukebox menu do not require a hardcoded list of sound track aliases anymore. Move the jukebox_menu to menu.c. * doc/heroes.texi (heroesrc): Say it is allowed to define new sound track aliases. * src/heroes.h (sound_track_htimer): Export. * src/heroes.c (soundtrack_list, soundtrack_current_nbr): Remove. (load_level): Don't setup soundtrack_list and soundtrack_current_nbr anymore. (jukebox_menu): Move to ... * src/menu.c (jukebox_menu): ... here. Adapt to use load_next_soundtrack and load_prev_soundtrack. * src/heroes.c (pause_menu): Adapt likewise. * src/musicfiles.c (get_sound_track_from_rank): Wrap to rank to fit in the number of sound tracks. * src/sound.c [HAVE_LIBMIKMOD, HAVE_LIBSDL_MIXER] (load_soundtrack_from_alias): Move ... [HAVE_LIBMIKMOD||HAVE_LIBSDL_MIXER] (load_soundtrack_from_alias): ... here (i.e. define only once). [HAVE_LIBMIKMOD, HAVE_LIBSDL_MIXER] (load_soundtrack): Tag static. [HAVE_LIBSDL_MIXER] (music): Rename as ... [HAVE_LIBSDL_MIXER] (module): ... this. Adjust all references. [HAVE_LIBMIKMOD||HAVE_LIBSDL_MIXER] (last_rank, load_and_setup_sound_track, load_next_soundtrack, load_prev_soundtrack): New. [HAVE_LIBMIKMOD||HAVE_LIBSDL_MIXER] (load_soundtrack_from_alias): Use (load_and_setup_sound_track). * src/sound.h (load_soundtrack): Remove. (load_next_soundtrack, load_prev_soundtrack): New. 2000-11-04 Alexandre Duret-Lutz Keep the sound tracks in a sorted array, in addition to the hash (needed for the jukebox menu, see next patch). * src/musicfiles.h (sound_track_t): Add the rank member. (get_sound_track_from_rank): New. (freeze_sound_track_list): New. * src/musicfiles.c (st_array, n_st): New. (st_cmp): Rename as ... (st_equ): ... this. (st_cmp): New. (st_cons): Initialize rank. (init_sound_track_list): Adapt to use st_equ. (print_sound_track_list): Adapt to use st_array. (freeze_sound_track_list): New. (get_sound_track_from_rank): New. * src/heroes.c (main): Call freeze_sound_track_list. * HASKING: README is no longer updated manually. 2000-11-04 Alexandre Duret-Lutz * tools/Makefile.am (EXTRA_DIST): Add readme.sh. 2000-11-04 Alexandre Duret-Lutz * doc/heroes.texi: Ispell it. 2000-11-04 Alexandre Duret-Lutz Generate README automatically from the Texinfo manual. * tools/readme.sed: New file. * Makefile.am (README): New. * HACKING: Update. 2000-11-04 Alexandre Duret-Lutz * TODO: Update. * BUGS: Update. 2000-11-04 Alexandre Duret-Lutz * m4/gccwarn.m4: New file (adapted from a2ps). * m4/Makefile.am (EXTRA_DIST): Add gccwarn.m4. * configure.in: Use ad_GCC_WARNINGS. * doc/heroes.texi (configure options): Document --enable-warnings. * m4/ac_adl_gcc_optim.m4 (ADL_GCC_WARNINGS): Rename as... (ADL_GCC_OPTIM): ... this (of course). 2000-11-04 Alexandre Duret-Lutz Fix some more warnings. * src/heroes.c (draw_end_level_info): Remove j. * src/gfx_reader.h (show_help): Add default case to switch. 2000-11-04 Alexandre Duret-Lutz * configure.in: Add check that ought to be in since 2000-10-31. 2000-11-04 Alexandre Duret-Lutz * lib/hash.c (hash_delete): Merge fix found in textutil 2.0g. 2000-11-03 Alexandre Duret-Lutz Rewrite musicfile.c: use a hash instead of a list to hold the sound-track aliases. Dump the hash content on --list=sound-tracks. * configure.in: Check for stdlib.h and stdbool.h. Check for malloc, calloc, realloc, and free definitions. * doc/heroes.texi: (Options): Document --list=sound-tracks. (heroesrc): Mention --list=sound-tracks. * lib/hash.c: New file (from textutils, with fix). * lib/hash.h: New file. * lib/Makefile.am (noinst_HEADERS): Add hash.h. (libheroes_a_SOURCES): Add hash.c. * src/argv.c (list): Handle sound-tracks. (print_help): Mention sound-tracks. * src/musicfiles.c (sound_track_list, sound_track_cons, sound_track_delete, add_sound_track): Remove. (st_hash, st_cmp, st_hasher, st_free, st_cons, print_sound_track_list, print_sound_track_list_stat) New. (add_sound_track_cons, get_sound_track_from_alias, init_sound_track_list): Rewrite to use the hash. (init_sound_track_list): Return void. * src/musicfiles.h (sound_track_cons, sound_track_delete, add_sound_track): Remove. (init_sound_track_list): Return void. (print_sound_track_list, print_sound_track_list): New * src/system.h: Define bool or include stdbool.h. 2000-11-03 Alexandre Duret-Lutz Rewrite the sprite interface, cleaner and clever. Remove the RLE-program stuff, install the brand new system. * src/rleprog.c: Delete file. * src/rleprog.h: Delete file. * src/rletext.c: Delete file. * src/rletext.h: Delete file. * src/sprite.c: New file. * src/sprite.h: New file. * src/sprrle.c: New file (bits from src/rleprog.c) * src/sprrle.h: New file. * src/sprprog.c: New file. * src/sprprog.h: New file. * src/sprprogwav.c: New file. * src/sprprogwav.h: New file. * src/sprtext.c: New file (mostly from src/rletext.c) * src/sprtext.h: New file (mostly from src/rletext.h) * src/Makefile.in (source_HEROES): Report the above changes. * src/bonus.c (bonus_rle,init_bonuses,uninit_bonuses): Adapt to use the new sprite interface. * src/heroes.c (draw_end_level_info): Use waving_arrows. * src/menus.c (left_arrow, right_arrow, checked_box, cursor_bg, cursor_fg, horizontal_rule, control_menu_txt, sound_menu_txt, music_vol_txt, sfx_vol_txt, screen_menu_txt, game_menu_txt, game_rounds_txt, keyboard_menu_txt, keyboard_keys_txt, extra_menu_txt, extra_modes_txt, extra_combine_txt): Use sprite_t, declare them all static. (init_menus_sprites): Adapt to use compile_sprrle, and the *sprprog functions. (uninit_menus_sprites): Adapt to use FREE_SPRITE0. (arrows, waving_arrows, chkbox, cursor, hrule, control_menu, keyboard_menu, sound_menu, screen_menu, game_menu, extra_menu, draw_saved_games_info): Use DRAW_SPRITE. (waving_arrows): Export. * src/menus.h (left_arrow,right_arrow): Remove. (waving_arrows): Declare. * src/render.c (draw_level): Use DRAW_SPRITE. * src/renderdata.c (tile_sprites): Rename as ... (tile_transp): ... this. Use sprite_t. Adjust all references. (get_tile_sprite): Use compile_sprrle. * src/renderdata.h (fg_data_t): Use sprite_t for members. 2000-11-02 Alexandre Duret-Lutz Draw superposed sprites using RLE-programs. * src/renderdata.c (init_tile_sprites,uninit_tile_sprites, get_tile_sprite,tile_set_size,tile_sprites): New. (uninit_render_data): Call uninit_tile_sprites. Use XFREE0. (init_render_data): Call init_tile_sprites. (init_render_data): Adapt to use get_tile_sprite. * src/renderdata.h (fg_data_t): Store sprite as a rleprog_t. * src/render.c (copy_tile_transp): Remove. (draw_level): Adapt to display sprite as rleprog_t. 2000-11-02 Alexandre Duret-Lutz * configure.in: Adapt AC_INIT to autoconf 2.49a. 2000-11-01 Alexandre Duret-Lutz Draw bonuses using RLE-programs. * src/bonus.c (bonus_a_img, bonus_b_img): Make them static. (bonus_rle): New. (init_bonuses, uninit_bonus): Take care of bonus_rle. (add_bonus): Adapt to put a rleprog_t in fg_data[pos].bonus. * src/bonus.h (bonus_a_img, bonus_b_img): Remove. * src/render.c (draw_level): Adapt to display bonuses as rleprog. * src/renderdata.h (fg_data_t): Use rleprog_t for bonus. 2000-11-01 Alexandre Duret-Lutz * doc/heroes.texi (Options): Describe --list=debug. (Environment): Mention --list=debug. * src/Makefile.am (heroes_SOURCES): Add debughash.c and debughash.h. (debughash.c): New. * src/argv.c (list): Recognize debug. (print_help): Update --list description. Mention --list in --verbose and --driver description. * src/debughash.gperf: New file. * src/debughash.h: New file. * src/debugmsg.c (dmsg_parse_string): Adapt to use get_channel_number. Rename opt to option to avoid a warning. * src/debugmsg.h (dmsg_parse_string): Rename opt to option. (debug_level): Revamp. * src/rsc_files.gperf: Add missing license header. 2000-11-01 Alexandre Duret-Lutz * src/argv.c (print_help): Rewrite more cleanly. 2000-11-01 Alexandre Duret-Lutz Use xmalloc-based macros or functions. As a consequence do not perform error checking on malloc return anymore. * lib/xstrdup.c: New file. * lib/Makefile.am (linheroes_a_SOURCES): Add xstrdup.c. * src/system.h (XFREE0, XCALLOC_ARRAY, XMALLOC_ARRAY, XSALLOC_ARRAY, XREALLOC_ARRAY, XMALLOC_VAR): New. * src/bonus.c (init_bonuses_level, uninit_bonuses_level): Use xmalloc-based macros. * src/argv.c (parse_argv): Likewise. * src/debugmsg.c (dmsg_parse_string): Likewise. * src/display.c [HAVE_PKG_GGI] (set_display_params): Likewise. [HAVE_PKG_GGI,HAVE_SDL] (init_video): Likewise. * src/extras.c (browse_extra_directory, browse_extra_directories add_extra_directory, add_extra_in_user_directory, free_extra_list): Likewise. * src/fontdata.c (initialize_menu_font, uninit_fonts): Likewise. * src/hedlite.c (save_pcx, outwayinit, free_levels_output_dir, hmain): Likewise. * src/heroes.c (init_buffers, load_level, compute_level_full_list, read_level_list): Likewise. * src/intro.c (show_intro): Likewise. * src/menus.c (editor_menu): Likewise. * src/misc.c (strcat_alloc, strappend): Likewise. * src/musicfiles.c (sound_track_cons, dir_name): Likewise. * src/pcx.c (img_init): Likewise. * src/renderdata.c (init_render_data): Likewise. * src/rleprog.c (compile_rleprog): Likewise. * src/rsc_files.c (set_rsc_file, rsc_expand, get_rsc_file): Likewise. * src/sfx.c (_load_sfx, close_sfx_handle): Likewise. * src/source.c [HAVE_LIBMIKMOD] (decode_sound_options): Likewise. * src/timer.c (new_htimer, free_htimer): Likewise. * src/userconf.c (read_userconf): Likewise. Misc fixes. * src/heroes.c (free_level_full_list, load_random_level): Enhance error message. * src/pcx.c (pcx_load_from_rsc): Use get_non_null_rsc_file. * src/rsc_files.c (get_non_null_rsc_file): Also ensure that the resulting string is not empty. 2000-10-31 Alexandre Duret-Lutz Rename common.h into system.h for consistency with other existing packages. * src/common.h: Move to ... * src/system.h: ... here. ADAPT ALL REFERENCES. * HACKING: Reflect change. * src/Makefile.am (heroes_SOURCES): Remove common.h, add system.h. Add new files to the 'stolen-code' repository. * configure.in: Check for malloc, realloc, strerror, and strerror_r. * lib/Makefile.am (EXTRA_DIST): Add malloc.c, realloc.c, strndup.c. (noinst_HEADERS): Add error.h, fstrcmp.h, and xalloc.h. (INCLUDES): Add -I$(top_srcdir)/src. (libheroes_a_SOURCES): Add error.c, fstrcmp.c and, xmalloc.c. * lib/error.c: New file. * lib/error.h: New file. * lib/fstrcmp.c: New file. * lib/fstrcmp.h: New file. * lib/malloc.c: New file. * lib/realloc.c: New file. * lib/strcasecmp.c: New file (overwrite existing file). * lib/strndup.c: New file. * lib/xalloc.h: New file. * lib/xmalloc.c: New file. * m4/Makefile.am (EXTRA_DIST): Add malloc.m4 and realloc.m4. * m4/malloc.m4: New file. * m4/realloc.m4: New file. * src/debugmsg.c (progname): Rename into ... (program_name): ... this. To please error.c. (dmsg, dperror): Adapt to use program_name. * src/errors.c (emsg, wmsg): Likewise. Give better error message, by detecting possible misspelling of resource names. * src/rsc_files.c (check_rsc_spelling_error): New. (set_rsc_file, get_rsc_file): Use it. * src/rsc_files.gperf (get_rsc_approx): New. * src/rsc_files_hash.h (get_rsc_approx): New. 2000-10-31 Alexandre Duret-Lutz Remove auto-installed files from CVS. Arrange so most of auto-installed file go in tools/, not in the base directory. * COPYING: Delete. * INSTALL: Delete. * depcomp: Delete. * config.guess: Delete. * config.sub: Delete. * install-sh: Delete. * missing: Delete. * mkinstalldirs: Delete. * doc/texinfo.tex: Delete. * doc/mdate-sh: Delete. * tools/autogen.sh: New. * tools/Makefile.am: New. * HACKING: Reflect changes. * Makefile.am (SUBDIRS): Add tools. * acconfig.h: Delete. * configure.in: Use AH_TEMPLATE to describe the DEFINEs originaly described in acconfig.h 2000-10-30 Alexandre Duret-Lutz * src/render.c (draw_level): Use correct source buffer width when drawing sprites. 2000-10-30 Alexandre Duret-Lutz Move bonuses handling in separate files. * src/bonus.c: New file. * src/bonus.h: New file. * src/Makefile.am (heroes_SOURCES): Add bonus.c and bonus.h. * src/const.c (bonus_proba_array, bonus_points, bonus_a_img, bonus_b_img, tile_bonus, tile_bonus_cpu, bonus_time, bonus_list, bonus_total_nbr, bonus_real_nbr, next_bonus_to_update, bonus_anim_offset): Move to bonus.c and bonus.h. * src/const.h: Likewise. * src/heroes.c (bonus_proba, bonus_proba_sum, txt_bonus, txt_bonus_tempo, bonus_anim_htimer, random_bonus, add_bonus, add_random_bonus, rem_bonus, _bonus, update_bonus): Move to bonus.c and bonus.h. (load_level): Adapt to call init_bonuses_level. (unload_level): Adapt to call uninit_bonuses_level. (grow_trail, shrink_trail): Remove static. (update_player): Call apply_bonus instead of _bonus, set_txt_bonus intead of draw_txt_bonus. Adapt to call update_player_bonus_vars. (update_all): Call update_bonuses instead of update_bonus. (main): Adapt to call init_bonus and uninit_bonus. * src/heroes.h (level_is_finished,grow_trail,shrink_trail): Export. * src/render.c: Include bonus.h. Create a debuging channel for bonuses. * doc/heroes.texi (Environment): Document BONUS. * src/debugmsg.c (dmsg_parse_string): Recognize "bonus". * src/debugmsg.h (debug_lvl): Add D_BONUS. 2000-10-30 Alexandre Duret-Lutz * ChangeLog: Cleanups. 2000-10-30 Alexandre Duret-Lutz Use a separate struct to hold the information needed to render the foreground sprites and bonuses. * src/renderdata.h (fg_data_t, fg_data): New. * src/renderdata.c (fg_data): New. (init_render_data, uninit_render_data): Handle fg_data. * src/const.h (bonus_ptr): Remove. (bonus_list): New. * src/const.c: Likewise. * src/heroes.c (add_bonus): Adapt to use bonus_list and update fg_data. (rem_bonus, update_bonus): Likewise. (add_random_bonus): Call add_bonus. (load_level, unload_level): Use bonus_list instead of bonus_ptr. * src/render.c (copy_tile_transp): Rewrite to take a source pointer and the source image width as argument. (draw_bonus): Remove (use copy_tile_transp instead), but move the dollar drawing part into ... (draw_dollar): ... this new function. (draw_level): Use fg_data. 2000-10-29 Alexandre Duret-Lutz Use a separate struct to hold the information needed to render the background tiles. * src/renderdata.c: New file. * src/renderdata.h: New file. * src/Makefile.in (heroes_SOURCES): Add renderdata.h and renderdata.c. * src/heroes.c (load_level): Call init_render_data. * src/heroes.h (unload_level): Call uninit_render_data. * src/render.c (draw_level): Draw background tiles using bg_data. 2000-10-27 Alexandre Duret-Lutz Old GCCs do not recognize -fstrict-aliasing, test this at configure-time. * m4/ac_adl_gcc_optim.m4: New file. * m4/Makefile.am (EXTRA_DIST): Add it. * configure.in: Used it. Misc errors. * m4/ac_adl_find_header.m4: Redirect possible complain of the compiler to /dev/null. * configure.in: Don't overwrite LDFLAGS with -g or -s, just append the option. * src/common.h: Use __attribute__ for gcc 2.7.x too. 2000-10-25 Alexandre Duret-Lutz Fix problems observed on Solaris. * src/visuals.c (corner_buffer_end): Use memset instead of a loop over a cast int* (caused BUS error). * m4/ac_adl_find_header.m4: Remove buggy redirection (caused configure to abort). 2000-10-22 Alexandre Duret-Lutz * src/errors.c (emsg): Thinko. 2000-10-22 Alexandre Duret-Lutz Error introduced by the renaming of getopt.h into gnugetopt.h. * lib/getopt.c: Include gnugetopt.h. * lib/getopt1.c: Likewise. 2000-10-20 Alexandre Duret-Lutz * configure.in: Add --enable-gprof. * doc/heroes.texi (configure options): Document --enable-gprof. 2000-10-20 Alexandre Duret-Lutz Copyright pedantry, follow the FSF guidelines. * Makefile.am: Remove the `(C)' glyph which has no legal meaning. * configure.in: Likewise. * arch/Makefile.am: Likewise. * doc/Makefile.am: Likewise. * doc/heroes.texi: Likewise. * lib/Makefile.am: Likewise. * lib/strcasecmp.c: Likewise. * m4/Makefile.am: Likewise. * man/Makefile.am: Likewise. * src/Makefile.am: Likewise. * src/argv.c: Likewise. * src/argv.h: Likewise. * src/common.h: Likewise. * src/const.c: Likewise. * src/const.h: Likewise. * src/debugmsg.c: Likewise. * src/debugmsg.h: Likewise. * src/display.c: Likewise. * src/display.h: Likewise. * src/draw.c: Likewise. * src/draw.h: Likewise. * src/endian.h: Likewise. * src/endscroll.c: Likewise. * src/endscroll.h: Likewise. * src/errors.c: Likewise. * src/errors.h: Likewise. * src/extras.c: Likewise. * src/extras.h: Likewise. * src/fader.c: Likewise. * src/fader.h: Likewise. * src/fastmem.h: Likewise. * src/font.h: Likewise. * src/font_deck.h: Likewise. * src/font_help.h: Likewise. * src/font_menu.h: Likewise. * src/fontdata.c: Likewise. * src/fontdata.h: Likewise. * src/generic_list.h: Likewise. * src/gfx_reader.h: Likewise. * src/hedlite.c: Likewise. * src/hedlite.h: Likewise. * src/hendian.c: Likewise. * src/hendian.h: Likewise. * src/heroes.c: Likewise. * src/heroes.h: Likewise. * src/intro.c: Likewise. * src/intro.h: Likewise. * src/joystick.c: Likewise. * src/joystick.h: Likewise. * src/keyb.c: Likewise. * src/keyb.h: Likewise. * src/keys_heroes.h: Likewise. * src/keysdef.c: Likewise. * src/keysdef.h: Likewise. * src/menus.c: Likewise. * src/menus.h: Likewise. * src/misc.c: Likewise. * src/misc.h: Likewise. * src/musicfiles.c: Likewise. * src/musicfiles.h: Likewise. * src/options.c: Likewise. * src/options.h: Likewise. * src/pcx.c: Likewise. * src/pcx.h: Likewise. * src/pixelize.c: Likewise. * src/pixelize.h: Likewise. * src/render.c: Likewise. * src/render.h: Likewise. * src/rleprog.c: Likewise. * src/rleprog.h: Likewise. * src/rletext.c: Likewise. * src/rletext.h: Likewise. * src/rsc_files.c: Likewise. * src/rsc_files.h: Likewise. * src/rsc_files_hash.h: Likewise. * src/savegame.c: Likewise. * src/savegame.h: Likewise. * src/scores.c: Likewise. * src/scores.h: Likewise. * src/scrtools.c: Likewise. * src/scrtools.h: Likewise. * src/sfx.c: Likewise. * src/sfx.h: Likewise. * src/sound.c: Likewise. * src/sound.h: Likewise. * src/structs.h: Likewise. * src/timer.c: Likewise. * src/timer.h: Likewise. * src/txts.c: Likewise. * src/txts.h: Likewise. * src/userconf.c: Likewise. * src/userconf.h: Likewise. * src/userdir.c: Likewise. * src/userdir.h: Likewise. * src/visuals.c: Likewise. * src/visuals.h: Likewise. * src/etc/Makefile.am: Likewise. * src/txt_cfg/Makefile.am: Likewise. * m4/ac_adl_find_header.m4: Fix email address. 2000-10-20 Alexandre Duret-Lutz * configure.in: Set version to 0.6d. 2000-10-19 Alexandre Duret-Lutz * NEWS: Update for snapshot 0.6c. 2000-10-19 Alexandre Duret-Lutz Handle --list to list various internal information such as resources or sound drivers (this supercede --drivers-info). * doc/heroes.texi: Document -l. Remove -n. Say the $HOME is used. Adapt the description of `setrsc' to point the user to `--list=resources'. * src/Makefile.am (rsc_files_hash.c): Generate ANSI-C, and a global hash table. * src/argv.c (list): New. (print_help): Add -l, remove -n. (long_options): Add --list. Sort all entries. --load is now -L. (parse_argv): Rename -l as -L, add -l. * src/rsc_files.gperf (data-dir, home-dir): Provide default nice to print with --list=resources. (print_rsc_files): New. * src/rsc_files_hash.h (print_rsc_files): New. 2000-10-19 Alexandre Duret-Lutz Store the user config filename in a resource. * src/rsc_files.gperf (heroesrc-txt): Rename to ... (system-conf): ... this. (user-conf): New. * src/heroes.c (main): Adapt to use new resources. * src/userconf.c (read_userconf): Don't try to build the user config filename, always use the supplied file. 2000-10-19 Alexandre Duret-Lutz * src/const.c (radar_trail_color, radar_wall_color, draw_glenz_box): Fix signedness. (glenz): Use pixel_t. * src/const.h: Likewise. 2000-10-19 Alexandre Duret-Lutz Remove most warnings from src/hedlite.c. * src/hedlite.c (partiel4,cadre,cadrept): Fix prototype. (dalletranspc): Rename to ... (copy_tile_transp_pcx): ... this, adjust callers. (sousdalletranspc): Rename to ... (copy_square_transp_pcx): ... this, adjust callers. (cadre,cadrept): Rename to ... (frame,framept): ... these, adjust callers. (partiel4,copy_tile,partiel4c,copy_tile_transp, copy_square_transp,copy_tile_transp_pcx,partiel2,frame, framept,draw_text,transpa,transpac,carre,affgt,majd, write_rle,save_pcx,planfull,joueanim): Fix signedness issues. (hmain): Fix an error introduced in recent prototype change (on 2000-10-10). 2000-10-18 Alexandre Duret-Lutz Factor the handling of vertical movements in menus. Reverse responses in the quit menu. * src/menus.c (move_updown): New. (control_menu, keyboard_menu, sound_menu, screen_menu, game_menu, option_menu, quit_menu): Adapt to use move_updown. (screen_menu): Reorganize key handling. (draw_quit_menu): Reverse the proposition order. (background_menu, sound_menu, screen_menu, game_menu, extra_menu, option_menu, draw_quit_menu, quit_menu, draw_play_menu, draw_main_menu, editor_first_menu, draw_saved_games_info): Change type of l from char to int. (init_menus_sprites): Typo. * src/menus.h (draw_play_menu,draw_quit_menu, draw_saved_games_info): Likewise. * src/heroes.c (main_menu): Adapt to new order of draw_quit_menu. 2000-10-18 Alexandre Duret-Lutz Regroup waving arrows logic into one function. * src/menus.c (waving_arrows): New. (option_menu, quit_menu, draw_play_menu, draw_main_menu, editor_selector, editor_first_menu): Use waving_arrows. 2000-10-18 Alexandre Duret-Lutz Draw horiwontal rules using hrule. * src/menus.c (horizontal_rule): New. (init_menus_sprites): Initialize horizontal_rule. (uninit_menus_sprites): Uninitialize it. (hrule): New. (background_menu,extra_menu,option_menu,draw_play_menu, draw_main_menu,editor_selector): Use hrule. 2000-10-18 Alexandre Duret-Lutz rletextize the extra menu. * src/menus.c (extra_menu_txt,extra_modes_txt,extra_combine_txt): New. (init_menus_sprites): Initialize the above variables. (uninit_menus_sprites): Free them. (extra_menu): Use them. Use a local array of rleprogs for the filenames. Make 7 levels jumps on pugeup/pagedown (was 10). 2000-10-18 Alexandre Duret-Lutz Use a rleprog_t to display the rounds number too. * src/menus.c (game_rounds_txt): New. (uninit_menus_sprites): Free game_rounds_txt. (game_menu): Handle game_rounds_txt. 2000-10-17 Alexandre Duret-Lutz Use keycode_t when handling key codes. * src/common.h (keycode_t): New. * src/const.h (get_key_or_joy): Return keycode_t. * src/const.c (get_key_or_joy): Likewise. * src/keyb.h (get_key): Likewise. * src/keyb.c [HAVE_PKG_GGI,HAVE_SDL] (get_key): Likewise. * src/gfx_reader.h (show_help): Use keycode_t. * src/heroes.c (jukebox_menu, enter_your_name, play_menu, load_demo, main_menu, pause_menu): Likewise. * src/keysdef.h (keynames_s): Likewise. * src/menus.c (control_menu, keyboard_menu, sound_menu, screen_menu, quit_menu): Likewise. * src/options.h (options_t): Document that player_key should be keycode_t. Less warnings. * src/menus.c (extra_menu,editor_selector): Fix comparisons between signed and unsigned. 2000-10-17 Alexandre Duret-Lutz Miscellaneous warning fixes * src/fontdata.c (compute_text_width): Cast *text indice to int. * src/rsc_files_hash.h (rsc_file): Replace the modified flag by a modified_value string. The initial value will never be modified. * src/rsc_files.c (set_rsc_file,get_rsc_file): Use modified_value. * src/rsc_files.gperf: Prototype hash. * src/timer.c (new_htimer): Fix dmsg format. 2000-10-17 Alexandre Duret-Lutz Adapt keyboard_menu to use rleprogs. * src/menus.c (keyboard_menu_txt, keyboard_keys_txt): New. (init_menus_sprites): Initialize keyboard_menu_txt. (uninit_menus_sprites): Free keyboard_menu_txt and keyboard_keys_txt. (draw_key): Remove (insert in next function). (keyboard_menu): Adapt to use keyboard_menu_txt and keyboard_keys_txt. 2000-10-16 Alexandre Duret-Lutz * src/menus.c (cursor_bg,cursor_fg,control_menu_txt,sound_menu_txt, music_vol_txt, sfx_vol_txt, screen_menu_txt, game_menu_txt): New. (init_menus_sprites): Initialize the above RLE-programs. (uninit_menus_sprites): Free them. (cursor): New. (sound_menu, screen_menu, game_menu): Adapt to use cursor, and the new _txt RLE-programs. 2000-10-16 Alexandre Duret-Lutz Support for waving strings in rletext. Try it in control menu. * src/draw.c (text_waving_htimer): Declare static. * src/draw.h (text_waving_step): Declare extern. * src/menus.c (control_menu_text): Rename into ... (control_menu_txt): ... this. (init_menus_sprites): Generate waving control_menu text. (control_menu): Don't draw waving text (already done). * src/rleprog.h (rleprog_s): Add line_size, func_offset, func_data. Change signedness of dest_offset (now signed). * src/rleprog.c (unclipped_run): Handle func_offset. (compile_rleprog): Reset line_size, func_offset, and func_data. * src/rletext.c (waving_offset): New. (compile_rletext): Handle T_WAVING. 2000-10-16 Alexandre Duret-Lutz Support for generating RLE-programs from strings to display. Try it in control menu. * src/fontdata.h: New file. * src/fontdata.c: New file. * src/rletext.h: New file. * src/rletext.c: New file. * src/Makefile.am (heroes_SOURCES): Add fontdata.h, fontdata.c, rletext.c, and rletext.h. * arch/VisualC/heroes.dsp: Likewise. Fix to use getshline.c from ../lib/. Use gnugetopt.h instead of getopt.h. * src/heroes.c (main): Call init_fonts and uninit_fonts. * src/menus.c (init_menus_sprites): Generate a RLE-program for the control menu text. (uninit_menus_sprites): Free it. (control_menu): Use it. * src/rleprog.h (rleprog_s): Add attribute latest_known. (concat_rleprog): New. * src/rleprog.c (compile_rleprog): Zero latest_known. (free_rleprog): Cosmetic. (concat_rleprog): New. 2000-10-11 Alexandre Duret-Lutz Remove most warning from src/intro.c. * src/intro.c (erase_data,erase_data_cur,erase_color_ptr): Use pixel_t. (i): Remove. (compute_erase_data,erase,antialias): Use pixel_t. (show_intro): Declare i. Rewrite the set_pal calls. (play_intro): Remove i. Rewrite the set_pal calls. 2000-10-11 Alexandre Duret-Lutz Use named values instead of 0xffffffff. * configure.in (FLAGS): Remove -Wtraditional. * src/common.h (U32_MAX): New. * src/structs.h (DONT_WRAP): New. * src/hedlite.c (tempd, tunnel_mod, curdallepg, curdalleph, curdallepd, curdallepb, planfull, outwayflag, gestclav, hmain): Use DONT_WRAP. * src/render.c (draw_level): Likewise. * src/heroes.c (load_level, compute_corner) Likewise. (ia_eval_neighb_pos, ia_goto_target, update_lemmings): Use U32_MAX. 2000-10-11 Alexandre Duret-Lutz Remove more warnings. * src/draw.h (draw_text, draw_text_clipped_left, draw_text_clipped_right, draw_text_waving, draw_text_320, draw_text_waving_320, draw_text_array, draw_text_array_320, draw_text_bonus, draw_deck_text): Fix signedness and use `text' instead of `texte'. * src/draw.c (draw_text, draw_text_clipped_left, draw_text_clipped_right, draw_text_waving, draw_text_320, draw_text_waving_320, draw_text_array, draw_text_array_320, draw_text_bonus, draw_deck_text): Likewise. * src/heroes.c (add_random_bonus,add_bonus, compute_level_full_list,output_screen): Fix signedness. (load_level): Fix dmsg format. (draw_round_info,play_game): Use temporary variables with a correct type to avoid casts. * src/pixelize.c (pixelize_1, pixelize_2_inline, pixelize_2, pixelize_4_inline, pixelize_4, pixelize_8_inline, pixelize_8, pixelize_16_inline, pixelize_16_inline_2, pixelize_16, pixelize_32_inline, pixelize_32_inline_2, pixelize_64_inline, pixel_64_inline_2, pixelize_64, pixelize): Fix constness, signedness, use pixel_t. 2000-10-10 Alexandre Duret-Lutz Fix warnings from gfx_reader.h. * src/endscroll.c (scroll_buffer,page): Use pixel_t*. (colors): Remove. (copy_background,draw_background): Adapt signedness and constness. (end_scroll): Don't free colors. * src/gfx_reader.h: Include scrtools (declare vsynch). (txtptr,strptr): Use u8_t. (copy_rect_transp_help,copy_rect_transp_help_with_glenz, copy_rect_transp_help_full_glenz,draw_text_help): Adapt signedness and constness. (show_help): Rename glenz into glenz_color. Fix signedness. 2000-10-10 Alexandre Duret-Lutz Remove the tmp1 and tmp2 global variables. Change the hmain prototype. * src/const.h (tmp1,tmp2): Remove. * src/const.c (tmp1,tmp2): Remove. * src/hedlite.c (hmain): Change prototype, and adapt body. * src/hedlite.h (hmain): Change prototype. * src/heroes.c (enter_your_name): Take the buffer to write to as argument. Use memset. (play_menu): Adapt call to enter_your_name. (scores_menu, draw_end_level_info, draw_text_waving, draw_end_level_info, draw_round_info): Use local buffers. * src/render.c (draw_score): Likewise. * src/menus.c (draw_key, game_menu, extra_menu, editor_selector,editor_menu): Likewise. (editor_selector,editor_menu): Adapt call to hmain. * src/structs.h (FILENAME_SIZE,PLAYER_NAME_SIZE): New. (level_header_t): Use FILENAME_SIZE. (top_score): Use PLAYER_NAME_SIZE. 2000-10-10 Alexandre Duret-Lutz Fix most warnings of src/render.h. * src/const.h (clock_anim_offset): Declare as pixel_t*. * src/const.c (clock_anim_offset): Likewise. * src/draw.h (draw_demo_stick): Fix argument constness. * src/draw.c (draw_demo_stick): Likewise. * src/render.c (copy_tile, copy_tile_transp, draw_bonus, copy_square_transp, draw_trail_real, draw_vehicle_tail, draw_vehicle_head, draw_trail, copy_lemming_transp, draw_color, draw_cash, draw_lemming, copy_dead_lemming_transp, draw_dead_lemming, draw_level, draw_radar_map, draw_score, draw_logo_info, display_buffer_tmp1, display_buffer_moving, display_two_buffers, display_two_buffers_moving, display_two_buffers_moving_and_clear): Fix constness and signedness. * src/render.h (draw_score,draw_logo_info): Use pixel_t*. 2000-10-10 Alexandre Duret-Lutz * HACKING: New file. * Makefile.am (EXTRA_DIST): Add HACKING. 2000-10-08 Alexandre Duret-Lutz Fix signedness warnings in visuals.[hc]. * src/visuals.h (srcroto): Declare as pixel_t*. * src/visuals.c (srcroto): Likewise. (rotozoom_buffer, rotozoom_half_buffer, horizontal_zoom_wave, horizontal_zoom_flip, vertical_zoom_wave, wave_buffer, wave_half_buffer, corner_buffer_begin, corner_buffer_middle, corner_buffer_end): Adapt to use pixel_t, u8_t and u32_t. 2000-10-08 Alexandre Duret-Lutz * src/keysdef.h (keyname_s): Fix constness. * src/structs.h (type_name): Likewise. * src/hedlite.c (draw_text,fatalog): Likewise. * src/sound.h (load_soundtrack_from_alias): Likewise. * src/sound.c [*] (load_soundtrack_from_alias): Likewise. * src/hedlite.h (free_levels_output_dir): Likewise. * src/hedlite.c (free_levels_output_dir): Likewise. * src/rsc_files_hash.h (rsc_file): Likewise. * src/scores.c (cmp_scores): Likewise. 2000-10-08 Alexandre Duret-Lutz Add support for RLEncoded sprites. * src/rleprog.h: New file. * src/rleprog.c: New file. * src/Makefile.am (heroes_SOURCES): Add src/rleprog.h and src/rleprog.c. * arch/VisualC/heroes.dsp: Likewise. Use this new feature to draw the arrows and checked boxes. * src/menus.h (left_arrow,right_arrow): New. (init_menus_sprites,uninit_menus_sprites): New. * src/menus.c (left_arrow,right_arrow,checked_box): New. (init_menus_sprites,uninit_menus_sprites,arrows,chkbox): New. (control_menu,keyboard_menu,sound_menu,screen_menu,game_menu, extra_menu,option_menu,draw_quit_menu,draw_play_menu,draw_main_menu, editor_selector,editor_first_menu): Adapt to use arrows and chkbox. (draw_saved_games_info): Adapt to use left_arrow and right_arrow. * src/heroes.c (draw_end_level_info): Likewise. (main): Call init_menus_sprites and uninit_menus_sprites. Misc. * src/sound.c (decode_sound_options): Typo. * src/pcx.h (IMGPOS): New macro. (pcx_header_t,color_rvb_t,palette_t,pcx_image_t): Use u8_t and u16_t. * src/pcx.c (delta,pcx_load): Adapt to use pixel_t and u8_t. * src/const.h (corner,render_buffer): Use type pixel_t. * src/const.c (corner,render_buffer): Likewise. * configure.in: Remove -Wconversion and explain why. 2000-10-07 Alexandre Duret-Lutz * src/scrtools.c: New file. * src/scrtools.h: New file. * src/Makefile.am (heroes_SOURCES): Add scrtools.c and scrtools.h. Remove mikmod.h. * arch/VisualC/heroes.dsp: Likewise. * src/const.h (vsynch,set_pal_with_luminance) Move to src/scrtools.h. * src/const.c (vsynch,set_pal_with_luminance) Move to src/scrtools.c, and fix constness and signedness issues. * src/pcx.h (palette_rvb): Remove. (color_): Rename to ... (color_rvb_t): ... this. * src/pcx.c (pcx_load): Typo. * src/display.h (pixel_t): New. (screen): Use pixel_t* as type. (set_pal): Set constness of the first argument. * src/display.c (screen_rv, screen, stretch_twofold, stretch_twofold_even, stretch_threefold, stretch_threefold_even, erase_odd_lines, copy_screen): Adapt to use pixel_t. [HAVE_PKG_GII,HAVE_SDL] (set_pal): Set constness of the first arg. * src/hedlite.c: Replace header_ by pcx_header_t, image_ by pcx_image_t, palette_ by palette_t. * src/heroes.c: Likewise. * src/pcx.c: Likewise. * src/pcx.h: Likewise. * src/const.c: Likewise. * src/const.h: Likewise. * src/endscroll.c: Likewise. * src/gfx_reader.h: Likewise. * src/intro.c: Likewise. * src/menus.c: Likewise. * src/fader.c: Likewise. * src/fader.h: Likewise. 2000-10-07 Alexandre Duret-Lutz * lib/getshline.c (getshstr): Change terminator type to suppress warnings. 2000-10-07 Alexandre Duret-Lutz * src/errors.c (emsg): Bug fix: exit the game even if error messages are disabled. 2000-10-07 Alexandre Duret-Lutz FreeBSD has getopt_long in the gnugetopt library. Moreover we don't want to use our own getopt.h header when getopt_long is already available on the build system. The FreeBSD part is untested. * configure.in: Check for getopt.h. Check for getopt_long, which might be available in the gnugetopt library. AC_LIBOBJ the replacements when needed. * lib/getopt.h: Move ... * lib/gnugetopt.h: ... here to avoid conflict with existing getopt.h. * lib/Makefile.am (EXTRA_DIST): Add getopt.c and getopt1.c. (HEADERS): Rename getopt.h into gnugetopt.h. (libheroes_a_SOURCES): Remove getopt.c and getopt1.c. * arch/VisualC/heroes.dsp: Rename getopt.h into gnugetopt.h. * src/argv.c: Do not include getopt.h. * src/common.h: Include getopt.h or gnugetopt.h. 2000-10-05 Alexandre Duret-Lutz * src/VisualC/config.h (HAVE_READDIR): Comment out. * src/VisualC/heroes.dsp: Define HAVE_CONFIG_H, and remove mikmod.h. 2000-10-05 Alexandre Duret-Lutz Fix VPATH build failure (caused `make distcheck' to fail). * arch/Makefile.am (Vzip): New. (EXTRA_DIST,distclean-local): Use $(Vzip). (VisualC/VisualC.zip): Rename to ... ($(Vzip)): ... this. Build in $(srcdir). (VisualC/config.cp): Build $(VSIP) in $(srcdir). (VisualC/config.h): Depend upon configure which is distributed, not Makefile which is generated. Ensure that configure is newer than the target, because the creation of config.cp can trigger the rule anyway. 2000-10-05 Alexandre Duret-Lutz * configure.in: Set version to 0.6c. 2000-10-04 Alexandre Duret-Lutz * README: Update from Texinfo documentation. * NEWS: Update from * configure.in (GGI_KEYBOARD_H): Typo. * m4/Makefile.am (EXTRA_DIST): Typo. 2000-10-04 Alexandre Duret-Lutz Include VicualC project files, from Stéphane Denis. * arch/Makefile.am: New. * arch/VisualC/config.h: New file. * arch/VisualC/keysdef-inc.h: New file. * arch/VisualC/heroes.dsp: New file, from Stéphane Denis. * arch/VisualC/heroes.dsw: New file, from Stéphane Denis. * arch/VisualC/README.html: New file, from Stéphane Denis. * arch/VisualC/README.txt: New file. * configure.in: Check for zip and unzip. Generate arch/Makefile. * Makefile.am (SUBDIRS): Add arch. 2000-10-04 Alexandre Duret-Lutz Define and use macros for common __attribute__ stuffs. * src/common.h (__attribute__,ATTRIBUTE_NORETURN,ATTRIBUTE_UNUSED, ATTRIBUTE_PRINTF): New. * src/debugmsg.h (dmsg): Use the above macro(s). * src/errors.h (wmsg,emsg,exit_heroes): Likewise. * src/hedlite.c (fn0,tunnel_mod,hmain): Likewise. * src/options.h (options_t): Likewise. * src/pcx.h (header_): Likewise. * src/sfx.c [!HAVE_LIBMIKMOD] [!HAVE_LIBSDL_MIXER] (load_sfx_mode,event_sfx): Likewise. * src/sound.c [HAVE_LIBMIKMOD] (update_thread): Likewise. [!HAVE_LIBSDL_MIXER] [!HAVE_LIBMIKMOD] (load_soundtrack, decode_sound_options,load_soundtrack_from_alias): Likewise. * src/structs.h (tunnel_t,anim_t,param_t,tile_t, tile_info_t,level_header_t,top_score,saved_game): Likewise. 2000-10-03 Alexandre Duret-Lutz Extract autoconf macro definitions from acinclude.m4 and configure.in and move them to the new m4/ directory. Some macro coming from the autoconf archive have been patched to use AC_STRING_HELP, the macro marked "bug fix" were bugged in their original version (patches sent to authors). * acinclude.m4: Delete (contents moved to m4/). * m4/ac_adl_find_header.m4: New file. * m4/ac_adl_pkg_generic.m4: New file. * m4/ac_c_bigendian_cross.m4: New file (bug fix). * m4/ac_caolan_check_package.m4: New file (bug fix). * m4/ac_define_dir.m4: New file. * m4/ac_func_mkdir.m4: New file. * m4/generic-config.m4: New file. * m4/Makefile.am: New file. * configure.in: Don't test for perl (unused). Adapt to use AC_adl_FIND_HEADER to check for ggi/keyboard.h and SDL_keysyms.h. Check endianess using AC_C_BIGENDIAN_CROSS. Check for mkdir using AC_FUNC_MKDIR. Generate m4/Makefile. * src/common.h: Use HAVE__MKDIR. * Makefile.am (ACLOCAL_AMFLAGS): New. (SUBDIRS): Add m4. 2000-09-29 Alexandre Duret-Lutz Revise handling of file saved by the game (options, games, scores). Use resources instead of configure-time option. * configure.in: Remove handling of --disable-user-config, --disable-user-scores and --disable-user-saves. Remove handling of obsolete directories. Fix help string for heroes-debug and mem-debug. * doc/heroes.texi (Options): Remove documentation of --disable-user-config,--disable-user-scores and --disable-user-saves. (Global score file): New section. * src/hedlite.c (create_levels_output_dir): Use $(hedlite-output-dir). (free_levels_output_dir): Reset freed pointer. * src/hedlite.h (hedlit_output_dir): Remove. * src/heroes.c (main): Set $(home-dir). * src/options.c (options_file): Use $(options-file). (free_options): Reset freed pointer. * src/rsc_files.gperf (games-file,hedlite-output-dir,home-dir, options-file,scores-file,user-dir): New. * src/savegame.c (saves_file): Use $(games-file). (free_save_records): Reset freed pointer. * src/scores.c (scores_file): Use $(scores-file). (free_scores): Reset freed pointer. * src/userdir.c (DIR_NAME): Remove. (exists_dir): Use dperror instead of perror. (setup_userdir): Use $(user-dir). (free_userdir): Reset freed pointer. * src/etc/Makefile.am (xdir): Don't use etcdir. * src/etc/heroesrc: Give example of redefinition of $(options-file), $(scores-file) and $(games-file). * src/txt_cfg/Makefile.am (xdir,ydir): Remove. (zdir): Don't use textdir. 2000-09-28 Alexandre Duret-Lutz Add option --verbose (same purpose as HEROES_DEBUG). * doc/heroes.texi (Options): Document. * src/argv.c (print_help): Add --verbose. (long_options): Likewise. (parse_argv): Handle it. * src/debugmsg.c (dmsg_init): Split into ... (dmsg_init,dmsg_parse_string): ... this two functions. Adapt to use wmsg. * src/debugmsg.h (dmsg_parse_string): New. 2000-09-28 Alexandre Duret-Lutz Rename -q into -i, and add -q and -Q to disable warning and error messages. * doc/heroes.texi (Options): Document new options. * src/errors.h (disable_emsg,disable_wmsg): New. * src/errors.h (disable_emsg,disable_wmsg): New. (emsg,wmsg): Use disable_emsg and disable_wmsg. * src/argv.c (print_help): Rename -i into -q, add -q and -Q. (long_options): Add quiet and really-quiet. Fix some buggy options (driver, full-screen). (parse_argv): Handle new options. 2000-09-27 Alexandre Duret-Lutz Add wmsg and emsg, for warning and error messages. Use them. * src/errors.c (fatal_error): Delete. (wmsg,emsg): New. * src/errors.h: Likewise. * src/heroes.c (load_level_from_number, init_buffers, load_random_wrapped_level, load_random_level, play_game, read_level_list, main): Use emsg instead of fatal_error. * src/pcx.c (img_init,pcx_load,pcx_load_from_rsc): Likewise. * src/hedlite.c (fatalog): Likewise. * src/sfx.c (load_sfx_mode): Likewise. * src/txts.c (read_txti_cfg): Likewise. * src/display.c (init_video): Use emsg instead of *printf. (init_video): Likewise. * src/joystick.c [HAVE_PKG_GII] (_get_joystick_state): Use wmsg instead of fprintf. * src/joystick.c (joyinit): Use wmsg instead of puts. * src/musicfiles.c (read_sound_config_file): Use wmsg instead of fprintf. * src/rsc_files.c (set_rsc_file,get_rsc_file): Likewise. * src/sfx.c (read_sfx_conf): Likewise. * src/sound.c [HAVE_LIBMIKMOD] (init_sound_engine, load_soundtrack, get_int): Likewise. [HAVE_LIBSDL_MIXER] (init_sound_engine, load_soundtrack, print_drivers_list, decode_sound_options): Likewise. [] (print_drivers_list): Likewise. * src/userconf.c (read_userconf): Likewise. * src/userdir.c (exists_dir): Likewise. (setup_userdir): Likewise. 2000-09-27 Alexandre Duret-Lutz Introduce fader to handle palette fadings automatically. * src/fader.h: New. * src/fader.c: New. * src/Makefile.am (heroes_SOURCES): Add fader.h and fader.c. * src/debugmsg.h (debug_lvl): Add D_FADER. * src/debugmsg.c (dmsg_init): Handle FADER. * doc/heroes.texi (Environment): Documents FADER. * src/heroes.h (fading_timer): Remove (now useless). * src/heroes.c (fading_timer): Likewise. (quit_yes_no): Don't reset fading_timer. (main): Call (un)init_fader instead of (un)initializing fading_timer. Call update_htimers() before runing main_menu. * src/const.c (p,p2,pal2pal): Delete. * src/const.h (p,p2,pal2pal): Likewise. * src/endscroll.c (set_pal_fade): Remove (useless). (end_scroll): Don't reset p. * src/gfx_reader.h (show_help): Adapt to use fader. * src/intro.c (play_intro,show_intro): Likewise. * src/heroes.c (jukebox_menu): Likewise. (enter_your_name,main_menu): Likewise. Use a timer for the pixelize effect. (play_menu): Adapt likewise. Use a timer for the flipping effect. (play_demo,play_game): Use local variables instead of p2. * src/menus.c (background_menu): Don't handle fading anymore. (control_menu, keyboard_menu, sound_menu, screen_menu, game_menu, extra_menu, quit_menu, option_menu, draw_play_menu, draw_main_menu, editor_selector, editor_menu, draw_saved_games_info): Adapt to use fader. Rename argument to remove a warning. * src/sound.c (decode_sound_options): Rename optarg to options_string. * src/sound.h (decode_sound_options): Likewise. Misc. * src/menus.c (demo_info): Remove (obsolete). * src/menus.h (demo_info): Likewise. 2000-09-24 Alexandre Duret-Lutz Suppress some warnings. * src/debugmsg.c (dmsg): Take a constant message. * src/debugmsg.h (dmsg): Likewise. * configure.in (CFLAGS): Remove -ansi, for it is harmful. * src/extras.h (extra_nbr,extra_user_nbr): Declare unsigned. * src/extras.c (extra_nbr,extra_user_nbr): Likewise. (browse_extra_directory): Take an extradir_info_t struct instead of the first two arguments. (browse_extra_directories): Adapt call to browse_extra_directory. Declare i as unsigned. (free_extra_list): Declare i as unsigned. * src/generic_list.h (NEW_LIST_SPEC): Remove trailing semicolon. (NEW_LIST_BODY): Ada a dummy function declaration to eat a trailing semicolon. 2000-09-24 Alexandre Duret-Lutz Fix memory handling in src/extras.c (was leaking, and reallocating 0 sized buffers). * src/extras.c (browse_extra_directories): Don't reallocate extra_list and extra_selected_list of no extra level was found. (NEW_LIST(level)): Use free as destructor. 2000-09-24 Alexandre Duret-Lutz * src/timer.c (shift_htimer) [!HAVE_GETTIMEOFDAY]: Remove unused variable. 2000-09-24 Alexandre Duret-Lutz * configure.in: Check for direct.h and io.h. * lib/w_dirent.c: Don't include system headers, include common.h instead. * lib/w_dirent.h: Don't include io.h * src/common.h: Include io.h and direct.h. * lib/strcasecmp.c (strcasecmp): Return 0 if the two pointers are equal. 2000-09-24 Alexandre Duret-Lutz * configure.in: Check for mkdir. Check whether it takes only one argument instead of testing whether it takes two arguments. * src/common.h (mkdir): Define as a macro mkdir when needed. * src/hedlite.c (create_levels_output_dir): Remove TWO_ARGS_MKDIR conditional. * src/userdir.c (setup_userdir): Likewise. 2000-09-22 Alexandre Duret-Lutz * TODO (Before 0.7): Add new items, consequence of reports from Stéphane Denis . (Before 1.0.0): Add heroeslvl. * THANKS: Add cts. * BUGS: Update. 2000-09-21 Alexandre Duret-Lutz * doc/heroes.texi: Reword some passages, add comments, update URLs, mark the beginning of each node. * README-alpha: Revise. 2000-09-21 Alexandre Duret-Lutz Fix the tunnel bug noticed on Solaris by Mattias Engdegård . * src/structs.h [WORDS_BIGENDIAN] (tunnel_t): Reverse the bitfields. * BUGS: Remove the report. 2000-09-19 Uwe Hermann * configure.in [$GCC]: Add lots of gcc warning options. * src/options.c: Change C++-style comments to C-style comments. Translate a comment into english language. * src/const.c: Change C++-style comments to C-style comments. * src/const.h: Likewise. * src/endscroll.c: Likewise. * src/hedlite.c: Likewise. * src/heroes.c: Likewise. * src/menus.c: Likewise. * src/pcx.c: Likewise. * src/render.c: Likewise. * src/sound.c: Likewise. * src/txts.c: Likewise. * src/visuals.c: Likewise. 2000-09-19 Alexandre Duret-Lutz * configure.in: Set version to 0.6b. Prune useless files from the CVS tree. * aclocal.m4: Delete (autogenerated). * edit.pcx: Delete (useless). * file_id_.diz: Likewise. * finfo.pcx: Likewise. * fontem.pcx: Likewise. * hedlite_.doc: Likewise. * helpics.pcx: Likewise. * heroes.end: Likewise. * heroes.ord: Likewise. * heroes.sw: Likewise. * heroes_.doc: Likewise. * options.dat: Likewise. * run.dat: Likewise. * savegame.dat: Likewise. * scores.dat: Likewise. * starttxt.pcx: Likewise. 2000-09-18 Alexandre Duret-Lutz * configure.in: Set version to 0.6a. * README-alpha: New. * THANKS: Add Stéphane and Uwe. * doc/heroes.texi (Contributors): Likewise. (Bug Reporting): Typo. (History): Fix spelling. (configure options): Mark --with-sdl as @samp. Fix spelling. * README: Update from Texinfo documentation. * NEWS: Update. There is something strange with automake 1.4a. * doc/Makefile.am (htmldir): Rename to ... (hdir): ... this. And include back in the MAKE_HTML conditional. 2000-09-18 Alexandre Duret-Lutz Temporaly kluge hopping to work around MSVC (untested). * src/draw.c (Id): New. (draw_text,draw_text_clipped_left,draw_text_waving, draw_text_clipped_right): Use Id. 2000-09-18 Alexandre Duret-Lutz * configure.in: Check for sleep. * src/common.h [HAVE_WINDOWS] [!HAVE_SLEEP]: Use Sleep as a replacement for sleep (untested). 2000-09-18 Alexandre Duret-Lutz * configure.in: Use $host, not $target, when cross-compiling. 2000-09-18 Alexandre Duret-Lutz Provide opendir/readdir/closedir substitutes for plain Win32 (untested). * configure.in: Check for readdir. * lib/w_dirent.h: New file. * lib/w_dirent.c: New file. * lib/Makefile.am (EXTRA_DIST): Add w_dirent.c. (noinst_HEADERS): Add w_dirent.h. * src/common.h [HAVE_WINDOWS_H] [!HAVE_READDIR]: Include w_dirent.h. 2000-09-17 Alexandre Duret-Lutz Define common integer types, and use them in the structs which are written to disk. * configure.in: Check for stdint.h. * src/common.h: Include stdint.h and defines common integer types. * src/options.h (options_t): Use the above defined integer types. * src/structs.h (tunnel_t, anim_t, param_u, tile_t, tile_info_t, level_header_t, top_score, saved_game): Likewise. (param_u): Rename to ... (param_t): ... this. * src/hedlite.c (affgt,majg,planfull,hmain): Don't print using long format. * src/heroes.c (scores_menu): Print using unsigned format. * TODO: Update. 2000-09-15 Alexandre Duret-Lutz Use opendir/readdir/closedir instead of scandir. * configure.in: Remove checks for scandir and alphadir. Remove the test about the type of d_name. * lib/scandir.c: Delete. * lib/alphadir.c: Delete. * lib/Makefile.am (EXTRA_DIST): Remove scandir and alphadir. * src/extras.c (NEW_LIST(level)): New. (alphasort,scandir): Remove declaration. (browse_extra_directory): Rewrite using opendir/readdir/closedir, add the files to a list given as a new argument. (browse_extra_directories): Convert the list filled by browse_extra_directory to an array, and allocate extra_selected_list (these two operations used to be done by browse_extra_directory). * src/common.h [!HAVE_DIRENT_H]: Include other possible headers. 2000-09-15 Alexandre Duret-Lutz Improve the generic list by handling comparator and destructor for the cells' type. * src/generic_list.h (NEW_LIST): Split into NEW_LIST_SPEC and NEW_LIST_BODY. Let NEW_LIST be a call to both. Handle two new parameters to NEW_LIST_BODY (and hence NEW_LIST) for equality test and destruction of cells. (NULL_DESTRUCTOR,STD_EQUAL): New. * src/extras.c: Adapt the call to NEW_LIST. (free_extradir_info): New. (free_extra_directories): Rewrite using extradir_clear. * src/musicfiles.c: Adapt the call to NEW_LIST. (uninit_sound_track_list): Rewrite using st_clear. 2000-09-15 Uwe Hermann * ChangeLog: Fix old ChangeLog-entries to use imperative mode (again). * TODO: Add new item. * src/endscroll.c, src/heroes.c, src/misc.c, src/pcx.c, src/txts.c: Remove all casts of malloc/realloc. Such casts are not necessary as malloc/realloc return 'void *', but they can hide the fact that the '#include ' is missing... 2000-09-15 Uwe Hermann * ChangeLog: Fix old ChangeLog-entries to use imperative mode. * src/argv.c (version): Add a missing 'void' in the definition. Change the 'const struct option long_options[]' to use no_argument, required_argument and NULL instead of 0, 1 and 0. This increases readability (IMHO). * src/const.c, src/endscroll.c, src/intro.c: Translate some french comments into english language. * src/debugmsg.h, src/draw.c, src/extras.c, src/fastmem.h: Typo. * src/endscroll.c, src/font.h, src/font_help.h, src/font_menu.h, src/gfx_reader.h, src/hedlite.c, src/heroes.c, src/joystick.c, src/menus.c, src/options.h: Change some C++-style comments (//foo) into C-style comments (/* foo */). * src/font.h, src/font_help.h, src/font_menu.h: Cosmetic changes. * src/debugmsg.h, src/gfx_reader.h, src/heroes.c, : Add a missing 'void'. 2000-09-15 Alexandre Duret-Lutz Use timeGetTime instead of clock on Win32 targets, as suggested by Stéphane Denis . * configure.in: Check for windows.h. * src/common.h [HAVE_WINDOWS_H]: Include it. * src/timer.h (time_type): Define to struct timeval, DWORD or clock_t according to the function used to read time. [!HAVE_GETTIMEOFDAY]: Define get_current_time to the function used to read time. Add definition of SECOND for Win32 systems. (htimer_s.orig_type): Use time_type. * src/timer.c (current_time): Use time_type. (update_htimers) [!HAVE_GETTIMEOFDAY]: Use get_current_time. (read_htimer) [!HAVE_GETTIMEOFDAY]: Store c, d and res as unsigned variables. Use get_current_time. 2000-09-14 Alexandre Duret-Lutz * Makefile.am (AUTOMAKE_OPTIONS): New, set gnits option. (EXTRA_DIST): Remove TODO, ChangeLog and THANKS since they are handled implicitly by automake. 2000-09-14 Alexandre Duret-Lutz automake 1.4a compatibility. * doc/Makefile.am (htmldir): Move out of MAKE_HTML conditional. * src/Makefile.am (keysdef.c): New (explicit dependency). * depcomp: New. 2000-09-14 Alexandre Duret-Lutz * src/keyb.c (get_key): Typo. 2000-09-14 Alexandre Duret-Lutz * TODO: Add new items. 2000-09-14 Alexandre Duret-Lutz * BUGS: Add reports about bugs on m68k and Solaris. 2000-09-14 Uwe Hermann * configure.in: Add AC_HEADER_STAT which defines STAT_MACROS_BROKEN if S_ISDIR etc. are broken. * TODO: Remove item about absent S_ISDIR. * src/common.h: Define/re-define S_ISDIR in the native implementation is broken or not existing. 2000-09-13 Alexandre Duret-Lutz * src/display.c (init_video): Enable SDL_QUIT events. * src/keyb.c (process_input_events): Handle SDL_QUIT events. (get_key): Likewise. (key_ready): Return true if there is a pending SDL_QUIT event. 2000-09-13 Alexandre Duret-Lutz Record the state of libraries (initialized or not) and sound tracks (loaded, playing, none). This allow to exit the game anywhere, because we know what to uninitialize. * src/display.c (scr_w,scr_h,scr_pitch): Remove static tag. (video_initialized): New. [HAVE_PKG_GGI] (visu,render_visu): Initialize to 0. [HAVE_PKG_GGI,HAVE_SDL] (init_video): Set video_initialized. [HAVE_PKG_GGI] (uninit_video): Clear display_param. Close visu, render_visu, if needed. Exit GGI if initialized. [HAVE_SDL] (visu): Initialize to 0. [HAVE_SDL] (screen): Remove (useless declaration). [HAVE_SDL] (SDL_initialized): New. [HAVE_SDL] (init_SDL): Use SDL_initialized instead of the static variable `done' [HAVE_SDL] (uninit_video): Use screen_allocated and SDL_initialized to know what to uninitialize. * src/errors.h (exit_heroes): New. * src/errors.c (exit_heroes): New. (fatal_error): Call exit_heroes. * src/sound.c (sound_initialized,sound_track_loaded, sound_track_playing): New. [HAVE_LIBMIKMOD,HAVE_PKG_sdl_mixer] (init_sound_engine): Set sound_initialized. [HAVE_LIBMIKMOD,HAVE_PKG_sdl_mixer] (uninit_sound_engine): Use sound_initialized. [HAVE_LIBMIKMOD,HAVE_PKG_sdl_mixer] (load_soundtrack): Set sound_track_loaded. [HAVE_LIBMIKMOD,HAVE_PKG_sdl_mixer] (unload_soundtrack): Use sound_track_playing and sound_track_loaded. [HAVE_LIBMIKMOD,HAVE_PKG_sdl_mixer] (play_soundtrack): Use sound_track_loaded. Set sound_track_playing. 2000-09-13 Alexandre Duret-Lutz * src/display.c (init_video): Typo. 2000-09-12 Alexandre Duret-Lutz Handle video pitch (SDL windx5 driver is now usable). * src/display.c (scr_pitch): New. (stretch_twofold,stretch_twofold_even, stretch_threefold,stretch_threefold_even): Use scr_pitch. (copy_screen): New. (copy_display): Call copy_screen. [HAVE_PKG_GGI,HAVE_SDL] (uninit_video): Set scr_pitch. 2000-09-12 Alexandre Duret-Lutz * src/hedlite.c: Include endian.h. * src/hendian.c: Likewise. 2000-09-12 Alexandre Duret-Lutz Lock visual when needed (SDL only). * src/display.c (screen_allocated): New. (stretch_display): Rename to ... (copy_display): ... this. Copy the screen if needed. [HAVE_PKG_GGI] (init_video): Set screen_allocated. [HAVE_PKG_GGI,HAVE_SDL] (uninit_video): Use screen_allocated. [HAVE_PKG_GGI] (vsynchro): Adapt to call copy_display. [HAVE_SDL] (init_video): Set screen_allocated. Don't set screen_rv if the visual require locking, allocate screen instead. [HAVE_SDL] (vsynchro): Adapt to call copy_display. Lock the surface if needed and set screen_rv. 2000-09-11 Uwe Hermann * AUTHORS, TODO, doc/heroes.texi: Fix several typos and some other minor stuff. 2000-09-10 Alexandre Duret-Lutz * lib/strcasecmp.c: New file. * lib/Makefile.am (EXTRA_DIST): Add strcasecmp. * configure.in: Check for strcasecmp. * src/common.h [!HAVE_STRCASECMP]: Declare strcasecmp. 2000-09-10 Alexandre Duret-Lutz * configure.in: Document undocumented AC_DEFINEs. * acconfig.h: Likewise. 2000-09-09 Alexandre Duret-Lutz Delete src/optionss.h. * src/optionss.h (options_t): Move to... * src/options.h (options_t): ...here. * src/optionss.h: Delete. * src/Makefile.am (heroes_SOURCES): Remove src/optionss.h. Add a common.h file for all system headers inclusions; ensure that all .c files include common.h instead of config.h (and before anything else). * src/common.h: New file. * src/Makefile.am (heroes_SOURCES): Add common.h. [GGI,SDL] (keysdef-inc.h): Do not generate #include in output file. * argv.c: Adapt to include common.h. * const.c: Likewise. * debugmsg.c: Likewise. * display.c: Likewise. * draw.c: Likewise. * endscroll.c: Likewise. * errors.c: Likewise. * extras.c: Likewise. * hedlite.c: Likewise. * hendian.c: Likewise. * heroes.c: Likewise. * intro.c: Likewise. * joystick.c: Likewise. * keyb.c: Likewise. * keysdef.c: Likewise. * menus.c: Likewise. * misc.c: Likewise. * musicfiles.c: Likewise. * options.c: Likewise. * pcx.c: Likewise. * pixelize.c: Likewise. * render.c: Likewise. * rsc_files.c: Likewise. * rsc_files.gperf: Likewise. * savegame.c: Likewise. * scores.c: Likewise. * sfx.c: Likewise. * sound.c: Likewise. * timer.c: Likewise. * txts.c: Likewise. * userconf.c: Likewise. * userdir.c: Likewise. * visuals.c: Likewise. Adapt the .h files, because they can now assume that common.h was already included. Also, rename the inclusion guards, using names like HEROES__FILE__H. * argv.h: Rename guard. * const.h: Rename guard. * debugmsg.h: Adapt includes and rename guard. * display.h: Rename guard. * draw.h: Rename guard. * endian.h: Adapt includes and rename guard. * endscroll.h: Rename guard. * errors.h: Rename guard. * extras.h: Rename guard. * fastmem.h: Adapt includes and rename guard. * generic_list.h: Adapt includes. * gfx_reader.h: Adapt includes. * hedlite.h: Rename guard. * hendian.h: Adapt includes and rename guard. * heroes.h: Rename guard. * intro.h: Rename guard. * joystick.h: Rename guard. * keyb.h: Rename guard. * keys_heroes.h: Adapt includes and rename guard. * keysdef.h: Rename guard. * menus.h: Rename guard. * misc.h: Rename guard. * musicfiles.h: Rename guard. * options.h: Rename guard. * pcx.h: Rename guard. * pixelize.h: Rename guard. * render.h: Rename guard. * rsc_files.h: Rename guard. * rsc_files_hash.h: Rename guard. * savegame.h: Rename guard. * scores.h: Rename guard. * sfx.h: Rename guard. * sound.h: Rename guard. * structs.h: Adapt includes and rename guard. * timer.h: Adapt includes and rename guard. * txts.h: Rename guard. * userconf.h: Rename guard. * userdir.h: Rename guard. * visuals.h: Rename guard. Add a few tests to configure. * configure.in: Check for memory.h, strings.h, unistd.h. Call AC_HEADER_TIME. Check for memcpy. 2000-09-08 Alexandre Duret-Lutz * BUGS: Add warning messages from windows. * TODO: Complete, rewrite, reorder. 2000-09-07 Alexandre Duret-Lutz Add support for arcade-style scanlined display (Adapted from Stéphane Denis ). And fix a bug in handling of --double and --triple options. * src/argv.h (even_lines): New. * src/argv.c (even_lines): New. (print_help): Add -e. (long_options): Add --even-lines. Fix argument number of --double and --triple (they don't accept any). (parse_argv): Handle -e. * doc/heroes.texi (Options): Document -e. * src/display.c (stretch_twofold_even): New. (stretch_threefold_even): New. (erase_odd_lines): New. (stretch_display): New. [HAVE_PKG_GGI,HAVE_SDL] (vsynchro): Move stretching calls to stretch_display and call stretch_display instead. 2000-09-06 Alexandre Duret-Lutz * man/Makefile.am (heroes.6): Do not build heroes.6 conditionnaly, `missing' will warn the user if help2man is needed. * configure.in: Be paranoiac, quote everything. Use AC_MISSING_PROG to check for help2man. 2000-09-06 Alexandre Duret-Lutz Free even more memory. * src/hedlite.h (free_levels_output_dir): New. * src/hedlite.c (free_levels_output_dir): New. * src/options.c (free_options): New. * src/options.h (free_options): New. * src/savegame.c (free_save_records): New. * src/savegame.h (free_save_records): New. * src/scores.c (free_scores): New. * src/scores.h (free_scores): New. * src/display.c [HAVE_SDL] (uninit_video): Free screen. [HAVE_PKG_GGI] (uninit_video): Free screen and display_params. * src/txts.c (close_txti): New. * src/txts.h (close_txti): New. * src/musicfiles.c (uninit_sound_track_list): Don't use the list temporaly variable. * src/extras.c (free_extra_directories): Also free the cells, and call free_levels_output_dir. * src/heroes.c (main): Call close_txti, free_scores, free_save_records, free_options. 2000-09-05 Alexandre Duret-Lutz Free some more memory. * src/extras.h (free_extra_directories): New. * src/extras.c (free_extra_directories): New. (free_extra_list): Do not free anything if extra_nbr == 0. (browse_extra_directory): Exit early when no file are found. * src/userdir.h (free_userdir): New. * src/userdir.c (free_userdir): New. (setup_userdir): Allocate one byte more for userdir, and free userdir if already allocated. * src/musicfiles.h (uninit_sound_track_list): New. * src/musicfiles.c (uninit_sound_track_list): New. * src/heroes.c (main): Call uninit_sound_track_list, free_extras_directories, and free_userdir. Do not free extra_list and extra_selected_list directly, call free_extras_list instead. * src/userconf.c (read_userconf): Free pname. * src/display.c (init_video): Do not ask for a ColorfulPalette when the display don't use a palette, because GGI would be mallocing a big palette in such case. 2000-09-04 Alexandre Duret-Lutz AC_PATH_GENERIC is not enough to test for a library, we need to check wether the library link or not. * acinclude.m4: Add AC_adl_PKG_GENERIC. * configure.in: Use it to check for libMikMod and SDL. 2000-09-04 Alexandre Duret-Lutz On some machines, quit_yes_no used to be called in a loop because the release of the key was not recorded. * src/heroes.c (quit_yes_no): Enclose the function by calls to (un)init_keyboard_map so that the keyboard map get cleared on exit. (pause_menu): Remove superfluous instruction. 2000-09-04 Alexandre Duret-Lutz Synchronize with my own CVS repository. * ChangeLog: Add one missing entry. * src/etc/heroesrc: The file was doubled, remove the bottom half. 2000-09-04 Alexandre Duret-Lutz * configure.in: Add copyright line. 2000-09-03 Alexandre Duret-Lutz * src/heroes.c (load_level): Cleanup the tunnels initialization loop. 2000-09-03 Alexandre Duret-Lutz From Mattias Engdegård. * configure.in: Always define the MAKE_HTML conditional. 2000-09-02 Alexandre Duret-Lutz * configure.in: Set version to 0.6. Port to Autoconf 2.49a. * acinclude.m4: Port to Autoconf 2.49a (use AC_HELP_STRING). * install-sh: Update from Autoconf 2.49a. * missing: Likewise. * mkinstalldirs: Likewise. * INSTALL: Likewise. 2000-09-01 Alexandre Duret-Lutz Solaris already defines SEC. * src/timer.c (SEC): Rename to ... (SECOND): ... this. * src/timer.c (reset_htimer_with_offset,read_htimer, shift_htimer): Addapt to use SECOND. 2000-09-01 Alexandre Duret-Lutz * src/intro.c (show_intro): Addapt constants for better synchronisation with the sound track. * src/heroes.c (play_demo): Reset the fading_timer once, and set fade to 0 only if it was equal to -1 before. 2000-08-31 Alexandre Duret-Lutz * NEWS: Update. * doc/heroes.texi (Contributors): Add Mattias and Maxim. 2000-08-31 Alexandre Duret-Lutz Mingw32 defines dirent.d_name as a pointer, so copying a struct dirent needs some additional massaging. * configure.in: Check wether dirent.d_name is a pointer, define D_NAME_IS_POINTER if so. Also replace the AC_TRY_LINK for the mkdir check by AC_TRY_COMPILE. * lib/scandir.c (scandir): Handle the D_NAME_IS_POINTER case (will strdup d_name). * src/extras.c (browse_extra_directory): If D_NAME_IS_POINTER, d_name has already been strduped there is no need to do it again. 2000-08-31 Alexandre Duret-Lutz * configure.in (data_dir): Support --enable-html-doc option. * doc/heroes.texi (configure options): Document it. * doc/Makefile.am (htmldir): Add rules to build and install html documentation. 2000-08-30 Alexandre Duret-Lutz One bigendian fix more. * src/structs.h: Translate comments to english. (hl): Reverse order of attributes when WORDS_BIGENDIAN. 2000-08-30 Alexandre Duret-Lutz Add --enable-heroes-debug option to compile HEROES_DEBUG support or not. * configure.in: Add --enable-heroes-debug option. Move the definition of DEBUG in another place, it was wrong. * src/debugmsg.h (DEBUG): Rename to ... (USE_HEROES_DEBUG): ... this. * src/debugmsg.c: Likewise. * src/userconf.c (read_userconf): Transform a fprintf in a call to dmsg. * doc/heroes.texi (Bug Reporting): Ask for HEROES_DEBUG trace. (configure options): Describe --disable-heroes-debug. * README: Adjust accordingly. 2000-08-30 Alexandre Duret-Lutz * doc/heroes.texi (Getting Heroes): Missing word. 2000-08-30 Alexandre Duret-Lutz * src/menus.c (editor_menu): Call update_text_waving_step in main loop. 2000-08-30 Alexandre Duret-Lutz * src/timer.c (read_htimer): Thinko, slice rest must not be accounted if we are blocking. 2000-08-30 Alexandre Duret-Lutz * src/menus.c (load_tile_set_preview): Fix incorrect usage of strappend. 2000-08-30 Alexandre Duret-Lutz * src/heroes.c (main): Perhabs calling uninit_sound_engine makes sense... :) 2000-08-29 Alexandre Duret-Lutz * src/sound.c (decode_sound_options): Implement. * doc/heroes.texi (Options): Document. 2000-08-29 Alexandre Duret-Lutz * src/rsc_files.gperf (end-scroller-txt): Typo. 2000-08-29 Alexandre Duret-Lutz * src/debugmsg.c (dperror): Print an error message only if debug_level is non null. * src/extras.c (browse_extra_directory): Print an error message if an extra user directory does not exists. 2000-08-29 Alexandre Duret-Lutz From Mattias Engdegård . Cure the bus errors on sparc (results from unaligned memory access). * src/endian.h [WORDS_BIGENDIAN,!WORDS_BIGENDIAN] (SETWORD,GETWORD,SETHALFWORD,GETHALFWORD): New macro. * src/gfx_reader.h (show_help): Use these macros. * src/savegame.c (check_save_records): Likewise. * src/scores.c (check_scores): Likewise. * src/visuals.c (horizontal_zoom_wave, horizontal_zoom_flip, vertical_zoom_wave): Likewise. Support larger file names. * src/heroes.c (load_level_from_number,loadlvlpasrandq2, load_random_wrapped_level,load_random_level): Widen the filename temporaly buffer. 2000-08-28 Alexandre Duret-Lutz * src/intro.c (play_intro): Set a black palette in ONE call, not 768! 2000-08-28 Alexandre Duret-Lutz * src/heroes.c (load_level): Add missing parameter to dmsg call. 2000-08-28 Alexandre Duret-Lutz Add a dperror, a wrapper to perror. * src/debugmsg.c [DEBUG] (dmsg): Use progname. [DEBUG] (dperror): New. * src/debugmsg.h [!DEBUG,DEBUG] (dperror): Define. * src/extras.c (browse_extra_directory): Use dperror. * src/heroes.c (load_level, save_pcx, read_level_list): Likewise. * src/musicfiles.c (read_sound_config_file): Likewise. * src/options.c (load_options): Likewise. * src/savegame.c (load_save_records): Likewise. * src/scores.c (load_scores): Likewise. * src/sfx.c (read_sfx_conf): Likewise. * userconf.c (read_userconf): Likewise. 2000-08-28 Alexandre Duret-Lutz * NEWS: Describe HEROES_DEBUG and HEROES_DATA_DIR. 2000-08-28 Alexandre Duret-Lutz * Makefile.am (EXTRA_DIST): Add misc/heroes.xpm. 2000-08-28 Alexandre Duret-Lutz Ellipsis in macro argument list is non-standard. * src/debugmsg.h [!DEBUG] (dmsg): Don't use ellipsis, rely on the use of comma operator in while argument instead. 2000-08-28 Alexandre Duret-Lutz Typo * src/Makefile.am (EXTRADIST): Rename to ... (EXTRA_DIST): ... this. 2000-08-28 Alexandre Duret-Lutz * src/Makefile.am (EXTRADIST): Add rsc_files.gperf. 2000-08-28 Alexandre Duret-Lutz * src/musicfiles.c (read_sound_config_file): Print the expanded filename. 2000-08-27 Alexandre Duret-Lutz Setup facility for printing debug messages. * src/debugmsg.h: New file. * src/debugmsg.c: New file. * src/Makefile.am (heroes_SOURCES): Add debugmsg.h and debugmsg.c. * doc/heroes.texi (Environment): Move the existing paragraphe in subsection HEROES_DATA_DIR. Add a subsection for HEROES_DEBUG and fill it. Output debug messages from various places. * src/display.c [HAVE_PKG_GGI] (init_video, uninit_video, set_color, set_pal): Call dmsg. [HAVE_SDL] (set_display_params, init_SDL, init_video, set_color, set_pal): Likewise. * src/extras.c (browse_extra_directory, add_extra_in_user_directory): Likewise. * src/gfx_reader.h (graphic_reader): Likewise. * src/heroes.c (erase_player, reinit_player, load_level, save_pcx, load_level_from_number, compute_level_full_list, load_random_wrapped_level, load_random_level, play_menu, play_demo, load_demo, main_menu, pause_menu, quit_yes_no, play_game, read_level_list, main): Likewise. * src/intro.c (play_intro): Likewise. * src/joystick.c (joyinit): Likewise. * src/musicfiles.c (read_sound_config_file): Likewise. * src/options.c (write_options,load_options): Likewise. * src/pcx.c (pcx_load): Likewise. * src/rsc_files.c (set_rsc_file,get_rsc_file): Likewise. * src/savegame.c (write_save_records,load_save_records: Likewise. * src/scores.c (write_scores, load_scores): Likewise. * src/sfx.c (read_sfx_conf, free_all_sfx, load_sfx_mode, event_sfx): Likewise. * src/sound.c [HAVE_LIBMIKMOD,HAVE_LIBSDL_MIXER] (set_volume, halve_volume, init_sound_engine, uninit_sound_engine, load_soundtrack, play_soundtrack): Likewise. * src/timer.c (new_htimer, free_htimer, read_htimer, shift_htimer): Likewise. * src/txts.c (read_txti_cfg): Likewise. * src/userconf.c (read_userconf): Likewise. * src/userdir.c (setup_userdir): Likewise. 2000-08-27 Alexandre Duret-Lutz OSF already defines dirname * src/musicfiles.c (dirname): Rename to... (dir_name): ... this. (read_sound_config_file): Adapt call ro dir_name. 2000-08-27 Alexandre Duret-Lutz Remove src/extradir from the distribution. * src/Makefile.am (SUBDIRS): Supress extradir. * configure.in: Do not generate src/extradir/Makefile. 2000-08-27 Alexandre Duret-Lutz * src/heroes.c (read_level_list): Improve error message. 2000-08-27 Alexandre Duret-Lutz * src/Makefile.am (heroes_SOURCES): Add missing rsc_file_hash.h. 2000-08-27 Alexandre Duret-Lutz timer_t is already declared in on NetBSD. * draw.c: Replace all occurences of timer_ by htimer_, and _timer by _htimer. * gfx_reader.h: Likewise. * heroes.c: Likewise. * heroes.h: Likewise. * intro.c: Likewise. * timer.c: Likewise. * timer.h: Likewise. 2000-08-27 Alexandre Duret-Lutz * src/Makefile.am (heroes_SOURCES): Remove start.h. * src/heroes.c: Do not include start.h. * src/start.h: Delete. 2000-08-27 Alexandre Duret-Lutz * configure.in: Remove the warning messages output by the failing check for GGI or SDL are not found. Complete the error message output when both check failed. 2000-08-26 Alexandre Duret-Lutz Move Mattias' alphasort and scandir functions to the lib/ directory and compile only when needed. * configure.in: Check for alphasort and scandir, and substitute LIBOBJS. * lib/Makefile.am (EXTRADIST): Add alphasort.c and scandir.c. (libheroes_a_LIBADD): New. (libheroes_a_DEPENDENCIES): New. * src/extras.c [!HAVE_ALPHASORT] (alphasort): Declare. (asort): Move to ... * lib/alphasort.c (alphasort): ... here. * src/extras.c [!HAVE_SCANDIR] (scandir): Declare. (myscandir): Move to ... * lib/scandir.c (scandir): ... here. * src/extras.c (browse_extra_directory): Use scandir and alphadir. 2000-08-26 Alexandre Duret-Lutz * NEWS: Update for next release. * THANKS: Likewise. * doc/heroes.texi (Libraries): "an alterate" -> "an alternative". * Readme: Likewise. 2000-08-26 Alexandre Duret-Lutz * doc/heroes.texi (Libraries): Describe SDL_mixer. (configure options): Describe new configure options. (Troubleshooting): Rename the subsection about Alsa and MikMod. (History): Flush left. * README: Update accordingly. Add a Summary section. 2000-08-26 Alexandre Duret-Lutz * src/sfx.c (_play_sfx): Use MIX_MAX_VOLUME. * src/sound.c (set_volume,halve_volume): Implement. * src/etc/heroesrc: New in CVS. Read $(datadir)/mod/sound.conf, not /sound.conf. * src/etc/heroesrc.in: Delete. * src/etc/Makefile (EXTRA_DIST): Set to x_DATA. (CLEANFILE,heroesrc): Remove. 2000-08-26 Alexandre Duret-Lutz Add -S/--no-sound option, and switch to no-sound automaticaly if the sound-engine can't initialize. * doc/heroes.texi: Document --no-sound and --no-sfx (was missing), and reoder the option list. * src/argv.h (nosound): New. * src/argv.c (nosound): New. (print_help): Add -S and --no-sound, reorder option list. (long_options): Add --no-sound. (parse_argv): Handle -S. * src/sound.c [HAVE_LIBMIKMOD,HAVE_LIBSDL_MIXER] (init_sound_engine, uninit_sound_engine, load_soundtrack, unload_soundtrack, play_soundtrack, load_soundtrack_from_alias): Handle nosound. * src/sfx.c [HAVE_MIKMOD] (_load_sfx): Fix return type. (load_sfx_mode): Cosmetic change of the error message. 2000-08-26 Alexandre Duret-Lutz SFX support for SDL_mixer * src/sfx.c: Move functions around, and setup support for both MikMod and SDL_mixer. [HAVE_LIBMIKMOD] (_load_sfx,_free_sfx,_play_sfx): New. [HAVE_LIBSDL_MIXER] (sfx_handles,_load_sfx,_free_sfx, _play_sfx): New. (free_all_sfx,event_sfx,load_sfx_mode): Adapt to use _free_sfx, _play_sfx and _load_sfx respectively. Misc. sound-related fixes. * src/sound.c [HAVE_LIBSDL_MIXER] (init_sound_engine): Fix audio rate selection. Reduce the audio buffer value. * src/argv.c (parse_argv): Add missing 'q' case. 2000-08-26 Alexandre Duret-Lutz Update to latest versions from subversion.gnu.org. * lib/getopt.c: Fresh version from glibc CVS. * lib/getopt1.c: Fresh version from glibc CVS. * lib/getopt.h: Fresh version from glibc CVS. * config.sub: Fresh version from config CVS. * config.guess: Fresh version from config CVS. 2000-08-26 Alexandre Duret-Lutz Preliminary support for SDL_mixer. * acconfig.h: Add HAVE_PKG_sdl_mixer. * aclocal.m4: Fix AC_caolan_CHECK_PACKAGE so that LIBS get backuped. * configure.in: Add --with-mikmod option, for consistancy. Handles choice between libMikMod and SDL_mixer. Check for SDL_mixer. * src/display.c (init_SDL) [HAVE_LIBSDL_MIXER]: Call SDL_Init with flag SDL_INIT_AUDIO. * src/sound.c [HAVE_LIBSDL_MIXER] (music,audio_rate,audio_format, audio_channels,audio_buffers): New. [HAVE_LIBSDL_MIXER] (set_volume, halve_volume, init_sound_engine, uninit_sound_engine, load_soundtrack, unload_soundtrack, play_soundtrack, print_drivers_list, decode_sound_options, load_soundtrack_from_alias): New. * src/timer.c (update_timers): Check HAVE_GETTIMEOFDAY, not GETTIMEOFDAY. 2000-08-26 Alexandre Duret-Lutz Under DOS, mkdir doesn't take a second argument. * configure.in: Check whether mkdir takes two arguments and define TWO_ARGS_MKDIR. * src/hedlite.c (create_levels_output_dir): Do not use the second mkdir argument if !TWO_ARGS_MKDIR. * src/userdir.c (setup_userdir): Likewise. * fastmem.h: Add missing "config.h" include. 2000-08-25 Alexandre Duret-Lutz Use clock when gettimeofday isn't available. * configure.in: Check for gettimeofday. * src/timer.h: Adapt to use struct timeval or clock_t whether GETTIMEOFDAY is defined or not. (reset_timer_with_offset): Remove the usec argument. * src/timer.c: Likewise. (reset_timer_with_offset,update_timers,read_timer,shift_timer): Write the !GETTIMEOFDAY version. * src/heroes.c (play_demo,play_game,main_menu): Adapt call to reset_timer_with_offset. 2000-08-25 Alexandre Duret-Lutz Create a lib/ directory for compatibility and utility functions. * src/getshline.c, src/getshline.h: Move to ... * lib/getshline.c, lib/getshline.h: ... here. * src/Makefile.am (heroes_SOURCES): Remove getshline.h and getshline.c. (INCLUDE,LD_ADD): New. * lib/Makefile.am: New file. * lib/getopt.c: New file. * lib/getopt.h: New file. * lib/getopt1.c: New file. * Makefile.am (SUBDIRS): Add lib. * configure.in: Test for randir. Remove check for strstr, strdup, and mkdir because their result is not used. Remove check for getopt_long and getopt.h because lib/getopt* are automatic replacements. When checking the build host is the same as the target host, look $build variable, not $hots. Output lib/Makefile. * argv.c [!HAVE_GETOPT_H]: Suppress this case, since lib/ has a replacement for getopt. [!HAVE_GETOPT_LONG]: Likewise. * src/argv.c, src/endscroll.c, src/extras.c, src/hedlite.c, src/heroes.c, src/intro.c, src/joystick.c, src/menus.c, src/misc.c, src/musicfiles.c, src/options.c, src/pixelize.c, src/rsc_files.c, src/savegame.c, src/scores.c, src/sfx.c, src/sound.c, src/start.c, src/txts.c, src/userconf.c, src/visuals.c: Move "config.h" at the top of the include list. 2000-08-25 Alexandre Duret-Lutz * autoconf.in: Test for the "string.h" header. * src/config.h, src/fastmem.h, src/gfx_reader.h, src/argv.c, src/display.c, src/extras.c, src/hedlite.c, src/heroes.c, src/intro.c, src/menus.c, src/misc.c, src/musicfiles.c, src/pixelize.c, src/rsc_files.c, src/savegame.c, src/scores.c, src/sfx.c, src/sound.c, src/txts.c, src/userconf.c, src/visuals.c: Include "string.h" or "strings.h" conditionaly. 2000-08-25 Alexandre Duret-Lutz * configure.in: Change the definition of GGI and SDL conditional so they also works when $with_GGI and $with_sdl are directory names. 2000-08-25 Alexandre Duret-Lutz * configure.in: Do not run AC_C_BIGENDIAN when doing a cross build but rely on explit knoledge of byte ordering of the target host instead. 2000-08-24 Alexandre Duret-Lutz Documents new features (file resources, HEROES_DATA_DIR), the four packages and the mailing lists. * doc/heroes.texi (Getting Heroes): Describe the four packages. Fix urls. (Mailing list): Rename to ... (Mailing lists): ... this. Describe the three public mailing lists. (Bug Reporting): Do not suggest shar. Remove the statement about the size of sound tracks, this is as true in the current packaging scheme. (Libraries): Move the note about memory debugger at the end of the section. (Environment): Describes the HEROES_DATA_DIR variable. (heroesrc): Describes the setrsc command. (Troubleshooting): Fix the way the user is tell how to run libmikmod in OSS-emulation. * README: Update, from the texinfo manual. * src/argv.c (print_help): Change bug reports address to 2000-08-24 Alexandre Duret-Lutz * configure.in (confdir): Remove declaration of heddir, introdir, nivdir, rscdir and spritedir directories. 2000-08-24 Alexandre Duret-Lutz * src/timer.c (reset_timer_with_offset,read_timer): Fix computation formula. (shift_timer): New. * src/timer.h (shift_timer): New. * src/heroes (pause_menu,quit_yes_no): Use a pause_timer to account the time used in the pause, and shift update_timer and event_timer on exit. 2000-08-24 Alexandre Duret-Lutz * src/heroes.c (play_demo,play_game): Call update_timers before reseting them. 2000-08-24 Alexandre Duret-Lutz Introduce new timer code in order to handle multiple (and non proportionnal) speeds, and to not depends on the display refresh rate. This is a rather important change that will probably introduce bugs. * src/timer.c: New timer code. * src/timer.h: New timer code. * src/const.h (frame_cur,frame_old,demo_done): Remove. * src/const.c (frame_cur,frame_old,demo_done): Remove. (vsynch): Call update_timers. (key_or_joy_ready): Use demo_trigger_timer. * src/draw.c (text_waving_step,text_waving_timer): New. (init_text_waving_step,uninit_text_waving_step, update_text_waving_step): New. (draw_text_waving,draw_text_bonus): Use text_waving_step (fix endian bug). (affvga320sin): Rename to ... (draw_text_waving_320): ... this. Use text_waving_step (fix endian bug). (draw_text_array_320): Adapt to use draw_text_waving_320. * src/draw.h (init_text_waving_step,uninit_text_waving_step, update_text_waving_step): New. (affvga320sin): Rename to ... (draw_text_waving_320): ... this. * gfx_reader.h [!__HEROES__]: Remove all that unused code. (draw_text_help) [SDF]: Define and use read_timer. * src/heroes.c (soundtrack_time): Remove (replaced by sound_track_timer). (DEMO_DURATION): Set to 90 secs. (blink_timer,clock_timer,bonus_anim_timer, tiles_anim_timer,corner_timer,event_timer, event_time,fading_timer,update_timer, waving_timer,background_timer,sound_track_timer, demo_trigger_timer): New. (add_random_bonus,add_bonus,erase_trail, update_bonus): Adapt to use even_time. (load_level): Comment out timer code (what's the purpose?). (jukebox_menu): Setup and use lemming_timer. Use waving_timer, and sound_track_timer. (play_menu): Reset sound_track_timer. (update_all): Use update_timer. (play_demo): Setup and use demo_timer. Reset clock_timer, bonus_anim_timer, tiles_anim_timer, blink_timer, and update_timer before running the game. Update event_time from event_timer. Reset background_timer and fading_timer on exit. (load_demo): Reset sound_track_timer and demo_trigger_timer on exit. (main_menu): Reset sound_track_timer, background_timer, fading_timer, demo_trigger_timer and event_timer. Update event_time. Adapt to use the above timers. Adapt to new calling convention of corner_buffer. (pause): Rename to ... (pause_menu): ... this because of name conflict from unistd.h. Adapt to use sound_track_timer. Call update_text_waving_step. (quit_yes_no): Adapt to use waving_timer. Call update_text_waving_step. Reset background_timer and fading_timer. (get_input_directions): Adapt to call pause_menu instead of pause. (draw_end_level_info): Adapt to use waving_timer. (play_game): Reset sound_track_timer, event_timer, clock_timer, bonus_anim_timer, tiles_anim_timer, blink_timer and update_timer. Make an explicit call to sleep rather than a loop over vsynch. Update event_time from event_timer and call update_text_waving_step on each iteration of the game loop. (main): Initialize and free clock_timer, blink_timer, event_timer, waving_timer, corner_timer, fading_timer, update_timer, background_timer, sound_track_timer, bonus_anim_timer, tiles_anim_timer and demo_trigger_timer. Call init_text_waving_step and uninit_text_waving_step. * src/heroes.h (clock_timer,blink_timer,bonus_anim_timer, tiles_anim_timer,corner_timer,fading_timer,waving_timer, background_timer): New. * src/intro.c (intro_frame_timer, intro_global_timer): New. (show_intro,play_intro): Adapt to use the above two timers. * src/menus.c (background_menu): Adapt to use background_timer and fading_timer. Fix the way how camera_x and camera_y are wrapped (fix endian bug). Call update_text_waving_step. (demo_info,option_menu,draw_quit_menu,draw_play_menu, draw_main_menu,editor_selector,editor_menu, editor_first_menu): Use waving_timer. Rename calls to affvga320sin as calls to draw_text_waving_320. (editor_menu): Reset background_timer and fading_timer on exit. * src/render.c (draw_level): Adapt to use clock_timer, blink_timer, bonus_anim_timer, tiles_anim_timer, waving_timer and event_time. * src/visuals.c (corner_buffer): Adapt to use corner_timer. Return 1 if the effect is finished. * src/visuals.h (corner_buffer): Return int. 2000-08-21 Alexandre Duret-Lutz From Maxim Sobolev . * src/Makefile.am (keysdef-inc.h): Include SDL_keysyms.h, not SDL/SDL_keysyms.h. 2000-08-21 Alexandre Duret-Lutz * src/rsc_files.h (rsc_expand): Export this function. * src/rsc_files.c (rsc_expand): Likewise. * src/musicfiles.h (read_sound_config_file): The argument is no more const. * src/musicfiles.c (read_sound_config_file): rsc_expand the filename. * src/etc/heroesrc (soundconf): Read $(datadir)/mod/sound.conf, not /sound.conf. 2000-08-20 Alexandre Duret-Lutz Support option -2 and -3 and stretch the display accordingly. * src/argv.h (stretch): New. * src/argv.c (stretch): New. (print_help): Describe -2 and -3. (long_options): Add --double and --triple. (parse_argv): Handle -2 and -3. * src/display.c (screen_rv,src_w,src_h): New. (stretch_twofold,stretch_threefold): New. [HAVE_PKG_GGI] (init_video): Use the value of stretch to setup src_w, src_h, screen and screen_rw. Use src_w and src_h to initialize the visuals. [HAVE_PKG_GGI] (vsynchro): Call stretch_threefold or stretch_twofold if needed. [HAVE_SDL] (init_video): Use the value of stretch to setup src_w, src_h, screen and screen_rw. Use src_w and src_h to initialize the visual. [HAVE_SDL] (vsynchro): Call stretch_threefold or stretch_twofold if needed. * src/keyb.h (mouse_x,mouse_y): Divide the position by the stretch factor. * doc/heroes.texi (Options): Document -2 and -3. Document the utility of -F with GGI's DGA driver. 2000-08-19 Alexandre Duret-Lutz * BUGS: New file. * Makefile.am (EXTRA_DIST): Add BUGS. 2000-08-19 Alexandre Duret-Lutz Save files as soon as possible to prevent data loss if the game freezes or crashes. * src/heroes.c (main_menu): Save the options on disk on return from the options menu. (play_game): Save the gamerecords on disk whenever a game is saved. (play_menu): Save the scores on disk whenever a new score is added. 2000-08-19 Alexandre Duret-Lutz Fix typos reported by Benjamin Preidecker . * src/txt_cfg/heroes.hlp: Typo. * src/txt_cfg/txti.cfg: Typo. 2000-08-02 Alexandre Duret-Lutz Allow overwriting a resource from a config.file. * src/userconf.c (read_userconf): Handle "setrsc:". 2000-08-02 Alexandre Duret-Lutz From Mattias Engdegård . First fixes needed to compile on Solaris. * configure.in: Check for getopt.h and getopt_long. * src/argv.c: Include getopt.h conditionnaly, hand-define [!HAVE_GETOPT_LONG] (struct option,getopt_long): Define. * src/display.c (set_display_params): Use putenv, not setenv. * src/extras.c (asort,myscandir): New. (browse_extra_directory): Use myscandir and asort instead of scandir and alphasort. * src/menus.c: Include endian.h. * src/pcx.c: Likewise. * src/scores.c: Swap the points, not the whole struct. * src/userconf.c (read_userconf): Use putenv, not setenv. * src/extralvl/Makefile.am (x_DATA): Use $(shell echo) instead of broken $(wildcard). 2000-08-01 Alexandre Duret-Lutz Move data to a separate package `heroes-data'. * src/hedit/: Remove recursively (moved to heroes-data/pics) * src/sprites/: Remove recursively (moved to heroes-data/pics) * src/intro/: Remove recursively (moved to heroes-data/pics) * src/rsc/: Remove recursively (moved to heroes-data/tilesets) * src/level/: Remove recursively (moved to heroes-data/levels) * src/rsc_files.gperf: Adapt to new locations. * src/Makefile.am (SUBDIRS): Remove hedit, sprites, intro, rsc and level directories. * configure.in: Do not generate Makfile for the above directories. 2000-07-31 Alexandre Duret-Lutz * src/argv.c (print_help): Document -X option. * src/sfx.c (read_sfx_conf): Switch to nosfx mode when the configuration file can't be read. 2000-07-30 Alexandre Duret-Lutz * src/rsc_files.gperf (sfx-conf-txt): Change value from "...sfx.cfg" to "...sfx.conf". 2000-07-30 Alexandre Duret-Lutz * src/sfx/: Delete recursively (files are going to the heroes-sound-effects package). * src/mod/: Delete recursively (heroes-sound-tracks package). * src/Makefile.am: Remove sfx and mod directory handling. * configure.in: Likewise. 2000-07-30 Alexandre Duret-Lutz * doc/heroes.texi: Write Nibbles with an s in more places. Allow heroes.texi to produce dvi files. Insert line breaks in some places. Markup all keys with @keys{}. 2000-07-29 Alexandre Duret-Lutz * src/musicfiles.c (dirname): New. (read_sound_config_file): Allow files that does not begin by `/' to be loaded relatively to the config file directory. * src/mod/Makefile.am: sound.conf does not need to be built from sound.conf.in anymore. (CLEANFILES,sound.conf): Remove. (EXTRA_DIST): Keep sound.conf instead of sound.conf.in. * src/mod/sound.conf: New file. * src/mod/sound.conf.in: Delete. * src/rsc_files.gperf (sfx-dir): New. * src/sfx.c (read_sfx_conf): Adapt to get the sfx directory and sfx.cfg file from resources. 2000-07-29 Alexandre Duret-Lutz * src/heroes.c (main): Search the environment for HEROES_DATA_DIR or HEROES_DATADIR to set the value of the data-dir resource, or fail back to the default value if no variable is found. 2000-07-29 Alexandre Duret-Lutz * configure.in: Check for gperf. * src/Makefile.am: Don't define a rule for rsc_files_hash.c if gperf is not available. 2000-07-28 Alexandre Duret-Lutz Setup the base structure for resources handling. rsc_files* are used to map a symbolic name to a true filename, handling variable substitutions (e.g. $(data-dir)). * rsc_files.c: New file. * rsc_files.h: New file. * rsc_files.gperf: New file. * rsc_files_hash.h: New file. * src/pcx.c (pcx_load_from_rsc): New. * src/pcx.h (pcx_load_from_rsc): New. * configure.in: Remove all directory #definitions and define only datadir. * src/Makefile.am (heroes_SOURCES): Add rsc_files.c, rsc_files.h and rsc_files_hash.c. (BUILT_SOURCES): Add rsc_files_hash.c. (rsc_files_hash.c): New. * src/argv.h (level_name): Rewrite as a dynamic array. * argv.c (level_name): Likewise. (parse_argv): Adapt to fill level_name, with the basename only. * src/endscroll.c (end_scroll): Adapt to call pcx_load_from_rsc. * src/extras.c (add_extra_in_user_directory): Adapt to get the extra directory from resource. * src/gfx_reader.h (graphic_reader): Adapt to get filenames from resources. * src/hedlite.c (tile_set_name,dallepie): Rewrite as dynamic arrays. (hmain): Adapt to fill those arrays, and read images from resources. * src/heroes.c (load_level,load_level_from_number, load_random_level,load_random_wrapped_level, play_menu,read_level_list): Adapt to read filenames and dirnames from resources. (play_game): Append the directory name to level_name, taken from resources. (main): Setup the data-dir resource. Adapt to read filenames for heroesrc and pictures from resources. * src/intro.c (show_intro): Read all pictures using resources. * src/menus.c (load_tile_set_preview,editor_menu): Adapt to read files from resources. * src/txts.c (read_txti_cfg): Likewise. * src/misc.c (strappend): New. * src/misc.h (strappend): New. 2000-07-27 Alexandre Duret-Lutz * src/intro.c (show_intro): At stratup, fill the black side of the screen. Do not display the buffer until the palette is set, or the buffer updated. 2000-07-27 Alexandre Duret-Lutz * configure.in: Use `#' for comments, not `dnl', so they can be read in the configure script. 2000-07-27 Alexandre Duret-Lutz * configure.in: Ensure that -DNDEBUG gets added to CFLAGS even when the user has specified its own CFLAGS (unless --enable-debug). 2000-07-27 Alexandre Duret-Lutz * doc/heroes.texi (Overview): Rewords the description of the game using Daniel Burrow's input. * README: Likewise. * doc/heroes.texi (Contributors): Update. * THANKS: Update. 2000-07-26 Alexandre Duret-Lutz Add mouse support with SDL 1.0.x. * src/keyb.c [HAVE_SDL] (SDL_BUTTON_LEFT,SDL_BUTTON_MIDDLE, SDL_BUTTON_RIGHT): Define these macros if missing. [HAVE_SDL] (process_input_events): Don't use SDL_MOUSEEVENTMASK since SDL 1.0.x does not define this, use SDL_MOUSEMOTIONMASK, SDL_MOUSEBUTTONDOWNMASK and SDL_MOUSEBUTTONUPMASK instead. 2000-07-26 Alexandre Duret-Lutz * configure.in: Quote variable substitutions in calls to test. 2000-07-22 Alexandre Duret-Lutz * configure.in: Change version to 0.5. 2000-07-21 Alexandre Duret-Lutz Support for VPATH builds. * src/etc/Makefile.am (heroesrc): Don't use broken `$<' variable, adapt for VPATH builds. * man/Makefile.am (heroes.6): Depends on argv.c rather than argv.o. * src/extralvl/Makefile.am (x_DATA): Adapt for VPATH builds. * src/hedit/Makefile.am (x_DATA): Likewise. * src/level/Makefile.am (x_DATA): Likewise. * src/rsc/Makefile.am (x_DATA): Likewise. * src/sfx/Makefile.am (x_DATA): Likewise. * src/sprites/Makefile.am (x_DATA): Likewise. * src/mod/Makefile.am (x_DATA,EXTRA_DIST): Likewise. (sound.conf): Don't use broken `$<' variable, adapt for VPATH builds. * NEWS: Update. Fix a bug introduced by a previous patch (`make distclean' produced an error when configured with sound support). * configure.in: Define the NOSOUND consitional. * src/Makefile.am (DIST_SUBDIRS): New. (DISTCLEANFILES): Define only if NOSOUND (otherwise mod/Makefile and sfx/Makefile would be removed before being called). 2000-07-21 Alexandre Duret-Lutz * NEWS: Update. * TODO: Update. * README: Update. * doc/heroes.texi: Update. * misc/heroes.xpm: New file. 2000-07-19 Alexandre Duret-Lutz Use authors and titles from the config file in the CD deck. * src/const.c (font_deck_img): New. * src/const.h (font_deck_img): New. * src/draw.c (deck_text_conv,draw_deck_text): New. * src/draw.h (draw_deck_text): New. * src/heroes.c (soundtrack_author_list): Remove. (jukebox_menu,pause): Display title and author using draw_deck_text. (main): Load and unload font_deck_img. * src/sound.c (soundtrack_author,soundtrack_title): New. (unload_soundtrack,load_soundtrack_from_alias): Update soundtrack_author and soundtrack_title. * src/sound.h (soundtrack_author,soundtrack_title): New. * src/font_deck.h: New file. * src/Makefile.am (heroes_SOURCES): Add font_deck.h. * src/sprites/fontdeck.pcx: New file (binary). 2000-07-19 Alexandre Duret-Lutz * src/Makefile.am (DISTCLEANFILES): Remove mod/Makefile, sfx/Makefile and sfx/sound.conf. 2000-07-19 Alexandre Duret-Lutz * src/etc/Makefile.am (EXTRA_DIST): Distribute heroesrc.in, not heroesrc. * src/mod/Makefile.am (EXTRA_DIST): Distribute sound.conf.in, not sound.conf. 2000-07-18 Alexandre Duret-Lutz Install a system-wide configuration file, and use it to define soundtrack filenames. * configure.in: Define $etcdir as ${datadir}/heroes/etc/ and enable substitution in *.in files. Generate src/etc/Makefile * src/Makefile.am (SUBDIRS): Add etc. * src/heroes.c (main): Read the system-wide config file. * src/musicfiles.c (get_sound_track_from_alias): Test the end of the right list when looking for the alias. (init_sound_track_list): Make the function empty (all the work is done from the config file). * src/userconf.c (read_userconf): Use the file argument, when not 0. * src/etc/Makefile.am: New file. * src/etc/heroesrc.in: New file. * src/mod/Makefile.am (x_DATA): Install sound.conf. (CLEANFILES): Delete sound.conf. (sound.conf): New. * src/mod/sound.conf.in: New file. 2000-07-18 Alexandre Duret-Lutz Display only user's levels in editor menus. * src/extras.c (extra_user_nbr): New. (cmp_filenames): Rename to ... (cmp_extralevels): ... this. Sort the user-levels first. (browse_extra_directory): Update extra_user_nbr. Adapt to call cmp_extralevels. (free_extra_list): Reset extra_user_nbr. * src/extras.h (extra_user_nbr): New. * src/menus.c (editor_selector,editor_menu, editor_first_menu): Use extra_user_nbr instead of extra_nbr. 2000-07-18 Alexandre Duret-Lutz * src/Makefile.am (CLEANFILES): Remove keysdef-inc.h. (keysdef-inc.h): Depends on config.h. 2000-07-17 Alexandre Duret-Lutz * src/extras.c (browse_extra_directory): Set full_name attribute. 2000-07-16 Alexandre Duret-Lutz Write edited levels in ~/.heroes/levels/. Rewrite the extradir code to read that directory, and handle a list of directory to search levels into (this list is browsed again each time the level editor exits). * src/extras.h (extra_level_t): New. (extra_selected_list): Change type to extra_level_t*. (browse_extra_directory): Remove. (make_extra_list): Remove. (add_extra_directory): New. * src/extras.c (extradir_info_t,edir): New. (extra_selected_list): Change type to extra_level_t*. (cmp_filenames): Adapt to compare extra_level_t. (browse_extra_directory): Take a new argument is_in_user_dir to initialize extra_level_t structure. Don't sort the list any more. (browse_extra_directories): New. Sort the list. (add_extra_directory,add_extra_in_user_directory): New. (make_extra_list): Rename into ... (add_default_extra_directories): ... this. Add ~/.heroes/levels directory. (free_extra_list): Adapt to free extra_level_t. * src/hedlite.h (hedlit_output_dir,levels_output_dir): New. (create_levels_output_dir): New. * src/hedlite.c (levelnom): Remove. (select_,boitask,asknew,askold): Remove. (create_levels_output_dir): New. (hmain): Removed commented out code. Call create_levels_output_dir. Handle level filename. * src/heroes.c (load_random_level): Adapt to extra_level_t. (main): Adapt to call add_default_extra_directories and browse_extra_directories. * src/menus.c (extra_menu,editor_selector,editor_menu): Adapt to extra_level_t. (editor_menu): Call browse_extra_directories instead of make_extra_list. * src/userconf.c (read_userconf): Call browse_extra_directories instead of make_extra_list. * src/userdir.c (exists_userdir): Rename into ... (exists_dir): ... this. Take the directory to test in argument. (setup_userdir): Adapt call to exists_dir. * src/userdir.h (exists_dir): New. 2000-07-15 Alexandre Duret-Lutz Fix two bugs occuring when using GGI. * src/hedlite.c (gestclav): Handle `^F' manualy (needed with GGI). * src/menus.c (editor_menu): Transform `if's in `else if's to prevent an arrow keysyms from being used in the level name field. 2000-07-15 Alexandre Duret-Lutz Document the level editor. * doc/heroes.texi (Top): Add a detailed node listing. (Level editor): New section. 2000-07-15 Alexandre Duret-Lutz Allow modification of `speed' and `stop' tile parameters in level editor. * src/hedlite.h (fnptr): Add speed_mod and stop_mod. (speed_mod): New. (stop_mod): New. * src/structs.h (spd_test): Make visible by removing test for __HEDLITE__. 2000-07-15 Alexandre Duret-Lutz Support for key modifiers in level editor. * src/hedlite.c (gestclav): Add an extra parameter for the modifiers state. Support keys that was not yet supported. (gestsrs1,gestsrs2,gestsrs3,hmain): Adapt calls to gestclav. * src/keyb.c (keyboard_modifiers): New. (init_keyboard_map): Reset keyboard_modifiers. (process_input_events): Update keyboard_modifiers. [HAVE_PKG_GGI] (get_key): Rewrite to allow update of keyboard_modifiers. [HAVE_SDL] (get_key): Update keyboard_modifiers. * src/keyb.h (keyboard_modifiers): New. * keys_heroes.h (HK_MOD_None,HK_MOD_Shift,HK_MOD_Ctrl, HK_MOD_Alt,HK_MOD_Meta): New. (HK_f): New. 2000-07-15 Alexandre Duret-Lutz Handle relative mouse moves in level editor. Make the full view work. * src/hedlite.c (affplan): Call vsynchro. (planfull, gestsrs1): Handle relative moves where needed. 2000-07-14 Alexandre Duret-Lutz Factorize endian-swaping of level infos into hendian.{h,c} and patch the leveleditor to swap read and saved files. * src/Makefile.am (heroes_SOURCES): Add hendian.c and hendian.h. * src/hedlite.c (save_pcx): BSWAP* header attributes. (hmain): Call bswap_level_header and bswap_level_tiles after reading and before writting. * src/heroes.c (load_level): Replace explicit calls to BSWAP* by calls to bswap_level_header and bswap_level_tiles. * src/hendian.h: New file. * src/hendian.c: New file. 2000-07-14 Alexandre Duret-Lutz * src/heroes.texi: Add two missing node descriptions. 2000-07-14 Alexandre Duret-Lutz Point people to the heroes-discuss mailing list and other SourceForge services. * src/argv.c (print_help): Change the `reports bug to:' email. * doc/heroes.texi (Getting Heroes): Add sourceforge URLs for project home page, download, and CVS. (Mailing list): New section. (Bug Reporting): Change email. Suggest sending snapshots of problems. 2000-07-13 Alexandre Duret-Lutz Mouse support with via SDL. * src/keyb.c [HAVE_SDL] (mouse_show, mouse_hide, update_mouse_state): Implement these functions. [HAVE_SDL] (handle_mouse_events): New. [HAVE_SDL] (process_input_events): Call handle_mouse_events. * src/hedlite.c (departfix, hmain): Remove useless call to mouse_show and mouse_hide. 2000-07-13 Alexandre Duret-Lutz * doc/heroes.texi (Libraries): Reword LibMikMod description. (Troubleshooting): Reword a paragraph in subsection `SegFault when using Alsa drivers. 2000-07-12 Alexandre Duret-Lutz * src/menus.c (extra_menu,editor_selector): Translate some hard-coded MS-DOS keycodes to Heroes' keysyms. 2000-07-12 Alexandre Duret-Lutz * doc/heroes.texi (Troubleshooting): Typos. 2000-07-12 Alexandre Duret-Lutz * doc/heroes.texi (Libraries): Link LibMikMod description to Troubleshooting. (Troubleshooting): Add the `SegFault with Alsa' section. 2000-07-11 Alexandre Duret-Lutz Link the level editor into the menu, and adapt the level editor to Heroes keycodes (most of them). Install editor data. * src/hedit/Makefile.am: New. * configure.in: Generate src/hedit/Makefile. * src/Makefile.am: Add hedit directory. * src/extras.c (free_extra_list): New. * src/extras.h (free_extra_list): New. * src/hedlite.c (majd,majg): Call vsynchro to update the display. (planfull,gestclav,gestsrs1,gestsrs2,gestsrs3,hmain): Replace hardcoded keyvalues by keysyms (most of them). (hmain): Clear the screen. * src/heroes.c: Remove unused include. (mouse_found): Set to 1 (should this variable be removed?). * src/keyb.c (update_mouse_state): New. (mouse_x,mouse_y,mouse_1,mouse_2,mouse_12): Call update_mouse_state. (process_input_events): Move mouse handling to update_mouse_state. * src/keys_heroes.h: Add new needed keysyms. * src/menus.c (editor_selector,editor_menu): Uncomment. (editor_menu): Adapt to call free_extra_list. 2000-07-10 Alexandre Duret-Lutz Shake the level editor code until it compile. * src/hedlite.c: Adapt signedness, change prototypes, (re)move functions, fix broken code, until it compile without warnings. * src/hedlite.h (hmain): Fix prototype. * src/Makefile.in (heroes_SOURCES): Add hedlite.c and hedlite.h. * src/keyb.c (mouse12): Return 1 if either button are pressed. * src/structs.c (param_u): Set size of the param array to 5, since param[4] was accessed in the code. 2000-07-10 Alexandre Duret-Lutz Preliminary mouse support (this is only the GGI implementation). * src/mouse.h: Delete. Move most of the declarations to ... * src/keyb.h: ... here. (init_mouse,mouse_show,mouse_hide,mouse_x,mouse_y, mouse1,mouse2,mouse12): Declare. * src/keyb.c (enable_mouse,mouse_pos_x,mouse_pos_y, mouse_button_left,mouse_button_right): New. (mouse_x,mouse_y,mouse1,mouse2,mouse12): New. [HAVE_PKG_GGI] (init_mouse,mouse_show,mouse_hide): New. [HAVE_PKG_GGI] (process_input_events): Rewrite the events processing loop as a switch and add mouse events handling. [HAVE_SDL] (init_mouse,mouse_show,mouse_hide): New. 2000-07-10 Alexandre Duret-Lutz * src/heroes.c (quit_yes_no): Remove unsed `flag' variable, and unused (#ifdefed-out) code. 2000-07-09 Alexandre Duret-Lutz Reading of sound config files. * src/heroes.c (main): Call init_sound_track_list before calling read_userconf. * src/musicfiles.c (read_config_file): Rename to ... (read_sound_config_file): ... this. Implement it (was empty). * src/musicfiles.h (read_config_file): Rename to ... (read_sound_config_file): ... this. * src/sound.c (init_sound_engine): Register all loaders so that the user is not limited to XMs. (load_soundtrack): Output a warning if the module couldn't be loaded. * src/userconf.c (read_userconf): Handle `soundconf:'. Close the input file. * doc/heroes.texi (heroesrc): Document it. 2000-07-09 Alexandre Duret-Lutz Sound configuration via -8 and -q options. * src/argv.c (hqmix,bits8): New variables. (print_help): Display -8 and -q options. (long_options): Add --8bits and --high-quality options. (parse_argv): Handle these options. * src/argv.h (hqmix,bits8): New variables. * src/sound.c (init_sound_engine): Set md_mode with respect to hqmix and bits8. * doc/heroes.texi (Options): Document these new options. (Troubleshooting): Add a `Sound errors' subsection. 2000-07-09 Alexandre Duret-Lutz * src/pcx.h (entete_): Rename to... (header_): ... this. Rename attributes as follow: bits_par_pixels -> bits_per_pixels largeur -> width hauteur -> height largeurdpi -> widthdpi hauteurdpi -> heightdpi nbrplans -> nbrplanes bytes_par_lignes -> bytes_per_lines palette_genre -> palette_kind (couleur_): Rename to ... (color_): ... this. And rename the `v' attribute to `g'. * src/pcx.c: Adapt to new names. (pcx_load): Swap endianess, if needed. * src/heroes: Adapt to new names. (save_pcx): Swap endianess, if needed. * src/intro.c (show_intro): Adapt to new names. * src/render.c: Adapt to new names. 2000-07-08 Alexandre Duret-Lutz Remove keywords (Id:) from all files to make switching to CVS easier (since there is binary files in the repository, -kb will be needed). 2000-07-06 Alexandre Duret-Lutz Preliminary big-endian support. * configure.in: Check for endianess. * src/endian.h: New file. * src/Makefile.am (heroes_SOURCES): Add endian.h. * src/scores.c (bswap_scores): New. (write_scores,load_scores): Adapt to call bswap_scores. * src/savegame.c (compute_magic): Translate a comment. (bswap_save_records): New. (write_save_records,load_save_records): Adapt to call bswap_save_records. * src/options.c (bswap_options): New. (write_options,load_options): Adapt to call bswap_options. * src/heroes.c (load_level): Swap map_info, and level_map attributes. * src/structs.h: Translate some comments. (saved_game): Tag level points and lifes as unsigned. 2000-07-06 Alexandre Duret-Lutz * doc/heroes.texi (Libraries): Add a note to suggest using GGI instead of SDL. * README: Likewise. 2000-07-06 Alexandre Duret-Lutz Handle --full-screen with GGI too. * src/argv.c (long_options): Typo. * src/display.c (full_screen): New. (set_full_screen_mode): The full_screen to 1. (init_video): Set the recommanded video mode, if full_screen. (vsynchro): CrossBlit the rendered buffer centered in the visual. * doc/heroes.texi (Options): Updated. 2000-07-06 Alexandre Duret-Lutz Bug fix. * configure.in: Disable joystick support if neighter libGII or support from SDL are available.. 2000-07-06 Alexandre Duret-Lutz SDL needs a special flag parameter to do full screen. * src/argv.c (print_help,long_options,parse_argv): Handle -F or --full-screen. * src/display.c [HAVE_PKG_GGI] (set_full_screen_mode): New. [HAVE_SDL] (visu_options,set_full_screen_mode): New. [HAVE_SDL] (init_SDL): Use visu_options. * src/display.h (set_full_screen_mode): New. 2000-07-05 Alexandre Duret-Lutz Reinterpret level_header_t.soundtrack_name as an alias which could be linked to any soundtrack file. * src/sound.h [HAVE_MIKMOD] (load_soundtrack_from_alias): New. [!HAVE_MIKMOD] (load_soundtrack_from_alias): New. [HAVE_MIKMOD] (unload_soundtrack,play_soundtrack): Don't do anything if no module loaded. * src/intro.c (show_intro): Adapt to call load_soundtrack_from_alias. * src/heroes.c (soundtrack_name): Remove. (load_level,jukebox_menu,play_menu,pause): Adapt to call load_soundtrack_from_alias. (main): Call init_sound_track_list. * src/musicfiles.h: New file. * src/musicfiles.c: New file. * src/generic_list.h: New file. * src/Makefile.am (heroes_SOURCES): Add generic_list.h, musicfiles.c and musicfiles.h. 2000-07-05 Alexandre Duret-Lutz * src/heroes.c (pause): Handle HK_Pause as an alias to HK_Escape. * userconf.c (read_userconf): Add a `;' to prevent a parsing error from lclint. 2000-07-04 Alexandre Duret-Lutz Handle multiple extra levels directories. * src/extras.c (make_extra_list): Rename to ... (browse_extra_directory): ... this. Take the directory in argument, handle error of scandir, append to (instead of overwriting) the the list of extra levels, sort the list. (make_extra_list): New. Call browse_extra_directory (extradir). (cmp_filenames): New. * src/extras.h (browse_extra_directory): New. * src/userconf.c (read_userconf): Call browse_extra_directory for each `extradir:' line. * doc/heroes.texi (heroesrc): Split the section in subsections for each keyword recognized (Option: and setenv:). (setenv:): New subsection. 2000-07-04 Alexandre Duret-Lutz Change --gfx-options to SDL_VIDEODRIVER with SDL. * src/display.c [HAVE_SDL] (set_display_params): Call setenv. * doc/heroes.texi (Heroes options,heroesrc): Document. 2000-07-04 Alexandre Duret-Lutz Bug fix. * acinclude.m4 (AC_caolan_CHECK_PACKAGE): Restore CFLAGS, LDFLAGS and CPPFLAGS with correct values. 2000-07-04 Alexandre Duret-Lutz Bug fix. * src/argv.c (long_options): --gfx-options should take one argument, no zero. 2000-07-03 Alexandre Duret-Lutz * src/keysdef.c: Typo. 2000-07-03 Alexandre Duret-Lutz * src/Makefile.am: Rename keysdef-gii.h and keysdef-sdl.h into keysdef-inc.h since they are never both used. * src/keysdef.c: Adapt to include keysdef-inc.h. 2000-07-03 Alexandre Duret-Lutz * src/Makefile.am (heroes_SOURCES): Add missing keys_heroes.h. 2000-07-03 Alexandre Duret-Lutz * configure.in: Change version to 0.4. * README: Update. * TODO: Update. * NEWS: Update. 2000-07-02 Alexandre Duret-Lutz Use 3rd and 4th buttons of first joystick if there is no second joystick to fill second joystick buttons states (this is used during the game for pause and quit). * src/joystick.c [HAVE_SDL] (joyinit): Get number of buttons for the first joystick. [HAVE_SDL] (get_joystick_state): Get the state of the 3rd and 4th buttons of first joystick if needed. 2000-07-02 Alexandre Duret-Lutz Support for `setenv:' in ~/.heroes/heroesrc. * src/userconf.c (read_userconf): Handle `setenv:' lines. * doc/heroes.texi (heroesrc): Document it. 2000-07-02 Alexandre Duret-Lutz Texinfo documentation. * Makefile.am (EXTRA_DIST): Remove HISTORY. (SUBDIRS): Add doc. * configure.in: Build doc/Makefile. Print info manual install path. * man/Makefile.am [HAVE_HELP2MAN] (heroes.6): Suppress the -N option (in order to have a pointer to the info manual). * doc/Makefile.am: New file. * doc/heroes.texi: New file. * doc/mdate-sh: New file. * HISTORY: Delete. * src/keys_heroes.h [HAVE_PKG_GGI] [HK_Enter]: Typo. 2000-07-01 Alexandre Duret-Lutz Joystick handling with SDL. * src/display.c (init_video): Move the call to SDL_Init to... (init_SDL): ... herem so that init_SDL can be called from joyinit(). (init_SDL) [HAVE_SDL_JOYSTICKOPEN]: Call SDL_Init with SDL_INIT_JOYSTICK. * src/joystick.h (is_joystick_up,is_joystick_right, is_joystick_down,is_joystick_left): Accept a slight variation arround 0 (+-8000). * src/joystick.c [HAVE_SDL_JOYSTICKOPEN] (joyinit, get_joystick_state): New. * configure.in: Check if SDL handles joysticks. 2000-07-01 Alexandre Duret-Lutz Call SDL_EnableKeyRepeat where available. * src/display.c [HAVE_SDL] (init_video) [HAVE_ENABLEKEYREPEAT]: Call SDL_EnableKeyRepeat. * configure.in: Check for SDL_EnableKeyRepeat. 2000-07-01 Alexandre Duret-Lutz * src/argv.c (print_help): Typo. * src/display.c [HAVE_SDL] (init_video): Print SDL error messages. 2000-07-01 Alexandre Duret-Lutz Rename --ggi-display in --gfx-options. * src/argv.c (print_help): Rename option in printed message. (long_options): Rename option. 2000-07-01 Alexandre Duret-Lutz Better ./configure support for linking with SDL from non-standard places. * configure.in: Rename --with-SDL to --with-sdl for consistency with other --with-sdl-* options. Rename *_SDL variables to *_sdl. Assume that --with-sdl-exec-prefix=DIR imply --with-sdl=DIR and vice versa. 2000-07-01 Alexandre Duret-Lutz --disable-joystick `support'. * src/joystick.c: Move code under #ifdef JOYSTICK_SUPPORT and #ifdef HAVE_PKG_GII. [JOYSTICK_SUPPORT,HAVE_PKG_GII] (joyinit): Suggest -J options if no joystick detected. [!JOYSTICK_SUPPORT] (joyinit,get_joystick_state): New. * acconfig.h [HAVE_PKG_GII]: New. * configure.in: Add support for --disable-joystick. Change configuration status display to print selected libraries. 2000-07-01 Alexandre Duret-Lutz Concat keymap.* and keyb.*. Remove keymap.*. * src/keymap.h (get_key,key_ready): Move to ... * src/keyb.h (get_key,key_ready): ... here. * src/keymap.c (get_key,key_ready): Move to ... * src/keyb.c (get_key,key_ready): ... here. * src/keymap.h: Delete. * src/keymap.c: Delete. * src/Makefile.am (source_HEROES): Remove src/keymap.h amd src/keymap.c. * src/endscroll.c: Include keyb.h instead of keymap.h. * src/menus.c: Likewise. * src/heroes.c: Likewise. * src/const.c: Likewise. Interface with SDL. * src/display.c: Include config.h, and move existing code under #ifdef HAVE_PKG_GGI. [HAVE_SDL] (visu,screen,set_display_params,init_video, uninit_video,set_color,set_pal,vsynchro): New interface with SDL. * src/keymap.c: Move code under #ifdef HAVE_PKG_GGI. [HAVE_SDL] (process_input_events,uninit_keyboard_map,get_key, key_ready): New interface with SDL. * keys_heroes.h: Move definitions under #ifdef HAVE_PKG_GGI. [HAVE_SDL] (KH_*): New definitions for SDL. Misc. * src/heroes (play_game): Use HK_Enter instead of HK_Return. * configure.in: Define DEBUG when --enable-debug. 2000-06-30 Alexandre Duret-Lutz Preliminary support for SDL. * acconfig.h [HAVE_PKG_LibGGI]: Rename to ... [HAVE_PKG_GGI]: ... this. * Makefile.am (EXTRA_DIST): Add HISTORY. * configure.in: Add support detection of SDL. Add option --with-SDL. Handle choice between GGI and SDL. Replace all occurance of LibGGI by GII. Use $GGI_include to search for ggi/keyboard.h. Fix the use of --enable-mem-debug. * acinclude.m4 (AC_caolan_CHECK_PACKAGE): Cosmetic change. * src/Makefile.am (heroes_SRC): Remove keysdef-gii.h. [GGI] (BUILT_SOURCES): Set to keysdef-gii.h. [GGI] (keysdef-gii.h): Rule to make keysdef-gii.h. [SDL] (BUILT_SOURCES): Set to keysdef-sdl.h. [SDL] (keysdef-sdl.h): Rule to make keysdef-sdl.h. * src/keysdef.c: Include options.h. Include keysdef-ggi.h or keysdef-sdl.h with respect to HAVE_PKG_GGI and HAVE_SDL. 2000-06-30 Alexandre Duret-Lutz Move files around, to prepare the interfacing with some other library than LibGGI. * Makefile.am (heroes_SOURCES): Add keysdef-gii.h. (BUILT_SOURCES): Rename keysdef.c to keysdef-gii.h. (keysdef.c): Rename to ... (keysdef-gii.h): ... this. And adapt to produce #ifndef/#endif guards. * src/keysdef.h: Don't include ggi/keyboard.h anymore. * src/keysdef.c: New file. * src/menus.c: Include keysdef.h. * keys_heroes.h: Include ggi/keyboard.h instead of keysdef.h. * acinclude.m4: Remove occurence of `AM_PATH_GTK' to suppress a warning from autoreconf. 2000-06-30 Alexandre Duret-Lutz Centralize the definitions of used key in src/keys_heroes.h to make the interfacing with another library easiest. * src/keys_heroes.h: New file. * src/gfx_reader.h: Adapt to use keys_heroes.h. * src/options.c: Likewise. * src/menus.c: Likewise. * src/heroes.c: Likewise. * src/const.c: Likewise. 2000-06-24 Alexandre Duret-Lutz * configure.in: Change version to 0.3. * TODO: Update. * README: Update. * src/getshline.c: Include stdlib.h. 2000-06-23 Alexandre Duret-Lutz Smarter keyboard configurator: allow to assign a key already assigned. Don't use keyboard_map anymore. * src/menus.c (keyboard_menu): Use get_key and key_ready instead of keyboard_map. Assign GIIK_NIL to stolen keys. Jump on NIL keys when trying to quit. 2000-06-22 Alexandre Duret-Lutz Joystick(s?) handling. * src/joystick.h (joystick_x, joystick_y): Change signedness to signed. (joystick_limit_up,joystick_limit_right,joystick_limit_down, joystick_limit_left): Remove. (is_joystick_up,is_joystick_right,is_joystick_down, is_joystick_left): Redefine, using joystick_x and joystick_y. * src/joystick.c: Include ggi/gii.h. (joystick_x, joystick_y): Change signedness to signed. (joystick_limit_up,joystick_limit_right,joystick_limit_down, joystick_limit_left): Remove. (joystick): New variable. (joystick_x,joystick_y,joystick_b,joydetected): Set values. (_get_joystick_state,joyinit): Rewrite using libgii. (get_joystick_state): Adapt the call to _get_joystick_state. (is_joystick_up,is_joystick_right,is_joystick_down, is_joystick_left): Remove these useless macros. * src/heroes.c (play_demo,quit_yes_no,get_input_directions, play_game): Uncomment joystick handling code. (get_input_directions): Remove detection of joystick unplugging. (main): Call joy_init() if joystick handling not disabled. * src/const.c (key_or_joy_ready): Remove detection of joystick unplugging. (get_key_or_joy): Return correct KeySyms. * src/argv.c (print_help): Display -J and --no-joystick options. (long_options): Rename joystick-off to no-joystick. (parse_argv): Handle -J. 2000-06-22 Alexandre Duret-Lutz Suppress warning for unused parameters in empty functions. * src/sound.c [HAVE_MIKMOD] (update_thread): Flag parameter as unused. [!HAVE_MIKMOD] (update_thread,decode_sound_options): Likewise. * src/sfx.c [!HAVE_MIKMOD] (load_sfx_mode,event_sfx): Likewise. * src/joystick.c [!HAVE_MIKMOD] (_get_joystick_state): Likewise. * src/draw.c (draw_demo_stick): Likewise. 2000-06-21 Alexandre Duret-Lutz * src/heroes.c: Translate all comments to English. (reinit_player): Rename `flag' to `unusable', move the declaration of `bitfl' in the loop where it is used. (main) [PORT]: Remove obselete code. 2000-06-21 Alexandre Duret-Lutz Handles -G and --ggi-display options. * src/display.h (set_display_params): New function. * src/display.c: Include string.h and dmalloc.h. (display_params): New variable. (set_display_params): New function. (init_video): Pass display_params to ggiOpen. Test return values of ggiOpen for errors. * src/argv.c (print_help): Display -G and --ggi-display options. (long_options): Declare -G and --ggi-display options. (parse_argv): Handles them. 2000-06-21 Alexandre Duret-Lutz * src/sound.c [!HAVE_MIKMOD]: Include stdio.h. [!HAVE_MIKMOD] (decode_sound_options): Add the argv0 parameters. 2000-06-18 Alexandre Duret-Lutz Support for sound and sfx volumes. * src/sound.c (set_volume): Set md_musicvolume. (halve_volume): Likewise. * src/sfx.c (event_sfx): Set the sample volume. 2000-06-18 Alexandre Duret-Lutz Support for options setup in ~/.heroes/heroesrc. Always create ~/.heroes/ directory. * src/heroes.c: Always include userdir.h. (main): Always setup userdir. Call read_userconf before parse_argv. * acconfig.h (USER_DIR): Remove * configure.in: Check for prototypes support. Suppress handling of USER_DIR. * src/Makefile.am (UDSRC): Remove. (EXTRA_DIST): Remove userdir.c and userdir.h. (heroes_SOURCES): Add userdir.c, userdir.h, getshline.h, getshline.c, userconf.c, and userconf.h. * src/argv.c (print_help): Display a pair of lines about ~/.heroes/heroesrc. (parse_argv): Reset optind to 0 so that parse_argv can be called multiple times. * src/userconf.h: New file. * src/userconf.c: New file. * src/getshline.h: New file. * src/getshline.c: New file. Move MikMod specific options parsing to sound.c. * src/sound.h (nth_driver, driver_option): Remove. (decode_sound_options): New. * src/argv.c (parse_argv): Move the 'd' case to decode_sound_options above. * src/argv.c (get_int): Move to... * src/sound.c (get_int): ...here. Missing include for dmalloc.h. * src/misc.c [HAVE_DMALLOC]: Include dmalloc.h. 2000-06-18 Alexandre Duret-Lutz Support for dmalloc or electric fence. * src/txts.c [HAVE_DMALLOC]: Include dmalloc.h. * src/start.c [HAVE_DMALLOC]: Likewise. * src/sound.c [HAVE_DMALLOC]: Likewise. * src/sfx.c [HAVE_DMALLOC]: Likewise. * src/endscroll.c [HAVE_DMALLOC]: Likewise. * src/pcx.c [HAVE_DMALLOC]: Likewise. * src/menus.c [HAVE_DMALLOC]: Likewise. * src/intro.c [HAVE_DMALLOC]: Likewise. * src/heroes.c [HAVE_DMALLOC]: Likewise. * src/hedlite.c [HAVE_DMALLOC]: Likewise. * src/extras.c [HAVE_DMALLOC]: Likewise. * src/userdir.c [HAVE_DMALLOC]: Likewise. * acconfig.h: Remove useless #undefs. * configure.in: Add comments. Add option --enable-mem-debug. Check for dmalloc or else efence. 2000-06-18 Alexandre Duret-Lutz Support for sound driver selection and arguments passing. * src/sound.h (print_drivers_list,nth_driver,driver_options): New. * src/sound.c (print_drivers_list,nth_driver,driver_options): New. (init_sound_engine): Initialize md_device with nth_driver. Call MikMod_Init qith driver_options. * src/argv.c (print_help): Display -n and -d options. (get_int): New. (long_options): Add -n and -d options. (parse_argv): Handle -n and -d options. 2000-06-03 Alexandre Duret-Lutz * configure.in: Change version to 0.2. * TODO: Update. * README: Update. * THANKS: Update. * src/sfx/Makefile.am: New (was missing). Various (signedness) cleanups. * configure.in: Suppress -Wno-implicit flag, add -W. * src/txts.c (read_txti_cfg): nbr is now unsigned. * src/sound.h (setup,sync,error): Remove. * src/sound.c (setup,sync,error): Likewise. * src/savegame.c (checksaverec): i is now unsigned. * src/render.c (draw_lemming): Take unsigned pos as argument. (draw_level): Adapt to signedness changes of other variables. * src/gfx_reader.h (draw_text_help): Switch const and static tags in declaration of colorhelp. * src/structs.h (level_info_t): Cosmetic changes. Score and score_delta are now unsigned. * src/pcx.c (pcx_load): compteur is now unsigned. * src/menus.c: #include misc.h. * src/heroes.c (load_level,compute_corner,ia_eval_dir_target, update_player): Adapt to signedness changes of other variables. (draw_round_info): Supress unused `l' argument. Adapt all callers. * src/const.h (camera_x,camera_y,corner_x,corner_y,corner_dx, corner_dy,inert_x,inert_y,nbr_tiles_cols,nbr_tiles_rows, map_info_2xt,map_info_2yt): Now unsigned. * src/const.h (camera_x,camera_y,corner_x,corner_y,corner_dx, corner_dy,inert_x,inert_y,nbr_tiles_cols,nbr_tiles_rows, map_info_2xt,map_info_2yt): Likewise. (map_info): Complete initalizer. * src/argv.c: #include string.h 2000-06-03 Alexandre Duret-Lutz * src/sfx/*.raw : Convert each .raw file into ... * src/sfx/*.wav : ... a .wav file. 2000-06-03 Alexandre Duret-Lutz * src/txt_cfg/txti.cfg: Fix a spelling mistake. * src/txt_cfg/heroes.hlp: Transform `COMMERCIAL INFORMATION' into `CONTACT'. Change the homepage address, add a bug report e-mail. Point to the THANKS file for extra credits. 2000-06-03 Alexandre Duret-Lutz * src/heroes.c (jukebox_menu): Remove credit for EOS and MIDAS. Point to the file THANKS instead. 2000-06-03 Alexandre Duret-Lutz Support for --disable-sound in sfx.c. * src/sfx.c [!HAVE_LIBMIKMOD] (read_sfx_conf,close_sfx_handle, load_sfx_mode,free_all_sfx,event_sfx): New (dummy) fonctions. 2000-06-03 Alexandre Duret-Lutz Support for sound effects. * src/sound.h (mono): Remove. * src/sound.c (mono): Remove. (init_sound_engine): Switch to mono if --mono. (play_soundtrack): Set number of SFX voices. * src/sfx.c: Port all #ifdef'ed-out code. Translate comments. * src/sfx/sfx.cfg: Translate comments. Adapt the file (list .wav, use a space to separate first letter from number). * configure.in: Include sfx un musicdir. Generate src/sfx/Makefile. * src/argv.h (mono): New variable. * src/argv.c (mono): New variable. (print_help): Print help for --mono. (long_options): Add mono. (parse_argv): Handle mono. 2000-06-03 Alexandre Duret-Lutz Suppress the `orange line' bug when playing a two player game. * src/const.c (glenz): Change type from char to unsigned char. * src/const.h (glenz): Likewise. 2000-06-01 Alexandre Duret-Lutz Save options|saves|scores files in ~/.heroes/ by default. * src/scores.c (SCORES_FILE,name,scores_file): New. (write_scores,load_scores): Use scores_file. * src/savegame.c (SAVES_FILE,name,saves_file): New. (write_save_records,load_save_records): Use saves_file. * src/options.c (CONFIG_FILE,name,options_file): New. (write_options,load_options): Use options_file. (reinit_options): Use GII symkeys for default player keys. * src/heroes.c (main) [USER_DIR]: Call setup_userdir. * src/misc.h (strcat_alloc): New. * src/misc.c (strcat_alloc): New. * src/userdir.h: New file. * src/userdir.c: New file. * acconfig.h: Add USER_SCORES_FILE, USER_CONFIG_FILE, USER_SAVES_FILE, USER_DIR. * configure.in: Add --disable-user-config, --disable-user-scores, and --disable-user-saves options. * src/Makefile.am (heroes_SOURCES): Include userdir.c and userdir.h if needed. (EXTRA_DIST): New. * src/txt_cfg/Makefile.am (x_DATA): Empty (don't install scores.dat). (y_DATA): Empty (don't install options.dat and savegame.dat). 2000-05-31 Alexandre Duret-Lutz * src/heroes.c (enter_your_name): Use delete or backspace. (play_game): Likewise (in "savegame" menu). * src/menus.c (editor_menu): Likewise. 2000-05-30 Alexandre Duret-Lutz * src/display.c (init_video): Try to get 8bits display mode before any other depth. 2000-05-29 Alexandre Duret-Lutz A smarter way to search for LibGGI. * acconfig.h (HAVE_PKG_LibGGI): New. * configure.in: Use AC_caolan_CHECK_PACKAGE to search LibGGI. * acinclude.m4 (AC_caolan_CHECK_PACKAGE): New. 2000-05-29 Alexandre Duret-Lutz Better keyboard handling (use GII unified scancodes, and display the correct names). * src/menus.c (search_keyname): New. (draw_key): Use search_keyname. (keyboard_menu): Don't limit scancodes to 8bits, use keysyms. * src/keyb.h (KEY_MAX): Change value from 0xff to 0xffff. * src/keyb.c: Don't include keysdef.h. (process_input_events): Use key.label instead of key.number. * src/heroes.c: Don't include keysdef.h. (play_demo,pause,get_input_directions,play_game): Use keysyms. * src/Makefile.am (heroes_SOURCES): Add keysdef.c. (BUILT_SOURCES): New. (keysdef.c): New. * src/keysdef.h: Erase the old file. This now defines struct keynames_s. * configure.in: Figure out where is ggi/keyboard.h. Test for cpp, and awk. 2000-05-27 Alexandre Duret-Lutz Draw in memory before bliting to visual with any depth. Original patch from Pierre Baillet . * src/display.c (render_visu): New. (init_video): Open render_visu and acquire a direct-buffer in render_visu. visu has now an unconstrained depth. (uninit_video): Close render_visu. (set_color): Set color in render_visu too. (set_pal): Set colors in render_visu too. (vsynchro): CrossBlit from render_visu to visu. * src/keyb.c (init_keyboard_map): Cosmetic cleanup. Suppress a buffer overflow. * src/pixelize (pixel16inline2): Rename to... (pixel_16_inline_2): ... this. Draw one line less. (pixelize_16): Adapt. (pixel32inline2): Rename to... (pixel_32_inline_2): ... this. Draw one line less. (pixelize_32): Adapt. (pixel64inline2): Rename to... (pixel_64_inline_2): ... this. Draw one line less. (pixelize_64): Adapt. 2000-05-25 Alexandre Duret-Lutz * src/intro.c (show_intro): Don't show wrong copyright info. * src/txt_cfg/heroes.hlp: Update copyright info. 2000-05-25 Alexandre Duret-Lutz * src/heroes.c (play_game): Fix handling of escape in savegame menu. 2000-05-25 Alexandre Duret-Lutz * src/keyb.c (process_input_events): Read and ignore KeyRepeat events so that further calls of get_key don't see them. 2000-05-24 Alexandre Duret-Lutz * src/sound.c (init_sound_engine): Register only the xm loader. * TODO: Updated. 2000-05-24 Alexandre Duret-Lutz * src/heroes.c (play_game): Suppress an infinite loop when waiting for the Escape key by calling process_input_event. * src/keyb.h (KEY_MAX): New. (keyboard_map): Define using KEY_MAX. * src/keyb.c (keyboard_map): Likewise. (init_keyboard_map): Use KEY_MAX. (process_input_events): Ensure that keyboard_map won't overflow. 2000-05-24 Alexandre Duret-Lutz More arguments fixes... * src/argv.c (long_options): Clean up. Correct values. 2000-05-24 Alexandre Duret-Lutz Fix a bug in argument handling. * src/argv.c (parse_argv): Handle 0 return from getopt_long. Remove cases that can be processed directly by getopt_long. Move long_option array out of parse_argv. 2000-05-24 Alexandre Duret-Lutz * configure.in: Evaluate $mandir before echoing. 2000-05-24 Alexandre Duret-Lutz From Jean Delvare . * src/display.c (init_video): Add newline to error message. 2000-05-24 Alexandre Duret-Lutz Don't supply help2man in the dist. * configure.in: Check for help2man. * man/Makefile.am: Build heroes.6 if HAVE_HELP2MAN. Strip one extra space. (EXTRA_DIST): Remove help2man. * man/help2man: Delete. * README: Updated. 2000-05-22 Alexandre Duret-Lutz * THANKS: New file. * Makefile.am (EXTRA_DIST): Add THANKS. 2000-05-22 Alexandre Duret-Lutz Better error handling when setting video mode. * src/display.c (init_video): Exit if correct video unavailable. * README: Update. Fix filenames modified by the big renaming patch. * src/intro/lezard.pcx: Renamed to ... * src/intro/erase.pcx: ... this. * savegame.c: Fix loaded filenames. * src/gfx_reader.h: Likewise. * src/pcx.c: Display filename on error. * src/heroes.c: Fix loaded file names. 2000-05-21 Alexandre Duret-Lutz Build a man page. * Makefile.am (SUBDIRS): Add man subdir. * configure.in: Check for perl. Output man/Makefile. Display $mandir. * src/argv.c (version): Don't indent authors. (print_help): Display help. * man/Makefile.am: New file. * man/help2man: New file. * src/draw.c: Cosmetic changes. 2000-05-20 Alexandre Duret-Lutz * TODO: Update. 2000-05-20 Alexandre Duret-Lutz Rename some source files. * src/vga_.c: Rename to ... * src/display.c: ... this. * src/vga_.h: Rename to ... * src/display.h: ... this. * src/sdf.c: Rename to ... * src/endscroll.c: ... this. * src/sdf.h: Rename to ... * src/endscroll.h: ... this. * src/readvga.h: Rename to ... * src/gfx_reader.h: ... this. * src/pixel.c: Rename to ... * src/pixelize.c: ... this. * src/pixel.h: Rename to ... * src/pixelize.h: ... this. * src/erreurs.c: Rename to ... * src/errors.c: ... this. * src/erreurs.h: Rename to ... * src/errors.h: ... this. * src/clavier.c: Rename to ... * src/keymap.c: ... this. * src/clavier.h: Rename to ... * src/keymap.h: ... this. * src/affvga.c: Rename to ... * src/draw.c: ... this. * src/affvga.h: Rename to ... * src/draw.h: ... this. * src/timer_.c: Rename to ... * src/timer.c: ... this. * src/timer_.h: Rename to ... * src/timer.h: ... this. * src/piece.h: Rename to ... * src/structs.h: ... this. * src/fonte.h: Rename to ... * src/font.h: ... this. * src/fontem.h: Rename to ... * src/font_menu.h: ... this. * src/fonteh.h: Rename to ... * src/font_help.h: ... this. * src/Makefile.am (heroes_SOURCES): Adjust. * Adjust all includers. 2000-05-20 Alexandre Duret-Lutz Rename all functions and global variables as given by the two columns below (left = old name, right = new one): affvga draw_text affvgaclipleft draw_text_clipped_left affvgaclipright draw_text_clipped_right affvgasin draw_text_waving affvga320 draw_text_320 affvga320 draw_text_waving_320 affvgatype draw_text_array affvga320type draw_text_array_320 afftyponus draw_text_bonus transp copy_rect_transp transp8 copy_rect_transp_8 transpred copy_rect_transp_red transp320 copy_rect_transp_320 transpz32 copy_32x32_transp_z copie4 copy_rect_4 copie2 copy_rect_2 copie2320 copy_rect_2_320 copie4320 copy_rect_4_320 demostick draw_demo_stick transpomb copy_rect_transp_shadow touche get_key toucheready key_ready explo1l fst_explo_list explo2l snd_explo_list tunnelsc tunnel_square_io radarcolor radar_trail_color collicolor radar_wall_color aleamode bonus_proba_array bonusint bonus_points roundsval rounds_nbr_values souscasedec square_offset_320 souscasedec384 square_offset modenames mode_name d2s d2w s2d w2d menu in_menu demo in_demo jukeboxfl in_jokebox frametot frame_cur framenew frame_old nbrdalles_x nbr_tiles_cols nbrdalles_y nbr_tiles_rows flag_x camera_stop_x flag_y camera_stop_y tmpbuffer render_buffer planinfo map_info planinfo2xt map_info_2xt planinfo2yt map_info_2yt planinfo2xwrap map_info_2xwrap planinfo2ywrap map_info_2ywrap fonte main_font_img icones icons_img vehic vehicles_img bonusa bonus_a_img bonusb bonus_b_img typonus bonus_font_img jukebox jukebox_img dalles tile_set_img deuxplr two_players trainloc trail_pos trainsens trail_way trainnbr trail_offset trainsize trail_size coulplr col2plr plrcoul plr2col plan level_map lastexplo last_explo doccup square_occupied dtsens square_way dradar square_radar_wall dcolli square_wall dexplo square_explosion dexplomorts square_dead_explosion dexploptr explo_list_ptr dexplox explo_list_pos_x dexploy explo_list_pos_y dexplonbr explo_nbr dexplot square_explosion_type dbonus tile_bonus dbonuscpu tile_bonus_cpu dbonustmp bonus_time dbonusptr bonus_ptr dbonuslook square2tile dwrap square_wrap dref square_offset2coord dcolor square_object nbrptibplr lemmings_per_players nbrptibtot lemmings_total dptib square_lemmings_list dtds square_dead_lemmings_list ptibsupport lemmings_support dbonusnbr bonus_total_nbr dbonusnbre bonus_real_nbr dcolornbr objects_nbr dbonuscur next_bonus_to_update scacces square2offset decalbonus bonus_anim_offset radarpos radar_target_pos radarcurpos radar_current_pos gamemode game_mode gamemagic game_magic centerx camera_center_x clockanim clock_anim_offset ptibanim lemmings_anim_offset ptibdecal lemmings_move_offset invinc invincible demoready demo_ready demoflag demo_done touchejoyready key_or_joy_ready touchejoy get_key_or_joy glenzbox draw_glenz_box defpallum set_pal_with_luminance fatal fatal_error extralst extra_list extraflg extra_selected_list extranbr extra_nbr makeextralst make_extra_list fonteloc font_pos fontepre font_first_ascii fontetransp font_transp_color fonteY font_height fonteX font_width fontehelpX help_font_width dallenom tile_set_name glenznom glenz_name modulenom soundtrack_name levellst level_list levelnbr level_list_nbr levelinfo level_wrapped levelrndlst level_full_list levelrndnbr level_full_list_size questpos current_quest_level listemod soundtrack_list auteur soundtrack_author_list modnbr soundtrack_current_nbr modtime soundtrack_time levelfinished level_is_finished skip1stmoves ia_skip_firsts_moves evaldirmax ia_max_depth evaldirlvl ia_cur_depth evalinvinc ia_is_invincible evalplr ia_player targetx ia_target_x targety ia_targer_y midx ia_wrap_x midy ia_wrap_y lowmidx ia_wrap_left lowmidy ia_wrap_right DEMOTIME DEMO_DURATION affok enable_blit aleabonus bonus_proba aleabonustot bonus_proba_sum mousefound mouse_found txt txt_tmp txtbonus txt_bonus txtbonustempo txt_bonus_tempo play play_game randbonus random_bonus newbonus add_random_bonus newbonust add_bonus delbonus rem_bonus newcolor add_color newcash add_cash efface_plr erase_player reinitplr reinit_player loadlevel load_level endlevel unload_level calc_corner compute_corner sendrle write_rle savepcx save_pcx afftxtbonus draw_txt_bonus showtxtbonus show_txt_bonus jukeboxmenu jukebox_menu loadlvlpasrand load_level_from_number initrandlvllst compute_level_full_list freerandlvllst free_level_full_list randlvlpick random_level loadlvlrand load_random_wrapped_level loadlvlrandround load_random_level enteryourname enter_your_name playmenu play_menu outputscreen output_screen thetapoint theta_prime PASEULER EULER_STEP NBRPAS NBR_STEPS tempsecoule elapsed_time pendule_init pendulum_init pendule_un_pas pandulum_one_step pendule_maj pendulum_update growtrail grow_trail shrinktrail shrink_trail effacetrace erase_trail evaldist ia_eval_dist evaldirinline ia_eval_dir_target_inline evaldirbonusinline ia_eval_dir_bonus_inline evaldirecraseinline ia_eval_dir_lemming_inline evaldirdollarinline ia_eval_dir_cash_inline evaldircolorinline ia_eval_dir_color_inline evalposcote ia_eval_neighb_pos evaldir ia_eval_dir_target evaldirecrase ia_eval_dir_lemming evaldircolor ia_eval_dir_color evaldirdollar ia_eval_dir_cash evaldirbonus ia_eval_dir_bonus gototargetinline ia_goto_target_inline gotobonusinline ia_goto_bonus_inline gotoecraseinline ia_goto_lemming_inline gotocolorinline ia_goto_color_inline gotodollarinline ia_goto_cash_inline gototarget ia_goto_target gotobonusnear ia_goto_nearest_bonus gotoecrasenear ia_goto_nearest_lemming gotocolornear ia_goto_nearest_color gotodollarnear ia_goto_nearest_cash trouvesens find_free_way avplr update_player majexplo update_explo majptib update_lemmings majbonus update_bonus majall update_all playdemo play_demo prepdemo load_demo scoresmenu scores_menu mainmenu main_menu quit_yn quit_yes_no inputdir get_input_directions aff_endlevelinfo draw_end_level_info aff_roundinfo draw_round_info readlvllst read_level_list fadepal fade_pal introimg intro_img lezardata erase_data lezardatac erase_data_cur coulnbr color_nbr lezardcoulptr erase_color_ptr copiemoto1 copy_vehicle_1 copiemoto2 copy_vehicle_2 lezardcalc compute_erase_data lezard erase showintro play_intro joydetected joystick_detected joylimitup joystick_limit_up joylimitright joystick_limit_right joylimitdown joystick_limit_down joylimitleft joystick_limit_left _getjoystate _get_joystick_state getjoystate get_joystick_state isjoyup is_joystick_up isjoydown is_joystick_down isjoyleft is_joystick_left isjoyright is_joystick_right isjoybuta is_joystick_button_a isjoybutb is_joystick_button_b clavier keyboard_map instkbdhdl init_keyboard_map uninstkbdhdl uninit_keyboard_map keysdefstr key_string menufond background_menu controlmenu control_menu afftouche draw_key keybmenu keyboard_menu soundmenu sound_menu screenmenu screen_menu gamemenu game_menu extramenu extra_menu demoinfo demo_info optionmenu option_menu affquitmenu draw_quit_menu quitmenu quit_menu affplaymenu draw_play_menu affmainmenu draw_main_menu tilesnames tile_sets_names loadtilesprev load_tile_set_preview editselect editor_selector editormenu editor_menu editorpremenu editor_first_menu aff_savegameinfo draw_saved_games_info writeoptions write_options reinitoptions reinit_options loadoptions load_options scrsize screen_size scrmap radar_map scrglenz use_glenz scrinfo display_infos scrcont luminance scrinrt inertia mus music musvol music_volume sfxvol sfx_volume ctrlone ctrl_one ctrltwo ctrl_two autoone autopilot_one autotwo autopilot_two gameghost ghosts gamespeed speed gameplr player_color keysdef player_keys t_opt options_t d_haut d_up d_droite d_right d_bas d_down d_gauche d_left s_haut w_up s_droite w_right s_bas w_down s_gauche w_left c_bas c_down c_gauche c_left c_haut c_up c_droite c_right t_nbr type_nbr t_noms type_name sortie output nbrimages frame_nbr vitesse speed tunnel_s tunnel_t anim_s anim_t paramunion param_u numero number dallemem tile_t infodallemem tile_info_t depart start departsens start_way dallepcx tile_set_name lvlmodule soundtrack_name level_header level_header_t sens way nextsens next_way oldsens old_way oldsens2 old_old_way senstun tunnel_way sc square invcom inversed_controls scorepp score_delta turbol turbo_level turbolpp turbo_level_delta deform rotozoom sensroto rotozoom_direction deformgel waves deformgelbeg waves_begin invinc invincible vies lifes notdelay notify_delay tinv tunnel_inverse autopil autopilot comportement behaviour targ target nbrbonhommes lemmings_nbr nbrmartiens martians_nbr joueur player_t ptibonhomme lemming pts points topscore top_score savegame saved_game pixel1 pixelize_1 pixel2inline pixelize_2_inline pixel2 pixelize_2 pixel4inline pixelize_4_inline pixel4 pixelize_4 pixel8inline pixelize_8_inline pixel8 pixelize_8 pixel16inline pixelize_16_inline pixel16 pixelize_16 pixel32inline pixelize_32_inline pixel32 pixelize_32 pixel64inline pixelize_64_inline pixel64 pixelize_64 nbrlignes nbr_lines fonteh font_help_img helpics help_pics_img transphelp copy_rect_transp_help transphelpgl copy_rect_transp_help_with_glenz transphelpfgl copy_rect_transp_help_full_glenz affhelpvga draw_text_help showhelp show_help readvga graphic_reader partiel4b copy_tile dalletransp copy_tile_transp affbonus draw_bonus sousdalletransp copy_square_transp afftrail draw_trail_real affvehic draw_vehicle_tail affvehic2 draw_vehicle_head afftrain draw_trail afftrain2 draw_trail_tail transpbonh copy_lemming_transp affpyra draw_color affcash draw_cash affbonh draw_lemming transptache copy_dead_lemming_transp afftache draw_dead_lemming draw_lvl draw_level affradar draw_radar_map affscore draw_score afflogoinfo draw_logo_info aff_buffer_tmp1 display_buffer_tmp1 aff_buffer_dyna1 display_buffer_moving aff_buffer_half display_two_buffers aff_buffer_half_dyna1 display_two_buffers_moving aff_buffer_half_dyna2 display_two_buffers_moving_and_clear setmagic set_magic allocmagic compute_magic findmagic find_magic checksaverec check_save_records reinitsaverec clear_save_records writesaverec write_save_records loadsaverec load_save_records cmpscores cmp_scores sortscores sort_scores reinitscores clear_scores checkscores check_scores writescores write_scores loadscores load_scores sbuffer scroll_buffer sauts jumps couleurs colors fond background_img copiefond copy_background preppage draw_background affpage display_page defpalfade set_pal_fade renderpage render_background sdf end_scroll maxevent max_events filenamet filename_t sfxnames sfx_names sfxloaded sfx_loaded sfxhandles sfx_handles playhandles play_handles eventhdl event_handle maxsfx max_sfx virem remove_comments aspc forward_spaces readsfxcfg read_sfx_conf closesfxhdl close_sfx_handle msfx mark_sfx stgame std_sfx_set freeallsfx free_all_sfx loadsfxmode load_sfx_mode eventsfx event_sfx modvolume set_volume halfvolume halve_volume init_midas init_sound_engine close_midas uninit_sound_engine chargexm load_soundtrack videxm unload_soundtrack playxm play_soundtrack frametimer frame_timer installetimer init_timer desinstalletimer uninit_timer readsettimer read_and_reset_timer readsettimernozero read_and_reset_timer_non_zero readsettimer_withvalue read_and_set_timer_with_value updatetimer update_timer updatetimer_block update_timer_block maxtxti max_txti readtxticfg read_txti_cfg close_video uninit_video defcoul set_color defpal set_pal aff_buffer_def rotozoom_buffer aff_buffer_def_half rotozoom_half_buffer hlzoom horizontal_zoom_wave hlzoom2 horizontal_zoom_flip vlzoom vertical_zoom_wave whichligne which_line whichcol which_column whichoffset which_offset aff_buffer_gel wave_buffer aff_buffer_gel_half wave_half_buffer flippage flip_buffer coinglz corner_buffer_glenz coin1 corner_buffer_begin coin2 corner_buffer_middle coin3 corner_buffer_end coin corner_buffer visualsinit compute_lut 2000-05-20 Alexandre Duret-Lutz Misc cleanups. * src/sdf.c (texte): Remove. (sdf): Don't load srtattxt.pcx. * src/render (draw_lvl): Remove useless comments. * src/optionss.h (struct t_opt): Document blocs of options. * src/menus.c (editormenu): Lowercase newlevel.pcx. * src/intro.c (lezard): Cosmetic change in prototype. * src/extras.c (makeextralst): Remove old DOS code. * src/clavier.h (etatclav): Remove. * src/clavier.c (etatclav): Remove. * src/intro/Makefile.am (x_DATA): Add start.pcx. 2000-05-19 Alexandre Duret-Lutz Fix the extramenu bug. * src/misc.c (strupr): New. * src/misc.h (strupr): New. * src/menus.c (extramenu): Upper case the filenames before displaying them. * TODO: Remove associated entry. 2000-05-18 Alexandre Duret-Lutz * src/timer_.c (updatetimer): Typo. (installetimer): Init start_time. 2000-05-18 Alexandre Duret-Lutz * src/intro/Makefile.am (x_DATA): Specify the exact filenames. 2000-05-18 Alexandre Duret-Lutz Use gettimeofday to simulate the frame timer (don't use times anymore). * src/timer_.c: Use HAVE_SYS_TIME to #include the correct header. (start_time): Change type to struct timeval. (frame_lenght): Remove. (usec_frame_lenght): New. (frames_per_second): New. (installetimer): Don't try to compute the retrace time anymore, fix it to 70FPS instead. (readsettimer_withvalue,updatetimer): Adapted to use gettimeofday. (updatetimer_block): Comment added. * configure.in: Check for sys/time.h. 2000-05-17 Alexandre Duret-Lutz Add the intro and tweak the timer to wait the next frame in updatetimer_block. * src/intro.c (lezardata,lezardatac,lezardcoulptr): Now unsigned. (img2vram,copiemoto1,copiemoto2,lezardcalc, lezard,antialias,show_intro): Tag static. (lezard,antialias): Translated from assembly to C. * src/heroes.c (main): Call showintro. Call installtimer right after init_video. * src/Makefile.am (SUBDIRS): Add intro. (heroes_SOURCES): Add intro.c. * src/intro/Makefile.am: New file. * configure.in: Add $LIBS on linker flags status line. Generate src/intro/Makefile. * src/const.c (vsynch): Call updatetimer_block instead of updatetimer. * src/timer_.c (updatetimer_block): New. * src/timer_.h (updatetimer_block): New. 2000-05-17 Alexandre Duret-Lutz * configure.in: Guess canonical host. Exit if LibGGI is not usable. Add -NDEBUG to $CFLAGS. Display configuration status. * config.guess: New file. * config.new: New file. * acconfig.h (HOST): Added. * src/argv.c (version): Display canonical host. 2000-05-16 Alexandre Duret-Lutz Tag local functions with static. * src/sound.c (init_midas): Typo. (update_thread): Tag static. * src/sfx.c (filenamet,sfxnames,sfxloaded,sfxhandles, playhandles,eventhdl,maxsfx,tmp3,virem,stgame): #ifdef out. (readsfxcfg,closesfxhdl,freeallsfx,loadsfxmode,eventsfx): Remove extern tag. * src/scores.c (cmpscores,checkscores): Tag static. * src/savegame.c (setmagic,checksaverec): Tag static. * src/render.c (partiel4b,dalletransp,affbonus,sousdalletransp, afftrail,affvehic,affvehic2,afftrain,afftrain2,transpbonh, affpyra,affcash,affbonh,transptache,afftache): Tag static. * src/pixel.c (pixel2inline,pixel4inline,pixel8inline, pixel16inline,pixel16inline2,pixel32inline,pixel32inline2, pixel64inline,pixel64inline2): Tag static. * src/pcx.c (delta): Tag static. * src/menus.c (controlmenu,afftouche,keybmenu,soundmenu, screenmenu,gamemenu,extramenu,loadtilesprev,editselect, editormenu): Tag static. (loadtilesprev): Lowercase the strings. * src/joystick.c (_getjoystate): Tag static. 2000-05-16 Alexandre Duret-Lutz * configure.in: Add support for --disable-sound and --enable-debug. Add more compiler warning and optimization flags. * README (Installation): Document --disable-sound and --enable-debug. * src/Makefile.am (heroes_LDADD): Remove. * TODO: Update. 2000-05-15 Alexandre Duret-Lutz * TODO: Update. * README: Update. * HISTORY: New file. 2000-05-13 Alexandre Duret-Lutz Sound with MikMod and pthread. * src/sound.h (init_midas): Return status. * src/sound.c [HAVE_LIBMIKMOD]: Use Mikmod. [!HAVE_LIBMIKMOD]: Empty implemetation. * src/heroes.c (loadlevel): Downcase module name. (jukeboxmenu): Likewise. (pause): Likewise. (playmenu): Downcase filename. * acconfig.h: Add HAVE_LIBMIKMOD. * configure.in: Test for libmikmod. * acinclude.m4: Add AC_PATH_GENERIC macro. * src/mod/Makefile.am: New file. * TODO: Add some notes. 2000-05-10 Alexandre Duret-Lutz Handle command line options with getopt_long. * src/argv.h: New. * src/argv.c: New. * src/sfx.h (nosfx): Move to argv.h. * src/sfx.c (nosfx): Move to argv.c. * src/savegame.h (x10sav): Move to argv.h. * src/savegame.c: #include argv.h. (x10sav): Move to argv.c. * src/options.h (swapside): Move to argv.h. * src/heroes.c: #include argv.h. (levelnom): Remove. (play): Use level_name from argv.h instead of levelnom. (main): Remove all command line parsing code. (doublefx,snap,joyoff,devparm,loadulevel,directmenu, reinitsco,reinitopt,reinitsav): Moved to argv.h and argv.c. * src/render.c: #include argv.h. * src/Makefile.am (heroes_SOURCES): Add argv.c and argv.h. 2000-05-10 Alexandre Duret-Lutz A working autoconf/automake configuration. * src/sfx.c (readsfxcfg): Return 0. * src/Makefile.am (SUBDIRS): New. * src/txt_cfg/Makefile.am: New. * src/sprites/Makefile.am: New. * src/rsc/Makefile.am: New. * src/level/Makefile.am: New. * src/extralvl/Makefile.am: New. * acinclude.m4: New, defines AC_DEFINE_DIR. * configure.in: Use AC_DEFINE_DIR. 2000-05-09 Alexandre Duret-Lutz Some fixes, plus autoconf/automake installation. * src/sfx.c: #ifdef out all the code. * src/heroes.c: Rename to ... * src/heroes.h: ... this. * src/sdf.c: Adapt to #incluide heroes.h. * src/heroes.c: Likewise. * acconfig.h: Used to generate src/config.h. * src/config.h: Remove from project (generated by configure). * src/Makefile: Likewise. * src/level/demo.lst: Delete. * README: New file. * AUTHORS: New file. * NEWS: New file. * COPYING: New file. * INSTALL: New file. * Makefile.am: New file. * configure.in: New file. * src/Makefile.am: New file. * install-sh: New file. * aclocal.m4: New file. 2000-05-08 Alexandre Duret-Lutz Recode each source file from MSDOS to latin1 charset. Indent -br -ce each source file. Insert copyright header on top of each source file. 2000-05-08 Alexandre Duret-Lutz Handle keyboard events. * src/keyb.h (clavier): Don't need to be volatile anymore. (instkbdfil,uninstkbdfil,instkbdcc,uninstkbdcc): Remove. (process_input_events): New. * src/keyb.c: Likewise. * src/menus.c (keybmenu): Call process_input_events. * src/heroes.c (playdemo): Call process_input_events. (quit_yn): Use touchejoy instead of clavier. (play): Call process_input_events. Use touchejoy instead of clavier. (main): Remove calls to instkbdcc, instkbdfil, uninstkbdfil, uninstkbdcc. 2000-05-07 Alexandre Duret-Lutz * src/visuals.c (aff_buffer_def_half): Thinko. * src/timer_.h (readsettimer_withvalue): New. * src/heroes.c (loadlevel): Use it. * src/timer_.h (readsettimer_withvalue): New. (frame_lenght): New. (installetimer): Calculate frame_lenght. (updatetimer): Use frame_lenght. * src/readvga.c (transphelpfgl): Specify signedness of some char variables. * src/heroes.c (outputscreen): Likewise. 2000-05-07 Alexandre Duret-Lutz * src/visuals.c (aff_buffer_def_half): Handle the case where a full line may be black. * src/txt_cfg/options.dat: Overwrite. * src/render.c (affbonh,afftache): Correct use of ptibsupport. * src/heroes.c (loadlevel,endlevel): Likewise. * src/pixel.c (pixe8inline,pixe16inline,pixe32inline,pixe64inline): Correct wrong calculation. * src/readvga.c (showhelp): Use GII keysyms. * src/menus.c: Likewise. * src/heroes.c: Likewise. * src/clavier.h: #include ggi/keyboard.h. * src/const.h (touchejoy): Return int. * src/const.c (touchejoy): Likewise. 2000-05-07 Alexandre Duret-Lutz * src/visuals.c (aff_buffer_def): Write on 320 columns, not 319. (aff_buffer_def_half): Write on 160 columns, not 159. * src/vga_.c (init_video): Call ggiSetColorfulPalette. (defcoul,defpal): Scale colors by 1024. * src/render.c (partiel4b): Typo. (draw_lvl): Specify signedness of some char variables (or promote some other to int). * src/piece.h: Use proper syntax for __attribute__ ((packed)). * src/heroes.c: Various tweaks for timer. * src/const.c (vsynch): Update frametot. * src/Makefile (OBJ): Remove finfo.o. * src/timer_.c (updatetimer): Don't use CLOCKS_PER_SEC. 2000-05-07 Alexandre Duret-Lutz Interface with GGI. Replace timer stuff. Miscellaneous fixes. * src/vga_.h: Remove all DOS stuff. Specify signedness of some char variables (or promote some other to int). * src/vga_.c: Likewise. Interface with libggi. * src/timer_.h: Specify signedness of some char variables (or promote some other to int). * src/timer_.c: * src/sound.c (init_midas): Remove video mode switching. * src/sdf.c (sdf): Likewise. * src/intro.c (show_intro): Likewise. * src/menus.c: Remove tests of demoversion. * src/keyb.c: #ifdef out all the code. * src/joystick.c (_getjoystate): Do nothing. * src/heroes.c: Remove reference to finfo.h. Remove tests of demoversion. (readlevellst): Prevent NULL dereferencing. (main): Init srand from time(0). Call init_video and close_video. * src/extras.c: Free the correct buffer. * src/erreurs.c: Call close_video. * src/const.h (demoversion): Remove. (windaube): Remove. (frametot): Don't need to be volatile anymore. * src/const.c: Likewise. (vsynch): Use vsynchro and updatetimer. (prevr): Remove. * src/clavier.h (touche): Return int. (toucheready): Return int. * src/clavier.c (touche): Use ggiGetc. (toucheready): Use ggiKbhit. * Makefile (CFLAGS): Add debugging symbols. (LDFLAGS): Link with libggi. (OBJ): Remove intro.o and start.o. Add timer_.o and keyb.o. * src/timer_.c: New file (replace timer_.asm). * src/timer_.asm: Delete. * src/misc.h: New file (declare strlwr). * src/misc.c: New file (define it). * src/finfo.c: Delete. * src/finfo.h: Delete. 2000-05-06 Alexandre Duret-Lutz Translate assembly code back to C. * src/visuals.c (rotoinline): Remove. (aff_buffer_def): Add C code to replace rotoinline call. (rotoinline2): Remove. (aff_buffer_def_half): Add C code to replace rotoinline2 call. * src/render.c (partiel4b): Translate to C. * src/pixel.c (pixel2inline,pixel4inline,pixel8inline,pixel16inline,pixel16inline2, pixel32inline,pixel32inline2): Translate to C. (pixel2,pixel4,pixel8,pixel16,pixel32): Adapt. 2000-05-06 Alexandre Duret-Lutz Move all directory #definitions in the same file (src/config.h). * src/config.h: New file. * src/txts.c: #include src/config.h. * src/start.c: Likewise. (introdir): Remove. * src/sdf.c: Likewise. (introdir): Remove. * src/scores.c: Likewise. * src/savegame.c: Likewise. * src/readvga.c: Likewise. * src/options.c: Likewise. * src/menus.c: Likewise. * src/intro.c: Likewise. * src/heroes.c: Likewise. * src/hedlite.c: Likewise. (rscdir,nivdir,heddir,moddir): Remove. * src/finfo.c: Likewise. * src/extras.c: Likewise. (extradir): Remove. * src/const.c: Likewise. (spritedir,rscdir,nivdir,heddir,moddir,introdir,extradir): Remove. * src/sfx.c: Likewise. (sfxdir): Remove. * src/extras.h (extradir): Remove. * src/const.h (spritedir,rscdir,nivdir,heddir,moddir,introdir): Remove. * src/Makefile: New file. 2000-05-06 Alexandre Duret-Lutz For each X.c: #include X.h and solve the conflicts. * src/txts.c: #include txts.h * src/start.c: #include src/start.h. * src/sound.c: #include src/sound.h. * src/sfx.c: #include src/sfx.h. * src/sdf.c: #include src/sdf.h. * src/scores.c: #include src/scores.h. * src/savegame.c: #include src/savegame.h. * src/pixel.c: #include src/pixel.h. * src/options.c: #include src/options.h. * src/menus.c: #include src/menus.h. * src/keyb.c: #include src/keyb.h. * src/joystick.c: #include src/joystick.h. * src/intro.c: #include src/intro.h. * src/heroes.c: #include src/heroes.h. * src/heroes.h: Correct. * src/hedlite.c: #include src/hedlite.h. * src/finfo.c: #include src/finfo.h. * src/erreurs.c: #include src/erreurs.h. * src/const.c: #include src/const.h. * src/const.h: Correct. * src/clavier.c: #include src/clavier.h. * src/affvga.c: #include src/affvga.h. Specify signedness of some char variables (or promote some other to int) * src/affvga.h: Adapt. * src/hcdplay.h: Delete. * src/test.c: Delete. 2000-05-06 Alexandre Duret-Lutz Many changes allowing all the following files to compile : sfx.c pcx.c erreurs.c joystick.c clavier.c const.c options.c scores.c savegame.c intro.c vga_.c menus.c affvga.c extras.c visuals.c render.c start.c sound.c pixel.c finfo.c sdf.c txts.c misc.c. * src/visuals.h: Specify signedness of some char variables (or promote some other to int). * src/render.h: Likewise. * src/visuals.c: Likewise. #ifdef out some assembly code. * src/render.c: Likewise. * src/pixel.c: Likewise. * src/txts.c: Rewrite all `(*X)[]' as `*X'. * src/sound.c: #ifdef out Midas stuff left. * src/sfx.h (sxfrev): Remove. * src/sfx.c: Rewrite all `(*X)[]' as `*X'. Move freeallsfx arround. * src/sdf.c: Remove reference to mallox.h. * src/savegame.c: Minor fixes. * src/pcx.c: #include stdlib.h. * src/options.c: Reverse the order of functions. * src/menus.c: Add '{ }' arround many ambiguous if/else. Specify signedness of some char variables (or promote some other to int). * src/keybc.c: Remove reference to dos.h and conio.h. * src/intro.c: Remove reference to mallox.h. Specify signedness of some char variables (or promote some other to int). #ifdef out some assembly code. * src/fastmem.h: Typos. * src/extras.h: Rewrite all `(*X)[]' as `*X'. * src/extras.c (makeextralst): Use scandir to list extra levels. (select_file): New. * src/erreurs.c: Remove the MS-DOS part. * src/const.c: Specify signedness of some char variables (or promote some other to int). Rewrite all `(*X)[]' as `*X'. * src/affvga.c: Specify signedness of some char variables (or promote some other to int). Rewrite call to JUSTIF_CALL with empty parameter as `JUSTIF_CALC( )'. 2000-05-06 Alexandre Duret-Lutz Many changes allowing heroes.c to compile. * src/render.h (afftxtbonus): Remove. * src/readvga.c: Remove ref. to conio.h, specify signedness of some char variables (or promote some other to int). * src/optionss.h: Specify signedness of some char variables (or promote some other to int). * src/options.h: Likewise. * src/keyb.c: Likewise. * src/extras.h: Likewise. * src/const.h: Likewise. * src/const.c: Likewise. * src/piece.h: Likewise. Replace #pragma pack by __attribute__ ((packed)). * src/pcx.h: Replace #pragma pack by __attribute__ ((packed)). Remove to #pragma aux. * src/heroes.c: Too many changes to list. Many functions moved. Specify signedness of some char variables (or promote some other to int). Rewrite all `(*X)[]' as `*X'. * src/extras.c: Rewrite all `(*X)[]' as `*X'. 2000-05-06 Alexandre Duret-Lutz * src/mallox.h: Delete. * src/mallox.c: Delete. * src/makefile: Delete. * src/fortune.h: Delete. * src/fortune.c: Delete. * src/start.c: Remove reference to mallox.h. * src/sfx.c: Likewise. * src/pcx.c: Likewise. * src/menus.c: Likewise. * src/hedlite.c: Likewise. * src/finfo.c: Likewise. src/extras.c * src/heroes.c: Likewise. Remove reference to fortune.h. * src/keyb.h: Remove LED stuff. * src/keyb.c: Likewise. * src/clavier.h (touche,toucheready): Remove #pargma aux. * src/clavier.c: Likewise. 2000-05-06 Alexandre Duret-Lutz * src/cdplayer.bat: Delete. * src/cdrom.c: Delete. * src/cdrom.h: Delete. * src/cdrom_a.asm: Delete. * src/file_id.diz: Delete. * src/hcdplay.c: Delete. * src/info.bat: Delete. * src/install/: Delete recursively. * src/install.bat: Delete. * src/install.c: Delete. * src/install.h: Delete. * src/midas/: Delete recursively. * src/reader.c: Delete. * src/reader.h: Delete. * src/setup.c: Delete. * src/setup.h: Delete. * src/setupex.c: Delete. * src/vgatxt.h: Delete. * src/vgatxt_a.asm: Delete. * src/sound.c: #ifdef out all calls to Midas. Remove reference to setup.h. * src/sfx.c: #ifdef out all calls to Midas. * src/mouse.h: Remove every #pragma aux (assembly code). * src/joystick.c (_getjoystate): Remove #pragma aux. * src/menus.c: Remove reference to reader.h. #ifdef out calls to hmain (level editor). * src/intro.c: Remove reference to midas.h. #ifdef out calls to tmrSyncSrc. * src/heroes.c: #ifdef out reference to mouse.h. Remove references to reader.h, install.h, hcdplay.h and midas.h. #ifdef out calls to tmrSyncSrc, access to joysticks states, mouse and sound initialization. (createbatches): Remove. (testinstall): Remove. (icoinst): Remove. Remove callers to these three functions. * fastmem.h: Replace inline assembly code by memcpy using #define. * src/const.h: Remove reference to midas.h. * src/const.c: Likewise. 2000-05-06 Alexandre Duret-Lutz * Initial revision (MS-DOS version). heroes-0.21/ChangeLog.010000644004117000411500000062247207373025700010411 2001-09-18 Alexandre Duret-Lutz * configure.ac: Bump version to 0.13. * NEWS: Update for 0.13. * HACKING (Typenames): New section. 2001-09-18 Alexandre Duret-Lutz * src/lvl/README: Update typenames. 2001-09-18 Alexandre Duret-Lutz All typenames ending with`*_t' are officially reserved by POSIX. In the past I already had to rename `timer_t' into `htimer_t' (see 2000-08-27) to avoid name clash with NetBSD. Today I've discovered that `level_t' is defined in on alphaev56-dec-osf4.0d, so I've decided to get rid of this *_t naming definitively. The replacement convention, beginning typenames with a_ or an_, comes from http://gcc.gnu.org/ml/gcc/2001-06/msg01006.html. Each Typename from the first column is replaced by the name from the second column. anim_kind_t an_anim_kind anim_t an_anim bg_data_t a_bg_data color_rvb_t an_rvb_color copy_function_t a_copy_function cost_t a_cost dest_t a_dest dir8_t a_dir8 dir_mask8_t a_dir_mask8 dir_mask_t a_dir_mask dir_t a_dir entry_func_t an_entry_func explosion_info_t an_explosion_info explosion_t an_explosion extra_level_t an_extra_level extradir_info_t an_extradir_info extradir_list_t an_extradir_list fader_status_t a_fader_status fg_data_t a_fg_data filename_t a_filename fontdata_t a_fontdata gameid_t a_gameid htimer_t a_timer keycode_t a_keycode last_list_t a_last_list lemming_t a_lemming level_bits_t a_level_bits level_header_t a_level_header level_info_t a_level_info level_list_t a_level_list level_t a_level menu_entry_t a_menu_entry menu_t a_menu options_t an_option_set palette_t a_palette paragraph_t a_paragraph param_t a_param pcx_header_t a_pcx_header pcx_image_t a_pcx_image pixel_t a_pixel player_t a_player prefs_t a_pref_set private_read_data_t a_private_read_data prog_list_t a_prog_list read_data_t a_read_data s16_t a_s16 s32_t a_s32 s8_t a_s8 sound_track_t a_sound_track sprite_prog_list_t a_sprite_prog_list sprite_t a_sprite square_coord_pair_t a_square_corrd_pair square_coord_t a_square_coord square_index_t a_square_index strpair_t a_strpair tile_coord_pair_t a_tile_coord_pair tile_coord_t a_tile_coord tile_data_t a_tile_data tile_index_t a_tile_index tile_info_t a_tile_info tile_t a_tile tile_type8_t a_tile_type8 tile_type_t a_tile_type tunnel_t a_tunnel u16_t a_u16 u32_t a_u32 u8_t a_u8 var_entry_t a_var_entry width_t a_width word_t a_word * src/bonus.c, src/bonus.h, src/camera.c, src/camera.h, src/const.c, src/const.h, src/endscroll.c, src/endscroll.h, src/explosions.c, src/explosions.h, src/extras.c, src/extras.h, src/fader.c, src/fader.h, src/fontdata.c, src/fontdata.h, src/gameid.c, src/gameid.h, src/generic_list.h, src/hedlite.c, src/hedlite.h, src/helptext.c, src/helptext.h, src/hendian.c, src/hendian.h, src/heroes.c, src/heroes.h, src/heroeslvl.c, src/intro.c, src/items.c, src/items.h, src/levellst.c, src/levellst.h, src/menus.c, src/menus.h, src/musicfiles.c, src/musicfiles.h, src/parafmt.c, src/parafmt.h, src/pcx.c, src/pcx.h, src/people.h, src/people.tpl, src/pixelize.c, src/pixelize.h, src/prefs.def, src/prefs.tpl, src/readmake.c, src/readmake.h, src/render.c, src/render.h, src/renderdata.c, src/renderdata.h, src/savegame.h, src/scores.c, src/scores.h, src/scrtools.c, src/scrtools.h, src/sprglauto.c, src/sprglauto.h, src/sprglenz.c, src/sprglenz.h, src/sprite.c, src/sprite.h, src/spropaque.c, src/spropaque.h, src/sprprog.c, src/sprprog.h, src/sprprogwav.c, src/sprprogwav.h, src/sprrle.c, src/sprrle.h, src/sprshade.c, src/sprshade.h, src/sprtext.c, src/sprtext.h, src/sprunish.c, src/sprunish.h, src/sprzcol.c, src/sprzcol.h, src/structs.h, src/system.h, src/timer.c, src/timer.h, src/vars.c, src/visuals.c, src/visuals.h, src/lvl/de_body.c, src/lvl/de_head.c, src/lvl/free.c, src/lvl/in_body.c, src/lvl/load.c, src/lvl/loadmac.h, src/lvl/lvl.h, src/lvl/lvl_priv.h, src/lvl/privacc.c, src/media/keyb.h, src/media/keysdef.h, src/media/keyvalues.h, src/media/sfx.c, src/media/strack.c, src/media/strack.h, src/media/video.c, src/media/video.h, src/media/video_low.h, src/media/allegro/keyb.c, src/media/allegro/keyvalues.c, src/media/allegro/video.c, src/media/dummy/keyb.c, src/media/dummy/keyvalues.c, src/media/dummy/video.c, src/media/ggi/keyb.c, src/media/ggi/keyvalues.c, src/media/ggi/video.c, src/media/sdl/keyb.c, src/media/sdl/keyvalues.c, src/media/sdl/video.c: Update as explained. 2001-09-18 Alexandre Duret-Lutz * src/media/dummy/keyvalues.c: Don't include ggi.h. 2001-09-17 Alexandre Duret-Lutz * m4/h-allegro.m4: Hide Allegro support. Do not check for it unless explicitly requested. 2001-09-17 Alexandre Duret-Lutz * src/media/allegro/video.c (screen_rv): New variable. (init_video_low, uninit_video_low, vsynchro_low, vsynchro2_low): Use it. (set_pal): Fix buffer overrun. (set_pal_entry): Supply p.filter value to suppress compiler warning. 2001-09-15 Alexandre Duret-Lutz * src/media/README: New file. * src/sys/README: New file. * src/lvl/README: New file. * src/lvl/Makefile.inc (EXTRA_DIST): Add lvl/README. * src/sys/Makefile.inc (EXTRA_DIST): Add sys/README. * src/media/Makefile.inc (EXTRA_DIST): Add media/README. 2001-08-26 Alexandre Duret-Lutz * NEWS: Typo. 2001-08-26 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12f. 2001-08-26 Alexandre Duret-Lutz * arch/mingw32/cross.sh (CONFIGURE_OPTS): Remove --program-suffix, not needed. (cross_install): Strip heroeslvl.exe. * arch/mingw32/dest-readme-lib: Update. 2001-08-26 Alexandre Duret-Lutz * m4/libalt.m4 (adl_LIBALT_OK): Support options in the 6th argument. (adl_LIBALT_EITHER): Defaut to prepend the library flags, handle the APPEND option. * m4/h-media.m4 (heroes_MEDIALIB_SELECTION): Use the APPEND option for allm and sdlm. 2001-08-26 Alexandre Duret-Lutz * m4/generic.m4 (AC_PATH_GENERIC): Don't complain about a missing mumble-config if the installer has not used --with-mumble. 2001-08-25 Alexandre Duret-Lutz * doc/heroes.texi (Machines): Add OpenBSD, update MSVC. 2001-08-25 Alexandre Duret-Lutz * m4/h-joystick.m4 (heroes_CHECK_JOYSTICK_LIB): Typo. 2001-08-25 Alexandre Duret-Lutz * configure.ac: Prepend -lm to LIBS if libm is found, this fix a bug introduced on 2001-08-24. 2001-08-25 Alexandre Duret-Lutz * src/sys/Makefile.inc (EXTRA_DIST): Add main.h. 2001-08-25 Alexandre Duret-Lutz * TODO: Update. * ANNOUNCE: Prepare for 0.13. 2001-08-25 Alexandre Duret-Lutz * po/fr.po: Update. 2001-08-25 Alexandre Duret-Lutz * src/heroeslvl.c (version, usage, dir_to_string, type_to_char, print_type_keys, print_tunnels, anim_kind_to_str, print_tile_details, process, main): Use gettext. 2001-08-25 Alexandre Duret-Lutz * doc/heroes.texi (direntry): Add heroeslvl. (heroeslvl): New chapter. 2001-08-24 Alexandre Duret-Lutz * src/heroes.c (find_lemming_direction): Allow lemmings to be blocked under a trail (i.e. don't assert against that). 2001-08-24 Alexandre Duret-Lutz configure was still defining many HAVE_LIB* macro that are no longer needed since the move to src/media/. Only HAVE_LIBSDL_MIXER is used. This remove all the other, to cleanup config.h (and reduce the probability of config.h to change, which is good since all files depend upon config.h). * m4/h-display.m4 (heroes_CHECK_DISPLAY_LIB): Don't call heroes_CHECK_DISPLAY_LIB. * m4/checkpkg.m4 (AC_caolan_CHECK_PACKAGE): Don't define HAVE_LIB[]UP. * m4/h-sdl.m4 (heroes_CHECK_SDL): Don't define HAVE_LIBSDL. (heroes_CHECK_SDL_PRELIM): Merge into heroes_CHECK_SDL. * m4/h-mikmod.m4 (heroes_CHECK_MIKMOD): Don't define HAVE_LIBMIMOD. (heroes_CHECK_MIKMOD_PRELIM): Merge into heroes_CHECK_MIKMOD. * m4/h-sdlmixer.m4 (heroes_CHECK_SDL_MIXER): Define HAVE_LIBSDL_MIXER. * configure.ac: Don't define HAVE_LIBM. 2001-08-24 Alexandre Duret-Lutz This is the start of support for Allegro. It does not work yet (actually it segfault, and I've not yet understood why). Allegro do not use any naming convention for its symbols, neither does Heroes, so presently this lead to many conflicts that had to be resolved by renaming Heroes' symbols. :( * m4/h-allegro.m4: New file. * src/media/allegro/keyb.c: New file. * src/media/allegro/keyvalues.c: New file. * src/media/allegro/video.c: New file. * src/sys/allegro/main.c: New file. * m4/h-display.m4 (heroes_CHECK_DISPLAY_LIB): Call heroes_CHECK_ALLEGRO. * m4/h-media.m4 (heroes_MEDIALIB_SELECTION): Handle allm and allvkm. * m4/libalt.m4 (adl_LIBALT_EITHER): Typo. * m4/pkgeneric.m4 (AC_adl_PKG_GENERIC): Allow to not test for a function presence. * src/hedlite.c: Rename mouse_x and mouse_y into mouse_coord_x and mouse_coord_y. (save_pcx): Rename as ... (save_level_as_pcx): ... this. * src/intro.c: Rename set_color as set_pal_entry. * src/menus.c: Rename set_volume and set_palette as adjust_volume and force_palette. * src/prefs.tpl: Rename KEYCODE_MAX as HKEYCODE_MAX. * src/scrtools.c (set_palette): Rename as ... (force_palette): ... this. * src/scrtools.h: Idem. * src/media/Makefile.inc (EXTRA_LIBRARIES): Add media/libhallvkm.a. (media_libhallvkm_a_CFLAGS, media_libhallvkm_a_SOURCES, nodist_media_libhallvkm_a_SOURCES): New variables. (media/allegro/keysdef.c): New target. * src/media/keyb.c: Rename KEY_MAX into HKEY_MAX, mouse_x into mouse_coord_x, mouse_y into mouse_coord_y. * src/media/keyb.h: Likewise. * src/media/ggi/keyb.c: Likewise. * src/media/sdl/keyb.c: Likewise. * src/media/strack.h (set_volume): Rename as ... (adjust_volume): ... this. * src/media/dummy/strack.c: Likewise. * src/media/mikmod/strack.c: Likewise. * src/media/sdl_mixer/strack.c: Likewise. * src/media/video.h (set_color): Rename as ... (set_pal_entry): ... this. * src/media/dummy/video.c: Likewise. * src/media/ggi/video.c: Likewise. * src/media/sdl/video.c: Likewise. * src/sys/Makefile.inc (EXTRA_LIBRARIES): Add sys/libhallm.a. (sys_libhallm_a_CFLAGS, sys_libhallm_a_SOURCES): New variables. 2001-08-23 Alexandre Duret-Lutz Because some libraries need some special `main' arrangement (e.g. SDL sometime want to rename main() into SDL_main()), we need to turn main() into static libraries... *grin*. * m4/h-media.m4 (heroes_MEDIALIB_SELECTION): Handle stdm/sdlm selection. * src/Makefile.am (INCLUDES): Add -I$(srcdir)/sys. (EXTRA_LIBRARY): Define empty. (CLEANFILES): New. (EXTRA_DIST): Add and include sys/Makefile.inc. * src/heroes.c (main): Rename as ... (heroes_main): ... this. * src/sys/Makefile.inc: New file. * src/sys/main.h: New file. * src/sys/std/main.c: New file. * src/media/Makefile.inc (EXTRA_LIBRARY): Append (+=) instead of assigning (=). (CLEANFILES): Move to src/Makefile.am. 2001-08-22 Alexandre Duret-Lutz * tools/alpha.sh: Typo. 2001-08-22 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12e. * NEWS: Update. * tools/genpotfiles.sh: Grep the files in src/media/ too. 2001-08-22 Alexandre Duret-Lutz * src/lvl/de_body.c (ANIM_FRAME_DELAY): Add 1. * src/lvl/load.c (lvl_load_body_file): Typo. 2001-08-22 Alexandre Duret-Lutz This is a mega-combo-patch which break the files interfacing with the display/keyboard/mouse/sound/joystick libraries into separate directories. Instead of one file per medium, holding code for all supported libraries, we now have one directory per supported library. Many atomic static libraries are built and linked on demand from these directories (roughly one library per medium). This is a lot cleaner: there is no need to play with #ifdef/#ifndef anymore, configure will just decide which of these atomic libraries Heroes will be linked with. Configuration machinery. We now check for all library in a first step, and make a choice for the availble libraries in a second step (taking user preferences into account). * m4/h-media.m4: New file. * m4/libalt.m4: New file. * configure.ac: Replace display/joystick/sound library checks by a call to heroes_MEDIALIB_SELECTION. (Move these checks there.) Comment out the configuration summary. * m4/h-display.m4 (heroes_CHECK_DISPLAY_LIB_PRELIM): Delete. (heroes_CHECK_DISPLAY_LIB): Simplify, don't handle library exclusions. Call adl_LIBALT_OK. * m4/h-ggi.m4 (heroes_CHECK_GGI): Update user_selection_list_vkm. (heroes_CHECK_GGI_POST): Delete. * m4/h-joystick.m4 (heroes_CHECK_JOYSTICK_LIB): Simplify, don't handle library exclusions. Call adl_LIBALT_OK. Update user_selection_list_j. Don't define JOYSTICK_SUPPORT. * m4/h-mikmod.m4 (heroes_CHECK_MIKMOD): Update user_selection_list_s. * m4/h-sdlmixer.m4 (heroes_CHECK_SDL_MIXER): Update user_selection_list_vkm, user_selection_list_j, and user_selection_list_s. * m4/h-sdl.m4 (heroes_CHECK_SDL): Likewise. (heroes_CHECK_SDL_POST): Delete. * m4/h-sound.m4 (heroes_CHECK_SOUND_LIB_PRELIM): Delete. (heroes_CHECK_SOUND_LIB): Update user_selection_list_s, call adl_LIBALT_OK. Many files are moved from src/ to src/media/. The code also have to be adapted to the new API that this break required. Among the major API changes is the key definitions which used to be macros and are now variables, hence they cannot be used as case labels anymore. * src/display.c: Delete (replaced by src/media/video.c, src/media/sdl/video.c, src/media/ggi/video.c) * src/display.h: Delete (replaced by src/media/video.h). * src/joystick.c: Delete (replaced by src/media/sdl/joystick.c, src/media/gii/joystick.c). * src/joystick.h: Delete (replaced by src/media/joystick.h). * src/keyb.c: Delete (replaced by src/media/keyb.c, src/media/sdl/keyb.c, src/media/ggi/keyb.c). * src/keys_heroes.h: Delete (replaced by src/media/keyvalues.h, src/media/sdl/keyvalues.c, src/media/ggi/keyvalues.c). * src/keys_heroes.c: Likewise. * src/keysdef.h: Delete (replaced by src/media/keysdef.h) * src/keysdef.c: Delete. * src/sfx.c: Delete (replaced by src/media/sfx.c, src/media/mikmod/sfx.c, src/media/sdl_mixer/sfx.c). * src/sfx.h: Delete (replaced by src/media/sfx.h). * src/sound.c: Delete (replaced by src/media/strack.c, src/media/sdl_mixer/strack.c, src/media/mikmod/strack.c). * src/sound.h: Delete (replaced by src/media/strack.h) * src/Makefile.am (INCUDES): Add ./media. (CFLAGS): Suppress all meadia-library related CFLAGS. We can now use per-library CFLAGS. (heroes_LDADD): Replace hard-coded values by @LIBALT_LDADD@. (heroes_LDFLAGS): Likewise. (heroes_DEPENDENCIES): New variable. (heroes_SOURCES): Remove moved sources. (BUILT_SOURCES, DISTCLEANFILES): Remove keysdef-inc.h. [SDL, GGI] (keysdef-inc.h): Remove target. (paramfmt-check.o, parafmt-check): Simplify into ... (EXTRA_PROGRAMS, parafmt_check_SOURCES, parafmt_check_CFLAGS): ... these. (EXTRA_DIST): Add media/Makefile.inc and include it. * src/argv.h: Adjust includes. * src/camera.h: Likewise. * src/const.h: Likewise. * src/endscroll.c: Likewise. * src/errors.c: Likewise. * src/fontdata.h: Likewise. * src/intro.h: Likewise. * src/pcx.h: Likewise. * src/pixelize.c: Likewise. * src/pixelize.h: Likewise. * src/render.c: Likewise. * src/renderdata.h: Likewise. * src/scrtools.c: Likewise. * src/sprite.h: Likewise. * src/timer.c: Likewise. * src/visuals.c: Likewise * src/hedlite.c: Likewise. (display_level_map_fullscreen, gestclav): Adjust to new key definitions. * src/heroes.c (play_game): Likewise. * src/menus.c (move_upon, exec_menu, extra_menu, edito_selector, handle_reader_keys): Likewise. * src/system.h: Suppress all the media library selection stuff. * src/prefs.def: Use keys_pref_group () is name for the key group. * src/prefs.tpl: Support for function (or variable) as group names. Most of the following files are made from files deleted from src/. See the top of the preceding block for details. * src/media/Makefile.inc: New file. * src/media/joystick.h: New File. * src/media/keyb.c: New file. * src/media/keyb.h: New file. * src/media/keyb_low.h: New file. * src/media/keysdef.h: New file. * src/media/keyvalues.h: New file. * src/media/sfx.c: New file. * src/media/sfx.h: New file. * src/media/strack.c: New file. * src/media/strack.h: New file. * src/media/video.c: New file. * src/media/video.h: New file. * src/media/video_low.h: New file. * src/media/dummy/joystick.c: New file. * src/media/dummy/keyb.c: New file. * src/media/dummy/keysdef.c: New file. * src/media/dummy/keyvalues.c: New file. * src/media/dummy/sfx.c: New file. * src/media/dummy/strack.c: New file. * src/media/dummy/video.c: New file. * src/media/ggi/keyb.c: New file. * src/media/ggi/keyvalues.c: New file. * src/media/ggi/video.c: New file. * src/media/gii/joystick.c: New file. * src/media/mikmod/sfx.c: New file. * src/media/mikmod/strack.c: New file. * src/media/sdl/joystick.c: New file. * src/media/sdl/keyb.c: New file. * src/media/sdl/keyvalues.c: New file. * src/media/sdl/video.c: New file. * src/media/sdl_mixer/sfx.c: New file. * src/media/sdl_mixer/strack.c: New file. 2001-08-06 Alexandre Duret-Lutz * src/display.c (init_SDL): Don't initialize the sound device if we are not going to use it. Idem with the joystick. Reported by Jean. 2001-08-05 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12d. * NEWS: Update. 2001-08-05 Alexandre Duret-Lutz * src/levellst.c (cmp_levels): Sort the level names on the last digit first, so that they are played in this order: 010 020 030 ... 011 021 ..., and not this one 010 011 012 ... 2001-08-05 Alexandre Duret-Lutz * src/heroes.c (find_free_way): Autopilot still work against file trails for invincible players. 2001-08-05 Alexandre Duret-Lutz * src/structs.h (lemming_t) : Rename as ... (lemming_t) : ... these. * src/heroes.c (update_lemmings): Eve out most of the code to ... (find_lemming_direction): ... this new function. Disallow lemmings to enter tunnels (the change from 2001-07-13 unintentionally allowed this). Comment and cleanup. (load_level): Use find_lemming_direction. (update_player): Adjust to new names. * src/render.c (draw_lemming): Likewise. * src/lvl/lvl.h (DIR_TO_DIRMASK): New function. 2001-08-05 Alexandre Duret-Lutz * src/camera.c (compute_corner) : New variables. Fix computation of the maximum possition for the camera on non-wrapped levels. 2001-08-05 Alexandre Duret-Lutz * src/const.h (radar_target_pos, radar_current_pos): Delete. * src/const.c (radar_target_pos, radar_current_pos): Move ... * src/heroes.c (radar_target_pos, radar_current_pos): ... here. 2001-08-04 Alexandre Duret-Lutz * src/render.c (draw_score): Change prototype, takes row, col and score_shift. Use score_shift instead of the global radar_current_pos variable. Use IMGPOS wherever possible. * src/render.h (draw_score): Change protoype. * src/heroes.c (output_screen): Adjust calls to draw_score. 2001-08-04 Alexandre Duret-Lutz * src/render.c (draw_radar_frame): New function, eved out from draw_radar_map. (draw_radar_map): Call draw_radar_frame, don't use `dede', comment, fix drawing of full-wrapped levels (typo introduced on 2001-07-14). Take the radar_shift parameter instead of using the global radar_current_pos. * src/render.h (draw_radar_map): Adjust prototype. * src/heroes.c (output_screen): Supply new argument to draw_radar_map. 2001-08-04 Alexandre Duret-Lutz * src/levellst.c (cmp_levels): New function. (read_level_list): Sort the levels. 2001-08-02 Alexandre Duret-Lutz Fix issues observed on OpenBSD 2.9. * configure.ac: Check for setgid. * src/system.h (setgid, setgid): Define if needed. (seteuid, setegid): Define using setreuid and setregid if possible. * src/persona.c (sys_persona, user_persona): Test whether _POSIX_SAVED_IDS is *defined*, not its actual value. (user_persona_definitively): Use setuid and setgid instead of setreuid and setregid, the latter are obsolete. 2001-08-02 Alexandre Duret-Lutz Reestablish MinGW32 support. * lib/stpcpy.c: New file, from fileutils 4.1. * lib/Makefile.am (EXTRA_DIST): Add it. * tools/fetish-sync.sh (files): Add stpcpy.c. * src/Makefile.am (heroes_LDADD): Put SDL_MIXER_LIBS before SDL_MIXER since the former needs the latter. (heroeS_LDADD): Add INTLLIBS. * src/lvl/load.c (lvl_load_body_file): Type length as size_t, add rlength and use it. * src/system.h [!HAVE_SSIZE_T] (ssize_t): Define. [!HAVE_DECL_STPCPY] (stpcpy): Declare. [!HAVE_STRCASESTR] (strcasestr): Redeclare ... [!HAVE_DECL_STRCASESTR] (strcasestr): ... in this case. * configure.ac: Check for declaration of ssize_t, strcasestr, and stpcpy. Replace stpcpy if needed. 2001-08-01 Alexandre Duret-Lutz Some Autoconf internal functions have changed between 2.50 and 2.52. Add workarounds to be compatible with both versions. * m4/compat.m4: New file. * m4/checkpkg.m4: Use MY_TR_CPP * m4/findheader.m4: Use MY_VAR_POPDEF, MY_VAR_PUSHDEF, and MY_VAR_SET. * m4/h-obsolet.m4: Use MY_TR_SH. 2001-07-29 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12c. * NEWS: Update for 0.12c. 2001-07-29 Alexandre Duret-Lutz * src/heroes.c (main): Switch to sys_persona() before calling init_sound_engine() and init_video(), and back to user_persona() after. * src/persona.h (keep_sgid, keepsuid): New variables. * src/persona.c (keep_sgid, keepsuid): New variables. (user_persona_definitively): Use them. * src/userconf.c (read_userconf): Handle keepsuid: and keepsgid:. * src/etc/heroesrc (soundconf): Add commented lines for keepsuid and keepsgid. * doc/heroes.texi (heroesrc): Document keepsuid and keepsgid. 2001-07-29 Alexandre Duret-Lutz Build a man page for heroeslvl. * man/Makefile.am (heroeslvl.6): New target. (man_MANS): Add heroeslvl.6. (MAINTAINERCLEANFILES): Rewrite as $(man_MANS). 2001-07-29 Alexandre Duret-Lutz * configure.ac: Show a summary of CFLAGS and LIBS for each libraries. * m4/checkpkg.m4: Typo, s/_LDALL/_LDFLAGS/. * src/Makefile.am (heroes_LDFLAGS): Typo, s/_LIBS/_LDFLAGS/. 2001-07-29 Alexandre Duret-Lutz * configure.ac: Remove the jm_FUNC_REALLOC kludge. 2001-07-29 Alexandre Duret-Lutz Because intl/ and lib/ contains third party code which does not conform to the same level of "strictness" as the code in src/, enable some -Woptions in src/ only. * m4/gccwarn.m4 (CF_GCC_MORE_WARNINGS): New functions. (ad_GCC_WARNINGS): Call CF_GCC_MORE_WARNINGS, AC_SUBST() MORE_WARNINGS_CFGLAGS. * src/Makefile.am (CFLAGS): Add MORE_WARNINGS_CFGLAGS. 2001-07-29 Alexandre Duret-Lutz ``heroeslvl'' should not be linked with SDL or GGI as ``heroes''. So let's change configure to not add those libraries to LIBS, CFLAGS, etc. Use per-target LDFLAGS and LDADD instead. * m4/checkpkg.m4: Set and AC_SUBST() UP[]_LDFLAGS, UP[]_CFLAGS, and UP[]_LIBS. * m4/h-joystick.m4: Add $SDL_LIBS to $LIBS before testing. * m4/h-sdl.m4: Check for SDL_EnableKeyRepeat in the call to AC_adl_PKG_GENERIC. * m4/pkgeneric.m4: Revert LIBS and CFLAGS. * src/Makefile.am (CFLAGS, heroes_LDFLAGS): New. (heroes_LADADD): Update. * lib/Makefile.am (CFLAGS): New. 2001-07-27 Alexandre Duret-Lutz * src/heroes.c (main): Call read_sfx_conf after init_sound_engine (). * src/sfx.c (read_sfx_conf): Free sfxdir on error. 2001-07-27 Alexandre Duret-Lutz * src/lvl/de_body.c (decode_level_body): Free square_walls_in. 2001-07-27 Alexandre Duret-Lutz * src/locales.c: New file. * src/locales.h: New file. * src/Makefile.am (heroes_SOURCES): Add them. * src/heroes.c (main): Move locale initialization code to init_locales() in locales.c and call it. 2001-07-27 Alexandre Duret-Lutz * src/musicfiles.c: Cosmetics changes. (dir_name): Delete, include "dirname.h" instead. (read_sound_config_file): Adjust to the new dir_name(), i.e., add a `/' between the file name and the directory name. 2001-07-27 Alexandre Duret-Lutz ``heroes-sdl -G mumble'' didn't work because the string put in environment (SDL_VIDEODRIVER=mumble) was immediatly freed afterward. * src/display.c [HAVE_LIBSDL] (sdl_videodriver): New variable. [HAVE_LIBSDL] (set_display_params): Set sdl_videodriver, putenv() it, but don't free it. [HAVE_LIBSDL] (uninit_video): Free sdl_videodriver here. 2001-07-26 Alexandre Duret-Lutz * src/camera.c (compute_corner): Cleanup. * src/const.c (camera_center_x): Remove. * src/const.h (camera_center_x): Remove. * src/heroes.c (play_demo, play_game): Don't set camera_center_x. 2001-07-25 Alexandre Duret-Lutz * src/const.h (square2offset, invincible): Delete. * src/const.c (square2offset): Delete. (invincible): Move to ... * src/render.c (invincible): ... here. * src/heroes.c (load_level): Don't initialize square2offset. 2001-07-26 Alexandre Duret-Lutz A report from William Black about the vehicles-restricted-in-a-two-square-width-vertical-zone allowed to finally close this bug (reported by Jean in Dec 2000). * src/people.def: Add him. * BUGS: Update. 2001-07-25 Alexandre Duret-Lutz Check gettext version in upgettext.sh. Older versions can cause the bootstrap process to fail ungracefully. Suggested by Laurent Duperval . * tools/upgettext.sh (usage): Add -f. (checkversion): New function. Handle -f, call checkversion unless -f is given. 2001-07-24 Alexandre Duret-Lutz * tools/alpha.sh: Reorder and comment sections. 2001-07-24 Alexandre Duret-Lutz * configure.ac: Bump to 0.12b. * NEWS: Update for 0.12b. * doc/Makfile.am (.texi.html): Add --no-split, newer versions of makeinfo need this. 2001-07-23 Alexandre Duret-Lutz * doc/heroes.texi (Invoking): More documentation for -G and -F. * TODO: Update. 2001-07-23 Alexandre Duret-Lutz * tools/Makefile.inc: New file. * tools/Makefile.am: Delete. * tools/README: New file. * tools/exnews.pl: New file. * tools/alpha.sh: New file. * configure.ac: Don't create tool/Makefile.in. * Makefile.am: Include tools/Makefile.inc (SUBDIRS): Remove tools. (EXTRA_DIST): Add tools/Makefile.inc. 2001-07-22 Alexandre Duret-Lutz * src/lvl/free.c: New file. * src/lvl/Makefile.inc (lvl_libhlvl_a_SOURCES): Add lvl/free.c. * src/lvl/in_body.c (initialize_empty_level_body): New function. * src/lvl/lvl_priv.h (initialize_empty_level_body): New function. * src/lvl/load.c (lvl_load_file): Call it. * src/heroes.c (unload_level): Call lvl_free. * src/heroeslvl.c (process): Likewise. * src/levellst.c (read_level_dir): Likewise. 2001-07-22 Alexandre Duret-Lutz * src/levellst.c: New file. * src/levellst.h: New file. * src/Makefile.am (heroes_SOURCES): Add them. * src/extras.c (select_file): Rename as select_file_lvl and move to levellst.c. (browse_Extra_directories): Use select_file_lvl. * src/heroes.c (level_list, levellstchunk, levelinf, level_list_nbr): Remove, replaced by varables from levellst.h and .c. (level_full_list_Size, current_quest_level): Define as unsigned. (load_level_from_level, compute_level_full_list, random_level, load_random_wrapped_level, load_random_level, play_menu, load_demo, main_menu, main): Adjust to the new definitions. (read_level_list): Remove. * sr/rsc_files.gperf (end-scroller-txt, help-txt, levels-list-txt, text-conf-txt): Remove. 2001-07-22 Alexandre Duret-Lutz * src/lvl/load.c (lvl_load_body_mem, lvl_load_header_mem): New functions. (lvl_init_lvl_basic_fields): New function, extracted from... (lvl_load_header): ... here. Rename as ... (lvl_load_header_file): ... this. Use lvl_load_header_mem. (lvl_load_body): Rename as ... (lvl_load_body_file): ... this. Use lvl_load_header_file. (lvl_load_file): Try to load the file using mmap, before falling back to read. 2001-07-21 Alexandre Duret-Lutz * src/heroeslvl.c (process): Don't load full level if we can avoid it. 2001-07-21 Alexandre Duret-Lutz Add option -pi to display tile details. * src/heroeslvl.c (options_t): Add print_tile_details. (print_tile_details, anim_kind_to_str): New functions. (usage): Document -pi. (decode_print_options): Handle 'i'. (print_square_type, print_square_walls, print_square_directions): Print line numbers. (process): Call print_tile_details. 2001-07-19 Alexandre Duret-Lutz Gather camera handling code from heroes.c and const.c into camera.c. * src/camera.c: New file. * src/camera.h: New file. * src/Makefile.am (heroes_SOURCES): Add camera.c and camera.h. * src/const.c (camera_x, camera_y, corner_x, corner_y, corner, corner_dx, corner_dy, inert_x, inert_y, nbr_tiles_cols, nbr_tiles_rows): Move to camera.c. (camera_stop_x, camera_stop_y): Move to ... * src/render.c (draw_level): ... here. * src/const.h: Likewise. * src/scrtools.c: Likewise. * src/visuals.c: Likewise. * src/endscroll.c: Include camera.h. * src/heroes.c (compute_corner): Move to camera.c. (update_all): Extract the position_camera() function, now in camera.c. (output_screen): Call position_camera(). (play_demo, play_game): Extract and call init_camera(). * src/menus.c (background_menu): Extract and call lisajou_camera(). 2001-07-16 Alexandre Duret-Lutz * configure.ac: Bump to 0.12a. Call AM_PROG_CC_C_O. * NEWS: Update for 0.12a. * TODO: Likewise. * src/Makefile.am (EXTRA_DIST): Add etc/Makefile.inc and lvl/Makefile.inc. (AUTOMAKE_OPTIONS): New. * Makefile.am (EXTRA_DIST): Add arch/Makefile.inc and m4/Makefile.inc. 2001-07-15 Alexandre Duret-Lutz New bonus: fire trail. * src/helptext.c (help_text2, help_text4): Document it. * src/bonus.c (bonus_density, bonus_point): Fill in the fire trail column. (apply_bonus): Handle fire_trail. * src/structs.h (player_t) : New. * src/player.c (reinit_player): Zeroes player[p].fire_trail. (find_free_way): Disable autopilot against fire trails. (update_player): Handle fire_trail. 2001-07-15 Alexandre Duret-Lutz * src/heroes.c (compute_corner): Compute and cast tw and th once for all. (update_all): Fix camera position computation (typo from 2001-07-13). 2001-07-15 Alexandre Duret-Lutz Rewrite the way explosions are handled. There used to be two distinct explosion types: those from T_BOOM squares and those triggered by player death. Both where handled separately and in different ways. This is now homogeneous. Two noticeable differences are that death explosions are now harmful to other players and will propagate to neighbor T_BOOM squares. * src/const.c (last_explo, square_explosion, square_dead_explosion, explo_list_ptr, explo_list_pos_x, explo_list_pos_y, explo_nbr, square_explosion_type): Delete. * src/const.h: Likewise. * src/explosions.c (square_explo_state): New variable, replace suqare_explosion and square_dead_explosion. (square_explo_type): New variable, replace square_explosion_type. (explosion_info_t, explo_list, explo_list_max, explo_list_first_unused, explo_timer, explo_time, allocate_explosions, release_explosions, trigger_explosion, trigger_possible_explosion, update_explosions): New. * src/explosions.h (EXPLOSION_SLICES_PER_FRAMES, EXPLOSION_DELAY, EXPLOSION_IMMEDIATE, EXPLOSION_TRIGGERED, EXPLOSION_TRIGGER_NEIGHBORS, EXPLOSION_UNTRIGGERED, explosion_t, square_explo_state, square_explo_type, allocate_explosions, release_explosions, trigger_explosion, trigger_possible_explosion, update_explosions): New. * src/heroes.c (load_level): Adjust to call allocate_explosions(). (unload_level): Adjust to call release_explosions(). (erase_trail): Adjust to call trigger_explosion(). (ia_eval_dir_target_inline, ia_eval_dir_bonus_inline, ia_eval_dir_lemming_inline, ia_eval_dir_cash_inline, ia_eval_dir_color_inline, ia_goto_target_inline, ia_goto_bonus_inline, ia_goto_lemming_inline, ia_goto_color_inline, ia_goto_cash_inline): Adjust to use square_explo_state. (update_explo): Remove. (update_all): Call update_explosions() instead of update_explo(). * src/render.c: (render): Adjust to use square_explo_type and square_explo_state, suppress the separate rendering loop for players' death explosions. 2001-07-14 Alexandre Duret-Lutz * src/const.h (d2w, w2d, square_offset): Delete. (square2tile, square_offset2coord): Rename as ... (square_tile, square_coord): ... these. * src/const.c (d2w, w2d): Remove. (square2tile, square_offset2coord): Rename as ... (square_tile, square_coord): ... these. (square_offset): Move to ... * src/hedlite.c (square_offset): ... here. * src/heroes.c (load_level, unload_level, ia_eval_dist, update_player, update_all): Adapt to new names. (find_free_way, update_lemmings): Don't use w2d. * src/render.c (draw_radar_map): Adapt to new names. 2001-07-13 Alexandre Duret-Lutz Use the new level loading library to load levels in the game (not the level editor). This new loading code will export level infos differently, hence many places have to be adapted to the new representation. * lib/xstrduplwr.h: New file. * lib/xstrduplwr.c: New file. * lib/Makefile.am: Add them. * src/Makefile.am (LDADD): Rename as ... (heroeslvl_LDADD): ... this. Add lvl/libhlvl.a. * src/const.c (map_info, map_info_2xt, map_info_2yt, map_info_2xwrap, map_info_2ywrap, level_map, square_radar_wall, square_wall, square_wrap): Remove these variables. (lvl): New variable, which replace all the above. * src/const.h: Likewise. * src/bonus.c (add_bonus, mark_unreachable_places, init_bonuses_level): Adjust to use the new level representation. * src/heroes.c (ia_target_x, ia_targer_y, ia_wrap_x, ia_wrap_y): Declare as square_coord_t. (tunnel_square_io): Remove this variable. (add_color, add_cash, erase_player, reinit_player, load_level, compute_corner, shrink_trail, erase_trail, ia_eval_dist, ia_eval_dir_target_inline, ia_eval_dir_bonus_inline, ia_eval_dir_lemming_inline, ia_eval_dir_cash_inline, ia_eval_dir_color_inline, ia_eval_neighb_pos, ia_eval_dir_target, ia_eval_dir_lemming, ia_eval_dir_color, ia_eval_dir_cash, ia_eval_dir_bonus, ia_goto_target_inline, ia_goto_bonus_inline, ia_goto_lemming_inline, ia_goto_color_inline, ia_goto_cash_inline, ia_goto_target, ia_goto_nearest_bonus, ia_goto_nearest_lemming, ia_goto_nearest_color, ia_goto_nearest_cash, update_player, update_explo, update_lemmings, update_all): Adjust to use the new level representation. * src/menu.c (background_menu): Likewise. * src/render.c (draw_level): Likewise. * src/renderdata.c (init_render_data): Likewise. * src/struct.h (DONT_WRAP): Don't declare, it's done in lvl/lvl.h. (player_t) : Declare as dir_t. (lemming_t) : Likewise. * src/renderdata.h (tile_anim_kind): Move to ... * src/lvl/lvl.h (anim_kind_t): ... here. (lvl_tile_sprite_overlay_offset): New function. (lvl_animation_info): Return animation type too. * src/lvl/de_body.c (TILE_SPRITE): Rename as ... (TILE_OVERLAY): ... this. (TILE_SPRITE): New. (decode_level_body): Read the sprite overlay, handle animation types. * src/lvl/de_head.c (decode_level_header): Lowercasify the sprite map basename. * src/lvl/lvl_priv.h (tile_data_t) : New. * src/lvl/privacc.c (lvl_tile_type, lvl_tile_sprite_offset, lvl_tile_sprite_overlay_offset, lvl_animation_info): New functions. 2001-07-10 Alexandre Duret-Lutz Some directories do not deserve their own Makefile (it takes time to recurse directories, and it's ugly). Replace some `Makefile.am' files by some `Makefile.inc' included from the underlying `Makefile.am'. * src/etc/Makefile.inc: New file. * src/etc/Makefile.am: Delete. * src/Makefile.am: Include src/etc/Makefile.inc. * tools/genm4mam.sh: Create m4/Makefile.inc instead of m4/Makefile.am. * arch/Makefile.inc: New file. * arch/Makefile.am: Delete. * configure.ac: Don't create src/etc/Makefile, m4/Makefile, and arch/Makefile.am. * Makefile.am: Include arch/Makefile.am and m4/Makefile.inc. (SUBDIRS): Remove arch and m4. (configure.ac): Don't create m4/Makefile, arch/Makefile, and src/etc/Makefile. * HACKING: Adjust. 2001-07-10 Alexandre Duret-Lutz * src/lvl/Makefile.inc: New file. * src/lvl/de_body.c: New file. * src/lvl/de_head.c: New file. * src/lvl/in_body.c: New file. * src/lvl/load.c: New file. * src/lvl/loadmac.h: New file. * src/lvl/lvl.h: New file. * src/lvl/lvl_priv.h: New file. * src/lvl/privacc.c: New file. * src/heroeslvl.c: New file. * src/Makefile.am: include src/lvl/Makefile.inc. (bin_PROGRAMS): Add heroeslvl. (INCLUDE, heroeslvl_SOURCES, heroeslvl_LDADD): New variables. * src/system.h: Add O_BINARY support. 2001-07-10 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12. * HACKING: Update. * TODO: Update. * NEWS: Update. * m4/gettext.m4: Update from Debian's gettext 0.10.38-2. 2001-06-17 Alexandre Duret-Lutz These patches are no longer needed with gettext-0.10.38. * misc/04-intl.patch: Delete. * misc/04-m4.patch: Delete. * misc/06-intl.patch: Delete. * Makefile.am (EXTRA_DIST): Remove them. * m4/gettext.m4: Upgrade for gettext-0.10.38. * m4/glibc21.m4: Likewise. * m4/iconv.m4: Likewise. 2001-06-16 Alexandre Duret-Lutz Yet another couple of fixes suggested by Jean. * src/menus.c (draw_end_level_info): Center the title (winner). (info_mode_next_save_arrow_pos): New variable. (init_menus_sprites): Compute info_mode_next_save_arrow_pos. (draw_end_level_info): Use it. 2001-06-16 Alexandre Duret-Lutz Jean reported several times that some levels play without any sound. These five levels are affected | ~/usr/share/heroes/levels % grep heroes * | Binary file niv038.lvl matches | Binary file niv039.lvl matches | Binary file niv049.lvl matches | Binary file niv067.lvl matches | Binary file niv108.lvl matches because they use lowercase soundtrack aliases instead of uppercase as the others. This patch change the hashing function used to lookup soundtrack aliases so that uppercase and lowercase versions of the same aliase will be hashed to the same value. * src/musicfiles.c (hash_case_string): New function. (st_hasher, get_sound_track_from_alias): Use hash_case_string instead of hash_string. * BUGS: Remove related entry. 2001-06-16 Alexandre Duret-Lutz * src/menus.c (init_menus_sprites): Reverse the strings "NEW LEVEL" and "EXISTING LEVEL". Reported by Jean. (editor_menu): Lowercasify the level name before trying to open the file for preview. Add debug messages. 2001-06-16 Alexandre Duret-Lutz Rewrite editor_first_menu using the compile_menu machinery. This also get rid of a bug reported by Jean where the french translation for "NEW LEVEL" would have been larger than the distance between the waving arrows. * src/menus.c (edit_first_menu_txt, edit_first_new_txt, edit_first_load_txt): Remove. (editor_entries, editor_menu_data): New variables to replace the three above. (init_menus_sprites, uninit_menus_sprites): Adjust. (editor_first_menu): Use exec_menu. 2001-06-04 Alexandre Duret-Lutz * src/joystick.c [HAVE_SDL_JOYSTICKOPEN, HAVE_LIBGII] (get_joystick_state): Print debug messages for joystick events. * src/debugchn.def (joystick): Adjust documentation. 2001-06-03 Alexandre Duret-Lutz * lib/filelock.h: Change protoype. * lib/filelock.c: Likewise, supply flock() and _locking() implementations, not really tested. * m4/filelock.m4: New file. * m4/fopenlock.m4: Remove (obsolete). * src/scores.c: Adjust to new filelock and fileunlock prototypes. * src/savegame.c: Likewise. * src/savegame.c (write_save_records_locked, load_save_records): Seek to the beginning of file before unlocking. * src/scores.c (write_scores_locked, load_scores): Likewise. 2001-05-28 Alexandre Duret-Lutz * src/joystick.c [HAVE_LIBGII] (_get_joystick_state): Fix valuator reads. 2001-05-28 Alexandre Duret-Lutz * m4/relpaths.m4: Typos in comments. 2001-05-23 Alexandre Duret-Lutz * m4/normpath.m4: Cleanup for submission to the autoconf archive. * m4/relpaths.m4: Likewise. 2001-05-23 Alexandre Duret-Lutz * tools/autogen.sh: Recurse directories to find configure.{ac,in}. 2001-05-22 Alexandre Duret-Lutz * configure.ac: Bump version number to 0.11. * ANNOUNCE: Update for 0.11. * TODO: s/0.11/0.12/, how shame! * po/fr.po: Update. 2001-05-22 Alexandre Duret-Lutz * src/hedlite.c (create_levels_output_dir): Strip trailing slashes from level output directory, or it doesn't work with MinGW. * src/userdir.c (setup_userdir): Likewise with the userdir. 2001-05-22 Alexandre Duret-Lutz * arch/mingw32/cross.sh: Fix function declarations, the `function' keyword is not portable. (cross_install): Zip ChangeLog.00 too, delete charset.alias. 2001-05-21 Alexandre Duret-Lutz * configure.in: Move to ... * configure.ac: ... here. Make it dependent on autoconf 2.50. * tools/autogen.sh: Be configure.ac aware. * tools/upgettext.sh: Likewise. * HACKING: s/configure.in/configure.ac/. * man/Makefile.am (heroes.6): Likewise. 2001-05-21 Alexandre Duret-Lutz * arch/Makefile.am: Remove the commented rules to please automake 1.4f (which bugs on trailing backslashes in comments). After all we can get the old rules back from CVS. 2001-05-21 Alexandre Duret-Lutz * ChangeLog.00: New file. * Makefile.am (EXTRA_DIST): Add ChangeLog.00. 2001-05-21 Alexandre Duret-Lutz Don't install charset.alias on glibc 2.1 systems. This is base on the patch that Bruno Haible applied on the Gettext CVS version to address the issue. * m4/glibc21.m4: New file. * m4/gettext.m4 (AM_GNU_GETTEXT): Require jm_GLIBC21. * misc/06-intl.patch: New file. * Makefile.am (EXTRA_DIST): Add misc/06-intl.patch. 2001-05-21 Alexandre Duret-Lutz * configure.in: Bump version number to 0.10b. * NEWS: Update for 0.10b. * HACKING: Update fetish files. 2001-05-20 Alexandre Duret-Lutz * src/etc/heroesrc (soundconf): Don't say preferences can be global. * doc/heroes.texi (Global score file): Likewise. 2001-05-20 Alexandre Duret-Lutz Allow the user to use other score or save files. * src/savegame.c (reinit_save_records_if_needed): New. * src/savegame.h (reinit_save_records_if_needed): New. * src/scores.c (reinit_scores_if_needed): New. * src/scores.h (reinit_scores_if_needed): New. * src/heroes.c (main): Call them. * src/scores.c (load_scores): Don't unlock the file if it's not open. * src/savegame.c (load_save_records): Likewise. 2001-05-20 Alexandre Duret-Lutz Change the way global file access and file locking is done. Before this patch whenever an update of a global file was requested the game had to a) switch personna if needed to access the file b) open the file c) lock it d) update the file e) close the file With this patch the global files are now open when the game begin, using the system persona, the game then switch to the user persona definitively, be keep the global file open for the whole life of the game. Updating a file now just consist of a) seeking to the beginning of the file b) locking the file c) updating the file d) unlocking the file The rationnal for this change is that it allows to drop all privileges definitively after the global files are open. Later, when scripting capability will be added to Heroes, it is important that the user cannot switch persona at will :) * lib/fopenlock.c: Delete. * lib/fopenlock.h: Delete. * lib/filelock.c: New file. * lib/filelock.h: New file. * lib/Makefile.am (libheroes_a_SOURCES, noinst_HEADERS): Replace fopenlock.c and fopenlock.h by filelock.c and filelock.h. * src/persona.c (user_persona_definitively): New function. (sys_persona_if_needed): Export. (persona_fopenlock): Remove. * src/persona.h (user_persona_definitively): New function. (sys_persona_if_needed): Export. (persona_fopenlock): Remove. * src/savegame.c (init_save_records): New. (save_games_file): Remove, adjust all callers to use name instead. (write_save_records): Rename as ... (write_save_records_locked): ... this. Don't close the file. (write_save_records): New, call write_save_records_lock. (load_save_records_open): Rewrite and rename as ... (load_save_records_seek): ... this. Adjust all callers. (load_save_records): Don't close the file, but unlock it. (load_save_records_and_keep_locked): Don't create the file. (free_save_records): Close the file here. * src/savegame.h (init_save_records): New. (write_save_records_locked): New. * src/scores.c (init_scores): New. (score_file): Remove, adjust all callers to use name instead. (write_scores): Rename as ... (write_scores_locked): ... this. Don't close the file. (write_scores): New, call write_scores_locked. (load_scores_open): Rewrite and rename as ... (load_scores_seek): ... this. Adjust all callers. (load_scores): Don't close the file, but unlock it. (load_scores_and_keep_locked): Don't create the file. (free_scores): Close the file here. * src/scores.h (init_scores): New. (write_scores_locked): New. * src/heroes.c (play_menu): Use write_scores_locked() instead of write_scores(). (main): Call init_scores(), init_save_records(), and user_persona_definitively(). 2001-05-20 Alexandre Duret-Lutz Hopefully, Heroes now works back with MinGW. * lib/stripslash.c: New file from fileutils-4.1. * lib/stripslash.h: New file. * src/relocalte.c (check_installation): Strip slashes before calling isdir. (try_to_explore_path): Check path_env against ';', not path. * tools/fetish-sync.sh (files): Add stripslash.c. * lib/dirname.c (dir_name): Compute append_dot using path, not newpath. * Makefile.am (SUBDIRS): Make intl before lib because lib needs libintl.h. * arch/mingw32/dest-readme-lib: Update to SDL 1.2.0 and SDL_mixer 1.2.0. * arch/mingw32/cross.sh: Likewise. * arch/mingw32/dest-run-bat: Update for i18n and relocation. * arch/mingw32/dest-readme-txt: Likewise. 2001-05-19 Alexandre Duret-Lutz * m4/h-paths.m4: Adjust the definition of localedir to the one used by recent gettexts, and put more comments about issues regarding localedir. 2001-05-19 Alexandre Duret-Lutz * m4/dos.m4: New file, from fileutils-4.1, patched to check for __WIN32__, _WIN32, and __MSDOS__. * tools/fetish-sync.sh (files): Add dos.m4. * configure.in: Call jm_AC_DOS. 2001-05-19 Alexandre Duret-Lutz * po/it.po: New revision from Alessandro. 2001-05-19 Alexandre Duret-Lutz * src/menus.c (handle_reader_keys): Typo. 2001-05-19 Alexandre Duret-Lutz * src/relocate.c (try_to_explore_path): Support semicolon separated paths. 2001-05-19 Alexandre Duret-Lutz * src/visuals.c: s/gauche/left/; s/droite/right/ (vertical_zoom_wave): Fix display of last line. Reported by Jean. 2001-05-17 Alexandre Duret-Lutz * doc/heroes.texi: Various fixes suggested by Jean. 2001-05-08 Alexandre Duret-Lutz * configure.in: Bump version to 0.10a. * NEWS: Update for 0.10a. 2001-05-08 Alexandre Duret-Lutz * src/relocate.c (try_to_derive_argv0): Don't free path if null. 2001-05-08 Alexandre Duret-Lutz * src/items.c (catch_this): Remove. (tutorial_arrow): New. (init_item, unit_items): Handle tutorial_arrow instead of catch_this. * src/items.h (catch_this): Remove. (tutorial_arrow, NBR_ARROW_FRAMES): New. * src/render.c (draw_level): Change the tutorial arror rendering the draw loops with the new arrow. * src/rsc_files.gperf (arrow-img): New. * src/system.h (M_PI, M_PI_2, M_PI_4): New. 2001-05-06 Alexandre Duret-Lutz * src/helptext.c (help_text1): Draw the two pictures in the background and label them using textat commands. * src/readmake.c (flag_error): New function. (compile_reader_data): Handle textat commands and use flag_error. 2001-05-06 Alexandre Duret-Lutz * configure.in: Bump version number to 0.10. * NEWS: Update for 0.10. * GNUmakefile (src/debughash.gperf): New target. (cvsboot): Require src/debughash.gperf. * po/fr.po: Update. 2001-05-06 Alexandre Duret-Lutz * Makefile.am: Avoid non-portable use of $< and $@ in explicit rules. * doc/Makefile.am: Likewise. * man/Makefile.am: Likewise. * src/Makefile.am: Likewise. * Makefile.am (MAINTAINERCLEANFILES): New target. (DISTCLEANFILES): Remove (intl/libintl.h is now removed from intl/Makefile). * man/Makefile.am (MAINTAINERCLEANFILES): New target. * src/Makefile.am (MAINTAINERCLEANFILES): New target. 2001-05-06 Alexandre Duret-Lutz * arch/Makefile.am: Comment out all the VisualC stuff. It's out of date. 2001-05-05 Alexandre Duret-Lutz * GNUmakefile (src/people.c): New target. (cvsboot): Require src/people.c. 2001-05-05 Alexandre Duret-Lutz * ANNOUNCE: Update for 0.10. * TODO: Likewise. 2001-05-05 Alexandre Duret-Lutz Update copyright year for recently modified files. * src/debugmsg.c: Copyright 2001. * src/misc.c: Likewise. * src/misc.h: Likewise. * src/pcx.c: Likewise. * src/rsc_files.c: Likewise. * src/rsc_files.gperf: Likewise. * src/rsc_files_hash.h: Likewise. * src/userconf.h: Likewise. * src/userconf.c: Likewise. * tools/autogen.sh: Likewise. * tools/cvsboot.sh: Likewise. * tools/fetish-sync.sh: Likewise. 2001-05-05 Alexandre Duret-Lutz * src/pcx.c (delta): Remove. (pcx_load): Remove call to delta, and do some cosmetic cleanups. 2001-05-05 Alexandre Duret-Lutz Get rid of new gcc-3.0 warnings. * src/const.c (draw_glenz_box): Remove `operation possibly undefined warning'. * src/pcx.c (delta): Likewise. * src/render.c (draw_radar_map, draw_score, draw_logo_info): Likewise. * src/heroes.c (output_screen): Likewise. (play_game): Set default value for 0 to suppress a warning. 2001-05-05 Alexandre Duret-Lutz * GNUmakefile: New file. * Makefile.am (EXTRA_DIST): Add GNUmakefile. * HACKING: Update. 2001-05-05 Alexandre Duret-Lutz * m4/gnu-source.m4: New file. * tools/fetish-sync.sh (files): Add m4/gnu-source.m4. * configure.in: Call AC__GNU_SOURCE. 2001-05-04 Alexandre Duret-Lutz Change the CREDIT screen to thanks ALL people. * src/people.h: New file. * src/people.tpl: Generate people.c. * src/Makefile.am (heroes_SOURCES): Add people.h add people.c. (people.c): New target. * src/menu.c (people_text): New variable. (credit_menu): Remove variable. (init_menus_sprites, uninit_menus_sprites): Handle people_text, remove reference to credit_menu. (handle_reader_keys): New functions. (jukebox_keys): Call handle_reader_keys. (jukebox_menu): Display people_text instead of credit_menu. * src/people.def: Add Eugenia Loli-Queru, Ian Dalton, and Pascal Rigaux. * src/relocate.c (try_to_explore_path): Oops, exit the loop if needed. 2001-05-03 Alexandre Duret-Lutz Generate AUTHORS, THANKS, and the associated section of the documentation from a central file (src/people.def). * AUTHORS: Delete. * THANKS: Delete. * Makefile (AUTHORS, THANKS): New targets. * src/people.def: New file. * src/people.tpl: New file. * src/Makefile.am (heroes_SOURCES): Add people.def or people.tpl. * doc/Makefile.am (heroes_TEXINFOS, MAINTAINERCLEANFILES): Add people.texi. (people.texi): New target. * doc/heroes.texi (Authors, Contributors): Replaces these sections ... (People): ... with this one, which includes people.texi. 2001-05-03 Alexandre Duret-Lutz * configure.in: Ask AM_GNU_GETTEXT to check for ngettext. Reported by Jean. 2001-05-01 Alexandre Duret-Lutz * configure.in: Bump version number to 0.9b. * NEWS: Update for 0.9b 2001-05-01 Alexandre Duret-Lutz * doc/heroes.texi (Relocatable package): New section. * tools/readme.sed: Adjust summary. 2001-05-01 Alexandre Duret-Lutz Better relocation: use argv0 and PATH to guess the location of data files. * configure.in: Check for memrchr. * lib/dirname.c: New file. * lib/dirname.h: New file. * lib/memrchr.c: New file. * lib/Makefile.am (EXTRA_DIST): Add memrchr. (noinst_HEADERS): Add dirname.h. (libheroes_a_SOURCES): Add dirname.c. * src/relocate.c (try_to_derive_argv0, try_backward_relative_bindir, try_to_explore_path): New functions. (relocate_data): Call this function. Take a argv0 argument. * src/relocate.h (relocate_data): Take a argv0 argument. * src/heroes.c (main): Adjust call to relocate_data. 2001-05-01 Alexandre Duret-Lutz From Alessandro Dotti . * po/it.po: New revision. 2001-04-30 Alexandre Duret-Lutz Italian translations. From Alessandro Dotti . * configure.in (ALL_LINGUAS): Add it. * po/it.po: New file. 2001-04-29 Alexandre Duret-Lutz * src/savegame.c (write_save_one_record): New function. * src/savegame.h (write_save_one_record): Likewise. * src/heroes.c (play_game): Use it. 2001-04-29 Alexandre Duret-Lutz * src/scores.c (insert_scores): New function. * src/scores.h (insert_scores): Likewise. * src/heroes.c (play_menu): Use it. 2001-04-29 Alexandre Duret-Lutz * po/fr.po: Update. 2001-04-29 Alexandre Duret-Lutz * src/relocate.c (relocate_data): Typo. 2001-04-29 Alexandre Duret-Lutz * src/menus.c (game_menu): Use ngettext to handle plural. * src/heroes.c (update_player): Likewise. * src/system.h (ngettext): Define replacement macro. 2001-04-28 Alexandre Duret-Lutz * src/etc/heroesrc (soundconf): Suggest to use ifdef suid-or-sgid to protect the definition of global paths. * src/userconf.c (read_userconf): Handle ifdef/endif. 2001-04-28 Alexandre Duret-Lutz * src/vars.h: New file. * src/vars.c: New file. * src/Makefile.am (heroes_SOURCES): Add vars.c and vars.h. * src/argv.c (list): Handle --list=variables. * src/heroes.c (main): Un/initialize variables. * src/persona.c (init_persiona): define sgid/suid/suid-or-sgid variables. 2001-04-25 Alexandre Duret-Lutz * tools/upgettext.sh: Fix function declarations, the `function' keyword is not portable. * tools/cvsboot.sh: Likewise. * tools/autogen.sh: Likewise. 2001-04-25 Alexandre Duret-Lutz * misc/01-intl.patch: New file. * misc/04-intl.patch: New file. * misc/04-m4.patch: New file. * misc/05-po.patch: New file. * Makefile.am (EXTRA_DIST): Add all the above files. * tools/upgettext.sh: Patch the gettext files using all the above patch, except 04-m4.patch (already applied). * tools/Makefile.am (EXTRA_DIST): Add upgettext.sh. 2001-04-24 Alexandre Duret-Lutz * gettext.m4: Check for getegid(). 2001-04-24 Alexandre Duret-Lutz Drop the fetish copy of gettext and switch to gettext-0.10.37, released a few days ago. The main reason for the change is that the change needed to run the old gettext on MinGW are already present in 0.10.37. * m4/lcmessage.m4: Update to gettext-0.10.37. * m4/progtest.m4: Likewise. * tools/cvsboot.sh: Run tools.upgettext.sh. * tools/fetish-sync.sh: Remove the gettext files, we are now using stock gettext. * ABOUT-NLS: Delete, installed by gettextize. * intl/ChangeLog: Likewise. * intl/Makefile.in: Likewise. * intl/VERSION: Likewise. * intl/bindtextdom.c: Likewise. * intl/cat-compat.c: Likewise. * intl/dcgettext.c: Likewise. * intl/dgettext.c: Likewise. * intl/explodename.c: Likewise. * intl/finddomain.c: Likewise. * intl/gettext.c: Likewise. * intl/gettext.h: Likewise. * intl/gettextP.h: Likewise. * intl/hash-string.h: Likewise. * intl/intl-compat.c: Likewise. * intl/l10nflist.c: Likewise. * intl/libgettext.h: Likewise. * intl/linux-msg.sed: Likewise. * intl/loadinfo.h: Likewise. * intl/loadmsgcat.c: Likewise. * intl/localealias.c: Likewise. * intl/po2tbl.sed.in: Likewise. * intl/textdomain.c: Likewise. * intl/xopen-msg.sed: Likewise. * po/Makefile.in.in: Likewise. * m4/libintl.m4: Delete, gettext use gettext.m4. * m4/codeset.m4: New file, from gettext-0.10.37. * m4/gettext.m4: Likewise. * m4/iconv.m4: Likewise. * m4/isc-posix.m4: Likewise. * tools/upgettext.m4: New file. * HACKING: Reflect changes. 2001-04-21 Alexandre Duret-Lutz * configure.in: Bump version number to 0.9a. * Makefile.am (null_AM_MAKEFLAGS): Set AUTOGEN to false. * src/Makefile.am (heroes_SOURCES): Add debugchn.def, debugchn.tpl, prefs.def and prefs.tpl. * lib/Makefile.am (noinst_HEADERS): Typo. * doc/Makefile.am (CLEANFILES): New. * src/system.h: Don't declare keycode_t as u32_t. * doc/heroes.texi (Machines): Add BeOS. Reported by Todd Allendorf . 2001-04-21 Alexandre Duret-Lutz * m4/checkpkg.m4: Prepend new libraries, instead of appending them. * m4/ftruncate.m4: Check for chsize and define HAVE_CHSIZE, always link ftruncate.o if ftruncate() is missing. * lib/fopenlock.c (fopenlock): Don't lock the file if fcntl locking is not available. * NEWS: Prepare for 0.9a. * arch/mingw32/cross.sh (BUILDNAME): s/i386/i586/ to follow Debian change. * HACKING: Needs autogen. 2001-04-17 Alexandre Duret-Lutz * src/persona.c (user_persona, sys_persona): Typo. * src/display.c (get_directbuffers): Argument v is not a pointer. * src/joystick.c (joystick): Not a pointer. 2001-04-16 Alexandre Duret-Lutz * src/prefs.tpl (load_preferences): Free buf. 2001-04-15 Alexandre Duret-Lutz * lib/basename.c: New file. * lib/basename.h: New file. * lib/Makefile.am (noinst_HEADERS): Add basename.h. (libheroes_a_SOURCES): Add basename.c. * tools/fetish-sync: Add basename.c. * HACKING: Likewise. * src/debugmsg.c (dmsg_init): Basename-ify the program name. 2001-04-15 Alexandre Duret-Lutz Ahem... output debug messages on stdout, as said in HACKING. * src/debugmsg.c (dmsg): s/stderr/stdout/. 2001-04-15 Alexandre Duret-Lutz * lib/isdir.c: New file. * lib/isdir.h: New file. * lib/Makefile.am (noinst_HEADERS): Add isdir.h. (libheroes_a_SOURCES): Add isdir.c. * tools/fetish-sync.sh: Add lib/isdir.c * HACKING: Add lib/isdir.c. * src/relocate.c (check_installation): New. (relocate_data): Call check_installation. 2001-04-10 Alexandre Duret-Lutz Compute make $(data-dir) and $(locale-dir) relative to $(prefix), and handle HEROES_PREFIX to override $(prefix). The next step is to compute/guess HEROES_PREFIX. * src/relocate.c: New file. * src/relocate.h: New file. * doc/heroes.texi (Example): Document HEROES_PREFIX. * m4/h-paths.m4: New file. * configure.in: Asjust to use heroes_COMPUTE_PATHS. * src/Makefile.am (localedir, DEFS): Remove. (heroes_SOURCES): Add relocate.c and relocate.h. * src/heroes.c: Adjust to call relocate_data. * src/resc_files.gperf (data-dir): Use FORWARD_RELATIVE_PKGDATADIR. (locale-dir): Use FORWARD_RELATIVE_LOCALEDIR. (prefix): New. 2001-04-18 Alexandre Duret-Lutz Merge with autogen-pending-BRANCH, I thought I would wait until Autogen 5.1.5 is released, but I give up (most of my upcomming patches would introduce conflicts in one branch or the other. There is a prerelease of autogen available here: ftp://autogen.sourceforge.net/pub/autogen/ Version 5.1.4d is a minimum. |2001-03-21 Alexandre Duret-Lutz | | * src/prefs.tpl: Use the ".name" notation to designate | locale variables in AutoGen >= 5.1.5 (not yet released). | |2001-03-18 Alexandre Duret-Lutz | | Basic protection against people that don't have AutoGen. | | * configure.in: Define AUTOGEN using AM_MISSING_PROG, fix | other AM_MISSING_PROG uses. | * doc/Makefile.am: Use $(AUTOGEN). | * src/Makefile.am: Likewise. | |2001-03-18 Alexandre Duret-Lutz | | * HACKING (Auto-generated files): Add src/prefs.c and src/prefs.h. | |2001-03-18 Alexandre Duret-Lutz | | * doc/heroes.texi (Heroes options): Document --list=preferences. | * src/argv.c (showprefs): New variable. | (list): Handle --list=preferences. Return a boolean | to indicate whether the action is finished or has been delayed. | (parse_argv): Adapt to follow this latter convention. | * src/argv.h (showprefs): New variable. | * src/heroes.c (main): Output the preferences if requested. | |2001-03-18 Alexandre Duret-Lutz | | Save preferences in text form. Generate the i/o code | automatically from a description of the preferences. | | * src/options.c: Delete. | * src/options.h: Delete. | * src/prefs.def: New file. | * src/prefs.tpl: New file. | * src/Makefile.am (heroes_SOURCES): Remove options.c and options.h, | add prefs.c and prefs.h. | (BUILT_SOURCES): Add prefs.c and prefs.h. | (prefs.h, prefs.c): New files. | * src/const.c: Include prefs.h instead of options.h. | * src/menus.c: Likewise. | * src/render.c: Likewise. | * src/scrtools.c: Likewise. | * src/sfx.c: Likewise. | * src/sound.c: Likewise. | * src/heroes.c: Likewise, also transform call to write_options, | reinit_options, load_options, and free_options to their new names: | save_preferences, reinit_preferences, load_preferences, | free_preferences. | * src/rsc_files.gperf: Remove options-file, add pref-file. | * src/system.h (PREF_INPUT_GROUP): New macro. | |2001-03-11 Alexandre Duret-Lutz | | Centralize the definition of debug channels into src/debugchn.def. | Use AutoGen the generate the hash table, the channel enumeration, | and the documentation. | | * doc/Makefile.am (heroes_TEXINFOS): New. | (MAINTAINERCLEANFILES): New. | (debugchn.texi): New. | * doc/heroes.texi (Environment variables): Remove the debug channels | table, include debugchn.texi instead. | * src/Makefile.am (heroes_SOURCES): Add debugchn.h. | (BUILT_SOURCES): Add debugchn.h and debughash.gperf. | (debughash.gperf, debugchn.h): New. | * src/debughash.gperf: Remove from CVS (now generated). | * src/debugmsg.h: Don't declare the channels, include debugchn.h | instead. | * src/debugchn.def: New file. | * src/debugchn.tpl: New file. | 2001-04-18 Alexandre Duret-Lutz * THANKS: Update Jos Boersema's email, the old bounced and I just came across this new one in the archive for the bug-texinfo mailing list. 2001-04-17 Alexandre Duret-Lutz * src/menus.c (enter_your_name): Work directly with keycodes to not misinterpret extended keys (sush as shift keys) as standard characters. Reported by Janos Holanyi . 2001-04-07 Alexandre Duret-Lutz * m4/getoptlong.m4: Update for submission to the Autoconf macro archive. 2001-04-01 Alexandre Duret-Lutz * m4/normpath.m4: New file. * m4/relpaths.m4: New file. * m4/stdrelpaths.m4: New file. 2001-03-29 Alexandre Duret-Lutz * configure.in: Check for uid_t, gid_t, getegid, setegid, and setregid. * src/persona.c: Use setregid and setreuid when setegid and seteuid are not found. * src/system.h (seteuid, setegid, setreuid, setreguid, geteuid, getuid, getegid, getgid): New replacement macros. 2001-03-26 Alexandre Duret-Lutz Keep track of secure (trusted) resources, and only change personna when handling such resources. * src/rsc_files_hash.h: Add a secure attribute. * src/rsc_files.gperf: Supply `true' for all secure attributes. * src/Makefile.am (rsc_files_hash.c): Adjust to initialize the secure member of empty hash entries to false. * src/userconf.c: Take a secure argument. * src/usercong.h: Adjust accordingly. * src/rsc_files.c (set_rsc_file): Take a secure argument. (rsc_expand, get_rsc_file, get_non_null_rsc_file): Rename to ... (rsc_expand_secure, get_rsc_file_secure, get_non_null_rsc_file_secure): ... these, and take a secure argument. (rsc_expand, get_rsc_file, get_non_null_rsc_file): New function, written using the above. * src/rsc_files.h: Adjust accordingly. * src/heroes.c (main): Adjust set_rsc_file, and read_userconf calls. * src/persona.c (sys_persona_if_needed): Make sure we handle secure resources. * doc/heroes.texi (Global score file): Update accordingly. Bug fix: persona_fopenlock already takes care of switching persona if needed. * src/scores.c (load_scores_and_keep_locked): Don't call sys_persona. 2001-03-20 Alexandre Duret-Lutz Support for relocatable locales. * src/heroes.c (main): Check for HEROES_LOCALE_DIR or HEROES_LOCALEDIR and set the locale-dir resource accodingly. Use this resource to initialize the locales. * src/rsc_files.gperf (locale-dir): New entry. * src/Makefile.am (rsc_files_hash.c): Adapt key indexes. * doc/heroes.texi (Environment variables): Document HEROES_LOCAL_DIR, and note the --list=resources can be used to check the value of data-dir and locale-dir. 2001-03-25 Alexandre Duret-Lutz Support for set-group-id and set-user-id access to a global score/savedgames file. * src/persona.c: New file. * src/persona.h: New file. * src/Makefile.am (heroes_SOURCES): Add persona.c and persona.h. * src/heroes.c (main): Call init_persona. * src/rsc_files.gperf (sys-dir): New. * src/savegame.c (write_save_records, load_save_records_open, load_scores_and_keep_locked): Adapt to use persona_fopenlock. And don't output the data unless the file has been succesfully opened. * src/scores.c (write_scores, load_scores_open, load_scores_and_keep_locked): Likewise. * doc/heroes.texi (Sharing a global score file): Document more. * src/etc/heroesrc: Adapt to new resources names. 2001-03-25 Alexandre Duret-Lutz Truncate scores and saved-games files, before writing to them. * lib/ftruncate.c: New file (from fileutils-4.0.39). * m4/ftruncate.m4: Likewise. * lib/Makefile.am (EXTRA_DIST): Add ftruncate.c. * tools/fetish-sync.sh (files): Add lib/ftruncate.c and m4/ftruncate.m4. * HACKING: Likewise. * configure.in: Call jm_FUNC_FTRUNCATE. * src/savegame.c (write_save_records): Truncate the file. * src/scores.c (write_scores): Likewise. 2001-03-25 Alexandre Duret-Lutz Replace game magics by game IDs, which serve the same purpose but are 128bits values. See comments in src/gameid.h. * src/gameid.h: New file. * src/gameid.c: New file. * src/Makefile.am (heroes_SOURCES): Add gameid.c and gameid.h. * src/const.c (game_magic): Replace by ... (game_id): ... this new variable. * src/const.h: Likewise. * src/heroes.c (play_menu, play_game): Adapt to use game IDs. * src/menus.c (draw_saved_games_info): Likewise. * src/savegame.c (clear_save_records, write_save_records, load_save_records_read): Likewise. (load_save_records_error): New function. (compute_magic, set_magic, find_magic): Remove. * src/savegame.h: Adjust. * src/scores.c (find_score_by_gameid): New function. (clear_scores, write_scores, load_scores_read): Adapt to yse game IDs. (load_scores_error): New function. * src/scores.h: Adjust. 2001-03-24 Alexandre Duret-Lutz * src/savegame.h: Copyright 2001. * src/savegame.c: Likewise. (load_save_records_read): Skip the initial space in the name. * src/score.c (load_scores_read): Likewise. (clear_scores): Don't set unused attributes. * src/score.h (top_score): Remove unused attributes. 2001-03-24 Alexandre Duret-Lutz Save the games as text. * src/rsc_files.gperf (games-file): Remove. (saved-games-file): New. * src/savegame.c (saves_file): Rename as ... (saved_games_file): ... this. Adjust all calls. (check_save_records, bswap_save_records): Remove. (write_save_records, load_save_records_read): Write and read the saved games as text. (load_save_records, load_save_records_and_keep_locked): Adjust to open the saved games file as text file. Create the file if needed. * src/savegame.h (saved_game): Declare used as bool. 2001-03-24 Alexandre Duret-Lutz Save the scores as text. * src/misc.c (chomp): New function. * src/misc.h (chomp): New function. * src/rsc_files.gperf (scores-file): Remove. (score-file): New. * src/scores.c (scores_file): Rename as ... (score_file): ... this. Adjust all calls. (check_scores, bswap_scores): Remove. (write_scores, load_scores_read): Write and read the scores as text. (load_scores, load_scores_and_keep_locked): Adjust to open the score as text file. Create the file if needed. 2001-03-24 Alexandre Duret-Lutz Adapt score and save records loading/saving to locking. Not perfect yet. * src/heroes.c (play_menu): Adapt to use load_scores_and_keep_locked. (play_game): Adapt to use load_save_records_and_keep_locked. (main): Don't load scores and save records, but save them right after clearing them if it was requested. * src/menus.c (scores_menu): Load scores to be up to date. * src/savegame.c (compute_magic): Likewise. (load_save_records): Move the x10sav cheat to ... (clear_save_records): ... here. (load_save_records): Split into ... (load_save_records_open, load_save_records_read): ... these new functions. (load_save_records_and_keep_locked): New function. (write_save_records): Adjust. * src/struct.h (save_game): Move ... * src/savegame.h (save_game): ... here. (load_save_records_and_keep_locked): New function. * src/scores.c (load_scores): Split into ... (load_scores_open, load_scores_read): ... these new functions. (load_scores_and_keep_locked): New function. (write_scores): Adjust. * src/struct.h (top_scores): Move ... * src/scores.h (top_scores): ... here. (load_scores_and_keep_locked): New function. 2001-03-23 Alexandre Duret-Lutz Introduce file locking support (as well as portability issues, I guess...). * lib/fopenlock.c: New file. * lib/fopenlock.h: New file. * lib/Makefile.am (noinst_HEADERS): Add fopenlock.h. (libheroes_a_SOURCES): Add fopenlock.c. * m4/fopenlock.m4: New file. * m4/Makefile.am (EXTRA_DIST): Add fopenlock.m4. * configure.in: Use adl_FUNC_FOPENLOCK. 2001-03-20 Alexandre Duret-Lutz * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2. 2001-03-16 Alexandre Duret-Lutz * src/system.h (KEYCODE_MAX): New macro. 2001-03-12 Alexandre Duret-Lutz * src/options.h (extrasel): Move ... * src/menus.h (extrasel): ... here. * src/options.c (extrasel): Move ... * src/menus.c (extrasel): ... here. 2001-03-19 Alexandre Duret-Lutz From Hermann J. Beckers . * po/de.po: New version. 2001-03-14 Alexandre Duret-Lutz From Hermann J. Beckers . * po/de.po: New version. 2001-03-10 Alexandre Duret-Lutz * HACKING (Console output): New section. 2001-03-10 Alexandre Duret-Lutz From Hermann J. Beckers . * po/de.po: New version. 2001-03-09 Alexandre Duret-Lutz German translations. From Hermann J. Beckers . * configure.in (ALL_LINGUAS): Add `de'. * po/de.po: New file. * THANKS: Add Hermann. * doc/heroes.texi: Likewise. 2001-02-28 Alexandre Duret-Lutz * m4/mkdir.m4: Update for submission to the Autoconf macro archive. 2001-02-24 Alexandre Duret-Lutz * configure.in: Bump to version 0.9. * NEWS: Update for 0.9. * doc/heroes.texi (configure options): Make the --enable-debug recommendation clearer. 2001-02-23 Alexandre Duret-Lutz * src/helptext.c (help_text3): Remove a doubled `the'. Reported by Jos Boersema . * po/nl.po: Update accordingly. * po/fr.po: Update accordingly, mark as `0.9 compliant'. 2001-02-22 Alexandre Duret-Lutz * arch/mingw32/cross.sh (cross_pack): Work around a strange behavior of zip, rooting the archive on `/heroes/' instead of `heroes/'. Reported by Jean. 2001-02-22 Alexandre Duret-Lutz * arch/mingw32/cross.sh (cross_install): zip the changelog, instead of gzip'ing it. Suggested by Jean. (cross_pack): Typo. * arch/ming32/dest-readme-txt: Add more text, suggest -F, give the bug-report address. * arch/ming32/dest-readme-lib: Update to newer libs. 2001-02-22 Alexandre Duret-Lutz * doc/heroes.texi (Machines): Describe the Win32/VisualC files as obsolete. 2001-02-22 Alexandre Duret-Lutz From Jean Delvare . * HACKING: Typo. * ChangeLog: Likewise. * src/menus.c (init_menus_sprites): Likewise. 2001-02-21 Alexandre Duret-Lutz * BUGS: Sync up with the recent bug reports from the lists. 2001-02-20 Alexandre Duret-Lutz * Makefile.am (distcheck-hook): Add my-distcheck-nodisplay. (my-distcheck-nodisplay): New target. * HACKING: Update accordingly (distcheck now makes four builds). 2001-02-19 Alexandre Duret-Lutz * configure.in: Bump to version 0.8f. * NEWS: Update for 0.8f. * src/Makefile.am: Copyright 2001. * src/keysdef.c: Likewise. * Makefile.am: Likewise. * po/fr.po: Update. * po/nl.po: Update. 2001-02-19 Alexandre Duret-Lutz * src/menus.c (keyboard_menu): Regenerate keyname sprites for conflicting keys. Reported by Jean Delvare . 2001-02-19 Alexandre Duret-Lutz Make sure no sticky bits go into the distribution. Reported by Jean Delvare . * Makefile.am (dist-hook): New. 2001-02-19 Alexandre Duret-Lutz From Jean Delvare . * NEWS: s/two players game/two player game/. * doc/heroes.texi: Likewise. 2001-02-19 Alexandre Duret-Lutz * src/argv.c (version): Set copyright year to 2001. Reported by Jean Delvare . 2001-02-19 Alexandre Duret-Lutz Make sure the manual pages are up-to-date before releasing. Reported by Jean Delvare . * man/Makefile.am (man-distcheck): New target. * Makefile.am (man-distcheck): New target. (distcheck-hook): Depend upon man-distcheck. 2001-02-18 Alexandre Duret-Lutz Support for --disable-display. * doc/heroes.texi (configure options): Document --disable-display. * m4/h-ggi.m4 (heroes_CHECK_GGI_POST): New. * m4/h-display.m4: Handle --disable-display. Call heroes_CHECK_GGI_POST. * m4/h-sound.m4: sound_lib default to . * src/Makefile.am (CLEANFILES): Remove keysdef-inc.h. (DISTCLEANFILES): Add keysdef-inc.h. (keysdef-inc.h): Don't depend upon $(CONFIG_HEADER); create keysdef-inc.h when neither GGI nor SDL are used. * src/display.h [!HAVE_LIBSDL && !HAVE_LIBGGI] (set_display_params, set_full_screen_mode, init_video, uninit_video, set_color, vsynchro, vsynchro2, set_pal): Define new empty macros. * src/keyb.c [!HAVE_LIBSDL && !HAVE_LIBGGI] (update_mouse_state): Define new empty macro. (uninit_keyboard_map): Define only once. * src/keyb.h [!HAVE_LIBSDL && !HAVE_LIBGGI] (process_input_events, get_key, key_ready, init_mouse, mouse_show, mouse_hide): Define new empty macros. * src/keys_heroes.h [!HAVE_LIBSDL && !HAVE_LIBGGI]: Define keys. * src/keysdef.c: Suppress RCS Id. * src/system.h [!HAVE_LIBSDL && !HAVE_LIBGGI] (keycode_t): Define. 2001-02-17 Alexandre Duret-Lutz * NEWS: s/Dutsh/Dutch/ * ANNOUNCE: Prepare for 0.9. * TODO: Likewise. 2001-02-16 Alexandre Duret-Lutz Heroes binaries to compiled with gcc 2.7.* failed pack struct correctly. * src/system.h: Undefine __attribute__ after xalloc.h inclusion. This is needed because we want to use __attribute__ ((packed)) on gcc 2.7.* while xalloc.h inhibit it for gcc <= 2.8. 2001-02-14 Alexandre Duret-Lutz From Jean Delvare. Spelling mistakes. * src/heroes.c (play_game): s/chose/choose/. * src/sprglenz.h: Likewise. * src/menus.c (init_menus_sprites): Likewise. s/TWO PLAYER/TWO PLAYERS/. 2001-02-13 Alexandre Duret-Lutz * configure.in: Bump to 0.8e. * NEWS: Update for 0.8e. * po/fr.po: Update. 2001-02-13 Alexandre Duret-Lutz * src/const.c (tunnel_square_io): Move to ... * src/heroes.c (tunnel_square_io): ... here. * src/const.c (radar_trail_color, radar_wall_color): Move to ... * src/render.c (radar_trail_color, radar_wall_color): ... here. * src/const.c (mode_names): Move to ... * src/menus.c (mode_names): ... here. * src/const.h (tunnel_square_io, radar_trail_color, radar_wall_color, mode_names): Remove. 2001-02-13 Alexandre Duret-Lutz * TODO: Update. 2001-02-13 Alexandre Duret-Lutz * src/display.c [HAVE_LIBGGI] (setup_WWWxHHHxB_display): Ask for GT_8BIT if possible. 2001-02-13 Alexandre Duret-Lutz * lib/xmalloc.c: Update from fileutils-4.0.39. 2001-02-13 Alexandre Duret-Lutz * src/display.c (set_color, set_pal): Don't set palette on visu if it is not palletized. 2001-02-13 Alexandre Duret-Lutz Revert an error I did when adapting Jean's patch. * src/menus.c (keyboard_menu): Don't strip keyname which are 7 letter wide, only thos which are longer. 2001-02-12 Alexandre Duret-Lutz Adapted from Jean Delvare . * src/menus.c (keyboard_menu): Strip wide keynames to 6 letters. 2001-02-12 Alexandre Duret-Lutz From Jos Boersema . * po/nl.po: Update. 2001-02-11 Alexandre Duret-Lutz * src/scrtools.c (set_pal_with_luminance): Perform gamma correction, use set_pal rather than set_palette. * src/options.c (reinit_options): Use 6 as default luminance value. * src/menu.c (screen_menu): Use 13 steps for the luminance option. 2001-02-11 Alexandre Duret-Lutz Important revamp of the LibGGI display driver to not use the `render_visu' intermediate buffer when crossblitting is unneeded, perform double buffering and locking. * src/display.c (screen_rv): Move to ... [HAVE_LIBSDL] (screen_rv): ... here. [HAVE_LIBGGI] (db, current_frame): New variables. [HAVE_LIBGGI] (setup_320x200x8_display, setup_320x200xB_display, setup_WWWxHHHxB_display, get_directbuffers): New functions. [HAVE_LIBGGI] (init_video): Revise, using the above functions. [HAVE_LIBGGI] (set_color, set_pal): Don't set paletter on render_visu when render_visu == NULL. [HAVE_LIBGGI] (vsynchro): Rewrite as a call to vsynchro2. [HAVE_LIBGGI] (vsynchro2): Revise to perform double buffering, locking, and write to visu or render_visu. 2001-02-08 Alexandre Duret-Lutz From Jos Boersema . * po/nl.po: Update. 2001-02-07 Alexandre Duret-Lutz * NEWS: Update for 0.8d. 2001-02-06 Alexandre Duret-Lutz * doc/heroes.texi (configure options): Say that --enable-debug will check the translated message. * HACKING: Add a section `Translating message catalogs'. 2001-02-06 Alexandre Duret-Lutz * src/sprtext.c (compile_sprtext, compile_sprtext_color): Don't compile undrawable letters. 2001-02-06 Alexandre Duret-Lutz * po/fr.po: Update for 0.8d. * po/nl.po: Merge. 2001-02-06 Alexandre Duret-Lutz * src/argv.c: Add comments for translators. * src/const.c: Likewise. * src/display.c: Likewise. * src/menus.c: Likewise. * src/readmake.c: Likewise. 2001-02-06 Alexandre Duret-Lutz Report unprintable messages before crashing... * src/system.h (XCALLOC_ARRAY): New. * src/fontdata.c (initialize_menu_font, initialize_deck_font, initialize_bonus_font, initialize_help_font): Use XCALLOC_VAR instead of XMALLOC_VAR and memset. This actually suppress a mistake because memset was called mistakenly. [DEBUG] (check_message_is_drawable): New function. * src/fontdata.h (check_message_is_drawable): New. * src/sprtext.c (compile_sprtext, compile_sprtext_color): Call check_message_is_drawable. 2001-02-05 Alexandre Duret-Lutz Dutch translation from Jos Boersema . * po/nl.po: New file. * configure.in (ALL_LINGAS): Add nl. * doc/heroes.texi (Contributors): Add Jos Boersema. * THANKS: Likewise. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c (affplan, afftests): Rename as ... (draw_level_map, draw_collide_tests): ... these. (planfull): Rename as ... (display_level_map_fullscreen): ... this. (joueanim): Rename as ... (display_level_map_animated): ... this. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c (partiel4c, carre, framept): Rename as ... (copy_tile_pcx, draw_check_point, frame_dashed): ... these. (affgt, majg, majd): Rename as ... (draw_left_panel, update_left_panel, update_middle_panel): ... these. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c (partiel4, partiel2): Rename both as ... (rectangle_copy): ... this. Adjust all calls. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c (fatalog): Remove. (hmain): Replace calls to fatalog by calls to emsg, gettextize the messages. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c: Cosmetic changes, comment removal. * src/structs.h (type_name, spd_test, dir_test): Move to ... * src/hedlite.c (type_name, spd_test, dir_test): ... here. 2001-02-02 Alexandre Duret-Lutz * configure.in: Bump to 0.8d. 2001-02-01 Alexandre Duret-Lutz * configure.in: Bump to 0.8c. * NEWS: Update for 0.8c, plus a missing entry in 0.8a. * po/fr.po: Update. 2001-02-01 Alexandre Duret-Lutz * src/fader.c (cancel_fader): New function pulled out from run_fader. (run_fader): Use it. * src/fader.h (cancel_fader): New. * src/scrtools.c (set_palette): New function. (set_pal_with_luminance): Use it instead of set_pal. * src/menus.c (pause_menu, quit_yes_no): Likewise. * src/scrtools.h (set_palette): New. 2001-02-01 Alexandre Duret-Lutz Use the same animated background as in the "endscroll" in pase_menu and quit_yes_no, since it is no longer possible the shade the screen. * src/endscroll.c (background_img, render_background): Rename as ... (dummy_background_img, dummy_moving_background_render): ... this, and export. (copy_background): Adjust accordingly. (end_scroll): Split into ... (dummy_moving_background_init, dummy_backgournd_uninit, end_scroll): ... these. * src/endscroll.h (dummy_backgournd_img, dummy_moving_background_init, dummy_backgournd_uninit, dummy_moving_background_render): New. * src/menus.c (pause_menu, quit_yes_no): Use dummy_moving_background_render. 2001-01-31 Alexandre Duret-Lutz Remove obsolete code (that was already commented out). * src/hedlite.c (gestclav) [PORT]: Remove. * src/heroes.c (unload_level, main) [PORT]: Remove. 2001-01-31 Alexandre Duret-Lutz Handle the middle button if the level editor, fix some compiler warning as well as two bugs. * src/keyb.c (enable_mouse, mouse_pos_x, mouse_pos_y, mouse_button_left, mouse_button_right): Mark as static. (mouse3): New function. (mouse_button_middle): New variable. (mous12): Also test for mouse_button_middle. [HAVE_LIBGGI] (update_mouse_state): Update mouse_button_middle. [HAVE_LIBSDL] (handle_mouse_events): Likewise. * src/keyb.h (mouse3): New. * src/heroes.c (ia_eval_dir_bonus_inline): Add back missing call to ia_eval_dir_bonus, removed by mistake on 2000-11-14 (0.6d). (ia_eval_dir_bonus): Move variable around. * src/hedlite.c (hmain): Rename variable i as k, and move it in near the event loop. Enable the third mouse button. (framept): s/320/xbuf/ (bugfix). * src/menus.c (keyboard_menu): Supply initial value for t. (scores_menu): Supply initial value for rolldec. * src/sfx.c (read_sfx_conf): Don't test for fconf in error handling, it's not always set. * src/sprtext.c (compile_sprtext, compile_sprtext_color): Supply initial value for text_width. * doc/heroes.texi (editor-clicks): Document the middle button. 2001-01-31 Alexandre Duret-Lutz * HACKING: Strip down. 2001-01-31 Alexandre Duret-Lutz * doc/heroes.texi: s/Burrow/Burrows/. * THANKS: Likewise. 2001-01-30 Alexandre Duret-Lutz Missing copyright updates from previous patches. * doc/heroes.texi: Copyright 2001. * src/menus.c: Likewise. * src/render.h: Likewise. * src/scrtools.h: Likewise. 2001-01-30 Alexandre Duret-Lutz * src/helptext.c (help_text1): Point users at the arrow keys. Suggested by Daniel Burrows. 2001-01-30 Alexandre Duret-Lutz * src/display.c (screen): Remove variable. [HAVE_LIBGGI, HAVE_LIBSDL] (init_video, uninit_video): Don't handle screen anymore. * src/display.h (screen): Remove variable. * src/menus.c (pause_menu, quit_yes_no): Comment calls to backup_screen, they need a replacement. * src/scrtools.c (vsynch, backup_screen, aff_buffer): Remove functions. * src/scrtools.h (vsynch, backup_screen, aff_buffer): Likewise. 2001-01-30 Alexandre Duret-Lutz * src/render.c (display_buffer_moving): Remove. * src/render.c (display_buffer_moving): Remove. * src/scrtools.c (flush_display_moving): New function. * src/scrtools.h (flush_display_moving): New function. * src/heroes.c (play_game): Use flush_display_moving instead of display_buffer_moving. 2001-01-30 Alexandre Duret-Lutz * src/render.c (display_two_buffers_moving_and_clear, display_two_buffers_moving): Remove. * src/render.h (display_two_buffers_moving_and_clear, display_two_buffers_moving): Remove * src/scrtools.c (flush_display2_moving): New function. * src/scrtools.h (flush_display2_moving): New function. * src/heroes.c (play_demo, play_game): Use flush_display2_moving instead of display_two_buffers_moving_and_clear or display_two_buffers_moving. 2001-01-30 Alexandre Duret-Lutz * src/display.c (stretch_twofold, stretch_twofold_even, stretch_threefold, stretch_threefold_even, stretch_fourfold, stretch_fourfold_even, copy_screen_even, copy_screen, copy_display): Take destination and width as arguments. [HAVE_LIBSDL, HAVE_LIBGGI] (vsynchro): Adapt call to copy_display. [HAVE_LIBSDL, HAVE_LIBGGI] (vsynchro2): New function. * src/display.h (vsynchro2): Likewise. * src/render.c (display_buffer_tmp1): Remove. (display_two_buffer): Remove. * src/render.h (display_buffer_tmp1): Remove. (display_two_buffer): Remove. * src/srctools.c (flush_display2): New function. * src/srctools.h (flush_display2): New function. * src/heroes.c (play_demo, play_game): Replace calls to display_two_buffer with calls to flush_display2. 2001-01-29 Alexandre Duret-Lutz Get rid of `screen' in heroes.c and menus.c. * src/heroes.c (main_menu): Rewrite the two pixelize blocks using a local `pixbuf' buffer instead of using screen. * src/menus.c (enter_your_name): Likewise. 2001-01-29 Alexandre Duret-Lutz Get rid of `screen' in hedlite.c. * src/hedlite.c (hedit_buffer): New variable. (partiel4, partiel2, frame, framept, draw_text, transpac, affgt, affplan, majg, departfix, planfull, joueanim, gestclav): Use hedit_buffer instead of screen. (hmain): Likewise. Allocate and free hedit_buffer. 2001-01-29 Alexandre Duret-Lutz Get rid of `screen' in intro.c. * src/intro.c (antialias): Rewrite, assuming a xbuf-wide buffer, drawing only in the first 320 pixels of a line. Take the height as second argument, not a number of pixels. (intro_buffer): New variable. (copy_vehicle_1, copy_vehicle_2, compute_erase_data): Adapt to use intro_buffer instead of screen, flush_display instead of vsynch. (show_intro): Likewise. Adapt call to antialias. (play_intro): Allocate intro_buffer. 2001-01-21 Alexandre Duret-Lutz * m4/debug.m4: Default to -g, use -ggdb3 if enabled, and nothing if disabled. * doc/heroes.texi: Update the corresponding documentation. 2001-01-21 Alexandre Duret-Lutz * intl/ChangeLog: Update from fileutils-4.0.37. * intl/gettextP.h: Likewise. * lib/hash.c: Likewise. * po/Makefile.in.in: Likewise. 2001-01-20 Alexandre Duret-Lutz * configure.in: Call adl_WITH_MPATROL. * m4/memdebug.m4 (adl_WITH_MPATROL, adl_CHECK_MEMORY_USAGE, adl_CHECK_MPATROL_LIBS, adl_CHECK_MPATROL, adl_WITH_MPATROL): New. (adl_ENABLE_MEM_DEBUG): Call adl_CHECK_MPATROL too. (adl_CHECK_DMALLOC): Use AC_CHECK_HEADERS, not AC_CHECK_HEADER. * src/system.h [HAVE_MPATROL_H]: Include mpatrol.h. * doc/heroes.texi (configure options): Describle --with-mpatrol. 2001-01-16 Alexandre Duret-Lutz * doc/heroes.texi (Machines): Document the existence of arch/mingw32. 2001-01-16 Alexandre Duret-Lutz * src/mingw32/cross.sh: Set LIBS to libs needed to link staticaly. Don't set CC, it's detected. Output zip file is now $PACKAGE-$VERSION-XXX-ming32.zip. Adjust `cross.sh all' to halt after the first failure any subtarget. 2001-01-15 Alexandre Duret-Lutz Remove the (broken & undocumented) support for screenshots. * src/argv.c (snap): Remove. (long_options): Remove snap. * src/argv.h (snap): Remove. * src/heroes.c (write_rle, save_pcx): Remove. (get_input_direction): Remove call to save_pcx. 2001-01-15 Alexandre Duret-Lutz Flush the display directly wherever we can avoid to write in `screen'. There are still some places that use `screen' (intro, level-editor, two-player display) and need to be further worked. * src/display.c (stretch_twofold, stretch_twofold_even, stretch_threefold, stretch_threefold_even, stretch_fourfold, stretch_fourfold_even, copy_screen, copy_display): Qualify the source argument as const. [HAVE_LIBSDL,HAVE_LIBGGI] (vsynchro): Likewise. (erase_odd_line): Delete. (copy_screen_event): New. (copy_display): Use copy_screen_event instead of erase_odd_line. * src/display.h (vsynchro): Qualify the source argument as const. * src/scrtools.c (flush_display): New. (vsynch): Rewrite using flush_display. * src/scrtools.c (flush_display): New. * src/endscroll.c (end_scroll): Adapt to use flush_display. * src/heroes (play_menu, play_demo, main_menu, play_game): Likewise. * src/menus.c (display_menu, control_menu, keyboard_menu, sound_menu, screen_menu, game_menu, extra_menu, quit_menu, editor_selector, editor_menu, editor_first_menu, jukebox_draw, pause_menu, quit_yes_no, enter_your_name, scores_menu, help_menu): Likewise. 2001-01-14 Alexandre Duret-Lutz Make `screen' an xbuf*ybuf sized buffer, and adapt all code accordingly. Also prepare the display.c code to not always works from `screen' (the idea is that since the render buffers are also xbuf*ybuf we might avoid doing the copy to `screen' to save some time). * src/const.c (square_offset_320): Remove. * src/const.h (square_offset_320): Remove. (xbuf, ybuf, sbuf): Move to ... * src/display.h (xbuf, ybuf, sbuf): ... here. (vsynchro): Take the source as a parameter. * src/display.c (stretch_twofold, stretch_twofold_even, stretch_threefold, stretch_threefold_even, stretch_fourfold, stretch_fourfold_even, erase_odd_lines, copy_screen, copy_display): Arrange to take the source buffer as a parameter (for a future optimization), and consider the source as an xbuf wide buffer. [HAVE_LIBGGI, HAVE_LIBSDL] (init_video): Always allocate screen (this is only temporary). [HAVE_LIBSDL] (uninit_video): Always free screen. [HAVE_LIBGGI, HAVE_LIBSDL] (vsynchro): Take the source buffer as a new argument, and adjust the call to copy_display. * src/const.c (scdec320): Rename as ... (square_offser_320): ... this. (partiel4, copy_tile, copy_tile_transp, copy_square_transp, partiel2, frame, framept, draw_text, transpa, transpac, carre, affgt, majd, affplan, majg, departfix, planfull, joueanim, hmain): Adjust to consider screen as a xbuf-wide buffer, and supply new the source argument to vsynchro(). * src/heroes.c (play_menu): Adjust to consider screen as a xbuf-wide buffer * src/intro.c (img2vram): Remove. (copy_vehicle_1, copy_vehicle_2, compute_erase_data): Adjust to work in xbuf-wide buffers. (show_intro): Likewise. Use copy_image_to_scr_area instead of img2vram. * src/pixelize.c (pixelize_1, pixelize_2_inline, pixelize_4_inline, pixelize_8_inline, pixelize_16_inline, pixelize_16_inline_2, pixelize_32_inline, pixelize_32_inline_2, pixelize_32, pixelize_64_inline, pixelize_64_inline_2, pixelize_64): Ajust to output in xbuf-wide buffers. (pixelize): Cosmetic change. * src/render.c (display_buffer_tmp1, display_buffer_moving, display_two_ubffers, display_two_buffers_moving, display_two_buffers_moving_and_clear): Ajust to output in xbuf-wide buffers. * src/scrtools.c (vsynch): Supply the source argument to vsynchro. (backup_screen): Adjust to work from xbuf-wide buffer. (add_buffer): Adjust to output in a xbuf-wide buffer. * src/struct.h [__HEDIT__] (square_offset_320, square_offset, d2w, w2d): Remove. * src/visuals.c (flip_buffer): Cosmetic changes. 2001-01-12 Alexandre Duret-Lutz * src/timer.c (reset_htimer) [!HAVE_GETTIMEOFDAY]: Typo from 2000-12-31's patch. 2001-01-11 Alexandre Duret-Lutz mtrace() support. * configure.in: Call add_WITH_MTRACE. * doc/heroes.texi: Describe --with-mtrace. * m4/memdebug.m4 (adl_WITH_MTRACE,adl_CHECK_MTRACE): New. (adl_CHECK_MALLOC,adl_CHECK_EFENCE): Cleanup. (adl_ENABLE_MEMDEBUG): Call adl_CHECK_MTRACE. * src/heroes.c (main): Call mtrace(). * src/system.h: Include mcheck.h if needed. 2001-01-10 Alexandre Duret-Lutz * NEWS: Update for version 0.8b. * m4/README: State the h-* files are Heroes specific. 2001-01-10 Alexandre Duret-Lutz * po/fr.po: Update. 2001-01-10 Alexandre Duret-Lutz * HACKING: Update. 2001-01-10 Alexandre Duret-Lutz * m4/mkdir.m4: Use #if instead of #ifdef. * m4/memdebug.m4: Likewise. 2001-01-09 Alexandre Duret-Lutz Distribute the html documentation. Check that Heroes can build with SDL and GGI before making a distribution. * Makefile.am (distcheck-hook, null_AM_MAKEFLAGS, t, my-distcheck-ggi, my-distcheck-sdl): New. * doc/Makefile.am (CLEANFILE): Rename as ... (EXTRA_DIST): ... this, to ship heroes.html. * m4/h-obsolete.m4: Remove test for with-sdl_mixer. 2001-01-09 Alexandre Duret-Lutz * m4/h-sdl.m4: Rename HAVE_SDL into HAVE_LIBSDL. * src/display.c: Likewise. * src/keyb.c: Likewise. * src/keys_heroes.h: Likewise. * src/system.h: Likewise. Also adapt #ifdef/#ifndef usage to follow autoconf recommendation (i.e. using #if). 2001-01-09 Alexandre Duret-Lutz * src/menus.c (draw_play_menu): Move arrows closer to the screen border to give more space to translations. 2001-01-08 Alexandre Duret-Lutz Rename HAVE_PKG_GGI as HAVE_LIBGGI, HAVE_PKG_GII as HAVE_LIBGII, HAVE_PKG_SDK_MIXER as HAVE_LIBSDL_MIXER, originally all these six macros were definied. * m4/checkpkg.m4: Use AC_CHECK_LIB's third argument to prvent definition of HAVE_LIBxxx. Define HAVE_LIBxxx instead of HAVE_PKGxxx, and provide a template help string for config.h. * m4/h-ggi.m4: Suppress AH_TEMPLATE call. * m4/h-joystick.m4: Likewise. * m4/h-sdlmixer.m4: Likewise. * src/display.c: Rename macros as stated above. * src/joystick.c: Likewise. * src/keyb.c: Likewise. * src/keys_heroes.h: Likewise. * src/system.h: Likewise. 2001-01-06 Alexandre Duret-Lutz * doc/heroes.texi (configure options): Describe --enable-devel. s/disable-debug/enable-debug/ s/disable-optimization/disable-optimizations/ * m4/devel.m4: New file. * configure.in: Call adl_ENABLE_DEVEL. 2001-01-04 Alexandre Duret-Lutz * man/Makefile.am (heroes.6): Be more verbose in game description. * src/argv.c (print_help): Change game description. 2001-01-03 Alexandre Duret-Lutz * po/Makefile.in.in (update-po): Merge po-files in temporary files in the build directory, and update the source directory only when the merged catalog differs from the original. This fix the know `make distcheck' failure due to `make update-po' being called on a read-only tree. 2001-01-02 Alexandre Duret-Lutz * doc/heroes.texi (configure options): Update to recent changes. * m4/debug.m4: Default to no. 2001-01-01 Alexandre Duret-Lutz Add files needed to cross compile and build a package for mingw32. * arch/mingw32/cross.sh: New file. * arch/mingw32/dest-readme-lib: New file. * arch/mingw32/dest-readme-txt: New file. * arch/mingw32/dest-run-bat: New file. * arch/Makefile.am (EXTRA_DIST): Add mingw32{cross.sh,dest-readme-txt,dest-readme-lib,dest-run-bat}. 2001-01-01 Alexandre Duret-Lutz * configure.in: Bump to 0.8b. Copyright 2001. 2001-01-01 Alexandre Duret-Lutz * NEWS: Update for 0.8a. * TODO: Update. * tools/Makefile.am (EXTRA_DIST): Typo. 2000-XX-XX Older entries belong to ChangeLog.00. * HACKING: Update help2man URL. 2001-09-21 Alexandre Duret-Lutz * src/people.def (Romuald Genevois): Update www. 2001-09-21 Alexandre Duret-Lutz * tools/readme.sed: Update License. * doc/heroes.texi (Getting Heroes): Update Metalab link, now Ibiblio. (Libraries): Update the LibMikMod home page. 2001-09-21 Alexandre Duret-Lutz Change the license from 'GPL version 2 or any later version' to 'GPL version 2'. * Makefile.am, configure.ac, arch/Makefile.inc, doc/Makefile.am, lib/Makefile.am, man/Makefile.am, src/Makefile.am, src/argv.c, src/argv.h, src/bonus.c, src/bonus.h, src/bytesex.h, src/camera.c, src/camera.h, src/const.c, src/const.h, src/debughash.h, src/debugmsg.c, src/debugmsg.h, src/endscroll.c, src/endscroll.h, src/errors.c, src/errors.h, src/explosions.c, src/explosions.h, src/extras.c, src/extras.h, src/fader.c, src/fader.h, src/fastmem.h, src/font.h, src/font_help.h, src/fontdata.c, src/fontdata.h, src/gameid.c, src/gameid.h, src/generic_list.h, src/hedlite.c, src/hedlite.h, src/helptext.c, src/helptext.h, src/hendian.c, src/hendian.h, src/heroes.c, src/heroes.h, src/heroeslvl.c, src/intro.c, src/intro.h, src/items.c, src/items.h, src/levellst.c, src/levellst.h, src/locales.c, src/locales.h, src/menus.c, src/menus.h, src/misc.c, src/misc.h, src/musicfiles.c, src/musicfiles.h, src/parafmt.c, src/parafmt.h, src/pcx.c, src/pcx.h, src/people.h, src/persona.c, src/persona.h, src/pixelize.c, src/pixelize.h, src/readmake.c, src/readmake.h, src/relocate.c, src/relocate.h, src/render.c, src/render.h, src/renderdata.c, src/renderdata.h, src/rsc_files.c, src/rsc_files.h, src/rsc_files_hash.h, src/savegame.c, src/savegame.h, src/scores.c, src/scores.h, src/scrtools.c, src/scrtools.h, src/sprglauto.c, src/sprglauto.h, src/sprglenz.c, src/sprglenz.h, src/sprite.c, src/sprite.h, src/spropaque.c, src/spropaque.h, src/sprprog.c, src/sprprog.h, src/sprprogwav.c, src/sprprogwav.h, src/sprrle.c, src/sprrle.h, src/sprshade.c, src/sprshade.h, src/sprtext.c, src/sprtext.h, src/sprunish.c, src/sprunish.h, src/sprzcol.c, src/sprzcol.h, src/structs.h, src/system.h, src/timer.c, src/timer.h, src/userconf.c, src/userconf.h, src/userdir.c, src/userdir.h, src/vars.c, src/vars.h, src/visuals.c, src/visuals.h, src/etc/Makefile.inc, src/lvl/Makefile.inc, src/lvl/de_body.c, src/lvl/de_head.c, src/lvl/free.c, src/lvl/in_body.c, src/lvl/load.c, src/lvl/loadmac.h, src/lvl/lvl.h, src/lvl/lvl_priv.h, src/lvl/privacc.c, src/media/Makefile.inc, src/media/joystick.h, src/media/keyb.c, src/media/keyb.h, src/media/keyb_low.h, src/media/keysdef.h, src/media/keyvalues.h, src/media/sfx.c, src/media/sfx.h, src/media/strack.c, src/media/strack.h, src/media/video.c, src/media/video.h, src/media/video_low.h, src/media/allegro/keyb.c, src/media/allegro/keyvalues.c src/media/allegro/video.c, src/media/dummy/joystick.c, src/media/dummy/keyb.c, src/media/dummy/keysdef.c, src/media/dummy/keyvalues.c, src/media/dummy/sfx.c, src/media/dummy/strack.c, src/media/dummy/video.c, src/media/ggi/keyvalues.c, src/media/ggi/video.c, src/media/gii/joystick.c, src/media/mikmod/sfx.c, src/media/mikmod/strack.c, src/media/sdl/joystick.c, src/media/sdl/keyb.c, src/media/sdl/keyvalues.c, src/media/sdl/video.c, src/media/sdl_mixer/sfx.c, src/media/sdl_mixer/strack.c, src/sys/Makefile.inc, src/sys/main.h, src/sys/allegro/main.c, src/sys/std/main.c, tools/Makefile.inc: Change license. * README: Update the license section. 2001-09-21 Alexandre Duret-Lutz * src/levellst.c (print_level_list): New function. * src/levellst.h (print_level_list): New function. * src/heroes.c (heroes_main): Call print_level_list(). * src/argv.h (showlevels): New variable. * src/argv.c (showlevels): New variable. (list): Handle --list=levels. * doc/heroes.texi (Invoking heroes): Document --list=levels. 2001-09-21 Alexandre Duret-Lutz * src/argv.c (print_help): Take a 'status' argument and use it as exit value. (parse_argv): Return -1 instead of 1 when the game must quit but not with a non-null exit status. (heroes_main): Handle return values of parse_argv(). 2001-09-20 Alexandre Duret-Lutz * configure.ac: Rewrite the configuration report. 2001-09-20 Alexandre Duret-Lutz * m4/h-display.m4 (heroes_CHECK_DISPLAY_LIB): Typo preventing SDL_mixer to be checked for when Allegro is not used. Reported by Daniel Burrows . * m4/h-sdl.m4 (heroes_CHECK_SDL): Don't force-append sdlj and sdls in the user selections (so that for instance --with-sdl does still allow giij or miks to be used without user hints) * m4/h-sdlmixer.m4 (heroes_CHECK_SDL_MIXER): Don't append sdlvkm and sdlj for similar reason. * m4/h-joystick.m4 (heroes_CHECK_JOYSTICK_LIB) : Add sdlj to the user selection. 2001-09-18 Alexandre Duret-Lutz * configure.ac: Bump version to 0.13. * NEWS: Update for 0.13. * HACKING (Typenames): New section. 2001-09-18 Alexandre Duret-Lutz * src/lvl/README: Update typenames. 2001-09-18 Alexandre Duret-Lutz All typenames ending with`*_t' are officially reserved by POSIX. In the past I already had to rename `timer_t' into `htimer_t' (see 2000-08-27) to avoid name clash with NetBSD. Today I've discovered that `level_t' is defined in on alphaev56-dec-osf4.0d, so I've decided to get rid of this *_t naming definitively. The replacement convention, beginning typenames with a_ or an_, comes from http://gcc.gnu.org/ml/gcc/2001-06/msg01006.html. Each Typename from the first column is replaced by the name from the second column. anim_kind_t an_anim_kind anim_t an_anim bg_data_t a_bg_data color_rvb_t an_rvb_color copy_function_t a_copy_function cost_t a_cost dest_t a_dest dir8_t a_dir8 dir_mask8_t a_dir_mask8 dir_mask_t a_dir_mask dir_t a_dir entry_func_t an_entry_func explosion_info_t an_explosion_info explosion_t an_explosion extra_level_t an_extra_level extradir_info_t an_extradir_info extradir_list_t an_extradir_list fader_status_t a_fader_status fg_data_t a_fg_data filename_t a_filename fontdata_t a_fontdata gameid_t a_gameid htimer_t a_timer keycode_t a_keycode last_list_t a_last_list lemming_t a_lemming level_bits_t a_level_bits level_header_t a_level_header level_info_t a_level_info level_list_t a_level_list level_t a_level menu_entry_t a_menu_entry menu_t a_menu options_t an_option_set palette_t a_palette paragraph_t a_paragraph param_t a_param pcx_header_t a_pcx_header pcx_image_t a_pcx_image pixel_t a_pixel player_t a_player prefs_t a_pref_set private_read_data_t a_private_read_data prog_list_t a_prog_list read_data_t a_read_data s16_t a_s16 s32_t a_s32 s8_t a_s8 sound_track_t a_sound_track sprite_prog_list_t a_sprite_prog_list sprite_t a_sprite square_coord_pair_t a_square_corrd_pair square_coord_t a_square_coord square_index_t a_square_index strpair_t a_strpair tile_coord_pair_t a_tile_coord_pair tile_coord_t a_tile_coord tile_data_t a_tile_data tile_index_t a_tile_index tile_info_t a_tile_info tile_t a_tile tile_type8_t a_tile_type8 tile_type_t a_tile_type tunnel_t a_tunnel u16_t a_u16 u32_t a_u32 u8_t a_u8 var_entry_t a_var_entry width_t a_width word_t a_word * src/bonus.c, src/bonus.h, src/camera.c, src/camera.h, src/const.c, src/const.h, src/endscroll.c, src/endscroll.h, src/explosions.c, src/explosions.h, src/extras.c, src/extras.h, src/fader.c, src/fader.h, src/fontdata.c, src/fontdata.h, src/gameid.c, src/gameid.h, src/generic_list.h, src/hedlite.c, src/hedlite.h, src/helptext.c, src/helptext.h, src/hendian.c, src/hendian.h, src/heroes.c, src/heroes.h, src/heroeslvl.c, src/intro.c, src/items.c, src/items.h, src/levellst.c, src/levellst.h, src/menus.c, src/menus.h, src/musicfiles.c, src/musicfiles.h, src/parafmt.c, src/parafmt.h, src/pcx.c, src/pcx.h, src/people.h, src/people.tpl, src/pixelize.c, src/pixelize.h, src/prefs.def, src/prefs.tpl, src/readmake.c, src/readmake.h, src/render.c, src/render.h, src/renderdata.c, src/renderdata.h, src/savegame.h, src/scores.c, src/scores.h, src/scrtools.c, src/scrtools.h, src/sprglauto.c, src/sprglauto.h, src/sprglenz.c, src/sprglenz.h, src/sprite.c, src/sprite.h, src/spropaque.c, src/spropaque.h, src/sprprog.c, src/sprprog.h, src/sprprogwav.c, src/sprprogwav.h, src/sprrle.c, src/sprrle.h, src/sprshade.c, src/sprshade.h, src/sprtext.c, src/sprtext.h, src/sprunish.c, src/sprunish.h, src/sprzcol.c, src/sprzcol.h, src/structs.h, src/system.h, src/timer.c, src/timer.h, src/vars.c, src/visuals.c, src/visuals.h, src/lvl/de_body.c, src/lvl/de_head.c, src/lvl/free.c, src/lvl/in_body.c, src/lvl/load.c, src/lvl/loadmac.h, src/lvl/lvl.h, src/lvl/lvl_priv.h, src/lvl/privacc.c, src/media/keyb.h, src/media/keysdef.h, src/media/keyvalues.h, src/media/sfx.c, src/media/strack.c, src/media/strack.h, src/media/video.c, src/media/video.h, src/media/video_low.h, src/media/allegro/keyb.c, src/media/allegro/keyvalues.c, src/media/allegro/video.c, src/media/dummy/keyb.c, src/media/dummy/keyvalues.c, src/media/dummy/video.c, src/media/ggi/keyb.c, src/media/ggi/keyvalues.c, src/media/ggi/video.c, src/media/sdl/keyb.c, src/media/sdl/keyvalues.c, src/media/sdl/video.c: Update as explained. 2001-09-18 Alexandre Duret-Lutz * src/media/dummy/keyvalues.c: Don't include ggi.h. 2001-09-17 Alexandre Duret-Lutz * m4/h-allegro.m4: Hide Allegro support. Do not check for it unless explicitly requested. 2001-09-17 Alexandre Duret-Lutz * src/media/allegro/video.c (screen_rv): New variable. (init_video_low, uninit_video_low, vsynchro_low, vsynchro2_low): Use it. (set_pal): Fix buffer overrun. (set_pal_entry): Supply p.filter value to suppress compiler warning. 2001-09-15 Alexandre Duret-Lutz * src/media/README: New file. * src/sys/README: New file. * src/lvl/README: New file. * src/lvl/Makefile.inc (EXTRA_DIST): Add lvl/README. * src/sys/Makefile.inc (EXTRA_DIST): Add sys/README. * src/media/Makefile.inc (EXTRA_DIST): Add media/README. 2001-08-26 Alexandre Duret-Lutz * NEWS: Typo. 2001-08-26 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12f. 2001-08-26 Alexandre Duret-Lutz * arch/mingw32/cross.sh (CONFIGURE_OPTS): Remove --program-suffix, not needed. (cross_install): Strip heroeslvl.exe. * arch/mingw32/dest-readme-lib: Update. 2001-08-26 Alexandre Duret-Lutz * m4/libalt.m4 (adl_LIBALT_OK): Support options in the 6th argument. (adl_LIBALT_EITHER): Defaut to prepend the library flags, handle the APPEND option. * m4/h-media.m4 (heroes_MEDIALIB_SELECTION): Use the APPEND option for allm and sdlm. 2001-08-26 Alexandre Duret-Lutz * m4/generic.m4 (AC_PATH_GENERIC): Don't complain about a missing mumble-config if the installer has not used --with-mumble. 2001-08-25 Alexandre Duret-Lutz * doc/heroes.texi (Machines): Add OpenBSD, update MSVC. 2001-08-25 Alexandre Duret-Lutz * m4/h-joystick.m4 (heroes_CHECK_JOYSTICK_LIB): Typo. 2001-08-25 Alexandre Duret-Lutz * configure.ac: Prepend -lm to LIBS if libm is found, this fix a bug introduced on 2001-08-24. 2001-08-25 Alexandre Duret-Lutz * src/sys/Makefile.inc (EXTRA_DIST): Add main.h. 2001-08-25 Alexandre Duret-Lutz * TODO: Update. * ANNOUNCE: Prepare for 0.13. 2001-08-25 Alexandre Duret-Lutz * po/fr.po: Update. 2001-08-25 Alexandre Duret-Lutz * src/heroeslvl.c (version, usage, dir_to_string, type_to_char, print_type_keys, print_tunnels, anim_kind_to_str, print_tile_details, process, main): Use gettext. 2001-08-25 Alexandre Duret-Lutz * doc/heroes.texi (direntry): Add heroeslvl. (heroeslvl): New chapter. 2001-08-24 Alexandre Duret-Lutz * src/heroes.c (find_lemming_direction): Allow lemmings to be blocked under a trail (i.e. don't assert against that). 2001-08-24 Alexandre Duret-Lutz configure was still defining many HAVE_LIB* macro that are no longer needed since the move to src/media/. Only HAVE_LIBSDL_MIXER is used. This remove all the other, to cleanup config.h (and reduce the probability of config.h to change, which is good since all files depend upon config.h). * m4/h-display.m4 (heroes_CHECK_DISPLAY_LIB): Don't call heroes_CHECK_DISPLAY_LIB. * m4/checkpkg.m4 (AC_caolan_CHECK_PACKAGE): Don't define HAVE_LIB[]UP. * m4/h-sdl.m4 (heroes_CHECK_SDL): Don't define HAVE_LIBSDL. (heroes_CHECK_SDL_PRELIM): Merge into heroes_CHECK_SDL. * m4/h-mikmod.m4 (heroes_CHECK_MIKMOD): Don't define HAVE_LIBMIMOD. (heroes_CHECK_MIKMOD_PRELIM): Merge into heroes_CHECK_MIKMOD. * m4/h-sdlmixer.m4 (heroes_CHECK_SDL_MIXER): Define HAVE_LIBSDL_MIXER. * configure.ac: Don't define HAVE_LIBM. 2001-08-24 Alexandre Duret-Lutz This is the start of support for Allegro. It does not work yet (actually it segfault, and I've not yet understood why). Allegro do not use any naming convention for its symbols, neither does Heroes, so presently this lead to many conflicts that had to be resolved by renaming Heroes' symbols. :( * m4/h-allegro.m4: New file. * src/media/allegro/keyb.c: New file. * src/media/allegro/keyvalues.c: New file. * src/media/allegro/video.c: New file. * src/sys/allegro/main.c: New file. * m4/h-display.m4 (heroes_CHECK_DISPLAY_LIB): Call heroes_CHECK_ALLEGRO. * m4/h-media.m4 (heroes_MEDIALIB_SELECTION): Handle allm and allvkm. * m4/libalt.m4 (adl_LIBALT_EITHER): Typo. * m4/pkgeneric.m4 (AC_adl_PKG_GENERIC): Allow to not test for a function presence. * src/hedlite.c: Rename mouse_x and mouse_y into mouse_coord_x and mouse_coord_y. (save_pcx): Rename as ... (save_level_as_pcx): ... this. * src/intro.c: Rename set_color as set_pal_entry. * src/menus.c: Rename set_volume and set_palette as adjust_volume and force_palette. * src/prefs.tpl: Rename KEYCODE_MAX as HKEYCODE_MAX. * src/scrtools.c (set_palette): Rename as ... (force_palette): ... this. * src/scrtools.h: Idem. * src/media/Makefile.inc (EXTRA_LIBRARIES): Add media/libhallvkm.a. (media_libhallvkm_a_CFLAGS, media_libhallvkm_a_SOURCES, nodist_media_libhallvkm_a_SOURCES): New variables. (media/allegro/keysdef.c): New target. * src/media/keyb.c: Rename KEY_MAX into HKEY_MAX, mouse_x into mouse_coord_x, mouse_y into mouse_coord_y. * src/media/keyb.h: Likewise. * src/media/ggi/keyb.c: Likewise. * src/media/sdl/keyb.c: Likewise. * src/media/strack.h (set_volume): Rename as ... (adjust_volume): ... this. * src/media/dummy/strack.c: Likewise. * src/media/mikmod/strack.c: Likewise. * src/media/sdl_mixer/strack.c: Likewise. * src/media/video.h (set_color): Rename as ... (set_pal_entry): ... this. * src/media/dummy/video.c: Likewise. * src/media/ggi/video.c: Likewise. * src/media/sdl/video.c: Likewise. * src/sys/Makefile.inc (EXTRA_LIBRARIES): Add sys/libhallm.a. (sys_libhallm_a_CFLAGS, sys_libhallm_a_SOURCES): New variables. 2001-08-23 Alexandre Duret-Lutz Because some libraries need some special `main' arrangement (e.g. SDL sometime want to rename main() into SDL_main()), we need to turn main() into static libraries... *grin*. * m4/h-media.m4 (heroes_MEDIALIB_SELECTION): Handle stdm/sdlm selection. * src/Makefile.am (INCLUDES): Add -I$(srcdir)/sys. (EXTRA_LIBRARY): Define empty. (CLEANFILES): New. (EXTRA_DIST): Add and include sys/Makefile.inc. * src/heroes.c (main): Rename as ... (heroes_main): ... this. * src/sys/Makefile.inc: New file. * src/sys/main.h: New file. * src/sys/std/main.c: New file. * src/media/Makefile.inc (EXTRA_LIBRARY): Append (+=) instead of assigning (=). (CLEANFILES): Move to src/Makefile.am. 2001-08-22 Alexandre Duret-Lutz * tools/alpha.sh: Typo. 2001-08-22 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12e. * NEWS: Update. * tools/genpotfiles.sh: Grep the files in src/media/ too. 2001-08-22 Alexandre Duret-Lutz * src/lvl/de_body.c (ANIM_FRAME_DELAY): Add 1. * src/lvl/load.c (lvl_load_body_file): Typo. 2001-08-22 Alexandre Duret-Lutz This is a mega-combo-patch which break the files interfacing with the display/keyboard/mouse/sound/joystick libraries into separate directories. Instead of one file per medium, holding code for all supported libraries, we now have one directory per supported library. Many atomic static libraries are built and linked on demand from these directories (roughly one library per medium). This is a lot cleaner: there is no need to play with #ifdef/#ifndef anymore, configure will just decide which of these atomic libraries Heroes will be linked with. Configuration machinery. We now check for all library in a first step, and make a choice for the availble libraries in a second step (taking user preferences into account). * m4/h-media.m4: New file. * m4/libalt.m4: New file. * configure.ac: Replace display/joystick/sound library checks by a call to heroes_MEDIALIB_SELECTION. (Move these checks there.) Comment out the configuration summary. * m4/h-display.m4 (heroes_CHECK_DISPLAY_LIB_PRELIM): Delete. (heroes_CHECK_DISPLAY_LIB): Simplify, don't handle library exclusions. Call adl_LIBALT_OK. * m4/h-ggi.m4 (heroes_CHECK_GGI): Update user_selection_list_vkm. (heroes_CHECK_GGI_POST): Delete. * m4/h-joystick.m4 (heroes_CHECK_JOYSTICK_LIB): Simplify, don't handle library exclusions. Call adl_LIBALT_OK. Update user_selection_list_j. Don't define JOYSTICK_SUPPORT. * m4/h-mikmod.m4 (heroes_CHECK_MIKMOD): Update user_selection_list_s. * m4/h-sdlmixer.m4 (heroes_CHECK_SDL_MIXER): Update user_selection_list_vkm, user_selection_list_j, and user_selection_list_s. * m4/h-sdl.m4 (heroes_CHECK_SDL): Likewise. (heroes_CHECK_SDL_POST): Delete. * m4/h-sound.m4 (heroes_CHECK_SOUND_LIB_PRELIM): Delete. (heroes_CHECK_SOUND_LIB): Update user_selection_list_s, call adl_LIBALT_OK. Many files are moved from src/ to src/media/. The code also have to be adapted to the new API that this break required. Among the major API changes is the key definitions which used to be macros and are now variables, hence they cannot be used as case labels anymore. * src/display.c: Delete (replaced by src/media/video.c, src/media/sdl/video.c, src/media/ggi/video.c) * src/display.h: Delete (replaced by src/media/video.h). * src/joystick.c: Delete (replaced by src/media/sdl/joystick.c, src/media/gii/joystick.c). * src/joystick.h: Delete (replaced by src/media/joystick.h). * src/keyb.c: Delete (replaced by src/media/keyb.c, src/media/sdl/keyb.c, src/media/ggi/keyb.c). * src/keys_heroes.h: Delete (replaced by src/media/keyvalues.h, src/media/sdl/keyvalues.c, src/media/ggi/keyvalues.c). * src/keys_heroes.c: Likewise. * src/keysdef.h: Delete (replaced by src/media/keysdef.h) * src/keysdef.c: Delete. * src/sfx.c: Delete (replaced by src/media/sfx.c, src/media/mikmod/sfx.c, src/media/sdl_mixer/sfx.c). * src/sfx.h: Delete (replaced by src/media/sfx.h). * src/sound.c: Delete (replaced by src/media/strack.c, src/media/sdl_mixer/strack.c, src/media/mikmod/strack.c). * src/sound.h: Delete (replaced by src/media/strack.h) * src/Makefile.am (INCUDES): Add ./media. (CFLAGS): Suppress all meadia-library related CFLAGS. We can now use per-library CFLAGS. (heroes_LDADD): Replace hard-coded values by @LIBALT_LDADD@. (heroes_LDFLAGS): Likewise. (heroes_DEPENDENCIES): New variable. (heroes_SOURCES): Remove moved sources. (BUILT_SOURCES, DISTCLEANFILES): Remove keysdef-inc.h. [SDL, GGI] (keysdef-inc.h): Remove target. (paramfmt-check.o, parafmt-check): Simplify into ... (EXTRA_PROGRAMS, parafmt_check_SOURCES, parafmt_check_CFLAGS): ... these. (EXTRA_DIST): Add media/Makefile.inc and include it. * src/argv.h: Adjust includes. * src/camera.h: Likewise. * src/const.h: Likewise. * src/endscroll.c: Likewise. * src/errors.c: Likewise. * src/fontdata.h: Likewise. * src/intro.h: Likewise. * src/pcx.h: Likewise. * src/pixelize.c: Likewise. * src/pixelize.h: Likewise. * src/render.c: Likewise. * src/renderdata.h: Likewise. * src/scrtools.c: Likewise. * src/sprite.h: Likewise. * src/timer.c: Likewise. * src/visuals.c: Likewise * src/hedlite.c: Likewise. (display_level_map_fullscreen, gestclav): Adjust to new key definitions. * src/heroes.c (play_game): Likewise. * src/menus.c (move_upon, exec_menu, extra_menu, edito_selector, handle_reader_keys): Likewise. * src/system.h: Suppress all the media library selection stuff. * src/prefs.def: Use keys_pref_group () is name for the key group. * src/prefs.tpl: Support for function (or variable) as group names. Most of the following files are made from files deleted from src/. See the top of the preceding block for details. * src/media/Makefile.inc: New file. * src/media/joystick.h: New File. * src/media/keyb.c: New file. * src/media/keyb.h: New file. * src/media/keyb_low.h: New file. * src/media/keysdef.h: New file. * src/media/keyvalues.h: New file. * src/media/sfx.c: New file. * src/media/sfx.h: New file. * src/media/strack.c: New file. * src/media/strack.h: New file. * src/media/video.c: New file. * src/media/video.h: New file. * src/media/video_low.h: New file. * src/media/dummy/joystick.c: New file. * src/media/dummy/keyb.c: New file. * src/media/dummy/keysdef.c: New file. * src/media/dummy/keyvalues.c: New file. * src/media/dummy/sfx.c: New file. * src/media/dummy/strack.c: New file. * src/media/dummy/video.c: New file. * src/media/ggi/keyb.c: New file. * src/media/ggi/keyvalues.c: New file. * src/media/ggi/video.c: New file. * src/media/gii/joystick.c: New file. * src/media/mikmod/sfx.c: New file. * src/media/mikmod/strack.c: New file. * src/media/sdl/joystick.c: New file. * src/media/sdl/keyb.c: New file. * src/media/sdl/keyvalues.c: New file. * src/media/sdl/video.c: New file. * src/media/sdl_mixer/sfx.c: New file. * src/media/sdl_mixer/strack.c: New file. 2001-08-06 Alexandre Duret-Lutz * src/display.c (init_SDL): Don't initialize the sound device if we are not going to use it. Idem with the joystick. Reported by Jean. 2001-08-05 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12d. * NEWS: Update. 2001-08-05 Alexandre Duret-Lutz * src/levellst.c (cmp_levels): Sort the level names on the last digit first, so that they are played in this order: 010 020 030 ... 011 021 ..., and not this one 010 011 012 ... 2001-08-05 Alexandre Duret-Lutz * src/heroes.c (find_free_way): Autopilot still work against file trails for invincible players. 2001-08-05 Alexandre Duret-Lutz * src/structs.h (lemming_t) : Rename as ... (lemming_t) : ... these. * src/heroes.c (update_lemmings): Eve out most of the code to ... (find_lemming_direction): ... this new function. Disallow lemmings to enter tunnels (the change from 2001-07-13 unintentionally allowed this). Comment and cleanup. (load_level): Use find_lemming_direction. (update_player): Adjust to new names. * src/render.c (draw_lemming): Likewise. * src/lvl/lvl.h (DIR_TO_DIRMASK): New function. 2001-08-05 Alexandre Duret-Lutz * src/camera.c (compute_corner) : New variables. Fix computation of the maximum possition for the camera on non-wrapped levels. 2001-08-05 Alexandre Duret-Lutz * src/const.h (radar_target_pos, radar_current_pos): Delete. * src/const.c (radar_target_pos, radar_current_pos): Move ... * src/heroes.c (radar_target_pos, radar_current_pos): ... here. 2001-08-04 Alexandre Duret-Lutz * src/render.c (draw_score): Change prototype, takes row, col and score_shift. Use score_shift instead of the global radar_current_pos variable. Use IMGPOS wherever possible. * src/render.h (draw_score): Change protoype. * src/heroes.c (output_screen): Adjust calls to draw_score. 2001-08-04 Alexandre Duret-Lutz * src/render.c (draw_radar_frame): New function, eved out from draw_radar_map. (draw_radar_map): Call draw_radar_frame, don't use `dede', comment, fix drawing of full-wrapped levels (typo introduced on 2001-07-14). Take the radar_shift parameter instead of using the global radar_current_pos. * src/render.h (draw_radar_map): Adjust prototype. * src/heroes.c (output_screen): Supply new argument to draw_radar_map. 2001-08-04 Alexandre Duret-Lutz * src/levellst.c (cmp_levels): New function. (read_level_list): Sort the levels. 2001-08-02 Alexandre Duret-Lutz Fix issues observed on OpenBSD 2.9. * configure.ac: Check for setgid. * src/system.h (setgid, setgid): Define if needed. (seteuid, setegid): Define using setreuid and setregid if possible. * src/persona.c (sys_persona, user_persona): Test whether _POSIX_SAVED_IDS is *defined*, not its actual value. (user_persona_definitively): Use setuid and setgid instead of setreuid and setregid, the latter are obsolete. 2001-08-02 Alexandre Duret-Lutz Reestablish MinGW32 support. * lib/stpcpy.c: New file, from fileutils 4.1. * lib/Makefile.am (EXTRA_DIST): Add it. * tools/fetish-sync.sh (files): Add stpcpy.c. * src/Makefile.am (heroes_LDADD): Put SDL_MIXER_LIBS before SDL_MIXER since the former needs the latter. (heroeS_LDADD): Add INTLLIBS. * src/lvl/load.c (lvl_load_body_file): Type length as size_t, add rlength and use it. * src/system.h [!HAVE_SSIZE_T] (ssize_t): Define. [!HAVE_DECL_STPCPY] (stpcpy): Declare. [!HAVE_STRCASESTR] (strcasestr): Redeclare ... [!HAVE_DECL_STRCASESTR] (strcasestr): ... in this case. * configure.ac: Check for declaration of ssize_t, strcasestr, and stpcpy. Replace stpcpy if needed. 2001-08-01 Alexandre Duret-Lutz Some Autoconf internal functions have changed between 2.50 and 2.52. Add workarounds to be compatible with both versions. * m4/compat.m4: New file. * m4/checkpkg.m4: Use MY_TR_CPP * m4/findheader.m4: Use MY_VAR_POPDEF, MY_VAR_PUSHDEF, and MY_VAR_SET. * m4/h-obsolet.m4: Use MY_TR_SH. 2001-07-29 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12c. * NEWS: Update for 0.12c. 2001-07-29 Alexandre Duret-Lutz * src/heroes.c (main): Switch to sys_persona() before calling init_sound_engine() and init_video(), and back to user_persona() after. * src/persona.h (keep_sgid, keepsuid): New variables. * src/persona.c (keep_sgid, keepsuid): New variables. (user_persona_definitively): Use them. * src/userconf.c (read_userconf): Handle keepsuid: and keepsgid:. * src/etc/heroesrc (soundconf): Add commented lines for keepsuid and keepsgid. * doc/heroes.texi (heroesrc): Document keepsuid and keepsgid. 2001-07-29 Alexandre Duret-Lutz Build a man page for heroeslvl. * man/Makefile.am (heroeslvl.6): New target. (man_MANS): Add heroeslvl.6. (MAINTAINERCLEANFILES): Rewrite as $(man_MANS). 2001-07-29 Alexandre Duret-Lutz * configure.ac: Show a summary of CFLAGS and LIBS for each libraries. * m4/checkpkg.m4: Typo, s/_LDALL/_LDFLAGS/. * src/Makefile.am (heroes_LDFLAGS): Typo, s/_LIBS/_LDFLAGS/. 2001-07-29 Alexandre Duret-Lutz * configure.ac: Remove the jm_FUNC_REALLOC kludge. 2001-07-29 Alexandre Duret-Lutz Because intl/ and lib/ contains third party code which does not conform to the same level of "strictness" as the code in src/, enable some -Woptions in src/ only. * m4/gccwarn.m4 (CF_GCC_MORE_WARNINGS): New functions. (ad_GCC_WARNINGS): Call CF_GCC_MORE_WARNINGS, AC_SUBST() MORE_WARNINGS_CFGLAGS. * src/Makefile.am (CFLAGS): Add MORE_WARNINGS_CFGLAGS. 2001-07-29 Alexandre Duret-Lutz ``heroeslvl'' should not be linked with SDL or GGI as ``heroes''. So let's change configure to not add those libraries to LIBS, CFLAGS, etc. Use per-target LDFLAGS and LDADD instead. * m4/checkpkg.m4: Set and AC_SUBST() UP[]_LDFLAGS, UP[]_CFLAGS, and UP[]_LIBS. * m4/h-joystick.m4: Add $SDL_LIBS to $LIBS before testing. * m4/h-sdl.m4: Check for SDL_EnableKeyRepeat in the call to AC_adl_PKG_GENERIC. * m4/pkgeneric.m4: Revert LIBS and CFLAGS. * src/Makefile.am (CFLAGS, heroes_LDFLAGS): New. (heroes_LADADD): Update. * lib/Makefile.am (CFLAGS): New. 2001-07-27 Alexandre Duret-Lutz * src/heroes.c (main): Call read_sfx_conf after init_sound_engine (). * src/sfx.c (read_sfx_conf): Free sfxdir on error. 2001-07-27 Alexandre Duret-Lutz * src/lvl/de_body.c (decode_level_body): Free square_walls_in. 2001-07-27 Alexandre Duret-Lutz * src/locales.c: New file. * src/locales.h: New file. * src/Makefile.am (heroes_SOURCES): Add them. * src/heroes.c (main): Move locale initialization code to init_locales() in locales.c and call it. 2001-07-27 Alexandre Duret-Lutz * src/musicfiles.c: Cosmetics changes. (dir_name): Delete, include "dirname.h" instead. (read_sound_config_file): Adjust to the new dir_name(), i.e., add a `/' between the file name and the directory name. 2001-07-27 Alexandre Duret-Lutz ``heroes-sdl -G mumble'' didn't work because the string put in environment (SDL_VIDEODRIVER=mumble) was immediatly freed afterward. * src/display.c [HAVE_LIBSDL] (sdl_videodriver): New variable. [HAVE_LIBSDL] (set_display_params): Set sdl_videodriver, putenv() it, but don't free it. [HAVE_LIBSDL] (uninit_video): Free sdl_videodriver here. 2001-07-26 Alexandre Duret-Lutz * src/camera.c (compute_corner): Cleanup. * src/const.c (camera_center_x): Remove. * src/const.h (camera_center_x): Remove. * src/heroes.c (play_demo, play_game): Don't set camera_center_x. 2001-07-25 Alexandre Duret-Lutz * src/const.h (square2offset, invincible): Delete. * src/const.c (square2offset): Delete. (invincible): Move to ... * src/render.c (invincible): ... here. * src/heroes.c (load_level): Don't initialize square2offset. 2001-07-26 Alexandre Duret-Lutz A report from William Black about the vehicles-restricted-in-a-two-square-width-vertical-zone allowed to finally close this bug (reported by Jean in Dec 2000). * src/people.def: Add him. * BUGS: Update. 2001-07-25 Alexandre Duret-Lutz Check gettext version in upgettext.sh. Older versions can cause the bootstrap process to fail ungracefully. Suggested by Laurent Duperval . * tools/upgettext.sh (usage): Add -f. (checkversion): New function. Handle -f, call checkversion unless -f is given. 2001-07-24 Alexandre Duret-Lutz * tools/alpha.sh: Reorder and comment sections. 2001-07-24 Alexandre Duret-Lutz * configure.ac: Bump to 0.12b. * NEWS: Update for 0.12b. * doc/Makfile.am (.texi.html): Add --no-split, newer versions of makeinfo need this. 2001-07-23 Alexandre Duret-Lutz * doc/heroes.texi (Invoking): More documentation for -G and -F. * TODO: Update. 2001-07-23 Alexandre Duret-Lutz * tools/Makefile.inc: New file. * tools/Makefile.am: Delete. * tools/README: New file. * tools/exnews.pl: New file. * tools/alpha.sh: New file. * configure.ac: Don't create tool/Makefile.in. * Makefile.am: Include tools/Makefile.inc (SUBDIRS): Remove tools. (EXTRA_DIST): Add tools/Makefile.inc. 2001-07-22 Alexandre Duret-Lutz * src/lvl/free.c: New file. * src/lvl/Makefile.inc (lvl_libhlvl_a_SOURCES): Add lvl/free.c. * src/lvl/in_body.c (initialize_empty_level_body): New function. * src/lvl/lvl_priv.h (initialize_empty_level_body): New function. * src/lvl/load.c (lvl_load_file): Call it. * src/heroes.c (unload_level): Call lvl_free. * src/heroeslvl.c (process): Likewise. * src/levellst.c (read_level_dir): Likewise. 2001-07-22 Alexandre Duret-Lutz * src/levellst.c: New file. * src/levellst.h: New file. * src/Makefile.am (heroes_SOURCES): Add them. * src/extras.c (select_file): Rename as select_file_lvl and move to levellst.c. (browse_Extra_directories): Use select_file_lvl. * src/heroes.c (level_list, levellstchunk, levelinf, level_list_nbr): Remove, replaced by varables from levellst.h and .c. (level_full_list_Size, current_quest_level): Define as unsigned. (load_level_from_level, compute_level_full_list, random_level, load_random_wrapped_level, load_random_level, play_menu, load_demo, main_menu, main): Adjust to the new definitions. (read_level_list): Remove. * sr/rsc_files.gperf (end-scroller-txt, help-txt, levels-list-txt, text-conf-txt): Remove. 2001-07-22 Alexandre Duret-Lutz * src/lvl/load.c (lvl_load_body_mem, lvl_load_header_mem): New functions. (lvl_init_lvl_basic_fields): New function, extracted from... (lvl_load_header): ... here. Rename as ... (lvl_load_header_file): ... this. Use lvl_load_header_mem. (lvl_load_body): Rename as ... (lvl_load_body_file): ... this. Use lvl_load_header_file. (lvl_load_file): Try to load the file using mmap, before falling back to read. 2001-07-21 Alexandre Duret-Lutz * src/heroeslvl.c (process): Don't load full level if we can avoid it. 2001-07-21 Alexandre Duret-Lutz Add option -pi to display tile details. * src/heroeslvl.c (options_t): Add print_tile_details. (print_tile_details, anim_kind_to_str): New functions. (usage): Document -pi. (decode_print_options): Handle 'i'. (print_square_type, print_square_walls, print_square_directions): Print line numbers. (process): Call print_tile_details. 2001-07-19 Alexandre Duret-Lutz Gather camera handling code from heroes.c and const.c into camera.c. * src/camera.c: New file. * src/camera.h: New file. * src/Makefile.am (heroes_SOURCES): Add camera.c and camera.h. * src/const.c (camera_x, camera_y, corner_x, corner_y, corner, corner_dx, corner_dy, inert_x, inert_y, nbr_tiles_cols, nbr_tiles_rows): Move to camera.c. (camera_stop_x, camera_stop_y): Move to ... * src/render.c (draw_level): ... here. * src/const.h: Likewise. * src/scrtools.c: Likewise. * src/visuals.c: Likewise. * src/endscroll.c: Include camera.h. * src/heroes.c (compute_corner): Move to camera.c. (update_all): Extract the position_camera() function, now in camera.c. (output_screen): Call position_camera(). (play_demo, play_game): Extract and call init_camera(). * src/menus.c (background_menu): Extract and call lisajou_camera(). 2001-07-16 Alexandre Duret-Lutz * configure.ac: Bump to 0.12a. Call AM_PROG_CC_C_O. * NEWS: Update for 0.12a. * TODO: Likewise. * src/Makefile.am (EXTRA_DIST): Add etc/Makefile.inc and lvl/Makefile.inc. (AUTOMAKE_OPTIONS): New. * Makefile.am (EXTRA_DIST): Add arch/Makefile.inc and m4/Makefile.inc. 2001-07-15 Alexandre Duret-Lutz New bonus: fire trail. * src/helptext.c (help_text2, help_text4): Document it. * src/bonus.c (bonus_density, bonus_point): Fill in the fire trail column. (apply_bonus): Handle fire_trail. * src/structs.h (player_t) : New. * src/player.c (reinit_player): Zeroes player[p].fire_trail. (find_free_way): Disable autopilot against fire trails. (update_player): Handle fire_trail. 2001-07-15 Alexandre Duret-Lutz * src/heroes.c (compute_corner): Compute and cast tw and th once for all. (update_all): Fix camera position computation (typo from 2001-07-13). 2001-07-15 Alexandre Duret-Lutz Rewrite the way explosions are handled. There used to be two distinct explosion types: those from T_BOOM squares and those triggered by player death. Both where handled separately and in different ways. This is now homogeneous. Two noticeable differences are that death explosions are now harmful to other players and will propagate to neighbor T_BOOM squares. * src/const.c (last_explo, square_explosion, square_dead_explosion, explo_list_ptr, explo_list_pos_x, explo_list_pos_y, explo_nbr, square_explosion_type): Delete. * src/const.h: Likewise. * src/explosions.c (square_explo_state): New variable, replace suqare_explosion and square_dead_explosion. (square_explo_type): New variable, replace square_explosion_type. (explosion_info_t, explo_list, explo_list_max, explo_list_first_unused, explo_timer, explo_time, allocate_explosions, release_explosions, trigger_explosion, trigger_possible_explosion, update_explosions): New. * src/explosions.h (EXPLOSION_SLICES_PER_FRAMES, EXPLOSION_DELAY, EXPLOSION_IMMEDIATE, EXPLOSION_TRIGGERED, EXPLOSION_TRIGGER_NEIGHBORS, EXPLOSION_UNTRIGGERED, explosion_t, square_explo_state, square_explo_type, allocate_explosions, release_explosions, trigger_explosion, trigger_possible_explosion, update_explosions): New. * src/heroes.c (load_level): Adjust to call allocate_explosions(). (unload_level): Adjust to call release_explosions(). (erase_trail): Adjust to call trigger_explosion(). (ia_eval_dir_target_inline, ia_eval_dir_bonus_inline, ia_eval_dir_lemming_inline, ia_eval_dir_cash_inline, ia_eval_dir_color_inline, ia_goto_target_inline, ia_goto_bonus_inline, ia_goto_lemming_inline, ia_goto_color_inline, ia_goto_cash_inline): Adjust to use square_explo_state. (update_explo): Remove. (update_all): Call update_explosions() instead of update_explo(). * src/render.c: (render): Adjust to use square_explo_type and square_explo_state, suppress the separate rendering loop for players' death explosions. 2001-07-14 Alexandre Duret-Lutz * src/const.h (d2w, w2d, square_offset): Delete. (square2tile, square_offset2coord): Rename as ... (square_tile, square_coord): ... these. * src/const.c (d2w, w2d): Remove. (square2tile, square_offset2coord): Rename as ... (square_tile, square_coord): ... these. (square_offset): Move to ... * src/hedlite.c (square_offset): ... here. * src/heroes.c (load_level, unload_level, ia_eval_dist, update_player, update_all): Adapt to new names. (find_free_way, update_lemmings): Don't use w2d. * src/render.c (draw_radar_map): Adapt to new names. 2001-07-13 Alexandre Duret-Lutz Use the new level loading library to load levels in the game (not the level editor). This new loading code will export level infos differently, hence many places have to be adapted to the new representation. * lib/xstrduplwr.h: New file. * lib/xstrduplwr.c: New file. * lib/Makefile.am: Add them. * src/Makefile.am (LDADD): Rename as ... (heroeslvl_LDADD): ... this. Add lvl/libhlvl.a. * src/const.c (map_info, map_info_2xt, map_info_2yt, map_info_2xwrap, map_info_2ywrap, level_map, square_radar_wall, square_wall, square_wrap): Remove these variables. (lvl): New variable, which replace all the above. * src/const.h: Likewise. * src/bonus.c (add_bonus, mark_unreachable_places, init_bonuses_level): Adjust to use the new level representation. * src/heroes.c (ia_target_x, ia_targer_y, ia_wrap_x, ia_wrap_y): Declare as square_coord_t. (tunnel_square_io): Remove this variable. (add_color, add_cash, erase_player, reinit_player, load_level, compute_corner, shrink_trail, erase_trail, ia_eval_dist, ia_eval_dir_target_inline, ia_eval_dir_bonus_inline, ia_eval_dir_lemming_inline, ia_eval_dir_cash_inline, ia_eval_dir_color_inline, ia_eval_neighb_pos, ia_eval_dir_target, ia_eval_dir_lemming, ia_eval_dir_color, ia_eval_dir_cash, ia_eval_dir_bonus, ia_goto_target_inline, ia_goto_bonus_inline, ia_goto_lemming_inline, ia_goto_color_inline, ia_goto_cash_inline, ia_goto_target, ia_goto_nearest_bonus, ia_goto_nearest_lemming, ia_goto_nearest_color, ia_goto_nearest_cash, update_player, update_explo, update_lemmings, update_all): Adjust to use the new level representation. * src/menu.c (background_menu): Likewise. * src/render.c (draw_level): Likewise. * src/renderdata.c (init_render_data): Likewise. * src/struct.h (DONT_WRAP): Don't declare, it's done in lvl/lvl.h. (player_t) : Declare as dir_t. (lemming_t) : Likewise. * src/renderdata.h (tile_anim_kind): Move to ... * src/lvl/lvl.h (anim_kind_t): ... here. (lvl_tile_sprite_overlay_offset): New function. (lvl_animation_info): Return animation type too. * src/lvl/de_body.c (TILE_SPRITE): Rename as ... (TILE_OVERLAY): ... this. (TILE_SPRITE): New. (decode_level_body): Read the sprite overlay, handle animation types. * src/lvl/de_head.c (decode_level_header): Lowercasify the sprite map basename. * src/lvl/lvl_priv.h (tile_data_t) : New. * src/lvl/privacc.c (lvl_tile_type, lvl_tile_sprite_offset, lvl_tile_sprite_overlay_offset, lvl_animation_info): New functions. 2001-07-10 Alexandre Duret-Lutz Some directories do not deserve their own Makefile (it takes time to recurse directories, and it's ugly). Replace some `Makefile.am' files by some `Makefile.inc' included from the underlying `Makefile.am'. * src/etc/Makefile.inc: New file. * src/etc/Makefile.am: Delete. * src/Makefile.am: Include src/etc/Makefile.inc. * tools/genm4mam.sh: Create m4/Makefile.inc instead of m4/Makefile.am. * arch/Makefile.inc: New file. * arch/Makefile.am: Delete. * configure.ac: Don't create src/etc/Makefile, m4/Makefile, and arch/Makefile.am. * Makefile.am: Include arch/Makefile.am and m4/Makefile.inc. (SUBDIRS): Remove arch and m4. (configure.ac): Don't create m4/Makefile, arch/Makefile, and src/etc/Makefile. * HACKING: Adjust. 2001-07-10 Alexandre Duret-Lutz * src/lvl/Makefile.inc: New file. * src/lvl/de_body.c: New file. * src/lvl/de_head.c: New file. * src/lvl/in_body.c: New file. * src/lvl/load.c: New file. * src/lvl/loadmac.h: New file. * src/lvl/lvl.h: New file. * src/lvl/lvl_priv.h: New file. * src/lvl/privacc.c: New file. * src/heroeslvl.c: New file. * src/Makefile.am: include src/lvl/Makefile.inc. (bin_PROGRAMS): Add heroeslvl. (INCLUDE, heroeslvl_SOURCES, heroeslvl_LDADD): New variables. * src/system.h: Add O_BINARY support. 2001-07-10 Alexandre Duret-Lutz * configure.ac: Bump version to 0.12. * HACKING: Update. * TODO: Update. * NEWS: Update. * m4/gettext.m4: Update from Debian's gettext 0.10.38-2. 2001-06-17 Alexandre Duret-Lutz These patches are no longer needed with gettext-0.10.38. * misc/04-intl.patch: Delete. * misc/04-m4.patch: Delete. * misc/06-intl.patch: Delete. * Makefile.am (EXTRA_DIST): Remove them. * m4/gettext.m4: Upgrade for gettext-0.10.38. * m4/glibc21.m4: Likewise. * m4/iconv.m4: Likewise. 2001-06-16 Alexandre Duret-Lutz Yet another couple of fixes suggested by Jean. * src/menus.c (draw_end_level_info): Center the title (winner). (info_mode_next_save_arrow_pos): New variable. (init_menus_sprites): Compute info_mode_next_save_arrow_pos. (draw_end_level_info): Use it. 2001-06-16 Alexandre Duret-Lutz Jean reported several times that some levels play without any sound. These five levels are affected | ~/usr/share/heroes/levels % grep heroes * | Binary file niv038.lvl matches | Binary file niv039.lvl matches | Binary file niv049.lvl matches | Binary file niv067.lvl matches | Binary file niv108.lvl matches because they use lowercase soundtrack aliases instead of uppercase as the others. This patch change the hashing function used to lookup soundtrack aliases so that uppercase and lowercase versions of the same aliase will be hashed to the same value. * src/musicfiles.c (hash_case_string): New function. (st_hasher, get_sound_track_from_alias): Use hash_case_string instead of hash_string. * BUGS: Remove related entry. 2001-06-16 Alexandre Duret-Lutz * src/menus.c (init_menus_sprites): Reverse the strings "NEW LEVEL" and "EXISTING LEVEL". Reported by Jean. (editor_menu): Lowercasify the level name before trying to open the file for preview. Add debug messages. 2001-06-16 Alexandre Duret-Lutz Rewrite editor_first_menu using the compile_menu machinery. This also get rid of a bug reported by Jean where the french translation for "NEW LEVEL" would have been larger than the distance between the waving arrows. * src/menus.c (edit_first_menu_txt, edit_first_new_txt, edit_first_load_txt): Remove. (editor_entries, editor_menu_data): New variables to replace the three above. (init_menus_sprites, uninit_menus_sprites): Adjust. (editor_first_menu): Use exec_menu. 2001-06-04 Alexandre Duret-Lutz * src/joystick.c [HAVE_SDL_JOYSTICKOPEN, HAVE_LIBGII] (get_joystick_state): Print debug messages for joystick events. * src/debugchn.def (joystick): Adjust documentation. 2001-06-03 Alexandre Duret-Lutz * lib/filelock.h: Change protoype. * lib/filelock.c: Likewise, supply flock() and _locking() implementations, not really tested. * m4/filelock.m4: New file. * m4/fopenlock.m4: Remove (obsolete). * src/scores.c: Adjust to new filelock and fileunlock prototypes. * src/savegame.c: Likewise. * src/savegame.c (write_save_records_locked, load_save_records): Seek to the beginning of file before unlocking. * src/scores.c (write_scores_locked, load_scores): Likewise. 2001-05-28 Alexandre Duret-Lutz * src/joystick.c [HAVE_LIBGII] (_get_joystick_state): Fix valuator reads. 2001-05-28 Alexandre Duret-Lutz * m4/relpaths.m4: Typos in comments. 2001-05-23 Alexandre Duret-Lutz * m4/normpath.m4: Cleanup for submission to the autoconf archive. * m4/relpaths.m4: Likewise. 2001-05-23 Alexandre Duret-Lutz * tools/autogen.sh: Recurse directories to find configure.{ac,in}. 2001-05-22 Alexandre Duret-Lutz * configure.ac: Bump version number to 0.11. * ANNOUNCE: Update for 0.11. * TODO: s/0.11/0.12/, how shame! * po/fr.po: Update. 2001-05-22 Alexandre Duret-Lutz * src/hedlite.c (create_levels_output_dir): Strip trailing slashes from level output directory, or it doesn't work with MinGW. * src/userdir.c (setup_userdir): Likewise with the userdir. 2001-05-22 Alexandre Duret-Lutz * arch/mingw32/cross.sh: Fix function declarations, the `function' keyword is not portable. (cross_install): Zip ChangeLog.00 too, delete charset.alias. 2001-05-21 Alexandre Duret-Lutz * configure.in: Move to ... * configure.ac: ... here. Make it dependent on autoconf 2.50. * tools/autogen.sh: Be configure.ac aware. * tools/upgettext.sh: Likewise. * HACKING: s/configure.in/configure.ac/. * man/Makefile.am (heroes.6): Likewise. 2001-05-21 Alexandre Duret-Lutz * arch/Makefile.am: Remove the commented rules to please automake 1.4f (which bugs on trailing backslashes in comments). After all we can get the old rules back from CVS. 2001-05-21 Alexandre Duret-Lutz * ChangeLog.00: New file. * Makefile.am (EXTRA_DIST): Add ChangeLog.00. 2001-05-21 Alexandre Duret-Lutz Don't install charset.alias on glibc 2.1 systems. This is base on the patch that Bruno Haible applied on the Gettext CVS version to address the issue. * m4/glibc21.m4: New file. * m4/gettext.m4 (AM_GNU_GETTEXT): Require jm_GLIBC21. * misc/06-intl.patch: New file. * Makefile.am (EXTRA_DIST): Add misc/06-intl.patch. 2001-05-21 Alexandre Duret-Lutz * configure.in: Bump version number to 0.10b. * NEWS: Update for 0.10b. * HACKING: Update fetish files. 2001-05-20 Alexandre Duret-Lutz * src/etc/heroesrc (soundconf): Don't say preferences can be global. * doc/heroes.texi (Global score file): Likewise. 2001-05-20 Alexandre Duret-Lutz Allow the user to use other score or save files. * src/savegame.c (reinit_save_records_if_needed): New. * src/savegame.h (reinit_save_records_if_needed): New. * src/scores.c (reinit_scores_if_needed): New. * src/scores.h (reinit_scores_if_needed): New. * src/heroes.c (main): Call them. * src/scores.c (load_scores): Don't unlock the file if it's not open. * src/savegame.c (load_save_records): Likewise. 2001-05-20 Alexandre Duret-Lutz Change the way global file access and file locking is done. Before this patch whenever an update of a global file was requested the game had to a) switch personna if needed to access the file b) open the file c) lock it d) update the file e) close the file With this patch the global files are now open when the game begin, using the system persona, the game then switch to the user persona definitively, be keep the global file open for the whole life of the game. Updating a file now just consist of a) seeking to the beginning of the file b) locking the file c) updating the file d) unlocking the file The rationnal for this change is that it allows to drop all privileges definitively after the global files are open. Later, when scripting capability will be added to Heroes, it is important that the user cannot switch persona at will :) * lib/fopenlock.c: Delete. * lib/fopenlock.h: Delete. * lib/filelock.c: New file. * lib/filelock.h: New file. * lib/Makefile.am (libheroes_a_SOURCES, noinst_HEADERS): Replace fopenlock.c and fopenlock.h by filelock.c and filelock.h. * src/persona.c (user_persona_definitively): New function. (sys_persona_if_needed): Export. (persona_fopenlock): Remove. * src/persona.h (user_persona_definitively): New function. (sys_persona_if_needed): Export. (persona_fopenlock): Remove. * src/savegame.c (init_save_records): New. (save_games_file): Remove, adjust all callers to use name instead. (write_save_records): Rename as ... (write_save_records_locked): ... this. Don't close the file. (write_save_records): New, call write_save_records_lock. (load_save_records_open): Rewrite and rename as ... (load_save_records_seek): ... this. Adjust all callers. (load_save_records): Don't close the file, but unlock it. (load_save_records_and_keep_locked): Don't create the file. (free_save_records): Close the file here. * src/savegame.h (init_save_records): New. (write_save_records_locked): New. * src/scores.c (init_scores): New. (score_file): Remove, adjust all callers to use name instead. (write_scores): Rename as ... (write_scores_locked): ... this. Don't close the file. (write_scores): New, call write_scores_locked. (load_scores_open): Rewrite and rename as ... (load_scores_seek): ... this. Adjust all callers. (load_scores): Don't close the file, but unlock it. (load_scores_and_keep_locked): Don't create the file. (free_scores): Close the file here. * src/scores.h (init_scores): New. (write_scores_locked): New. * src/heroes.c (play_menu): Use write_scores_locked() instead of write_scores(). (main): Call init_scores(), init_save_records(), and user_persona_definitively(). 2001-05-20 Alexandre Duret-Lutz Hopefully, Heroes now works back with MinGW. * lib/stripslash.c: New file from fileutils-4.1. * lib/stripslash.h: New file. * src/relocalte.c (check_installation): Strip slashes before calling isdir. (try_to_explore_path): Check path_env against ';', not path. * tools/fetish-sync.sh (files): Add stripslash.c. * lib/dirname.c (dir_name): Compute append_dot using path, not newpath. * Makefile.am (SUBDIRS): Make intl before lib because lib needs libintl.h. * arch/mingw32/dest-readme-lib: Update to SDL 1.2.0 and SDL_mixer 1.2.0. * arch/mingw32/cross.sh: Likewise. * arch/mingw32/dest-run-bat: Update for i18n and relocation. * arch/mingw32/dest-readme-txt: Likewise. 2001-05-19 Alexandre Duret-Lutz * m4/h-paths.m4: Adjust the definition of localedir to the one used by recent gettexts, and put more comments about issues regarding localedir. 2001-05-19 Alexandre Duret-Lutz * m4/dos.m4: New file, from fileutils-4.1, patched to check for __WIN32__, _WIN32, and __MSDOS__. * tools/fetish-sync.sh (files): Add dos.m4. * configure.in: Call jm_AC_DOS. 2001-05-19 Alexandre Duret-Lutz * po/it.po: New revision from Alessandro. 2001-05-19 Alexandre Duret-Lutz * src/menus.c (handle_reader_keys): Typo. 2001-05-19 Alexandre Duret-Lutz * src/relocate.c (try_to_explore_path): Support semicolon separated paths. 2001-05-19 Alexandre Duret-Lutz * src/visuals.c: s/gauche/left/; s/droite/right/ (vertical_zoom_wave): Fix display of last line. Reported by Jean. 2001-05-17 Alexandre Duret-Lutz * doc/heroes.texi: Various fixes suggested by Jean. 2001-05-08 Alexandre Duret-Lutz * configure.in: Bump version to 0.10a. * NEWS: Update for 0.10a. 2001-05-08 Alexandre Duret-Lutz * src/relocate.c (try_to_derive_argv0): Don't free path if null. 2001-05-08 Alexandre Duret-Lutz * src/items.c (catch_this): Remove. (tutorial_arrow): New. (init_item, unit_items): Handle tutorial_arrow instead of catch_this. * src/items.h (catch_this): Remove. (tutorial_arrow, NBR_ARROW_FRAMES): New. * src/render.c (draw_level): Change the tutorial arror rendering the draw loops with the new arrow. * src/rsc_files.gperf (arrow-img): New. * src/system.h (M_PI, M_PI_2, M_PI_4): New. 2001-05-06 Alexandre Duret-Lutz * src/helptext.c (help_text1): Draw the two pictures in the background and label them using textat commands. * src/readmake.c (flag_error): New function. (compile_reader_data): Handle textat commands and use flag_error. 2001-05-06 Alexandre Duret-Lutz * configure.in: Bump version number to 0.10. * NEWS: Update for 0.10. * GNUmakefile (src/debughash.gperf): New target. (cvsboot): Require src/debughash.gperf. * po/fr.po: Update. 2001-05-06 Alexandre Duret-Lutz * Makefile.am: Avoid non-portable use of $< and $@ in explicit rules. * doc/Makefile.am: Likewise. * man/Makefile.am: Likewise. * src/Makefile.am: Likewise. * Makefile.am (MAINTAINERCLEANFILES): New target. (DISTCLEANFILES): Remove (intl/libintl.h is now removed from intl/Makefile). * man/Makefile.am (MAINTAINERCLEANFILES): New target. * src/Makefile.am (MAINTAINERCLEANFILES): New target. 2001-05-06 Alexandre Duret-Lutz * arch/Makefile.am: Comment out all the VisualC stuff. It's out of date. 2001-05-05 Alexandre Duret-Lutz * GNUmakefile (src/people.c): New target. (cvsboot): Require src/people.c. 2001-05-05 Alexandre Duret-Lutz * ANNOUNCE: Update for 0.10. * TODO: Likewise. 2001-05-05 Alexandre Duret-Lutz Update copyright year for recently modified files. * src/debugmsg.c: Copyright 2001. * src/misc.c: Likewise. * src/misc.h: Likewise. * src/pcx.c: Likewise. * src/rsc_files.c: Likewise. * src/rsc_files.gperf: Likewise. * src/rsc_files_hash.h: Likewise. * src/userconf.h: Likewise. * src/userconf.c: Likewise. * tools/autogen.sh: Likewise. * tools/cvsboot.sh: Likewise. * tools/fetish-sync.sh: Likewise. 2001-05-05 Alexandre Duret-Lutz * src/pcx.c (delta): Remove. (pcx_load): Remove call to delta, and do some cosmetic cleanups. 2001-05-05 Alexandre Duret-Lutz Get rid of new gcc-3.0 warnings. * src/const.c (draw_glenz_box): Remove `operation possibly undefined warning'. * src/pcx.c (delta): Likewise. * src/render.c (draw_radar_map, draw_score, draw_logo_info): Likewise. * src/heroes.c (output_screen): Likewise. (play_game): Set default value for 0 to suppress a warning. 2001-05-05 Alexandre Duret-Lutz * GNUmakefile: New file. * Makefile.am (EXTRA_DIST): Add GNUmakefile. * HACKING: Update. 2001-05-05 Alexandre Duret-Lutz * m4/gnu-source.m4: New file. * tools/fetish-sync.sh (files): Add m4/gnu-source.m4. * configure.in: Call AC__GNU_SOURCE. 2001-05-04 Alexandre Duret-Lutz Change the CREDIT screen to thanks ALL people. * src/people.h: New file. * src/people.tpl: Generate people.c. * src/Makefile.am (heroes_SOURCES): Add people.h add people.c. (people.c): New target. * src/menu.c (people_text): New variable. (credit_menu): Remove variable. (init_menus_sprites, uninit_menus_sprites): Handle people_text, remove reference to credit_menu. (handle_reader_keys): New functions. (jukebox_keys): Call handle_reader_keys. (jukebox_menu): Display people_text instead of credit_menu. * src/people.def: Add Eugenia Loli-Queru, Ian Dalton, and Pascal Rigaux. * src/relocate.c (try_to_explore_path): Oops, exit the loop if needed. 2001-05-03 Alexandre Duret-Lutz Generate AUTHORS, THANKS, and the associated section of the documentation from a central file (src/people.def). * AUTHORS: Delete. * THANKS: Delete. * Makefile (AUTHORS, THANKS): New targets. * src/people.def: New file. * src/people.tpl: New file. * src/Makefile.am (heroes_SOURCES): Add people.def or people.tpl. * doc/Makefile.am (heroes_TEXINFOS, MAINTAINERCLEANFILES): Add people.texi. (people.texi): New target. * doc/heroes.texi (Authors, Contributors): Replaces these sections ... (People): ... with this one, which includes people.texi. 2001-05-03 Alexandre Duret-Lutz * configure.in: Ask AM_GNU_GETTEXT to check for ngettext. Reported by Jean. 2001-05-01 Alexandre Duret-Lutz * configure.in: Bump version number to 0.9b. * NEWS: Update for 0.9b 2001-05-01 Alexandre Duret-Lutz * doc/heroes.texi (Relocatable package): New section. * tools/readme.sed: Adjust summary. 2001-05-01 Alexandre Duret-Lutz Better relocation: use argv0 and PATH to guess the location of data files. * configure.in: Check for memrchr. * lib/dirname.c: New file. * lib/dirname.h: New file. * lib/memrchr.c: New file. * lib/Makefile.am (EXTRA_DIST): Add memrchr. (noinst_HEADERS): Add dirname.h. (libheroes_a_SOURCES): Add dirname.c. * src/relocate.c (try_to_derive_argv0, try_backward_relative_bindir, try_to_explore_path): New functions. (relocate_data): Call this function. Take a argv0 argument. * src/relocate.h (relocate_data): Take a argv0 argument. * src/heroes.c (main): Adjust call to relocate_data. 2001-05-01 Alexandre Duret-Lutz From Alessandro Dotti . * po/it.po: New revision. 2001-04-30 Alexandre Duret-Lutz Italian translations. From Alessandro Dotti . * configure.in (ALL_LINGUAS): Add it. * po/it.po: New file. 2001-04-29 Alexandre Duret-Lutz * src/savegame.c (write_save_one_record): New function. * src/savegame.h (write_save_one_record): Likewise. * src/heroes.c (play_game): Use it. 2001-04-29 Alexandre Duret-Lutz * src/scores.c (insert_scores): New function. * src/scores.h (insert_scores): Likewise. * src/heroes.c (play_menu): Use it. 2001-04-29 Alexandre Duret-Lutz * po/fr.po: Update. 2001-04-29 Alexandre Duret-Lutz * src/relocate.c (relocate_data): Typo. 2001-04-29 Alexandre Duret-Lutz * src/menus.c (game_menu): Use ngettext to handle plural. * src/heroes.c (update_player): Likewise. * src/system.h (ngettext): Define replacement macro. 2001-04-28 Alexandre Duret-Lutz * src/etc/heroesrc (soundconf): Suggest to use ifdef suid-or-sgid to protect the definition of global paths. * src/userconf.c (read_userconf): Handle ifdef/endif. 2001-04-28 Alexandre Duret-Lutz * src/vars.h: New file. * src/vars.c: New file. * src/Makefile.am (heroes_SOURCES): Add vars.c and vars.h. * src/argv.c (list): Handle --list=variables. * src/heroes.c (main): Un/initialize variables. * src/persona.c (init_persiona): define sgid/suid/suid-or-sgid variables. 2001-04-25 Alexandre Duret-Lutz * tools/upgettext.sh: Fix function declarations, the `function' keyword is not portable. * tools/cvsboot.sh: Likewise. * tools/autogen.sh: Likewise. 2001-04-25 Alexandre Duret-Lutz * misc/01-intl.patch: New file. * misc/04-intl.patch: New file. * misc/04-m4.patch: New file. * misc/05-po.patch: New file. * Makefile.am (EXTRA_DIST): Add all the above files. * tools/upgettext.sh: Patch the gettext files using all the above patch, except 04-m4.patch (already applied). * tools/Makefile.am (EXTRA_DIST): Add upgettext.sh. 2001-04-24 Alexandre Duret-Lutz * gettext.m4: Check for getegid(). 2001-04-24 Alexandre Duret-Lutz Drop the fetish copy of gettext and switch to gettext-0.10.37, released a few days ago. The main reason for the change is that the change needed to run the old gettext on MinGW are already present in 0.10.37. * m4/lcmessage.m4: Update to gettext-0.10.37. * m4/progtest.m4: Likewise. * tools/cvsboot.sh: Run tools.upgettext.sh. * tools/fetish-sync.sh: Remove the gettext files, we are now using stock gettext. * ABOUT-NLS: Delete, installed by gettextize. * intl/ChangeLog: Likewise. * intl/Makefile.in: Likewise. * intl/VERSION: Likewise. * intl/bindtextdom.c: Likewise. * intl/cat-compat.c: Likewise. * intl/dcgettext.c: Likewise. * intl/dgettext.c: Likewise. * intl/explodename.c: Likewise. * intl/finddomain.c: Likewise. * intl/gettext.c: Likewise. * intl/gettext.h: Likewise. * intl/gettextP.h: Likewise. * intl/hash-string.h: Likewise. * intl/intl-compat.c: Likewise. * intl/l10nflist.c: Likewise. * intl/libgettext.h: Likewise. * intl/linux-msg.sed: Likewise. * intl/loadinfo.h: Likewise. * intl/loadmsgcat.c: Likewise. * intl/localealias.c: Likewise. * intl/po2tbl.sed.in: Likewise. * intl/textdomain.c: Likewise. * intl/xopen-msg.sed: Likewise. * po/Makefile.in.in: Likewise. * m4/libintl.m4: Delete, gettext use gettext.m4. * m4/codeset.m4: New file, from gettext-0.10.37. * m4/gettext.m4: Likewise. * m4/iconv.m4: Likewise. * m4/isc-posix.m4: Likewise. * tools/upgettext.m4: New file. * HACKING: Reflect changes. 2001-04-21 Alexandre Duret-Lutz * configure.in: Bump version number to 0.9a. * Makefile.am (null_AM_MAKEFLAGS): Set AUTOGEN to false. * src/Makefile.am (heroes_SOURCES): Add debugchn.def, debugchn.tpl, prefs.def and prefs.tpl. * lib/Makefile.am (noinst_HEADERS): Typo. * doc/Makefile.am (CLEANFILES): New. * src/system.h: Don't declare keycode_t as u32_t. * doc/heroes.texi (Machines): Add BeOS. Reported by Todd Allendorf . 2001-04-21 Alexandre Duret-Lutz * m4/checkpkg.m4: Prepend new libraries, instead of appending them. * m4/ftruncate.m4: Check for chsize and define HAVE_CHSIZE, always link ftruncate.o if ftruncate() is missing. * lib/fopenlock.c (fopenlock): Don't lock the file if fcntl locking is not available. * NEWS: Prepare for 0.9a. * arch/mingw32/cross.sh (BUILDNAME): s/i386/i586/ to follow Debian change. * HACKING: Needs autogen. 2001-04-17 Alexandre Duret-Lutz * src/persona.c (user_persona, sys_persona): Typo. * src/display.c (get_directbuffers): Argument v is not a pointer. * src/joystick.c (joystick): Not a pointer. 2001-04-16 Alexandre Duret-Lutz * src/prefs.tpl (load_preferences): Free buf. 2001-04-15 Alexandre Duret-Lutz * lib/basename.c: New file. * lib/basename.h: New file. * lib/Makefile.am (noinst_HEADERS): Add basename.h. (libheroes_a_SOURCES): Add basename.c. * tools/fetish-sync: Add basename.c. * HACKING: Likewise. * src/debugmsg.c (dmsg_init): Basename-ify the program name. 2001-04-15 Alexandre Duret-Lutz Ahem... output debug messages on stdout, as said in HACKING. * src/debugmsg.c (dmsg): s/stderr/stdout/. 2001-04-15 Alexandre Duret-Lutz * lib/isdir.c: New file. * lib/isdir.h: New file. * lib/Makefile.am (noinst_HEADERS): Add isdir.h. (libheroes_a_SOURCES): Add isdir.c. * tools/fetish-sync.sh: Add lib/isdir.c * HACKING: Add lib/isdir.c. * src/relocate.c (check_installation): New. (relocate_data): Call check_installation. 2001-04-10 Alexandre Duret-Lutz Compute make $(data-dir) and $(locale-dir) relative to $(prefix), and handle HEROES_PREFIX to override $(prefix). The next step is to compute/guess HEROES_PREFIX. * src/relocate.c: New file. * src/relocate.h: New file. * doc/heroes.texi (Example): Document HEROES_PREFIX. * m4/h-paths.m4: New file. * configure.in: Asjust to use heroes_COMPUTE_PATHS. * src/Makefile.am (localedir, DEFS): Remove. (heroes_SOURCES): Add relocate.c and relocate.h. * src/heroes.c: Adjust to call relocate_data. * src/resc_files.gperf (data-dir): Use FORWARD_RELATIVE_PKGDATADIR. (locale-dir): Use FORWARD_RELATIVE_LOCALEDIR. (prefix): New. 2001-04-18 Alexandre Duret-Lutz Merge with autogen-pending-BRANCH, I thought I would wait until Autogen 5.1.5 is released, but I give up (most of my upcomming patches would introduce conflicts in one branch or the other. There is a prerelease of autogen available here: ftp://autogen.sourceforge.net/pub/autogen/ Version 5.1.4d is a minimum. |2001-03-21 Alexandre Duret-Lutz | | * src/prefs.tpl: Use the ".name" notation to designate | locale variables in AutoGen >= 5.1.5 (not yet released). | |2001-03-18 Alexandre Duret-Lutz | | Basic protection against people that don't have AutoGen. | | * configure.in: Define AUTOGEN using AM_MISSING_PROG, fix | other AM_MISSING_PROG uses. | * doc/Makefile.am: Use $(AUTOGEN). | * src/Makefile.am: Likewise. | |2001-03-18 Alexandre Duret-Lutz | | * HACKING (Auto-generated files): Add src/prefs.c and src/prefs.h. | |2001-03-18 Alexandre Duret-Lutz | | * doc/heroes.texi (Heroes options): Document --list=preferences. | * src/argv.c (showprefs): New variable. | (list): Handle --list=preferences. Return a boolean | to indicate whether the action is finished or has been delayed. | (parse_argv): Adapt to follow this latter convention. | * src/argv.h (showprefs): New variable. | * src/heroes.c (main): Output the preferences if requested. | |2001-03-18 Alexandre Duret-Lutz | | Save preferences in text form. Generate the i/o code | automatically from a description of the preferences. | | * src/options.c: Delete. | * src/options.h: Delete. | * src/prefs.def: New file. | * src/prefs.tpl: New file. | * src/Makefile.am (heroes_SOURCES): Remove options.c and options.h, | add prefs.c and prefs.h. | (BUILT_SOURCES): Add prefs.c and prefs.h. | (prefs.h, prefs.c): New files. | * src/const.c: Include prefs.h instead of options.h. | * src/menus.c: Likewise. | * src/render.c: Likewise. | * src/scrtools.c: Likewise. | * src/sfx.c: Likewise. | * src/sound.c: Likewise. | * src/heroes.c: Likewise, also transform call to write_options, | reinit_options, load_options, and free_options to their new names: | save_preferences, reinit_preferences, load_preferences, | free_preferences. | * src/rsc_files.gperf: Remove options-file, add pref-file. | * src/system.h (PREF_INPUT_GROUP): New macro. | |2001-03-11 Alexandre Duret-Lutz | | Centralize the definition of debug channels into src/debugchn.def. | Use AutoGen the generate the hash table, the channel enumeration, | and the documentation. | | * doc/Makefile.am (heroes_TEXINFOS): New. | (MAINTAINERCLEANFILES): New. | (debugchn.texi): New. | * doc/heroes.texi (Environment variables): Remove the debug channels | table, include debugchn.texi instead. | * src/Makefile.am (heroes_SOURCES): Add debugchn.h. | (BUILT_SOURCES): Add debugchn.h and debughash.gperf. | (debughash.gperf, debugchn.h): New. | * src/debughash.gperf: Remove from CVS (now generated). | * src/debugmsg.h: Don't declare the channels, include debugchn.h | instead. | * src/debugchn.def: New file. | * src/debugchn.tpl: New file. | 2001-04-18 Alexandre Duret-Lutz * THANKS: Update Jos Boersema's email, the old bounced and I just came across this new one in the archive for the bug-texinfo mailing list. 2001-04-17 Alexandre Duret-Lutz * src/menus.c (enter_your_name): Work directly with keycodes to not misinterpret extended keys (sush as shift keys) as standard characters. Reported by Janos Holanyi . 2001-04-07 Alexandre Duret-Lutz * m4/getoptlong.m4: Update for submission to the Autoconf macro archive. 2001-04-01 Alexandre Duret-Lutz * m4/normpath.m4: New file. * m4/relpaths.m4: New file. * m4/stdrelpaths.m4: New file. 2001-03-29 Alexandre Duret-Lutz * configure.in: Check for uid_t, gid_t, getegid, setegid, and setregid. * src/persona.c: Use setregid and setreuid when setegid and seteuid are not found. * src/system.h (seteuid, setegid, setreuid, setreguid, geteuid, getuid, getegid, getgid): New replacement macros. 2001-03-26 Alexandre Duret-Lutz Keep track of secure (trusted) resources, and only change personna when handling such resources. * src/rsc_files_hash.h: Add a secure attribute. * src/rsc_files.gperf: Supply `true' for all secure attributes. * src/Makefile.am (rsc_files_hash.c): Adjust to initialize the secure member of empty hash entries to false. * src/userconf.c: Take a secure argument. * src/usercong.h: Adjust accordingly. * src/rsc_files.c (set_rsc_file): Take a secure argument. (rsc_expand, get_rsc_file, get_non_null_rsc_file): Rename to ... (rsc_expand_secure, get_rsc_file_secure, get_non_null_rsc_file_secure): ... these, and take a secure argument. (rsc_expand, get_rsc_file, get_non_null_rsc_file): New function, written using the above. * src/rsc_files.h: Adjust accordingly. * src/heroes.c (main): Adjust set_rsc_file, and read_userconf calls. * src/persona.c (sys_persona_if_needed): Make sure we handle secure resources. * doc/heroes.texi (Global score file): Update accordingly. Bug fix: persona_fopenlock already takes care of switching persona if needed. * src/scores.c (load_scores_and_keep_locked): Don't call sys_persona. 2001-03-20 Alexandre Duret-Lutz Support for relocatable locales. * src/heroes.c (main): Check for HEROES_LOCALE_DIR or HEROES_LOCALEDIR and set the locale-dir resource accodingly. Use this resource to initialize the locales. * src/rsc_files.gperf (locale-dir): New entry. * src/Makefile.am (rsc_files_hash.c): Adapt key indexes. * doc/heroes.texi (Environment variables): Document HEROES_LOCAL_DIR, and note the --list=resources can be used to check the value of data-dir and locale-dir. 2001-03-25 Alexandre Duret-Lutz Support for set-group-id and set-user-id access to a global score/savedgames file. * src/persona.c: New file. * src/persona.h: New file. * src/Makefile.am (heroes_SOURCES): Add persona.c and persona.h. * src/heroes.c (main): Call init_persona. * src/rsc_files.gperf (sys-dir): New. * src/savegame.c (write_save_records, load_save_records_open, load_scores_and_keep_locked): Adapt to use persona_fopenlock. And don't output the data unless the file has been succesfully opened. * src/scores.c (write_scores, load_scores_open, load_scores_and_keep_locked): Likewise. * doc/heroes.texi (Sharing a global score file): Document more. * src/etc/heroesrc: Adapt to new resources names. 2001-03-25 Alexandre Duret-Lutz Truncate scores and saved-games files, before writing to them. * lib/ftruncate.c: New file (from fileutils-4.0.39). * m4/ftruncate.m4: Likewise. * lib/Makefile.am (EXTRA_DIST): Add ftruncate.c. * tools/fetish-sync.sh (files): Add lib/ftruncate.c and m4/ftruncate.m4. * HACKING: Likewise. * configure.in: Call jm_FUNC_FTRUNCATE. * src/savegame.c (write_save_records): Truncate the file. * src/scores.c (write_scores): Likewise. 2001-03-25 Alexandre Duret-Lutz Replace game magics by game IDs, which serve the same purpose but are 128bits values. See comments in src/gameid.h. * src/gameid.h: New file. * src/gameid.c: New file. * src/Makefile.am (heroes_SOURCES): Add gameid.c and gameid.h. * src/const.c (game_magic): Replace by ... (game_id): ... this new variable. * src/const.h: Likewise. * src/heroes.c (play_menu, play_game): Adapt to use game IDs. * src/menus.c (draw_saved_games_info): Likewise. * src/savegame.c (clear_save_records, write_save_records, load_save_records_read): Likewise. (load_save_records_error): New function. (compute_magic, set_magic, find_magic): Remove. * src/savegame.h: Adjust. * src/scores.c (find_score_by_gameid): New function. (clear_scores, write_scores, load_scores_read): Adapt to yse game IDs. (load_scores_error): New function. * src/scores.h: Adjust. 2001-03-24 Alexandre Duret-Lutz * src/savegame.h: Copyright 2001. * src/savegame.c: Likewise. (load_save_records_read): Skip the initial space in the name. * src/score.c (load_scores_read): Likewise. (clear_scores): Don't set unused attributes. * src/score.h (top_score): Remove unused attributes. 2001-03-24 Alexandre Duret-Lutz Save the games as text. * src/rsc_files.gperf (games-file): Remove. (saved-games-file): New. * src/savegame.c (saves_file): Rename as ... (saved_games_file): ... this. Adjust all calls. (check_save_records, bswap_save_records): Remove. (write_save_records, load_save_records_read): Write and read the saved games as text. (load_save_records, load_save_records_and_keep_locked): Adjust to open the saved games file as text file. Create the file if needed. * src/savegame.h (saved_game): Declare used as bool. 2001-03-24 Alexandre Duret-Lutz Save the scores as text. * src/misc.c (chomp): New function. * src/misc.h (chomp): New function. * src/rsc_files.gperf (scores-file): Remove. (score-file): New. * src/scores.c (scores_file): Rename as ... (score_file): ... this. Adjust all calls. (check_scores, bswap_scores): Remove. (write_scores, load_scores_read): Write and read the scores as text. (load_scores, load_scores_and_keep_locked): Adjust to open the score as text file. Create the file if needed. 2001-03-24 Alexandre Duret-Lutz Adapt score and save records loading/saving to locking. Not perfect yet. * src/heroes.c (play_menu): Adapt to use load_scores_and_keep_locked. (play_game): Adapt to use load_save_records_and_keep_locked. (main): Don't load scores and save records, but save them right after clearing them if it was requested. * src/menus.c (scores_menu): Load scores to be up to date. * src/savegame.c (compute_magic): Likewise. (load_save_records): Move the x10sav cheat to ... (clear_save_records): ... here. (load_save_records): Split into ... (load_save_records_open, load_save_records_read): ... these new functions. (load_save_records_and_keep_locked): New function. (write_save_records): Adjust. * src/struct.h (save_game): Move ... * src/savegame.h (save_game): ... here. (load_save_records_and_keep_locked): New function. * src/scores.c (load_scores): Split into ... (load_scores_open, load_scores_read): ... these new functions. (load_scores_and_keep_locked): New function. (write_scores): Adjust. * src/struct.h (top_scores): Move ... * src/scores.h (top_scores): ... here. (load_scores_and_keep_locked): New function. 2001-03-23 Alexandre Duret-Lutz Introduce file locking support (as well as portability issues, I guess...). * lib/fopenlock.c: New file. * lib/fopenlock.h: New file. * lib/Makefile.am (noinst_HEADERS): Add fopenlock.h. (libheroes_a_SOURCES): Add fopenlock.c. * m4/fopenlock.m4: New file. * m4/Makefile.am (EXTRA_DIST): Add fopenlock.m4. * configure.in: Use adl_FUNC_FOPENLOCK. 2001-03-20 Alexandre Duret-Lutz * Makefile.am (AUTOMAKE_OPTIONS): Add dist-bzip2. 2001-03-16 Alexandre Duret-Lutz * src/system.h (KEYCODE_MAX): New macro. 2001-03-12 Alexandre Duret-Lutz * src/options.h (extrasel): Move ... * src/menus.h (extrasel): ... here. * src/options.c (extrasel): Move ... * src/menus.c (extrasel): ... here. 2001-03-19 Alexandre Duret-Lutz From Hermann J. Beckers . * po/de.po: New version. 2001-03-14 Alexandre Duret-Lutz From Hermann J. Beckers . * po/de.po: New version. 2001-03-10 Alexandre Duret-Lutz * HACKING (Console output): New section. 2001-03-10 Alexandre Duret-Lutz From Hermann J. Beckers . * po/de.po: New version. 2001-03-09 Alexandre Duret-Lutz German translations. From Hermann J. Beckers . * configure.in (ALL_LINGUAS): Add `de'. * po/de.po: New file. * THANKS: Add Hermann. * doc/heroes.texi: Likewise. 2001-02-28 Alexandre Duret-Lutz * m4/mkdir.m4: Update for submission to the Autoconf macro archive. 2001-02-24 Alexandre Duret-Lutz * configure.in: Bump to version 0.9. * NEWS: Update for 0.9. * doc/heroes.texi (configure options): Make the --enable-debug recommendation clearer. 2001-02-23 Alexandre Duret-Lutz * src/helptext.c (help_text3): Remove a doubled `the'. Reported by Jos Boersema . * po/nl.po: Update accordingly. * po/fr.po: Update accordingly, mark as `0.9 compliant'. 2001-02-22 Alexandre Duret-Lutz * arch/mingw32/cross.sh (cross_pack): Work around a strange behavior of zip, rooting the archive on `/heroes/' instead of `heroes/'. Reported by Jean. 2001-02-22 Alexandre Duret-Lutz * arch/mingw32/cross.sh (cross_install): zip the changelog, instead of gzip'ing it. Suggested by Jean. (cross_pack): Typo. * arch/ming32/dest-readme-txt: Add more text, suggest -F, give the bug-report address. * arch/ming32/dest-readme-lib: Update to newer libs. 2001-02-22 Alexandre Duret-Lutz * doc/heroes.texi (Machines): Describe the Win32/VisualC files as obsolete. 2001-02-22 Alexandre Duret-Lutz From Jean Delvare . * HACKING: Typo. * ChangeLog: Likewise. * src/menus.c (init_menus_sprites): Likewise. 2001-02-21 Alexandre Duret-Lutz * BUGS: Sync up with the recent bug reports from the lists. 2001-02-20 Alexandre Duret-Lutz * Makefile.am (distcheck-hook): Add my-distcheck-nodisplay. (my-distcheck-nodisplay): New target. * HACKING: Update accordingly (distcheck now makes four builds). 2001-02-19 Alexandre Duret-Lutz * configure.in: Bump to version 0.8f. * NEWS: Update for 0.8f. * src/Makefile.am: Copyright 2001. * src/keysdef.c: Likewise. * Makefile.am: Likewise. * po/fr.po: Update. * po/nl.po: Update. 2001-02-19 Alexandre Duret-Lutz * src/menus.c (keyboard_menu): Regenerate keyname sprites for conflicting keys. Reported by Jean Delvare . 2001-02-19 Alexandre Duret-Lutz Make sure no sticky bits go into the distribution. Reported by Jean Delvare . * Makefile.am (dist-hook): New. 2001-02-19 Alexandre Duret-Lutz From Jean Delvare . * NEWS: s/two players game/two player game/. * doc/heroes.texi: Likewise. 2001-02-19 Alexandre Duret-Lutz * src/argv.c (version): Set copyright year to 2001. Reported by Jean Delvare . 2001-02-19 Alexandre Duret-Lutz Make sure the manual pages are up-to-date before releasing. Reported by Jean Delvare . * man/Makefile.am (man-distcheck): New target. * Makefile.am (man-distcheck): New target. (distcheck-hook): Depend upon man-distcheck. 2001-02-18 Alexandre Duret-Lutz Support for --disable-display. * doc/heroes.texi (configure options): Document --disable-display. * m4/h-ggi.m4 (heroes_CHECK_GGI_POST): New. * m4/h-display.m4: Handle --disable-display. Call heroes_CHECK_GGI_POST. * m4/h-sound.m4: sound_lib default to . * src/Makefile.am (CLEANFILES): Remove keysdef-inc.h. (DISTCLEANFILES): Add keysdef-inc.h. (keysdef-inc.h): Don't depend upon $(CONFIG_HEADER); create keysdef-inc.h when neither GGI nor SDL are used. * src/display.h [!HAVE_LIBSDL && !HAVE_LIBGGI] (set_display_params, set_full_screen_mode, init_video, uninit_video, set_color, vsynchro, vsynchro2, set_pal): Define new empty macros. * src/keyb.c [!HAVE_LIBSDL && !HAVE_LIBGGI] (update_mouse_state): Define new empty macro. (uninit_keyboard_map): Define only once. * src/keyb.h [!HAVE_LIBSDL && !HAVE_LIBGGI] (process_input_events, get_key, key_ready, init_mouse, mouse_show, mouse_hide): Define new empty macros. * src/keys_heroes.h [!HAVE_LIBSDL && !HAVE_LIBGGI]: Define keys. * src/keysdef.c: Suppress RCS Id. * src/system.h [!HAVE_LIBSDL && !HAVE_LIBGGI] (keycode_t): Define. 2001-02-17 Alexandre Duret-Lutz * NEWS: s/Dutsh/Dutch/ * ANNOUNCE: Prepare for 0.9. * TODO: Likewise. 2001-02-16 Alexandre Duret-Lutz Heroes binaries to compiled with gcc 2.7.* failed pack struct correctly. * src/system.h: Undefine __attribute__ after xalloc.h inclusion. This is needed because we want to use __attribute__ ((packed)) on gcc 2.7.* while xalloc.h inhibit it for gcc <= 2.8. 2001-02-14 Alexandre Duret-Lutz From Jean Delvare. Spelling mistakes. * src/heroes.c (play_game): s/chose/choose/. * src/sprglenz.h: Likewise. * src/menus.c (init_menus_sprites): Likewise. s/TWO PLAYER/TWO PLAYERS/. 2001-02-13 Alexandre Duret-Lutz * configure.in: Bump to 0.8e. * NEWS: Update for 0.8e. * po/fr.po: Update. 2001-02-13 Alexandre Duret-Lutz * src/const.c (tunnel_square_io): Move to ... * src/heroes.c (tunnel_square_io): ... here. * src/const.c (radar_trail_color, radar_wall_color): Move to ... * src/render.c (radar_trail_color, radar_wall_color): ... here. * src/const.c (mode_names): Move to ... * src/menus.c (mode_names): ... here. * src/const.h (tunnel_square_io, radar_trail_color, radar_wall_color, mode_names): Remove. 2001-02-13 Alexandre Duret-Lutz * TODO: Update. 2001-02-13 Alexandre Duret-Lutz * src/display.c [HAVE_LIBGGI] (setup_WWWxHHHxB_display): Ask for GT_8BIT if possible. 2001-02-13 Alexandre Duret-Lutz * lib/xmalloc.c: Update from fileutils-4.0.39. 2001-02-13 Alexandre Duret-Lutz * src/display.c (set_color, set_pal): Don't set palette on visu if it is not palletized. 2001-02-13 Alexandre Duret-Lutz Revert an error I did when adapting Jean's patch. * src/menus.c (keyboard_menu): Don't strip keyname which are 7 letter wide, only thos which are longer. 2001-02-12 Alexandre Duret-Lutz Adapted from Jean Delvare . * src/menus.c (keyboard_menu): Strip wide keynames to 6 letters. 2001-02-12 Alexandre Duret-Lutz From Jos Boersema . * po/nl.po: Update. 2001-02-11 Alexandre Duret-Lutz * src/scrtools.c (set_pal_with_luminance): Perform gamma correction, use set_pal rather than set_palette. * src/options.c (reinit_options): Use 6 as default luminance value. * src/menu.c (screen_menu): Use 13 steps for the luminance option. 2001-02-11 Alexandre Duret-Lutz Important revamp of the LibGGI display driver to not use the `render_visu' intermediate buffer when crossblitting is unneeded, perform double buffering and locking. * src/display.c (screen_rv): Move to ... [HAVE_LIBSDL] (screen_rv): ... here. [HAVE_LIBGGI] (db, current_frame): New variables. [HAVE_LIBGGI] (setup_320x200x8_display, setup_320x200xB_display, setup_WWWxHHHxB_display, get_directbuffers): New functions. [HAVE_LIBGGI] (init_video): Revise, using the above functions. [HAVE_LIBGGI] (set_color, set_pal): Don't set paletter on render_visu when render_visu == NULL. [HAVE_LIBGGI] (vsynchro): Rewrite as a call to vsynchro2. [HAVE_LIBGGI] (vsynchro2): Revise to perform double buffering, locking, and write to visu or render_visu. 2001-02-08 Alexandre Duret-Lutz From Jos Boersema . * po/nl.po: Update. 2001-02-07 Alexandre Duret-Lutz * NEWS: Update for 0.8d. 2001-02-06 Alexandre Duret-Lutz * doc/heroes.texi (configure options): Say that --enable-debug will check the translated message. * HACKING: Add a section `Translating message catalogs'. 2001-02-06 Alexandre Duret-Lutz * src/sprtext.c (compile_sprtext, compile_sprtext_color): Don't compile undrawable letters. 2001-02-06 Alexandre Duret-Lutz * po/fr.po: Update for 0.8d. * po/nl.po: Merge. 2001-02-06 Alexandre Duret-Lutz * src/argv.c: Add comments for translators. * src/const.c: Likewise. * src/display.c: Likewise. * src/menus.c: Likewise. * src/readmake.c: Likewise. 2001-02-06 Alexandre Duret-Lutz Report unprintable messages before crashing... * src/system.h (XCALLOC_ARRAY): New. * src/fontdata.c (initialize_menu_font, initialize_deck_font, initialize_bonus_font, initialize_help_font): Use XCALLOC_VAR instead of XMALLOC_VAR and memset. This actually suppress a mistake because memset was called mistakenly. [DEBUG] (check_message_is_drawable): New function. * src/fontdata.h (check_message_is_drawable): New. * src/sprtext.c (compile_sprtext, compile_sprtext_color): Call check_message_is_drawable. 2001-02-05 Alexandre Duret-Lutz Dutch translation from Jos Boersema . * po/nl.po: New file. * configure.in (ALL_LINGAS): Add nl. * doc/heroes.texi (Contributors): Add Jos Boersema. * THANKS: Likewise. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c (affplan, afftests): Rename as ... (draw_level_map, draw_collide_tests): ... these. (planfull): Rename as ... (display_level_map_fullscreen): ... this. (joueanim): Rename as ... (display_level_map_animated): ... this. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c (partiel4c, carre, framept): Rename as ... (copy_tile_pcx, draw_check_point, frame_dashed): ... these. (affgt, majg, majd): Rename as ... (draw_left_panel, update_left_panel, update_middle_panel): ... these. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c (partiel4, partiel2): Rename both as ... (rectangle_copy): ... this. Adjust all calls. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c (fatalog): Remove. (hmain): Replace calls to fatalog by calls to emsg, gettextize the messages. 2001-02-04 Alexandre Duret-Lutz * src/hedlite.c: Cosmetic changes, comment removal. * src/structs.h (type_name, spd_test, dir_test): Move to ... * src/hedlite.c (type_name, spd_test, dir_test): ... here. 2001-02-02 Alexandre Duret-Lutz * configure.in: Bump to 0.8d. 2001-02-01 Alexandre Duret-Lutz * configure.in: Bump to 0.8c. * NEWS: Update for 0.8c, plus a missing entry in 0.8a. * po/fr.po: Update. 2001-02-01 Alexandre Duret-Lutz * src/fader.c (cancel_fader): New function pulled out from run_fader. (run_fader): Use it. * src/fader.h (cancel_fader): New. * src/scrtools.c (set_palette): New function. (set_pal_with_luminance): Use it instead of set_pal. * src/menus.c (pause_menu, quit_yes_no): Likewise. * src/scrtools.h (set_palette): New. 2001-02-01 Alexandre Duret-Lutz Use the same animated background as in the "endscroll" in pase_menu and quit_yes_no, since it is no longer possible the shade the screen. * src/endscroll.c (background_img, render_background): Rename as ... (dummy_background_img, dummy_moving_background_render): ... this, and export. (copy_background): Adjust accordingly. (end_scroll): Split into ... (dummy_moving_background_init, dummy_backgournd_uninit, end_scroll): ... these. * src/endscroll.h (dummy_backgournd_img, dummy_moving_background_init, dummy_backgournd_uninit, dummy_moving_background_render): New. * src/menus.c (pause_menu, quit_yes_no): Use dummy_moving_background_render. 2001-01-31 Alexandre Duret-Lutz Remove obsolete code (that was already commented out). * src/hedlite.c (gestclav) [PORT]: Remove. * src/heroes.c (unload_level, main) [PORT]: Remove. 2001-01-31 Alexandre Duret-Lutz Handle the middle button if the level editor, fix some compiler warning as well as two bugs. * src/keyb.c (enable_mouse, mouse_pos_x, mouse_pos_y, mouse_button_left, mouse_button_right): Mark as static. (mouse3): New function. (mouse_button_middle): New variable. (mous12): Also test for mouse_button_middle. [HAVE_LIBGGI] (update_mouse_state): Update mouse_button_middle. [HAVE_LIBSDL] (handle_mouse_events): Likewise. * src/keyb.h (mouse3): New. * src/heroes.c (ia_eval_dir_bonus_inline): Add back missing call to ia_eval_dir_bonus, removed by mistake on 2000-11-14 (0.6d). (ia_eval_dir_bonus): Move variable around. * src/hedlite.c (hmain): Rename variable i as k, and move it in near the event loop. Enable the third mouse button. (framept): s/320/xbuf/ (bugfix). * src/menus.c (keyboard_menu): Supply initial value for t. (scores_menu): Supply initial value for rolldec. * src/sfx.c (read_sfx_conf): Don't test for fconf in error handling, it's not always set. * src/sprtext.c (compile_sprtext, compile_sprtext_color): Supply initial value for text_width. * doc/heroes.texi (editor-clicks): Document the middle button. 2001-01-31 Alexandre Duret-Lutz * HACKING: Strip down. 2001-01-31 Alexandre Duret-Lutz * doc/heroes.texi: s/Burrow/Burrows/. * THANKS: Likewise. 2001-01-30 Alexandre Duret-Lutz Missing copyright updates from previous patches. * doc/heroes.texi: Copyright 2001. * src/menus.c: Likewise. * src/render.h: Likewise. * src/scrtools.h: Likewise. 2001-01-30 Alexandre Duret-Lutz * src/helptext.c (help_text1): Point users at the arrow keys. Suggested by Daniel Burrows. 2001-01-30 Alexandre Duret-Lutz * src/display.c (screen): Remove variable. [HAVE_LIBGGI, HAVE_LIBSDL] (init_video, uninit_video): Don't handle screen anymore. * src/display.h (screen): Remove variable. * src/menus.c (pause_menu, quit_yes_no): Comment calls to backup_screen, they need a replacement. * src/scrtools.c (vsynch, backup_screen, aff_buffer): Remove functions. * src/scrtools.h (vsynch, backup_screen, aff_buffer): Likewise. 2001-01-30 Alexandre Duret-Lutz * src/render.c (display_buffer_moving): Remove. * src/render.c (display_buffer_moving): Remove. * src/scrtools.c (flush_display_moving): New function. * src/scrtools.h (flush_display_moving): New function. * src/heroes.c (play_game): Use flush_display_moving instead of display_buffer_moving. 2001-01-30 Alexandre Duret-Lutz * src/render.c (display_two_buffers_moving_and_clear, display_two_buffers_moving): Remove. * src/render.h (display_two_buffers_moving_and_clear, display_two_buffers_moving): Remove * src/scrtools.c (flush_display2_moving): New function. * src/scrtools.h (flush_display2_moving): New function. * src/heroes.c (play_demo, play_game): Use flush_display2_moving instead of display_two_buffers_moving_and_clear or display_two_buffers_moving. 2001-01-30 Alexandre Duret-Lutz * src/display.c (stretch_twofold, stretch_twofold_even, stretch_threefold, stretch_threefold_even, stretch_fourfold, stretch_fourfold_even, copy_screen_even, copy_screen, copy_display): Take destination and width as arguments. [HAVE_LIBSDL, HAVE_LIBGGI] (vsynchro): Adapt call to copy_display. [HAVE_LIBSDL, HAVE_LIBGGI] (vsynchro2): New function. * src/display.h (vsynchro2): Likewise. * src/render.c (display_buffer_tmp1): Remove. (display_two_buffer): Remove. * src/render.h (display_buffer_tmp1): Remove. (display_two_buffer): Remove. * src/srctools.c (flush_display2): New function. * src/srctools.h (flush_display2): New function. * src/heroes.c (play_demo, play_game): Replace calls to display_two_buffer with calls to flush_display2. 2001-01-29 Alexandre Duret-Lutz Get rid of `screen' in heroes.c and menus.c. * src/heroes.c (main_menu): Rewrite the two pixelize blocks using a local `pixbuf' buffer instead of using screen. * src/menus.c (enter_your_name): Likewise. 2001-01-29 Alexandre Duret-Lutz Get rid of `screen' in hedlite.c. * src/hedlite.c (hedit_buffer): New variable. (partiel4, partiel2, frame, framept, draw_text, transpac, affgt, affplan, majg, departfix, planfull, joueanim, gestclav): Use hedit_buffer instead of screen. (hmain): Likewise. Allocate and free hedit_buffer. 2001-01-29 Alexandre Duret-Lutz Get rid of `screen' in intro.c. * src/intro.c (antialias): Rewrite, assuming a xbuf-wide buffer, drawing only in the first 320 pixels of a line. Take the height as second argument, not a number of pixels. (intro_buffer): New variable. (copy_vehicle_1, copy_vehicle_2, compute_erase_data): Adapt to use intro_buffer instead of screen, flush_display instead of vsynch. (show_intro): Likewise. Adapt call to antialias. (play_intro): Allocate intro_buffer. 2001-01-21 Alexandre Duret-Lutz * m4/debug.m4: Default to -g, use -ggdb3 if enabled, and nothing if disabled. * doc/heroes.texi: Update the corresponding documentation. 2001-01-21 Alexandre Duret-Lutz * intl/ChangeLog: Update from fileutils-4.0.37. * intl/gettextP.h: Likewise. * lib/hash.c: Likewise. * po/Makefile.in.in: Likewise. 2001-01-20 Alexandre Duret-Lutz * configure.in: Call adl_WITH_MPATROL. * m4/memdebug.m4 (adl_WITH_MPATROL, adl_CHECK_MEMORY_USAGE, adl_CHECK_MPATROL_LIBS, adl_CHECK_MPATROL, adl_WITH_MPATROL): New. (adl_ENABLE_MEM_DEBUG): Call adl_CHECK_MPATROL too. (adl_CHECK_DMALLOC): Use AC_CHECK_HEADERS, not AC_CHECK_HEADER. * src/system.h [HAVE_MPATROL_H]: Include mpatrol.h. * doc/heroes.texi (configure options): Describle --with-mpatrol. 2001-01-16 Alexandre Duret-Lutz * doc/heroes.texi (Machines): Document the existence of arch/mingw32. 2001-01-16 Alexandre Duret-Lutz * src/mingw32/cross.sh: Set LIBS to libs needed to link staticaly. Don't set CC, it's detected. Output zip file is now $PACKAGE-$VERSION-XXX-ming32.zip. Adjust `cross.sh all' to halt after the first failure any subtarget. 2001-01-15 Alexandre Duret-Lutz Remove the (broken & undocumented) support for screenshots. * src/argv.c (snap): Remove. (long_options): Remove snap. * src/argv.h (snap): Remove. * src/heroes.c (write_rle, save_pcx): Remove. (get_input_direction): Remove call to save_pcx. 2001-01-15 Alexandre Duret-Lutz Flush the display directly wherever we can avoid to write in `screen'. There are still some places that use `screen' (intro, level-editor, two-player display) and need to be further worked. * src/display.c (stretch_twofold, stretch_twofold_even, stretch_threefold, stretch_threefold_even, stretch_fourfold, stretch_fourfold_even, copy_screen, copy_display): Qualify the source argument as const. [HAVE_LIBSDL,HAVE_LIBGGI] (vsynchro): Likewise. (erase_odd_line): Delete. (copy_screen_event): New. (copy_display): Use copy_screen_event instead of erase_odd_line. * src/display.h (vsynchro): Qualify the source argument as const. * src/scrtools.c (flush_display): New. (vsynch): Rewrite using flush_display. * src/scrtools.c (flush_display): New. * src/endscroll.c (end_scroll): Adapt to use flush_display. * src/heroes (play_menu, play_demo, main_menu, play_game): Likewise. * src/menus.c (display_menu, control_menu, keyboard_menu, sound_menu, screen_menu, game_menu, extra_menu, quit_menu, editor_selector, editor_menu, editor_first_menu, jukebox_draw, pause_menu, quit_yes_no, enter_your_name, scores_menu, help_menu): Likewise. 2001-01-14 Alexandre Duret-Lutz Make `screen' an xbuf*ybuf sized buffer, and adapt all code accordingly. Also prepare the display.c code to not always works from `screen' (the idea is that since the render buffers are also xbuf*ybuf we might avoid doing the copy to `screen' to save some time). * src/const.c (square_offset_320): Remove. * src/const.h (square_offset_320): Remove. (xbuf, ybuf, sbuf): Move to ... * src/display.h (xbuf, ybuf, sbuf): ... here. (vsynchro): Take the source as a parameter. * src/display.c (stretch_twofold, stretch_twofold_even, stretch_threefold, stretch_threefold_even, stretch_fourfold, stretch_fourfold_even, erase_odd_lines, copy_screen, copy_display): Arrange to take the source buffer as a parameter (for a future optimization), and consider the source as an xbuf wide buffer. [HAVE_LIBGGI, HAVE_LIBSDL] (init_video): Always allocate screen (this is only temporary). [HAVE_LIBSDL] (uninit_video): Always free screen. [HAVE_LIBGGI, HAVE_LIBSDL] (vsynchro): Take the source buffer as a new argument, and adjust the call to copy_display. * src/const.c (scdec320): Rename as ... (square_offser_320): ... this. (partiel4, copy_tile, copy_tile_transp, copy_square_transp, partiel2, frame, framept, draw_text, transpa, transpac, carre, affgt, majd, affplan, majg, departfix, planfull, joueanim, hmain): Adjust to consider screen as a xbuf-wide buffer, and supply new the source argument to vsynchro(). * src/heroes.c (play_menu): Adjust to consider screen as a xbuf-wide buffer * src/intro.c (img2vram): Remove. (copy_vehicle_1, copy_vehicle_2, compute_erase_data): Adjust to work in xbuf-wide buffers. (show_intro): Likewise. Use copy_image_to_scr_area instead of img2vram. * src/pixelize.c (pixelize_1, pixelize_2_inline, pixelize_4_inline, pixelize_8_inline, pixelize_16_inline, pixelize_16_inline_2, pixelize_32_inline, pixelize_32_inline_2, pixelize_32, pixelize_64_inline, pixelize_64_inline_2, pixelize_64): Ajust to output in xbuf-wide buffers. (pixelize): Cosmetic change. * src/render.c (display_buffer_tmp1, display_buffer_moving, display_two_ubffers, display_two_buffers_moving, display_two_buffers_moving_and_clear): Ajust to output in xbuf-wide buffers. * src/scrtools.c (vsynch): Supply the source argument to vsynchro. (backup_screen): Adjust to work from xbuf-wide buffer. (add_buffer): Adjust to output in a xbuf-wide buffer. * src/struct.h [__HEDIT__] (square_offset_320, square_offset, d2w, w2d): Remove. * src/visuals.c (flip_buffer): Cosmetic changes. 2001-01-12 Alexandre Duret-Lutz * src/timer.c (reset_htimer) [!HAVE_GETTIMEOFDAY]: Typo from 2000-12-31's patch. 2001-01-11 Alexandre Duret-Lutz mtrace() support. * configure.in: Call add_WITH_MTRACE. * doc/heroes.texi: Describe --with-mtrace. * m4/memdebug.m4 (adl_WITH_MTRACE,adl_CHECK_MTRACE): New. (adl_CHECK_MALLOC,adl_CHECK_EFENCE): Cleanup. (adl_ENABLE_MEMDEBUG): Call adl_CHECK_MTRACE. * src/heroes.c (main): Call mtrace(). * src/system.h: Include mcheck.h if needed. 2001-01-10 Alexandre Duret-Lutz * NEWS: Update for version 0.8b. * m4/README: State the h-* files are Heroes specific. 2001-01-10 Alexandre Duret-Lutz * po/fr.po: Update. 2001-01-10 Alexandre Duret-Lutz * HACKING: Update. 2001-01-10 Alexandre Duret-Lutz * m4/mkdir.m4: Use #if instead of #ifdef. * m4/memdebug.m4: Likewise. 2001-01-09 Alexandre Duret-Lutz Distribute the html documentation. Check that Heroes can build with SDL and GGI before making a distribution. * Makefile.am (distcheck-hook, null_AM_MAKEFLAGS, t, my-distcheck-ggi, my-distcheck-sdl): New. * doc/Makefile.am (CLEANFILE): Rename as ... (EXTRA_DIST): ... this, to ship heroes.html. * m4/h-obsolete.m4: Remove test for with-sdl_mixer. 2001-01-09 Alexandre Duret-Lutz * m4/h-sdl.m4: Rename HAVE_SDL into HAVE_LIBSDL. * src/display.c: Likewise. * src/keyb.c: Likewise. * src/keys_heroes.h: Likewise. * src/system.h: Likewise. Also adapt #ifdef/#ifndef usage to follow autoconf recommendation (i.e. using #if). 2001-01-09 Alexandre Duret-Lutz * src/menus.c (draw_play_menu): Move arrows closer to the screen border to give more space to translations. 2001-01-08 Alexandre Duret-Lutz Rename HAVE_PKG_GGI as HAVE_LIBGGI, HAVE_PKG_GII as HAVE_LIBGII, HAVE_PKG_SDK_MIXER as HAVE_LIBSDL_MIXER, originally all these six macros were definied. * m4/checkpkg.m4: Use AC_CHECK_LIB's third argument to prvent definition of HAVE_LIBxxx. Define HAVE_LIBxxx instead of HAVE_PKGxxx, and provide a template help string for config.h. * m4/h-ggi.m4: Suppress AH_TEMPLATE call. * m4/h-joystick.m4: Likewise. * m4/h-sdlmixer.m4: Likewise. * src/display.c: Rename macros as stated above. * src/joystick.c: Likewise. * src/keyb.c: Likewise. * src/keys_heroes.h: Likewise. * src/system.h: Likewise. 2001-01-06 Alexandre Duret-Lutz * doc/heroes.texi (configure options): Describe --enable-devel. s/disable-debug/enable-debug/ s/disable-optimization/disable-optimizations/ * m4/devel.m4: New file. * configure.in: Call adl_ENABLE_DEVEL. 2001-01-04 Alexandre Duret-Lutz * man/Makefile.am (heroes.6): Be more verbose in game description. * src/argv.c (print_help): Change game description. 2001-01-03 Alexandre Duret-Lutz * po/Makefile.in.in (update-po): Merge po-files in temporary files in the build directory, and update the source directory only when the merged catalog differs from the original. This fix the know `make distcheck' failure due to `make update-po' being called on a read-only tree. 2001-01-02 Alexandre Duret-Lutz * doc/heroes.texi (configure options): Update to recent changes. * m4/debug.m4: Default to no. 2001-01-01 Alexandre Duret-Lutz Add files needed to cross compile and build a package for mingw32. * arch/mingw32/cross.sh: New file. * arch/mingw32/dest-readme-lib: New file. * arch/mingw32/dest-readme-txt: New file. * arch/mingw32/dest-run-bat: New file. * arch/Makefile.am (EXTRA_DIST): Add mingw32{cross.sh,dest-readme-txt,dest-readme-lib,dest-run-bat}. 2001-01-01 Alexandre Duret-Lutz * configure.in: Bump to 0.8b. Copyright 2001. 2001-01-01 Alexandre Duret-Lutz * NEWS: Update for 0.8a. * TODO: Update. * tools/Makefile.am (EXTRA_DIST): Typo. 2000-XX-XX Older entries belong to ChangeLog.00. heroes-0.21/GNUmakefile0000644004117000411500000000343307275443437010474 # This Makefile is used only if you run GNU make. # It includes `Makefile' so it usually make no difference, except # that we can add special maintainer rules here and rely # on GNU make features. # Systems where /bin/sh is not the default shell need this. The $(shell) # command below won't work with e.g. stock DOS/Windows shells. SHELL = /bin/sh have-Makefile := $(shell test -f Makefile && echo yes) have-configure := $(shell test -f configure && echo yes) ifneq ($(have-Makefile),yes) ifeq ($(have-configure),yes) # If there is a ./configure but no Makefile, give the user a diagnostic. all: @echo There seems to be no Makefile in this directory. @echo You must run ./configure before running make. @exit 1 else # no configure? try to create it. all: cvsboot endif AUTOGEN = autogen # Those target are already in Makefile.am, but they are # needed before Makefile.in can be generated. So we define # them here only if Makefile doesn't exist yet. THANKS: src/people.def src/people.tpl $(AUTOGEN) -L src -o 'thanks=THANKS' $< AUTHORS: src/people.def src/people.tpl $(AUTOGEN) -L src -o 'authors=AUTHORS' $< else include Makefile endif # This rule is already in src/Makefile.am, but added here # for convenience. Building src/people.c is needed before # tool/genpotfile.sh is run (by tools/cvsboot.sh). src/people.c: src/people.def src/people.tpl $(AUTOGEN) -L src -o 'c=src/people.c' $< # likewise src/debughash.gperf: src/debugchn.def src/debugchn.tpl $(AUTOGEN) -L src -o 'gperf=src/debughash.gperf' $< cvsboot: AUTHORS THANKS src/people.c src/debughash.gperf tools/cvsboot.sh -v .PHONY: all cvsboot # Tell version 3.79 and up of GNU make to not build goals in this # directory in parallel. This is necessary in case someone tries to # build multiple targets on one command line. .NOTPARALLEL: heroes-0.21/HACKING0000644004117000411500000003354507406064411007403 * This file This file attempts to give some hints to people whishing to contribute to Heroes. Questions or suggestions about this file can be sent to . * Developer tools used in Heroes Required to bootstrap a CVS checkout: autoconf 2.50 (from ftp.gnu.org) automake 1.4d (from sources.redhat.com/automake) autogen 5.2 (from autogen.sourceforge.net) gettext 0.10.38 (from alpha.gnu.org) gperf (from ftp.gnu.org) gnu make (from ftp.gnu.org) (numbers are *minimal* versions required) Optionally needed if you change some specific parts of the game: help2man (http://www.gnu.org/software/help2man/) texinfo (from ftp.gnu.org) zip (ftp://ftp.cdrom.com/pub/infozip/src/zip23.tar.gz) unzip (ftp://ftp.cdrom.com/pub/infozip/src/unzip540.tar.gz) Required to commit a patch if you have write access to the CVS server: cvs-utils (from subversions.gnu.org) * Translating message catalogs Heroes use gettext as internationalization library, and gettext come with a manual which is really worth reading. Translating Heroes' messages is not as straightforward as translating a console-based utility would be. In short, there are two kind of messages: those printed on the console (--help output, error messages,...), and those drawn during the game (menu entries, online help,...). The former cause no particular problem. The latter use home-made fonts (coming with the heroes-data package) and those fonts do not always implement the full Latin-1 character set. You ought to configure Heroes with --enable-debug. When configured like this, Heroes will check most messages at startup and report those who contains non-drawable characters. If you have done a new translation, want to try it, but don't want to install all the above tools (autoconf, automake, etc.), do the following: open the file `configure' in your favorite editor, locate the line starting with `ALL_LINGUAS=' and add your language here, then rerun configure and reinstall the game, your catalog should be installed with the others. Note that you will still need gettext installed. (For people who have the latest autoconf and automake, the correct way to add a new catalog is to edit the same line in configure.ac, of course). * Sending patches If you patched Heroes and want to have your patch included in a next release, please send it to . (This is a general discussion list, there is presently no list dedicated to patches.) * General coding conventions We try to follow the GNU standards (with some slight modifications as it will be noted below) and most of their guidelines are not repeated here. standards.info (available on every good GNU system) is a recommended reading. ** Formatting Look the code around to see how the code is formated. Basically this is the GNU formatting standard, except that braces are kept on the same line as the flow-control keywords, as in do { if (cond2) { /* ... */ } else if (cond3) { /* ... */ } else { /* ... */ } } while (cond1); The corresponding indent options are `-br' and `-ce'. ** Typenames Typenames used in Heroes code used to be suffixed by `_t'. Unfortunatelly, all such typenames (ending with `_t') are reserved by POSIX, and OS vendors usually add new types using this convention. Therefore using the same naming was not a really great idea: name clashes occured twice (`timer_t' happened to be already defined on NetBSD, `level_t' was defined on OSF) before I decide to use another convention. Typenames in Heroes now starts with a_ or an_ (e.g. `a_level', `an_option'). This idea came from http://gcc.gnu.org/ml/gcc/2001-06/msg01006.html. ** Includes Any .c-file should include "system.h" as the first included file. Read the beginning of system.h for more explanations. Any .h-file can assume system.h has already been included, but should include other local headers needed (e.g. type declaration used in function prototypes) so that inclusion order is not important. ** FIXME The keywords `FIXME:', `NOTE:', and `WARNING:' can be used to emphasis any comment in the sources. Try to make the important part of your comment fit on the same line of the keyword, such that `grep FIXME: *.[ch]' give a nice summary. ** ChangeLog Any change to a file that goes into the distribution should have a corresponding ChangeLog entry (verbosity is prefered). Removals in files BUGS and TODO or additions to THANKS can be implicit (i.e. without ChangeLog entries). ** RCS keywords Do not use them; they make mixing of files from different projects complicated. If you stole a file from another project which has such keywords, don't remove them, just "cvs add -ko" the file (-ko prevent future keywords substitution). Actually just "cvs add -ko" any file. * Files that should not be changed Some files are auto-generated, or maintained elsewhere and should therefore not be modified directly. ** Auto-generated files Files which will go into the distribution, but are not in the CVS because they can be generated from files already kept the CVS. aclocal.m4 (generated by aclocal from configure.ac and m4/*) configure (generated by autoconf from configure.ac) THANKS (generated by Makefile or GNUmakefile using autogen from src/people.{def,tpl}) THANKS (generated by Makefile or GNUmakefile using autogen from src/people.{def,tpl}) src/config.h.in (generated by autoheader from configure.ac and aclocal.m4) **/Makefile.in (generated by automake from configure.ac) arch/VisualC/VisualC.zip (generated by arch/Makefile using zip from arch/Visual/*) src/rsc_files_hash.c (generated by src/Makefile using gperf from src/rsc_files.gperf) src/debugchn.h (generated by src/Makefile using AutoGen from src/debugchn.{def,tpl}) src/debughash.gperf (generated by src/Makefile using AutoGen from src/debugchn.{def,tpl}) src/debughash.c (generated by src/Makefile using gperf from src/debughash.gperf) src/prefs.c (generated by src/Makefile using AutoGen from src/prefs.{def,tpl}) src/prefs.h (generated by src/Makefile using AutoGen from src/prefs.{def,tpl}) src/people.c (generated by src/Makefile using autogen from src/people.{def,tpl}) doc/heroes.info (generated by doc/Makefile using makeinfo from src/heroes.texi) doc/debugchn.info (generated by doc/Makefile using AutoGen from src/debugchn.{def,tpl}) man/heroes.6 (generated by man/Makefile using help2man from the Heroes binary) doc/people.texi (generated by doc/Makefile using autogen from src/people.{def,tpl}) po/POTFILES.in (generated by tools/genpotfiles.sh) m4/Makefile.inc (generated by tools/genm4mam.sh) ** Not generated, but added automatically by automake or gettextize ... and therefore not in CVS. automake adds these COPYING, INSTALL, tools/config.guess, tools/config.sub, tools/depcomp, tools/install-sh, tools/mdate-sh, tools/missing, tools/mkinstalldirs, tools/texinfo.tex gettextize adds all the files in intl/, as well as po/Makefile.in.in and ABOUT-NLS. ** Files in CVS, but maintained elsewhere Avoid any change to these files, if possible. (And report any change upstream, of course.) lib/alloca.c (from fetish) lib/basename.c (from fetish) lib/dirname.c (from fetish) lib/dirname.h (from fetish) lib/ftruncate.c (from fetish) lib/getopt.c (from glibc) lib/getopt1.c (from glibc) lib/gnugetopt.h (from glibc, where it is named getopt.h) lib/error.c (from glibc) lib/error.h (from glibc) lib/hash.c (from fetish) lib/hash.h (from fetish) lib/isdir.c (from fetish) lib/malloc.c (from fetish) lib/realloc.h (from fetish) lib/realloc.h (from fetish) lib/stpcpy.c (from fetish) lib/strcasecmp.c (from fetish) lib/stripslash.c (from fetish) lib/strndup.c (from glibc) lib/xalloc.c (from fetish) lib/xmalloc.c (from fetish) lib/xstrdup.c (from fetish) m4/dos.m4 (from fetish) m4/ftruncate.m4 (from fetish) m4/glibc21.m4 (from fetish) m4/gnu-source.m4 (from fetish) m4/malloc.m4 (from fetish) m4/realloc.m4 (from fetish) m4/strerror_r.m4 (from fetish) po/Makefile.in.in (from fetish) Jim Meyering is keeping all the above files up to date in his fetish tools (fileutils, textutils, or shellutils). The script tools/fetish-sync.sh can be used to upgrade all of them from the latest fetish release. m4/codeset.m4 (from gettext) m4/gettext.m4 (from gettext) m4/iconv.m4 (from gettext) m4/isc-posix.m4 (from gettext) m4/lcmessage.m4 (from gettext) m4/progtest.m4 (from gettext) These latter files come from the gettext package. Other files: lib/fstrcmp.c (from gettext, via libit) lib/fstrcmp.h (from gettext, via libit) lib/getshline.c (from a2ps) lib/getshline.h (from a2ps) lib/w_dirent.c (from mingw, originally dirent.c) lib/w_dirent.h (from mingw, originally dirent.h) ** Autogenerated, kept in CVS README: generated by the root Makefile from the Texinfo manual (when you run `make README' or `make dist'). It needs to be kept in CVS because it is checked out by the webpages' Makefile. * CVS ** Building from CVS As generated files are not all kept in CVS, you need to generate them after your first checkout. This is done by running GNU make. The first time you run make on your CVS checkout it will generate the file THANKS and AUTHORS, and then call the script tools/cvsboot.sh which will take care of generating the other missing file. After you have run cvsboot, you will be able to make a first build first build (./configure; make) to create the documentation and the other files generated by Makefile rules. cvsboot calls a few other commands you may want to use separately: tools/upgettext.sh: populate intl/, and install some other gettext files tools/autogen.sh: build autotools files (configure, */makefile.in, etc.) tools/genm4mam.sh: build m4/Makefile.am tools/genpotfiles.sh: build po/POTFILES.in All these commands shoud be run from the top level directory. ** Committing changes If you have write access to the CVS, you shall use clcommit to commit your patches (clcommit can be obtained from the cvs-tools modules of subversion.gnu.org CVS server). clcommit will use your ChangeLog entry as a commit message, and complain if you forgot to make a ChangeLog entry. ** Tracking other changes CVS commit are automatically sent as patches, to heroes-commits@lists.sourceforge.net. You can subscribe to this list using the following page. http://lists.sourceforge.net/mailman/listinfo/heroes-commits ** Committing patches from other people If there is no ChangeLog entry, write one (and add a "From " comment line) or ask the author to make one. Don't forget to put the author in THANKS. ** Bug fixes If you fix a bug reported by someone, add a "Reported by " line to your ChangeLog entry. Put him in THANKS too. ** Tag and branches The main trunk should remain the latest, bleeding edge, development version of the game. Releases are tagged using symbolic name such as heroes_0_5 (for heroes-0.5) or heroes_0_6b (for heroes-0.6b). After a public release there is usually an errata branch (e.g. heroes_0_6_errata) created, and rooted on the corresponding release version. This branch is for important bug fixes (e.g. bugs that prevent the game to compile or run). Every patch commited to that branch should be merged in the main trunk. * Design guidelines ** Console output There is four kinds of console messages in Heroes. a) warning messages, i.e., non fatal errors; output with wmsg() b) error messages, for fatal errors; output with emsg() c) debug messages, i.e. traces selected with the `-v' switches; output with dmsg(). d) standard messages; output with printf(), puts() or whatever. Groups a) and b) are printed to stderr because they are errors, while groups c) and d) are printed to stdin because they are answers to user requests (e.g. the output of --help goes to stdout because the user asked for it). As far i18n is concerned, the idea is to internationalize only what is worth to the user, and keep in english all messages destined to the developper. Therefore groups a), b), and d) are translated, while group c) is not. * Release process ** Before a public release - Update externally-maintained files - Update administrative files: + src/people.def (add new contributions if not already done) + NEWS, TODO, BUGS must be up to date - Set version number in configure.ac - run tools/cvsboot.sh and make a dummy build (to update the generated file to the new version) - build the distribution using `make distcheck' in addition to making a distribution, this will actually perform five builds of the game using differents configurations (so you need all supported libraries installed to do that) If the above was successful: - commit the changes to CVS - tag the repository (cvs tag heroes_xx_yy) - update the webpages (the repository needs to be tagged before) ** Where to upload SourceForge ftp://upload.sourceforge.net/incoming/ https://sourceforge.net/project/admin/editpackages.php?group_id=7982 MetaLab ftp://metalab.unc.edu/incoming/Linux/ ** Where to announce - mail: heroes-announce@lists.sourceforge.net games-announce@lists.sourceforge.net news@linuxgames.com (http://www.linuxgames.com/) sdl-announce@lokigames.com - news: comp.os.linux.applications (moderated) - web: http://freshmeat.net/projects/heroes/ http://www.linuxapps.com/?page=update&id=3154 http://happypenguin.org/show?Heroes https://sourceforge.net/news/submit.php?group_id=7982 Local Variables: mode: outline End: heroes-0.21/lib/0000777004117000411500000000000007451377042007243 5heroes-0.21/lib/Makefile.am0000644004117000411500000000254707404237313011215 # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 # # path for config.h and system.h INCLUDES = -I.. -I$(srcdir) -I../intl -I$(top_srcdir)/src noinst_LIBRARIES= libheroes.a # These files are always compiled libheroes_a_SOURCES= \ basename.c \ basename.h \ cast.c \ cast.h \ dirname.c \ dirname.h \ error.c \ error.h \ filelock.c \ filelock.h \ fstrcmp.c \ fstrcmp.h \ getshline.c \ getshline.h \ gnugetopt.h \ hash.c \ hash.h \ isdir.c \ isdir.h \ stripslash.c \ unlocked-io.h \ w_dirent.h \ xalloc.h \ xmalloc.c \ xstrdup.c \ xstrduplwr.c \ xstrduplwr.h # Additional files to compile, when functions are missing. libheroes_a_LIBADD = @LIBOBJS@ @ALLOCA@ heroes-0.21/lib/Makefile.in0000644004117000411500000003124307451373564011234 # Makefile.in generated by automake 1.6 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 # SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ ALLEGRO_H = @ALLEGRO_H@ AMTAR = @AMTAR@ AUTOGEN = @AUTOGEN@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ DATADIRNAME = @DATADIRNAME@ DEPDIR = @DEPDIR@ GENCAT = @GENCAT@ GGI_KEYBOARD_H = @GGI_KEYBOARD_H@ GLIBC21 = @GLIBC21@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GPERF = @GPERF@ HELP2MAN = @HELP2MAN@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LIBALT_LOCAL_XLDADD = @LIBALT_LOCAL_XLDADD@ LIBALT_XLDADD = @LIBALT_XLDADD@ LIBALT_XLDFLAGS = @LIBALT_XLDFLAGS@ LIBICONV = @LIBICONV@ LN_S = @LN_S@ MKINSTALLDIRS = @MKINSTALLDIRS@ MORE_WARNINGS_CFLAGS = @MORE_WARNINGS_CFLAGS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL_KEYSYM_H = @SDL_KEYSYM_H@ STRIP = @STRIP@ U = @U@ UNZIP = @UNZIP@ UP = @UP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ ZIP = @ZIP@ am__include = @am__include@ am__quote = @am__quote@ htmldir = @htmldir@ install_sh = @install_sh@ # path for config.h and system.h INCLUDES = -I.. -I$(srcdir) -I../intl -I$(top_srcdir)/src noinst_LIBRARIES = libheroes.a # These files are always compiled libheroes_a_SOURCES = \ basename.c \ basename.h \ cast.c \ cast.h \ dirname.c \ dirname.h \ error.c \ error.h \ filelock.c \ filelock.h \ fstrcmp.c \ fstrcmp.h \ getshline.c \ getshline.h \ gnugetopt.h \ hash.c \ hash.h \ isdir.c \ isdir.h \ stripslash.c \ unlocked-io.h \ w_dirent.h \ xalloc.h \ xmalloc.c \ xstrdup.c \ xstrduplwr.c \ xstrduplwr.h # Additional files to compile, when functions are missing. libheroes_a_LIBADD = @LIBOBJS@ @ALLOCA@ subdir = lib mkinstalldirs = $(SHELL) $(top_srcdir)/tools/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = LIBRARIES = $(noinst_LIBRARIES) libheroes_a_AR = $(AR) cru libheroes_a_DEPENDENCIES = @LIBOBJS@ @ALLOCA@ am_libheroes_a_OBJECTS = basename.$(OBJEXT) cast.$(OBJEXT) \ dirname.$(OBJEXT) error.$(OBJEXT) filelock.$(OBJEXT) \ fstrcmp.$(OBJEXT) getshline.$(OBJEXT) hash.$(OBJEXT) \ isdir.$(OBJEXT) stripslash.$(OBJEXT) xmalloc.$(OBJEXT) \ xstrdup.$(OBJEXT) xstrduplwr.$(OBJEXT) libheroes_a_OBJECTS = $(am_libheroes_a_OBJECTS) DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/tools/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = $(DEPDIR)/alloca.Po $(DEPDIR)/ftruncate.Po \ @AMDEP_TRUE@ $(DEPDIR)/getopt.Po $(DEPDIR)/getopt1.Po \ @AMDEP_TRUE@ $(DEPDIR)/malloc.Po $(DEPDIR)/memrchr.Po \ @AMDEP_TRUE@ $(DEPDIR)/realloc.Po $(DEPDIR)/stpcpy.Po \ @AMDEP_TRUE@ $(DEPDIR)/strcasecmp.Po $(DEPDIR)/strndup.Po \ @AMDEP_TRUE@ $(DEPDIR)/w_dirent.Po ./$(DEPDIR)/basename.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/cast.Po ./$(DEPDIR)/dirname.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/error.Po ./$(DEPDIR)/filelock.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/fstrcmp.Po ./$(DEPDIR)/getshline.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/hash.Po ./$(DEPDIR)/isdir.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/stripslash.Po ./$(DEPDIR)/xmalloc.Po \ @AMDEP_TRUE@ ./$(DEPDIR)/xstrdup.Po ./$(DEPDIR)/xstrduplwr.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(libheroes_a_SOURCES) DIST_COMMON = Makefile.am Makefile.in alloca.c ftruncate.c getopt.c \ getopt1.c malloc.c memrchr.c realloc.c stpcpy.c strcasecmp.c \ strndup.c w_dirent.c SOURCES = $(libheroes_a_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu lib/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) AR = ar clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libheroes.a: $(libheroes_a_OBJECTS) $(libheroes_a_DEPENDENCIES) -rm -f libheroes.a $(libheroes_a_AR) libheroes.a $(libheroes_a_OBJECTS) $(libheroes_a_LIBADD) $(RANLIB) libheroes.a mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/ftruncate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/malloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memrchr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/realloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/stpcpy.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strndup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/w_dirent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cast.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filelock.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstrcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getshline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrdup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrduplwr.Po@am__quote@ distclean-depend: -rm -rf $(DEPDIR) ./$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` CCDEPMODE = @CCDEPMODE@ uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir)$$dir \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* 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 distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic uninstall-am: uninstall-info-am .PHONY: GTAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES distclean distclean-compile \ distclean-depend distclean-generic distclean-tags distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: heroes-0.21/lib/alloca.c0000644004117000411500000003406307353601452010560 /* alloca.c -- allocate automatically reclaimed memory (Mostly) portable public-domain implementation -- D A Gwyn This implementation of the PWB library alloca function, which is used to allocate space off the run-time stack so that it is automatically reclaimed upon procedure exit, was inspired by discussions with J. Q. Johnson of Cornell. J.Otto Tennant contributed the Cray support. There are some preprocessor constants that can be defined when compiling for your specific system, for improved efficiency; however, the defaults should be okay. The general concept of this implementation is to keep track of all alloca-allocated blocks, and reclaim any that are found to be deeper in the stack than the current invocation. This heuristic does not reclaim storage as soon as it becomes invalid, but it will do so eventually. As a special case, alloca(0) reclaims storage without allocating any. It is a good idea to use alloca(0) in your main control loop, etc. to force garbage collection. */ #ifdef HAVE_CONFIG_H # include #endif #if HAVE_STRING_H # include #endif #if HAVE_STDLIB_H # include #endif #ifdef emacs # include "blockinput.h" #endif /* If compiling with GCC 2, this file's not needed. */ #if !defined (__GNUC__) || __GNUC__ < 2 /* If someone has defined alloca as a macro, there must be some other way alloca is supposed to work. */ # ifndef alloca # ifdef emacs # ifdef static /* actually, only want this if static is defined as "" -- this is for usg, in which emacs must undefine static in order to make unexec workable */ # ifndef STACK_DIRECTION you lose -- must know STACK_DIRECTION at compile-time # endif /* STACK_DIRECTION undefined */ # endif /* static */ # endif /* emacs */ /* If your stack is a linked list of frames, you have to provide an "address metric" ADDRESS_FUNCTION macro. */ # if defined (CRAY) && defined (CRAY_STACKSEG_END) long i00afunc (); # define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg)) # else # define ADDRESS_FUNCTION(arg) &(arg) # endif # if __STDC__ typedef void *pointer; # else typedef char *pointer; # endif # ifndef NULL # define NULL 0 # endif /* Different portions of Emacs need to call different versions of malloc. The Emacs executable needs alloca to call xmalloc, because ordinary malloc isn't protected from input signals. On the other hand, the utilities in lib-src need alloca to call malloc; some of them are very simple, and don't have an xmalloc routine. Non-Emacs programs expect this to call xmalloc. Callers below should use malloc. */ # ifndef emacs # undef malloc # define malloc xmalloc # endif extern pointer malloc (); /* Define STACK_DIRECTION if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ # ifndef STACK_DIRECTION # define STACK_DIRECTION 0 /* Direction unknown. */ # endif # if STACK_DIRECTION != 0 # define STACK_DIR STACK_DIRECTION /* Known at compile-time. */ # else /* STACK_DIRECTION == 0; need run-time code. */ static int stack_dir; /* 1 or -1 once known. */ # define STACK_DIR stack_dir static void find_stack_direction () { static char *addr = NULL; /* Address of first `dummy', once known. */ auto char dummy; /* To get stack address. */ if (addr == NULL) { /* Initial entry. */ addr = ADDRESS_FUNCTION (dummy); find_stack_direction (); /* Recurse once. */ } else { /* Second entry. */ if (ADDRESS_FUNCTION (dummy) > addr) stack_dir = 1; /* Stack grew upward. */ else stack_dir = -1; /* Stack grew downward. */ } } # endif /* STACK_DIRECTION == 0 */ /* An "alloca header" is used to: (a) chain together all alloca'ed blocks; (b) keep track of stack depth. It is very important that sizeof(header) agree with malloc alignment chunk size. The following default should work okay. */ # ifndef ALIGN_SIZE # define ALIGN_SIZE sizeof(double) # endif typedef union hdr { char align[ALIGN_SIZE]; /* To force sizeof(header). */ struct { union hdr *next; /* For chaining headers. */ char *deep; /* For stack depth measure. */ } h; } header; static header *last_alloca_header = NULL; /* -> last alloca header. */ /* Return a pointer to at least SIZE bytes of storage, which will be automatically reclaimed upon exit from the procedure that called alloca. Originally, this space was supposed to be taken from the current stack frame of the caller, but that method cannot be made to work for some implementations of C, for example under Gould's UTX/32. */ pointer alloca (size_t size) { auto char probe; /* Probes stack depth: */ register char *depth = ADDRESS_FUNCTION (probe); # if STACK_DIRECTION == 0 if (STACK_DIR == 0) /* Unknown growth direction. */ find_stack_direction (); # endif /* Reclaim garbage, defined as all alloca'd storage that was allocated from deeper in the stack than currently. */ { register header *hp; /* Traverses linked list. */ # ifdef emacs BLOCK_INPUT; # endif for (hp = last_alloca_header; hp != NULL;) if ((STACK_DIR > 0 && hp->h.deep > depth) || (STACK_DIR < 0 && hp->h.deep < depth)) { register header *np = hp->h.next; free ((pointer) hp); /* Collect garbage. */ hp = np; /* -> next header. */ } else break; /* Rest are not deeper. */ last_alloca_header = hp; /* -> last valid storage. */ # ifdef emacs UNBLOCK_INPUT; # endif } if (size == 0) return NULL; /* No allocation required. */ /* Allocate combined header + user data storage. */ { register pointer new = malloc (sizeof (header) + size); /* Address of header. */ if (new == 0) abort(); ((header *) new)->h.next = last_alloca_header; ((header *) new)->h.deep = depth; last_alloca_header = (header *) new; /* User storage begins just after header. */ return (pointer) ((char *) new + sizeof (header)); } } # if defined (CRAY) && defined (CRAY_STACKSEG_END) # ifdef DEBUG_I00AFUNC # include # endif # ifndef CRAY_STACK # define CRAY_STACK # ifndef CRAY2 /* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */ struct stack_control_header { long shgrow:32; /* Number of times stack has grown. */ long shaseg:32; /* Size of increments to stack. */ long shhwm:32; /* High water mark of stack. */ long shsize:32; /* Current size of stack (all segments). */ }; /* The stack segment linkage control information occurs at the high-address end of a stack segment. (The stack grows from low addresses to high addresses.) The initial part of the stack segment linkage control information is 0200 (octal) words. This provides for register storage for the routine which overflows the stack. */ struct stack_segment_linkage { long ss[0200]; /* 0200 overflow words. */ long sssize:32; /* Number of words in this segment. */ long ssbase:32; /* Offset to stack base. */ long:32; long sspseg:32; /* Offset to linkage control of previous segment of stack. */ long:32; long sstcpt:32; /* Pointer to task common address block. */ long sscsnm; /* Private control structure number for microtasking. */ long ssusr1; /* Reserved for user. */ long ssusr2; /* Reserved for user. */ long sstpid; /* Process ID for pid based multi-tasking. */ long ssgvup; /* Pointer to multitasking thread giveup. */ long sscray[7]; /* Reserved for Cray Research. */ long ssa0; long ssa1; long ssa2; long ssa3; long ssa4; long ssa5; long ssa6; long ssa7; long sss0; long sss1; long sss2; long sss3; long sss4; long sss5; long sss6; long sss7; }; # else /* CRAY2 */ /* The following structure defines the vector of words returned by the STKSTAT library routine. */ struct stk_stat { long now; /* Current total stack size. */ long maxc; /* Amount of contiguous space which would be required to satisfy the maximum stack demand to date. */ long high_water; /* Stack high-water mark. */ long overflows; /* Number of stack overflow ($STKOFEN) calls. */ long hits; /* Number of internal buffer hits. */ long extends; /* Number of block extensions. */ long stko_mallocs; /* Block allocations by $STKOFEN. */ long underflows; /* Number of stack underflow calls ($STKRETN). */ long stko_free; /* Number of deallocations by $STKRETN. */ long stkm_free; /* Number of deallocations by $STKMRET. */ long segments; /* Current number of stack segments. */ long maxs; /* Maximum number of stack segments so far. */ long pad_size; /* Stack pad size. */ long current_address; /* Current stack segment address. */ long current_size; /* Current stack segment size. This number is actually corrupted by STKSTAT to include the fifteen word trailer area. */ long initial_address; /* Address of initial segment. */ long initial_size; /* Size of initial segment. */ }; /* The following structure describes the data structure which trails any stack segment. I think that the description in 'asdef' is out of date. I only describe the parts that I am sure about. */ struct stk_trailer { long this_address; /* Address of this block. */ long this_size; /* Size of this block (does not include this trailer). */ long unknown2; long unknown3; long link; /* Address of trailer block of previous segment. */ long unknown5; long unknown6; long unknown7; long unknown8; long unknown9; long unknown10; long unknown11; long unknown12; long unknown13; long unknown14; }; # endif /* CRAY2 */ # endif /* not CRAY_STACK */ # ifdef CRAY2 /* Determine a "stack measure" for an arbitrary ADDRESS. I doubt that "lint" will like this much. */ static long i00afunc (long *address) { struct stk_stat status; struct stk_trailer *trailer; long *block, size; long result = 0; /* We want to iterate through all of the segments. The first step is to get the stack status structure. We could do this more quickly and more directly, perhaps, by referencing the $LM00 common block, but I know that this works. */ STKSTAT (&status); /* Set up the iteration. */ trailer = (struct stk_trailer *) (status.current_address + status.current_size - 15); /* There must be at least one stack segment. Therefore it is a fatal error if "trailer" is null. */ if (trailer == 0) abort (); /* Discard segments that do not contain our argument address. */ while (trailer != 0) { block = (long *) trailer->this_address; size = trailer->this_size; if (block == 0 || size == 0) abort (); trailer = (struct stk_trailer *) trailer->link; if ((block <= address) && (address < (block + size))) break; } /* Set the result to the offset in this segment and add the sizes of all predecessor segments. */ result = address - block; if (trailer == 0) { return result; } do { if (trailer->this_size <= 0) abort (); result += trailer->this_size; trailer = (struct stk_trailer *) trailer->link; } while (trailer != 0); /* We are done. Note that if you present a bogus address (one not in any segment), you will get a different number back, formed from subtracting the address of the first block. This is probably not what you want. */ return (result); } # else /* not CRAY2 */ /* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP. Determine the number of the cell within the stack, given the address of the cell. The purpose of this routine is to linearize, in some sense, stack addresses for alloca. */ static long i00afunc (long address) { long stkl = 0; long size, pseg, this_segment, stack; long result = 0; struct stack_segment_linkage *ssptr; /* Register B67 contains the address of the end of the current stack segment. If you (as a subprogram) store your registers on the stack and find that you are past the contents of B67, you have overflowed the segment. B67 also points to the stack segment linkage control area, which is what we are really interested in. */ stkl = CRAY_STACKSEG_END (); ssptr = (struct stack_segment_linkage *) stkl; /* If one subtracts 'size' from the end of the segment, one has the address of the first word of the segment. If this is not the first segment, 'pseg' will be nonzero. */ pseg = ssptr->sspseg; size = ssptr->sssize; this_segment = stkl - size; /* It is possible that calling this routine itself caused a stack overflow. Discard stack segments which do not contain the target address. */ while (!(this_segment <= address && address <= stkl)) { # ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl); # endif if (pseg == 0) break; stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; this_segment = stkl - size; } result = address - this_segment; /* If you subtract pseg from the current end of the stack, you get the address of the previous stack segment's end. This seems a little convoluted to me, but I'll bet you save a cycle somewhere. */ while (pseg != 0) { # ifdef DEBUG_I00AFUNC fprintf (stderr, "%011o %011o\n", pseg, size); # endif stkl = stkl - pseg; ssptr = (struct stack_segment_linkage *) stkl; size = ssptr->sssize; pseg = ssptr->sspseg; result += size; } return (result); } # endif /* not CRAY2 */ # endif /* CRAY */ # endif /* no alloca */ #endif /* not GCC version 2 */ heroes-0.21/lib/ftruncate.c0000644004117000411500000000321407257574244011325 /* ftruncate emulations that work on some System V's. This file is in the public domain. */ #if HAVE_CONFIG_H # include #endif #include #include #ifdef F_CHSIZE int ftruncate (int fd, off_t length) { return fcntl (fd, F_CHSIZE, length); } #else /* not F_CHSIZE */ # ifdef F_FREESP /* By William Kucharski . */ # include # include # if HAVE_UNISTD_H # include # endif int ftruncate (int fd, off_t length) { struct flock fl; struct stat filebuf; if (fstat (fd, &filebuf) < 0) return -1; if (filebuf.st_size < length) { /* Extend file length. */ if (lseek (fd, (length - 1), SEEK_SET) < 0) return -1; /* Write a "0" byte. */ if (write (fd, "", 1) != 1) return -1; } else { /* Truncate length. */ fl.l_whence = 0; fl.l_len = 0; fl.l_start = length; fl.l_type = F_WRLCK; /* write lock on file space */ /* This relies on the *undocumented* F_FREESP argument to fcntl, which truncates the file so that it ends at the position indicated by fl.l_start. Will minor miracles never cease? */ if (fcntl (fd, F_FREESP, &fl) < 0) return -1; } return 0; } # else /* not F_CHSIZE nor F_FREESP */ # if HAVE_CHSIZE int ftruncate (int fd, off_t length) { return chsize (fd, length); } # else /* not F_CHSIZE nor F_FREESP nor HAVE_CHSIZE */ # include # ifndef errno extern int errno; # endif int ftruncate (int fd, off_t length) { errno = EIO; return -1; } # endif /* not HAVE_CHSIZE */ # endif /* not F_FREESP */ #endif /* not F_CHSIZE */ heroes-0.21/lib/getopt.c0000644004117000411500000007357007375270046010642 /* Getopt for GNU. NOTE: getopt is now part of the C library, so if you don't know what "Keep this file name-space clean" means, talk to drepper@gnu.org before changing it! Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO # define _NO_PROTO #endif #ifdef HAVE_CONFIG_H # include #endif #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ # ifndef const # define const # endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 # include # if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION # define ELIDE_CODE # endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ /* Don't include stdlib.h for non-GNU C libraries because some of them contain conflicting prototypes for getopt. */ # include # include #endif /* GNU C library. */ #ifdef VMS # include # if HAVE_STRING_H - 0 # include # endif #endif #ifndef _ /* This is for other GNU distributions with internationalized messages. */ # if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC # include # ifndef _ # define _(msgid) gettext (msgid) # endif # else # define _(msgid) (msgid) # endif #endif /* This version of `getopt' appears to the caller like standard Unix `getopt' but it behaves differently for the user, since it allows the user to intersperse the options with the other arguments. As `getopt' works, it permutes the elements of ARGV so that, when it is done, all the options precede everything else. Thus all application programs are extended to handle flexible argument order. Setting the environment variable POSIXLY_CORRECT disables permutation. Then the behavior is completely standard. GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ #include "getopt.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ /* 1003.2 says this must be 1 before any call. */ int optind = 1; /* Formerly, initialization of getopt depended on optind==0, which causes problems with re-calling getopt as programs generally don't know that. */ int __getopt_initialized; /* The next char to be scanned in the option-element in which the last option character we returned was found. This allows us to pick up the scan where we left off. If this is zero, or a null string, it means resume the scan by advancing to the next ARGV-element. */ static char *nextchar; /* Callers store zero here to inhibit the error message for unrecognized options. */ int opterr = 1; /* Set to an option character which was unrecognized. This must be initialized on some systems to avoid linking in the system's own getopt implementation. */ int optopt = '?'; /* Describe how to deal with options that follow non-option ARGV-elements. If the caller did not specify anything, the default is REQUIRE_ORDER if the environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. REQUIRE_ORDER means don't recognize them as options; stop option processing when the first non-option is seen. This is what Unix does. This mode of operation is selected by either setting the environment variable POSIXLY_CORRECT, or using `+' as the first character of the list of option characters. PERMUTE is the default. We permute the contents of ARGV as we scan, so that eventually all the non-options are at the end. This allows options to be given in any order, even with programs that were not written to expect this. RETURN_IN_ORDER is an option available to programs that were written to expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. Using `-' as the first character of the list of option characters selects this mode of operation. The special argument `--' forces an end of option-scanning regardless of the value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause `getopt' to return -1 with `optind' != ARGC. */ static enum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER } ordering; /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. On some systems, it contains special magic macros that don't work in GCC. */ # include # define my_index strchr #else # if HAVE_STRING_H # include # else # include # endif /* Avoid depending on library functions or files whose names are inconsistent. */ #ifndef getenv extern char *getenv (); #endif static char * my_index (str, chr) const char *str; int chr; { while (*str) { if (*str == chr) return (char *) str; str++; } return 0; } /* If using GCC, we can safely declare strlen this way. If not using GCC, it is ok not to declare it. */ #ifdef __GNUC__ /* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. That was relevant to code that was here before. */ # if (!defined __STDC__ || !__STDC__) && !defined strlen /* gcc with -traditional declares the built-in strlen to return int, and has done so at least since version 2.4.5. -- rms. */ extern int strlen (const char *); # endif /* not __STDC__ */ #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have been skipped. `first_nonopt' is the index in ARGV of the first of them; `last_nonopt' is the index after the last of them. */ static int first_nonopt; static int last_nonopt; #ifdef _LIBC /* Bash 2.0 gives us an environment variable containing flags indicating ARGV elements that should not be considered arguments. */ #ifdef USE_NONOPTION_FLAGS /* Defined in getopt_init.c */ extern char *__getopt_nonoption_flags; static int nonoption_flags_max_len; static int nonoption_flags_len; #endif static int original_argc; static char *const *original_argv; /* Make sure the environment variable bash 2.0 puts in the environment is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ original_argc = argc; original_argv = argv; } # ifdef text_set_element text_set_element (__libc_subinit, store_args_and_env); # endif /* text_set_element */ # ifdef USE_NONOPTION_FLAGS # define SWAP_FLAGS(ch1, ch2) \ if (nonoption_flags_len > 0) \ { \ char __tmp = __getopt_nonoption_flags[ch1]; \ __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ __getopt_nonoption_flags[ch2] = __tmp; \ } # else # define SWAP_FLAGS(ch1, ch2) # endif #else /* !_LIBC */ # define SWAP_FLAGS(ch1, ch2) #endif /* _LIBC */ /* Exchange two adjacent subsequences of ARGV. One subsequence is elements [first_nonopt,last_nonopt) which contains all the non-options that have been skipped so far. The other is elements [last_nonopt,optind), which contains all the options processed since those non-options were skipped. `first_nonopt' and `last_nonopt' are relocated so that they describe the new indices of the non-options in ARGV after they are moved. */ #if defined __STDC__ && __STDC__ static void exchange (char **); #endif static void exchange (argv) char **argv; { int bottom = first_nonopt; int middle = last_nonopt; int top = optind; char *tem; /* Exchange the shorter segment with the far end of the longer segment. That puts the shorter segment into the right place. It leaves the longer segment in the right place overall, but it consists of two parts that need to be swapped next. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS /* First make sure the handling of the `__getopt_nonoption_flags' string can work normally. Our top argument must be in the range of the string. */ if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len) { /* We must extend the array. The user plays games with us and presents new arguments. */ char *new_str = malloc (top + 1); if (new_str == NULL) nonoption_flags_len = nonoption_flags_max_len = 0; else { memset (__mempcpy (new_str, __getopt_nonoption_flags, nonoption_flags_max_len), '\0', top + 1 - nonoption_flags_max_len); nonoption_flags_max_len = top + 1; __getopt_nonoption_flags = new_str; } } #endif while (top > middle && middle > bottom) { if (top - middle > middle - bottom) { /* Bottom segment is the short one. */ int len = middle - bottom; register int i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[top - (middle - bottom) + i]; argv[top - (middle - bottom) + i] = tem; SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); } /* Exclude the moved bottom segment from further swapping. */ top -= len; } else { /* Top segment is the short one. */ int len = top - middle; register int i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++) { tem = argv[bottom + i]; argv[bottom + i] = argv[middle + i]; argv[middle + i] = tem; SWAP_FLAGS (bottom + i, middle + i); } /* Exclude the moved top segment from further swapping. */ bottom += len; } } /* Update records for the slots the non-options now occupy. */ first_nonopt += (optind - last_nonopt); last_nonopt = optind; } /* Initialize the internal data when the first call is made. */ #if defined __STDC__ && __STDC__ static const char *_getopt_initialize (int, char *const *, const char *); #endif static const char * _getopt_initialize (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { /* Start processing options with ARGV-element 1 (since ARGV-element 0 is the program name); the sequence of previously skipped non-option ARGV-elements is empty. */ first_nonopt = last_nonopt = optind; nextchar = NULL; posixly_correct = getenv ("POSIXLY_CORRECT"); /* Determine how to handle the ordering of options and nonoptions. */ if (optstring[0] == '-') { ordering = RETURN_IN_ORDER; ++optstring; } else if (optstring[0] == '+') { ordering = REQUIRE_ORDER; ++optstring; } else if (posixly_correct != NULL) ordering = REQUIRE_ORDER; else ordering = PERMUTE; #if defined _LIBC && defined USE_NONOPTION_FLAGS if (posixly_correct == NULL && argc == original_argc && argv == original_argv) { if (nonoption_flags_max_len == 0) { if (__getopt_nonoption_flags == NULL || __getopt_nonoption_flags[0] == '\0') nonoption_flags_max_len = -1; else { const char *orig_str = __getopt_nonoption_flags; int len = nonoption_flags_max_len = strlen (orig_str); if (nonoption_flags_max_len < argc) nonoption_flags_max_len = argc; __getopt_nonoption_flags = (char *) malloc (nonoption_flags_max_len); if (__getopt_nonoption_flags == NULL) nonoption_flags_max_len = -1; else memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), '\0', nonoption_flags_max_len - len); } } nonoption_flags_len = nonoption_flags_max_len; } else nonoption_flags_len = 0; #endif return optstring; } /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. If an element of ARGV starts with '-', and is not exactly "-" or "--", then it is an option element. The characters of this element (aside from the initial '-') are option characters. If `getopt' is called repeatedly, it returns successively each of the option characters from each of the option elements. If `getopt' finds another option character, it returns that character, updating `optind' and `nextchar' so that the next call to `getopt' can resume the scan with the following option character or ARGV-element. If there are no more option characters, `getopt' returns -1. Then `optind' is the index in ARGV of the first ARGV-element that is not an option. (The ARGV-elements have been permuted so that those that are not options now come last.) OPTSTRING is a string containing the legitimate option characters. If an option character is seen that is not listed in OPTSTRING, return '?' after printing an error message. If you set `opterr' to zero, the error message is suppressed but we still return '?'. If a char in OPTSTRING is followed by a colon, that means it wants an arg, so the following text in the same ARGV-element, or the text of the following ARGV-element, is returned in `optarg'. Two colons mean an option that wants an optional arg; if there is text in the current ARGV-element, it is returned in `optarg', otherwise `optarg' is set to zero. If OPTSTRING starts with `-' or `+', it requests different methods of handling the non-option ARGV-elements. See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. Long-named options begin with `--' instead of `-'. Their names may be abbreviated as long as the abbreviation is unique or is an exact match for some defined option. If they have an argument, it follows the option name in the same ARGV-element, separated from the option name by a `=', or else the in next ARGV-element. When `getopt' finds a long-named option, it returns 0 if that option's `flag' field is nonzero, the value of the option's `val' field if the `flag' field is zero. The elements of ARGV aren't really const, because we permute them. But we pretend they're const in the prototype to be compatible with other systems. LONGOPTS is a vector of `struct option' terminated by an element containing a name which is zero. LONGIND returns the index in LONGOPT of the long-named option found. It is only valid when a long-named option has been found by the most recent call. If LONG_ONLY is nonzero, '-' as well as '--' can introduce long-named options. */ int _getopt_internal (argc, argv, optstring, longopts, longind, long_only) int argc; char *const *argv; const char *optstring; const struct option *longopts; int *longind; int long_only; { int print_errors = opterr; if (optstring[0] == ':') print_errors = 0; if (argc < 1) return -1; optarg = NULL; if (optind == 0 || !__getopt_initialized) { if (optind == 0) optind = 1; /* Don't scan ARGV[0], the program name. */ optstring = _getopt_initialize (argc, argv, optstring); __getopt_initialized = 1; } /* Test whether ARGV[optind] points to a non-option argument. Either it does not have option syntax, or there is an environment flag from the shell indicating it is not an option. The later information is only used when the used in the GNU libc. */ #if defined _LIBC && defined USE_NONOPTION_FLAGS # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \ || (optind < nonoption_flags_len \ && __getopt_nonoption_flags[optind] == '1')) #else # define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0') #endif if (nextchar == NULL || *nextchar == '\0') { /* Advance to the next ARGV-element. */ /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been moved back by the user (who may also have changed the arguments). */ if (last_nonopt > optind) last_nonopt = optind; if (first_nonopt > optind) first_nonopt = optind; if (ordering == PERMUTE) { /* If we have just processed some options following some non-options, exchange them so that the options come first. */ if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (last_nonopt != optind) first_nonopt = optind; /* Skip any additional non-options and extend the range of non-options previously skipped. */ while (optind < argc && NONOPTION_P) optind++; last_nonopt = optind; } /* The special ARGV-element `--' means premature end of options. Skip it like a null option, then exchange with previous non-options as if it were an option, then skip everything else like a non-option. */ if (optind != argc && !strcmp (argv[optind], "--")) { optind++; if (first_nonopt != last_nonopt && last_nonopt != optind) exchange ((char **) argv); else if (first_nonopt == last_nonopt) first_nonopt = optind; last_nonopt = argc; optind = argc; } /* If we have done all the ARGV-elements, stop the scan and back over any non-options that we skipped and permuted. */ if (optind == argc) { /* Set the next-arg-index to point at the non-options that we previously skipped, so the caller will digest them. */ if (first_nonopt != last_nonopt) optind = first_nonopt; return -1; } /* If we have come to a non-option and did not permute it, either stop the scan or describe it to the caller and pass it by. */ if (NONOPTION_P) { if (ordering == REQUIRE_ORDER) return -1; optarg = argv[optind++]; return 1; } /* We have found another option-ARGV-element. Skip the initial punctuation. */ nextchar = (argv[optind] + 1 + (longopts != NULL && argv[optind][1] == '-')); } /* Decode the current option-ARGV-element. */ /* Check whether the ARGV-element is a long option. If long_only and the ARGV-element has the form "-f", where f is a valid short option, don't consider it an abbreviated form of a long option that starts with f. Otherwise there would be no way to give the -f short option. On the other hand, if there's a long option "fubar" and the ARGV-element is "-fu", do consider that an abbreviation of the long option, just like "--fu", and not "-f" with arg "u". This distinction seems to be the most useful approach. */ if (longopts != NULL && (argv[optind][1] == '-' || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = -1; int option_index; for (nameend = nextchar; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == (unsigned int) strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else if (long_only || pfound->has_arg != p->has_arg || pfound->flag != p->flag || pfound->val != p->val) /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; optopt = 0; return '?'; } if (pfound != NULL) { option_index = indfound; optind++; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) { if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, _("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, _("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } nextchar += strlen (nextchar); optopt = pfound->val; return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); optopt = pfound->val; return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } /* Can't find it as a long option. If this is not getopt_long_only, or the option starts with '--' or is not a valid short option, then it's an error. Otherwise interpret it as a short option. */ if (!long_only || argv[optind][1] == '-' || my_index (optstring, *nextchar) == NULL) { if (print_errors) { if (argv[optind][1] == '-') /* --option */ fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[optind][0], nextchar); } nextchar = (char *) ""; optind++; optopt = 0; return '?'; } } /* Look at and handle the next short option-character. */ { char c = *nextchar++; char *temp = my_index (optstring, c); /* Increment `optind' when we start to process its last character. */ if (*nextchar == '\0') ++optind; if (temp == NULL || c == ':') { if (print_errors) { if (posixly_correct) /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; } /* Convenience. Treat POSIX -W foo same as long option --foo */ if (temp[0] == 'W' && temp[1] == ';') { char *nameend; const struct option *p; const struct option *pfound = NULL; int exact = 0; int ambig = 0; int indfound = 0; int option_index; /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; return c; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; /* optarg is now the argument, see if it's in the table of longopts. */ for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) /* Do nothing. */ ; /* Test all long options for either exact match or abbreviated matches. */ for (p = longopts, option_index = 0; p->name; p++, option_index++) if (!strncmp (p->name, nextchar, nameend - nextchar)) { if ((unsigned int) (nameend - nextchar) == strlen (p->name)) { /* Exact match found. */ pfound = p; indfound = option_index; exact = 1; break; } else if (pfound == NULL) { /* First nonexact match found. */ pfound = p; indfound = option_index; } else /* Second or later nonexact match found. */ ambig = 1; } if (ambig && !exact) { if (print_errors) fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[optind]); nextchar += strlen (nextchar); optind++; return '?'; } if (pfound != NULL) { option_index = indfound; if (*nameend) { /* Don't test has_arg with >, because some C compilers don't allow it to be used on enums. */ if (pfound->has_arg) optarg = nameend + 1; else { if (print_errors) fprintf (stderr, _("\ %s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; } } else if (pfound->has_arg == 1) { if (optind < argc) optarg = argv[optind++]; else { if (print_errors) fprintf (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[optind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; } } nextchar += strlen (nextchar); if (longind != NULL) *longind = option_index; if (pfound->flag) { *(pfound->flag) = pfound->val; return 0; } return pfound->val; } nextchar = NULL; return 'W'; /* Let the application handle it. */ } if (temp[1] == ':') { if (temp[2] == ':') { /* This is an option that accepts an argument optionally. */ if (*nextchar != '\0') { optarg = nextchar; optind++; } else optarg = NULL; nextchar = NULL; } else { /* This is an option that requires an argument. */ if (*nextchar != '\0') { optarg = nextchar; /* If we end this ARGV-element by taking the rest as an arg, we must advance to the next element now. */ optind++; } else if (optind == argc) { if (print_errors) { /* 1003.2 specifies the format of this message. */ fprintf (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } optopt = c; if (optstring[0] == ':') c = ':'; else c = '?'; } else /* We already incremented `optind' once; increment it again when taking next ARGV-elt as argument. */ optarg = argv[optind++]; nextchar = NULL; } } return c; } } int getopt (argc, argv, optstring) int argc; char *const *argv; const char *optstring; { return _getopt_internal (argc, argv, optstring, (const struct option *) 0, (int *) 0, 0); } #endif /* Not ELIDE_CODE. */ #ifdef TEST /* Compile with -DTEST to make an executable for use in testing the above definition of `getopt'. */ int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; c = getopt (argc, argv, "abc:d:0123456789"); if (c == -1) break; switch (c) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ heroes-0.21/lib/getopt1.c0000644004117000411500000001065007353601452010704 /* getopt_long and getopt_long_only entry points for GNU getopt. Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifdef HAVE_CONFIG_H #include #endif #include "getopt.h" #if !defined __STDC__ || !__STDC__ /* This is a separate conditional since some stdc systems reject `defined (const)'. */ #ifndef const #define const #endif #endif #include /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling and linking in this code is a waste when using the GNU C library (especially if it is a shared library). Rather than having every GNU program understand `configure --with-gnu-libc' and omit the object files, it is simpler to just do this in the source for each such file. */ #define GETOPT_INTERFACE_VERSION 2 #if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2 #include #if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION #define ELIDE_CODE #endif #endif #ifndef ELIDE_CODE /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ #include #endif #ifndef NULL #define NULL 0 #endif int getopt_long (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 0); } /* Like getopt_long, but '-' as well as '--' can indicate a long option. If an option that starts with '-' (not '--') doesn't match a long option, but does match a short option, it is parsed as a short option instead. */ int getopt_long_only (argc, argv, options, long_options, opt_index) int argc; char *const *argv; const char *options; const struct option *long_options; int *opt_index; { return _getopt_internal (argc, argv, options, long_options, opt_index, 1); } #endif /* Not ELIDE_CODE. */ #ifdef TEST #include int main (argc, argv) int argc; char **argv; { int c; int digit_optind = 0; while (1) { int this_option_optind = optind ? optind : 1; int option_index = 0; static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, {"verbose", 0, 0, 0}, {"create", 0, 0, 0}, {"file", 1, 0, 0}, {0, 0, 0, 0} }; c = getopt_long (argc, argv, "abc:d:0123456789", long_options, &option_index); if (c == -1) break; switch (c) { case 0: printf ("option %s", long_options[option_index].name); if (optarg) printf (" with arg %s", optarg); printf ("\n"); break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (digit_optind != 0 && digit_optind != this_option_optind) printf ("digits occur in two different argv-elements.\n"); digit_optind = this_option_optind; printf ("option %c\n", c); break; case 'a': printf ("option a\n"); break; case 'b': printf ("option b\n"); break; case 'c': printf ("option c with value `%s'\n", optarg); break; case 'd': printf ("option d with value `%s'\n", optarg); break; case '?': break; default: printf ("?? getopt returned character code 0%o ??\n", c); } } if (optind < argc) { printf ("non-option ARGV-elements: "); while (optind < argc) printf ("%s ", argv[optind++]); printf ("\n"); } exit (0); } #endif /* TEST */ heroes-0.21/lib/malloc.c0000644004117000411500000000215407200302603010553 /* Work around bug on some systems where malloc (0) fails. Copyright (C) 1997, 1998 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. */ /* written by Jim Meyering */ #if HAVE_CONFIG_H # include #endif #undef malloc #include char *malloc (); /* Allocate an N-byte block of memory from the heap. If N is zero, allocate a 1-byte block. */ char * rpl_malloc (size_t n) { if (n == 0) n = 1; return malloc (n); } heroes-0.21/lib/memrchr.c0000644004117000411500000001441307274020577010764 /* memrchr -- find the last occurrence of a byte in a memory block Copyright (C) 1991, 93, 96, 97, 99, 2000 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), with help from Dan Sahlin (dan@sics.se) and commentary by Jim Blandy (jimb@ai.mit.edu); adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu), and implemented by Roland McGrath (roland@ai.mit.edu). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU C Library 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H # include #endif #include #undef __ptr_t #if defined (__cplusplus) || (defined (__STDC__) && __STDC__) # define __ptr_t void * #else /* Not C++ or ANSI C. */ # define __ptr_t char * #endif /* C++ or ANSI C. */ #if defined (_LIBC) # include # include #else # define reg_char char #endif #if defined (HAVE_LIMITS_H) || defined (_LIBC) # include #endif #define LONG_MAX_32_BITS 2147483647 #ifndef LONG_MAX # define LONG_MAX LONG_MAX_32_BITS #endif #include #undef __memrchr #undef memrchr #ifndef weak_alias # define __memrchr memrchr #endif /* Search no more than N bytes of S for C. */ __ptr_t __memrchr (s, c_in, n) const __ptr_t s; int c_in; size_t n; { const unsigned char *char_ptr; const unsigned long int *longword_ptr; unsigned long int longword, magic_bits, charmask; unsigned reg_char c; c = (unsigned char) c_in; /* Handle the last few characters by reading one character at a time. Do this until CHAR_PTR is aligned on a longword boundary. */ for (char_ptr = (const unsigned char *) s + n; n > 0 && ((unsigned long int) char_ptr & (sizeof (longword) - 1)) != 0; --n) if (*--char_ptr == c) return (__ptr_t) char_ptr; /* All these elucidatory comments refer to 4-byte longwords, but the theory applies equally well to 8-byte longwords. */ longword_ptr = (unsigned long int *) char_ptr; /* Bits 31, 24, 16, and 8 of this number are zero. Call these bits the "holes." Note that there is a hole just to the left of each byte, with an extra at the end: bits: 01111110 11111110 11111110 11111111 bytes: AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD The 1-bits make sure that carries propagate to the next 0-bit. The 0-bits provide holes for carries to fall into. */ if (sizeof (longword) != 4 && sizeof (longword) != 8) abort (); #if LONG_MAX <= LONG_MAX_32_BITS magic_bits = 0x7efefeff; #else magic_bits = ((unsigned long int) 0x7efefefe << 32) | 0xfefefeff; #endif /* Set up a longword, each of whose bytes is C. */ charmask = c | (c << 8); charmask |= charmask << 16; #if LONG_MAX > LONG_MAX_32_BITS charmask |= charmask << 32; #endif /* Instead of the traditional loop which tests each character, we will test a longword at a time. The tricky part is testing if *any of the four* bytes in the longword in question are zero. */ while (n >= sizeof (longword)) { /* We tentatively exit the loop if adding MAGIC_BITS to LONGWORD fails to change any of the hole bits of LONGWORD. 1) Is this safe? Will it catch all the zero bytes? Suppose there is a byte with all zeros. Any carry bits propagating from its left will fall into the hole at its least significant bit and stop. Since there will be no carry from its most significant bit, the LSB of the byte to the left will be unchanged, and the zero will be detected. 2) Is this worthwhile? Will it ignore everything except zero bytes? Suppose every byte of LONGWORD has a bit set somewhere. There will be a carry into bit 8. If bit 8 is set, this will carry into bit 16. If bit 8 is clear, one of bits 9-15 must be set, so there will be a carry into bit 16. Similarly, there will be a carry into bit 24. If one of bits 24-30 is set, there will be a carry into bit 31, so all of the hole bits will be changed. The one misfire occurs when bits 24-30 are clear and bit 31 is set; in this case, the hole at bit 31 is not changed. If we had access to the processor carry flag, we could close this loophole by putting the fourth hole at bit 32! So it ignores everything except 128's, when they're aligned properly. 3) But wait! Aren't we looking for C, not zero? Good point. So what we do is XOR LONGWORD with a longword, each of whose bytes is C. This turns each byte that is C into a zero. */ longword = *--longword_ptr ^ charmask; /* Add MAGIC_BITS to LONGWORD. */ if ((((longword + magic_bits) /* Set those bits that were unchanged by the addition. */ ^ ~longword) /* Look at only the hole bits. If any of the hole bits are unchanged, most likely one of the bytes was a zero. */ & ~magic_bits) != 0) { /* Which of the bytes was C? If none of them were, it was a misfire; continue the search. */ const unsigned char *cp = (const unsigned char *) longword_ptr; #if LONG_MAX > 2147483647 if (cp[7] == c) return (__ptr_t) &cp[7]; if (cp[6] == c) return (__ptr_t) &cp[6]; if (cp[5] == c) return (__ptr_t) &cp[5]; if (cp[4] == c) return (__ptr_t) &cp[4]; #endif if (cp[3] == c) return (__ptr_t) &cp[3]; if (cp[2] == c) return (__ptr_t) &cp[2]; if (cp[1] == c) return (__ptr_t) &cp[1]; if (cp[0] == c) return (__ptr_t) cp; } n -= sizeof (longword); } char_ptr = (const unsigned char *) longword_ptr; while (n-- > 0) { if (*--char_ptr == c) return (__ptr_t) char_ptr; } return 0; } #ifdef weak_alias weak_alias (__memrchr, memrchr) #endif heroes-0.21/lib/realloc.c0000644004117000411500000000237207200302603010727 /* Work around bug on some systems where realloc (NULL, 0) fails. Copyright (C) 1997 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. */ /* written by Jim Meyering */ #if HAVE_CONFIG_H # include #endif #undef realloc #include char *malloc (); char *realloc (); /* Change the size of an allocated block of memory P to N bytes, with error checking. If N is zero, change it to 1. If P is NULL, use malloc. */ char * rpl_realloc (p, n) char *p; size_t n; { if (n == 0) n = 1; if (p == 0) return malloc (n); return realloc (p, n); } heroes-0.21/lib/stpcpy.c0000644004117000411500000000264007332464512010644 /* stpcpy.c -- copy a string and return pointer to end of new string Copyright (C) 1992, 1995, 1997, 1998 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. 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. */ #ifdef HAVE_CONFIG_H # include #endif #include #undef __stpcpy #undef stpcpy #ifndef weak_alias # define __stpcpy stpcpy #endif /* Copy SRC to DEST, returning the address of the terminating '\0' in DEST. */ char * __stpcpy (char *dest, const char *src) { register char *d = dest; register const char *s = src; do *d++ = *s; while (*s++ != '\0'); return d - 1; } #ifdef weak_alias weak_alias (__stpcpy, stpcpy) #endif heroes-0.21/lib/strcasecmp.c0000644004117000411500000000362707200302603011456 /* strcasecmp.c -- case insensitive string comparator Copyright (C) 1998, 1999 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. */ #if HAVE_CONFIG_H # include #endif #ifdef LENGTH_LIMIT # define STRXCASECMP_FUNCTION strncasecmp # define STRXCASECMP_DECLARE_N , size_t n # define LENGTH_LIMIT_EXPR(Expr) Expr #else # define STRXCASECMP_FUNCTION strcasecmp # define STRXCASECMP_DECLARE_N /* empty */ # define LENGTH_LIMIT_EXPR(Expr) 0 #endif #include #include #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) /* Compare {{no more than N characters of }}strings S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. */ int STRXCASECMP_FUNCTION (const char *s1, const char *s2 STRXCASECMP_DECLARE_N) { register const unsigned char *p1 = (const unsigned char *) s1; register const unsigned char *p2 = (const unsigned char *) s2; unsigned char c1, c2; if (p1 == p2 || LENGTH_LIMIT_EXPR (n == 0)) return 0; do { c1 = TOLOWER (*p1); c2 = TOLOWER (*p2); if (LENGTH_LIMIT_EXPR (--n == 0) || c1 == '\0') break; ++p1; ++p2; } while (c1 == c2); return c1 - c2; } heroes-0.21/lib/strndup.c0000644004117000411500000000310107217356370011016 /* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. 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. */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #if defined _LIBC || defined STDC_HEADERS # include # include #else char *malloc (); #endif #ifndef HAVE_DECL_STRNLEN "this configure-time declaration test was not run" #endif #if !HAVE_DECL_STRNLEN size_t strnlen (); #endif #undef __strndup #undef strndup #ifndef weak_alias # define __strndup strndup #endif char * __strndup (const char *s, size_t n) { size_t len = strnlen (s, n); char *new = malloc (len + 1); if (new == NULL) return NULL; new[len] = '\0'; return (char *) memcpy (new, s, len); } #ifdef weak_alias weak_alias (__strndup, strndup) #endif heroes-0.21/lib/w_dirent.c0000644004117000411500000001360307200302603011120 /* * w_dirent.c * * Derived from DIRLIB.C by Matt J. Weinstein * This note appears in the DIRLIB.H * DIRLIB.H by M. J. Weinstein Released to public domain 1-Jan-89 * * Updated by Jeremy Bettis * Significantly revised and rewinddir, seekdir and telldir added by Colin * Peters * * Stolen from Mingw32 and adapted to Heroes * by Alexandre Duret-Lutz */ #include "system.h" #include "w_dirent.h" #define SUFFIX "*" #define SLASH "\\" /* * opendir * * Returns a pointer to a DIR structure appropriately filled in to begin * searching a directory. */ DIR * opendir (const char *szPath) { DIR *nd; struct _stat statDir; errno = 0; if (!szPath) { errno = EFAULT; return (DIR *) 0; } if (szPath[0] == '\0') { errno = ENOTDIR; return (DIR *) 0; } /* Attempt to determine if the given path really is a directory. */ if (_stat (szPath, &statDir)) { /* Error, stat should have set an error value. */ return (DIR *) 0; } if (!S_ISDIR (statDir.st_mode)) { /* Error, stat reports not a directory. */ errno = ENOTDIR; return (DIR *) 0; } /* Allocate enough space to store DIR structure and the complete * directory path given. */ nd = (DIR *) malloc (sizeof (DIR) + strlen (szPath) + strlen (SLASH) + strlen (SUFFIX)); if (!nd) { /* Error, out of memory. */ errno = ENOMEM; return (DIR *) 0; } /* Create the search expression. */ strcpy (nd->dd_name, szPath); /* Add on a slash if the path does not end with one. */ if (nd->dd_name[0] != '\0' && nd->dd_name[strlen (nd->dd_name) - 1] != '/' && nd->dd_name[strlen (nd->dd_name) - 1] != '\\') { strcat (nd->dd_name, SLASH); } /* Add on the search pattern */ strcat (nd->dd_name, SUFFIX); /* Initialize handle to -1 so that a premature closedir doesn't try * to call _findclose on it. */ nd->dd_handle = -1; /* Initialize the status. */ nd->dd_stat = 0; /* Initialize the dirent structure. ino and reclen are invalid under * Win32, and name simply points at the appropriate part of the * findfirst_t structure. */ nd->dd_dir.d_ino = 0; nd->dd_dir.d_reclen = 0; nd->dd_dir.d_namlen = 0; nd->dd_dir.d_name = nd->dd_dta.name; return nd; } /* * readdir * * Return a pointer to a dirent structure filled with the information on the * next entry in the directory. */ struct dirent * readdir (DIR * dirp) { errno = 0; /* Check for valid DIR struct. */ if (!dirp) { errno = EFAULT; return (struct dirent *) 0; } if (dirp->dd_dir.d_name != dirp->dd_dta.name) { /* The structure does not seem to be set up correctly. */ errno = EINVAL; return (struct dirent *) 0; } if (dirp->dd_stat < 0) { /* We have already returned all files in the directory * (or the structure has an invalid dd_stat). */ return (struct dirent *) 0; } else if (dirp->dd_stat == 0) { /* We haven't started the search yet. */ /* Start the search */ dirp->dd_handle = _findfirst (dirp->dd_name, &(dirp->dd_dta)); if (dirp->dd_handle == -1) { /* Whoops! Seems there are no files in that * directory. */ dirp->dd_stat = -1; } else { dirp->dd_stat = 1; } } else { /* Get the next search entry. */ if (_findnext (dirp->dd_handle, &(dirp->dd_dta))) { /* We are off the end or otherwise error. */ _findclose (dirp->dd_handle); dirp->dd_handle = -1; dirp->dd_stat = -1; } else { /* Update the status to indicate the correct * number. */ dirp->dd_stat++; } } if (dirp->dd_stat > 0) { /* Successfully got an entry. Everything about the file is * already appropriately filled in except the length of the * file name. */ dirp->dd_dir.d_namlen = strlen (dirp->dd_dir.d_name); return &dirp->dd_dir; } return (struct dirent *) 0; } /* * closedir * * Frees up resources allocated by opendir. */ int closedir (DIR * dirp) { int rc; errno = 0; rc = 0; if (!dirp) { errno = EFAULT; return -1; } if (dirp->dd_handle != -1) { rc = _findclose (dirp->dd_handle); } /* Delete the dir structure. */ free (dirp); return rc; } /* * rewinddir * * Return to the beginning of the directory "stream". We simply call findclose * and then reset things like an opendir. */ void rewinddir (DIR * dirp) { errno = 0; if (!dirp) { errno = EFAULT; return; } if (dirp->dd_handle != -1) { _findclose (dirp->dd_handle); } dirp->dd_handle = -1; dirp->dd_stat = 0; } /* * telldir * * Returns the "position" in the "directory stream" which can be used with * seekdir to go back to an old entry. We simply return the value in stat. */ long telldir (DIR * dirp) { errno = 0; if (!dirp) { errno = EFAULT; return -1; } return dirp->dd_stat; } /* * seekdir * * Seek to an entry previously returned by telldir. We rewind the directory * and call readdir repeatedly until either dd_stat is the position number * or -1 (off the end). This is not perfect, in that the directory may * have changed while we weren't looking. But that is probably the case with * any such system. */ void seekdir (DIR * dirp, long lPos) { errno = 0; if (!dirp) { errno = EFAULT; return; } if (lPos < -1) { /* Seeking to an invalid position. */ errno = EINVAL; return; } else if (lPos == -1) { /* Seek past end. */ if (dirp->dd_handle != -1) { _findclose (dirp->dd_handle); } dirp->dd_handle = -1; dirp->dd_stat = -1; } else { /* Rewind and read forward to the appropriate index. */ rewinddir (dirp); while ((dirp->dd_stat < lPos) && readdir (dirp)) ; } } heroes-0.21/lib/basename.c0000644004117000411500000000435407353601452011100 /* basename.c -- return the last element in a path Copyright (C) 1990, 1998, 1999, 2000, 2001 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. */ #if HAVE_CONFIG_H # include #endif #if STDC_HEADERS || HAVE_STRING_H # include #endif #include "dirname.h" /* In general, we can't use the builtin `basename' function if available, since it has different meanings in different environments. In some environments the builtin `basename' modifies its argument. Return the address of the last file name component of NAME. If NAME has no file name components because it is all slashes, return NAME if it is empty, the address of its last slash otherwise. */ char * base_name (char const *name) { char const *base = name + FILESYSTEM_PREFIX_LEN (name); char const *p; for (p = base; *p; p++) { if (ISSLASH (*p)) { /* Treat multiple adjacent slashes like a single slash. */ do p++; while (ISSLASH (*p)); /* If the file name ends in slash, use the trailing slash as the basename if no non-slashes have been found. */ if (! *p) { if (ISSLASH (*base)) base = p - 1; break; } /* *P is a non-slash preceded by a slash. */ base = p; } } return (char *) base; } /* Return the length of of the basename NAME. Typically NAME is the value returned by base_name. Act like strlen (NAME), except omit redundant trailing slashes. */ size_t base_len (char const *name) { size_t len; for (len = strlen (name); 1 < len && ISSLASH (name[len - 1]); len--) continue; return len; } heroes-0.21/lib/basename.h0000644004117000411500000000014707267511444011106 #ifndef BASENAME_H_ #define BASENAME_H_ char *base_name (char const *name); #endif /* BASENAME_H_ */ heroes-0.21/lib/cast.c0000644004117000411500000000372307404237314010255 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes 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. | | | | Heroes 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 | `------------------------------------------------------------------*/ /* An evil hack. The sources in src/* are compiled with -Wcast-qual so that the compiler will warn about any conversion of (char*) to (const char*), even explicit. Yet there are few case (like when calling a system function with a dubious prototype) where such cast is required. So we simply define a function that do that. Because this function is compiled in lib/ where -Wcast-qual is not used, we avoid the warning. This incur a sligh run-time penalty, but we don't care; this is really seldom used. */ char * const_cast_string (const char *s) { return (char *) s; } heroes-0.21/lib/cast.h0000644004117000411500000000274407404237314010264 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes 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. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef LIB_CAST_H_ #define LIB_CAST_H_ char *const_cast_string (const char *); #endif /* LIB_CAST_H_ */ heroes-0.21/lib/dirname.c0000644004117000411500000000545407353601452010746 /* dirname.c -- return all but the last element in a path Copyright 1990, 1998, 2000, 2001 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. */ #if HAVE_CONFIG_H # include #endif #if STDC_HEADERS || HAVE_STRING_H # include #endif #include "dirname.h" #include "xalloc.h" /* Return the length of `dirname (PATH)', or zero if PATH is in the working directory. Works properly even if there are trailing slashes (by effectively ignoring them). */ size_t dir_len (char const *path) { size_t prefix_length = FILESYSTEM_PREFIX_LEN (path); size_t length; /* Strip the basename and any redundant slashes before it. */ for (length = base_name (path) - path; prefix_length < length; length--) if (! ISSLASH (path[length - 1])) return length; /* But don't strip the only slash from "/". */ return prefix_length + ISSLASH (path[prefix_length]); } /* Return the leading directories part of PATH, allocated with xmalloc. Works properly even if there are trailing slashes (by effectively ignoring them). */ char * dir_name (char const *path) { size_t length = dir_len (path); int append_dot = (length == FILESYSTEM_PREFIX_LEN (path)); char *newpath = xmalloc (length + append_dot + 1); memcpy (newpath, path, length); if (append_dot) newpath[length++] = '.'; newpath[length] = 0; return newpath; } #ifdef TEST_DIRNAME /* Run the test like this (expect no output): gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall \ basename.c dirname.c xmalloc.c sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out BEGIN-DATA foo//// . bar/foo//// bar foo/ . / / . . a . END-DATA */ # define MAX_BUFF_LEN 1024 # include int main () { char buff[MAX_BUFF_LEN + 1]; buff[MAX_BUFF_LEN] = 0; while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0]) { char path[MAX_BUFF_LEN]; char expected_result[MAX_BUFF_LEN]; char const *result; sscanf (buff, "%s %s", path, expected_result); result = dir_name (path); if (strcmp (result, expected_result)) printf ("%s: got %s, expected %s\n", path, result, expected_result); } return 0; } #endif heroes-0.21/lib/dirname.h0000644004117000411500000000266507353601452010754 /* Copyright (C) 1998, 2001 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. */ #ifndef DIRNAME_H_ # define DIRNAME_H_ 1 # ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args # else # define PARAMS(Args) () # endif # endif # ifndef DIRECTORY_SEPARATOR # define DIRECTORY_SEPARATOR '/' # endif # ifndef ISSLASH # define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR) # endif # ifndef FILESYSTEM_PREFIX_LEN # define FILESYSTEM_PREFIX_LEN(Filename) 0 # endif char *base_name PARAMS ((char const *path)); char *dir_name PARAMS ((char const *path)); size_t base_len PARAMS ((char const *path)); size_t dir_len PARAMS ((char const *path)); int strip_trailing_slashes PARAMS ((char *path)); #endif /* not DIRNAME_H_ */ heroes-0.21/lib/error.c0000644004117000411500000002204207402475440010451 /* Error handler for noninteractive utilities Copyright (C) 1990-1998, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. Its master source is NOT part of the C library, however. The master source lives in /gd/gnu/lib. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ /* Written by David MacKenzie . */ #ifdef HAVE_CONFIG_H # include #endif #include #if HAVE_LIBINTL_H # include #endif #ifdef _LIBC # include # define mbsrtowcs __mbsrtowcs #endif #if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC # if __STDC__ # include # define VA_START(args, lastarg) va_start(args, lastarg) # else # include # define VA_START(args, lastarg) va_start(args) # endif #else # define va_alist a1, a2, a3, a4, a5, a6, a7, a8 # define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; #endif #if STDC_HEADERS || _LIBC # include # include #else void exit (); #endif #include "error.h" #include "unlocked-io.h" #ifndef _ # define _(String) String #endif /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ void (*error_print_progname) ( #if __STDC__ - 0 void #endif ); /* This variable is incremented each time `error' is called. */ unsigned int error_message_count; #ifdef _LIBC /* In the GNU C library, there is a predefined variable for this. */ # define program_name program_invocation_name # include /* In GNU libc we want do not want to use the common name `error' directly. Instead make it a weak alias. */ extern void __error (int status, int errnum, const char *message, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern void __error_at_line (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, ...) __attribute__ ((__format__ (__printf__, 5, 6)));; # define error __error # define error_at_line __error_at_line # ifdef USE_IN_LIBIO # include # define fflush(s) _IO_fflush (s) # endif #else /* not _LIBC */ # if !HAVE_DECL_STRERROR_R && STRERROR_R_CHAR_P # ifndef HAVE_DECL_STRERROR_R "this configure-time declaration test was not run" # endif char *strerror_r (); # endif /* The calling program should define program_name and set it to the name of the executing program. */ extern char *program_name; # if HAVE_STRERROR_R || defined strerror_r # define __strerror_r strerror_r # else # if HAVE_STRERROR # ifndef HAVE_DECL_STRERROR "this configure-time declaration test was not run" # endif # if !HAVE_DECL_STRERROR char *strerror (); # endif # else static char * private_strerror (int errnum) { extern char *sys_errlist[]; extern int sys_nerr; if (errnum > 0 && errnum <= sys_nerr) return _(sys_errlist[errnum]); return _("Unknown system error"); } # define strerror private_strerror # endif /* HAVE_STRERROR */ # endif /* HAVE_STRERROR_R || defined strerror_r */ #endif /* not _LIBC */ static void print_errno_message (int errnum) { char const *s; #if defined HAVE_STRERROR_R || _LIBC char errbuf[1024]; # if STRERROR_R_CHAR_P || _LIBC s = __strerror_r (errnum, errbuf, sizeof errbuf); # else if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0) s = errbuf; else s = 0; # endif #else s = strerror (errnum); #endif #if !_LIBC if (! s) s = _("Unknown system error"); #endif #if _LIBC && USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) { __fwprintf (stderr, L": %s", s); return; } #endif fprintf (stderr, ": %s", s); } #ifdef VA_START static void error_tail (int status, int errnum, const char *message, va_list args) { # if HAVE_VPRINTF || _LIBC # if _LIBC && USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) { # define ALLOCA_LIMIT 2000 size_t len = strlen (message) + 1; wchar_t *wmessage = NULL; mbstate_t st; size_t res; const char *tmp; do { if (len < ALLOCA_LIMIT) wmessage = (wchar_t *) alloca (len * sizeof (wchar_t)); else { if (wmessage != NULL && len / 2 < ALLOCA_LIMIT) wmessage = NULL; wmessage = (wchar_t *) realloc (wmessage, len * sizeof (wchar_t)); if (wmessage == NULL) { fputws_unlocked (L"out of memory\n", stderr); return; } } memset (&st, '\0', sizeof (st)); tmp =message; } while ((res = mbsrtowcs (wmessage, &tmp, len, &st)) == len); if (res == (size_t) -1) /* The string cannot be converted. */ wmessage = (wchar_t *) L"???"; __vfwprintf (stderr, wmessage, args); } else # endif vfprintf (stderr, message, args); # else _doprnt (message, args, stderr); # endif va_end (args); ++error_message_count; if (errnum) print_errno_message (errnum); # if _LIBC && USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) putwc (L'\n', stderr); else # endif putc ('\n', stderr); fflush (stderr); if (status) exit (status); } #endif /* Print the program name and error message MESSAGE, which is a printf-style format string with optional args. If ERRNUM is nonzero, print its corresponding system error message. Exit with status STATUS if it is nonzero. */ /* VARARGS */ void #if defined VA_START && __STDC__ error (int status, int errnum, const char *message, ...) #else error (status, errnum, message, va_alist) int status; int errnum; char *message; va_dcl #endif { #ifdef VA_START va_list args; #endif fflush (stdout); #ifdef _LIBC # ifdef USE_IN_LIBIO _IO_flockfile (stderr); # else __flockfile (stderr); # endif #endif if (error_print_progname) (*error_print_progname) (); else { #if _LIBC && USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s: ", program_name); else #endif fprintf (stderr, "%s: ", program_name); } #ifdef VA_START VA_START (args, message); error_tail (status, errnum, message, args); #else fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); ++error_message_count; if (errnum) print_errno_message (errnum); putc ('\n', stderr); fflush (stderr); if (status) exit (status); #endif #ifdef _LIBC # ifdef USE_IN_LIBIO _IO_funlockfile (stderr); # else __funlockfile (stderr); # endif #endif } /* Sometimes we want to have at most one error per line. This variable controls whether this mode is selected or not. */ int error_one_per_line; void #if defined VA_START && __STDC__ error_at_line (int status, int errnum, const char *file_name, unsigned int line_number, const char *message, ...) #else error_at_line (status, errnum, file_name, line_number, message, va_alist) int status; int errnum; const char *file_name; unsigned int line_number; char *message; va_dcl #endif { #ifdef VA_START va_list args; #endif if (error_one_per_line) { static const char *old_file_name; static unsigned int old_line_number; if (old_line_number == line_number && (file_name == old_file_name || strcmp (old_file_name, file_name) == 0)) /* Simply return and print nothing. */ return; old_file_name = file_name; old_line_number = line_number; } fflush (stdout); #ifdef _LIBC # ifdef USE_IN_LIBIO _IO_flockfile (stderr); # else __flockfile (stderr); # endif #endif if (error_print_progname) (*error_print_progname) (); else { #if _LIBC && USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s: ", program_name); else #endif fprintf (stderr, "%s:", program_name); } if (file_name != NULL) { #if _LIBC && USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) __fwprintf (stderr, L"%s:%d: ", file_name, line_number); else #endif fprintf (stderr, "%s:%d: ", file_name, line_number); } #ifdef VA_START VA_START (args, message); error_tail (status, errnum, message, args); #else fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8); ++error_message_count; if (errnum) print_errno_message (errnum); putc ('\n', stderr); fflush (stderr); if (status) exit (status); #endif #ifdef _LIBC # ifdef USE_IN_LIBIO _IO_funlockfile (stderr); # else __funlockfile (stderr); # endif #endif } #ifdef _LIBC /* Make the weak alias. */ # undef error # undef error_at_line weak_alias (__error, error) weak_alias (__error_at_line, error_at_line) #endif heroes-0.21/lib/error.h0000644004117000411500000000513507353601452010461 /* Declaration for error-reporting function Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. NOTE: The canonical source of this file is maintained with the GNU C Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. 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. */ #ifndef _ERROR_H #define _ERROR_H 1 #ifndef __attribute__ /* This feature is available in gcc versions 2.5 and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) # define __attribute__(Spec) /* empty */ # endif /* The __-protected variants of `format' and `printf' attributes are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) # define __format__ format # define __printf__ printf # endif #endif #ifdef __cplusplus extern "C" { #endif #if defined (__STDC__) && __STDC__ /* Print a message with `fprintf (stderr, FORMAT, ...)'; if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ extern void error (int status, int errnum, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern void error_at_line (int status, int errnum, const char *fname, unsigned int lineno, const char *format, ...) __attribute__ ((__format__ (__printf__, 5, 6))); /* If NULL, error will flush stdout, then print on stderr the program name, a colon and a space. Otherwise, error will call this function without parameters instead. */ extern void (*error_print_progname) (void); #else void error (); void error_at_line (); extern void (*error_print_progname) (); #endif /* This variable is incremented each time `error' is called. */ extern unsigned int error_message_count; /* Sometimes we want to have at most one error per line. This variable controls whether this mode is selected or not. */ extern int error_one_per_line; #ifdef __cplusplus } #endif #endif /* error.h */ heroes-0.21/lib/filelock.c0000644004117000411500000000644207424066251011116 /*-------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | 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 | `-------------------------------------------------------------------*/ #if HAVE_CONFIG_H # include #endif #include #include #if HAVE_FCNTL_H # include #endif #if HAVE_SYS_FILE_H # include #endif /* These two files are for Windows (MinGW actually). */ #if HAVE_IO_H # include #endif #if HAVE_SYS_LOCKING_H # include #endif #include "filelock.h" /* fcntl() locking is prefered because it works over NFS, otherwise we fall back to flock(), or _locking() (this one is for Windows). */ int file_lock (int fd, int exclusive) { #if HAVE_FCNTL && defined(F_SETLKW) struct flock lock; lock.l_type = exclusive ? F_WRLCK : F_RDLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 0; /* Lock the whole file. */ return fcntl (fd, F_SETLKW, &lock); #else /* !(HAVE_FCNTL && defined(F_SETLKW)) */ # if HAVE_FLOCK return flock (fd, exclusive ? LOCK_EX : LOCK_SH); # else /* !HAVE_FLOCK */ # if HAVE__LOCKING /* Lock the 10 next bytes. */ return _locking (fd, exclusive ? _LK_LOCK : _LK_RLCK, 10); # else /* !HAVE__LOCKING */ /* FIXME: implement other kind of locking for system. */ return -1; # endif /* !HAVE_LOCKING */ # endif /* !HAVE_FLOCK */ #endif /* !(HAVE_FCNTL && defined(F_SETLKW)) */ } int file_unlock (int fd) { #if HAVE_FCNTL && defined(F_SETLKW) struct flock lock; lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 0; /* Unlock the whole file. */ return fcntl (fd, F_SETLKW, &lock); #else /* !(HAVE_FCNTL && defined(F_SETLKW)) */ # if HAVE_FLOCK return flock (fd, LOCK_UN); # else /* !HAVE_FLOCK */ # if HAVE__LOCKING /* Some version of MinGW used to spell _LK_UNLCK with an O. */ # ifndef _LK_UNLCK # ifdef _LK_UNLOCK # define _LK_UNLCK _LK_UNLOCK # endif # endif /* Unlock the 10 next bytes. */ return _locking (fd, _LK_UNLCK, 10); # else /* !HAVE__LOCKING */ /* FIXME: implement other kind of locking for system. */ return -1; # endif /* !HAVE__LOCKING */ # endif /* !HAVE_FLOCK */ #endif /* !(HAVE_FCNTL && defined(F_SETLKW)) */ } heroes-0.21/lib/filelock.h0000644004117000411500000000340407311432054011107 /*-------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | 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 | `-------------------------------------------------------------------*/ /* Lock a file, blocking if needed. If EXCLUSIVE is 0 then many processes can lock the file (usually this is for reading), otherwise only one process can lock the file (for writing). Return 0 on success, something else on error. */ int file_lock (int fd, int exlusive); /* Unlock a file. */ int file_unlock (int fd); /* WARNING: under Windows, these functions will lock or unlock the 10 next bytes. Therefore you should make sure that you always call these functions from the same position. */ heroes-0.21/lib/fstrcmp.c0000644004117000411500000003671207200302603010771 /* Functions to make fuzzy comparisons between strings Copyright (C) 1988, 1989, 1992, 1993, 1995 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 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., 675 Mass Ave, Cambridge, MA 02139, USA. Derived from GNU diff 2.7, analyze.c et al. The basic algorithm is described in: "An O(ND) Difference Algorithm and its Variations", Eugene Myers, Algorithmica Vol. 1 No. 2, 1986, pp. 251-266; see especially section 4.2, which describes the variation used below. The basic algorithm was independently discovered as described in: "Algorithms for Approximate String Matching", E. Ukkonen, Information and Control Vol. 64, 1985, pp. 100-118. Modified to work on strings rather than files by Peter Miller , October 1995 */ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef HAVE_STRING_H # include #else # include #endif #include #ifdef HAVE_LIMITS_H # include #else # define INT_MAX ((int)(~(unsigned)0 >> 1)) #endif #include "system.h" #include "fstrcmp.h" /* * Data on one input string being compared. */ struct string_data { /* The string to be compared. */ const char *data; /* The length of the string to be compared. */ int data_length; /* The number of characters inserted or deleted. */ int edit_count; }; static struct string_data string[2]; #ifdef MINUS_H_FLAG /* This corresponds to the diff -H flag. With this heuristic, for strings with a constant small density of changes, the algorithm is linear in the strings size. This is unlikely in typical uses of fstrcmp, and so is usually compiled out. Besides, there is no interface to set it true. */ static int heuristic; #endif /* Vector, indexed by diagonal, containing 1 + the X coordinate of the point furthest along the given diagonal in the forward search of the edit matrix. */ static int *fdiag; /* Vector, indexed by diagonal, containing the X coordinate of the point furthest along the given diagonal in the backward search of the edit matrix. */ static int *bdiag; /* Edit scripts longer than this are too expensive to compute. */ static int too_expensive; /* Snakes bigger than this are considered `big'. */ #define SNAKE_LIMIT 20 struct partition { /* Midpoints of this partition. */ int xmid, ymid; /* Nonzero if low half will be analyzed minimally. */ int lo_minimal; /* Likewise for high half. */ int hi_minimal; }; /* NAME diag - find diagonal path SYNOPSIS int diag(int xoff, int xlim, int yoff, int ylim, int minimal, struct partition *part); DESCRIPTION Find the midpoint of the shortest edit script for a specified portion of the two strings. Scan from the beginnings of the strings, and simultaneously from the ends, doing a breadth-first search through the space of edit-sequence. When the two searches meet, we have found the midpoint of the shortest edit sequence. If MINIMAL is nonzero, find the minimal edit script regardless of expense. Otherwise, if the search is too expensive, use heuristics to stop the search and report a suboptimal answer. RETURNS Set PART->(XMID,YMID) to the midpoint (XMID,YMID). The diagonal number XMID - YMID equals the number of inserted characters minus the number of deleted characters (counting only characters before the midpoint). Return the approximate edit cost; this is the total number of characters inserted or deleted (counting only characters before the midpoint), unless a heuristic is used to terminate the search prematurely. Set PART->LEFT_MINIMAL to nonzero iff the minimal edit script for the left half of the partition is known; similarly for PART->RIGHT_MINIMAL. CAVEAT This function assumes that the first characters of the specified portions of the two strings do not match, and likewise that the last characters do not match. The caller must trim matching characters from the beginning and end of the portions it is going to specify. If we return the "wrong" partitions, the worst this can do is cause suboptimal diff output. It cannot cause incorrect diff output. */ static int diag PARAMS ((int, int, int, int, int, struct partition *)); static int diag (xoff, xlim, yoff, ylim, minimal, part) int xoff; int xlim; int yoff; int ylim; int minimal; struct partition *part; { int *const fd = fdiag; /* Give the compiler a chance. */ int *const bd = bdiag; /* Additional help for the compiler. */ const char *const xv = string[0].data; /* Still more help for the compiler. */ const char *const yv = string[1].data; /* And more and more . . . */ const int dmin = xoff - ylim; /* Minimum valid diagonal. */ const int dmax = xlim - yoff; /* Maximum valid diagonal. */ const int fmid = xoff - yoff; /* Center diagonal of top-down search. */ const int bmid = xlim - ylim; /* Center diagonal of bottom-up search. */ int fmin = fmid; int fmax = fmid; /* Limits of top-down search. */ int bmin = bmid; int bmax = bmid; /* Limits of bottom-up search. */ int c; /* Cost. */ int odd = (fmid - bmid) & 1; /* * True if southeast corner is on an odd diagonal with respect * to the northwest. */ fd[fmid] = xoff; bd[bmid] = xlim; for (c = 1;; ++c) { int d; /* Active diagonal. */ int big_snake; big_snake = 0; /* Extend the top-down search by an edit step in each diagonal. */ if (fmin > dmin) fd[--fmin - 1] = -1; else ++fmin; if (fmax < dmax) fd[++fmax + 1] = -1; else --fmax; for (d = fmax; d >= fmin; d -= 2) { int x; int y; int oldx; int tlo; int thi; tlo = fd[d - 1], thi = fd[d + 1]; if (tlo >= thi) x = tlo + 1; else x = thi; oldx = x; y = x - d; while (x < xlim && y < ylim && xv[x] == yv[y]) { ++x; ++y; } if (x - oldx > SNAKE_LIMIT) big_snake = 1; fd[d] = x; if (odd && bmin <= d && d <= bmax && bd[d] <= x) { part->xmid = x; part->ymid = y; part->lo_minimal = part->hi_minimal = 1; return 2 * c - 1; } } /* Similarly extend the bottom-up search. */ if (bmin > dmin) bd[--bmin - 1] = INT_MAX; else ++bmin; if (bmax < dmax) bd[++bmax + 1] = INT_MAX; else --bmax; for (d = bmax; d >= bmin; d -= 2) { int x; int y; int oldx; int tlo; int thi; tlo = bd[d - 1], thi = bd[d + 1]; if (tlo < thi) x = tlo; else x = thi - 1; oldx = x; y = x - d; while (x > xoff && y > yoff && xv[x - 1] == yv[y - 1]) { --x; --y; } if (oldx - x > SNAKE_LIMIT) big_snake = 1; bd[d] = x; if (!odd && fmin <= d && d <= fmax && x <= fd[d]) { part->xmid = x; part->ymid = y; part->lo_minimal = part->hi_minimal = 1; return 2 * c; } } if (minimal) continue; #ifdef MINUS_H_FLAG /* Heuristic: check occasionally for a diagonal that has made lots of progress compared with the edit distance. If we have any such, find the one that has made the most progress and return it as if it had succeeded. With this heuristic, for strings with a constant small density of changes, the algorithm is linear in the strings size. */ if (c > 200 && big_snake && heuristic) { int best; best = 0; for (d = fmax; d >= fmin; d -= 2) { int dd; int x; int y; int v; dd = d - fmid; x = fd[d]; y = x - d; v = (x - xoff) * 2 - dd; if (v > 12 * (c + (dd < 0 ? -dd : dd))) { if ( v > best && xoff + SNAKE_LIMIT <= x && x < xlim && yoff + SNAKE_LIMIT <= y && y < ylim ) { /* We have a good enough best diagonal; now insist that it end with a significant snake. */ int k; for (k = 1; xv[x - k] == yv[y - k]; k++) { if (k == SNAKE_LIMIT) { best = v; part->xmid = x; part->ymid = y; break; } } } } } if (best > 0) { part->lo_minimal = 1; part->hi_minimal = 0; return 2 * c - 1; } best = 0; for (d = bmax; d >= bmin; d -= 2) { int dd; int x; int y; int v; dd = d - bmid; x = bd[d]; y = x - d; v = (xlim - x) * 2 + dd; if (v > 12 * (c + (dd < 0 ? -dd : dd))) { if (v > best && xoff < x && x <= xlim - SNAKE_LIMIT && yoff < y && y <= ylim - SNAKE_LIMIT) { /* We have a good enough best diagonal; now insist that it end with a significant snake. */ int k; for (k = 0; xv[x + k] == yv[y + k]; k++) { if (k == SNAKE_LIMIT - 1) { best = v; part->xmid = x; part->ymid = y; break; } } } } } if (best > 0) { part->lo_minimal = 0; part->hi_minimal = 1; return 2 * c - 1; } } #endif /* MINUS_H_FLAG */ /* Heuristic: if we've gone well beyond the call of duty, give up and report halfway between our best results so far. */ if (c >= too_expensive) { int fxybest; int fxbest; int bxybest; int bxbest; /* Pacify `gcc -Wall'. */ fxbest = 0; bxbest = 0; /* Find forward diagonal that maximizes X + Y. */ fxybest = -1; for (d = fmax; d >= fmin; d -= 2) { int x; int y; x = fd[d] < xlim ? fd[d] : xlim; y = x - d; if (ylim < y) { x = ylim + d; y = ylim; } if (fxybest < x + y) { fxybest = x + y; fxbest = x; } } /* Find backward diagonal that minimizes X + Y. */ bxybest = INT_MAX; for (d = bmax; d >= bmin; d -= 2) { int x; int y; x = xoff > bd[d] ? xoff : bd[d]; y = x - d; if (y < yoff) { x = yoff + d; y = yoff; } if (x + y < bxybest) { bxybest = x + y; bxbest = x; } } /* Use the better of the two diagonals. */ if ((xlim + ylim) - bxybest < fxybest - (xoff + yoff)) { part->xmid = fxbest; part->ymid = fxybest - fxbest; part->lo_minimal = 1; part->hi_minimal = 0; } else { part->xmid = bxbest; part->ymid = bxybest - bxbest; part->lo_minimal = 0; part->hi_minimal = 1; } return 2 * c - 1; } } } /* NAME compareseq - find edit sequence SYNOPSIS void compareseq(int xoff, int xlim, int yoff, int ylim, int minimal); DESCRIPTION Compare in detail contiguous subsequences of the two strings which are known, as a whole, to match each other. The subsequence of string 0 is [XOFF, XLIM) and likewise for string 1. Note that XLIM, YLIM are exclusive bounds. All character numbers are origin-0. If MINIMAL is nonzero, find a minimal difference no matter how expensive it is. */ static void compareseq PARAMS ((int, int, int, int, int)); static void compareseq (xoff, xlim, yoff, ylim, minimal) int xoff; int xlim; int yoff; int ylim; int minimal; { const char *const xv = string[0].data; /* Help the compiler. */ const char *const yv = string[1].data; /* Slide down the bottom initial diagonal. */ while (xoff < xlim && yoff < ylim && xv[xoff] == yv[yoff]) { ++xoff; ++yoff; } /* Slide up the top initial diagonal. */ while (xlim > xoff && ylim > yoff && xv[xlim - 1] == yv[ylim - 1]) { --xlim; --ylim; } /* Handle simple cases. */ if (xoff == xlim) { while (yoff < ylim) { ++string[1].edit_count; ++yoff; } } else if (yoff == ylim) { while (xoff < xlim) { ++string[0].edit_count; ++xoff; } } else { int c; struct partition part; /* Find a point of correspondence in the middle of the strings. */ c = diag (xoff, xlim, yoff, ylim, minimal, &part); if (c == 1) { #if 0 /* This should be impossible, because it implies that one of the two subsequences is empty, and that case was handled above without calling `diag'. Let's verify that this is true. */ abort (); #else /* The two subsequences differ by a single insert or delete; record it and we are done. */ if (part.xmid - part.ymid < xoff - yoff) ++string[1].edit_count; else ++string[0].edit_count; #endif } else { /* Use the partitions to split this problem into subproblems. */ compareseq (xoff, part.xmid, yoff, part.ymid, part.lo_minimal); compareseq (part.xmid, xlim, part.ymid, ylim, part.hi_minimal); } } } /* NAME fstrcmp - fuzzy string compare SYNOPSIS double fstrcmp(const char *, const char *); DESCRIPTION The fstrcmp function may be used to compare two string for similarity. It is very useful in reducing "cascade" or "secondary" errors in compilers or other situations where symbol tables occur. RETURNS double; 0 if the strings are entirly dissimilar, 1 if the strings are identical, and a number in between if they are similar. */ double fstrcmp (string1, string2) const char *string1; const char *string2; { int i; size_t fdiag_len; static int *fdiag_buf; static size_t fdiag_max; /* set the info for each string. */ string[0].data = string1; string[0].data_length = strlen (string1); string[1].data = string2; string[1].data_length = strlen (string2); /* short-circuit obvious comparisons */ if (string[0].data_length == 0 && string[1].data_length == 0) return 1.0; if (string[0].data_length == 0 || string[1].data_length == 0) return 0.0; /* Set TOO_EXPENSIVE to be approximate square root of input size, bounded below by 256. */ too_expensive = 1; for (i = string[0].data_length + string[1].data_length; i != 0; i >>= 2) too_expensive <<= 1; if (too_expensive < 256) too_expensive = 256; /* Because fstrcmp is typically called multiple times, while scanning symbol tables, etc, attempt to minimize the number of memory allocations performed. Thus, we use a static buffer for the diagonal vectors, and never free them. */ fdiag_len = string[0].data_length + string[1].data_length + 3; if (fdiag_len > fdiag_max) { fdiag_max = fdiag_len; fdiag_buf = xrealloc (fdiag_buf, fdiag_max * (2 * sizeof (int))); } fdiag = fdiag_buf + string[1].data_length + 1; bdiag = fdiag + fdiag_len; /* Now do the main comparison algorithm */ string[0].edit_count = 0; string[1].edit_count = 0; compareseq (0, string[0].data_length, 0, string[1].data_length, 0); /* The result is ((number of chars in common) / (average length of the strings)). This is admittedly biased towards finding that the strings are similar, however it does produce meaningful results. */ return ((double) (string[0].data_length + string[1].data_length - string[1].edit_count - string[0].edit_count) / (string[0].data_length + string[1].data_length)); } heroes-0.21/lib/fstrcmp.h0000644004117000411500000000165107200302603010770 /* GNU gettext - internationalization aids Copyright (C) 1995 Free Software Foundation, Inc. This file was written by Peter Miller 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. */ #ifndef _FSTRCMP_H #define _FSTRCMP_H double fstrcmp PARAMS ((const char *__s1, const char *__s2)); #endif heroes-0.21/lib/getshline.c0000644004117000411500000001256707170027366011317 /* getshline.c -- read a meaningfull line from a file Copyright (C) 1993, 1996 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 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. */ /* Written by Jan Brittenson, bson@gnu.ai.mit.edu. */ /* Written by Akim Demaille, demaille@inf.enst.fr * from getline.c by Jan Brittenson, bson@gnu.ai.mit.edu. */ /* Modified on 2000-06-18 by Alexandre Duret-Lutz to include dmalloc.h */ #if HAVE_CONFIG_H # include #endif #include #include #if HAVE_SYS_TYPES_H # include #endif #include #ifdef HAVE_DMALLOC #include #endif #include "getshline.h" /* Always add at least this many bytes when extending the buffer. */ #define MIN_CHUNK 64 /* Read up to (and including) a TERMINATOR from STREAM into *LINEPTR + OFFSET (and null-terminate it). *LINEPTR is a pointer returned from malloc (or NULL), pointing to *N characters of space. It is realloc'd as necessary. Return the number of characters read (not including the null terminator), or -1 on error or EOF. */ static int getshstr (int * firstline, int * lastline, char ** lineptr, size_t * n, FILE * stream, int terminator, int terminator_quote, int commentor, size_t offset) { int nchars_avail; /* Allocated but unused chars in *LINEPTR. */ char *read_pos; /* Where we're reading into *LINEPTR. */ int ret; if (!lineptr || !n || !stream) return -1; if (!*lineptr) { *n = MIN_CHUNK; *lineptr = malloc (*n * sizeof(char)); if (!*lineptr) return -1; } /* We are reading a new line */ *firstline = ++(*lastline); nchars_avail = *n - offset; read_pos = *lineptr + offset; for (;;) { register int c = getc (stream); /* We always want at least one char left in the buffer, since we always (unless we get an error while reading the first char) NUL-terminate the line buffer. */ assert(*n + *lineptr == read_pos + nchars_avail); if (nchars_avail < 2) { if (*n > MIN_CHUNK) *n *= 2; else *n += MIN_CHUNK; nchars_avail = *n + *lineptr - read_pos; *lineptr = realloc (*lineptr, *n * sizeof(char)); if (!*lineptr) return -1; read_pos = *n - nchars_avail + *lineptr; assert(*n + *lineptr == read_pos + nchars_avail); } if (c == EOF || ferror (stream)) { /* Return partial line, if any. */ if (read_pos == *lineptr) return -1; else break; } *read_pos++ = c; nchars_avail--; if (c == terminator) { /* The comment lines can not be continued by an * escaped eol, so test this before quotation of eol */ if (**lineptr == terminator || **lineptr == commentor) { /* We just read a blank line. Then we are reading * a new first line */ *firstline = *lastline + 1; return (getshstr (firstline, lastline, lineptr, n, stream, terminator, terminator_quote, commentor, offset)); } if ((read_pos - 2 <= *lineptr) || (*(read_pos - 2) != terminator_quote)) /* Return the line. */ break; /* The line is continued because the eol was quoted, * hence lastline has to be incremented */ read_pos -= 2; nchars_avail += 2; (*lastline)++; } } /* Done - NUL terminate and return the number of chars read. */ *read_pos = '\0'; ret = read_pos - (*lineptr + offset); return ret; } int getshline_numbered (int * firstline, int * lastline, char ** lineptr, size_t * n, FILE * stream) { return getshstr (firstline, lastline, lineptr, n, stream, '\n', '\\', '#', 0); } int getshline (char ** lineptr, size_t * n, FILE * stream) { int firstline, lastline; return getshstr (&firstline, &lastline, lineptr, n, stream, '\n', '\\', '#', 0); } int getshdelim_numbered (int * firstline, int * lastline, char ** lineptr, size_t * n, int delimiter, int delimiter_quote, int commentor, FILE * stream) { return getshstr (firstline, lastline, lineptr, n, stream, delimiter, delimiter_quote, commentor, 0); } int getshdelim (char ** lineptr, size_t * n, int delimiter, int delimiter_quote, int commentor, FILE * stream) { int firstline, lastline; return getshstr (&firstline, &lastline, lineptr, n, stream, delimiter, delimiter_quote, commentor, 0); } #ifdef TEST const char * program_name = "getsh"; int main(int argc, char *argv[]) { int firstline = 0, lastline = 0; char * line_content = NULL; int line_size = 0; FILE * file; int res; if (argc < 2) exit (1); file = fopen (argv[1], "r"); if (!file) exit (1); while ((res = getshline_numbered (&firstline, &lastline, &line_content, &line_size, file)) != -1) printf ("%3d-%3d:%s", firstline, lastline, line_content); free (line_content); return 0; } #endif heroes-0.21/lib/getshline.h0000644004117000411500000000424607151702265011314 /* Copyright (C) 1995 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. */ #ifndef _GETSHLINE_H_ # define _GETSHLINE_H_ 1 /* Support of prototyping when possible */ # ifndef PARAMS # if PROTOTYPES # define PARAMS(protos) protos # else /* no PROTOTYPES */ # define PARAMS(protos) () # endif /* no PROTOTYPES */ # endif /* These routines are devoted to reading meaning full lines. By * meaningful is ment, not empty, and not behind a COMMENTOR symbol. * These lines are ended by a DELIMITER, but may be continued if * DELIMITER is preceded by a DELIMITER_QUOTE. */ int getshline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream)); int getshdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, int _delimiter_quote, int _commentor, FILE *_stream)); /* These routines are the pending of the above routines, keeping * track of the meaning full line interval read. When calling them * *LASTLINE should be the number of the last line read (hence 0 * for the first line), upon return, *FIRSTLINE is the line number * where begun the line returned, and *LASTLINE, the line number * where it ended */ /* A basic example is available at the bottom of getshline.c */ int getshline_numbered PARAMS ((int *_firstline, int *_lastline, char **_lineptr, size_t *_n, FILE *_stream)); int getshdelim_numbered PARAMS ((int *_firstline, int *_lastline, char **_lineptr, size_t *_n, int _delimiter, int _delimiter_quote, int _commentor, FILE *_stream)); #endif /* not defined(_GETSHLINE_H_) */ heroes-0.21/lib/gnugetopt.h0000644004117000411500000001445707353601452011353 /* Declarations for getopt. Copyright (C) 1989-1994, 1996-1999, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ #ifndef _GETOPT_H #ifndef __need_getopt # define _GETOPT_H 1 #endif /* If __GNU_LIBRARY__ is not already defined, either we are being used standalone, or this is the first header included in the source file. If we are being used with glibc, we need to include , but that does not exist if we are standalone. So: if __GNU_LIBRARY__ is not defined, include , which will pull in for us if it's from glibc. (Why ctype.h? It's guaranteed to exist and it doesn't flood the namespace with stuff the way some other headers do.) */ #if !defined __GNU_LIBRARY__ # include #endif #ifdef __cplusplus extern "C" { #endif /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns -1, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int opterr; /* Set to an option character which was unrecognized. */ extern int optopt; #ifndef __need_getopt /* Describe the long-named options requested by the application. The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector of `struct option' terminated by an element containing a name which is zero. The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but left unchanged if the option is not found. To have a long-named option do something other than set an `int' to a compiled-in constant, such as set a value from `optarg', set the option's `flag' field to zero and its `val' field to a nonzero value (the equivalent single-letter option character, if there is one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ struct option { # if (defined __STDC__ && __STDC__) || defined __cplusplus const char *name; # else char *name; # endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ int has_arg; int *flag; int val; }; /* Names for the values of the `has_arg' field of `struct option'. */ # define no_argument 0 # define required_argument 1 # define optional_argument 2 #endif /* need getopt */ /* Get definitions and prototypes for functions to process the arguments in ARGV (ARGC of them, minus the program name) for options given in OPTS. Return the option character from OPTS just read. Return -1 when there are no more options. For unrecognized options, or options missing arguments, `optopt' is set to the option letter, and '?' is returned. The OPTS string is a list of characters which are recognized option letters, optionally followed by colons, specifying that that letter takes an argument, to be placed in `optarg'. If a letter in OPTS is followed by two colons, its argument is optional. This behavior is specific to the GNU `getopt'. The argument `--' causes premature termination of argument scanning, explicitly telling `getopt' that there are no more options. If OPTS begins with `--', then non-option arguments are treated as arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ #if (defined __STDC__ && __STDC__) || defined __cplusplus # ifdef __GNU_LIBRARY__ /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ extern int getopt (int __argc, char *const *__argv, const char *__shortopts); # else /* not __GNU_LIBRARY__ */ extern int getopt (); # endif /* __GNU_LIBRARY__ */ # ifndef __need_getopt extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); extern int getopt_long_only (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); /* Internal only. Users should not call this directly. */ extern int _getopt_internal (int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); # endif #else /* not __STDC__ */ extern int getopt (); # ifndef __need_getopt extern int getopt_long (); extern int getopt_long_only (); extern int _getopt_internal (); # endif #endif /* __STDC__ */ #ifdef __cplusplus } #endif /* Make sure we later can get all the definitions and declarations. */ #undef __need_getopt #endif /* getopt.h */ heroes-0.21/lib/hash.c0000644004117000411500000007355607402475440010263 /* hash - hashing table processing. Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Jim Meyering, 1992. 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. */ /* A generic hash table package. */ /* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead of malloc. If you change USE_OBSTACK, you have to recompile! */ #if HAVE_CONFIG_H # include #endif #if HAVE_STDLIB_H # include #endif #if HAVE_STDBOOL_H # include #else typedef enum {false = 0, true = 1} bool; #endif #include #include #ifndef HAVE_DECL_FREE "this configure-time declaration test was not run" #endif #if !HAVE_DECL_FREE void free (); #endif #ifndef HAVE_DECL_MALLOC "this configure-time declaration test was not run" #endif #if !HAVE_DECL_MALLOC char *malloc (); #endif #if USE_OBSTACK # include "obstack.h" # ifndef obstack_chunk_alloc # define obstack_chunk_alloc malloc # endif # ifndef obstack_chunk_free # define obstack_chunk_free free # endif #endif #include "hash.h" struct hash_table { /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1, for a possibility of N_BUCKETS. Among those, N_BUCKETS_USED buckets are not empty, there are N_ENTRIES active entries in the table. */ struct hash_entry *bucket; struct hash_entry *bucket_limit; unsigned n_buckets; unsigned n_buckets_used; unsigned n_entries; /* Tuning arguments, kept in a physicaly separate structure. */ const Hash_tuning *tuning; /* Three functions are given to `hash_initialize', see the documentation block for this function. In a word, HASHER randomizes a user entry into a number up from 0 up to some maximum minus 1; COMPARATOR returns true if two user entries compare equally; and DATA_FREER is the cleanup function for a user entry. */ Hash_hasher hasher; Hash_comparator comparator; Hash_data_freer data_freer; /* A linked list of freed struct hash_entry structs. */ struct hash_entry *free_entry_list; #if USE_OBSTACK /* Whenever obstacks are used, it is possible to allocate all overflowed entries into a single stack, so they all can be freed in a single operation. It is not clear if the speedup is worth the trouble. */ struct obstack entry_stack; #endif }; /* A hash table contains many internal entries, each holding a pointer to some user provided data (also called a user entry). An entry indistinctly refers to both the internal entry and its associated user entry. A user entry contents may be hashed by a randomization function (the hashing function, or just `hasher' for short) into a number (or `slot') between 0 and the current table size. At each slot position in the hash table, starts a linked chain of entries for which the user data all hash to this slot. A bucket is the collection of all entries hashing to the same slot. A good `hasher' function will distribute entries rather evenly in buckets. In the ideal case, the length of each bucket is roughly the number of entries divided by the table size. Finding the slot for a data is usually done in constant time by the `hasher', and the later finding of a precise entry is linear in time with the size of the bucket. Consequently, a larger hash table size (that is, a larger number of buckets) is prone to yielding shorter chains, *given* the `hasher' function behaves properly. Long buckets slow down the lookup algorithm. One might use big hash table sizes in hope to reduce the average length of buckets, but this might become inordinate, as unused slots in the hash table take some space. The best bet is to make sure you are using a good `hasher' function (beware that those are not that easy to write! :-), and to use a table size larger than the actual number of entries. */ /* If an insertion makes the ratio of nonempty buckets to table size larger than the growth threshold (a number between 0.0 and 1.0), then increase the table size by multiplying by the growth factor (a number greater than 1.0). The growth threshold defaults to 0.8, and the growth factor defaults to 1.414, meaning that the table will have doubled its size every second time 80% of the buckets get used. */ #define DEFAULT_GROWTH_THRESHOLD 0.8 #define DEFAULT_GROWTH_FACTOR 1.414 /* If a deletion empties a bucket and causes the ratio of used buckets to table size to become smaller than the shrink threshold (a number between 0.0 and 1.0), then shrink the table by multiplying by the shrink factor (a number greater than the shrink threshold but smaller than 1.0). The shrink threshold and factor default to 0.0 and 1.0, meaning that the table never shrinks. */ #define DEFAULT_SHRINK_THRESHOLD 0.0 #define DEFAULT_SHRINK_FACTOR 1.0 /* Use this to initialize or reset a TUNING structure to some sensible values. */ static const Hash_tuning default_tuning = { DEFAULT_SHRINK_THRESHOLD, DEFAULT_SHRINK_FACTOR, DEFAULT_GROWTH_THRESHOLD, DEFAULT_GROWTH_FACTOR, false }; /* Information and lookup. */ /* The following few functions provide information about the overall hash table organization: the number of entries, number of buckets and maximum length of buckets. */ /* Return the number of buckets in the hash table. The table size, the total number of buckets (used plus unused), or the maximum number of slots, are the same quantity. */ unsigned hash_get_n_buckets (const Hash_table *table) { return table->n_buckets; } /* Return the number of slots in use (non-empty buckets). */ unsigned hash_get_n_buckets_used (const Hash_table *table) { return table->n_buckets_used; } /* Return the number of active entries. */ unsigned hash_get_n_entries (const Hash_table *table) { return table->n_entries; } /* Return the length of the longest chain (bucket). */ unsigned hash_get_max_bucket_length (const Hash_table *table) { struct hash_entry *bucket; unsigned max_bucket_length = 0; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { if (bucket->data) { struct hash_entry *cursor = bucket; unsigned bucket_length = 1; while (cursor = cursor->next, cursor) bucket_length++; if (bucket_length > max_bucket_length) max_bucket_length = bucket_length; } } return max_bucket_length; } /* Do a mild validation of a hash table, by traversing it and checking two statistics. */ bool hash_table_ok (const Hash_table *table) { struct hash_entry *bucket; unsigned n_buckets_used = 0; unsigned n_entries = 0; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { if (bucket->data) { struct hash_entry *cursor = bucket; /* Count bucket head. */ n_buckets_used++; n_entries++; /* Count bucket overflow. */ while (cursor = cursor->next, cursor) n_entries++; } } if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries) return true; return false; } void hash_print_statistics (const Hash_table *table, FILE *stream) { unsigned n_entries = hash_get_n_entries (table); unsigned n_buckets = hash_get_n_buckets (table); unsigned n_buckets_used = hash_get_n_buckets_used (table); unsigned max_bucket_length = hash_get_max_bucket_length (table); fprintf (stream, "# entries: %u\n", n_entries); fprintf (stream, "# buckets: %u\n", n_buckets); fprintf (stream, "# buckets used: %u (%.2f%%)\n", n_buckets_used, (100.0 * n_buckets_used) / n_buckets); fprintf (stream, "max bucket length: %u\n", max_bucket_length); } /* If ENTRY matches an entry already in the hash table, return the entry from the table. Otherwise, return NULL. */ void * hash_lookup (const Hash_table *table, const void *entry) { struct hash_entry *bucket = table->bucket + table->hasher (entry, table->n_buckets); struct hash_entry *cursor; assert (bucket < table->bucket_limit); if (bucket->data == NULL) return NULL; for (cursor = bucket; cursor; cursor = cursor->next) if (table->comparator (entry, cursor->data)) return cursor->data; return NULL; } /* Walking. */ /* The functions in this page traverse the hash table and process the contained entries. For the traversal to work properly, the hash table should not be resized nor modified while any particular entry is being processed. In particular, entries should not be added or removed. */ /* Return the first data in the table, or NULL if the table is empty. */ void * hash_get_first (const Hash_table *table) { struct hash_entry *bucket; if (table->n_entries == 0) return NULL; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) if (bucket->data) return bucket->data; assert (0); return NULL; } /* Return the user data for the entry following ENTRY, where ENTRY has been returned by a previous call to either `hash_get_first' or `hash_get_next'. Return NULL if there are no more entries. */ void * hash_get_next (const Hash_table *table, const void *entry) { struct hash_entry *bucket = table->bucket + table->hasher (entry, table->n_buckets); struct hash_entry *cursor; assert (bucket < table->bucket_limit); /* Find next entry in the same bucket. */ for (cursor = bucket; cursor; cursor = cursor->next) if (cursor->data == entry && cursor->next) return cursor->next->data; /* Find first entry in any subsequent bucket. */ while (++bucket < table->bucket_limit) if (bucket->data) return bucket->data; /* None found. */ return NULL; } /* Fill BUFFER with pointers to active user entries in the hash table, then return the number of pointers copied. Do not copy more than BUFFER_SIZE pointers. */ unsigned hash_get_entries (const Hash_table *table, void **buffer, unsigned buffer_size) { unsigned counter = 0; struct hash_entry *bucket; struct hash_entry *cursor; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { if (bucket->data) { for (cursor = bucket; cursor; cursor = cursor->next) { if (counter >= buffer_size) return counter; buffer[counter++] = cursor->data; } } } return counter; } /* Call a PROCESSOR function for each entry of a hash table, and return the number of entries for which the processor function returned success. A pointer to some PROCESSOR_DATA which will be made available to each call to the processor function. The PROCESSOR accepts two arguments: the first is the user entry being walked into, the second is the value of PROCESSOR_DATA as received. The walking continue for as long as the PROCESSOR function returns nonzero. When it returns zero, the walking is interrupted. */ unsigned hash_do_for_each (const Hash_table *table, Hash_processor processor, void *processor_data) { unsigned counter = 0; struct hash_entry *bucket; struct hash_entry *cursor; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { if (bucket->data) { for (cursor = bucket; cursor; cursor = cursor->next) { if (!(*processor) (cursor->data, processor_data)) return counter; counter++; } } } return counter; } /* Allocation and clean-up. */ /* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1. This is a convenience routine for constructing other hashing functions. */ #if USE_DIFF_HASH /* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see B. J. McKenzie, R. Harries & T. Bell, Selecting a hashing algorithm, Software--practice & experience 20, 2 (Feb 1990), 209-224. Good hash algorithms tend to be domain-specific, so what's good for [diffutils'] io.c may not be good for your application." */ unsigned hash_string (const char *string, unsigned n_buckets) { # ifndef CHAR_BIT # define CHAR_BIT 8 # endif # define ROTATE_LEFT(Value, Shift) \ ((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift))) # define HASH_ONE_CHAR(Value, Byte) \ ((Byte) + ROTATE_LEFT (Value, 7)) unsigned value = 0; for (; *string; string++) value = HASH_ONE_CHAR (value, *(const unsigned char *) string); return value % n_buckets; # undef ROTATE_LEFT # undef HASH_ONE_CHAR } #else /* not USE_DIFF_HASH */ /* This one comes from `recode', and performs a bit better than the above as per a few experiments. It is inspired from a hashing routine found in the very old Cyber `snoop', itself written in typical Greg Mansfield style. (By the way, what happened to this excellent man? Is he still alive?) */ unsigned hash_string (const char *string, unsigned n_buckets) { unsigned value = 0; while (*string) value = ((value * 31 + (int) *(const unsigned char *) string++) % n_buckets); return value; } #endif /* not USE_DIFF_HASH */ /* Return true if CANDIDATE is a prime number. CANDIDATE should be an odd number at least equal to 11. */ static bool is_prime (unsigned long candidate) { unsigned long divisor = 3; unsigned long square = divisor * divisor; while (square < candidate && (candidate % divisor)) { divisor++; square += 4 * divisor; divisor++; } return (candidate % divisor ? true : false); } /* Round a given CANDIDATE number up to the nearest prime, and return that prime. Primes lower than 10 are merely skipped. */ static unsigned long next_prime (unsigned long candidate) { /* Skip small primes. */ if (candidate < 10) candidate = 10; /* Make it definitely odd. */ candidate |= 1; while (!is_prime (candidate)) candidate += 2; return candidate; } void hash_reset_tuning (Hash_tuning *tuning) { *tuning = default_tuning; } /* For the given hash TABLE, check the user supplied tuning structure for reasonable values, and return true if there is no gross error with it. Otherwise, definitively reset the TUNING field to some acceptable default in the hash table (that is, the user loses the right of further modifying tuning arguments), and return false. */ static bool check_tuning (Hash_table *table) { const Hash_tuning *tuning = table->tuning; if (tuning->growth_threshold > 0.0 && tuning->growth_threshold < 1.0 && tuning->growth_factor > 1.0 && tuning->shrink_threshold >= 0.0 && tuning->shrink_threshold < 1.0 && tuning->shrink_factor > tuning->shrink_threshold && tuning->shrink_factor <= 1.0 && tuning->shrink_threshold < tuning->growth_threshold) return true; table->tuning = &default_tuning; return false; } /* Allocate and return a new hash table, or NULL upon failure. The initial number of buckets is automatically selected so as to _guarantee_ that you may insert at least CANDIDATE different user entries before any growth of the hash table size occurs. So, if have a reasonably tight a-priori upper bound on the number of entries you intend to insert in the hash table, you may save some table memory and insertion time, by specifying it here. If the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE argument has its meaning changed to the wanted number of buckets. TUNING points to a structure of user-supplied values, in case some fine tuning is wanted over the default behavior of the hasher. If TUNING is NULL, the default tuning parameters are used instead. The user-supplied HASHER function should be provided. It accepts two arguments ENTRY and TABLE_SIZE. It computes, by hashing ENTRY contents, a slot number for that entry which should be in the range 0..TABLE_SIZE-1. This slot number is then returned. The user-supplied COMPARATOR function should be provided. It accepts two arguments pointing to user data, it then returns true for a pair of entries that compare equal, or false otherwise. This function is internally called on entries which are already known to hash to the same bucket index. The user-supplied DATA_FREER function, when not NULL, may be later called with the user data as an argument, just before the entry containing the data gets freed. This happens from within `hash_free' or `hash_clear'. You should specify this function only if you want these functions to free all of your `data' data. This is typically the case when your data is simply an auxiliary struct that you have malloc'd to aggregate several values. */ Hash_table * hash_initialize (unsigned candidate, const Hash_tuning *tuning, Hash_hasher hasher, Hash_comparator comparator, Hash_data_freer data_freer) { Hash_table *table; struct hash_entry *bucket; if (hasher == NULL || comparator == NULL) return NULL; table = (Hash_table *) malloc (sizeof (Hash_table)); if (table == NULL) return NULL; if (!tuning) tuning = &default_tuning; table->tuning = tuning; if (!check_tuning (table)) { /* Fail if the tuning options are invalid. This is the only occasion when the user gets some feedback about it. Once the table is created, if the user provides invalid tuning options, we silently revert to using the defaults, and ignore further request to change the tuning options. */ free (table); return NULL; } table->n_buckets = next_prime (tuning->is_n_buckets ? candidate : (unsigned) (candidate / tuning->growth_threshold)); table->bucket = (struct hash_entry *) malloc (table->n_buckets * sizeof (struct hash_entry)); if (table->bucket == NULL) { free (table); return NULL; } table->bucket_limit = table->bucket + table->n_buckets; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { bucket->data = NULL; bucket->next = NULL; } table->n_buckets_used = 0; table->n_entries = 0; table->hasher = hasher; table->comparator = comparator; table->data_freer = data_freer; table->free_entry_list = NULL; #if USE_OBSTACK obstack_init (&table->entry_stack); #endif return table; } /* Make all buckets empty, placing any chained entries on the free list. Apply the user-specified function data_freer (if any) to the datas of any affected entries. */ void hash_clear (Hash_table *table) { struct hash_entry *bucket; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { if (bucket->data) { struct hash_entry *cursor; struct hash_entry *next; /* Free the bucket overflow. */ for (cursor = bucket->next; cursor; cursor = next) { if (table->data_freer) (*table->data_freer) (cursor->data); cursor->data = NULL; next = cursor->next; /* Relinking is done one entry at a time, as it is to be expected that overflows are either rare or short. */ cursor->next = table->free_entry_list; table->free_entry_list = cursor; } /* Free the bucket head. */ if (table->data_freer) (*table->data_freer) (bucket->data); bucket->data = NULL; bucket->next = NULL; } } table->n_buckets_used = 0; table->n_entries = 0; } /* Reclaim all storage associated with a hash table. If a data_freer function has been supplied by the user when the hash table was created, this function applies it to the data of each entry before freeing that entry. */ void hash_free (Hash_table *table) { struct hash_entry *bucket; struct hash_entry *cursor; struct hash_entry *next; /* Call the user data_freer function. */ if (table->data_freer && table->n_entries) { for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { if (bucket->data) { for (cursor = bucket; cursor; cursor = cursor->next) { (*table->data_freer) (cursor->data); } } } } #if USE_OBSTACK obstack_free (&table->entry_stack, NULL); #else /* Free all bucket overflowed entries. */ for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { for (cursor = bucket->next; cursor; cursor = next) { next = cursor->next; free (cursor); } } /* Also reclaim the internal list of previously freed entries. */ for (cursor = table->free_entry_list; cursor; cursor = next) { next = cursor->next; free (cursor); } #endif /* Free the remainder of the hash table structure. */ free (table->bucket); free (table); } /* Insertion and deletion. */ /* Get a new hash entry for a bucket overflow, possibly by reclying a previously freed one. If this is not possible, allocate a new one. */ static struct hash_entry * allocate_entry (Hash_table *table) { struct hash_entry *new; if (table->free_entry_list) { new = table->free_entry_list; table->free_entry_list = new->next; } else { #if USE_OBSTACK new = (struct hash_entry *) obstack_alloc (&table->entry_stack, sizeof (struct hash_entry)); #else new = (struct hash_entry *) malloc (sizeof (struct hash_entry)); #endif } return new; } /* Free a hash entry which was part of some bucket overflow, saving it for later recycling. */ static void free_entry (Hash_table *table, struct hash_entry *entry) { entry->data = NULL; entry->next = table->free_entry_list; table->free_entry_list = entry; } /* This private function is used to help with insertion and deletion. When ENTRY matches an entry in the table, return a pointer to the corresponding user data and set *BUCKET_HEAD to the head of the selected bucket. Otherwise, return NULL. When DELETE is true and ENTRY matches an entry in the table, unlink the matching entry. */ static void * hash_find_entry (Hash_table *table, const void *entry, struct hash_entry **bucket_head, bool delete) { struct hash_entry *bucket = table->bucket + table->hasher (entry, table->n_buckets); struct hash_entry *cursor; assert (bucket < table->bucket_limit); *bucket_head = bucket; /* Test for empty bucket. */ if (bucket->data == NULL) return NULL; /* See if the entry is the first in the bucket. */ if ((*table->comparator) (entry, bucket->data)) { void *data = bucket->data; if (delete) { if (bucket->next) { struct hash_entry *next = bucket->next; /* Bump the first overflow entry into the bucket head, then save the previous first overflow entry for later recycling. */ *bucket = *next; free_entry (table, next); } else { bucket->data = NULL; } } return data; } /* Scan the bucket overflow. */ for (cursor = bucket; cursor->next; cursor = cursor->next) { if ((*table->comparator) (entry, cursor->next->data)) { void *data = cursor->next->data; if (delete) { struct hash_entry *next = cursor->next; /* Unlink the entry to delete, then save the freed entry for later recycling. */ cursor->next = next->next; free_entry (table, next); } return data; } } /* No entry found. */ return NULL; } /* For an already existing hash table, change the number of buckets through specifying CANDIDATE. The contents of the hash table are preserved. The new number of buckets is automatically selected so as to _guarantee_ that the table may receive at least CANDIDATE different user entries, including those already in the table, before any other growth of the hash table size occurs. If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the exact number of buckets desired. */ bool hash_rehash (Hash_table *table, unsigned candidate) { Hash_table *new_table; struct hash_entry *bucket; struct hash_entry *cursor; struct hash_entry *next; new_table = hash_initialize (candidate, table->tuning, table->hasher, table->comparator, table->data_freer); if (new_table == NULL) return false; /* Merely reuse the extra old space into the new table. */ #if USE_OBSTACK obstack_free (&new_table->entry_stack, NULL); new_table->entry_stack = table->entry_stack; #endif new_table->free_entry_list = table->free_entry_list; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) if (bucket->data) for (cursor = bucket; cursor; cursor = next) { void *data = cursor->data; struct hash_entry *new_bucket = (new_table->bucket + new_table->hasher (data, new_table->n_buckets)); assert (new_bucket < new_table->bucket_limit); next = cursor->next; if (new_bucket->data) { if (cursor == bucket) { /* Allocate or recycle an entry, when moving from a bucket header into a bucket overflow. */ struct hash_entry *new_entry = allocate_entry (new_table); if (new_entry == NULL) return false; new_entry->data = data; new_entry->next = new_bucket->next; new_bucket->next = new_entry; } else { /* Merely relink an existing entry, when moving from a bucket overflow into a bucket overflow. */ cursor->next = new_bucket->next; new_bucket->next = cursor; } } else { /* Free an existing entry, when moving from a bucket overflow into a bucket header. Also take care of the simple case of moving from a bucket header into a bucket header. */ new_bucket->data = data; new_table->n_buckets_used++; if (cursor != bucket) free_entry (new_table, cursor); } } free (table->bucket); table->bucket = new_table->bucket; table->bucket_limit = new_table->bucket_limit; table->n_buckets = new_table->n_buckets; table->n_buckets_used = new_table->n_buckets_used; table->free_entry_list = new_table->free_entry_list; /* table->n_entries already holds its value. */ #if USE_OBSTACK table->entry_stack = new_table->entry_stack; #endif free (new_table); return true; } /* If ENTRY matches an entry already in the hash table, return the pointer to the entry from the table. Otherwise, insert ENTRY and return ENTRY. Return NULL if the storage required for insertion cannot be allocated. */ void * hash_insert (Hash_table *table, const void *entry) { void *data; struct hash_entry *bucket; assert (entry); /* cannot insert a NULL entry */ /* If there's a matching entry already in the table, return that. */ if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL) return data; /* ENTRY is not matched, it should be inserted. */ if (bucket->data) { struct hash_entry *new_entry = allocate_entry (table); if (new_entry == NULL) return NULL; /* Add ENTRY in the overflow of the bucket. */ new_entry->data = (void *) entry; new_entry->next = bucket->next; bucket->next = new_entry; table->n_entries++; return (void *) entry; } /* Add ENTRY right in the bucket head. */ bucket->data = (void *) entry; table->n_entries++; table->n_buckets_used++; /* If the growth threshold of the buckets in use has been reached, increase the table size and rehash. There's no point in checking the number of entries: if the hashing function is ill-conditioned, rehashing is not likely to improve it. */ if (table->n_buckets_used > table->tuning->growth_threshold * table->n_buckets) { /* Check more fully, before starting real work. If tuning arguments became invalid, the second check will rely on proper defaults. */ check_tuning (table); if (table->n_buckets_used > table->tuning->growth_threshold * table->n_buckets) { const Hash_tuning *tuning = table->tuning; unsigned candidate = (unsigned) (tuning->is_n_buckets ? (table->n_buckets * tuning->growth_factor) : (table->n_buckets * tuning->growth_factor * tuning->growth_threshold)); /* If the rehash fails, arrange to return NULL. */ if (!hash_rehash (table, candidate)) entry = NULL; } } return (void *) entry; } /* If ENTRY is already in the table, remove it and return the just-deleted data (the user may want to deallocate its storage). If ENTRY is not in the table, don't modify the table and return NULL. */ void * hash_delete (Hash_table *table, const void *entry) { void *data; struct hash_entry *bucket; data = hash_find_entry (table, entry, &bucket, true); if (!data) return NULL; table->n_entries--; if (!bucket->data) { table->n_buckets_used--; /* If the shrink threshold of the buckets in use has been reached, rehash into a smaller table. */ if (table->n_buckets_used < table->tuning->shrink_threshold * table->n_buckets) { /* Check more fully, before starting real work. If tuning arguments became invalid, the second check will rely on proper defaults. */ check_tuning (table); if (table->n_buckets_used < table->tuning->shrink_threshold * table->n_buckets) { const Hash_tuning *tuning = table->tuning; unsigned candidate = (unsigned) (tuning->is_n_buckets ? table->n_buckets * tuning->shrink_factor : (table->n_buckets * tuning->shrink_factor * tuning->growth_threshold)); hash_rehash (table, candidate); } } } return data; } /* Testing. */ #if TESTING void hash_print (const Hash_table *table) { struct hash_entry *bucket; for (bucket = table->bucket; bucket < table->bucket_limit; bucket++) { struct hash_entry *cursor; if (bucket) printf ("%d:\n", bucket - table->bucket); for (cursor = bucket; cursor; cursor = cursor->next) { char *s = (char *) cursor->data; /* FIXME */ if (s) printf (" %s\n", s); } } } #endif /* TESTING */ heroes-0.21/lib/hash.h0000644004117000411500000000663607402475440010263 /* hash - hashing table processing. Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc. Written by Jim Meyering , 1998. 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. */ /* A generic hash table package. */ /* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use obstacks instead of malloc, and recompile `hash.c' with same setting. */ #ifndef HASH_H_ # define HASH_H_ # ifndef PARAMS # if PROTOTYPES || __STDC__ # define PARAMS(Args) Args # else # define PARAMS(Args) () # endif # endif typedef unsigned (*Hash_hasher) PARAMS ((const void *, unsigned)); typedef bool (*Hash_comparator) PARAMS ((const void *, const void *)); typedef void (*Hash_data_freer) PARAMS ((void *)); typedef bool (*Hash_processor) PARAMS ((void *, void *)); struct hash_entry { void *data; struct hash_entry *next; }; struct hash_tuning { /* This structure is mainly used for `hash_initialize', see the block documentation of `hash_reset_tuning' for more complete comments. */ float shrink_threshold; /* ratio of used buckets to trigger a shrink */ float shrink_factor; /* ratio of new smaller size to original size */ float growth_threshold; /* ratio of used buckets to trigger a growth */ float growth_factor; /* ratio of new bigger size to original size */ bool is_n_buckets; /* if CANDIDATE really means table size */ }; typedef struct hash_tuning Hash_tuning; struct hash_table; typedef struct hash_table Hash_table; /* Information and lookup. */ unsigned hash_get_n_buckets PARAMS ((const Hash_table *)); unsigned hash_get_n_buckets_used PARAMS ((const Hash_table *)); unsigned hash_get_n_entries PARAMS ((const Hash_table *)); unsigned hash_get_max_bucket_length PARAMS ((const Hash_table *)); bool hash_table_ok PARAMS ((const Hash_table *)); void hash_print_statistics PARAMS ((const Hash_table *, FILE *)); void *hash_lookup PARAMS ((const Hash_table *, const void *)); /* Walking. */ void *hash_get_first PARAMS ((const Hash_table *)); void *hash_get_next PARAMS ((const Hash_table *, const void *)); unsigned hash_get_entries PARAMS ((const Hash_table *, void **, unsigned)); unsigned hash_do_for_each PARAMS ((const Hash_table *, Hash_processor, void *)); /* Allocation and clean-up. */ unsigned hash_string PARAMS ((const char *, unsigned)); void hash_reset_tuning PARAMS ((Hash_tuning *)); Hash_table *hash_initialize PARAMS ((unsigned, const Hash_tuning *, Hash_hasher, Hash_comparator, Hash_data_freer)); void hash_clear PARAMS ((Hash_table *)); void hash_free PARAMS ((Hash_table *)); /* Insertion and deletion. */ bool hash_rehash PARAMS ((Hash_table *, unsigned)); void *hash_insert PARAMS ((Hash_table *, const void *)); void *hash_delete PARAMS ((Hash_table *, const void *)); #endif heroes-0.21/lib/isdir.c0000644004117000411500000000236707267511334010444 /* isdir.c -- determine whether a directory exists Copyright (C) 1990, 1998 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. */ #if HAVE_CONFIG_H # include #endif #include #include #if STAT_MACROS_BROKEN # undef S_ISDIR #endif #if !defined S_ISDIR && defined S_IFDIR # define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR) #endif /* If PATH is an existing directory or symbolic link to a directory, return nonzero, else 0. */ int isdir (const char *path) { struct stat stats; return stat (path, &stats) == 0 && S_ISDIR (stats.st_mode); } heroes-0.21/lib/isdir.h0000644004117000411500000000013007267511334010433 #ifndef ISDIR_H_ #define ISDIR_H_ int isdir (const char *path); #endif /* ISDIR_H_ */ heroes-0.21/lib/stripslash.c0000644004117000411500000000302507353601452011513 /* stripslash.c -- remove redundant trailing slashes from a file name Copyright (C) 1990, 2001 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. */ #if HAVE_CONFIG_H # include #endif #if STDC_HEADERS || HAVE_STRING_H # include #else # include #endif #include "dirname.h" /* Remove trailing slashes from PATH. Return nonzero if a trailing slash was removed. This is useful when using filename completion from a shell that adds a "/" after directory names (such as tcsh and bash), because the Unix rename and rmdir system calls return an "Invalid argument" error when given a path that ends in "/" (except for the root directory). */ int strip_trailing_slashes (char *path) { char *base = base_name (path); char *base_lim = base + base_len (base); int had_slash = *base_lim; *base_lim = '\0'; return had_slash; } heroes-0.21/lib/unlocked-io.h0000644004117000411500000000006307402475440011535 /* Empty file, we don't use unlocked i/o here. */ heroes-0.21/lib/w_dirent.h0000644004117000411500000000436007163600422011135 /* * w_dirent.h (formerly DIRENT.H (formerly DIRLIB.H)) * * by M. J. Weinstein Released to public domain 1-Jan-89 * * Because I have heard that this feature (opendir, readdir, closedir) * it so useful for programmers coming from UNIX or attempting to port * UNIX code, and because it is reasonably light weight, I have included * it in the Mingw32 package. I have also added an implementation of * rewinddir, seekdir and telldir. * - Colin Peters * * This code is distributed in the hope that is will be useful but * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY * DISCLAMED. This includeds but is not limited to warranties of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * Stolen from Mingw32 and adapted to Heroes * by Alexandre Duret-Lutz */ #ifndef __STRICT_ANSI__ #ifndef _DIRENT_H_ #define _DIRENT_H_ #ifndef RC_INVOKED #ifdef __cplusplus extern "C" { #endif struct dirent { long d_ino; /* Always zero. */ unsigned short d_reclen; /* Always zero. */ unsigned short d_namlen; /* Length of name in d_name. */ char* d_name; /* File name. */ /* NOTE: The name in the dirent structure points to the name in the * finddata_t structure in the DIR. */ }; /* * This is an internal data structure. Good programmers will not use it * except as an argument to one of the functions below. */ typedef struct { /* disk transfer area for this dir */ struct _finddata_t dd_dta; /* dirent struct to return from dir (NOTE: this makes this thread * safe as long as only one thread uses a particular DIR struct at * a time) */ struct dirent dd_dir; /* _findnext handle */ long dd_handle; /* * Status of search: * 0 = not started yet (next entry to read is first entry) * -1 = off the end * positive = 0 based index of next entry */ short dd_stat; /* given path for dir with search pattern (struct is extended) */ char dd_name[1]; } DIR; DIR* opendir (const char*); struct dirent* readdir (DIR*); int closedir (DIR*); void rewinddir (DIR*); long telldir (DIR*); void seekdir (DIR*, long); #ifdef __cplusplus } #endif #endif /* Not RC_INVOKED */ #endif /* Not _DIRENT_H_ */ #endif /* Not __STRICT_ANSI__ */ heroes-0.21/lib/xalloc.h0000644004117000411500000000604307217356370010616 /* xalloc.h -- malloc with out-of-memory checking Copyright (C) 1990-1998, 1999, 2000 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. */ #ifndef XALLOC_H_ # define XALLOC_H_ # ifndef PARAMS # if defined PROTOTYPES || (defined __STDC__ && __STDC__) # define PARAMS(Args) Args # else # define PARAMS(Args) () # endif # endif # ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ # define __attribute__(x) # endif # endif # ifndef ATTRIBUTE_NORETURN # define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__)) # endif /* Exit value when the requested amount of memory is not available. It is initialized to EXIT_FAILURE, but the caller may set it to some other value. */ extern int xalloc_exit_failure; /* If this pointer is non-zero, run the specified function upon each allocation failure. It is initialized to zero. */ extern void (*xalloc_fail_func) PARAMS ((void)); /* If XALLOC_FAIL_FUNC is undefined or a function that returns, this message is output. It is translated via gettext. Its value is "memory exhausted". */ extern char const xalloc_msg_memory_exhausted[]; /* This function is always triggered when memory is exhausted. It is in charge of honoring the three previous items. This is the function to call when one wants the program to die because of a memory allocation failure. */ extern void xalloc_die PARAMS ((void)) ATTRIBUTE_NORETURN; void *xmalloc PARAMS ((size_t n)); void *xcalloc PARAMS ((size_t n, size_t s)); void *xrealloc PARAMS ((void *p, size_t n)); char *xstrdup PARAMS ((const char *str)); # define XMALLOC(Type, N_items) ((Type *) xmalloc (sizeof (Type) * (N_items))) # define XCALLOC(Type, N_items) ((Type *) xcalloc (sizeof (Type), (N_items))) # define XREALLOC(Ptr, Type, N_items) \ ((Type *) xrealloc ((void *) (Ptr), sizeof (Type) * (N_items))) /* Declare and alloc memory for VAR of type TYPE. */ # define NEW(Type, Var) Type *(Var) = XMALLOC (Type, 1) /* Free VAR only if non NULL. */ # define XFREE(Var) \ do { \ if (Var) \ free (Var); \ } while (0) /* Return a pointer to a malloc'ed copy of the array SRC of NUM elements. */ # define CCLONE(Src, Num) \ (memcpy (xmalloc (sizeof (*Src) * (Num)), (Src), sizeof (*Src) * (Num))) /* Return a malloc'ed copy of SRC. */ # define CLONE(Src) CCLONE (Src, 1) #endif /* !XALLOC_H_ */ heroes-0.21/lib/xmalloc.c0000644004117000411500000000553307242440052010756 /* xmalloc.c -- malloc with out of memory checking Copyright (C) 1990-1999, 2000 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. */ #if HAVE_CONFIG_H # include #endif #include #if STDC_HEADERS # include #else void *calloc (); void *malloc (); void *realloc (); void free (); #endif #if ENABLE_NLS # include # define _(Text) gettext (Text) #else # define textdomain(Domain) # define _(Text) Text #endif #define N_(Text) Text #include "error.h" #include "xalloc.h" #ifndef EXIT_FAILURE # define EXIT_FAILURE 1 #endif #ifndef HAVE_DONE_WORKING_MALLOC_CHECK "you must run the autoconf test for a properly working malloc -- see malloc.m4" #endif #ifndef HAVE_DONE_WORKING_REALLOC_CHECK "you must run the autoconf test for a properly working realloc --see realloc.m4" #endif /* Exit value when the requested amount of memory is not available. The caller may set it to some other value. */ int xalloc_exit_failure = EXIT_FAILURE; /* If non NULL, call this function when memory is exhausted. */ void (*xalloc_fail_func) PARAMS ((void)) = 0; /* If XALLOC_FAIL_FUNC is NULL, or does return, display this message before exiting when memory is exhausted. Goes through gettext. */ char const xalloc_msg_memory_exhausted[] = N_("memory exhausted"); void xalloc_die (void) { if (xalloc_fail_func) (*xalloc_fail_func) (); error (xalloc_exit_failure, 0, "%s", _(xalloc_msg_memory_exhausted)); /* The `noreturn' cannot be given to error, since it may return if its first argument is 0. To help compilers understand the xalloc_die does terminate, call exit. */ exit (EXIT_FAILURE); } /* Allocate N bytes of memory dynamically, with error checking. */ void * xmalloc (size_t n) { void *p; p = malloc (n); if (p == 0) xalloc_die (); return p; } /* Change the size of an allocated block of memory P to N bytes, with error checking. */ void * xrealloc (void *p, size_t n) { p = realloc (p, n); if (p == 0) xalloc_die (); return p; } /* Allocate memory for N elements of S bytes, with error checking. */ void * xcalloc (size_t n, size_t s) { void *p; p = calloc (n, s); if (p == 0) xalloc_die (); return p; } heroes-0.21/lib/xstrdup.c0000644004117000411500000000220707402475440011032 /* xstrdup.c -- copy a string with out of memory checking Copyright (C) 1990, 1996, 1998, 2001 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. */ #if HAVE_CONFIG_H # include #endif #if STDC_HEADERS || HAVE_STRING_H # include #else # include #endif #include #include "xalloc.h" /* Return a newly allocated copy of STRING. */ char * xstrdup (const char *string) { return strcpy (xmalloc (strlen (string) + 1), string); } heroes-0.21/lib/xstrduplwr.c0000644004117000411500000000332707324516272011565 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes 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. | | | | Heroes 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 | `------------------------------------------------------------------*/ #if HAVE_CONFIG_H # include #endif #include #include #include "xalloc.h" #include "xstrduplwr.h" #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) char * xstrduplwr (const char *in) { char *a = xmalloc (strlen (in) + 1); char *b = a; while (*in) *b++ = tolower (*in++); *b = 0; return a; } heroes-0.21/lib/xstrduplwr.h0000644004117000411500000000272107324516272011567 /*------------------------------------------------------------------. | Copyright 2001 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes 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. | | | | Heroes 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 | `------------------------------------------------------------------*/ #ifndef XSTRDUPLWR_H_ #define XSTRDUPLWR_H_ char *xstrduplwr (const char *in); #endif heroes-0.21/man/0000777004117000411500000000000007451377056007255 5heroes-0.21/man/Makefile.am0000644004117000411500000000402107352614752011217 # Copyright 2000 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 man_MANS = heroes.6 heroeslvl.6 EXTRA_DIST = $(man_MANS) MAINTAINERCLEANFILES = $(man_MANS) heroes.6 : $(srcdir)/../src/argv.c $(top_srcdir)/configure.ac @if test -f $(top_builddir)/src/heroes; then \ echo "Updating man page heroes.6"; \ $(HELP2MAN) -n 'a game like Nibbles or Tron, just better' \ -s6 $(top_builddir)/src/heroes | sed -e 's/ FSF//' > heroes.6; \ else \ echo "WARNING: The man page heroes.6 cannot be updated yet."; \ echo " Retry once the corresponding executable is built."; \ fi heroeslvl.6 : $(srcdir)/../src/heroeslvl.c $(top_srcdir)/configure.ac @if test -f $(top_builddir)/src/heroeslvl; then \ echo "Updating man page heroeslvl.6"; \ $(HELP2MAN) -N -n "inspect Heroes' level files" \ -s6 $(top_builddir)/src/heroeslvl | sed -e 's/ FSF//' > heroeslvl.6; \ else \ echo "WARNING: The man page heroeslvl.6 cannot be updated yet."; \ echo " Retry once the corresponding executable is built."; \ fi # Make sure the manual pages show a correct version before # releasing a distribution. This target is called by the top # level Makefile on `make distcheck'. man-distcheck: $(man_MANS) @for i in $(man_MANS); do \ if sed 15q $$i | fgrep -e "$(VERSION)" > /dev/null; then :; else \ echo "$$i shows wrong version; not releasing" 1>&2; \ exit 1; \ fi \ done heroes-0.21/man/Makefile.in0000644004117000411500000002263607451373564011247 # Makefile.in generated by automake 1.6 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ # Copyright 2000 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ ALLEGRO_H = @ALLEGRO_H@ AMTAR = @AMTAR@ AUTOGEN = @AUTOGEN@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ DATADIRNAME = @DATADIRNAME@ DEPDIR = @DEPDIR@ GENCAT = @GENCAT@ GGI_KEYBOARD_H = @GGI_KEYBOARD_H@ GLIBC21 = @GLIBC21@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GPERF = @GPERF@ HELP2MAN = @HELP2MAN@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LIBALT_LOCAL_XLDADD = @LIBALT_LOCAL_XLDADD@ LIBALT_XLDADD = @LIBALT_XLDADD@ LIBALT_XLDFLAGS = @LIBALT_XLDFLAGS@ LIBICONV = @LIBICONV@ LN_S = @LN_S@ MKINSTALLDIRS = @MKINSTALLDIRS@ MORE_WARNINGS_CFLAGS = @MORE_WARNINGS_CFLAGS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL_KEYSYM_H = @SDL_KEYSYM_H@ STRIP = @STRIP@ U = @U@ UNZIP = @UNZIP@ UP = @UP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ ZIP = @ZIP@ am__include = @am__include@ am__quote = @am__quote@ htmldir = @htmldir@ install_sh = @install_sh@ man_MANS = heroes.6 heroeslvl.6 EXTRA_DIST = $(man_MANS) MAINTAINERCLEANFILES = $(man_MANS) subdir = man mkinstalldirs = $(SHELL) $(top_srcdir)/tools/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = DIST_SOURCES = NROFF = nroff MANS = $(man_MANS) DIST_COMMON = Makefile.am Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu man/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) uninstall-info-am: man6dir = $(mandir)/man6 install-man6: $(man6_MANS) $(man_MANS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man6dir) @list='$(man6_MANS) $(dist_man6_MANS) $(nodist_man6_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.6*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man6dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man6dir)/$$inst; \ done uninstall-man6: @$(NORMAL_UNINSTALL) @list='$(man6_MANS) $(dist_man6_MANS) $(nodist_man6_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.6*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man6dir)/$$inst"; \ rm -f $(DESTDIR)$(man6dir)/$$inst; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir)$$dir \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: $(mkinstalldirs) $(DESTDIR)$(man6dir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* 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 "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-man install-exec-am: install-info: install-info-am install-man: install-man6 installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic uninstall-am: uninstall-info-am uninstall-man uninstall-man: uninstall-man6 .PHONY: all all-am check check-am clean clean-generic distclean \ distclean-generic distdir dvi dvi-am info info-am install \ install-am install-data install-data-am install-exec \ install-exec-am install-info install-info-am install-man \ install-man6 install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic uninstall uninstall-am \ uninstall-info-am uninstall-man uninstall-man6 heroes.6 : $(srcdir)/../src/argv.c $(top_srcdir)/configure.ac @if test -f $(top_builddir)/src/heroes; then \ echo "Updating man page heroes.6"; \ $(HELP2MAN) -n 'a game like Nibbles or Tron, just better' \ -s6 $(top_builddir)/src/heroes | sed -e 's/ FSF//' > heroes.6; \ else \ echo "WARNING: The man page heroes.6 cannot be updated yet."; \ echo " Retry once the corresponding executable is built."; \ fi heroeslvl.6 : $(srcdir)/../src/heroeslvl.c $(top_srcdir)/configure.ac @if test -f $(top_builddir)/src/heroeslvl; then \ echo "Updating man page heroeslvl.6"; \ $(HELP2MAN) -N -n "inspect Heroes' level files" \ -s6 $(top_builddir)/src/heroeslvl | sed -e 's/ FSF//' > heroeslvl.6; \ else \ echo "WARNING: The man page heroeslvl.6 cannot be updated yet."; \ echo " Retry once the corresponding executable is built."; \ fi # Make sure the manual pages show a correct version before # releasing a distribution. This target is called by the top # level Makefile on `make distcheck'. man-distcheck: $(man_MANS) @for i in $(man_MANS); do \ if sed 15q $$i | fgrep -e "$(VERSION)" > /dev/null; then :; else \ echo "$$i shows wrong version; not releasing" 1>&2; \ exit 1; \ fi \ done # 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: heroes-0.21/man/heroes.60000644004117000411500000000622107451373447010546 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.27. .TH HEROES "6" "March 2002" "Heroes 0.21" "Games" .SH NAME Heroes \- a game like Nibbles or Tron, just better .SH SYNOPSIS .B heroes [\fIOPTIONS\fR]... .SH DESCRIPTION Heroes is a game similar to the "Tron" and "Nibbles" games of yore but includes many graphical improvements and new game features. .PP Mandatory arguments to long options are mandatory for short options too. .SS "General options:" .TP \fB\-v\fR, \fB\-\-version\fR display version number .TP \fB\-h\fR, \fB\-\-help\fR display this help .TP \fB\-q\fR, \fB\-\-quiet\fR don't print warning messages .TP \fB\-Q\fR, \fB\-\-really\-quiet\fR don't even print error messages .TP \fB\-v\fR, \fB\-\-verbose\fR=\fICHANNELS\fR enable or disable debugging channels (see \fB\-\-list\fR=\fIdebug\fR for available channels) .TP \fB\-l\fR, \fB\-\-list\fR=\fIWORD\fR show some internal information; WORD can be \&'debug', 'resources', 'sound-drivers' or \&'sound-tracks' .SS "Sound options:" .TP \fB\-d\fR, \fB\-\-driver\fR=\fIN[\fR,OPTIONS] use Nth driver for sound output (0:autodetect) (see \fB\-\-list\fR=\fIsound\-drivers\fR for available Ns) .TP \fB\-S\fR, \fB\-\-no\-sound\fR disable sound .TP \fB\-X\fR, \fB\-\-no\-sfx\fR disable sound-effects .TP \fB\-m\fR, \fB\-\-mono\fR non-stereo output .TP \fB\-8\fR, \fB\-\-8bits\fR 8bits sound output .TP \fB\-i\fR, \fB\-\-high\-quality\fR high quality mixer .SS "Display options:" .TP \fB\-G\fR, \fB\-\-gfx\-options\fR=\fIOPTIONS\fR pass OPTIONS to the display driver .TP \fB\-F\fR, \fB\-\-full\-screen\fR full screen mode .TP \fB\-2\fR, \fB\-\-double\fR stretch the display twofold .TP \fB\-3\fR, \fB\-\-triple\fR stretch the display threefold .TP \fB\-4\fR, \fB\-\-quadruple\fR stretch the display fourfold .TP \fB\-e\fR, \fB\-\-even\-lines\fR display only even-lines .SS "Miscellaneous options:" .TP \fB\-\-cpu\-off\fR disable computer opponents .TP \fB\-\-default\-scores\fR restore default scores file .TP \fB\-\-default\-options\fR restore default options file .TP \fB\-\-default\-saves\fR restore default saves file .TP \fB\-s\fR, \fB\-\-swap\-sides\fR swap sides in two player mode .TP \fB\-\-no\-double\-fx\fR disable combination of rotozoom and waves .TP \fB\-g\fR, \fB\-\-go\fR skip the introduction .TP \fB\-J\fR, \fB\-\-no\-joystick\fR disable joystick handling .PP These options can be set in your file ~/.heroes/heroesrc (which is read before parsing other command line options) using a line like the following: .IP Options: \fB\-gs\fR \fB\-d3\fR,buffer=11,count=4 .PP Visit http://heroes.sourceforge.net/ for news, documentation, and updates. .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT Copyright \(co 2002 Alexandre Duret-Lutz, Romuald Genevois, Alexandre Liverneaux and Philippe Meisburger. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. .SH "SEE ALSO" The full documentation for .B Heroes is maintained as a Texinfo manual. If the .B info and .B Heroes programs are properly installed at your site, the command .IP .B info Heroes .PP should give you access to the complete manual. heroes-0.21/man/heroeslvl.60000644004117000411500000000230307451373450011253 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.27. .TH HEROESLVL "6" "March 2002" "heroeslvl (Heroes) 0.21" "Games" .SH NAME heroeslvl \- inspect Heroes' level files .SH SYNOPSIS .B heroeslvl [\fIOPTIONS\fR]... \fIlevels\fR .SH DESCRIPTION Heroeslvl is a tool used to inspect Heroes' level files. .PP Mandatory arguments to long options are mandatory for short options too. .TP \fB\-v\fR, \fB\-\-version\fR display version number .TP \fB\-h\fR, \fB\-\-help\fR display this help .TP \fB\-p\fR, \fB\-\-print\fR=\fIWHAT\fR select information to display. WHAT should be one or more of these characters: .TP d print square directions .TP f print filename .TP h print header .TP i print tile details .TP t print square type map .TP T print type keys .TP w print square wall map .TP @ print tunnels .TP \fB\-i\fR, \fB\-\-indent\fR indent everything but the filename .PP When no options are given, the default is \fB\-ipfh\fR. .SH "REPORTING BUGS" Report bugs to . .SH COPYRIGHT Copyright \(co 2002 Alexandre Duret-Lutz. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. heroes-0.21/doc/0000777004117000411500000000000007451377064007246 5heroes-0.21/doc/Makefile.am0000644004117000411500000000264507375467160011227 # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 info_TEXINFOS = heroes.texi EXTRA_DIST = doc.scm heroes.html if MAKE_HTML hdir = @htmldir@ h_DATA = heroes.html endif SUFFIXES = .html .texi.html: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) && $(MAKEINFO) --html --no-split `echo $< | sed 's,.*/,,'` AUTOGEN_OPTS = -L $(top_srcdir)/src -S $(srcdir)/doc.scm heroes.texi: $(top_srcdir)/src/debugchn.def $(top_srcdir)/src/debugchn.tpl $(srcdir)/doc.scm $(top_srcdir)/src/people.def $(top_srcdir)/src/people.tpl SOURCE_TEXI=heroes.texi $(AUTOGEN) $(AUTOGEN_OPTS) -o 'texi=tmp1.texi' $(top_srcdir)/src/debugchn.def SOURCE_TEXI=tmp1.texi $(AUTOGEN) $(AUTOGEN_OPTS) -o 'texi=tmp2.texi' --writable $(top_srcdir)/src/people.def mv tmp2.texi heroes.texi heroes-0.21/doc/Makefile.in0000644004117000411500000002746607451373563011246 # Makefile.in generated by automake 1.6 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ # Copyright 2000, 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ ALLEGRO_H = @ALLEGRO_H@ AMTAR = @AMTAR@ AUTOGEN = @AUTOGEN@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ DATADIRNAME = @DATADIRNAME@ DEPDIR = @DEPDIR@ GENCAT = @GENCAT@ GGI_KEYBOARD_H = @GGI_KEYBOARD_H@ GLIBC21 = @GLIBC21@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GPERF = @GPERF@ HELP2MAN = @HELP2MAN@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LIBALT_LOCAL_XLDADD = @LIBALT_LOCAL_XLDADD@ LIBALT_XLDADD = @LIBALT_XLDADD@ LIBALT_XLDFLAGS = @LIBALT_XLDFLAGS@ LIBICONV = @LIBICONV@ LN_S = @LN_S@ MKINSTALLDIRS = @MKINSTALLDIRS@ MORE_WARNINGS_CFLAGS = @MORE_WARNINGS_CFLAGS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL_KEYSYM_H = @SDL_KEYSYM_H@ STRIP = @STRIP@ U = @U@ UNZIP = @UNZIP@ UP = @UP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ ZIP = @ZIP@ am__include = @am__include@ am__quote = @am__quote@ htmldir = @htmldir@ install_sh = @install_sh@ info_TEXINFOS = heroes.texi EXTRA_DIST = doc.scm heroes.html @MAKE_HTML_TRUE@hdir = @htmldir@ @MAKE_HTML_TRUE@h_DATA = heroes.html SUFFIXES = .html AUTOGEN_OPTS = -L $(top_srcdir)/src -S $(srcdir)/doc.scm subdir = doc mkinstalldirs = $(SHELL) $(top_srcdir)/tools/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = DIST_SOURCES = TEXINFO_TEX = $(top_srcdir)/tools/texinfo.tex INFO_DEPS = heroes.info DVIS = heroes.dvi TEXINFOS = heroes.texi DATA = $(h_DATA) DIST_COMMON = Makefile.am Makefile.in stamp-vti version.texi all: all-am .SUFFIXES: .SUFFIXES: .html .dvi .info .ps .texi $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) $(srcdir)/version.texi: $(srcdir)/stamp-vti @: $(srcdir)/stamp-vti: heroes.texi $(top_srcdir)/configure.ac @(set `$(SHELL) $(top_srcdir)/tools/mdate-sh $(srcdir)/heroes.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp @cmp -s vti.tmp $(srcdir)/version.texi \ || (echo "Updating $(srcdir)/version.texi"; \ cp vti.tmp $(srcdir)/version.texi) -@rm -f vti.tmp @cp $(srcdir)/version.texi $@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi heroes.info: heroes.texi $(srcdir)/version.texi heroes.dvi: heroes.texi $(srcdir)/version.texi .texi.info: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ `echo $< | sed 's,.*/,,'` .texi.dvi: TEXINPUTS="$(top_srcdir)/tools$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $< .texi: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) \ && $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \ `echo $< | sed 's,.*/,,'` MAKEINFO = @MAKEINFO@ TEXI2DVI = texi2dvi DVIPS = dvips .dvi.ps: $(DVIPS) $< -o $@ uninstall-info-am: $(PRE_UNINSTALL) @if (install-info --version && \ install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file"; \ install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$file; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ (if cd $(DESTDIR)$(infodir); then \ echo " rm -f $$file $$file-[0-9] $$file-[0-9][0-9])"; \ rm -f $$file $$file-[0-9] $$file-[0-9][0-9]; \ else :; fi); \ done dist-info: $(INFO_DEPS) list='$(INFO_DEPS)'; \ for base in $$list; do \ d=$(srcdir); \ for file in $$d/$$base*; do \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f $(distdir)/$$relfile || \ cp -p $$file $(distdir)/$$relfile; \ done; \ done mostlyclean-aminfo: -rm -f heroes.aux heroes.cp heroes.cps heroes.dvi heroes.fn heroes.ky \ heroes.log heroes.pg heroes.ps heroes.toc heroes.tp heroes.vr maintainer-clean-aminfo: cd $(srcdir) && \ for i in $(INFO_DEPS); do \ rm -f $$i; \ if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ rm -f $$i-[0-9]*; \ fi; \ done hDATA_INSTALL = $(INSTALL_DATA) install-hDATA: $(h_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(hdir) @list='$(h_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " $(hDATA_INSTALL) $$d$$p $(DESTDIR)$(hdir)/$$f"; \ $(hDATA_INSTALL) $$d$$p $(DESTDIR)$(hdir)/$$f; \ done uninstall-hDATA: @$(NORMAL_UNINSTALL) @list='$(h_DATA)'; for p in $$list; do \ f="`echo $$p | sed -e 's|^.*/||'`"; \ echo " rm -f $(DESTDIR)$(hdir)/$$f"; \ rm -f $(DESTDIR)$(hdir)/$$f; \ done tags: TAGS TAGS: DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir)$$dir \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="${top_distdir}" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) $(DATA) installdirs: $(mkinstalldirs) $(DESTDIR)$(infodir) $(DESTDIR)$(hdir) 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* 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 distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-hDATA install-info-am install-exec-am: install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(infodir) @list='$(INFO_DEPS)'; \ for file in $$list; do \ d=$(srcdir); \ for ifile in echo $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9]; do \ if test -f $$ifile; then \ relfile=`expr "$$ifile" : "$$d/\(.*\)"`; \ echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \ $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \ else : ; fi; \ done; \ done @$(POST_INSTALL) @if (install-info --version && \ install-info --version | fgrep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ done; \ else : ; fi install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-aminfo mostlyclean-generic mostlyclean-vti uninstall-am: uninstall-hDATA uninstall-info-am .PHONY: all all-am check check-am clean clean-generic dist-info \ distclean distclean-generic distdir dvi dvi-am info info-am \ install install-am install-data install-data-am install-exec \ install-exec-am install-hDATA install-info install-info-am \ install-man install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean \ mostlyclean-aminfo mostlyclean-generic mostlyclean-vti \ uninstall uninstall-am uninstall-hDATA uninstall-info-am .texi.html: @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9] cd $(srcdir) && $(MAKEINFO) --html --no-split `echo $< | sed 's,.*/,,'` heroes.texi: $(top_srcdir)/src/debugchn.def $(top_srcdir)/src/debugchn.tpl $(srcdir)/doc.scm $(top_srcdir)/src/people.def $(top_srcdir)/src/people.tpl SOURCE_TEXI=heroes.texi $(AUTOGEN) $(AUTOGEN_OPTS) -o 'texi=tmp1.texi' $(top_srcdir)/src/debugchn.def SOURCE_TEXI=tmp1.texi $(AUTOGEN) $(AUTOGEN_OPTS) -o 'texi=tmp2.texi' --writable $(top_srcdir)/src/people.def mv tmp2.texi heroes.texi # 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: heroes-0.21/doc/stamp-vti0000644004117000411500000000013507451374601011022 @set UPDATED 30 March 2002 @set UPDATED-MONTH March 2002 @set EDITION 0.21 @set VERSION 0.21 heroes-0.21/doc/version.texi0000644004117000411500000000013507451373456011542 @set UPDATED 30 March 2002 @set UPDATED-MONTH March 2002 @set EDITION 0.21 @set VERSION 0.21 heroes-0.21/doc/heroes.texi0000644004117000411500000021637307451374546011360 \input texinfo @c -*-texinfo-*- @c %**start of header @setfilename heroes.info @settitle Heroes Manual @setchapternewpage odd @c %**end of header @c This is a Texinfo input file (in case it is not obvious from all the @c mess around). The Makefile in the current directory can produce @c various output format from this (including .info, .dvi and .html). @c Be careful when adding or renaming nodes into this manual. Texinfo is @c a kind of preprocessed language in the sense that it requires that @c you preprocess some part of the document before submitting it to Texinfo. @c For example the nodes needs to be hard linked together in the input file. @c This preprocessing can be done automatically under Emacs' Texinfo mode @c after you press the magic key sequence "C-u C-c C-u C-a" (this will @c update the menus, the nodes and cramp your fingers). Users of other @c editors have to do this very interesting work manually or can ask Emacs @c to do the work. This can easily be done from the command line: @c % emacs --batch --eval '(and (find-file "heroes.texi") @c (texinfo-all-menus-update t) @c (save-buffer))' @include version.texi @synindex vr cp @c register Heroes in the info directory @dircategory Games @direntry * Heroes: (heroes). A Nibbles clone, just better. * heroeslvl: (heroes)heroeslvl. Inspect Heroes levels. @end direntry @ifinfo This file documents Heroes, a Nibbles clone, just better. Copyright 2000, 2001 Alexandre Duret-Lutz Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries a copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled ``Copying'' and ``GNU General Public License'' are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end ifinfo @c This title page illustrates only one of the @c two methods of forming a title page. @titlepage @title Heroes Manual @subtitle A Nibbles clone, just better @author Alexandre Duret-Lutz @c The following two commands @c start the copyright page. @page @vskip 0pt plus 1filll Copyright 2000, 2001 Alexandre Duret-Lutz Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled ``Copying'' and ``GNU General Public License'' are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end titlepage @c ====================================================================== @node Top, Copying, (dir), (dir) @top Heroes @ifinfo This document describes Heroes, a Nibbles clone, just better. This document applies to Heroes version @value{VERSION}. @end ifinfo @menu * Copying:: Your rights. * Overview:: Heroes in brief and contact information. * Installation:: Installing Heroes. * Running:: Running Heroes. * heroeslvl:: Inspect Heroes levels. * Index:: A menu covering many topics. @detailmenu --- The Detailed Node Listing --- Overview of Heroes * Getting Heroes:: Where to download Heroes from. * Mailing lists:: Where to talk about Heroes.. * Bug Reporting:: Sending bugs, suggestions, contributions. * People:: Contributors * History:: History of the DOS version. Installation of Heroes * Libraries:: Libraries Heroes can link with. * configure:: Generic configure instructions. * configure options:: Configure options specific to heroes. * Relocatable package:: Building a relocatable package. * Machines:: Architectures where Heroes is known to work. Running Heroes * Invoking heroes:: Heroes launch-time options. * Environment:: Environment variables used by Heroes. * heroesrc:: Heroes configuration file. * Global score file:: Sharing a global score file. * Game:: Game rules. * Level editor:: How to create new levels. * Troubleshooting:: Common problems. Level editor * editor-keys:: Key used in the level editor. * editor-clicks:: How mouse is used in the editor. * tunnels:: How to setup a tunnel. * sprites:: How to setup a sprite. * animations:: How to setup animations. * departures:: How to setup departures. @samp{heroeslvl} * Invoking heroeslvl:: heroeslvl launch-time options @end detailmenu @end menu @node Copying, Overview, Top, Top @chapter Heroes Copying Conditions @cindex copying @cindex rights @cindex free @cindex distribution Heroes is "free"; this means that everyone is free to use it and free to redistribute it on a free basis. Heroes is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of Heroes that they might get from you. Specifically, we want to make sure that you have the right to give away copies of Heroes, that you receive source code or else can get it if you want it, that you can change Heroes or use pieces of it in new free programs@footnote{For instance, this section was stolen from the documentation of GNU Texinfo.}, and that you know you can do these things. To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of Heroes, 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 tell them their rights. Also, for our own protection, we must make certain that everyone finds out that there is no warranty for Heroes. If these programs are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation. The precise conditions of the license for Heroes are found in the GNU General Public License that accompanies it. @c ====================================================================== @node Overview, Installation, Copying, Top @chapter Overview of Heroes @cindex overview @cindex Nibbles @cindex Tron Heroes is similar to the "Tron" and "Nibbles" games of yore, but includes many graphical improvements and new game features. In it, you must maneuver a small vehicle around a world and collect powerups while avoiding obstacles, your opponents' trails, and even your own trail. There are five game modes available. Quest is the classical Nibbles, in Death Match you start with very long tails a must kill your opponents, in Kill'em All you must run over lemmings moving on the ground, in Time Cash or Color modes you must collect money or pyramids of color. Heroes features 12 original sound tracks, 94 levels (in 10 different tile sets) plus a level editor. Heroes source code originates from an original MS-DOS game but has been heavily modified to enhance the portability and some new features have been added. MS-DOS support has been lost by the meantime. The original MS-DOS version can still be found on the Internet but is unmaintained and should be considered obsolete. @c The original MS-DOS source code is not available and will never be. @c People wanting MS-DOS support are invited to contribute the needed @c changes to the current develop The current development focus on cleaning the code and port the game to available operating systems. Our objective is to release the version 1.0 as a clean and portable base that would allow further important works such as network support or programmable vehicles. @menu * Getting Heroes:: Where to download Heroes from. * Mailing lists:: Where to talk about Heroes.. * Bug Reporting:: Sending bugs, suggestions, contributions. * People:: Contributors * History:: History of the DOS version. @end menu @c ====================================================================== @node Getting Heroes, Mailing lists, Overview, Overview @comment node-name, next, previous, up @section Getting Heroes @cindex getting heroes @cindex download @cindex sunsite @cindex metalab @cindex ibiblio @subsection Where to fetch new releases? Heroes development is powered by the free services offered by SourceForge to the Open-Source community. The web page of Heroes is @uref{http://heroes.sourceforge.net/}. The latest releases of Heroes is always uploaded to SourceForge and available from @uref{http://sourceforge.net/projects/heroes/}. Announces are sent to the @samp{heroes-announce} mailing list (@pxref{Mailing lists}). Source code releases are also uploaded to Ibiblio (formerly MetaLab, and Sunsite)) in @file{/pub/linux/games}; see @uref{http://ibiblio.org/pub/linux/MIRRORS.html,the Ibiblio mirror list} to find your nearest mirror. You will have to wait three or four days to have the files available on Ibiblio after a release. A public CVS server is also accessible. See@* @uref{http://sourceforge.net/cvs/?group_id=7982} for details. @subsection What to download? Heroes is distributed as five packages with independent version numbering and release schedule. @table @samp @item heroes The source code, info file, and man page. @item heroes-data The level data (level maps, sprites, etc.) @item heroes-sound-tracks Sound tracks for the game (.xm files). @item heroes-sound-effects The sound effects for the game (.wav files). @item heroes-hq-sound-tracks High quality sound tracks (.xm files), they will replace some sound-tracks from @samp{heroes-sound-track}. @end table The two first packages are required, the others are optional. The game has been so split because the data and sound files are big and don't evolve as often as the code does. It would therefore be unfair to bloat the bandwidth by requiring the mirrors and users to download everything on each release. @c ====================================================================== @node Mailing lists, Bug Reporting, Getting Heroes, Overview @comment node-name, next, previous, up @section Mailing lists. Three mailing lists are available for you to report bugs, discuss about the game or get announcements of new releases. @table @samp @item heroes-bugs@@lists.sourceforge.net @cindex heroes-bugs A public mailing list for bug reports. @uref{http://lists.sourceforge.net/mailman/listinfo/heroes-bugs, subscription page}. @item heroes-discuss@@lists.sourceforge.net @cindex heroes-discuss A public mailing list for discussion (questions, criticism, suggestions, contributions, ...) on the game. @uref{http://lists.sourceforge.net/mailman/listinfo/heroes-discuss, subscription page}. @item heroes-announce@@lists.sourceforge.net @cindex heroes-announce A read-only and low traffic list for announcements of Heroes releases. Mails posted to this list are also forwarded to @samp{heroes-discuss} so you don't need to subscribe to both lists. @uref{http://lists.sourceforge.net/mailman/listinfo/heroes-announce, subscription page}. @end table @c ====================================================================== @node Bug Reporting, People, Mailing lists, Overview @comment node-name, next, previous, up @section Reporting bugs, sending suggestions or contribution @cindex bug @cindex bug report @cindex suggestions We welcome bug reports or suggestions for Heroes (either program, documentation, or data files). This program will get better only if you report the problems you encounter. Please email them to @email{heroes-bugs@@lists.sourceforge.net} or @email{heroes-discuss@@lists.sourceforge.net}. For bug reports, please include enough information to reproduce the problem, if possible. Useful information include: @itemize @bullet @item the version number of Heroes. @item hardware, operating system (and OS distribution), and compiler versions. @item any unusual options you gave to `configure'. @item the actions necessary to reproduce the bug. @item a description of the problem (sometimes, a snapshot may be a good description) and of the behavior you are expecting (this is not always obvious for everyone) @item a trace of the game, as given by running Heroes with the @samp{HEROES_DEBUG} environment variable set (to @samp{all}, for instance). @item a stack trace of the crash, if you compiled the game with debugging options (see below). @item anything else that you think would be helpful. @end itemize When in doubt whether something is needed or not, include it. It's better to include too much than to leave out something important. @cindex core dump To get useful core dumps, @samp{./configure} with @samp{--enable-debug} and @samp{--disable-sound}. @cindex patch @cindex diff Patches are most welcome; if possible, please make them with @samp{diff -u} (@pxref{Unified Format,Unified Format,diff,diff.info,Diff Manual}) or @samp{diff -c} (@pxref{Context Format,Context Format,Diff,diff.info,Diff Manual}) and include @samp{ChangeLog} entries (@pxref{Change Log,Change Log,emacs,emacs-e20,Emacs Manual}). When sending email, please do not encode or split the messages in any way if possible; it's much easier to deal with one plain text message, however large, than many small ones. @cindex contributing @cindex TODO Do not hesitate to contribute. This is YOUR game and the GPL allows you to apply any modifications you want to the game (provided that you keep those modifications under the GPL). There are numerous places where you can contribute: you can hack the code (the TODO file can give you ideas but should not be seen as a limit), design new levels, create new drawings (e.g. new sets of tiles), track some new music or add your personal touch here and there. @c ====================================================================== @node People, History, Bug Reporting, Overview @comment node-name, next, previous, up @section People @cindex authors @cindex contributors @cindex translators @cindex packagers Heroes would not be what it is presently without the following people. @c START == PEOPLE == DO NOT CHANGE THIS COMMENT @c The following text, up to `END == PEOPLE ==', @c is AutoGen'ed from ../src/people.def and people. @unnumberedsubsec Authors @itemize @bullet @item @email{duret_g@@epita.fr,Alexandre Duret-Lutz} Wrote the original source code, ported it to GNU/Linux and created a few levels. @item @email{rgenevois@@besancon.net,Romual Genevois} Had the idea of that game, designed most of it, drew the graphics, created most of the levels. @item @email{alex.livernaux@@wanadoo.fr,Alexandre Liverneaux} Composed the soundtracks. @item @email{philmeis@@mail.dotcom.fr,Philippe Meisburger} Composed the soundtracks and created some levels. @end itemize @unnumberedsubsec Contributors @itemize @bullet @item @email{octplane@@via.ecp.fr,Pierre Baillet} Support for non-8bits depth video mode with LibGGI. @item @email{uh1763@@bingo-ev.de,Uwe Hermann} Clean-ups and portability fixes. @item @email{inguin@@gmx.de,Ingo van Lil} Latin-1 characters in fonts. @end itemize @unnumberedsubsec Translators @itemize @bullet @item @email{beckers@@st-oneline.de,Hermann J. Beackers} (German) @item @email{joshb@@xs4all.nl,Jos Boersema} (Dutch) @item @email{luza.solucao@@uol.com.br,Luzemario Dantas Rocha} (Brazilian Portuguese) @item @email{alessandro.dotti@@libero.it,Alessandro Dotti} (Italian) @item @email{duret_g@@epita.fr,Alexandre Duret-Lutz} (French) @item @email{inguin@@gmx.de,Ingo van Lil} (German) @end itemize @unnumberedsubsec Packagers @itemize @bullet @item @email{Daniel_Burrows@@brown.edu,Daniel Burrows} (Debian GNU/Linux) @item @email{delvare@@ensicaen.ismra.fr,Jean Delvare} (RPM & Slackware Linux) @item @email{eloli@@hotmail.com,Eugenia Loli-Queru} (BeOS) @item @email{pixel@@mandrakesoft.com,Pascal Rigaux} (Linux-Mandrake) @item @email{sobomax@@FreeBSD.org,Maxim Sobolev} (FreeBSD) @end itemize @unnumberedsubsec Porters @itemize @bullet @item @email{S.Denis@@darkworks.com,St@'ephane Denis} (Win/Visual C) @item @email{f91-men@@nada.kth.se,Mattias Engdeg@aa{}rd} (Solaris) @item @email{sobomax@@FreeBSD.org,Maxim Sobolev} (FreeBSD) @end itemize @c END == PEOPLE == DO NOT CHANGE THIS COMMENT More people are listed in the file @file{THANKS} at the top level of the Heroes tarball. @c ====================================================================== @node History, , People, Overview @comment node-name, next, previous, up @section History of the DOS version @cindex history The next paragraphs are extracted from the DOS version of Heroes. We started this game in summer 96. The idea came form Guen. At this moment, we were only three: Guen, Toalnkor (now known as Tnk) and me (Pollux); Alexel joined us one year later. The development was going quite slow (it took us two years actually) mainly because of our studies. Maybe the fact that Guen and me communicated by (snail-)mail was another slowing down factor. I sent more than 60 letters to Guen during this two years ! During the first year, we decided to sell the game. We made a demo version (with only 10 levels, no editor, and an order form), and a CD version (with songs remixed on audio track, but not used in the game). Our main issue was the price of Midas' license (the sound engine used); we were also hesitating on the way we should distribute Heroes (shall we do it shareware or commercial ?). Finally, after a couple of wasted months we decided to spread it freeware (Enjoy !), because we thought that no one would really like to buy such a game today; today where 3D rules. Now let's talk about the content of the game. At first, Tnk decided to make some four channels songs in the old original mod format. As there were only two scores done and we were waiting for the next tunes, we used some songs from Clawz just to vary. These were 'overtaking' and 'hibakusha2' and gave a better taste to the game. So we removed old Tnk's songs and he was asked to make some more Clawz-like musics. By the time, Alexel joined and came with 10 channels XM, thus all tunes are now 8 or 10 channels XM... There were 13 tunes in the game (for a total of 2.88Mb unpacked), these are the intro tune, the menu tune, the 10 levels, and the end tune (you can't hear the later without finishing the quest game); most of them have been done by Alexel. All sprites and pictures were drawn by Guen. He first made some level-tiles and a set of hand-done previews of the game before any other work get started (I guess he has a few other projects at this state of development at home). These screens and tiles were used to make the level editor. Actually I learned C while making this editor so there is some piece of code I am not proud of into (and also in the game). When it was nearly done, I started to code the game. The first thing done was the introduction, and then came the multi-directional scroller. I remember that the first level which was loaded was sized 4x4 and wrapped in all directions; this was very small but at this time there were no tails and the vehicles were crossing the walls... Most of the levels were done by Guen. But Tnk and I also did some. Guen made a cleanup of all the levels we made: some were relegated in the EXTRALVL directory, other were simply erased. We aimed to spread the game with 100 of them, but as it is going late and that we are not going to sell the game anymore I don't know how many levels there will be. @c ====================================================================== @node Installation, Running, Overview, Top @comment node-name, next, previous, up @chapter Installation of Heroes @cindex installation @menu * Libraries:: Libraries Heroes can link with. * configure:: Generic configure instructions. * configure options:: Configure options specific to heroes. * Relocatable package:: Building a relocatable package. * Machines:: Architectures where Heroes is known to work. @end menu @c ====================================================================== @node Libraries, configure, Installation, Installation @comment node-name, next, previous, up @section Needed Libraries @cindex libraries @cindex libmikmod @cindex mikmod @cindex libggi @cindex ggi @cindex libgii @cindex gii @cindex libsdl @cindex sdl @cindex allegro @cindex Simple DirectMedia Layer Heroes can be configured to use several libraries to handle display, sound output and joystick support. Following is a list of supported libraries (hopefully you won't have to install all of them but just a subset). @itemize @bullet @item LibGGI (General Graphic Interface) can be used as a display and keyboard driver. Get it from @uref{http://www.ggi-project.org/}. @item LibGII (General Input Interface) will provide joystick support (the game can be compiled without). Get it from @uref{http://www.ggi-project.org/}. It is needed by LibGGI, by the way. @item SDL can be used as a display and keyboard driver. Recent revisions will also provide support for joysticks. Get it from @uref{http://www.libsdl.org/}. @item Allegro, a game programming library, can be used as a display, keyboard, and joystick driver. @uref{http://alleg.sourceforge.net/}. @item LibMikMod is a sound library. You don't need it if you want to compile Heroes without sound support. Get it from @uref{http://www.mikmod.org/} or from @uref{ftp://ftp.ibiblio.org/pub/linux/apps/sound/libs/}. If you install LibMikMod from sources you may want to compile LibMikMod without Alsa support (@pxref{Troubleshooting}). @item SDL_Mixer is an alternative sound engine that can be used only if you use SDL as display driver. You don't need it if you want to compile Heroes without sound support. Get it from @uref{http://www.devolution.com/~slouken/SDL/projects/SDL_mixer/}. @end itemize To summarize, install at least LibGGI, SDL, or Allegro to get video output and keyboard handling. Install LibGII to get joystick support, unless you use a recent SDL or Allegro. And install LibMikMod (or SDL_mixer if you have SDL) if you want sound output. My personal preference goes to LibGGI/LibGII and LibMikMod which give you more control over the drivers used. On the other hand, SDL seems better at doing full screen display and is maintained actively. Allegro is quite new on Unix. Heroes also supports memory debugging libraries, such as @samp{dmalloc} or @samp{efence}. See the @samp{--enable-mem-debug} option in section @ref{configure options}. @c ====================================================================== @node configure, configure options, Libraries, Installation @comment node-name, next, previous, up @section configure generic instructions @cindex configure generic instructions To be filled. @c ====================================================================== @node configure options, Relocatable package, configure, Installation @comment node-name, next, previous, up @section configure options for Heroes @cindex configure options for Heroes @samp{configure} will do its best to find the libraries and functions needed by the game. Still, you may give several options to @samp{configure} to help it, or to fine tune special features of Heroes. @table @samp @item --enable-html-doc[=DIR] @cindex --enable-html-doc[=DIR] Build and install html documentation in directory @samp{DIR}. If @samp{DIR} is not given, install in @file{$datadir/heroes/doc}. @item --disable-sound @cindex --disable-sound Turn off sound support. Sound is enabled by default, unless no sound engine is found). @item --disable-joystick @cindex --disable-joystick Do not include joystick support in the game. Joystick support is enabled by default, unless you don't have GII or joystick support in SDL. @item --with-sdl[=DIR] @cindex --with-sdl Specify that you want to link with SDL. This is the default if LibGGI is not installed. If you installed SDL in some non-standard place, you can specify the installation path as an argument. For example: @example ./configure --with-sdl=/home/adl/usr @end example @samp{configure} will then look for @file{/home/adl/usr/bin/sdl-config} and configure Heroes accordingly. @item --with-ggi[=DIR] @cindex --with-ggi Link with LibGGI. This is the default if LibGGI is installed. If you installed LibGGI in some non-standard place, you can specify the installation path as an argument @item --with-allegro[=DIR] @cindex --with-allegro Link with Allegro. This is the default is neither LibGGI not SDL can be used. If you installed Allegro in some non-standard place, you can specify the installation path as an argument @item --with-mikmod[=DIR] @cindex --with-mikmod Use LibMikMod four sound output. This is the default if LibMikMod is installed and LibGGI have been selected. You may specify where LibMikMod is installed using the optional argument. @item --with-sdl-mixer[=DIR] @cindex --with-sdl-mixer[=DIR] Use SDL_mixer for sound output. This is the default if SDL_mixer is installed and SDL has been selected. You may specify where SDL_mixer is installed using the optional argument. Using this option implies @samp{--with-sdl}. @item --disable-heroes-debug @cindex --disable-heroes-debug @cindex HEROES_DEBUG Turn off tracing support. See the description of the @samp{HEROES_DEBUG} variable (@pxref{Environment}). This is enabled by default to facilitate bug reporting. Using this options should reduce the size of the resulting binary, and speed up the game by an indiscernible amount. @end table The following options are for developing purpose. The default configuration should be suitable for end users (i.e. players) but people attempting to hack the code may want debugging symbols or compiler warnings. @table @samp @item --enable-debug @itemx --disable-debug @cindex --enable-debug @cindex --disable-debug This is a three state option. The default is to compile with debugging symbols: this produce bigger binaries but allow to get helpfull coredumps, without slowing down the game. You may want to use @samp{--enable-debug} to include more debugging data and turn on some debugging code. Use @samp{--disable-debug} to turn this off. Translators: you @emph{do want} to turn this option on, really! Because the debugging code includes some checks on the translated messages. @item --disable-optimizations @cindex --disable-optimizations Turn off compiler optimizations options. This can ease debugging. If you want to supply your own optimizations options, use something like @samp{--enable-optimizations='-O3 -march=pentium'}. @item --enable-warnings @cindex --enable-warnings Try to turn on a large bunch of compiler warnings. @item --enable-assert @cindex --enable-assert Turn on some assertions squattered over the source code. This can slow down things a bit. @item --enable-devel @cindex --enable-devel Is a shorthand for @samp{--enable-debug --disable-optimizations --enable-warnings --enable-assert}. @item --with-mpatrol @cindex --with-mpatrol @cindex mpatrol Link with MPatrol, a @samp{malloc()} debugger. @item --with-mtrace @cindex --with-mtrace @cindex mtrace Use GNU libc's @samp{mtrace()} facility to check @samp{malloc()} usage. @item --with-dmalloc @cindex --with-dmalloc @cindex dmalloc Link with Dmalloc, a @samp{malloc()} debugger. @item --with-efence @cindex --with-efence @cindex efence Link with Electric Fence, a @samp{malloc()} debugger. @item --enable-mem-debug @cindex --enable-mem-debug Check for @samp{mtrace()}, Dmalloc, or Electric Fence. Use the first found. @item --enable-gprof @cindex --enable-gprof @cindex gprof Enable profiling support with @samp{gcc}, you need @samp{gprof} to inspect the file resulting from a run of Heroes. @item --disable-display @cindex --disable-display This disable all screen output, making the game rather unplayable. This suppress decencies over third party libraries like GGI or SDL, therefore you may find it useful with some debugging tools like checkergcc. @end table @c ====================================================================== @node Relocatable package, Machines, configure options, Installation @comment node-name, next, previous, up @section Building a relocatable package @cindex relocation @dfn{Relocation} refers to the ability to install or move the game in a directory which is different from the one it has been configured for. This usually happens if you create a binary package for Heroes and don't know in advance where the user will unpack it. This section describe how Heroes find for his files, in order to allow relocatable packages. Most people don't need to read this section, only packagers might be interested. The values of the @samp{./configure} options you used to specify directories (such as @samp{--prefix}, @samp{--bindir}, or @samp{--datadir}) are all transformed into paths relative to @var{prefix} and then hardcoded into the Heroes binary. Because Heroes uses only paths relative to @var{prefix}, the relocation process is just a matter of guessing the correct value of @var{prefix} at runtime. This guess is done using various informations available: first the original value of @var{prefix} is tried, then @var{prefix} is computed from the path to the current binary (@code{argv[0]}) when available, then the content of the environment variable @samp{PATH} is used to find the binary and derive @var{prefix}, finally Heroes assumes it is running from the @var{bindir} directory. The whole process is not garanteed to succeed, but you can also override those paths with some enivronment variables (@pxref{Environment}). @c ====================================================================== @node Machines, , Relocatable package, Installation @comment node-name, next, previous, up @section Machines @cindex machines @cindex architecture Heroes has been reported to compile and run on the following architectures. Since Heroes can use SDL, GGI, or Allegro as display driver, the following list shows the driver which was used. @table @asis @item Linux/i386 (GGI, SDL, or Allegro) Should build out of the box. Packages for some Linux distributions are available from the web pages. @cartouche Suse 7.1 users, the libc shipped with your distribution (glibc-2.2-7) will crash every time Heroes calls the @code{ngettext()} function. The workaround is to configure Heroes with @samp{configure --with-included-gettext} so that it uses its own version of @code{ngettext()}. @end cartouche @cartouche Red Hat 7.0 users, the compiler shipped with your distribution (packaged as @samp{gcc-2.96-54.i386.rpm}) is an experimental version which is still @emph{bugged} despite the pile of fixes applied. It actually produces unfaithful code for Heroes, so please use another compiler. Either upgrade to a newer version (@samp{gcc-2.96-64.i386.rpm} is known to work) or use the one provided by the @samp{kgcc} package. @end cartouche @item Linux/m68k (SDL) Is reported to work when the sound (@samp{SDL_mixer}) is disabled (@samp{configure --disable-sound} or @samp{heroes -S}). Any feedback on this issue is welcome. See also the @file{BUGS} file. @item FreeBSD (SDL) Should build out of the box. Packages are available from the web pages. @item Solaris (SDL) Should build out of the box. @item Win32/MinGW32 (SDL) Can be cross-compiled (native compilation untested). The script used to cross build the Heroes package available on the web page is in the subdirectory @file{arch/mingw32}. @item Win32/VisualC (SDL) See the files in the @file{arch/VisualC} subdirectory of the Heroes CVS tree. We used to distribute these files along with the rest of the sources, but stopped because they are now completely out-of-date (they have not been updated since version 0.7). However you can use them as a start point if you think about compiling Heroes with MSVC. @item Digital Unix (GGI) Should build out of the box. @item NetBSD (SDL) I had to tweak SDL 1.1.6 to get it working, and also force Heroes' configure to use the result of @samp{sdl-config --static-libs} instead of @samp{sdl-config --libs}. Both issues should be fixed today (FIXME: need to check). @item OpenBSD 2.9 (GGI & SDL) It looks like some configure hints need to be given when using either libs. A build of Heroes configured with GGI will apperently complete successfully, however the resulting binary fails to load, with the dynamic loader complaining about a missing symbol from libpthread. So you'd rather configure Heroes with @example ./configure --with-ggi=/usr/local LDFLAGS=-pthread @end example Then Heroes appears to work fine. If you prefer to use SDL, things are different. I had to configure Heroes with @example ./configure --with-sdl=/usr/local LDFLAGS=-L/usr/X11R6/lib X11BASE=/usr/X11R6 @end example Unfortunately, the resulting binary froze when initializing SDL (in @samp{SDL_init()}). Please send us a note if you are luckier. FIXME: Look how other packages using SDL are built, I'm probably missing something. @item IRIX 6.5 (SDL) Heroes 0.7 has been reported to compile and run with SDL 1.1.3 and @samp{gcc} + libraries from @samp{freeware.sgi.com} on IRIX 6.5. @item BeOS (SDL) Heroes 0.9 has been reported to compile and run out of the box. @end table If you got Heroes working on a platform which is not listed here, please send a notice to @email{heroes-discuss@@lists.sourceforge.net}. @c ====================================================================== @node Running, heroeslvl, Installation, Top @comment node-name, next, previous, up @chapter Running Heroes @cindex running @menu * Invoking heroes:: Heroes launch-time options. * Environment:: Environment variables used by Heroes. * heroesrc:: Heroes configuration file. * Global score file:: Sharing a global score file. * Game:: Game rules. * Level editor:: How to create new levels. * Troubleshooting:: Common problems. @end menu @c ====================================================================== @node Invoking heroes, Environment, Running, Running @comment node-name, next, previous, up @section @samp{heroes} options @cindex options @cindex runtime options Heroes call be launched with various options. @table @samp @item -v @itemx --version @cindex -v @cindex --version Display Heroes version number and copyright informations. @item -h @itemx --help @cindex -h @cindex --help Print a help message about these run-time options. @item -q @itemx --quiet @cindex -q @cindex --quiet Disable warning messages. This can be useful on platform such as Windows were such messages will pop up a text window. @item -Q @itemx --really-quiet @cindex -Q @cindex --really-quiet Same as @samp{-q}, but disable error messages too. @item -vOPTIONS @itemx --verbose=CHANNELS @cindex -vOPTIONS @cindex --verbose=CHANNELS Enable debugging output. @samp{CHANNELS} can take the same values as @samp{HEROES_DEBUG} (@pxref{Environment}). @item -lWORD @itemx --list=WORD @cindex -lWORD @cindex --list=WORD Show various internal information. @samp{WORD} can be @samp{debug}, @samp{levels}, @samp{preferences}, @samp{resources}, @samp{sound-drivers}, or @samp{sound-tracks}. @samp{--list=debug} will list the available debugging channel, to be used with @samp{--verbose} or @samp{HEROES_DEBUG} (@pxref{Environment}). @samp{--list=levels} displays the list of installed levels (only the game levels, not the extra levels). @samp{--list=sound-drivers} is used to print LibMikMod's drivers list. The expected output is something like this: @example % heroes --list=sound-drivers LibMikMod version 3.1.7 Available drivers: 1 Enlightened sound daemon (EsounD) driver v0.2.12 2 Advanced Linux Sound Architecture (ALSA) driver v0.3.2 3 Open Sound System driver v1.5 4 Raw disk writer (music.raw) v1.1 5 Wav disk writer (music.wav) v1.2 6 Piped Output driver v0.1 7 Standard output driver v1.1 8 Nosound Driver v3.0 @end example @samp{--list=resources} will dump the list of file resources. File resources are kinds of aliases used internally to name files and directories. They can be overwritten in you configuration file using the @samp{setrsc:} command. This command will also list the original (default) value of the resource if it has been overwritten. @samp{--list=sound-tracks} will print the list of sound-tracks used in the game in a format compatible with the @samp{soundconf:} command (@pxref{heroesrc}). @samp{--list=preferences} will print the preferences and their values, as they would be saved in @file{~/.heroes/preferences}. @comment sound options: @item -d N[,OPTIONS] @itemx --driver=N[,OPTIONS] @cindex -d N[,OPTIONS] @cindex --driver=N[,OPTIONS] @cindex sound driver With LibMikMod, specify the driver to use. @samp{N} is the number of the driver taken from the output of @samp{heroes --list=sound-drivers}. Use @samp{0} for auto-detection. Additional options can be given to the driver, see LibMikMod's @file{README} file. With SDL_mixer, override some audio parameters. @samp{freq} and @samp{buffers} are the two recognized parameters. Example @example heroes -d freq=11050:buffers=512 @end example @item -S @itemx --no-sound Disable sound output completely (both sound tracks and sound effects). @item -X @itemx --no-sfx Disable sound effects only. @item -m @itemx --mono @cindex -m @cindex --mono Output sound in one single channel. This has no effect if the game is compiled without sound support, of course. @item -8 @itemx --8bits @cindex -8 @cindex --8bits Output sound in 8bits, rather than 16. You will need this option if you have an old sound card that can't play 16bits samples. @item -i @itemx --high-quality @cindex -i @cindex --high-quality When compiled with MikMod, use the high quality software mixer. This mixer is somewhat more expensive, but you can expect a better sound quality. When compiled with SDL_mixer, output sound in 44kHz instead of 22kHz. @comment display options @item -G OPTIONS @itemx --gfx-options=OPTIONS @cindex -G OPTIONS @cindex --gfx-options=OPTIONS @cindex target.txt @vindex GGI_DISPLAY @vindex SDL_VIDEODRIVER @cindex display driver Give additional options to the display driver. With GGI applications, the usual way to force the selection of a driver is to define the @samp{GGI_DISPLAY} environment variable. The usage and possible values of this variable are documented in the file @file{target.txt} which comes with LibGGI. If Heroes has been compiled with GGI, the option @samp{-G} will bypass the setting of @samp{GGI_DISPLAY}, as if the variable was overwritten. For instance @example % heroes -G 'tile:0,0,160,200,(x):160,0,160,200,(x)' @end example is equivalant to @example % export GGI_DISPLAY='tile:0,0,160,200,(x):160,0,160,200,(x)' % heroes @end example except that the former does not modify @samp{GGI_DISPLAY}. (BTW, the above setting uses GGI's tile driver to display Heroes in two half-windows... this maybe quite fun to try in two player mode.) It is also possible to prevent Heroes' GGI driver to request a 8 bit mode with @samp{-G not8}. This is necessary on some uncommon X setup to workaround a bug in GGI (@pxref{Troubleshooting}). Other legitimate GGI settings maybe supplied after a colon, as in @samp{-G not8:x}. As SDL applications are concerned, selection of the video driver is achieved through the @samp{SDL_VIDEODRIVER} environment variable. At the time of writting this is not documented in SDL, so you will have to either RTFS or guess the possible values. If Heroes has been compiled with SDL, the option @samp{-G} with override the setting of @samp{SDL_VIDEODRIVER}. For instance you could force SDL to use the X11 driver with @example % heroes -G x11 @end example or @example % export SDL_VIDEODRIVER=x11 % heroes @end example @item -F @itemx --full-screen @cindex -F @cindex --full-screen @cindex full screen If Heroes is compiled with SDL, this option will turn on full screen mode. Otherwise, if Heroes is compiled with GGI, this option will allow Heroes to use a video mode with any size; i.e., the video surface is not constrained to 320x200 and Heroes will just center its 320x200 output. The rational is that GGI's DGA driver doesn't switch video modes. So unless your X server run in 320x200 it would be hard to use the DGA driver otherwise. Here is the typical settings for ``full-screen'' DGA output: @example % heroes -G dga -F @end example Admittedly the name of @samp{--full-screen} is quite misleading here since this option can provide you with a 320x200 stamp centered on your 1600x1200 display... @item -2 @itemx --double @cindex -2 @cindex --double @cindex stretching Stretch the game twofold before blitting to screen. This is slow. @item -3 @itemx --triple @cindex -3 @cindex --triple @cindex stretching Stretch the game threefold before blitting to screen. This is even slower. @item -4 @itemx --quadruple @cindex -4 @cindex --quadruple @cindex stretching Stretch the game fourfold before blitting to screen. This has been requested by people which can run @samp{heroes -3} smoothly. @item -e @itemx --even-lines @cindex -e @cindex --even-lines @cindex stretching Display only even lines, leaving blank scan lines as on real arcade monitors. This will contribute to make options @samp{-2}, @samp{-3} and @samp{-4} faster. @comment miscellaneous options @item --cpu-off @cindex --cpu-off Disable computer opponents driving. The opponents are still there (there will always be four players) but they are no more driven: they turn when they hit wall. You won't want to use this options, it is here for historical reason: when the game was started in 1996 this used to suppress some overhead on slow machines. @item --default-scores @itemx --default-options @itemx --default-saves @cindex --default-scores @cindex --default-options @cindex --default-saves Don't read the corresponding file, but use default value instead. The files will be saved at the end of the game anyway, so you can use these options to revert the default value of the given file. Another way to do this is simply to delete the file, it will be created the next time Heroes run. @item -s @itemx --swap-sides @cindex -s @cindex --swap-sides Swap sides when playing in two player mode. The default is to have player one on the right and player two on the left, because the default key bindings use the arrows for player one and left letters keys for player two. @item --no-double-fx @cindex --no-double-fx Disable superposition of rotozoom and waves. This is also a prehistoric option. These two visual effects lead to a small overhead that one may not want to combine on a slow host. @item -g @itemx --go @cindex -g @cindex --go Skip the game introduction, start right on the main menu. @item -J @itemx --no-joystick @cindex -J @cindex --no-joystick Disable joystick handling. Most of the time you will use this because you don't have a joystick and are annoyed by the warning message output when heroes start. @end table @c ====================================================================== @node Environment, heroesrc, Invoking heroes, Running @comment node-name, next, previous, up @section Environment variables @cindex environment @subsection @samp{HEROES_DEBUG} @cindex @samp{HEROES_DEBUG} The very first action of Heroes when it starts is to look the environment for a @samp{HEROES_DATA_DIR} variable. If Heroes has been compiled with the @samp{--enable-heroes-debug} configure option (which is the default), this variable specify the kind of debug messages that should be printed out. Possible values are the following (they can be printed using the @samp{--list=debug} option). @c START == DEBUGCHN == DO NOT CHANGE THIS COMMENT @c The following text, up to `END == DEBUGCHN ==', @c is AutoGen'ed from ../src/debugchn.def and debugchn. @table @samp @item SECTION The different parts of the game (introduction, demonstration, menus, ...). @item SYSTEM Handling of environment variables, creation of directories, initialization of libraries. @item RESOURCE Filename Resources Handling. @item FILE Files And Directories Handling. @item LEVEL Levels Handling. @item SOUND_TRACK Sound Track Events. @item SOUND_EFFECT Sound Effects Events. @item VIDEO Events related to the display interface. @item JOYSTICK Joystick Initialization And Events. @item TIMER Timer Handling. @item MISC Miscellaneous Events. @item FADER Palette Fade Events. @item BONUS Bonus handling. @item ALL All of the above. @end table @c END == DEBUGCHN == DO NOT CHANGE THIS COMMENT Multiple values can be separated by @samp{:}, and a value is negated if prefixed by @samp{-}. For example the following command line sets @samp{HEROES_DEBUG} so that all messages get printed except those related to timer handling. @example export HEROES_DEBUG=all:-timer @end example @subsection @samp{HEROES_PREFIX} @cindex @samp{HEROES_PREFIX} The @samp{HEROES_PREFIX} indicate the base directory where Heroes was installed. It is equivalant to the @samp{--prefix} option of @samp{configure}. This variable is not found the default prefix (configured at build time) will be used, usually this is something like @samp{/usr/local} or @samp{/usr}. Type @samp{heroes --list=resources | grep prefix} to see the value actually used by Heroes. Most people don't need to set this variable. This is only useful if you got Heroes as a binary distribution and want to move files around. @subsection @samp{HEROES_DATA_DIR} @cindex @samp{HEROES_DATA_DIR} The @samp{HEROES_DATA_DIR} variable may specify the path were the data files are located. It thus allows you to relocate the data file. If this variable is not found the default path (configured at build time) will be used. Run @samp{heroes --list=resources | grep data-dir} to see the value actually used by Heroes. The path to datafiles is adjusted automatically if you set @samp{HEROES_PREFIX} (because it is a subdirectory of @samp{HEROES_PREFIX}), so most people don't need to set @samp{HEROES_DATA_DIR}. @subsection @samp{HEROES_LOCALE_DIR} @cindex @samp{HEROES_LOCALE_DIR} The @samp{HEROES_LOCALE_DIR} variable override the path were the message catalogs are looked for. The default value is hardcoded into the Heroes binary, and you can see it if you run @samp{heroes --list=resources | grep locale-dir}. As for @samp{HEROES_DATA_DIR}, changing @samp{HEROES_PREFIX} is usually enough because @samp{HEROES_LOCALE_DIR} is a subdirectory of @samp{HEROES_PREFIX}. @subsection @samp{HOME} @cindex @samp{HOME} The @samp{HOME} variable is used to locate your home directory. You can also use @samp{HEROES_HOME}. @c ====================================================================== @node heroesrc, Global score file, Environment, Running @comment node-name, next, previous, up @section @file{~/.heroes/heroesrc} @cindex heroesrc Each time you start heroes, it tries to read the system-wide configuration file @file{heroesrc} (in the @file{$datadir/heroes/etc/} directory) and from the @file{~/.heroes/heroesrc} in your home directory. @subsection @samp{option:} @cindex options You can specify options in that file, they will be processed before any options given on the command line. Put the word @samp{Options:} in front of a line, and write the options after (separated by spaces, as on the command line, except that there is no quoting or variable substitution). For example, if you want that Heroes always skip the introduction, and swap the player sides, add the following line to your @file{~/.heroes/heroesrc}: @example Options: -g -s @end example Multiple @samp{Options:} lines can be given, they are processed in order. @subsection @samp{setenv:} @cindex setenv @vindex SDL_VIDEODRIVER @cindex environment variable @cindex variable You can also have line starting with @samp{setenv:}, followed by a variable name and a value (the rest of the line, after the variable name is taken as the value). This will setup the corresponding environment variable. This provide a way to configure the used libraries. For example, to instruct SDL to use its DGA driver, use the following line: @example setenv: SDL_VIDEODRIVER dga @end example This may seam redundant with @samp{--gfx-options} and @samp{--driver} but can be used to configure other libraries. For example, setup GGI or SDL to use AAlib (the ASCII art rendering library) and configure AAlib via its @samp{AAOPTS} variable. @subsection @samp{extradir:} @cindex extradir @cindex extra levels directory Lines starting with @samp{extradir:} are used to specify additional extra levels directories. @subsection @samp{soundconf:} @cindex soundconf The @samp{soundconf:} lines are used to introduce configuration files defining the sound tracks played by the game. The format of such files is as follow: @example ALIAS:FILENAME:TITLE:AUTHOR ... @end example Where @samp{ALIAS} is the name of the sound track used internally by Heroes, @samp{FILENAME} is the filename of the sound track you want to be loaded, @samp{TITLE} is the title of the sound track, and @samp{AUTHOR} is the person who tracked that music. You may give several definitions for the same alias, in which case only the latest will be used (and of course your configuration file is read after heroes has setup its default aliases so you can overwrite them). Presently the set of used aliases include @samp{INTRO},@samp{MENU},@samp{HEROES01},@samp{HEROES02},...,@samp{HEROES10}, and @samp{ENDSCROLL}. You can overwrite them, but you can also define your own aliases: they will be available in the jukebox menu. To give one full example, imagine you want to hear @samp{/music/2nd-reality.s3m} when you are playing Heroes in the second world (desert and pyramids). What you do is this @example % cd ~/.heroes % echo "HEROES02:/music/2nd-reality.s3m:\ Second Reality:Purple Motion" > mymod % echo "soundconf: /home/adl/.heroes/mymod" >> heroesrc @end example In this example, the configuration file has been put in the @samp{~/.heroes} directory but you can put it anywhere provided the filename given after @samp{soundconf:} points to it. All that sound configuration stuff should allow you to make drop-in replacement for heroes modules. You just make a set of modules available with a configuration file that any user can get read from its @samp{~/.heroes/heroesrc}. You can run @samp{heroes --list=sound-tracks} to print the list of sound-tracks used by heroes, and hence verify the correctness of your configuration. @subsection @samp{setrsc:} @cindex setrsc @cindex file resources This follow the same format as @samp{setenv} but is used to overwrite some filenames used by the game. Heroes internally handles file or directory names using name aliases called file resources whose values (actual filenames) can be overwritten by @samp{setrsc} and are subject to variable expansion. The command @samp{heroes --list=resources} will list all the resources used by the game. @samp{data-dir} is a special resource which content is setup from the @samp{HEROES_DATA_DIR} environment variable, or from the path used to install the files when the game was built. @samp{home-dir} is initialized from the @samp{HOME} environment variable. An example of @samp{setrsc:} usage is to run the game with an alternate picture file. Say you are working on a modified version of the main font used in the game, you can override the installed picture by yours with the following line. @example setrsc: main-font /home/adl/heroes-dev/tmp/fontem.pcx @end example @subsection @samp{keepsgid:} and @samp{keepsuid:} @cindex keepsgid @cindex keepsuid @cindex suid @cindex sgid By default, if Heroes has a sgid-bit or suid-bit, it will drop all privileges once the score and saved games are open. This happens before the user configuration is read, and therefore before the display and sound are initialized. Sometime you do not want these privileges to be dropped because your setup requires them. For instance your display driver might require read/write access to /dev/mem, or a similar requirement may exist for the sound library). @samp{keepsgid: yes} and @samp{keepsuid: yes} can be used to instruct Heroes to keep the s-bit privileges for its whole life. These commands can only be used in the system-wide configuration file. @c ====================================================================== @node Global score file, Game, heroesrc, Running @comment node-name, next, previous, up @section Sharing a global score file @cindex suid @cindex sgid In its default configuration, Heroes will create a score file in each user's directory. However you may want to share a global score file for many users. This can easily be done by redefining the filename used by Heroes to read and write the score file. This filename is a resource, so it can be overwritten in an @file{heroesrc} configuration file. If you are the installer of Heroes, you can do this from the system wide @file{heroesrc} with a line like the following @example setrsc: score-file $(sys-dir)/scores @end example The same considerations apply to saved games (@samp{saved-games-file}). @samp{$(sys-dir)} is another resource the value of which defaults to @samp{/var/games/heroes}. According to the Filesystem Hierarchy Standard this is the place where you should store modifiable game files. If you need to change this, simply add another @samp{setrsc:} line: @example setrsc: sys-dir /site/var/games/heroes @end example By the way, you will have to create the @samp{$(sys-dir)} directory yourself, because Heroes is not smart enough (and probably doesn't have the right to create that directory anyway). Now you have to make several choices regarding the policy for granting access to that file. This is a global score files, so you need to devise a setup which allows Heroes to write that file whoever run the game. The most straightforward way to allow this is to create the @file{scores} file with @samp{666} permission... you probably don't want to do this because everybody would be allowed to damage the file. A cleaner idea is to create a special user or group to own that file, and grant @samp{heroes} the appropriate rights (set-user-id or set-group-id). Setting @samp{heroes} as a set-user-id program is a security problem, because if someone manage to get @samp{heroes} to execute arbitrary code, he can have the game overwriting itself. So the correct solution is to set @samp{heroes} as a set-group-id program, and make the score file writable only by that group. At worse, if someone manage to break into @samp{heroes}, s/he will only be able to damage the score file. Here is a sample setup where @samp{heroes} is configured as a set-group-id program for a group called `@samp{games}': @example % cd /usr/games && ls -l heroes -r-xr-sr-x 1 root games 2074633 Mar 25 22:29 heroes % cd /var/games/heroes && ls -la drwxr-xr-x 2 root games 4096 Mar 25 22:35 ./ drwxr-xr-x 4 root root 4096 Mar 25 19:59 ../ -rw-rw-r-- 1 root games 2291 Mar 25 22:35 scores @end example Note that @file{/var/games/heroes} is not writable by group @samp{games}, so you have to create the file @samp{scores} before Heroes can use it. When @samp{heroes} is run as a set-group-id or set-user-id program, it executes some code to drop this privilege whenever possible. Basically, it will revert its effective-group-id and effective-user-id to the player's group-id and user-id on startup and only switch back to it's file-group-id and file-user-id when it needs to write to a file in the @samp{$(sys-dir)} directory. This is what the @samp{$(sys-dir)} resource is for: a file which is beyond that directory is opened with the file-group&user-id (i.e. group `games' in the above example), any other file is opened using the player's group(s) and user-id. The visible consequence is that files created in the @samp{~/.heroes} directory won't be owned by group @samp{games} (or whatever you chose). Finally, note that Heroes does keep track of how a resource has been setup, and wont switch persona when @samp{$(sys-dir)} or @samp{$(score-file)} has been setup in a non-trusted way. Roughly, all hard-coded and system-wide settings are trusted, while the user's personal settings are untrusted. @c ====================================================================== @node Game, Level editor, Global score file, Running @comment node-name, next, previous, up @section Game @cindex game Heroes has an `INFO' menu, that should describe the different game modes and options, with pictures and colors. Please refer to it until this section is written. @c ====================================================================== @node Level editor, Troubleshooting, Game, Running @comment node-name, next, previous, up @section Level editor @cindex level editor @cindex editor The level editor is available from the `editor' entry in the main menu. Created levels will be stored in your @file{~/.heroes/levels} directory. This editor is a cut down version of the one that served us to build all 100 levels of this game. This one will allow you to construct your own levels in a quite simplified manner. On the left side of the screen, you can see a part of your level. You can move with keyboard or mouse (read the two next sections). In the middle of the screen you can see the set of all the available tiles. You will pick tiles here to build you level. And on the right there is some informations about the level and the selected (orange box) tile. @menu * editor-keys:: Key used in the level editor. * editor-clicks:: How mouse is used in the editor. * tunnels:: How to setup a tunnel. * sprites:: How to setup a sprite. * animations:: How to setup animations. * departures:: How to setup departures. @end menu @c ====================================================================== @node editor-keys, editor-clicks, Level editor, Level editor @comment node-name, next, previous, up @subsection Editor keys @cindex editor keys @cindex keys, in editor Here is the list of keys used in the level-editor. You will have to learn most of them because most of these actions are available only as key-bindings. @table @kbd @item @key{F3} Toggle sprite and vehicle display. @item @key{F5} Toggle collide tests display. @item @key{ESC} Quit and save. @item @key{Ctrl}-@key{Left} @itemx @key{Ctrl}-@key{Right} @itemx @key{Ctrl}-@key{Up} @itemx @key{Ctrl}-@key{Down} @itemx @key{Ctrl}-@key{PageUp} @itemx @key{Ctrl}-@key{PageDown} @itemx @key{Ctrl}-@key{Home} @itemx @key{Ctrl}-@key{End} Move the cursor in the tiles side. @item @key{Left} @itemx @key{Right} @itemx @key{Up} @itemx @key{Down} Move the cursor in the level side. @item @key{SPC} Copy a tile. @item @key{d} Setup starting positions on the selected tile. @item @key{Ctrl}-@key{f} Fill the whole level with the selected tile. @item @key{Meta}-@key{f} @itemx @key{Alt}-@key{f} Fill the whole level with the two first tiles (for the 10th set of tiles). @item @key{p} Output the level map as a big @file{pcx} file. The file is saved in the current directory, and the file name is made by appending @samp{.pcx} to the level name. @item @key{s} Copy a sprite, or remove a sprite. @item @key{t} Select the tile for tunnel destination. @item @key{RET} View the level map in full screen. @item @key{Ctrl}-@key{RET} Play animations. @end table @c ====================================================================== @node editor-clicks, tunnels, editor-keys, Level editor @comment node-name, next, previous, up @subsection Editor clicks @cindex editor clicks @cindex mouse, in editor You can select a tiles by clicking on it with the left mouse button. Keeping this button pulled down will allow you to move the map without using the keyboard. The middle button (if you have one) used in the left side will temporally select a tile, as if you were using the @kbd{t} key. The right button, used in the left side, will copy a tile to the pointed tile, in a way it behaves like the space key. @c ====================================================================== @node tunnels, sprites, editor-clicks, Level editor @comment node-name, next, previous, up @subsection Tunnels @cindex tunnels Copy your two tiles that are the entrances of your tunnel. Move the box-pointer on one, and select it if the @kbd{@key{t}} key (or click on it with the middle button). Once you will move the pointer, this tile will appear in a dashed box. Move on the second tunnel and click on the @samp{[GO TO]} box that is on the right of your screen. Now you have set up the first way: for now if your were playing on this level you could go from this place to the dashed one, but from the dashed to this one. So you also have to set up the tunnel in the other way: select the current tiles with @kbd{@key{t}}, move on the former and click on @samp{[GO TO]}. That's all. Notice that with this technique you can also typeset some kind of triangular tunnel. Let @samp{A}, @samp{B}, @samp{C} be the entrances, you could setup the way like that @samp{A->B}, @samp{B->C}, and @samp{C->A}. The coordinate @samp{0x0} if used for the destination denotes a non-setup way. That's why you can't put a tunnel on the @samp{0x0} position. @c ====================================================================== @node sprites, animations, tunnels, Level editor @comment node-name, next, previous, up @subsection Sprites @cindex sprites With some set of tiles (like the Egyptian one), there are tiles (like palm trees) designed to be used as `sprites', i.e. put over others with transparency. You have to use the @kbd{@key{s}} key for this: @itemize @bullet @item copy the ground tile with @kbd{@key{SPC}} or the first button @item copy the sprite tile with @kbd{@key{s}} (and if you don't see any sprite on the level, press @kbd{@key{F3}}). @end itemize @c ====================================================================== @node animations, departures, sprites, Level editor @comment node-name, next, previous, up @subsection Animations @cindex animations You may have noticed that during the game, some tiles are animated: color cycle (like the speed arrows) or moving objects (ventilators). Each frame of an animation is actually a separate tile. The different tiles of an animations are drawn horizontally in the sets. To setup an animation, you just have to select the first one and copy it into your level. Optionally, press @kbd{@key{Ctrl}-@key{RET}} to see the animation. When the orange box is on an animated tile, you should find a button on the right to modify the speed: the greater the number is, the slower the animation goes. @c ====================================================================== @node departures, , animations, Level editor @comment node-name, next, previous, up @subsection Departures @cindex departures Select a tile and press the @kbd{@key{d}} key. Then look at the right side, select a color and click on the arrow you want (if you don't see any vehicle on the level, press @kbd{@key{F3}}). @c ====================================================================== @node Troubleshooting, , Level editor, Running @comment node-name, next, previous, up @section Troubleshooting @cindex troubleshooting @subsection Video mode @cindex video mode @vindex GGI_DISPLAY @cindex --gfx-options @cindex X This game was primary made for MS-DOS, with VGA 320x200x8bits display. If GGI is used to manage the video modes and you run into trouble with video modes, I suggest you play with a environment variable called @samp{GGI_DISPLAY} used to select the display used. LibGGI come with a file @file{env.txt} that describes this variable. As an alternative you may use heroes' @samp{--gfx-options} option instead of the above variable. If you want to force X display, you can add a line @example Options: --gfx-options=X @end example in your @file{~/.heroes/heroesrc} file. Note: @samp{--gfx-options} has no effect if you are using SDL. We suggest you to run the game under X because in console modes (libvga, frame buffers, ...) it's easy to get stuck if the game freeze. People using an X server that supports 8bit visuals although the default visual is not 8bit (run @code{xdpyinfo} to see a list of visuals that your X server supports) are subject to what is probably a GGI bug. Basically GGI's X driver fails to allocate the 8bit mode correctly. The symptom is @example X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 1 (X_CreateWindow) Serial number of failed request: 24 Current serial number in output stream: 31 @end example One workaround is to prevent Heroes from negociating a 8bit video mode. Specify @samp{--gfx-options not8} to that effect. The default visual depth for your server will then be selected by GGI. (Of course this is slower because Heroes internally works in 8bit mode; use of another display depth involves a conversion.) @subsection Keyboard @cindex keyboard @cindex keys @cindex key codes There is a menu `KEYS' in the submenu `OPTIONS' that lets you change the key bindings used during the game. Please set the keys here before playing since key codes can vary from place to place (hmm... is that right?). @subsection Sound effects @cindex sound effects @cindex sfx @cindex delay You may find that there is some delay between an action and the associated sound effect. This is because libmikmod is polling in a buffer and is thus always one buffer ahead in the playback. It is possible to reduce the size of that buffer using some driver parameters, please see the section `DRIVER PARAMETERS' of libmikmod's @file{README}. For instance I'm using the OSS driver and I reduce the size of libmikmod's buffer by running heroes with the line @example Options: -d3,buffer=11,count=4 @end example in my @file{~/.heroes/heroesrc} file. If you can find correct values for other drivers, please send them to @email{duret_g@@epita.fr,me}! @subsection Sound errors @cindex sound errors @cindex errors If Heroes try to tell you that: @example Could not initialize sound, reason: Could not set sample size @end example That means that MikMod couldn't setup the 16bits output, may be because your sound card doesn't support that. Use the @samp{-8} option to have the game running with 8bits sound output. If you get: @example Could not initialize sound, reason: Could not set mono/stereo setting @end example You will have to run the game with @samp{-m}, because stereo is not available. Remember that you can always put these options in your @samp{~/.heroes/heroes} file (@pxref{heroesrc}) so that you don't need to type them every time you run the game. @subsection SegFault when using Alsa drivers with and LibMikMod @cindex Alsa @cindex sound errors @cindex LibMikMod and Alsa If you are using Alsa 0.5.x drivers@footnote{Alsa is a project to improve the Linux sound subsystem@* (See @uref{http://www.alsa-project.org/,the Alsa page} for details).} Heroes is likely to crash during it's startup. This is because the current version of LibMikMod (3.1.9 at the time of writing) lacks support for Alsa 0.5. A solution is to run Alsa in OSS-emulation mode: simply run @samp{heroes -d x} (where x is the OSS driver number printed by @samp{heroes -n}) to force LibMikMod using its OSS@footnote{Open Sound System is a set of device drivers that provide a uniform API across all the major UNIX architectures. The Linux kernel contain free code from the commercial OSS (See @uref{http://www.linux.org.uk/OSS/,this page} for details).} interface. As a more general solution, you may want to compile LibMikMod without Alsa support (@samp{./configure --disable-alsa}) so that it never crash for any application. @c ====================================================================== @node heroeslvl, Index, Running, Top @comment node-name, next, previous, up @chapter @samp{heroeslvl} @cindex heroeslvl @samp{heroeslvl} is a tool that can be used to inspect the content of Heroes level files. This is of almost no interest to the usual Heroes player, but can sometime be helpful to find bugs in levels. @menu * Invoking heroeslvl:: heroeslvl launch-time options @end menu @c ====================================================================== @node Invoking heroeslvl, , heroeslvl, heroeslvl @comment node-name, next, previous, up @section @samp{heroeslvl} options @cindex Invoking heroeslvl @samp{heroeslvl} takes a list of levels to inspect in argument, and support the following options. When no options are given, @samp{heroeslvl} defaults to @samp{-ipfh}. @table @samp @item -v @itemx --version @cindex -v @cindex --version Display @samp{heroeslvl} version number and copyright informations. @item -h @itemx --help @cindex -h @cindex --help Print a help message about these run-time options. @item -p WHAT @itemx --print=WHAT @cindex -p @cindex --print Select what information @samp{heroeslvl} should display. @samp{WHAT} can be one or more of the following characters. @table @samp @item d @cindex -pd Print square directions. Square directions are used on tunnel to indicate the entrance direction, and on speed tiles to indicate the direction of the acceleration. @item f @cindex -pf Print the filename of each processed file. @item h @cindex -ph Print header information. This include level size, soundtrack and tilesets to use, starting positions... @item i @cindex -pi Print tile details. This will display a list of all tiles, along with some of their attributes (type of the tile, adress of its sprite, animation information). @item t @cindex -pt Print square type map. Display a map of the level, rendering each square with a character indicating the square type. @item T @cindex -pT Display the character used as type keys in the @samp{-pt} output. @item w @cindex -pw Print wall map. Display a map of the level, rendering each square with a character indicating the number of neighboring walls. (Walls are just bits indicating the directions that can be used to exit from a square; they not always map to something visible on the level.) @item @@ @cindex -p@@ Print the list of tunnels, with position, direction, and destination. @end table @item -i @itemx --indent @cindex -i @cindex --indent Indent everything but the filenames of each level processed. Note that filenames are only displayed if requested by @samp{-pf}. @end table @c ====================================================================== @node Index, , heroeslvl, Top @comment node-name, next, previous, up @chapter Index @cindex index @printindex cp @contents @bye heroes-0.21/doc/doc.scm0000644004117000411500000000236007375467160010436 ; Copyright 2001 Alexandre Duret-Lutz ; ; This file is part of Heroes. ; ; Heroes 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. ; ; Heroes 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 (define (source-texi) (or (getenv "SOURCE_TEXI") (error "You should set the environment variable SOURCE_TEXI."))) (define (import-head marker) (string-append (shellf "sed -n '1,/@c START == %s == /p' %s" marker (source-texi)) (sprintf "\n@c The following text, up to `END == %s ==',\n" marker) (sprintf "@c is AutoGen'ed from %s and %s.\n" (def-file) (tpl-file)))) (define (import-tail marker) (shellf "sed -n '/@c END == %s == /,$p' %s" marker (source-texi))) heroes-0.21/doc/heroes.html0000644004117000411500000025273307451374631011346 Heroes Manual

Heroes Manual


Node:Top, Next:, Previous:(dir), Up:(dir)

Heroes


Node:Copying, Next:, Previous:Top, Up:Top

Heroes Copying Conditions

Heroes is "free"; this means that everyone is free to use it and free to redistribute it on a free basis. Heroes is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of Heroes that they might get from you.

Specifically, we want to make sure that you have the right to give away copies of Heroes, that you receive source code or else can get it if you want it, that you can change Heroes or use pieces of it in new free programs1, and that you know you can do these things.

To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of Heroes, 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 tell them their rights.

Also, for our own protection, we must make certain that everyone finds out that there is no warranty for Heroes. If these programs are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation.

The precise conditions of the license for Heroes are found in the GNU General Public License that accompanies it.


Node:Overview, Next:, Previous:Copying, Up:Top

Overview of Heroes

Heroes is similar to the "Tron" and "Nibbles" games of yore, but includes many graphical improvements and new game features.

In it, you must maneuver a small vehicle around a world and collect powerups while avoiding obstacles, your opponents' trails, and even your own trail.

There are five game modes available. Quest is the classical Nibbles, in Death Match you start with very long tails a must kill your opponents, in Kill'em All you must run over lemmings moving on the ground, in Time Cash or Color modes you must collect money or pyramids of color. Heroes features 12 original sound tracks, 94 levels (in 10 different tile sets) plus a level editor.

Heroes source code originates from an original MS-DOS game but has been heavily modified to enhance the portability and some new features have been added. MS-DOS support has been lost by the meantime. The original MS-DOS version can still be found on the Internet but is unmaintained and should be considered obsolete.

The current development focus on cleaning the code and port the game to available operating systems. Our objective is to release the version 1.0 as a clean and portable base that would allow further important works such as network support or programmable vehicles.


Node:Getting Heroes, Next:, Previous:Overview, Up:Overview

Getting Heroes

Where to fetch new releases?

Heroes development is powered by the free services offered by SourceForge to the Open-Source community. The web page of Heroes is http://heroes.sourceforge.net/.

The latest releases of Heroes is always uploaded to SourceForge and available from http://sourceforge.net/projects/heroes/. Announces are sent to the heroes-announce mailing list (see Mailing lists).

Source code releases are also uploaded to Ibiblio (formerly MetaLab, and Sunsite)) in /pub/linux/games; see the Ibiblio mirror list to find your nearest mirror. You will have to wait three or four days to have the files available on Ibiblio after a release.

A public CVS server is also accessible. See
http://sourceforge.net/cvs/?group_id=7982 for details.

What to download?

Heroes is distributed as five packages with independent version numbering and release schedule.

heroes
The source code, info file, and man page.
heroes-data
The level data (level maps, sprites, etc.)
heroes-sound-tracks
Sound tracks for the game (.xm files).
heroes-sound-effects
The sound effects for the game (.wav files).
heroes-hq-sound-tracks
High quality sound tracks (.xm files), they will replace some sound-tracks from heroes-sound-track.

The two first packages are required, the others are optional.

The game has been so split because the data and sound files are big and don't evolve as often as the code does. It would therefore be unfair to bloat the bandwidth by requiring the mirrors and users to download everything on each release.


Node:Mailing lists, Next:, Previous:Getting Heroes, Up:Overview

Mailing lists.

Three mailing lists are available for you to report bugs, discuss about the game or get announcements of new releases.

heroes-bugs@lists.sourceforge.net

A public mailing list for bug reports. subscription page.

heroes-discuss@lists.sourceforge.net

A public mailing list for discussion (questions, criticism, suggestions, contributions, ...) on the game. subscription page.

heroes-announce@lists.sourceforge.net

A read-only and low traffic list for announcements of Heroes releases. Mails posted to this list are also forwarded to heroes-discuss so you don't need to subscribe to both lists. subscription page.


Node:Bug Reporting, Next:, Previous:Mailing lists, Up:Overview

Reporting bugs, sending suggestions or contribution

We welcome bug reports or suggestions for Heroes (either program, documentation, or data files). This program will get better only if you report the problems you encounter. Please email them to heroes-bugs@lists.sourceforge.net or heroes-discuss@lists.sourceforge.net. For bug reports, please include enough information to reproduce the problem, if possible. Useful information include:

  • the version number of Heroes.
  • hardware, operating system (and OS distribution), and compiler versions.
  • any unusual options you gave to `configure'.
  • the actions necessary to reproduce the bug.
  • a description of the problem (sometimes, a snapshot may be a good description) and of the behavior you are expecting (this is not always obvious for everyone)
  • a trace of the game, as given by running Heroes with the HEROES_DEBUG environment variable set (to all, for instance).
  • a stack trace of the crash, if you compiled the game with debugging options (see below).
  • anything else that you think would be helpful.

When in doubt whether something is needed or not, include it. It's better to include too much than to leave out something important.

To get useful core dumps, ./configure with --enable-debug and --disable-sound.

Patches are most welcome; if possible, please make them with diff -u (see Unified Format) or diff -c (see Context Format) and include ChangeLog entries (see Change Log).

When sending email, please do not encode or split the messages in any way if possible; it's much easier to deal with one plain text message, however large, than many small ones.

Do not hesitate to contribute. This is YOUR game and the GPL allows you to apply any modifications you want to the game (provided that you keep those modifications under the GPL). There are numerous places where you can contribute: you can hack the code (the TODO file can give you ideas but should not be seen as a limit), design new levels, create new drawings (e.g. new sets of tiles), track some new music or add your personal touch here and there.


Node:People, Next:, Previous:Bug Reporting, Up:Overview

People

Heroes would not be what it is presently without the following people.

Authors

Contributors

Translators

Packagers

Porters

More people are listed in the file THANKS at the top level of the Heroes tarball.


Node:History, Previous:People, Up:Overview

History of the DOS version

The next paragraphs are extracted from the DOS version of Heroes.

We started this game in summer 96. The idea came form Guen. At this moment, we were only three: Guen, Toalnkor (now known as Tnk) and me (Pollux); Alexel joined us one year later. The development was going quite slow (it took us two years actually) mainly because of our studies. Maybe the fact that Guen and me communicated by (snail-)mail was another slowing down factor. I sent more than 60 letters to Guen during this two years ! During the first year, we decided to sell the game. We made a demo version (with only 10 levels, no editor, and an order form), and a CD version (with songs remixed on audio track, but not used in the game). Our main issue was the price of Midas' license (the sound engine used); we were also hesitating on the way we should distribute Heroes (shall we do it shareware or commercial ?). Finally, after a couple of wasted months we decided to spread it freeware (Enjoy !), because we thought that no one would really like to buy such a game today; today where 3D rules.

Now let's talk about the content of the game. At first, Tnk decided to make some four channels songs in the old original mod format. As there were only two scores done and we were waiting for the next tunes, we used some songs from Clawz just to vary. These were 'overtaking' and 'hibakusha2' and gave a better taste to the game. So we removed old Tnk's songs and he was asked to make some more Clawz-like musics. By the time, Alexel joined and came with 10 channels XM, thus all tunes are now 8 or 10 channels XM... There were 13 tunes in the game (for a total of 2.88Mb unpacked), these are the intro tune, the menu tune, the 10 levels, and the end tune (you can't hear the later without finishing the quest game); most of them have been done by Alexel.

All sprites and pictures were drawn by Guen. He first made some level-tiles and a set of hand-done previews of the game before any other work get started (I guess he has a few other projects at this state of development at home). These screens and tiles were used to make the level editor. Actually I learned C while making this editor so there is some piece of code I am not proud of into (and also in the game). When it was nearly done, I started to code the game. The first thing done was the introduction, and then came the multi-directional scroller. I remember that the first level which was loaded was sized 4x4 and wrapped in all directions; this was very small but at this time there were no tails and the vehicles were crossing the walls...

Most of the levels were done by Guen. But Tnk and I also did some. Guen made a cleanup of all the levels we made: some were relegated in the EXTRALVL directory, other were simply erased. We aimed to spread the game with 100 of them, but as it is going late and that we are not going to sell the game anymore I don't know how many levels there will be.


Node:Installation, Next:, Previous:Overview, Up:Top

Installation of Heroes


Node:Libraries, Next:, Previous:Installation, Up:Installation

Needed Libraries

Heroes can be configured to use several libraries to handle display, sound output and joystick support. Following is a list of supported libraries (hopefully you won't have to install all of them but just a subset).

To summarize, install at least LibGGI, SDL, or Allegro to get video output and keyboard handling. Install LibGII to get joystick support, unless you use a recent SDL or Allegro. And install LibMikMod (or SDL_mixer if you have SDL) if you want sound output.

My personal preference goes to LibGGI/LibGII and LibMikMod which give you more control over the drivers used. On the other hand, SDL seems better at doing full screen display and is maintained actively. Allegro is quite new on Unix.

Heroes also supports memory debugging libraries, such as dmalloc or efence. See the --enable-mem-debug option in section configure options.


Node:configure, Next:, Previous:Libraries, Up:Installation

configure generic instructions

To be filled.


Node:configure options, Next:, Previous:configure, Up:Installation

configure options for Heroes

configure will do its best to find the libraries and functions needed by the game. Still, you may give several options to configure to help it, or to fine tune special features of Heroes.

--enable-html-doc[=DIR]
Build and install html documentation in directory DIR. If DIR is not given, install in $datadir/heroes/doc.
--disable-sound
Turn off sound support. Sound is enabled by default, unless no sound engine is found).
--disable-joystick
Do not include joystick support in the game. Joystick support is enabled by default, unless you don't have GII or joystick support in SDL.
--with-sdl[=DIR]
Specify that you want to link with SDL. This is the default if LibGGI is not installed. If you installed SDL in some non-standard place, you can specify the installation path as an argument. For example:
./configure --with-sdl=/home/adl/usr
configure will then look for /home/adl/usr/bin/sdl-config and configure Heroes accordingly.
--with-ggi[=DIR]
Link with LibGGI. This is the default if LibGGI is installed. If you installed LibGGI in some non-standard place, you can specify the installation path as an argument
--with-allegro[=DIR]
Link with Allegro. This is the default is neither LibGGI not SDL can be used. If you installed Allegro in some non-standard place, you can specify the installation path as an argument
--with-mikmod[=DIR]
Use LibMikMod four sound output. This is the default if LibMikMod is installed and LibGGI have been selected. You may specify where LibMikMod is installed using the optional argument.
--with-sdl-mixer[=DIR]
Use SDL_mixer for sound output. This is the default if SDL_mixer is installed and SDL has been selected. You may specify where SDL_mixer is installed using the optional argument. Using this option implies --with-sdl.
--disable-heroes-debug
Turn off tracing support. See the description of the HEROES_DEBUG variable (see Environment). This is enabled by default to facilitate bug reporting. Using this options should reduce the size of the resulting binary, and speed up the game by an indiscernible amount.

The following options are for developing purpose. The default configuration should be suitable for end users (i.e. players) but people attempting to hack the code may want debugging symbols or compiler warnings.

--enable-debug
--disable-debug
This is a three state option. The default is to compile with debugging symbols: this produce bigger binaries but allow to get helpfull coredumps, without slowing down the game. You may want to use --enable-debug to include more debugging data and turn on some debugging code. Use --disable-debug to turn this off. Translators: you do want to turn this option on, really! Because the debugging code includes some checks on the translated messages.
--disable-optimizations
Turn off compiler optimizations options. This can ease debugging. If you want to supply your own optimizations options, use something like --enable-optimizations='-O3 -march=pentium'.
--enable-warnings
Try to turn on a large bunch of compiler warnings.
--enable-assert
Turn on some assertions squattered over the source code. This can slow down things a bit.
--enable-devel
Is a shorthand for --enable-debug --disable-optimizations --enable-warnings --enable-assert.
--with-mpatrol
Link with MPatrol, a malloc() debugger.
--with-mtrace
Use GNU libc's mtrace() facility to check malloc() usage.
--with-dmalloc
Link with Dmalloc, a malloc() debugger.
--with-efence
Link with Electric Fence, a malloc() debugger.
--enable-mem-debug
Check for mtrace(), Dmalloc, or Electric Fence. Use the first found.
--enable-gprof
Enable profiling support with gcc, you need gprof to inspect the file resulting from a run of Heroes.
--disable-display
This disable all screen output, making the game rather unplayable. This suppress decencies over third party libraries like GGI or SDL, therefore you may find it useful with some debugging tools like checkergcc.


Node:Relocatable package, Next:, Previous:configure options, Up:Installation

Building a relocatable package

Relocation refers to the ability to install or move the game in a directory which is different from the one it has been configured for. This usually happens if you create a binary package for Heroes and don't know in advance where the user will unpack it. This section describe how Heroes find for his files, in order to allow relocatable packages. Most people don't need to read this section, only packagers might be interested.

The values of the ./configure options you used to specify directories (such as --prefix, --bindir, or --datadir) are all transformed into paths relative to prefix and then hardcoded into the Heroes binary. Because Heroes uses only paths relative to prefix, the relocation process is just a matter of guessing the correct value of prefix at runtime. This guess is done using various informations available: first the original value of prefix is tried, then prefix is computed from the path to the current binary (argv[0]) when available, then the content of the environment variable PATH is used to find the binary and derive prefix, finally Heroes assumes it is running from the bindir directory. The whole process is not garanteed to succeed, but you can also override those paths with some enivronment variables (see Environment).


Node:Machines, Previous:Relocatable package, Up:Installation

Machines

Heroes has been reported to compile and run on the following architectures. Since Heroes can use SDL, GGI, or Allegro as display driver, the following list shows the driver which was used.

Linux/i386 (GGI, SDL, or Allegro)
Should build out of the box. Packages for some Linux distributions are available from the web pages.

Suse 7.1 users, the libc shipped with your distribution (glibc-2.2-7) will crash every time Heroes calls the ngettext() function. The workaround is to configure Heroes with configure --with-included-gettext so that it uses its own version of ngettext().

Red Hat 7.0 users, the compiler shipped with your distribution (packaged as gcc-2.96-54.i386.rpm) is an experimental version which is still bugged despite the pile of fixes applied. It actually produces unfaithful code for Heroes, so please use another compiler. Either upgrade to a newer version (gcc-2.96-64.i386.rpm is known to work) or use the one provided by the kgcc package.

Linux/m68k (SDL)
Is reported to work when the sound (SDL_mixer) is disabled (configure --disable-sound or heroes -S). Any feedback on this issue is welcome. See also the BUGS file.
FreeBSD (SDL)
Should build out of the box. Packages are available from the web pages.
Solaris (SDL)
Should build out of the box.
Win32/MinGW32 (SDL)
Can be cross-compiled (native compilation untested). The script used to cross build the Heroes package available on the web page is in the subdirectory arch/mingw32.
Win32/VisualC (SDL)
See the files in the arch/VisualC subdirectory of the Heroes CVS tree. We used to distribute these files along with the rest of the sources, but stopped because they are now completely out-of-date (they have not been updated since version 0.7). However you can use them as a start point if you think about compiling Heroes with MSVC.
Digital Unix (GGI)
Should build out of the box.
NetBSD (SDL)
I had to tweak SDL 1.1.6 to get it working, and also force Heroes' configure to use the result of sdl-config --static-libs instead of sdl-config --libs. Both issues should be fixed today (FIXME: need to check).
OpenBSD 2.9 (GGI & SDL)
It looks like some configure hints need to be given when using either libs.

A build of Heroes configured with GGI will apperently complete successfully, however the resulting binary fails to load, with the dynamic loader complaining about a missing symbol from libpthread. So you'd rather configure Heroes with

./configure --with-ggi=/usr/local LDFLAGS=-pthread
Then Heroes appears to work fine.

If you prefer to use SDL, things are different. I had to configure Heroes with

./configure --with-sdl=/usr/local LDFLAGS=-L/usr/X11R6/lib X11BASE=/usr/X11R6
Unfortunately, the resulting binary froze when initializing SDL (in SDL_init()). Please send us a note if you are luckier. FIXME: Look how other packages using SDL are built, I'm probably missing something.
IRIX 6.5 (SDL)
Heroes 0.7 has been reported to compile and run with SDL 1.1.3 and gcc + libraries from freeware.sgi.com on IRIX 6.5.
BeOS (SDL)
Heroes 0.9 has been reported to compile and run out of the box.

If you got Heroes working on a platform which is not listed here, please send a notice to heroes-discuss@lists.sourceforge.net.


Node:Running, Next:, Previous:Installation, Up:Top

Running Heroes


Node:Invoking heroes, Next:, Previous:Running, Up:Running

heroes options

Heroes call be launched with various options.

-v
--version
Display Heroes version number and copyright informations.
-h
--help
Print a help message about these run-time options.
-q
--quiet
Disable warning messages. This can be useful on platform such as Windows were such messages will pop up a text window.
-Q
--really-quiet
Same as -q, but disable error messages too.
-vOPTIONS
--verbose=CHANNELS
Enable debugging output. CHANNELS can take the same values as HEROES_DEBUG (see Environment).
-lWORD
--list=WORD

Show various internal information. WORD can be debug, levels, preferences, resources, sound-drivers, or sound-tracks.

--list=debug will list the available debugging channel, to be used with --verbose or HEROES_DEBUG (see Environment).

--list=levels displays the list of installed levels (only the game levels, not the extra levels).

--list=sound-drivers is used to print LibMikMod's drivers list. The expected output is something like this:

% heroes --list=sound-drivers
LibMikMod version 3.1.7

Available drivers:
 1 Enlightened sound daemon (EsounD) driver v0.2.12
 2 Advanced Linux Sound Architecture (ALSA) driver v0.3.2
 3 Open Sound System driver v1.5
 4 Raw disk writer (music.raw) v1.1
 5 Wav disk writer (music.wav) v1.2
 6 Piped Output driver v0.1
 7 Standard output driver v1.1
 8 Nosound Driver v3.0

--list=resources will dump the list of file resources. File resources are kinds of aliases used internally to name files and directories. They can be overwritten in you configuration file using the setrsc: command. This command will also list the original (default) value of the resource if it has been overwritten.

--list=sound-tracks will print the list of sound-tracks used in the game in a format compatible with the soundconf: command (see heroesrc).

--list=preferences will print the preferences and their values, as they would be saved in ~/.heroes/preferences.

-d N[,OPTIONS]
--driver=N[,OPTIONS]
With LibMikMod, specify the driver to use. N is the number of the driver taken from the output of heroes --list=sound-drivers. Use 0 for auto-detection. Additional options can be given to the driver, see LibMikMod's README file.

With SDL_mixer, override some audio parameters. freq and buffers are the two recognized parameters. Example

heroes -d freq=11050:buffers=512

-S
--no-sound
Disable sound output completely (both sound tracks and sound effects).
-X
--no-sfx
Disable sound effects only.
-m
--mono
Output sound in one single channel. This has no effect if the game is compiled without sound support, of course.
-8
--8bits
Output sound in 8bits, rather than 16. You will need this option if you have an old sound card that can't play 16bits samples.
-i
--high-quality
When compiled with MikMod, use the high quality software mixer. This mixer is somewhat more expensive, but you can expect a better sound quality. When compiled with SDL_mixer, output sound in 44kHz instead of 22kHz.
-G OPTIONS
--gfx-options=OPTIONS
Give additional options to the display driver.

With GGI applications, the usual way to force the selection of a driver is to define the GGI_DISPLAY environment variable. The usage and possible values of this variable are documented in the file target.txt which comes with LibGGI. If Heroes has been compiled with GGI, the option -G will bypass the setting of GGI_DISPLAY, as if the variable was overwritten. For instance

% heroes -G 'tile:0,0,160,200,(x):160,0,160,200,(x)'
is equivalant to
% export GGI_DISPLAY='tile:0,0,160,200,(x):160,0,160,200,(x)'
% heroes
except that the former does not modify GGI_DISPLAY. (BTW, the above setting uses GGI's tile driver to display Heroes in two half-windows... this maybe quite fun to try in two player mode.)

It is also possible to prevent Heroes' GGI driver to request a 8 bit mode with -G not8. This is necessary on some uncommon X setup to workaround a bug in GGI (see Troubleshooting). Other legitimate GGI settings maybe supplied after a colon, as in -G not8:x.

As SDL applications are concerned, selection of the video driver is achieved through the SDL_VIDEODRIVER environment variable. At the time of writting this is not documented in SDL, so you will have to either RTFS or guess the possible values. If Heroes has been compiled with SDL, the option -G with override the setting of SDL_VIDEODRIVER. For instance you could force SDL to use the X11 driver with

% heroes -G x11
or
% export SDL_VIDEODRIVER=x11
% heroes

-F
--full-screen
If Heroes is compiled with SDL, this option will turn on full screen mode.

Otherwise, if Heroes is compiled with GGI, this option will allow Heroes to use a video mode with any size; i.e., the video surface is not constrained to 320x200 and Heroes will just center its 320x200 output. The rational is that GGI's DGA driver doesn't switch video modes. So unless your X server run in 320x200 it would be hard to use the DGA driver otherwise. Here is the typical settings for "full-screen" DGA output:

% heroes -G dga -F
Admittedly the name of --full-screen is quite misleading here since this option can provide you with a 320x200 stamp centered on your 1600x1200 display...
-2
--double
Stretch the game twofold before blitting to screen. This is slow.
-3
--triple
Stretch the game threefold before blitting to screen. This is even slower.
-4
--quadruple
Stretch the game fourfold before blitting to screen. This has been requested by people which can run heroes -3 smoothly.
-e
--even-lines
Display only even lines, leaving blank scan lines as on real arcade monitors. This will contribute to make options -2, -3 and -4 faster.
--cpu-off
Disable computer opponents driving. The opponents are still there (there will always be four players) but they are no more driven: they turn when they hit wall. You won't want to use this options, it is here for historical reason: when the game was started in 1996 this used to suppress some overhead on slow machines.
--default-scores
--default-options
--default-saves
Don't read the corresponding file, but use default value instead. The files will be saved at the end of the game anyway, so you can use these options to revert the default value of the given file. Another way to do this is simply to delete the file, it will be created the next time Heroes run.
-s
--swap-sides
Swap sides when playing in two player mode. The default is to have player one on the right and player two on the left, because the default key bindings use the arrows for player one and left letters keys for player two.
--no-double-fx
Disable superposition of rotozoom and waves. This is also a prehistoric option. These two visual effects lead to a small overhead that one may not want to combine on a slow host.
-g
--go
Skip the game introduction, start right on the main menu.
-J
--no-joystick
Disable joystick handling. Most of the time you will use this because you don't have a joystick and are annoyed by the warning message output when heroes start.


Node:Environment, Next:, Previous:Invoking heroes, Up:Running

Environment variables

HEROES_DEBUG

The very first action of Heroes when it starts is to look the environment for a HEROES_DATA_DIR variable. If Heroes has been compiled with the --enable-heroes-debug configure option (which is the default), this variable specify the kind of debug messages that should be printed out. Possible values are the following (they can be printed using the --list=debug option).

SECTION
The different parts of the game (introduction, demonstration, menus, ...).
SYSTEM
Handling of environment variables, creation of directories, initialization of libraries.
RESOURCE
Filename Resources Handling.
FILE
Files And Directories Handling.
LEVEL
Levels Handling.
SOUND_TRACK
Sound Track Events.
SOUND_EFFECT
Sound Effects Events.
VIDEO
Events related to the display interface.
JOYSTICK
Joystick Initialization And Events.
TIMER
Timer Handling.
MISC
Miscellaneous Events.
FADER
Palette Fade Events.
BONUS
Bonus handling.
ALL
All of the above.

Multiple values can be separated by :, and a value is negated if prefixed by -. For example the following command line sets HEROES_DEBUG so that all messages get printed except those related to timer handling.

export HEROES_DEBUG=all:-timer

HEROES_PREFIX

The HEROES_PREFIX indicate the base directory where Heroes was installed. It is equivalant to the --prefix option of configure. This variable is not found the default prefix (configured at build time) will be used, usually this is something like /usr/local or /usr. Type heroes --list=resources | grep prefix to see the value actually used by Heroes.

Most people don't need to set this variable. This is only useful if you got Heroes as a binary distribution and want to move files around.

HEROES_DATA_DIR

The HEROES_DATA_DIR variable may specify the path were the data files are located. It thus allows you to relocate the data file. If this variable is not found the default path (configured at build time) will be used. Run heroes --list=resources | grep data-dir to see the value actually used by Heroes.

The path to datafiles is adjusted automatically if you set HEROES_PREFIX (because it is a subdirectory of HEROES_PREFIX), so most people don't need to set HEROES_DATA_DIR.

HEROES_LOCALE_DIR

The HEROES_LOCALE_DIR variable override the path were the message catalogs are looked for. The default value is hardcoded into the Heroes binary, and you can see it if you run heroes --list=resources | grep locale-dir.

As for HEROES_DATA_DIR, changing HEROES_PREFIX is usually enough because HEROES_LOCALE_DIR is a subdirectory of HEROES_PREFIX.

HOME

The HOME variable is used to locate your home directory. You can also use HEROES_HOME.


Node:heroesrc, Next:, Previous:Environment, Up:Running

~/.heroes/heroesrc

Each time you start heroes, it tries to read the system-wide configuration file heroesrc (in the $datadir/heroes/etc/ directory) and from the ~/.heroes/heroesrc in your home directory.

option:

You can specify options in that file, they will be processed before any options given on the command line. Put the word Options: in front of a line, and write the options after (separated by spaces, as on the command line, except that there is no quoting or variable substitution). For example, if you want that Heroes always skip the introduction, and swap the player sides, add the following line to your ~/.heroes/heroesrc:

Options: -g -s

Multiple Options: lines can be given, they are processed in order.

setenv:

You can also have line starting with setenv:, followed by a variable name and a value (the rest of the line, after the variable name is taken as the value). This will setup the corresponding environment variable. This provide a way to configure the used libraries. For example, to instruct SDL to use its DGA driver, use the following line:

setenv: SDL_VIDEODRIVER dga

This may seam redundant with --gfx-options and --driver but can be used to configure other libraries. For example, setup GGI or SDL to use AAlib (the ASCII art rendering library) and configure AAlib via its AAOPTS variable.

extradir:

Lines starting with extradir: are used to specify additional extra levels directories.

soundconf:

The soundconf: lines are used to introduce configuration files defining the sound tracks played by the game. The format of such files is as follow:

ALIAS:FILENAME:TITLE:AUTHOR
...
Where ALIAS is the name of the sound track used internally by Heroes, FILENAME is the filename of the sound track you want to be loaded, TITLE is the title of the sound track, and AUTHOR is the person who tracked that music.

You may give several definitions for the same alias, in which case only the latest will be used (and of course your configuration file is read after heroes has setup its default aliases so you can overwrite them).

Presently the set of used aliases include INTRO,MENU,HEROES01,HEROES02,...,HEROES10, and ENDSCROLL. You can overwrite them, but you can also define your own aliases: they will be available in the jukebox menu.

To give one full example, imagine you want to hear /music/2nd-reality.s3m when you are playing Heroes in the second world (desert and pyramids). What you do is this

% cd ~/.heroes
% echo "HEROES02:/music/2nd-reality.s3m:\
Second Reality:Purple Motion" > mymod
% echo "soundconf: /home/adl/.heroes/mymod" >> heroesrc

In this example, the configuration file has been put in the ~/.heroes directory but you can put it anywhere provided the filename given after soundconf: points to it.

All that sound configuration stuff should allow you to make drop-in replacement for heroes modules. You just make a set of modules available with a configuration file that any user can get read from its ~/.heroes/heroesrc.

You can run heroes --list=sound-tracks to print the list of sound-tracks used by heroes, and hence verify the correctness of your configuration.

setrsc:

This follow the same format as setenv but is used to overwrite some filenames used by the game. Heroes internally handles file or directory names using name aliases called file resources whose values (actual filenames) can be overwritten by setrsc and are subject to variable expansion.

The command heroes --list=resources will list all the resources used by the game. data-dir is a special resource which content is setup from the HEROES_DATA_DIR environment variable, or from the path used to install the files when the game was built. home-dir is initialized from the HOME environment variable.

An example of setrsc: usage is to run the game with an alternate picture file. Say you are working on a modified version of the main font used in the game, you can override the installed picture by yours with the following line.

setrsc: main-font /home/adl/heroes-dev/tmp/fontem.pcx

keepsgid: and keepsuid:

By default, if Heroes has a sgid-bit or suid-bit, it will drop all privileges once the score and saved games are open. This happens before the user configuration is read, and therefore before the display and sound are initialized.

Sometime you do not want these privileges to be dropped because your setup requires them. For instance your display driver might require read/write access to /dev/mem, or a similar requirement may exist for the sound library).

keepsgid: yes and keepsuid: yes can be used to instruct Heroes to keep the s-bit privileges for its whole life. These commands can only be used in the system-wide configuration file.


Node:Global score file, Next:, Previous:heroesrc, Up:Running

Sharing a global score file

In its default configuration, Heroes will create a score file in each user's directory. However you may want to share a global score file for many users. This can easily be done by redefining the filename used by Heroes to read and write the score file. This filename is a resource, so it can be overwritten in an heroesrc configuration file.

If you are the installer of Heroes, you can do this from the system wide heroesrc with a line like the following

setrsc: score-file $(sys-dir)/scores

The same considerations apply to saved games (saved-games-file).

$(sys-dir) is another resource the value of which defaults to /var/games/heroes. According to the Filesystem Hierarchy Standard this is the place where you should store modifiable game files. If you need to change this, simply add another setrsc: line:

setrsc: sys-dir /site/var/games/heroes
By the way, you will have to create the $(sys-dir) directory yourself, because Heroes is not smart enough (and probably doesn't have the right to create that directory anyway).

Now you have to make several choices regarding the policy for granting access to that file. This is a global score files, so you need to devise a setup which allows Heroes to write that file whoever run the game. The most straightforward way to allow this is to create the scores file with 666 permission... you probably don't want to do this because everybody would be allowed to damage the file.

A cleaner idea is to create a special user or group to own that file, and grant heroes the appropriate rights (set-user-id or set-group-id). Setting heroes as a set-user-id program is a security problem, because if someone manage to get heroes to execute arbitrary code, he can have the game overwriting itself. So the correct solution is to set heroes as a set-group-id program, and make the score file writable only by that group. At worse, if someone manage to break into heroes, s/he will only be able to damage the score file.

Here is a sample setup where heroes is configured as a set-group-id program for a group called `games':

% cd /usr/games && ls -l heroes
-r-xr-sr-x    1 root     games     2074633 Mar 25 22:29 heroes
% cd /var/games/heroes && ls -la
drwxr-xr-x    2 root     games        4096 Mar 25 22:35 ./
drwxr-xr-x    4 root     root         4096 Mar 25 19:59 ../
-rw-rw-r--    1 root     games        2291 Mar 25 22:35 scores
Note that /var/games/heroes is not writable by group games, so you have to create the file scores before Heroes can use it.

When heroes is run as a set-group-id or set-user-id program, it executes some code to drop this privilege whenever possible. Basically, it will revert its effective-group-id and effective-user-id to the player's group-id and user-id on startup and only switch back to it's file-group-id and file-user-id when it needs to write to a file in the $(sys-dir) directory. This is what the $(sys-dir) resource is for: a file which is beyond that directory is opened with the file-group&user-id (i.e. group `games' in the above example), any other file is opened using the player's group(s) and user-id. The visible consequence is that files created in the ~/.heroes directory won't be owned by group games (or whatever you chose).

Finally, note that Heroes does keep track of how a resource has been setup, and wont switch persona when $(sys-dir) or $(score-file) has been setup in a non-trusted way. Roughly, all hard-coded and system-wide settings are trusted, while the user's personal settings are untrusted.


Node:Game, Next:, Previous:Global score file, Up:Running

Game

Heroes has an `INFO' menu, that should describe the different game modes and options, with pictures and colors. Please refer to it until this section is written.


Node:Level editor, Next:, Previous:Game, Up:Running

Level editor

The level editor is available from the `editor' entry in the main menu. Created levels will be stored in your ~/.heroes/levels directory.

This editor is a cut down version of the one that served us to build all 100 levels of this game. This one will allow you to construct your own levels in a quite simplified manner.

On the left side of the screen, you can see a part of your level. You can move with keyboard or mouse (read the two next sections). In the middle of the screen you can see the set of all the available tiles. You will pick tiles here to build you level. And on the right there is some informations about the level and the selected (orange box) tile.


Node:editor-keys, Next:, Previous:Level editor, Up:Level editor

Editor keys

Here is the list of keys used in the level-editor. You will have to learn most of them because most of these actions are available only as key-bindings.

<F3>
Toggle sprite and vehicle display.
<F5>
Toggle collide tests display.
<ESC>
Quit and save.
<Ctrl>-<Left>
<Ctrl>-<Right>
<Ctrl>-<Up>
<Ctrl>-<Down>
<Ctrl>-<PageUp>
<Ctrl>-<PageDown>
<Ctrl>-<Home>
<Ctrl>-<End>
Move the cursor in the tiles side.
<Left>
<Right>
<Up>
<Down>
Move the cursor in the level side.
<SPC>
Copy a tile.
<d>
Setup starting positions on the selected tile.
<Ctrl>-<f>
Fill the whole level with the selected tile.
<Meta>-<f>
<Alt>-<f>
Fill the whole level with the two first tiles (for the 10th set of tiles).
<p>
Output the level map as a big pcx file. The file is saved in the current directory, and the file name is made by appending .pcx to the level name.
<s>
Copy a sprite, or remove a sprite.
<t>
Select the tile for tunnel destination.
<RET>
View the level map in full screen.
<Ctrl>-<RET>
Play animations.


Node:editor-clicks, Next:, Previous:editor-keys, Up:Level editor

Editor clicks

You can select a tiles by clicking on it with the left mouse button. Keeping this button pulled down will allow you to move the map without using the keyboard.

The middle button (if you have one) used in the left side will temporally select a tile, as if you were using the t key.

The right button, used in the left side, will copy a tile to the pointed tile, in a way it behaves like the space key.


Node:tunnels, Next:, Previous:editor-clicks, Up:Level editor

Tunnels

Copy your two tiles that are the entrances of your tunnel. Move the box-pointer on one, and select it if the <t> key (or click on it with the middle button). Once you will move the pointer, this tile will appear in a dashed box. Move on the second tunnel and click on the [GO TO] box that is on the right of your screen. Now you have set up the first way: for now if your were playing on this level you could go from this place to the dashed one, but from the dashed to this one. So you also have to set up the tunnel in the other way: select the current tiles with <t>, move on the former and click on [GO TO]. That's all.

Notice that with this technique you can also typeset some kind of triangular tunnel. Let A, B, C be the entrances, you could setup the way like that A->B, B->C, and C->A.

The coordinate 0x0 if used for the destination denotes a non-setup way. That's why you can't put a tunnel on the 0x0 position.


Node:sprites, Next:, Previous:tunnels, Up:Level editor

Sprites

With some set of tiles (like the Egyptian one), there are tiles (like palm trees) designed to be used as `sprites', i.e. put over others with transparency. You have to use the <s> key for this:

  • copy the ground tile with <SPC> or the first button
  • copy the sprite tile with <s> (and if you don't see any sprite on the level, press <F3>).


Node:animations, Next:, Previous:sprites, Up:Level editor

Animations

You may have noticed that during the game, some tiles are animated: color cycle (like the speed arrows) or moving objects (ventilators). Each frame of an animation is actually a separate tile. The different tiles of an animations are drawn horizontally in the sets. To setup an animation, you just have to select the first one and copy it into your level. Optionally, press <Ctrl>-<RET> to see the animation. When the orange box is on an animated tile, you should find a button on the right to modify the speed: the greater the number is, the slower the animation goes.


Node:departures, Previous:animations, Up:Level editor

Departures

Select a tile and press the <d> key. Then look at the right side, select a color and click on the arrow you want (if you don't see any vehicle on the level, press <F3>).


Node:Troubleshooting, Previous:Level editor, Up:Running

Troubleshooting

Video mode

This game was primary made for MS-DOS, with VGA 320x200x8bits display. If GGI is used to manage the video modes and you run into trouble with video modes, I suggest you play with a environment variable called GGI_DISPLAY used to select the display used. LibGGI come with a file env.txt that describes this variable. As an alternative you may use heroes' --gfx-options option instead of the above variable. If you want to force X display, you can add a line

Options: --gfx-options=X
in your ~/.heroes/heroesrc file. Note: --gfx-options has no effect if you are using SDL.

We suggest you to run the game under X because in console modes (libvga, frame buffers, ...) it's easy to get stuck if the game freeze.

People using an X server that supports 8bit visuals although the default visual is not 8bit (run xdpyinfo to see a list of visuals that your X server supports) are subject to what is probably a GGI bug. Basically GGI's X driver fails to allocate the 8bit mode correctly. The symptom is

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  1 (X_CreateWindow)
  Serial number of failed request:  24
  Current serial number in output stream:  31
One workaround is to prevent Heroes from negociating a 8bit video mode. Specify --gfx-options not8 to that effect. The default visual depth for your server will then be selected by GGI. (Of course this is slower because Heroes internally works in 8bit mode; use of another display depth involves a conversion.)

Keyboard

There is a menu `KEYS' in the submenu `OPTIONS' that lets you change the key bindings used during the game. Please set the keys here before playing since key codes can vary from place to place (hmm... is that right?).

Sound effects

You may find that there is some delay between an action and the associated sound effect. This is because libmikmod is polling in a buffer and is thus always one buffer ahead in the playback. It is possible to reduce the size of that buffer using some driver parameters, please see the section `DRIVER PARAMETERS' of libmikmod's README. For instance I'm using the OSS driver and I reduce the size of libmikmod's buffer by running heroes with the line

Options: -d3,buffer=11,count=4
in my ~/.heroes/heroesrc file. If you can find correct values for other drivers, please send them to me!

Sound errors

If Heroes try to tell you that:

Could not initialize sound, reason: Could not set sample size
That means that MikMod couldn't setup the 16bits output, may be because your sound card doesn't support that. Use the -8 option to have the game running with 8bits sound output.

If you get:

Could not initialize sound, reason: Could not set mono/stereo setting
You will have to run the game with -m, because stereo is not available.

Remember that you can always put these options in your ~/.heroes/heroes file (see heroesrc) so that you don't need to type them every time you run the game.

SegFault when using Alsa drivers with and LibMikMod

If you are using Alsa 0.5.x drivers2 Heroes is likely to crash during it's startup. This is because the current version of LibMikMod (3.1.9 at the time of writing) lacks support for Alsa 0.5.

A solution is to run Alsa in OSS-emulation mode: simply run heroes -d x (where x is the OSS driver number printed by heroes -n) to force LibMikMod using its OSS3 interface.

As a more general solution, you may want to compile LibMikMod without Alsa support (./configure --disable-alsa) so that it never crash for any application.


Node:heroeslvl, Next:, Previous:Running, Up:Top

heroeslvl

heroeslvl is a tool that can be used to inspect the content of Heroes level files. This is of almost no interest to the usual Heroes player, but can sometime be helpful to find bugs in levels.


Node:Invoking heroeslvl, Previous:heroeslvl, Up:heroeslvl

heroeslvl options

heroeslvl takes a list of levels to inspect in argument, and support the following options.

When no options are given, heroeslvl defaults to -ipfh.

-v
--version
Display heroeslvl version number and copyright informations.
-h
--help
Print a help message about these run-time options.
-p WHAT
--print=WHAT
Select what information heroeslvl should display. WHAT can be one or more of the following characters.
d
Print square directions. Square directions are used on tunnel to indicate the entrance direction, and on speed tiles to indicate the direction of the acceleration.
f
Print the filename of each processed file.
h
Print header information. This include level size, soundtrack and tilesets to use, starting positions...
i
Print tile details. This will display a list of all tiles, along with some of their attributes (type of the tile, adress of its sprite, animation information).
t
Print square type map. Display a map of the level, rendering each square with a character indicating the square type.
T
Display the character used as type keys in the -pt output.
w
Print wall map. Display a map of the level, rendering each square with a character indicating the number of neighboring walls. (Walls are just bits indicating the directions that can be used to exit from a square; they not always map to something visible on the level.)
@
Print the list of tunnels, with position, direction, and destination.

-i
--indent
Indent everything but the filenames of each level processed. Note that filenames are only displayed if requested by -pf.


Node:Index, Previous:heroeslvl, Up:Top

Index

Table of Contents


Footnotes

  1. For instance, this section was stolen from the documentation of GNU Texinfo.

  2. Alsa is a project to improve the Linux sound subsystem
    (See the Alsa page for details).

  3. Open Sound System is a set of device drivers that provide a uniform API across all the major UNIX architectures. The Linux kernel contain free code from the commercial OSS (See this page for details).


heroes-0.21/doc/heroes.info0000644004117000411500000000404707451374601011323 This is heroes.info, produced by makeinfo version 4.1 from heroes.texi. INFO-DIR-SECTION Games START-INFO-DIR-ENTRY * Heroes: (heroes). A Nibbles clone, just better. * heroeslvl: (heroes)heroeslvl. Inspect Heroes levels. END-INFO-DIR-ENTRY This file documents Heroes, a Nibbles clone, just better. Copyright 2000, 2001 Alexandre Duret-Lutz Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled "Copying" and "GNU General Public License" are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.  Indirect: heroes.info-1: 1168 heroes.info-2: 50454  Tag Table: (Indirect) Node: Top1168 Node: Copying3301 Ref: Copying-Footnote-14967 Node: Overview5052 Node: Getting Heroes6756 Node: Mailing lists8587 Node: Bug Reporting9597 Node: People12013 Node: History13946 Node: Installation17032 Node: Libraries17513 Node: configure19777 Node: configure options19960 Node: Relocatable package24490 Node: Machines25958 Node: Running29609 Node: Invoking heroes30137 Node: Environment38192 Node: heroesrc41280 Node: Global score file46384 Node: Game50181 Node: Level editor50454 Node: editor-keys51621 Node: editor-clicks52897 Node: tunnels53438 Node: sprites54513 Node: animations54986 Node: departures55683 Node: Troubleshooting55962 Ref: Troubleshooting-Footnote-159904 Ref: Troubleshooting-Footnote-260031 Node: heroeslvl60272 Node: Invoking heroeslvl60648 Node: Index62643  End Tag Table heroes-0.21/doc/heroes.info-10000644004117000411500000014242607451374601011465 This is heroes.info, produced by makeinfo version 4.1 from heroes.texi. INFO-DIR-SECTION Games START-INFO-DIR-ENTRY * Heroes: (heroes). A Nibbles clone, just better. * heroeslvl: (heroes)heroeslvl. Inspect Heroes levels. END-INFO-DIR-ENTRY This file documents Heroes, a Nibbles clone, just better. Copyright 2000, 2001 Alexandre Duret-Lutz Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled "Copying" and "GNU General Public License" are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.  File: heroes.info, Node: Top, Next: Copying, Prev: (dir), Up: (dir) Heroes ****** This document describes Heroes, a Nibbles clone, just better. This document applies to Heroes version 0.21. * Menu: * Copying:: Your rights. * Overview:: Heroes in brief and contact information. * Installation:: Installing Heroes. * Running:: Running Heroes. * heroeslvl:: Inspect Heroes levels. * Index:: A menu covering many topics. --- The Detailed Node Listing --- Overview of Heroes * Getting Heroes:: Where to download Heroes from. * Mailing lists:: Where to talk about Heroes.. * Bug Reporting:: Sending bugs, suggestions, contributions. * People:: Contributors * History:: History of the DOS version. Installation of Heroes * Libraries:: Libraries Heroes can link with. * configure:: Generic configure instructions. * configure options:: Configure options specific to heroes. * Relocatable package:: Building a relocatable package. * Machines:: Architectures where Heroes is known to work. Running Heroes * Invoking heroes:: Heroes launch-time options. * Environment:: Environment variables used by Heroes. * heroesrc:: Heroes configuration file. * Global score file:: Sharing a global score file. * Game:: Game rules. * Level editor:: How to create new levels. * Troubleshooting:: Common problems. Level editor * editor-keys:: Key used in the level editor. * editor-clicks:: How mouse is used in the editor. * tunnels:: How to setup a tunnel. * sprites:: How to setup a sprite. * animations:: How to setup animations. * departures:: How to setup departures. `heroeslvl' * Invoking heroeslvl:: heroeslvl launch-time options  File: heroes.info, Node: Copying, Next: Overview, Prev: Top, Up: Top Heroes Copying Conditions ************************* Heroes is "free"; this means that everyone is free to use it and free to redistribute it on a free basis. Heroes is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of Heroes that they might get from you. Specifically, we want to make sure that you have the right to give away copies of Heroes, that you receive source code or else can get it if you want it, that you can change Heroes or use pieces of it in new free programs(1), and that you know you can do these things. To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of Heroes, 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 tell them their rights. Also, for our own protection, we must make certain that everyone finds out that there is no warranty for Heroes. If these programs are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation. The precise conditions of the license for Heroes are found in the GNU General Public License that accompanies it. ---------- Footnotes ---------- (1) For instance, this section was stolen from the documentation of GNU Texinfo.  File: heroes.info, Node: Overview, Next: Installation, Prev: Copying, Up: Top Overview of Heroes ****************** Heroes is similar to the "Tron" and "Nibbles" games of yore, but includes many graphical improvements and new game features. In it, you must maneuver a small vehicle around a world and collect powerups while avoiding obstacles, your opponents' trails, and even your own trail. There are five game modes available. Quest is the classical Nibbles, in Death Match you start with very long tails a must kill your opponents, in Kill'em All you must run over lemmings moving on the ground, in Time Cash or Color modes you must collect money or pyramids of color. Heroes features 12 original sound tracks, 94 levels (in 10 different tile sets) plus a level editor. Heroes source code originates from an original MS-DOS game but has been heavily modified to enhance the portability and some new features have been added. MS-DOS support has been lost by the meantime. The original MS-DOS version can still be found on the Internet but is unmaintained and should be considered obsolete. The current development focus on cleaning the code and port the game to available operating systems. Our objective is to release the version 1.0 as a clean and portable base that would allow further important works such as network support or programmable vehicles. * Menu: * Getting Heroes:: Where to download Heroes from. * Mailing lists:: Where to talk about Heroes.. * Bug Reporting:: Sending bugs, suggestions, contributions. * People:: Contributors * History:: History of the DOS version.  File: heroes.info, Node: Getting Heroes, Next: Mailing lists, Prev: Overview, Up: Overview Getting Heroes ============== Where to fetch new releases? ---------------------------- Heroes development is powered by the free services offered by SourceForge to the Open-Source community. The web page of Heroes is `http://heroes.sourceforge.net/'. The latest releases of Heroes is always uploaded to SourceForge and available from `http://sourceforge.net/projects/heroes/'. Announces are sent to the `heroes-announce' mailing list (*note Mailing lists::). Source code releases are also uploaded to Ibiblio (formerly MetaLab, and Sunsite)) in `/pub/linux/games'; see the Ibiblio mirror list (http://ibiblio.org/pub/linux/MIRRORS.html) to find your nearest mirror. You will have to wait three or four days to have the files available on Ibiblio after a release. A public CVS server is also accessible. See `http://sourceforge.net/cvs/?group_id=7982' for details. What to download? ----------------- Heroes is distributed as five packages with independent version numbering and release schedule. `heroes' The source code, info file, and man page. `heroes-data' The level data (level maps, sprites, etc.) `heroes-sound-tracks' Sound tracks for the game (.xm files). `heroes-sound-effects' The sound effects for the game (.wav files). `heroes-hq-sound-tracks' High quality sound tracks (.xm files), they will replace some sound-tracks from `heroes-sound-track'. The two first packages are required, the others are optional. The game has been so split because the data and sound files are big and don't evolve as often as the code does. It would therefore be unfair to bloat the bandwidth by requiring the mirrors and users to download everything on each release.  File: heroes.info, Node: Mailing lists, Next: Bug Reporting, Prev: Getting Heroes, Up: Overview Mailing lists. ============== Three mailing lists are available for you to report bugs, discuss about the game or get announcements of new releases. `heroes-bugs@lists.sourceforge.net' A public mailing list for bug reports. subscription page (http://lists.sourceforge.net/mailman/listinfo/heroes-bugs). `heroes-discuss@lists.sourceforge.net' A public mailing list for discussion (questions, criticism, suggestions, contributions, ...) on the game. subscription page (http://lists.sourceforge.net/mailman/listinfo/heroes-discuss). `heroes-announce@lists.sourceforge.net' A read-only and low traffic list for announcements of Heroes releases. Mails posted to this list are also forwarded to `heroes-discuss' so you don't need to subscribe to both lists. subscription page (http://lists.sourceforge.net/mailman/listinfo/heroes-announce).  File: heroes.info, Node: Bug Reporting, Next: People, Prev: Mailing lists, Up: Overview Reporting bugs, sending suggestions or contribution =================================================== We welcome bug reports or suggestions for Heroes (either program, documentation, or data files). This program will get better only if you report the problems you encounter. Please email them to or . For bug reports, please include enough information to reproduce the problem, if possible. Useful information include: * the version number of Heroes. * hardware, operating system (and OS distribution), and compiler versions. * any unusual options you gave to `configure'. * the actions necessary to reproduce the bug. * a description of the problem (sometimes, a snapshot may be a good description) and of the behavior you are expecting (this is not always obvious for everyone) * a trace of the game, as given by running Heroes with the `HEROES_DEBUG' environment variable set (to `all', for instance). * a stack trace of the crash, if you compiled the game with debugging options (see below). * anything else that you think would be helpful. When in doubt whether something is needed or not, include it. It's better to include too much than to leave out something important. To get useful core dumps, `./configure' with `--enable-debug' and `--disable-sound'. Patches are most welcome; if possible, please make them with `diff -u' (*note Unified Format: (diff.info)Unified Format.) or `diff -c' (*note Context Format: (diff.info)Context Format.) and include `ChangeLog' entries (*note Change Log: (emacs-e20)Change Log.). When sending email, please do not encode or split the messages in any way if possible; it's much easier to deal with one plain text message, however large, than many small ones. Do not hesitate to contribute. This is YOUR game and the GPL allows you to apply any modifications you want to the game (provided that you keep those modifications under the GPL). There are numerous places where you can contribute: you can hack the code (the TODO file can give you ideas but should not be seen as a limit), design new levels, create new drawings (e.g. new sets of tiles), track some new music or add your personal touch here and there.  File: heroes.info, Node: People, Next: History, Prev: Bug Reporting, Up: Overview People ====== Heroes would not be what it is presently without the following people. Authors ------- * Alexandre Duret-Lutz Wrote the original source code, ported it to GNU/Linux and created a few levels. * Romual Genevois Had the idea of that game, designed most of it, drew the graphics, created most of the levels. * Alexandre Liverneaux Composed the soundtracks. * Philippe Meisburger Composed the soundtracks and created some levels. Contributors ------------ * Pierre Baillet Support for non-8bits depth video mode with LibGGI. * Uwe Hermann Clean-ups and portability fixes. * Ingo van Lil Latin-1 characters in fonts. Translators ----------- * Hermann J. Beackers (German) * Jos Boersema (Dutch) * Luzemario Dantas Rocha (Brazilian Portuguese) * Alessandro Dotti (Italian) * Alexandre Duret-Lutz (French) * Ingo van Lil (German) Packagers --------- * Daniel Burrows (Debian GNU/Linux) * Jean Delvare (RPM & Slackware Linux) * Eugenia Loli-Queru (BeOS) * Pascal Rigaux (Linux-Mandrake) * Maxim Sobolev (FreeBSD) Porters ------- * Ste'phane Denis (Win/Visual C) * Mattias Engdegaard (Solaris) * Maxim Sobolev (FreeBSD) More people are listed in the file `THANKS' at the top level of the Heroes tarball.  File: heroes.info, Node: History, Prev: People, Up: Overview History of the DOS version ========================== The next paragraphs are extracted from the DOS version of Heroes. We started this game in summer 96. The idea came form Guen. At this moment, we were only three: Guen, Toalnkor (now known as Tnk) and me (Pollux); Alexel joined us one year later. The development was going quite slow (it took us two years actually) mainly because of our studies. Maybe the fact that Guen and me communicated by (snail-)mail was another slowing down factor. I sent more than 60 letters to Guen during this two years ! During the first year, we decided to sell the game. We made a demo version (with only 10 levels, no editor, and an order form), and a CD version (with songs remixed on audio track, but not used in the game). Our main issue was the price of Midas' license (the sound engine used); we were also hesitating on the way we should distribute Heroes (shall we do it shareware or commercial ?). Finally, after a couple of wasted months we decided to spread it freeware (Enjoy !), because we thought that no one would really like to buy such a game today; today where 3D rules. Now let's talk about the content of the game. At first, Tnk decided to make some four channels songs in the old original mod format. As there were only two scores done and we were waiting for the next tunes, we used some songs from Clawz just to vary. These were 'overtaking' and 'hibakusha2' and gave a better taste to the game. So we removed old Tnk's songs and he was asked to make some more Clawz-like musics. By the time, Alexel joined and came with 10 channels XM, thus all tunes are now 8 or 10 channels XM... There were 13 tunes in the game (for a total of 2.88Mb unpacked), these are the intro tune, the menu tune, the 10 levels, and the end tune (you can't hear the later without finishing the quest game); most of them have been done by Alexel. All sprites and pictures were drawn by Guen. He first made some level-tiles and a set of hand-done previews of the game before any other work get started (I guess he has a few other projects at this state of development at home). These screens and tiles were used to make the level editor. Actually I learned C while making this editor so there is some piece of code I am not proud of into (and also in the game). When it was nearly done, I started to code the game. The first thing done was the introduction, and then came the multi-directional scroller. I remember that the first level which was loaded was sized 4x4 and wrapped in all directions; this was very small but at this time there were no tails and the vehicles were crossing the walls... Most of the levels were done by Guen. But Tnk and I also did some. Guen made a cleanup of all the levels we made: some were relegated in the EXTRALVL directory, other were simply erased. We aimed to spread the game with 100 of them, but as it is going late and that we are not going to sell the game anymore I don't know how many levels there will be.  File: heroes.info, Node: Installation, Next: Running, Prev: Overview, Up: Top Installation of Heroes ********************** * Menu: * Libraries:: Libraries Heroes can link with. * configure:: Generic configure instructions. * configure options:: Configure options specific to heroes. * Relocatable package:: Building a relocatable package. * Machines:: Architectures where Heroes is known to work.  File: heroes.info, Node: Libraries, Next: configure, Prev: Installation, Up: Installation Needed Libraries ================ Heroes can be configured to use several libraries to handle display, sound output and joystick support. Following is a list of supported libraries (hopefully you won't have to install all of them but just a subset). * LibGGI (General Graphic Interface) can be used as a display and keyboard driver. Get it from `http://www.ggi-project.org/'. * LibGII (General Input Interface) will provide joystick support (the game can be compiled without). Get it from `http://www.ggi-project.org/'. It is needed by LibGGI, by the way. * SDL can be used as a display and keyboard driver. Recent revisions will also provide support for joysticks. Get it from `http://www.libsdl.org/'. * Allegro, a game programming library, can be used as a display, keyboard, and joystick driver. `http://alleg.sourceforge.net/'. * LibMikMod is a sound library. You don't need it if you want to compile Heroes without sound support. Get it from `http://www.mikmod.org/' or from `ftp://ftp.ibiblio.org/pub/linux/apps/sound/libs/'. If you install LibMikMod from sources you may want to compile LibMikMod without Alsa support (*note Troubleshooting::). * SDL_Mixer is an alternative sound engine that can be used only if you use SDL as display driver. You don't need it if you want to compile Heroes without sound support. Get it from `http://www.devolution.com/~slouken/SDL/projects/SDL_mixer/'. To summarize, install at least LibGGI, SDL, or Allegro to get video output and keyboard handling. Install LibGII to get joystick support, unless you use a recent SDL or Allegro. And install LibMikMod (or SDL_mixer if you have SDL) if you want sound output. My personal preference goes to LibGGI/LibGII and LibMikMod which give you more control over the drivers used. On the other hand, SDL seems better at doing full screen display and is maintained actively. Allegro is quite new on Unix. Heroes also supports memory debugging libraries, such as `dmalloc' or `efence'. See the `--enable-mem-debug' option in section *Note configure options::.  File: heroes.info, Node: configure, Next: configure options, Prev: Libraries, Up: Installation configure generic instructions ============================== To be filled.  File: heroes.info, Node: configure options, Next: Relocatable package, Prev: configure, Up: Installation configure options for Heroes ============================ `configure' will do its best to find the libraries and functions needed by the game. Still, you may give several options to `configure' to help it, or to fine tune special features of Heroes. `--enable-html-doc[=DIR]' Build and install html documentation in directory `DIR'. If `DIR' is not given, install in `$datadir/heroes/doc'. `--disable-sound' Turn off sound support. Sound is enabled by default, unless no sound engine is found). `--disable-joystick' Do not include joystick support in the game. Joystick support is enabled by default, unless you don't have GII or joystick support in SDL. `--with-sdl[=DIR]' Specify that you want to link with SDL. This is the default if LibGGI is not installed. If you installed SDL in some non-standard place, you can specify the installation path as an argument. For example: ./configure --with-sdl=/home/adl/usr `configure' will then look for `/home/adl/usr/bin/sdl-config' and configure Heroes accordingly. `--with-ggi[=DIR]' Link with LibGGI. This is the default if LibGGI is installed. If you installed LibGGI in some non-standard place, you can specify the installation path as an argument `--with-allegro[=DIR]' Link with Allegro. This is the default is neither LibGGI not SDL can be used. If you installed Allegro in some non-standard place, you can specify the installation path as an argument `--with-mikmod[=DIR]' Use LibMikMod four sound output. This is the default if LibMikMod is installed and LibGGI have been selected. You may specify where LibMikMod is installed using the optional argument. `--with-sdl-mixer[=DIR]' Use SDL_mixer for sound output. This is the default if SDL_mixer is installed and SDL has been selected. You may specify where SDL_mixer is installed using the optional argument. Using this option implies `--with-sdl'. `--disable-heroes-debug' Turn off tracing support. See the description of the `HEROES_DEBUG' variable (*note Environment::). This is enabled by default to facilitate bug reporting. Using this options should reduce the size of the resulting binary, and speed up the game by an indiscernible amount. The following options are for developing purpose. The default configuration should be suitable for end users (i.e. players) but people attempting to hack the code may want debugging symbols or compiler warnings. `--enable-debug' `--disable-debug' This is a three state option. The default is to compile with debugging symbols: this produce bigger binaries but allow to get helpfull coredumps, without slowing down the game. You may want to use `--enable-debug' to include more debugging data and turn on some debugging code. Use `--disable-debug' to turn this off. Translators: you _do want_ to turn this option on, really! Because the debugging code includes some checks on the translated messages. `--disable-optimizations' Turn off compiler optimizations options. This can ease debugging. If you want to supply your own optimizations options, use something like `--enable-optimizations='-O3 -march=pentium''. `--enable-warnings' Try to turn on a large bunch of compiler warnings. `--enable-assert' Turn on some assertions squattered over the source code. This can slow down things a bit. `--enable-devel' Is a shorthand for `--enable-debug --disable-optimizations --enable-warnings --enable-assert'. `--with-mpatrol' Link with MPatrol, a `malloc()' debugger. `--with-mtrace' Use GNU libc's `mtrace()' facility to check `malloc()' usage. `--with-dmalloc' Link with Dmalloc, a `malloc()' debugger. `--with-efence' Link with Electric Fence, a `malloc()' debugger. `--enable-mem-debug' Check for `mtrace()', Dmalloc, or Electric Fence. Use the first found. `--enable-gprof' Enable profiling support with `gcc', you need `gprof' to inspect the file resulting from a run of Heroes. `--disable-display' This disable all screen output, making the game rather unplayable. This suppress decencies over third party libraries like GGI or SDL, therefore you may find it useful with some debugging tools like checkergcc.  File: heroes.info, Node: Relocatable package, Next: Machines, Prev: configure options, Up: Installation Building a relocatable package ============================== "Relocation" refers to the ability to install or move the game in a directory which is different from the one it has been configured for. This usually happens if you create a binary package for Heroes and don't know in advance where the user will unpack it. This section describe how Heroes find for his files, in order to allow relocatable packages. Most people don't need to read this section, only packagers might be interested. The values of the `./configure' options you used to specify directories (such as `--prefix', `--bindir', or `--datadir') are all transformed into paths relative to PREFIX and then hardcoded into the Heroes binary. Because Heroes uses only paths relative to PREFIX, the relocation process is just a matter of guessing the correct value of PREFIX at runtime. This guess is done using various informations available: first the original value of PREFIX is tried, then PREFIX is computed from the path to the current binary (`argv[0]') when available, then the content of the environment variable `PATH' is used to find the binary and derive PREFIX, finally Heroes assumes it is running from the BINDIR directory. The whole process is not garanteed to succeed, but you can also override those paths with some enivronment variables (*note Environment::).  File: heroes.info, Node: Machines, Prev: Relocatable package, Up: Installation Machines ======== Heroes has been reported to compile and run on the following architectures. Since Heroes can use SDL, GGI, or Allegro as display driver, the following list shows the driver which was used. Linux/i386 (GGI, SDL, or Allegro) Should build out of the box. Packages for some Linux distributions are available from the web pages. Suse 7.1 users, the libc shipped with your distribution (glibc-2.2-7) will crash every time Heroes calls the `ngettext()' function. The workaround is to configure Heroes with `configure --with-included-gettext' so that it uses its own version of `ngettext()'. Red Hat 7.0 users, the compiler shipped with your distribution (packaged as `gcc-2.96-54.i386.rpm') is an experimental version which is still _bugged_ despite the pile of fixes applied. It actually produces unfaithful code for Heroes, so please use another compiler. Either upgrade to a newer version (`gcc-2.96-64.i386.rpm' is known to work) or use the one provided by the `kgcc' package. Linux/m68k (SDL) Is reported to work when the sound (`SDL_mixer') is disabled (`configure --disable-sound' or `heroes -S'). Any feedback on this issue is welcome. See also the `BUGS' file. FreeBSD (SDL) Should build out of the box. Packages are available from the web pages. Solaris (SDL) Should build out of the box. Win32/MinGW32 (SDL) Can be cross-compiled (native compilation untested). The script used to cross build the Heroes package available on the web page is in the subdirectory `arch/mingw32'. Win32/VisualC (SDL) See the files in the `arch/VisualC' subdirectory of the Heroes CVS tree. We used to distribute these files along with the rest of the sources, but stopped because they are now completely out-of-date (they have not been updated since version 0.7). However you can use them as a start point if you think about compiling Heroes with MSVC. Digital Unix (GGI) Should build out of the box. NetBSD (SDL) I had to tweak SDL 1.1.6 to get it working, and also force Heroes' configure to use the result of `sdl-config --static-libs' instead of `sdl-config --libs'. Both issues should be fixed today (FIXME: need to check). OpenBSD 2.9 (GGI & SDL) It looks like some configure hints need to be given when using either libs. A build of Heroes configured with GGI will apperently complete successfully, however the resulting binary fails to load, with the dynamic loader complaining about a missing symbol from libpthread. So you'd rather configure Heroes with ./configure --with-ggi=/usr/local LDFLAGS=-pthread Then Heroes appears to work fine. If you prefer to use SDL, things are different. I had to configure Heroes with ./configure --with-sdl=/usr/local LDFLAGS=-L/usr/X11R6/lib X11BASE=/usr/X11R6 Unfortunately, the resulting binary froze when initializing SDL (in `SDL_init()'). Please send us a note if you are luckier. FIXME: Look how other packages using SDL are built, I'm probably missing something. IRIX 6.5 (SDL) Heroes 0.7 has been reported to compile and run with SDL 1.1.3 and `gcc' + libraries from `freeware.sgi.com' on IRIX 6.5. BeOS (SDL) Heroes 0.9 has been reported to compile and run out of the box. If you got Heroes working on a platform which is not listed here, please send a notice to .  File: heroes.info, Node: Running, Next: heroeslvl, Prev: Installation, Up: Top Running Heroes ************** * Menu: * Invoking heroes:: Heroes launch-time options. * Environment:: Environment variables used by Heroes. * heroesrc:: Heroes configuration file. * Global score file:: Sharing a global score file. * Game:: Game rules. * Level editor:: How to create new levels. * Troubleshooting:: Common problems.  File: heroes.info, Node: Invoking heroes, Next: Environment, Prev: Running, Up: Running `heroes' options ================ Heroes call be launched with various options. `-v' `--version' Display Heroes version number and copyright informations. `-h' `--help' Print a help message about these run-time options. `-q' `--quiet' Disable warning messages. This can be useful on platform such as Windows were such messages will pop up a text window. `-Q' `--really-quiet' Same as `-q', but disable error messages too. `-vOPTIONS' `--verbose=CHANNELS' Enable debugging output. `CHANNELS' can take the same values as `HEROES_DEBUG' (*note Environment::). `-lWORD' `--list=WORD' Show various internal information. `WORD' can be `debug', `levels', `preferences', `resources', `sound-drivers', or `sound-tracks'. `--list=debug' will list the available debugging channel, to be used with `--verbose' or `HEROES_DEBUG' (*note Environment::). `--list=levels' displays the list of installed levels (only the game levels, not the extra levels). `--list=sound-drivers' is used to print LibMikMod's drivers list. The expected output is something like this: % heroes --list=sound-drivers LibMikMod version 3.1.7 Available drivers: 1 Enlightened sound daemon (EsounD) driver v0.2.12 2 Advanced Linux Sound Architecture (ALSA) driver v0.3.2 3 Open Sound System driver v1.5 4 Raw disk writer (music.raw) v1.1 5 Wav disk writer (music.wav) v1.2 6 Piped Output driver v0.1 7 Standard output driver v1.1 8 Nosound Driver v3.0 `--list=resources' will dump the list of file resources. File resources are kinds of aliases used internally to name files and directories. They can be overwritten in you configuration file using the `setrsc:' command. This command will also list the original (default) value of the resource if it has been overwritten. `--list=sound-tracks' will print the list of sound-tracks used in the game in a format compatible with the `soundconf:' command (*note heroesrc::). `--list=preferences' will print the preferences and their values, as they would be saved in `~/.heroes/preferences'. `-d N[,OPTIONS]' `--driver=N[,OPTIONS]' With LibMikMod, specify the driver to use. `N' is the number of the driver taken from the output of `heroes --list=sound-drivers'. Use `0' for auto-detection. Additional options can be given to the driver, see LibMikMod's `README' file. With SDL_mixer, override some audio parameters. `freq' and `buffers' are the two recognized parameters. Example heroes -d freq=11050:buffers=512 `-S' `--no-sound' Disable sound output completely (both sound tracks and sound effects). `-X' `--no-sfx' Disable sound effects only. `-m' `--mono' Output sound in one single channel. This has no effect if the game is compiled without sound support, of course. `-8' `--8bits' Output sound in 8bits, rather than 16. You will need this option if you have an old sound card that can't play 16bits samples. `-i' `--high-quality' When compiled with MikMod, use the high quality software mixer. This mixer is somewhat more expensive, but you can expect a better sound quality. When compiled with SDL_mixer, output sound in 44kHz instead of 22kHz. `-G OPTIONS' `--gfx-options=OPTIONS' Give additional options to the display driver. With GGI applications, the usual way to force the selection of a driver is to define the `GGI_DISPLAY' environment variable. The usage and possible values of this variable are documented in the file `target.txt' which comes with LibGGI. If Heroes has been compiled with GGI, the option `-G' will bypass the setting of `GGI_DISPLAY', as if the variable was overwritten. For instance % heroes -G 'tile:0,0,160,200,(x):160,0,160,200,(x)' is equivalant to % export GGI_DISPLAY='tile:0,0,160,200,(x):160,0,160,200,(x)' % heroes except that the former does not modify `GGI_DISPLAY'. (BTW, the above setting uses GGI's tile driver to display Heroes in two half-windows... this maybe quite fun to try in two player mode.) It is also possible to prevent Heroes' GGI driver to request a 8 bit mode with `-G not8'. This is necessary on some uncommon X setup to workaround a bug in GGI (*note Troubleshooting::). Other legitimate GGI settings maybe supplied after a colon, as in `-G not8:x'. As SDL applications are concerned, selection of the video driver is achieved through the `SDL_VIDEODRIVER' environment variable. At the time of writting this is not documented in SDL, so you will have to either RTFS or guess the possible values. If Heroes has been compiled with SDL, the option `-G' with override the setting of `SDL_VIDEODRIVER'. For instance you could force SDL to use the X11 driver with % heroes -G x11 or % export SDL_VIDEODRIVER=x11 % heroes `-F' `--full-screen' If Heroes is compiled with SDL, this option will turn on full screen mode. Otherwise, if Heroes is compiled with GGI, this option will allow Heroes to use a video mode with any size; i.e., the video surface is not constrained to 320x200 and Heroes will just center its 320x200 output. The rational is that GGI's DGA driver doesn't switch video modes. So unless your X server run in 320x200 it would be hard to use the DGA driver otherwise. Here is the typical settings for "full-screen" DGA output: % heroes -G dga -F Admittedly the name of `--full-screen' is quite misleading here since this option can provide you with a 320x200 stamp centered on your 1600x1200 display... `-2' `--double' Stretch the game twofold before blitting to screen. This is slow. `-3' `--triple' Stretch the game threefold before blitting to screen. This is even slower. `-4' `--quadruple' Stretch the game fourfold before blitting to screen. This has been requested by people which can run `heroes -3' smoothly. `-e' `--even-lines' Display only even lines, leaving blank scan lines as on real arcade monitors. This will contribute to make options `-2', `-3' and `-4' faster. `--cpu-off' Disable computer opponents driving. The opponents are still there (there will always be four players) but they are no more driven: they turn when they hit wall. You won't want to use this options, it is here for historical reason: when the game was started in 1996 this used to suppress some overhead on slow machines. `--default-scores' `--default-options' `--default-saves' Don't read the corresponding file, but use default value instead. The files will be saved at the end of the game anyway, so you can use these options to revert the default value of the given file. Another way to do this is simply to delete the file, it will be created the next time Heroes run. `-s' `--swap-sides' Swap sides when playing in two player mode. The default is to have player one on the right and player two on the left, because the default key bindings use the arrows for player one and left letters keys for player two. `--no-double-fx' Disable superposition of rotozoom and waves. This is also a prehistoric option. These two visual effects lead to a small overhead that one may not want to combine on a slow host. `-g' `--go' Skip the game introduction, start right on the main menu. `-J' `--no-joystick' Disable joystick handling. Most of the time you will use this because you don't have a joystick and are annoyed by the warning message output when heroes start.  File: heroes.info, Node: Environment, Next: heroesrc, Prev: Invoking heroes, Up: Running Environment variables ===================== `HEROES_DEBUG' -------------- The very first action of Heroes when it starts is to look the environment for a `HEROES_DATA_DIR' variable. If Heroes has been compiled with the `--enable-heroes-debug' configure option (which is the default), this variable specify the kind of debug messages that should be printed out. Possible values are the following (they can be printed using the `--list=debug' option). `SECTION' The different parts of the game (introduction, demonstration, menus, ...). `SYSTEM' Handling of environment variables, creation of directories, initialization of libraries. `RESOURCE' Filename Resources Handling. `FILE' Files And Directories Handling. `LEVEL' Levels Handling. `SOUND_TRACK' Sound Track Events. `SOUND_EFFECT' Sound Effects Events. `VIDEO' Events related to the display interface. `JOYSTICK' Joystick Initialization And Events. `TIMER' Timer Handling. `MISC' Miscellaneous Events. `FADER' Palette Fade Events. `BONUS' Bonus handling. `ALL' All of the above. Multiple values can be separated by `:', and a value is negated if prefixed by `-'. For example the following command line sets `HEROES_DEBUG' so that all messages get printed except those related to timer handling. export HEROES_DEBUG=all:-timer `HEROES_PREFIX' --------------- The `HEROES_PREFIX' indicate the base directory where Heroes was installed. It is equivalant to the `--prefix' option of `configure'. This variable is not found the default prefix (configured at build time) will be used, usually this is something like `/usr/local' or `/usr'. Type `heroes --list=resources | grep prefix' to see the value actually used by Heroes. Most people don't need to set this variable. This is only useful if you got Heroes as a binary distribution and want to move files around. `HEROES_DATA_DIR' ----------------- The `HEROES_DATA_DIR' variable may specify the path were the data files are located. It thus allows you to relocate the data file. If this variable is not found the default path (configured at build time) will be used. Run `heroes --list=resources | grep data-dir' to see the value actually used by Heroes. The path to datafiles is adjusted automatically if you set `HEROES_PREFIX' (because it is a subdirectory of `HEROES_PREFIX'), so most people don't need to set `HEROES_DATA_DIR'. `HEROES_LOCALE_DIR' ------------------- The `HEROES_LOCALE_DIR' variable override the path were the message catalogs are looked for. The default value is hardcoded into the Heroes binary, and you can see it if you run `heroes --list=resources | grep locale-dir'. As for `HEROES_DATA_DIR', changing `HEROES_PREFIX' is usually enough because `HEROES_LOCALE_DIR' is a subdirectory of `HEROES_PREFIX'. `HOME' ------ The `HOME' variable is used to locate your home directory. You can also use `HEROES_HOME'.  File: heroes.info, Node: heroesrc, Next: Global score file, Prev: Environment, Up: Running `~/.heroes/heroesrc' ==================== Each time you start heroes, it tries to read the system-wide configuration file `heroesrc' (in the `$datadir/heroes/etc/' directory) and from the `~/.heroes/heroesrc' in your home directory. `option:' --------- You can specify options in that file, they will be processed before any options given on the command line. Put the word `Options:' in front of a line, and write the options after (separated by spaces, as on the command line, except that there is no quoting or variable substitution). For example, if you want that Heroes always skip the introduction, and swap the player sides, add the following line to your `~/.heroes/heroesrc': Options: -g -s Multiple `Options:' lines can be given, they are processed in order. `setenv:' --------- You can also have line starting with `setenv:', followed by a variable name and a value (the rest of the line, after the variable name is taken as the value). This will setup the corresponding environment variable. This provide a way to configure the used libraries. For example, to instruct SDL to use its DGA driver, use the following line: setenv: SDL_VIDEODRIVER dga This may seam redundant with `--gfx-options' and `--driver' but can be used to configure other libraries. For example, setup GGI or SDL to use AAlib (the ASCII art rendering library) and configure AAlib via its `AAOPTS' variable. `extradir:' ----------- Lines starting with `extradir:' are used to specify additional extra levels directories. `soundconf:' ------------ The `soundconf:' lines are used to introduce configuration files defining the sound tracks played by the game. The format of such files is as follow: ALIAS:FILENAME:TITLE:AUTHOR ... Where `ALIAS' is the name of the sound track used internally by Heroes, `FILENAME' is the filename of the sound track you want to be loaded, `TITLE' is the title of the sound track, and `AUTHOR' is the person who tracked that music. You may give several definitions for the same alias, in which case only the latest will be used (and of course your configuration file is read after heroes has setup its default aliases so you can overwrite them). Presently the set of used aliases include `INTRO',`MENU',`HEROES01',`HEROES02',...,`HEROES10', and `ENDSCROLL'. You can overwrite them, but you can also define your own aliases: they will be available in the jukebox menu. To give one full example, imagine you want to hear `/music/2nd-reality.s3m' when you are playing Heroes in the second world (desert and pyramids). What you do is this % cd ~/.heroes % echo "HEROES02:/music/2nd-reality.s3m:\ Second Reality:Purple Motion" > mymod % echo "soundconf: /home/adl/.heroes/mymod" >> heroesrc In this example, the configuration file has been put in the `~/.heroes' directory but you can put it anywhere provided the filename given after `soundconf:' points to it. All that sound configuration stuff should allow you to make drop-in replacement for heroes modules. You just make a set of modules available with a configuration file that any user can get read from its `~/.heroes/heroesrc'. You can run `heroes --list=sound-tracks' to print the list of sound-tracks used by heroes, and hence verify the correctness of your configuration. `setrsc:' --------- This follow the same format as `setenv' but is used to overwrite some filenames used by the game. Heroes internally handles file or directory names using name aliases called file resources whose values (actual filenames) can be overwritten by `setrsc' and are subject to variable expansion. The command `heroes --list=resources' will list all the resources used by the game. `data-dir' is a special resource which content is setup from the `HEROES_DATA_DIR' environment variable, or from the path used to install the files when the game was built. `home-dir' is initialized from the `HOME' environment variable. An example of `setrsc:' usage is to run the game with an alternate picture file. Say you are working on a modified version of the main font used in the game, you can override the installed picture by yours with the following line. setrsc: main-font /home/adl/heroes-dev/tmp/fontem.pcx `keepsgid:' and `keepsuid:' --------------------------- By default, if Heroes has a sgid-bit or suid-bit, it will drop all privileges once the score and saved games are open. This happens before the user configuration is read, and therefore before the display and sound are initialized. Sometime you do not want these privileges to be dropped because your setup requires them. For instance your display driver might require read/write access to /dev/mem, or a similar requirement may exist for the sound library). `keepsgid: yes' and `keepsuid: yes' can be used to instruct Heroes to keep the s-bit privileges for its whole life. These commands can only be used in the system-wide configuration file.  File: heroes.info, Node: Global score file, Next: Game, Prev: heroesrc, Up: Running Sharing a global score file =========================== In its default configuration, Heroes will create a score file in each user's directory. However you may want to share a global score file for many users. This can easily be done by redefining the filename used by Heroes to read and write the score file. This filename is a resource, so it can be overwritten in an `heroesrc' configuration file. If you are the installer of Heroes, you can do this from the system wide `heroesrc' with a line like the following setrsc: score-file $(sys-dir)/scores The same considerations apply to saved games (`saved-games-file'). `$(sys-dir)' is another resource the value of which defaults to `/var/games/heroes'. According to the Filesystem Hierarchy Standard this is the place where you should store modifiable game files. If you need to change this, simply add another `setrsc:' line: setrsc: sys-dir /site/var/games/heroes By the way, you will have to create the `$(sys-dir)' directory yourself, because Heroes is not smart enough (and probably doesn't have the right to create that directory anyway). Now you have to make several choices regarding the policy for granting access to that file. This is a global score files, so you need to devise a setup which allows Heroes to write that file whoever run the game. The most straightforward way to allow this is to create the `scores' file with `666' permission... you probably don't want to do this because everybody would be allowed to damage the file. A cleaner idea is to create a special user or group to own that file, and grant `heroes' the appropriate rights (set-user-id or set-group-id). Setting `heroes' as a set-user-id program is a security problem, because if someone manage to get `heroes' to execute arbitrary code, he can have the game overwriting itself. So the correct solution is to set `heroes' as a set-group-id program, and make the score file writable only by that group. At worse, if someone manage to break into `heroes', s/he will only be able to damage the score file. Here is a sample setup where `heroes' is configured as a set-group-id program for a group called ``games'': % cd /usr/games && ls -l heroes -r-xr-sr-x 1 root games 2074633 Mar 25 22:29 heroes % cd /var/games/heroes && ls -la drwxr-xr-x 2 root games 4096 Mar 25 22:35 ./ drwxr-xr-x 4 root root 4096 Mar 25 19:59 ../ -rw-rw-r-- 1 root games 2291 Mar 25 22:35 scores Note that `/var/games/heroes' is not writable by group `games', so you have to create the file `scores' before Heroes can use it. When `heroes' is run as a set-group-id or set-user-id program, it executes some code to drop this privilege whenever possible. Basically, it will revert its effective-group-id and effective-user-id to the player's group-id and user-id on startup and only switch back to it's file-group-id and file-user-id when it needs to write to a file in the `$(sys-dir)' directory. This is what the `$(sys-dir)' resource is for: a file which is beyond that directory is opened with the file-group&user-id (i.e. group `games' in the above example), any other file is opened using the player's group(s) and user-id. The visible consequence is that files created in the `~/.heroes' directory won't be owned by group `games' (or whatever you chose). Finally, note that Heroes does keep track of how a resource has been setup, and wont switch persona when `$(sys-dir)' or `$(score-file)' has been setup in a non-trusted way. Roughly, all hard-coded and system-wide settings are trusted, while the user's personal settings are untrusted.  File: heroes.info, Node: Game, Next: Level editor, Prev: Global score file, Up: Running Game ==== Heroes has an `INFO' menu, that should describe the different game modes and options, with pictures and colors. Please refer to it until this section is written. heroes-0.21/doc/heroes.info-20000644004117000411500000005751007451374601011465 This is heroes.info, produced by makeinfo version 4.1 from heroes.texi. INFO-DIR-SECTION Games START-INFO-DIR-ENTRY * Heroes: (heroes). A Nibbles clone, just better. * heroeslvl: (heroes)heroeslvl. Inspect Heroes levels. END-INFO-DIR-ENTRY This file documents Heroes, a Nibbles clone, just better. Copyright 2000, 2001 Alexandre Duret-Lutz Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided also that the sections entitled "Copying" and "GNU General Public License" are included exactly as in the original, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.  File: heroes.info, Node: Level editor, Next: Troubleshooting, Prev: Game, Up: Running Level editor ============ The level editor is available from the `editor' entry in the main menu. Created levels will be stored in your `~/.heroes/levels' directory. This editor is a cut down version of the one that served us to build all 100 levels of this game. This one will allow you to construct your own levels in a quite simplified manner. On the left side of the screen, you can see a part of your level. You can move with keyboard or mouse (read the two next sections). In the middle of the screen you can see the set of all the available tiles. You will pick tiles here to build you level. And on the right there is some informations about the level and the selected (orange box) tile. * Menu: * editor-keys:: Key used in the level editor. * editor-clicks:: How mouse is used in the editor. * tunnels:: How to setup a tunnel. * sprites:: How to setup a sprite. * animations:: How to setup animations. * departures:: How to setup departures.  File: heroes.info, Node: editor-keys, Next: editor-clicks, Prev: Level editor, Up: Level editor Editor keys ----------- Here is the list of keys used in the level-editor. You will have to learn most of them because most of these actions are available only as key-bindings. `' Toggle sprite and vehicle display. `' Toggle collide tests display. `' Quit and save. `-' `-' `-' `-' `-' `-' `-' `-' Move the cursor in the tiles side. `' `' `' `' Move the cursor in the level side. `' Copy a tile. `' Setup starting positions on the selected tile. `-' Fill the whole level with the selected tile. `-' `-' Fill the whole level with the two first tiles (for the 10th set of tiles). `

' Output the level map as a big `pcx' file. The file is saved in the current directory, and the file name is made by appending `.pcx' to the level name. `' Copy a sprite, or remove a sprite. `' Select the tile for tunnel destination. `' View the level map in full screen. `-' Play animations.  File: heroes.info, Node: editor-clicks, Next: tunnels, Prev: editor-keys, Up: Level editor Editor clicks ------------- You can select a tiles by clicking on it with the left mouse button. Keeping this button pulled down will allow you to move the map without using the keyboard. The middle button (if you have one) used in the left side will temporally select a tile, as if you were using the `t' key. The right button, used in the left side, will copy a tile to the pointed tile, in a way it behaves like the space key.  File: heroes.info, Node: tunnels, Next: sprites, Prev: editor-clicks, Up: Level editor Tunnels ------- Copy your two tiles that are the entrances of your tunnel. Move the box-pointer on one, and select it if the `' key (or click on it with the middle button). Once you will move the pointer, this tile will appear in a dashed box. Move on the second tunnel and click on the `[GO TO]' box that is on the right of your screen. Now you have set up the first way: for now if your were playing on this level you could go from this place to the dashed one, but from the dashed to this one. So you also have to set up the tunnel in the other way: select the current tiles with `', move on the former and click on `[GO TO]'. That's all. Notice that with this technique you can also typeset some kind of triangular tunnel. Let `A', `B', `C' be the entrances, you could setup the way like that `A->B', `B->C', and `C->A'. The coordinate `0x0' if used for the destination denotes a non-setup way. That's why you can't put a tunnel on the `0x0' position.  File: heroes.info, Node: sprites, Next: animations, Prev: tunnels, Up: Level editor Sprites ------- With some set of tiles (like the Egyptian one), there are tiles (like palm trees) designed to be used as `sprites', i.e. put over others with transparency. You have to use the `' key for this: * copy the ground tile with `' or the first button * copy the sprite tile with `' (and if you don't see any sprite on the level, press `').  File: heroes.info, Node: animations, Next: departures, Prev: sprites, Up: Level editor Animations ---------- You may have noticed that during the game, some tiles are animated: color cycle (like the speed arrows) or moving objects (ventilators). Each frame of an animation is actually a separate tile. The different tiles of an animations are drawn horizontally in the sets. To setup an animation, you just have to select the first one and copy it into your level. Optionally, press `-' to see the animation. When the orange box is on an animated tile, you should find a button on the right to modify the speed: the greater the number is, the slower the animation goes.  File: heroes.info, Node: departures, Prev: animations, Up: Level editor Departures ---------- Select a tile and press the `' key. Then look at the right side, select a color and click on the arrow you want (if you don't see any vehicle on the level, press `').  File: heroes.info, Node: Troubleshooting, Prev: Level editor, Up: Running Troubleshooting =============== Video mode ---------- This game was primary made for MS-DOS, with VGA 320x200x8bits display. If GGI is used to manage the video modes and you run into trouble with video modes, I suggest you play with a environment variable called `GGI_DISPLAY' used to select the display used. LibGGI come with a file `env.txt' that describes this variable. As an alternative you may use heroes' `--gfx-options' option instead of the above variable. If you want to force X display, you can add a line Options: --gfx-options=X in your `~/.heroes/heroesrc' file. Note: `--gfx-options' has no effect if you are using SDL. We suggest you to run the game under X because in console modes (libvga, frame buffers, ...) it's easy to get stuck if the game freeze. People using an X server that supports 8bit visuals although the default visual is not 8bit (run `xdpyinfo' to see a list of visuals that your X server supports) are subject to what is probably a GGI bug. Basically GGI's X driver fails to allocate the 8bit mode correctly. The symptom is X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 1 (X_CreateWindow) Serial number of failed request: 24 Current serial number in output stream: 31 One workaround is to prevent Heroes from negociating a 8bit video mode. Specify `--gfx-options not8' to that effect. The default visual depth for your server will then be selected by GGI. (Of course this is slower because Heroes internally works in 8bit mode; use of another display depth involves a conversion.) Keyboard -------- There is a menu `KEYS' in the submenu `OPTIONS' that lets you change the key bindings used during the game. Please set the keys here before playing since key codes can vary from place to place (hmm... is that right?). Sound effects ------------- You may find that there is some delay between an action and the associated sound effect. This is because libmikmod is polling in a buffer and is thus always one buffer ahead in the playback. It is possible to reduce the size of that buffer using some driver parameters, please see the section `DRIVER PARAMETERS' of libmikmod's `README'. For instance I'm using the OSS driver and I reduce the size of libmikmod's buffer by running heroes with the line Options: -d3,buffer=11,count=4 in my `~/.heroes/heroesrc' file. If you can find correct values for other drivers, please send them to me ! Sound errors ------------ If Heroes try to tell you that: Could not initialize sound, reason: Could not set sample size That means that MikMod couldn't setup the 16bits output, may be because your sound card doesn't support that. Use the `-8' option to have the game running with 8bits sound output. If you get: Could not initialize sound, reason: Could not set mono/stereo setting You will have to run the game with `-m', because stereo is not available. Remember that you can always put these options in your `~/.heroes/heroes' file (*note heroesrc::) so that you don't need to type them every time you run the game. SegFault when using Alsa drivers with and LibMikMod --------------------------------------------------- If you are using Alsa 0.5.x drivers(1) Heroes is likely to crash during it's startup. This is because the current version of LibMikMod (3.1.9 at the time of writing) lacks support for Alsa 0.5. A solution is to run Alsa in OSS-emulation mode: simply run `heroes -d x' (where x is the OSS driver number printed by `heroes -n') to force LibMikMod using its OSS(2) interface. As a more general solution, you may want to compile LibMikMod without Alsa support (`./configure --disable-alsa') so that it never crash for any application. ---------- Footnotes ---------- (1) Alsa is a project to improve the Linux sound subsystem (See the Alsa page (http://www.alsa-project.org/) for details). (2) Open Sound System is a set of device drivers that provide a uniform API across all the major UNIX architectures. The Linux kernel contain free code from the commercial OSS (See this page (http://www.linux.org.uk/OSS/) for details).  File: heroes.info, Node: heroeslvl, Next: Index, Prev: Running, Up: Top `heroeslvl' *********** `heroeslvl' is a tool that can be used to inspect the content of Heroes level files. This is of almost no interest to the usual Heroes player, but can sometime be helpful to find bugs in levels. * Menu: * Invoking heroeslvl:: heroeslvl launch-time options  File: heroes.info, Node: Invoking heroeslvl, Prev: heroeslvl, Up: heroeslvl `heroeslvl' options =================== `heroeslvl' takes a list of levels to inspect in argument, and support the following options. When no options are given, `heroeslvl' defaults to `-ipfh'. `-v' `--version' Display `heroeslvl' version number and copyright informations. `-h' `--help' Print a help message about these run-time options. `-p WHAT' `--print=WHAT' Select what information `heroeslvl' should display. `WHAT' can be one or more of the following characters. `d' Print square directions. Square directions are used on tunnel to indicate the entrance direction, and on speed tiles to indicate the direction of the acceleration. `f' Print the filename of each processed file. `h' Print header information. This include level size, soundtrack and tilesets to use, starting positions... `i' Print tile details. This will display a list of all tiles, along with some of their attributes (type of the tile, adress of its sprite, animation information). `t' Print square type map. Display a map of the level, rendering each square with a character indicating the square type. `T' Display the character used as type keys in the `-pt' output. `w' Print wall map. Display a map of the level, rendering each square with a character indicating the number of neighboring walls. (Walls are just bits indicating the directions that can be used to exit from a square; they not always map to something visible on the level.) `@' Print the list of tunnels, with position, direction, and destination. `-i' `--indent' Indent everything but the filenames of each level processed. Note that filenames are only displayed if requested by `-pf'.  File: heroes.info, Node: Index, Prev: heroeslvl, Up: Top Index ***** * Menu: * -2: Invoking heroes. * -3: Invoking heroes. * -4: Invoking heroes. * -8: Invoking heroes. * -8bits: Invoking heroes. * -cpu-off: Invoking heroes. * -d N[,OPTIONS]: Invoking heroes. * -default-options: Invoking heroes. * -default-saves: Invoking heroes. * -default-scores: Invoking heroes. * -disable-debug: configure options. * -disable-display: configure options. * -disable-heroes-debug: configure options. * -disable-joystick: configure options. * -disable-optimizations: configure options. * -disable-sound: configure options. * -double: Invoking heroes. * -driver=N[,OPTIONS]: Invoking heroes. * -e: Invoking heroes. * -enable-assert: configure options. * -enable-debug: configure options. * -enable-devel: configure options. * -enable-gprof: configure options. * -enable-html-doc[=DIR]: configure options. * -enable-mem-debug: configure options. * -enable-warnings: configure options. * -even-lines: Invoking heroes. * -F: Invoking heroes. * -full-screen: Invoking heroes. * -g: Invoking heroes. * -G OPTIONS: Invoking heroes. * -gfx-options: Troubleshooting. * -gfx-options=OPTIONS: Invoking heroes. * -go: Invoking heroes. * -h <1>: Invoking heroeslvl. * -h: Invoking heroes. * -help <1>: Invoking heroeslvl. * -help: Invoking heroes. * -high-quality: Invoking heroes. * -i <1>: Invoking heroeslvl. * -i: Invoking heroes. * -indent: Invoking heroeslvl. * -J: Invoking heroes. * -list=WORD: Invoking heroes. * -lWORD: Invoking heroes. * -m: Invoking heroes. * -mono: Invoking heroes. * -no-double-fx: Invoking heroes. * -no-joystick: Invoking heroes. * -p: Invoking heroeslvl. * -p@: Invoking heroeslvl. * -pd: Invoking heroeslvl. * -pf: Invoking heroeslvl. * -ph: Invoking heroeslvl. * -pi: Invoking heroeslvl. * -print: Invoking heroeslvl. * -pT: Invoking heroeslvl. * -pt: Invoking heroeslvl. * -pw: Invoking heroeslvl. * -Q: Invoking heroes. * -q: Invoking heroes. * -quadruple: Invoking heroes. * -quiet: Invoking heroes. * -really-quiet: Invoking heroes. * -s: Invoking heroes. * -swap-sides: Invoking heroes. * -triple: Invoking heroes. * -v <1>: Invoking heroeslvl. * -v: Invoking heroes. * -verbose=CHANNELS: Invoking heroes. * -version <1>: Invoking heroeslvl. * -version: Invoking heroes. * -vOPTIONS: Invoking heroes. * -with-allegro: configure options. * -with-dmalloc: configure options. * -with-efence: configure options. * -with-ggi: configure options. * -with-mikmod: configure options. * -with-mpatrol: configure options. * -with-mtrace: configure options. * -with-sdl: configure options. * -with-sdl-mixer[=DIR]: configure options. * allegro: Libraries. * Alsa: Troubleshooting. * animations: animations. * architecture: Machines. * authors: People. * bug: Bug Reporting. * bug report: Bug Reporting. * configure generic instructions: configure. * configure options for Heroes: configure options. * contributing: Bug Reporting. * contributors: People. * copying: Copying. * core dump: Bug Reporting. * delay: Troubleshooting. * departures: departures. * diff: Bug Reporting. * display driver: Invoking heroes. * distribution: Copying. * dmalloc: configure options. * download: Getting Heroes. * editor: Level editor. * editor clicks: editor-clicks. * editor keys: editor-keys. * efence: configure options. * environment: Environment. * environment variable: heroesrc. * errors: Troubleshooting. * extra levels directory: heroesrc. * extradir: heroesrc. * file resources: heroesrc. * free: Copying. * full screen: Invoking heroes. * game: Game. * getting heroes: Getting Heroes. * ggi: Libraries. * GGI_DISPLAY <1>: Troubleshooting. * GGI_DISPLAY: Invoking heroes. * gii: Libraries. * gprof: configure options. * heroes-announce: Mailing lists. * heroes-bugs: Mailing lists. * heroes-discuss: Mailing lists. * HEROES_DATA_DIR: Environment. * HEROES_DEBUG <1>: Environment. * HEROES_DEBUG: configure options. * HEROES_LOCALE_DIR: Environment. * HEROES_PREFIX: Environment. * heroeslvl: heroeslvl. * heroesrc: heroesrc. * history: History. * HOME: Environment. * ibiblio: Getting Heroes. * index: Index. * installation: Installation. * Invoking heroeslvl: Invoking heroeslvl. * keepsgid: heroesrc. * keepsuid: heroesrc. * key codes: Troubleshooting. * keyboard: Troubleshooting. * keys: Troubleshooting. * keys, in editor: editor-keys. * level editor: Level editor. * libggi: Libraries. * libgii: Libraries. * libmikmod: Libraries. * LibMikMod and Alsa: Troubleshooting. * libraries: Libraries. * libsdl: Libraries. * machines: Machines. * metalab: Getting Heroes. * mikmod: Libraries. * mouse, in editor: editor-clicks. * mpatrol: configure options. * mtrace: configure options. * Nibbles: Overview. * options <1>: heroesrc. * options: Invoking heroes. * overview: Overview. * packagers: People. * patch: Bug Reporting. * relocation: Relocatable package. * rights: Copying. * running: Running. * runtime options: Invoking heroes. * sdl: Libraries. * SDL_VIDEODRIVER <1>: heroesrc. * SDL_VIDEODRIVER: Invoking heroes. * setenv: heroesrc. * setrsc: heroesrc. * sfx: Troubleshooting. * sgid <1>: Global score file. * sgid: heroesrc. * Simple DirectMedia Layer: Libraries. * sound driver: Invoking heroes. * sound effects: Troubleshooting. * sound errors: Troubleshooting. * soundconf: heroesrc. * sprites: sprites. * stretching: Invoking heroes. * suggestions: Bug Reporting. * suid <1>: Global score file. * suid: heroesrc. * sunsite: Getting Heroes. * target.txt: Invoking heroes. * TODO: Bug Reporting. * translators: People. * Tron: Overview. * troubleshooting: Troubleshooting. * tunnels: tunnels. * variable: heroesrc. * video mode: Troubleshooting. * X: Troubleshooting. heroes-0.21/tests/0000777004117000411500000000000007451377064007643 5heroes-0.21/tests/Makefile.am0000644004117000411500000000220107423624172011600 # Copyright 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 INCLUDES = \ -I$(top_srcdir)/lib -I../lib \ -I../intl \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/lvl \ -I$(top_srcdir)/src/media \ -I$(top_srcdir)/src/sys \ -I.. \ -I. AM_CFLAGS = $(MORE_WARNINGS_CFLAGS) EXTRA_DIST = defs $(TESTS) TESTS = demo.test intro.test lvlsave.test check_PROGRAMS = lvlsave lvlsave_SOURCES = lvlsave.c lvlsave_LDADD = \ $(top_builddir)/src/lvl/libhlvl.a \ $(top_builddir)/lib/libheroes.a heroes-0.21/tests/Makefile.in0000644004117000411500000002665707451373570011642 # Makefile.in generated by automake 1.6 from Makefile.am. # @configure_input@ # Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 # 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@ # Copyright 2001 Alexandre Duret-Lutz # # This file is part of Heroes. # # Heroes is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License version 2 as published by # the Free Software Foundation. # # Heroes 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 SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = @host_alias@ host_triplet = @host@ EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ PATH_SEPARATOR = @PATH_SEPARATOR@ ALLEGRO_H = @ALLEGRO_H@ AMTAR = @AMTAR@ AUTOGEN = @AUTOGEN@ AWK = @AWK@ BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ CPP = @CPP@ DATADIRNAME = @DATADIRNAME@ DEPDIR = @DEPDIR@ GENCAT = @GENCAT@ GGI_KEYBOARD_H = @GGI_KEYBOARD_H@ GLIBC21 = @GLIBC21@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GPERF = @GPERF@ HELP2MAN = @HELP2MAN@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLBISON = @INTLBISON@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ LIBALT_LOCAL_XLDADD = @LIBALT_LOCAL_XLDADD@ LIBALT_XLDADD = @LIBALT_XLDADD@ LIBALT_XLDFLAGS = @LIBALT_XLDFLAGS@ LIBICONV = @LIBICONV@ LN_S = @LN_S@ MKINSTALLDIRS = @MKINSTALLDIRS@ MORE_WARNINGS_CFLAGS = @MORE_WARNINGS_CFLAGS@ MSGFMT = @MSGFMT@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ SDL_KEYSYM_H = @SDL_KEYSYM_H@ STRIP = @STRIP@ U = @U@ UNZIP = @UNZIP@ UP = @UP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ ZIP = @ZIP@ am__include = @am__include@ am__quote = @am__quote@ htmldir = @htmldir@ install_sh = @install_sh@ INCLUDES = \ -I$(top_srcdir)/lib -I../lib \ -I../intl \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/lvl \ -I$(top_srcdir)/src/media \ -I$(top_srcdir)/src/sys \ -I.. \ -I. AM_CFLAGS = $(MORE_WARNINGS_CFLAGS) EXTRA_DIST = defs $(TESTS) TESTS = demo.test intro.test lvlsave.test check_PROGRAMS = lvlsave lvlsave_SOURCES = lvlsave.c lvlsave_LDADD = \ $(top_builddir)/src/lvl/libhlvl.a \ $(top_builddir)/lib/libheroes.a subdir = tests mkinstalldirs = $(SHELL) $(top_srcdir)/tools/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = check_PROGRAMS = lvlsave$(EXEEXT) am_lvlsave_OBJECTS = lvlsave.$(OBJEXT) lvlsave_OBJECTS = $(am_lvlsave_OBJECTS) lvlsave_DEPENDENCIES = $(top_builddir)/src/lvl/libhlvl.a \ $(top_builddir)/lib/libheroes.a lvlsave_LDFLAGS = DEFS = @DEFS@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ depcomp = $(SHELL) $(top_srcdir)/tools/depcomp am__depfiles_maybe = depfiles @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/lvlsave.Po COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ DIST_SOURCES = $(lvlsave_SOURCES) DIST_COMMON = Makefile.am Makefile.in SOURCES = $(lvlsave_SOURCES) all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) clean-checkPROGRAMS: -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) lvlsave$(EXEEXT): $(lvlsave_OBJECTS) $(lvlsave_DEPENDENCIES) @rm -f lvlsave$(EXEEXT) $(LINK) $(lvlsave_LDFLAGS) $(lvlsave_OBJECTS) $(lvlsave_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lvlsave.Po@am__quote@ distclean-depend: -rm -rf ./$(DEPDIR) .c.o: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< .c.obj: @AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ @AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ $(COMPILE) -c `cygpath -w $<` CCDEPMODE = @CCDEPMODE@ uninstall-info-am: ETAGS = etags ETAGSFLAGS = tags: TAGS ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(ETAGS_ARGS)$$tags$$unique" \ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; \ srcdir=$(srcdir); export srcdir; \ list='$(TESTS)'; \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ echo "XPASS: $$tst"; \ ;; \ *) \ echo "PASS: $$tst"; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *" $$tst "*) \ xfail=`expr $$xfail + 1`; \ echo "XFAIL: $$tst"; \ ;; \ *) \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ ;; \ esac; \ fi; \ done; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all tests failed"; \ else \ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ fi; \ fi; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes"; \ test "$$failed" -eq 0; \ else :; fi DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) top_distdir = .. distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ if test "$$dir" != "$$file" && test "$$dir" != "."; then \ dir="/$$dir"; \ $(mkinstalldirs) "$(distdir)$$dir"; \ else \ dir=''; \ fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir)$$dir \ || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS 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_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* 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-checkPROGRAMS clean-generic mostlyclean-am distclean: distclean-am distclean-am: clean-am distclean-compile distclean-depend \ distclean-generic distclean-tags dvi: dvi-am dvi-am: info: info-am info-am: install-data-am: install-exec-am: install-info: install-info-am install-man: installcheck-am: maintainer-clean: maintainer-clean-am maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic uninstall-am: uninstall-info-am .PHONY: GTAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic distclean distclean-compile \ distclean-depend distclean-generic distclean-tags distdir dvi \ dvi-am info info-am install install-am install-data \ install-data-am install-exec install-exec-am install-info \ install-info-am install-man install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic tags uninstall uninstall-am \ uninstall-info-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: heroes-0.21/tests/lvlsave.c0000644004117000411500000000330307423064460011366 /*------------------------------------------------------------------. | Copyright 2002 Alexandre Duret-Lutz | | | | This file is part of Heroes. | | | | Heroes is free software; you can redistribute it and/or modify it | | under the terms of the GNU General Public License version 2 as | | published by the Free Software Foundation. | | | | Heroes 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 | `------------------------------------------------------------------*/ #include "system.h" #include "lvl.h" #include "error.h" a_level lvl; char *program_name = 0; int main (int argc, char *argv[]) { program_name = argv[0]; if (argc != 3) error (1, 0, "Usage: lvlsave in out"); printf ("Loading %s...\n", argv[1]); lvl_load_file (argv[1], &lvl, true); printf ("Saving %s...\n", argv[2]); lvl_save_file (argv[2], &lvl); lvl_free (&lvl); return 0; } heroes-0.21/tests/defs0000644004117000411500000000114107422634741010414 # -*- shell-script -*- # Defines for Heroes testing environment. # Ensure $srcdir set correctly. if test ! -f $srcdir/defs; then echo "defs: installation error" 1>&2 exit 1 fi # User can set VERBOSE to see all output. test -z "$VERBOSE" && exec > /dev/null 2>&1 echo "== Running test $0" test -z "$HEROES" && HEROES="../src/heroes" test -z "$HEROESLVL" && HEROESLVL="../src/heroeslvl" if test -z "$HEROES_SYSTEM_CONF"; then HEROES_SYSTEM_CONF="$srcdir/../src/etc/heroesrc" export HEROES_SYSTEM_CONF fi # Turn on shell traces when VERBOSE=x. if test "x$VERBOSE" = xx; then set -x else : fi heroes-0.21/tests/demo.test0000755004117000411500000000015607376031772011410 #!/bin/sh # Test to make sure that a demo does not segfault. . $srcdir/defs || exit 1 $HEROES -g --check=demo heroes-0.21/tests/intro.test0000755004117000411500000000015707376031772011620 #!/bin/sh # Test to make sure that the intro does not segfault. . $srcdir/defs || exit 1 $HEROES --check=intro heroes-0.21/tests/lvlsave.test0000755004117000411500000000071207422634741012133 #!/bin/sh # Test to make sure that loaded level are saved identically. . $srcdir/defs || exit 1 set -e for lvl in `$HEROES --list=levels | awk '{ print $2 }'`; do ./lvlsave $lvl testout # Don't make a binary comparison, because it's ok to have some # difference like case in filename, etc. $HEROESLVL -phidtw@ $lvl > testin.out $HEROESLVL -phidtw@ testout > testout.out diff testin.out testout.out done rm -f testout testin.out testout.out :