diff options
author | B. Watson <urchlay@slackware.uk> | 2023-01-18 03:54:24 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-01-21 10:22:10 +0700 |
commit | 918d4273926158832cadfdacf9f6ec41bc3ea319 (patch) | |
tree | 4d82279605ff22e9c2b00dfbfbd3efd723d485e7 /games/wolf4sdl | |
parent | 1ff6dedb3ab22ad3105fc6ff373fb2971cc9629c (diff) |
games/wolf4sdl: Updated for version 2.0+20210408_f31f41a.
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/wolf4sdl')
20 files changed, 756 insertions, 35 deletions
diff --git a/games/wolf4sdl/README b/games/wolf4sdl/README index 6a20c5e87579..3ac421ec9e89 100644 --- a/games/wolf4sdl/README +++ b/games/wolf4sdl/README @@ -10,3 +10,10 @@ of Wolfenstein 3D and its sequel Spear of Destiny. To play the full versions of the games, you need the *.wl*, *.sod, and/or *.sd* files from your installed copies of the games. Copy them to "/usr/share/games/wolf3d". Filenames must be all-lowercase. + +This version of Wolf4SDL has some gameplay features that make it play +more like a modern FPS game. To try this, run e.g. + +$ wolf4sdl-wolf3d-demo --modern + +See the man page for more information. diff --git a/games/wolf4sdl/datadir.diff.gz b/games/wolf4sdl/datadir.diff.gz Binary files differdeleted file mode 100644 index c456c6539a04..000000000000 --- a/games/wolf4sdl/datadir.diff.gz +++ /dev/null diff --git a/games/wolf4sdl/wolf4sdl-spear-demo.desktop b/games/wolf4sdl/desktop/wolf4sdl-spear-demo.desktop index 0d93ff508606..7777b6b19c5f 100644 --- a/games/wolf4sdl/wolf4sdl-spear-demo.desktop +++ b/games/wolf4sdl/desktop/wolf4sdl-spear-demo.desktop @@ -2,6 +2,6 @@ Type=Application Name=Wolf3D Spear of Destiny (Demo) Icon=wolf4sdl -Exec=/usr/games/wolf4sdl-spear-demo --windowed-mouse --res 960 720 +Exec=/usr/games/wolf4sdl-spear-demo Terminal=false Categories=Game;ActionGame; diff --git a/games/wolf4sdl/wolf4sdl-spear-full.desktop b/games/wolf4sdl/desktop/wolf4sdl-spear-full.desktop index f231f6c1e161..055c3eee81f9 100644 --- a/games/wolf4sdl/wolf4sdl-spear-full.desktop +++ b/games/wolf4sdl/desktop/wolf4sdl-spear-full.desktop @@ -2,6 +2,6 @@ Type=Application Name=Wolf3D Spear of Destiny (Full Version) Icon=wolf4sdl -Exec=/usr/games/wolf4sdl-spear-full --windowed-mouse --res 960 720 +Exec=/usr/games/wolf4sdl-spear-full Terminal=false Categories=Game;ActionGame; diff --git a/games/wolf4sdl/wolf4sdl-wolf3d-demo.desktop b/games/wolf4sdl/desktop/wolf4sdl-wolf3d-demo.desktop index de0e76225bc6..9c9e850ce2af 100644 --- a/games/wolf4sdl/wolf4sdl-wolf3d-demo.desktop +++ b/games/wolf4sdl/desktop/wolf4sdl-wolf3d-demo.desktop @@ -2,6 +2,6 @@ Type=Application Name=Wolfenstein 3D (Demo) Icon=wolf4sdl -Exec=/usr/games/wolf4sdl-wolf3d-demo --windowed-mouse --res 960 720 +Exec=/usr/games/wolf4sdl-wolf3d-demo Terminal=false Categories=Game;ActionGame; diff --git a/games/wolf4sdl/wolf4sdl-wolf3d-full.desktop b/games/wolf4sdl/desktop/wolf4sdl-wolf3d-full.desktop index b6d62ef2c699..83752d7852cd 100644 --- a/games/wolf4sdl/wolf4sdl-wolf3d-full.desktop +++ b/games/wolf4sdl/desktop/wolf4sdl-wolf3d-full.desktop @@ -2,6 +2,6 @@ Type=Application Name=Wolfenstein 3D (Full Version) Icon=wolf4sdl -Exec=/usr/games/wolf4sdl-wolf3d-full --windowed-mouse --res 960 720 +Exec=/usr/games/wolf4sdl-wolf3d-full Terminal=false Categories=Game;ActionGame; diff --git a/games/wolf4sdl/exename.diff.gz b/games/wolf4sdl/exename.diff.gz Binary files differdeleted file mode 100644 index b46b61da5687..000000000000 --- a/games/wolf4sdl/exename.diff.gz +++ /dev/null diff --git a/games/wolf4sdl/git2tarxz.sh b/games/wolf4sdl/git2tarxz.sh new file mode 100644 index 000000000000..b3473a8ed75a --- /dev/null +++ b/games/wolf4sdl/git2tarxz.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +### Containg wolf4sdl specific stuff, do not use as-is for a template! + +# Create source tarball from git repo, with generated version +# number. + +# Note that this script doesn't need to be run as root. It does +# need to be able to write to the current directory it's run from. + +# Takes one optional argument, which is the commit or tag to create +# a tarball of. With no arg, HEAD is used. + +PRGNAM=wolf4sdl +CLONE_URL=https://github.com/11001011101001011/Wolf4SDL + +# The version of wolf4sdl, according to the Changes.txt file. Have to +# keep track of this manually unless upstream starts using git tags... +# but this is an archived/readonly github project so it'll never +# happen. +MAINVER=2.0 + +set -e + +GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX ) +rm -rf $GITDIR +git clone $CLONE_URL $GITDIR + +CWD="$( pwd )" +cd $GITDIR + +if [ "$1" != "" ]; then + git reset --hard "$1" || exit 1 +fi + +GIT_SHA=$( git rev-parse --short HEAD ) + +DATE=$( git log --date=format:%Y%m%d --format=%cd | head -1 ) + +VERSION=${MAINVER}+${DATE}_${GIT_SHA} + +rm -rf .git +find . -name .gitignore -print0 | xargs -0 rm -f + +cd "$CWD" +rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz +mv $GITDIR $PRGNAM-$VERSION +tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION + +echo +echo "Created tarball: $PRGNAM-$VERSION.tar.xz" +echo "VERSION=$VERSION" diff --git a/games/wolf4sdl/icons/128.png b/games/wolf4sdl/icons/128.png Binary files differindex 04cf9b9c6fd5..018dc8de485b 100644 --- a/games/wolf4sdl/icons/128.png +++ b/games/wolf4sdl/icons/128.png diff --git a/games/wolf4sdl/icons/16.png b/games/wolf4sdl/icons/16.png Binary files differindex 98efb19983ae..7632b41ad0ba 100644 --- a/games/wolf4sdl/icons/16.png +++ b/games/wolf4sdl/icons/16.png diff --git a/games/wolf4sdl/icons/22.png b/games/wolf4sdl/icons/22.png Binary files differnew file mode 100644 index 000000000000..a497c2455882 --- /dev/null +++ b/games/wolf4sdl/icons/22.png diff --git a/games/wolf4sdl/icons/32.png b/games/wolf4sdl/icons/32.png Binary files differindex 01d716cae796..8deb831fd068 100644 --- a/games/wolf4sdl/icons/32.png +++ b/games/wolf4sdl/icons/32.png diff --git a/games/wolf4sdl/icons/48.png b/games/wolf4sdl/icons/48.png Binary files differindex e3b560ba1073..01e8c8d95f0f 100644 --- a/games/wolf4sdl/icons/48.png +++ b/games/wolf4sdl/icons/48.png diff --git a/games/wolf4sdl/patches/datadir.diff b/games/wolf4sdl/patches/datadir.diff new file mode 100644 index 000000000000..1c8e7524b727 --- /dev/null +++ b/games/wolf4sdl/patches/datadir.diff @@ -0,0 +1,311 @@ +diff -Naur wolf4sdl-2.0+20210408_f31f41a/Makefile wolf4sdl-2.0+20210408_f31f41a.patched/Makefile +--- wolf4sdl-2.0+20210408_f31f41a/Makefile 2023-01-17 21:39:16.429986286 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/Makefile 2023-01-17 22:30:58.234400318 -0500 +@@ -20,7 +20,7 @@ + LDFLAGS_SDL ?= $(shell $(SDL_CONFIG) --libs) + + +-CFLAGS += $(CFLAGS_SDL) ++CFLAGS += -DPREFIX='"$(PREFIX)"' $(CFLAGS_SDL) + + #CFLAGS += -Wall + #CFLAGS += -W +@@ -87,6 +87,7 @@ + SRCS += wl_state.c + SRCS += wl_text.c + SRCS += wl_utils.c ++SRCS += datafile.c + + DEPS = $(filter %.d, $(SRCS:.c=.d) $(SRCS:.cpp=.d)) + OBJS = $(filter %.o, $(SRCS:.c=.o) $(SRCS:.cpp=.o)) +diff -Naur wolf4sdl-2.0+20210408_f31f41a/datafile.c wolf4sdl-2.0+20210408_f31f41a.patched/datafile.c +--- wolf4sdl-2.0+20210408_f31f41a/datafile.c 1969-12-31 19:00:00.000000000 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/datafile.c 2023-01-17 22:28:44.888190048 -0500 +@@ -0,0 +1,60 @@ ++ ++#include <stdlib.h> ++#include <unistd.h> ++#include <limits.h> ++#include <stdio.h> ++#include <sys/types.h> ++#include <sys/stat.h> ++#include <fcntl.h> ++ ++#include "datafile.h" ++ ++static char *datapath = NULL; ++ ++static void set_data_path(void) { ++ if(datapath) return; ++ datapath = getenv("WOLF4PATH"); ++ if(datapath) return; ++ ++ // 20120113 bkw: should this be "C:\\WOLF3D" on Windows? ++ datapath = (char *)PREFIX "/share/games/wolf3d"; ++} ++ ++int datafile_exists(const char *file) { ++ char datafile[PATH_MAX]; ++ struct stat statbuf; ++ ++ set_data_path(); ++ ++ if(stat(file, &statbuf)) ++ return 1; ++ ++ sprintf(datafile, "%s/%s", datapath, file); ++ return stat(datafile, &statbuf); ++} ++ ++int datafile_open(const char *file, int flags) { ++ char datafile[PATH_MAX]; ++ int handle; ++ ++ set_data_path(); ++ ++ if( (handle = open(file, flags)) > 0 ) ++ return handle; ++ ++ sprintf(datafile, "%s/%s", datapath, file); ++ return open(datafile, flags); ++} ++ ++FILE *datafile_fopen(const char *file, const char *mode) { ++ char datafile[PATH_MAX]; ++ FILE *f; ++ ++ set_data_path(); ++ ++ if( (f = fopen(file, mode)) ) ++ return f; ++ ++ sprintf(datafile, "%s/%s", datapath, file); ++ return fopen(datafile, mode); ++} +diff -Naur wolf4sdl-2.0+20210408_f31f41a/datafile.h wolf4sdl-2.0+20210408_f31f41a.patched/datafile.h +--- wolf4sdl-2.0+20210408_f31f41a/datafile.h 1969-12-31 19:00:00.000000000 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/datafile.h 2023-01-17 22:28:44.888190048 -0500 +@@ -0,0 +1,22 @@ ++ ++#include <stdio.h> ++/* ++20120113 bkw: ++Functions for loading game data files. ++ ++All these functions search for files in: ++ ++- The current directory ++- The directory specified by $WOLF4PATH if set ++- If WOLF4PATH not set, fall back to PREFIX/share/games/wolf3d ++ ++*/ ++ ++/* returns true if file exists in the data path, otherwise false */ ++int datafile_exists(const char *file); ++ ++/* returns a filehandle to the file if found, or -1 if not */ ++int datafile_open(const char *file, int flags); ++ ++/* returns a FILE* if found, or NULL if not */ ++FILE *datafile_fopen(const char *file, const char *mode); +diff -Naur wolf4sdl-2.0+20210408_f31f41a/id_ca.c wolf4sdl-2.0+20210408_f31f41a.patched/id_ca.c +--- wolf4sdl-2.0+20210408_f31f41a/id_ca.c 2023-01-17 21:39:16.432986336 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/id_ca.c 2023-01-17 22:34:06.381518949 -0500 +@@ -24,6 +24,7 @@ + #include <unistd.h> + #endif + ++#include "datafile.h" + #include "wl_def.h" + #pragma hdrstop + +@@ -181,7 +182,7 @@ + { + int32_t size; + +- const int handle = open(filename, O_RDONLY | O_BINARY); ++ const int handle = datafile_open(filename, O_RDONLY | O_BINARY); + if (handle == -1) + return false; + +@@ -454,7 +455,7 @@ + strcpy(fname,gdictname); + strcat(fname,graphext); + +- handle = open(fname, O_RDONLY | O_BINARY); ++ handle = datafile_open(fname, O_RDONLY | O_BINARY); + if (handle == -1) + CA_CannotOpen(fname); + +@@ -465,7 +466,7 @@ + strcpy(fname,gheadname); + strcat(fname,graphext); + +- handle = open(fname, O_RDONLY | O_BINARY); ++ handle = datafile_open(fname, O_RDONLY | O_BINARY); + if (handle == -1) + CA_CannotOpen(fname); + +@@ -500,7 +501,7 @@ + strcpy(fname,gfilename); + strcat(fname,graphext); + +- grhandle = open(fname, O_RDONLY | O_BINARY); ++ grhandle = datafile_open(fname, O_RDONLY | O_BINARY); + if (grhandle == -1) + CA_CannotOpen(fname); + +@@ -544,7 +545,7 @@ + strcpy(fname,mheadname); + strcat(fname,extension); + +- handle = open(fname, O_RDONLY | O_BINARY); ++ handle = datafile_open(fname, O_RDONLY | O_BINARY); + if (handle == -1) + CA_CannotOpen(fname); + +@@ -560,14 +561,14 @@ + strcpy(fname, "gamemaps."); + strcat(fname, extension); + +- maphandle = open(fname, O_RDONLY | O_BINARY); ++ maphandle = datafile_open(fname, O_RDONLY | O_BINARY); + if (maphandle == -1) + CA_CannotOpen(fname); + #else + strcpy(fname,mfilename); + strcat(fname,extension); + +- maphandle = open(fname, O_RDONLY | O_BINARY); ++ maphandle = datafile_open(fname, O_RDONLY | O_BINARY); + if (maphandle == -1) + CA_CannotOpen(fname); + #endif +@@ -627,7 +628,7 @@ + strcpy(fname,afilename); + strcat(fname,audioext); + +- audiohandle = open(fname, O_RDONLY | O_BINARY); ++ audiohandle = datafile_open(fname, O_RDONLY | O_BINARY); + if (audiohandle == -1) + CA_CannotOpen(fname); + } +diff -Naur wolf4sdl-2.0+20210408_f31f41a/id_pm.c wolf4sdl-2.0+20210408_f31f41a.patched/id_pm.c +--- wolf4sdl-2.0+20210408_f31f41a/id_pm.c 2023-01-17 21:39:16.432986336 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/id_pm.c 2023-01-17 22:34:44.942158111 -0500 +@@ -1,5 +1,6 @@ + // ID_PM.C + ++#include "datafile.h" + #include "wl_def.h" + + word ChunksInFile; +@@ -35,7 +36,7 @@ + + strcat (fname,extension); + +- file = fopen(fname,"rb"); ++ file = datafile_fopen(fname,"rb"); + + if (!file) + CA_CannotOpen(fname); +diff -Naur wolf4sdl-2.0+20210408_f31f41a/wl_menu.c wolf4sdl-2.0+20210408_f31f41a.patched/wl_menu.c +--- wolf4sdl-2.0+20210408_f31f41a/wl_menu.c 2023-01-17 21:39:16.439986452 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/wl_menu.c 2023-01-17 22:39:05.618478948 -0500 +@@ -14,6 +14,7 @@ + #include <unistd.h> + #endif + ++#include "datafile.h" + #include "wl_def.h" + #pragma hdrstop + +@@ -4052,11 +4053,11 @@ + // + #ifdef JAPAN + #ifdef JAPDEMO +- if(!stat("vswap.wj1", &statbuf)) ++ if(datafile_exists("vswap.wj1")) + { + strcpy (extension, "wj1"); + #else +- if(!stat("vswap.wj6", &statbuf)) ++ if(datafile_exists("vswap.wj6")) + { + strcpy (extension, "wj6"); + #endif +@@ -4076,13 +4077,13 @@ + // ENGLISH + // + #ifdef UPLOAD +- if(!stat("vswap.wl1", &statbuf)) ++ if(datafile_exists("vswap.wl1")) + strcpy (extension, "wl1"); + else + Quit ("NO WOLFENSTEIN 3-D DATA FILES to be found!"); + #else + #ifndef SPEAR +- if(!stat("vswap.wl6", &statbuf)) ++ if(datafile_exists("vswap.wl6")) + { + strcpy (extension, "wl6"); + NewEmenu[2].active = +@@ -4095,14 +4096,14 @@ + } + else + { +- if(!stat("vswap.wl3", &statbuf)) ++ if(datafile_exists("vswap.wl3")) + { + strcpy (extension, "wl3"); + NewEmenu[2].active = NewEmenu[4].active = EpisodeSelect[1] = EpisodeSelect[2] = 1; + } + else + { +- if(!stat("vswap.wl1", &statbuf)) ++ if(datafile_exists("vswap.wl1")) + strcpy (extension, "wl1"); + else + Quit ("NO WOLFENSTEIN 3-D DATA FILES to be found!"); +@@ -4116,28 +4117,28 @@ + #ifndef SPEARDEMO + if(param_mission == 0) + { +- if(!stat("vswap.sod", &statbuf)) ++ if(datafile_exists("vswap.sod")) + strcpy (extension, "sod"); + else + Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!"); + } + else if(param_mission == 1) + { +- if(!stat("vswap.sd1", &statbuf)) ++ if(datafile_exists("vswap.sd1")) + strcpy (extension, "sd1"); + else + Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!"); + } + else if(param_mission == 2) + { +- if(!stat("vswap.sd2", &statbuf)) ++ if(datafile_exists("vswap.sd2")) + strcpy (extension, "sd2"); + else + Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!"); + } + else if(param_mission == 3) + { +- if(!stat("vswap.sd3", &statbuf)) ++ if(datafile_exists("vswap.sd3")) + strcpy (extension, "sd3"); + else + Quit ("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!"); +@@ -4147,7 +4148,7 @@ + strcpy (graphext, "sod"); + strcpy (audioext, "sod"); + #else +- if(!stat("vswap.sdm", &statbuf)) ++ if(datafile_exists("vswap.sdm")) + { + strcpy (extension, "sdm"); + } diff --git a/games/wolf4sdl/patches/exename.diff b/games/wolf4sdl/patches/exename.diff new file mode 100644 index 000000000000..5ccaea752c8c --- /dev/null +++ b/games/wolf4sdl/patches/exename.diff @@ -0,0 +1,32 @@ +diff -Naur wolf4sdl-2.0+20210408_f31f41a/wl_main.c wolf4sdl-2.0+20210408_f31f41a.patched/wl_main.c +--- wolf4sdl-2.0+20210408_f31f41a/wl_main.c 2023-01-17 21:39:16.439986452 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/wl_main.c 2023-01-17 22:45:03.503411046 -0500 +@@ -1608,6 +1608,10 @@ + bool hasError = false, showHelp = false; + bool sampleRateGiven = false, audioBufferGiven = false; + int i,defaultSampleRate = param_samplerate; ++ char *exename = argv[0], *p; ++ ++ for (p = argv[0]; *p; p++) ++ if (*p == '/') exename = p + 1; + + for(i = 1; i < argc; i++) + { +@@ -1814,7 +1818,7 @@ + "Wolf4SDL v2.0\n" + "Ported by Chaos-Software, additions by the community\n" + "Original Wolfenstein 3D by id Software\n\n" +- "Usage: Wolf4SDL [options]\n" ++ "Usage: %s [options]\n" + "Options:\n" + " --help This help page\n" + " --tedlevel <level> Starts the game in the given level\n" +@@ -1853,7 +1857,7 @@ + " (default: 0 -> .sod, 1-3 -> .sd*)\n" + " --goodtimes Disable copy protection quiz\n" + #endif +- , defaultSampleRate ++ , exename, defaultSampleRate + ); + exit(1); + } diff --git a/games/wolf4sdl/patches/gameplay.diff b/games/wolf4sdl/patches/gameplay.diff new file mode 100644 index 000000000000..0ce18512925a --- /dev/null +++ b/games/wolf4sdl/patches/gameplay.diff @@ -0,0 +1,270 @@ +diff -Naur wolf4sdl-2.0+20210408_f31f41a/id_in.c wolf4sdl-2.0+20210408_f31f41a.patched/id_in.c +--- wolf4sdl-2.0+20210408_f31f41a/id_in.c 2023-01-17 21:39:16.000000000 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/id_in.c 2023-01-18 03:22:12.892051206 -0500 +@@ -393,6 +393,12 @@ + return Joystick != NULL; + } + ++boolean autorun = false; ++boolean autostrafe = false; ++/* This doesn't work yet. ++boolean mw_dn = false, mw_up = false; ++*/ ++ + static void processEvent(SDL_Event *event) + { + switch (event->type) +@@ -417,6 +423,34 @@ + + LastScan = event->key.keysym.sym; + SDL_Keymod mod = SDL_GetModState(); ++ ++ if ((mod & KMOD_LSHIFT) && (mod & KMOD_RSHIFT)) ++ { ++ autorun = !autorun; ++ ++ if (autorun) ++ Message ("Always Run: On"); ++ else ++ Message ("Always Run: Off"); ++ ++ IN_ClearKeysDown (); ++ IN_Ack (); ++ } ++ if (((mod & KMOD_LALT) && (mod & KMOD_RALT)) || ++ ((mod & KMOD_LALT) && (mod & KMOD_MODE)) || ++ ((mod & KMOD_LALT) && (mod & KMOD_RSHIFT))) ++ { ++ autostrafe = !autostrafe; ++ ++ if (autostrafe) ++ Message ("Always Strafe: On"); ++ else ++ Message ("Always Strafe: Off"); ++ ++ IN_ClearKeysDown (); ++ IN_Ack (); ++ } ++ + if(Keyboard(sc_Alt)) + { + if(LastScan==SDLK_F4) +@@ -426,6 +460,7 @@ + if(LastScan == SDLK_KP_ENTER) LastScan = SDLK_RETURN; + else if(LastScan == SDLK_RSHIFT) LastScan = SDLK_LSHIFT; + else if(LastScan == SDLK_RALT) LastScan = SDLK_LALT; ++ else if(LastScan == SDLK_MODE) LastScan = SDLK_LALT; /* AltGr */ + else if(LastScan == SDLK_RCTRL) LastScan = SDLK_LCTRL; + else + { +@@ -470,6 +505,7 @@ + if(key == SDLK_KP_ENTER) key = SDLK_RETURN; + else if(key == SDLK_RSHIFT) key = SDLK_LSHIFT; + else if(key == SDLK_RALT) key = SDLK_LALT; ++ else if(key == SDLK_MODE) key = SDLK_LALT; /* AltGr */ + else if(key == SDLK_RCTRL) key = SDLK_LCTRL; + else + { +@@ -497,6 +533,18 @@ + GP2X_ButtonUp(event->jbutton.button); + break; + #endif ++ ++ /* ++ case SDL_MOUSEWHEEL: ++ { ++ mw_dn = mw_up = false; ++ if (event->wheel.y < 0) ++ mw_dn = true; ++ else if(event->wheel.y > 0) ++ mw_up = true; ++ break; ++ } ++ */ + } + } + +diff -Naur wolf4sdl-2.0+20210408_f31f41a/wl_def.h wolf4sdl-2.0+20210408_f31f41a.patched/wl_def.h +--- wolf4sdl-2.0+20210408_f31f41a/wl_def.h 2023-01-17 21:39:16.000000000 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/wl_def.h 2023-01-18 03:22:12.893051223 -0500 +@@ -949,6 +949,8 @@ + extern int param_mission; + extern boolean param_goodtimes; + extern boolean param_ignorenumchunks; ++extern boolean param_novert; ++extern boolean param_crosshair; + + + void NewGame (int difficulty, int episode); +diff -Naur wolf4sdl-2.0+20210408_f31f41a/wl_draw.c wolf4sdl-2.0+20210408_f31f41a.patched/wl_draw.c +--- wolf4sdl-2.0+20210408_f31f41a/wl_draw.c 2023-01-17 21:39:16.000000000 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/wl_draw.c 2023-01-18 03:22:12.893051223 -0500 +@@ -956,6 +956,17 @@ + SimpleScaleShape(viewwidth/2,SPR_DEMO,viewheight+1); + } + ++void DrawCrosshair (void) ++{ ++ if (gamestate.victoryflag || gamestate.weapon < wp_pistol) ++ return; ++ ++ const int c = (gamestate.health >= 50) ? 2 : (gamestate.health >= 25) ? 6 : 4; ++ const int h = (viewsize == 21 && ingame) ? screenHeight : screenHeight - scaleFactor * STATUSLINES; ++ ++ VL_Hlin (screenWidth / 2 - scaleFactor, h / 2, 2 * scaleFactor + 1, c); ++ VL_Vlin (screenWidth / 2, h / 2 - scaleFactor, 2 * scaleFactor + 1, c); ++} + + //========================================================================== + +@@ -1666,6 +1677,8 @@ + #endif + + DrawPlayerWeapon (); // draw player's hands ++ if (param_crosshair) ++ DrawCrosshair (); + + if(Keyboard(sc_Tab) && viewsize == 21 && gamestate.weapon != -1) + ShowActStatus(); +diff -Naur wolf4sdl-2.0+20210408_f31f41a/wl_main.c wolf4sdl-2.0+20210408_f31f41a.patched/wl_main.c +--- wolf4sdl-2.0+20210408_f31f41a/wl_main.c 2023-01-17 21:39:16.000000000 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/wl_main.c 2023-01-18 03:40:19.681065262 -0500 +@@ -102,6 +102,10 @@ + int param_mission = 0; + boolean param_goodtimes = false; + boolean param_ignorenumchunks = false; ++boolean param_novert = false; ++boolean param_crosshair = false; ++extern boolean autorun; ++extern boolean autostrafe; + + /* + ============================================================================= +@@ -1644,6 +1648,28 @@ + fullscreen = false; + forcegrabmouse = true; + } ++ else IFARG("--novert") ++ { ++ param_novert = true; ++ } ++ else IFARG("--crosshair") ++ { ++ param_crosshair = true; ++ } ++ else IFARG("--strafe") ++ { ++ autostrafe = true; ++ } ++ else IFARG("--run") ++ { ++ autorun = true; ++ } ++ else IFARG("--modern") ++ { ++ autostrafe = true; ++ param_crosshair = true; ++ param_novert = true; ++ } + else IFARG("--res") + { + if(i + 2 >= argc) +@@ -1824,6 +1850,11 @@ + " --hard Sets the difficulty to hard for tedlevel\n" + " --nowait Skips intro screens\n" + " --windowed[-mouse] Starts the game in a window [and grabs mouse]\n" ++ " --novert Suppresses vertical mouse movement\n" ++ " --crosshair Shows a crosshair\n" ++ " --run Always run\n" ++ " --strafe Always strafe\n" ++ " --modern Same as --novert --crosshair --strafe\n" + " --res <width> <height> Sets the screen resolution\n" + " (must be multiple of 320x200 or 320x240)\n" + " --resf <w> <h> Sets any screen resolution >= 320x200\n" +diff -Naur wolf4sdl-2.0+20210408_f31f41a/wl_play.c wolf4sdl-2.0+20210408_f31f41a.patched/wl_play.c +--- wolf4sdl-2.0+20210408_f31f41a/wl_play.c 2023-01-17 21:39:16.000000000 -0500 ++++ wolf4sdl-2.0+20210408_f31f41a.patched/wl_play.c 2023-01-18 03:22:12.894051239 -0500 +@@ -260,10 +260,19 @@ + void PollKeyboardButtons (void) + { + int i; ++ extern boolean autorun; + + for (i = 0; i < NUMBUTTONS; i++) + if (Keyboard(buttonscan[i])) + buttonstate[i] = true; ++ ++ if (autorun) ++ { ++ if (Keyboard(buttonscan[bt_run])) ++ buttonstate[bt_run] = false; ++ else ++ buttonstate[bt_run] = true; ++ } + } + + +@@ -278,6 +287,9 @@ + void PollMouseButtons (void) + { + int buttons = IN_MouseButtons (); ++ /* ++ extern boolean mw_dn, mw_up; ++ */ + + if (buttons & 1) + buttonstate[buttonmouse[0]] = true; +@@ -285,6 +297,14 @@ + buttonstate[buttonmouse[1]] = true; + if (buttons & 4) + buttonstate[buttonmouse[2]] = true; ++ ++ /* This doesn't work, sadly. ++ if (mw_dn) ++ buttonstate[bt_prevweapon] = true; ++ if (mw_up) ++ buttonstate[bt_nextweapon] = true; ++ mw_dn = mw_up = false; ++ */ + } + + +@@ -320,15 +340,26 @@ + void PollKeyboardMove (void) + { + int delta = buttonstate[bt_run] ? RUNMOVE * tics : BASEMOVE * tics; ++ extern boolean autostrafe; + + if (Keyboard(dirscan[di_north])) + controly -= delta; + if (Keyboard(dirscan[di_south])) + controly += delta; + if (Keyboard(dirscan[di_west])) +- controlx -= delta; ++ { ++ if (autostrafe) ++ buttonstate[bt_strafeleft] = true; ++ else ++ controlx -= delta; ++ } + if (Keyboard(dirscan[di_east])) +- controlx += delta; ++ { ++ if (autostrafe) ++ buttonstate[bt_straferight] = true; ++ else ++ controlx += delta; ++ } + } + + +@@ -356,7 +387,8 @@ + #endif + + controlx += mousexmove * 10 / (13 - mouseadjustment); +- controly += mouseymove * 20 / (13 - mouseadjustment); ++ if (!param_novert) ++ controly += mouseymove * 20 / (13 - mouseadjustment); + } + + diff --git a/games/wolf4sdl/wolf4sdl.6 b/games/wolf4sdl/wolf4sdl.6 index b65e1f88dfe2..38406c64a91f 100644 --- a/games/wolf4sdl/wolf4sdl.6 +++ b/games/wolf4sdl/wolf4sdl.6 @@ -1,4 +1,4 @@ -.TH WOLF4SDL "6" "March 2010" "wolf4sdl" "Games" +.TH WOLF4SDL "6" "January 18 2023" "2.0+" "SlackBuilds.org" .SH NAME Wolf4SDL \- Game engine for Wolfenstein 3D and Spear of Destiny .SH SYNOPSIS @@ -22,6 +22,10 @@ the original feel while taking advantage of some modern improvements. .PP Wolf4SDL is a game engine. To actually play the game, it requires the data files from the original game (see \fBFILES\fR, below). +.PP +This man page is for the SlackBuilds.org \fBgames/wolf4sdl\fR build, which +is based on the last available community version from \fIhttps://github.com/11001011101001011/Wolf4SDL\fR, with additional patches ported from Debian. + .SH OPTIONS .TP \fB\-\-help\fR @@ -52,7 +56,23 @@ Starts the game in a window, without mouse support. Starts the game in a window, with mouse support. The mouse pointer will be unable to leave the game window. .TP -\fB\-\-res\fR <width> <height> Sets the screen resolution +\fB\-\-novert\fR +Disables vertical mouse motion (see also \fB\-\-modern\fR). +.TP +\fB\-\-crosshair\fR +Shows a crosshair (see also \fB\-\-modern\fR). +.TP +\fB\-\-run\fR +Always run (press both Shift keys to toggle; see also \fB\-\-modern\fR). +.TP +\fB\-\-strafe\fR +Always strafe instead of turning left/right (press both Alt keys or Alt+RightShift to toggle; see also \fB\-\-modern\fR). +.TP +\fB\-\-modern\fR +Same as \fB\-\-novert\fR \fB\-\-crosshair\fR \fB\-\-run\fR \fB\-\-strafe\fR. +.TP +\fB\-\-res\fR <width> <height> +Sets the screen resolution (must be multiple of 320x200 or 320x240). In fullscreen mode, the game switches to the smallest available fullscreen mode that's equal to or larger than the chosen resolution (e.g. 960x720 usually results in a 1024x768 display with black @@ -110,7 +130,7 @@ Ignores the number of chunks in VGAHEAD.* Sets the directory where game data files are searched for. When this variable is not set, the default directory is \fIPREFIX\fR\fB/share/games/wolf3d\fR (\fIPREFIX\fR was set at -compile time, and defaults to /usr/local). +compile time, and defaults to \fB/usr\fR). .PP Note that data files are always searched for in the current directory first, regardless of this setting. @@ -216,14 +236,28 @@ Right Button (#2) Strafe Center Button (#3) Open Door .TE .PP +.TS +box; +cB s +lB l. +Other Controls (non-remappable) +Left Shift + Right Shift Toggle autorun +Left Alt + Right Alt Toggle autostrafe +Left Alt + Right Shift Toggle autostrafe (same as above) +.TE +.PP Also, if the game was run with \fB\-\-goobers\fR (Wolf) or \fB\-\-debugmode\fR (Spear), the standard cheat codes are available. Remember to press Alt\-Shift\-Backspace first, and \fBbe careful\fR not to accidentally hit Alt\-Ctrl\-Backspace instead (*boom*, there goes your X session...) .SH AUTHORS -Ported by Chaos\-Software (http://www.chaos\-software.de.vu) +Ported by Chaos\-Software: http://www.chaos\-software.de.vu .PP Original Wolfenstein 3D by id Software. .PP -This man page by B. Watson. +The Wolf4SDL project was started by Ripper, and continued by various +authors. See https://wl6.fandom.com/wiki/Wolf4SDL for more information. +.PP +This man page written for the SlackBuilds.org project +by B. Watson, and is licensed under the WTFPL. diff --git a/games/wolf4sdl/wolf4sdl.SlackBuild b/games/wolf4sdl/wolf4sdl.SlackBuild index 50a0469584bf..70b54d040908 100644 --- a/games/wolf4sdl/wolf4sdl.SlackBuild +++ b/games/wolf4sdl/wolf4sdl.SlackBuild @@ -6,14 +6,12 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. -# TODO: investigate the patches from https://packages.debian.org/sid/wolf4sdl -# These don't apply cleanly to the original source (which is what -# we use), but I don't want to use Debian's "dfsg" source because it -# removes the OPL MIDI emulation for licensing reasons. It'll take some -# effort: I'll have to port the patches manually, or else re-add the OPL -# stuff to the Debian source. Also worth looking at: -# https://github.com/11001011101001011/Wolf4SDL (which apparently adds SDL2 -# support). +# 20230117 bkw: Updated for 2.0+20210408_f31f41a, the last commit from +# the "community" version, which uses SDL2. This script can't build +# 1.7 any more. Also ported some of Debian's 1.7 patches to 2.0 and +# switched the icon to theirs (it looks better at smaller sizes). +# Updated the man page and made the .desktop files run the game fullscreen, +# which works a lot better with SDL2. # 20230112 bkw: BUILD=3, install doinst.sh to right place (derp). # 20211015 bkw: BUILD=2, new-style icons. @@ -21,8 +19,8 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=wolf4sdl -VERSION=${VERSION:-1.7} -BUILD=${BUILD:-3} +VERSION=${VERSION:-2.0+20210408_f31f41a} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -64,18 +62,36 @@ SRCNAM=Wolf4SDL rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $SRCNAM-$VERSION-src -unzip $CWD/$SRCNAM-$VERSION-src.zip -cd $SRCNAM-$VERSION-src +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.xz +cd $PRGNAM-$VERSION chown -R root:root . find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ +# This old code has a terrifying amount of warnings, uncomment to see... +#SLKCFLAGS+=" -Wall" + +# The shading looks awful. Apparently upstream agrees, since it's +# disabled by default. If someone really wants to try it, here it is +# as an undocumented build option. +[ "${SHADING:-no}" = "yes" ] && SLKCFLAGS+=" -DUSE_SHADING" + # look for game data files in /usr/share/games/wolf3d -zcat $CWD/datadir.diff.gz | patch -p1 +patch -p1 < $CWD/patches/datadir.diff # show correct executable name in usage message (instead of Wolf4SDL) -zcat $CWD/exename.diff.gz | patch -p1 +patch -p1 < $CWD/patches/exename.diff + +# 20230117 bkw: The gameplay patch was adapted from: +# https://packages.debian.org/sid/wolf4sdl +# It includes their novert, crosshair, autorun, and +# autostrafe patches, ported to the 2.0 codebase (and SDL2). +# Also added --run --strafe --modern options (see man page). +# Didn't include shading (awful looking), pc-speaker (awful-sounding), +# datadir (already got one), or compiler-warnings (a *lot* of work). +# Didn't include mousewheel *yet* because I didn't get it working yet. +patch -p1 < $CWD/patches/gameplay.diff # don't use 'make install', do it manually. mkdir -p $PKG/usr/games $PKG/usr/share/games/wolf3d @@ -88,7 +104,7 @@ cat <<EOF >config.slack CFLAGS=$SLKCFLAGS -DVERSIONALREADYCHOSEN -DCARMACIZED -DUPLOAD EOF make CONFIG=config.slack PREFIX=/usr -install -m0755 -s wolf3d $PKG/usr/games/$PRGNAM-wolf-demo +install -m0755 -s wolf4sdl $PKG/usr/games/$PRGNAM-wolf-demo # Wolfenstein 3D 1.4 Full/Registered (GT/ID/Activision) # NOTE: If the game complains about your data files being incompatible, @@ -100,7 +116,7 @@ cat <<EOF >config.slack CFLAGS=$SLKCFLAGS -DVERSIONALREADYCHOSEN -DCARMACIZED -DGOODTIMES EOF make CONFIG=config.slack PREFIX=/usr -install -m0755 -s wolf3d $PKG/usr/games/$PRGNAM-wolf-full +install -m0755 -s wolf4sdl $PKG/usr/games/$PRGNAM-wolf-full # Spear of Destiny 1.4 Demo make clean @@ -108,7 +124,7 @@ cat <<EOF >config.slack CFLAGS=$SLKCFLAGS -DVERSIONALREADYCHOSEN -DCARMACIZED -DSPEAR -DSPEARDEMO EOF make CONFIG=config.slack PREFIX=/usr -install -m0755 -s wolf3d $PKG/usr/games/$PRGNAM-spear-demo +install -m0755 -s wolf4sdl $PKG/usr/games/$PRGNAM-spear-demo # Spear of Destiny 1.4 Full/Registered make clean @@ -116,7 +132,7 @@ cat <<EOF >config.slack CFLAGS=$SLKCFLAGS -DVERSIONALREADYCHOSEN -DCARMACIZED -DSPEAR -DGOODTIMES EOF make CONFIG=config.slack PREFIX=/usr -install -m0755 -s wolf3d $PKG/usr/games/$PRGNAM-spear-full +install -m0755 -s wolf4sdl $PKG/usr/games/$PRGNAM-spear-full # Wolfenstein 3D demo data unzip $CWD/wolfdata.zip @@ -136,8 +152,7 @@ for i in {wolf,spear}-{demo,full}; do ln -s $PRGNAM.6.gz $PKGMAN6/$PRGNAM-$i.6.gz done -# Icons extracted from macosx/wolf4sdl.icns with icns2png. -# 48.png scaled down from 512.png with 'convert -resize'. +# Icons created from the Debian SVG icon, with rsvg-convert. # Don't install 256x256 or 512x512 icons. for i in $CWD/icons/*.png; do px=$( basename $i | cut -d. -f1 ) @@ -151,10 +166,10 @@ mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png # .desktop files written for this build. -cp $CWD/*.desktop $PKG/usr/share/applications/ +install -m0644 -oroot -groot $CWD/desktop/*.desktop $PKG/usr/share/applications/ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a Changes.txt README.txt license-*.txt $PKG/usr/doc/$PRGNAM-$VERSION +cp -a Changes.txt README.TXT license-*.txt $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install diff --git a/games/wolf4sdl/wolf4sdl.info b/games/wolf4sdl/wolf4sdl.info index 705b1f72ed17..c515e9fbc51a 100644 --- a/games/wolf4sdl/wolf4sdl.info +++ b/games/wolf4sdl/wolf4sdl.info @@ -1,10 +1,10 @@ PRGNAM="wolf4sdl" -VERSION="1.7" +VERSION="2.0+20210408_f31f41a" HOMEPAGE="https://wl6.fandom.com/wiki/Wolf4SDL" -DOWNLOAD="https://slackware.uk/~urchlay/src/Wolf4SDL-1.7-src.zip \ +DOWNLOAD="https://slackware.uk/~urchlay/src/wolf4sdl-2.0+20210408_f31f41a.tar.xz \ https://downloads.sourceforge.net/project/wolfgl/Data/Demo/wolfdata.zip \ https://downloads.sourceforge.net/project/wolfgl/Data/Demo/sdmdata.zip" -MD5SUM="303f340598bfbe3440523c1ddb9f52e8 \ +MD5SUM="7efa65b8afbaea5581969687704f4763 \ bc4564940cae816aec0f4af0b8436baf \ 0aa1f89a8f5ddef700613b0f428fd8b0" DOWNLOAD_x86_64="" diff --git a/games/wolf4sdl/wolf4sdl.png b/games/wolf4sdl/wolf4sdl.png Binary files differdeleted file mode 100644 index ddd8ffe76756..000000000000 --- a/games/wolf4sdl/wolf4sdl.png +++ /dev/null |