diff --git a/pandatool/src/bam/eggToBam.cxx b/pandatool/src/bam/eggToBam.cxx index 89814882c5..5311ba2782 100644 --- a/pandatool/src/bam/eggToBam.cxx +++ b/pandatool/src/bam/eggToBam.cxx @@ -87,6 +87,17 @@ EggToBam() : "written exactly as they are, losslessly.", &EggToBam::dispatch_none, &_compression_off); + add_option + ("rawtex", "", 0, + "Record texture data directly in the bam file, instead of storing " + "a reference to the texture elsewhere on disk. The textures are " + "stored uncompressed. A particular texture that is encoded into " + "multiple different bam files in this way cannot be unified into " + "the same part of texture memory if the different bam files are loaded " + "together. All that being said, this can sometimes be a convenient " + "way to ensure the bam file is completely self-contained.", + &EggToBam::dispatch_none, &_tex_rawdata); + redescribe_option ("cs", "Specify the coordinate system of the resulting " + _format_name + @@ -174,8 +185,12 @@ handle_args(ProgramBase::Args &args) { // If the user specified a path store option, we need to set the // bam-texture-mode Configrc variable directly to support this // (otherwise the bam code will do what it wants to do anyway). - if (_got_path_store) { + if (_tex_rawdata) { + bam_texture_mode = BTM_rawdata; + + } else if (_got_path_store) { bam_texture_mode = BTM_unchanged; + } else { // Otherwise, the default path store is absolute; then the // bam-texture-mode can do the appropriate thing to it. diff --git a/pandatool/src/bam/eggToBam.h b/pandatool/src/bam/eggToBam.h index 2fa79b6d12..0042debdac 100644 --- a/pandatool/src/bam/eggToBam.h +++ b/pandatool/src/bam/eggToBam.h @@ -44,6 +44,7 @@ private: bool _has_compression_quality; int _compression_quality; bool _compression_off; + bool _tex_rawdata; }; #endif