mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-17 20:23:47 -04:00
vertex_data_compression_level
This commit is contained in:
parent
378beb4b63
commit
83967af7dc
@ -49,6 +49,12 @@ ConfigVariableInt max_compressed_vertex_data
|
|||||||
"the least-recently-used ones will be temporarily flushed to "
|
"the least-recently-used ones will be temporarily flushed to "
|
||||||
"disk until they are needed. Set it to -1 for no limit."));
|
"disk until they are needed. Set it to -1 for no limit."));
|
||||||
|
|
||||||
|
ConfigVariableInt vertex_data_compression_level
|
||||||
|
("vertex-data-compression-level", 1,
|
||||||
|
PRC_DESC("Specifies the zlib compression level to use when compressing "
|
||||||
|
"vertex data. The number should be in the range 1 to 9, where "
|
||||||
|
"larger values are slower but give better compression."));
|
||||||
|
|
||||||
ConfigVariableInt max_disk_vertex_data
|
ConfigVariableInt max_disk_vertex_data
|
||||||
("max-disk-vertex-data", -1,
|
("max-disk-vertex-data", -1,
|
||||||
PRC_DESC("Specifies the maximum number of bytes of vertex data "
|
PRC_DESC("Specifies the maximum number of bytes of vertex data "
|
||||||
@ -451,8 +457,9 @@ make_compressed() {
|
|||||||
uLongf buffer_size = cdata->_data_full_size + ((cdata->_data_full_size + 999) / 1000) + 12;
|
uLongf buffer_size = cdata->_data_full_size + ((cdata->_data_full_size + 999) / 1000) + 12;
|
||||||
Bytef *buffer = new Bytef[buffer_size];
|
Bytef *buffer = new Bytef[buffer_size];
|
||||||
|
|
||||||
int result = compress(buffer, &buffer_size,
|
int result = compress2(buffer, &buffer_size,
|
||||||
&cdata->_data[0], cdata->_data_full_size);
|
&cdata->_data[0], cdata->_data_full_size,
|
||||||
|
vertex_data_compression_level);
|
||||||
if (result != Z_OK) {
|
if (result != Z_OK) {
|
||||||
gobj_cat.error()
|
gobj_cat.error()
|
||||||
<< "Couldn't compress: zlib error " << result << "\n";
|
<< "Couldn't compress: zlib error " << result << "\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user