ImageMagick 6 fix (hopefully) and early support for HL_STEAM_INSTALL.

However, due to a CRC mismatch in c1a0d.bsp it will fail to build a
valid pak0.pak at this time.
This commit is contained in:
Marco Cawthorne 2023-05-06 16:37:44 -07:00
parent 66cea7a180
commit bf4e822b34
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
5 changed files with 67 additions and 5 deletions

6
README
View File

@ -38,7 +38,7 @@ Requirements:
- working C compiler
- GNU make (probably)
- wget
- magick (as part of ImageMagick)
- magick/convert (as part of ImageMagick)
Getting started:
@ -55,6 +55,10 @@ steaminstall_halflife.exe
...and place them alongside this README file.
If you want to use your local Steam Half-Life installation,
pass the HL_STEAM_INSTALL environment variable like so:
`HL_STEAM_INSTALL="/path/to/Half-Life" ./start`
The end result is placed into ./_build for you to copy wherever.

View File

@ -39,6 +39,22 @@ find_file ()
fi
done
if [ ! -z "$HL_STEAM_INSTALL" ]
then
find "$HL_STEAM_INSTALL" -type f -name "${SEARCHNAME}" | while read FOUND
do
CHECK=$(sha256sum "${FOUND}" | cut -d ' ' -f 1)
#echo "$CHECK == $2"
if [ "${CHECK}" = "$2" ]
then
mkdir -p "${PAK0_OUTDIR}/$(dirname $1)"
cp -v "${FOUND}" "${PAK0_OUTDIR}/$1"
exit 0
fi
done
fi
if [ ! -f "${PAK0_OUTDIR}/$1" ]
then
echo "${1}" >> "./_build/missing-$3-pak0.txt"

View File

@ -30,4 +30,9 @@ fetch_resource "http://archive.org/download/Half-lifeUplink/hluplink.exe" "Half-
fetch_resource "http://archive.org/download/half-life-patches/English/Update 1.1.1.0 English/hl1110.exe" "Half-Life: Patch 1.1.1.0"
fetch_resource "https://archive.org/download/opfor-demo/opfordemofull.exe" "Half-Life: Opposing Force - Demo"
fetch_resource "https://downloads.ammahls.com/HLSDK/hl_sdk_v23.exe" "Half-Life SDK v2.3"
# if we pass a Steam path, skip this one
if [ -z "$HL_STEAM_INSTALL" ]
then
fetch_resource "http://archive.org/download/steaminstall_halflife/steaminstall_halflife.exe" "Steam Installer with Half-Life Cache"
fi

13
rip_sources.sh Executable file → Normal file
View File

@ -31,7 +31,11 @@ x_rewise "hluplink.exe"
x_rewise "hl1110.exe"
x_rewise "opfordemofull.exe"
x_rewise "hl_sdk_v23.exe"
if [ -z "$HL_STEAM_INSTALL" ]
then
x_rewise "steaminstall_halflife.exe"
fi
mkdir -p "./_tmp/hluplink-pak0"
pakextract -o "./_tmp/hluplink-pak0" "./_tmp/hluplink.exe/MAINDIR/valve/pak0.PAK"
@ -39,11 +43,20 @@ pakextract -o "./_tmp/hluplink-pak0" "./_tmp/hluplink.exe/MAINDIR/valve/pak0.PAK
mkdir -p "./_tmp/opfordemofull-pak0"
pakextract -o "./_tmp/opfordemofull-pak0" "./_tmp/opfordemofull.exe/MAINDIR/valve/pak0.PAK"
if [ -z "$HL_STEAM_INSTALL" ]
then
mkdir -p "./_tmp/half-life.gcf"
hlextract -p "./_tmp/steaminstall_halflife.exe/MAINDIR/SteamApps/half-life.gcf" -d "./_tmp/half-life.gcf" -e "root/valve/"
fi
./ccase.sh -r "./_tmp"
# if anything goes wrong here, it's probably imagemagick messing with the image
if [ ! -x "$(command -v magick)" ]; then
convert "./_tmp/hluplink-pak0/gfx/shell/btns_main.bmp" -compress none -crop 156x4836+0+0 BMP3:"./_tmp/btns_main.bmp"
else
magick "./_tmp/hluplink-pak0/gfx/shell/btns_main.bmp" -compress none -crop 156x4836+0+0 BMP3:"./_tmp/btns_main.bmp"
fi
magick "./_tmp/hluplink-pak0/gfx/shell/btns_main.bmp" -compress none -crop 156x4836+0+0 BMP3:"./_tmp/btns_main.bmp"
bmpfix "./_tmp/hl1110.exe/maindir/valve/models/player/hgrunt/hgrunt.bmp"

View File

@ -1,5 +1,29 @@
#!/bin/sh
set -e
# some sanity checks before we continue
if [ ! -x "$(command -v make)" ]; then
echo "make not found. Please install GNU make."
exit 2
fi
if [ ! -x "$(command -v cc)" ]; then
echo "cc not found. Please install a C compiler."
exit 2
fi
if [ ! -x "$(command -v wget)" ]; then
echo "wget not found. Please install wget."
exit 2
fi
if [ ! -x "$(command -v magick)" ]; then
if [ ! -x "$(command -v convert)" ]; then
echo "magick/convert not found. Please install ImageMagick or higher."
exit 2
fi
fi
./build_tools.sh
./dl_sources.sh
./rip_sources.sh