[fixed]question about dmf loader and texture paths

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
drac_gd
Posts: 132
Joined: Sun Apr 09, 2006 8:43 pm

[fixed]question about dmf loader and texture paths

Post by drac_gd »

I was investigating why some free dmf models I had would not show in the mesh viewer unless the textures were up one subdirectory from the the directory the dmf file was in.
while stepping through the CDMFLoader.cpp
on line 250
StringList filepath = SubdivideString(String(file->getFileName()),"\\");

getFileName returns
"f:\TronacomSvnBuild\bin\win\models\dmf_models\objects/Stables.dmf"


for (u32 j=0; j<filepath.size()-1; ++j)
path = path + filepath[j] + String("/");

path ends up being
"f:/TronacomSvnBuild/bin/win/models/dmf_models/"
instead of
"f:/TronacomSvnBuild/bin/win/models/dmf_models/objects/"
that it would have been if the original file name was
"f:\TronacomSvnBuild\bin\win\models\dmf_models\objects\Stables.dmf"
instead of
"f:\TronacomSvnBuild\bin\win\models\dmf_models\objects/Stables.dmf"

is this as designed?
should the textures be up one directory level instead of in the same directory as the dmf file ?

irrlicht version was latest checked out from svn (1509) using mesh viewer example
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yes, this is a bug. I've replaced the texture handling with a new method from IFileSystem which should take care of different file name separators.
Post Reply