mirror of
https://github.com/gwdevhub/gMod.git
synced 2026-07-15 15:09:30 +00:00
1.9 KiB
1.9 KiB
gMod
A 32-bit Windows DLL that hooks Direct3D 9 to load texture mods for Guild Wars. Continuation of uMod. Integrated with GW Launcher and 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 filescmake/— CMake helper scriptsbuild/— 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 hookinglibzippp/libzip/zlib— reading .tpf/.zip mod filesdirectxtex— texture format conversionMicrosoft.GSL— Guidelines Support Library
How it works
dll_main.cpp— DLL entry point, hooks d3d9.dll via MinHookD3D9Hooks.cpp— interceptsDirect3DCreate9and IDirect3DDevice9 methodsModfileLoader— readsmodlist.txt, loads .tpf/.zip mod archivesTextureClient/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.txtcontains full paths to .tpf/.zip mod files, one per line