mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
fix negative pstats reporting
This commit is contained in:
parent
8c46644a1c
commit
4190c60ba7
@ -194,6 +194,7 @@ write_data(const unsigned char *data, size_t size, bool compressed) {
|
|||||||
|
|
||||||
PT(VertexDataSaveBlock) block = (VertexDataSaveBlock *)SimpleAllocator::do_alloc(size);
|
PT(VertexDataSaveBlock) block = (VertexDataSaveBlock *)SimpleAllocator::do_alloc(size);
|
||||||
if (block != (VertexDataSaveBlock *)NULL) {
|
if (block != (VertexDataSaveBlock *)NULL) {
|
||||||
|
_total_file_size = max(_total_file_size, block->get_start() + size);
|
||||||
block->set_compressed(compressed);
|
block->set_compressed(compressed);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -240,8 +241,6 @@ write_data(const unsigned char *data, size_t size, bool compressed) {
|
|||||||
size -= result;
|
size -= result;
|
||||||
}
|
}
|
||||||
#endif // _WIN32
|
#endif // _WIN32
|
||||||
|
|
||||||
_total_file_size = max(_total_file_size, block->get_start() + size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return block;
|
return block;
|
||||||
|
@ -44,11 +44,13 @@ public:
|
|||||||
size_t max_size);
|
size_t max_size);
|
||||||
~VertexDataSaveFile();
|
~VertexDataSaveFile();
|
||||||
|
|
||||||
|
PUBLISHED:
|
||||||
INLINE bool is_valid() const;
|
INLINE bool is_valid() const;
|
||||||
|
|
||||||
INLINE size_t get_total_file_size() const;
|
INLINE size_t get_total_file_size() const;
|
||||||
INLINE size_t get_used_file_size() const;
|
INLINE size_t get_used_file_size() const;
|
||||||
|
|
||||||
|
public:
|
||||||
PT(VertexDataSaveBlock) write_data(const unsigned char *data, size_t size,
|
PT(VertexDataSaveBlock) write_data(const unsigned char *data, size_t size,
|
||||||
bool compressed);
|
bool compressed);
|
||||||
bool read_data(unsigned char *data, size_t size,
|
bool read_data(unsigned char *data, size_t size,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user