Skip to content

Commit ee5ac37

Browse files
TomBrouwsmrimer
authored andcommitted
Add support for Steam GatEB builds, and standalone builds for KDD/JTRH/TCB
1 parent 9985882 commit ee5ac37

12 files changed

Lines changed: 263 additions & 61 deletions

File tree

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ Master/Darwin/release/
140140
Master/Darwin/debug/
141141
Master/Darwin/steam/
142142
Master/Darwin/deps/
143-
# Local Steam AppID for out-of-Steam dev testing (never shipped/committed)
144-
Master/Darwin/steam_appid.txt
145143
# Local game data (.dat) for dev builds — copyrighted, never committed
146144
Master/Darwin/localdata/
147145
.DS_Store

CompilingDrod_macOS.md

Lines changed: 75 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,22 +95,83 @@ an actual macOS 15 / Intel Mac before relying on it there.
9595

9696
## Steam build
9797

98+
There are two Steam apps built from this engine, selected with `--steam-variant`:
99+
100+
| variant | game | AppID | define | data file | icon |
101+
|---------|------|-------|--------|-----------|------|
102+
| `tss` (default) | DROD: The Second Sky | 351320 | `-DSTEAMBUILD_TSS_APP` | `drod-tss5_0.dat` | `assets/TSS` |
103+
| `gateb` | Gunthro and the Epic Blunder | 314330 | (none) | `drod5_0.dat` | `assets/GatEB` |
104+
98105
```
99-
./build_macos.sh --steam --universal --steam-sdk /path/to/steamworks-sdk
106+
./build_macos.sh --steam-variant gateb --universal --steam-sdk /path/to/steamworks-sdk
107+
./build_macos.sh --steam-variant tss --universal # (--steam is shorthand for tss)
100108
```
101109

102-
This builds with `-DSTEAMBUILD -DSTEAMBUILD_TSS_APP` (the TSS Steam app: data file
103-
`drod-tss5_0.dat`, game name `drod-tss`) and links `libsteam_api`. Details:
110+
Both build with `-DSTEAMBUILD` and link `libsteam_api`; `tss` adds `-DSTEAMBUILD_TSS_APP`.
111+
The variant table (AppIDs etc.) lives near the top of `build_macos.sh`. Details:
104112
- `--steam-sdk` points at an unpacked Steamworks SDK (default `~/Developer/steam-sdk`);
105113
its `public/steam` headers are added to the include path.
106-
- `libsteam_api.dylib` is taken from the SDK's `redistributable_bin/osx/` (override
107-
with `--steam-lib`), staged into `deps/lib`, vendored into the bundle, and signed.
108-
- A Steam build is normally launched through the Steam client (which supplies the
109-
app id), so the shipped bundle contains no `steam_appid.txt`.
110-
- To run a Steam build **outside** Steam for local testing, provision a gitignored
111-
AppID file once: `./build_macos.sh --steam --steam-appid <id> …`. That writes
112-
`Master/Darwin/steam_appid.txt` (gitignored), and every subsequent Steam build
113-
copies it next to the executable so `SteamAPI_Init` works without Steam launching
114-
it. **Never upload that file to the Steam depot** — delete
115-
`Master/Darwin/steam_appid.txt` to build a clean shippable app.
116-
- Just the binary: `make drod-steam STEAM_SDK=/path/to/steamworks-sdk`.
114+
- `libsteam_api.dylib` is taken from the SDK's `redistributable_bin/osx/` (override with
115+
`--steam-lib`), staged into `deps/lib`, vendored into the bundle, and signed.
116+
- Game data comes from the per-app dir `Master/Darwin/localdata/<App>/` (`TSS`/`GatEB`,
117+
gitignored) by default; override with `--dat-dir`. The app icon comes from the committed
118+
`Master/Darwin/assets/<App>/` (its `DROD.icns`, plus any icon bitmaps overlaid onto the
119+
shared drodData ones). Switching variants cleans the shared `steam/` build dir
120+
automatically, so no manual clean is needed.
121+
- A Steam build is normally launched through the Steam client (which supplies the app id),
122+
so the shipped bundle contains no `steam_appid.txt`. To run **outside** Steam for local
123+
testing, add `--steam-appid`: it writes the variant's AppID to
124+
`Contents/MacOS/steam_appid.txt` in the bundle. **Never upload that file to the depot**
125+
omit `--steam-appid` for a clean shippable app.
126+
- Just the binary: `make drod-steam STEAM_SDK=/path/... [STEAM_TSS=1]` (STEAM_TSS=1 = TSS).
127+
128+
## Standalone older games (KDD / JtRH / TCB / GatEB)
129+
130+
The same engine also builds the older games as **standalone** (non-Steam) apps,
131+
selected with `--game`. Each is gated behind its own compile-time define and
132+
looks for its own data file:
133+
134+
| `--game` | game | define | data file | app / icon / data folder |
135+
|----------|------|--------|-----------|--------------------------|
136+
| `kdd` | King Dugan's Dungeon | `-DKDD_STANDALONE` | `drod-kdd5_0.dat` | `KDD` |
137+
| `jtrh` | Journey to Rooted Hold | `-DJTRH_STANDALONE` | `drod-jtrh5_0.dat` | `JtRH` |
138+
| `tcb` | The City Beneath | `-DTCB_STANDALONE` | `drod-tcb5_0.dat` | `TCB` |
139+
| `gateb` | Gunthro and the Epic Blunder| `-DGATEB_STANDALONE` | `drod-gateb5_0.dat` | `GatEB` |
140+
141+
```
142+
./build_macos.sh --game kdd # -> "DROD KDD.app"
143+
./build_macos.sh --game tcb --universal
144+
```
145+
146+
- `--game` cannot be combined with `--steam` (these are standalone builds).
147+
- App name defaults to `DROD <App>` (override with `--name`); the icon comes from
148+
`Master/Darwin/assets/<App>/DROD.icns` (falls back to the TSS icon with a warning
149+
if not present yet), and branded `Icon*.bmp` from the same folder.
150+
- Game data comes from `Master/Darwin/localdata/<App>/` (gitignored) by default.
151+
The build copies **only this game's** data set — `drod-<game>5_0.dat` plus its
152+
`drod-<game>5_0_NN.dat` add-on packs — so a folder shared with another game's
153+
dats (e.g. Steam GatEB's `drod5_0*.dat` alongside standalone GatEB's
154+
`drod-gateb5_0*.dat` in `localdata/GatEB/`) never leaks mismatched data into the
155+
bundle.
156+
- Switching game/variant cleans the reused `custom/` (or `release`/`debug`) build
157+
dir automatically, since make can't see the changed `-D` flag.
158+
- Just the binary: `make drod-custom GAME=kdd` (or `jtrh`/`tcb`/`gateb`).
159+
160+
## Demo build (TSS)
161+
162+
```
163+
./build_macos.sh --demo # -> "DROD TSS Demo.app"
164+
```
165+
166+
There is **no demo compile flag** — a TSS demo is the *plain* TSS binary (data
167+
`drod5_0.dat`) shipping a demo hold. The engine decides demo-vs-full at runtime in
168+
`CDrodScreen::IsGameFullVersion()`: a build is a demo when its installed hold has
169+
≤50 level entrances (`EntrancesInFullVersion()`), which enables the "Buy Now" menu
170+
item and the sell/buy screens.
171+
172+
`--demo` is purely a convenience: it brands the app `DROD TSS Demo` and sources the
173+
demo `drod5_0.dat` from `Master/Darwin/localdata/TSS-Demo/` (gitignored), keeping it
174+
apart from the Steam TSS data in `localdata/TSS/` (`drod-tss5_0.dat`). It is the
175+
same binary as a full standalone TSS, so it shares the `custom/` build objects — no
176+
recompile when switching between them. TSS-standalone only (not with `--game` /
177+
`--steam`).

