games/jfsw: Added (Shadow Warrior first-person shooter)

This commit is contained in:
B. Watson 2010-04-10 09:50:49 -04:00 committed by David Somero
parent 8484ee946c
commit d5752ff22c
10 changed files with 4943 additions and 0 deletions

36
games/jfsw/README Normal file
View File

@ -0,0 +1,36 @@
jfsw (source port of Shadow Warrior first-person shooter game)
The aim of this port is to present Shadow Warrior as closely as possible
to the original game while adding optional features to expand the
possibilities of the game.
To play the game, you will need the sw.grp data file from either the
full or shareware DOS version of Shadow Warrior. If you want to play the
shareware version, you can install jfsw_demo_data from slackbuilds.org.
For the full version, copy sw.grp from the game directory to
/usr/share/games/jfsw/sw.grp (the filename must be lowercase).
If you have sw.grp from the full version of the game, you may also want
to install jfsw_hires_pack for some graphic enhancements (don't bother
trying, if all you have is the shareware sw.grp: it segfaults on startup).
Mote #1: To hear the in-game music, install either eawpats (recommended)
or freepats (both available at slackbuilds.org)
Note #2: There's no way to enable the mouse from the in-game menus. To
enable the mouse, you must run the game at least once to create its
config file (~/.jfsw/sw.cfg), then edit the config file and change
ControllerType to 1. You probably also want to change MouseAimingOn to 1,
for a more modern "mouselook" style of play.
Note #3: The Ambience setting in the Sound Setup menu is permanently
disabled, because the ambience code causes the game to crash.
Note #4: Multiplayer does work (at least for LAN play). See
/usr/doc/jsfw-$VERSION/releasenotes.html for multiplayer usage.
Note #5 (for Slackware 64-bit users): The source includes x86 assembly
code, so can't be built for any non-x86 architecture. If you're using
x86_64, you might (or might not) be able to build jfsw on a 32-bit
Slackware system and install it on x86_64 along with alienBOB's or fred's
-compat32 packages and get it to run.

4
games/jfsw/doinst.sh Normal file
View File

@ -0,0 +1,4 @@
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

103
games/jfsw/jfsw.SlackBuild Normal file
View File

@ -0,0 +1,103 @@
#!/bin/sh
# Slackware build script for jfsw
# Written by B. Watson (yalhcru@gmail.com)
PRGNAM=jfsw
VERSION=${VERSION:-20051009}
ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
# SLKCFLAGS is only used if FORCE_SLACK_CFLAGS=yes in the environment.
# This is because the code has portability problems that might cause
# trouble if built with CFLAGS other than the default ones in the Makefile.
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
else
echo "Sorry, this package can't be built on $ARCH"
exit 1
fi
set -e
BUILD_PRGNAM=jfbuild
BIN_NAME=sw
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf ${PRGNAM}_src_${VERSION} ${BUILD_PRGNAM}_src_${VERSION} build
unzip $CWD/${PRGNAM}_src_${VERSION}.zip
unzip $CWD/${BUILD_PRGNAM}_src_${VERSION}.zip
mv ${BUILD_PRGNAM}_src_${VERSION} build
cd build
# build engine compile fixes, from gentoo
patch -p1 < $CWD/patches/jfbuild_src_20051009.patch
cd -
cd ${PRGNAM}_src_${VERSION}
# compile fixes, from gentoo
patch -p1 < $CWD/patches/jfsw_src_20051009.patch
# permanently disable ambient sound option, since it doesn't work and
# causes the game to lock up
patch -p1 < $CWD/patches/disable_ambience.patch
chown -R root:root .
find . \
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
# I hate hard-coded assumptions that I have the same CPU you have...
sed -i 's/-march=pentium//' Makefile ../build/Makefile
if [ "${FORCE_SLACK_CFLAGS:-no}" = "yes" ]; then
sed -i '/^\s\+debug=/s/=.*/='"$SLKCFLAGS"'/' Makefile ../build/Makefile
fi
make RELEASE=1
# no 'make install' target
mkdir -p $PKG/usr/games
install -s -m0755 -oroot -groot $BIN_NAME $PKG/usr/games
cd $PKG/usr/games
ln -s $BIN_NAME $PRGNAM
cd -
# Data directory included in package, even though we don't include data file.
# Why? Because the user might be grabbing sw.grp from a retail CD-ROM, and
# if this dir doesn't exist, he might get confused...
mkdir -p $PKG/usr/share/games/$PRGNAM
# Icon taken from the highres pack, highres/screen/menu/2870.png
mkdir -p $PKG/usr/share/pixmaps
cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
mkdir -p $PKG/usr/share/applications
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
GNU.TXT readme.txt releasenotes.html \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README_SBo.txt
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

7
games/jfsw/jfsw.desktop Normal file
View File

@ -0,0 +1,7 @@
[Desktop Entry]
Name=JFShadowWarrior
Icon=jfsw
Exec=/usr/games/sw
Terminal=false
Type=Application
Categories=Game;ActionGame;

10
games/jfsw/jfsw.info Normal file
View File

