Start a new topic

mgIsTextureInPalette

Original Post by: SCGrant327 Fri Apr 2 16:16:58 2010


When calling this function, it appears that the function fails if it is called with the root filename and the texture palette entry contains any pathing information.


Is there any way to check for a texture in the palette besides iterating through all the textures?


Original Post by: SteveThompson Fri Apr 2 16:48:38 2010


Since mgIsTextureInPalette is supposed to work, I'm afraid there is no contingency function to account for it not working ;-)


I don't understand the situation you are reporting. Can you provide a concrete example so we have a chance to fix it?


Thanks.


Also what version of the API are you using?

Original Post by: SCGrant327 Fri Apr 2 16:59:24 2010


API is 4.0.1


The problem: If textures are stored in the FLT file with ANY pathing (MSPT_ABSOLUTE or MSPT_RELATIVE), then using mgIsTextureInPalette will fail if called with just the filename.


I have worked around this by opening the DB, then calling mgTextureSetSavePathType with MSPT_NOPATH, writing the file...then calling mgIsTextureInPalette.


So, to test, create a FLT file with textures saved pathing, then call mgIsTextureInPalette with a filename (no path) and see what happens.

Original Post by: SteveThompson Fri Apr 2 17:21:52 2010


The problem: If textures are stored in the FLT file with ANY pathing (MSPT_ABSOLUTE or MSPT_RELATIVE), then using mgIsTextureInPalette will fail if called with just the filename.

This is by design and guards against two files in the palette with the same name but in different folders. I don't think you'd want the function to return true if ANY file with that name (only) is in the palette -- or would you? Your results might be ambiguous.

Login to post a comment