# witthayapae/whatever architecture

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

- Interactive diagram: https://gitdiagram.com/witthayapae/whatever
- Repository: https://github.com/witthayapae/whatever

## Overview

Ran-Mobile is a native mobile port of the RAN game client, with platform adaptation and a D3D9-to-OpenGL ES rendering shim. The visible startup entry is Android’s native boot function; the tree also contains Android launcher code and tools for inspecting extracted game assets. The README gives no capability overview, so this map is limited to workflows supported by the supplied excerpts and source index. Several asset tools are unsampled; their connections are shown only where the index or excerpt supports them.

Main entry points: [`native/shim/d3d/d3d9_impl.cpp`](https://github.com/witthayapae/whatever/blob/main/native/shim/d3d/d3d9_impl.cpp) (D3D9 Shim), [`tools/rcc-extract/preview-terrain.js`](https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/preview-terrain.js) (Terrain Preview), [`native/platform/android/main.cpp`](https://github.com/witthayapae/whatever/blob/main/native/platform/android/main.cpp) (Native Boot), [`tools/rcc-extract/staticmesh.js`](https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/staticmesh.js) (Static Mesh Decoder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile Runtime"]
  node_android_launcher["Android Launcher<br/>[RanActivity.java]"]
  node_native_entry["Native Boot<br/>[main.cpp]"]
  node_platform_services["Platform Services<br/>[ran_plat.h]"]
  node_win_compat["Win32 Compatibility<br/>[windows.h]"]
end

subgraph group_render["Graphics Compatibility"]
  node_d3d_shim["D3D9 Shim<br/>[d3d9_impl.cpp]"]
  node_gl_context["GL Context<br/>[gl_context.cpp]"]
  node_gl_api["GL Interfaces<br/>[gl_thunks.h]"]
  node_touch_ui["Touch Controls<br/>[touch_ui.cpp]"]
end

subgraph group_assets["Asset Decoding"]
  node_rcc_reader["RCC Archive Reader<br/>[rcc.js]"]
  node_mesh_decoder["Static Mesh Decoder<br/>[staticmesh.js]"]
  node_octree_decoder["Octree Decoder<br/>[octree.js]"]
  node_png_encoder["PNG Encoder<br/>[png.js]"]
end

subgraph group_inspect["Asset Inspection"]
  node_terrain_preview["Terrain Preview<br/>[preview-terrain.js]"]
  node_mesh_preview["Mesh Preview<br/>[preview-mesh.js]"]
end

node_native_entry -->|"logs through"| node_platform_services
node_native_entry -->|"includes"| node_win_compat
node_d3d_shim -->|"includes"| node_win_compat
node_d3d_shim -->|"uses backend"| node_gl_context
node_d3d_shim -->|"uses renderer"| node_gl_api
node_terrain_preview -->|"reads archives"| node_rcc_reader
node_terrain_preview -->|"decodes terrain"| node_mesh_decoder
node_terrain_preview -->|"encodes image"| node_png_encoder
node_mesh_preview -->|"encodes image"| node_png_encoder
node_mesh_decoder -->|"uses decoder"| node_octree_decoder

click node_android_launcher "https://github.com/witthayapae/whatever/blob/main/native/android/java/com/ran/launcher/RanActivity.java"
click node_native_entry "https://github.com/witthayapae/whatever/blob/main/native/platform/android/main.cpp"
click node_platform_services "https://github.com/witthayapae/whatever/blob/main/native/shim/platform/ran_plat.h"
click node_win_compat "https://github.com/witthayapae/whatever/blob/main/native/shim/win/windows.h"
click node_d3d_shim "https://github.com/witthayapae/whatever/blob/main/native/shim/d3d/d3d9_impl.cpp"
click node_gl_context "https://github.com/witthayapae/whatever/blob/main/native/shim/gl/gl_context.cpp"
click node_gl_api "https://github.com/witthayapae/whatever/blob/main/native/shim/gl/gl_thunks.h"
click node_touch_ui "https://github.com/witthayapae/whatever/blob/main/native/shim/platform/touch_ui.cpp"
click node_rcc_reader "https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/rcc.js"
click node_mesh_decoder "https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/staticmesh.js"
click node_octree_decoder "https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/octree.js"
click node_png_encoder "https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/png.js"
click node_terrain_preview "https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/preview-terrain.js"
click node_mesh_preview "https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/preview-mesh.js"

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_android_launcher,node_native_entry,node_platform_services,node_win_compat toneBlue
class node_d3d_shim,node_gl_context,node_gl_api,node_touch_ui toneAmber
class node_rcc_reader,node_mesh_decoder,node_octree_decoder,node_png_encoder toneMint
class node_terrain_preview,node_mesh_preview toneRose
```

## Components

### Mobile Runtime

- [Android Launcher](https://github.com/witthayapae/whatever/blob/main/native/android/java/com/ran/launcher/RanActivity.java): `native/android/java/com/ran/launcher/RanActivity.java`
- [Native Boot](https://github.com/witthayapae/whatever/blob/main/native/platform/android/main.cpp): `native/platform/android/main.cpp`
- [Platform Services](https://github.com/witthayapae/whatever/blob/main/native/shim/platform/ran_plat.h): `native/shim/platform/ran_plat.h`
- [Win32 Compatibility](https://github.com/witthayapae/whatever/blob/main/native/shim/win/windows.h): `native/shim/win/windows.h`

### Graphics Compatibility

- [D3D9 Shim](https://github.com/witthayapae/whatever/blob/main/native/shim/d3d/d3d9_impl.cpp): `native/shim/d3d/d3d9_impl.cpp`
- [GL Context](https://github.com/witthayapae/whatever/blob/main/native/shim/gl/gl_context.cpp): `native/shim/gl/gl_context.cpp`
- [GL Interfaces](https://github.com/witthayapae/whatever/blob/main/native/shim/gl/gl_thunks.h): `native/shim/gl/gl_thunks.h`
- [Touch Controls](https://github.com/witthayapae/whatever/blob/main/native/shim/platform/touch_ui.cpp): `native/shim/platform/touch_ui.cpp`

### Asset Decoding

- [RCC Archive Reader](https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/rcc.js): `tools/rcc-extract/rcc.js`
- [Static Mesh Decoder](https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/staticmesh.js): `tools/rcc-extract/staticmesh.js`
- [Octree Decoder](https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/octree.js): `tools/rcc-extract/octree.js`
- [PNG Encoder](https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/png.js): `tools/rcc-extract/png.js`

### Asset Inspection

- [Terrain Preview](https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/preview-terrain.js): `tools/rcc-extract/preview-terrain.js`
- [Mesh Preview](https://github.com/witthayapae/whatever/blob/main/tools/rcc-extract/preview-mesh.js): `tools/rcc-extract/preview-mesh.js`

## Connections

- Native Boot → Platform Services: logs through (evidence: `native/platform/android/main.cpp`)
- Native Boot → Win32 Compatibility: includes (evidence: `native/platform/android/main.cpp`)
- D3D9 Shim → Win32 Compatibility: includes (evidence: `native/shim/d3d/d3d9_impl.cpp`)
- D3D9 Shim → GL Context: uses backend (evidence: `native/shim/d3d/d3d9_impl.cpp`)
- D3D9 Shim → GL Interfaces: uses renderer (evidence: `native/shim/d3d/d3d9_impl.cpp`)
- Terrain Preview → RCC Archive Reader: reads archives (evidence: `tools/rcc-extract/preview-terrain.js`)
- Terrain Preview → Static Mesh Decoder: decodes terrain (evidence: `tools/rcc-extract/preview-terrain.js`)
- Terrain Preview → PNG Encoder: encodes image (evidence: `tools/rcc-extract/preview-terrain.js`)
- Mesh Preview → PNG Encoder: encodes image (evidence: `tools/rcc-extract/preview-mesh.js`)
- Static Mesh Decoder → Octree Decoder: uses decoder (evidence: `tools/rcc-extract/staticmesh.js`)
