Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ Master/Darwin/release/
Master/Darwin/debug/
Master/Darwin/steam/
Master/Darwin/deps/
# Local Steam AppID for out-of-Steam dev testing (never shipped/committed)
Master/Darwin/steam_appid.txt
# Local game data (.dat) for dev builds — copyrighted, never committed
Master/Darwin/localdata/
.DS_Store
Expand Down
89 changes: 75 additions & 14 deletions CompilingDrod_macOS.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,83 @@ an actual macOS 15 / Intel Mac before relying on it there.

## Steam build

There are two Steam apps built from this engine, selected with `--steam-variant`:

| variant | game | AppID | define | data file | icon |
|---------|------|-------|--------|-----------|------|
| `tss` (default) | DROD: The Second Sky | 351320 | `-DSTEAMBUILD_TSS_APP` | `drod-tss5_0.dat` | `assets/TSS` |
| `gateb` | Gunthro and the Epic Blunder | 314330 | (none) | `drod5_0.dat` | `assets/GatEB` |

```
./build_macos.sh --steam --universal --steam-sdk /path/to/steamworks-sdk
./build_macos.sh --steam-variant gateb --universal --steam-sdk /path/to/steamworks-sdk
./build_macos.sh --steam-variant tss --universal # (--steam is shorthand for tss)
```

This builds with `-DSTEAMBUILD -DSTEAMBUILD_TSS_APP` (the TSS Steam app: data file
`drod-tss5_0.dat`, game name `drod-tss`) and links `libsteam_api`. Details:
Both build with `-DSTEAMBUILD` and link `libsteam_api`; `tss` adds `-DSTEAMBUILD_TSS_APP`.
The variant table (AppIDs etc.) lives near the top of `build_macos.sh`. Details:
- `--steam-sdk` points at an unpacked Steamworks SDK (default `~/Developer/steam-sdk`);
its `public/steam` headers are added to the include path.
- `libsteam_api.dylib` is taken from the SDK's `redistributable_bin/osx/` (override
with `--steam-lib`), staged into `deps/lib`, vendored into the bundle, and signed.
- A Steam build is normally launched through the Steam client (which supplies the
app id), so the shipped bundle contains no `steam_appid.txt`.
- To run a Steam build **outside** Steam for local testing, provision a gitignored
AppID file once: `./build_macos.sh --steam --steam-appid <id> …`. That writes
`Master/Darwin/steam_appid.txt` (gitignored), and every subsequent Steam build
copies it next to the executable so `SteamAPI_Init` works without Steam launching
it. **Never upload that file to the Steam depot** — delete
`Master/Darwin/steam_appid.txt` to build a clean shippable app.
- Just the binary: `make drod-steam STEAM_SDK=/path/to/steamworks-sdk`.
- `libsteam_api.dylib` is taken from the SDK's `redistributable_bin/osx/` (override with
`--steam-lib`), staged into `deps/lib`, vendored into the bundle, and signed.
- Game data comes from the per-app dir `Master/Darwin/localdata/<App>/` (`TSS`/`GatEB`,
gitignored) by default; override with `--dat-dir`. The app icon comes from the committed
`Master/Darwin/assets/<App>/` (its `DROD.icns`, plus any icon bitmaps overlaid onto the
shared drodData ones). Switching variants cleans the shared `steam/` build dir
automatically, so no manual clean is needed.
- A Steam build is normally launched through the Steam client (which supplies the app id),
so the shipped bundle contains no `steam_appid.txt`. To run **outside** Steam for local
testing, add `--steam-appid`: it writes the variant's AppID to
`Contents/MacOS/steam_appid.txt` in the bundle. **Never upload that file to the depot** —
omit `--steam-appid` for a clean shippable app.
- Just the binary: `make drod-steam STEAM_SDK=/path/... [STEAM_TSS=1]` (STEAM_TSS=1 = TSS).

## Standalone older games (KDD / JtRH / TCB / GatEB)

The same engine also builds the older games as **standalone** (non-Steam) apps,
selected with `--game`. Each is gated behind its own compile-time define and
looks for its own data file:

| `--game` | game | define | data file | app / icon / data folder |
|----------|------|--------|-----------|--------------------------|
| `kdd` | King Dugan's Dungeon | `-DKDD_STANDALONE` | `drod-kdd5_0.dat` | `KDD` |
| `jtrh` | Journey to Rooted Hold | `-DJTRH_STANDALONE` | `drod-jtrh5_0.dat` | `JtRH` |
| `tcb` | The City Beneath | `-DTCB_STANDALONE` | `drod-tcb5_0.dat` | `TCB` |
| `gateb` | Gunthro and the Epic Blunder| `-DGATEB_STANDALONE` | `drod-gateb5_0.dat` | `GatEB` |

```
./build_macos.sh --game kdd # -> "DROD KDD.app"
./build_macos.sh --game tcb --universal
```

