mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
Add softspace flag to StreamWriter - fixes print spaces in runtime env
This commit is contained in:
parent
f33e450823
commit
1f0b4332e3
@ -1434,8 +1434,9 @@ scan_element(CPPInstance *element, CPPStructType *struct_type,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (element->_file._source != CPPFile::S_local ||
|
if (struct_type == NULL &&
|
||||||
in_ignorefile(element->_file._filename_as_referenced)) {
|
(element->_file._source != CPPFile::S_local ||
|
||||||
|
in_ignorefile(element->_file._filename_as_referenced))) {
|
||||||
// The element is defined in some other package or in an
|
// The element is defined in some other package or in an
|
||||||
// ignorable file.
|
// ignorable file.
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -16,10 +16,13 @@
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: StreamWriter::Constructor
|
// Function: StreamWriter::Constructor
|
||||||
// Access: Public
|
// Access: Public
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE StreamWriter::
|
INLINE StreamWriter::
|
||||||
StreamWriter(ostream &out) :
|
StreamWriter(ostream &out) :
|
||||||
|
#ifdef HAVE_PYTHON
|
||||||
|
softspace(0),
|
||||||
|
#endif
|
||||||
_out(&out),
|
_out(&out),
|
||||||
_owns_stream(false)
|
_owns_stream(false)
|
||||||
{
|
{
|
||||||
@ -28,10 +31,13 @@ StreamWriter(ostream &out) :
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
// Function: StreamWriter::Constructor
|
// Function: StreamWriter::Constructor
|
||||||
// Access: Published
|
// Access: Published
|
||||||
// Description:
|
// Description:
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE StreamWriter::
|
INLINE StreamWriter::
|
||||||
StreamWriter(ostream *out, bool owns_stream) :
|
StreamWriter(ostream *out, bool owns_stream) :
|
||||||
|
#ifdef HAVE_PYTHON
|
||||||
|
softspace(0),
|
||||||
|
#endif
|
||||||
_out(out),
|
_out(out),
|
||||||
_owns_stream(owns_stream)
|
_owns_stream(owns_stream)
|
||||||
{
|
{
|
||||||
@ -45,6 +51,9 @@ StreamWriter(ostream *out, bool owns_stream) :
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
INLINE StreamWriter::
|
INLINE StreamWriter::
|
||||||
StreamWriter(const StreamWriter ©) :
|
StreamWriter(const StreamWriter ©) :
|
||||||
|
#ifdef HAVE_PYTHON
|
||||||
|
softspace(0),
|
||||||
|
#endif
|
||||||
_out(copy._out),
|
_out(copy._out),
|
||||||
_owns_stream(false)
|
_owns_stream(false)
|
||||||
{
|
{
|
||||||
|
@ -81,6 +81,12 @@ PUBLISHED:
|
|||||||
private:
|
private:
|
||||||
ostream *_out;
|
ostream *_out;
|
||||||
bool _owns_stream;
|
bool _owns_stream;
|
||||||
|
|
||||||
|
#ifdef HAVE_PYTHON
|
||||||
|
PUBLISHED:
|
||||||
|
// Python 2 needs this for printing to work correctly.
|
||||||
|
int softspace;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "streamWriter.I"
|
#include "streamWriter.I"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user