|
|
@@ -83,11 +83,12 @@ read_flt(Filename filename) {
|
|
|
return FE_could_not_open;
|
|
|
}
|
|
|
|
|
|
- // By default, the filename's directory is added to the texture
|
|
|
- // search path.
|
|
|
+ // By default, the filename's directory is added to the texture and
|
|
|
+ // model search path.
|
|
|
string dirname = filename.get_dirname();
|
|
|
if (!dirname.empty()) {
|
|
|
- _texture_path.append_directory(dirname);
|
|
|
+ _texture_path.prepend_directory(dirname);
|
|
|
+ _model_path.prepend_directory(dirname);
|
|
|
}
|
|
|
|
|
|
return read_flt(in);
|
|
|
@@ -847,6 +848,40 @@ get_texture_path() const {
|
|
|
return _texture_path;
|
|
|
}
|
|
|
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: FltHeader::set_model_path
|
|
|
+// Access: Public
|
|
|
+// Description: Sets the search path that relative external
|
|
|
+// references will be looked for along.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+void FltHeader::
|
|
|
+set_model_path(const DSearchPath &path) {
|
|
|
+ _model_path = path;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: FltHeader::update_model_path
|
|
|
+// Access: Public
|
|
|
+// Description: Returns a non-const reference to the model search
|
|
|
+// path, so that it may be appended to or otherwise
|
|
|
+// modified.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+DSearchPath &FltHeader::
|
|
|
+update_model_path() {
|
|
|
+ return _model_path;
|
|
|
+}
|
|
|
+
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+// Function: FltHeader::get_model_path
|
|
|
+// Access: Public
|
|
|
+// Description: Returns the search path for looking up external
|
|
|
+// references.
|
|
|
+////////////////////////////////////////////////////////////////////
|
|
|
+const DSearchPath &FltHeader::
|
|
|
+get_model_path() const {
|
|
|
+ return _model_path;
|
|
|
+}
|
|
|
+
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
// Function: FltHeader::has_light_source
|
|
|
// Access: Public
|