# zeffuro/x-files-pc-enhancement-patch architecture

> Architecture diagram of the GitHub repository zeffuro/x-files-pc-enhancement-patch, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zeffuro/x-files-pc-enhancement-patch
- Repository: https://github.com/zeffuro/x-files-pc-enhancement-patch

## Overview

The X-Files PC Enhancement Patch installs and launches supported game editions, then augments gameplay on modern Windows. The main user journey is setup from game media to an installed game, followed by launch into the patched game; players can configure display and controller behavior, use enhanced saves and subtitles, and request local diagnostic reports. The tree and README establish the product’s major subsystems; sampled excerpts confirm launcher setup of media/save environment and DLL hook installation, but not all runtime call wiring.

Main entry points: [`src/launcher/application.cpp`](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/launcher/application.cpp) (Game launcher), [`src/dllmain.cpp`](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/dllmain.cpp) (Compatibility hooks), [`src/setup/dialog.cpp`](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/setup/dialog.cpp) (Setup workflow), [`src/enhancements/controller.cpp`](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/enhancements/controller.cpp) (Controller support)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_install["Setup and launch"]
  node_setup["Setup workflow<br/>[dialog.cpp]"]
  node_media_setup["Media discovery<br/>[media.cpp]"]
  node_staging["Game staging<br/>[staging.cpp]"]
  node_launcher["Game launcher<br/>[application.cpp]"]
end

subgraph group_runtime["Game compatibility"]
  node_patch["Patch runtime<br/>[runtime.cpp]"]
  node_hooks["Compatibility hooks<br/>[dllmain.cpp]"]
  node_preferences[("Settings storage<br/>[store.cpp]")]
end

subgraph group_playback["Media and display"]
  node_movie["Movie decoding<br/>[movie.cpp]"]
  node_playback["Playback pipeline<br/>[movie.cpp]"]
  node_dvd["DVD playback<br/>[player.cpp]"]
  node_display["Windowed display<br/>[graphics.cpp]"]
end

subgraph group_enhance["Gameplay enhancements"]
  node_controller["Controller support<br/>[controller.cpp]"]
  node_gameplay["Game interactions<br/>[dialogue.cpp]"]
  node_subtitle_ui["Subtitle options"]
end

subgraph group_support["Saves and diagnostics"]
  node_saves["Save browser<br/>[browser.cpp]"]
  node_save_storage[("Save storage<br/>[storage.cpp]")]
  node_reports["Diagnostic reports<br/>[report.cpp]"]
end

node_user(("Player"))
node_game["X-Files game"]
node_xinput["XInput device"]
node_windows["Windows platform"]

node_user -->|"selects game media"| node_setup
node_setup -->|"discovers media"| node_media_setup
node_setup -->|"installs game"| node_staging
node_user -->|"starts game"| node_launcher
node_launcher -->|"launches"| node_game
node_launcher -->|"prepares saves"| node_save_storage
node_launcher -->|"configures runtime"| node_patch
node_game -->|"loads patch hooks"| node_hooks
node_hooks -->|"installs preference hooks"| node_preferences
node_hooks -->|"installs media hooks"| node_movie
node_hooks -->|"installs save hooks"| node_saves
node_movie -->|"provides decoded media"| node_playback
node_dvd -->|"uses movie decoding"| node_movie
node_user -->|"plays with controller"| node_controller
node_controller -->|"polls input"| node_xinput
node_controller -->|"routes game input"| node_gameplay
node_user -->|"configures subtitles"| node_subtitle_ui
node_user -->|"manages saves"| node_saves
node_saves -->|"reads and writes"| node_save_storage
node_user -->|"requests report"| node_reports
node_launcher -->|"records launch diagnostics"| node_reports
node_patch -->|"supports display modes"| node_display
node_windows -->|"hosts runtime"| node_patch

