Trouble resolving pathnames when loading scheme file

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
toysnob
Just popping in
Just popping in
Posts: 13
Joined: Fri Feb 18, 2005 01:15

Trouble resolving pathnames when loading scheme file

Postby toysnob » Mon Feb 21, 2005 18:17

I am porting the sample DX9 code to my own app and it seems to fail to load the scheme file. I am pretty sure this is a path issue based on being relative to the app.

This is the line that fails:

Code: Select all

CEGUI::SchemeManager::getSingleton().loadScheme("../../data/guires/schemes/TaharezLook.scheme");


My app is two levels below the directory holding data/.....

I am running in the debugger but that shouldn't matter. Also,
I tried using an absolute path C:.... and that didn't work either.

Any suggestions? I'm sure this is a pretty basic oversight on my part.

UPDATE:

Upon further debugging it seems its this line:

Code: Select all

        std::ifstream dataFile(filename.c_str(), std::ios::binary|std::ios::ate);


Inside ceguidefaultresourceprovider.cpp at line 60 that is failing.

So its failing in trying to load the GUIScheme.xsd file that I guess is implicitly loaded before trying to load my requested TaharezLook.scheme file..

Hope that helps in helping me :) I'm not sure why it loads for the DX9 sample but not for my app.

UPDATE 2:

I just noticed that the same thing happens when running the DX9 demo, it does fail, I forgot that I have been able to run the DX9 demo by just running the prebuilt binary which does not have any problems. That is very werid, since I imagine they are the same right?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Trouble resolving pathnames when loading scheme file

Postby lindquist » Mon Feb 21, 2005 20:03

you could try logging the current path in your app. This way you could make sure that the executable is actually running in the right directory!

fx like this... its probably not the best way, but it does the job!

Code: Select all

#include <direct.h>
char buf[512] = "";
CEGUI::Logger::getSingleton().logEvent( "Current working directory: " + CEGUI::String( getcwd( buf, 511 ) ) );

User avatar
toysnob
Just popping in
Just popping in
Posts: 13
Joined: Fri Feb 18, 2005 01:15

Re: Trouble resolving pathnames when loading scheme file

Postby toysnob » Mon Feb 21, 2005 22:01

Yeah I did that and its running in the right directory relative to the path I am specifying. In other words using the path I specify should lead from the working directory to the directory where the scheme file is.

But more to the point, even if I specify a full hard coded path, it fails. Shouldn't this work? I am not sure how CEGUI is coded but I would imagine that if I specified the full path on my hard drive to a file, it would work.

Interestingly, as I mentioned earlier, the DX9 demo has the same problem when built from demo source, the prebuilt binary does not have this problem.

UPDATE:

Still not working. I would love it if someone could download the DX9 demo and try running it from the debugger or building it and running it from the debug directory, ie. don't just run the prebuilt version that comes with the zip. Tell me if it works for you. For me it bombs on that very line every time and the path info is correct.

So far this isn't a good intro for a potential CEGUI user. Its probably good to get that fixed and figured out, it doesn't make a great first impression when the toolkit fails on a simple file load issue.

In the meantime I'll keep trying and hope for the best. Any suggestions will be appreciated.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Trouble resolving pathnames when loading scheme file

Postby CrazyEddie » Tue Feb 22, 2005 09:58

This is a known issue (it's been mentioned twice before in the past 10 days I think).

Copy all the .xsd files into the current working directory for the app. This will fix the issue until I get around to restoring the previous behavior.

CE.

User avatar
toysnob
Just popping in
Just popping in
Posts: 13
Joined: Fri Feb 18, 2005 01:15

Re: Trouble resolving pathnames when loading scheme file

Postby toysnob » Wed Feb 23, 2005 03:28

This did not resolve the issue for me. I put the following .xsd files in my working directory:

CEGUIConfig.xsd
Font.xsd
GUILayout.xsd
GUIScheme.xsd
Imageset.xsd

Same problem. This is pretty frustrating. If someone can patch this and release it it would be appreciated.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Trouble resolving pathnames when loading scheme file

Postby CrazyEddie » Thu Feb 24, 2005 09:17

If copying the files did not fix the error, then it's some other problem.

I'll try and find the time some time soon to get the source for the dx9 version demo 7 and see what the problem is.

CE

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Trouble resolving pathnames when loading scheme file

Postby CrazyEddie » Sat Feb 26, 2005 13:55

I'm not sure if you're still having the issue, but I thought I'd just say that I tried demo7 for dx9 and, excepting the need to copy the .xsd files, had no issues against 0.2.0 or CVS-HEAD.

Just ensure you replace the dlls in the Debug and/or Release directories with the frsh copies from your compile of the library.

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests