Textures Tag Hook

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderators: Darksaber, General_Trageton, Forceflow, JeremyaFr, DTM

Post Reply

Textures Tag Hook

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1605
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Jul 26, 2019 12:21 pm

Hello,
Here is a new hook.

This hook set a tag to the textures. The tag can then be read from ddraw.dll.

The tag can be read from the CreateSurface method of the IDirectDraw interface. The dwReserved variable of the DDSURFACEDESC structure is set to a pointer to the tag string (const char*).

The format of the tag is:
- for dat images: "dat,groupId,ImageId,mipmapLevel"
- for opt textures:
"opt,optFileName,textureName,color,mipmapLevel" for color maps
or "opt,optFileName,textureName,color-transparent,mipmapLevel" for transparent color maps
or "opt,optFileName,textureName,light,mipmapLevel" for light maps

To help debugging, the hook can optionally write the tags to the debug ouput that can be read with DebugView.
See "hook_textures_tag.cfg".

xwa_hook_textures_tag.zip

blue_max
Ensign
XWAU Member
Posts: 324
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri Jul 26, 2019 8:51 pm

Thank you, Jeremy. I appreciate your help with this hook. I must also say that this was a very, very clever way to implement it.

Justagai
Cadet 1st Class
Posts: 206
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Sat Jul 27, 2019 5:39 pm

Well done.

User avatar
keiranhalcyon7
Ensign
Posts: 274
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sat Jul 27, 2019 9:30 pm

Yes, very clever to use an empty reserved field to hold a pointer to the extra info.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1605
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Jul 29, 2019 4:21 pm

UPDATE
I've added a "-transparent" tag to transparent textures.

blue_max
Ensign
XWAU Member
Posts: 324
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Jul 29, 2019 8:51 pm

Thank you Jeremy, this is awesome

Post Reply