FAQ  FAQ   Search  Search   Memberlist  Memberlist   Usergroups  Usergroups
Register  ::  Log in Log in to check your private messages

Post new topic  Reply to topic
 Storage Manager case handling broken? « View previous topic :: View next topic » 
Author Message
PostPosted: Thu Aug 02, 2007 8:29 pm    Post subject: Storage Manager case handling broken? Reply with quote

Joined: 02 Aug 2007
Posts: 33


I have an issue here with uppercase texture names. I'm currently writing a storage plugin for meshes. I want to load a texture to fill into the surface description structure. My code is like this:


      iStorage * tex_storage = g_storage_man->GetStorageFromPath(tex_path);

         for (unsigned i=0; i<tex_storage->GetNodesNo(); ++i)
            sStorageNodeInfo info;
            tex_storage->GetNodeInfo(i, &info);

         iTexture * tex = (iTexture*)tex_storage->ExtractNode(cur_mesh->getTextureName()[0].c_str());
         if (!tex) msgBox(std::string("Couldn't find tex ") + cur_mesh->getTextureName()[0]);

A texture with uppercase letters can't be found in the storage. Its name in lowercase is displayed in a messagebox when the textures contained in the storage are listed, so i suppose names are converted to lowercase internally? Using lowercase names in the model solves this problem.
Back to top
View user's profile Send private message
PostPosted: Fri Aug 03, 2007 7:20 am    Post subject: Reply with quote

Joined: 12 Feb 2007
Posts: 1328

Yes, you are right. Because Windows OS is not case sensitive regarding the file system, all the file names are transformed to lower case when parsed by the engine. This at least ensures that you always find the image by its lower case name. The file system may change the name as he likes when copying the file for example (I know Windows 2000 and above don't do that, but previous systems used to that, and also the user can change the files to any case and the file basically should remain the same).

I'm sorry if this was not indicated in the documentation, I will have it fixed.

Adrian L.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Based on a template by Dustin Baccetti
Powered by phpBB © 2001, 2005 phpBB Group