Skip to content

Commit e138096

Browse files
committed
gobj: support writing Texture clear colors to .bam files (bam 6.45)
This fix requires setting "bam-version 6 45" in Config.prc. Part of the fix for panda3d#844
1 parent f1da4d4 commit e138096

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

panda/src/gobj/texture.cxx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10023,6 +10023,13 @@ do_write_datagram_body(CData *cdata, BamWriter *manager, Datagram &me) {
1002310023
me.add_uint32(cdata->_simple_ram_image._image.size());
1002410024
me.append_data(cdata->_simple_ram_image._image, cdata->_simple_ram_image._image.size());
1002510025
}
10026+
10027+
if (manager->get_file_minor_ver() >= 45) {
10028+
me.add_bool(cdata->_has_clear_color);
10029+
if (cdata->_has_clear_color) {
10030+
cdata->_clear_color.write_datagram(me);
10031+
}
10032+
}
1002610033
}
1002710034

1002810035
/**
@@ -10268,6 +10275,13 @@ do_fillin_body(CData *cdata, DatagramIterator &scan, BamReader *manager) {
1026810275
cdata->_simple_ram_image._page_size = u_size;
1026910276
cdata->inc_simple_image_modified();
1027010277
}
10278+
10279+
if (manager->get_file_minor_ver() >= 45) {
10280+
cdata->_has_clear_color = scan.get_bool();
10281+
if (cdata->_has_clear_color) {
10282+
cdata->_clear_color.read_datagram(scan);
10283+
}
10284+
}
1027110285
}
1027210286

1027310287
/**

panda/src/putil/bam.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static const unsigned short _bam_major_ver = 6;
3232
// Bumped to major version 6 on 2006-02-11 to factor out PandaNode::CData.
3333

3434
static const unsigned short _bam_first_minor_ver = 14;
35-
static const unsigned short _bam_last_minor_ver = 44;
35+
static const unsigned short _bam_last_minor_ver = 45;
3636
static const unsigned short _bam_minor_ver = 44;
3737
// Bumped to minor version 14 on 2007-12-19 to change default ColorAttrib.
3838
// Bumped to minor version 15 on 2008-04-09 to add TextureAttrib::_implicit_sort.
@@ -65,5 +65,6 @@ static const unsigned short _bam_minor_ver = 44;
6565
// Bumped to minor version 42 on 2016-04-08 to expand ColorBlendAttrib.
6666
// Bumped to minor version 43 on 2018-12-06 to expand BillboardEffect and CompassEffect.
6767
// Bumped to minor version 44 on 2018-12-23 to rename CollisionTube to CollisionCapsule.
68+
// Bumped to minor version 45 on 2020-03-18 to add Texture::_clear_color.
6869

6970
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy