Skip to content

Commit b74e3f4

Browse files
committed
docs: document macOS language fallback logic and update implementation status for music and video features
1 parent fdb3fc8 commit b74e3f4

2 files changed

Lines changed: 49 additions & 3 deletions

File tree

Platform/MacOS/docs/FILE_SYSTEM.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,38 @@ On Windows, `GetStringFromGeneralsRegistry("", "InstallPath")` returns the Base
154154
155155
On macOS, `getStringFromRegistry` is wrapped with `#ifdef __APPLE__`. For the `InstallPath` key, it returns `basePath` discovered by the detector at startup.
156156
157+
### `GetRegistryLanguage()` (Language from Options.ini)
158+
159+
On Windows, the game language is read from the Windows registry. On macOS, `GetRegistryLanguage()` reads the `Language` key from `~/Command and Conquer Generals Zero Hour Data/Options.ini`.
160+
161+
```
162+
Language = russian
163+
```
164+
165+
Fallback: if the key is not found → `"english"`.
166+
167+
> This is called **before** `OptionPreferences` initializes, so the file is parsed manually (line-by-line scan).
168+
169+
### Localized Asset Resolution
170+
171+
The engine uses `GetRegistryLanguage()` to build localized paths for speech, music, and video:
172+
173+
**Audio** (`AudioEventRTS::adjustForLocalization`):
174+
```
175+
1. Data\Audio\Speech\Russian\unit.wav ← localized (from Language)
176+
2. Data\Audio\Speech\unit.wav ← base (no language subfolder)
177+
3. Data\Audio\Speech\English\unit.wav ← English fallback (#ifdef __APPLE__)
178+
```
179+
180+
**Video** (`FFmpegVideoPlayer::open`):
181+
```
182+
1. Data/Russian/Movies/file.bik ← localized
183+
2. Data/English/Movies/file.bik ← English fallback
184+
3. Data\Movies\file.bik ← generic
185+
```
186+
187+
> Steps 3 (audio) and 2 (video) are macOS-specific additions. Without them, non-English locales have no speech or campaign videos because `.big` archives only contain files under `English/` subfolders.
188+
157189
## Core / Platform Duality
158190
159191
Two `StdLocalFileSystem` implementations exist in the project:

Platform/MacOS/docs/IMPLEMENTATION_STATUS.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# macOS Port — Implementation Status
22

3-
> Updated: 2026-04-15
3+
> Updated: 2026-05-27
44
55
---
66

@@ -131,7 +131,8 @@
131131
|| `setDeviceListenerPosition` | Listener position/orientation → AVAudioEnvironmentNode |
132132
|| WAV loading | PCM WAV from disk + `.big` archives, stereo→mono downmix for 3D |
133133
|| Buffer cache | `m_bufferCache` prevents redundant disk reads |
134-
| ⚠️ | Music streaming | MP3/OGG streaming not implemented — music tracks are silent |
134+
|| Music streaming | MP3/AAC/ADPCM via `AVAudioFile` + `avbridge_playStream` |
135+
|| Language fallback | `adjustForLocalization()` → English fallback for speech/music in non-English locales |
135136
| ⚠️ | ADPCM WAV | Only PCM (format=1) supported; ADPCM files silently skipped |
136137

137138
---
@@ -200,11 +201,24 @@
200201

201202
---
202203

203-
## 11. Launcher & Distribution
204+
## 11. Video
205+
206+
| Status | Component | Note |
207+
|:---|:---|:---|
208+
|| `FFmpegVideoPlayer` | Bink → FFmpeg decoder for `.bik` playback (intro, campaign, challenge) |
209+
|| `MacOSVideoAudioStream` | A/V sync via `AVAudioEngine` PCM scheduling |
210+
|| Language fallback | `FFmpegVideoPlayer::open()` → English fallback for localized movie paths |
211+
212+
---
213+
214+
## 12. Launcher & Distribution
204215

205216
| Status | Component | Note |
206217
|:---|:---|:---|
207218
|| `GeneralsLauncher` (SwiftUI) | Folder picker + game data validation + launch with env vars |
219+
|| Game Language picker | 11 languages, reads/writes `Options.ini`, scope `GLOBAL` |
220+
|| Extended settings | Camera height/speed, FPS limiter, stats overlay, network, debug |
221+
|| SteamCMD integration | Automatic asset download from Steam depots |
208222
|| `assemble_distribution.sh` | 6-step pipeline: dylib bundling, rpath cleanup, launcher compile, asset injection, README, ZIP |
209223
|| `dylibbundler` integration | Copies Homebrew `.dylib` deps → `Contents/Frameworks/`, rewrites `@rpath` |
210224
|| `Info.plist` patching | Sets `CFBundleExecutable` to `GeneralsLauncher`, injects `AppIcon.png` |

0 commit comments

Comments
 (0)