debian/0000775000000000000000000000000012627621214007173 5ustar debian/maelstrom.dirs0000664000000000000000000000020312603037500012045 0ustar usr/lib/games/maelstrom usr/share/games/maelstrom usr/share/menu usr/share/applications usr/share/doc/maelstrom usr/share/man/man6 debian/postinst0000664000000000000000000000173512611662357011015 0ustar #!/bin/sh set -e #create maelstrom high-score directory SCOREDIR=/var/games if [ ! -e ${SCOREDIR} ] ; then install -d ${SCOREDIR} chown root:games ${SCOREDIR} chmod 2775 ${SCOREDIR} fi #remove old symlink which may point to the wrong file if [ -e /usr/lib/games/maelstrom/Maelstrom-Scores ] ; then rm -f /usr/lib/games/maelstrom/Maelstrom-Scores fi ln -sf ${SCOREDIR}/Maelstrom-Scores /usr/lib/games/maelstrom/Maelstrom-Scores #use old score file if [ -e /var/lib/games/maelstrom/Maelstrom-Scores ] ; then echo "Using score file found in /var/lib/games/maelstrom" install -p -m 664 -g games \ /var/lib/games/maelstrom/Maelstrom-Scores ${SCOREDIR}/Maelstrom-Scores rm -rf /var/lib/games/maelstrom fi #install the default score file if [ ! -e ${SCOREDIR}/Maelstrom-Scores ] ; then echo "installing debian default score file..." install -p -m 664 -g games \ /usr/lib/games/maelstrom/Maelstrom-Scores.debian \ ${SCOREDIR}/Maelstrom-Scores fi #DEBHELPER# debian/maelstrom.links0000664000000000000000000000030612603037500012230 0ustar usr/games/Maelstrom usr/games/maelstrom usr/share/man/man6/Maelstrom.6.gz usr/share/man/man6/maelstrom.6.gz usr/share/man/man6/Maelstrom.6.gz usr/share/man/man6/Maelstrom-netd.6.gz debian/compat0000664000000000000000000000000212611662357010377 0ustar 9 debian/maelstrom.desktop0000664000000000000000000000034312611662357012577 0ustar [Desktop Entry] Type=Application Name=Maelstrom GenericName=Ambrosia Maelstrom Comment=Play an Asteroids like game Icon=/usr/share/games/maelstrom/icon32.xpm Exec=/usr/games/maelstrom Terminal=false Categories=Game;ArcadeGame; debian/rules0000775000000000000000000000550112611662357010262 0ustar #!/usr/bin/make -f TMPDIR=maelstrom BINDIR=debian/${TMPDIR}/usr/games LIBDIR=debian/${TMPDIR}/usr/lib/games/maelstrom BMPDIR=debian/${TMPDIR}/usr/share/games/maelstrom DOCDIR=debian/${TMPDIR}/usr/share/doc/maelstrom MANDIR=debian/${TMPDIR}/usr/share/man DESKTOPDIR=debian/${TMPDIR}/usr/share/applications export DEB_BUILD_MAINT_OPTIONS=hardening=+all export DEB_BUILD_HARDENING=1 CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall CXXFLAGS := $(shell dpkg-buildflags --get CXXFLAGS) -Wall CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) build-arch: build build-indep: build build: cp /usr/share/misc/config.guess . cp /usr/share/misc/config.sub . ./configure CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" $(MAKE) touch build clean: rm -f build [ ! -f Makefile ] || $(MAKE) distclean rm -f config.guess rm -f config.sub dh_clean binary-indep: binary-arch: build dh_prep dh_installdirs $(MAKE) install prefix=`pwd`/debian/maelstrom/usr #move lib files mv ${BINDIR}/Images ${BMPDIR} mv ${BINDIR}/icon.* ${BMPDIR} mv ${BINDIR}/Maelstrom_* ${LIBDIR} cp icon32.* ${BMPDIR} sh debian/handle_underscores ${BMPDIR} sh debian/handle_underscores ${LIBDIR} #these are not needed rm -f ${BINDIR}/macres rm -f ${BINDIR}/playwave rm -f ${BINDIR}/snd2wav # highscores should be in /var/games this is handled by postinst and # postrm as highscore files shouldn't be overwritten during updates etc. mv ${BINDIR}/Maelstrom-Scores ${LIBDIR}/Maelstrom-Scores.debian chmod 644 ${LIBDIR}/Maelstrom-Scores.debian rm -f ${BMPDIR}/Images/Makefile* # menu entry dh_installmenu install -p -m 644 debian/maelstrom.desktop ${DESKTOPDIR} # documentation install -p -m 644 Docs/*FAQ ${DOCDIR} install -p -m 644 Docs/Maelstrom-Announce ${DOCDIR} install -p -m 644 Docs/MaelstromGPL_press_release ${DOCDIR} install -p -m 644 Docs/Quotes ${DOCDIR} install -p -m 644 Docs/RSA.README ${DOCDIR} install -p -m 644 Docs/*.Paper ${DOCDIR} install -p -m 644 Docs/Technical_Notes* ${DOCDIR} install -p -m 644 Changelog ${DOCDIR}/changelog install -p -m 644 CREDITS ${DOCDIR} install -p -m 644 debian/changelog ${DOCDIR}/changelog.Debian gzip -9n ${DOCDIR}/* install -p -m 644 README ${DOCDIR} install -p -m 644 README.options ${DOCDIR} install -p -m 644 README.network ${DOCDIR} install -p -m 644 README.joystick ${DOCDIR} install -p -m 644 debian/copyright ${DOCDIR} # man pages install -p -m 644 debian/maelstrom.6 ${MANDIR}/man6/Maelstrom.6 gzip -9n ${MANDIR}/man6/Maelstrom.6 # install scripts dh_installdeb dh_link dh_fixperms chown root:games ${BINDIR}/Maelstrom chmod 2755 ${BINDIR}/Maelstrom dh_strip # generate dependencies dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: binary binary-arch binary-indep clean debian/changelog0000664000000000000000000003115212627621214011047 0ustar maelstrom (1.4.3-L3.0.6+main-7ubuntu1) xenial; urgency=medium * Merge from Debian unstable. Remaining changes: - Include header to fix FTBFS due to implicit pointer conversion. -- Logan Rosen Wed, 02 Dec 2015 11:54:58 -0500 maelstrom (1.4.3-L3.0.6+main-7) unstable; urgency=medium * QA upload. * Use debhelper 9. * Switch to "3.0 (quilt)" source format. * prerm, postrm, postinst: Do not worry anymore about the /usr/doc to /usr/share/doc transition. Drop prerm completely. * postrm, postinst: Do not worry about menus, debhelper already does. * Do not use a different configure script to do "make install". Instead, pass an appropriate prefix option to the one used to compile. * As there is now only one modified configure script, put it in the usual place so that we can avoid moving it back and forth. * Do not embed calls to dpkg-buildflags in Makefile.in files. Instead, pass CFLAGS and related variables to configure script. * Try to be reproducible by using gzip -n and dh_fixperms. * Drop useless/unused debian/rules stuff. * Drop -fPIC. No libraries here. -- Santiago Vila Wed, 30 Sep 2015 22:02:30 +0200 maelstrom (1.4.3-L3.0.6+main-6ubuntu1) wily; urgency=medium * Include header to fix FTBFS due to implicit pointer conversion. -- Logan Rosen Tue, 20 Oct 2015 21:49:25 -0400 maelstrom (1.4.3-L3.0.6+main-6) unstable; urgency=low * orphan package -- Christoph Baumann Mon, 22 Sep 2014 22:23:17 +0200 maelstrom (1.4.3-L3.0.6+main-5) unstable; urgency=low * further fix in postinst -- Christoph Baumann Wed, 15 May 2013 22:15:24 +0200 maelstrom (1.4.3-L3.0.6+main-4) unstable; urgency=low * fix cleanup of old symlinks. Closes: #707840 -- Christoph Baumann Wed, 15 May 2013 00:47:05 +0200 maelstrom (1.4.3-L3.0.6+main-3) unstable; urgency=low * applied NMU diff by Steve McIntyre (see bug 678804) -- Christoph Baumann Sat, 14 Jul 2012 22:49:04 +0200 maelstrom (1.4.3-L3.0.6+main-2) unstable; urgency=low * added -fPIC option for compilation of libraries -- Christoph Baumann Mon, 02 Jul 2012 17:13:35 +0200 maelstrom (1.4.3-L3.0.6+main-1) unstable; urgency=low * fix several lintian bugs - Closes: #677029 - Closes: #677030 - Closes: #673442 - Closes: #677034 -- Christoph Baumann Mon, 11 Jun 2012 14:34:45 +0200 maelstrom (1.4.3-L3.0.6+main-0+nmu1) unstable; urgency=low * NMU * Re-upload with faked new upstream to make sure the source all gets into main. Closes: #673442. -- Steve McIntyre <93sam@debian.org> Mon, 11 Jun 2012 10:05:45 +0100 maelstrom (1.4.3-L3.0.6-11) unstable; urgency=low * fix several lintian bugs -- Christoph Baumann Tue, 24 Apr 2012 23:51:29 +0200 maelstrom (1.4.3-L3.0.6-10) unstable; urgency=low * License of game art (graphics and sound) became free under CC (Closes: #668623) * Added .desktop file (Closes: #602308) * Updated upstream contact information -- Christoph Baumann Mon, 16 Apr 2012 22:29:12 +0200 maelstrom (1.4.3-L3.0.6-9) unstable; urgency=low * maintainer upload -- Christoph Baumann Thu, 12 Apr 2012 18:38:13 +0200 maelstrom (1.4.3-L3.0.6-8.1) unstable; urgency=low * Non-maintainer upload. * Fix bugs in debian/rules: - Fix bashism in clean commands, thanks to Angel Abad (Closes: #581483) - Remove more files in clean target - Don't ignore failure of 'rm' commands * Remove unneeded temporary files * Remove bogus build-dependency on build-essential -- Ben Hutchings Fri, 31 Dec 2010 19:45:53 +0000 maelstrom (1.4.3-L3.0.6-8) unstable; urgency=low * fixed some compiler warnings with gcc-4.3.2 * fixed some lintian error/warnings -- Christoph Baumann Fri, 1 Jan 2010 23:10:42 +0100 maelstrom (1.4.3-L3.0.6-7) unstable; urgency=low * added handling for SIGINT (Closes: #431234) -- Christoph Baumann Tue, 3 Jul 2007 20:46:42 +0100 maelstrom (1.4.3-L3.0.6-6.1) unstable; urgency=low * Non-maintainer upload. * Remove build-dependency on xlibs-dev. (Closes: #346942) -- Steinar H. Gunderson Sun, 22 Jan 2006 19:05:32 +0100 maelstrom (1.4.3-L3.0.6-6) unstable; urgency=low * added autotools-dev to Build-Depends (closes: #325672) * Standards-Version set to 3.6.2 -- Christoph Baumann Wed, 31 Aug 2005 23:32:46 +0200 maelstrom (1.4.3-L3.0.6-5) unstable; urgency=low * fixed FTBFS on ppc64 (closes: #300389) * fixed symlink in /usr/doc (closes: #322792) * recompiled with newer gcc-3.3.5, gcc-4.0 not available on sarge (closes: #321196) -- Christoph Baumann Tue, 23 Aug 2005 22:22:49 +0200 maelstrom (1.4.3-L3.0.6-4) unstable; urgency=low * fixed FTBFS with gcc-4.0 on AMD64 (closes: Bug#294450) -- Christoph Baumann Fri, 11 Feb 2004 00:13:42 +0100 maelstrom (1.4.3-L3.0.6-3) unstable; urgency=low * fixed FTBFS with gcc-3.4 (closes: Bug#260500) -- Christoph Baumann Tue, 24 Aug 2004 00:31:05 +0100 maelstrom (1.4.3-L3.0.6-2) unstable; urgency=low * fixed security issues concerning buffer overflows (closes: Bug#255434) -- Christoph Baumann Tue, 3 Aug 2004 23:32:15 +0100 maelstrom (1.4.3-L3.0.6-1) unstable; urgency=low * new upstream version (closes: Bug#252235) * don't use suidmanagear any more (closes: Bug#237962) -- Christoph Baumann Wed, 30 Jun 2004 00:41:34 +0100 maelstrom (1.4.3-L3.0.5-3) unstable; urgency=low * fixed some lintian errors and the /usr/doc symlink (closes: Bug#129396) -- Christoph Baumann Thu, 17 Jan 2002 20:55:43 +0100 maelstrom (1.4.3-L3.0.5-2) unstable; urgency=low * recompiled against libsdl1.2debian (closes: Bug#125723) -- Christoph Baumann Fri, 21 Dec 2001 22:33:33 +0100 maelstrom (1.4.3-L3.0.5-1) unstable; urgency=low * initial release with new source * (closes: Bug#112893) * (closes: Bug#76132) -- Christoph Baumann Sat, 15 Dec 2001 17:27:28 +0100 maelstrom (1.4.3-L3.0.1-8) unstable; urgency=low * fixing postinst script to handle upgrades (closes: Bug#121381) -- Christoph Baumann Tue, 28 Nov 2001 20:18:15 +0200 maelstrom (1.4.3-L3.0.1-7) unstable; urgency=low * moving to /var/games (closes: Bug#115845) -- Christoph Baumann Sun, 25 Nov 2001 19:06:08 +0200 maelstrom (1.4.3-L3.0.1-6) unstable; urgency=low * give handle_underscores a +x before building (closes: Bug#82344) * changed MANDIR to /usr/share/man (closes: Bug#91207) -- Christoph Baumann Mon, 28 May 2001 16:35:53 +0200 maelstrom (1.4.3-L3.0.1-5) unstable; urgency=low * corrected a silly mistake with the manpage -- Christoph Baumann Thu, 29 Mar 2001 16:35:53 +0200 maelstrom (1.4.3-L3.0.1-4) unstable; urgency=low * inserted some lines to debian/rules to delete rubbish in debian/ and ./ -- Christoph Baumann Thu, 16 Jan 2001 11:55:53 +0200 maelstrom (1.4.3-L3.0.1-3) unstable; urgency=low * included symlink from /usr/doc/maelstrom to /usr/share/doc/maelstrom -- Christoph Baumann Thu, 6 Jul 2000 18:14:51 +0200 maelstrom (1.4.3-L3.0.1-2) unstable; urgency=low * changed permissions for executable to 2755 -- Christoph Baumann Fri, 21 Apr 2000 16:43:41 +0200 maelstrom (1.4.3-L3.0.1-1) unstable; urgency=low * completely new source based on SDL -- Christoph Baumann Tue, 21 Mar 2000 01:11:38 +0200 maelstrom (1.4.3-L2.0.6-12) unstable; urgency=low * did some debuging, i.e. changed some (meanwhile?) wrong declarations to solve errors during compilation. The changed files are: - fastrand.cpp - mixer-dma.h - mixer-dma.cpp - netlogic/netplay.cpp - vga_framebuf.h maelstrom should now compile on potato -- Christoph Baumann Fri, 17 Dec 1999 21:06:36 +0200 maelstrom (1.4.3-L2.0.6-11) unstable; urgency=low * myerror.cpp: had to include 'string.h' to avoid an 'implicit declaration' caused by the call of the undeclared function 'strerror' which is normaly declared in 'string.h' -- Christoph Baumann Wed, 17 Nov 1999 16:35:12 +0200 maelstrom (1.4.3-L2.0.6-10) unstable; urgency=low * Had to jump to revision number 10 to correct some mistakes made with the last upload (entry for rev.no. 9 is more or less bogus) -- Christoph Baumann Tue, 9 Nov 1999 16:15:12 +0200 maelstrom (1.4.3-L2.0.6-9) unstable; urgency=low * Added some information to debian/copyright -- Christoph Baumann Tue, 2 Nov 1999 15:42:12 +0200 maelstrom (1.4.3-L2.0.6-8) unstable; urgency=low * Maintainer changed * (debian/rules) Changed DOCDIR to /usr/share/doc/maelstrom, according to the policy -- Christoph Baumann Fri, 29 Oct 1999 15:31:12 +0200 maelstrom (1.4.3-L2.0.6-7) unstable; urgency=low * (debian/config-i386, debian/config-other) Compile with USE_JOYSTICK, since it's harmless when there is no joystick present, and activates joystick support for those who have it. Thanks to Tom Lear for pointing this out. * (debian/rules) Also install README.joystick. * (debian/postrm) Use = instead of == in test (avoids bashism), pointed out by Joey Hess. -- Richard Braakman Thu, 11 Jun 1998 00:12:08 +0200 maelstrom (1.4.3-L2.0.6-6) unstable; urgency=low * Better scorefile handling: - Don't make score file a conffile, and don't include it in the package directly. - Install Maelstrom's two default scorefiles in /usr/lib/games/maelstrom. - In the postinst, check if the score directory exists and install it if not. Create it with mode 2775, group games. Then check if the scorefile exists. If not, copy the "high" default to that location and set it to mode 664, group games. - In the postrm, remove the scorefile and score directory if the argument is "purge". - Don't include the directory in the package itself, to avoid dpkg warnings when it tries to remove the directory while leaving the scorefile. * Upstream "high" scorefile is broken. Install a fixed version. It's uuencoded in the Debian diffs. -- Richard Braakman Thu, 5 Mar 1998 02:44:24 +0100 maelstrom (1.4.3-L2.0.6-5) unstable; urgency=low * debian/copyright: Describe Debian-specific patches (Policy, 5.6) * debian/rules: Added hackery to depend on svgalibg1 | svgalib-dummyg1, even if svgalibg1 does not list svgalib-dummyg1 in its shlibs file. (cf. http://www.debian.org/Lists-Archives/debian-devel-9710/msg00685.html) * debian/rules: install /var/lib/games/maelstrom/ directory as a normal 755 directory, rather than 775 and owned by games. Maelstrom can't recreate its scorefile anyway if it's gone. The scorefile is still owned and writeable by games. * Moved Maelstrom_sound and Maelstrom_sound.dma to /usr/lib/games/maelstrom/. * Removed manpage symlink for Maelstrom_sound. * Changed debian/rules to not call upstream install target. -- Richard Braakman Wed, 11 Feb 1998 18:27:25 +0100 maelstrom (1.4.3-L2.0.6-4) unstable; urgency=low * Install Maelstrom_sound.dma for people who want it. * Include Section and Priority fields in binary package. * README.Debian: Clearer text about using the mouse in svga mode. * Standards-Version 2.4.0.0. * Previous version did not list scorefile as conffile. Oops, sorry. * Use -p flag when installing documentation. -- Richard Braakman Sat, 7 Feb 1998 12:45:45 +0100 maelstrom (1.4.3-L2.0.6-3) unstable; urgency=low * Rewrote rules file (no longer used debstd). * Now compresses changelog.Debian -- Richard Braakman Fri, 28 Nov 1997 00:26:57 +0100 maelstrom (1.4.3-L2.0.6-2) unstable; urgency=low * Worked around new sgid-dropping code in svgalibg1-1.2.11, to preserve games id. * Added line about mice and svgalib to README.debian -- Richard Braakman Sat, 18 Oct 1997 15:09:57 +0200 maelstrom (1.4.3-L2.0.6-1) unstable; urgency=low * Check for i386 before setting USE_SVGALIB * Added menu entry * Moved to non-free (see copyright file) * Repackaged for standards-version 2.3.0.0 * Compiled for libc6, xlib6g, xpm4g * Pristine source * New upstream version * Gave reasons for suid and sgid settings in README.debian * New maintainer -- Richard Braakman Fri, 19 Sep 1997 12:19:48 +0200 debian/copyright0000664000000000000000000000177312611662357011144 0ustar This is the Debian GNU/Linux prepackaged version of Maelstrom, an arcade-style game resembling Asteroids. This version of the package was made by Christoph Baumann , from sources obtained from: http://www.libsdl.org/projects/Maelstrom/ Last maintainer was Richard Braakmann (1.4.3-L2.0.6-1 to 1.4.3-L2.0.6-7). Earlier versions were maintained by Robert Leslie . The following copyright applies to this software: Copyright 1999 Sam Lantinga The source code to Maelstrom 3.0 and higher has been released under the GNU General Public License which can be found in /usr/share/common-licenses/GPL-2 The artwork and animations in Maelstrom may be used under the terms of the Creative Commons Attribution 3.0 license (unported): http://creativecommons.org/licenses/by/3.0/legalcode The following files must accompany any distribution of Maeltrom 3.0: Ambrosia_Software,_Inc._FAQ MaelstromGPL_press_release They can be found in the Docs directory. debian/postrm0000664000000000000000000000047212611662357010453 0ustar #!/bin/sh set -e SCOREDIR=/var/games if test "$1" = purge; then echo "Purging high-score file." rm -f $SCOREDIR/Maelstrom-Scores fi LIBDIR=/usr/lib/games/maelstrom if test "$1" = purge; then echo "Purging high-score file." rm -f $LIBDIR/Maelstrom-Scores rmdir $LIBDIR || true fi #DEBHELPER# debian/patches/0000775000000000000000000000000012627621637010633 5ustar debian/patches/series0000664000000000000000000000013712627621260012041 0ustar 01-debian-diff-to-be-split-some-day.patch 02-configure-diff.patch 03-implicit-conversion.patch debian/patches/03-implicit-conversion.patch0000664000000000000000000000257212627621260016067 0ustar Description: TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. . maelstrom (1.4.3-L3.0.6+main-7ubuntu1) xenial; urgency=medium . * Merge from Debian unstable. Remaining changes: - Include header to fix FTBFS due to implicit pointer conversion. Author: Logan Rosen --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: http://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- maelstrom-1.4.3-L3.0.6+main.orig/Maelstrom-netd.c +++ maelstrom-1.4.3-L3.0.6+main/Maelstrom-netd.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include debian/patches/02-configure-diff.patch0000664000000000000000000000410712603037670014754 0ustar Description: configure script really used to compile and install --- a/configure +++ b/configure @@ -239,7 +239,7 @@ # # Initializations. # -ac_default_prefix=/usr/local +ac_default_prefix=/usr cross_compiling=no subdirs= MFLAGS= @@ -285,14 +285,15 @@ # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. -bindir='${exec_prefix}/bin' +bindir='${exec_prefix}/games' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datadir='${prefix}/share/games' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' +localstatedir='/var/games' +libdir='${exec_prefix}/lib/games/maelstrom' +bmpdir='${exec_prefix}/share/games/maelstrom' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' @@ -616,7 +617,7 @@ # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir + localstatedir libdir bmpdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in @@ -1439,7 +1440,7 @@ fi -PACKAGE=Maelstrom +PACKAGE=maelstrom VERSION=3.0.6 @@ -3229,14 +3230,14 @@ ;; *-*-beos*) ac_default_prefix=/boot/beos - GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE" + GAME_INSTALLDIR="\$(prefix)/games/" ;; *) - GAME_INSTALLDIR="\$(prefix)/games/$PACKAGE" + GAME_INSTALLDIR="\$(prefix)/games/" ;; esac -CFLAGS="$CFLAGS -DLIBDIR=\\\"$GAME_INSTALLDIR\\\"" +CFLAGS="$CFLAGS -DLIBDIR=\\\"$libdir\\\" -DBMPDIR=\\\"$bmpdir\\\"" CXXFLAGS="$CXXFLAGS $CFLAGS" @@ -3814,6 +3815,7 @@ s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t +s,@bmpdir@,$bmpdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t debian/patches/01-debian-diff-to-be-split-some-day.patch0000664000000000000000000016014712603037574020077 0ustar Description: Debian diff as of version 1.4.3-L3.0.6+main-6 --- a/COPYING +++ b/COPYING @@ -1,14 +1,11 @@ The source code to Maelstrom 3.0 and higher has been released under the GNU General Public License which can be found in COPYING.GPL. -The artwork and sounds used by Maelstrom are copyright Ambrosia Software -(http://www.ambrosiasw.com) and may not be redistributed separately from -the Maelstrom public GPL release. +The artwork and animations in Maelstrom may be used under the terms +of the Creative Commons Attribution 3.0 license (unported): +http://creativecommons.org/licenses/by/3.0/legalcode The following files must accompany any distribution of Maeltrom 3.0: Ambrosia_Software,_Inc._FAQ MaelstromGPL_press_release They can be found in the Docs directory. - -Copying, modifying, bundling, and burning to new ROMs is encouraged! - --- a/Maelstrom-netd.c +++ b/Maelstrom-netd.c @@ -2,6 +2,7 @@ /* Here we go... */ #include +#include #include #include #include @@ -48,7 +49,7 @@ (void) free(players[which].packet); close(players[which].sockfd); players[which].state = UNCONNECTED; -printf("Player on slot %d has been disconnected.\n", which); + printf("Player on slot %d has been disconnected.\n", which); } void SendError(int which, char *message) @@ -63,8 +64,8 @@ } mesgbuf[0] = mesglen; mesgbuf[1] = NET_ABORT; - strcpy((char *)&mesgbuf[2], message); -printf("Sending error '%s' to player in slot %d\n", message, which); + strncpy((char *)&mesgbuf[2], message, sizeof(mesgbuf)-2); + printf("Sending error '%s' to player in slot %d\n", message, which); (void) write(players[which].sockfd, mesgbuf, mesglen); DisconnectPlayer(which); @@ -124,9 +125,9 @@ if ( players[i].state != ACTIVE ) continue; if ( players[i].numplayers != numplayers ) { - sprintf(buffer, - "There are %d, not %d players in this game", - numplayers, players[i].numplayers); + snprintf(buffer, sizeof(buffer), + "There are %d, not %d players in this game", + numplayers, players[i].numplayers); SendError(i, (char *)buffer); } } @@ -154,11 +155,11 @@ for ( i=0; iraddr.sin_addr)); + strncpy(ptr, (char *)inet_ntoa(player->raddr.sin_addr), (BUFSIZ-len)); printf("Setting up player %d at host %s and port ", i+1, ptr); len += strlen(ptr)+1; ptr += strlen(ptr)+1; - sprintf(ptr, "%d", ntohs(player->raddr.sin_port)); + snprintf(ptr, (BUFSIZ-len), "%d", ntohs(player->raddr.sin_port)); printf("%s\n", ptr); len += strlen(ptr)+1; ptr += strlen(ptr)+1; @@ -342,7 +343,7 @@ if ( i != MAX_CONNECTIONS ) { char message[BUFSIZ]; - sprintf(message, "Player %d is already on!", + snprintf(message, sizeof(message), "Player %d is already on!", player+1); SendError(slot, message); continue; --- a/Makefile.in +++ b/Makefile.in @@ -27,6 +27,7 @@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ +bmpdir = @bmpdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ --- a/README +++ b/README @@ -9,7 +9,7 @@ but is recommended highly! :) The latest GPL'd version of Maelstrom is available at: - http://www.devolution.com/~slouken/Maelstrom/ + http://www.libsdl.org/projects/Maelstrom/ The original Macintosh version of this game is available at: http://www.ambrosiasw.com/ @@ -27,5 +27,5 @@ about the Maelstrom porting process. Enjoy! - -Sam Lantinga (slouken@devolution.com) + -Sam Lantinga (slouken@libsdl.org) --- a/README.options +++ b/README.options @@ -55,7 +55,8 @@ -fullscreen This option puts a big black border around the Maelstrom screen, and centers Maelstrom within it. This help create a "full screen" effect on large - displays. + displays. During the game the fullscreen mode can + be toggled using Alt+Return. -version This option prints the version of the Maelstrom binary. --- a/buttonlist.h +++ b/buttonlist.h @@ -16,7 +16,7 @@ void Add_Button(Uint16 x, Uint16 y, Uint16 width, Uint16 height, void (*callback)(void)) { - struct button *belem; + button *belem; for ( belem=&button_list; belem->next; belem=belem->next ); belem->next = new button; @@ -30,7 +30,7 @@ } void Activate_Button(Uint16 x, Uint16 y) { - struct button *belem; + button *belem; for ( belem=button_list.next; belem; belem=belem->next ) { if ( (x >= belem->x1) && (x <= belem->x2) && @@ -42,7 +42,7 @@ } void Delete_Buttons(void) { - struct button *belem, *btemp; + button *belem, *btemp; for ( belem=button_list.next; belem; ) { btemp = belem; --- a/checksum.cpp +++ b/checksum.cpp @@ -261,7 +261,7 @@ char *get_checksum(unsigned char *key, int keylen) { Unused(key); Unused(keylen); - static char *foo = "Checksum Not Enabled"; + static char *foo = (char*)"Checksum Not Enabled"; return(foo); } #endif /* USE_CHECKSUM */ --- a/configure +++ b/configure @@ -3185,11 +3185,11 @@ else { { echo "$as_me:$LINENO: error: *** Can't find the SDL_net library The SDL_net library can be found at: -http://www.devolution.com/~slouken/SDL/projects/SDL_net/ +http://www.libsdl.org/ " >&5 echo "$as_me: error: *** Can't find the SDL_net library The SDL_net library can be found at: -http://www.devolution.com/~slouken/SDL/projects/SDL_net/ +http://www.libsdl.org/ " >&2;} { (exit 1); exit 1; }; } fi --- a/controls.cpp +++ b/controls.cpp @@ -40,16 +40,16 @@ /* Add "arrow" to the arrow keys */ if ( strcmp(name, "up") == 0 ) { - name = "up arrow"; + name = (char *)"up arrow"; } else if ( strcmp(name, "down") == 0 ) { - name = "down arrow"; + name = (char *)"down arrow"; } else if ( strcmp(name, "right") == 0 ) { - name = "right arrow"; + name = (char *)"right arrow"; } else if ( strcmp(name, "left") == 0 ) { - name = "left arrow"; + name = (char *)"left arrow"; } /* Make the key names uppercased */ for ( starting = 1; *name; ++name ) { @@ -73,17 +73,17 @@ char *home; FILE *data; - if ( (home=getenv("HOME")) == NULL ) { + if ( (home = getenv("HOME")) == NULL ) { if ( strcmp(CUR_DIR, DIR_SEP) != 0 ) { - home = CUR_DIR; + home = (char *)CUR_DIR; } else { - home=""; + home = (char *)""; } } if ( fname ) { *fname = datafile; } - sprintf(datafile, "%s"DIR_SEP"%s", home, MAELSTROM_DATA); + snprintf(datafile, sizeof(datafile), "%s"DIR_SEP"%s", home, MAELSTROM_DATA); if ( (data=fopen(datafile, mode)) == NULL ) return(NULL); return(data); @@ -95,7 +95,7 @@ FILE *data; /* Open our control data file */ - data = OpenData("r", &datafile); + data = OpenData((char *)"r", &datafile); if ( data == NULL ) { return; } @@ -119,14 +119,14 @@ FILE *data; /* Don't clobber existing joystick data */ - if ( (data=OpenData("r", NULL)) != NULL ) { - newmode = "r+"; + if ( (data=OpenData((char *)"r", NULL)) != NULL ) { + newmode = (char *)"r+"; fclose(data); } else - newmode = "w"; + newmode = (char*)"w"; if ( (data=OpenData(newmode, &datafile)) == NULL ) { - error("Warning: Couldn't save controls to %s\n", datafile); + error((char*)"Warning: Couldn't save controls to %s\n", datafile); return; } @@ -157,14 +157,14 @@ int yoffset; SDLKey *control; } checkboxes[] = { - { "Fire", 0*BOX_HEIGHT+0*SP, &newcontrols.gFireControl }, - { "Thrust", 1*BOX_HEIGHT+1*SP, &newcontrols.gThrustControl }, - { "Shield", 2*BOX_HEIGHT+2*SP, &newcontrols.gShieldControl }, - { "Turn Clockwise", 3*BOX_HEIGHT+3*SP, &newcontrols.gTurnRControl }, - { "Turn Counter-Clockwise", + { (char*)"Fire", 0*BOX_HEIGHT+0*SP, &newcontrols.gFireControl }, + { (char*)"Thrust", 1*BOX_HEIGHT+1*SP, &newcontrols.gThrustControl }, + { (char*)"Shield", 2*BOX_HEIGHT+2*SP, &newcontrols.gShieldControl }, + { (char*)"Turn Clockwise", 3*BOX_HEIGHT+3*SP, &newcontrols.gTurnRControl }, + { (char*)"Turn Counter-Clockwise", 4*BOX_HEIGHT+4*SP, &newcontrols.gTurnLControl }, - { "Pause", 5*BOX_HEIGHT+5*SP, &newcontrols.gPauseControl }, - { "Abort Game", 6*BOX_HEIGHT+6*SP, &newcontrols.gQuitControl }, + { (char*)"Pause", 5*BOX_HEIGHT+5*SP, &newcontrols.gPauseControl }, + { (char*)"Abort Game", 6*BOX_HEIGHT+6*SP, &newcontrols.gQuitControl }, }; static int X=0; @@ -206,7 +206,7 @@ fontserv->FreeText(keynames[currentbox]); /* Blit the new message */ - strcpy(keyname, "That key is in use!"); + strncpy(keyname, "That key is in use!", sizeof(keyname)); keynames[currentbox] = fontserv->TextImage(keyname, chicago, STYLE_NORM, black, white); screen->QueueBlit( @@ -281,11 +281,11 @@ #endif valid = 0; cancel = new Mac_Button(291, 265, BUTTON_WIDTH, BUTTON_HEIGHT, - "Cancel", chicago, fontserv, Cancel_callback); + (char*)"Cancel", chicago, fontserv, Cancel_callback); dialog->Add_Dialog(cancel); okay = new Mac_Button(291+BUTTON_WIDTH+26, 265, BUTTON_WIDTH, BUTTON_HEIGHT, - "OK", chicago, fontserv, OK_callback); + (char*)"OK", chicago, fontserv, OK_callback); dialog->Add_Dialog(okay); memcpy(&newcontrols, &controls, sizeof(controls)); radiobuttons = new Mac_RadioList(¤tbox, X+266, Y+75, @@ -422,7 +422,7 @@ /* Special key -- Do a screen dump here. */ - screen->ScreenDump("ScreenShot", + screen->ScreenDump((char*)"ScreenShot", 0, 0, 0, 0); #ifdef MOVIE_SUPPORT } else if ( key == XK_F5 ) { @@ -496,12 +496,12 @@ void ShowDawn(void) { static char *D_text[6] = { - "No eternal reward will forgive us", - "now", - "for", - "wasting", - "the", - "dawn." + (char*)"No eternal reward will forgive us", + (char*)"now", + (char*)"for", + (char*)"wasting", + (char*)"the", + (char*)"dawn." }; MFont *chicago; SDL_Surface *splash, *text[6]; @@ -541,7 +541,7 @@ x += (text[i]->w+2); } OK = new Mac_DefaultButton(210, 160, 90, BUTTON_HEIGHT, - "OK", chicago, fontserv, NULL); + (char*)"OK", chicago, fontserv, NULL); dialog->Add_Dialog(OK); /* Run the dialog box */ --- a/dialog.cpp +++ b/dialog.cpp @@ -29,7 +29,7 @@ button = SDL_CreateRGBSurface(SDL_SWSURFACE, Width, Height, 8, 0, 0, 0, 0); if ( button == NULL ) { - SetError("%s", SDL_GetError()); + SetError((char*)"%s", SDL_GetError()); return; } button->format->palette->colors[0].r = 0xFF; --- a/dialog.h +++ b/dialog.h @@ -92,7 +92,7 @@ va_list ap; va_start(ap, fmt); - vsprintf(errbuf, fmt, ap); + vsnprintf(errbuf, sizeof(errbuf), fmt, ap); va_end(ap); errstr = errbuf; } @@ -401,11 +401,11 @@ for ( radio=&radio_list; radio->next; radio=radio->next ) /* Loop to end of radio box list */; /* Which is ANSI C++? */ -#ifdef linux - radio->next = new struct Mac_RadioList::radio; -#else +//#ifdef linux +// radio->next = new struct Mac_RadioList::radio; +//#else radio->next = new struct radio; -#endif +//#endif radio = radio->next; radio->label = Fontserv->TextImage(text, Font, STYLE_NORM, 0, 0, 0); @@ -878,7 +878,7 @@ if ( entry->text ) { Fontserv->FreeText(entry->text); } - sprintf(buf, "%d", *entry->variable); + snprintf(buf, sizeof(buf), "%d", *entry->variable); if ( entry->hilite ) { clear = Fg; --- /dev/null +++ b/icon32.xpm @@ -0,0 +1,128 @@ +/* XPM */ +static char * icon32_xpm[] = { +"32 32 93 2", +" c #FFFFFF", +". c #DEDEDE", +"+ c #D6D6D6", +"@ c #CECECE", +"# c #C6C6C6", +"$ c #BDBDBD", +"% c #B5B5B5", +"& c #ADADAD", +"* c #A5A5A5", +"= c #9C9C9C", +"- c #949494", +"; c #8C8C8C", +"> c #848484", +", c #7B7B7B", +"' c #737373", +") c #6B6B6B", +"! c #636363", +"~ c #5A5A5A", +"{ c #525252", +"] c #4A4A4A", +"^ c #424242", +"/ c #393939", +"( c #313131", +"_ c #292929", +": c #212121", +"< c #181818", +"[ c #101010", +"} c #080808", +"| c #ADA5A5", +"1 c #948C8C", +"2 c #8C8484", +"3 c #7B7373", +"4 c #847B7B", +"5 c #736B6B", +"6 c #6B6363", +"7 c #5A5252", +"8 c #524A4A", +"9 c #4A4242", +"0 c #423939", +"a c #393131", +"b c #312929", +"c c #292121", +"d c #211818", +"e c #181010", +"f c #100808", +"g c #080000", +"h c #737B7B", +"i c #7B8484", +"j c #6B7373", +"k c #636B6B", +"l c #525A5A", +"m c #5A6363", +"n c #4A5252", +"o c #424A4A", +"p c #738484", +"q c #6B7B7B", +"r c #394242", +"s c #313939", +"t c #293131", +"u c #526363", +"v c #738C8C", +"w c #212929", +"x c #5A7373", +"y c #394A4A", +"z c #638484", +"A c #4A6363", +"B c #314242", +"C c #5A7B7B", +"D c #425A5A", +"E c #182121", +"F c #293939", +"G c #4A6B6B", +"H c #395252", +"I c #426363", +"J c #101818", +"K c #314A4A", +"L c #294242", +"M c #426B6B", +"N c #315252", +"O c #396363", +"P c #427373", +"Q c #315A5A", +"R c #396B6B", +"S c #295252", +"T c #214242", +"U c #316363", +"V c #295A5A", +"W c #183939", +"X c #215252", +"Y c #081818", +"Z c #082929", +"` c #000808", +" . c #000000", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .", +" .. $ % % % % % % % % % % % % % % % % % % % % % % % % % % $ . .", +" .$ ( < < < < < < < < < < < < < < < < < < < < < < < < < < ( $ .", +" .% < . . . . . . . . . . . . .[ . . . .} . . . . . . .< % .", +" .% < . . . . . . . . . . . .[ < [ } } [ / : . . . . . .< % .", +" .% < . . . . . . .} } < { n : : ~ { : ^ / : ^ [ . . . .< % .", +" .% < . . . .} } d ( ^ ) n O ^ ^ ] 7 : ^ / < { ^ . . . .< % .", +" .% < . . .[ ] ^ U { { { ^ 8 [ } l R : 0 { ~ ^ ^ ^ ~ } .< % .", +" .% < . . .( ^ _ w o _ { 9 ' [ } { n : ^ > i 8 ^ _ { . .< % .", +" .% < . ._ / ^ ^ ^ : < e U s , : } } _ ) ^ < R l ^ / ^ } < % .", +" .% < .} : : ] ^ ^ < .} w : , _ [ < _ ] 0 [ m l : : ^ } < % .", +" .% < } / { ( _ ^ .[ ^ < .} .: ` : } : : } ( ' ( [ E } < % .", +" .% < .: ~ { ^ ] ./ [ } 0 ^ ( ^ X r ! ] ) ] { ; . .Q o [ % .", +" .% < . .E S a [ : } _ 7 R j > & 1 & > ' ' ' , ] ( ) 5 < < % .", +" .% < . . .J < < < } , ' n { > & ; - ' { ] ] ~ { ] { _ } < % .", +" .% < . . . .[ < ] * $ $ { l ^ ] / / / / ] < { > ) } . .< % .", +" .% < . . . .[ } % $ $ $ i M 8 _ _ _ : [ < .{ > ' : . .< % .", +" .% < . ._ < [ , $ $ % * } e / [ . ./ ~ - > : m 2 > . .< % .", +" .% < .[ ] < ^ ' = % ; ] .} [ } < _ > > , ~ w V 3 ) . .< % .", +" .% < .< ! ; , _ ( < . . .} : ] ! , ! ] ( [ d ) ' _ . .< % .", +" .% < .< > > , ] [ .[ [ . .' , > ; < : : ._ ' ^ } . .< % .", +" .% < . . . .: _ .} .} / , ; ; ~ : [ [ < [ P m . . . .< % .", +" .% < . . .[ ~ ' . .< } ~ = ; - : : < [ ] ( > ! . . . .< % .", +" .% < . . .< / : ^ [ w _ ; , ' ^ : : { ' , , ! ] . . . .< % .", +" .% < . . . ._ / ] 6 U h ~ { _ : ^ : ] ) > ) : _ . . . .< % .", +" .% < . . . .: / ^ ! ] ] ~ ~ } } < < ) & ~ : ) < . . . .< % .", +" .% < . . . .< _ < < b ^ > * [ [ .[ - = : : _ } . . . .< % .", +" .% < . . . . . . . . .[ ~ , ( : [ < ^ < . . . . . . . .< % .", +" .% < . . . . . . . . . .{ ~ } . . .} . . . . . . . . .< % .", +" .$ ( < < < < < < < < < < [ [ < < < < < < < < < < < < < < ( $ .", +" .. $ % % % % % % % % % % % % % % % % % % % % % % % % % % $ . .", +" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ."}; --- a/init.cpp +++ b/init.cpp @@ -735,6 +735,10 @@ } atexit(CleanUp); signal(SIGSEGV, exit); + signal(SIGTERM, exit); + signal(SIGKILL, exit); + signal(SIGHUP, exit); + signal(SIGINT, exit); // -- Initialize some variables gLastHigh = -1; @@ -780,7 +784,7 @@ error("Fatal: %s\n", screen->Error()); return(-1); } - screen->SetCaption("Maelstrom"); + screen->SetCaption((char*)"Maelstrom"); atexit(CleanUp); // Need to reset this under X11 DGA SDL_FreeSurface(icon); --- a/load.cpp +++ b/load.cpp @@ -81,7 +81,7 @@ SDL_Surface *bmp, *title; /* Open the title file -- we know its colormap is our global one */ - sprintf(file, "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id); + snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Titles#%d.bmp", title_id); bmp = SDL_LoadBMP(path.Path(file)); if ( bmp == NULL ) { return(NULL); @@ -103,7 +103,7 @@ Uint16 w, h; /* Open the cicn sprite file.. */ - sprintf(file, "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id); + snprintf(file, sizeof(file), "Images"DIR_SEP"Maelstrom_Icon#%hd.cicn", cicn_id); if ( (cicn_src=SDL_RWFromFile(path.Path(file), "r")) == NULL ) { error("GetCIcon(%hd): Can't open CICN %s: ", cicn_id, path.Path(file)); --- a/load.h +++ b/load.h @@ -16,7 +16,7 @@ newstr = (char *)malloc(strlen(str)+1); if ( newstr ) { - strcpy(newstr, str); + strncpy(newstr, str, (strlen(str)+1)); } return(newstr); } @@ -47,12 +47,20 @@ #ifndef LIBDIR #if defined(unix) || defined(__MACH__) -#define LIBDIR "/usr/local/lib/Maelstrom" +#define LIBDIR "/usr/lib/games/maelstrom" #else #define LIBDIR CUR_DIR #endif #endif /* !defined(LIBDIR) */ +#ifndef BMPDIR +#if defined(unix) || defined(__MACH__) +#define BMPDIR "/usr/share/games/maelstrom" +#else +#define BMPDIR CUR_DIR +#endif +#endif /* !defined(BMPDIR) */ + class LibPath { private: @@ -71,7 +79,7 @@ if ( exep > exepath ) { *exep = '\0'; } else { - strcpy(exepath, CUR_DIR); + strncpy(exepath, CUR_DIR, strlen(exe)); } } @@ -88,11 +96,18 @@ } const char *Path(const char *filename) { - char *directory; + const char *directory; - directory = getenv("MAELSTROM_LIB"); + directory = getenv((const char*)"MAELSTROM_LIB"); if ( directory == NULL ) { - directory = LIBDIR; + //load images from BMPDIR + if ((strstr(filename, ".bmp") != NULL) + || (strstr(filename, ".cicn") != NULL) + || (strstr(filename, ".xpm") != NULL)) { + directory = BMPDIR; + } else { + directory = LIBDIR; + } #ifndef macintosh if ( access(directory, F_OK) < 0 ) { directory = exepath; @@ -104,9 +119,9 @@ delete[] path; path = new char[strlen(directory)+1+strlen(filename)+1]; if ( strcmp(directory, DIR_SEP) == 0 ) { - sprintf(path, DIR_SEP"%s", filename); + snprintf(path, (strlen(directory)+1+strlen(filename)+1), DIR_SEP"%s", filename); } else { - sprintf(path, "%s"DIR_SEP"%s", directory, filename); + snprintf(path, (strlen(directory)+1+strlen(filename)+1), "%s"DIR_SEP"%s", directory, filename); } return(path); } --- a/maclib/Mac_FontServ.cpp +++ b/maclib/Mac_FontServ.cpp @@ -77,11 +77,11 @@ fontres = new Mac_Resource(fontfile); text_allocated = 0; if ( fontres->Error() ) { - SetError("Couldn't load resources from %s", fontfile); + SetError((char*)"Couldn't load resources from %s", fontfile); return; } if ( fontres->NumResources("FOND") == 0 ) { - SetError("FontServ: No 'FOND' resources in %s", fontfile); + SetError((char*)"FontServ: No 'FOND' resources in %s", fontfile); return; } errstr = NULL; @@ -113,7 +113,7 @@ /* Get the font family */ fond = fontres->Resource("FOND", fontname); if ( fond == NULL ) { - SetError("Warning: Font family '%s' not found", fontname); + SetError((char*)"Warning: Font family '%s' not found", fontname); return(NULL); } @@ -143,9 +143,7 @@ break; } if ( i == Fond.num_fonts ) { - SetError( - "Warning: Font family '%s' doesn't have %d pt fonts", - fontname, ptsize); + SetError((char*)"Warning: Font family '%s' doesn't have %d pt fonts", fontname, ptsize); return(NULL); } @@ -154,8 +152,7 @@ font->nfnt = fontres->Resource("NFNT", Fent.ID); if ( font->nfnt == NULL ) { delete font; - SetError( -"Warning: Can't find NFNT resource for %d pt %s font", ptsize, fontname); + SetError((char*)"Warning: Can't find NFNT resource for %d pt %s font", ptsize, fontname); return(NULL); } @@ -181,7 +178,7 @@ */ if ( ((font->header->fontType & ~3) != PROPFONT) && ((font->header->fontType & ~3) != FIXEDFONT) ) { - SetError("Warning: Bad font Magic number: 0x%04x", + SetError((char*)"Warning: Bad font Magic number: 0x%04x", (font->header)->fontType); delete font; return(NULL); @@ -277,20 +274,19 @@ int ascii, i, y; int bit; - switch (style) { - case STYLE_NORM: bold_offset = 0; - break; - case STYLE_BOLD: bold_offset = 1; - break; - case STYLE_ULINE: bold_offset = 0; - break; - case STYLE_ITALIC: SetError( - "FontServ: Italics not implemented!"); - return(NULL); - default: SetError( - "FontServ: Unknown text style!"); - return(NULL); - } + switch (style) + { + case STYLE_NORM: bold_offset = 0; + break; + case STYLE_BOLD: bold_offset = 1; + break; + case STYLE_ULINE: bold_offset = 0; + break; + case STYLE_ITALIC: SetError((char*)"FontServ: Italics not implemented!"); + return(NULL); + default: SetError((char*)"FontServ: Unknown text style!"); + return(NULL); + } /* Notes on the tables. @@ -326,7 +322,7 @@ /* Figure out how big the text image will be */ width = TextWidth(text, font, style); if ( width == 0 ) { - SetError("No text to convert"); + SetError((char*)"No text to convert"); return(NULL); } height = (font->header)->fRectHeight; @@ -334,7 +330,7 @@ /* Allocate the text bitmap image */ image = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 1, 0,0,0,0); if ( image == NULL ) { - SetError("Unable to allocate bitmap: %s", SDL_GetError()); + SetError((char*)"Unable to allocate bitmap: %s", SDL_GetError()); return(NULL); } bitmap = (Uint8 *)image->pixels; @@ -406,7 +402,7 @@ /* Only works on bitmap images */ if ( text->format->BitsPerPixel != 1 ) { - SetError("Not a text bitmap"); + SetError((char*)"Not a text bitmap"); return(-1); } --- a/maclib/Mac_FontServ.h +++ b/maclib/Mac_FontServ.h @@ -135,7 +135,7 @@ va_list ap; va_start(ap, fmt); - vsprintf(errbuf, fmt, ap); + vsnprintf(errbuf, sizeof(errbuf), fmt, ap); va_end(ap); errstr = errbuf; } --- a/maclib/Mac_Resource.cpp +++ b/maclib/Mac_Resource.cpp @@ -189,12 +189,12 @@ /* Separate the Mac name from a UNIX path */ filename = new char[strlen(*original)+1]; - strcpy(filename, *original); + strncpy(filename, *original, strlen(*original)+1); if ( (basename=strrchr(filename, '/')) != NULL ) { dirname = filename; *(basename++) = '\0'; } else { - dirname = ""; + dirname = (char*)""; basename = filename; } @@ -208,8 +208,8 @@ /* First look for Executor (tm) resource forks */ newname = new char[strlen(dirname)+2+1+strlen(basename)+1]; - sprintf(newname, "%s%s%%%s", dirname, (*dirname ? "/" : ""), - basename); + snprintf(newname, (strlen(dirname)+2+1+strlen(basename)+1), + "%s%s%%%s", dirname, (*dirname ? "/" : ""), basename); if ( (resfile=fopen(newname, "rb")) != NULL ) { break; } @@ -217,8 +217,8 @@ /* Look for MacBinary files */ newname = new char[strlen(dirname)+2+strlen(basename)+4+1]; - sprintf(newname, "%s%s%s.bin", dirname, (*dirname ? "/" : ""), - basename); + snprintf(newname, (strlen(dirname)+2+strlen(basename)+4+1), + "%s%s%s.bin", dirname, (*dirname ? "/" : ""), basename); if ( (resfile=fopen(newname, "rb")) != NULL ) { break; } @@ -226,8 +226,8 @@ /* Look for raw resource fork.. */ newname = new char[strlen(dirname)+2+strlen(basename)+1]; - sprintf(newname, "%s%s%s", dirname, (*dirname ? "/" : ""), - basename); + snprintf(newname, (strlen(dirname)+2+strlen(basename)+1), + "%s%s%s", dirname, (*dirname ? "/" : ""), basename); if ( (resfile=fopen(newname, "rb")) != NULL ) { break; } @@ -268,7 +268,7 @@ /* Try to open the Macintosh resource fork */ errstr = NULL; if ( (filep=Open_MacRes(&filename, &base)) == NULL ) { - error("Couldn't open resource file '%s'", filename); + error((char*)"Couldn't open resource file '%s'", filename); return; } else { /* Open_MacRes() passes back the real name of resource file */ @@ -277,7 +277,7 @@ fseek(filep, base, SEEK_SET); if ( ! fread(&Header, sizeof(Header), 1, filep) ) { - error("Couldn't read resource info from '%s'", filename); + error((char*)"Couldn't read resource info from '%s'", filename); return; } bytesex32(Header.res_length); @@ -288,7 +288,7 @@ fseek(filep, base+Header.map_offset, SEEK_SET); if ( ! fread(&Map, sizeof(Map), 1, filep) ) { - error("Couldn't read resource info from '%s'", filename); + error((char*)"Couldn't read resource info from '%s'", filename); return; } bytesex16(Map.types_offset); @@ -306,7 +306,7 @@ fseek(filep, base+Header.map_offset+Map.types_offset+2, SEEK_SET); for ( i=0; idata = new Uint8[d->length]; if (!fread(d->data,d->length,1,filep)) { delete[] d->data; - error("Couldn't read %d bytes", d->length); + error((char*)"Couldn't read %d bytes", d->length); delete d; return(NULL); } @@ -488,7 +488,7 @@ } } } - error("Couldn't find resource of type '%s', id %hu", res_type, id); + error((char*)"Couldn't find resource of type '%s', id %hu", res_type, id); return(NULL); } @@ -515,7 +515,7 @@ d->data = new Uint8[d->length]; if (!fread(d->data,d->length,1,filep)) { delete[] d->data; - error("Couldn't read %d bytes", d->length); + error((char*)"Couldn't read %d bytes", d->length); delete d; return(NULL); } @@ -525,7 +525,7 @@ } } } - error("Couldn't find resource of type '%s', name %s", res_type, name); + error((char*)"Couldn't find resource of type '%s', name %s", res_type, name); return(NULL); } --- a/maclib/Mac_Resource.h +++ b/maclib/Mac_Resource.h @@ -96,7 +96,7 @@ va_list ap; va_start(ap, fmt); - vsprintf(errbuf, fmt, ap); + vsnprintf(errbuf, BUFSIZ, fmt, ap); va_end(ap); errstr = errbuf; } --- a/maclib/Mac_Sound.cpp +++ b/maclib/Mac_Sound.cpp @@ -107,11 +107,11 @@ /* Load the sounds from the resource files */ soundres = new Mac_Resource(soundfile); if ( soundres->Error() ) { - error("%s", soundres->Error()); + error((char*)"%s", soundres->Error()); return; } if ( soundres->NumResources("snd ") == 0 ) { - error("No sound resources in '%s'", soundfile); + error((char*)"No sound resources in '%s'", soundfile); return; } ids = soundres->ResourceIDs("snd "); @@ -119,13 +119,13 @@ for ( i=0; ids[i] != 0xFFFF; ++i ) { snd = soundres->Resource("snd ", ids[i]); if ( snd == NULL ) { - error("%s", soundres->Error()); + error((char*)"%s", soundres->Error()); delete soundres; return; } wave = new Wave(snd, DSP_FREQUENCY); if ( wave->Error() ) { - error("%s", wave->Error()); + error((char*)"%s", wave->Error()); delete wave; delete soundres; return; --- a/maclib/Mac_Sound.h +++ b/maclib/Mac_Sound.h @@ -199,7 +199,7 @@ va_list ap; va_start(ap, fmt); - vsprintf(errbuf, fmt, ap); + vsnprintf(errbuf, sizeof(errbuf), fmt, ap); va_end(ap); errstr = errbuf; } --- a/maclib/Mac_Wave.cpp +++ b/maclib/Mac_Wave.cpp @@ -114,7 +114,7 @@ /* Load the WAVE file */ if ( SDL_LoadWAV(wavefile, &spec, &samples, &sound_datalen) == NULL ) { - error("%s", SDL_GetError()); + error((char*)"%s", SDL_GetError()); return(-1); } /* Copy malloc()'d data to new'd data */ @@ -179,12 +179,12 @@ snd_copy16(n_types, data); if ( n_types != 1 ) { - error("Multi-type sound not supported"); + error((char*)"Multi-type sound not supported"); return(-1); } snd_copy16(f_type, data); if ( f_type != SAMPLED_SND ) { - error("Not a sampled sound resource"); + error((char*)"Not a sampled sound resource"); return(-1); } snd_copy32(init_op, data); @@ -193,7 +193,7 @@ snd_copy16(ref_cnt, data); } else { - error("Unknown sound format: 0x%X", snd_version); + error((char*)"Unknown sound format: 0x%X", snd_version); return(-1); } @@ -206,12 +206,12 @@ snd_copy16(num_cmds, data); if ( num_cmds != 1 ) { - error("Multi-command sound not supported"); + error((char*)"Multi-command sound not supported"); return(-1); } snd_copy16(command, data); if ( (command != BUFFER_CMD) && (command != SOUND_CMD) ) { - error("Unknown sound command: 0x%X\n", command); + error((char*)"Unknown sound command: 0x%X\n", command); return(-1); } snd_copy16(param1, data); @@ -220,7 +220,7 @@ snd_copy32(param2, data); /* Set 'data' to the offset of the sampled data */ if ( param2 > snd->length ) { - error("Offset too large -- corrupt sound?"); + error((char*)"Offset too large -- corrupt sound?"); return(-1); } data = snd->data+param2; @@ -238,7 +238,7 @@ snd_copy32(sample_offset, data); /* FIXME: What's the interpretation of this offset? */ if ( sample_offset != 0 ) { - error("Sound samples don't immediately follow header"); + error((char*)"Sound samples don't immediately follow header"); return(-1); } snd_copy32(num_samples, data); @@ -248,7 +248,7 @@ snd_copy32(loop_end, data); encoding = *data++; if ( encoding != stdSH ) { - error("Non-standard sound encoding: 0x%X", encoding); + error((char*)"Non-standard sound encoding: 0x%X", encoding); return(-1); } /* Frequency base might be used later */ @@ -256,7 +256,7 @@ /* Now allocate room for the sound */ if ( num_samples > snd->length-(data-snd->data) ) { - error("truncated sound resource"); + error((char*)"truncated sound resource"); return(-1); } @@ -528,7 +528,7 @@ /* Open the WAV file for writing */ dst = SDL_RWFromFile(wavefile, "wb"); if ( dst == NULL ) { - error("Couldn't open %s for writing", wavefile); + error((char*)"Couldn't open %s for writing", wavefile); return(-1); } @@ -563,7 +563,7 @@ ! SDL_WriteLE32(dst, sound_datalen) || ! SDL_RWwrite(dst, sound_data, sound_datalen, 1) || (SDL_RWclose(dst) != 0) ) { - error("Couldn't write to %s", wavefile); + error((char*)"Couldn't write to %s", wavefile); SDL_RWclose(dst); return(-1); } --- a/maclib/Mac_Wave.h +++ b/maclib/Mac_Wave.h @@ -108,7 +108,7 @@ va_list ap; va_start(ap, fmt); - vsprintf(errbuf, fmt, ap); + vsnprintf(errbuf, sizeof(errbuf), fmt, ap); va_end(ap); errstr = errbuf; } --- a/maclib/macres.cpp +++ b/maclib/macres.cpp @@ -58,7 +58,7 @@ ids[j], res->ResourceName(types[i], ids[j])); if ( argv[2] ) { char path[23]; - sprintf(path,"%s/%s:%hu", argv[2], + snprintf(path,sizeof(path),"%s/%s:%hu", argv[2], types[i], ids[j]); FILE *output; Mac_ResData *D; --- a/maclib/snd2wav.cpp +++ b/maclib/snd2wav.cpp @@ -82,7 +82,7 @@ continue; } wave.Load(snd, rate); - sprintf(wavname, "snd_%d.wav", ids[i]); + snprintf(wavname, sizeof(wavname), "snd_%d.wav", ids[i]); wave.Save(wavname); } delete macx; --- a/main.cpp +++ b/main.cpp @@ -20,7 +20,7 @@ extern int DoInitializations(Uint32 video_flags); /* init.cc */ static char *Version = -"Maelstrom v1.4.3 (GPL version 3.0.6) -- 10/19/2002 by Sam Lantinga\n"; +(char*)"Maelstrom v1.4.3 (GPL version 3.0.6) -- 10/19/2002 by Sam Lantinga\n"; // Global variables set in this file... int gStartLives; @@ -192,6 +192,7 @@ } /* Parse command line arguments */ + video_flags &= ~SDL_FULLSCREEN; for ( progname=argv[0]; --argc; ++argv ) { if ( strcmp(argv[1], "-fullscreen") == 0 ) { video_flags |= SDL_FULLSCREEN; @@ -370,7 +371,7 @@ /* -- Create a screen dump of high scores */ case SDLK_F3: - screen->ScreenDump("ScoreDump", + screen->ScreenDump((char*)"ScoreDump", 64, 48, 298, 384); break; @@ -445,7 +446,7 @@ DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD, 0x00, 0x00, 0x00); } - sprintf(text, "%d", gSoundLevel); + snprintf(text, sizeof(text), "%d", gSoundLevel); DrawText(xOff+309-7, yOff+240-6, text, geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); screen->Update(); @@ -515,14 +516,14 @@ error("Can't use New York (18) font! -- Exiting.\n"); exit(255); } - DrawText(xOff+5, botDiv+22, "Name", bigfont, STYLE_ULINE, + DrawText(xOff+5, botDiv+22, (char*)"Name", bigfont, STYLE_ULINE, 0xFF, 0xFF, 0x00); sRt = xOff+185; - DrawText(sRt, botDiv+22, "Score", bigfont, STYLE_ULINE, + DrawText(sRt, botDiv+22, (char*)"Score", bigfont, STYLE_ULINE, 0xFF, 0xFF, 0x00); sRt += fontserv->TextWidth("Score", bigfont, STYLE_ULINE); wRt = xOff+245; - DrawText(wRt, botDiv+22, "Wave", bigfont, STYLE_ULINE, + DrawText(wRt, botDiv+22, (char*)"Wave", bigfont, STYLE_ULINE, 0xFF, 0xFF, 0x00); wRt += fontserv->TextWidth("Wave", bigfont, STYLE_ULINE)-10; @@ -547,20 +548,20 @@ } DrawText(xOff+5, botDiv+42+(index*18), hScores[index].name, font, STYLE_BOLD, R, G, B); - sprintf(buffer, "%u", hScores[index].score); + snprintf(buffer, sizeof(buffer), "%u", hScores[index].score); sw = fontserv->TextWidth(buffer, font, STYLE_BOLD); DrawText(sRt-sw, botDiv+42+(index*18), buffer, font, STYLE_BOLD, R, G, B); - sprintf(buffer, "%u", hScores[index].wave); + snprintf(buffer, sizeof(buffer), "%u", hScores[index].wave); sw = fontserv->TextWidth(buffer, font, STYLE_BOLD); DrawText(wRt-sw, botDiv+42+(index*18), buffer, font, STYLE_BOLD, R, G, B); } delete font; - DrawText(xOff+5, botDiv+46+(10*18)+3, "Last Score: ", + DrawText(xOff+5, botDiv+46+(10*18)+3, (char*)"Last Score: ", bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF); - sprintf(buffer, "%d", GetScore()); + snprintf(buffer, sizeof(buffer), "%d", GetScore()); sw = fontserv->TextWidth("Last Score: ", bigfont, STYLE_NORM); DrawText(xOff+5+sw, botDiv+46+(index*18)+3, buffer, bigfont, STYLE_NORM, 0xFF, 0xFF, 0xFF); @@ -571,50 +572,50 @@ pt.h = rightDiv + 10; pt.v = yOff + 10; - DrawKey(&pt, "P", " Start playing Maelstrom", RunPlayGame); + DrawKey(&pt, (char*)"P", (char*)" Start playing Maelstrom", RunPlayGame); pt.h = rightDiv + 10; pt.v += offset; - DrawKey(&pt, "C", " Configure the game controls", RunConfigureControls); + DrawKey(&pt, (char*)"C", (char*)" Configure the game controls", RunConfigureControls); pt.h = rightDiv + 10; pt.v += offset; - DrawKey(&pt, "Z", " Zap the high scores", RunZapScores); + DrawKey(&pt, (char*)"Z", (char*)" Zap the high scores", RunZapScores); pt.h = rightDiv + 10; pt.v += offset; - DrawKey(&pt, "A", " About Maelstrom...", RunDoAbout); + DrawKey(&pt, (char*)"A", (char*)" About Maelstrom...", RunDoAbout); pt.v += offset; pt.h = rightDiv + 10; pt.v += offset; - DrawKey(&pt, "Q", " Quit Maelstrom", RunQuitGame); + DrawKey(&pt, (char*)"Q", (char*)" Quit Maelstrom", RunQuitGame); pt.h = rightDiv + 10; pt.v += offset; - DrawKey(&pt, "0", " ", DecrementSound); + DrawKey(&pt, (char*)"0", (char*)" ", DecrementSound); if ( (font = fontserv->NewFont("Geneva", 9)) == NULL ) { error("Can't use Geneva font! -- Exiting.\n"); exit(255); } - DrawText(pt.h+gKeyIcon->w+3, pt.v+19, "-", + DrawText(pt.h+gKeyIcon->w+3, pt.v+19, (char*)"-", font, STYLE_NORM, 0xFF, 0xFF, 0x00); pt.h = rightDiv + 50; - DrawKey(&pt, "8", " Set Sound Volume", IncrementSound); + DrawKey(&pt, (char*)"8", (char*)" Set Sound Volume", IncrementSound); /* -- Draw the credits */ - DrawText(xOff+5+68, yOff+5+127, "Port to Linux by Sam Lantinga", + DrawText(xOff+5+68, yOff+5+127, (char*)"Port to Linux by Sam Lantinga", font, STYLE_BOLD, 0xFF, 0xFF, 0x00); - DrawText(rightDiv+10, yOff+259, "©1992-4 Ambrosia Software, Inc.", + DrawText(rightDiv+10, yOff+259, (char*)"©1992-4 Ambrosia Software, Inc.", font, STYLE_BOLD, 0xFF, 0xFF, 0xFF); /* -- Draw the version number */ - DrawText(xOff+20, yOff+151, VERSION_STRING, + DrawText(xOff+20, yOff+151, (char*)VERSION_STRING, font, STYLE_NORM, 0xFF, 0xFF, 0xFF); delete font; @@ -672,7 +673,7 @@ if ( message ) { DrawText(xOff, 25, message, font, STYLE_BOLD, 0xCC,0xCC,0xCC); last_message = new char[strlen(message)+1]; - strcpy(last_message, message); + strncpy(last_message, message, strlen(message)); } else { last_message = new char[1]; last_message[0] = '\0'; --- a/myerror.cpp +++ b/myerror.cpp @@ -10,34 +10,34 @@ #include -void error(char *fmt, ...) +void error(const char *fmt, ...) { char mesg[BUFSIZ]; va_list ap; va_start(ap, fmt); - vsprintf(mesg, fmt, ap); + vsnprintf(mesg, BUFSIZ, fmt, ap); fputs(mesg, stderr); va_end(ap); } -void mesg(char *fmt, ...) +void mesg(const char *fmt, ...) { char mesg[BUFSIZ]; va_list ap; va_start(ap, fmt); - vsprintf(mesg, fmt, ap); + vsnprintf(mesg, BUFSIZ, fmt, ap); fputs(mesg, stdout); va_end(ap); } -void myperror(char *msg) +void myperror(const char *msg) { char buffer[BUFSIZ]; if ( *msg ) { - sprintf(buffer, "%s: %s\n", msg, strerror(errno)); + snprintf(buffer, BUFSIZ, "%s: %s\n", msg, strerror(errno)); error(buffer); } else error((char *)strerror(errno)); --- a/myerror.h +++ b/myerror.h @@ -4,9 +4,9 @@ /* Generic error message routines */ -extern void error(char *fmt, ...); -extern void mesg(char *fmt, ...); -extern void myperror(char *msg); +extern void error(const char *fmt, ...); +extern void mesg(const char *fmt, ...); +extern void myperror(const char *msg); #endif /* _myerror_h */ --- a/netlogic/game.cpp +++ b/netlogic/game.cpp @@ -200,24 +200,24 @@ screen->DrawLine(0, gStatusLine, SCREEN_WIDTH-1, gStatusLine, ourWhite); x = 3; - i = DrawText(x, gStatusLine+11, "Score:", geneva, STYLE_BOLD, + i = DrawText(x, gStatusLine+11, (char*)"Score:", geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); x += (i+70); - i = DrawText(x, gStatusLine+11, "Shield:", geneva, STYLE_BOLD, + i = DrawText(x, gStatusLine+11, (char*)"Shield:", geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); x += (i+70); - i = DrawText(x, gStatusLine+11, "Wave:", geneva, STYLE_BOLD, + i = DrawText(x, gStatusLine+11, (char*)"Wave:", geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); x += (i+30); - i = DrawText(x, gStatusLine+11, "Lives:", geneva, STYLE_BOLD, + i = DrawText(x, gStatusLine+11, (char*)"Lives:", geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); x += (i+30); - DrawText(x, gStatusLine+11, "Bonus:", geneva, STYLE_BOLD, + DrawText(x, gStatusLine+11, (char*)"Bonus:", geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); /* Heh, DOOM style frag count */ if ( gNumPlayers > 1 ) { x = 530; - i = DrawText(x, gStatusLine+11, "Frags:", geneva, + i = DrawText(x, gStatusLine+11, (char*)"Frags:", geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); fragoff = x+i+4; } @@ -232,9 +232,9 @@ lastDisplayed = gDisplayed; screen->FillRect(0, 0, SCREEN_WIDTH, 12, ourBlack); - sprintf(caption, - "You are player %d --- displaying player %d", - gOurPlayer+1, gDisplayed+1); + snprintf(caption, sizeof(caption), + "You are player %d --- displaying player %d", + gOurPlayer+1, gDisplayed+1); DrawText(SPRITES_WIDTH, 11, caption, geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); @@ -357,7 +357,7 @@ /* -- Erase old and draw new score */ screen->FillRect(45, gStatusLine+1, score_width, text_height, ourBlack); - sprintf(numbuf, "%d", Score); + snprintf(numbuf, sizeof(numbuf), "%d", Score); score_width = DrawText(45, gStatusLine+11, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); @@ -380,7 +380,7 @@ if (lastWave != gWave) { screen->FillRect(255, gStatusLine+1, wave_width, text_height, ourBlack); - sprintf(numbuf, "%d", gWave); + snprintf(numbuf, sizeof(numbuf), "%d", gWave); wave_width = DrawText(255, gStatusLine+11, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); @@ -391,7 +391,7 @@ if (lastLives != Lives) { screen->FillRect(319, gStatusLine+1, lives_width, text_height, ourBlack); - sprintf(numbuf, "%-3.1d", Lives); + snprintf(numbuf, sizeof(numbuf), "%-3.1d", Lives); lives_width = DrawText(319, gStatusLine+11, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); @@ -402,7 +402,7 @@ if (lastBonus != Bonus) { screen->FillRect(384, gStatusLine+1, bonus_width, text_height, ourBlack); - sprintf(numbuf, "%-7.1d", Bonus); + snprintf(numbuf, sizeof(numbuf), "%-7.1d", Bonus); bonus_width = DrawText(384, gStatusLine+11, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); @@ -414,7 +414,7 @@ if (lastFrags != Frags) { screen->FillRect(fragoff, gStatusLine+1, frags_width, text_height, ourBlack); - sprintf(numbuf, "%-3.1d", Frags); + snprintf(numbuf, sizeof(numbuf), "%-3.1d", Frags); frags_width = DrawText(fragoff, gStatusLine+11, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); @@ -747,9 +747,9 @@ for ( i=0; i>8, 30000>>8, 0xFF); @@ -783,7 +783,8 @@ for ( i = 8; i >= which ; --i ) { hScores[i + 1].score = hScores[i].score; hScores[i + 1].wave = hScores[i].wave; - strcpy(hScores[i+1].name, hScores[i].name); + ;/* copy to same type should be safe, but anyway */ + strncpy(hScores[i+1].name, hScores[i].name, sizeof(hScores[i+1].name)); } /* -- Draw the "Enter your name" string */ @@ -794,7 +795,7 @@ newyork_height = fontserv->TextHeight(newyork); x = (SCREEN_WIDTH-(fontserv->TextWidth("Enter your name: ", newyork, STYLE_NORM)*2))/2; - x += DrawText(x, 300, "Enter your name: ", + x += DrawText(x, 300, (char*)"Enter your name: ", newyork, STYLE_NORM, 30000>>8, 30000>>8, 0xFF); screen->Update(); @@ -852,7 +853,7 @@ hScores[which].wave = gWave; hScores[which].score = OurShip->GetScore(); - strcpy(hScores[which].name, handle); + strncpy(hScores[which].name, handle, sizeof(hScores[i+1].name)); sound->HaltSound(); sound->PlaySound(gGotPrize, 6); @@ -898,7 +899,7 @@ /* -- Draw the wave completed message */ - sprintf(numbuf, "Wave %d completed.", gWave); + snprintf(numbuf, sizeof(numbuf), "Wave %d completed.", gWave); sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD); x = (SCREEN_WIDTH - sw) / 2; DrawText(x, 150, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00); @@ -906,14 +907,14 @@ /* -- Draw the bonus */ sw = fontserv->TextWidth("Bonus Score: ", geneva, STYLE_BOLD); x = ((SCREEN_WIDTH - sw) / 2) - 20; - DrawText(x, 200, "Bonus Score: ", geneva, STYLE_BOLD, + DrawText(x, 200, (char*)"Bonus Score: ", geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); xt = x+sw; /* -- Draw the score */ sw = fontserv->TextWidth("Score: ", geneva, STYLE_BOLD); x = ((SCREEN_WIDTH - sw) / 2) - 3; - DrawText(x, 220, "Score: ", geneva, STYLE_BOLD, + DrawText(x, 220, (char*)"Score: ", geneva, STYLE_BOLD, 30000>>8, 30000>>8, 0xFF); xs = x+sw; screen->Update(); @@ -935,7 +936,7 @@ if (OurShip->GetBonusMult() != 1) { SDL_Surface *sprite; - sprintf(numbuf, "%-5.1d", OurShip->GetBonus()); + snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus()); DrawText(x, 200, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); x += 75; @@ -951,10 +952,10 @@ Delay(SOUND_DELAY); sound->PlaySound(gFunk, 5); - sprintf(numbuf, "%-5.1d", OurShip->GetBonus()); + snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus()); bonus_width = DrawText(x, 200, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); - sprintf(numbuf, "%-5.1d", OurShip->GetScore()); + snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore()); score_width = DrawText(xt, 220, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); screen->Update(); @@ -997,12 +998,12 @@ screen->FillRect(x, 200-text_height+2, bonus_width, text_height, ourBlack); - sprintf(numbuf, "%-5.1d", OurShip->GetBonus()); + snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetBonus()); bonus_width = DrawText(x, 200, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); screen->FillRect(xt, 220-text_height+2, score_width, text_height, ourBlack); - sprintf(numbuf, "%-5.1d", OurShip->GetScore()); + snprintf(numbuf, sizeof(numbuf), "%-5.1d", OurShip->GetScore()); score_width = DrawText(xt, 220, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0xFF); @@ -1015,7 +1016,7 @@ HandleEvents(10); /* -- Draw the "next wave" message */ - sprintf(numbuf, "Prepare for Wave %d...", gWave+1); + snprintf(numbuf, sizeof(numbuf), "Prepare for Wave %d...", gWave+1); sw = fontserv->TextWidth(numbuf, geneva, STYLE_BOLD); x = (SCREEN_WIDTH - sw)/2; DrawText(x, 259, numbuf, geneva, STYLE_BOLD, 0xFF, 0xFF, 0x00); --- a/netlogic/netplay.cpp +++ b/netlogic/netplay.cpp @@ -210,7 +210,7 @@ } /* Add ourselves if needed */ if ( gNumPlayers == 0 ) { - AddPlayer("1"); + AddPlayer((char*)"1"); gNumPlayers = 1; FoundUs = 1; } @@ -506,16 +506,16 @@ char *message = NULL; /* Our address server connection is through TCP */ - Message("Connecting to Address Server"); + Message((char*)"Connecting to Address Server"); sock = SDLNet_TCP_Open(&ServAddr); if ( sock == NULL ) { - ErrorMessage("Connection failed"); + ErrorMessage((char*)"Connection failed"); return(-1); } socketset = SDLNet_AllocSocketSet(1); if ( socketset == NULL ) { status = -1; - message = "Couldn't create socket set"; + message = (char*)"Couldn't create socket set"; goto done; } SDLNet_TCP_AddSocket(socketset, sock); @@ -528,11 +528,11 @@ len += 1; if ( SDLNet_TCP_Send(sock, sendbuf, len) != len ) { status = -1; - message = "Socket write error"; + message = (char*)"Socket write error"; goto done; } - Message("Waiting for other players"); + Message((char*)"Waiting for other players"); status = 0; len = 0; lenread = 0; @@ -558,7 +558,7 @@ if ( len <= 0 ) { waiting = 0; status = -1; - message = "Error reading player addresses"; + message = (char*)"Error reading player addresses"; continue; } lenread += len; @@ -570,7 +570,7 @@ if ( netbuf[0] <= 1 ) { waiting = 0; status = -1; - message = "Error: Short server packet!"; + message = (char*)"Error: Short server packet!"; continue; } switch ( netbuf[1] ) { @@ -667,10 +667,10 @@ /* Wait for Ack's */ for ( nleft=gNumPlayers, n=0; nleft; ) { /* Show a status */ - strcpy(message, "Waiting for players:"); + strncpy(message, "Waiting for players:", sizeof(message)); for ( i=0; i 0 ) { @@ -121,7 +121,7 @@ int i; char netbuf[1024], *ptr; - remote = Goto_ScoreServer(SCORE_HOST, SCORE_PORT); + remote = Goto_ScoreServer((char*)SCORE_HOST, SCORE_PORT); if ( remote == NULL ) { error( "Warning: Couldn't connect to Maelstrom Score Server.\r\n"); @@ -132,7 +132,7 @@ SDLNet_TCP_Recv(remote, netbuf, 1024); /* Send our request */ - strcpy(netbuf, "SHOWSCORES\n"); + strncpy(netbuf, "SHOWSCORES\n", sizeof(netbuf)); SDLNet_TCP_Send(remote, netbuf, strlen(netbuf)); /* Read the response */ @@ -144,7 +144,7 @@ perror("Read error on socket stream"); break; } - strcpy(hScores[i].name, "Invalid Name"); + strncpy(hScores[i].name, "Invalid Name", sizeof(hScores[i].name)); for ( ptr = netbuf; *ptr; ++ptr ) { if ( *ptr == '\t' ) { /* This is just to remove trailing whitespace --- a/scores.cpp +++ b/scores.cpp @@ -15,7 +15,7 @@ #include "load.h" #include "dialog.h" -#define MAELSTROM_SCORES "Maelstrom-Scores" +#define MAELSTROM_SCORES "/var/games/Maelstrom-Scores" #define NUM_SCORES 10 // Do not change this! /* Everyone can write to scores file if defined to 0 */ @@ -38,13 +38,13 @@ if ( NetLoadScores() == 0 ) return; else { - mesg("Using local score file\n\n"); + mesg((char *)"Using local score file\n\n"); gNetScores = 0; } } memset(&hScores, 0, sizeof(hScores)); - scores_src = SDL_RWFromFile(path.Path(MAELSTROM_SCORES), "rb"); + scores_src = SDL_RWFromFile(MAELSTROM_SCORES, "rb"); if ( scores_src != NULL ) { for ( i=0; iAdd_Image(splash, 4, 4); do_clear = 0; clear = new Mac_Button(99, 74, BUTTON_WIDTH, BUTTON_HEIGHT, - "Clear", chicago, fontserv, Clear_callback); + (char*)"Clear", chicago, fontserv, Clear_callback); dialog->Add_Dialog(clear); cancel = new Mac_DefaultButton(99+BUTTON_WIDTH+14, 74, BUTTON_WIDTH, BUTTON_HEIGHT, - "Cancel", chicago, fontserv, Cancel_callback); + (char*)"Cancel", chicago, fontserv, Cancel_callback); dialog->Add_Dialog(cancel); /* Run the dialog box */ @@ -185,17 +185,17 @@ int GetStartLevel(void) { - static char *Ltext1 = + static const char *Ltext1 = "Enter the level to start from (1-40). This"; - static char *Ltext2 = + static const char *Ltext2 = "disqualifies you from a high score..."; - static char *Ltext3 = "Level:"; - static char *Ltext4 = "Lives:"; + static const char *Ltext3 = "Level:"; + static const char *Ltext4 = "Lives:"; MFont *chicago; Maclike_Dialog *dialog; SDL_Surface *splash; SDL_Surface *text1, *text2, *text3, *text4; - static char *turbotext = "Turbofunk On"; + static char *turbotext = (char*)"Turbofunk On"; int x, y, X, Y; Mac_Button *doit; Mac_Button *cancel; @@ -204,8 +204,8 @@ int startlevel=10, startlives=5, turbofunk=0; /* Set up all the components of the dialog box */ - if ( (chicago = fontserv->NewFont("Chicago", 12)) == NULL ) { - error("Can't use Chicago font!\n"); + if ( (chicago = fontserv->NewFont((const char*)"Chicago", 12)) == NULL ) { + error((const char*)"Can't use Chicago font!\n"); return(0); } if ( (splash = GetCIcon(screen, 103)) == NULL ) { @@ -228,10 +228,10 @@ dialog->Add_Image(text2, x, y); do_level = 0; cancel = new Mac_Button(166, 96, 73, BUTTON_HEIGHT, - "Cancel", chicago, fontserv, Cancel2_callback); + (char *)"Cancel", chicago, fontserv, Cancel2_callback); dialog->Add_Dialog(cancel); doit = new Mac_DefaultButton(166+73+14, 96, BUTTON_WIDTH, BUTTON_HEIGHT, - "Do it!", chicago, fontserv, Level_callback); + (char *)"Do it!", chicago, fontserv, Level_callback); dialog->Add_Dialog(doit); numeric_entry = new Mac_NumericEntry(X, Y, chicago, fontserv); numeric_entry->Add_Entry(78, 60, 3, 1, &startlevel); --- a/screenlib/SDL_FrameBuf.cpp +++ b/screenlib/SDL_FrameBuf.cpp @@ -103,12 +103,12 @@ //video_flags |= SDL_ANYFORMAT; screenfg = SDL_SetVideoMode(width, height, 8, video_flags); if ( screenfg == NULL ) { - SetError("Couldn't set %dx%d video mode: %s", + SetError((char*)"Couldn't set %dx%d video mode: %s", width, height, SDL_GetError()); return(-1); } FocusFG(); - PrintSurface("Created foreground", screenfg); + PrintSurface((char*)"Created foreground", screenfg); /* Create the background */ screenbg = SDL_CreateRGBSurface(screen->flags, screen->w, screen->h, @@ -117,10 +117,10 @@ screen->format->Gmask, screen->format->Bmask, 0); if ( screenbg == NULL ) { - SetError("Couldn't create background: %s", SDL_GetError()); + SetError((char*)"Couldn't create background: %s", SDL_GetError()); return(-1); } - PrintSurface("Created background", screenbg); + PrintSurface((char*)"Created background", screenbg); /* Create a dirty rectangle map of the screen */ dirtypitch = LOWER_PREC(width); @@ -628,7 +628,7 @@ found = 0; for ( which=0; !found; ++which ) { - sprintf(file, "%s%d.bmp", prefix, which); + snprintf(file, sizeof(file), "%s%d.bmp", prefix, which); if ( ((fp=fopen(file, "r")) == NULL) && ((fp=fopen(file, "w")) != NULL) ) { found = 1; @@ -639,7 +639,7 @@ } retval = SDL_SaveBMP(dump, file); if ( retval < 0 ) { - SetError("%s", SDL_GetError()); + SetError((char*)"%s", SDL_GetError()); } FreeImage(dump); } else { @@ -662,7 +662,7 @@ screenfg->format->Gmask, screenfg->format->Bmask, 0); if ( artwork == NULL ) { - SetError("Couldn't create artwork: %s", SDL_GetError()); + SetError((char*)"Couldn't create artwork: %s", SDL_GetError()); return(NULL); } @@ -845,14 +845,13 @@ newlist = new SDL_Rect[updatemax+UPDATE_CHUNK]; memcpy(newlist,updatelist,updatelen*sizeof(SDL_Rect)); /* Update the dirty rectangle map with the new list */ - for ( i=0; i XSBC-Original-Maintainer: Debian QA Group Homepage: http://www.libsdl.org/projects/Maelstrom/ Standards-Version: 3.9.6 Build-Depends: debhelper (>= 9), libsdl1.2-dev, libsdl-net1.2-dev, autotools-dev Package: maelstrom Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: An arcade-style game resembling Asteroids. This is a port of the high-resolution "asteroids" style arcade game written by Andrew Welch for the Macintosh. It is now freely supported with additional network play on the Linux platform, courtesy of Sam Lantinga (slouken@libsdl.org). debian/maelstrom.60000664000000000000000000000761212611662357011301 0ustar .TH MAELSTROM 6 29-Dec-1996 .SH NAME Maelstrom \- an arcade-style game resembling Asteroids .SH SYNOPSIS Maelstrom .RI [ options ] .PP Maelstrom [-netscores] -printscores .SH DESCRIPTION This is a Linux port of the Macintosh game by the same name. This version is remarkably faithful to the original. .PP You pilot your ship through the dreaded "Maelstrom" asteroid belt -- suddenly your best friend thrusts towards you and fires, directly at your cockpit. You raise your shields just in time, and the battle is joined. The deadliest stretch of space known to mankind has just gotten deadlier. Everywhere massive asteroids jostle for a chance to crush your ship, and deadly Shenobi fighter patrols pursue you across the asteroid belt. But the deadliest of them all is your sister ship, assigned to you on patrol. The pilot, trained by your own Navy, battle-hardened by months in the Maelstrom, is equipped with a twin of your own ship and intimate knowledge of your tactics. The lovely Stratocaster R&R facility never sounded so good, but as you fire full thrusters to dodge the latest barrage you begin to think you'll never get home... .SH OPTIONS .TP .RI "-display " host:0 Runs Maelstrom on the given X11 display. .TP -fullscreen Puts a big black border around the Maelstrom screen, and centers Maelstrom within it. This help create a "full screen" effect on large displays. During the game the screen mode can be toggled using Alt+Return. .TP -privatecmap Runs Maelstrom with a private (custom) colormap. This prevents Maelstrom from locking up all of the colors on your display. It is only useful on 256 color (pseudo-color) displays. .TP -gamma [0-8] Sets the gamma correction level for Maelstrom. The higher the gamma correction, the brighter Maelstrom will appear on your monitor. If no gamma level is given, Maelstrom will print the current gamma level saved in your custom configuration. Once this option is used, the gamma correction level is saved, and this option doesn't need to be used later unless you want to change it again. .TP -volume [0-8] Sets the sound volume. .TP -nofade Prevents Maelstrom from doing the screen fading. This is useful if you find the fading annoying. .TP -realfade Causes the entire display to fade, not just inside the Maelstrom window. .TP -netscores Tells Maelstrom to use the Internet Maelstrom Score Server for the high score list. .TP -printscores Prints out a list of the current high scores. If used with the -netscores option, it will will connect to the Internet Maelstrom Score Server and print out the world-wide Maelstrom high scores. .TP -player N[@host][:port] Tells Maelstrom that it is playing a network game, and that player .I N is at host .I host and/or port .IR port . .TP -server N@host[:port] Tells Maelstrom to use a network address server at host .I host (and port .IR port ) for a multiplayer game with .I N players. .TP -deathmatch [N] Configures a multiplayer game to continue until someone gets .I N frags (default = 8). A frag is 3 shots at a player. .TP -version Prints the version of the Maelstrom binary. .TP -speedtest Runs Maelstrom in a graphics test mode. It prints the number of milliseconds it takes for your graphics display to display a full 48-frame, 360 degree rotation of your ship. It is for comparative information only. .SH NOTES .B maelstrom is an alias for .BR Maelstrom ; you may use either to start the game. .PP .B Maelstrom_sound is the Maelstrom sound server. You do not need (nor should you try) to start this yourself; Maelstrom uses it transparently. .SH AUTHOR The original Maelstrom was written for the Macintosh by Andrew Welch. The Linux port was done by Sam Lantinga . .PP The author has approved the inclusion of Maelstrom in Debian distributions, including commercially distributed versions, as long as Maelstrom is .B not sold independently and remains freely available. .PP This manual page was contributed by Robert Leslie . debian/menu0000664000000000000000000000042012611662357010064 0ustar ?package(maelstrom):\ needs="X11"\ section="Games/Action"\ title="Maelstrom"\ command="/usr/games/maelstrom"\ icon="/usr/share/games/maelstrom/icon32.xpm" ?package(maelstrom):\ needs="vc"\ section="Games/Action"\ title="Maelstrom"\ command="/usr/games/maelstrom" debian/clean0000664000000000000000000000003612603037500010170 0ustar Docs/Makefile Images/Makefile debian/source/0000775000000000000000000000000012611662360010473 5ustar debian/source/format0000664000000000000000000000001412603037500011672 0ustar 3.0 (quilt) debian/handle_underscores0000664000000000000000000000050712611662357012775 0ustar #!/bin/sh LIBDIR=$1 if test -e $LIBDIR/Maelstrom_Fonts ; then mv $LIBDIR/Maelstrom_Fonts $LIBDIR/Maelstrom\ Fonts fi if test -e $LIBDIR/Maelstrom_Sounds ; then mv $LIBDIR/Maelstrom_Sounds $LIBDIR/Maelstrom\ Sounds fi if test -e $LIBDIR/Maelstrom_Sprites ; then mv $LIBDIR/Maelstrom_Sprites $LIBDIR/Maelstrom\ Sprites fi