Jon ac39241ff9 Release replacement textures when a client is torn down (#38)
* 1.9

* Release replacement textures when a client is torn down

TextureClient::~TextureClient deleted the per-texture side-state but never
released the replacement IDirect3DTexture9 objects gMod created. That's
fine when the client dies because the device hit refcount 0 (a texture
refs its device, so by then every fake is already released and the maps
are empty). But when gMod is unloaded via FreeLibrary while the game's
device is still alive (late-injected/SetDevice integrations), the maps
are full of textures gMod still owns and they all leak - and ExitInstance
never deleted the clients, so the destructor didn't even run.

- ~TextureClient now releases each replacement it still owns (a fake is
  still owned while it has a partner; an orphaned fake was already
  released and is left alone). No-op in the device-release path.
- Add DestroyAllTextureClients() to delete the per-device clients.
- ExitInstance calls it, gated on a genuine FreeLibrary
  (lpReserved == nullptr) so it's skipped during process termination
  where the device/d3d9 may already be gone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Jon <>
Co-authored-by: Marc <m@pyc.ac>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 17:14:10 +01:00
2024-11-11 23:35:43 +07:00
2024-11-11 23:35:43 +07:00
2023-11-10 17:40:30 +01:00
2024-09-28 12:15:04 +02:00
2026-05-01 14:35:46 +07:00
2023-11-17 21:58:04 +01:00
2024-11-11 23:35:43 +07:00
2024-11-11 23:35:43 +07:00
2023-11-10 17:40:30 +01:00

gMod

Continuation of the uMod project to improve performance and stability. Integrated with Guild Wars Launcher and Daybreak.

Usage is primarily intended with GW Launcher or Daybreak, but it can be used without.

Usage with manual gMod.dll injection:

  • Create a file called modlist.txt in either the Guild Wars (Gw.exe) folder, or the gMod.dll folder.
  • Inject gMod.dll before d3d9.dll is loaded.

Usage without dll injection:

  • Create a file called modlist.txt in the Guild Wars (Gw.exe) folder.
  • Place gMod.dll in the Guild Wars folder
  • Rename gMod.dll to d3d9.dll
  • Launch Guild Wars

Format of the modlist.txt file:

Each line in the modlist.txt is the full path to a mod you want to load (eg. D:\uMod\Borderless Cartography Made Easy 2015 1.3.tpf) gMod will load all these files on startup

Disclaimer about Reshade

Reshade in versions > 5.0.1 is known to cause glitches with TexMod, uMod and also gMod. If you would like to use Reshade in combination with gMod, we recommend running version 5.0.1 or 4.9.1.

Build from source

Requirements:

  • Visual Studio 2022
  • CMake 3.29+, integrated into the Developer Powershell for VS 2022
  • vcpkg, integrated into the Developer Powershell for VS 2022

Compile:

  • cmake --preset=vcpkg
  • cmake --open build
  • compile

TpfConvert Small utility to convert old .tpf files with invalid images into .zip files with working images. Usage:

  • Put TpfConvert.exe and d3dx9.dll in the folder where you have your old, broken texmods with invalid images.
  • Run TpfConvert.exe, all *.tpf and *.zip files are processed. The originals are saved into a newly created backup folder.
  • Done.
S
Description
Continuation of the uMod project to improve performance and stability. Mainly for GW Launcher and Daybreak.
Readme GPL-3.0 1.6 MiB
Languages
C++ 82.8%
PowerShell 10.6%
CMake 3.1%
C 2.1%
Shell 1.4%