mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 07:48:37 -04:00
*** empty log message ***
This commit is contained in:
parent
1ae907ef31
commit
35af988627
@ -33,6 +33,7 @@
|
||||
#include <dconfig.h>
|
||||
|
||||
Configure(config_flt);
|
||||
NotifyCategoryDef(flt, "");
|
||||
|
||||
// Set this true to trigger an assertion failure (and core dump)
|
||||
// immediately when an error is detected on reading or writing a flt
|
||||
|
@ -6,6 +6,12 @@
|
||||
#ifndef CONFIG_FLT_H
|
||||
#define CONFIG_FLT_H
|
||||
|
||||
#include <pandatoolbase.h>
|
||||
|
||||
#include <notifyCategoryProxy.h>
|
||||
|
||||
NotifyCategoryDecl(flt, EXPCL_MISC, EXPTP_MISC);
|
||||
|
||||
extern const bool flt_error_abort;
|
||||
|
||||
#endif
|
||||
|
@ -509,10 +509,8 @@ read_record_and_children(FltRecordReader &reader) {
|
||||
}
|
||||
|
||||
// Skip to the next record. If that's the end, fine.
|
||||
result = reader.advance();
|
||||
if (result == FE_end_of_file) {
|
||||
return FE_ok;
|
||||
} else if (result != FE_ok) {
|
||||
result = reader.advance(true);
|
||||
if (reader.eof() || result != FE_ok) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ get_record_length() const {
|
||||
// file has been reached.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
FltError FltRecordReader::
|
||||
advance() {
|
||||
advance(bool ok_eof) {
|
||||
if (_state == S_eof) {
|
||||
assert(!flt_error_abort);
|
||||
return FE_end_of_file;
|
||||
@ -118,6 +118,9 @@ advance() {
|
||||
|
||||
if (_in.eof()) {
|
||||
_state = S_eof;
|
||||
if (ok_eof) {
|
||||
return FE_ok;
|
||||
}
|
||||
assert(!flt_error_abort);
|
||||
return FE_end_of_file;
|
||||
|
||||
@ -133,7 +136,10 @@ advance() {
|
||||
_opcode = (FltOpcode)dgi.get_be_int16();
|
||||
_record_length = dgi.get_be_uint16();
|
||||
|
||||
// cerr << "Reading " << _opcode << " of length " << _record_length << "\n";
|
||||
if (flt_cat.is_debug()) {
|
||||
flt_cat.debug()
|
||||
<< "Reading " << _opcode << " of length " << _record_length << "\n";
|
||||
}
|
||||
|
||||
// And now read the full record based on the length.
|
||||
int length = _record_length - header_size;
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
const Datagram &get_datagram();
|
||||
int get_record_length() const;
|
||||
|
||||
FltError advance();
|
||||
FltError advance(bool ok_eof = false);
|
||||
|
||||
bool eof() const;
|
||||
bool error() const;
|
||||
|
@ -76,7 +76,11 @@ update_datagram() {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
FltError FltRecordWriter::
|
||||
advance() {
|
||||
// cerr << "Writing " << _opcode << " of length " << _datagram.get_length() << "\n";
|
||||
if (flt_cat.is_debug()) {
|
||||
flt_cat.debug()
|
||||
<< "Writing " << _opcode << " of length "
|
||||
<< _datagram.get_length() << "\n";
|
||||
}
|
||||
|
||||
// Build a mini-datagram to write the header.
|
||||
static const int header_size = 4;
|
||||
|
Loading…
x
Reference in New Issue
Block a user