mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-11 07:22:22 +00:00
This is JonoF's Shadow Warrior port with additional
patches for FX sound support. WWW: http://www.jonof.id.au/jfsw PR: ports/144846 Submitted by: Ganael Laplanche <ganael.laplanche@martymac.com> Approved by: tabthorpe
This commit is contained in:
parent
fa2be9ee8b
commit
43a95308f3
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=255411
@ -395,6 +395,7 @@
|
||||
SUBDIR += jetpack
|
||||
SUBDIR += jfduke3d
|
||||
SUBDIR += jfk
|
||||
SUBDIR += jfsw
|
||||
SUBDIR += jigsaw
|
||||
SUBDIR += jigzo
|
||||
SUBDIR += jin
|
||||
|
57
games/jfsw/Makefile
Normal file
57
games/jfsw/Makefile
Normal file
@ -0,0 +1,57 @@
|
||||
# New ports collection makefile for: jfsw
|
||||
# Date Created: 11 March 2010
|
||||
# Whom: Ganael Laplanche <ganael.laplanche@martymac.com>
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= jfsw
|
||||
PORTVERSION= 20051009
|
||||
CATEGORIES= games
|
||||
MASTER_SITES= http://users.on.net/~jonof/buildport/
|
||||
DISTFILES= ${PORTNAME}_src_${PORTVERSION}.zip \
|
||||
jfbuild_src_${PORTVERSION}.zip
|
||||
|
||||
MAINTAINER= ganael.laplanche@martymac.com
|
||||
COMMENT= Jonathon Fowler's Shadow Warrior Port
|
||||
|
||||
BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
|
||||
|
||||
ONLY_FOR_ARCHS= i386
|
||||
ONLY_FOR_ARCHS_REASON= uses x86 assembly code
|
||||
USE_ZIP= yes
|
||||
USE_GMAKE= yes
|
||||
USE_GL= gl
|
||||
USE_GNOME= gtk20
|
||||
USE_SDL= mixer sdl
|
||||
WRKSRC= ${WRKDIR}/${PORTNAME}_src_${PORTVERSION}
|
||||
PATCH_WRKSRC= ${WRKDIR}
|
||||
|
||||
SUB_FILES= pkg-message
|
||||
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -Ee \
|
||||
's|^(EROOT=)../build/|\1../jfbuild_src_${PORTVERSION}/|; \
|
||||
s|^(CC=).*|\1${CC}|; \
|
||||
s|^(CFLAGS=).*|\1${CFLAGS}|; \
|
||||
s|^(NASMFLAGS=).*|\1 -s -f elf|; \
|
||||
s|/usr/X11R6|${LOCALBASE}|; \
|
||||
s|sdl-config|${SDL_CONFIG}|' \
|
||||
${WRKSRC}/Makefile \
|
||||
${WRKDIR}/jfbuild_src_${PORTVERSION}/Makefile \
|
||||
${WRKDIR}/jfbuild_src_${PORTVERSION}/Makefile.shared
|
||||
@${REINPLACE_CMD} -e 's|/usr/share/games/jfsw|${DATADIR}|' \
|
||||
${WRKSRC}/source/game.c ${WRKSRC}/source/jnstub.c
|
||||
|
||||
do-install:
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/sw ${PREFIX}/bin/${PORTNAME}
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/build ${PREFIX}/bin/${PORTNAME}-build
|
||||
${MKDIR} ${DATADIR}
|
||||
.if !defined(NOPORTDOCS)
|
||||
.for f in readme.txt releasenotes.html
|
||||
${MKDIR} ${DOCSDIR}
|
||||
${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
|
||||
.endfor
|
||||
@${CAT} ${PKGMESSAGE}
|
||||
.endif
|
||||
|
||||
.include <bsd.port.mk>
|
6
games/jfsw/distinfo
Normal file
6
games/jfsw/distinfo
Normal file
@ -0,0 +1,6 @@
|
||||
MD5 (jfsw_src_20051009.zip) = 6b175daed0e459aac375e63de90097f0
|
||||
SHA256 (jfsw_src_20051009.zip) = 09fd3b711775deb7e3843b30f649b486a95e0e3f22a1de9e1cb1744d954992ce
|
||||
SIZE (jfsw_src_20051009.zip) = 1091394
|
||||
MD5 (jfbuild_src_20051009.zip) = 44a943c0050bfd46ce1e6af24c951898
|
||||
SHA256 (jfbuild_src_20051009.zip) = 4bab5eb5171b6480c529f2076411f83038bd19861e3a9c8ede95c4c026bd746e
|
||||
SIZE (jfbuild_src_20051009.zip) = 610745
|
125
games/jfsw/files/patch-jfbuild_src_20051009
Normal file
125
games/jfsw/files/patch-jfbuild_src_20051009
Normal 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
|
4597
games/jfsw/files/patch-jfsw_src_20051009
Normal file
4597
games/jfsw/files/patch-jfsw_src_20051009
Normal file
File diff suppressed because it is too large
Load Diff
19
games/jfsw/files/pkg-message.in
Normal file
19
games/jfsw/files/pkg-message.in
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
=============================================================
|
||||
|
||||
JonoF's Shadow Warrior is now installed.
|
||||
|
||||
Before playing, you need to copy the following
|
||||
files from the original (or shareware) game:
|
||||
|
||||
* sw.grp
|
||||
* sw.rts
|
||||
|
||||
to %%DATADIR%%
|
||||
|
||||
Launch the game by typing 'jfsw'
|
||||
|
||||
Enjoy!
|
||||
|
||||
=============================================================
|
||||
|
4
games/jfsw/pkg-descr
Normal file
4
games/jfsw/pkg-descr
Normal file
@ -0,0 +1,4 @@
|
||||
This is JonoF's Shadow Warrior port with additional
|
||||
patches for FX sound support.
|
||||
|
||||
WWW: http://www.jonof.id.au/jfsw
|
6
games/jfsw/pkg-plist
Normal file
6
games/jfsw/pkg-plist
Normal file
@ -0,0 +1,6 @@
|
||||
bin/jfsw
|
||||
bin/jfsw-build
|
||||
@dirrmtry %%DATADIR%%
|
||||
%%PORTDOCS%%%%DOCSDIR%%/readme.txt
|
||||
%%PORTDOCS%%%%DOCSDIR%%/releasenotes.html
|
||||
%%PORTDOCS%%@dirrm %%DOCSDIR%%
|
Loading…
Reference in New Issue
Block a user