GenBlenderDNA: use common formatting.
parent
2e0db8cfd5
commit
06ca0e094b
|
@ -58,24 +58,16 @@ template_src = "BlenderScene.cpp.template"
|
||||||
# workaround for stackoverflowing when reading the linked list of scene objects
|
# workaround for stackoverflowing when reading the linked list of scene objects
|
||||||
# with the usual approach. See embedded notes for details.
|
# with the usual approach. See embedded notes for details.
|
||||||
Structure_Convert_Base_fullcode = """
|
Structure_Convert_Base_fullcode = """
|
||||||
template <> void Structure :: Convert<Base> (
|
template <> void Structure::Convert<Base>( Base& dest, const FileDatabase& db ) const {
|
||||||
Base& dest,
|
|
||||||
const FileDatabase& db
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
// note: as per https://github.com/assimp/assimp/issues/128,
|
// note: as per https://github.com/assimp/assimp/issues/128,
|
||||||
// reading the Object linked list recursively is prone to stack overflow.
|
// reading the Object linked list recursively is prone to stack overflow.
|
||||||
// This structure converter is therefore an hand-written exception that
|
// This structure converter is therefore an hand-written exception that
|
||||||
// does it iteratively.
|
// does it iteratively.
|
||||||
|
|
||||||
const int initial_pos = db.reader->GetCurrentPos();
|
const int initial_pos = db.reader->GetCurrentPos();
|
||||||
|
|
||||||
std::pair<Base*, int> todo = std::make_pair(&dest, initial_pos);
|
std::pair<Base*, int> todo = std::make_pair(&dest, initial_pos);
|
||||||
|
|
||||||
Base* saved_prev = NULL;
|
Base* saved_prev = NULL;
|
||||||
|
|
||||||
while(true) {
|
while(true) {
|
||||||
|
|
||||||
Base& cur_dest = *todo.first;
|
Base& cur_dest = *todo.first;
|
||||||
db.reader->SetCurrentPos(todo.second);
|
db.reader->SetCurrentPos(todo.second);
|
||||||
|
|
||||||
|
@ -303,8 +295,3 @@ def main():
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.exit(main())
|
sys.exit(main())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue