mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 19:08:55 -04:00
fix texture bamming
This commit is contained in:
parent
f87b67df13
commit
c32747d900
@ -1248,7 +1248,9 @@ begin_frame(GraphicsStateGuardianBase *gsg, Thread *current_thread) {
|
|||||||
++qti) {
|
++qti) {
|
||||||
Texture *tex = (*qti);
|
Texture *tex = (*qti);
|
||||||
TextureContext *tc = tex->prepare_now(this, gsg);
|
TextureContext *tc = tex->prepare_now(this, gsg);
|
||||||
gsg->update_texture(tc, true);
|
if (tc != (TextureContext *)NULL) {
|
||||||
|
gsg->update_texture(tc, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_enqueued_textures.clear();
|
_enqueued_textures.clear();
|
||||||
|
@ -5064,6 +5064,8 @@ make_from_bam(const FactoryParams ¶ms) {
|
|||||||
manager->get_loader_options());
|
manager->get_loader_options());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
cerr << "loaded tex " << me << "\n";
|
||||||
|
cerr << "loaded filename = " << me->get_filename() << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5226,7 +5228,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||||||
// disk.
|
// disk.
|
||||||
BamTextureMode file_texture_mode = manager->get_file_texture_mode();
|
BamTextureMode file_texture_mode = manager->get_file_texture_mode();
|
||||||
bool has_rawdata =
|
bool has_rawdata =
|
||||||
(file_texture_mode == BTM_rawdata || (do_has_ram_image() && _fullpath.empty()));
|
(file_texture_mode == BTM_rawdata || (do_has_ram_image() && _filename.empty()));
|
||||||
if (has_rawdata && !do_has_ram_image()) {
|
if (has_rawdata && !do_has_ram_image()) {
|
||||||
do_get_ram_image();
|
do_get_ram_image();
|
||||||
if (!do_has_ram_image()) {
|
if (!do_has_ram_image()) {
|
||||||
@ -5237,8 +5239,8 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||||||
|
|
||||||
bool has_bam_dir = !manager->get_filename().empty();
|
bool has_bam_dir = !manager->get_filename().empty();
|
||||||
Filename bam_dir = manager->get_filename().get_dirname();
|
Filename bam_dir = manager->get_filename().get_dirname();
|
||||||
Filename filename;
|
Filename filename = _filename;
|
||||||
Filename alpha_filename;
|
Filename alpha_filename = _alpha_filename;
|
||||||
|
|
||||||
switch (file_texture_mode) {
|
switch (file_texture_mode) {
|
||||||
case BTM_unchanged:
|
case BTM_unchanged:
|
||||||
@ -5286,7 +5288,7 @@ write_datagram(BamWriter *manager, Datagram &me) {
|
|||||||
<< "Unsupported bam-texture-mode: " << (int)file_texture_mode << "\n";
|
<< "Unsupported bam-texture-mode: " << (int)file_texture_mode << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filename.empty()) {
|
if (filename.empty() && do_has_ram_image()) {
|
||||||
// If we don't have a filename, we have to store rawdata anyway.
|
// If we don't have a filename, we have to store rawdata anyway.
|
||||||
has_rawdata = true;
|
has_rawdata = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user