@ -0,0 +1,10 @@
PRGNAM="jfsw"
VERSION="20051009"
HOMEPAGE="http://www.jonof.id.au/jfsw"
DOWNLOAD="http://static.jonof.id.au/dl/buildport/jfsw_src_20051009.zip http://static.jonof.id.au/dl/buildport/jfbuild_src_20051009.zip"
DOWNLOAD_x86_64="UNSUPPORTED"
MD5SUM="6b175daed0e459aac375e63de90097f0 44a943c0050bfd46ce1e6af24c951898"
MD5SUM_x86_64=""
MAINTAINER="B. Watson"
EMAIL="yalhcru@gmail.com"
APPROVED="dsomero"

BIN
games/jfsw/jfsw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,61 @@
diff -Naur jfsw_src_20051009.orig/source/game.c jfsw_src_20051009/source/game.c
--- jfsw_src_20051009.orig/source/game.c 2005-10-09 15:28:24.000000000 -0400
+++ jfsw_src_20051009/source/game.c 2010-02-09 00:08:14.000000000 -0500
@@ -197,7 +197,7 @@
TRUE, // fx on
TRUE, // Music on
TRUE, // talking
-TRUE, // ambient
+FALSE, // ambient
FALSE, // Flip Stereo
// Network game settings
diff -Naur jfsw_src_20051009.orig/source/menus.c jfsw_src_20051009/source/menus.c
--- jfsw_src_20051009.orig/source/menus.c 2005-10-09 15:28:24.000000000 -0400
+++ jfsw_src_20051009/source/menus.c 2010-02-09 00:26:35.000000000 -0500
@@ -196,7 +196,7 @@
{DefInert(0, NULL), OPT_XSIDE, OPT_LINE(3), 0, m_defshade, 0, NULL, NULL, NULL},
//{DefButton(btn_talking, 0, "Talking"), OPT_XS, OPT_LINE(4), 1, m_defshade, 0, NULL, MNU_FxCheck, NULL},
- {DefButton(btn_ambience, 0, "Ambience"), OPT_XS, OPT_LINE(4), 1, m_defshade, 0, NULL, MNU_FxCheck, NULL},
+ {DefButton(btn_ambience, 0, "Ambience"), OPT_XS, OPT_LINE(4), 1, m_defshade, 0, NULL, MNU_DisableButton, NULL},
{DefButton(btn_flipstereo, 0, "Flip Stereo"), OPT_XS, OPT_LINE(5), 1, m_defshade, 0, NULL, MNU_FxCheck, NULL},
//{DefButton(btn_playcd, 0, "Play CD"), OPT_XS, OPT_LINE(6), 1, m_defshade, 0, NULL, NULL, NULL},
{DefNone}
@@ -2695,6 +2695,13 @@
}
BOOL
+MNU_DisableButton(MenuItem *item)
+ {
+ SET(item->flags, mf_disabled);
+ return (TRUE);
+ }
+
+BOOL
MNU_FxCheck(MenuItem *item)
{
if (FXDevice < 0 || !FxInitialized)
diff -Naur jfsw_src_20051009.orig/source/menus.h jfsw_src_20051009/source/menus.h
--- jfsw_src_20051009.orig/source/menus.h 2005-10-09 15:28:24.000000000 -0400
+++ jfsw_src_20051009/source/menus.h 2010-02-09 00:27:29.000000000 -0500
@@ -289,6 +289,7 @@
BOOL MNU_MusicFxCheck(MenuItem_p item);
BOOL MNU_MusicCheck(MenuItem_p item);
+BOOL MNU_DisableButton(MenuItem_p item);
BOOL MNU_FxCheck(MenuItem_p item);
BOOL MNU_MouseCheck(MenuItem_p item);
BOOL MNU_BorderCheck(MenuItem_p item);
diff -Naur jfsw_src_20051009.orig/source/swconfig.c jfsw_src_20051009/source/swconfig.c
--- jfsw_src_20051009.orig/source/swconfig.c 2005-10-09 15:28:24.000000000 -0400
+++ jfsw_src_20051009/source/swconfig.c 2010-02-09 00:09:21.000000000 -0500
@@ -170,7 +170,7 @@
dummy = -1;
SCRIPT_GetNumber( scripthandle, "Options", "Ambient",&dummy);
- if (dummy != -1) gs.Ambient = dummy;
+ gs.Ambient = 0;
dummy = -1;
SCRIPT_GetNumber( scripthandle, "Options", "FxOn",&dummy);

View File

@ -0,0 +1,125 @@
diff -Nur jfbuild_src_20051009.orig/include/editor.h jfbuild_src_20051009/include/editor.h
--- jfbuild_src_20051009.orig/include/editor.h 2005-10-09 15:23:02.000000000 +0200
+++ jfbuild_src_20051009/include/editor.h 2005-10-10 15:06:18.000000000 +0200
@@ -18,7 +18,7 @@
extern short temppicnum, tempcstat, templotag, temphitag, tempextra;
extern char tempshade, temppal, tempxrepeat, tempyrepeat;
-extern char somethingintab;
+static char somethingintab;
extern char buildkeys[NUMBUILDKEYS];
diff -Nur jfbuild_src_20051009.orig/Makefile jfbuild_src_20051009/Makefile
--- jfbuild_src_20051009.orig/Makefile 2005-10-09 15:23:00.000000000 +0200
+++ jfbuild_src_20051009/Makefile 2005-10-10 15:06:22.000000000 +0200
@@ -27,7 +27,7 @@
# Debugging options
# RELEASE - 1 = no debugging
# EFENCE - 1 = compile with Electric Fence for malloc() debugging
-RELEASE?=0
+RELEASE?=1
EFENCE?=0
# SDK locations - adjust to match your setup
diff -Nur jfbuild_src_20051009.orig/src/build.c jfbuild_src_20051009/src/build.c
--- jfbuild_src_20051009.orig/src/build.c 2005-10-09 15:23:00.000000000 +0200
+++ jfbuild_src_20051009/src/build.c 2005-10-10 15:06:18.000000000 +0200
@@ -86,7 +86,7 @@
short temppicnum, tempcstat, templotag, temphitag, tempextra;
char tempshade, temppal, tempvis, tempxrepeat, tempyrepeat;
-char somethingintab = 255;
+static char somethingintab = 255;
static char boardfilename[BMAX_PATH], selectedboardfilename[BMAX_PATH];
static struct _directoryitem {
diff -Nur jfbuild_src_20051009.orig/src/crc32.c jfbuild_src_20051009/src/crc32.c
--- jfbuild_src_20051009.orig/src/crc32.c 2005-10-09 15:23:00.000000000 +0200
+++ jfbuild_src_20051009/src/crc32.c 2005-10-10 15:06:18.000000000 +0200
@@ -73,16 +73,6 @@
}
}
-
-unsigned long crc32(unsigned char *blk, unsigned long len)
-{
- unsigned long crc;
-
- crc32init(&crc);
- crc32block(&crc, blk, len);
- return crc32finish(&crc);
-}
-
void crc32init(unsigned long *crcvar)
{
if (!crcvar) return;
diff -Nur jfbuild_src_20051009.orig/src/sdlayer.c jfbuild_src_20051009/src/sdlayer.c
--- jfbuild_src_20051009.orig/src/sdlayer.c 2005-10-09 15:23:00.000000000 +0200
+++ jfbuild_src_20051009/src/sdlayer.c 2005-10-10 15:06:22.000000000 +0200
@@ -24,6 +24,10 @@
// undefine to restrict windowed resolutions to conventional sizes
#define ANY_WINDOWED_SIZE
+// fix for mousewheel
+#define MWHEELTICKS 10
+static unsigned long mwheelup, mwheeldown;
+
int _buildargc = 1;
char **_buildargv = NULL;
extern long app_main(long argc, char *argv[]);
@@ -486,8 +490,8 @@
initprintf("Initialising mouse\n");
// grab input
- grabmouse(1);
moustat=1;
+ grabmouse(1);
return 0;
}
@@ -1363,14 +1367,22 @@
case SDL_BUTTON_LEFT: j = 0; break;
case SDL_BUTTON_RIGHT: j = 1; break;
case SDL_BUTTON_MIDDLE: j = 2; break;
- default: j = -1; break;
+ default: j = ev.button.button; break;
}
if (j<0) break;
- if (ev.button.state == SDL_PRESSED)
+ if (ev.button.state == SDL_PRESSED) {
+ if (ev.button.button == SDL_BUTTON_WHEELUP) {
+ mwheelup = totalclock;
+ }
+ if (ev.button.button == SDL_BUTTON_WHEELDOWN) {
+ mwheeldown = totalclock;
+ }
mouseb |= (1<<j);
- else
- mouseb &= ~(1<<j);
+ }
+ else {
+ if (j < 4) mouseb &= ~(1<<j);
+ }
if (mousepresscallback)
mousepresscallback(j+1, ev.button.state == SDL_PRESSED);
@@ -1435,6 +1447,17 @@
sampletimer();
+ if (moustat) {
+ if ((mwheelup) && (mwheelup <= (totalclock - MWHEELTICKS))) {
+ mouseb &= ~16;
+ mwheelup = 0;
+ }
+ if ((mwheeldown) && (mwheeldown <= (totalclock - MWHEELTICKS))) {
+ mouseb &= ~32;
+ mwheeldown = 0;
+ }
+ }
+
#ifdef HAVE_GTK2
if (gtkenabled) update_startwin();
#endif

File diff suppressed because it is too large Load Diff

19
games/jfsw/slack-desc Normal file
View File

@ -0,0 +1,19 @@
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
|-----handy-ruler------------------------------------------------------|
jfsw: jfsw (source port of Shadow Warrior first-person shooter game)
jfsw:
jfsw: The aim of this port is to present Shadow Warrior as closely as
jfsw: possible to the original game while adding optional features to expand
jfsw: the possibilities of the game.
jfsw:
jfsw:
jfsw:
jfsw:
jfsw:
jfsw: