diff --git a/panda/src/audio/audioManager.cxx b/panda/src/audio/audioManager.cxx index 9386c77f76..d40fb62018 100644 --- a/panda/src/audio/audioManager.cxx +++ b/panda/src/audio/audioManager.cxx @@ -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; } diff --git a/panda/src/audiotraits/fmodAudioManager.cxx b/panda/src/audiotraits/fmodAudioManager.cxx index 363fad7921..91751d68ea 100644 --- a/panda/src/audiotraits/fmodAudioManager.cxx +++ b/panda/src/audiotraits/fmodAudioManager.cxx @@ -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; diff --git a/panda/src/audiotraits/globalMilesManager.cxx b/panda/src/audiotraits/globalMilesManager.cxx index dc66f51cec..48bbf1389f 100644 --- a/panda/src/audiotraits/globalMilesManager.cxx +++ b/panda/src/audiotraits/globalMilesManager.cxx @@ -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); diff --git a/panda/src/audiotraits/milesAudioManager.cxx b/panda/src/audiotraits/milesAudioManager.cxx index 38d180c8d1..10878f1519 100644 --- a/panda/src/audiotraits/milesAudioManager.cxx +++ b/panda/src/audiotraits/milesAudioManager.cxx @@ -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 '"<resolve_filename(path, get_sound_path()) || - vfs->resolve_filename(path, get_model_path()); + vfs->resolve_filename(path, get_model_path()); audio_debug(" path=\""<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()) { diff --git a/panda/src/downloader/socketStream.cxx b/panda/src/downloader/socketStream.cxx index 1e5641566f..04ecd63f4c 100644 --- a/panda/src/downloader/socketStream.cxx +++ b/panda/src/downloader/socketStream.cxx @@ -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 diff --git a/panda/src/downloader/socketStream.h b/panda/src/downloader/socketStream.h index f897532c0d..e291c020ff 100644 --- a/panda/src/downloader/socketStream.h +++ b/panda/src/downloader/socketStream.h @@ -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; }; diff --git a/panda/src/egg/config_egg.cxx b/panda/src/egg/config_egg.cxx index 5fd2efa695..abd0e08ebd 100644 --- a/panda/src/egg/config_egg.cxx +++ b/panda/src/egg/config_egg.cxx @@ -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 " diff --git a/panda/src/egg/config_egg.h b/panda/src/egg/config_egg.h index 7682648af3..65119c7662 100644 --- a/panda/src/egg/config_egg.h +++ b/panda/src/egg/config_egg.h @@ -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; diff --git a/panda/src/egg/eggData.cxx b/panda/src/egg/eggData.cxx index f079c5cb41..86c2edd9d2 100644 --- a/panda/src/egg/eggData.cxx +++ b/panda/src/egg/eggData.cxx @@ -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); diff --git a/panda/src/egg/eggGroupNode.cxx b/panda/src/egg/eggGroupNode.cxx index 85cb453b23..876868e933 100644 --- a/panda/src/egg/eggGroupNode.cxx +++ b/panda/src/egg/eggGroupNode.cxx @@ -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) { diff --git a/panda/src/gobj/texture.cxx b/panda/src/gobj/texture.cxx index ed89c5d70c..620e11171f 100644 --- a/panda/src/gobj/texture.cxx +++ b/panda/src/gobj/texture.cxx @@ -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() diff --git a/panda/src/gobj/texturePool.cxx b/panda/src/gobj/texturePool.cxx index 42a7b0ed90..60e388cc4e 100644 --- a/panda/src/gobj/texturePool.cxx +++ b/panda/src/gobj/texturePool.cxx @@ -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. diff --git a/panda/src/putil/config_util.cxx b/panda/src/putil/config_util.cxx index baf71a8744..60d653c0e9 100644 --- a/panda/src/putil/config_util.cxx +++ b/panda/src/putil/config_util.cxx @@ -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; diff --git a/panda/src/putil/config_util.h b/panda/src/putil/config_util.h index 798c7e7c03..01e531abff 100644 --- a/panda/src/putil/config_util.h +++ b/panda/src/putil/config_util.h @@ -41,8 +41,6 @@ extern EXPCL_PANDA_PUTIL ConfigVariableEnum 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 diff --git a/pandatool/src/converter/somethingToEggConverter.I b/pandatool/src/converter/somethingToEggConverter.I index 08c9b9d2df..e51c9f1b13 100644 --- a/pandatool/src/converter/somethingToEggConverter.I +++ b/pandatool/src/converter/somethingToEggConverter.I @@ -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 diff --git a/pandatool/src/converter/somethingToEggConverter.h b/pandatool/src/converter/somethingToEggConverter.h index a56f5b4234..9a90a5de71 100644 --- a/pandatool/src/converter/somethingToEggConverter.h +++ b/pandatool/src/converter/somethingToEggConverter.h @@ -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 diff --git a/pandatool/src/egg-palettize/txaFileFilter.cxx b/pandatool/src/egg-palettize/txaFileFilter.cxx index 06693d9490..529b9619c1 100644 --- a/pandatool/src/egg-palettize/txaFileFilter.cxx +++ b/pandatool/src/egg-palettize/txaFileFilter.cxx @@ -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)) { diff --git a/pandatool/src/eggbase/eggReader.cxx b/pandatool/src/eggbase/eggReader.cxx index 0557a1fe24..39f3c936cf 100644 --- a/pandatool/src/eggbase/eggReader.cxx +++ b/pandatool/src/eggbase/eggReader.cxx @@ -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; diff --git a/pandatool/src/flt/fltTexture.cxx b/pandatool/src/flt/fltTexture.cxx index 89e7c78e43..be5d3eee63 100644 --- a/pandatool/src/flt/fltTexture.cxx +++ b/pandatool/src/flt/fltTexture.cxx @@ -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(); diff --git a/pandatool/src/lwoegg/cLwoSurface.cxx b/pandatool/src/lwoegg/cLwoSurface.cxx index 59d2a8626f..9b49d8d495 100644 --- a/pandatool/src/lwoegg/cLwoSurface.cxx +++ b/pandatool/src/lwoegg/cLwoSurface.cxx @@ -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); diff --git a/pandatool/src/maxegg/maxToEggConverter.cxx b/pandatool/src/maxegg/maxToEggConverter.cxx index 65d34b51d4..e4177c5d7f 100755 --- a/pandatool/src/maxegg/maxToEggConverter.cxx +++ b/pandatool/src/maxegg/maxToEggConverter.cxx @@ -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(), ""); diff --git a/pandatool/src/mayaegg/mayaToEggConverter.cxx b/pandatool/src/mayaegg/mayaToEggConverter.cxx index e7ab784664..be885b4a3f 100644 --- a/pandatool/src/mayaegg/mayaToEggConverter.cxx +++ b/pandatool/src/mayaegg/mayaToEggConverter.cxx @@ -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); } diff --git a/pandatool/src/softegg/softToEggConverter.cxx b/pandatool/src/softegg/softToEggConverter.cxx index 3349a4966d..bba48b81aa 100755 --- a/pandatool/src/softegg/softToEggConverter.cxx +++ b/pandatool/src/softegg/softToEggConverter.cxx @@ -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); diff --git a/pandatool/src/xfileegg/xFileMaterial.cxx b/pandatool/src/xfileegg/xFileMaterial.cxx index da67f7fc2e..74bfc016cb 100644 --- a/pandatool/src/xfileegg/xFileMaterial.cxx +++ b/pandatool/src/xfileegg/xFileMaterial.cxx @@ -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);