# webline-max/kotektools-pc architecture

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

- Interactive diagram: https://gitdiagram.com/webline-max/kotektools-pc
- Repository: https://github.com/webline-max/kotektools-pc

## Overview

KoTeKTools-PC is a desktop utility for preparing game-mod assets. The principal workflow is a user selecting an operation and input, invoking a tool, and receiving converted or modified files. Its documented capabilities span asset conversion, copying, atmosphere editing, painting, map and blood utilities, texture work, and DFF viewing. The graph preserves these product branches; sampled evidence establishes the application entry point and some module references, but not every handler-to-implementation call.

Main entry points: [`source/KoTeKTools.cpp`](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools.cpp) (Main window and UI), [`source/KoTeKTools_convert.cpp`](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_convert.cpp) (Conversion handlers), [`source/main.cpp`](https://github.com/webline-max/kotektools-pc/blob/main/source/main.cpp) (Application entry), [`source/txd.cpp`](https://github.com/webline-max/kotektools-pc/blob/main/source/txd.cpp) (TXD processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop application"]
  node_entry["Application entry<br/>[main.cpp]"]
  node_workspace["Main window and UI<br/>[KoTeKTools.cpp]"]
  node_ui_pages["UI pages"]
end

subgraph group_assets["Asset conversion"]
  node_copy["Asset copying"]
  node_convert_ui["Conversion handlers"]
  node_btx["PNG and BTX<br/>[btx_converter.cpp]"]
  node_dff["MOD and DFF processing<br/>[dff.cpp]"]
  node_bpc["BPC processing<br/>[bpc.cpp]"]
  node_txd["TXD processing<br/>[txd.cpp]"]
  node_texture["YTD texture tools"]
  node_image_write["Image writing<br/>[stb_image_write.h]"]
  node_list_names["Vegetation name list<br/>[listva_names.h]"]
  node_zip_lib["ZIP support<br/>[zip.h]"]
  node_zlib["Compression support<br/>[zlib.h]"]
end

subgraph group_customize["Visual customization"]
  node_atmo_ui["Atmosphere controls"]
  node_atmo["Atmosphere generation<br/>[atmosphere.cpp]"]
  node_paint_ui["Painting controls"]
  node_painting["Image and HUD painting<br/>[painting.cpp]"]
  node_extra["Blood and map tools"]
  node_map["Map slicing<br/>[map.cpp]"]
end

subgraph group_view["Viewing and texturing"]
  node_viewer["3D model viewer<br/>[KoTeKTools_3D.cpp]"]
  node_image_decode["Image decoding<br/>[stb_image.h]"]
  node_model_types["DFF data structures<br/>[KoTeKTools.h]"]
end

node_user(("User"))

node_user -->|"launches"| node_entry
node_entry -->|"creates and shows"| node_workspace
node_user -->|"selects operation"| node_workspace
node_workspace -->|"offers copying"| node_copy
node_workspace -->|"offers conversions"| node_convert_ui
node_workspace -->|"offers texture work"| node_texture
node_workspace -->|"offers atmosphere edits"| node_atmo_ui
node_workspace -->|"offers painting"| node_paint_ui
node_workspace -->|"offers extra tools"| node_extra
node_workspace -->|"offers 3D viewing"| node_viewer
node_convert_ui -->|"converts PNG and BTX"| node_btx
node_convert_ui -->|"processes MOD and DFF"| node_dff
node_convert_ui -->|"converts BPC"| node_bpc
node_convert_ui -->|"processes TXD"| node_txd
node_atmo_ui -->|"uses atmosphere module"| node_atmo
node_paint_ui -->|"uses painting module"| node_painting
node_extra -->|"uses map module"| node_map
node_viewer -->|"uses image decoder"| node_image_decode
node_txd -->|"uses image writer"| node_image_write

click node_entry "https://github.com/webline-max/kotektools-pc/blob/main/source/main.cpp"
click node_workspace "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools.cpp"
click node_ui_pages "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_ui_setup.cpp"
click node_copy "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_copy.cpp"
click node_convert_ui "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_convert.cpp"
click node_btx "https://github.com/webline-max/kotektools-pc/blob/main/source/btx_converter.cpp"
click node_dff "https://github.com/webline-max/kotektools-pc/blob/main/source/dff.cpp"
click node_bpc "https://github.com/webline-max/kotektools-pc/blob/main/source/bpc.cpp"
click node_txd "https://github.com/webline-max/kotektools-pc/blob/main/source/txd.cpp"
click node_texture "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_texture.cpp"
click node_atmo_ui "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_atmosphere.cpp"
click node_atmo "https://github.com/webline-max/kotektools-pc/blob/main/source/atmosphere.cpp"
click node_paint_ui "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_painting.cpp"
click node_painting "https://github.com/webline-max/kotektools-pc/blob/main/source/painting.cpp"
click node_extra "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_extra.cpp"
click node_map "https://github.com/webline-max/kotektools-pc/blob/main/source/map.cpp"
click node_viewer "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_3D.cpp"
click node_image_decode "https://github.com/webline-max/kotektools-pc/blob/main/source/stb_image.h"
click node_image_write "https://github.com/webline-max/kotektools-pc/blob/main/source/stb_image_write.h"
click node_model_types "https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools.h"
click node_list_names "https://github.com/webline-max/kotektools-pc/blob/main/source/listva_names.h"
click node_zip_lib "https://github.com/webline-max/kotektools-pc/blob/main/source/zip.h"
click node_zlib "https://github.com/webline-max/kotektools-pc/blob/main/source/zlib.h"

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_workspace,node_ui_pages,node_user toneBlue
class node_copy,node_convert_ui,node_btx,node_dff,node_bpc,node_txd,node_texture,node_image_write,node_list_names,node_zip_lib,node_zlib toneAmber
class node_atmo_ui,node_atmo,node_paint_ui,node_painting,node_extra,node_map toneMint
class node_viewer,node_image_decode,node_model_types toneRose
```

## Components

### Desktop application

- [Application entry](https://github.com/webline-max/kotektools-pc/blob/main/source/main.cpp): `source/main.cpp`
- [Main window and UI](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools.cpp): `source/KoTeKTools.cpp`
- [UI pages](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_ui_setup.cpp): `source/KoTeKTools_ui_setup.cpp`

### Asset conversion

- [Asset copying](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_copy.cpp): `source/KoTeKTools_copy.cpp`
- [Conversion handlers](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_convert.cpp): `source/KoTeKTools_convert.cpp`
- [PNG and BTX](https://github.com/webline-max/kotektools-pc/blob/main/source/btx_converter.cpp): `source/btx_converter.cpp`
- [MOD and DFF processing](https://github.com/webline-max/kotektools-pc/blob/main/source/dff.cpp): `source/dff.cpp`
- [BPC processing](https://github.com/webline-max/kotektools-pc/blob/main/source/bpc.cpp): `source/bpc.cpp`
- [TXD processing](https://github.com/webline-max/kotektools-pc/blob/main/source/txd.cpp): `source/txd.cpp`
- [YTD texture tools](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_texture.cpp): `source/KoTeKTools_texture.cpp`
- [Image writing](https://github.com/webline-max/kotektools-pc/blob/main/source/stb_image_write.h): `source/stb_image_write.h`
- [Vegetation name list](https://github.com/webline-max/kotektools-pc/blob/main/source/listva_names.h): `source/listva_names.h`
- [ZIP support](https://github.com/webline-max/kotektools-pc/blob/main/source/zip.h): `source/zip.h`
- [Compression support](https://github.com/webline-max/kotektools-pc/blob/main/source/zlib.h): `source/zlib.h`

### Visual customization

- [Atmosphere controls](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_atmosphere.cpp): `source/KoTeKTools_atmosphere.cpp`
- [Atmosphere generation](https://github.com/webline-max/kotektools-pc/blob/main/source/atmosphere.cpp): `source/atmosphere.cpp`
- [Painting controls](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_painting.cpp): `source/KoTeKTools_painting.cpp`
- [Image and HUD painting](https://github.com/webline-max/kotektools-pc/blob/main/source/painting.cpp): `source/painting.cpp`
- [Blood and map tools](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_extra.cpp): `source/KoTeKTools_extra.cpp`
- [Map slicing](https://github.com/webline-max/kotektools-pc/blob/main/source/map.cpp): `source/map.cpp`

### Viewing and texturing

- [3D model viewer](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools_3D.cpp): `source/KoTeKTools_3D.cpp`
- [Image decoding](https://github.com/webline-max/kotektools-pc/blob/main/source/stb_image.h): `source/stb_image.h`
- [DFF data structures](https://github.com/webline-max/kotektools-pc/blob/main/source/KoTeKTools.h): `source/KoTeKTools.h`

### Other components

- **User**

## Connections

- User → Application entry: launches (evidence: `source/main.cpp`)
- Application entry → Main window and UI: creates and shows (evidence: `source/main.cpp`)
- User → Main window and UI: selects operation (evidence: `README.md`)
- Main window and UI → Asset copying: offers copying (evidence: `README.md`)
- Main window and UI → Conversion handlers: offers conversions (evidence: `README.md`)
- Main window and UI → YTD texture tools: offers texture work (evidence: `README.md`)
- Main window and UI → Atmosphere controls: offers atmosphere edits (evidence: `README.md`)
- Main window and UI → Painting controls: offers painting (evidence: `README.md`)
- Main window and UI → Blood and map tools: offers extra tools (evidence: `README.md`)
- Main window and UI → 3D model viewer: offers 3D viewing (evidence: `README.md`)
- Conversion handlers → PNG and BTX: converts PNG and BTX (evidence: `source/KoTeKTools_convert.cpp`)
- Conversion handlers → MOD and DFF processing: processes MOD and DFF (evidence: `source/KoTeKTools_convert.cpp`)
- Conversion handlers → BPC processing: converts BPC (evidence: `source/KoTeKTools_convert.cpp`)
- Conversion handlers → TXD processing: processes TXD (evidence: `source/KoTeKTools_convert.cpp`)
- Atmosphere controls → Atmosphere generation: uses atmosphere module (evidence: `source/KoTeKTools_atmosphere.cpp`)
- Painting controls → Image and HUD painting: uses painting module (evidence: `source/KoTeKTools_painting.cpp`)
- Blood and map tools → Map slicing: uses map module (evidence: `source/KoTeKTools_extra.cpp`)
- 3D model viewer → Image decoding: uses image decoder (evidence: `source/KoTeKTools_3D.cpp`)
- TXD processing → Image writing: uses image writer (evidence: `source/txd.cpp`)
