From 379878bd6d57d5ea056545733d4a4f804a33c8ac Mon Sep 17 00:00:00 2001 From: Jon <> Date: Mon, 8 Jun 2026 17:14:56 +0100 Subject: [PATCH] Claude stuff --- .claudeignore | 38 ++++++++++++++++++++++++++++++++++++++ CLAUDE.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 .claudeignore create mode 100644 CLAUDE.md diff --git a/.claudeignore b/.claudeignore new file mode 100644 index 0000000..73bb38e --- /dev/null +++ b/.claudeignore @@ -0,0 +1,38 @@ +# Build output and artifacts +build/ +bin/ +Debug/ +Release/ +MinSizeRel/ +RelWithDebInfo/ +win32/ +install/ + +# CMake generated directories +*.dir/ +CMakeFiles/ +_deps/ + +# vcpkg vendored dependencies +vcpkg_installed/ + +# Visual Studio files +*.vcxproj +*.vcxproj.filters +*.vcxproj.user +*.sln +*.slnx +*.sdf +*.suo +*.user +*.aps + +# CMake cache/generated +CMakeCache.txt +cmake_install.cmake +ALL_BUILD* +ZERO_CHECK* +INSTALL* + +# Version resource (generated) +version.rc diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..1556402 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,49 @@ +# gMod + +A 32-bit Windows DLL that hooks Direct3D 9 to load texture mods for Guild Wars. Continuation of uMod. Integrated with [GW Launcher](https://github.com/gwdevhub/gwlauncher) and [Daybreak](https://github.com/gwdevhub/Daybreak). + +## Project structure + +- `header/` — header files (D3D9Hooks, D3D9State, Defines, Error, Main, Utils) +- `source/` — implementation files (D3D9Hooks.cpp, dll_main.cpp, Error.cpp) +- `modules/` — C++23 module files (ModfileLoader, ModfileLoader_TpfReader, TextureClient, TextureFunction) +- `TpfConvert/` — standalone utility to fix broken .tpf files +- `cmake/` — CMake helper scripts +- `build/` — CMake build tree (generated, ignored) +- `bin/` — compiled output (generated, ignored) + +## Build + +Requires Visual Studio 2022, CMake 3.29+, and vcpkg — all via the VS 2022 Developer PowerShell. + +``` +cmake --preset=vcpkg +cmake --open build +# then compile inside Visual Studio, or: +cmake --build build --config Release +``` + +- Target: 32-bit only (`-A Win32` / `CMAKE_GENERATOR_PLATFORM=win32`) +- Standard: C++23 +- Output: `bin/` (gMod.dll, TpfConvert.exe) +- Version: set in `CMakeLists.txt` (`VERSION_MAJOR/MINOR/PATCH/TWEAK`) + +## Key dependencies (via vcpkg) + +- `minhook` — D3D9 function hooking +- `libzippp` / `libzip` / `zlib` — reading .tpf/.zip mod files +- `directxtex` — texture format conversion +- `Microsoft.GSL` — Guidelines Support Library + +## How it works + +1. `dll_main.cpp` — DLL entry point, hooks d3d9.dll via MinHook +2. `D3D9Hooks.cpp` — intercepts `Direct3DCreate9` and IDirect3DDevice9 methods +3. `ModfileLoader` — reads `modlist.txt`, loads .tpf/.zip mod archives +4. `TextureClient` / `TextureFunction` — matches and replaces textures by hash at runtime + +## Notes + +- Must be injected before d3d9.dll loads, or renamed to d3d9.dll in the GW folder +- Reshade > 5.0.1 causes glitches; recommend 5.0.1 or 4.9.1 +- `modlist.txt` contains full paths to .tpf/.zip mod files, one per line