- `--game` cannot be combined with `--steam` (these are standalone builds).
- App name defaults to `DROD <App>` (override with `--name`); the icon comes from
`Master/Darwin/assets/<App>/DROD.icns` (falls back to the TSS icon with a warning
if not present yet), and branded `Icon*.bmp` from the same folder.
- Game data comes from `Master/Darwin/localdata/<App>/` (gitignored) by default.
The build copies **only this game's** data set — `drod-<game>5_0.dat` plus its
`drod-<game>5_0_NN.dat` add-on packs — so a folder shared with another game's
dats (e.g. Steam GatEB's `drod5_0*.dat` alongside standalone GatEB's
`drod-gateb5_0*.dat` in `localdata/GatEB/`) never leaks mismatched data into the
bundle.
- Switching game/variant cleans the reused `custom/` (or `release`/`debug`) build
dir automatically, since make can't see the changed `-D` flag.
- Just the binary: `make drod-custom GAME=kdd` (or `jtrh`/`tcb`/`gateb`).

## Demo build (TSS)

```
./build_macos.sh --demo # -> "DROD TSS Demo.app"
```

There is **no demo compile flag** — a TSS demo is the *plain* TSS binary (data
`drod5_0.dat`) shipping a demo hold. The engine decides demo-vs-full at runtime in
`CDrodScreen::IsGameFullVersion()`: a build is a demo when its installed hold has
≤50 level entrances (`EntrancesInFullVersion()`), which enables the "Buy Now" menu
item and the sell/buy screens.

`--demo` is purely a convenience: it brands the app `DROD TSS Demo` and sources the
demo `drod5_0.dat` from `Master/Darwin/localdata/TSS-Demo/` (gitignored), keeping it
apart from the Steam TSS data in `localdata/TSS/` (`drod-tss5_0.dat`). It is the
same binary as a full standalone TSS, so it shares the `custom/` build objects — no
recompile when switching between them. TSS-standalone only (not with `--game` /
`--steam`).
22 changes: 19 additions & 3 deletions Master/Darwin/Config
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,33 @@ CXXFLAGS_custom = -Wno-unused -pipe -O2 -fomit-frame-pointer -ffast-math
CXXFLAGS_release = -Wno-unused -pipe -O2 -fomit-frame-pointer -ffast-math
CXXFLAGS_debug = -Wno-unused -pipe -ggdb -D_DEBUG -ffast-math

# Steam build: optimized + STEAMBUILD (TSS app), with the Steamworks SDK headers.
# Steam build: optimized + STEAMBUILD, with the Steamworks SDK headers.
# STEAM_SDK must point at an unpacked Steamworks SDK (so $(STEAM_SDK)/public/steam
# contains steam_api.h); pass it on the make command line or via build_macos.sh.
# STEAM_TSS=1 selects the TSS app (adds STEAMBUILD_TSS_APP -> drod-tss5_0.dat);
# leaving it unset builds GatEB (default drod5_0.dat).
STEAM_SDK ?=
CXXFLAGS_steam = $(CXXFLAGS_custom) -DSTEAMBUILD -DSTEAMBUILD_TSS_APP -I$(STEAM_SDK)/public/steam
STEAM_TSS ?=
STEAM_DEFINES = -DSTEAMBUILD $(if $(STEAM_TSS),-DSTEAMBUILD_TSS_APP)
CXXFLAGS_steam = $(CXXFLAGS_custom) $(STEAM_DEFINES) -I$(STEAM_SDK)/public/steam

# Linker flags always applied (architecture + deployment target).
LDFLAGS = $(ARCH_FLAGS) -mmacosx-version-min=$(MACOSX_VERSION_MIN)

# Standalone game selection. The TSS engine builds several older games from the
# same source, each gated behind a compile-time define (see wszUniqueResFile /
# GAMETITLE in DROD/Main.cpp and GetOfficialHoldStatus in DRODLib/DbHolds.cpp).
# Pass GAME=<kdd|jtrh|tcb|gateb> on the make command line (or via build_macos.sh
# --game) to build that standalone game; leaving it unset builds plain TSS.
GAME ?=
GAME_DEFINE = \
$(if $(filter kdd,$(GAME)),-DKDD_STANDALONE) \
$(if $(filter jtrh,$(GAME)),-DJTRH_STANDALONE) \
$(if $(filter tcb,$(GAME)),-DTCB_STANDALONE) \
$(if $(filter gateb,$(GAME)),-DGATEB_STANDALONE)

# Build variant selection.
VARIANT_FLAGS = -DUSE_SDL_MIXER -DCARAVELBUILD
VARIANT_FLAGS = -DUSE_SDL_MIXER -DCARAVELBUILD $(GAME_DEFINE)

###########################################
### <2> Library locations ###
Expand Down
Binary file added Master/Darwin/assets/GatEB/DROD.icns
Binary file not shown.
Binary file added Master/Darwin/assets/GatEB/Icon-128x128.bmp
Binary file not shown.
Binary file added Master/Darwin/assets/JtRH/DROD.icns
Binary file not shown.
Binary file added Master/Darwin/assets/KDD/DROD.icns
Binary file not shown.
Binary file added Master/Darwin/assets/TCB/DROD.icns
Binary file not shown.
File renamed without changes.
Binary file added Master/Darwin/assets/TSS/Icon-128x128.bmp
Binary file not shown.
1 change: 0 additions & 1 deletion Master/Darwin/build_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ cmake_install() {
-DCMAKE_OSX_DEPLOYMENT_TARGET="$DEPLOY" \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_INSTALL_NAME_DIR="@rpath" \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
-DCMAKE_PREFIX_PATH="$PREFIX" \
-DBUILD_SHARED_LIBS=ON \
"$@"
Expand Down
Loading
Loading