# greygxds/spl-resourceloader architecture

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

- Interactive diagram: https://gitdiagram.com/greygxds/spl-resourceloader
- Repository: https://github.com/greygxds/spl-resourceloader

## Overview

resourceLoader is a GTA V Legacy single-player mod that loads FiveM-style resource folders and .rpf mods. Its main workflow is game startup through the loader, discovery and manifest parsing, then a staged streaming plan that registers assets and data with the game. The graph also shows mod archive handling and the game-memory bridge. The README documents these product capabilities; sampled source confirms orchestration and streaming/backend responsibilities, but does not expose every connection in the mod or manifest subsystems.

Main entry points: [`src/core/Application.cpp`](https://github.com/greygxds/spl-resourceloader/blob/main/src/core/Application.cpp) (Application), [`src/resource/ResourceManager.cpp`](https://github.com/greygxds/spl-resourceloader/blob/main/src/resource/ResourceManager.cpp) (Resource manager), [`src/mods/ModsScanner.cpp`](https://github.com/greygxds/spl-resourceloader/blob/main/src/mods/ModsScanner.cpp) (Mods scanner), [`src/streaming/StreamingManager.cpp`](https://github.com/greygxds/spl-resourceloader/blob/main/src/streaming/StreamingManager.cpp) (Streaming manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and configuration"]
  node_entry["ASI entry<br/>[Entry.cpp]"]
  node_app["Application<br/>[Application.cpp]"]
  node_config["Config loader<br/>[ConfigLoader.cpp]"]
  node_paths["Game paths<br/>[Paths.cpp]"]
end

subgraph group_inputs["Resource and mod inputs"]
  node_resources["Resource manager"]
  node_resource_scan["Resource scanner"]
  node_manifest_loader["Manifest loader"]
  node_manifest_parser["Manifest parser<br/>[ManifestParser.cpp]"]
  node_mods_scan["Mods scanner<br/>[ModsScanner.cpp]"]
  node_mod_catalog["Mod catalog<br/>[ModCatalog.cpp]"]
  node_mod_layout["Mod layout<br/>[ModLayout.cpp]"]
  node_rpf_reader["RPF reader<br/>[RpfReader.cpp]"]
end

subgraph group_streaming["Streaming workflow"]
  node_plan["Streaming plan<br/>[StreamingPlan.cpp]"]
  node_asset_scan["Asset scanner<br/>[AssetScanner.cpp]"]
  node_stream_manager["Streaming manager"]
  node_registry["Asset registry<br/>[AssetRegistry.cpp]"]
end

subgraph group_game["Game integration"]
  node_backend["RAGE backend"]
  node_bridge["RAGE bridge<br/>[RageBridge.cpp]"]
  node_file_devices["Game file devices"]
  node_hook_manager["Hook manager<br/>[HookManager.cpp]"]
end

subgraph group_ops["Diagnostics"]
  node_logger["Logger<br/>[Logger.cpp]"]
  node_crash_handler["Crash handler<br/>[CrashHandler.cpp]"]
end

node_game_user(("Player"))
node_scripthook["ScriptHookV"]
node_gta(("GTA V"))

node_game_user -->|"launches"| node_gta
node_scripthook -->|"loads ASI"| node_entry
node_entry -->|"starts"| node_app
node_app -->|"loads settings"| node_config
node_app -->|"resolves paths"| node_paths
node_app -->|"discovers resources"| node_resources
node_resources -->|"scans folders"| node_resource_scan
node_resources -->|"loads manifests"| node_manifest_loader
node_manifest_loader -->|"parses manifest"| node_manifest_parser
node_app -->|"scans mods"| node_mods_scan
node_mods_scan -->|"reads archives"| node_rpf_reader
node_mods_scan -->|"catalogs mods"| node_mod_catalog
node_mod_catalog -->|"lays out mods"| node_mod_layout
node_app -->|"builds plan"| node_plan
node_plan -->|"scans assets"| node_asset_scan
node_app -->|"pumps stages"| node_stream_manager
node_stream_manager -->|"dispatches work"| node_backend
node_stream_manager -->|"records assets"| node_registry
node_backend -->|"uses game APIs"| node_bridge
node_bridge -->|"initializes devices"| node_file_devices
node_bridge -->|"resolves game memory"| node_gta
node_app -->|"sets up hooks"| node_hook_manager
node_hook_manager -->|"hooks functions"| node_gta
node_app -->|"reports startup"| node_logger
node_crash_handler -->|"records crash"| node_logger
node_app -->|"installs handler"| node_crash_handler

click node_entry "https://github.com/greygxds/spl-resourceloader/blob/main/src/main/Entry.cpp"
click node_app "https://github.com/greygxds/spl-resourceloader/blob/main/src/core/Application.cpp"
click node_config "https://github.com/greygxds/spl-resourceloader/blob/main/src/config/ConfigLoader.cpp"
click node_paths "https://github.com/greygxds/spl-resourceloader/blob/main/src/core/Paths.cpp"
click node_resources "https://github.com/greygxds/spl-resourceloader/blob/main/src/resource/ResourceManager.cpp"
click node_resource_scan "https://github.com/greygxds/spl-resourceloader/blob/main/src/resource/ResourceScanner.cpp"
click node_manifest_loader "https://github.com/greygxds/spl-resourceloader/blob/main/src/manifest/LuaManifestLoader.cpp"
click node_manifest_parser "https://github.com/greygxds/spl-resourceloader/blob/main/src/manifest/ManifestParser.cpp"
click node_mods_scan "https://github.com/greygxds/spl-resourceloader/blob/main/src/mods/ModsScanner.cpp"
click node_mod_catalog "https://github.com/greygxds/spl-resourceloader/blob/main/src/mods/ModCatalog.cpp"
click node_mod_layout "https://github.com/greygxds/spl-resourceloader/blob/main/src/mods/ModLayout.cpp"
click node_rpf_reader "https://github.com/greygxds/spl-resourceloader/blob/main/src/rpf/RpfReader.cpp"
click node_plan "https://github.com/greygxds/spl-resourceloader/blob/main/src/streaming/StreamingPlan.cpp"
click node_asset_scan "https://github.com/greygxds/spl-resourceloader/blob/main/src/streaming/AssetScanner.cpp"
click node_stream_manager "https://github.com/greygxds/spl-resourceloader/blob/main/src/streaming/StreamingManager.cpp"
click node_registry "https://github.com/greygxds/spl-resourceloader/blob/main/src/streaming/AssetRegistry.cpp"
click node_backend "https://github.com/greygxds/spl-resourceloader/blob/main/src/rage/RageStreamingBackend.cpp"
click node_bridge "https://github.com/greygxds/spl-resourceloader/blob/main/src/rage/RageBridge.cpp"
click node_file_devices "https://github.com/greygxds/spl-resourceloader/blob/main/src/rage/FileDeviceInterface.cpp"
click node_hook_manager "https://github.com/greygxds/spl-resourceloader/blob/main/src/hooking/HookManager.cpp"
click node_logger "https://github.com/greygxds/spl-resourceloader/blob/main/src/logging/Logger.cpp"
click node_crash_handler "https://github.com/greygxds/spl-resourceloader/blob/main/src/core/CrashHandler.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_entry,node_app,node_config,node_paths toneBlue
class node_resources,node_resource_scan,node_manifest_loader,node_manifest_parser,node_mods_scan,node_mod_catalog,node_mod_layout,node_rpf_reader toneAmber
class node_plan,node_asset_scan,node_stream_manager,node_registry toneMint
class node_backend,node_bridge,node_file_devices,node_hook_manager toneRose
class node_logger,node_crash_handler,node_game_user,node_scripthook,node_gta toneIndigo
```

## Components

### Startup and configuration

- [ASI entry](https://github.com/greygxds/spl-resourceloader/blob/main/src/main/Entry.cpp): `src/main/Entry.cpp`
- [Application](https://github.com/greygxds/spl-resourceloader/blob/main/src/core/Application.cpp): `src/core/Application.cpp`
- [Config loader](https://github.com/greygxds/spl-resourceloader/blob/main/src/config/ConfigLoader.cpp): `src/config/ConfigLoader.cpp`
- [Game paths](https://github.com/greygxds/spl-resourceloader/blob/main/src/core/Paths.cpp): `src/core/Paths.cpp`

### Resource and mod inputs

- [Resource manager](https://github.com/greygxds/spl-resourceloader/blob/main/src/resource/ResourceManager.cpp): `src/resource/ResourceManager.cpp`
- [Resource scanner](https://github.com/greygxds/spl-resourceloader/blob/main/src/resource/ResourceScanner.cpp): `src/resource/ResourceScanner.cpp`
- [Manifest loader](https://github.com/greygxds/spl-resourceloader/blob/main/src/manifest/LuaManifestLoader.cpp): `src/manifest/LuaManifestLoader.cpp`
- [Manifest parser](https://github.com/greygxds/spl-resourceloader/blob/main/src/manifest/ManifestParser.cpp): `src/manifest/ManifestParser.cpp`
- [Mods scanner](https://github.com/greygxds/spl-resourceloader/blob/main/src/mods/ModsScanner.cpp): `src/mods/ModsScanner.cpp`
- [Mod catalog](https://github.com/greygxds/spl-resourceloader/blob/main/src/mods/ModCatalog.cpp): `src/mods/ModCatalog.cpp`
- [Mod layout](https://github.com/greygxds/spl-resourceloader/blob/main/src/mods/ModLayout.cpp): `src/mods/ModLayout.cpp`
- [RPF reader](https://github.com/greygxds/spl-resourceloader/blob/main/src/rpf/RpfReader.cpp): `src/rpf/RpfReader.cpp`

### Streaming workflow

- [Streaming plan](https://github.com/greygxds/spl-resourceloader/blob/main/src/streaming/StreamingPlan.cpp): `src/streaming/StreamingPlan.cpp`
- [Asset scanner](https://github.com/greygxds/spl-resourceloader/blob/main/src/streaming/AssetScanner.cpp): `src/streaming/AssetScanner.cpp`
- [Streaming manager](https://github.com/greygxds/spl-resourceloader/blob/main/src/streaming/StreamingManager.cpp): `src/streaming/StreamingManager.cpp`
- [Asset registry](https://github.com/greygxds/spl-resourceloader/blob/main/src/streaming/AssetRegistry.cpp): `src/streaming/AssetRegistry.cpp`

### Game integration

- [RAGE backend](https://github.com/greygxds/spl-resourceloader/blob/main/src/rage/RageStreamingBackend.cpp): `src/rage/RageStreamingBackend.cpp`
- [RAGE bridge](https://github.com/greygxds/spl-resourceloader/blob/main/src/rage/RageBridge.cpp): `src/rage/RageBridge.cpp`
- [Game file devices](https://github.com/greygxds/spl-resourceloader/blob/main/src/rage/FileDeviceInterface.cpp): `src/rage/FileDeviceInterface.cpp`
- [Hook manager](https://github.com/greygxds/spl-resourceloader/blob/main/src/hooking/HookManager.cpp): `src/hooking/HookManager.cpp`

### Diagnostics

- [Logger](https://github.com/greygxds/spl-resourceloader/blob/main/src/logging/Logger.cpp): `src/logging/Logger.cpp`
- [Crash handler](https://github.com/greygxds/spl-resourceloader/blob/main/src/core/CrashHandler.cpp): `src/core/CrashHandler.cpp`

### Other components

- **Player**
- **ScriptHookV**
- **GTA V**

## Connections

- Player → GTA V: launches
- ScriptHookV → ASI entry: loads ASI
- ASI entry → Application: starts
- Application → Config loader: loads settings
- Application → Game paths: resolves paths
- Application → Resource manager: discovers resources
- Resource manager → Resource scanner: scans folders
- Resource manager → Manifest loader: loads manifests
- Manifest loader → Manifest parser: parses manifest
- Application → Mods scanner: scans mods
- Mods scanner → RPF reader: reads archives
- Mods scanner → Mod catalog: catalogs mods
- Mod catalog → Mod layout: lays out mods
- Application → Streaming plan: builds plan
- Streaming plan → Asset scanner: scans assets
- Application → Streaming manager: pumps stages
- Streaming manager → RAGE backend: dispatches work
- Streaming manager → Asset registry: records assets
- RAGE backend → RAGE bridge: uses game APIs
- RAGE bridge → Game file devices: initializes devices
- RAGE bridge → GTA V: resolves game memory
- Application → Hook manager: sets up hooks
- Hook manager → GTA V: hooks functions
- Application → Logger: reports startup
- Crash handler → Logger: records crash
- Application → Crash handler: installs handler
