# tridoz/herion_hero architecture

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

- Interactive diagram: https://gitdiagram.com/tridoz/herion_hero
- Repository: https://github.com/tridoz/herion_hero

## Overview

This is a C++ SDL3 game engine with gameplay and in-app editing capabilities. The principal runtime path begins in main.cpp, enters Engine, and coordinates input, menus, rendering resources, player state, and rooms. Separate branches cover CML-driven menus, JSON-backed configuration, audio, entity/component behavior, and image/world editing. Relationships below are limited to explicit source-index references and excerpted calls; the README is empty, and unsampled implementation details are not assumed.

Main entry points: [`src/Engine/cpp/Engine.cpp`](https://github.com/tridoz/herion_hero/blob/main/src/Engine/cpp/Engine.cpp) (Engine loop), [`src/UI/cpp/ButtonMenu.cpp`](https://github.com/tridoz/herion_hero/blob/main/src/UI/cpp/ButtonMenu.cpp) (Menu system), [`src/WorldBuilding/cpp/RoomManager.cpp`](https://github.com/tridoz/herion_hero/blob/main/src/WorldBuilding/cpp/RoomManager.cpp) (Room manager), [`src/Textures/cpp/TextureManager.cpp`](https://github.com/tridoz/herion_hero/blob/main/src/Textures/cpp/TextureManager.cpp) (Texture manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Game runtime"]
  node_entry["Application entry<br/>[main.cpp]"]
  node_engine["Engine loop<br/>[Engine.cpp]"]
  node_input["Input processor<br/>[InputProcessor.hpp]"]
end

subgraph group_presentation["UI and rendering"]
  node_menus["Menu system<br/>[ButtonMenu.cpp]"]
  node_menu_views["Menu views<br/>[Menu.cpp]"]
  node_textures["Texture manager<br/>[TextureManager.cpp]"]
  node_windows["Application windows<br/>[Window.cpp]"]
  node_sound["Audio system<br/>[SoundBoard.cpp]"]
end

subgraph group_content["World and entities"]
  node_player["Player entity<br/>[Player.cpp]"]
  node_ecs["Entity components<br/>[ECS.hpp]"]
  node_rooms["Room manager<br/>[RoomManager.cpp]"]
end

subgraph group_configuration["Content configuration"]
  node_lexer["CML lexer<br/>[Lexer.cpp]"]
  node_parser["CML parser<br/>[Parser.cpp]"]
  node_ast["CML syntax tree<br/>[AST.cpp]"]
  node_json["JSON settings<br/>[JSONParser.hpp]"]
end

subgraph group_support["Editing and support"]
  node_editorroom["Room editor<br/>[EditorRoom.cpp]"]
  node_image_editor["Image editor<br/>[ImageEditor.cpp]"]
  node_image["Image data<br/>[Image.cpp]"]
  node_logger["Logging<br/>[Logger.hpp]"]
  node_file_errors["File exceptions"]
end

node_user(("Player"))

node_user -.->|"starts"| node_entry
node_entry -.->|"starts"| node_engine
node_engine -->|"loads textures"| node_textures
node_engine -->|"creates manager"| node_rooms
node_engine -->|"creates editor"| node_editorroom
node_engine -->|"creates editor"| node_image_editor
node_engine -->|"creates player"| node_player
node_engine -->|"loads configuration"| node_menus
node_engine -->|"dispatches events"| node_input
node_engine -->|"creates windows"| node_windows
node_engine -.->|"coordinates audio"| node_sound
node_menus -->|"parses CML"| node_parser
node_parser -->|"builds syntax tree"| node_ast
node_menus -->|"uses views"| node_menu_views
node_menus -->|"uses textures"| node_textures
node_menus -->|"reads settings"| node_json
node_rooms -->|"gets tile textures"| node_textures
node_rooms -->|"reads dimensions"| node_json
node_engine -->|"reads graphics settings"| node_json
node_player -.->|"uses components"| node_ecs
node_image_editor -.->|"uses image data"| node_image
node_engine -->|"handles file errors"| node_file_errors
node_engine -->|"logs errors"| node_logger
node_rooms -->|"handles file errors"| node_file_errors

click node_entry "https://github.com/tridoz/herion_hero/blob/main/main.cpp"
click node_engine "https://github.com/tridoz/herion_hero/blob/main/src/Engine/cpp/Engine.cpp"
click node_input "https://github.com/tridoz/herion_hero/blob/main/src/Utils/hpp/InputProcessor.hpp"
click node_player "https://github.com/tridoz/herion_hero/blob/main/src/Entities/cpp/Player.cpp"
click node_ecs "https://github.com/tridoz/herion_hero/blob/main/src/Entities/hpp/ECS.hpp"
click node_rooms "https://github.com/tridoz/herion_hero/blob/main/src/WorldBuilding/cpp/RoomManager.cpp"
click node_editorroom "https://github.com/tridoz/herion_hero/blob/main/src/WorldBuilding/cpp/EditorRoom.cpp"
click node_menus "https://github.com/tridoz/herion_hero/blob/main/src/UI/cpp/ButtonMenu.cpp"
click node_menu_views "https://github.com/tridoz/herion_hero/blob/main/src/UI/cpp/Menu.cpp"
click node_textures "https://github.com/tridoz/herion_hero/blob/main/src/Textures/cpp/TextureManager.cpp"
click node_windows "https://github.com/tridoz/herion_hero/blob/main/src/UI/cpp/Window.cpp"
click node_sound "https://github.com/tridoz/herion_hero/blob/main/src/Sound/cpp/SoundBoard.cpp"
click node_lexer "https://github.com/tridoz/herion_hero/blob/main/src/ParserCML/cpp/Lexer.cpp"
click node_parser "https://github.com/tridoz/herion_hero/blob/main/src/ParserCML/cpp/Parser.cpp"
click node_ast "https://github.com/tridoz/herion_hero/blob/main/src/ParserCML/cpp/AST.cpp"
click node_json "https://github.com/tridoz/herion_hero/blob/main/src/Utils/hpp/JSONParser.hpp"
click node_image_editor "https://github.com/tridoz/herion_hero/blob/main/src/Editor/cpp/ImageEditor.cpp"
click node_image "https://github.com/tridoz/herion_hero/blob/main/src/Editor/cpp/Image.cpp"
click node_logger "https://github.com/tridoz/herion_hero/blob/main/src/Utils/hpp/Logger.hpp"
click node_file_errors "https://github.com/tridoz/herion_hero/blob/main/src/Exceptions/hpp/HerionFileException.hpp"

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_engine,node_input toneBlue
class node_menus,node_menu_views,node_textures,node_windows,node_sound toneAmber
class node_player,node_ecs,node_rooms toneMint
class node_lexer,node_parser,node_ast,node_json toneRose
class node_editorroom,node_image_editor,node_image,node_logger,node_file_errors,node_user toneIndigo
```

## Components

### Game runtime

- [Application entry](https://github.com/tridoz/herion_hero/blob/main/main.cpp): `main.cpp`
- [Engine loop](https://github.com/tridoz/herion_hero/blob/main/src/Engine/cpp/Engine.cpp): `src/Engine/cpp/Engine.cpp`
- [Input processor](https://github.com/tridoz/herion_hero/blob/main/src/Utils/hpp/InputProcessor.hpp): `src/Utils/hpp/InputProcessor.hpp`

### UI and rendering

- [Menu system](https://github.com/tridoz/herion_hero/blob/main/src/UI/cpp/ButtonMenu.cpp): `src/UI/cpp/ButtonMenu.cpp`
- [Menu views](https://github.com/tridoz/herion_hero/blob/main/src/UI/cpp/Menu.cpp): `src/UI/cpp/Menu.cpp`
- [Texture manager](https://github.com/tridoz/herion_hero/blob/main/src/Textures/cpp/TextureManager.cpp): `src/Textures/cpp/TextureManager.cpp`
- [Application windows](https://github.com/tridoz/herion_hero/blob/main/src/UI/cpp/Window.cpp): `src/UI/cpp/Window.cpp`
- [Audio system](https://github.com/tridoz/herion_hero/blob/main/src/Sound/cpp/SoundBoard.cpp): `src/Sound/cpp/SoundBoard.cpp`

### World and entities

- [Player entity](https://github.com/tridoz/herion_hero/blob/main/src/Entities/cpp/Player.cpp): `src/Entities/cpp/Player.cpp`
- [Entity components](https://github.com/tridoz/herion_hero/blob/main/src/Entities/hpp/ECS.hpp): `src/Entities/hpp/ECS.hpp`
- [Room manager](https://github.com/tridoz/herion_hero/blob/main/src/WorldBuilding/cpp/RoomManager.cpp): `src/WorldBuilding/cpp/RoomManager.cpp`

### Content configuration

- [CML lexer](https://github.com/tridoz/herion_hero/blob/main/src/ParserCML/cpp/Lexer.cpp): `src/ParserCML/cpp/Lexer.cpp`
- [CML parser](https://github.com/tridoz/herion_hero/blob/main/src/ParserCML/cpp/Parser.cpp): `src/ParserCML/cpp/Parser.cpp`
- [CML syntax tree](https://github.com/tridoz/herion_hero/blob/main/src/ParserCML/cpp/AST.cpp): `src/ParserCML/cpp/AST.cpp`
- [JSON settings](https://github.com/tridoz/herion_hero/blob/main/src/Utils/hpp/JSONParser.hpp): `src/Utils/hpp/JSONParser.hpp`

### Editing and support

- [Room editor](https://github.com/tridoz/herion_hero/blob/main/src/WorldBuilding/cpp/EditorRoom.cpp): `src/WorldBuilding/cpp/EditorRoom.cpp`
- [Image editor](https://github.com/tridoz/herion_hero/blob/main/src/Editor/cpp/ImageEditor.cpp): `src/Editor/cpp/ImageEditor.cpp`
- [Image data](https://github.com/tridoz/herion_hero/blob/main/src/Editor/cpp/Image.cpp): `src/Editor/cpp/Image.cpp`
- [Logging](https://github.com/tridoz/herion_hero/blob/main/src/Utils/hpp/Logger.hpp): `src/Utils/hpp/Logger.hpp`
- [File exceptions](https://github.com/tridoz/herion_hero/blob/main/src/Exceptions/hpp/HerionFileException.hpp): `src/Exceptions/hpp/HerionFileException.hpp`

### Other components

- **Player**

## Connections

- Player → Application entry: starts
- Application entry → Engine loop: starts
- Engine loop → Texture manager: loads textures (evidence: `src/Engine/cpp/Engine.cpp`)
- Engine loop → Room manager: creates manager (evidence: `src/Engine/cpp/Engine.cpp`)
- Engine loop → Room editor: creates editor (evidence: `src/Engine/cpp/Engine.cpp`)
- Engine loop → Image editor: creates editor (evidence: `src/Engine/cpp/Engine.cpp`)
- Engine loop → Player entity: creates player (evidence: `src/Engine/cpp/Engine.cpp`)
- Engine loop → Menu system: loads configuration (evidence: `src/Engine/cpp/Engine.cpp`)
- Engine loop → Input processor: dispatches events (evidence: `src/Engine/cpp/Engine.cpp`)
- Engine loop → Application windows: creates windows (evidence: `src/Engine/cpp/Engine.cpp`)
- Engine loop → Audio system: coordinates audio
- Menu system → CML parser: parses CML (evidence: `src/UI/cpp/ButtonMenu.cpp`)
- CML parser → CML syntax tree: builds syntax tree
- Menu system → Menu views: uses views
- Menu system → Texture manager: uses textures
- Menu system → JSON settings: reads settings (evidence: `src/UI/cpp/ButtonMenu.cpp`)
- Room manager → Texture manager: gets tile textures (evidence: `src/WorldBuilding/cpp/RoomManager.cpp`)
- Room manager → JSON settings: reads dimensions (evidence: `src/WorldBuilding/cpp/RoomManager.cpp`)
- Engine loop → JSON settings: reads graphics settings (evidence: `src/Engine/cpp/Engine.cpp`)
- Player entity → Entity components: uses components
- Image editor → Image data: uses image data
- Engine loop → File exceptions: handles file errors (evidence: `src/Engine/cpp/Engine.cpp`)
- Engine loop → Logging: logs errors (evidence: `src/Engine/cpp/Engine.cpp`)
- Room manager → File exceptions: handles file errors (evidence: `src/WorldBuilding/cpp/RoomManager.cpp`)
