# oaleex/openshao architecture

> Architecture diagram of the GitHub repository oaleex/openshao, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/oaleex/openshao
- Repository: https://github.com/oaleex/openshao

## Overview

OpenShao is a native PC port of Mortal Kombat: Shaolin Monks, running a statically recompiled Xbox game. The user-facing path is launcher setup and game selection, followed by game startup, input, rendering, and persistent saves. Separate branches cover mod management, photo mode, and pipeline preparation. The README documents capabilities and the launch flow; source evidence is sampled unevenly, so unsampled subsystem links are omitted rather than inferred as calls.

Main entry points: [`src/linux/vk/vk_backend.cpp`](https://github.com/oaleex/openshao/blob/main/src/linux/vk/vk_backend.cpp) (Vulkan Backend), [`src/launcher.h`](https://github.com/oaleex/openshao/blob/main/src/launcher.h) (Launcher), [`src/linux/linux_main.cpp`](https://github.com/oaleex/openshao/blob/main/src/linux/linux_main.cpp) (Linux Entry), [`src/photo_mode.h`](https://github.com/oaleex/openshao/blob/main/src/photo_mode.h) (Photo Mode)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch and Setup"]
  node_launcher["Launcher<br/>[launcher.h]"]
  node_linux_entry["Linux Entry<br/>[linux_main.cpp]"]
  node_updater["Updater<br/>[updater.cpp]"]
end

subgraph group_game["Game Runtime"]
  node_host["Game Host<br/>[host.h]"]
  node_controls["Input Controls<br/>[input_bindings.h]"]
  node_campaign["Campaign<br/>[campaign_moves.cpp]"]
  node_survival["Survival Mode<br/>[survival_mode.cpp]"]
  node_difficulty["Difficulty<br/>[difficulty.cpp]"]
end

subgraph group_graphics["Graphics"]
  node_vulkan["Vulkan Backend<br/>[vk_backend.cpp]"]
  node_vk_api["Vulkan API<br/>[vk_api.h]"]
  node_aspect["Aspect Ratio<br/>[aspect_ratio.h]"]
  node_pipeline_assets["Pipeline Assets"]
  node_precompile["Pipeline Precompile"]
  node_screen_state["Screen Pipeline State"]
end

subgraph group_extensions["Mods and Enhancements"]
  node_photo["Photo Mode<br/>[photo_mode.h]"]
  node_photo_effects["Photo Effects"]
  node_mods["Mod Manager<br/>[manager.cpp]"]
  node_mod_routines["Mod Routines<br/>[routines.h]"]
  node_language["Language Packs<br/>[language_pack.h]"]
end

subgraph group_state["Persistence"]
  node_save[("Save Storage<br/>[save_storage.cpp]")]
  node_runtime_paths["Runtime Paths<br/>[runtime_paths.h]"]
end

node_player(("Player"))

node_player -->|"chooses game"| node_launcher
node_launcher -->|"starts game"| node_linux_entry
node_linux_entry -->|"configures"| node_host
node_linux_entry -->|"loads input"| node_controls
node_linux_entry -->|"initializes"| node_photo
node_host -->|"uses storage"| node_save
node_player -->|"plays with"| node_controls
node_player -->|"selects fighters"| node_campaign
node_player -->|"chooses mode"| node_survival
node_player -->|"sets difficulty"| node_difficulty
node_player -->|"captures photos"| node_photo
node_vulkan -->|"uses API"| node_vk_api
node_vulkan -->|"starts pipelines"| node_pipeline_assets
node_vulkan -->|"builds pipelines"| node_precompile
node_vulkan -->|"supports mode"| node_photo
node_pipeline_assets -->|"includes state"| node_screen_state
node_pipeline_assets -->|"uses precompiler"| node_precompile
node_photo -.->|"offers effects"| node_photo_effects
node_player -->|"manages mods"| node_mods
node_mods -->|"uses routines"| node_mod_routines
node_player -->|"chooses language"| node_language
node_player -->|"requests update"| node_updater
node_launcher -->|"checks updates"| node_updater
node_player -->|"stores progress"| node_save
node_launcher -.->|"accesses files"| node_runtime_paths
node_vulkan -.->|"adapts display"| node_aspect

click node_launcher "https://github.com/oaleex/openshao/blob/main/src/launcher.h"
click node_linux_entry "https://github.com/oaleex/openshao/blob/main/src/linux/linux_main.cpp"
click node_host "https://github.com/oaleex/openshao/blob/main/src/host.h"
click node_controls "https://github.com/oaleex/openshao/blob/main/src/input_bindings.h"
click node_campaign "https://github.com/oaleex/openshao/blob/main/src/campaign_moves.cpp"
click node_survival "https://github.com/oaleex/openshao/blob/main/src/survival_mode.cpp"
click node_difficulty "https://github.com/oaleex/openshao/blob/main/src/difficulty.cpp"
click node_save "https://github.com/oaleex/openshao/blob/main/src/save_storage.cpp"
click node_runtime_paths "https://github.com/oaleex/openshao/blob/main/src/runtime_paths.h"
click node_vulkan "https://github.com/oaleex/openshao/blob/main/src/linux/vk/vk_backend.cpp"
click node_vk_api "https://github.com/oaleex/openshao/blob/main/src/linux/vk/vk_api.h"
click node_aspect "https://github.com/oaleex/openshao/blob/main/src/aspect_ratio.h"
click node_pipeline_assets "https://github.com/oaleex/openshao/blob/main/src/pipeline_assets.cpp"
click node_precompile "https://github.com/oaleex/openshao/blob/main/src/pipeline_precompile.cpp"
click node_screen_state "https://github.com/oaleex/openshao/blob/main/src/pipeline_screen_state.h"
click node_photo "https://github.com/oaleex/openshao/blob/main/src/photo_mode.h"
click node_photo_effects "https://github.com/oaleex/openshao/blob/main/src/photo_mode_effects.h"
click node_mods "https://github.com/oaleex/openshao/blob/main/src/mods/manager.cpp"
click node_mod_routines "https://github.com/oaleex/openshao/blob/main/src/mods/routines.h"
click node_language "https://github.com/oaleex/openshao/blob/main/src/language_pack.h"
click node_updater "https://github.com/oaleex/openshao/blob/main/src/updater.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_launcher,node_linux_entry,node_updater toneBlue
class node_host,node_controls,node_campaign,node_survival,node_difficulty toneAmber
class node_vulkan,node_vk_api,node_aspect,node_pipeline_assets,node_precompile,node_screen_state toneMint
class node_photo,node_photo_effects,node_mods,node_mod_routines,node_language toneRose
class node_save,node_runtime_paths,node_player toneIndigo
```

## Components

### Launch and Setup

- [Launcher](https://github.com/oaleex/openshao/blob/main/src/launcher.h): `src/launcher.h`
- [Linux Entry](https://github.com/oaleex/openshao/blob/main/src/linux/linux_main.cpp): `src/linux/linux_main.cpp`
- [Updater](https://github.com/oaleex/openshao/blob/main/src/updater.cpp): `src/updater.cpp`

### Game Runtime

- [Game Host](https://github.com/oaleex/openshao/blob/main/src/host.h): `src/host.h`
- [Input Controls](https://github.com/oaleex/openshao/blob/main/src/input_bindings.h): `src/input_bindings.h`
- [Campaign](https://github.com/oaleex/openshao/blob/main/src/campaign_moves.cpp): `src/campaign_moves.cpp`
- [Survival Mode](https://github.com/oaleex/openshao/blob/main/src/survival_mode.cpp): `src/survival_mode.cpp`
- [Difficulty](https://github.com/oaleex/openshao/blob/main/src/difficulty.cpp): `src/difficulty.cpp`

### Graphics

- [Vulkan Backend](https://github.com/oaleex/openshao/blob/main/src/linux/vk/vk_backend.cpp): `src/linux/vk/vk_backend.cpp`
- [Vulkan API](https://github.com/oaleex/openshao/blob/main/src/linux/vk/vk_api.h): `src/linux/vk/vk_api.h`
- [Aspect Ratio](https://github.com/oaleex/openshao/blob/main/src/aspect_ratio.h): `src/aspect_ratio.h`
- [Pipeline Assets](https://github.com/oaleex/openshao/blob/main/src/pipeline_assets.cpp): `src/pipeline_assets.cpp`
- [Pipeline Precompile](https://github.com/oaleex/openshao/blob/main/src/pipeline_precompile.cpp): `src/pipeline_precompile.cpp`
- [Screen Pipeline State](https://github.com/oaleex/openshao/blob/main/src/pipeline_screen_state.h): `src/pipeline_screen_state.h`

### Mods and Enhancements

- [Photo Mode](https://github.com/oaleex/openshao/blob/main/src/photo_mode.h): `src/photo_mode.h`
- [Photo Effects](https://github.com/oaleex/openshao/blob/main/src/photo_mode_effects.h): `src/photo_mode_effects.h`
- [Mod Manager](https://github.com/oaleex/openshao/blob/main/src/mods/manager.cpp): `src/mods/manager.cpp`
- [Mod Routines](https://github.com/oaleex/openshao/blob/main/src/mods/routines.h): `src/mods/routines.h`
- [Language Packs](https://github.com/oaleex/openshao/blob/main/src/language_pack.h): `src/language_pack.h`

### Persistence

- [Save Storage](https://github.com/oaleex/openshao/blob/main/src/save_storage.cpp): `src/save_storage.cpp`
- [Runtime Paths](https://github.com/oaleex/openshao/blob/main/src/runtime_paths.h): `src/runtime_paths.h`

### Other components

- **Player**

## Connections

- Player → Launcher: chooses game
- Launcher → Linux Entry: starts game (evidence: `src/linux/linux_main.cpp`)
- Linux Entry → Game Host: configures (evidence: `src/linux/linux_main.cpp`)
- Linux Entry → Input Controls: loads input (evidence: `src/linux/linux_main.cpp`)
- Linux Entry → Photo Mode: initializes (evidence: `src/linux/linux_main.cpp`)
- Game Host → Save Storage: uses storage (evidence: `src/host.h`)
- Player → Input Controls: plays with
- Player → Campaign: selects fighters
- Player → Survival Mode: chooses mode
- Player → Difficulty: sets difficulty
- Player → Photo Mode: captures photos
- Vulkan Backend → Vulkan API: uses API (evidence: `src/linux/vk/vk_backend.cpp`)
- Vulkan Backend → Pipeline Assets: starts pipelines (evidence: `src/linux/vk/vk_backend.cpp`)
- Vulkan Backend → Pipeline Precompile: builds pipelines (evidence: `src/linux/vk/vk_backend.cpp`)
- Vulkan Backend → Photo Mode: supports mode (evidence: `src/linux/vk/vk_backend.cpp`)
- Pipeline Assets → Screen Pipeline State: includes state (evidence: `src/pipeline_assets.cpp`)
- Pipeline Assets → Pipeline Precompile: uses precompiler
- Photo Mode → Photo Effects: offers effects
- Player → Mod Manager: manages mods
- Mod Manager → Mod Routines: uses routines (evidence: `src/mods/manager.cpp`)
- Player → Language Packs: chooses language
- Player → Updater: requests update
- Launcher → Updater: checks updates
- Player → Save Storage: stores progress
- Launcher → Runtime Paths: accesses files
- Vulkan Backend → Aspect Ratio: adapts display (evidence: `src/linux/vk/vk_backend.cpp`)
