mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
remove texture_path, sound_path, egg_path
This commit is contained in:
parent
4c68734398
commit
bcdab6f3d4
@ -287,8 +287,7 @@ get_dls_pathname() {
|
||||
Filename dls_filename = audio_dls_file;
|
||||
if (!dls_filename.empty()) {
|
||||
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||
vfs->resolve_filename(dls_filename, get_sound_path()) ||
|
||||
vfs->resolve_filename(dls_filename, get_model_path());
|
||||
vfs->resolve_filename(dls_filename, get_model_path());
|
||||
|
||||
return dls_filename;
|
||||
}
|
||||
|
@ -410,8 +410,7 @@ get_sound(const string &file_name, bool positional, int) {
|
||||
Filename path = file_name;
|
||||
|
||||
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||
vfs->resolve_filename(path, get_sound_path()) ||
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
|
||||
// Build a new AudioSound from the audio data.
|
||||
PT(AudioSound) audioSound = 0;
|
||||
|
@ -318,8 +318,7 @@ open_api() {
|
||||
Filename dls_pathname = AudioManager::get_dls_pathname();
|
||||
|
||||
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||
vfs->resolve_filename(dls_pathname, get_sound_path()) ||
|
||||
vfs->resolve_filename(dls_pathname, get_model_path());
|
||||
vfs->resolve_filename(dls_pathname, get_model_path());
|
||||
|
||||
_dls_data.clear();
|
||||
PT(VirtualFile) file = vfs->get_file(dls_pathname);
|
||||
|
@ -147,8 +147,7 @@ get_sound(const string &file_name, bool, int) {
|
||||
Filename path = file_name;
|
||||
|
||||
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||
vfs->resolve_filename(path, get_sound_path()) ||
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
audio_debug(" resolved file_name is '"<<path<<"'");
|
||||
|
||||
PT(SoundData) sd;
|
||||
@ -244,8 +243,7 @@ uncache_sound(const string &file_name) {
|
||||
Filename path = file_name;
|
||||
|
||||
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||
vfs->resolve_filename(path, get_sound_path()) ||
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
|
||||
audio_debug(" path=\""<<path<<"\"");
|
||||
SoundMap::iterator i = _sounds.find(path);
|
||||
|
@ -386,8 +386,7 @@ get_sound(const string &file_name, bool positional, int mode) {
|
||||
|
||||
Filename path = file_name;
|
||||
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||
vfs->resolve_filename(path, get_sound_path()) ||
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
|
||||
if (path.empty()) {
|
||||
audio_error("get_sound - invalid filename");
|
||||
@ -417,8 +416,7 @@ uncache_sound(const string& file_name) {
|
||||
Filename path = file_name;
|
||||
|
||||
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||
vfs->resolve_filename(path, get_sound_path()) ||
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
vfs->resolve_filename(path, get_model_path());
|
||||
|
||||
SampleCache::iterator sci = _sample_cache.find(path);
|
||||
if (sci != _sample_cache.end()) {
|
||||
|
@ -232,20 +232,4 @@ ISocketStream::
|
||||
nassertv(_channel == NULL);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: ISocketStream::set_hold_ptr
|
||||
// Access: Published
|
||||
// Description: Associates a reference-counting pointer with the
|
||||
// stream. The stream does nothing with the pointer
|
||||
// other than hold its reference count for its own
|
||||
// lifetime (or until set_hold_ptr() is called again).
|
||||
//
|
||||
// At the moment, this is used only by VirtualFileHTTP.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void ISocketStream::
|
||||
set_hold_ptr(const TypedReferenceCount *ptr) {
|
||||
_hold_ptr = ptr;
|
||||
}
|
||||
|
||||
#endif // HAVE_OPENSSL
|
||||
|
@ -138,14 +138,10 @@ PUBLISHED:
|
||||
virtual void close() = 0;
|
||||
virtual ReadState get_read_state() = 0;
|
||||
|
||||
void set_hold_ptr(const TypedReferenceCount *ptr);
|
||||
|
||||
protected:
|
||||
HTTPChannel *_channel;
|
||||
|
||||
private:
|
||||
CPT(TypedReferenceCount) _hold_ptr;
|
||||
|
||||
friend class HTTPChannel;
|
||||
};
|
||||
|
||||
|
@ -64,11 +64,6 @@ ConfigureFn(config_egg) {
|
||||
init_libegg();
|
||||
}
|
||||
|
||||
ConfigVariableSearchPath egg_path
|
||||
("egg-path",
|
||||
PRC_DESC("The search path along which only egg files are searched. Generally, you "
|
||||
"should use model-path instead of egg-path."));
|
||||
|
||||
ConfigVariableBool egg_support_old_anims
|
||||
("egg-support-old-anims", true,
|
||||
PRC_DESC("Set this true to support loading of old character animation files, which "
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
NotifyCategoryDecl(egg, EXPCL_PANDAEGG, EXPTP_PANDAEGG);
|
||||
|
||||
extern ConfigVariableSearchPath egg_path;
|
||||
extern ConfigVariableBool egg_support_old_anims;
|
||||
|
||||
extern EXPCL_PANDAEGG ConfigVariableBool egg_mesh;
|
||||
|
@ -37,10 +37,9 @@ TypeHandle EggData::_type_handle;
|
||||
// Function: EggData::resolve_egg_filename
|
||||
// Access: Public, Static
|
||||
// Description: Looks for the indicated filename, first along the
|
||||
// indicated searchpath, and then along the egg_path and
|
||||
// finally along the model_path. If found, updates the
|
||||
// filename to the full path and returns true;
|
||||
// otherwise, returns false.
|
||||
// indicated searchpath, and then along the model_path.
|
||||
// If found, updates the filename to the full path and
|
||||
// returns true; otherwise, returns false.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
bool EggData::
|
||||
resolve_egg_filename(Filename &egg_filename, const DSearchPath &searchpath) {
|
||||
@ -51,7 +50,6 @@ resolve_egg_filename(Filename &egg_filename, const DSearchPath &searchpath) {
|
||||
}
|
||||
|
||||
vfs->resolve_filename(egg_filename, searchpath, "egg") ||
|
||||
vfs->resolve_filename(egg_filename, egg_path, "egg") ||
|
||||
vfs->resolve_filename(egg_filename, get_model_path(), "egg");
|
||||
|
||||
return vfs->exists(egg_filename);
|
||||
|
@ -412,9 +412,9 @@ has_absolute_pathnames() const {
|
||||
// Function: EggGroupNode::resolve_filenames
|
||||
// Access: Published
|
||||
// Description: Walks the tree and attempts to resolve any filenames
|
||||
// encountered. This looks up filenames in the search
|
||||
// path, etc. It does not automatically search the
|
||||
// egg_path for missing files.
|
||||
// encountered. This looks up filenames along the
|
||||
// specified search path; it does not automatically
|
||||
// search the model_path for missing files.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void EggGroupNode::
|
||||
resolve_filenames(const DSearchPath &searchpath) {
|
||||
|
@ -5223,9 +5223,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
||||
alpha_filename = _alpha_fullpath;
|
||||
bam_dir.make_absolute();
|
||||
if (!has_bam_dir || !filename.make_relative_to(bam_dir, true)) {
|
||||
if (filename.find_on_searchpath(get_texture_path()) == -1) {
|
||||
filename.find_on_searchpath(get_model_path());
|
||||
}
|
||||
filename.find_on_searchpath(get_model_path());
|
||||
}
|
||||
if (gobj_cat.is_debug()) {
|
||||
gobj_cat.debug()
|
||||
@ -5233,9 +5231,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
||||
<< " found as " << filename << "\n";
|
||||
}
|
||||
if (!has_bam_dir || !alpha_filename.make_relative_to(bam_dir, true)) {
|
||||
if (alpha_filename.find_on_searchpath(get_texture_path()) == -1) {
|
||||
alpha_filename.find_on_searchpath(get_model_path());
|
||||
}
|
||||
alpha_filename.find_on_searchpath(get_model_path());
|
||||
}
|
||||
if (gobj_cat.is_debug()) {
|
||||
gobj_cat.debug()
|
||||
|
@ -850,8 +850,7 @@ resolve_filename(Filename &new_filename, const Filename &orig_filename) {
|
||||
|
||||
new_filename = orig_filename;
|
||||
VirtualFileSystem *vfs = VirtualFileSystem::get_global_ptr();
|
||||
vfs->resolve_filename(new_filename, get_texture_path()) ||
|
||||
vfs->resolve_filename(new_filename, get_model_path());
|
||||
vfs->resolve_filename(new_filename, get_model_path());
|
||||
|
||||
_relpath_lookup[orig_filename] = new_filename;
|
||||
}
|
||||
@ -958,8 +957,7 @@ report_texture_unreadable(const Filename &filename) const {
|
||||
// search path.
|
||||
gobj_cat.error()
|
||||
<< "Unable to find texture \"" << filename << "\""
|
||||
<< " on texture_path " << get_texture_path()
|
||||
<< " or model_path " << get_model_path() <<"\n";
|
||||
<< " on model-path " << get_model_path() <<"\n";
|
||||
} else {
|
||||
// A fully-specified filename is not searched along the path, so
|
||||
// don't mislead the user with the error message.
|
||||
|
@ -90,33 +90,6 @@ get_model_path() {
|
||||
return *model_path;
|
||||
}
|
||||
|
||||
ConfigVariableSearchPath &
|
||||
get_texture_path() {
|
||||
static ConfigVariableSearchPath *texture_path = NULL;
|
||||
if (texture_path == NULL) {
|
||||
texture_path = new ConfigVariableSearchPath
|
||||
("texture-path",
|
||||
PRC_DESC("A special directory path to search for textures only. "
|
||||
"Textures are also searched for along the model-path, so the "
|
||||
"use of texture-path is only useful if you have special "
|
||||
"directories that only contain textures."));
|
||||
}
|
||||
|
||||
return *texture_path;
|
||||
}
|
||||
|
||||
ConfigVariableSearchPath &
|
||||
get_sound_path() {
|
||||
static ConfigVariableSearchPath *sound_path = NULL;
|
||||
if (sound_path == NULL) {
|
||||
sound_path = new ConfigVariableSearchPath
|
||||
("sound-path",
|
||||
PRC_DESC("The directories to search for sound and music files to be loaded."));
|
||||
}
|
||||
|
||||
return *sound_path;
|
||||
}
|
||||
|
||||
ConfigVariableSearchPath &
|
||||
get_plugin_path() {
|
||||
static ConfigVariableSearchPath *plugin_path = NULL;
|
||||
|
@ -41,8 +41,6 @@ extern EXPCL_PANDA_PUTIL ConfigVariableEnum<BamTextureMode> bam_texture_mode;
|
||||
|
||||
BEGIN_PUBLISH
|
||||
EXPCL_PANDA_PUTIL ConfigVariableSearchPath &get_model_path();
|
||||
EXPCL_PANDA_PUTIL ConfigVariableSearchPath &get_texture_path();
|
||||
EXPCL_PANDA_PUTIL ConfigVariableSearchPath &get_sound_path();
|
||||
EXPCL_PANDA_PUTIL ConfigVariableSearchPath &get_plugin_path();
|
||||
END_PUBLISH
|
||||
|
||||
|
@ -496,18 +496,6 @@ get_egg_data() {
|
||||
return _egg_data;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: SomethingToEggConverter::convert_texture_path
|
||||
// Access: Public
|
||||
// Description: Converts the indicated texture filename to a relative
|
||||
// or absolute or whatever filename, according to
|
||||
// _path_replace.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE Filename SomethingToEggConverter::
|
||||
convert_texture_path(const Filename &orig_filename) {
|
||||
return _path_replace->convert_path(orig_filename, get_texture_path());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: SomethingToEggConverter::convert_model_path
|
||||
// Access: Public
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "pandatoolbase.h"
|
||||
|
||||
#include "filename.h"
|
||||
#include "config_util.h" // for get_texture_path() and get_model_path()
|
||||
#include "config_util.h" // for get_model_path()
|
||||
#include "animationConvert.h"
|
||||
#include "pathReplace.h"
|
||||
#include "pointerTo.h"
|
||||
@ -110,7 +110,6 @@ public:
|
||||
bool handle_external_reference(EggGroupNode *egg_parent,
|
||||
const Filename &ref_filename);
|
||||
|
||||
INLINE Filename convert_texture_path(const Filename &orig_filename);
|
||||
INLINE Filename convert_model_path(const Filename &orig_filename);
|
||||
|
||||
// Set this true to treat errors as warnings and generate output
|
||||
|
@ -132,7 +132,6 @@ read_txa_file() {
|
||||
"is in effect."));
|
||||
|
||||
Filename filename = txa_file;
|
||||
vfs->resolve_filename(filename, get_texture_path());
|
||||
vfs->resolve_filename(filename, get_model_path());
|
||||
|
||||
if (!vfs->exists(filename)) {
|
||||
|
@ -280,9 +280,7 @@ copy_textures() {
|
||||
EggTexture *tex = (*ti);
|
||||
Filename orig_filename = tex->get_filename();
|
||||
if (!orig_filename.exists()) {
|
||||
bool found =
|
||||
orig_filename.resolve_filename(get_texture_path()) ||
|
||||
orig_filename.resolve_filename(get_model_path());
|
||||
bool found = orig_filename.resolve_filename(get_model_path());
|
||||
if (!found) {
|
||||
nout << "Cannot find " << orig_filename << "\n";
|
||||
success = false;
|
||||
|
@ -242,7 +242,7 @@ extract_record(FltRecordReader &reader) {
|
||||
} else {
|
||||
_orig_filename = iterator.get_fixed_string(200);
|
||||
}
|
||||
_converted_filename = _header->convert_path(Filename::from_os_specific(_orig_filename), get_texture_path());
|
||||
_converted_filename = _header->convert_path(Filename::from_os_specific(_orig_filename), get_model_path());
|
||||
_pattern_index = iterator.get_be_int32();
|
||||
_x_location = iterator.get_be_int32();
|
||||
_y_location = iterator.get_be_int32();
|
||||
|
@ -244,7 +244,7 @@ check_texture() {
|
||||
return false;
|
||||
}
|
||||
|
||||
Filename pathname = _converter->convert_texture_path(clip->_filename);
|
||||
Filename pathname = _converter->convert_model_path(clip->_filename);
|
||||
|
||||
_egg_texture = new EggTexture("clip" + format_string(clip_index), pathname);
|
||||
|
||||
|
@ -959,7 +959,7 @@ void MaxToEggConverter::analyze_diffuse_maps(PandaMaterial &pandaMat, Texmap *ma
|
||||
|
||||
Filename fullpath, outpath;
|
||||
Filename filename = Filename::from_os_specific(diffuseTex->GetMapName());
|
||||
_options->_path_replace->full_convert_path(filename, get_texture_path(),
|
||||
_options->_path_replace->full_convert_path(filename, get_model_path(),
|
||||
fullpath, outpath);
|
||||
tex->set_filename(outpath);
|
||||
tex->set_fullpath(fullpath);
|
||||
@ -1000,7 +1000,7 @@ void MaxToEggConverter::analyze_opacity_maps(PandaMaterial &pandaMat, Texmap *ma
|
||||
|
||||
Filename fullpath, outpath;
|
||||
Filename filename = Filename::from_os_specific(transTex->GetMapName());
|
||||
_options->_path_replace->full_convert_path(filename, get_texture_path(),
|
||||
_options->_path_replace->full_convert_path(filename, get_model_path(),
|
||||
fullpath, outpath);
|
||||
|
||||
// See if this opacity map already showed up.
|
||||
@ -1052,7 +1052,7 @@ void MaxToEggConverter::analyze_glow_maps(PandaMaterial &pandaMat, Texmap *mat)
|
||||
|
||||
Filename fullpath, outpath;
|
||||
Filename filename = Filename::from_os_specific(gtex->GetMapName());
|
||||
_options->_path_replace->full_convert_path(filename, get_texture_path(),
|
||||
_options->_path_replace->full_convert_path(filename, get_model_path(),
|
||||
fullpath, outpath);
|
||||
|
||||
// Try to find a diffuse map to pair this with as an alpha-texture.
|
||||
@ -1097,7 +1097,7 @@ void MaxToEggConverter::analyze_gloss_maps(PandaMaterial &pandaMat, Texmap *mat)
|
||||
|
||||
Filename fullpath, outpath;
|
||||
Filename filename = Filename::from_os_specific(gtex->GetMapName());
|
||||
_options->_path_replace->full_convert_path(filename, get_texture_path(),
|
||||
_options->_path_replace->full_convert_path(filename, get_model_path(),
|
||||
fullpath, outpath);
|
||||
|
||||
// Try to find a diffuse map to pair this with as an alpha-texture.
|
||||
@ -1142,7 +1142,7 @@ void MaxToEggConverter::analyze_normal_maps(PandaMaterial &pandaMat, Texmap *mat
|
||||
|
||||
Filename fullpath, outpath;
|
||||
Filename filename = Filename::from_os_specific(ntex->GetMapName());
|
||||
_options->_path_replace->full_convert_path(filename, get_texture_path(),
|
||||
_options->_path_replace->full_convert_path(filename, get_model_path(),
|
||||
fullpath, outpath);
|
||||
|
||||
PT(EggTexture) tex = new EggTexture(generate_tex_name(), "");
|
||||
|
@ -2565,7 +2565,7 @@ set_shader_legacy(EggPrimitive &primitive, const MayaShader &shader,
|
||||
//}
|
||||
Filename filename = Filename::from_os_specific(color_def->_texture_filename);
|
||||
Filename fullpath, outpath;
|
||||
_path_replace->full_convert_path(filename, get_texture_path(), fullpath, outpath);
|
||||
_path_replace->full_convert_path(filename, get_model_path(), fullpath, outpath);
|
||||
tex.set_filename(outpath);
|
||||
tex.set_fullpath(fullpath);
|
||||
apply_texture_uvprops(tex, *color_def);
|
||||
@ -2609,7 +2609,7 @@ set_shader_legacy(EggPrimitive &primitive, const MayaShader &shader,
|
||||
// set_alpha_file_channel()), but for now we assume it comes
|
||||
// from the grayscale data.
|
||||
filename = Filename::from_os_specific(trans_def._texture_filename);
|
||||
_path_replace->full_convert_path(filename, get_texture_path(),
|
||||
_path_replace->full_convert_path(filename, get_model_path(),
|
||||
fullpath, outpath);
|
||||
tex.set_alpha_filename(outpath);
|
||||
tex.set_alpha_fullpath(fullpath);
|
||||
@ -2708,7 +2708,7 @@ set_shader_legacy(EggPrimitive &primitive, const MayaShader &shader,
|
||||
// primary filename, and set the format accordingly.
|
||||
Filename filename = Filename::from_os_specific(trans_def._texture_filename);
|
||||
Filename fullpath,outpath;
|
||||
_path_replace->full_convert_path(filename, get_texture_path(),
|
||||
_path_replace->full_convert_path(filename, get_model_path(),
|
||||
fullpath, outpath);
|
||||
tex.set_filename(outpath);
|
||||
tex.set_fullpath(fullpath);
|
||||
@ -2874,7 +2874,7 @@ void MayaToEggConverter::
|
||||
apply_texture_filename(EggTexture &tex, const MayaShaderColorDef &def) {
|
||||
Filename filename = Filename::from_os_specific(def._texture_filename);
|
||||
Filename fullpath, outpath;
|
||||
_path_replace->full_convert_path(filename, get_texture_path(), fullpath, outpath);
|
||||
_path_replace->full_convert_path(filename, get_model_path(), fullpath, outpath);
|
||||
tex.set_filename(outpath);
|
||||
tex.set_fullpath(fullpath);
|
||||
}
|
||||
@ -2891,7 +2891,7 @@ apply_texture_alpha_filename(EggTexture &tex, const MayaShaderColorDef &def) {
|
||||
if (def._opposite->_texture_filename != def._texture_filename) {
|
||||
Filename filename = Filename::from_os_specific(def._opposite->_texture_filename);
|
||||
Filename fullpath, outpath;
|
||||
_path_replace->full_convert_path(filename, get_texture_path(), fullpath, outpath);
|
||||
_path_replace->full_convert_path(filename, get_model_path(), fullpath, outpath);
|
||||
tex.set_alpha_filename(outpath);
|
||||
tex.set_alpha_fullpath(fullpath);
|
||||
}
|
||||
|
@ -2030,7 +2030,7 @@ set_shader_attributes(SoftNodeDesc *node_desc, EggPrimitive &primitive, int idx)
|
||||
EggTexture tex(texName, "");
|
||||
|
||||
Filename filename = Filename::from_os_specific(texName);
|
||||
Filename fullpath = _path_replace->match_path(filename, get_texture_path());
|
||||
Filename fullpath = _path_replace->match_path(filename, get_model_path());
|
||||
tex.set_filename(_path_replace->store_path(fullpath));
|
||||
tex.set_fullpath(fullpath);
|
||||
// tex.set_format(EggTexture::F_rgb);
|
||||
|
@ -99,7 +99,7 @@ void XFileMaterial::
|
||||
apply_to_egg(EggPrimitive *egg_prim, XFileToEggConverter *converter) {
|
||||
// Is there a texture?
|
||||
if (_has_texture) {
|
||||
Filename texture = converter->convert_texture_path(_texture);
|
||||
Filename texture = converter->convert_model_path(_texture);
|
||||
EggTexture temp("", texture);
|
||||
EggTexture *egg_tex = converter->create_unique_texture(temp);
|
||||
egg_prim->set_texture(egg_tex);
|
||||
|
Loading…
x
Reference in New Issue
Block a user