Ok, thanks for all your help. For all those who need a solution for the same problem, here's how I fixed it for now:
All properties can be determined using tomspeeds MemoryLib.DLL (mentioned above), with the exception of:
Blitz's internal functions
GetSurfaceBrush
GetBrushTexture
TextureName
as well as
To obtain texture x scaling and y scaling and the coordSet flag. For these 3 functions use the old hacks published here:
http://www.blitzbasic.com/Community/posts.php?topic=66397
GetBrushTextureCoords
GetBrushTextureScaleU
GetBrushTextureScaleV
Note: although Tomspeed's dll will return the TexFlags, the bit $10000 (65536) does not reflect the CoordsSet as it is stored in the B3D file! Therefor you need to use the hack GetBrushTextureCoords(tex)
Now, with this patchwork of internal functions, external functions and quickndirty hacks, all informations to save a (static) mesh with all visual settings (excluding cubemapping) can be determined. Future compiler version compatibility not guaranted.
Unfort. there may be a memory leak caused by lost brush handles. Noless, a tool can be powerfull, even if it has to be restarted from time to time.
EDIT Additional Note:
when using GetBrushTexture for the 8 possible textures of a brush, it will return numbers other than zero, even if there is no texture on a certain layer. Currently the only way to determine if a returned number is a valid texture handle is to use:
if TextureName$(tex(i))<>"" then
This does of course exclude the usage of Textures that have been created using CreateTexture (I have no idea on how to handle them right now)
Note, it seems TextureName will return the texture name as it was used in the LoadMesh function, regardless if the file was found. So if the file wasn't found, it will still return a TextureName() other than "", but the texture handle will be invalid! To check this out you need to use
Is there a TextureName? yes, layer seems to be used.
Does a file named Name exist? Yes, assume the texture was loaded.
Now you may access TextureBuffer() without to worry too much. If it returns zero, it seems to be a DDS texture, this can be doublechecked by testing the filename extension (".DDS").
After all:
GetBrushTexture(brush,index) that won't return zero for unused layers may be considered a bug.
All properties can be determined using tomspeeds MemoryLib.DLL (mentioned above), with the exception of:
Blitz's internal functions
GetSurfaceBrush
GetBrushTexture
TextureName
as well as
To obtain texture x scaling and y scaling and the coordSet flag. For these 3 functions use the old hacks published here:
http://www.blitzbasic.com/Community/posts.php?topic=66397
GetBrushTextureCoords
GetBrushTextureScaleU
GetBrushTextureScaleV
Note: although Tomspeed's dll will return the TexFlags, the bit $10000 (65536) does not reflect the CoordsSet as it is stored in the B3D file! Therefor you need to use the hack GetBrushTextureCoords(tex)
Now, with this patchwork of internal functions, external functions and quickndirty hacks, all informations to save a (static) mesh with all visual settings (excluding cubemapping) can be determined. Future compiler version compatibility not guaranted.
Unfort. there may be a memory leak caused by lost brush handles. Noless, a tool can be powerfull, even if it has to be restarted from time to time.
EDIT Additional Note:
when using GetBrushTexture for the 8 possible textures of a brush, it will return numbers other than zero, even if there is no texture on a certain layer. Currently the only way to determine if a returned number is a valid texture handle is to use:
if TextureName$(tex(i))<>"" then
This does of course exclude the usage of Textures that have been created using CreateTexture (I have no idea on how to handle them right now)
Note, it seems TextureName will return the texture name as it was used in the LoadMesh function, regardless if the file was found. So if the file wasn't found, it will still return a TextureName() other than "", but the texture handle will be invalid! To check this out you need to use
Is there a TextureName? yes, layer seems to be used.
Does a file named Name exist? Yes, assume the texture was loaded.
Now you may access TextureBuffer() without to worry too much. If it returns zero, it seems to be a DDS texture, this can be doublechecked by testing the filename extension (".DDS").
After all:
GetBrushTexture(brush,index) that won't return zero for unused layers may be considered a bug.