# victorgbd/nfsmw-recompiled architecture

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

- Interactive diagram: https://gitdiagram.com/victorgbd/nfsmw-recompiled
- Repository: https://github.com/victorgbd/nfsmw-recompiled

## Overview

NFSMW Recompiled runs a statically translated native game, with this fork adding an Android frontend and graphics paths plus a Linux game launcher. The Android user configures the game, selects a game image and options, then starts the native runtime; touch controls can send input through a JNI bridge. The Linux launcher provides a separate game-import and launch interface. Source excerpts are partial, so some documented runtime capabilities are shown without speculative call edges.

Main entry points: [`android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java`](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java) (Setup screen), [`android/app/src/main/cpp/android_main.cpp`](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/android_main.cpp) (Android native entry), [`android/app/src/main/java/io/github/nfsmwrecomp/GameActivity.java`](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/GameActivity.java) (Game activity), [`android/app/src/main/cpp/juego.cpp`](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/juego.cpp) (Game integration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_android["Android frontend"]
  node_setup["Setup screen<br/>[SetupActivity.java]"]
  node_prefs[("Preferences<br/>[Ajustes.java]")]
  node_drivers["Graphics drivers<br/>[Drivers.java]"]
  node_language["Language settings<br/>[Idioma.java]"]
  node_gameactivity["Game activity<br/>[GameActivity.java]"]
end

subgraph group_native["Native game"]
  node_android_entry["Android native entry<br/>[android_main.cpp]"]
  node_game_hooks["Game hooks<br/>[ganchos.cpp]"]
  node_game_code["Game integration<br/>[juego.cpp]"]
  node_audio["Audio driver<br/>[aaudio_driver.cpp]"]
  node_render_targets["Render targets<br/>[render_targets.cpp]"]
  node_vulkan_probe["Vulkan probe<br/>[sonda_vulkan.cpp]"]
  node_app_entry["Desktop app entry<br/>[main.cpp]"]
  node_app["Game app<br/>[nfsmw_app.h]"]
  node_game_menu["In-game menu<br/>[nfsmw_menu.cpp]"]
end

subgraph group_linux["Linux launcher"]
  node_launcher_entry["Launcher entry<br/>[main.cpp]"]
  node_launcher_ui["Launcher window<br/>[main_window.cpp]"]
  node_game_config[("Game configuration<br/>[game_config.cpp]")]
  node_import["Game import<br/>[import_service.cpp]"]
end

subgraph group_input["Android input"]
  node_touch_editor["Touch editor"]
  node_touch_view["Touch controls"]
  node_touch_bridge["JNI input bridge"]
end

node_player(("Player"))

node_player -->|"configures"| node_setup
node_setup -->|"reads and writes"| node_prefs
node_setup -->|"uses"| node_language
node_setup -->|"selects"| node_drivers
node_setup -->|"starts"| node_gameactivity
node_gameactivity -->|"reads"| node_prefs
node_gameactivity -->|"displays"| node_touch_view
node_player -->|"edits controls"| node_touch_editor
node_touch_editor -->|"configures"| node_touch_view
node_touch_view -->|"sends state"| node_touch_bridge
node_touch_bridge -.->|"forwards input"| node_android_entry
node_gameactivity -->|"loads native libraries"| node_android_entry
node_android_entry -.->|"initializes audio"| node_audio
node_android_entry -.->|"starts game"| node_game_code
node_game_code -.->|"uses hooks"| node_game_hooks
node_game_code -.->|"renders"| node_render_targets
node_android_entry -.->|"probes Vulkan"| node_vulkan_probe
node_player -.->|"launches"| node_app_entry
node_app_entry -->|"creates"| node_app
node_app -->|"opens menu"| node_game_menu
node_player -->|"launches"| node_launcher_entry
node_launcher_entry -->|"shows"| node_launcher_ui
node_launcher_ui -->|"imports game"| node_import
node_launcher_ui -.->|"configures game"| node_game_config

click node_setup "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java"
click node_prefs "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/Ajustes.java"
click node_drivers "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/Drivers.java"
click node_language "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/Idioma.java"
click node_gameactivity "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/GameActivity.java"
click node_touch_editor "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/EditorTactilActivity.java"
click node_touch_view "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/TouchControllerView.java"
click node_touch_bridge "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/TouchControllerBridge.java"
click node_android_entry "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/android_main.cpp"
click node_game_hooks "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/ganchos.cpp"
click node_game_code "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/juego.cpp"
click node_audio "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/audio/aaudio_driver.cpp"
click node_render_targets "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/render_targets.cpp"
click node_vulkan_probe "https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/sonda_vulkan.cpp"
click node_app_entry "https://github.com/victorgbd/nfsmw-recompiled/blob/main/app/src/main.cpp"
click node_app "https://github.com/victorgbd/nfsmw-recompiled/blob/main/app/src/nfsmw_app.h"
click node_game_menu "https://github.com/victorgbd/nfsmw-recompiled/blob/main/app/src/nfsmw_menu.cpp"
click node_launcher_entry "https://github.com/victorgbd/nfsmw-recompiled/blob/main/launcher-linux/main.cpp"
click node_launcher_ui "https://github.com/victorgbd/nfsmw-recompiled/blob/main/launcher-linux/main_window.cpp"
click node_game_config "https://github.com/victorgbd/nfsmw-recompiled/blob/main/launcher-linux/game_config.cpp"
click node_import "https://github.com/victorgbd/nfsmw-recompiled/blob/main/launcher-linux/import_service.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_prefs,node_drivers,node_language,node_gameactivity toneBlue
class node_android_entry,node_game_hooks,node_game_code,node_audio,node_render_targets,node_vulkan_probe,node_app_entry,node_app,node_game_menu toneAmber
class node_launcher_entry,node_launcher_ui,node_game_config,node_import toneMint
class node_touch_editor,node_touch_view,node_touch_bridge toneRose
class node_player toneIndigo
```

## Components

### Android frontend

- [Setup screen](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java): `android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java`
- [Preferences](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/Ajustes.java): `android/app/src/main/java/io/github/nfsmwrecomp/Ajustes.java`
- [Graphics drivers](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/Drivers.java): `android/app/src/main/java/io/github/nfsmwrecomp/Drivers.java`
- [Language settings](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/Idioma.java): `android/app/src/main/java/io/github/nfsmwrecomp/Idioma.java`
- [Game activity](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/GameActivity.java): `android/app/src/main/java/io/github/nfsmwrecomp/GameActivity.java`

### Native game

- [Android native entry](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/android_main.cpp): `android/app/src/main/cpp/android_main.cpp`
- [Game hooks](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/ganchos.cpp): `android/app/src/main/cpp/ganchos.cpp`
- [Game integration](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/juego.cpp): `android/app/src/main/cpp/juego.cpp`
- [Audio driver](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/audio/aaudio_driver.cpp): `android/app/src/main/cpp/audio/aaudio_driver.cpp`
- [Render targets](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/render_targets.cpp): `android/app/src/main/cpp/render_targets.cpp`
- [Vulkan probe](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/cpp/sonda_vulkan.cpp): `android/app/src/main/cpp/sonda_vulkan.cpp`
- [Desktop app entry](https://github.com/victorgbd/nfsmw-recompiled/blob/main/app/src/main.cpp): `app/src/main.cpp`
- [Game app](https://github.com/victorgbd/nfsmw-recompiled/blob/main/app/src/nfsmw_app.h): `app/src/nfsmw_app.h`
- [In-game menu](https://github.com/victorgbd/nfsmw-recompiled/blob/main/app/src/nfsmw_menu.cpp): `app/src/nfsmw_menu.cpp`

### Linux launcher

- [Launcher entry](https://github.com/victorgbd/nfsmw-recompiled/blob/main/launcher-linux/main.cpp): `launcher-linux/main.cpp`
- [Launcher window](https://github.com/victorgbd/nfsmw-recompiled/blob/main/launcher-linux/main_window.cpp): `launcher-linux/main_window.cpp`
- [Game configuration](https://github.com/victorgbd/nfsmw-recompiled/blob/main/launcher-linux/game_config.cpp): `launcher-linux/game_config.cpp`
- [Game import](https://github.com/victorgbd/nfsmw-recompiled/blob/main/launcher-linux/import_service.cpp): `launcher-linux/import_service.cpp`

### Android input

- [Touch editor](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/EditorTactilActivity.java): `android/app/src/main/java/io/github/nfsmwrecomp/EditorTactilActivity.java`
- [Touch controls](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/TouchControllerView.java): `android/app/src/main/java/io/github/nfsmwrecomp/TouchControllerView.java`
- [JNI input bridge](https://github.com/victorgbd/nfsmw-recompiled/blob/main/android/app/src/main/java/io/github/nfsmwrecomp/TouchControllerBridge.java): `android/app/src/main/java/io/github/nfsmwrecomp/TouchControllerBridge.java`

### Other components

- **Player**

## Connections

- Player → Setup screen: configures (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java`)
- Setup screen → Preferences: reads and writes (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java`)
- Setup screen → Language settings: uses (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java`)
- Setup screen → Graphics drivers: selects (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java`)
- Setup screen → Game activity: starts (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/SetupActivity.java`)
- Game activity → Preferences: reads (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/GameActivity.java`)
- Game activity → Touch controls: displays (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/GameActivity.java`)
- Player → Touch editor: edits controls (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/EditorTactilActivity.java`)
- Touch editor → Touch controls: configures (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/EditorTactilActivity.java`)
- Touch controls → JNI input bridge: sends state (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/TouchControllerView.java`)
- JNI input bridge → Android native entry: forwards input
- Game activity → Android native entry: loads native libraries (evidence: `android/app/src/main/java/io/github/nfsmwrecomp/GameActivity.java`)
- Android native entry → Audio driver: initializes audio
- Android native entry → Game integration: starts game
- Game integration → Game hooks: uses hooks
- Game integration → Render targets: renders
- Android native entry → Vulkan probe: probes Vulkan
- Player → Desktop app entry: launches
- Desktop app entry → Game app: creates (evidence: `app/src/main.cpp`)
- Game app → In-game menu: opens menu (evidence: `app/src/nfsmw_app.h`)
- Player → Launcher entry: launches (evidence: `launcher-linux/main.cpp`)
- Launcher entry → Launcher window: shows (evidence: `launcher-linux/main.cpp`)
- Launcher window → Game import: imports game (evidence: `launcher-linux/main_window.cpp`)
- Launcher window → Game configuration: configures game