Master/Darwin/Config

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,33 @@ CXXFLAGS_custom = -Wno-unused -pipe -O2 -fomit-frame-pointer -ffast-math
3838
CXXFLAGS_release = -Wno-unused -pipe -O2 -fomit-frame-pointer -ffast-math
3939
CXXFLAGS_debug = -Wno-unused -pipe -ggdb -D_DEBUG -ffast-math
4040

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

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

54+
# Standalone game selection. The TSS engine builds several older games from the
55+
# same source, each gated behind a compile-time define (see wszUniqueResFile /
56+
# GAMETITLE in DROD/Main.cpp and GetOfficialHoldStatus in DRODLib/DbHolds.cpp).
57+
# Pass GAME=<kdd|jtrh|tcb|gateb> on the make command line (or via build_macos.sh
58+
# --game) to build that standalone game; leaving it unset builds plain TSS.
59+
GAME ?=
60+
GAME_DEFINE = \
61+
$(if $(filter kdd,$(GAME)),-DKDD_STANDALONE) \
62+
$(if $(filter jtrh,$(GAME)),-DJTRH_STANDALONE) \
63+
$(if $(filter tcb,$(GAME)),-DTCB_STANDALONE) \
64+
$(if $(filter gateb,$(GAME)),-DGATEB_STANDALONE)
65+
5066
# Build variant selection.
51-
VARIANT_FLAGS = -DUSE_SDL_MIXER -DCARAVELBUILD
67+
VARIANT_FLAGS = -DUSE_SDL_MIXER -DCARAVELBUILD $(GAME_DEFINE)
5268

5369
###########################################
5470
### <2> Library locations ###
45.1 KB
Binary file not shown.
64.1 KB
Binary file not shown.
75.1 KB
Binary file not shown.

Master/Darwin/assets/KDD/DROD.icns

75.1 KB
Binary file not shown.

Master/Darwin/assets/TCB/DROD.icns

39.8 KB
Binary file not shown.
48.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)