diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..ce0fe34 --- /dev/null +++ b/AUTHORS @@ -0,0 +1,25 @@ +----------------------------------< CREDITS >----------------------------------- + +Graphics and code by KARL BARTEL: +E-mail: karlb@gmx.net +Homepage: http://members.linuxstart.com/~karlb/ + +Particle code, ideas and other support by LION KIMBRO: +E-mail: SnowLion@sprynet.com + +The music was written by THE LIZARD KING +E-mail: gustaf.grefberg@pp.itv.se +Homepage: http://www.itv.se/~a1055/frames.html + +Some levels by STEPHAN: +E-mail: emailme@enthralling.com + +Backgounds grabbed from the "eterm-backgrounds_1.0-1.deb" the authors say about +it: +"NONE of these images are original work by either of the Eterm authors; they +have all been collected from various sites on the web. As far as I know, they +are all freely available for use. +However, should any person who can provide proof of ownership of any of these +pictures object to their inclusion, they will be IMMEDIATELY withdrawn. No +copyright infringement is intended. Inclusion here should be taken as a +compliment. :-)" \ No newline at end of file diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..e77696a --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, 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) 19yy + + 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. + +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) 19yy 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. diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..a0cc5b9 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,196 @@ +Version 1.45 + -fixed crash-after-racer-selection bug. I can't understand why this bug + didn't cause a crash on my computer... + +Version 1.44 + -2 new levels + -better balanced racers + -changed the URL on the help screen + -fixed "time boni are gone forever" bug + +Version 1.?? + -new aclocal file (fixes compilation on arm) + +Version 1.43 + -no SDL_mixer included + -command line help + -changed command line options + -new option: no fadeout for slow computers + -fixed a bug concerning wrong video flags + +Version 1.42 + -game now easier (some smaller changes) + -other changes?? (I deleted changelog... ooops!) + -now using SDL>=1.1.5 (including a bug workaround) + -hiscore bug finally fixed + +Version 1.4 + -the highscore list is shown properly after the name has been entered + -the lasers are now animated + -messages like "crashed" are displayed until all particles have disappeared + -the shot leave the cannon more precisely + -a new level + -the racer can move closer to the edges of the screen + -changed some tile graphics + -new timeout picture + -new scoring system + -changed collision code (I hope it's better...) + -fixed a small update bug (nothing serious) + -fixed a bug in the racer selection menu + -bumprace uses always 16 bpp again, cause there are some problems with 8bpp + +Version 1.3 + -now using input from sdl-config for configure + -configure now checks for mathlib (-lm), too, if it is needed + -bumprace can now be installed anywhere + -the version number, which is displayed at startup, changes automatically + -the last version installed an unneccessary header file -> fixed + -removed a timeout bug when playing two times without quitting + -music is faded out when quitting + -removed some other bugs when played two times + -added highscore list + -now using SFont for fonts output + -using the gfx.cpp of penguin-command which makes coding easier for me + and it has also better error checking. + -the particles are much better now. + -there's a frame limit now. + -a BumpRace Version without mixer is available + -changed the special key to left ctrl for player 2 + -new images for "crashed" and "level completed" + -BumpRace can now run in any color depth, and uses the color depth of the + X-server + -some new tiles + -png support + +Version 1.2 + -fixed a bug in 2p team mode (the game didn't terminate after the timeout) + -reduced the time between crashing and the crash sound by decreasing the + chunk size. + -repaired wrong output when the sound is turned off due a used device + -fixed a bug in HandleShots() that could cause BumpRace to crash when + the free CPU time for BumpRace is very low. + -fixed a bug that caused the racer selction to be skipped on fast computers + -added a quit button to the main menu. The game now returns to the main + menu after the scoring. + -moved the menus to menu.c + -level numbers are displayed again (was a bug in 1.1) + -the cannon is now displayed correctly + -reduced cannon's turn speed + -added a fullscreen fade after the scoring. This is very slow under Linux, + but this will be better with XFree 4, when hardware acceleration is ready. + -added configure/automake/autoconf support. This is not prefect yet, but + I'm still working on it + -modified LoadImage() to search for the graphic files in different + directories + -modified the sound and font loading to use the path selected by LoadImage + -modified the README file, deleted README-SOURCE and created NEWS,AUTHORS + and INSTALL files + -better directory stucture + -fullscreen mode is default now, cause the new SDL fullscreen code works + perfect. + -configure now checks for the needed libs and allows "make install" + -the points hasn't been displayed correctly in competition mode. fixed. + -now using SDL_Mixer 1.0.4 + +Version 1.1 + -moved some gfx functions into gfx.c + -added jpg support + -all loaded images are converted to the pixel format of the screen surface. + This should speed up bumprace and increase the image quality. + -added some startup output + -BumpRace is now using a backbuffer. This increases the memory usage but it + makes a lot of programming easier and faster. + -some pics are converted to jpg -> smaller download + -BumpRace doesn't quit when it can't find a sound device, now it just turns + the sound off + -The time display is now labelled with "TIME LEFT" and the time decreases + from the sides to the middle + -You can quit BumpRace now by pressing the close button of your window manager + -moved the particle code to particles.c + -added the most complex obstacle: the cannon! This makes the game much more + interesting IMO. + -Racer are now handled very similar to shots and particles. This allows + multiple racers, and eleminates some reasons for flickering. + -yet another background + -added two new game modes: 2player teamwork and 2player competition + -added a nice menu for selecting the game mode + -the startup message (This is free software...) is now faded in and out. + -added simple scoring + +Version 1.00 + -4 more levels (now 14). + -added output "You have completed ?? levels". Windows users won't be able to + see this, cause this appears in the shell after the game. + -added tree levels (now 17)that were done by Stephan. Thanks! + -added lasers (obstacles that switch on and off) + -other background + -encapsulated the particle routines into the "correct" functions. + -fixes a particle removing bug over transparent surfaces + -added email/web adresses to the credits + -added racer info to the menu + -the data is loaded while displaying the title screen -> faster startup + -added a new racer + -added the "sticky" ability + -improved collision + -time is only updated when the change is visible + -time can now show a wider range of time + -got timidity out of the sound system -> smaller package + +Version 0.90 + -fixed the "quickstart bug" again :-) + -now using SDL 0.10.0 + -added short command line parameters. The old ones start with -- now. + -added particle effects ( thanks Lion! ) + -added new sound effects + -fixed time display bug + +Version 0.80 + -fixed the "quick start" bug + -added help (and credits) screen + -added a fadeout after every crash and the timeout + -added fps counter (-fps , but it shows a very high value, so I'm not sure + if that's correct: On my Cyrix200 it does 170fps!) + -new 3D-Logo + -added the "real" auto-slowdown ablility + -added gravity + -put racer abilities into variables + -one new level with gravity + -rendered new racer graphics, now with 18 pics for a smoother rotation + Is anyone interested in the .blend files? + -now 3 racers are available + -added racer ability extra_time. This is the percentage of extra time at the + beginning of the game + -new graphic for the info board + -lifetime if now displayed as a colored bar decreasing from green to red + +Version 0.70: + -fonts are now blitted correctly + -random level select + -more levels (now 11) + -bonus time for every completed level + -collision rewritten + -moved the levels to the file "levels.h" + -new background(s) + -added the output "This is free software..." like recommended. + +Version 0.60: + -added timeout + -added (terrible) fonts + -better (but still flickering and buggy) fullscreen mode + -fixed some bugs + -added music: 22khz, 16bit, stereo! + -added sound effect(s) + -BumpRace is now available under the GNU General Public License version 2. + -added command line parameter + -added three levels + +Version 0.45: + -one speed on all systems + -cleaned up the source + -title screen + -smaller background ( 144 KB ) + -added one level + +------------------------------------< BUGS >------------------------------------ + +no known bugs -> please mail any bug reports to karlb@gmx.net diff --git a/FAQ b/FAQ new file mode 100644 index 0000000..d72d752 --- /dev/null +++ b/FAQ @@ -0,0 +1,14 @@ + BUMPRACE FAQ +-------------------------------------------------------------------------------- +Q: Fullscreen mode does not work on my computer. +A: You probably have an old SDL version. SDL 1.0.3 is reccomended + for this release. +-------------------------------------------------------------------------------- +Q: BumpRace runs too slow on my computer. +A: 1. turn off particles (-t / --noparticles) + 2. turn off fadeouts (-o / --nofadeout) + 3. Start your X server at 16 bpp color depth. (startx -- -bpp 16) +-------------------------------------------------------------------------------- +Q: My question is not written here. +A: Then write a mail: karlb@gmx.net or get the newest version of BumpRace + from http://members.linuxstart.com/~karlb/ \ No newline at end of file diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..b42a17a --- /dev/null +++ b/INSTALL @@ -0,0 +1,182 @@ +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, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If at some point `config.cache' +contains results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you must use a version of `make' that +supports the `VPATH' variable, such as GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + If you have to use a `make' that does not supports the `VPATH' +variable, you have to compile the package for one architecture at a time +in the source code directory. After you have installed the package for +one architecture, use `make distclean' before reconfiguring for another +architecture. + +Installation Names +================== + + By default, `make install' will install the package's files in +`/usr/local/bin', `/usr/local/man', etc. You can specify an +installation prefix other than `/usr/local' by giving `configure' the +option `--prefix=PATH'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +give `configure' the option `--exec-prefix=PATH', the package will use +PATH as the prefix for installing programs and libraries. +Documentation and other data files will still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=PATH' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + + There may be some features `configure' can not figure out +automatically, but needs to determine by the type of host the package +will run on. Usually `configure' can figure that out, but if it prints +a message saying it can not guess the host type, give it the +`--host=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name with three fields: + CPU-COMPANY-SYSTEM + +See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the host type. + + If you are building compiler tools for cross-compiling, you can also +use the `--target=TYPE' option to select the type of system they will +produce code for and the `--build=TYPE' option to select the type of +system on which you are compiling the package. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Operation Controls +================== + + `configure' recognizes the following options to control how it +operates. + +`--cache-file=FILE' + Use and save the results of the tests in FILE instead of + `./config.cache'. Set FILE to `/dev/null' to disable caching, for + debugging `configure'. + +`--help' + Print a summary of the options to `configure', and exit. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--version' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`configure' also accepts some other, not widely useful, options. diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..8cd9d28 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,6 @@ + +SUBDIRS = data src + +EXTRA_DIST = FAQ + +distdir = $(PACKAGE)-$(VERSION) \ No newline at end of file diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..15b659b --- /dev/null +++ b/Makefile.in @@ -0,0 +1,324 @@ +# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 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. + + +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 + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +MAKEINFO = @MAKEINFO@ +MATHLIB = @MATHLIB@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +VERSION = @VERSION@ + +SUBDIRS = data src + +EXTRA_DIST = FAQ + +distdir = $(PACKAGE)-$(VERSION) +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ +Makefile.in NEWS acinclude.m4 aclocal.m4 config.guess config.sub \ +configure configure.in install-sh missing mkinstalldirs + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(ACLOCAL_M4): configure.in acinclude.m4 + cd $(srcdir) && $(ACLOCAL) + +config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + cd $(srcdir) && $(AUTOCONF) + +# 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. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @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; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && 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 + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(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)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: +top_distdir = $(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 + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-tags distclean-generic clean-am + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: install-data-recursive uninstall-data-recursive \ +install-exec-recursive uninstall-exec-recursive installdirs-recursive \ +uninstalldirs-recursive all-recursive check-recursive \ +installcheck-recursive info-recursive dvi-recursive \ +mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# 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: diff --git a/NEWS b/NEWS new file mode 100644 index 0000000..a0cc5b9 --- /dev/null +++ b/NEWS @@ -0,0 +1,196 @@ +Version 1.45 + -fixed crash-after-racer-selection bug. I can't understand why this bug + didn't cause a crash on my computer... + +Version 1.44 + -2 new levels + -better balanced racers + -changed the URL on the help screen + -fixed "time boni are gone forever" bug + +Version 1.?? + -new aclocal file (fixes compilation on arm) + +Version 1.43 + -no SDL_mixer included + -command line help + -changed command line options + -new option: no fadeout for slow computers + -fixed a bug concerning wrong video flags + +Version 1.42 + -game now easier (some smaller changes) + -other changes?? (I deleted changelog... ooops!) + -now using SDL>=1.1.5 (including a bug workaround) + -hiscore bug finally fixed + +Version 1.4 + -the highscore list is shown properly after the name has been entered + -the lasers are now animated + -messages like "crashed" are displayed until all particles have disappeared + -the shot leave the cannon more precisely + -a new level + -the racer can move closer to the edges of the screen + -changed some tile graphics + -new timeout picture + -new scoring system + -changed collision code (I hope it's better...) + -fixed a small update bug (nothing serious) + -fixed a bug in the racer selection menu + -bumprace uses always 16 bpp again, cause there are some problems with 8bpp + +Version 1.3 + -now using input from sdl-config for configure + -configure now checks for mathlib (-lm), too, if it is needed + -bumprace can now be installed anywhere + -the version number, which is displayed at startup, changes automatically + -the last version installed an unneccessary header file -> fixed + -removed a timeout bug when playing two times without quitting + -music is faded out when quitting + -removed some other bugs when played two times + -added highscore list + -now using SFont for fonts output + -using the gfx.cpp of penguin-command which makes coding easier for me + and it has also better error checking. + -the particles are much better now. + -there's a frame limit now. + -a BumpRace Version without mixer is available + -changed the special key to left ctrl for player 2 + -new images for "crashed" and "level completed" + -BumpRace can now run in any color depth, and uses the color depth of the + X-server + -some new tiles + -png support + +Version 1.2 + -fixed a bug in 2p team mode (the game didn't terminate after the timeout) + -reduced the time between crashing and the crash sound by decreasing the + chunk size. + -repaired wrong output when the sound is turned off due a used device + -fixed a bug in HandleShots() that could cause BumpRace to crash when + the free CPU time for BumpRace is very low. + -fixed a bug that caused the racer selction to be skipped on fast computers + -added a quit button to the main menu. The game now returns to the main + menu after the scoring. + -moved the menus to menu.c + -level numbers are displayed again (was a bug in 1.1) + -the cannon is now displayed correctly + -reduced cannon's turn speed + -added a fullscreen fade after the scoring. This is very slow under Linux, + but this will be better with XFree 4, when hardware acceleration is ready. + -added configure/automake/autoconf support. This is not prefect yet, but + I'm still working on it + -modified LoadImage() to search for the graphic files in different + directories + -modified the sound and font loading to use the path selected by LoadImage + -modified the README file, deleted README-SOURCE and created NEWS,AUTHORS + and INSTALL files + -better directory stucture + -fullscreen mode is default now, cause the new SDL fullscreen code works + perfect. + -configure now checks for the needed libs and allows "make install" + -the points hasn't been displayed correctly in competition mode. fixed. + -now using SDL_Mixer 1.0.4 + +Version 1.1 + -moved some gfx functions into gfx.c + -added jpg support + -all loaded images are converted to the pixel format of the screen surface. + This should speed up bumprace and increase the image quality. + -added some startup output + -BumpRace is now using a backbuffer. This increases the memory usage but it + makes a lot of programming easier and faster. + -some pics are converted to jpg -> smaller download + -BumpRace doesn't quit when it can't find a sound device, now it just turns + the sound off + -The time display is now labelled with "TIME LEFT" and the time decreases + from the sides to the middle + -You can quit BumpRace now by pressing the close button of your window manager + -moved the particle code to particles.c + -added the most complex obstacle: the cannon! This makes the game much more + interesting IMO. + -Racer are now handled very similar to shots and particles. This allows + multiple racers, and eleminates some reasons for flickering. + -yet another background + -added two new game modes: 2player teamwork and 2player competition + -added a nice menu for selecting the game mode + -the startup message (This is free software...) is now faded in and out. + -added simple scoring + +Version 1.00 + -4 more levels (now 14). + -added output "You have completed ?? levels". Windows users won't be able to + see this, cause this appears in the shell after the game. + -added tree levels (now 17)that were done by Stephan. Thanks! + -added lasers (obstacles that switch on and off) + -other background + -encapsulated the particle routines into the "correct" functions. + -fixes a particle removing bug over transparent surfaces + -added email/web adresses to the credits + -added racer info to the menu + -the data is loaded while displaying the title screen -> faster startup + -added a new racer + -added the "sticky" ability + -improved collision + -time is only updated when the change is visible + -time can now show a wider range of time + -got timidity out of the sound system -> smaller package + +Version 0.90 + -fixed the "quickstart bug" again :-) + -now using SDL 0.10.0 + -added short command line parameters. The old ones start with -- now. + -added particle effects ( thanks Lion! ) + -added new sound effects + -fixed time display bug + +Version 0.80 + -fixed the "quick start" bug + -added help (and credits) screen + -added a fadeout after every crash and the timeout + -added fps counter (-fps , but it shows a very high value, so I'm not sure + if that's correct: On my Cyrix200 it does 170fps!) + -new 3D-Logo + -added the "real" auto-slowdown ablility + -added gravity + -put racer abilities into variables + -one new level with gravity + -rendered new racer graphics, now with 18 pics for a smoother rotation + Is anyone interested in the .blend files? + -now 3 racers are available + -added racer ability extra_time. This is the percentage of extra time at the + beginning of the game + -new graphic for the info board + -lifetime if now displayed as a colored bar decreasing from green to red + +Version 0.70: + -fonts are now blitted correctly + -random level select + -more levels (now 11) + -bonus time for every completed level + -collision rewritten + -moved the levels to the file "levels.h" + -new background(s) + -added the output "This is free software..." like recommended. + +Version 0.60: + -added timeout + -added (terrible) fonts + -better (but still flickering and buggy) fullscreen mode + -fixed some bugs + -added music: 22khz, 16bit, stereo! + -added sound effect(s) + -BumpRace is now available under the GNU General Public License version 2. + -added command line parameter + -added three levels + +Version 0.45: + -one speed on all systems + -cleaned up the source + -title screen + -smaller background ( 144 KB ) + -added one level + +------------------------------------< BUGS >------------------------------------ + +no known bugs -> please mail any bug reports to karlb@gmx.net diff --git a/README b/README new file mode 100644 index 0000000..28e1deb --- /dev/null +++ b/README @@ -0,0 +1,45 @@ + +--------------------------------< BumpRace >------------------------------------ + +BumpRace is a simple arcade game. I'd like to receive a lot of comments and +suggestions. You can get the newest version of BumpRace at: + http://members.linuxstart.com/~karlb/ +And you can reach me via e-mail: + karlb@gmx.net + +Keys: + PLAYER 1 + moving + special ability + + PLAYER 2 + left + right + thrust + special ability + +To run this, you need the SDL-library. If you don't have it, get it from: + http://www.devolution.com/~slouken/SDL/ + +-----------------------------< RACER ABILITIES >-------------------------------- + +UFO-Racer: slows down automatically +V-Shaped-Racer: has 10% extra time +Rocket-Racer: press control for extra speed +Last Racer: press control to stick to walls + +--------------------------------< PARAMETER >----------------------------------- + +"--nofullscreen" "-f" guess +"--nosound" "-s" guess again +"--notfinal" "-n" no title screen (nice for develolopers) +"--noparticles" "-t" turns of paticles. good for slow computers. +"--pageflip" "-p" flicker-free fullscreen, slow and extremly buggy +"--precision [value]" sets the precison of the collisions (default=10) + using this is not recommended + +---------------------------------< LICENSE >------------------------------------ + +This game is available under the GNU General Public License version 2. +See COPYING for details. + diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..c8896aa --- /dev/null +++ b/acinclude.m4 @@ -0,0 +1,174 @@ +# Configure paths for SDL +# Sam Lantinga 9/21/99 +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS +dnl +AC_DEFUN(AM_PATH_SDL, +[dnl +dnl Get the cflags and libraries from the sdl-config script +dnl +AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], + sdl_prefix="$withval", sdl_prefix="") +AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], + sdl_exec_prefix="$withval", sdl_exec_prefix="") +AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], + , enable_sdltest=yes) + + if test x$sdl_exec_prefix != x ; then + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_args="$sdl_args --prefix=$sdl_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_prefix/bin/sdl-config + fi + fi + + AC_REQUIRE([AC_CANONICAL_TARGET]) + AC_PATH_PROG(SDL_CONFIG, sdl-config, no) + min_sdl_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" +dnl +dnl Now check if the installed SDL is sufficiently new. (Also sanity +dnl checks the results of sdl-config to some extent +dnl + rm -f conf.sdltest + AC_TRY_RUN([ +#include +#include +#include +#include "SDL.h" + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); + printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SDL_CONFIG" = "no" ; then + echo "*** The sdl-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL_CONFIG environment variable to the" + echo "*** full path to sdl-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + AC_TRY_LINK([ +#include +#include "SDL.h" + +int main(int argc, char *argv[]) +{ return 0; } +#undef main +#define main K_and_R_C_main +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + rm -f conf.sdltest +]) diff --git a/aclocal.m4 b/aclocal.m4 new file mode 100644 index 0000000..888029e --- /dev/null +++ b/aclocal.m4 @@ -0,0 +1,292 @@ +dnl aclocal.m4 generated automatically by aclocal 1.4-p4 + +dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +# Configure paths for SDL +# Sam Lantinga 9/21/99 +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS +dnl +AC_DEFUN(AM_PATH_SDL, +[dnl +dnl Get the cflags and libraries from the sdl-config script +dnl +AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)], + sdl_prefix="$withval", sdl_prefix="") +AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)], + sdl_exec_prefix="$withval", sdl_exec_prefix="") +AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program], + , enable_sdltest=yes) + + if test x$sdl_exec_prefix != x ; then + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_args="$sdl_args --prefix=$sdl_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_prefix/bin/sdl-config + fi + fi + + AC_REQUIRE([AC_CANONICAL_TARGET]) + AC_PATH_PROG(SDL_CONFIG, sdl-config, no) + min_sdl_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" +dnl +dnl Now check if the installed SDL is sufficiently new. (Also sanity +dnl checks the results of sdl-config to some extent +dnl + rm -f conf.sdltest + AC_TRY_RUN([ +#include +#include +#include +#include "SDL.h" + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); + printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$SDL_CONFIG" = "no" ; then + echo "*** The sdl-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL_CONFIG environment variable to the" + echo "*** full path to sdl-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + AC_TRY_LINK([ +#include +#include "SDL.h" + +int main(int argc, char *argv[]) +{ return 0; } +#undef main +#define main K_and_R_C_main +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(SDL_CFLAGS) + AC_SUBST(SDL_LIBS) + rm -f conf.sdltest +]) + +# Define a conditional. + +AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + +# Do all the work for Automake. 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. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +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 +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + +AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# 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 conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $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" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. +AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + diff --git a/config.guess b/config.guess new file mode 100644 index 0000000..6cb567b --- /dev/null +++ b/config.guess @@ -0,0 +1,1087 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 +# Free Software Foundation, Inc. +# +# 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. + +# Written by Per Bothner . +# The master version of this file is at the FSF in /home/gd/gnu/lib. +# Please send patches to the Autoconf mailing list . +# +# 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 system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# Use $HOST_CC if defined. $CC may point to a cross-compiler +if test x"$CC_FOR_BUILD" = x; then + if test x"$HOST_CC" != x; then + CC_FOR_BUILD="$HOST_CC" + else + if test x"$CC" != x; then + CC_FOR_BUILD="$CC" + else + CC_FOR_BUILD=cc + fi + fi +fi + + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +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 + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + 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 + .globl main + .ent main +main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + 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-cbm-sysv4 + exit 0;; + amiga:NetBSD:*:*) + echo m68k-cbm-netbsd${UNAME_RELEASE} + exit 0 ;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + arm32:NetBSD:*:*) + echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + SR2?01: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=`(head -1 /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 ;; + atari*:NetBSD:*:*) + echo m68k-atari-netbsd${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${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 ;; + sun3*:NetBSD:*:*) + echo m68k-sun-netbsd${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:NetBSD:*:*) + echo m68k-apple-netbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-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 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + macppc:NetBSD:*:*) + echo powerpc-apple-netbsd${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) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus + 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 $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + 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 -o $UNAME_PROCESSOR = mc88110 ] ; then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ + -o ${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 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + 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 $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:*:4) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${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=4.${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 NetBSD 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:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + sed 's/^ //' << EOF >$dummy.c + #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 + ($CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + 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 $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:*:*) + 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 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + 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*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + 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/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*T3E:*:*:*) + echo t3e-cray-unicosmk${UNAME_RELEASE} + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp3[0-9][05]:NetBSD:*:*) + echo m68k-hp-netbsd${UNAME_RELEASE} + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | i?86:BSD/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:*:*) + if test -x /usr/bin/objformat; then + if test "elf" = "`/usr/bin/objformat`"; then + echo ${UNAME_MACHINE}-unknown-freebsdelf`echo ${UNAME_RELEASE}|sed -e 's/[-_].*//'` + exit 0 + fi + fi + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:NetBSD:*:*) + echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`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*: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 ;; + *:Linux:*:*) + # uname on the ARM produces all sorts of strangeness, and we need to + # filter it out. + case "$UNAME_MACHINE" in + armv*) UNAME_MACHINE=$UNAME_MACHINE ;; + arm* | sa110*) UNAME_MACHINE="arm" ;; + esac + + # 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. + ld_help_string=`cd /; ld --help 2>&1` + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; + i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; + sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; + elf32ppc) + # Determine Lib Version + cat >$dummy.c < +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif +main(argc, argv) + int argc; + char *argv[]; +{ +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); +#else + printf("unkown\n"); +#endif + return 0; +} +EOF + LIBC="" + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.c $dummy + echo powerpc-unknown-linux-gnu${LIBC} ; exit 0 ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + sed 's/^ //' <$dummy.s + .globl main + .ent main + main: + .frame \$30,0,\$26,0 + .prologue 0 + .long 0x47e03d80 # implver $0 + lda \$2,259 + .long 0x47e20c21 # amask $2,$1 + srl \$1,8,\$2 + sll \$2,2,\$2 + sll \$0,3,\$0 + addl \$1,\$0,\$0 + addl \$2,\$0,\$0 + ret \$31,(\$26),1 + .end main +EOF + LIBC="" + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy + case "$?" in + 7) + UNAME_MACHINE="alpha" + ;; + 15) + UNAME_MACHINE="alphaev5" + ;; + 14) + UNAME_MACHINE="alphaev56" + ;; + 10) + UNAME_MACHINE="alphapca56" + ;; + 16) + UNAME_MACHINE="alphaev6" + ;; + esac + + objdump --private-headers $dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >$dummy.c </dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c < +#ifdef __cplusplus + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + fi ;; +# 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. + i?86:DYNIX/ptx:4*:*) + 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.*:*) + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:5:7*) + 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=i585 + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}${UNAME_VERSION}-sysv${UNAME_RELEASE} + 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 ;; + pc:*:*:*) + # 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]??,*:*:4.0:3.0 | 4850:*: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.*:*) + 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]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-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:CPunix: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 ;; + 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 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +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) + printf ("vax-dec-bsd\n"); exit (0); +#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 $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 + +#echo '(Unable to guess system type)' 1>&2 + +exit 1 diff --git a/config.sub b/config.sub new file mode 100644 index 0000000..2436b45 --- /dev/null +++ b/config.sub @@ -0,0 +1,1215 @@ +#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. +# 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. + +# 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. + +if [ x$1 = x ] +then + echo Configuration name missing. 1>&2 + echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 + echo "or $0 ALIAS" 1>&2 + echo where ALIAS is a recognized configuration type. 1>&2 + exit 1 +fi + +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; +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 + linux-gnu*) + 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) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=vxworks + 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 + ;; +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. + tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 \ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | mips64orion | mips64orionel | mipstx39 | mipstx39el \ + | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ + | mips64vr5000 | miprs64vr5000el \ + | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ + | thumb | d10v) + basic_machine=$basic_machine-unknown + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65) + ;; + + # 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[34567]86) + 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. + vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ + | xmp-* | ymp-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ + | alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ + | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ + | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ + | mipstx39-* | mipstx39el-* \ + | f301-* | armv*-* | t3e-* \ + | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ + | thumb-* | v850-* | d30v-* | tic30-* | c30-* ) + ;; + # 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-cbm + ;; + amigaos | amigados) + basic_machine=m68k-cbm + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-cbm + 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 + ;; + 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 | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + 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 + ;; + 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 + os=-mvs + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]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 + ;; + i386-go32 | go32) + basic_machine=i386-unknown + os=-go32 + ;; + i386-mingw32 | mingw32) + basic_machine=i386-unknown + os=-mingw32 + ;; + 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 + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | *MiNT) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-unknown + os=-msdos + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-corel + 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 + ;; + np1) + basic_machine=np1-gould + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + 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 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-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/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-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 + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + 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 + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + 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 + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc | sparcv9) + 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 + ;; + *) + 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* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -openstep* | -oskit*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -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|'` + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + # 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) + 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*-corel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + 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 + ;; + *-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 + ;; + f301-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*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -*MiNT) + vendor=atari + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os diff --git a/configure b/configure new file mode 100755 index 0000000..473a961 --- /dev/null +++ b/configure @@ -0,0 +1,2096 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-sdl-prefix=PFX Prefix where SDL is installed (optional)" +ac_help="$ac_help + --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)" +ac_help="$ac_help + --disable-sdltest Do not try to compile and run a test SDL program" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +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' + +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +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 + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # 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 ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$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" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) 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) + # 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 << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --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 +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$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) + 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 ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + 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 "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# 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 + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=README + +# 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_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + 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 "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# 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 "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +######## Setup for automake + + +if test -d ./src/mixer ; then + MIXER_INCLUDED_TRUE= + MIXER_INCLUDED_FALSE='#' +else + MIXER_INCLUDED_TRUE='#' + MIXER_INCLUDED_FALSE= +fi + +NAME="bumprace" +SDL_VERSION=1.1.5 +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# 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 +# 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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:576: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/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 + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +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 "$ac_t""$INSTALL" 1>&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_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:629: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# 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 conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $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 "configure: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { echo "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +echo "$ac_t""yes" 1>&6 +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +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" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:686: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 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 conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=$NAME + +VERSION=1.45 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi +cat >> confdefs.h <> confdefs.h <&6 +echo "configure:732: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:745: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:758: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:771: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:784: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +######## Detect the canonical host and target build environment + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:806: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:827: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + + +######## Check for tools +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:849: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:879: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 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 "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:930: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:962: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 973 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1004: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:1009: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1037: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 + +# 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 +# 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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1080: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/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 + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +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 "$ac_t""$INSTALL" 1>&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_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1135: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +######## Check for compiler environment +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:1165: checking for working const" >&5 +if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:1219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_const=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_const=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_c_const" 1>&6 +if test $ac_cv_c_const = no; then + cat >> confdefs.h <<\EOF +#define const +EOF + +fi + + +######## Figure out which math library to use +case "$target" in + *-*-mingw32*) + MATHLIB="" + ;; + *-*-beos*) + MATHLIB="" + ;; + *) + MATHLIB="-lm" + echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 +echo "configure:1251: checking for main in -lm" >&5 +ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lm $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo m | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +{ echo "configure: error: Your system is missing libm (mathlib)!" 1>&2; exit 1; } +fi + + ;; +esac + + +######## Check for SDL +# Check whether --with-sdl-prefix or --without-sdl-prefix was given. +if test "${with_sdl_prefix+set}" = set; then + withval="$with_sdl_prefix" + sdl_prefix="$withval" +else + sdl_prefix="" +fi + +# Check whether --with-sdl-exec-prefix or --without-sdl-exec-prefix was given. +if test "${with_sdl_exec_prefix+set}" = set; then + withval="$with_sdl_exec_prefix" + sdl_exec_prefix="$withval" +else + sdl_exec_prefix="" +fi + +# Check whether --enable-sdltest or --disable-sdltest was given. +if test "${enable_sdltest+set}" = set; then + enableval="$enable_sdltest" + : +else + enable_sdltest=yes +fi + + + if test x$sdl_exec_prefix != x ; then + sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config + fi + fi + if test x$sdl_prefix != x ; then + sdl_args="$sdl_args --prefix=$sdl_prefix" + if test x${SDL_CONFIG+set} != xset ; then + SDL_CONFIG=$sdl_prefix/bin/sdl-config + fi + fi + + + # Extract the first word of "sdl-config", so it can be a program name with args. +set dummy sdl-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1341: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$SDL_CONFIG" in + /*) + ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_SDL_CONFIG="$SDL_CONFIG" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_SDL_CONFIG="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_SDL_CONFIG" && ac_cv_path_SDL_CONFIG="no" + ;; +esac +fi +SDL_CONFIG="$ac_cv_path_SDL_CONFIG" +if test -n "$SDL_CONFIG"; then + echo "$ac_t""$SDL_CONFIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + min_sdl_version=$SDL_VERSION + echo $ac_n "checking for SDL - version >= $min_sdl_version""... $ac_c" 1>&6 +echo "configure:1376: checking for SDL - version >= $min_sdl_version" >&5 + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else + SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` + SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_sdltest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + rm -f conf.sdltest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat > conftest.$ac_ext < +#include +#include +#include "SDL.h" + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main (int argc, char *argv[]) +{ + int major, minor, micro; + char *tmp_version; + + /* This hangs on some systems (?) + system ("touch conf.sdltest"); + */ + { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); } + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_sdl_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_sdl_version"); + exit(1); + } + + if (($sdl_major_version > major) || + (($sdl_major_version == major) && ($sdl_minor_version > minor)) || + (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version); + printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n"); + printf("*** to point to the correct copy of sdl-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + + +EOF +if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + no_sdl=yes +fi +rm -fr conftest* +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_sdl" = x ; then + echo "$ac_t""yes" 1>&6 + : + else + echo "$ac_t""no" 1>&6 + if test "$SDL_CONFIG" = "no" ; then + echo "*** The sdl-config script installed by SDL could not be found" + echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the SDL_CONFIG environment variable to the" + echo "*** full path to sdl-config." + else + if test -f conf.sdltest ; then + : + else + echo "*** Could not run SDL test program, checking why..." + CFLAGS="$CFLAGS $SDL_CFLAGS" + LIBS="$LIBS $SDL_LIBS" + cat > conftest.$ac_ext < +#include "SDL.h" + +int main(int argc, char *argv[]) +{ return 0; } +#undef main +#define main K_and_R_C_main + +int main() { + return 0; +; return 0; } +EOF +if { (eval echo configure:1510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding SDL or finding the wrong" + echo "*** version of SDL. If it is not finding SDL, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means SDL was incorrectly installed" + echo "*** or that you have moved SDL since it was installed. In the latter case, you" + echo "*** may want to edit the sdl-config script: $SDL_CONFIG" +fi +rm -f conftest* + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + SDL_CFLAGS="" + SDL_LIBS="" + { echo "configure: error: *** SDL version $SDL_VERSION not found!" 1>&2; exit 1; } + + fi + + + rm -f conf.sdltest + + +######## Check for other libs +echo $ac_n "checking for main in -ljpeg""... $ac_c" 1>&6 +echo "configure:1547: checking for main in -ljpeg" >&5 +ac_lib_var=`echo jpeg'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ljpeg $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo jpeg | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +{ echo "configure: error: Your system is missing libjpeg!" 1>&2; exit 1; } +fi + + +#Commented out because of a bug in the SuSE 6.2 +#AC_CHECK_LIB(png, main, , AC_MSG_ERROR(Your system is missing libpng!)) + +echo $ac_n "checking for main in -lSDL_mixer""... $ac_c" 1>&6 +echo "configure:1595: checking for main in -lSDL_mixer" >&5 +ac_lib_var=`echo SDL_mixer'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lSDL_mixer $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SOUND="-lSDL_mixer";CFLAGS="$CFLAGS -DSOUND" +else + echo "$ac_t""no" 1>&6 +fi + + +######## Set compiler flags and libraries +CFLAGS="$CFLAGS $SDL_CFLAGS -DDATADIR=\\\"$datadir/bumprace\\\"" +LIBS="$LIBS $SDL_LIBS -ljpeg -lpng $SOUND -lz -lSDL" + +######## Check for headers +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1637: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1658: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1675: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1692: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +for ac_hdr in png.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1720: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +{ echo "configure: error: Your system is missing png.h ! You will probably have to install the png-devel package" 1>&2; exit 1; } +fi +done + +for ac_hdr in jpeglib.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1761: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1771: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <&6 +{ echo "configure: error: Your system is missing jpeglib.h ! You will probably have to install the jpeg-devel package" 1>&2; exit 1; } +fi +done + + +######## Finally create all the generated files +trap '' 1 2 15 +cat > confcache <<\EOF +# 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. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# 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 \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo " +Makefile +src/Makefile +data/Makefile +data/gfx/Makefile +data/sound/Makefile +" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@MIXER_INCLUDED_TRUE@%$MIXER_INCLUDED_TRUE%g +s%@MIXER_INCLUDED_FALSE@%$MIXER_INCLUDED_FALSE%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@target@%$target%g +s%@target_alias@%$target_alias%g +s%@target_cpu@%$target_cpu%g +s%@target_vendor@%$target_vendor%g +s%@target_os@%$target_os%g +s%@CC@%$CC%g +s%@RANLIB@%$RANLIB%g +s%@MATHLIB@%$MATHLIB%g +s%@SDL_CONFIG@%$SDL_CONFIG%g +s%@SDL_CFLAGS@%$SDL_CFLAGS%g +s%@SDL_LIBS@%$SDL_LIBS%g +s%@CPP@%$CPP%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# 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_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # 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" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..e8227f2 --- /dev/null +++ b/configure.in @@ -0,0 +1,67 @@ +######## Process this file with autoconf to produce a configure script. +AC_INIT(README) + +######## Setup for automake +AM_CONDITIONAL(MIXER_INCLUDED, test -d ./src/mixer ) + +NAME="bumprace" +SDL_VERSION=1.1.5 +AM_INIT_AUTOMAKE($NAME, 1.45) + +######## Detect the canonical host and target build environment +AC_CANONICAL_HOST +AC_CANONICAL_TARGET + +######## Check for tools +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_RANLIB + +######## Check for compiler environment +AC_C_CONST + +######## Figure out which math library to use +case "$target" in + *-*-mingw32*) + MATHLIB="" + ;; + *-*-beos*) + MATHLIB="" + ;; + *) + MATHLIB="-lm" + AC_CHECK_LIB(m, main, , AC_MSG_ERROR(Your system is missing libm (mathlib)!)) + ;; +esac +AC_SUBST(MATHLIB) + +######## Check for SDL +AM_PATH_SDL($SDL_VERSION, + :, + AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!]) +) + +######## Check for other libs +AC_CHECK_LIB(jpeg, main, , AC_MSG_ERROR(Your system is missing libjpeg!)) + +#Commented out because of a bug in the SuSE 6.2 +#AC_CHECK_LIB(png, main, , AC_MSG_ERROR(Your system is missing libpng!)) + +AC_CHECK_LIB(SDL_mixer, main, SOUND="-lSDL_mixer";CFLAGS="$CFLAGS -DSOUND") + +######## Set compiler flags and libraries +CFLAGS="$CFLAGS $SDL_CFLAGS -DDATADIR=\\\"$datadir/bumprace\\\"" +LIBS="$LIBS $SDL_LIBS -ljpeg -lpng $SOUND -lz -lSDL" + +######## Check for headers +AC_CHECK_HEADERS(png.h, , AC_MSG_ERROR(Your system is missing png.h ! You will probably have to install the png-devel package)) +AC_CHECK_HEADERS(jpeglib.h, , AC_MSG_ERROR(Your system is missing jpeglib.h ! You will probably have to install the jpeg-devel package)) + +######## Finally create all the generated files +AC_OUTPUT([ +Makefile +src/Makefile +data/Makefile +data/gfx/Makefile +data/sound/Makefile +]) diff --git a/data/Makefile.am b/data/Makefile.am new file mode 100644 index 0000000..a75bf71 --- /dev/null +++ b/data/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = gfx sound + +generaldir = $(datadir)/@PACKAGE@ + +general_DATA = diff --git a/data/Makefile.in b/data/Makefile.in new file mode 100644 index 0000000..cb4cc0d --- /dev/null +++ b/data/Makefile.in @@ -0,0 +1,303 @@ +# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 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. + + +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 + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +MAKEINFO = @MAKEINFO@ +MATHLIB = @MATHLIB@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +VERSION = @VERSION@ + +SUBDIRS = gfx sound + +generaldir = $(datadir)/@PACKAGE@ + +general_DATA = +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +DATA = $(general_DATA) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps data/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-generalDATA: $(general_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(generaldir) + @list='$(general_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(generaldir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(generaldir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(generaldir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(generaldir)/$$p; \ + fi; fi; \ + done + +uninstall-generalDATA: + @$(NORMAL_UNINSTALL) + list='$(general_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(generaldir)/$$p; \ + done + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @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; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" = "." && dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && 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 + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(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)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = data + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: install-generalDATA +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: uninstall-generalDATA +uninstall: uninstall-recursive +all-am: Makefile $(DATA) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(generaldir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-tags distclean-generic clean-am + +distclean: distclean-recursive + +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + +.PHONY: uninstall-generalDATA install-generalDATA install-data-recursive \ +uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# 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: diff --git a/data/gfx/1player.jpg b/data/gfx/1player.jpg new file mode 100644 index 0000000..039585c Binary files /dev/null and b/data/gfx/1player.jpg differ diff --git a/data/gfx/2playercomp.jpg b/data/gfx/2playercomp.jpg new file mode 100644 index 0000000..0121a43 Binary files /dev/null and b/data/gfx/2playercomp.jpg differ diff --git a/data/gfx/2playerteam.jpg b/data/gfx/2playerteam.jpg new file mode 100644 index 0000000..d96c6c1 Binary files /dev/null and b/data/gfx/2playerteam.jpg differ diff --git a/data/gfx/Makefile.am b/data/gfx/Makefile.am new file mode 100644 index 0000000..a17bce8 --- /dev/null +++ b/data/gfx/Makefile.am @@ -0,0 +1,35 @@ + +gfxdir=$(datadir)/@PACKAGE@/gfx + +gfx_DATA = \ +1player.jpg completed.png racerc16.gif racerd7.gif racerf12.gif \ +2playercomp.jpg crashed.png racerc17.gif racerd8.gif racerf13.gif \ +2playerteam.jpg explosion1.gif racerc18.gif racerd9.gif racerf14.gif \ +fore1.png racerc2.gif racerd_big.gif racerf15.gif \ +back2.jpg fore11.gif racerc3.gif racere1.gif racerf16.gif \ +cannon1.jpg fore12.gif racerc4.gif racere10.gif racerf17.gif \ +cannon10.jpg fore13.gif racerc5.gif racere11.gif racerf18.gif \ +cannon11.jpg fore14.gif racerc6.gif racere12.gif racerf2.gif \ +cannon12.jpg fore15.gif racerc7.gif racere13.gif racerf3.gif \ +cannon13.jpg fore16.gif racerc8.gif racere14.gif racerf4.gif \ +cannon14.jpg fore2.png racerc9.gif racere15.gif racerf5.gif \ +cannon15.jpg fore3.png racerd1.gif racere16.gif racerf6.gif \ +cannon16.jpg fore4.png racerd10.gif racere17.gif racerf7.gif \ +cannon17.jpg fore5.png racerd11.gif racere18.gif racerf8.gif \ +cannon18.jpg fore6.png racerd12.gif racere2.gif racerf9.gif \ +cannon19.jpg fore7.png racerd13.gif racere3.gif racerf_big.gif \ +cannon2.jpg quit.jpg racerd14.gif racere4.gif select.gif \ +cannon20.jpg racer_big.gif racerd15.gif racere5.gif selectp1.jpg \ +cannon21.jpg racerb_big.gif racerd16.gif racere6.gif selectp2.jpg \ +cannon3.jpg racerc1.gif racerd17.gif racere7.gif star1.gif \ +cannon4.jpg racerc10.gif racerd18.gif racere8.gif star2.gif \ +cannon5.jpg racerc11.gif racerd2.gif racere9.gif star3.gif \ +cannon6.jpg racerc12.gif racerd3.gif racere_big.gif star4.gif \ +cannon7.jpg racerc13.gif racerd4.gif racerf1.gif star5.gif \ +cannon8.jpg racerc14.gif racerd5.gif racerf10.gif timeout.png \ +cannon9.jpg racerc15.gif racerd6.gif racerf11.gif title.gif \ +font.png highscore.png fore8.png\ +laser1.png laser3.png laser5.png laser7.png laser9.png \ +laser2.png laser4.png laser6.png laser8.png + +EXTRA_DIST = $(gfx_DATA) diff --git a/data/gfx/Makefile.in b/data/gfx/Makefile.in new file mode 100644 index 0000000..11fb99a --- /dev/null +++ b/data/gfx/Makefile.in @@ -0,0 +1,200 @@ +# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 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. + + +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 + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +MAKEINFO = @MAKEINFO@ +MATHLIB = @MATHLIB@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +VERSION = @VERSION@ + +gfxdir = $(datadir)/@PACKAGE@/gfx + +gfx_DATA = 1player.jpg completed.png racerc16.gif racerd7.gif racerf12.gif 2playercomp.jpg crashed.png racerc17.gif racerd8.gif racerf13.gif 2playerteam.jpg explosion1.gif racerc18.gif racerd9.gif racerf14.gif fore1.png racerc2.gif racerd_big.gif racerf15.gif back2.jpg fore11.gif racerc3.gif racere1.gif racerf16.gif cannon1.jpg fore12.gif racerc4.gif racere10.gif racerf17.gif cannon10.jpg fore13.gif racerc5.gif racere11.gif racerf18.gif cannon11.jpg fore14.gif racerc6.gif racere12.gif racerf2.gif cannon12.jpg fore15.gif racerc7.gif racere13.gif racerf3.gif cannon13.jpg fore16.gif racerc8.gif racere14.gif racerf4.gif cannon14.jpg fore2.png racerc9.gif racere15.gif racerf5.gif cannon15.jpg fore3.png racerd1.gif racere16.gif racerf6.gif cannon16.jpg fore4.png racerd10.gif racere17.gif racerf7.gif cannon17.jpg fore5.png racerd11.gif racere18.gif racerf8.gif cannon18.jpg fore6.png racerd12.gif racere2.gif racerf9.gif cannon19.jpg fore7.png racerd13.gif racere3.gif racerf_big.gif cannon2.jpg quit.jpg racerd14.gif racere4.gif select.gif cannon20.jpg racer_big.gif racerd15.gif racere5.gif selectp1.jpg cannon21.jpg racerb_big.gif racerd16.gif racere6.gif selectp2.jpg cannon3.jpg racerc1.gif racerd17.gif racere7.gif star1.gif cannon4.jpg racerc10.gif racerd18.gif racere8.gif star2.gif cannon5.jpg racerc11.gif racerd2.gif racere9.gif star3.gif cannon6.jpg racerc12.gif racerd3.gif racere_big.gif star4.gif cannon7.jpg racerc13.gif racerd4.gif racerf1.gif star5.gif cannon8.jpg racerc14.gif racerd5.gif racerf10.gif timeout.png cannon9.jpg racerc15.gif racerd6.gif racerf11.gif title.gif font.png highscore.png fore8.png laser1.png laser3.png laser5.png laser7.png laser9.png laser2.png laser4.png laser6.png laser8.png + + +EXTRA_DIST = $(gfx_DATA) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +DATA = $(gfx_DATA) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps data/gfx/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-gfxDATA: $(gfx_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(gfxdir) + @list='$(gfx_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(gfxdir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(gfxdir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gfxdir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(gfxdir)/$$p; \ + fi; fi; \ + done + +uninstall-gfxDATA: + @$(NORMAL_UNINSTALL) + list='$(gfx_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(gfxdir)/$$p; \ + done +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = data/gfx + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-gfxDATA +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-gfxDATA +uninstall: uninstall-am +all-am: Makefile $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(gfxdir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: uninstall-gfxDATA install-gfxDATA tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# 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: diff --git a/data/gfx/back2.jpg b/data/gfx/back2.jpg new file mode 100644 index 0000000..0016514 Binary files /dev/null and b/data/gfx/back2.jpg differ diff --git a/data/gfx/cannon1.jpg b/data/gfx/cannon1.jpg new file mode 100644 index 0000000..17df789 Binary files /dev/null and b/data/gfx/cannon1.jpg differ diff --git a/data/gfx/cannon10.jpg b/data/gfx/cannon10.jpg new file mode 100644 index 0000000..8f28917 Binary files /dev/null and b/data/gfx/cannon10.jpg differ diff --git a/data/gfx/cannon11.jpg b/data/gfx/cannon11.jpg new file mode 100644 index 0000000..3f5497c Binary files /dev/null and b/data/gfx/cannon11.jpg differ diff --git a/data/gfx/cannon12.jpg b/data/gfx/cannon12.jpg new file mode 100644 index 0000000..7e2448b Binary files /dev/null and b/data/gfx/cannon12.jpg differ diff --git a/data/gfx/cannon13.jpg b/data/gfx/cannon13.jpg new file mode 100644 index 0000000..789c717 Binary files /dev/null and b/data/gfx/cannon13.jpg differ diff --git a/data/gfx/cannon14.jpg b/data/gfx/cannon14.jpg new file mode 100644 index 0000000..7eecfec Binary files /dev/null and b/data/gfx/cannon14.jpg differ diff --git a/data/gfx/cannon15.jpg b/data/gfx/cannon15.jpg new file mode 100644 index 0000000..cb63d87 Binary files /dev/null and b/data/gfx/cannon15.jpg differ diff --git a/data/gfx/cannon16.jpg b/data/gfx/cannon16.jpg new file mode 100644 index 0000000..21d31e8 Binary files /dev/null and b/data/gfx/cannon16.jpg differ diff --git a/data/gfx/cannon17.jpg b/data/gfx/cannon17.jpg new file mode 100644 index 0000000..ed2d923 Binary files /dev/null and b/data/gfx/cannon17.jpg differ diff --git a/data/gfx/cannon18.jpg b/data/gfx/cannon18.jpg new file mode 100644 index 0000000..46a57d3 Binary files /dev/null and b/data/gfx/cannon18.jpg differ diff --git a/data/gfx/cannon19.jpg b/data/gfx/cannon19.jpg new file mode 100644 index 0000000..e2198fd Binary files /dev/null and b/data/gfx/cannon19.jpg differ diff --git a/data/gfx/cannon2.jpg b/data/gfx/cannon2.jpg new file mode 100644 index 0000000..befe5d8 Binary files /dev/null and b/data/gfx/cannon2.jpg differ diff --git a/data/gfx/cannon20.jpg b/data/gfx/cannon20.jpg new file mode 100644 index 0000000..3424b68 Binary files /dev/null and b/data/gfx/cannon20.jpg differ diff --git a/data/gfx/cannon21.jpg b/data/gfx/cannon21.jpg new file mode 100644 index 0000000..ed91db8 Binary files /dev/null and b/data/gfx/cannon21.jpg differ diff --git a/data/gfx/cannon3.jpg b/data/gfx/cannon3.jpg new file mode 100644 index 0000000..11db559 Binary files /dev/null and b/data/gfx/cannon3.jpg differ diff --git a/data/gfx/cannon4.jpg b/data/gfx/cannon4.jpg new file mode 100644 index 0000000..a17ba5d Binary files /dev/null and b/data/gfx/cannon4.jpg differ diff --git a/data/gfx/cannon5.jpg b/data/gfx/cannon5.jpg new file mode 100644 index 0000000..fa55974 Binary files /dev/null and b/data/gfx/cannon5.jpg differ diff --git a/data/gfx/cannon6.jpg b/data/gfx/cannon6.jpg new file mode 100644 index 0000000..555f7f9 Binary files /dev/null and b/data/gfx/cannon6.jpg differ diff --git a/data/gfx/cannon7.jpg b/data/gfx/cannon7.jpg new file mode 100644 index 0000000..8237025 Binary files /dev/null and b/data/gfx/cannon7.jpg differ diff --git a/data/gfx/cannon8.jpg b/data/gfx/cannon8.jpg new file mode 100644 index 0000000..ed3baf8 Binary files /dev/null and b/data/gfx/cannon8.jpg differ diff --git a/data/gfx/cannon9.jpg b/data/gfx/cannon9.jpg new file mode 100644 index 0000000..2c4dccc Binary files /dev/null and b/data/gfx/cannon9.jpg differ diff --git a/data/gfx/completed.png b/data/gfx/completed.png new file mode 100644 index 0000000..5fe2d3e Binary files /dev/null and b/data/gfx/completed.png differ diff --git a/data/gfx/crashed.png b/data/gfx/crashed.png new file mode 100644 index 0000000..4989e83 Binary files /dev/null and b/data/gfx/crashed.png differ diff --git a/data/gfx/explosion1.gif b/data/gfx/explosion1.gif new file mode 100644 index 0000000..8ed7b0b Binary files /dev/null and b/data/gfx/explosion1.gif differ diff --git a/data/gfx/font.png b/data/gfx/font.png new file mode 100644 index 0000000..a28ba54 Binary files /dev/null and b/data/gfx/font.png differ diff --git a/data/gfx/fore1.png b/data/gfx/fore1.png new file mode 100644 index 0000000..1f45078 Binary files /dev/null and b/data/gfx/fore1.png differ diff --git a/data/gfx/fore11.gif b/data/gfx/fore11.gif new file mode 100644 index 0000000..7d94f83 Binary files /dev/null and b/data/gfx/fore11.gif differ diff --git a/data/gfx/fore12.gif b/data/gfx/fore12.gif new file mode 100644 index 0000000..ef3c467 Binary files /dev/null and b/data/gfx/fore12.gif differ diff --git a/data/gfx/fore13.gif b/data/gfx/fore13.gif new file mode 100644 index 0000000..c5d9945 Binary files /dev/null and b/data/gfx/fore13.gif differ diff --git a/data/gfx/fore14.gif b/data/gfx/fore14.gif new file mode 100644 index 0000000..557450e Binary files /dev/null and b/data/gfx/fore14.gif differ diff --git a/data/gfx/fore15.gif b/data/gfx/fore15.gif new file mode 100644 index 0000000..d0f3c7a Binary files /dev/null and b/data/gfx/fore15.gif differ diff --git a/data/gfx/fore16.gif b/data/gfx/fore16.gif new file mode 100644 index 0000000..9ec600c Binary files /dev/null and b/data/gfx/fore16.gif differ diff --git a/data/gfx/fore2.png b/data/gfx/fore2.png new file mode 100644 index 0000000..6f151ab Binary files /dev/null and b/data/gfx/fore2.png differ diff --git a/data/gfx/fore3.png b/data/gfx/fore3.png new file mode 100644 index 0000000..faf1961 Binary files /dev/null and b/data/gfx/fore3.png differ diff --git a/data/gfx/fore4.png b/data/gfx/fore4.png new file mode 100644 index 0000000..2b1eb8c Binary files /dev/null and b/data/gfx/fore4.png differ diff --git a/data/gfx/fore5.png b/data/gfx/fore5.png new file mode 100644 index 0000000..dd41980 Binary files /dev/null and b/data/gfx/fore5.png differ diff --git a/data/gfx/fore6.png b/data/gfx/fore6.png new file mode 100644 index 0000000..f729552 Binary files /dev/null and b/data/gfx/fore6.png differ diff --git a/data/gfx/fore7.png b/data/gfx/fore7.png new file mode 100644 index 0000000..531d750 Binary files /dev/null and b/data/gfx/fore7.png differ diff --git a/data/gfx/fore8.png b/data/gfx/fore8.png new file mode 100644 index 0000000..1f45078 Binary files /dev/null and b/data/gfx/fore8.png differ diff --git a/data/gfx/highscore.png b/data/gfx/highscore.png new file mode 100644 index 0000000..86c8822 Binary files /dev/null and b/data/gfx/highscore.png differ diff --git a/data/gfx/laser1.png b/data/gfx/laser1.png new file mode 100644 index 0000000..90d650e Binary files /dev/null and b/data/gfx/laser1.png differ diff --git a/data/gfx/laser2.png b/data/gfx/laser2.png new file mode 100644 index 0000000..bac262a Binary files /dev/null and b/data/gfx/laser2.png differ diff --git a/data/gfx/laser3.png b/data/gfx/laser3.png new file mode 100644 index 0000000..c735b00 Binary files /dev/null and b/data/gfx/laser3.png differ diff --git a/data/gfx/laser4.png b/data/gfx/laser4.png new file mode 100644 index 0000000..0ff94c1 Binary files /dev/null and b/data/gfx/laser4.png differ diff --git a/data/gfx/laser5.png b/data/gfx/laser5.png new file mode 100644 index 0000000..419abc4 Binary files /dev/null and b/data/gfx/laser5.png differ diff --git a/data/gfx/laser6.png b/data/gfx/laser6.png new file mode 100644 index 0000000..fbd0d4d Binary files /dev/null and b/data/gfx/laser6.png differ diff --git a/data/gfx/laser7.png b/data/gfx/laser7.png new file mode 100644 index 0000000..5d20da7 Binary files /dev/null and b/data/gfx/laser7.png differ diff --git a/data/gfx/laser8.png b/data/gfx/laser8.png new file mode 100644 index 0000000..0cf6db4 Binary files /dev/null and b/data/gfx/laser8.png differ diff --git a/data/gfx/laser9.png b/data/gfx/laser9.png new file mode 100644 index 0000000..85400ba Binary files /dev/null and b/data/gfx/laser9.png differ diff --git a/data/gfx/quit.jpg b/data/gfx/quit.jpg new file mode 100644 index 0000000..1ad435f Binary files /dev/null and b/data/gfx/quit.jpg differ diff --git a/data/gfx/racer_big.gif b/data/gfx/racer_big.gif new file mode 100644 index 0000000..5f6d03f Binary files /dev/null and b/data/gfx/racer_big.gif differ diff --git a/data/gfx/racerb_big.gif b/data/gfx/racerb_big.gif new file mode 100644 index 0000000..f3bb3f3 Binary files /dev/null and b/data/gfx/racerb_big.gif differ diff --git a/data/gfx/racerc1.gif b/data/gfx/racerc1.gif new file mode 100644 index 0000000..d6f3af5 Binary files /dev/null and b/data/gfx/racerc1.gif differ diff --git a/data/gfx/racerc10.gif b/data/gfx/racerc10.gif new file mode 100644 index 0000000..ea128a5 Binary files /dev/null and b/data/gfx/racerc10.gif differ diff --git a/data/gfx/racerc11.gif b/data/gfx/racerc11.gif new file mode 100644 index 0000000..8f58d59 Binary files /dev/null and b/data/gfx/racerc11.gif differ diff --git a/data/gfx/racerc12.gif b/data/gfx/racerc12.gif new file mode 100644 index 0000000..4d8876c Binary files /dev/null and b/data/gfx/racerc12.gif differ diff --git a/data/gfx/racerc13.gif b/data/gfx/racerc13.gif new file mode 100644 index 0000000..07400a1 Binary files /dev/null and b/data/gfx/racerc13.gif differ diff --git a/data/gfx/racerc14.gif b/data/gfx/racerc14.gif new file mode 100644 index 0000000..1d7f87a Binary files /dev/null and b/data/gfx/racerc14.gif differ diff --git a/data/gfx/racerc15.gif b/data/gfx/racerc15.gif new file mode 100644 index 0000000..3b395cc Binary files /dev/null and b/data/gfx/racerc15.gif differ diff --git a/data/gfx/racerc16.gif b/data/gfx/racerc16.gif new file mode 100644 index 0000000..de96447 Binary files /dev/null and b/data/gfx/racerc16.gif differ diff --git a/data/gfx/racerc17.gif b/data/gfx/racerc17.gif new file mode 100644 index 0000000..a91b6f3 Binary files /dev/null and b/data/gfx/racerc17.gif differ diff --git a/data/gfx/racerc18.gif b/data/gfx/racerc18.gif new file mode 100644 index 0000000..5a5d5d6 Binary files /dev/null and b/data/gfx/racerc18.gif differ diff --git a/data/gfx/racerc2.gif b/data/gfx/racerc2.gif new file mode 100644 index 0000000..85aa918 Binary files /dev/null and b/data/gfx/racerc2.gif differ diff --git a/data/gfx/racerc3.gif b/data/gfx/racerc3.gif new file mode 100644 index 0000000..1467d21 Binary files /dev/null and b/data/gfx/racerc3.gif differ diff --git a/data/gfx/racerc4.gif b/data/gfx/racerc4.gif new file mode 100644 index 0000000..b47c2ec Binary files /dev/null and b/data/gfx/racerc4.gif differ diff --git a/data/gfx/racerc5.gif b/data/gfx/racerc5.gif new file mode 100644 index 0000000..efdef55 Binary files /dev/null and b/data/gfx/racerc5.gif differ diff --git a/data/gfx/racerc6.gif b/data/gfx/racerc6.gif new file mode 100644 index 0000000..a3d5ee6 Binary files /dev/null and b/data/gfx/racerc6.gif differ diff --git a/data/gfx/racerc7.gif b/data/gfx/racerc7.gif new file mode 100644 index 0000000..7022082 Binary files /dev/null and b/data/gfx/racerc7.gif differ diff --git a/data/gfx/racerc8.gif b/data/gfx/racerc8.gif new file mode 100644 index 0000000..a45207f Binary files /dev/null and b/data/gfx/racerc8.gif differ diff --git a/data/gfx/racerc9.gif b/data/gfx/racerc9.gif new file mode 100644 index 0000000..ac475b8 Binary files /dev/null and b/data/gfx/racerc9.gif differ diff --git a/data/gfx/racerd1.gif b/data/gfx/racerd1.gif new file mode 100644 index 0000000..0a81f21 Binary files /dev/null and b/data/gfx/racerd1.gif differ diff --git a/data/gfx/racerd10.gif b/data/gfx/racerd10.gif new file mode 100644 index 0000000..9e606e7 Binary files /dev/null and b/data/gfx/racerd10.gif differ diff --git a/data/gfx/racerd11.gif b/data/gfx/racerd11.gif new file mode 100644 index 0000000..93ae111 Binary files /dev/null and b/data/gfx/racerd11.gif differ diff --git a/data/gfx/racerd12.gif b/data/gfx/racerd12.gif new file mode 100644 index 0000000..f053428 Binary files /dev/null and b/data/gfx/racerd12.gif differ diff --git a/data/gfx/racerd13.gif b/data/gfx/racerd13.gif new file mode 100644 index 0000000..3b8088d Binary files /dev/null and b/data/gfx/racerd13.gif differ diff --git a/data/gfx/racerd14.gif b/data/gfx/racerd14.gif new file mode 100644 index 0000000..1c533d3 Binary files /dev/null and b/data/gfx/racerd14.gif differ diff --git a/data/gfx/racerd15.gif b/data/gfx/racerd15.gif new file mode 100644 index 0000000..0b9001d Binary files /dev/null and b/data/gfx/racerd15.gif differ diff --git a/data/gfx/racerd16.gif b/data/gfx/racerd16.gif new file mode 100644 index 0000000..3e399ea Binary files /dev/null and b/data/gfx/racerd16.gif differ diff --git a/data/gfx/racerd17.gif b/data/gfx/racerd17.gif new file mode 100644 index 0000000..b462b79 Binary files /dev/null and b/data/gfx/racerd17.gif differ diff --git a/data/gfx/racerd18.gif b/data/gfx/racerd18.gif new file mode 100644 index 0000000..33e32c8 Binary files /dev/null and b/data/gfx/racerd18.gif differ diff --git a/data/gfx/racerd2.gif b/data/gfx/racerd2.gif new file mode 100644 index 0000000..41cd356 Binary files /dev/null and b/data/gfx/racerd2.gif differ diff --git a/data/gfx/racerd3.gif b/data/gfx/racerd3.gif new file mode 100644 index 0000000..6587309 Binary files /dev/null and b/data/gfx/racerd3.gif differ diff --git a/data/gfx/racerd4.gif b/data/gfx/racerd4.gif new file mode 100644 index 0000000..03c2671 Binary files /dev/null and b/data/gfx/racerd4.gif differ diff --git a/data/gfx/racerd5.gif b/data/gfx/racerd5.gif new file mode 100644 index 0000000..dca73d8 Binary files /dev/null and b/data/gfx/racerd5.gif differ diff --git a/data/gfx/racerd6.gif b/data/gfx/racerd6.gif new file mode 100644 index 0000000..606581b Binary files /dev/null and b/data/gfx/racerd6.gif differ diff --git a/data/gfx/racerd7.gif b/data/gfx/racerd7.gif new file mode 100644 index 0000000..e6e3875 Binary files /dev/null and b/data/gfx/racerd7.gif differ diff --git a/data/gfx/racerd8.gif b/data/gfx/racerd8.gif new file mode 100644 index 0000000..d90f47d Binary files /dev/null and b/data/gfx/racerd8.gif differ diff --git a/data/gfx/racerd9.gif b/data/gfx/racerd9.gif new file mode 100644 index 0000000..7c04e18 Binary files /dev/null and b/data/gfx/racerd9.gif differ diff --git a/data/gfx/racerd_big.gif b/data/gfx/racerd_big.gif new file mode 100644 index 0000000..4ecde63 Binary files /dev/null and b/data/gfx/racerd_big.gif differ diff --git a/data/gfx/racere1.gif b/data/gfx/racere1.gif new file mode 100644 index 0000000..bce038b Binary files /dev/null and b/data/gfx/racere1.gif differ diff --git a/data/gfx/racere10.gif b/data/gfx/racere10.gif new file mode 100644 index 0000000..9216811 Binary files /dev/null and b/data/gfx/racere10.gif differ diff --git a/data/gfx/racere11.gif b/data/gfx/racere11.gif new file mode 100644 index 0000000..2f3c8c5 Binary files /dev/null and b/data/gfx/racere11.gif differ diff --git a/data/gfx/racere12.gif b/data/gfx/racere12.gif new file mode 100644 index 0000000..cb03eb8 Binary files /dev/null and b/data/gfx/racere12.gif differ diff --git a/data/gfx/racere13.gif b/data/gfx/racere13.gif new file mode 100644 index 0000000..8f5a362 Binary files /dev/null and b/data/gfx/racere13.gif differ diff --git a/data/gfx/racere14.gif b/data/gfx/racere14.gif new file mode 100644 index 0000000..0633ab5 Binary files /dev/null and b/data/gfx/racere14.gif differ diff --git a/data/gfx/racere15.gif b/data/gfx/racere15.gif new file mode 100644 index 0000000..e1b75fa Binary files /dev/null and b/data/gfx/racere15.gif differ diff --git a/data/gfx/racere16.gif b/data/gfx/racere16.gif new file mode 100644 index 0000000..a8ab0f9 Binary files /dev/null and b/data/gfx/racere16.gif differ diff --git a/data/gfx/racere17.gif b/data/gfx/racere17.gif new file mode 100644 index 0000000..cacf6c2 Binary files /dev/null and b/data/gfx/racere17.gif differ diff --git a/data/gfx/racere18.gif b/data/gfx/racere18.gif new file mode 100644 index 0000000..7377f2f Binary files /dev/null and b/data/gfx/racere18.gif differ diff --git a/data/gfx/racere2.gif b/data/gfx/racere2.gif new file mode 100644 index 0000000..bcd1be1 Binary files /dev/null and b/data/gfx/racere2.gif differ diff --git a/data/gfx/racere3.gif b/data/gfx/racere3.gif new file mode 100644 index 0000000..5d1550b Binary files /dev/null and b/data/gfx/racere3.gif differ diff --git a/data/gfx/racere4.gif b/data/gfx/racere4.gif new file mode 100644 index 0000000..27d93c6 Binary files /dev/null and b/data/gfx/racere4.gif differ diff --git a/data/gfx/racere5.gif b/data/gfx/racere5.gif new file mode 100644 index 0000000..e243568 Binary files /dev/null and b/data/gfx/racere5.gif differ diff --git a/data/gfx/racere6.gif b/data/gfx/racere6.gif new file mode 100644 index 0000000..c27bdb4 Binary files /dev/null and b/data/gfx/racere6.gif differ diff --git a/data/gfx/racere7.gif b/data/gfx/racere7.gif new file mode 100644 index 0000000..33b11cc Binary files /dev/null and b/data/gfx/racere7.gif differ diff --git a/data/gfx/racere8.gif b/data/gfx/racere8.gif new file mode 100644 index 0000000..7e4308e Binary files /dev/null and b/data/gfx/racere8.gif differ diff --git a/data/gfx/racere9.gif b/data/gfx/racere9.gif new file mode 100644 index 0000000..eb30fa1 Binary files /dev/null and b/data/gfx/racere9.gif differ diff --git a/data/gfx/racere_big.gif b/data/gfx/racere_big.gif new file mode 100644 index 0000000..f8ec6f3 Binary files /dev/null and b/data/gfx/racere_big.gif differ diff --git a/data/gfx/racerf1.gif b/data/gfx/racerf1.gif new file mode 100644 index 0000000..c49a340 Binary files /dev/null and b/data/gfx/racerf1.gif differ diff --git a/data/gfx/racerf10.gif b/data/gfx/racerf10.gif new file mode 100644 index 0000000..54a84b2 Binary files /dev/null and b/data/gfx/racerf10.gif differ diff --git a/data/gfx/racerf11.gif b/data/gfx/racerf11.gif new file mode 100644 index 0000000..93ed025 Binary files /dev/null and b/data/gfx/racerf11.gif differ diff --git a/data/gfx/racerf12.gif b/data/gfx/racerf12.gif new file mode 100644 index 0000000..10ceeee Binary files /dev/null and b/data/gfx/racerf12.gif differ diff --git a/data/gfx/racerf13.gif b/data/gfx/racerf13.gif new file mode 100644 index 0000000..1641fa9 Binary files /dev/null and b/data/gfx/racerf13.gif differ diff --git a/data/gfx/racerf14.gif b/data/gfx/racerf14.gif new file mode 100644 index 0000000..2c9aca7 Binary files /dev/null and b/data/gfx/racerf14.gif differ diff --git a/data/gfx/racerf15.gif b/data/gfx/racerf15.gif new file mode 100644 index 0000000..14bd0dd Binary files /dev/null and b/data/gfx/racerf15.gif differ diff --git a/data/gfx/racerf16.gif b/data/gfx/racerf16.gif new file mode 100644 index 0000000..6849eb0 Binary files /dev/null and b/data/gfx/racerf16.gif differ diff --git a/data/gfx/racerf17.gif b/data/gfx/racerf17.gif new file mode 100644 index 0000000..97aa5a6 Binary files /dev/null and b/data/gfx/racerf17.gif differ diff --git a/data/gfx/racerf18.gif b/data/gfx/racerf18.gif new file mode 100644 index 0000000..b1e3756 Binary files /dev/null and b/data/gfx/racerf18.gif differ diff --git a/data/gfx/racerf2.gif b/data/gfx/racerf2.gif new file mode 100644 index 0000000..f99f6cf Binary files /dev/null and b/data/gfx/racerf2.gif differ diff --git a/data/gfx/racerf3.gif b/data/gfx/racerf3.gif new file mode 100644 index 0000000..b644d0e Binary files /dev/null and b/data/gfx/racerf3.gif differ diff --git a/data/gfx/racerf4.gif b/data/gfx/racerf4.gif new file mode 100644 index 0000000..54a8650 Binary files /dev/null and b/data/gfx/racerf4.gif differ diff --git a/data/gfx/racerf5.gif b/data/gfx/racerf5.gif new file mode 100644 index 0000000..820766a Binary files /dev/null and b/data/gfx/racerf5.gif differ diff --git a/data/gfx/racerf6.gif b/data/gfx/racerf6.gif new file mode 100644 index 0000000..45f2d01 Binary files /dev/null and b/data/gfx/racerf6.gif differ diff --git a/data/gfx/racerf7.gif b/data/gfx/racerf7.gif new file mode 100644 index 0000000..a3de332 Binary files /dev/null and b/data/gfx/racerf7.gif differ diff --git a/data/gfx/racerf8.gif b/data/gfx/racerf8.gif new file mode 100644 index 0000000..ef4de77 Binary files /dev/null and b/data/gfx/racerf8.gif differ diff --git a/data/gfx/racerf9.gif b/data/gfx/racerf9.gif new file mode 100644 index 0000000..92c9971 Binary files /dev/null and b/data/gfx/racerf9.gif differ diff --git a/data/gfx/racerf_big.gif b/data/gfx/racerf_big.gif new file mode 100644 index 0000000..cc6f322 Binary files /dev/null and b/data/gfx/racerf_big.gif differ diff --git a/data/gfx/select.gif b/data/gfx/select.gif new file mode 100644 index 0000000..169ec82 Binary files /dev/null and b/data/gfx/select.gif differ diff --git a/data/gfx/selectp1.jpg b/data/gfx/selectp1.jpg new file mode 100644 index 0000000..b0063b8 Binary files /dev/null and b/data/gfx/selectp1.jpg differ diff --git a/data/gfx/selectp2.jpg b/data/gfx/selectp2.jpg new file mode 100644 index 0000000..0ddd75e Binary files /dev/null and b/data/gfx/selectp2.jpg differ diff --git a/data/gfx/star1.gif b/data/gfx/star1.gif new file mode 100644 index 0000000..bc21771 Binary files /dev/null and b/data/gfx/star1.gif differ diff --git a/data/gfx/star2.gif b/data/gfx/star2.gif new file mode 100644 index 0000000..6b6c61a Binary files /dev/null and b/data/gfx/star2.gif differ diff --git a/data/gfx/star3.gif b/data/gfx/star3.gif new file mode 100644 index 0000000..05d0331 Binary files /dev/null and b/data/gfx/star3.gif differ diff --git a/data/gfx/star4.gif b/data/gfx/star4.gif new file mode 100644 index 0000000..5c39743 Binary files /dev/null and b/data/gfx/star4.gif differ diff --git a/data/gfx/star5.gif b/data/gfx/star5.gif new file mode 100644 index 0000000..4b654e4 Binary files /dev/null and b/data/gfx/star5.gif differ diff --git a/data/gfx/timeout.png b/data/gfx/timeout.png new file mode 100644 index 0000000..1b4cfa8 Binary files /dev/null and b/data/gfx/timeout.png differ diff --git a/data/gfx/title.gif b/data/gfx/title.gif new file mode 100644 index 0000000..2f96f56 Binary files /dev/null and b/data/gfx/title.gif differ diff --git a/data/sound/Makefile.am b/data/sound/Makefile.am new file mode 100644 index 0000000..2312e25 --- /dev/null +++ b/data/sound/Makefile.am @@ -0,0 +1,6 @@ + +sounddir=$(datadir)/@PACKAGE@/sound + +sound_DATA = explode.wav lizard.mod whoosh.wav winlevel.wav + +EXTRA_DIST = $(sound_DATA) diff --git a/data/sound/Makefile.in b/data/sound/Makefile.in new file mode 100644 index 0000000..4cf9bc2 --- /dev/null +++ b/data/sound/Makefile.in @@ -0,0 +1,199 @@ +# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 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. + + +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 + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +MAKEINFO = @MAKEINFO@ +MATHLIB = @MATHLIB@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +VERSION = @VERSION@ + +sounddir = $(datadir)/@PACKAGE@/sound + +sound_DATA = explode.wav lizard.mod whoosh.wav winlevel.wav + +EXTRA_DIST = $(sound_DATA) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +DATA = $(sound_DATA) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps data/sound/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-soundDATA: $(sound_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(sounddir) + @list='$(sound_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sounddir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(sounddir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sounddir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(sounddir)/$$p; \ + fi; fi; \ + done + +uninstall-soundDATA: + @$(NORMAL_UNINSTALL) + list='$(sound_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(sounddir)/$$p; \ + done +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = data/sound + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-soundDATA +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-soundDATA +uninstall: uninstall-am +all-am: Makefile $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(sounddir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: uninstall-soundDATA install-soundDATA tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# 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: diff --git a/data/sound/explode.wav b/data/sound/explode.wav new file mode 100644 index 0000000..8a59f59 Binary files /dev/null and b/data/sound/explode.wav differ diff --git a/data/sound/lizard.mod b/data/sound/lizard.mod new file mode 100644 index 0000000..c3956bd Binary files /dev/null and b/data/sound/lizard.mod differ diff --git a/data/sound/whoosh.wav b/data/sound/whoosh.wav new file mode 100644 index 0000000..cd2e409 Binary files /dev/null and b/data/sound/whoosh.wav differ diff --git a/data/sound/winlevel.wav b/data/sound/winlevel.wav new file mode 100644 index 0000000..2110968 Binary files /dev/null and b/data/sound/winlevel.wav differ diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..e9de238 --- /dev/null +++ b/install-sh @@ -0,0 +1,251 @@ +#!/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 + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + chmodcmd="" + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/missing b/missing new file mode 100755 index 0000000..7789652 --- /dev/null +++ b/missing @@ -0,0 +1,190 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997 Free Software Foundation, Inc. +# Franc,ois 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. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +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 + +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 + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`configure.in'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`configure.in'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`configure.in'. 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.in` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case "$f" in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + 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 + ;; + + 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 + ;; + + makeinfo) + 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 + ;; + + *) + 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 diff --git a/mkinstalldirs b/mkinstalldirs new file mode 100755 index 0000000..9c887cb --- /dev/null +++ b/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 1999/11/18 18:23:17 hercules Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/src/IMG.h b/src/IMG.h new file mode 100644 index 0000000..fbeff9e --- /dev/null +++ b/src/IMG.h @@ -0,0 +1,77 @@ +/* + IMGLIB: An example image loading library for use with SDL + Copyright (C) 1999 Sam Lantinga + + 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 + + Sam Lantinga + 5635-34 Springhouse Dr. + Pleasanton, CA 94588 (USA) + slouken@devolution.com +*/ + +/* A simple library to load images of various formats as SDL surfaces */ + +#ifndef _IMG_h +#define _IMG_h + +#include "SDL.h" +#include "begin_code.h" + +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +extern "C" { +#endif + +/* Load an image from an SDL data source. + The 'type' may be one of: "BMP", "GIF", "PNG", etc. + + If the image format supports a transparent pixel, SDL will set the + colorkey for the surface. You can enable RLE acceleration on the + surface afterwards by calling: + SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey); + */ +extern DECLSPEC SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, + char *type); +/* Convenience functions */ +extern DECLSPEC SDL_Surface *IMG_Load(const char *file); +extern DECLSPEC SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc); + +/* Invert the alpha of a surface for use with OpenGL + This function is now a no-op, and only provided for backwards compatibility. +*/ +extern DECLSPEC int IMG_InvertAlpha(int on); + +/* Functions to detect a file type, given a seekable source */ +extern DECLSPEC int IMG_isGIF(SDL_RWops *src); +extern DECLSPEC int IMG_isJPG(SDL_RWops *src); +extern DECLSPEC int IMG_isPNG(SDL_RWops *src); + +/* Individual loading functions */ +extern DECLSPEC SDL_Surface *IMG_LoadGIF_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src); +extern DECLSPEC SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src); + +/* We'll use SDL for reporting errors */ +#define IMG_SetError SDL_SetError +#define IMG_GetError SDL_GetError + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +}; +#endif +#include "close_code.h" + +#endif /* _IMG_h */ diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..c8887de --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,10 @@ +bin_PROGRAMS = bumprace + +bumprace_SOURCES = bumprace.c img.c img_gif.c img_jpg.c \ + gfx.c particles.c menu.c img_png.c \ + IMG.h bumprace.h gfx.h \ + levels.h menu.h particles.h \ + options.h options.c font.h font.c + + +#SUBDIRS = mixer \ No newline at end of file diff --git a/src/Makefile.in b/src/Makefile.in new file mode 100644 index 0000000..f9d7ba4 --- /dev/null +++ b/src/Makefile.in @@ -0,0 +1,294 @@ +# Makefile.in generated automatically by automake 1.4-p4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 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. + + +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 + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +CC = @CC@ +MAKEINFO = @MAKEINFO@ +MATHLIB = @MATHLIB@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SDL_CFLAGS = @SDL_CFLAGS@ +SDL_CONFIG = @SDL_CONFIG@ +SDL_LIBS = @SDL_LIBS@ +VERSION = @VERSION@ + +bin_PROGRAMS = bumprace + +bumprace_SOURCES = bumprace.c img.c img_gif.c img_jpg.c gfx.c particles.c menu.c img_png.c IMG.h bumprace.h gfx.h levels.h menu.h particles.h options.h options.c font.h font.c + +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_CLEAN_FILES = +PROGRAMS = $(bin_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +bumprace_OBJECTS = bumprace.o img.o img_gif.o img_jpg.o gfx.o \ +particles.o menu.o img_png.o options.o font.o +bumprace_LDADD = $(LDADD) +bumprace_DEPENDENCIES = +bumprace_LDFLAGS = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = $(bumprace_SOURCES) +OBJECTS = $(bumprace_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-binPROGRAMS: + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +distclean-binPROGRAMS: + +maintainer-clean-binPROGRAMS: + +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(bin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +.c.o: + $(COMPILE) -c $< + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +bumprace: $(bumprace_OBJECTS) $(bumprace_DEPENDENCIES) + @rm -f bumprace + $(LINK) $(bumprace_LDFLAGS) $(bumprace_OBJECTS) $(bumprace_LDADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +bumprace.o: bumprace.c levels.h particles.h menu.h bumprace.h gfx.h \ + font.h options.h +font.o: font.c +gfx.o: gfx.c bumprace.h gfx.h font.h IMG.h +img.o: img.c IMG.h +img_gif.o: img_gif.c IMG.h +img_jpg.o: img_jpg.c IMG.h +img_png.o: img_png.c IMG.h +menu.o: menu.c bumprace.h gfx.h font.h +options.o: options.c bumprace.h gfx.h font.h +particles.o: particles.c bumprace.h gfx.h font.h + +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binPROGRAMS +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binPROGRAMS +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ + mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ + distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ +check-am installcheck-am installcheck install-exec-am install-exec \ +install-data-am install-data install-am install uninstall-am uninstall \ +all-redirect all-am all installdirs mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +#SUBDIRS = mixer + +# 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: diff --git a/src/bumprace.c b/src/bumprace.c new file mode 100644 index 0000000..8b0749d --- /dev/null +++ b/src/bumprace.c @@ -0,0 +1,1108 @@ +/* BumpRace: an easy-to-learn arcade game for up to two players + Copyright (C) 2000 Karl Bartel + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + 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 + + Karl Bartel + Cecilienstr. 14 + 12307 Berlin + GERMANY + karlb@gmx.net +*/ +#include +#include +#include +#include +#include +#ifdef SOUND +#include "SDL_mixer.h" +#endif +#include "levels.h" +#include "particles.h" +#include "menu.h" +#include "bumprace.h" +#include "font.h" +#include "options.h" + +#define MAX_PLAYER_NUM 2 +#define FOREGROUND_TILE_NUM 8 +#define MAX_SHOTNUM 50 +#define NUMBER_OF_LEVELS 21 +#define BPP 0 +#define RR 3 //this is a value of unprecision for the racer collision + + //the players + player user[MAX_PLAYER_NUM]; int pl=0,playernum=2; + //general setting + int final=1,fullscreen=1,pageflip=0,sound=1,precision=10,fps=0,particle=1,mode,dofadeout=1; + //level settings + float gravity=0,turbo=5,laser_switch; + int startx,starty; + //sounds +#ifdef SOUND + char modname[20]="lizard.mod"; + Mix_Chunk *explode_sound,*winlevel_sound,*teleport_sound; + Mix_Music *music; +#endif + //images + SDL_Surface *timeout_pic, *explosion_pic, *title_pic, + *back, *fore[16], *pic_completed,*pic_crashed, + *racer_pic[6], *cannon_pic[21], *shot_pic[5], + *mode_select_pic[4], *selector_pic, *selectp_pic[2], + *Font,*laser_pic[9]; + //event handling + SDL_Event event; Uint8 *keys; + //game states + int endgame=0,dontshow=0,levelnum=0,quit=0,already=0,laser_state; + //level vars + char finished[28]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // is level number X finished (1 or 0) + int levels_completed=0,Stage; + //assorted + float game_speed=100,average_speed,time_since_start,accel_speed,turn_speed; + int frame_count=0,count_start=0,Score=0; + float frames_per_second,PARTICLES_OF_EXHAUST=150; + int stop=0,stop2=0,infox,infoy,shotnum=0,cannonnum; + Sint32 now,lifetime=800000,last_lifetime,NextParticle; + char text[200]; + int i,y,x,time_bonus; + shot_type shot[MAX_SHOTNUM]; + +void ComplainAndExit(void); + +void free_memory() +{ +#ifdef SOUND + if (sound) + { + Mix_FreeMusic(music); + Mix_FreeChunk(explode_sound); + Mix_FreeChunk(winlevel_sound); + Mix_FreeChunk(teleport_sound); + Mix_CloseAudio(); + } +#endif +} + +void timing() +{ +#ifdef SOUND + if ((!Mix_PlayingMusic())&&(sound)) {Mix_PlayMusic(music,1);} +#endif + time_since_start+=game_speed; + average_speed=time_since_start/frame_count; + //printf("gamespeed: %f average: %f \n",game_speed,average_speed); + lifetime-=game_speed; + if ( keys[SDLK_ESCAPE] == SDL_PRESSED ) + {quit=1;endgame=1;} + frame_count++; + frames_per_second=frame_count*1000/((SDL_GetTicks()-count_start)+1); + game_speed=(SDL_GetTicks()-now)*7; + while (game_speed<140) { + SDL_Delay(1); + game_speed=(SDL_GetTicks()-now)*7; + } + // printf("x:%f y:%f delay:%d fps%f\n",user[pl].realx,user[pl].realy,(SDL_GetTicks()-now),frames_per_second); + now=SDL_GetTicks(); +} + +void corner_collision( Uint8 xblock, Uint8 yblock) +{ + float hyp,alpha,xold,yold; + xold=user[pl].xspeed; + yold=user[pl].yspeed; + hyp=hypot(user[pl].realx+15-xblock*40,user[pl].realy+15-yblock*40); + if (hyp<15-RR) + { + alpha=atan(-(user[pl].realx+15-xblock*40)/(user[pl].realy+15-yblock*40)); + user[pl].xspeed=2*(xold*cos(alpha)+yold*sin(alpha))*cos(alpha)-xold; + user[pl].yspeed=2*(xold*cos(alpha)+yold*sin(alpha))*sin(alpha)-yold; + already=1; + } +} + +void kollision() //calcualtes all collisions +{ + Uint8 x,y,x2,y2,xbig,ybig,sticky; + SDL_Rect reblit_back; + if (( keys[user[pl].extra] == SDL_PRESSED )&&(user[pl].sticky_possible)) sticky=1; else sticky=0; + if (already) {already=0;} else + for (y=0;y<=14;y++) { + for (x=0;x<=19;x++) { +//wall + if (((map[levelnum][y][x]==1)||(map[levelnum][y][x]>10)||(map[levelnum][y][x]==8))&&((user[pl].realx+30>x*40)&&(user[pl].realxy*40)&&(user[pl].realyy*40)&&(!already)&& + (user[pl].realx+15<(x+1)*40)&&(user[pl].realx+15>x*40)&&(map[levelnum][y-1][x]!=1)) + if (sticky) {user[pl].yspeed*=0.1;user[pl].xspeed*=0.1;} else if (user[pl].yspeed>0) {user[pl].yspeed=-user[pl].yspeed;already=1;} + if ((user[pl].realx+15>(x+1)*40)&&(user[pl].realx+RR<(x+1)*40)&&(!already)&& + (user[pl].realy+15<(y+1)*40)&&(user[pl].realy+15>y*40)&&(map[levelnum][y][x+1]!=1)) + if (sticky) {user[pl].yspeed*=0.1;user[pl].xspeed*=0.1;} else if (user[pl].xspeed<0) {user[pl].xspeed=-user[pl].xspeed;already=1;} + if ((user[pl].realy+15>(y+1)*40)&&(user[pl].realy+RR<(y+1)*40)&&(!already)&& + (user[pl].realx+15<(x+1)*40)&&(user[pl].realx+15>x*40)&&(map[levelnum][y+1][x]!=1)) + if (sticky) {user[pl].yspeed*=0.1;user[pl].xspeed*=0.1;} else if (user[pl].yspeed<0) {user[pl].yspeed=-user[pl].yspeed;already=1;} + if ((user[pl].realx+15x*40)&&(!already)&& + (user[pl].realy+15<(y+1)*40)&&(user[pl].realy+15>y*40)&&(map[levelnum][y][x-1]!=1)) + if (sticky) {user[pl].yspeed*=0.1;user[pl].xspeed*=0.1;} else if (user[pl].xspeed>0) {user[pl].xspeed=-user[pl].xspeed;already=1;} + // corners + if ((user[pl].realx+15>(x+1)*40)&&(user[pl].realy+150))*/ corner_collision(x+1,y); + if ((user[pl].realx+150)&&(user[pl].yspeed>0))*/ corner_collision(x,y); + if ((user[pl].realx+15>(x+1)*40)&&(user[pl].realy+15>(y+1)*40)&&(!already)&&(map[levelnum][y][x+1]!=1)&&(map[levelnum][y+1][x]!=1)) + /*if ((user[pl].xspeed<0)&&(user[pl].yspeed<0))*/ corner_collision(x+1,y+1); + if ((user[pl].realx+15(y+1)*40)&&(!already)&&(map[levelnum][y][x-1]!=1)&&(map[levelnum][y+1][x]!=1)) + /*if ((user[pl].xspeed>0)&&(user[pl].yspeed<0))*/ corner_collision(x,y+1); + } + if (stop) {stop--;} + if (stop2) {stop2--;} +//lightning + if ((map[levelnum][y][x]==2)&&((user[pl].realx+24>x*40)&&(user[pl].realxy*40)&&(user[pl].realyx*40)&&(user[pl].realxy*40)&&(user[pl].realyx*40)&&(user[pl].realxy*40)&&(user[pl].realyx*40)&&(user[pl].realxy*40)&&(user[pl].realy0) {user[pl].teleported-=game_speed;} + if (user[pl].teleported<0) {user[pl].teleported=0;} +//time bonus + if ((map[levelnum][y][x]==6)&&((user[pl].realx+10>x*40)&&(user[pl].realxy*40)&&(user[pl].realyw/2; + reblit_back.y=y*40+20-fore[5]->h/2; + reblit_back.w=fore[5]->w; + reblit_back.h=fore[5]->h; + BlitPart(0,0,back,reblit_back); + SDL_BlitSurface( back, &reblit_back, backbuffer, &reblit_back ); + if (!fullscreen) {SDL_UpdateRects(Screen,1,&reblit_back);} + } +//laser + if ((map[levelnum][y][x]==7)&&((user[pl].realx+24>x*40)&&(user[pl].realxy*40)&&(user[pl].realy774) {user[pl].realx=774;user[pl].xspeed=-user[pl].xspeed;} + if (user[pl].realy<-6) {user[pl].realy=-6;user[pl].yspeed=-user[pl].yspeed;} + if (user[pl].realy>574) {user[pl].realy=574;user[pl].yspeed=-user[pl].yspeed;} + kollision(); + } +//gravity + user[pl].yspeed+=(gravity)*game_speed; +//slowdown + if (user[pl].slowdown>0) + { + if (user[pl].xspeed!=0) {alpha=atan(user[pl].yspeed/user[pl].xspeed);} else alpha=1; + hyp=hypot(user[pl].xspeed,user[pl].yspeed); + if ((user[pl].xspeed<0)) + { + if (!gravity) {user[pl].yspeed+=sin(alpha)*hyp*user[pl].slowdown*game_speed;} + {user[pl].xspeed+=cos(alpha)*hyp*user[pl].slowdown*game_speed;} + }else + { + if (!gravity) {user[pl].yspeed-=sin(alpha)*hyp*user[pl].slowdown*game_speed;} + {user[pl].xspeed-=cos(alpha)*hyp*user[pl].slowdown*game_speed;} + } + } +} + +void DontReadKeys() +{ + SDL_EventState(SDL_KEYUP, SDL_IGNORE); + SDL_EventState(SDL_KEYDOWN, SDL_IGNORE); +} + +void UndrawLaser(int update) +{ + SDL_Rect src_rect; + + Uint8 x,y,xbig,ybig; + for (y=0;y<=14;y++) { + for (x=0;x<=19;x++) { + if (map[levelnum][y][x]==7){ + src_rect.x=x*40; + src_rect.y=y*40; + src_rect.w=40; + src_rect.h=40; + BlitPart(x*40,y*40,backbuffer,src_rect); +// SDL_BlitSurface(back , &src_rect , backbuffer, &src_rect); + if (update) SDL_UpdateRect(Screen,x*40,y*40,40,40); + } + } + } +} + +void DrawLaser() +{ + SDL_Rect src_rect; + + Uint8 x,y,xbig,ybig; + for (y=0;y<=14;y++) { + for (x=0;x<=19;x++) { + if (map[levelnum][y][x]==7){ + src_rect.x=x*40; + src_rect.y=y*40; + src_rect.w=40; + src_rect.h=40; + Blit(x*40 ,y*40,laser_pic[abrand(0,8)]); + Blit(x*40+15,y*40,laser_pic[abrand(0,8)]); + Blit(x*40+30,y*40,laser_pic[abrand(0,8)]); + SDL_UpdateRect(Screen,x*40,y*40,40,40); + } + } + } +} + +void draw_cannon() +{ + int pic=0; + + while (cannon.turn<0) cannon.turn+=360; + cannon.turn+=90; // bad fix -> should be changed! + pic=((cannon.turn)*21/360); + if (pic>20) pic-=21; // bad fix -> should be changed! + if (pic!=cannon.last_pic) + { + Blit(cannon.x*40,cannon.y*40,cannon_pic[pic]); + BlitToBB(cannon.x*40,cannon.y*40,cannon_pic[pic]); + } + cannon.last_pic=pic; + cannon.turn-=90; // bad fix -> should be changed! + while (cannon.turn>360) cannon.turn-=360; +} + +void checks_common() +{ +//laser + if ((laser_state==0)&&(div(SDL_GetTicks(),laser_switch)).rem<(int)(laser_switch/2)) + laser_state=1; + if ((laser_state==1)&&(div(SDL_GetTicks(),laser_switch).rem>(int)(laser_switch/2))) { + laser_state=0; + UndrawLaser(1); + } +//cannon + if (cannonnum) + { + cannon.turn+=game_speed/(15+cannon.type*15); + if (cannon.turn>360) cannon.turn-=360; + if (cannon.turn<0) cannon.turn+=360; + cannon.time_to_shot-=game_speed*1; + if ((cannon.time_to_shot<0)&&(shotnumw/2+1400*shot[shotnum].xspeed; + shot[shotnum].y=cannon.y*40+20-shot_pic[0]->h/2+1400*shot[shotnum].yspeed; + shotnum++; + //printf("%d\n",(int)cannon.turn); + } + } +} + +void DisplayMsg(SDL_Surface *img, float speed) +{ + Blit(400-img->w/2,250,img); + now=SDL_GetTicks(); + for (i=255*speed;i>=0;i-=(float)(SDL_GetTicks()-now)/2) + { + timing(); + SDL_SetAlpha(backbuffer,(SDL_SRCALPHA),255); + UndrawParticles(); + HandleParticles(); + DisplayParticles(); + Blit(400-img->w/2,250,img); + SDL_SetAlpha(backbuffer,(SDL_SRCALPHA),(int)(i/speed)); + SDL_BlitSurface(backbuffer,&blitrect,Screen,&blitrect); + Update(); + } + BlitToBB(400-img->w/2,250,img); + SDL_SetAlpha(backbuffer,SDL_SRCALPHA,255); + while (NullParticle>0) { + timing(); + UndrawParticles(); + HandleParticles(); + DisplayParticles(); + Update(); + } + SDL_SetAlpha(backbuffer,SDL_SRCALPHA,255); +} + +void DrawExplosion() +{ + int x,y; + + x=abrand(-14,+8);y=abrand(-14,+8); + Blit(user[pl].realx+x,user[pl].realy+y,explosion_pic); + BlitToBB(user[pl].realx+x,user[pl].realy+y,explosion_pic); +} + +void checks_1p() +{ + int degree; + +//level end + if ( user[pl].completed ) + { +#ifdef SOUND + if (sound) {Mix_PlayChannel(-1,winlevel_sound,0);} +#endif + DontReadKeys(); + DisplayMsg(pic_completed,1); + SDL_Delay(1000); + endgame=1; + lifetime+=(int)(150000*(1+(time_bonus)/100)); + } +//crash + if ( user[pl].crashed ) + { + DontReadKeys(); +#ifdef SOUND + if (sound) {Mix_PlayChannel(-1,explode_sound,0);} +#endif + SDL_SetAlpha(explosion_pic,(SDL_SRCALPHA),255-80); + DrawExplosion(); + DrawExplosion(); + DrawExplosion(); + DisplayMsg(pic_crashed,1); + SDL_Delay(1000); + endgame=1; + fadeout(); + } +//timeout + if (lifetime<0) + { + DontReadKeys(); + DisplayMsg(timeout_pic,1); + SDL_Delay(1000); + endgame=1; + quit=1; + fadeout(); + } +} + +void checks_2p() +{ + for (pl=0;plformat,255-xcol,xcol,y)); + } + } + unlock(); + timerect.x=infox*40+5; + timerect.y=infoy*40; + timerect.w=110; + timerect.h=38; + if (!fullscreen) {SDL_UpdateRects(Screen,1,&timerect);} + SDL_BlitSurface(Screen,&timerect,backbuffer,&timerect); + } + } +} + +SDL_Rect SetShotRect(int i) +{ + SDL_Rect rect; + + rect.x=shot[i].x; + rect.y=shot[i].y; + rect.w=shot_pic[0]->w; + rect.h=shot_pic[0]->h; + if (rect.w+rect.x>800) rect.w=800-rect.x; + if (rect.h+rect.y>600) rect.h=600-rect.y; + if (rect.x<0) {rect.w=rect.w+rect.x;rect.x=0;} + if (rect.y<0) {rect.h=rect.h+rect.y;rect.y=0;} + return (rect); +} + +void UndrawShots() +{ + for (i=0;i4) shot[i].anim-=5; + shot[i].x+=shot[i].xspeed*game_speed; + shot[i].y+=shot[i].yspeed*game_speed; + if ((shot[i].x<=-shot_pic[0]->w)||(shot[i].x>=800) + ||(shot[i].y<=-shot_pic[0]->h)||(shot[i].y>=600)) + { + SDL_UpdateRects( Screen, 1, &shot[i].oldrect ); + for (i2=i;i2360) {user[pl].turn=user[pl].turn-360;} + for (i=0;i<=17;i++) //selects the correct picture + if (user[pl].turn+10>i*20) {pic=i;} + Blit(user[pl].realx,user[pl].realy,user[pl].racer[pic]); + user[pl].oldrect=blitrect; +} + +void HandleAndDraw_RacerParticlesAndShots() +{ + if (laser_state) UndrawLaser(0); + UndrawShots(); + UndrawParticles(); + for (pl=0;plw/2+20, + y*40-fore[map[levelnum][y][x]-1]->h/2+20, + fore[map[levelnum][y][x]-1]); + } + } +} + +void LookForInfo() //looks for the info box in this level +{ + int i; + + infox=-1; + infoy=-1; + cannon.x=-1; + for (y=0;y<=14;y++) { + for (x=0;x<=19;x++) { + if ((map[levelnum][y][x]==11)&&(infoy==-1)) + { + infox=x; + infoy=y; + } + if (map[levelnum][y][x]==8) + { + cannon.y=y; + cannon.x=x; + } + } + } + if (cannon.x<0) cannonnum=0; else cannonnum=1; +} + +void load_images() +{ + Uint8 i; + + racer_pic[0]=LoadImage("racer_big.gif",0); + racer_pic[1]=LoadImage("racerb_big.gif",0); + racer_pic[2]=LoadImage("racere_big.gif",0); + racer_pic[4]=LoadImage("racerd_big.gif",0); + racer_pic[3]=LoadImage("racerf_big.gif",0); + racer_pic[5]=LoadImage("highscore.png",0); + timeout_pic=LoadImage("timeout.png",3); + explosion_pic=LoadImage("explosion1.gif",1); + pic_completed=LoadImage("completed.png",3); + pic_crashed=LoadImage("crashed.png",3); + back=LoadImage("back2.jpg",0); + mode_select_pic[0]=LoadImage("1player.jpg",0); + mode_select_pic[1]=LoadImage("2playercomp.jpg",0); + mode_select_pic[2]=LoadImage("2playerteam.jpg",0); + mode_select_pic[3]=LoadImage("quit.jpg",0); + selectp_pic[0]=LoadImage("selectp1.jpg",0); + selectp_pic[1]=LoadImage("selectp2.jpg",0); + selector_pic=LoadImage("select.gif",1); + for (i=0;i<=FOREGROUND_TILE_NUM-1;i++) + { + sprintf(text,"fore%d.png",i+1); + fore[i]=LoadImage(text,3); + } + for (i=10;i<16;i++) + { + sprintf(text,"fore%d.gif",i+1); + fore[i]=LoadImage(text,0); + } + for (i=0;i<21;i++) + { + sprintf(text,"cannon%d.jpg",i+1); + cannon_pic[i]=LoadImage(text,0); + } + for (i=0;i<5;i++) + { + sprintf(text,"star%d.gif",i+1); + shot_pic[i]=LoadImage(text,1); + } + for (i=0;i<9;i++) + { + sprintf(text,"laser%d.png",i+1); + laser_pic[i]=LoadImage(text,3); + } +} + +void TextHelp(char *argv[]) +{ + printf("\nBumpRace Version %s\n",VERSION); + puts("The newest version can be obtained at http://www.linux-games.com/\n"); + printf("Usage: %s [options]\n",argv[0]); + puts(" [-f | --fullscreen] start in fullscreen mode (default)"); + puts(" [-w,| --windowed] start in windowed mode"); + puts(" [-s,| --nosound] start without sound"); + puts(" [-n,| --notfinal] no title screen (nice for develolopers)"); + puts(" [-t,| --noparticles] turns of paticles. good for slow computers."); + puts(" [-o,| --nofadeout] no fadeout after crash (for slow coputers)"); + puts(" [ --precision] sets the precison of the collisions (default=10)"); + puts(" [-h,| --help] this text\n"); + + exit(0); +} + +void ReadCommandLine(char *argv[]) +{ + int i; + for ( i=1;argv[i];i++ ) + { + if ((strcmp(argv[i],"--nosound")==0)||(strcmp(argv[i],"-s")==0)) {sound=0;} else + if ((strcmp(argv[i],"--fullscreen")==0)||(strcmp(argv[i],"-f")==0)) {fullscreen=1;} else + if ((strcmp(argv[i],"--windowed")==0)||(strcmp(argv[i],"-w")==0)) {fullscreen=0;} else + if ((strcmp(argv[i],"--pageflip")==0)||(strcmp(argv[i],"-p")==0)) {pageflip=1;fullscreen=1;} else + if ((strcmp(argv[i],"--notfinal")==0)||(strcmp(argv[i],"-n")==0)) {final=0;} else + if ((strcmp(argv[i],"--noparticles")==0)||(strcmp(argv[i],"-t")==0)) {particle=0;} else + if ((strcmp(argv[i],"--nofadeout")==0)||(strcmp(argv[i],"-o")==0)) {dofadeout=0;} else + if ((strcmp(argv[i],"--precision")==0)&&(argv[i+1])) + {i++;precision=atoi(argv[i]);printf("Precision is set to %d\n",precision);} else + if ((strcmp(argv[i],"--help")==0)||(strcmp(argv[i],"-h")==0)) TextHelp(argv); + else { + printf("Unknown parameter (-h for help): \"%s\" \n", argv[i]); + TextHelp(argv); + } + } +} + +void BlitMenu() //blits menu for SelectRacer +{ + SDL_Rect fillrect; + + for (i=0;i<=5;i++) + { + if (i==user[pl].racernum) { + SDL_SetAlpha(racer_pic[i],(SDL_SRCALPHA),255); + } else { + SDL_SetAlpha(racer_pic[i],(SDL_SRCALPHA),75); + } + } + fillrect.x=0; + fillrect.y=160; + fillrect.w=800; + fillrect.h=440; + SDL_FillRect(Screen,&fillrect,0); + Blit(50,160,racer_pic[0]); + Blit(300,160,racer_pic[1]); + Blit(550,160,racer_pic[2]); + Blit(50,370,racer_pic[3]); + Blit(300,370,racer_pic[4]); + Blit(550,370,racer_pic[5]); + PutString(Screen, 100, 350, "Best steering"); + PutString(Screen, 330, 350, "15% extra time"); + PutString(Screen, 540, 350, "High velocity (ctrl key)"); + PutString(Screen, 40, 560, "Sticks to walls (ctrl key)"); +} + +void NextStage() +{ + Blit(0,0,back); + XCenteredString(Screen, 100, "Congratulations!"); + XCenteredString(Screen, 130, "You have completed a stage!"); + XCenteredString(Screen, 200, "You gain 200 points for completing this stage"); + sprintf(text, "and %d points for the time that is left,", lifetime/3000); + XCenteredString(Screen, 230, text); + XCenteredString(Screen, 260, "but the game gets a bit harder."); + sprintf(text, "You are in Stage %d now", ++Stage); + XCenteredString(Screen, 360, text); + sprintf(text, "Your current score is %d", Score+=200+lifetime/3000); + XCenteredString(Screen, 390, text); + levels_completed=0; + lifetime=800000-(Stage-1)*70000; + SDL_UpdateRect(Screen,0,0,0,0); + SDL_EventState(SDL_KEYUP, SDL_ENABLE); + SDL_EventState(SDL_KEYDOWN, SDL_ENABLE); + SDL_WaitEvent(&event); + SDL_WaitEvent(&event); +} + +void nextlevel() //selects the next level at random +{ + int i; + finished[levelnum]=1; + quit=1; + for (i=0;iuser[1].points) sprintf(text,"Player 1 has won!"); + else if (user[0].points +#include "gfx.h" +#include "font.h" + +#define SDL_SetAlpha($1,$2,$3) SDL_SetAlpha($1,0,0);SDL_SetAlpha($1,$2,$3) + +typedef struct{ + float slowdown,turbo_possible,sticky_possible,extra_time; + float realx,realy,xspeed,yspeed,turn,teleported; + int crashed,completed,racernum,points; + SDL_Rect oldrect; + SDLKey up,down,left,right,extra; + SDL_Surface *racer[18]; +}player; + +typedef struct +{ + int shot_delay; // delay between two shots + float time_to_shot; // time to the next shot + float turn; // current degree of rotation + int x,y; // coordinates + int last_pic; // last blitted picture + int type; // shooting method +} cannon_type; + + cannon_type cannon; + +typedef struct +{ + float x,y; // coordinates + float xspeed,yspeed; // speed and direction + float anim; // # of shown picture + SDL_Rect oldrect; // the background has to be restored here +} shot_type; + + +#define MAX_PLAYER_NUM 2 + +extern player user[MAX_PLAYER_NUM]; +extern SDL_Surface *screen, *back, *backbuffer, *fore[16], + *racer_pic[6], *selector_pic, *selectp_pic[2], *mode_select_pic[4], + *title_pic; +extern float game_speed, gravity; +extern int particle,which_racer,pl,i,mode,playernum,Score,fullscreen,precision,dofadeout; +extern Uint8 *keys; +extern SDL_Event event; +extern struct BitFont font; +extern Sint32 now; +extern char text[200]; +//extern char *DATAPATH[200]; + +#endif \ No newline at end of file diff --git a/src/font.c b/src/font.c new file mode 100644 index 0000000..90342e8 --- /dev/null +++ b/src/font.c @@ -0,0 +1,75 @@ +#include "SDL.h" + +int CharPos[520]; +SDL_Surface *Font; + +#define SPACE_WIDTH CharPos[2]-CharPos[1] + +void InitFont(SDL_Surface *FontToUse) +{ + int x=0,i=0; + + Font=FontToUse; + while (xw) { + if (GetPixel(Font,x,0)==SDL_MapRGB(Font->format,255,0,255)) { + CharPos[i++]=x; +// printf("%d ",x); + while (GetPixel(Font,x,0)==SDL_MapRGB(Font->format,255,0,255)) + x++; + CharPos[i++]=x; +// printf("%d ",x); + } + x++; +// printf("%d-",GetPixel(Font,x,0)); + } +} + + +void PutString(SDL_Surface *Surface, int x, int y, char *text) +{ + unsigned char ofs; + int i=0; + SDL_Rect srcrect,dstrect; + + while (text[i]!='\0') { + if (text[i]==' ') { + x+=SPACE_WIDTH; + i++; + } else { + ofs=(text[i]-33)*2+1; +// printf("printing %c %d\n",text[i],ofs); + srcrect.w=dstrect.w=(CharPos[ofs+2]+CharPos[ofs+1])/2-(CharPos[ofs]+CharPos[ofs-1])/2; + srcrect.h=dstrect.h=Font->h-1; + srcrect.x=(CharPos[ofs]+CharPos[ofs-1])/2; + srcrect.y=1; + dstrect.x=x; + dstrect.y=y; + SDL_BlitSurface( Font, &srcrect, Surface, &dstrect); + x+=CharPos[ofs+1]-CharPos[ofs]; + i++; + } + } +} + +int TextWidth(char *text) +{ + int x=0,i=0; + unsigned char ofs; + + while (text[i]!='\0') { + if (text[i]==' ') { + x+=SPACE_WIDTH; + i++; + } else { + ofs=(text[i]-33)*2+1; + x+=CharPos[ofs+1]-CharPos[ofs]; + i++; + } + } + return x+CharPos[ofs+2]-CharPos[ofs+1]; +} + +void XCenteredString(SDL_Surface *Surface, int y, char *text) +{ + PutString(Surface, Surface->w/2-TextWidth(text)/2, y, text); +} \ No newline at end of file diff --git a/src/font.h b/src/font.h new file mode 100644 index 0000000..b9c8422 --- /dev/null +++ b/src/font.h @@ -0,0 +1,18 @@ +// SFONT - SDL Font Library by Karl Bartel + +#include "SDL.h" + +// Initializes the font +// Font: this is the surface which contains the font. +void InitFont(SDL_Surface *Font); + +// Blits a string to a surface +// Destination: the suface you want to blit to +// text: a string containing the text you want to blit. +void PutString( SDL_Surface *Destination, int x, int y, char *text); + +// Blits a string to with centered x position +void XCenteredString(SDL_Surface *Surface, int y, char *text); + +// Returns the width of "text" in pixels +int TextWidth( char *text); \ No newline at end of file diff --git a/src/gfx.c b/src/gfx.c new file mode 100644 index 0000000..7a385aa --- /dev/null +++ b/src/gfx.c @@ -0,0 +1,464 @@ +#include +#include "IMG.h" + +#define PATHNUM 8 +#define BPP 0 +#define RECTS_NUM 40000 +char DATAPATH[200]=DATADIR; +const char PATH[PATHNUM][200]={DATADIR,".","data","/usr/local/share/bumprace" +,"/usr/lib/bumprace","../data","/usr/share/bumprace",DATADIR}; +SDL_Surface *Screen,*BackBuffer,*fadebuffer; +SDL_Rect blitrect,blitrects[RECTS_NUM]; +int blitrects_num=0; +#ifdef DATADIR +void ComplainAndExit(void) +{ + fprintf(stderr, "Problem: %s\n", SDL_GetError()); + exit(1); +} +#endif +int abrand(int a,int b) //random number between a and b (inclusive) +{ + return(a+(rand() % (b-a+1))); +} + +int (*_PutPixel)(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color); + +int fast_putpixel1(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color) +{ + if (X < 0 || X > Surface->w || Y < 0 || Y > Surface->h) + return -1; + + *((Uint8 *)Surface->pixels + Y * Surface->pitch + X) = Color; + + return 0; +} + +int fast_putpixel2(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color) +{ + if (X < 0 || X > Surface->w || Y < 0 || Y > Surface->h) + return -1; + + *((Uint16 *)Surface->pixels + Y * Surface->pitch/2 + X) = Color; + + return 0; +} + +int fast_putpixel3(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color) +{ + Uint8 *pix; + int shift; + + if (X < 0 || X > Surface->w || Y < 0 || Y > Surface->h) + return -1; + + /* Gack - slow, but endian correct */ + pix = (Uint8 *)Surface->pixels + Y * Surface->pitch + X*3; + shift = Surface->format->Rshift; + *(pix+shift/8) = Color>>shift; + shift = Surface->format->Gshift; + *(pix+shift/8) = Color>>shift; + shift = Surface->format->Bshift; + *(pix+shift/8) = Color>>shift; + + return 0; +} + +int fast_putpixel4(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color) +{ + if (X < 0 || X > Surface->w || Y < 0 || Y > Surface->h) + return -1; + + *((Uint32 *)Surface->pixels + Y * Surface->pitch/4 + X) = Color; + + return 0; +} + +void init_SDL() // sets the video mode +{ + int bpp=BPP; + const SDL_VideoInfo *info; + + if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_AUDIO) < 0 ) {ComplainAndExit();} + info = SDL_GetVideoInfo(); + if (info->vfmt->BitsPerPixel==8) bpp=16; + atexit(SDL_Quit); +// Set the video mode (800x600 at 16-bit depth) + if (fullscreen) + Screen = SDL_SetVideoMode(800, 600, BPP, SDL_FULLSCREEN); + else + { Screen = SDL_SetVideoMode(800, 600, BPP, 0); } + if ( Screen == NULL ) {ComplainAndExit();} +// create BackBuffer + BackBuffer = SDL_AllocSurface(Screen->flags, + 800, + 600, + Screen->format->BitsPerPixel, + Screen->format->Rmask, + Screen->format->Gmask, + Screen->format->Bmask, 0); + if (BackBuffer == NULL) + printf("ERROR: Couldn't create BackBuffer: %s\n", SDL_GetError()); + fadebuffer = SDL_AllocSurface(Screen->flags, + 800, + 600, + Screen->format->BitsPerPixel, + Screen->format->Rmask, + Screen->format->Gmask, + Screen->format->Bmask, 0); + if (fadebuffer == NULL) + printf("ERROR: Couldn't create fadebuffer: %s\n", SDL_GetError()); +// Figure out what putpixel routine to use + switch (Screen->format->BytesPerPixel) + { + case 1: + _PutPixel = fast_putpixel1; + break; + case 2: + _PutPixel = fast_putpixel2; + break; + case 3: + _PutPixel = fast_putpixel3; + break; + case 4: + _PutPixel = fast_putpixel4; + break; + } +} + +void lock() +{ + if ( SDL_MUSTLOCK(Screen) ) { + if ( SDL_LockSurface(Screen) < 0 ) + return; } +} + +void unlock() +{ + if ( SDL_MUSTLOCK(Screen) ) { + SDL_UnlockSurface(Screen); } +} + +// Performs Callback at each line point. This came straight from the +// asphyxia vga trainers +int DoLine (SDL_Surface *Surface, Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, Uint32 Color, int Callback (SDL_Surface *Surf, Sint32 X, Sint32 Y, Uint32 Color)) +{ + Sint32 dx, dy, sdx, sdy, x, y, px, py; + + dx = X2 - X1; + dy = Y2 - Y1; + + sdx = (dx < 0) ? -1 : 1; + sdy = (dy < 0) ? -1 : 1; + + dx = sdx * dx + 1; + dy = sdy * dy + 1; + + x = y = 0; + + px = X1; + py = Y1; + + if (dx >= dy) + { + for (x = 0; x < dx; x++) + { + Callback(Surface, px, py, Color); + + y += dy; + if (y >= dx) + { + y -= dx; + py += sdy; + } + px += sdx; + } + } + else + { + for (y = 0; y < dy; y++) + { + + Callback(Surface, px, py, Color); + + x += dx; + if (x >= dy) + { + x -= dy; + px += sdx; + } + py += sdy; + } + } + return 0; +} + +// The user's line drawing function +void Line(Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, Uint32 Color) +{ + Sint32 temp; + \ No newline at end of file +/* + \ No newline at end of file + // Make sure X1 is before X2 + if (X2 < X1){ + temp = X2; + X2 = X1; + X1 = temp; + } + // Make sure Y1 is before Y2 + if (Y2 < Y1){ + temp = Y2; + Y2 = Y1; + Y1 = temp; + } \ No newline at end of file +*/ + lock(Screen); + \ No newline at end of file + /* Draw the line */ + DoLine(Screen, X1, Y1, X2, Y2, Color, &PutPixel); + unlock(Screen); +} + +void fadeout() +{ + int x,y; + + if (dofadeout==0) return; + + for (x=0;x<800;x++) + { + lock(); + for (y=0;y<300;y++) + { + PutPixel(Screen,x,y*2,SDL_MapRGB(Screen->format,0,0,0)); + } + unlock(); + Update(); + } + for (x=799;x>=0;x--) + { + lock(); + for (y=299;y>0;y--) + { + PutPixel(Screen,x,y*2+1,SDL_MapRGB(Screen->format,0,0,0)); + } + unlock(); + Update(); + } +} + +void Update() +{ + SDL_UpdateRects(Screen,blitrects_num,blitrects); + blitrects_num=0; +} + +void AddRect(int x1, int y1, int x2, int y2) +{ + int temp; + \ No newline at end of file + /* Make sure X1 is before X2 */ + if (x2 < x1){ + temp = x2; + x2 = x1; + x1 = temp; + } + /* Make sure Y1 is before Y2 */ + if (y2 < y1){ + temp = y2; + y2 = y1; + y1 = temp; + } + blitrect.x = x1; + blitrect.y = y1; + blitrect.w = x2-x1+1; + blitrect.h = y2-y1+1; + if (x1<0) printf("x is too small in function AddRect! - %d\n",x1);else + if (y1<0) printf("y is too small in function AddRect! - %d\n",y1);else + if (x2>=800) printf("x is too big in function AddRect! - %d\n",x2);else + if (y2>=600) printf("y is too big in function AddRect! - %d\n",y2);else { + blitrects[blitrects_num]=blitrect; + if (++blitrects_num>=RECTS_NUM-2) + {printf("Too many blits!\n");blitrects_num--;Update();} + } +} + +void AddThisRect(SDL_Rect blitrect) +{ + blitrects[blitrects_num]=blitrect; + if (++blitrects_num>=RECTS_NUM-2) + {printf("Too many blits!\n");blitrects_num--;Update();} +} + +void Blit(int Xpos,int Ypos,SDL_Surface *image) //blits one GIF or BMP from the memory to the screen +{ + blitrect.x = Xpos; + blitrect.y = Ypos; + blitrect.w = image->w; + blitrect.h = image->h; + + if (Xpos<-image->w) printf("WRONG BLIT: Xpos is too small! - %d\n",Xpos); else + if (Xpos>=800) printf("WRONG BLIT: Xpos is too big! - %d\n",Xpos); else + if (Ypos<-image->h) printf("WRONG BLIT: Ypos is too small! - %d\n",Ypos); else + if (Ypos>=600) printf("WRONG BLIT: Ypos is too big! - %d\n",Ypos); else + if ( SDL_BlitSurface(image, NULL, Screen, &blitrect) < 0 ) + { + SDL_FreeSurface(image); + ComplainAndExit(); + } + blitrects[blitrects_num]=blitrect; + blitrects_num++; +} + +SDL_Surface *LoadImage(char *datafile, int transparent) // reads one png into the memory +{ + SDL_Surface *pic,*pic2; + char filename[200]; + int i=0; + + sprintf(filename,"%s/gfx/%s",DATAPATH,datafile); + pic=IMG_Load(filename); + while ( pic == NULL ) { + strcpy(DATAPATH,PATH[i]); + sprintf(filename,"%s/gfx/%s",DATAPATH,datafile); + pic=IMG_Load(filename); + i++; + + if (i>=PATHNUM) + { + fprintf(stderr,"Couldn't load %s: %s\n", filename, SDL_GetError()); + exit(2); + } + } + if (transparent==3) return(pic); + if (transparent==1) + SDL_SetColorKey(pic,SDL_SRCCOLORKEY|SDL_RLEACCEL,SDL_MapRGB(pic->format,0xFF,0xFF,0xFF)); + if (transparent==2) + SDL_SetColorKey(pic,SDL_SRCCOLORKEY|SDL_RLEACCEL,SDL_MapRGB(pic->format,0x00,0x00,0x00)); + pic2 = SDL_DisplayFormat(pic); + SDL_FreeSurface(pic); +// blit(0,0,pic2); +// SDL_UpdateRect(screen,0,0,0,0); + return (pic2); +} + +void BlitToBB(int Xpos,int Ypos,SDL_Surface *image) //blits one GIF or BMP from the memory to the screen +{ + blitrect.x = Xpos; + blitrect.y = Ypos; + blitrect.w = image->w; + blitrect.h = image->h; + if ( SDL_BlitSurface(image, NULL, BackBuffer, &blitrect) < 0 ) + { + SDL_FreeSurface(image); + ComplainAndExit(); + } +} + +void BlitPart(int Xpos,int Ypos,SDL_Surface *image, SDL_Rect srcrect) +{ + blitrect.x = srcrect.x; + blitrect.y = srcrect.y; + blitrect.w = srcrect.w; + blitrect.h = srcrect.h; + if ( SDL_BlitSurface(image, &srcrect , Screen, &blitrect) < 0 ) + { + SDL_FreeSurface(image); + ComplainAndExit(); + } + blitrects[blitrects_num]=blitrect; + blitrects_num++; +} + +void FadeScreen(float speed) +{ + Sint32 now,i; + + SDL_BlitSurface(Screen,NULL,fadebuffer,NULL); + now=SDL_GetTicks(); + for (i=255*speed;i>=0;i-=SDL_GetTicks()-now) + { + now=SDL_GetTicks(); + SDL_BlitSurface(fadebuffer,&blitrect,Screen,&blitrect); + SDL_SetAlpha(BackBuffer,SDL_SRCALPHA,255-(int)(i/speed)); + Blit(0,0,BackBuffer); + Update(); + } + SDL_SetAlpha(BackBuffer,SDL_SRCALPHA,255); + Blit(0,0,BackBuffer); + Update(); +} + +int PutPixel(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color) +{ + if (X<0) printf("X < 0 in function PutPixel! - %d\n",X); else + if (X>=800) printf("X >= 800 in function PutPixel! - %d\n",X); else + if (Y<0) printf("Y < 0 in function PutPixel! - %d\n",Y); else + if (Y>=600) printf("Y >= 600 in function PutPixel! - %d\n",Y); else + { + _PutPixel(Surface,X,Y,Color); + AddRect(X,Y,X,Y); + } + return 0; +} + +int PutPixelC(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color) +{ + if (X<0) printf("X < 0 in function PutPixelC! - %d\n",X); else + if (X>=800) printf("X >= 800 in function PutPixelC! - %d\n",X); else + if (Y<0) printf("Y < 0 in function PutPixelC! - %d\n",Y); else + if (Y>=600) printf("Y >= 600 in function PutPixelC! - %d\n",Y); else + { + _PutPixel(Surface,X,Y,Color); + AddRect(X,Y,X,Y); + } + return 0; +} + +int PutBackPixel(SDL_Surface *Surface, Sint32 X, Sint32 Y) +{ + SDL_Rect rect; + + rect.w=1; + rect.h=1; + rect.x=X; + rect.y=Y; + SDL_BlitSurface(BackBuffer, &rect, Surface, &rect); + AddThisRect(rect); +} + +Uint32 GetPixel (SDL_Surface *Surface, Sint32 X, Sint32 Y) +{ + + Uint8 *bits; + Uint32 Bpp; + + + Bpp = Surface->format->BytesPerPixel; + + bits = ((Uint8 *)Surface->pixels)+Y*Surface->pitch+X*Bpp; + + // Get the pixel + switch(Bpp) { + case 1: + return *((Uint8 *)Surface->pixels + Y * Surface->pitch + X); + break; + case 2: + return *((Uint16 *)Surface->pixels + Y * Surface->pitch/2 + X); + break; + case 3: { // Format/endian independent + Uint8 r, g, b; + r = *((bits)+Surface->format->Rshift/8); + g = *((bits)+Surface->format->Gshift/8); + b = *((bits)+Surface->format->Bshift/8); + return SDL_MapRGB(Surface->format, r, g, b); + } + break; + case 4: + return *((Uint32 *)Surface->pixels + Y * Surface->pitch/4 + X); + break; + } + + return -1; +} diff --git a/src/gfx.h b/src/gfx.h new file mode 100644 index 0000000..f5056c0 --- /dev/null +++ b/src/gfx.h @@ -0,0 +1,52 @@ +#include +#define backbuffer BackBuffer + +extern SDL_Surface *Screen,*BackBuffer,*fadebuffer; +extern SDL_Rect blitrect; +extern char DATAPATH[200]; + +// inits a lot of SDL stuff +void init_SDL(); + +// fades screen to BackBuffer +void FadeScreen(float speed); + +// prints error and quits +void ComplainAndExit(void); + +// Updates all blitted rects; +void Update(); + +// Draw a line +void Line(Sint32 X1, Sint32 Y1, Sint32 X2, Sint32 Y2, Uint32 Color); + +// Puts a pixel (lock and unlock needed!) +extern int PutPixel(SDL_Surface *Surface, Sint32 X, Sint32 Y, Uint32 Color); + +// Add rect to update queue +void AddRect(int x1, int y1, int x2, int y2); +void AddThisRect(SDL_Rect blitrect); + +// random number between a and b (inclusive) +int abrand(int a,int b); + +// Draws a circle +int Circle (SDL_Surface *Surface, Sint32 X, Sint32 Y, Sint32 Rad, float Aspect, Uint32 Color); + +// Draws the background (as a circle) +int UndoCircle (SDL_Surface *Surface, Sint32 X, Sint32 Y, Sint32 Rad, float Aspect); + +// returns the flipped surface +SDL_Surface *FlippedSurface(SDL_Surface *Surface); + +// returns the color value of a pixel +Uint32 GetPixel (SDL_Surface *Surface, Sint32 X, Sint32 Y); + +void lock(); +void unlock(); +void fadeout(); +SDL_Surface *LoadImage(char *datafile, int transparent); +void Blit(int Xpos,int Ypos,SDL_Surface *image); +void BlitToBB(int Xpos,int Ypos,SDL_Surface *image); //blits to BackBuffer +void BlitPart(int Xpos,int Ypos,SDL_Surface *image, SDL_Rect srcrect); +int PutBackPixel(SDL_Surface *Surface, Sint32 x, Sint32 y); \ No newline at end of file diff --git a/src/img.c b/src/img.c new file mode 100644 index 0000000..f4173ab --- /dev/null +++ b/src/img.c @@ -0,0 +1,125 @@ +/* + IMGLIB: An example image loading library for use with SDL + Copyright (C) 1999 Sam Lantinga + + This 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. + + This 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 this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + 5635-34 Springhouse Dr. + Pleasanton, CA 94588 (USA) + slouken@devolution.com +*/ + +/* A simple library to load images of various formats as SDL surfaces */ + +#include +#include +#include + +#include "IMG.h" + +/* Table of image detection and loading functions */ +static struct { + char *type; + int (*is)(SDL_RWops *src); + SDL_Surface *(*load)(SDL_RWops *src); +} supported[] = { + /* keep magicless formats first (denoted by is==NULL) */ + { "GIF", IMG_isGIF, IMG_LoadGIF_RW }, + { "JPG", IMG_isJPG, IMG_LoadJPG_RW }, + { "PNG", IMG_isPNG, IMG_LoadPNG_RW }, +}; + +/* Load an image from a file */ +SDL_Surface *IMG_Load(const char *file) +{ + SDL_RWops *src = SDL_RWFromFile(file, "rb"); + char *ext = strrchr(file, '.'); + if(ext) + ext++; + return IMG_LoadTyped_RW(src, 1, ext); +} + +/* Load an image from an SDL datasource (for compatibility) */ +SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc) +{ + return IMG_LoadTyped_RW(src, freesrc, NULL); +} + +/* Portable case-insensitive string compare function */ +static int string_equals(const char *str1, const char *str2) +{ + while ( *str1 && *str2 ) { + if ( toupper((unsigned char)*str1) != + toupper((unsigned char)*str2) ) + break; + ++str1; + ++str2; + } + return (!*str1 && !*str2); +} + +/* Load an image from an SDL datasource, optionally specifying the type */ +SDL_Surface *IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, char *type) +{ + int i, start; + SDL_Surface *image; + + /* Make sure there is something to do.. */ + if ( src == NULL ) { + return(NULL); + } + + /* See whether or not this data source can handle seeking */ + if ( SDL_RWseek(src, 0, SEEK_CUR) < 0 ) { + IMG_SetError("Can't seek in this data source"); + return(NULL); + } + + /* Detect the type of image being loaded */ + start = SDL_RWtell(src); + image = NULL; + for ( i=0; supported[i].type && !image; ++i ) { + if( (supported[i].is + && (SDL_RWseek(src, start, SEEK_SET), + supported[i].is(src))) + || (type && string_equals(type, supported[i].type))) { +#ifdef DEBUG_IMGLIB + fprintf(stderr, "IMGLIB: Loading image as %s\n", + supported[i].type); +#endif + SDL_RWseek(src, start, SEEK_SET); + image = supported[i].load(src); + break; + } + } + + /* Clean up, check for errors, and return */ + if ( freesrc ) { + SDL_RWclose(src); + } + if ( image == NULL ) { + IMG_SetError("Unsupported image format"); + } + return(image); +} + +/* Invert the alpha of a surface for use with OpenGL + This function is a no-op and only kept for backwards compatibility. + */ +int IMG_InvertAlpha(int on) +{ + return 1; +} diff --git a/src/img_gif.c b/src/img_gif.c new file mode 100644 index 0000000..9d3cd5f --- /dev/null +++ b/src/img_gif.c @@ -0,0 +1,587 @@ +/* + IMGLIB: An example image loading library for use with SDL + Copyright (C) 1999 Sam Lantinga + + This 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. + + This 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 this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + 5635-34 Springhouse Dr. + Pleasanton, CA 94588 (USA) + slouken@devolution.com +*/ + +/* This is a GIF image file loading framework */ + +#include +#include + +#include "IMG.h" + + +/* See if an image is contained in a data source */ +int IMG_isGIF(SDL_RWops *src) +{ + int is_GIF; + char magic[6]; + + is_GIF = 0; + if ( SDL_RWread(src, magic, 6, 1) ) { + if ( (strncmp(magic, "GIF", 3) == 0) && + ((memcmp(magic + 3, "87a", 3) == 0) || + (memcmp(magic + 3, "89a", 3) == 0)) ) { + is_GIF = 1; + } + } + return(is_GIF); +} + +/* Code from here to end of file has been adapted from XPaint: */ +/* +-------------------------------------------------------------------+ */ +/* | Copyright 1990, 1991, 1993 David Koblas. | */ +/* | Copyright 1996 Torsten Martinsen. | */ +/* | Permission to use, copy, modify, and distribute this software | */ +/* | and its documentation for any purpose and without fee is hereby | */ +/* | granted, provided that the above copyright notice appear in all | */ +/* | copies and that both that copyright notice and this permission | */ +/* | notice appear in supporting documentation. This software is | */ +/* | provided "as is" without express or implied warranty. | */ +/* +-------------------------------------------------------------------+ */ + +/* Adapted for use in SDL by Sam Lantinga -- 7/20/98 */ +#define USED_BY_SDL + +#include +#include + +#ifdef USED_BY_SDL +/* Changes to work with SDL: + + Include SDL header file + Use SDL_Surface rather than xpaint Image structure + Define SDL versions of RWSetMsg(), ImageNewCmap() and ImageSetCmap() +*/ +#include "SDL.h" + +#define Image SDL_Surface +#define RWSetMsg IMG_SetError +#define ImageNewCmap(w, h, s) SDL_AllocSurface(SDL_SWSURFACE,w,h,8,0,0,0,0) +#define ImageSetCmap(s, i, R, G, B) do { \ + s->format->palette->colors[i].r = R; \ + s->format->palette->colors[i].g = G; \ + s->format->palette->colors[i].b = B; \ + } while (0) +/* * * * * */ + +#else + +/* Original XPaint sources */ + +#include "image.h" +#include "rwTable.h" + +#define SDL_RWops FILE +#define SDL_RWclose fclose + +#endif /* USED_BY_SDL */ + + +#define MAXCOLORMAPSIZE 256 + +#define TRUE 1 +#define FALSE 0 + +#define CM_RED 0 +#define CM_GREEN 1 +#define CM_BLUE 2 + +#define MAX_LWZ_BITS 12 + +#define INTERLACE 0x40 +#define LOCALCOLORMAP 0x80 +#define BitSet(byte, bit) (((byte) & (bit)) == (bit)) + +#define ReadOK(file,buffer,len) SDL_RWread(file, buffer, len, 1) + +#define LM_to_uint(a,b) (((b)<<8)|(a)) + +struct { + unsigned int Width; + unsigned int Height; + unsigned char ColorMap[3][MAXCOLORMAPSIZE]; + unsigned int BitPixel; + unsigned int ColorResolution; + unsigned int Background; + unsigned int AspectRatio; + int GrayScale; +} GifScreen; + +static struct { + int transparent; + int delayTime; + int inputFlag; + int disposal; +} Gif89; + +static int ReadColorMap(SDL_RWops * src, int number, + unsigned char buffer[3][MAXCOLORMAPSIZE], int *flag); +static int DoExtension(SDL_RWops * src, int label); +static int GetDataBlock(SDL_RWops * src, unsigned char *buf); +static int GetCode(SDL_RWops * src, int code_size, int flag); +static int LWZReadByte(SDL_RWops * src, int flag, int input_code_size); +static Image *ReadImage(SDL_RWops * src, int len, int height, int, + unsigned char cmap[3][MAXCOLORMAPSIZE], + int gray, int interlace, int ignore); + +Image * +IMG_LoadGIF_RW(SDL_RWops *src) +{ + unsigned char buf[16]; + unsigned char c; + unsigned char localColorMap[3][MAXCOLORMAPSIZE]; + int grayScale; + int useGlobalColormap; + int bitPixel; + int imageCount = 0; + char version[4]; + int imageNumber = 1; + Image *image = NULL; + + if ( src == NULL ) { + goto done; + } + if (!ReadOK(src, buf, 6)) { + RWSetMsg("error reading magic number"); + goto done; + } + if (strncmp((char *) buf, "GIF", 3) != 0) { + RWSetMsg("not a GIF file"); + goto done; + } + strncpy(version, (char *) buf + 3, 3); + version[3] = '\0'; + + if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) { + RWSetMsg("bad version number, not '87a' or '89a'"); + goto done; + } + Gif89.transparent = -1; + Gif89.delayTime = -1; + Gif89.inputFlag = -1; + Gif89.disposal = 0; + + if (!ReadOK(src, buf, 7)) { + RWSetMsg("failed to read screen descriptor"); + goto done; + } + GifScreen.Width = LM_to_uint(buf[0], buf[1]); + GifScreen.Height = LM_to_uint(buf[2], buf[3]); + GifScreen.BitPixel = 2 << (buf[4] & 0x07); + GifScreen.ColorResolution = (((buf[4] & 0x70) >> 3) + 1); + GifScreen.Background = buf[5]; + GifScreen.AspectRatio = buf[6]; + + if (BitSet(buf[4], LOCALCOLORMAP)) { /* Global Colormap */ + if (ReadColorMap(src, GifScreen.BitPixel, GifScreen.ColorMap, + &GifScreen.GrayScale)) { + RWSetMsg("error reading global colormap"); + goto done; + } + } + do { + if (!ReadOK(src, &c, 1)) { + RWSetMsg("EOF / read error on image data"); + goto done; + } + if (c == ';') { /* GIF terminator */ + if (imageCount < imageNumber) { + RWSetMsg("only %d image%s found in file", + imageCount, imageCount > 1 ? "s" : ""); + goto done; + } + } + if (c == '!') { /* Extension */ + if (!ReadOK(src, &c, 1)) { + RWSetMsg("EOF / read error on extention function code"); + goto done; + } + DoExtension(src, c); + continue; + } + if (c != ',') { /* Not a valid start character */ + continue; + } + ++imageCount; + + if (!ReadOK(src, buf, 9)) { + RWSetMsg("couldn't read left/top/width/height"); + goto done; + } + useGlobalColormap = !BitSet(buf[8], LOCALCOLORMAP); + + bitPixel = 1 << ((buf[8] & 0x07) + 1); + + if (!useGlobalColormap) { + if (ReadColorMap(src, bitPixel, localColorMap, &grayScale)) { + RWSetMsg("error reading local colormap"); + goto done; + } + image = ReadImage(src, LM_to_uint(buf[4], buf[5]), + LM_to_uint(buf[6], buf[7]), + bitPixel, localColorMap, grayScale, + BitSet(buf[8], INTERLACE), + imageCount != imageNumber); + } else { + image = ReadImage(src, LM_to_uint(buf[4], buf[5]), + LM_to_uint(buf[6], buf[7]), + GifScreen.BitPixel, GifScreen.ColorMap, + GifScreen.GrayScale, BitSet(buf[8], INTERLACE), + imageCount != imageNumber); + } + } while (image == NULL); + +#ifdef USED_BY_SDL + if ( Gif89.transparent > 0 ) { + SDL_SetColorKey(image, SDL_SRCCOLORKEY, Gif89. transparent); + } +#endif + +done: + return image; +} + +static int +ReadColorMap(SDL_RWops *src, int number, + unsigned char buffer[3][MAXCOLORMAPSIZE], int *gray) +{ + int i; + unsigned char rgb[3]; + int flag; + + flag = TRUE; + + for (i = 0; i < number; ++i) { + if (!ReadOK(src, rgb, sizeof(rgb))) { + RWSetMsg("bad colormap"); + return 1; + } + buffer[CM_RED][i] = rgb[0]; + buffer[CM_GREEN][i] = rgb[1]; + buffer[CM_BLUE][i] = rgb[2]; + flag &= (rgb[0] == rgb[1] && rgb[1] == rgb[2]); + } + +#if 0 + if (flag) + *gray = (number == 2) ? PBM_TYPE : PGM_TYPE; + else + *gray = PPM_TYPE; +#else + *gray = 0; +#endif + + return FALSE; +} + +static int +DoExtension(SDL_RWops *src, int label) +{ + static unsigned char buf[256]; + char *str; + + switch (label) { + case 0x01: /* Plain Text Extension */ + str = "Plain Text Extension"; + break; + case 0xff: /* Application Extension */ + str = "Application Extension"; + break; + case 0xfe: /* Comment Extension */ + str = "Comment Extension"; + while (GetDataBlock(src, (unsigned char *) buf) != 0); + return FALSE; + case 0xf9: /* Graphic Control Extension */ + str = "Graphic Control Extension"; + (void) GetDataBlock(src, (unsigned char *) buf); + Gif89.disposal = (buf[0] >> 2) & 0x7; + Gif89.inputFlag = (buf[0] >> 1) & 0x1; + Gif89.delayTime = LM_to_uint(buf[1], buf[2]); + if ((buf[0] & 0x1) != 0) + Gif89.transparent = buf[3]; + + while (GetDataBlock(src, (unsigned char *) buf) != 0); + return FALSE; + default: + str = (char *)buf; + sprintf(str, "UNKNOWN (0x%02x)", label); + break; + } + + while (GetDataBlock(src, (unsigned char *) buf) != 0); + + return FALSE; +} + +static int ZeroDataBlock = FALSE; + +static int +GetDataBlock(SDL_RWops *src, unsigned char *buf) +{ + unsigned char count; + + if (!ReadOK(src, &count, 1)) { + /* pm_message("error in getting DataBlock size" ); */ + return -1; + } + ZeroDataBlock = count == 0; + + if ((count != 0) && (!ReadOK(src, buf, count))) { + /* pm_message("error in reading DataBlock" ); */ + return -1; + } + return count; +} + +static int +GetCode(SDL_RWops *src, int code_size, int flag) +{ + static unsigned char buf[280]; + static int curbit, lastbit, done, last_byte; + int i, j, ret; + unsigned char count; + + if (flag) { + curbit = 0; + lastbit = 0; + done = FALSE; + return 0; + } + if ((curbit + code_size) >= lastbit) { + if (done) { + if (curbit >= lastbit) + RWSetMsg("ran off the end of my bits"); + return -1; + } + buf[0] = buf[last_byte - 2]; + buf[1] = buf[last_byte - 1]; + + if ((count = GetDataBlock(src, &buf[2])) == 0) + done = TRUE; + + last_byte = 2 + count; + curbit = (curbit - lastbit) + 16; + lastbit = (2 + count) * 8; + } + ret = 0; + for (i = curbit, j = 0; j < code_size; ++i, ++j) + ret |= ((buf[i / 8] & (1 << (i % 8))) != 0) << j; + + curbit += code_size; + + return ret; +} + +static int +LWZReadByte(SDL_RWops *src, int flag, int input_code_size) +{ + static int fresh = FALSE; + int code, incode; + static int code_size, set_code_size; + static int max_code, max_code_size; + static int firstcode, oldcode; + static int clear_code, end_code; + static int table[2][(1 << MAX_LWZ_BITS)]; + static int stack[(1 << (MAX_LWZ_BITS)) * 2], *sp; + register int i; + + if (flag) { + set_code_size = input_code_size; + code_size = set_code_size + 1; + clear_code = 1 << set_code_size; + end_code = clear_code + 1; + max_code_size = 2 * clear_code; + max_code = clear_code + 2; + + GetCode(src, 0, TRUE); + + fresh = TRUE; + + for (i = 0; i < clear_code; ++i) { + table[0][i] = 0; + table[1][i] = i; + } + for (; i < (1 << MAX_LWZ_BITS); ++i) + table[0][i] = table[1][0] = 0; + + sp = stack; + + return 0; + } else if (fresh) { + fresh = FALSE; + do { + firstcode = oldcode = GetCode(src, code_size, FALSE); + } while (firstcode == clear_code); + return firstcode; + } + if (sp > stack) + return *--sp; + + while ((code = GetCode(src, code_size, FALSE)) >= 0) { + if (code == clear_code) { + for (i = 0; i < clear_code; ++i) { + table[0][i] = 0; + table[1][i] = i; + } + for (; i < (1 << MAX_LWZ_BITS); ++i) + table[0][i] = table[1][i] = 0; + code_size = set_code_size + 1; + max_code_size = 2 * clear_code; + max_code = clear_code + 2; + sp = stack; + firstcode = oldcode = GetCode(src, code_size, FALSE); + return firstcode; + } else if (code == end_code) { + int count; + unsigned char buf[260]; + + if (ZeroDataBlock) + return -2; + + while ((count = GetDataBlock(src, buf)) > 0); + + if (count != 0) { + /* + * pm_message("missing EOD in data stream (common occurence)"); + */ + } + return -2; + } + incode = code; + + if (code >= max_code) { + *sp++ = firstcode; + code = oldcode; + } + while (code >= clear_code) { + *sp++ = table[1][code]; + if (code == table[0][code]) + RWSetMsg("circular table entry BIG ERROR"); + code = table[0][code]; + } + + *sp++ = firstcode = table[1][code]; + + if ((code = max_code) < (1 << MAX_LWZ_BITS)) { + table[0][code] = oldcode; + table[1][code] = firstcode; + ++max_code; + if ((max_code >= max_code_size) && + (max_code_size < (1 << MAX_LWZ_BITS))) { + max_code_size *= 2; + ++code_size; + } + } + oldcode = incode; + + if (sp > stack) + return *--sp; + } + return code; +} + +static Image * +ReadImage(SDL_RWops * src, int len, int height, int cmapSize, + unsigned char cmap[3][MAXCOLORMAPSIZE], + int gray, int interlace, int ignore) +{ + Image *image; + unsigned char c; + int i, v; + int xpos = 0, ypos = 0, pass = 0; + + /* + ** Initialize the compression routines + */ + if (!ReadOK(src, &c, 1)) { + RWSetMsg("EOF / read error on image data"); + return NULL; + } + if (LWZReadByte(src, TRUE, c) < 0) { + RWSetMsg("error reading image"); + return NULL; + } + /* + ** If this is an "uninteresting picture" ignore it. + */ + if (ignore) { + while (LWZReadByte(src, FALSE, c) >= 0); + return NULL; + } + image = ImageNewCmap(len, height, cmapSize); + + for (i = 0; i < cmapSize; i++) + ImageSetCmap(image, i, cmap[CM_RED][i], + cmap[CM_GREEN][i], cmap[CM_BLUE][i]); + + while ((v = LWZReadByte(src, FALSE, c)) >= 0) { +#ifdef USED_BY_SDL + ((Uint8 *)image->pixels)[xpos + ypos * image->pitch] = v; +#else + image->data[xpos + ypos * len] = v; +#endif + ++xpos; + if (xpos == len) { + xpos = 0; + if (interlace) { + switch (pass) { + case 0: + case 1: + ypos += 8; + break; + case 2: + ypos += 4; + break; + case 3: + ypos += 2; + break; + } + + if (ypos >= height) { + ++pass; + switch (pass) { + case 1: + ypos = 4; + break; + case 2: + ypos = 2; + break; + case 3: + ypos = 1; + break; + default: + goto fini; + } + } + } else { + ++ypos; + } + } + if (ypos >= height) + break; + } + + fini: + + return image; +} diff --git a/src/img_jpg.c b/src/img_jpg.c new file mode 100644 index 0000000..2e39e75 --- /dev/null +++ b/src/img_jpg.c @@ -0,0 +1,223 @@ +/* + IMGLIB: An example image loading library for use with SDL + Copyright (C) 1999 Sam Lantinga + + This 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. + + This 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 this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + 5635-34 Springhouse Dr. + Pleasanton, CA 94588 (USA) + slouken@devolution.com +*/ + +/* This is a JPEG image file loading framework */ + +#include + +#include "IMG.h" + +#include + +/* Define this for fast loading and not as good image quality */ +/*#define FAST_JPEG*/ + +/* See if an image is contained in a data source */ +int IMG_isJPG(SDL_RWops *src) +{ + int is_JPG; + Uint8 magic[4]; + + is_JPG = 0; + if ( SDL_RWread(src, magic, 2, 1) ) { + if ( (magic[0] == 0xFF) && (magic[1] == 0xD8) ) { + SDL_RWread(src, magic, 4, 1); + SDL_RWread(src, magic, 4, 1); + if ( strncmp(magic, "JFIF", 4) == 0 ) { + is_JPG = 1; + } + } + } + return(is_JPG); +} + +#define INPUT_BUFFER_SIZE 4096 +typedef struct { + struct jpeg_source_mgr pub; + + SDL_RWops *ctx; + Uint8 buffer[INPUT_BUFFER_SIZE]; +} my_source_mgr; + +/* + * Initialize source --- called by jpeg_read_header + * before any data is actually read. + */ +void _init_source (j_decompress_ptr cinfo) +{ + /* We don't actually need to do anything */ + return; +} + +/* + * Fill the input buffer --- called whenever buffer is emptied. + */ +int _fill_input_buffer (j_decompress_ptr cinfo) +{ + my_source_mgr * src = (my_source_mgr *) cinfo->src; + int nbytes; + + nbytes = SDL_RWread(src->ctx, src->buffer, 1, INPUT_BUFFER_SIZE); + if (nbytes <= 0) { + /* Insert a fake EOI marker */ + src->buffer[0] = (Uint8) 0xFF; + src->buffer[1] = (Uint8) JPEG_EOI; + nbytes = 2; + } + src->pub.next_input_byte = src->buffer; + src->pub.bytes_in_buffer = nbytes; + + return TRUE; +} + + +/* + * Skip data --- used to skip over a potentially large amount of + * uninteresting data (such as an APPn marker). + * + * Writers of suspendable-input applications must note that skip_input_data + * is not granted the right to give a suspension return. If the skip extends + * beyond the data currently in the buffer, the buffer can be marked empty so + * that the next read will cause a fill_input_buffer call that can suspend. + * Arranging for additional bytes to be discarded before reloading the input + * buffer is the application writer's problem. + */ +void _skip_input_data (j_decompress_ptr cinfo, long num_bytes) +{ + my_source_mgr * src = (my_source_mgr *) cinfo->src; + + /* Just a dumb implementation for now. Could use fseek() except + * it doesn't work on pipes. Not clear that being smart is worth + * any trouble anyway --- large skips are infrequent. + */ + if (num_bytes > 0) { + while (num_bytes > (long) src->pub.bytes_in_buffer) { + num_bytes -= (long) src->pub.bytes_in_buffer; + (void) src->pub.fill_input_buffer(cinfo); + /* note we assume that fill_input_buffer will never + * return FALSE, so suspension need not be handled. + */ + } + src->pub.next_input_byte += (size_t) num_bytes; + src->pub.bytes_in_buffer -= (size_t) num_bytes; + } +} + +/* + * Terminate source --- called by jpeg_finish_decompress + * after all data has been read. + */ +void _term_source (j_decompress_ptr cinfo) +{ + /* We don't actually need to do anything */ + return; +} + +/* + * Prepare for input from a stdio stream. + * The caller must have already opened the stream, and is responsible + * for closing it after finishing decompression. + */ +void jpeg_SDL_RW_src (j_decompress_ptr cinfo, SDL_RWops *ctx) +{ + my_source_mgr *src; + + /* The source object and input buffer are made permanent so that a series + * of JPEG images can be read from the same file by calling jpeg_stdio_src + * only before the first one. (If we discarded the buffer at the end of + * one image, we'd likely lose the start of the next one.) + * This makes it unsafe to use this manager and a different source + * manager serially with the same JPEG object. Caveat programmer. + */ + if (cinfo->src == NULL) { /* first time for this JPEG object? */ + cinfo->src = (struct jpeg_source_mgr *) + (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, + sizeof(my_source_mgr)); + src = (my_source_mgr *) cinfo->src; + } + + src = (my_source_mgr *) cinfo->src; + src->pub.init_source = _init_source; + src->pub.fill_input_buffer = _fill_input_buffer; + src->pub.skip_input_data = _skip_input_data; + src->pub.resync_to_restart = jpeg_resync_to_restart; /* use default method */ + src->pub.term_source = _term_source; + src->ctx = ctx; + src->pub.bytes_in_buffer = 0; /* forces fill_input_buffer on first read */ + src->pub.next_input_byte = NULL; /* until buffer loaded */ +} + +/* Load a JPEG type image from an SDL datasource */ +SDL_Surface *IMG_LoadJPG_RW(SDL_RWops *src) +{ + struct jpeg_error_mgr errmgr; + struct jpeg_decompress_struct cinfo; + JSAMPROW rowptr[1]; + SDL_Surface *surface; + + /* Create a decompression structure and load the JPEG header */ + cinfo.err = jpeg_std_error(&errmgr); + jpeg_create_decompress(&cinfo); + jpeg_SDL_RW_src(&cinfo, src); + jpeg_read_header(&cinfo, TRUE); + + /* Set 24-bit RGB output */ + cinfo.out_color_space = JCS_RGB; + cinfo.quantize_colors = FALSE; +#ifdef FAST_JPEG + cinfo.scale_num = 1; + cinfo.scale_denom = 1; + cinfo.dct_method = JDCT_FASTEST; + cinfo.do_fancy_upsampling = FALSE; +#endif + jpeg_calc_output_dimensions(&cinfo); + + /* Allocate an output surface to hold the image */ + surface = SDL_AllocSurface(SDL_SWSURFACE, + cinfo.output_width, cinfo.output_height, 24, +#if SDL_BYTEORDER == SDL_LIL_ENDIAN + 0x0000FF, 0x00FF00, 0xFF0000, +#else + 0xFF0000, 0x00FF00, 0x0000FF, +#endif + 0); + if ( surface == NULL ) { + IMG_SetError("Out of memory"); + goto done; + } + + /* Decompress the image */ + jpeg_start_decompress(&cinfo); + while ( cinfo.output_scanline < cinfo.output_height ) { + rowptr[0] = (JSAMPROW)(Uint8 *)surface->pixels + + cinfo.output_scanline * surface->pitch; + jpeg_read_scanlines(&cinfo, rowptr, (JDIMENSION) 1); + } + jpeg_finish_decompress(&cinfo); + + /* Clean up and return */ +done: + jpeg_destroy_decompress(&cinfo); + return(surface); +} diff --git a/src/img_png.c b/src/img_png.c new file mode 100644 index 0000000..71b31c4 --- /dev/null +++ b/src/img_png.c @@ -0,0 +1,264 @@ +/* + IMGLIB: An example image loading library for use with SDL + Copyright (C) 1999 Sam Lantinga + + This 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. + + This 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 this library; if not, write to the Free + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Sam Lantinga + 5635-34 Springhouse Dr. + Pleasanton, CA 94588 (USA) + slouken@devolution.com +*/ + +/* This is a PNG image file loading framework */ + +#include +#include + +#include "IMG.h" + + +/*============================================================================= + File: SDL_png.c + Purpose: A PNG loader and saver for the SDL library + Revision: + Created by: Philippe Lavoie (2 November 1998) + lavoie@zeus.genie.uottawa.ca + Modified by: + + Copyright notice: + Copyright (C) 1998 Philippe Lavoie + + This 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. + + This 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 this library; if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Comments: The load and save routine are basically the ones you can find + in the example.c file from the libpng distribution. + + Changes: + 5/17/99 - Modified to use the new SDL data sources - Sam Lantinga + +=============================================================================*/ + +#include "SDL_endian.h" + +#include + +#define PNG_BYTES_TO_CHECK 4 + +/* See if an image is contained in a data source */ +int IMG_isPNG(SDL_RWops *src) +{ + char buf[PNG_BYTES_TO_CHECK]; + + /* Read in the signature bytes */ + if (SDL_RWread(src, buf, 1, PNG_BYTES_TO_CHECK) != PNG_BYTES_TO_CHECK) + return 0; + + /* Compare the first PNG_BYTES_TO_CHECK bytes of the signature. */ + return( !png_sig_cmp(buf, (png_size_t)0, PNG_BYTES_TO_CHECK)); +} + +/* Load a PNG type image from an SDL datasource */ +static void png_read_data(png_structp ctx, png_bytep area, png_size_t size) +{ + SDL_RWops *src; + + src = (SDL_RWops *)png_get_io_ptr(ctx); + SDL_RWread(src, area, size, 1); +} +SDL_Surface *IMG_LoadPNG_RW(SDL_RWops *src) +{ + SDL_Surface *surface; + png_structp png_ptr; + png_infop info_ptr; + png_uint_32 width, height; + int bit_depth, color_type, interlace_type; + Uint32 Rmask; + Uint32 Gmask; + Uint32 Bmask; + Uint32 Amask; + SDL_Palette *palette; + png_bytep *row_pointers; + int row, i; + int ckey = -1; + png_color_16 *transv; + + /* Initialize the data we will clean up when we're done */ + png_ptr = NULL; info_ptr = NULL; row_pointers = NULL; surface = NULL; + + /* Check to make sure we have something to do */ + if ( ! src ) { + goto done; + } + + /* Create the PNG loading context structure */ + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, + NULL,NULL,NULL); + if (png_ptr == NULL){ + IMG_SetError("Couldn't allocate memory for PNG file"); + goto done; + } + + /* Allocate/initialize the memory for image information. REQUIRED. */ + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) { + IMG_SetError("Couldn't create image information for PNG file"); + goto done; + } + + /* Set error handling if you are using setjmp/longjmp method (this is + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in png_create_read_struct() earlier. + */ + if ( setjmp(png_ptr->jmpbuf) ) { + IMG_SetError("Error reading the PNG file."); + goto done; + } + + /* Set up the input control */ + png_set_read_fn(png_ptr, src, png_read_data); + + /* Read PNG header info */ + png_read_info(png_ptr, info_ptr); + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, + &color_type, &interlace_type, NULL, NULL); + + /* tell libpng to strip 16 bit/color files down to 8 bits/color */ + png_set_strip_16(png_ptr) ; + + /* Extract multiple pixels with bit depths of 1, 2, and 4 from a single + * byte into separate bytes (useful for paletted and grayscale images). + */ + png_set_packing(png_ptr); + + /* scale greyscale values to the range 0..255 */ + if(color_type == PNG_COLOR_TYPE_GRAY) + png_set_expand(png_ptr); + + /* For images with a single "transparent colour", set colour key; + if more than one index has transparency, use full alpha channel */ + if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { + int num_trans; + Uint8 *trans; + png_get_tRNS(png_ptr, info_ptr, &trans, &num_trans, + &transv); + if(color_type == PNG_COLOR_TYPE_PALETTE) { + if(num_trans == 1) { + /* exactly one transparent value: set colour key */ + ckey = trans[0]; + } else + png_set_expand(png_ptr); + } else + ckey = 0; /* actual value will be set later */ + } + + if ( color_type == PNG_COLOR_TYPE_GRAY_ALPHA ) + png_set_gray_to_rgb(png_ptr); + + png_read_update_info(png_ptr, info_ptr); + + png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, + &color_type, &interlace_type, NULL, NULL); + + /* Allocate the SDL surface to hold the image */ + Rmask = Gmask = Bmask = Amask = 0 ; + if ( color_type != PNG_COLOR_TYPE_PALETTE ) { + if ( SDL_BYTEORDER == SDL_LIL_ENDIAN ) { + Rmask = 0x000000FF; + Gmask = 0x0000FF00; + Bmask = 0x00FF0000; + Amask = (info_ptr->channels == 4) ? 0xFF000000 : 0; + } else { + int s = (info_ptr->channels == 4) ? 0 : 8; + Rmask = 0xFF000000 >> s; + Gmask = 0x00FF0000 >> s; + Bmask = 0x0000FF00 >> s; + Amask = 0x000000FF >> s; + } + } + surface = SDL_AllocSurface(SDL_SWSURFACE, width, height, + bit_depth*info_ptr->channels, Rmask,Gmask,Bmask,Amask); + if ( surface == NULL ) { + IMG_SetError("Out of memory"); + goto done; + } + + if(ckey != -1) { + if(color_type != PNG_COLOR_TYPE_PALETTE) + ckey = SDL_MapRGB(surface->format, transv->red, + transv->green, transv->blue); + SDL_SetColorKey(surface, SDL_SRCCOLORKEY, ckey); + } + + /* Create the array of pointers to image data */ + row_pointers = (png_bytep*) malloc(sizeof(png_bytep)*height); + if ( (row_pointers == NULL) ) { + IMG_SetError("Out of memory"); + SDL_FreeSurface(surface); + surface = NULL; + goto done; + } + for (row = 0; row < height; row++) { + row_pointers[row] = (png_bytep) + (Uint8 *)surface->pixels + row*surface->pitch; + } + + /* Read the entire image in one go */ + png_read_image(png_ptr, row_pointers); + + /* read rest of file, get additional chunks in info_ptr - REQUIRED */ + png_read_end(png_ptr, info_ptr); + + /* Load the palette, if any */ + palette = surface->format->palette; + if ( palette ) { + if(color_type == PNG_COLOR_TYPE_GRAY) { + palette->ncolors = 256; + for(i = 0; i < 256; i++) { + palette->colors[i].r = i; + palette->colors[i].g = i; + palette->colors[i].b = i; + } + } else if (info_ptr->num_palette > 0 ) { + palette->ncolors = info_ptr->num_palette; + for( i=0; inum_palette; ++i ) { + palette->colors[i].b = info_ptr->palette[i].blue; + palette->colors[i].g = info_ptr->palette[i].green; + palette->colors[i].r = info_ptr->palette[i].red; + } + } + } + +done: /* Clean up and return */ + png_destroy_read_struct(&png_ptr, info_ptr ? &info_ptr : (png_infopp)0, + (png_infopp)0); + if ( row_pointers ) { + free(row_pointers); + } + return(surface); +} + diff --git a/src/levels.h b/src/levels.h new file mode 100644 index 0000000..5d15de8 --- /dev/null +++ b/src/levels.h @@ -0,0 +1,425 @@ +#include + +// ********************* These are the levels: ********************** +// 1=normal 2=lightning 3=stopper 4=finish 5=teleporter 6=time bonus +// 7=vertical laser 8=cannon + + Uint8 map[28][15][20]; + Uint8 origMap[28][15][20] = + { { {0,0,0,0,1,1,1,3,3,3,3,1,0,0,0,0,0,0,0,0}, + {0,0,0,0,1,1,1,3,3,0,0,1,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0}, + {0,0,1,1,1,0,0,0,1,0,0,1,1,1,1,1,0,0,0,0}, + {0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,1}, + {0,0,1,0,0,0,1,1,1,1,0,0,0,0,0,1,0,0,0,0}, + {0,0,0,0,0,0,0,0,2,2,1,1,1,0,0,1,0,0,0,0}, + {0,0,0,1,1,1,0,0,2,2,1,1,0,0,0,1,0,0,0,0}, + {0,0,0,1,0,0,0,0,2,1,0,0,0,0,1,1,1,1,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0}, + {0,0,0,1,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0}, + {0,0,0,1,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,4}, + {1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,11,12,13}, + {1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,14,15,16} }, + + { {0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0}, + {0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,0,0,0,1,1,0,0,0,1,0,1,0,0,4,0,0}, + {1,1,1,1,0,0,0,0,1,0,2,0,1,0,1,0,0,0,0,0}, + {0,0,0,1,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,1,0,1,0,0}, + {0,0,0,0,0,0,1,1,1,0,2,0,1,0,0,0,0,0,0,0}, + {0,0,0,0,0,1,1,0,0,0,0,0,1,0,2,0,0,0,0,1}, + {0,0,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,1,1}, + {0,0,1,1,1,1,0,0,1,1,1,1,1,1,1,0,0,1,1,1}, + {0,0,0,0,1,1,1,0,1,1,1,0,0,0,0,0,0,1,1,1}, + {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1}, + {0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,11,12,13}, + {0,0,0,0,0,1,0,0,1,1,1,0,0,1,0,0,0,14,15,16} }, + + { {0,0,0,0,1,11,12,13,0,1,0,0,0,0,0,0,0,0,0,4}, + {0,0,0,0,1,14,15,16,0,1,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0}, + {1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,1,1,1,0,0,1,1,1,1,0,1,1,1,3,1,3}, + {0,0,0,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,0,0,1,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0}, + {1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,0,0}, + {0,0,0,0,0,0,1,0,0,1,8,1,0,0,1,0,0,1,0,0}, + {0,0,0,0,0,0,1,0,0,1,1,1,0,0,1,0,0,1,0,0}, + {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0} }, + + { {0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0}, + {0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,1,0,0,0,0}, + {0,0,0,1,0,0,0,0,1,1,1,0,1,0,0,1,0,0,0,0}, + {0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,0,0,0,0,0}, + {0,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1}, + {0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0}, + {0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0}, + {2,2,2,0,0,0,0,0,0,0,0,2,0,8,0,0,0,0,4,4}, + {0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,2,0,4,4}, + {0,0,0,0,0,1,1,1,0,0,0,2,0,0,0,0,0,0,4,4}, + {0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,14,15,16} }, + + { {0,0,0,1,0,0,0,7,0,0,0,1,0,0,0,0,0,0,0,4}, + {0,0,0,1,0,0,0,7,0,0,0,1,0,0,0,0,0,1,0,0}, + {0,0,0,1,0,0,0,7,0,0,0,1,0,0,0,0,0,0,1,0}, + {0,0,0,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0}, + {0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0}, + {0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,0,0}, + {0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0}, + {1,1,1,1,1,1,1,1,0,0,0,1,0,0,1,0,0,1,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,1,0,0,2,0,0,1,0,0}, + {0,0,3,1,1,1,1,1,1,1,1,1,0,0,2,1,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,4}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,4,14,15,16} }, + + { {0,0,0,0,0,0,5,0,0,0,0,0,0,0,1,4,4,4,4,4}, + {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0}, + {0,0,0,0,0,0,1,3,0,0,0,0,0,0,0,0,1,0,0,0}, + {5,0,0,0,0,0,1,0,0,3,0,1,0,0,1,0,0,1,0,0}, + {1,1,1,1,1,0,1,0,0,0,0,1,0,0,0,1,0,0,1,0}, + {0,0,0,0,0,0,1,0,3,0,0,1,0,0,0,0,1,0,0,0}, + {0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0}, + {0,0,0,0,0,0,1,3,0,3,0,1,0,0,0,0,0,0,1,0}, + {0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0}, + {2,0,0,1,1,1,1,0,0,0,3,1,0,0,0,0,0,0,1,0}, + {0,0,0,0,0,0,0,0,3,0,0,1,0,0,0,0,0,0,1,0}, + {0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,1,0}, + {0,0,0,0,0,0,1,0,0,3,0,1,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,1,0,0,3,0,1,2,0,2,0,2,11,12,13}, + {0,0,0,0,0,0,1,0,0,3,0,1,2,0,4,0,2,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0}, + {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0}, + {0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,0,0,1,0,0}, + {0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,0,1,0,0,1,0,0,0,1,0,1,0,0,0,0,0}, + {0,0,0,0,0,1,0,0,2,4,4,4,1,0,1,0,1,1,1,1}, + {0,0,0,0,0,1,0,0,2,4,4,4,1,0,1,0,0,0,0,0}, + {0,0,0,0,0,1,0,0,2,4,4,4,1,0,1,0,0,0,0,0}, + {0,0,0,0,0,8,0,0,1,0,0,0,1,0,1,0,0,0,1,0}, + {0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0}, + {0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,0,0,0,1,6}, + {0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,6}, + {0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,1,5,5,1,4,4,4,4}, + {0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,0,0}, + {0,0,1,1,1,1,0,0,1,0,0,0,1,0,0,1,0,5,5,0}, + {0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,0,2,2,0}, + {0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0}, + {0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,1,1,1,2,0,0,1,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0}, + {0,1,1,1,1,1,2,0,1,0,0,0,0,0,1,1,0,0,0,0}, + {0,0,1,1,1,1,2,0,1,0,0,1,1,1,1,1,0,0,0,0}, + {0,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0}, + {2,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,11,12,13}, + {2,2,0,0,0,0,0,0,0,0,0,3,3,3,3,3,3,14,15,16} }, + + { {0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0}, + {0,1,0,2,2,2,2,2,0,0,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,2,0,0,0,2,0,0,0,0,1,0,0,0,0,0,1,3}, + {1,0,0,2,0,2,4,2,0,0,0,0,0,0,0,0,1,0,0,0}, + {0,0,0,2,0,2,2,2,0,0,0,0,0,0,1,0,0,0,3,4}, + {0,0,1,0,0,1,1,1,0,0,0,0,1,0,0,0,0,0,1,3}, + {0,0,1,0,1,1,1,1,0,1,0,1,0,0,0,0,1,0,0,0}, + {0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,0,1,1,8,0,0,1,0,1,0,0,0,0,0,1,0}, + {0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,1,0,0,0}, + {0,0,0,0,0,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1}, + {0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,1,1,1}, + {0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,1,1}, + {1,1,1,1,0,0,1,1,0,0,0,1,1,1,1,0,0,0,0,1}, + {0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,0,0,0,0}, + {0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0}, + {2,2,2,2,3,3,0,1,0,0,0,1,1,1,1,0,0,0,0,0}, + {0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,0,0,1,1,0}, + {0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,4,4,0}, + {0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0}, + {0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,2,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,1,1,1,6,6,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,2,14,15,16} }, + + { {0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0}, + {0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,5,1,0,0,0}, + {0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0}, + {0,0,0,1,0,0,0,1,0,0,0,0,1,1,0,0,1,0,0,0}, + {0,0,0,1,0,0,4,1,1,1,0,0,0,1,1,1,1,0,0,0}, + {0,0,0,1,0,0,4,1,1,1,0,0,0,0,0,1,1,1,1,0}, + {1,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,1,0,0,0}, + {0,0,0,1,0,0,0,1,0,0,0,0,8,0,0,0,0,0,0,0}, + {0,0,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0}, + {0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0}, + {0,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,11,12,13}, + {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,14,15,16} }, + + + { {0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,1,0,0,0,1,0,1,0,0,0,0,1,1,1,1,1,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,1}, + {1,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,0,0,0,0,0}, + {0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,2,2,2,2,4}, + {0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,3}, + {1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,2,2,2,2,4}, + {0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0}, + {0,1,1,1,1,1,0,0,1,0,0,0,0,0,1,0,0,1,0,0}, + {0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0}, + {0,1,5,1,0,1,0,0,1,0,0,1,1,0,1,0,0,1,0,5}, + {0,1,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,3,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,3,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,0,2,2,0,0,3,0}, + {0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,3,0}, + {0,0,0,0,1,0,0,0,0,0,0,2,2,0,0,8,0,0,3,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0}, + {0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,3,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,4}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,2,2,2,0,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,1,6,6,4,0,0,0,0,0}, + {0,0,0,0,1,1,1,0,0,0,0,0,1,0,0,0,4,0,0,0}, + {0,0,0,0,0,0,0,1,0,1,0,0,1,1,4,0,0,0,4,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0,4,0,0,0}, + {0,0,0,1,0,0,0,0,8,0,0,0,0,0,0,1,1,1,0,0}, + {1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0}, + {0,0,0,0,0,1,0,0,11,12,13,0,0,0,0,0,0,1,0,0}, + {0,0,0,0,0,1,0,0,14,15,16,0,0,0,2,0,0,1,0,0}, + {1,1,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0}, + {0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0}, + {0,0,0,0,1,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0}, + {0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,0,1,0,0,0}, + {0,0,0,0,0,0,0,0,1,1,0,1,0,0,0,1,0,0,0,0}, + {0,0,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,1,3,3,0,0,0,0,0,0} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0}, + {0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0}, + {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0}, + {0,0,1,0,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0}, + {0,0,1,2,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0}, + {0,0,1,6,0,0,1,0,1,1,1,1,0,1,0,0,1,0,0,0}, + {0,0,1,2,0,0,1,0,1,0,0,1,0,1,0,0,1,0,0,0}, + {0,0,1,6,0,0,1,0,0,0,0,1,0,1,0,0,1,0,0,0}, + {0,0,1,2,0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0}, + {0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0}, + {0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0}, + {0,0,0,1,4,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0}, + {0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0}, + {0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0}, + {0,0,3,2,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0}, + {2,0,0,0,2,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0}, + {0,2,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0}, + {0,0,2,3,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1}, + {0,0,0,2,0,0,3,2,0,0,1,0,0,1,0,0,0,0,1,0}, + {0,0,0,0,2,0,0,0,2,0,0,0,0,1,0,0,0,1,0,0}, + {0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,1,0,0,0}, + {0,0,0,0,0,0,1,3,0,0,2,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,1,0,0,3,2,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,1,1}, + {0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,4,1,1,1}, + {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,4,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,4,14,15,16} }, + + { {0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,7,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0}, + {0,0,7,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0}, + {0,0,7,0,0,1,1,1,2,2,1,1,1,0,0,0,0,0,0,0}, + {0,0,7,0,0,0,1,6,2,2,6,1,0,0,0,0,0,0,0,0}, + {0,0,7,0,0,0,0,2,2,2,2,0,0,0,0,0,0,0,0,0}, + {0,0,1,1,1,1,1,1,2,2,1,1,1,1,1,0,0,0,0,0}, + {0,0,0,0,0,0,0,2,4,4,2,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,1,1,5,5,1,2,0,0,0,0,0,0,0,0}, + {1,1,0,0,0,8,0,1,5,5,1,0,2,0,0,0,0,0,0,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0}, + {0,0,0,1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0}, + {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,2,0,2,0,2,0,2,0,2,0,2,0,0,0,0,0}, + {0,0,0,0,2,0,2,0,2,0,2,0,2,0,2,0,0,0,0,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,1,0,4,4,0,0,0,4,4,0,1,0,0,0,0,0}, + {0,0,0,0,1,0,4,4,0,0,0,4,4,0,1,0,0,0,0,0}, + {0,0,0,0,1,0,0,0,0,8,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,1,0,0,0,3,3,3,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,1,0,4,4,4,4,4,4,4,0,1,0,0,0,0,0}, + {0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,2,0,0}, + {1,1,1,1,1,1,0,0,1,0,0,1,1,0,0,0,0,2,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0}, + {0,0,0,0,0,0,0,0,1,4,4,0,1,0,0,1,1,1,0,0}, + {0,0,0,0,1,0,0,0,1,1,1,1,1,1,0,7,0,0,0,0}, + {0,0,0,0,1,0,0,0,2,0,0,8,1,1,1,7,0,0,0,0}, + {0,0,0,0,1,0,0,0,7,0,0,0,1,1,1,1,0,0,0,0}, + {0,0,0,0,1,0,0,0,2,0,0,0,1,1,1,0,0,0,0,0}, + {0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,1}, + {0,0,0,0,0,0,1,0,0,0,0,0,2,0,0,0,0,0,1,1}, + {1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1}, + {0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,11,12,13}, + {6,7,0,0,0,0,1,0,0,0,0,0,0,0,0,0,3,14,15,16} }, + + { {0,0,1,0,0,7,0,0,0,1,0,0,0,7,0,0,1,1,1,1}, + {0,0,1,0,0,7,0,1,0,0,0,1,0,7,0,0,1,1,1,1}, + {0,0,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,0,0}, + {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,4}, + {0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,4}, + {1,1,1,1,1,1,0,0,1,0,0,1,1,0,0,1,0,0,0,4}, + {0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,1,0,0,0,4}, + {0,0,0,0,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,4}, + {0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1}, + {0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0}, + {0,1,0,0,0,1,1,1,1,0,0,0,2,0,0,0,0,0,0,0}, + {0,1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0}, + {0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,3,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,14,15,16} }, + + { {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0}, + {0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,7,1,0,0,0,0,0,0,1,0,0,0,0,2,0,0,0}, + {0,0,0,7,7,1,0,0,0,0,0,1,4,0,0,0,1,0,0,0}, + {0,0,0,7,7,0,1,0,0,0,0,1,4,0,0,0,1,3,0,0}, + {0,0,0,7,7,0,0,1,0,0,0,1,4,0,0,0,1,0,0,3}, + {0,0,0,7,7,0,0,0,1,0,0,1,4,0,0,0,3,0,0,0}, + {0,0,0,7,7,0,3,0,0,0,0,1,0,0,0,0,1,0,0,0}, + {0,0,0,7,7,0,0,0,1,0,0,0,0,0,0,0,1,0,3,0}, + {0,0,0,7,7,0,0,1,0,0,0,0,0,0,0,1,3,0,0,0}, + {0,0,0,7,7,0,1,0,0,0,0,0,0,0,1,0,0,0,0,3}, + {0,0,0,7,7,1,1,1,1,1,1,1,1,1,0,0,3,0,0,1}, + {0,0,0,7,1,0,0,0,0,0,1,1,1,3,0,0,0,0,1,1}, + {0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,3,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} }, + + { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,12,13}, + {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,15,16} } + }; diff --git a/src/menu.c b/src/menu.c new file mode 100644 index 0000000..f8cf568 --- /dev/null +++ b/src/menu.c @@ -0,0 +1,291 @@ +#include "bumprace.h" + +void clear_screen() +{ + SDL_Rect fillrect; + + fillrect.x=0; + fillrect.y=0; + fillrect.w=800; + fillrect.h=600; + SDL_FillRect(Screen,&fillrect,0); +} + +void clear_bb() +{ + SDL_Rect fillrect; + + fillrect.x=0; + fillrect.y=0; + fillrect.w=800; + fillrect.h=600; + SDL_FillRect(backbuffer,&fillrect,0); +} + +//************************ HELP MENU *********************** + +void help() //prints the help & credits screeen +{ + int i; + + clear_screen(); + for (i=0;i<=5;i++) + { + Blit(25,160+i*70,fore[i]); + } + Blit(300,-30,racer_pic[4]); + PutString(Screen, 80, 175, "Normal wall"); + PutString(Screen, 80, 245, "Deadly wall"); + PutString(Screen, 80, 315, "Stopper"); + PutString(Screen, 80, 385, "Your goal is to arrive here"); + PutString(Screen, 80, 455, "Teleporter"); + PutString(Screen, 80, 525, "Time bonus"); + + PutString(Screen, 350, 165, "Code:"); + PutString(Screen, 350, 180, "Karl Bartel (main code) "); + PutString(Screen, 350, 195, "Lion Kimbro (particles) "); + PutString(Screen, 350, 220, "Graphics:"); + PutString(Screen, 350, 235, "Karl Bartel"); + PutString(Screen, 500, 220, "Backgrounds:"); + PutString(Screen, 500, 235, "Unknown (see AUTHORS)"); + + PutString(Screen, 350, 265, "Packaging:"); + PutString(Screen, 350, 280, "Christian T. Steigies (debian)"), + + PutString(Screen, 350, 305, "Music:"); + PutString(Screen, 350, 320, "The Lizard King (www.itv.se/~a1055/frames.html)"); + + PutString(Screen, 350, 365, "Sound Effects:"); + PutString(Screen, 350, 380, "grabbed from ClanBomber"); + PutString(Screen, 350, 405, "Levels:"); + PutString(Screen, 350, 420, "Karl Bartel"); + PutString(Screen, 350, 435, "Stephan "); + + PutString(Screen, 350, 465, "Libraries used:"); + PutString(Screen, 350, 480, "SDL by Sam Lantinga"); + PutString(Screen, 350, 495, "SFont by Karl Bartel"); + PutString(Screen, 350, 510, "modified MikMod (for SDL)"); + + PutString(Screen, 40, 580, "You can find the BumpRace web page at: http://www.linux-games.com"); + SDL_UpdateRect(Screen,0,0,0,0); + SDL_WaitEvent(&event); + SDL_WaitEvent(&event); + clear_screen(); + BlitMenu(); + Blit(100,0,selectp_pic[pl]); + SDL_UpdateRect(Screen,0,0,0,0); +} + +// ******************************** Main Menu ***************** + +void PrepareMenu() +{ + SDL_EventState(SDL_KEYUP, SDL_ENABLE); + SDL_EventState(SDL_KEYDOWN, SDL_ENABLE); + clear_bb(); + BlitToBB(0,0,title_pic); + FadeScreen(7); +} + +SDL_Rect DrawMode(int num, int y, SDL_Rect *rect) //for Menu only +{ + if (y<600) + { + if (num<3) Blit(50+num*250,y,mode_select_pic[num]); + else Blit(300+(num-3)*250,y,mode_select_pic[num]); + }else + { + blitrect.x=1; + blitrect.y=1; + blitrect.w=1; + blitrect.h=1; + } + return blitrect; +} + +void FadeSelectorOut(int y, int mode) +{ + SDL_Rect dstrect; + + now=SDL_GetTicks(); + for (i=0;i<=255;i+=SDL_GetTicks()-now) + { + now=SDL_GetTicks(); + dstrect.x=40+mode*250;dstrect.y=y-10;dstrect.w=220;dstrect.h=10; + SDL_FillRect(Screen,&dstrect,0); + dstrect.x=40+mode*250;dstrect.y=y+100;dstrect.w=220;dstrect.h=10; + SDL_FillRect(Screen,&dstrect,0); + dstrect.x=40+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100; + SDL_FillRect(Screen,&dstrect,0); + dstrect.x=250+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100; + SDL_FillRect(Screen,&dstrect,0); + SDL_SetAlpha(selector_pic,(SDL_SRCALPHA),255-i); + Blit (40+250*mode,y-10,selector_pic); + Update(); + } + dstrect.x=40+mode*250;dstrect.y=y-10;dstrect.w=220;dstrect.h=10; + SDL_FillRect(Screen,&dstrect,0); + dstrect.x=40+mode*250;dstrect.y=y+100;dstrect.w=220;dstrect.h=10; + SDL_FillRect(Screen,&dstrect,0); + dstrect.x=40+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100; + SDL_FillRect(Screen,&dstrect,0); + dstrect.x=250+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100; + SDL_FillRect(Screen,&dstrect,0); + SDL_UpdateRect(Screen,40+mode*250,y-10,220,120); +} + +void FadeSelectorIn(int y, int mode) +{ + SDL_Rect dstrect; + + now=SDL_GetTicks(); + if (mode==3) {y+=120;mode=1;} + for (i=255;i>=0;i-=SDL_GetTicks()-now) + { + now=SDL_GetTicks(); + dstrect.x=40+mode*250;dstrect.y=y-10;dstrect.w=220;dstrect.h=10; + SDL_FillRect(Screen,&dstrect,0); + dstrect.x=40+mode*250;dstrect.y=y+100;dstrect.w=220;dstrect.h=10; + SDL_FillRect(Screen,&dstrect,0); + dstrect.x=40+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100; + SDL_FillRect(Screen,&dstrect,0); + dstrect.x=250+mode*250;dstrect.y=y;dstrect.w=10;dstrect.h=100; + SDL_FillRect(Screen,&dstrect,0); + SDL_SetAlpha(selector_pic,(SDL_SRCALPHA),255-i); + Blit (40+250*mode,y-10,selector_pic); + Update(); + } +} + +void Menu() +{ + int v,y=599,update; + float time; + SDL_Rect oldrect[4]; + +// blit(0,0,title_pic); + for (i=0;i<4;i++) + { + oldrect[i].x=0;oldrect[i].y=0;oldrect[i].w=1;oldrect[i].h=1; + } + v=555; + now=SDL_GetTicks(); + while (v>0) + { + for (i=0;i<4;i++) { + SDL_FillRect(Screen,&oldrect[i],0); + AddThisRect(oldrect[i]); + } + oldrect[0]=DrawMode(0, y, oldrect); + oldrect[1]=DrawMode(1, y, oldrect); + oldrect[2]=DrawMode(2, y, oldrect); + oldrect[3]=DrawMode(3, y+120, oldrect); + time=((float)(SDL_GetTicks()-now))/1000; + now=SDL_GetTicks(); + y-=v*time; + v-=599*time; + Update(); + } + mode=0;update=1; + SDL_PollEvent(&event); + keys = SDL_GetKeyState(NULL); + while ( keys[SDLK_RETURN]!=SDL_PRESSED) + { + if (update) FadeSelectorIn(y,mode); + SDL_PollEvent(&event); + keys = SDL_GetKeyState(NULL); + update=0; + if (( keys[SDLK_RIGHT] == SDL_PRESSED )&&(mode<2)) + {FadeSelectorOut(y,mode);mode++;update=1;} + if (( keys[SDLK_LEFT] == SDL_PRESSED )&&(mode>0)&&(mode<3)) + {FadeSelectorOut(y,mode);mode--;update=1;} + if (( keys[SDLK_DOWN] == SDL_PRESSED )&&(mode<3)) + {FadeSelectorOut(y,mode);mode=3;update=1;} + if (( keys[SDLK_UP] == SDL_PRESSED )&&(mode==3)) + {FadeSelectorOut(y+120,1);mode=1;update=1;} + SDL_WaitEvent(&event); + } + if (mode==0) playernum=1; else playernum=2; +} + + +// ************************** Racer Selection + +void load_racer() //loads the racer data +{ + if (user[pl].racernum==0) { + for (i=0;i<=17;i++) + { + sprintf(text,"racerc%d.gif",i+1); + user[pl].racer[i]=LoadImage(text,1); + } + }else + if (user[pl].racernum==1) { + for (i=0;i<=17;i++) + { + sprintf(text,"racerd%d.gif",i+1); + user[pl].racer[i]=LoadImage(text,1); + } + }else + if (user[pl].racernum==2) { + for (i=0;i<=17;i++) + { + sprintf(text,"racere%d.gif",i+1); + user[pl].racer[i]=LoadImage(text,1); + } + }else + { + for (i=0;i<=17;i++) + { + sprintf(text,"racerf%d.gif",i+1); + user[pl].racer[i]=LoadImage(text,1); + } + } + user[pl].slowdown=0; + user[pl].turbo_possible=0; + user[pl].sticky_possible=0; + user[pl].extra_time=0; + if (user[pl].racernum==0) {user[pl].slowdown=0.00012;} + if (user[pl].racernum==1) {user[pl].extra_time=15;} + if (user[pl].racernum==2) {user[pl].turbo_possible=1; user[pl].slowdown=0.00004;} + if (user[pl].racernum==3) {user[pl].sticky_possible=1; user[pl].slowdown=0.00003;} +} + +void SelectRacer() //menu for racer selection +{ + SDL_Rect fillrect; + int i; + + fillrect.x=50; + fillrect.y=140; + fillrect.w=700; + fillrect.h=430; + SDL_PollEvent(&event); + keys = SDL_GetKeyState(NULL); + while (keys[SDLK_RETURN]==SDL_PRESSED) + { + SDL_PollEvent(&event); + keys = SDL_GetKeyState(NULL); + } + while (keys[SDLK_RETURN]!=SDL_PRESSED) + { + SDL_PollEvent(&event); + keys = SDL_GetKeyState(NULL); + while (!SDL_WaitEvent(&event)) + { + SDL_PollEvent(&event); + keys = SDL_GetKeyState(NULL); + } + if (( keys[SDLK_RIGHT] == SDL_PRESSED )&&(user[pl].racernum<5)) + {user[pl].racernum++;} + if (( keys[SDLK_LEFT] == SDL_PRESSED )&&(user[pl].racernum>0)) + {user[pl].racernum--;} + if (( keys[SDLK_DOWN] == SDL_PRESSED )&&(user[pl].racernum<3)) + {user[pl].racernum+=3;} + if (( keys[SDLK_UP] == SDL_PRESSED )&&(user[pl].racernum>2)) + {user[pl].racernum-=3;} + if (user[pl].racernum>5) user[pl].racernum=5; + BlitMenu(); + SDL_UpdateRects(Screen,1,&fillrect); + } +} diff --git a/src/menu.h b/src/menu.h new file mode 100644 index 0000000..c6828d3 --- /dev/null +++ b/src/menu.h @@ -0,0 +1,3 @@ +void Menu(); // Main Menu +void help(); // Help and Credits +void SelectRacer(); \ No newline at end of file diff --git a/src/options.c b/src/options.c new file mode 100644 index 0000000..cc43feb --- /dev/null +++ b/src/options.c @@ -0,0 +1,161 @@ +#include "bumprace.h" +#include "errno.h" + +char Player[10][200]; +int Hiscore[10],i; + +FILE *OpenOptionsFile( char *mode ) +{ + char filename[200]; + FILE *file; + + if ((char *)getenv("HOME") != NULL) + sprintf( filename, "%s/.bumprace", getenv("HOME")); + else + sprintf( filename, "bumprace.dat"); + + file = fopen(filename, mode); + + if (file==NULL) { + fprintf(stderr, "\nWarning: I could not open the options file "); + if (strcmp(mode, "r") == 0) + fprintf(stderr, "for read:"); + else if (strcmp(mode, "w") == 0) + fprintf(stderr, "for write:"); + + fprintf(stderr, "\n%s\n" + "The error that occured was:\n" + "%s\n\n", filename, strerror(errno)); + } + + return file; +} + +void ReadOptions() +{ + FILE *file; + + file=OpenOptionsFile("r"); + + if (file==NULL) { + file=OpenOptionsFile("w"); + if (file==NULL) exit(1); + + fprintf(file, "# BumpRace Options File\n\n"); + fprintf(file, "Sam\nLion\nBill\nJohn\nAndreas\nAaron\nMichael\nPhoenix\nPierre\nRobert\n"); + for (i=0;i<10;i++) + fprintf(file, "%d\n", 4000-i*400); + + fclose(file); + file=OpenOptionsFile("r"); + } + + fscanf(file, "%*s%*s%*s%*s\n"); + for (i=0;i<10;i++) + fscanf(file, "%[^\n]\n",&Player[i]); + for (i=0;i<10;i++) + fscanf(file, "%d\n",&Hiscore[i]); +// for (i=0;i<10;i++) +// printf("%s %d\n",Player[i],Hiscore[i]); + + fclose(file); +} + +void FinalScore() +{ + char Name[200]="",text[200]; + int ch,a; + SDL_Rect rect; + FILE *file; + + if (Score>Hiscore[9]) { + Blit(0,0,back); + XCenteredString(Screen, 200, "< YOUR FINAL SCORE >"); + sprintf(text,"%d", Score); + XCenteredString(Screen, 250, text); + XCenteredString(Screen, 300, "Enter Your Name:"); + Update(); + rect.x=0; + rect.y=350; + rect.w=800; + rect.h=100; + SDL_EventState(SDL_KEYDOWN, SDL_ENABLE); + while ((ch!=SDLK_RETURN)&&(SDL_WaitEvent(&event))) { + SDL_PollEvent(&event); + if (event.type==SDL_KEYDOWN) { + ch=event.key.keysym.unicode; + sprintf(Name,"%s%c",Name,ch); + if (ch=='\b') Name[strlen(Name)-2]='\0'; + //printf("%s - %c\n",Name,ch); + SDL_BlitSurface( back, &rect, Screen, &rect); + PutString(Screen,400-TextWidth(Name)/2,350,Name); + AddThisRect(rect); + Update(); + } + SDL_Delay(10); + } + Name[strlen(Name)-1]='\0'; + if (strcmp(Name,"")==0) strcpy(Name,"Anonymous Coward"); + for (i=0;i<10;i++) { + if (Score>Hiscore[i]) { + // Move other players down on the list + for (a=9;a>=i;a--) { + strcpy(Player[a],Player[a-1]); + Hiscore[a]=Hiscore[a-1]; + } + // add the player + strcpy(Player[i],Name); + Hiscore[i]=Score; + break; + } + } +// for (i=0;i<10;i++) +// printf("%s %d\n",Player[i],Hiscore[i]); + + // write everything into the options file + file=OpenOptionsFile("w"); + if (file==NULL) exit(1); + + fprintf(file, "# BumpRace Options File\n\n"); + for (i=0;i<10;i++) + fprintf(file, "%s\n", Player[i]); + for (i=0;i<10;i++) + fprintf(file, "%d\n", Hiscore[i]); + + fclose(file); + +} else { + + if (Score<0) Score=0; + Blit(0,0,back); + XCenteredString(Screen, 200, "< YOUR FINAL SCORE >"); + sprintf(text,"%d", Score); + XCenteredString(Screen, 250, text); + XCenteredString(Screen, 300, "You didn't qualify for the highscore list..."); + Update(); + SDL_EventState(SDL_KEYUP, SDL_ENABLE); + SDL_EventState(SDL_KEYDOWN, SDL_ENABLE); + SDL_WaitEvent(&event); + SDL_WaitEvent(&event); +}} + +void ShowHiscore() +{ + SDL_Event WaitEvent; + char text[200]; + int i; + + Blit(0,0,back); + XCenteredString(Screen, 100, "< BUMPRACE HIGHSCORES >"); + for (i=0;i<10;i++) { + sprintf(text,"%s", Player[i]); + PutString(Screen,200,150+i*30,text); + sprintf(text,"%d", Hiscore[i]); + PutString(Screen,600-TextWidth(text),150+i*30,text); + } + Update(); + while ((WaitEvent.type!=SDL_KEYDOWN)&&(WaitEvent.type!=SDL_MOUSEBUTTONDOWN)) { + SDL_PollEvent(&WaitEvent); + SDL_WaitEvent(&WaitEvent); + } +} diff --git a/src/options.h b/src/options.h new file mode 100644 index 0000000..78710de --- /dev/null +++ b/src/options.h @@ -0,0 +1,3 @@ +void ReadOptions(); +void FinalScore(); +void ShowHiscore(); \ No newline at end of file diff --git a/src/particles.c b/src/particles.c new file mode 100644 index 0000000..c70f093 --- /dev/null +++ b/src/particles.c @@ -0,0 +1,163 @@ +#include "bumprace.h" +#include "math.h" +#include "stdlib.h" + +#define PARTICLE_LIFETIME 13 +#define PARTICLES_OF_EXHAUST 300 +typedef struct +{ + float Lifetime; // Lifetime of the current Particle + float X; // X coordinate + float Y; // Y coordinate + float dX; // delta X for each Particle frame + float dY; // delta Y for each Particle frame + int R, G, B; // Red, Green, and Blue for Particle +} Particle; + +Particle particles[ 300 ]; + +int NullParticle=0; // The NullParticle is the # of the last legal particle. + // Cannot reach PARTICLES_OF_EXHAUST! + +#define PARTICLE_COLORS 5 +int ParticleColorsR[] = { 255, 255, 200, 200, 80 }; +int ParticleColorsG[] = { 255, 190, 90, 20, 0}; +int ParticleColorsB[] = { 0, 0 , 0, 50, 255 }; + +void UndrawParticles() +{ + int i; + for( i = 0; i < NullParticle; i++ ) + { + Particle* ThisParticle = &particles[ i ]; + if( (int)ThisParticle->X >= 0 ) + if( (int)ThisParticle->X < 800 ) + if( (int)ThisParticle->Y >= 0 ) + if( (int)ThisParticle->Y < 600 ) + PutBackPixel( Screen, (int)ThisParticle->X, (int)ThisParticle->Y ); + } +} + +void HandleParticles() +{ + int i; + + for( i = 0; i < NullParticle; i++ ) + { + Particle* ThisParticle = &particles[ i ]; + + ThisParticle->Lifetime-=game_speed/(float)1000; + if( ThisParticle->Lifetime <= 0 ) + { + // Delete this particle + if( i != NullParticle -1 ) + { + // We aren't the end particle, so we have to preserve the end. + Particle* OtherParticle = &particles[ NullParticle - 1 ]; + *ThisParticle = *OtherParticle; // Default: Memberwise Assignment + } + NullParticle--; + i--; // Do this cell once more... + } + else + { + int MorphColor; + + // Move this particle + ThisParticle->X += ThisParticle->dX*game_speed; + ThisParticle->Y += ThisParticle->dY*game_speed; + ThisParticle->dY+= gravity/(float)2000; + // printf("%f\t%f\n",ThisParticle->dX*game_speed,ThisParticle->dY*game_speed); + + MorphColor = 0; + switch( (int)ThisParticle->Lifetime ) + { + case 25: + case 20: MorphColor = 1; break; + case 8: + case 2: MorphColor = -1; break; + } + ThisParticle->R += MorphColor; + ThisParticle->G += MorphColor; + ThisParticle->B += MorphColor; + // Strangely enough, it looks better *WITHOUT* the logical constraints! + // if (ThisParticle->R>255) ThisParticle->R=255; + // if (ThisParticle->R<0) ThisParticle->R=0; + // if (ThisParticle->G>255) ThisParticle->G=255; + // if (ThisParticle->G<0) ThisParticle->G=0; + // if (ThisParticle->B>255) ThisParticle->B=255; + // if (ThisParticle->B<0) ThisParticle->B=0; + } + } +} + +void DisplayParticles() +{ + int i; + + lock(); + for( i = 0; i < NullParticle; i++ ){ + Particle* ThisParticle = &particles[ i ]; + int X, Y; + X = ThisParticle->X; + Y = ThisParticle->Y; + if( ThisParticle->X >= 0 ) + if( ThisParticle->X < 800 ) + if( ThisParticle->Y >= 0 ) + if( ThisParticle->Y < 600 ){ + PutPixel( Screen, ThisParticle->X, ThisParticle->Y, + SDL_MapRGB(Screen->format,ThisParticle->R, ThisParticle->G, ThisParticle->B) ); + } + } + unlock(); +} + +void NewParticles(float turn, int X, int Y) +{ + if(( NullParticle < PARTICLES_OF_EXHAUST )&&(particle)) + { + int ColorIndex; + int Percent; // Damn. C is really really finicky about declarations! Urusai! + float scalefactor; + + Particle* ThisParticle = &particles[ NullParticle ]; + ThisParticle->Lifetime = PARTICLE_LIFETIME + abrand( -5, 5 ); + ThisParticle->X = X + 15; + ThisParticle->Y = Y + 15; + + ColorIndex = abrand( 0, PARTICLE_COLORS-1 ); + ThisParticle->R = ParticleColorsR[ ColorIndex ]; + ThisParticle->G = ParticleColorsG[ ColorIndex ]; + ThisParticle->B = ParticleColorsB[ ColorIndex ]; + // Introduce Orthogonal (y, -x) Component + switch( user[pl].racernum ) { + case 0: // SlowPoke + Percent = abrand( -50, 50 ); + break; + case 1: // Normal + Percent = abrand( -25, 25 ); + break; + case 2: // Speedy + Percent = abrand( -5, 5 ); + break; + case 3: // Spinny + Percent = abrand( -60, 60 ); + break; + default: // OOPS! + Percent = 0; + } + turn+=190; + turn+=Percent; + if (turn>360) turn-=360; + ThisParticle->dX = sin(turn*0.01745)*(precision); + ThisParticle->dY = -cos(turn*0.01745)*(precision); + + // scale particle speed + // (because I'm having such difficulty finding a good scaling value...) + ThisParticle->dX /= (float)2000; + ThisParticle->dY /= (float)2000; + + NullParticle++; + + } +} \ No newline at end of file diff --git a/src/particles.h b/src/particles.h new file mode 100644 index 0000000..c044431 --- /dev/null +++ b/src/particles.h @@ -0,0 +1,11 @@ +/* +Thanks to Lion Kimbro for his great prticle code. You can reach him via email +at SnowLion@sprynet.com +*/ + +extern int NullParticle; + +void UndrawParticles(); +void HandleParticles(); +void DisplayParticles(); +void NewParticles(float turn, int X, int Y);