hosted on yikes.pw
discord: https://discord.gg/2kgxEREY6g
- sound
- saving/loading (works, TODO: save to browser storage)
- sometimes render breaks (something related to lightmaps?)
- fullscreen html button (works through game settings)
use docker, something like this, there might be some missing libs idk:
docker run --rm -it -v.:/source-engine debian
apt update
apt install git curl wget python3 xz-utils llvm binutils -y
# activate emsdk
cd /
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
git checkout 2d480a1b7c7a34a354188d93f3e89190a44a1d21
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd /source-engine
# patch and rebuild sdl2
embuilder --pic build sdl2 sdl2-mt
sed -Ei 's/freq = EM_ASM_INT/freq = MAIN_THREAD_EM_ASM_INT/' /emsdk/upstream/emscripten/cache/ports/sdl2/SDL-release-2.32.0/src/audio/emscripten/SDL_emscriptenaudio.c
embuilder --force --pic build sdl2 sdl2-mt
# patch glMapBufferRange to allow some "unsupported" parameters
patch /emsdk/upstream/emscripten/src/lib/libwebgl.js emscripten/libwebgl.patch
emmake ./build_emscripten.shthen download packed game data (yikes.pw/portal/chunks/mapName.data for each map) and put it to ./build/install/chunks/
first of all, you'll need to build engine from https://github.com/nillerusr/source-engine for your native arch add that printf to ./filesystem/basefilesystem.cpp
FileHandle_t CBaseFileSystem::OpenForRead( const char *pFileNameT, const char *pOptions, unsigned flags, const char *pathID, char **ppszResolvedFilename )
{
printf("OpenForRead %s %s\n", pFileNameT, pathID);
VPROF( "CBaseFileSystem::OpenForRead" );and lauch it via emscripten/get_logs.sh script, make sure to edit map list
after that, use emscripten/repackage.js script to make .data chunks
edit knownMaps and baseGamePath variables, make sure to unpack all .vpks