b0r3doom engine source
======================

This is the complete source for the engine build running at
https://b0r3d.org/b0r3doom/ (engine build ec5a20aef27e).

It is Dwasm (PrBoom+ / PrBoomX), GPL-2.0 (see COPYING), taken from
https://github.com/GMH-Code/Dwasm at commit
ddf0347a4fc115b11ffb1c5710768b7c47c46698, with b0r3d.org's changes already
applied. The changes on their own are b0r3d-engine.patch, published next to
this archive and at https://b0r3d.org/b0r3doom/b0r3d-engine.patch. Its header
describes each change (The Sword, the Return to b0r3d menu item, and the page
hooks used by the launcher and its dev menu).

Freedoom (the game data) is not in here. b0r3doom fetches it separately; see
https://freedoom.github.io/ and the notes at https://b0r3d.download/.

Building
--------

README.md covers the build in full. The short version, and the exact
settings this build used:

1. Native first, for the engine's own wad. The patch touches data/, so the
   wad must be regenerated rather than taken from a stock build:

       mkdir build_native && cd build_native
       cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS="-std=gnu17 -fpermissive -w"
       make prboomwad
       cp prboomx.wad ../wasm/fs/prboomx.wad

   Expected: prboomx.wad, 473,280 bytes,
   SHA-256 3658b9b70748c5dbc0c4d1e4066aeed660f7e92078fffa0c1c2adaf89896243c

2. Then the WebAssembly build (emsdk, no GL4ES):

       source /path/to/emsdk/emsdk_env.sh
       mkdir build && cd build
       emcmake cmake .. -DCMAKE_BUILD_TYPE=Release \
         -DCMAKE_C_FLAGS="-std=gnu17 -w -Wno-error=implicit-function-declaration -Wno-error=int-conversion -Wno-error=incompatible-function-pointer-types -Wno-error=deprecated-non-prototype -Wno-error=incompatible-pointer-types"
       emmake make -j8

   The output is index.js, index.wasm and index.data. build/index.html is
   Dwasm's stock shell; b0r3doom uses its own launcher page instead.

The C flags exist because the engine predates the C23 defaults of current
compilers, which turn several old C idioms into hard errors.

Toolchain this build used: Emscripten 6.0.9, GCC 15.2.0 (native step),
CMake 4.2.3.

The shipped files, for comparison:

    ec5a20aef27e65b64e2816665759c9c715409b06139e5c5577168127701a1e21  index.wasm
    496d60ad2364537aff317e00ca115dc096514f4268d222ed0e1d16ff8d40f9cc  index.js
    cd02080bbce94a18f0879d5489de7aaf108378c181c1f276d8eb8ddf5e582b64  index.data

Emscripten output is not bit-for-bit reproducible across toolchain versions,
so a rebuild with a different emsdk will differ in the bytes while behaving
the same.

Not affiliated with, endorsed by, or connected to id Software, Bethesda
Softworks, or ZeniMax Media.
