mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
use vfs to insist on correct case in conversion
This commit is contained in:
parent
acae410759
commit
0376b5e575
@ -20,6 +20,7 @@
|
|||||||
#include "config_util.h"
|
#include "config_util.h"
|
||||||
#include "config_pandatoolbase.h"
|
#include "config_pandatoolbase.h"
|
||||||
#include "indent.h"
|
#include "indent.h"
|
||||||
|
#include "virtualFileSystem.h"
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: PathReplace::Constructor
|
// Function: PathReplace::Constructor
|
||||||
@ -58,6 +59,8 @@ match_path(const Filename &orig_filename,
|
|||||||
Filename match;
|
Filename match;
|
||||||
bool got_match = false;
|
bool got_match = false;
|
||||||
|
|
||||||
|
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||||
|
|
||||||
Entries::const_iterator ei;
|
Entries::const_iterator ei;
|
||||||
for (ei = _entries.begin(); ei != _entries.end(); ++ei) {
|
for (ei = _entries.begin(); ei != _entries.end(); ++ei) {
|
||||||
const Entry &entry = (*ei);
|
const Entry &entry = (*ei);
|
||||||
@ -71,16 +74,16 @@ match_path(const Filename &orig_filename,
|
|||||||
if (new_filename.is_fully_qualified()) {
|
if (new_filename.is_fully_qualified()) {
|
||||||
// If the resulting filename is fully qualified, it's a match
|
// If the resulting filename is fully qualified, it's a match
|
||||||
// if and only if it exists.
|
// if and only if it exists.
|
||||||
if (new_filename.exists()) {
|
if (vfs->exists(new_filename)) {
|
||||||
return new_filename;
|
return new_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, if it's a relative filename, attempt to look it
|
// Otherwise, if it's a relative filename, attempt to look it
|
||||||
// up on the search path.
|
// up on the search path.
|
||||||
if (new_filename.resolve_filename(_path) ||
|
if (vfs->resolve_filename(new_filename, _path) ||
|
||||||
new_filename.resolve_filename(additional_path) ||
|
vfs->resolve_filename(new_filename, additional_path) ||
|
||||||
new_filename.resolve_filename(get_model_path())) {
|
vfs->resolve_filename(new_filename, get_model_path())) {
|
||||||
// Found it!
|
// Found it!
|
||||||
if (_path_store == PS_keep) {
|
if (_path_store == PS_keep) {
|
||||||
// If we asked to "keep" the pathname, we return the
|
// If we asked to "keep" the pathname, we return the
|
||||||
@ -129,9 +132,9 @@ match_path(const Filename &orig_filename,
|
|||||||
// is.
|
// is.
|
||||||
if (_path_store != PS_keep) {
|
if (_path_store != PS_keep) {
|
||||||
Filename new_filename = orig_filename;
|
Filename new_filename = orig_filename;
|
||||||
if (new_filename.resolve_filename(_path) ||
|
if (vfs->resolve_filename(new_filename, _path) ||
|
||||||
new_filename.resolve_filename(additional_path) ||
|
vfs->resolve_filename(new_filename, additional_path) ||
|
||||||
new_filename.resolve_filename(get_model_path())) {
|
vfs->resolve_filename(new_filename, get_model_path())) {
|
||||||
// Found it!
|
// Found it!
|
||||||
return new_filename;
|
return new_filename;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user