mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
Merge pull request #26 from eswartz/pr-rocket-fix-file-lookup-alone
Resolve libRocket assets along the model-path
This commit is contained in:
commit
c854872714
@ -41,8 +41,18 @@ Open(const Rocket::Core::String& path) {
|
||||
|
||||
PT(VirtualFile) file = _vfs->get_file(fn);
|
||||
if (file == NULL) {
|
||||
rocket_cat.error() << "Failed to find " << fn << "\n";
|
||||
return (Rocket::Core::FileHandle) NULL;
|
||||
// failed? Try model-path as a Panda-friendly fallback.
|
||||
if (!fn.resolve_filename(get_model_path())) {
|
||||
rocket_cat.error() << "Could not resolve " << fn
|
||||
<< " along the model-path (currently: " << get_model_path() << ")\n";
|
||||
return (Rocket::Core::FileHandle) NULL;
|
||||
}
|
||||
|
||||
file = _vfs->get_file(fn);
|
||||
if (file == NULL) {
|
||||
rocket_cat.error() << "Failed to get " << fn << ", found on model-path\n";
|
||||
return (Rocket::Core::FileHandle) NULL;
|
||||
}
|
||||
}
|
||||
|
||||
istream *str = file->open_read_file(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user