click node_setup "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/setup/dialog.cpp"
click node_media_setup "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/setup/media.cpp"
click node_staging "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/launcher/staging.cpp"
click node_launcher "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/launcher/application.cpp"
click node_patch "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/runtime.cpp"
click node_hooks "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/dllmain.cpp"
click node_preferences "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/preferences/store.cpp"
click node_movie "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/media/movie.cpp"
click node_playback "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/playback/movie.cpp"
click node_dvd "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/dvd/player.cpp"
click node_display "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/graphics.cpp"
click node_controller "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/enhancements/controller.cpp"
click node_gameplay "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/enhancements/dialogue.cpp"
click node_subtitle_ui "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/enhancements/ui/subtitle_dialog.cpp"
click node_saves "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/saves/browser.cpp"
click node_save_storage "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/saves/storage.cpp"
click node_reports "https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/diagnostics/report.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_setup,node_media_setup,node_staging,node_launcher toneBlue
class node_patch,node_hooks,node_preferences toneAmber
class node_movie,node_playback,node_dvd,node_display toneMint
class node_controller,node_gameplay,node_subtitle_ui toneRose
class node_saves,node_save_storage,node_reports,node_user,node_game,node_xinput,node_windows toneIndigo
```

## Components

### Setup and launch

- [Setup workflow](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/setup/dialog.cpp): `src/setup/dialog.cpp`
- [Media discovery](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/setup/media.cpp): `src/setup/media.cpp`
- [Game staging](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/launcher/staging.cpp): `src/launcher/staging.cpp`
- [Game launcher](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/launcher/application.cpp): `src/launcher/application.cpp`

### Game compatibility

- [Patch runtime](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/runtime.cpp): `src/runtime.cpp`
- [Compatibility hooks](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/dllmain.cpp): `src/dllmain.cpp`
- [Settings storage](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/preferences/store.cpp): `src/preferences/store.cpp`

### Media and display

- [Movie decoding](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/media/movie.cpp): `src/media/movie.cpp`
- [Playback pipeline](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/playback/movie.cpp): `src/playback/movie.cpp`
- [DVD playback](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/dvd/player.cpp): `src/dvd/player.cpp`
- [Windowed display](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/graphics.cpp): `src/graphics.cpp`

### Gameplay enhancements

- [Controller support](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/enhancements/controller.cpp): `src/enhancements/controller.cpp`
- [Game interactions](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/enhancements/dialogue.cpp): `src/enhancements/dialogue.cpp`
- [Subtitle options](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/enhancements/ui/subtitle_dialog.cpp): `src/enhancements/ui/subtitle_dialog.cpp`

### Saves and diagnostics

- [Save browser](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/saves/browser.cpp): `src/saves/browser.cpp`
- [Save storage](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/saves/storage.cpp): `src/saves/storage.cpp`
- [Diagnostic reports](https://github.com/zeffuro/x-files-pc-enhancement-patch/blob/main/src/diagnostics/report.cpp): `src/diagnostics/report.cpp`

### Other components

- **Player**
- **X-Files game**
- **XInput device**
- **Windows platform**

## Connections

- Player → Setup workflow: selects game media
- Setup workflow → Media discovery: discovers media
- Setup workflow → Game staging: installs game
- Player → Game launcher: starts game
- Game launcher → X-Files game: launches
- Game launcher → Save storage: prepares saves
- Game launcher → Patch runtime: configures runtime
- X-Files game → Compatibility hooks: loads patch hooks
- Compatibility hooks → Settings storage: installs preference hooks
- Compatibility hooks → Movie decoding: installs media hooks
- Compatibility hooks → Save browser: installs save hooks
- Movie decoding → Playback pipeline: provides decoded media
- DVD playback → Movie decoding: uses movie decoding
- Player → Controller support: plays with controller
- Controller support → XInput device: polls input
- Controller support → Game interactions: routes game input
- Player → Subtitle options: configures subtitles
- Player → Save browser: manages saves
- Save browser → Save storage: reads and writes
- Player → Diagnostic reports: requests report
- Game launcher → Diagnostic reports: records launch diagnostics
- Patch runtime → Windowed display: supports display modes
- Windows platform → Patch runtime: hosts runtime
